what are the differences between Vundle and NeoBundle? - vim

I would like to have a nice and easy way of managing vim plugins.
I found NeoBundle and Vundle.
What are the main differences between them? I know that NeoBundle is a fork of Vundle, but what is it that makes it different?
What do you use?

Here is an article written (in Japanese) by the author of NeoBundle Shougo, about why he wrote NeoBundle and how NeoBundle differs from Vundle.
Actually, NeoBundle is a fork of Vundle. Shougo added some features to a fork of Vundle but lately found he couldn't follow the upstream Vundle's development, so he made the fork to a new plugin now called NeoBundle.
The differences summarized as below:
Rename the commands from Vundle, replace Bundle to NeoBundle. (Example: BundelInstall to NeoBundleInstall).
Add support for vital.vim, a vim utility library written by thinca.
Neobundle works even you have set the shellslash option other than the default.
Add support for vimproc, a launcher plugin written by Shougo.
Add an interface for unite.vim written by Shougo, he also notes it as the major motive for writing NeoBundle.
Add support for plugins that hosted as a Subversion/Mercurial repository, but it is still an experimental feature now.
(UPDATED) Now NeoBundle adds a lazy loading feature where Vundle doesn't have. It allows you to load plugins at some user-defined time point, not only during the vim initialization where .vimrc is loaded.
I use vundle because it suffices my needs (I used pathogen before). But you can take a try at NeoBundle.
(UPDATE) NeoBundle has stopped active development now and will be replaced by dein.vim, which is Shougo's another brand new plugin manager. As a side note, you can also take a look at vim-plug which I'm currently using.

Related

Installed vim colorscheme is not be found at startup, but it can be set once vim is loaded

I have installed with Vundle this github colours theme. I installed is with :VundleInstall and it seems to work just fine. The directory ~/.vim/bundle/vim-colors-github is there. Indeed, I can switch the color scheme with colorscheme github.
Next, I have added the following lines to ~/.vimrc to make this change permanent:
" github colors
let g:github_colors_soft = 1
Plugin 'cormacrelf/vim-colors-github'
colorscheme github
But this raises the error "E185: colorscheme «github» not found".
It just doesn't work during the loading of vim!? What's going on here? I guess there is something that hasn't been set yet at the time of calling the change in the colorscheme. How could I debug this?
You seem to be missing the call to vundle#end() at the end of your plug-in configuration. See the quick start guide which shows an example of defining plug-ins in your vimrc:
call vundle#begin()
Plugin ...
call vundle#end() " required
filetype plugin indent on " required
In your case, adding those lines around your Plugin definition will most likely fix the issue:
" load plugins
call vundle#begin()
Plugin 'cormacrelf/vim-colors-github'
call vundle#end() " required
filetype plugin indent on " required
" github colors
let g:github_colors_soft = 1
colorscheme github
Also note that Vundle hasn't really been very thoroughly maintained. While there's nothing wrong with it, vim-plug is a compatible alternative (works the same way, uses similar configuration and similar commands) which is well maintained and offers improvements in terms of performance and features. I'd definitely recommend switching to vim-plug, particularly if you're getting started with a Vim plug-in manager of this style.
Color schemes are searched along 'runtimepath' and 'packpath'. Therefore they will only be found on startup if you install plugins with respect to :h packages (i.e. under 'packpath'), not under arbitrary ~/.vim/bundle.
As for Vundle and such you are expected to manually set up 'runtimepath', so that it includes all plugins before executing :colorscheme. For Vundle it is done by calling vundle#end().

Clojure comment highlights not working in neovim with basic syntax plugins installed

I'm using neovim with vim-clojure-static, among other vim plugins. But for some reason when I comment out text in my clojure files they are not highlighted as such.
The plugins I'm using are:
Plugin 'tpope/vim-fireplace'
Plugin 'guns/vim-sexp'
Plugin 'tpope/vim-sexp-mappings-for-regular-people'
Plugin 'tpope/vim-repeat'
Plugin 'guns/vim-clojure-static'
Plugin 'guns/vim-clojure-highlight'
Plugin 'oblitum/rainbow'
Plugin 'tpope/vim-classpath'
Plugin 'tpope/vim-surround'
Any idea what might be going wrong? Is there other information I can provide here to uncover the issue?
I think you’re running into a compatibility issue here. According to the notice at the top of its README, oblitum/rainbow is unmaintained, and the replacement for it is luochen1990/rainbow.
So, try replacing Plugin 'oblitum/rainbow' with Plugin 'luochen1990/rainbow'.

