" $Id: vimrc,v 1.32 2007/02/10 18:58:51 tklauser Exp $ " {{{ General settings set nocompatible " Forget about (N)VI set noerrorbells " No annoying bells set vb t_vb= " Don't highlight search results " set nohlsearch " Type-ahead find set incsearch " Indent of 8, but no spaces set shiftwidth=8 set tabstop=8 " Allow backspacing over indentation, end-of-line and start-of-line set backspace=2 " smart autoindenting set smartindent " Paste toggle (a.k.a set paste/set nopaste) set pastetoggle= " Enable folding by fold markers set foldmethod=marker " Wrap line longer than the display "set wrap " Textwidth of 80 (Standard terminal) set tw=80 " Number of undo operations to store set undolevels=50 set laststatus=2 " Always show the statusline set ruler " Display ruler with cursor positions "set cursorline " Highlight the cursor line and column " Buffer, filename, line, total lines, column, ASCII value "set statusline=[%n]\ %f\ %m\ %l/%L,%c\ ASCII:\ %3b " maximum number of tabs to open set tabpagemax=20 set showmode set modeline set backupcopy=auto,breakhardlink filetype on " Enable filetype detection filetype indent on " Enable filetype specific indenting filetype plugin on " Enable filetype specific plugins au FileType c set cindent let g:git_diff_spawn_mode=2 " }}} " {{{ Colors and fonts set background=dark let g:solarized_termtrans=1 colorscheme solarized " Syntax highlighting if &t_Co > 2 || has("gui_running") syntax on endif " Highlight trailing whitespaces let c_space_errors=1 highlight WhitespaceEOL ctermbg=red guibg=red match WhitespaceEOL /\s\+$/ " }}} " {{{ Completion autocmd FileType c set omnifunc=ccomplete#Complete autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType php set omnifunc=phpcomplete#CompletePHP " }}} " {{{ Mappings let mapleader="," " Line numbering toggle nmap n :set invnumber "highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE map s ^iSigned-off-by: =$GIT_AUTHOR_NAME <=$GIT_AUTHOR_EMAIL>^ map! s Signed-off-by: =$GIT_AUTHOR_NAME <=$GIT_AUTHOR_EMAIL> map a ^iAcked-by: =$GIT_AUTHOR_NAME <=$GIT_AUTHOR_EMAIL>^ map! a Acked-by: =$GIT_AUTHOR_NAME <=$GIT_AUTHOR_EMAIL> map y ^iCopyright (C) =strftime("%Y") =$GIT_AUTHOR_NAME <=$GIT_AUTHOR_EMAIL>^ map! y Copyright (C) =strftime("%Y") =$GIT_AUTHOR_NAME <=$GIT_AUTHOR_EMAIL> map c i=strftime("%F %R") Tobias Klauser * map! c =strftime("%F %R") Tobias Klauser * map f ^iFrom: Tobias Klauser ^ map! f From: Tobias Klauser map :let &background = ( &background == "dark" ? "light" : "dark" ) map :! make map!   " Remove all trailing whitespaces in file map w :%s/\s\+$//^ map! w :%s/\s\+$// " Remove Mac/DOS line-breaks map l :%s/ //^ map! l :%s/ // " Navigate non-breaking lines more easily " from http://zinformatik.de/tipps-tricks/vim-tipps/einige-tipps-und-tricks-fur-vim/ noremap gj noremap gk " Thanks mikap! http://michael-prokop.at/computer/config/.vimrc map !f !perl -MText::Autoformat -e'autoformat' map ;0 :'<,'>!boxes map ;1 :'<,'>!boxes -d boxquote map ;2 :'<,'>!boxes -d peek -a c -s 40x5 map ;3 :'<,'>!boxes -d c-cmt map ;4 :'<,'>!boxes -d dog -a c map ;5 :'<,'>!boxes -d simple -a jr map ;6 :'<,'>!boxes -d headline map hon :%!xxd map hof :%!xxd -r " delete the text until start of the mail signature with ,k map k d/^-- $ " line numbering map ln :%s/^/\=line('.')/ " add a comment map mkc i/* */ " greet to the person you write a mail map a G/^\* /e+1ye1G}oHallo ", " }}} " {{{ Abbrevations ab mfg Mit freundlichen Grüssen " }}} " {{{ VIM LaTeX let g:Imap_UsePlaceHolders = 0 " }}} " {{{ VIM VHDL " for taglist let loaded_taglist = 'no' " disable for now let g:tlist_vhdl_settings = 'vhdl;d:package declarations;b:package bodies;e:entities;a:architecture specifications;t:type declarations;p:processes;f:functions;m:port maps;r:procedures' nnoremap :TlistToggle " }}} " {{{ Automatically create C header file skeletons augroup c autocmd BufNewFile *.h :0r! mkheader.py -s augroup END " }}} " {{{ localvimrc plugin " disable sandbox to allow autocmd let g:localvimrc_sandbox=0 " don't ask before loading let g:localvimrc_ask=0 " }}}