3

I'm using vundle to install vim plugins but I need to install YouCompleteMe from the branch fix-vim-eval-returning-py2-str because I have to use python3 and otherwise I get errors.

To do it I have download the master branch with vundle by :PluginInstall then I have to this:

cd ~/.vim/bundle
rm -rf YouCompleteMe
git clone -b fix-vim-eval-returning-py2-str https://github.com/puremourning/YouCompleteMe.git 
cd YouCompleteMe
git submodule update --init --recursive

To change the branch.

The problem is that sometimes vundle replace my brunch with master (that is not compatible with my system) and I must leave the line Plugin 'Valloric/YouCompleteMe' on my .vimrc or the plugin doesn't work. How can I workaround?

Andrea993
  • 663
  • 1
  • 10
  • 23
  • From the [issue tracker](https://github.com/VundleVim/Vundle.vim/issues/35) it seems that it is currently not possible to do that with Vundle. However [vim-plug](https://github.com/junegunn/vim-plug) has this feature. – statox Oct 14 '16 at 14:38
  • Yes, I know that but I'm looking for a workaround. I think that I will install ycm without vundle editing some files to allow ycm works in a different directory – Andrea993 Oct 14 '16 at 15:31

1 Answers1

3

You can make this work while still using Vundle. After manually switching the branch of your clone with git, replace the Plugin line with this:

Plugin 'Valloric/YouCompleteMe', {'pinned': 1}

The 'pinned' option “tells Vundle not to perform any git operations on the plugin, while still adding the existing plugin under the bundles directories to the runtimepath.” So Vundle will not mess with your clone of YouCompleteMe anymore when you :PluginUpdate, it will just load the plugin.

Note that this setting means you will have to update YouCompleteMe yourself, by using git pull within the plugin’s directory.

Community
  • 1
  • 1
Rory O'Kane
  • 29,210
  • 11
  • 96
  • 131
  • Thanks this is the best solution I have found. However I'm switch to `NeoBundle` that allow to select the `branch` But thanks anyway – Andrea993 Oct 23 '16 at 10:07