Closed Massimo-B closed 11 years ago
How? You mean by
:set
or
:let v:
?
g:plugin_root_dir
is not a setting, neither is l:plugin_root_dir
(which is actually defined in a function): it is just a shortcut defined in order not to always write full path. Changing this shortcut to any value that does not match default one (see :h VAM-plugin_root_dir
) leads to behavior that seems to be incorrect.
If issues appear, check all the documentation, especially third and fourth sections. Examples may be incorrect as they are not tested. Or they may be misleading like in this case. Third and fourth sections are being constantly updated.
How? You mean by
First, variable defined there is l:plugin_root_dir
, not g:plugin_root_dir
. Second, neither l:plugin_root_dir
(obviously: it is local to function) nor g:plugin_root_dir
values are checked anywhere in VAM. They are not checked means they are not a setting, this has nothing to do with :set
.
Sorry, I can't follow you in some points. I was looking why the root-vim did use a different plugin root than the user-vim. I know setting my g:plugin_root_dir did not change it, it was just for debugging.
When re-reading the docs I have seen you have changed the commented version on Jan 18, 2013 :) A comment here about that would have been nice since the comment on the change says it fixes this issue :)
I added this section, and it works now:
" VAM install location:
let c = get(g:, 'vim_addon_manager', {})
let g:vim_addon_manager = c
let c.plugin_root_dir = '/etc/vim/vim-addons'
if !EnsureVamIsOnDisk(c.plugin_root_dir)
echohl ErrorMsg | echomsg "No VAM found!" | echohl NONE
return
endif
let &rtp.=(empty(&rtp)?'':',').c.plugin_root_dir.'/vim-addon-manager'
However, the commented part to be added into some vimrc is becoming quite large. Wouldn't it be helpful to put this stuff into some vam-init.vim file inside vim-addon-manager itself to get it updated, and to have only these points to add into users vimrc:
I have my own vimrc.vam sourced by vimrc.local, but even vimrc.vam is not static since I need to edit the plugin_root_dir on different installations (NFS environment, some userspace-only environments, ...). So I would rather like to have a static vam-init.vim and only change the plugin_root_dir from vimrc.
What you see in documentation is just an example code doing much useless (for me) things like checking out VAM and not doing some useful things (setting a few options). If you need static VAM-init and non-static everything else just create it. You don’t require anything except vam#ActivateAddons
call, thus is no need in vam-init
. There is no way it can be simplified further by adding any files to the repository.
Hi,
I have setup VAM inside /etc/vim/vim-addons. I do this to have the same add-on set for root and users, actually it's only me and root. This works fine now as root. But running vim as user tries to re-install all add-ons into ~/.vim/vim-addons:
vimrc.vam is mostly the commented version from docs:
It seems that plugin_root_dir is somehow different for the user. I tried for debugging:
but it results into /etc/vim/vim-addons as well for the user.
Now comparing the :scriptnames of the user all add-ons are sourced from ~/.vim/vim-addons ignoring the plugin_root_dir:
There is no users ~/.vimrc