change jk mapping for visual mode only

This commit is contained in:
Lucario387 2022-09-08 19:55:15 +09:00 committed by Sidhanth Rathod
parent d617bb5a75
commit 5db641289d

View file

@ -72,13 +72,13 @@ M.general = {
t = { ["<C-x>"] = { termcodes "<C-\\><C-N>", "escape terminal mode" } }, t = { ["<C-x>"] = { termcodes "<C-\\><C-N>", "escape terminal mode" } },
v = { v = {
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, ["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, ["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
}, },
x = { x = {
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
-- Don't copy the replaced text after pasting in visual mode -- Don't copy the replaced text after pasting in visual mode
-- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste -- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste
["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', opts = { silent = true } }, ["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', opts = { silent = true } },