added spellcheck stuff

This commit is contained in:
2025-09-19 13:19:46 +02:00
parent 9fa5fd2099
commit aad2c79943
7 changed files with 44 additions and 0 deletions
+22
View File
@@ -11,6 +11,13 @@ vim.o.swapfile = false
vim.g.mapleader = " "
vim.o.winborder = "single"
-- Make 'j' and 'k' navigate visual lines (not logical lines)
vim.keymap.set("n", "j", "gj", { noremap = true, silent = true })
vim.keymap.set("n", "k", "gk", { noremap = true, silent = true })
vim.keymap.set("v", "j", "gj", { noremap = true, silent = true })
vim.keymap.set("v", "k", "gk", { noremap = true, silent = true })
-- VIM OPTIONS END --
-- PLUGINS START --
@@ -112,3 +119,18 @@ vim.diagnostic.config({
},
severity_sort = true,
})
-- Toggle spell check with <leader>sc
vim.keymap.set("n", "<leader>sc", function()
vim.wo.spell = not vim.wo.spell
print("Spell checking: " .. (vim.wo.spell and "ON" or "OFF"))
end, { desc = "Toggle spell checking" })
-- Switch between English and German with <leader>sl
vim.keymap.set("n", "<leader>sl", function()
local current = vim.opt.spelllang:get()[1] or ""
local new_lang = current == "en" and "de" or "en"
vim.opt.spelllang = new_lang
print("Spell language: " .. new_lang)
end, { desc = "Switch spell language" })