" =================================================================== " .vimrc Author: Domingo Stephan 2006-2008 ischeriad at gmail dot com " =================================================================== " Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect. set nocompatible " allow backspacing over everything in insert mode set backspace=indent,eol,start set history=50 " keep 50 lines of command line history set showcmd " display incomplete commands set incsearch " do incremental searching " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") syntax on set hlsearch endif if has("gui_running") " settings for MacVim on MacBook, almost full screen set background=light colorscheme vcbc set gfn=Monaco:h12 set gcr=a:blinkon0 set columns=180 set lines=45 else colorscheme impact endif " Only do this part when compiled with support for autocommands. if has("autocmd") " Put these in an autocmd group, so that we can delete them easily. augroup vimrcEx au! " For all text files set 'textwidth' to 78 characters. autocmd FileType text setlocal textwidth=78 " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif autocmd BufReadPre *.doc set ro autocmd BufReadPre *.doc set nohlsearch autocmd BufReadPost *.doc %!antiword "%" autocmd BufReadPre *.rtf set ro autocmd BufReadPre *.rtf set nohlsearch autocmd BufReadPost *.rtf %!unrtf --text "%" autocmd BufReadPre *.pdf set ro autocmd BufReadPost *.pdf %!pdftotext -nopgbrk "%" - |fmt -csw78 " german left and right single quotes in .tex files autocmd BufReadPre *.tex imap 'l \glq autocmd BufReadPre *.tex imap 'r \grq autocmd BufEnter *.php setlocal autoindent augroup END else set autoindent " always set autoindenting on endif " has("autocmd") set ruler set scrolloff=3 " Keep 3 lines above and below cursor set tabstop=4 " I don't like to insertactual tabs set softtabstop=2 set shiftwidth=2 set expandtab filetype plugin indent on set grepprg=grep\ -nH\ $* set enc=utf8 set fenc=utf8 set termencoding=utf8 set backup set backupdir=./.backup,.,/tmp set directory=.,./.backup,/tmp set listchars=tab:>-,trail:~ set list set linebreak " if wrap is set, and list is not, don't break within words " toggle listchars / linebreak nnoremap :set list! " forces me to use hjkl in normal mode map map map map " " key bindings " " for pasting indented text " set pastetoggle= " already taken in OS X set pastetoggle= " maximize splits and switch between them set wmh=0 map j_ map k_ " for fast fingers map :Q :q " bindings for supercollider. Not working yet " source ~/.scvimrc set wildmenu set wildmode=longest:list,full " clear highlight after search by pressing nnoremap :nohls