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

set cindent does not work in .vimrc

Expand Messages
  • Mike H
    This is the content of .vimrc file that I use... For some reason, both txx and cu files are recognized properly, but cindent does not work ! So I have to
    Message 1 of 3 , Jan 6, 2008
      This is the content of .vimrc file that I use...
      For some reason, both txx and cu files are recognized properly, but
      cindent does not work !

      So I have to manually type , set cindent , for indentation to work.

      I am a newbie.. Could anybody help me?
      Thanks



      au BufReadPost,BufNewFile *.txx set syntax=c
      au BufReadPost,BufNewFile *.cu set syntax=c
      set sw=2
      set cindent

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Matt Wozniski
      ... My recommendation is not to set cindent globally like that (it would give you problems with, for instance, python files, later on) but instead to do this:
      Message 2 of 3 , Jan 6, 2008
        On Jan 6, 2008 5:11 PM, Mike H <hspnew@...> wrote:
        >
        > This is the content of .vimrc file that I use...
        > For some reason, both txx and cu files are recognized properly, but
        > cindent does not work !
        >
        > So I have to manually type , set cindent , for indentation to work.
        >
        > I am a newbie.. Could anybody help me?
        > Thanks
        >
        >
        >
        > au BufReadPost,BufNewFile *.txx set syntax=c
        > au BufReadPost,BufNewFile *.cu set syntax=c
        > set sw=2
        > set cindent

        My recommendation is not to set cindent globally like that (it would
        give you problems with, for instance, python files, later on) but
        instead to do this:

        filetype plugin on
        syntax on
        set sw=2
        au BufReadPost,BufNewFile *.txx,*.cu set filetype=c

        ~Matt

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        ... Using plain :set changes the default for newly opened files. Best regards, Tony. -- You are old, said the youth, and your programs don t run, And
        Message 3 of 3 , Jan 6, 2008
          Matt Wozniski wrote:
          > On Jan 6, 2008 5:11 PM, Mike H <hspnew@...> wrote:
          >> This is the content of .vimrc file that I use...
          >> For some reason, both txx and cu files are recognized properly, but
          >> cindent does not work !
          >>
          >> So I have to manually type , set cindent , for indentation to work.
          >>
          >> I am a newbie.. Could anybody help me?
          >> Thanks
          >>
          >>
          >>
          >> au BufReadPost,BufNewFile *.txx set syntax=c
          >> au BufReadPost,BufNewFile *.cu set syntax=c
          >> set sw=2
          >> set cindent
          >
          > My recommendation is not to set cindent globally like that (it would
          > give you problems with, for instance, python files, later on) but
          > instead to do this:
          >
          > filetype plugin on
          > syntax on
          > set sw=2
          > au BufReadPost,BufNewFile *.txx,*.cu set filetype=c

          ---------------------------------------^ setlocal

          >
          > ~Matt


          Using plain ":set" changes the default for newly opened files.

          Best regards,
          Tony.
          --
          "You are old," said the youth, "and your programs don't run,
          And there isn't one language you like;
          Yet of useful suggestions for help you have none --
          Have you thought about taking a hike?"

          "Since I never write programs," his father replied,
          "Every language looks equally bad;
          Yet the people keep paying to read all my books
          And don't realize that they've been had."

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        Your message has been successfully submitted and would be delivered to recipients shortly.