" Last modified: 2010-03-19 17:30:50 CET " some useful keyboard commands noremap :wq noremap :w noremap :q! noremap :!make set pastetoggle= " general options set nocp set modelines=5 set ruler set sw=2 set showmode set whichwrap="" set nojoinspaces "set encoding=iso-8859-15 set autowrite set incsearch set ai set sm set hlsearch set background=dark "set nonu nu " Set textwidth to 72 for mail and news au FileType mail set tw=70 "au BufRead mutt*,.article,.followup,.letter set tw=72 " some programming things syntax on set makeprg=make\ %< au BufRead,BufNewFile *.[chly],*.cc,*.hh,*.cpp set cindent au BufRead,BufNewFile *.py set ts=4 "au BufRead,BufNewFile *.java set cindent au BufRead,BufNewFile *.lisp set lisp " remove/delete trailing whitespace: nmap ;tr :%s/\s\+$// vmap ;tr :s/\s\+$// " timestamps iab YDATE =strftime("%Y-%m-%d %T %Z") " update command UpdateTimestamp execute "normal 1G/Last modified:[ \t]\s*/e+1CYDATE#" " update with faked save-excursion function! UpdateTimestampFun() let save_cursor = getpos(".") UpdateTimestamp call setpos('.', save_cursor) endfunction " keyboard command map ,L :call UpdateTimestampFun() " automatically update for files containing the timestamp (presumably) au BufWritePre * if search("Last modified:\s*", "wn") | call UpdateTimestampFun() | endif " homepage: insert links.html item map ,i o
  • -
  • ^f"a " When editing a file, always jump to the last cursor position autocmd BufReadPost * if line("'\"") && line("'\"") <= line("$") | exe "normal `\"" | endif " comment out function map cf {i/*}i*/ " comment out line map cl ^i/*$a*/ map cul ^2x$xx