Skip to content

Instantly share code, notes, and snippets.

@bronson
Created July 9, 2011 02:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bronson/1073254 to your computer and use it in GitHub Desktop.
Save bronson/1073254 to your computer and use it in GitHub Desktop.
difference between Pathogen and Vundle?
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" enabling this fixes things:
"call pathogen#runtime_append_all_bundles()
filetype indent plugin on
syntax on
set laststatus=2 " always display status line even if only one window is visible.
Bundle 'https://github.com/gmarik/vundle'
Bundle 'https://github.com/tpope/vim-fugitive'
" TODO: this prompt seems to cause huge delays with big repos on MacOS X
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
@gmarik
Copy link

gmarik commented Jul 9, 2011

It works for me ...
could you post your :scriptnames output? here's mine:

      1: /Applications/MacVim.app/Contents/Resources/vim/vimrc
      2: /Users/gmarik/.vimrc
      3: /Users/gmarik/.vim/vimrc
      4: /Applications/MacVim.app/Contents/Resources/vim/runtime/ftoff.vim
      5: /Users/gmarik/.vim/bundle/vundle/autoload/vundle.vim
      6: /Users/gmarik/.vim/bundle/vundle/autoload/vundle/config.vim
      7: /Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
      8: /Applications/MacVim.app/Contents/Resources/vim/runtime/ftplugin.vim
      9: /Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim
     10: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
     11: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
     12: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
     13: /Users/gmarik/.vim/bundle/vim-fugitive/plugin/fugitive.vim
     14: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/getscriptPlugin.vim
     15: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/gzip.vim
     16: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/matchparen.vim
     17: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/netrwPlugin.vim
     18: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/rrhelper.vim
     19: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/spellfile.vim
     20: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tarPlugin.vim
     21: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tohtml.vim
     22: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
     23: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/zipPlugin.vim

@gmarik
Copy link

gmarik commented Jul 9, 2011

Since fugitive isn't a autoloadable plugin the error can be only get triggered in case when statusline to be displayed and fugitive not yet loaded.

@gmarik
Copy link

gmarik commented Jul 9, 2011

can you try moving set laststatus=2 below the set statusline command?
It may trigger statusline to display!
Try that, and let me know...

And since I cannot reproduce it - probably vim dependant...

@bronson
Copy link
Author

bronson commented Jul 9, 2011

Good point. On Linux I'm on 7.3.237, on Mac it's MacVim 7.3.57.

Here's :scriptnames:

      1: /usr/share/vim/vimrc
      2: /usr/share/vim/vim73/debian.vim
      3: /usr/share/vim/vim73/syntax/syntax.vim
      4: /usr/share/vim/vim73/syntax/synload.vim
      5: /usr/share/vim/vim73/syntax/syncolor.vim
      6: /usr/share/vim/vim73/filetype.vim
      7: /disk/natty/bronson/.vimrc
      8: /usr/share/vim/vim73/ftoff.vim
      9: /disk/natty/bronson/.vim/bundle/vundle/autoload/vundle.vim
     10: /disk/natty/bronson/.vim/bundle/vundle/autoload/vundle/config.vim
     11: /usr/share/vim/vim73/ftplugin.vim
     12: /usr/share/vim/vim73/indent.vim
     13: /usr/share/vim/vim73/syntax/nosyntax.vim
     14: /usr/share/vim/vim73/plugin/getscriptPlugin.vim
     15: /usr/share/vim/vim73/plugin/gzip.vim
     16: /usr/share/vim/vim73/plugin/matchparen.vim
     17: /usr/share/vim/vim73/plugin/netrwPlugin.vim
     18: /usr/share/vim/vim73/plugin/rrhelper.vim
     19: /usr/share/vim/vim73/plugin/spellfile.vim
     20: /usr/share/vim/vim73/plugin/tarPlugin.vim
     21: /usr/share/vim/vim73/plugin/tohtml.vim
     22: /usr/share/vim/vim73/plugin/vimballPlugin.vim
     23: /usr/share/vim/vim73/plugin/zipPlugin.vim

try moving set laststatus=2 below the set statusline command?

No difference.

I guess I don't understand the difference between call vundle#rc() and call pathogen#runtime_append_all_bundles().

@gmarik
Copy link

gmarik commented Jul 9, 2011

here's my rtp:

