diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 307f4e1a..00eadb69 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -21,18 +21,19 @@ vim.keymap.set({ "i", "n" }, "", "") -- vim.notify("test") -- end) -map({ "n", "v" }, "\\", function() +map({ "n", "x" }, "\\", function() LazyVim.format({ force = true }) end, { desc = "Format" }) -map({ "n", "i" }, "", function() - vim.cmd("normal! zz") -end, { remap = false, noremap = true, desc = "Center Screen (Insert Mode)" }) +map({ "n", "i" }, "", function() + -- the `a` is necessary to return the cursor to the same + -- position it was before + vim.api.nvim_input("zza") +end, { remap = false, noremap = true, desc = "Center Screen" }) map("n", "", "stop", { desc = "Suspend" }) map({ "n", "i", "x", "o" }, "", "", { noremap = true, desc = "Escape" }) -map({ "n", "i", "x", "o" }, "", "", { noremap = true, desc = "Escape" }) -- Better Scroll