@@ 6,6 6,7 @@ vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = false
vim.opt.signcolumn = 'number'
+vim.opt.completeopt = 'menuone,noselect'
vim.keymap.set('n', '<leader>ff', '<cmd>Telescope find_files<cr>')
vim.keymap.set('n', '<leader>fg', '<cmd>Telescope live_grep<cr>')
@@ 40,6 40,8 @@ local on_attach = function(client, bufnr)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
+
+ vim.keymap.set('i', '<C-s>', vim.lsp.buf.signature_help, bufopts)
end
local lsp_flags = {
@@ 96,6 98,8 @@ lsp_installer.setup{
automatic_installation = true,
}
+-- Make diagnostics a little bit less aggressive. Use \ee to see the error
+-- under the cursor, or \ew to open a quickfix window with all of them.
vim.diagnostic.config({
virtual_text = false,
update_in_insert = false,
@@ 104,3 108,10 @@ vim.diagnostic.config({
border = 'single',
},
})
+
+-- Keep signature help open while still typing.
+vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
+ vim.lsp.handlers.signature_help, {
+ close_events = {"CursorMoved", "BufHidden"},
+ }
+)