Public Access
spell stuf
This commit is contained in:
+20
-2
@@ -26,10 +26,14 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
|
|
||||||
-- If current buffer is in skip list, do nothing
|
-- If current buffer is in skip list, do nothing
|
||||||
for _, bt in ipairs(skip_buftypes) do
|
for _, bt in ipairs(skip_buftypes) do
|
||||||
if buftype == bt then return end
|
if buftype == bt then
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for _, ft in ipairs(skip_filetypes) do
|
for _, ft in ipairs(skip_filetypes) do
|
||||||
if filetype == ft then return end
|
if filetype == ft then
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Else, enable spellcheck
|
-- Else, enable spellcheck
|
||||||
@@ -38,6 +42,20 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- 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" })
|
||||||
|
|
||||||
-- Clear search highlights when entering insert mode.
|
-- Clear search highlights when entering insert mode.
|
||||||
vim.api.nvim_create_autocmd("InsertEnter", {
|
vim.api.nvim_create_autocmd("InsertEnter", {
|
||||||
callback = function()
|
callback = function()
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -6,3 +6,16 @@ npm
|
|||||||
InDesign
|
InDesign
|
||||||
Vue
|
Vue
|
||||||
monorepo
|
monorepo
|
||||||
|
config
|
||||||
|
AeroSpace
|
||||||
|
macOS
|
||||||
|
github
|
||||||
|
toml
|
||||||
|
dvorak
|
||||||
|
colemak
|
||||||
|
nvim
|
||||||
|
yazi
|
||||||
|
Gruvbox
|
||||||
|
fzf
|
||||||
|
eza
|
||||||
|
bitwarden
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user