"------------------------------------------------------- " .vimrc from Michael Kohl " " Last update: Mo 2009-01-26 11:47 " "------------------------------------------------------- "------------------------------------------------------- " TERMINAL ENCODING " ------------------------------------------------------ if ($TERM == "rxvt-unicode") && (&termencoding == "") set termencoding=utf-8 endif "------------------------------------------------------- " GENERAL SETTINGS "------------------------------------------------------- " No vi compatibility set nocompatible " Activate filetype detection, indentation etc. filetype on filetype indent on filetype plugin on " can delete everything in insert mode set backspace=eol,indent,start " Show current mode set showmode set showcmd " Show matching parentheses set showmatch " Incremental search set incsearch " No case sensitive search, unless explicitly " searching for uppercase letters set ignorecase set smartcase " Show context around cursor set scrolloff=2 set sidescrolloff=2 " completion on command line set wildmode=list:longest,full " Set command history to 50 lines set history=50 " Show cursor position set ruler " Show line numbersn set nu " Folding set foldenable set foldmethod=indent set foldlevel=1 set foldcolumn=1 " Activate linewrapping, but deactivate it for " comments (including Vim comments) set nowrap set comments+=b:\" set formatoptions-=t set textwidth=75 " Indent of 2 set shiftwidth=2 set softtabstop=2 set smartindent set autoindent " Only uses modeliens for secure Vim versions if (v:version == 603 && has("patch045")) || (v:version > 603) set modeline else set nomodeline endif "------------------------------------------------------- " USER INTERFACE "------------------------------------------------------- " Color scheme if has("gui_running") || &t_Co >= 88 colorscheme inkpot else colorscheme golden endif " Syntax highlighting in terminals with color support " and GVim if has("syntax") && (&t_Co > 2) || has("gui_running") syntax on endif " No menu und toolbar in GVim set guioptions-=m set guioptions-=T " Size of new GVim window if has("gui_running") set lines=40 set columns=80 endif "------------------------------------------------------- " Keys "------------------------------------------------------- " = page down, "-" = page up noremap noremap - " +n/+p jumps between files nnoremap :next nnoremap :prev " Run current file as Ruby program nnoremap :!ruby % " Correct one of my standard mistakes cabbrev Wq wq "------------------------------------------------------- " MacVim specific "------------------------------------------------------- " Set transparency for non active windows au FocusLost * set transp=50 au FocusGained * set transp=0 "------------------------------------------------------- " STATUSBAR " ------------------------------------------------------ set laststatus=2 set statusline= set statusline+=%-3.3n\ " buffer number set statusline+=%f\ " file name set statusline+=%h%m%r%w " flags set statusline+=\[%{strlen(&ft)?&ft:'none'}, " filetype set statusline+=%{&encoding}, " encoding set statusline+=%{&fileformat}] " file format set statusline+=%= " right align set statusline+=0x%-8B\ " current char set statusline+=%-10.(%l,%c%V%)\ %<%P " offset "------------------------------------------------------- " AUTOCOMMANDS "------------------------------------------------------- " Update .*rc header fun! UpdateRcHeader() let l:c=col(".") let l:l=line(".") 1,4s-\(Last update:\).*-\="Last update: ".strftime("%a %Y\-%m\-%d %R")- call cursor(l:l, l:c) endfun " My autocommands augroup citizen428 autocmd! " Automatically update headers of vimrc and bashrc autocmd BufWritePre *vimrc :call UpdateRcHeader() autocmd BufWritePre *bashrc :call UpdateRcHeader() augroup END "------------------------------------------------------- " PLUGINS "------------------------------------------------------- " taglist.vim let Tlist_Use_Right_Window=1 let Tlist_Auto_Open=0 let Tlist_Enable_Fold_Column=0 let Tlist_Compact_Format=1 let Tlist_WinWidth=28 let Tlist_Exit_OnlyWindow=1 let Tlist_File_Fold_Auto_Close = 1 nnoremap :Tlist " minibufexpl.vim let g:miniBufExplModSelTarget = 1 let g:miniBufExplWinFixHeight = 1