nvim: fix tab completion
This commit is contained in:
parent
dcdac91726
commit
785aae79c8
@ -526,6 +526,11 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
local complopts = {silent = true, noremap = true, expr = true, replace_keycodes = false}
|
||||
vim.keymap.set("i", "<TAB>", [[pumvisible() ? "\<c-n>" : "\<TAB>"]], complopts)
|
||||
vim.keymap.set("i", "<S-TAB>", [[pumvisible() ? "\<c-p>" : "\<C-h>"]], complopts)
|
||||
vim.keymap.set("i", "<cr>", [[pumvisible() ? "\<c-y>" : "\<cr>"]], complopts)
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
|
Loading…
Reference in New Issue
Block a user