set nottybuiltin " Welcome to Fefe's .vimrc! " Some default settings I'll never change version 4.0 " We are up to date! set backspace=2 " backspace can join lines "set smarttab " at start of line tabs chars set shiftwidth=2 " at start of line tabs 2 chars set ruler " show cursor position " The following eats gcc and SGI cc/CC set errorformat=%f:%l:%m,\"%f\"\\,\ line\ %l\:\ %m set magic " regular expressions the way I'm used to them set nobackup " don't clutter my account with *.bak! set writebackup " keep a backup copy during the edit session "set digraph " Enter ISO-8869-1 umlauts on US keyboards! set incsearch " Incremental search. set joinspaces " Join adds two spaces after a period. " I use the One True Brace Style set cinoptions=>s,{0,}0,?0,^0,:0,=s,p0,t0,+s,(0,)20,*30 " My key is screwed up set t_kD= " Let K ask Webster for the word under the cursor set keywordprg=webster " Sometimes I edit code with really weird indentation, like *three* " spaces and stuff like that... set shiftround " My message length preferences set shortmess=mrnto " I really hated this when Emacs did it ;) set showmatch " Oh I hate it when programs do things I didn't ask for set nostartofline " Setting the window title does not work good with screen set notitle " Some macros I can't do without map Q gq " Old habits never die map :make " Insert Reply-To header map ,r 1GoReply-To: leitner@math.fu-berlin.de " show the man page for the word under the cursor map ,m ya:!man " " try to delete signature by killing the last paragraph map ,ks Gd{ " append a cookie as random signature map ,s Go-- :r!fortune ~/comp.sigs " rot13 the marked text map ,D :!tr A-Za-z N-ZA-Mn-za-m " this awk script weeds away unwanted headers map ,w :/^$/,$!mawk -f ~/bin/weed2.awk " reformat the current paragraph map ,, Qp/^. " execute the command in the current line (minus the first word, which " is intended to be a shell prompt) and insert the output in the buffer map ,e ^wy$:r!" " Go figure this one out for yourself ;) map ,g :%s/## CrossPoint .*##$/## GrossPoint\/3 MultiActive InterMedia Gold PRO Plus for Windows95 9.02 ##/ 1G/^$/ j " Give the URL under the cursor to Netscape map ,n yA:!netscape -remote "openurl "" " Insert some ascii-art map ,a :r~/.ascii-art/ " Underline macro map ,u :s/./&_/g " Bold macro map ,b :s/./&&/g " Die, SuperCite, Die! vmap ,kpq :s/^> *[a-zA-Z]*>/> >/ " Some abbreviations for pointing people to my various pages and mirrors ;) abb prz prz.tu-berlin.de abb ffu ftp.fu-berlin.de abb fmutt ftp://ftp.fu-berlin.de/pub/unix/mail/mutt abb cnh http://www.prz.tu-berlin.de/~leitner/CnH/ abb p5 -O3 -pipe -funroll-loops -malign-jumps=2 -malign-loops=2 -malign-functions=2 abb unsub approve letiner unsubscribe " Weird keyboard mappings, pgup+pgdn, home+end map O 0 map Oe $ map O 0 map O $ map  j map [4~ $ map ,cv :%s//'/g :%s/[]/"/g map dp dap map yp yap vmap p ap vmap i d:new P:%s/[^ ]/&&/g :%y p " Nice autocommands: " Standard settings are: autoindent, wrap in column 72 autocmd BufEnter * set fo=tcq2l ai tw=72 nocin com& " cindent for C files autocmd BufEnter *.c,*.C,*.h,*.H,*.java set fo=croql cin autocmd BufEnter *.pl,*.cgi set fo=croql cin comments=n:# autocmd BufEnter /tmp/mutt[^/]*$ /^Subj/ " I use slrn as news reader. slrn uses the file names .followup, " .article and .letter. "ncom" is "nestedcomments". autocmd BufRead .followup,.article,.letter set fo=tcq comments=n:>,n::,n:,n:] " Delete Quotes on empty lines autocmd BufRead .followup %s/^> $// " Unfortunately, slrn does not understand aliases, so I run the header " of mails through expandmail (a Perl script that expands aliases " using my ELM aliases list) autocmd BufRead .letter 1,/^$/!perl ~/bin/expandmail " weed2.awk deletes unwanted Mail/News headers like X-Stardate: When I " forward something, I don't want the whole Path: list autocmd BufRead .letter 1;/^$/,$!mawk -f ~/bin/weed2.awk " Slrn quotes all lines when replying to mails (I don't want empty lines " quoted) and it quotes nothing when forwarding (I want every line " quoted when forwarding) autocmd BufRead .letter 1;/^$/+1,$!perl ~/bin/fixquoting.pl " Now position the cursor at the first line of the body. autocmd BufRead .followup,.article,.letter 1;/^$/+ " When editing my vimrc and exrc, the comment is " autocmd BufEnter .vimrc,.exrc set com=:\" " Makefiles and Polyray input files use "include" as include directive, " not #include autocmd BufEnter *.pi,[Mm]akefile* set include=^include autocmd BufLeave *.pi,[Mm]akefile* set include& " When editing my fortune collection, strfile it when done autocmd BufWritePost comp.sigs !strfile % " Enable editing of gzipped files. This comes straight from the vim " distribution and it served me well. " uncompress them after reading " compress them before writing, undone after writing " binary mode is needed when writing gzipped files autocmd BufRead *.gz set bin|%!gunzip autocmd BufRead *.gz set nobin autocmd BufWritePre *.gz %!gzip autocmd BufWritePre *.gz set bin autocmd BufWritePost *.gz undo|set nobin autocmd FileReadPost *.gz set bin|'[,']!gunzip autocmd FileReadPost set nobin if has("syntax") source $VIM/syntax/syntax.vim " The default methods for highlighting. Can be overridden later highlight Error term=reverse ctermbg=6 guibg=Red highlight Statement ctermfg=2 gui=bold guifg=Brown highlight PreCondit term=underline ctermfg=7 guifg=Purple highlight Type term=underline cterm=bold ctermfg=2 guifg=SeaGreen gui=bold highlight String term=italic ctermfg=3 guifg=Magenta gui=underline highlight Comment term=bold ctermbg=4 ctermfg=7 guifg=Blue highlight Special term=bold ctermfg=3 cterm=bold guifg=SlateBlue gui=underline highlight Todo term=standout ctermbg=3 ctermfg=0 guifg=Blue guibg=Yellow highlight Operator cterm=bold ctermfg=6 highlight Identifier term=underline ctermfg=2 guifg=DarkCyan highlight Function cterm=bold ctermfg=3 gui=bold guifg=Brown highlight PreCondit ctermfg=3 " highlight link Function Statement " temporarily au BufNewFile,BufReadPost,TermChanged *.H source $VIM/syntax/cpp.vim au BufNewFile,BufReadPost,TermChanged mutt* source $VIM/syntax/mail.vim endif