Loading ...
Sorry, an error occurred while loading the content.

Re: enable spell for a particular set of files

Expand Messages
  • Gary Johnson
    ... Since you want to enable spell checking for only certain file types, change that set to setlocal , e.g., autocmd FileType tex setlocal spell Also, Vim
    Message 1 of 4 , Jul 1, 2010
    • 0 Attachment
      On 2010-07-01, Andrei Popescu wrote:
      > On Jo, 01 iul 10, 13:35:58, Xian Chen wrote:
      > > 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
      >
      > Use
      > :help autocmd
      > to get more info.

      Since you want to enable spell checking for only certain file types,
      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
      this:

      autocmd BufNewFile,BufRead *.txt setlocal spell

      Regards,
      Gary

      --
      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
    • Andrei Popescu
      ... Thanks, just did a s/set/setlocal/ for all my FileType autocmds ;) Regards, Andrei -- If you can t explain it simply, you don t understand it well enough.
      Message 2 of 4 , Jul 1, 2010
      • 0 Attachment
        On Jo, 01 iul 10, 11:54:10, Gary Johnson wrote:

        > Since you want to enable spell checking for only certain file types,
        > change that "set" to "setlocal", e.g.,
        >
        > autocmd FileType tex setlocal spell
        >

        Thanks, just did a s/set/setlocal/ for all my FileType autocmds ;)

        Regards,
        Andrei
        --
        If you can't explain it simply, you don't understand it well enough.
        (Albert Einstein)
      Your message has been successfully submitted and would be delivered to recipients shortly.