From fcaaba9e8d928447b4b33fac2eb88ac3e4f14d26 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 1 Mar 2024 10:33:36 +0100 Subject: [PATCH] nvim: Improve auto spellfix mapping If the cursor was on the very first letter of a word it would fix the misspelled word instead - now it should stay and fix the current word under cursor instead. --- nvim/.config/nvim/lua/core/init.lua | 1 + nvim/.config/nvim/lua/core/mappings.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lua/core/init.lua b/nvim/.config/nvim/lua/core/init.lua index f13b09e..addb99f 100644 --- a/nvim/.config/nvim/lua/core/init.lua +++ b/nvim/.config/nvim/lua/core/init.lua @@ -9,3 +9,4 @@ for _, source in ipairs({ vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault) end end + diff --git a/nvim/.config/nvim/lua/core/mappings.lua b/nvim/.config/nvim/lua/core/mappings.lua index d6e2442..2e8a6dc 100644 --- a/nvim/.config/nvim/lua/core/mappings.lua +++ b/nvim/.config/nvim/lua/core/mappings.lua @@ -132,5 +132,5 @@ map("n", "ZE", ":setlocal spell! spelllang=en_us", { desc = "To map("n", "ZB", ":setlocal spell! spelllang=en_gb", { desc = "Toggle EN_GB spellcheck" }) map("n", "ZD", ":setlocal spell! spelllang=de_de", { desc = "Toggle DE_DE spellcheck" }) -- undo last spelling mistake from insert and normal mode -map("i", "", "u[s1z=`]au") -map("n", "z", "ms[s1z=`s", { desc = "Fix last spell error" }) +map("i", "", "ue[s1z=`]au") +map("n", "z", "mse[s1z=`s", { desc = "Fix last spell error" })