From 26a36a745189eb2d5104317e93a5be29a448d79e Mon Sep 17 00:00:00 2001 From: Fabio Gallonetto Date: Thu, 16 May 2013 16:55:15 +0100 Subject: [PATCH] Fix a bug with installing new vim plugin from the command line Fixes #328 --- bin/yadr/vundle.rb | 7 +++++-- vim/after/plugin/dune-ctags.vim | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 vim/after/plugin/dune-ctags.vim diff --git a/bin/yadr/vundle.rb b/bin/yadr/vundle.rb index a936dc4..76e3321 100644 --- a/bin/yadr/vundle.rb +++ b/bin/yadr/vundle.rb @@ -7,7 +7,8 @@ module Vundle vundles = vundles_from_file last_bundle_dir = vundles.rindex{ |line| line =~ /^Bundle / } - vundles.insert last_bundle_dir+1, "Bundle \"#{plugin_repo}\"" + last_bundle_dir = last_bundle_dir ? last_bundle_dir+1 : 0 + vundles.insert last_bundle_dir, "Bundle \"#{plugin_repo}\"" write_vundles_to_file vundles end @@ -25,16 +26,18 @@ module Vundle end def self.update_vundle - system "vim --noplugin -u vim/vundles.vim -N \"+set hidden\" \"+syntax on\" +BundleClean +BundleInstall +qall" + system "vim --noplugin -u #{ENV['HOME']}/.vim/vundles.vim -N \"+set hidden\" \"+syntax on\" +BundleClean +BundleInstall +qall" end private def self.contains_vundle?(vundle_name) + FileUtils.touch(@vundles_path) unless File.exists? @vundles_path File.read(@vundles_path).include?(vundle_name) end def self.vundles_from_file + FileUtils.touch(@vundles_path) unless File.exists? @vundles_path File.read(@vundles_path).split("\n") end diff --git a/vim/after/plugin/dune-ctags.vim b/vim/after/plugin/dune-ctags.vim new file mode 100644 index 0000000..c0905c0 --- /dev/null +++ b/vim/after/plugin/dune-ctags.vim @@ -0,0 +1 @@ +set tags+=tags,gems.tags,stdlib.tags