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

Re: disabling all forms of auto indentation completely

Expand Messages
  • Carlo Florendo
    ... I thought toothat `filetype indenf off will eventually do the trick. I didn t know there was a filetype command but after reading some more, `filetype
    Message 1 of 24 , Sep 27, 2003
      Antoine J. Mechelynck wrote:

      >>>>Right. One of them is doing it. I thought that vimrc was
      >>>>processed last....
      >>>>
      >>>>
      >>>>
      >>>>
      >>>The vimrc is processed once, as part of Vim initialisation. cpp.vim
      >>>is processed whenever a cpp file is opened, as part of filetype
      >>>recognition. But I thought that setting "filetype indent off" in
      >>>your vimrc would prevent sourcing indent files (for any filetype)
      >>>later. Doing ":filetype" with no arguments will tell you which of
      >>>ft-detect, ft-plugin, ft-indent are on, and which of them are off.
      >>>Again, try it at the time of a spontaneous indent.
      >>>

      I thought toothat `filetype indenf off' will eventually do the trick. I
      didn't know there was a filetype command
      but after reading some more, `filetype plugin indent off' did the
      trick. Again, thanks for the insights on `filetype'. :)


      >>>
      >>>
      >>Ok, I hope we're almost there. `filetype indent off' prevented
      >>/usr/share/vim/vim62/indent/cpp.vim from being executed. (In one of
      >>my previous mail in this thread, I showed that cpp.vim was the last
      >>who set cindent.)
      >>
      >>This time however,
      >>
      >>
      >>
      >>>verbose set cindent?
      >>>
      >>>
      >>gives me
      >>
      >>cindent
      >> Last set from /usr/share/vim/vim62/ftplugin/c.vim
      >>
      >>Ok, how do I disable /usr/share/vim/vim62/ftplugin/c.vim from being
      >>read, or all files that set indentation for that matter? If this file
      >>is used for syntax highlighting, then I'm dead since I do not want to
      >>disable syntax highlighting. All I want is to disable any and all
      >>forms
      >>of indenting without any side effect.
      >>
      >>
      >
      >This one is not an indent plugin but a filetype plugin. Maybe you need the
      >other things it does. But I suggest to override it /a posteriori/ by putting
      >the following line into one of ~/.vim/after/ftplugin/c.vim (for Unix),
      >~/vimfiles/after/ftplugin/c.vim (for Dos/Windows), or
      >$VIM/vimfiles/after/ftplugin/c.vim (if, on Dos/Windows, doing ":echo $HOME"
      >in Vim doesn't give a usable answer):
      >
      > setlocal nocindent
      >
      >Create the file if it doesn't exist, else add that line to whatever is
      >already in it. Such a file (a "user filetype plugin") will be processed
      >whenever $VIMRUNTIME/ftplugin/c.vim is processed, and after it.
      >

      Another new thing learned! Technical support from a mailing list on
      an open source project is really the
      best way to solve any problem. :)

      >
      >
      >>
      >>
      >
      >I. Your system-wide vimrc (a user-specific vimrc would be ~/.vimrc)
      >
      >
      >
      >> 1: /usr/share/vim/vimrc
      >>
      >>
      >
      >II. "syntax on" (IIUC)
      >
      >
      [the rest of the detailed analysis stripped...]

      >> 15: /usr/share/vim/vim62/ftplugin/c.vim
      >> 16: /usr/share/vim/vim62/syntax/c.vim
      >>
      >>Script #15 is the culprit. That's where cindent is set. Is is
      >>possible, with one command option, to override all indenting under
      >>/usr/share/vim/vim62/ftplugin ?
      >>
      >>
      >
      >see above the method I suggest. I believe indenting should be set in a
      >filetype-indent-plugin, not in a filetype-plugin, but I don't want to alter
      >the distribution files themselves because the next upgrade will probably
      >overwrite them with new versions.
      >
      >
      >
      >>And everyone, thanks for all those suggestions!
      >>
      >>
      >
      >My pleasure.
      >
      >
      >>Still waiting for help,
      >>
      >>
      >>
      Not waiting for help anymore. The issue has finally been closed and solved.

      My sincerest thanks to everyone for their comments, step by step
      analyses, and suggestions. :)



      Best Regards,

      Carlo
      ------
      Carlo Florendo
      Astra Philippines Inc.
      www.hq.astra.ph
    Your message has been successfully submitted and would be delivered to recipients shortly.