""" hanumizzle's .vimrc """ vim:foldmethod=marker " General {{{1 " set encoding=utf-8 filetype plugin indent on syntax enable " 1337 coloring if has('gui_running') colorscheme desert else colorscheme ron endif " Other basic GUI options set guifont=Monospace\ 12 " Larger font set guioptions-=T " I find the toolbar useless " Default filetype is text autocmd BufRead,BufNewFile * setfiletype text autocmd FileType text setlocal autoindent textwidth=78 formatoptions+=n " Indentation {{{1 " I hate tabs ... huge indents are also terrible set expandtab shiftwidth=2 softtabstop=2 " Python conventions request a four-space indent, but I still like two-space " indent " autocmd FileType python setlocal shiftwidth=4 softtabstop=4 " Persistence {{{1 " Preserve a lot of information and long history; see the user manual for " full details set viminfo=<1024,%,'1024,/1024,:1024,@1024,c,f1 set sessionoptions=buffers,curdir,folds,localoptions,options,resize autocmd VimLeave * mksession! ~/.vim/session.vim " Backup {{{1 " Backup files and try local .backup directory before $HOME set backup backupdir=./.backup,~/.backup " Try to make a .backup directory if possible autocmd BufWritePre * call system('mkdir ' . expand(':p:h') . '/.backup') " Keymapping {{{1 let maplocalleader='_' " Open a file in the current directory noremap e :e =expand('%:p:h') . '/' noremap s :split =expand('%:p:h') . '/' " Wrap the current paragraph noremap w gwip " Search highlighting gets annoying noremap c :nohlsearch " This one came from Salman Halim on the vim mailing list back in the day; " executes all currently selected Vim script lines function! Vim_execute() execute getline('.') endfunction autocmd FileType vim noremap v :call Vim_execute() " C-w = (equalize window size) should ignore -MiniBufExplorer-, so this quick " hack will take care of it noremap = :CMiniBufExplorer=:MiniBufExplorer " Emacs-style keybindings for cmdline cnoremap cnoremap cnoremap cnoremap cnoremap cnoremap cnoremap cnoremap " Completion {{{1 " I hate cycling matches set wildmode=list:longest " MiniBufExplorer {{{1 let miniBufExplTabWrap = 1 let miniBufExplSplitBelow = 0 let miniBufExplMaxSize = 4 " taglist {{{1 let Tlist_Use_Horiz_Window = 1 let Tlist_WinHeight = 10 " Miscellaneous {{{1 set incsearch hlsearch " Incremental and highlighted search set nowrap " Don't soft wrap long lines set showmatch matchtime=4 " Show matching parentheses " Allow back space over auto-indent and past start of insertion set backspace=start,indent set winaltkeys=no " Don't use Alt keys for menu set visualbell " *beep* *beep* *beep* is a good way to annoy your roommate