Wednesday, June 29, 2016

Re: Difficulty with Packages

On Tuesday, June 28, 2016 at 3:39:50 PM UTC-5, Bram Moolenaar wrote:
> Matthew Desjardins wrote:
>
> > > > 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?
> > >
> > > 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 -- Bram@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 ///
> >
> > 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
>
> 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?
>

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.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment