I am trying to create a separate vim environment in order to install python-mode plugin. So I've used -u option to select a vim configuration file for the environment. But I cannot figure out how can I properly assign the runtimepath variable. If I just specify set rtp=~/python-env then vim cannot find my plugins in the environment. Can you please help me figure out how to properly set up this variable?
Asked
Active
Viewed 294 times
0
-
`I am trying to create a separate vim environment in order to install python-mode plugin.` I don't understand your problem... can you paste some example codes? – Kent Oct 12 '18 at 21:54
-
Why a separate environment to begin with? What's your goal, exactly? – romainl Oct 13 '18 at 09:24
1 Answers
0
Your question is pretty vague, and noone has answered yet, so here are some general hints:
- Instead of using
-u vimrc
, I would rather define "feature flags" via global variables and set those via--cmd "let g:isPythonMode = 1"
, and test for the variable (withexists()
) in your~/.vimrc
. With this, you don't have the config segregated into multiple parts, and you can even define multiple, independent features in the future, and mix and match them without having to duplicate configuration. - If you
:set rtp=
, you have to specify all the default locations (as listed in:help 'runtimepath'
), too. It's easier to just prepend / append additional paths via:set rtp^=my/path
/:set rtp+=my/path/after
. - If I understand you correctly, you only want to enable the python-mode plugin for some sessions. Since version 7.4, Vim can do that, even on-demand after starting, via the
:help :packadd
command. You just need to install the plugin in a special "optional" location (~/.vim/pack/{some name}/opt/vim-python-mode/
).

Ingo Karkat
- 167,457
- 16
- 250
- 324