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

Re: Auto indent lost when opening a new file?

Expand Messages
  • Fran├žois Ingelrest
    Thank you very much for your answer. I have these lines in my .vimrc: if has( autocmd ) au BufRead,BufNewFile *.cls set filetype=tex au BufRead,BufNewFile
    Message 1 of 4 , Mar 1, 2007
    • 0 Attachment
      Thank you very much for your answer. I have these lines in my .vimrc:

      if has("autocmd")
      au BufRead,BufNewFile *.cls set filetype=tex
      au BufRead,BufNewFile sconstruct set filetype=python

      " Nes C syntax (used by TinyOS)
      au BufRead,BufNewFile *.nc set filetype=nesc
      au! Syntax nesc source ~/.vim/nesc.vim
      endif

      I use them to force a filetype for some files. Shouldn't I do that?
      I added your line among mine:

      au BufRead * set autoindent cindent smartindent

      And now it's working correctly. As I understand it, these options are
      disabled because I didn't add them to my other lines? But in this
      case, why other options aren't also disabled?
    • Yakov Lerner
      ... It s not abvious whether any of your commands above break auto-indenting or not. The only way to know is if you comment them all out (first all of them,
      Message 2 of 4 , Mar 1, 2007
      • 0 Attachment
        On 3/1/07, Fran├žois Ingelrest <athropos@...> wrote:
        > Thank you very much for your answer. I have these lines in my .vimrc:
        >
        > if has("autocmd")
        > au BufRead,BufNewFile *.cls set filetype=tex
        > au BufRead,BufNewFile sconstruct set filetype=python
        >
        > " Nes C syntax (used by TinyOS)
        > au BufRead,BufNewFile *.nc set filetype=nesc
        > au! Syntax nesc source ~/.vim/nesc.vim
        > endif
        >
        > I use them to force a filetype for some files. Shouldn't I do that?

        It's not abvious whether any of your commands above
        break auto-indenting or not. The only way to know is if you
        comment them all out (first all of them, them one-by one)
        and see if it changes anything wrt auto-indenting.
        (Also comment out the new command you added today for this check),

        Yakov

        > I added your line among mine:
        >
        > au BufRead * set autoindent cindent smartindent
        >
        > And now it's working correctly. As I understand it, these options are
        > disabled because I didn't add them to my other lines? But in this
        > case, why other options aren't also disabled?
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.