Friday, February 5, 2016

Re: Pathogen doesn't seem to work

2016-02-05 19:53 GMT+03:00 Erik Falor <ewfalor@gmail.com>:
> On Fri, Feb 05, 2016 at 10:14:31AM +0300, Nikolay Aleksandrovich Pavlov wrote:
>> 2016-02-05 6:00 GMT+03:00 Erik Falor <ewfalor@gmail.com>:
>> > On Thu, Feb 04, 2016 at 03:54:40PM -0800, Hashjie wrote:
>> >
>> >> Whenever I run vim with vim -u NONE
>> >
>> > That's your problem right there. -u skips many of Vim's regular
>> > initializations, including loading [autoloaded] plugins. That is why
>> > Vim does not recognize the function pathogen#infect().
>>
>> This is not correct. `-u NONE` tells Vim to read no initialization
>> files, as well as plugins. This will not disable autoloading, so one
>> *still* may do `:execute pathogen#infect()` after starting Vim or in
>> e.g. --cmd (it *will* work on that early stage because &runtimepath
>> would already be initialized to contain ~/.vim and this is *all* one
>> needs to make autoloading work). But -u NONE will require to do this
>> explicitly (done by OP by using :so) and will also set &loadplugins to
>> zero which makes calling pathogen rather pointless.
>>
>> OP should have different problem, -u NONE is not disabling autoloading
>> functionality.
>
> You're right, Nikolay. -u NONE is not disabling the autoload feature.
>
> What I've found is that -u NONE, among other things, sets
> 'compatible', which precludes pathogen from defining its functions.
> Near the beginning of pathogen.vim is this stanza:
>
> if exists("g:loaded_pathogen") || &cp
> finish
> endif
> let g:loaded_pathogen = 1
>
> This is why pathogen#infect() isn't recognized: its definition was
> never seen by Vim.
>
> Hashjie, in order to use pathogen.vim along with -u NONE, you must
> take several manual steps after Vim has loaded. I've found that this
> sequence works with my setup:
>
> $ vim -u NONE
> :set nocompatible loadplugins

And `set nocompatible` with `-u NONE` is not needed when using `-u
NONE -N`. But this line is not needed at all because it can be
replaced with `-u NORC -N`.

> :so ~/.vim/autoload/pathogen.vim

This should not be needed.

> :call pathogen#infect()
> :runtime! plugin/*.vim

If this is needed then `set loadplugins` should not change anything, I
do not see pathogen checking this setting.

>
> Then you can see with :scriptnames that your plugins under .vim/bundle
> are loaded. However, when I do this I get several warnings and errors.
>
> I'm sure that you have your reasons to combine -u NONE with Pathogen,
> but it seems like a lot of extra work to me!

I would say that -u NONE is usually used for testing or for finding
minimal failing example needed for bug reports. If this is the case I
would recomment using `-N -u <(<<< $'call pathogen#infect()') --cmd
'set runtimepath=~/.vim'`: this should disable all plugins, except
pathogen and bundles.

>
> --
> Erik Falor
> Registered Linux User #445632 http://unnovative.net
>
> --
> --
> 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.

--
--
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: