From 696fa78ea5955e555790980385b09adfed567916 Mon Sep 17 00:00:00 2001 From: Zbigniew Siciarz Date: Thu, 16 Feb 2012 21:55:54 +0100 Subject: [PATCH] Experimenting with ctags defined per-virtualenv. --- vimrc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 9a62925..6ecd957 100644 --- a/vimrc +++ b/vimrc @@ -53,7 +53,20 @@ filetype plugin indent on set completeopt=longest,menuone inoremap -set tags+=$HOME/.vim/tags/python.ctags +" ctags for system Python and for virtual environments +let base_ctags_path = $HOME . "/.vim/tags/python.ctags" +exec 'set tags+=' . base_ctags_path +if !empty($VIRTUAL_ENV) + let ctags_path = $VIRTUAL_ENV . "/python.ctags" + if filereadable(ctags_path) + exec 'set tags+=' . ctags_path + endif +else + let ctags_path = base_ctags_path +endif + +let ctags_src = system('python -c "import sys; from distutils.sysconfig import get_python_lib; sys.stdout.write(get_python_lib())"') +exec 'map t :!ctags -R -f' ctags_path ctags_src . '' python << EOF import os