How to install spell file in VIM?

I am trying to use spellchecker in vim; if I want to add a word to the internal dictionary (so that it is not highlighted as erroneous) with the zg command, it says "option spellfile is not set" .

I tried to enter: set spellfile=PATH.../.vim.spell ,

but I always get "Invalid argument: spellfile=PATH.../.vim.spell" . Any clues please?

I am using linux Ubuntu 12.04.

+7
vim
source share
2 answers

You cannot select an arbitrary name. :help 'spellfile' says:

It must end in ". {Encoding} .add".

So use this syntax (and make sure the spell directory exists):

 :set spellfile=~/.vim/spell/en.utf-8.add 

To encode, check the box :set encoding? (Technically, this is a buffer-local parameter of 'fileencoding' , but most of the default settings are for the first).

+9
source share

Perhaps you just need to do mkdir ~/.vim .

By default, spell files are stored there. But if vim could not find this folder, it will complain about this error message.

+1
source share

All Articles