/Users/gmarik/.vim/bundle/vundle,/Users/gmarik/.vim/bundle/vim-fugitive,/Users/gmarik/.vim,/Applications/MacVim.app/Contents/Resources/
vim/vimfiles,/Applications/MacVim.app/Contents/Resources/vim/runtime,/Applications/MacVim.app/Contents/Resources/vim/vimfiles/after,/Users/gmarik/.vi
m/after,/Users/gmarik/.vim/bundle/vundle/,/Users/gmarik/.vim/bundle/vim-fugitive/after,/Users/gmarik/.vim/bundle/vundle/after

@gmarik
Copy link

gmarik commented Jul 9, 2011

I guess I don't understand the difference between call vundle#rc() and call pathogen#runtime_append_all_bundles()

Vundle is an autoloadable plugin, that means that call vundle#rc() triggers Vim to find autoload/vundle.vim and call vundle#rc() method just to initialize vundle and Bundle* commands.

In other hand call pathogen#runtime_append_all_bundles() makes Vim find autoload/pathogen.vim and call pathogen#runtime_append_all_bundles() method, which adds all bundle/* dirs to runtimepath.
In case of Vundle runtimepath gets modified by Bundle 'blah' command, so you can have as many bundles in your bundle/ dir but only those declared with Bundle command get loaded.

@gmarik
Copy link

gmarik commented Jul 9, 2011

As for the issue:
There may be something prohibiting vundle to parse Bundle 'https://github.com/tpope/vim-fugitive' correctly, which results in missing fugitive command.
Can't think of anything else ATM..

@gmarik
Copy link

gmarik commented Jul 9, 2011

Also when do you get the error?
One may get that error when trying to install bundles for the first time with Vundle (aka chicken & egg dilemma ).
I'm assuming htat's not the case.

@bronson
Copy link
Author

bronson commented Jul 11, 2011

Yep, bundles were all installed by vim-update-bundles beforehand so it's not chicken/egg.

Here's rtp (afaict no real difference from yours): /home/bronson/.vim/bundle/vundle,/home/bronson/.vim/bundle/vimfugitive,/disk/natty/bronson/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/disk/natty/bronson/.vim/after,/disk/natty/bronson/.vim/bundle/vundle/,/home/bronson/.vim/bundle/vim-fugitive/after,/home/bronson/.vim/bundle/vundle/after

Since it's a part of rtp, I guess that's a sign that the Bundle directive is being parsed correctly?

The error gets displayed every time when starting vim:

E117: Unknown function: fugitive#statusline
E15: Invalid expression: fugitive#statusline()
Press ENTER or type command to continue

Then everything works as usual except Fugitive isn't loaded and of course the statusline doesn't include Fugitive status.

@bronson
Copy link
Author

bronson commented Jul 11, 2011

OH, I see. Your explanation makes sense now. Vundle is adding .vim/bundle/vimfugitive to the rtp but vim-update-bundles cloned it into 'fugitive'

We're both modifying the repo name, https://github.com/tpope/vim-fugitive: you're calling it vimfugitive, I'm changing it to just plain fugitive.

Pretty obvious in retrospect.

So hm... How do you want to handle repo name munging?

@bronson
Copy link
Author

bronson commented Jul 11, 2011

For the record, I just drop leading 'vim-' and trailing '.git':

dirname = url.split('/').last.gsub(/^vim-|\.git$/, '')

@gmarik
Copy link

gmarik commented Jul 11, 2011

ok, that makes sense now.
Yeah, Vundle just strips out .git ext but leaving the vim- part.
Not sure how should we handle vim-. And I agree that it's a useless prefix.

How is it possible that your rtp has bundle/vimfugitive without dash in name?

@bronson
Copy link
Author

bronson commented Jul 12, 2011

I'm thinking I'll change v-u-b to match vundle. I just added it because I noticed tpope and a few others using it to identify their plugins on github. But it's not necessary and simpler is better.

bundle/vimfugitive must have been a copy/paste error. It's vim-fugitive right now (although I'm using a very different environment).

Pathogen's rtp has 56 entries, Vundle's equivalent has 101. It would be nice if Vundle didn't add paths that don't exist. :)

@gmarik
Copy link

gmarik commented Jul 12, 2011

It would be nice if Vundle didn't add paths that don't exist.

Yeah, good catch! )

@bronson
Copy link
Author

bronson commented Jul 12, 2011

Yep, not dropping the vim- fixed it. Things seem to work, thanks!

Still trying to figure out how I feel about basing the rtp on the .vimrc instead of ~/.vim/bundle... Seems like more to go wrong, less flexible, but maybe it's nicer to have removals take place immediately. Can't tell. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment