How can I create my own spelling file for vim?

5,487

Solution 1

The 'spellfile' option is what you're looking for:

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

Note: Avoid special characters like _; as it separates the region name in Vim.

You can then add your custom words to it with zg. You don't even need to add anything to 'spelllang'; those additions will be considered automatically.

Solution 2

:help spell-mkspell

is what you are looking for.

Share:
5,487

Related videos on Youtube

Raphael Ahrens
Author by

Raphael Ahrens

I'm an open source enthusiast since the day my Windows machine had a total crash in 2008. The crash was caused by a driver problem of the motherboard. Back then I had some Linux experience from my education, so I switch completely to Ubuntu. The more I worked with Ubuntu I started to tweak it to my liking and in the end I had my personal minimalistic setup with a personal Desktop based on Openbox, SLiM and tint2. ZSH as my interactive shell and vim as my standard editor With the release of Ubuntu 10.04 I switched my desktop to FreeBSD 8.1 and was surprised to see, that it was much easier to get my personal setup running on FreeBSD than on Ubuntu. So since 2010 I'm a happy user of FreeBSD.

Updated on September 18, 2022

Comments

  • Raphael Ahrens
    Raphael Ahrens over 1 year

    At the moment I'm writing a document where I need to use a lot of acronyms, technical language, and non German words.

    Now I was wondering if I could create a spelling file (tech_speak) which checks for this technical language so I can use the following vim command

    :set spelllang=de,tech_speak spell
    

    How could this be done?

  • Raphael Ahrens
    Raphael Ahrens over 10 years
    Please correct me if I'm wrong. But as far as I had read this I need an existing dictionary file. But I want to make a new language file which I can combine with my language.
  • Raphael Ahrens
    Raphael Ahrens over 10 years
    Yeah this looks good but, when I use zg vim throws "E751: Output file name must not have region name" at me.
  • Raphael Ahrens
    Raphael Ahrens over 10 years
    Ah I needed to remove the _ so :set spellfile=~/.vim/spell/techspeak.utf-8.add works. Thanks!
  • John
    John over 10 years
    A dictionary file can be a simple word list.
  • Ingo Karkat
    Ingo Karkat over 10 years
    You're right; it's best to avoid such characters; I've edited my answer.
  • Zelphir Kaltstahl
    Zelphir Kaltstahl over 7 years
    @n.m. So like a csv? Just words separated by commas?
  • John
    John over 7 years
    @Zelphir by newlines IIRC