diff --git a/lua/opdavies/options.lua b/lua/opdavies/options.lua index 4fee705..8745a71 100644 --- a/lua/opdavies/options.lua +++ b/lua/opdavies/options.lua @@ -101,9 +101,20 @@ local function set_key_mappings() vmap { "", ":m '>+1gv=gv", opts } vmap { "", ":m '<-2gv=gv", opts } - -- Move half a screen up or down and re-center. - nmap { "", "zz" } - nmap { "", "zz" } + -- Re-centre when navigating. + vim.keymap.set("n", "#", "#zz", opts) + vim.keymap.set("n", "%", "%zz", opts) + vim.keymap.set("n", "*", "*zz", opts) + vim.keymap.set("n", "", "zz", opts) + vim.keymap.set("n", "", "zz", opts) + vim.keymap.set("n", "", "zz", opts) + vim.keymap.set("n", "", "zz", opts) + vim.keymap.set("n", "G", "Gzz", opts) + vim.keymap.set("n", "N", "Nzz", opts) + vim.keymap.set("n", "gg", "ggzz", opts) + vim.keymap.set("n", "n", "Nzz", opts) + vim.keymap.set("n", "{", "{zz", opts) + vim.keymap.set("n", "}", "}zz", opts) end local function set_highlights()