feat: Basic working config

- Added copilot
- Disabled nvim-navic (errors out when copilot-cmp is enabled)
- Added clangd
- Added packages for nvim-dap
This commit is contained in:
Jiří Štefka 2024-03-06 18:55:22 +01:00
parent e2cff543d6
commit 5a85ef99ff
Signed by: jiriks74
GPG key ID: 1D5E30D3DB2264DE
8 changed files with 61 additions and 6 deletions

View file

@ -63,7 +63,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
local client = vim.lsp.get_client_by_id(ev.data.client_id)
-- Attach plugins
require('nvim-navic').attach(client, bufnr)
-- require('nvim-navic').attach(client, bufnr)
vim.cmd.setlocal('signcolumn=yes')
vim.bo[bufnr].bufhidden = 'hide'

View file

@ -67,7 +67,7 @@ cmp.setup {
complete_with_source('path')
end
end, { 'i', 'c', 's' }),
['<C-n>'] = cmp.mapping(function(fallback)
['<C-j>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- expand_or_jumpable(): Jump outside the snippet region
@ -80,7 +80,7 @@ cmp.setup {
fallback()
end
end, { 'i', 'c', 's' }),
['<C-p>'] = cmp.mapping(function(fallback)
['<C-k>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
@ -103,6 +103,7 @@ cmp.setup {
},
sources = cmp.config.sources {
-- The insertion order influences the priority of the sources
{ name = "copilot", group_index = 2 },
{ name = 'nvim_lsp', keyword_length = 3 },
{ name = 'nvim_lsp_signature_help', keyword_length = 3 },
{ name = 'buffer' },

15
nvim/plugin/copilot.lua Normal file
View file

@ -0,0 +1,15 @@
if vim.g.did_load_copilot_plugin then
return
end
vim.g.did_load_copilot_plugin = true
-- local configs = require('copilot')
-- many plugins annoyingly require a call to a 'setup' function to be loaded,
-- even with default configs
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})

View file

@ -3,8 +3,8 @@ if vim.g.did_load_lualine_plugin then
end
vim.g.did_load_lualine_plugin = true
local navic = require('nvim-navic')
navic.setup {}
-- local navic = require('nvim-navic')
-- avic.setup {}
---Indicators for special modes,
---@return string status
@ -32,7 +32,7 @@ require('lualine').setup {
sections = {
lualine_c = {
-- nvim-navic
{ navic.get_location, cond = navic.is_available },
-- { navic.get_location, cond = navic.is_available },
},
lualine_z = {
-- (see above)

View file

@ -6,5 +6,6 @@ vim.g.did_load_plugins_plugin = true
-- many plugins annoyingly require a call to a 'setup' function to be loaded,
-- even with default configs
require("copilot_cmp").setup()
require('nvim-surround').setup()
require('which-key').setup()