Closed sajadspeed closed 4 months ago
Not with this plugin, but sounds like an achievable task using the CSpell cli, something like:
You could wrap everything in a user command or a custom mapping:
vim.api.nvim_create_user_command("AddAllWordsToDictionary", function()
local cmd = "node_modules/.bin/cspell --words-only --no-summary --no-color --no-progress "
.. vim.fn.expand("%")
.. " | sort -u > /tmp/words.txt"
vim.fn.system(cmd)
vim.cmd("edit") -- trigger a refresh in the current buffer so none-ls can reanalyze the contents
end, { nargs = 0 })
You would have to customize the path to the CSpell cli and the target directory
OK I got it... Thank you very much.
Can I do this?