From 6918b5cffe1e4707501b63f69f8458c8eccbeed4 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 12 Jun 2024 16:43:54 +0200 Subject: nvim: Only remap visual-line and -block modes on Linux --- .config/nvim/init.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ec708f0..1c2d070 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -62,16 +62,12 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', 'V', - { desc = 'Enter visual-line mode' }) vim.keymap.set('n', 'h', function() vim.cmd 'split' end, { desc = 'Open a [H]orizontal split' }) 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' }) -vim.keymap.set('n', 'V', '', - { desc = 'Enter visual-block mode' }) vim.keymap.set('x', '', ":m '>+1gv=gv", { desc = 'Move a selection down a line' }) vim.keymap.set('x', '', ":m '<-2gv=gv", @@ -106,6 +102,13 @@ vim.keymap.set('n', 'K', function() mk_scratch_buffer() end, { desc = 'Open the scratch buffer in a horizontal split' }) +if vim.loop.os_uname().sysname ~= 'Darwin' then + vim.keymap.set('n', '', 'V', + { desc = 'Enter visual-line mode' }) + vim.keymap.set('n', 'V', '', + { desc = 'Enter visual-block mode' }) +end + -- Don’t move the cursor with various commands vim.keymap.set('n', 'J', 'mzJ`z') vim.keymap.set('n', '', 'zz') -- cgit v1.2.3