vim-cucumber doesn't find definitions

I'm trying to switch to Vim from Sublime. I do a lot of Cucumber work. A Sublime plugin allows me to jump from the step in feature file to the corresponding step definition. It looks like vim-cucumber is designed for that purpose as well. I've installed vim-cucumber using Vundle. However, when I use any of the commands in the vim-cucumber readme (e.g. [<C-d> or <C-W>d) I always get E388: Couldn't find definition. Is there some prior command or configuration I need to run to load the existing definitions for vim-cucumber to work?
The mappings used by that plugin override buit-in mappings that do more or less the same thing (but not for cucumber so that's alright).
The error message you get is associated with those buit-in mappings (:help e388) so it looks like the buit-in mappings are not overriden and thus that your plugin is not installed correctly.
romani, thanks for pointing me in the right direction. To fix the issue:
I removed vim-cucumber from my Vundle plugin list in .vimrc
executed :PluginClean
removed some references to cucumber.vim in my .vim directory that I think I added either via pathogen or manually at some point
added the plugin back in to .vimrc
executed :PluginInstall
Looks like jumping to definitions is working. Thanks.

How to make vim pathogen to reload plugins?

Is it possible to make vim to reload pathogen plugins without restarting vim?
I have opened vim with many files, then I add plugin to:
~/.vim/bundle
Since now I'd like to force vim to use the new plugin.
Pathogen just manipulates the 'runtimepath' option; the situation with plugin reloads is therefore the same as with the plain default plugin structure. (Other plugin managers may offer this kind of reload / dynamic enable functionality; I suppose you want to stick with Pathogen.)
To retroactively enable a plugin in a running Vim session, you need to :source all (usually that's only one) plugin scripts that have been added. For a plugin named foobar, that would be:
:source ~/.vim/bundle/foobar/plugin/foobar.vim
If you can get Pathogen to re-initialize the 'runtimepath' (or augment it yourself via :set rtp+=~/.vim/bundle/foobar), you can also use the shorter
:runtime plugin/foobar.vim
If you use a modern version of vim, you can use its built-in package manager, which has a convenient function to reload all plugins:
:packloadall
http://vimhelp.appspot.com/repeat.txt.html#%3Apackloadall
I was in the same boat before util I find an awesome plugin(vim-reload) to do these stuffs automatic in an amazing way.You should have a shot at this plugin.

Manually and conditionally load plugins for Vim

I have two different projects that I'm working on (let's call them projA and projB) that have their own Vim plugins.
Each plugin folder has an ftdetect, ftplugin, plugin and syntax subfolder, and each deals with the same type of files (.cpp, .html, etc).
If I load both sets of plugins then nothing I want works right so I need a way to only load the plugin that corresponds to the project I'm working on.
My idea is to detect what my current working directory is via getcwd() and then only load the relevant plugin, but I have no idea how to manually load a single plugin.
I'm currently using Vundle to manage the rest of my plugins.
With vim-plug
The vim-plug plugin manager supports loading plugins conditionally.
This is straight from their readme:
" On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
Package managers like Vundle and Pathogen separate each plugin into its own subtree and concatenate all those paths into the 'runtimepath' option so that Vim considers all of them. That makes it particularly simple to disable plugins: Just prevent the inclusion of the plugin's subtree into 'runtimepath'.
Vundle references plugins in ~/.vimrc via Bundle 'foo/bar' commands, so you just have to put a conditional around it:
if getcwd() ==# '/work/cpp'
Bundle example/cpp
else
Bundle example/other
endif
conventional approach
With a conventional, single ~/.vim/ configuration hierarchy, you'd have to resort to suppressing plugin loads by setting the canonical g:loaded_PluginName inclusion guard. This requires support from the plugin, and mostly won't work for ftplugins, indent, and syntax scripts.

Resources