From d26fa59d72588d526f427495ea98bb0e3b8f2b56 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Mon, 10 Jul 2023 10:30:17 +0200 Subject: [PATCH] shorten keybind expressions --- vimrc.lua | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/vimrc.lua b/vimrc.lua index 6527525..7ee0eb2 100644 --- a/vimrc.lua +++ b/vimrc.lua @@ -107,26 +107,18 @@ vim.api.nvim_create_autocmd('LspAttach', { end }) -vim.diagnostic.config({ - virtual_text = false, -- Turn off inline diagnostics -}) +vim.diagnostic.config({ virtual_text = false}) -- Turn off inline diagnostics + -- Show all diagnostics on current line in floating window -vim.api.nvim_set_keymap( - 'n', 'd', ':lua vim.diagnostic.open_float()', - { noremap = true, silent = true } -) +vim.api.nvim_set_keymap( 'n', 'd', ':lua vim.diagnostic.open_float()', opts) + -- Go to next diagnostic (if there are multiple on the same line, only shows -- one at a time in the floating window) -vim.api.nvim_set_keymap( - 'n', 'n', ':lua vim.diagnostic.goto_next()', - { noremap = true, silent = true } -) +vim.api.nvim_set_keymap( 'n', 'n', ':lua vim.diagnostic.goto_next()', opts) + -- Go to prev diagnostic (if there are multiple on the same line, only shows -- one at a time in the floating window) -vim.api.nvim_set_keymap( - 'n', 'p', ':lua vim.diagnostic.goto_prev()', - { noremap = true, silent = true } -) +vim.api.nvim_set_keymap( 'n', 'p', ':lua vim.diagnostic.goto_prev()', opts) -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches