" {{{ General settings set nocompatible " Forget about (N)VI set noerrorbells " No annoying bells set vb t_vb= set hidden " allow buffer switching without saving " 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 "set statusline+=[%{strlen(&fenc)?&fenc:'none'}, " file encoding "set statusline+=%{&ff}] " file format " 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 r ^iReviewed-by: =$GIT_AUTHOR_NAME <=$GIT_AUTHOR_EMAIL>^ map! r Reviewed-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!   map :Files map :NERDTreeFind " Remove all trailing whitespaces in file map w :%s/\s\+$//^ map! w :%s/\s\+$// " Remove Mac/DOS line-breaks map lb :%s/ //^ map! lb :%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 ", " }}} " {{{ VIM LaTeX let g:Imap_UsePlaceHolders = 0 " }}} " {{{ Always use tabs in Makefiles autocmd BufEnter ?akefile* set noet ts=8 sw=8 nocindent " }}} " {{{ pathogen plugin execute pathogen#infect() " }}} " {{{ settings for bundles installed by pathogen " NERDTree autocmd vimenter * if !argc() | NERDTree | endif autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif let NERDTreeShowHidden=1 map nt :NERDTreeToggle " }}} " {{{ localvimrc plugin " disable sandbox to allow autocmd let g:localvimrc_sandbox=0 " don't ask before loading let g:localvimrc_ask=0 " }}} " {{{ vim-plug (https://github.com/junegunn/vim-plug) call plug#begin('~/.vim/plugged') " fzf (https://github.com/junegunn/fzf.vim) Plug 'junegunn/fzf', { 'do': './install --bin' } Plug 'junegunn/fzf.vim' call plug#end() " }}}