diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-04 08:44:50 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-06 16:43:16 +0200 |
| commit | 34510ebc63ff65d51f6979a86169bfc52de6180c (patch) | |
| tree | 36c8b73c99a3c566ccee888818c60204398991fd /plugin/50-spell.lua | |
| download | nvim-config-34510ebc63ff65d51f6979a86169bfc52de6180c.tar.gz nvim-config-34510ebc63ff65d51f6979a86169bfc52de6180c.zip | |
feat: initial setup
- `dotfiles` (this project's CLI)
- foot configuration
- tmux configuration
- bash configuration
- nvim (as a git submodule) + configuration
- ranger configuration
- fzf configuration
- KDE global shortcuts
- Other miscellaneous dependencies
Diffstat (limited to 'plugin/50-spell.lua')
| -rw-r--r-- | plugin/50-spell.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/plugin/50-spell.lua b/plugin/50-spell.lua new file mode 100644 index 0000000..56d4c5f --- /dev/null +++ b/plugin/50-spell.lua @@ -0,0 +1,34 @@ +-- +-- Spell check plugin +-- + +local function toggle_spell() + vim.o.spell = not vim.o.spell +end + +local function set_spell_en() + vim.opt.spelllang = { "en_us" } +end + +local function set_spell_fr() + vim.opt.spelllang = { "fr" } +end + +local function set_spell_en_fr() + vim.opt.spelllang = { "en_us", "fr" } +end + +vim.opt.spelllang = "en_us" -- Initial spell language +vim.opt.spellfile = { -- Spellfiles for zg, zw, z=, etc + "/home/tvanbesi/.config/nvim/spell/en.utf-8.add", + "/home/tvanbesi/.config/nvim/spell/fr.utf-8.add", +} + +vim.api.nvim_create_user_command("SpellToggle", toggle_spell, { desc = "Toggle spell checking" }) +vim.api.nvim_create_user_command("SpellSetEn", set_spell_en, { desc = "Set spell language to English" }) +vim.api.nvim_create_user_command("SpellSetFr", set_spell_fr, { desc = "Set spell language to French" }) +vim.api.nvim_create_user_command( + "SpellSetEnFr", + set_spell_en_fr, + { desc = "Set spell languages to English and French" } +) |
