" Begin vimrc set nocompatible set bs=indent,eol,start set background=dark set softtabstop=4 set shiftwidth=4 set laststatus=2 set scrolloff=2 set nowrap set showcmd set modelines=5 set clipboard=unnamed syntax on set ruler set expandtab set autoindent filetype plugin indent on set foldmethod=indent set foldlevel=9999 set list set listchars=tab:>-,trail:.,extends:> set suffixes+=.pyc,.pyo " ignore compiled Python files set showmatch set ignorecase smartcase set incsearch set visualbell " I hate bells set path=,,.,** set cdpath=,,.,~/ set dir=~/tmp/vim " no swapfiles laying around set pastetoggle= set errorformat+= \%A\ \ File\ \"%f\"\\\,\ line\ %l\\\,%m, \%C\ \ \ \ %.%#, \%+Z%.%#Error\:\ %.%#, \%A\ \ File\ \"%f\"\\\,\ line\ %l, \%+C\ \ %.%#, \%-C%p^, \%Z%m, \%-G%.%# " alternative Python error format (given in the vim docs) "" set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m match Error /\%>79v.\+/ " Make p in Visual mode replace the selected text with the default register. vnoremap p :let current_reg = @"gvdi=current_reg " Disable Alt+... shortcuts for menus, because they clash with Alt+H set winaltkeys=no " Easy switching between buffers nmap :wincmd k nmap :wincmd j nmap :wincmd h nmap :wincmd l imap :wincmd k imap :wincmd j imap :wincmd h imap :wincmd l map :SwitchCodeAndTest map :OpenTestInOtherWindow " vimspell config let loaded_vimspell = 1 " disable vimspell for now let spell_auto_type = "mail" let spell_options = "-S -Tutf8" " Some custom functions nmap ,w :call OpenInNewWindow() nmap ,p :call CompilePythonSource() "nmap ,c :!pychecker % map ,c :TC "map C :CC nmap ,C :e ~/.vim/vimrc nmap ,d :!doctest % nmap ,x :!chmod a+x % nmap ,b :!cp % %.orig nmap ,s :%s/\s\+$//g " remove trailing whitespace nmap ,t :!ctags -R; mkid -m ~/devel/id-lang.map nmap ,S :source ~/.vim/vimsh.vim function! OpenInNewWindow() let filename=expand("%") silent! close silent! exe "!gvim " filename endf function! CompilePythonSource() exe "!python -c 'import py_compile; py_compile.compile(\"%\")'" endf " taglist settings let Tlist_Use_Right_Window = 1 let Tlist_WinWidth = 25 let Tlist_Use_SingleClick = 1 let Tlist_Exit_OnlyWindow = 1 let Tlist_Compact_Format = 1 " svn-diff configuration au BufRead svn-commit.tmp source ~/.vim/svn-diff.vim " pydoc configuration source ~/.vim/pydoc.vim " commentify configuration source ~/.vim/ToggleCommentify.vim " man configuration runtime ftplugin/man.vim " Python syntax configuration let python_highlight_all = 1 " -- Pythonhelper configuration -- set statusline=%-f%r\ %2*%m%*\ \ \ %1*%{TagInStatusLine()}%*%=[%l:%v]\ (%P)\ [%n] set updatetime=1000 source ~/.vim/mg.vim " W00t! " End vimrc