|
@ -3,12 +3,27 @@ |
|
|
local lsp = require('lsp-zero') |
|
|
local lsp = require('lsp-zero') |
|
|
lsp.preset('recommended') |
|
|
lsp.preset('recommended') |
|
|
|
|
|
|
|
|
|
|
|
lsp.nvim_workspace() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local cmp = require('cmp') |
|
|
|
|
|
local cmp_select = { behavior = cmp.SelectBehavior.Select } |
|
|
|
|
|
local cmp_mappings = lsp.defaults.cmp_mappings({ |
|
|
|
|
|
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), |
|
|
|
|
|
['<C-n>'] = cmp.mapping.select_next_item(cmp_select), |
|
|
|
|
|
['<C-s>'] = cmp.mapping.confirm({ select = true }), |
|
|
|
|
|
["<C-Space>"] = cmp.mapping.complete(), |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
cmp_mappings['<Tab>'] = nil |
|
|
|
|
|
cmp_mappings['<S-Tab>'] = nil |
|
|
|
|
|
|
|
|
lsp.setup_nvim_cmp({ |
|
|
lsp.setup_nvim_cmp({ |
|
|
|
|
|
mapping = cmp_mappings, |
|
|
experimental = { |
|
|
experimental = { |
|
|
ghost_text = true, |
|
|
ghost_text = true, |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
-- (Optional) Configure lua language server for neovim |
|
|
-- (Optional) Configure lua language server for neovim |
|
|
lsp.nvim_workspace() |
|
|
lsp.nvim_workspace() |
|
|
|
|
|
|
|
|