" #############\ " vim settings # " --------------------------------------------------------------------------------------------------------------------------------+ " 1) important options " | " nocp - do not force vi-compatible mode " | set nocompatible " noim - do not start in insertion mode " | set noinsertmode " do not start in paste mode, use pastetoggle to invert this setting " | set nopaste " should this really be F4 ? " | set pastetoggle= " | " 2) positioning, searching, patterns " | " ic - search without considering lower and upper letters " | set ignorecase " inc - show parts of found strings when typing search string " | set incsearch " ws - when reaching EOF, search from the beginning " | set wrapscan " ww - when on end of line, only space is able to jump to the next line; same for backspace when on the beginning of a line " | set whichwrap="b,s" " | " 3) tags " | " | " 4) display / layout " | " ch - number of lines for ex-commandos " | set cmdheight=1 " lbr - long lines will not be broken (word boundary) " | set nolinebreak " nu - show line numbers " | set number " scr - number of lines to jump over with CTRL-D / CTRL-U " | set scroll=30 " so - minimum number of lines above / below cursor! " | set scrolloff=5 " cul - set cursorline for gvim but not for vim " | if has("gui_running") set nocursorline endif " | " 5) syntax / higlighting " | " bg - light or dark " | set background=dark " | " 6) multiple windows " | " | " 7) terminal " | " | " 8) mouse " | " | " 9) gui " | " lsp - number of pixel between lines " | set linespace=0 " | " 10) printing " | " | " 11) messages, informations " | " eb - piep on error " | set errorbells " ru - show row and column of cursor " | set ruler " sc - do not type in commands blindly " | set showcmd " smd - show mode (insert or replace) " | set showmode " vb - do an acoustic signal instead of a visual one " | set novisualbell " | " 12) select text " | " | " 13) edit text " | " tw - maximum number of lines for inserted text " | set textwidth=0 " sm - jump shortly to the according parenthesis " | set showmatch " ul - number of undo-levels " | set undolevels=1000 " js - do only one space after joining two lines whereby the first line ends on ., ? or ! " | set nojoinspaces " | " 14) tab / indenting " | " indentation based on previous line " | set autoindent " activate indentation for C programs " | set cindent " ts - distance for a tab " | set tabstop=4 " sw -shift width for automatic indentation " | set shiftwidth=4 " if you really do want no indentation: " | " :set noautoindent " | " :set nosmartindent " | " :set nocindent " | " delete the line :filetype indent on " | " | " 15) folds " | " | " 16) diffs " | " | " 17) keyboard, encoding " | " enc - internally used encoding " | " set encoding=utf-8 " fenc - overwrites encoding for multibytes files " | " set fileencoding=utf-8 " tenc - encoding of the terminal " | " set termencoding=utf-8 " " | " this is from http://vim.wikia.com/wiki/Working_with_Unicode " | " thus, we do not the lines above " | " " | " hint #1: how do you do an a with a grave (à): press CTRL-K, then a, then ! " | " " | " hint #2: Reloading a file using a different encoding: :e ++enc= " | " " | if has("multi_byte") if &termencoding == "" let &termencoding = &encoding endif set encoding=utf-8 setglobal fileencoding=utf-8 bomb set fileencodings=ucs-bom,utf-8,latin1 endif " | " 18) read / write files " | " ar - do not automatically read in file after being changed from outside " | set noautoread " aw - do not automatically write file when buffer has changed " | set noautowrite " bk - do not make any backup files " | set nobackup " mls - number of modelines which shall be recognised (lines which are interpreted as vim settings) " | set modelines=0 " acd - don't change directory when opening / closing files - some plugins do not work with this enabled " | set noautochdir " | " 19) swap file " | " | " 20) edit commando lines " | " | " 21) invoke external commands " | " | " 22) make and error handling " | " | " 23) language specifig " | " | " 24) several " | " | " file reading / writing " | " bk - I do not want to fill up my hard disk with backup files " | set nobackup " | filetype plugin on filetype indent on set grepprg=grep\ -nH\ $* let &errorformat="%f:%l: %t%*[^:]:%m," . &errorformat " --------------------------------------------------------------------------------------------------------------------------------+ " END OF vim settings / " #################### " ########### " statusbar # " ----------------------------------------------------------------------------------------------------------------+ set laststatus=2 " first of all it's empty " | set statusline= " buffer number " | set statusline+=%-3.3n\ " file name " | set statusline+=%f\ " flags " | set statusline+=%h%m%r%w " filetype " | set statusline+=\[%{strlen(&ft)?&ft:'none'}, " just print out enc(oding) " | set statusline+=%{&encoding}, " this is a much more complicated one " | set statusline+=%<%f\ %h%m%r%=%k[%{(&fenc\ ==\\"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}]\ %-12.(%l,%c%V%)\ %P " file format " | set statusline+=%{&fileformat}] " right align " | set statusline+=%= " current char as hex " | set statusline+=0x%-8B\ " line number, column numbers " | set statusline+=%-14.(%l,%c%V%)\ %<%P " ----------------------------------------------------------------------------------------------------------------+ " END OF statusbar / " ################# " ############## " abbreviations \ " ----------------------------------------------------------------+ " ab stands for normal mode abbreviations " | " iab stands for insertion mode abbreviations " | " " | " some mail stuff " | iab MFG mit freundlichen GrüßenAndreas Leppert " | " java stuff " | iab syso System.out.println " | " some html stuff for my homepage " | iab precode
3bi iab ahref 2b2li iab iitalic 2b2li iab spanmark 2b2li iab brr
" ----------------------------------------------------------------+ " END OF abbreviations / " ##################### " #########\ " mappings # " --------------------------------------------------------------------------------------------------------------------------------------------------------------------+ nmap :set tw=80gqap:set tw=0 " map :!./%< " | " nmap gqap " | map :set spellfile=~/.vim/spellfile.de.add:set spelllang=de:set spell!:echo "German spell check: " . strpart("OffOn", 3 * &spell, 3) map :set spellfile=~/.vim/spellfile.en.add:set spelllang=en_us:set spell!:echo "English spell check: " . strpart("OffOn", 3 * &spell, 3) " | nnoremap :TlistToggle map :WMToggle nnoremap "_yiwi"ea" "set treeExplVertical=1 " | " | map jddO"ddk map :set makeprg=gcc\ -Wall\ -o\ %<\ %:w:make:set makeprg=make map :set makeprg=mpicc\ -std=c99\ -Wall\ -W\ -o\ %<\ %:w:make:set makeprg=make map :!scp % prp10@carla.ipd.uka.de:uebungsdateien/ map :!exuberant-ctags -R * " | " some haskell stuff for GHC " | map :make map :copen map :cclose " | map :FirstExplorerWindow map :BottomExplorerWindow " --------------------------------------------------------------------------------------------------------------------------------------------------------------------+ " END OF mappings / " ################ " #######################\ " user-defined functions # " ----------------------------------------------------------------------------------------+ " | "delete the buffer; keep windows " | function Kwbd(kwbdStage) if(a:kwbdStage == 1) let g:kwbdBufNum = bufnr("%") let g:kwbdWinNum = winnr() windo call Kwbd(2) execute "bd! " . g:kwbdBufNum execute "normal " . g:kwbdWinNum . "" else if(bufnr("%") == g:kwbdBufNum) let prevbufvar = bufnr("#") if(prevbufvar > 0 && buflisted(prevbufvar) && prevbufvar != g:kwbdBufNum) b # else bn endif endif endif endfunction " | " Tag Formatter Function /*{{{*/ " | " " | " Author: David Fishburn " | " usage: :FormatSGML " | " " | function! Format_SGML() range " | " Add a new line to the bottom of the mark to be removed later " | call cursor(a:lastline,1) put ='' silent! exec "ma z" " | " Add a new line above the mark to be removed later " | call cursor(a:firstline,1) put! = '' silent! exec "ma y" " | " Put each tag on a newline " | exec line("'y").','.line("'z").'s/>\s*\r,call Format_SGML() " /*}}}*/ " | " ----------------------------------------------------------------------------------------+ " END OF user-defined functions / " ############################## " ####################\ " haskellmode for vim # " ------------------------------------------------------------------------+ " http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/ " | " | " use ghc functionality for haskell files " | au BufEnter *.hs compiler ghc " | " configure browser for haskell_doc.vim " | let g:haddock_browser="/usr/bin/firefox" let g:haddock_docdir="/mnt/storage/code/haskell/haskell.org/" " let g:haddock_browser="/usr/bin/elinks" " | " let g:haddock_browser_callformat="%s file://%s >/dev/null 2>&1 &" " | " ------------------------------------------------------------------------+ " END OF haskellmode / " ################### " #################\ " miniBuf settings # " --------------------------------------------+ let g:miniBufExplMapWindowNavArrows = 1 let g:miniBufExplMapCTabSwitchBufs = 1 let g:miniBufExplUseSingleClick = 1 " --------------------------------------------+ " END OF miniBuf / " ############### " ################\ " c.vim setttings # " ----------------------------------------------------------------+ " http://vim.sourceforge.net/scripts/script.php?script_id=213 " | " | " let g:C_AuthorName = 'Andreas Leppert' " | " let g:C_AuthorRef = 'Al' " | " let g:C_Email = 'wudmx@web.de' " | " let g:C_Company = 'Uni Karlsruhe' " | " ----------------------------------------------------------------+ " END OF c.vim / " ############# " TODO " ich sollt mal ueberlegen, ob ich gewisse leader mache fuer aktionen wie " tabs, andere leader fuer ghc sachen, etc. ,X z.b. fuer tab etc. " nmap n :tabnew " nnoremap t :tabnew " C-W T makes a new tab out of a window (if there are more than one window " alive) " CTRL-W_gf to open a file under the cursor in a new tab " ############\ " FuzzyFinder # " ----------------------------------------------------------------------------+ " in the given file list, press " | " - Return to open the file in the current buffer " | " - F1 to open the file in a new window " | " - F2 to open the file in a new vertical split window " | " when a FuzzyFinder is open, use " | " - F12 to change the mode (File, Mru, Favorites, Buffer) " | " - F11 to change to in-sensitive / sensitive pattern recognition " | nnoremap :FuzzyFinderFile nnoremap :FuzzyFinderMru nnoremap :FuzzyFinderBuffer " ----------------------------------------------------------------------------+ " END OF FuzzyFinder / " ################### " ######################\ " compview.vim settings # " --------------------------------------------------------------------+ " to get a search input field " | " in the created buffer use " | " q to quit the buffer " | " e to quit the buffer, but let the buffer opened " | " Return to quit the buffer and put the cursor on the found line " | " --------------------------------------------------------------------+ " END OF compview / " ################ " #####################\ " matchit.vim settings # " --------------------------------------------------------------------+ " % cycle forward through matching groups " | " g% cycle backwards " | " --------------------------------------------------------------------+ " END OF matchit / " ###############