feat(nvim): improve C-d and C-u mappings
Move up or down by half a page but also automatically re-center the screen so that the cursor is always within a consistent positiion.
This commit is contained in:
parent
8466a81183
commit
7e935b12c0
|
@ -100,6 +100,10 @@ local function set_key_mappings()
|
||||||
nmap { "<M-k>", ":m .-2<CR>==", opts }
|
nmap { "<M-k>", ":m .-2<CR>==", opts }
|
||||||
vmap { "<M-j>", ":m '>+1<CR>gv=gv", opts }
|
vmap { "<M-j>", ":m '>+1<CR>gv=gv", opts }
|
||||||
vmap { "<M-k>", ":m '<-2<CR>gv=gv", opts }
|
vmap { "<M-k>", ":m '<-2<CR>gv=gv", opts }
|
||||||
|
|
||||||
|
-- Move half a screen up or down and re-center.
|
||||||
|
nmap { "<C-d>", "<C-d>zz" }
|
||||||
|
nmap { "<C-u>", "<C-u>zz" }
|
||||||
end
|
end
|
||||||
|
|
||||||
local function set_highlights()
|
local function set_highlights()
|
||||||
|
|
Loading…
Reference in a new issue