Files
neovim/runtime/plugin/nvim/spellfile.lua
Justin M. Keyes 4d501c93bb refactor(spell): cleanup
- prefer `stdpath(data)/site/spell` instead of looking for random dirs in 'runtimepath'.
- drop unused functions `choose_directory`, `setup`, etc.
2025-10-26 01:28:37 +02:00

17 lines
496 B
Lua

vim.g.loaded_spellfile_plugin = true
--- Downloads missing .spl file.
---
--- @param args { bufnr: integer, match: string }
local function on_spellfile_missing(args)
local spellfile = require('nvim.spellfile')
spellfile.load_file(args.match)
end
vim.api.nvim_create_autocmd('SpellFileMissing', {
group = vim.api.nvim_create_augroup('nvim_spellfile', { clear = true }),
pattern = '*',
desc = 'Download missing spell files when setting spelllang',
callback = on_spellfile_missing,
})