From ddc29f99a4c6ed25d690bd39a97753aaa075fa73 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 27 Dec 2024 00:45:02 -0500 Subject: [PATCH] AutoYADM commit: 2024-12-27 00:45:02 --- .config/nvim/lua/config/keymaps.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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