I'm using gVim for LaTeX editing. I write lots of scientific documents with words that the vim dictionary does not know. When running through spell checking I come across words that I know are spelled correctly, how do I add those words to the dictionary?
1 Answer
From the vim manual:
To add words to your own word list:
zg Add word under the cursor as a good word to the first
name in 'spellfile'. A count may precede the command
to indicate the entry in 'spellfile' to be used. A
count of two uses the second entry.
In Visual mode the selected characters are added as a
word (including white space!).
When the cursor is on text that is marked as badly
spelled then the marked text is used.
Otherwise the word under the cursor, separated by
non-word characters, is used.
If the word is explicitly marked as bad word in
another spell file the result is unpredictable.
zG Like "zg" but add the word to the internal word list
|internal-wordlist|.
zw Like "zg" but mark the word as a wrong (bad) word.
If the word already appears in 'spellfile' it is
turned into a comment line. See |spellfile-cleanup|
for getting rid of those.
zW Like "zw" but add the word to the internal word list
|internal-wordlist|.
zuw
zug Undo |zw| and |zg|, remove the word from the entry in
'spellfile'. Count used as with |zg|.
zuW
zuG Undo |zW| and |zG|, remove the word from the internal
word list. Count used as with |zg|.
On the command line:
:[count]spe[llgood] {word}
Add {word} as a good word to 'spellfile', like with
|zg|. Without count the first name is used, with a
count of two the second entry, etc.
:spe[llgood]! {word} Add {word} as a good word to the internal word list,
like with |zG|.
:[count]spellw[rong] {word}
Add {word} as a wrong (bad) word to 'spellfile', as
with |zw|. Without count the first name is used, with
a count of two the second entry, etc.
:spellw[rong]! {word} Add {word} as a wrong (bad) word to the internal word
list, like with |zW|.
:[count]spellu[ndo] {word}
Like |zuw|. [count] used as with |:spellgood|.
:spellu[ndo]! {word} Like |zuW|. [count] used as with |:spellgood|.
For more help on spell in vim, type :help spell
or :help spell-quickstart
-
4
:spellgood!
works for adding a word (e.g.de Bruijn
) containing a space.:spellgood!de Bruijn
Oct 5, 2020 at 19:30 -
6What is the difference between adding the word to 'spellfile' and adding it to the internal word list? Apr 8, 2021 at 15:08
-
5@LuísdeSousa "The internal word list is used for all buffers where 'spell' is set. It is not stored, it is lost when you exit Vim. It is also cleared when 'encoding' is set." vimdoc.sourceforge.net/htmldoc/spell.html#internal-wordlist vs vimdoc.sourceforge.net/htmldoc/options.html#'spellfile'– n8henrieFeb 15, 2022 at 19:41
-