set nocompatible " be iMproved filetype off " required! set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'gmarik/Vundle.vim' Plugin 'closetag.vim' Plugin 'godlygeek/tabular' Plugin 'plasticboy/vim-markdown' Plugin 'scrooloose/nerdtree' Plugin 'comments.vim' Plugin 'browsereload-mac.vim' Plugin 'coffee.vim' Plugin 'vim-coffee-script' Plugin 'WebAPI.vim' Plugin 'Gist.vim' call vundle#end() " let Vundle manage Vundle " and don't put the comment on the same line """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " General behavior """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set autowrite " Speichert bei jedem :make, ;next, :rewind etc. set autoread if match($TERM, "screen")!=-1 set term=xterm endif set title " Set buffer name as terminal name " Schaltet syntax-highlighting und korrektes Einrücken an " und filetype spezifisches ein syntax on filetype plugin indent on " Vermeidet Probleme beim pasten aus dem Browser set paste " Stellt die Dateinamenerweiterung wie unter bash ein set wildmode=longest,list " Der Zeiger springt kurz zur öffnenden Klammer, wenn die schließende " eingegeben wird set showmatch set matchtime=1 " In diesem Fall 1/10 sek. set autoindent " automatic and smart indentation set smartindent set copyindent " Die Einrückweite pro Level set shiftwidth=4 " Ein Tab wird wie 2 Leerzeichen angezeigt und dank expandtab werden tabs " gleich als Leerzeichen eingefügt. set tabstop=4 set expandtab set softtabstop=4 set smarttab " Setzt die maximale Textbreite von Fließtext set linebreak set textwidth=66 " highlight lines that are to long " highlight OverLength ctermbg=red ctermfg=white guibg=#592929 " match OverLength /\%79v.\+/ " Wenn mit /suchwort gesucht wird, springt der Zeiger schon beim Eintippen set incsearch "Sucht standardmäßig ohne Groß- und Kleinschreibung zu unterscheiden set ignorecase "Blendet Zeileninformation ein set ruler "Blendet Formatierungszeichen ein set lcs=tab:>-,trail:-,nbsp:~ set nolist "Faltet automatisch neue Dateien nach Einrückung ein set foldmethod=indent "set foldcolumn=8 set foldlevel=8 set showcmd " Display an incomplete command in the lower right corner of the Vim window set mouse-=a " Disable mouse set mousehide " Hide mouse after chars typed """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Keyboard short cuts """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " change the mapleader from \ to , let mapleader="," "let mapleader=" " " Show trailing characters and such map st :set list " Quickly edit/reload the vimrc file nmap oc :e $MYVIMRC nmap rc :so $MYVIMRC " Shortcut for hypergit nmap g :ToggleGitMenu " Save files, close vim map w :w map x :x map q :q! " Shortcuts for NERD tree map n :NERDTree . " Simplify saving and closing of files "map :silent execute "!pdflatex % > /dev/null && xpdf -remote paper -reload > /dev/null &"ggG map :!% map :w map :x " Spellcheck, ignore tex comments map :set spell let g:tex_comment_nospell=1 " Shortcuts for ConqueTerm shell map sh :ConqueTermSplit bash map vsh :ConqueTermVSplit bash map py :ConqueTermSplit ipython map vpy :ConqueTermVSplit ipython " open MRU menu nnoremap m :MRU " NERDtree on t nnoremap t :NERDTree " remove trailing whitespace map rt :%s/\s\+$// map sp :set paste map fl a.format(**locals()) map up i#!/usr/bin/env pythonif __name__ == '__main__': map um i#!/usr/bin/env pythondef main(): passif __name__ == '__main__': main() map in iif __name__ == '__main__': " open FuzzyFinder map ff :FufFile " Have NERDTree alway open in the current folder set autochdir let NERDTreeChDirMode=2 " Setzt die Ergebnisse einer Stringsuche immer in die Mitte des Bildschirms nmap n nzzzv nmap N Nzzzv nmap * *zzzv nmap # #zzzv nmap g* g*zzzv nmap g# g#zzzv " Change windows size next to each other using <, > "nmap < "nmap > > " Einrücken der ganzen Datei mit -- fun! BenIndent() let oldLine=line('.') normal(gg=G) execute ':' . oldLine endfun map -- :call BenIndent() let g:AutoPairsFlyMode=1 let g:AutoPairsShortCutBackInsert='' """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Language specific behavior """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Fortran " Fixes 'bug' in wrong form recognition let fortran_free_source=1 let fortran_fold=1 "autocmd FileType fortran compiler ifort " Java Spezifisches let java_highlight_all=1 let java_highlight_functions="style" let java_allow_cpp_keywords=1 " LaTeX Spezifisches set iskeyword+=: "let g:Tex_Env_theorem "\\pspicture(0,0)(,)(,)\\\\endpspicture" let g:Tex_DefaultTargetFormat='pdf' let g:Tex_CompileRule='latex --interaction=nonstopmode $*' let g:Tex_CompileRule_ps='dvips -q -Ppdf -o $*.ps $*.dvi' let g:Tex_CompileRule_pdf='ps2pdf $*.ps' let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf' let g:Tex_IgnoredWarnings=' \"Underfull\n". \"Overfull\n". \"specifier changed to\n". \"You have requested\n". \"Missing number, treated as zero.\n". \"There were undefined references\n". \"Citation %.%# undefined\n" \"Unused global option"' autocmd Filetype html,xml,xsl source ~/.vim/scripts/closetag.vim ""Enables OmniComplete Toggeling with only Ctrl-n "set complete-=k complete+=k let NERDTreeIgnore=['\~$', '\.pyc$', '\.pyo$', '\.class$', 'pip-log\.txt$', '\.o$'] nnoremap " Function to automagically increase number of marked column fun! Incr() let l = line(".") let c = virtcol("'<") let l1 = line("'<") let l2 = line("'>") if l1 > l2 let a = l - l2 else let a = l - l1 endif if a != 0 exe 'normal '.c.'|' exe 'normal '.a."\" endif normal `< endfunction vnoremap :call Incr() "jump to last position when reopen autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Plugin specific behavior """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " OmniCompletion "Omni Completion für alle möglichen sprachen einschalten 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 "autocmd FileType c set omnifunc=ccomplete#Complete let g:SuperTabDefaultCompletionType = "context" set completeopt=menuone,longest,preview " for Goerz' sendToScreen gimmick autocmd BufNewFile,BufRead *.py let b:sendToProgramMode="ipython" let b:sendToProgramName="~/.vim/scripts/send2screen.py -S ipy1 " " settings for pydiction (Python tab completion) plugin) let g:pydiction_location="~/.vim/ftplugin/pydiction/complete-dict" let g:pydiction_menu_height=20 let g:tex_flavor='latex' "" for Go "filetype off "filetype plugin indent off "set runtimepath += "/usr/local/go/misc/vim" "filetype plugin indent on "syntax on let g:instant_markdown_slow = 1 " allow for better search and replace vnoremap s //e=&selection=='exclusive'?'+1':'' \:call histdel('search',-1)let @/=histget('search',-1)gv omap s :normal vs function! NumberToggle() if(&relativenumber == 1) set number else set relativenumber endif endfunc nnoremap :call NumberToggle()