Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to do:

:spellgood w/o

I get an error message saying

Unrecognized flags in ~/.vim/spell/en.utf-8.add line 16

I have attempted the following to no avail:

:spellgood w\/o
:spellgood w//o
:spellgood "w/o"
:spellgood 'w/o'

I also tried visually selecting the word in question and hitting zg. Same error.

How can I get vim to stop telling me that w/o is a bad word?

Adding o to the spell file or capitalizing w/o to W/O works, but those options make me sad.


I have added the following as ~/.vim/spell/en_US.aff

SET ISO8859-1
KEY qwertyuiop|asdfghjkl|zxcvbnm
TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ'-

# ordinal numbers (1st, 2nd, 3th, 11th) and decads (0s, 10s, 1990s)
# only in compounds: 1th, 2th, 3th
# compound rules:
# 1. [0-9]*1[0-9]th (10th, 11th, 12th, 56714th, etc.)
# 2. [0-9]*[02-9](1st|2nd|3rd|[4-9]th) (21st, 22nd, 123rd, 1234th, etc.)
WORDCHARS 0123456789' 

and the following file as ~/.vim/spell/en_US.dic


and have executed the following vim commands:

:cd ~/.vim/spell
:mkspell mine en_US.aff
:set spelllang+=mine
file: ~/.vim/spell/en.utf-8.spl
file: ~/.vim/spell/mine.utf-8.spl
file: ~/.vim/spell/en.utf-8.add.spl

And I still cannot get vim to recognize w/o as a good word.

share|improve this question
The reason the adding o to the file works is because you already added w to the spell file. – FDinoff Jul 23 '13 at 21:10
@FDinoff I understand that, but what I was attempting to say is that adding w and o separately is an unacceptable solution. – kzh Jul 25 '13 at 18:15
I agree adding both would be weird. – FDinoff Jul 25 '13 at 18:16

From :help spell

Note: in line 5 to 7 non-word characters are used. You can include any character in a word. When checking the text a word still only matches when it appears with a non-word character before and after it. For Myspell a word starting with a non-word character probably won't work.

In line 12 the word "TCP/IP" is defined. Since the slash has a special meaning the comma is used instead. This is defined with the SLASH item in the affix file, see |spell-SLASH|. Note that without this SLASH item the word will be "TCP,IP".

Above it defines some custom words, TCP/IP being one of them. So you should just need to use , instead of / in this case.

i.e. use w,o


As you point out, I was pointing toward documentation about .dic files, which in my limited experience are more common. In the .dic file, you can use your solution of w\/o (see :help spell-SLASH)

WORDS WITH A SLASH                                      *spell-SLASH*

The slash is used in the .dic file to separate the basic word from the
affix letters and other flags.  Unfortunately, this means you cannot
use a slash in a word.  Thus "TCP/IP" is not a word but "TCP with the
flags "IP".  To include a slash in the word put a backslash before it:
"TCP\/IP".  In the rare case you want to use a backslash inside a word
you need to use two backslashes. Any other use of the backslash is
reserved for future expansion.
share|improve this answer
So what you're telling me is that I should've RTFM better. – kzh Jul 24 '13 at 12:49
This is not working for me. I enter the command :spellgood w,o and both the w and the o are highlighted red. Now i :help spell-SLASH, it says "the slash is used in the .dic file". I am not using a .dic file. :spellgood adds the word to my ~/.vim/spell/en.utf-8.add file. Are they the same filetype? Did you try your suggestion and see if it works? – kzh Jul 24 '13 at 13:01
So it appears that there are two different file types: spell-wordlist, and spell-dic. I was attempting to use wordlist, your answer uses dic. I have no idea how to use dic, but am reasearching. – kzh Jul 24 '13 at 13:13
I have been combing over the manual, but cannot find how to create a .dic file. I see several references, but do not see any instructions such as where it goes. Where do you have your *.dic? – kzh Jul 24 '13 at 19:03
I updated my question, your answer still appears to be a no-go. – kzh Jul 29 '13 at 22:11

You are nearly done, you are just doing a small mistake.

You have to compile the dictionary first, before moving it to ~/.vim/spell, the correct format is .spl instead of .aff.

I found a really good article about how you should install/create a spell file. I am using the wordlist that the author of the article was pointing to, however the wiki pages and links got messed up, so the link to it is below.

Here you can find the en_US dictionary/wordlist.

I didn't see your edit at first, so discard the information above - but if you use the wordlist provided it works. :)

share|improve this answer
Have you tried it with the word 'w/o'? Did it work? I will try replacing :mkspell mine en_US.aff with :mkspell mine en_US when I get home. Thanks. – kzh Jul 29 '13 at 23:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .