Compare commits

...

2 Commits

Author SHA1 Message Date
c990f0054f Update laptop nvim conf 2024-02-05 15:20:17 -06:00
fb8b00a355 Update laptop nvim conf 2024-02-05 15:15:35 -06:00
3 changed files with 17 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ local plugins = {
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'L3MON4D3/LuaSnip',
'rust-lang/rust.vim',

View File

@@ -10,11 +10,24 @@ for _, lsp in ipairs(servers) do
}
end
local luasnip = require 'luasnip'
local cmp = require 'cmp'
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end
},
preselect = cmp.PreselectMode.None,
mapping = cmp.mapping.preset.insert({
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@@ -32,6 +45,7 @@ cmp.setup {
}),
sources = {
{ name = 'nvim_lsp' },
{ name = 'path' }
{ name = 'luasnip' },
{ name = 'path' },
},
}

View File

@@ -31,7 +31,7 @@ vim.opt.wrapscan=true
vim.opt.report=0
vim.opt.list=true
vim.opt.completeopt=menuone,noselect,noinsert
vim.opt.completeopt=menuone,noselect
vim.g['loaded_perl_provider']=0