From 56403ecb3fb6f16b625ec0bd37727324399f306a Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Oct 2024 20:30:46 +0200 Subject: checkpoint --- lua/config/map.lua | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lua/config/map.lua b/lua/config/map.lua index 1ce241d..30a96c8 100644 --- a/lua/config/map.lua +++ b/lua/config/map.lua @@ -67,16 +67,27 @@ map("n", " W", "write!", { noremap = true }) map("n", " e", "edit", { noremap = true }) map("n", ",s", function() vim.cmd.source() - print("sourced.") + print("Sourced.") end, { noremap = true }) -- Lazy map("n", " P", "Lazy", { noremap = true }) +local function verbose_toggle(value, name) + local toggle = value == false + if toggle == true then + print("Enabled " .. name .. ".") + else + print("Disabled " .. name .. ".") + end + return toggle +end + -- spelling -map("n", " ts", "setlocal spell!", { noremap = true, desc = "Toggle spelling" }) +map("n", " ts", function() + vim.o.spell = verbose_toggle(vim.o.spell, "spelling") +end, { noremap = true, desc = "Toggle spelling" }) map("n", "g", "z=1", { noremap = true }) - map("n", " td", function() - vim.diagnostic.enable(vim.diagnostic.is_enabled() == false) + vim.diagnostic.enable(verbose_toggle(vim.diagnostic.is_enabled(), "diagnostics")) end, { desc = "Toggle diagnostics" }) -- cgit v1.2.3