psliwka / vim-dirtytalk

spellcheck dictionary for programmers 📖
MIT License
136 stars 5 forks source link

Prompts `No spell file downloaded for "programming" in utf-8` each startup #25

Closed ok-nick closed 7 months ago

ok-nick commented 1 year ago

I'm using Neovim and each startup I get the prompt:

:!

No spell file for "programming" in utf-8
Download it?
(Y)es, [N]o:

Even after selecting no, vim-dirtytalk works perfectly. I can confirm the spell file is being downloaded to the correct path.

Here is my config, I'm using lazy.nvim:

return {
    "psliwka/vim-dirtytalk",
    build = function()
        vim.cmd("DirtytalkUpdate")
    end,
    init = function()
        vim.opt.spelllang:append("programming")
    end,
}
dsully commented 1 year ago

I'm seeing the same thing, also with lazy.nvim, with basically the same config as above.

tapayne88 commented 1 year ago

I found something similar with largely the same config after converting from packer.nvim to lazy.nvim. My error was the following when running :setlocal spell

Warning: Cannot find word list "programming.utf-8.spl" or "programming.ascii.spl"

I think the issue is that lazy.nvim doesn't add "usual" paths to the neovim's runtimepath. It's kind of explained in the docs under Startup Sequence.

I was able to resolve it by manually add the site location to the runtimepath - this is where vim-dirtytalk installs the lang file (site/spell/programming-utf-8.spl).

Now my config looks like this

return {
  'psliwka/vim-dirtytalk',
  build = ':DirtytalkUpdate',
  config = function()
    vim.opt.spelllang = { 'en', 'programming' }
    vim.opt.rtp:append(vim.fn.stdpath 'data' .. '/site')  -- Line of interest
  end,
}

Hope this helps!

psliwka commented 7 months ago

I finally migrated to lazy.nvim and thus had a chance to test it, but I can't reproduce the issue above. I get a clean install without errors, even after manually purging all site files.

I'm going to assume that whatever the problem was, it's either fixed in the current lazy.nvim and/or neovim itself (I run v0.9.5). Please let me know if I'm wrong though! :pray: