Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim spell checking - comments only in LaTeX files

I use gvim to edit LaTex .tex file. I noticed that it checks spelling on the fly only for the commented text. If I have a mistake in a regular text - no underline. If I comment this text with % , the misspell is underlined immediately. What is wrong? Is there any strange option turned on?

like image 724
Jakub M. Avatar asked May 02 '11 17:05

Jakub M.


People also ask

Does LaTeX support spell checking?

Spell-checking and Word CountingYou can also use a LaTeX editor with built-in spell checking, such as LyX, Kile, or Emacs.

How do I use spellcheck in Vim?

Using SpellcheckingTo move to a misspelled word, use ]s and [s . The ]s command will move the cursor to the next misspelled word, the [s command will move the cursor back through the buffer to previous misspelled words. Just hit Enter if none of the suggestions work, or enter the number for the correct word.

Does TeXworks have spell check?

As per the TeXworks manual, the procedure to install spell checking dictionaries in TeXworks is as follows. Download the dictionary corresponding to your desired language from the OpenOffice.org extensions site. Change the file extension of the downloaded file from .

Does Excel spell check comments?

If you select a single cell for spell check, Excel checks the entire worksheet, including the comments, page headers, footers and graphics. If you select multiple cells, Excel checks spelling only for those cells. To spell check words in a formula bar, select the words.


2 Answers

The latex ft plugin conveniently defines this behaviour.

SpellChecker : Spell check text including LaTeX documents

Using latexmk, vim spell checking and vim latex-suite

There is an option that appears to come close:

:syntax spell [toplevel | notoplevel | default] 

Update

Also

:he ft-tex-syntax 

has very useful tidbits, like

Don't Want Spell Checking In Comments? ~  Some folks like to include things like source code in comments and so would prefer that spell checking be disabled in comments in LaTeX files.  To do this, put the following in your <.vimrc>: >       let g:tex_comment_nospell= 1 

You'll have to figure out whether you can use that/extrapolate from there

like image 149
sehe Avatar answered Sep 20 '22 15:09

sehe


I had the same problem (VIM 7.3), but this post at the vim-latex-devel mailing list provided the clue. To get the spell checking working, I had to put

syntax spell toplevel 

in my ~/.vimrc, but it has to be declared after

syntax enable 

or

syntax on 

for it to work.

like image 29
digitaldingo Avatar answered Sep 18 '22 15:09

digitaldingo