Re: enable spell for a particular set of files
- On 2010-07-01, Andrei Popescu wrote:
> On Jo, 01 iul 10, 13:35:58, Xian Chen wrote:Since you want to enable spell checking for only certain file types,
> > I want to enable spell for .txt and .tex files. Is there any way to do so?
> > I enable spell in .vimrc but it enables for every file, including .c .cpp.
> You can do just any setting per filetype with an 'autocmd'. Something
> like this in .vimrc should work
> autocmd FileType txt set spell spelllang=en
> :help autocmd
> to get more info.
change that "set" to "setlocal", e.g.,
autocmd FileType tex setlocal spell
Also, Vim does not have a file type for .txt files. You can either
create your own txt file type, or you can use an autocommand like
autocmd BufNewFile,BufRead *.txt setlocal spell
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
- On Jo, 01 iul 10, 11:54:10, Gary Johnson wrote:
> Since you want to enable spell checking for only certain file types,Thanks, just did a s/set/setlocal/ for all my FileType autocmds ;)
> change that "set" to "setlocal", e.g.,
> autocmd FileType tex setlocal spell
If you can't explain it simply, you don't understand it well enough.