Difficulty with Packages

78 views
Skip to first unread message

Matthew Desjardins

unread,
Jun 27, 2016, 8:29:13 AM6/27/16
to vim_use
I've been trying to get packages to work, but I'm having difficulties with the resulting 'runtimepath'. Packages are all added after my own "after" directory, which I would have assumed would be at the end to allow me to override things.

Am I missing something?

Bram Moolenaar

unread,
Jun 27, 2016, 4:56:46 PM6/27/16
to Matthew Desjardins, vim_use
What is supposed to happen is that the package directory is added just
after the entry in 'runtimepath' where it that package was found.

For example, the 'rtp' starts as:
~/.vim,/usr/lib/vim/vim74/runtime,~/.vim/after

And when finding the matchit plugin it becomes:
~/.vim,/usr/lib/vim/vim74/runtime,/usr/lib/vim/vim74/runtime/pack/dist/opt/matchit,~/.vim/after

Or when finding a package under ~/.vim:
~/.vim,~/.vim/pack/my/start/demo,/usr/lib/vim/vim74/runtime,~/.vim/after


Can you give a small example of what you are doing and what you see
happens?

--
Although the scythe isn't pre-eminent among the weapons of war, anyone who
has been on the wrong end of, say, a peasants' revolt will know that in
skilled hands it is fearsome.
-- (Terry Pratchett, Mort)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Matthew Desjardins

unread,
Jun 28, 2016, 8:02:01 AM6/28/16
to vim_use, desjardin...@gmail.com

packadd-ing an opt is fine, but something under a start is appended to my runtimepath:

C:\Users\desjardinsm/vimfiles,C:\Program Files\Vim/vimfiles,C:\Program Files\Vim\vim74,C:\Program Files\Vim\vim74\pack\dist\opt\matchit,C:\Program Files\Vim/vimfiles/after,C:\Users\desjardinsm/vimfiles/after,C:/Users/desjardinsm/vimfiles/pack/test/start/test

Bram Moolenaar

unread,
Jun 28, 2016, 4:39:50 PM6/28/16
to Matthew Desjardins, vim_use
Looks like a forward/backward slash mixup problem.

Can somone using Windows reproduct this and find out what is the best
way to fix it?

--
hundred-and-one symptoms of being an internet addict:
161. You get up before the sun rises to check your e-mail, and you
find yourself in the very same chair long after the sun has set.

Tumbler Terrall

unread,
Jun 28, 2016, 5:24:13 PM6/28/16
to vim_use, desjardin...@gmail.com

> Looks like a forward/backward slash mixup problem.
>
> Can somone using Windows reproduct this and find out what is the best
> way to fix it?

I don't think that mixes slashes is the problem. I have mixed slashes in my runtimepath, and it works fine. Windows happily uses either kind (or even both) without caring.

Bram Moolenaar

unread,
Jun 29, 2016, 5:47:08 AM6/29/16
to Tumbler Terrall, vim_use, desjardin...@gmail.com
That works fine for using the 'rtp', that's why there can be a mix.
But when finding the spot to put the new path in strstr() is used, which
doesn't ignore the difference. This is in add_pack_plugin().

--
hundred-and-one symptoms of being an internet addict:
164. You got out to buy software, instead of going out for a beer.

Ben Fritz

unread,
Jun 29, 2016, 12:04:47 PM6/29/16
to vim_use, desjardin...@gmail.com

No suggestions on a fix, but thanks for the pointer! This workaround, placed at the beginning of my .vimrc, lets Vim put package directories in the correct location for now:

if has('win32')
let &runtimepath=substitute(&rtp, '/', '\\', 'g')
endif


Interestingly, going the other way (changing from backslash to forward slash) does not work, even with 'shellslash' set.

Reply all
Reply to author
Forward
0 new messages