|
@@ -13,9 +13,6 @@ vim.keymap.set({'n', 'v'}, 'k', 'gk', opts)
|
|
|
-- leave insert mode with <ESC><ESC>
|
|
|
vim.keymap.set('t', '<ESC><ESC>', '<C-\\><C-N>', opts)
|
|
|
|
|
|
--- allow pressing enter to autocomplete
|
|
|
-vim.keymap.set('i', '<CR>', 'pumvisible() ? "\\<C-y>" : "\\<CR>"', { expr = true })
|
|
|
-
|
|
|
-- select pasted text
|
|
|
vim.keymap.set('n', 'gp', '`[v`]', opts)
|
|
|
|
|
@@ -78,15 +75,13 @@ vim.keymap.set('n', '<space>q', '<cmd>lua vim.diagnostic.setqflist({ severity =
|
|
|
|
|
|
function on_attach(client, bufnr)
|
|
|
local opts = { silent = true, buffer = bufnr }
|
|
|
- -- Enable completion triggered by <c-x><c-o>
|
|
|
- vim.bo.omnifunc = 'v:lua.MiniCompletion.completefunc_lsp'
|
|
|
|
|
|
-- LSP-specific mappings
|
|
|
vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
|
|
vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
|
|
vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
|
|
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
|
|
- vim.keymap.set('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
|
|
+ vim.keymap.set({'n', 'i'}, '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
|
|
vim.keymap.set('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
|
|
vim.keymap.set('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
|
|
vim.keymap.set('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|