"-------------------------------------------------- " General "-------------------------------------------------- set nocompatible syntax on filetype plugin indent on set smarttab set autoindent set autowriteall set history=1000 set shortmess=atI set showmatch set matchtime=3 set incsearch set nohlsearch set laststatus=2 set pastetoggle= set smartcase set ttyfast set shell=zsh set tabstop=4 set shiftwidth=4 set expandtab set softtabstop=4 set formatoptions=tcq set showcmd set mousemodel=popup set background=dark set nu set browsedir=last set mouse=a set updatetime=2000 set grepprg=grep\ -nH\ $* set printoptions=paper:letter set undolevels=10000 set textwidth=76 "-------------------------------------------------- " GUI options "-------------------------------------------------- set guioptions=aemgith set guifont=Monaco:h12 if has("gui_running") set lines=50 set columns=140 set macatsui endif "-------------------------------------------------- " Theme "-------------------------------------------------- if has("gui_running") colorscheme desert else colorscheme default endif " Files/Backups set backup set backupdir=~/.vi_backups set backupext=.bak "-------------------------------------------------- " Vim UI "-------------------------------------------------- set backspace=2 set noerrorbells set visualbell set ruler set nowrap set ch=1 " Keymappings " ---------------------------- nnoremap :TlistToggle nnoremap :MRU inoremap # X# map ,# :s/^/#/ map ,! :s/^/!/ :map! " tab navigation like safari " idea adopted from: http://www.vim.org/tips/tip.php?tip_id=1221 :nmap :tabprevious :nmap :tabnext :nmap :tabprevious :nmap :tabnext :imap :tabpreviousi :imap :tabnexti :nmap :tabnew :imap :tabnew :nmap :tabclose :imap :tabclose map 1gt map 2gt map 3gt map 4gt map 5gt map 6gt map 7gt map 8gt map 9gt " autocmds autocmd BufEnter * lcd %:p:h " python autocmd BufRead *.py set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\" autocmd BufRead *.py set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m autocmd BufRead *.py nmap :!python % autocmd BufRead *.py nmap :!pychecker % " taglist let Tlist_Compact_Format=1 let Tlist_Enable_Fold_Column=0 let Tlist_File_Fold_Auto_Close=1 let Tlist_Show_One_File=1 let Tlist_Sort_Type="name" let Tlist_Use_SingleClick=1 let Tlist_Process_File_Always=1 let Tlist_Exit_OnlyWindow=1 let Tlist_WinWidth=30 let Tlist_Auto_Open=0 let Tlist_Auto_Highlight_Tag=1 let Tlist_Auto_Update=1 let Tlist_Display_Tag_Scope=1 let Tlist_Highlight_Tag_On_BufEnter=1 "let Tlist_Show_Menu=1 " EnhCommentify let EnhCommentifyUseAltKeys='yes' " MRU let MRU_FILE = '$HOME/.vim_mru' let MRU_Max_Entires = 20 let MRU_Window_Height = 15 if version >= 600 set foldenable "set foldmethod=indent "set foldcolumn=2 "set foldlevel=1 "map za endif if version <= 600 colorscheme default endif if version >= 700 set guitablabel=%N\ %m\ %t set numberwidth=2 endif let s:path = system("echo echo VIMPATH'${PATH}' | $SHELL -l") let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n') function! InsertTabWrapper(direction) let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\" elseif "backward" == a:direction return "\" else return "\" endif endfunction inoremap =InsertTabWrapper ("forward") inoremap =InsertTabWrapper ("backward")