[oclug]vimrc files.

Bart Trojanowski bart-oclug at jukie.net
Thu Nov 14 15:02:17 EST 2002


* Ross Jordan <rjordan at student.math.uwaterloo.ca> [021114 13:26]:
> > We should start a VimSIG ! ;>
> 
> Hmm, actually -- how about people post their .vimrc with explanations
> for cool and/or obscure settings.

Allright...

One thing I like to put in my .vimrc is 'autocmd BufEnter' directives to
switch between editing modes based on the file type:

" auto load extensions for different file types
:autocmd BufEnter *tmp/mutt-*-*,/tmp/pico.*        source ~/.vim/mail.vim
:autocmd BufEnter *.tex                            source ~/.vim/tex.vim
:autocmd BufEnter *.txt,README*                    source ~/.vim/txt.vim
:autocmd BufEnter *.c,*.h,*.cpp,*.hpp,*.cc         source ~/.vim/c.vim
:autocmd BufEnter *.pl,*.perl                      source ~/.vim/pl.vim

Then I have specialized .vim/*.vim files which represent editing
preferences for different uses.  So when I edit a *.c file it will load
up the .vim/c.vim config file, .vim/pl.vim for *.pl files, etc.

For mut users... I have set my tmp directory to ~/tmp as opposed to the
default /tmp, but the match for using mail.vim mode will catch both.
Also I set editor="vim -c ':0;/^Subject: ' -c ':noh'" and edit_headers
in .muttrc.

For pine users... pico is used to compose mail in pine.  It uses
/tmp/pico.$$ temporary files to compose the mail.

The rest should be pretty self explanatory.

-- 
				WebSig: http://www.jukie.net/~bart/sig/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://tux.oclug.on.ca/pipermail/oclug/attachments/20021114/eb93603d/attachment.bin


More information about the OCLUG mailing list