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:
Oliver Davies 2022-09-01 22:01:42 +01:00
parent 8466a81183
commit 7e935b12c0

View file

@ -100,6 +100,10 @@ local function set_key_mappings()
nmap { "<M-k>", ":m .-2<CR>==", opts }
vmap { "<M-j>", ":m '>+1<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
local function set_highlights()