set nocompatible syntax on filetype on filetype indent on filetype plugin on set foldmethod=indent set autoread set vb set et set sw=2 set tw=80 set smarttab set nu set sm set mouse=a set spelllang=de,en set sps=10 let g:netrw_liststyle = 3 " Enable emenu source $VIMRUNTIME/menu.vim set wildmenu set cpo-=< set wcm= " Map opening of emenu to map :emenu "======================================================= " from http://items.sjbach.com/319/configuring-vim-right "======================================================= " Allow switching edited buffers without saving set hidden " Remap so we always jump to the right line _and_ column nnoremap ' ` nnoremap ` ' " Redefine the leader key, default is '\' " let mapleader = "," " History of remembered commands set history=1000 " Make % not only match opening and closing brackets but also if/then/else etc. runtime macros/matchit.vim " Complete only up to point of ambiguity (like in shell) when hitting TAB set wildmode=list:longest " Faster viewport scrolling nnoremap 3 nnoremap 3 "======================================================= " From vim.wikia.com "======================================================= " Easily switch to directory of current file map cd :cd %:p:h " Redefine the status line :set statusline=%(%F%m%r%h%w\%)%=%([TYPE=%Y]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]%) :set laststatus=2 " Toggle the TList showing code functions etc. nnoremap :TlistToggle let Tlist_Use_Right_Window = 1 let g:proj_flags = "fgimst" " Mappings to make CTRL-PageUp -PageDown work with Thinkpad and Vim nmap [5^ nmap [6^ " Compiler settings for .mxml and .as files autocmd BufNewFile,BufRead *.mxml compiler flex autocmd BufNewFile,BufRead *.as compiler flex " Disable conversion of " to `` etc. by latex-suite let g:Tex_SmartKeyQuote = 0 " Compile with pdflatex by default let g:Tex_DefaultTargetFormat = "pdf" " Preferred PDF viewer let g:Tex_ViewRule_pdf = "evince" " Abbreviations ab mfg Mit freundlichen GrüßenPatrick Hof map mw QuickFixNote map me QuickFixSave " Mark something in visual mode and hit 'gl' to automatically run an 'svn blame' for " these lines vmap gl :!svn blame =expand("%:p") \| sed -n =line("'<") ,=line("'>") p " Allows to read PDF files with VIM by piping them through pdftotext autocmd BufReadPre *.pdf set ro autocmd BufReadPost *.pdf silent %!pdftotext -nopgbrk "%" - |fmt -csw78 " Same for word files with antiword autocmd BufReadPre *.doc set ro autocmd BufReadPost *.doc %!antiword "%" " For the YankRing plugin: Show the elements currently in the YankRing nmap yr :YRShow " Setting my own tabline. See " http://eseth.org/filez/prefs/vimrc set showtabline=1 " }}} " MyTabLine {{{ " This is an attempt to emulate the default Vim-7 tabs as closely as possible but with numbered tabs. if exists("+showtabline") function! MyTabLine() let s = '' for i in range(tabpagenr('$')) " set up some oft-used variables let tab = i + 1 " range() starts at 0 let winnr = tabpagewinnr(tab) " gets current window of current tab let buflist = tabpagebuflist(tab) " list of buffers associated with the windows in the current tab let bufnr = buflist[winnr - 1] " current buffer number let bufname = bufname(bufnr) " gets the name of the current buffer in the current window of the current tab let s .= '%' . tab . 'T' " start a tab let s .= (tab == tabpagenr() ? '%#TabLineSel#' : '%#TabLine#') " if this tab is the current tab...set the right highlighting let s .= ' ' . tab " current tab number let n = tabpagewinnr(tab,'$') " get the number of windows in the current tab if n > 1 let s .= ':' . n " if there's more than one, add a colon and display the count endif let bufmodified = getbufvar(bufnr, "&mod") if bufmodified let s .= ' +' endif if bufname != '' let s .= ' ' . pathshorten(bufname) . ' ' " outputs the one-letter-path shorthand & filename else let s .= ' [No Name] ' endif endfor let s .= '%#TabLineFill#' " blank highlighting between the tabs and the righthand close 'X' let s .= '%T' " resets tab page number? let s .= '%=' " seperate left-aligned from right-aligned let s .= '%#TabLine#' " set highlight for the 'X' below let s .= '%999XX' " places an 'X' at the far-right return s endfunction set tabline=%!MyTabLine() endif " Toggle the zenburn colorscheme from low to high contrast and vice versa function! s:toggleHighContrast() if exists("g:zenburn_high_Contrast") unlet g:zenburn_high_Contrast else let g:zenburn_high_Contrast = 1 endif colorscheme zenburn endfunction colorscheme zenburn map :call toggleHighContrast() filetype plugin indent on