[TriLUG] VIM insanity

Alan Porter porter at trilug.org
Thu Oct 21 18:55:07 EDT 2004


> If someone knows of a more correct way to turn off those
> code-oriented features such as auto commenting, feel free
> to chime in.

I read a very long thread on this a few months ago.  I also
got infuriated with the autoindenting, commenting, etc.  But
I have made my peace with vim.  Here's what I ended up with.

.vimrc
------
" save backup files~ to $HOME/.backup
" but don't freak out if $HOME/.backup does not exist
set backup
set backupdir=~/.backup,.

" under no circumstances should you auto-indent
set nocindent
set nosmartindent
set noautoindent
set indentexpr=
filetype indent off
filetype plugin indent off

if !exists("autocommands_loaded")
   let autocommands_loaded = 1

   " but you SHOULD do syntax highlighting if possible
   autocmd Filetype * syntax on

   " custom colors for syntax highlighting
   autocmd Filetype * highlight Comment ctermfg=green

endif

" do not wrap long lines
set nowrap


The general consensus among vim fans was that you should not
use ":set paste" to turn off indenting, because it also makes
a lot of other settings that you probably don't want.  I do
not recall the details... I just copied their .vimrc ideas
and got on with my life.

Hope this helps.

Alan






More information about the TriLUG mailing list