summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-06 20:30:46 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-06 20:30:46 +0200
commit56403ecb3fb6f16b625ec0bd37727324399f306a (patch)
tree5f1acaf9fc1a27d953f004848e4e697d589be5aa
parente8315399fb7a337ac496c776048a38599716bdb9 (diff)
checkpoint
-rw-r--r--lua/config/map.lua19
1 files 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", "<cmd>write!<cr>", { noremap = true })
map("n", " e", "<cmd>edit<cr>", { noremap = true })
map("n", ",s", function()
vim.cmd.source()
- print("sourced.")
+ print("Sourced.")
end, { noremap = true })
-- Lazy
map("n", " P", "<cmd>Lazy<cr>", { 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", "<cmd>setlocal spell!<cr>", { 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", "<C-s>g", "z=1<cr><cr>", { 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" })