Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically enabling spell checking in vimrc

Tags:

vim

How can I enable spell checking to be automatically enabled in the .vimrc file? Perhaps there's a way to define a quick shortcut that would toggle it instead.

Better yet, is possible to enable it for certain file extensions only?

like image 236
Matty Avatar asked Sep 02 '11 16:09

Matty


People also ask

How do I set up automatic spell check on my computer?

Click File > Options > Proofing, clear the Check spelling as you type box, and click OK. To turn spell check back on, repeat the process and select the Check spelling as you type box. To check spelling manually, click Review > Spelling & Grammar. But do remember to run spell check.

How do I turn on spell check in Vim?

By default, spell check will be off. If you want to turn it on, run setlocal spell in the Vim command line (if you want spell check to always be on, add set spell to your . vimrc). After turning spell check on, misspelled words will now be highlighted.

What is automatic spell checker?

A software program or program feature designed to locate misspelled words and notify the user of the misspellings. Depending on the spell checker, the feature may either autocorrect the word or allow the user to select from potential corrections on the misspelled word.


2 Answers

For only certain file extensions, you can use the autocommands in Vim:

au BufRead *.txt setlocal spell
like image 28
evaryont Avatar answered Sep 25 '22 15:09

evaryont


You should be able to just put set spell in your .vimrc file.

like image 168
Alex Avatar answered Sep 21 '22 15:09

Alex