filetype plugin on filetype indent plugin on autocmd FileType c set omnifunc=ccomplete#Complete " set UTF-8 encoding set enc=utf-8 set fenc=utf-8 set termencoding=utf-8 " disable vi compatibility (emulation of old bugs) set nocompatible " use indentation of previous line autocmd FileType c set autoindent " use intelligent indentation for C autocmd FileType c set smartindent " configure tabwidth and insert spaces instead of tabs set tabstop=4 " tab width is 4 spaces set shiftwidth=4 " indent also with 4 spaces set expandtab " expand tabs to spaces " wrap lines at 120 chars. 80 is somewaht antiquated with nowadays displays. set textwidth=120 " turn syntax highlighting on set t_Co=256 syntax on colorscheme torte " turn line numbers on set number " highlight matching braces set showmatch " intelligent comments "set comments=sl:/*,mb:\ *,elx:\ */ " Install OmniCppComplete like described on http://vim.wikia.com/wiki/C++_code_completion " This offers intelligent C++ completion when typing ‘.’ ‘->’ or " Load standard tag files set tags+=~/.vim/tags/cpp set tags+=~/.vim/tags/gl set tags+=~/.vim/tags/sdl set tags+=~/.vim/tags/qt4 set tags+=~/pvt/pvt/tags " Enhanced keyboard mappings " " switch between header/source with F4 map :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp, " recreate tags file with F5 map :!ctags -R –c++-kinds=+p –fields=+iaS –extra=+q . " create doxygen comment map :make " build using makeprg with map :make clean all " goto definition with F12 map " in diff mode we use the spell check keys for merging if &diff " diff settings map ]c map [c map do map dp map :new:read !svn diff:set syntax=diff buftype=nofilegg else " spell settings ":setlocal spell spelllang=en " set the spellfile - folders must exist " set spellfile=~/.vim/spellfile.add map ]s map [s endif let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" if &term == "screen" set t_ts= endif if &term == "screen" || &term == "xterm" set title endif if &term== "screen-bce" silent !screen -X title % >/dev/null autocmd VimLeave * silent !tmux rename-window $PWD >/dev/null endif set cot=menu au FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4 au FileType python setlocal foldmethod=indent au FileType c setlocal foldmethod=syntax " Shortcut to rapidly toggle `set list` nmap l :set list! " " " Use the same symbols as TextMate for tabstops and EOLs set listchars=tab:▸\ ,eol:¬ " set pastetoggle= set statusline=%t\ %y\ format:\ %{&ff};%=\ [%c,%l] set laststatus=2 autocmd VimLeave * silent set notitle autocmd VimLeave * silent !tmux rename-window $PWD >/dev/null