1

I installed Vim 8.1.1 on Windows 10.

My _vimrc in C:\Users\Maggyero has the following lines:

set spell
set spelllang=en,fr
set spellsuggest=5

When I open Vim, I get the following message:

Alerte : Liste de mots "fr.utf-8.spl" ou "fr.ascii.spl" introuvable

After clicking on "Ok", I type:

:set spell

and I get the following message:

Cannot find spell file for "fr" in utf-8 Do you want me to try downloading it?

After clicking on "Yes", I get the following message:

Downloading fr.utf-8.spl...
**error** (netrw) Illegal PORT command.^M
**warning** (netrw) file <C:\Users\MAGGYERO\AppData\Local\Temp\VIA45B2.spl> not readable
Could not find it, trying fr.ascii.spl...
**error** (netrw) Illegal PORT command.^M
**warning** (netrw) file <C:\Users\MAGGYERO\AppData\Local\Temp\VIA45B2.spl> not readable
Sorry, downloading failed
Alerte : Liste de mots "fr.utf-8.spl" ou "fr.ascii.spl" introuvable

  • 1
    Please read the extensive help for netrw. I would suggesting enabling passive mode (See :h netrw-ftp) – Christian Brabandt Aug 22 '18 at 6:17
  • Note that you can also download the files manually in ~/.vim/spell with wget http://ftp.vim.org/vim/runtime/spell/fr.utf-8.spl and wget http://ftp.vim.org/vim/runtime/spell/fr.utf-8.sug . More information (in French) can be found here – statox Aug 22 '18 at 7:51
  • @ChristianBrabandt: I typed :let g:netrw_ftp_cmd= "ftp -p" to switch the ftp command to passive mode, like suggested in the help, before typing :set spell. Now the errors are gone but the warnings are still there, so the downloading still fails. Why do the files are not readable? I even tried executing Vim in administrator mode, without luck. – Maggyero Aug 22 '18 at 10:56
  • as suggested on the Vim issue, could be a firewall problem, it looks like netrw is not able to connect to the given server. You might be able to further debug this issue by following the help at :h netrw-debug – Christian Brabandt Aug 22 '18 at 11:59
  • @ChristianBrabandt: It is not a Windows firewall issue as even when deactivated the downloading fails. – Maggyero Aug 22 '18 at 13:43
1

It seems that netrw invokes wget or fetch (via cmd, not powershell which aliases wget for the built-in Invoke-WebRequest command) for retrieving the spell file:

C:\WINDOWS\system32\cmd.exe /c (wget ^"http://ftp.vim.org/pub/vim/runtime/spell/fr.utf-8.spl^" -q -O ^"C:\Users\MAGGYERO\AppData\Local\Temp\VIA77E3.spl^")
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc

and the suggestion file:

C:\Windows\system32\cmd.exe /c (wget ^"http://ftp.vim.org/pub/vim/runtime/spell/fr.utf-8.sug^" -q -O ^"C:\Users\MAGGYERO\AppData\Local\Temp\VIA126E.sug^")
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc

If wget or fetch is not in the PATH environment variable (which was my case), netrw invokes ftp.

In active mode (the default), ftp opens a T.C.P. control connection to the server port 21 and accepts a T.C.P. data connection opened by the server to a client port between 1024 and 65635—so if the client has a firewall or a NAT gateway it must be correctly set up.

In passive mode, ftp opens a T.C.P. control connection to the server port 21 and opens a T.C.P. data connection to a server port between 1024 and 65635—so if the server has a firewall or a NAT gateway it must be correctly set up.

As we are behind a NAT gateway (and maybe a firewall) at the office, it might be the reason why ftp failed. Switching to passive mode (:let g:netrw_ftp_cmd= "ftp -p") removed the errors but kept the warnings so the downloading is still failing, for a reason that I ignore (maybe because the server has a firewall or a NAT gateway that is not correctly set up, or simply because the server does not allow passive mode).

So simply installing GNU Wget from Sourceforge and adding it to the PATH environment variable solved the issue: http://gnuwin32.sourceforge.net/packages/wget.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.