X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=.vimrc;h=852d3cb21fb0abe5c8ae7a1a37c151f762295f09;hb=2c8a3af9a83c63d371a5ba6463230e5e02b8e875;hp=bc4a54ab55e9fae8ac9c1916511d3d184a35ed3e;hpb=f3d5077ad1762c49948e73acf7eebb187dc9134f;p=dotfiles.git diff --git a/.vimrc b/.vimrc index bc4a54a..852d3cb 100644 --- a/.vimrc +++ b/.vimrc @@ -271,6 +271,8 @@ autocmd BufWritePost ~/.vimrc source ~/.vimrc | syntax on if version >= 700 " Save all files before running any quickfix command (grep, makeprg, etc.) autocmd QuickFixCmdPre * wall +" automatically close quickfix if it's the only window left +autocmd WinEnter * if winnr('$') == 1 && &buftype == "quickfix" | quit | endif endif " Syntax highlighting @@ -525,6 +527,19 @@ if exists("$SLOWTERM") endif +if has("python") +python << END_OF_PYTHON +import sys, os + +virtualenv_dir = os.environ.get('VIRTUAL_ENV') +if virtualenv_dir: + sys.path.insert(0, virtualenv_dir) + activate_this = os.path.join(virtualenv_dir, 'bin', 'activate_this.py') + execfile(activate_this, dict(__file__=activate_this)) +END_OF_PYTHON +endif + + " ---------- " From http://slobin.pp.ru/vim/_vimrc.html