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

Re: Disable spell for certain filetypes

Expand Messages
  • C Rose
    Many thanks Tony, C
    Message 1 of 5 , Jul 31, 2006
    • 0 Attachment
      Many thanks Tony,

      C



      A.J.Mechelynck wrote:
      > C Rose wrote:
      >
      >> Hi
      >>
      >> Is it possible to tell vim 7 to use spell in general, but not for
      >> files with specific filename extensions?
      >>
      >> Thanks in advance
      >>
      >> C
      >>
      >>
      >
      > :set spell
      > :autocmd FileType c,cpp,lisp setlocal nospell
      >
      > Replace the list of comma-separated filetypes by whatever you want. To
      > ascertain the filetype (as known by Vim) of the file you are currently
      > editing, use
      >
      > :set filetype?
      >
      > Of course, you need filetype recognition to be active for it to work.
      > The vimrc_example.vim takes care of that if your vimrc sources it;
      > otherwise you need
      >
      > :filetype [plugin] [indent] on
      >
      > where the [] parts are optional. I recommend using at least
      >
      > :filetype plugin on
      >
      >
      > -- If you want to discriminate between files of a common 'filetype' you
      > will need an ":if" statement as part of the autocommand:
      >
      > :au Filetype c,cpp,lisp if <afile> !~# '\.C$' | setl nospell | endif
      >
      > (about the !~# operator, see ":help expr4")
      >
      >
      >
      > Best regards,
      > Tony.
    Your message has been successfully submitted and would be delivered to recipients shortly.