mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Don't use gj and gk in V-LINE and V-BLOCK modes
In regular visual mode gk and gj make sense as the default, but when doing block or line selects regular j and k are better defaults.
This commit is contained in:
parent
45af7e1fed
commit
f0ca626c3f
1 changed files with 8 additions and 4 deletions
|
|
@ -5,10 +5,14 @@
|
|||
local map = LazyVim.safe_keymap_set
|
||||
|
||||
-- better up/down
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map("n", "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map("n", "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map("n", "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map("n", "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map("x", "j", "mode() ==# 'v' && v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map("x", "<Down>", "mode() ==# 'v' && v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map("x", "k", "mode() ==# 'v' && v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map("x", "<Up>", "mode() ==# 'v' && v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
|
||||
-- Move to window using the <ctrl> hjkl keys
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue