let $HOME = '/home/parv' let $cf = expand( "$HOME/cf" ) let $vim_cf = expand( "$cf/vim" ) let $backup_dir = expand( "$HOME/tmp/.vim" ) . ",./tmp,." let $view_dir = expand( "$vim_cf/.view-sess" ) let $sess = expand( "$view_dir/session" ) "set verbose=4 "set mouse=vc mousemodel=extend set virtualedit=block nostartofline set history=90 background=dark set nocompatible magic autowrite ai showmode showcmd set noignorecase smartcase wrapscan incsearch hlsearch set nowrap textwidth=80 wrapmargin=0 noexpandtab shiftwidth=2 shiftround set timeout timeoutlen=1000 ttimeoutlen=1000 let loaded_matchparen = 1 set showmatch matchpairs=(:),{:},[:],<:> matchtime=4 set cpoptions=aABcdeFgJKnsSty set iskeyword=@,48-57,_,192-255 set complete=.,w,b,u,t,U,i,k,s set showbreak=\ \ \ \ \ \ \ \ breakat=" !;:,./?" linebreak set list listchars=tab:._,trail:~,extends:>,precedes:< "set clipboard=unnamed,autoselect,exclude:cons set shortmess=fimnrxlIW report=4 showmode ruler " a: Argument list status as in default title. " B: Value of byte under cursor in hexadecimal. " c: Column number. " f: Path to the file in the buffer, relative to current directory. " h: Help buffer flag. " l: Line number. " L: Lines in buffer . " m: Modified flag. " n: Buffer number. " P: Percentage through file of displayed window. " r: Readonly flag " V: Virtual column number as -{number}. Not displayed if equal to 'c'. " y: Type of file. set statusline=\ #%n\ %<%f\ %3*%(%m%)%(%r%)%(%h%)%*\ %1*\ 0x%02B\ %03c%V%*%2*\ %4l/%L\ %* set rulerformat=0x%02B\ %03c%V%*%2*\ %4l " If backupdir is missing, vim then opens the file in read only mode " to write, use "w!" or make sure backupdir exists set browsedir=buffer backup backupext=~ set backupdir=$backup_dir " Backspace setting (=2, or =indent,eol,start) allows to back over indents set backspace=indent,eol,start " Laststatus setting (=2) always shows status line set laststatus=2 " Do not restore previous screen. (There is a space after 't_te=') set t_ti= t_te= " = Delete char underneath the cursor (insert/command mode) set t_kD= " : Delete preceeding character (insert mode) " : Move to preceeding character (command mode) set t_kb= " Enable some syntax highlighting "filetype plugin on set fo=tcqn comments=n:#,fb:-,fb:+,fb:* silent! com -bang -nargs=? W :w "runtime ftplugin/man.vim set viewdir=$view_dir set sessionoptions=blank,buffers,curdir,folds,winsize,slash,unix " Try to exit/skip if file is directory " - Does not work if a regular file name is given after directory " - name "au BufEnter * if isdirectory(expand("")) | quit | endif "set verbose=9 augroup parv-default au BufNewFile,BufRead * fixdel au BufNewFile,BufRead * so $vim_cf/personal.cf au BufNewFile,BufRead * so $vim_cf/default.func au BufNewFile,BufRead * so $vim_cf/default.map au BufNewFile,BufRead * so $vim_cf/shell-emacs.map au BufNewFile,BufRead * call Set_Syntax_Hilight('default','parv-default') augroup END augroup vi au BufNewFile,BufRead .exrc,.vimrc,*/vim/*,*.vim,*.vim,vim*cf set comments=n:\",n:\' au BufNewFile,BufRead .exrc,.vimrc,*/vim/*,*.vim,*.vim,vim*cf call Set_Syntax_Hilight('vi') augroup END augroup list au BufNewFile,BufRead */list/*,list.*,list-* so $vim_cf/list.cf au BufNewFile,BufRead */list/*,list.*,list-* call Set_Syntax_Hilight('list') augroup END augroup course au BufNewFile,BufRead */course/*/* so $vim_cf/course.cf augroup END augroup x "au BufWinLeave *Xdefaults*,.*Xdefaults*,*Xresources*,.*Xresources* mkview "au BufWinEnter *Xdefaults*,.*Xdefaults*,*Xresources*,.*Xresources* silent loadview au BufNewFile,BufRead *Xdefaults*,.*Xdefaults*,*Xresources*,.*Xresources* call Set_Syntax_Hilight('xres') augroup END augroup perl "au BufWinLeave */*perl/*,*.cgi,*.perl,*.pl,*.pm mkview "au BufWinEnter */*perl/*,*.cgi,*.perl,*.pl,*.pm silent loadview au BufNewFile,BufRead */*perl/*,*/*perl5/*,*.cgi,*.perl,*.pl,*.pm so $vim_cf/common-prgm.cf au BufNewFile,BufRead */*perl/*,*/*perl5/*,*.cgi,*.perl,*.pl,*.pm so $vim_cf/perl.cf au BufNewFile,BufRead */*perl/*,*/*perl5/*,*.cgi,*.perl,*.pl,*.pm set tags=$cf/tags/perl.tags au BufNewFile,BufRead */*perl/*,*/*perl5/*,*.cgi,*.perl,*.pl,*.pm set dict+=$cf/dict/perl.dict au BufNewFile,BufRead */*perl/*,*/*perl5/*,*.cgi,*.perl,*.pl,*.pm set thesaurus+=$cf/dict/perl.thes au BufNewFile */*perl/*,*/*perl5/*,*.cgi,*.perl,*.pl,*.pm 0put='#!/usr/local/bin/perl'|put=''|put='use warnings; use strict;' au BufNewFile,BufRead mailstat* set ts=4 sw=2 expandtab augroup END " C, C++, Visual C++ augroup c "au BufWinLeave *.c,*.h,*.H,*.hh,*.C,*.cc,*.cp,*.cpp,*.c++,*.cxx,*.vc mkview "au BufWinEnter *.c,*.h,*.H,*.hh,*.C,*.cc,*.cp,*.cpp,*.c++,*.cxx,*.vc silent loadview au BufNewFile,BufRead *.c,*.h,*.H,*.hh,*.C,*.cc,*.cp,*.cpp,*.c++,*.cxx,*.vc so $vim_cf/common-prgm.cf au BufNewFile,BufRead *.c,*.h,*.H,*.hh,*.C,*.cc,*.cp,*.cpp,*.c++,*.cxx so $vim_cf/c.cf au BufNewFile *.c 0put='#include '|put=''|put='int main()'|put='{'|put=' '|put='return 0;'|put='}' au BufNewFile *.C,*.cc,*.cp,*.cpp,*.c++,*.cxx 0put=''|put='#include '|put=''|put='using namespace std;'|put=''|put='int main()'|put='{'|put=' '|put=' '|put=' return 0;'|put='}' au BufNewFile,BufRead *.vc,*.vxx so $vim_cf/vc.cf "au BufNewFile *.vc,*.vxx 0put=''|put='#using '|put=''|put='using namespace System;'|put=''|put='int main(void)'|put='{'|put=' '|put=' '|put=' return 0;'|put='}' augroup END augroup java "au BufWinLeave *.java mkview "au BufWinEnter *.java silent loadview au BufNewFile,BufRead *.java so $vim_cf/common-prgm.cf au BufNewFile,BufRead *.java so $vim_cf/java.cf au BufNewFile,BufRead *.java set tags=$cf/tags/java.tags au BufNewFile,BufRead *.java set dict+=$cf/dict/java.dict au BufNewFile,BufRead *.java set thesaurus+=$cf/dict/java.thes au BufNewFile *.java 0put='package ;'|put=''|put='public class '|put='{'|put=' public ()'|put=' {'|put=' }'|put=''|put='}' augroup END " JavaScript augroup js "au BufWinLeave *.js mkview "au BufWinEnter *.js silent loadview au BufNewFile,BufRead *.js so $vim_cf/common-prgm.cf au BufNewFile,BufRead *.js so $vim_cf/js.cf augroup END augroup php "au BufWinLeave *.php mkview "au BufWinEnter *.php silent loadview au BufNewFile,BufRead *.php so $vim_cf/common-prgm.cf au BufNewFile,BufRead *.php so $vim_cf/php.cf au BufNewFile,BufRead */wisepub* set tags=$cf/tags/wise.tags | set ts=4 sw=4 tw=0 noexpandtab au BufNewFile,BufRead */{forum_mod,misc-func}* set ts=2 sw=2 tw=80 expandtab augroup END augroup sql "au BufWinLeave *.sql mkview "au BufWinEnter *.sql silent loadview au BufNewFile,BufRead *.sql,.*.sql so $vim_cf/sql.cf augroup END augroup tex "au BufWinLeave *.tex mkview "au BufWinEnter *.tex silent loadview au BufNewFile,BufRead *.tex so $vim_cf/tex.cf au BufNewFile,BufRead *.tex set ts=4 sw=2 expandtab augroup END augroup html "au BufWinLeave */css/*,*.css,*.html*,*.htm,*.xhtml*,*.shtml mkview "au BufWinEnter */css/*,*.css,*.html*,*.htm,*.xhtml*,*.shtml silent loadview au BufNewFile,BufRead */css/*,*.css,*.html*,*.htm,*.xhtml*,*.shtml so $vim_cf/common-prgm.cf au BufNewFile,BufRead *.html*,*.htm,*.xhtml*,*.shtml call Set_Syntax_Hilight('html') au BufNewFile,BufRead */css/*,*.css call Set_Syntax_Hilight('css') au BufNewFile,BufRead */css/*,*.css set syn=css comments=sr:/*,m:#,ex:*/ augroup END augroup procmail "au BufWinLeave procmail.cf* mkview "au BufWinEnter procmail.cf* silent loadview au BufNewFile,BufRead procmail.cf* so $vim_cf/procmail-cf.cf au BufNewFile,BufRead procmail.log* call Set_Syntax_Hilight('procmail-log') augroup END augroup mailpost "au BufNewFile,BufRead */.mutt/mutt-*-*,*SLRN* set comments=n:> au BufNewFile,BufRead */.mutt/mutt-*-*,*SLRN* so $vim_cf/mail-write.cf augroup END augroup slrn "au BufWinLeave *slrn*cf mkview "au BufWinEnter *slrn*cf silent loadview au BufNewFile,BufRead *slrn*cf set comments=n:% augroup END augroup radio au BufNewFile,BufRead *radio*,*npr*,*pri* so $vim_cf/radio.cf augroup END "set dict+=/usr/share/dict/words au BufWinLeave * mkview au BufWinEnter * silent loadview "au BufWinLeave * mksession! $sess "au BufWinEnter * silent so $sess " Abbreviations iab wrapline Do wrap lines around 69 or so characters to give me no incentive to ignore your mail otherwise. iab subjline I don't know the answer, but i would have been more inclined to search for, or offer, a solution if you had chosen more descriptive subject line.