" Configuration file for vim set nocompatible filetype off set rtp+=~/.vim/bundle/vundle/ call vundle#rc() " let Vundle manage Vundle " required! Bundle 'gmarik/vundle' Bundle 'clang-complete' Bundle 'matchit.zip' " \cc .. commit to repository " \ca .. add to repository " \cD .. delete from repository " \cs .. status of repository " \cd .. show diff " \cv .. show vimdiff " \cl .. show log Bundle 'git://repo.or.cz/vcscommand' " :BundleList - list configured bundles " :BundleInstall(!) - install(update) bundles " :BundleSearch(!) foo - search(or refresh cache first) for foo " :BundleClean(!) - confirm(or auto-approve) removal of unused bundles " " see :h vundle for more details or wiki for FAQ " NOTE: comments after Bundle command are not allowed.. "show options when pressing tab set wildmenu set wildmode=list:longest "sometimes used temporary: "set paste set textwidth=72 set ic "for cmake: "set makeprg=make\ --no-print-directory\ -C\ build " Out of tree builds "set makeprg=make\ --no-print-directory\ -C\ ../build " Inside the src folder "set makeprg=make\ --no-print-directory\ -C\ ../../build " Below the src folder "set makeprg=make\ --no-print-directory\ -C\ ../../../build " twice below "set makeprg=make\ --no-print-directory\ -C\ /home/markus/Projekte/Elektra/current/build set backupdir=~/tmp,/var/tmp,/tmp,. set directory=~/tmp,/var/tmp,/tmp,. set dictionary=/usr/share/dict/words set complete=i set tags=/home/markus/.ctags,.ctags set path=.,H,DLL,include,/usr/include "do not modify runtimepath, instead use vim-addons install.. "set runtimepath=~/.vim,/usr/share/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim72,/usr/share/vim/vimfiles/after,~/.vim/after " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements syntax enable "grey tab markers set listchars=tab:>-,trail:. set list highlight SpecialKey ctermbg=Black ctermfg=DarkGrey "reox tipps set nu "map :'<,'>!xclip "vmap "*y "map :r!xclip -o au! Syntax {cpp,c,idl} au Syntax {cpp,c,idl} runtime syntax/doxygen.vim filetype on set spell " Use spell correction set nocompatible " Use Vim defaults instead of 100% vi compatibility set backspace=indent,eol,start " more powerful backspacing set cindent "set textwidth=0 " Don't wrap words by default set nobackup " Don't keep a backup file set viminfo='20,\"1000 " read/write a .viminfo file, don't store more than " 1000 lines of registers set history=1000 " keep 1000 lines of command line history set ruler " show the cursor position all the time hi SpellBad ctermfg=White ctermbg=Black cterm=underline hi SpellCap ctermfg=White ctermbg=Black cterm=underline " Set xterm title "set title " Copy and paste for X " You need to install xsel for it " (even without X support. If you have X support use the * register) command -range Xc :silent :,w !xsel -i command -range Xp :silent :r !xsel -o " Define shortcuts " (is needed because user commands must start uppercase) ca xc Xc ca xp Xp " Suffixes that get lower priority when doing tab completion for filenames. " These are files we are not likely to want to edit or read. set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc " Debian uses compressed helpfiles. We must inform vim that the main " helpfiles is compressed. Other helpfiles are stated in the tags-file. " set helpfile=$VIMRUNTIME/doc/help.txt " For reportbug augroup filetype au BufRead reportbug.* set ft=mail au BufRead reportbug-* set ft=mail augroup END " The following are commented out as they cause vim to behave a lot " different from regular vi. They are highly recommended though. set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set incsearch " Incremental search set autowrite " Automatically save before commands like :next and :make set hls " Make highlights coloured set magic " Interprets '*.' in patterns " Functions let spellst = ["de", "en_gb"] let langcnt = 0 function Sel_lang() let g:langcnt = (g:langcnt+1) % len(g:spellst) let lang = g:spellst[g:langcnt] " echo "language " . lang . " selected" exe "set spelllang=" . lang endfunction " Choose german as default "call Sel_lang() "call Sel_lang() " http://vim.wikia.com/wiki/Search_across_multiple_lines " Search for the ... arguments separated with whitespace (if no '!'), " or with non-word characters (if '!' added to command). function! SearchMultiLine(bang, ...) if a:0 > 0 let sep = (a:bang) ? '\_W\+' : '\_s\+' let @/ = join(a:000, sep) endif endfunction command! -bang -nargs=* -complete=tag S call SearchMultiLine(0, )|normal! // " use :S or :S! "From gentoo: " When editing a file, always jump to the last cursor position autocmd BufReadPost * \ if ! exists("g:leave_my_cursor_position_alone") | \ if line("'\"") > 0 && line ("'\"") <= line("$") | \ exe "normal g'\"" | \ endif | \ endif " Mappings map " next word map " prev word nmap l :call Sel_lang() nmap :tabprevious map :tabprevious imap :tabprevious nmap :tabnext map :tabnext imap :tabnext nmap :tabnew imap :tabnew " \ has an awkward position on german keyboards, so lets use something else! let mapleader="," map " Follow _L_ink on Ctrl+l