20

When setting spelllang for the first time, I was prompted to auto-download the appropriate spell file. Somehow I aborted the process due to unclear instructions, when it asked me, into which directory it should go.

Now when I :set spelllang it just says Warning: Cannot find word list… but does not offer to download it.

How can I restart the process?

Christopher Bottoms
  • 3,772
  • 6
  • 22
  • 33
oarfish
  • 1,277
  • 3
  • 10
  • 18

2 Answers2

16

The help states this:

The plugin has a default place where to look for spell files, on the Vim ftp
server.  If you want to use another location or another protocol, set the
g:spellfile_URL variable to the directory that holds the spell files.  The
netrw plugin is used for getting the file, look there for the specific
syntax of the URL.  Example: 
    let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
You may need to escape special characters.

The plugin will only ask about downloading a language once.  If you want to
try again anyway restart Vim, or set g:spellfile_URL to another value (e.g.,
prepend a space).

Please, note that the default choice at each interaction is negative.

For instance, the following happens if you enter :set spelllang=fr and the French language is not yet installed).

Cannot find spell file for "fr" in utf-8
Do you want me to try downloading it?
(Y)es, [N]o:

Hit Y to download the spell language

Downloading fr.utf-8.spl...
:!curl 'http://ftp.vim.org/pub/vim/runtime/spell/fr.utf-8.spl' -o '/tmp/vu98ZTF/2.spl'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
"/tmp/vu98ZTF/2.spl" [noeol] 1122L, 571626C
In which directory do you want to write the file:
1. /home/youruser/.vim/spell
[C]ancel, (1):

Hit 1 (hitting Enter choses the default Cancel action)

This will improve making suggestions for spelling mistakes,
but it uses quite a bit of memory.
[N]o, (Y)es:

Hit Y (or N/Enter, it's your choice)

Downloading fr.utf-8.sug...
:!curl 'http://ftp.vim.org/pub/vim/runtime/spell/fr.utf-8.sug' -o '/tmp/vu9
8ZTF/2.sug'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--    26 2269k   26  596k    0     0   651k      0  0:00:03 --:--:--  0:00:03  6 64 2269k   64 1469k    0     0   767k      0  0:00:02  0:00:01  0:00:01  7"~/.vim/spell/fr.utf-8.sug" [New] 15706L, 2324315C written
Press ENTER or type command to continue
Enlico
  • 2,194
  • 15
  • 31
Christian Brabandt
  • 25,820
  • 1
  • 52
  • 77
  • The documentation did not help me, because when I follow the instructions for the case of not using a plugin, namely adding the autocommand autocmd SpellFileMissing * call Download_spell_file(expand('<amatch>')) and then do :set spell it comes up with an error, not knowing the function Download_spell_file. Am I the only one? – Zelphir Kaltstahl Feb 05 '17 at 13:21
  • @Zelphir I don't understand. Why would you not have the autocommand active? – Christian Brabandt Feb 05 '17 at 15:04
  • @ChristianBrabandt, maybe doing more than copying the documentation would make this a better answer. – Enlico May 12 '19 at 06:47
  • @EnricoMariaDeAngelis or maybe not, because the documentation already clearly answers the question. – Christian Brabandt May 13 '19 at 05:59
  • @ChristianBrabandt, then I suppose I'm here due to some malfunctioning neuron of mines. – Enlico May 13 '19 at 06:02
  • @EnricoMariaDeAngelis perhaps you should mention what exactly you are missing instead... – Christian Brabandt May 13 '19 at 06:06
  • @ChristianBrabandt, at the moment I read the help I could not have to issue solved (hence my comment). Eventually I solved after googling a bit; now I regret not having taking notes of what enlightened me. – Enlico May 18 '19 at 10:29
  • @EnricoMariaDeAngelis well if something is unclear, than I suggest the help document to be improved. Too bad you don't know what problem you had and how you solved it. – Christian Brabandt May 18 '19 at 10:30
  • Ok, @ChristianBrabandt, I've figured it out using another language. It was my mistake: Vim's first question is Cannot find spell file for "fr" in utf-8. Do you want me to try downloading it? (Y)es, [N]o:, to which I naturally answered with Y; then Vim asked In which directory do you want to write the file: 1. /home/enrico/.vim/spell [C]ancel, (1):, to which I answered by hitting Enter, since I didn't notice that the default action is to cancel; then, since the plugin didn't ask anymore, I just thought that I was simply using the wrong command. – Enlico May 18 '19 at 10:46
  • Eventually I must have hit 1 instead of Enter, which makes everything work. And I was like "Ok, what did I do wrong the first time?" – Enlico May 18 '19 at 10:49
  • Maybe you could add (or I can do it on your behalf, if you agree) the successive outputs of the command? – Enlico May 18 '19 at 10:50
5

I understand the question differently: when answering "No" to the "Do you want me to try downloading it [the spell file]?" question, the option to download does not present itself again.

I got around it by deleting ~/.viminfo—surely this isn't the best way, but it does answer the question (to my interpretation, at least).

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65
Pedro Maciel
  • 51
  • 1
  • 1