views:

23

answers:

1

I've been using vim for a long time, but recently I built a new server, and when I opened vim, I found it wasn't using my spell file.

Historically vim would load ~/.vim/spell/en.utf-8.add as it's spell file, but when I tried adding a word to the dictionary, it added it to en.latin1.add instead.

ls ~/.vim/spell
en.latin1.add  en.latin1.add.spl  en.utf-8.add

So as a possible fix, I put set spelllang=en.utf-8 into my vimrc. But instead of then trying to use en.utf-8.add, it used en.utf-8.latin1.add. How do I turn that latin1 into a utf-8?

Also as a side note, here are my environment variables:

declare -x LANG="en_US.UTF-8"
declare -x LC_ADDRESS="en_US.UTF-8"
declare -x LC_ALL=""
declare -x LC_COLLATE="C"
declare -x LC_CTYPE="en_US.UTF-8"
declare -x LC_IDENTIFICATION="en_US.UTF-8"
declare -x LC_MEASUREMENT="en_US.UTF-8"
declare -x LC_MESSAGES="en_US.UTF-8"
declare -x LC_MONETARY="en_US.UTF-8"
declare -x LC_NAME="en_US.UTF-8"
declare -x LC_NUMERIC="en_US.UTF-8"
declare -x LC_PAPER="en_US.UTF-8"
declare -x LC_TELEPHONE="en_US.UTF-8"
declare -x LC_TIME="en_US.UTF-8"
+2  A: 

From the documentation (:help spell-load):

Vim searches for spell files in the "spell" subdirectory of the directories in
'runtimepath'.  The name is: LL.EEE.spl, where:
    LL  the language name
    EEE the value of 'encoding'
...
...
...
Exceptions:
- Vim uses "latin1" when 'encoding' is "iso-8859-15".  The euro sign doesn't
  matter for spelling.

Despite your environment variables all listing UTF-8, it looks as though Vim's encoding is set to either "latin1" or "iso-8859-15". Perhaps you could set Vim's encoding manually by running :set encoding=utf-8.

nelstrom
Sadly changing the encoding still doesn't fix the issue.
icco