feat(nvim): plugins, cleanup, ign lazy-lock.json

This commit is contained in:
2024-09-22 04:26:02 +03:00
parent 6f1e1a0416
commit 9b6e39b4af
7 changed files with 54 additions and 98 deletions

View File

@@ -8,13 +8,37 @@ return {
'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
-- Adds other completion capabilities.
-- nvim-cmp does not ship with all sources by default. They are split
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'onsails/lspkind.nvim',
{
'zbirenbaum/copilot-cmp',
dependencies = {
'zbirenbaum/copilot.lua',
},
config = function()
require('copilot_cmp').setup()
end,
},
},
config = function()
-- nvim-cmp setup
local cmp = require 'cmp'
local luasnip = require 'luasnip'
local lspkind = require 'lspkind'
luasnip.config.setup {}
cmp.setup {
formatting = {
format = lspkind.cmp_format {
mode = 'symbol',
max_width = 50,
symbol_map = { Copilot = '' },
},
},
view = {
entries = 'native',
},
@@ -26,6 +50,9 @@ return {
mapping = cmp.mapping.preset.insert {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available.
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
@@ -51,8 +78,12 @@ return {
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
-- Copilot Source
{ name = 'copilot', group_index = 2 },
-- Other Sources
{ name = 'nvim_lsp', group_index = 2 },
{ name = 'path', group_index = 2 },
{ name = 'luasnip', group_index = 2 },
},
}
end,