如何使vim下载拼写文件?


14

spelllang首次设置时,系统提示我自动下载适当的拼写文件。由于指令不明确,我以某种方式中止了该过程,当它询问我应将其进入哪个目录时。

现在,当我:set spelllangWarning: Cannot find word list...时,它不提供下载。

如何重新启动该过程?

Answers:


13

帮助阐明这一点:

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).

请注意,每次互动时的默认选择均为否定。

例如,如果您输入:set spelllang=fr并且尚未安装法语,则会发生以下情况。

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

点击Y下载拼写语言

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):

击中1(击中Enter选择默认Cancel动作)

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

命中Y(或N/ Enter,这是您的选择)

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

该文档对我没有帮助,因为当我遵循不使用插件的情况下的说明时,即添加自动命令autocmd SpellFileMissing * call Download_spell_file(expand('<amatch>')),然后执行:set spell此操作会出现错误,不知道该函数Download_spell_file。我是唯一一个?
Zelphir Kaltstahl '02

@Zelphir我不明白。为什么不激活自动命令?
Christian Brabandt

@ChristianBrabandt,也许做的比复制文档更多,这将是一个更好的答案。
恩里科·玛丽亚·德·安吉里斯

@EnricoMariaDeAngelis也许不是,因为文档已经清楚地回答了这个问题。
克里斯汀·布拉班德

@ChristianBrabandt,那么我想我在这里是由于地雷的某些神经元故障。
恩里科·玛丽亚·德·安吉利斯

1

我对问题的理解不同:对“您要我尝试下载[咒语文件]吗?”回答“否”时。问题,下载选项不会再次出现。

我通过删除~/.viminfo来解决它- 当然这不是最好的方法,但是它确实回答了这个问题(至少按照我的解释)。


欢迎来到Vi和Vim!我已经轻而易举地编辑了您的答案。
D. Ben Knoble
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.