From 35fd372acade33a609b87e39862fb77cba363296 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 8 Aug 2024 20:06:10 +0200 Subject: nvim: Prefer silent mappings --- .config/nvim/init.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to '.config') diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d4fbb0c..d461371 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -55,7 +55,7 @@ end vim.keymap.set('x', 'a', 'gg0oG$', { desc = 'Select the [A]ll of the buffer' }) vim.keymap.set('o', 'a', ':normal! ggVG', - { desc = 'Text object of [A]ll of the buffer' }) + { desc = 'Text object of [A]ll of the buffer', silent = true }) vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) vim.keymap.set('n', '', '', @@ -69,21 +69,22 @@ vim.keymap.set('n', 'h', function() vim.cmd 'split' end, vim.keymap.set('n', 'v', function() vim.cmd 'vsplit' end, { desc = 'Open a [V]ertical split' }) vim.keymap.set('n', 'M', ':w! | make', - { desc = 'Run the configured compiler' }) + { desc = 'Run the configured compiler', silent = true }) vim.keymap.set('x', '', ":m '>+1gv=gv", - { desc = 'Move a selection down a line' }) + { desc = 'Move a selection down a line', silent = true }) vim.keymap.set('x', '', ":m '<-2gv=gv", - { desc = 'Move a selection up a line' }) + { desc = 'Move a selection up a line', silent = true }) vim.keymap.set({ 'n', 'o', 'x' }, '€', '$', { desc = 'Go to end of the line' }) -vim.keymap.set('n', '', 'nohlsearch', - { desc = 'Disable highlighting of currently highlighted search matches' }) +vim.keymap.set('n', '', ':nohlsearch', + { desc = 'Disable highlighting of currently highlighted search matches', + silent = true }) vim.keymap.set('n', 't', function() vim.cmd.normal('"zx"zph') end, { desc = '[T]ranspose the current and next characters' }) vim.keymap.set('n', 'T', function() vim.cmd.normal('"zX"zp') end, { desc = '[T]ranspose the current and previous characters' }) vim.keymap.set('n', '-', ':Ex', - { desc = 'Open Netrw' }) + { desc = 'Open Netrw', silent = true }) vim.keymap.set('n', 'gJ', function() vim.cmd [[ let save = winsaveview() -- cgit v1.2.3