Permalink
Browse files

Swap Pathogen for Vundle

  • Loading branch information...
jackfranklin committed Dec 28, 2013
1 parent 889d5d9 commit 62861ec9e0c6b811b783298ea1ffa994401686e0
Showing with 37 additions and 478 deletions.
  1. +2 −6 Makefile
  2. +0 −80 scripts/lib/vim.rb
  3. +0 −5 scripts/vim_bundles.rb
  4. +0 −345 vim/plugin/dragvisuals.vim
  5. +35 −14 vim/vimrc
  6. +0 −28 vim_plugins.json
View
@@ -1,8 +1,7 @@
DIR=/Users/jackfranklin/dotfiles
-all: symlinks ruby_env ruby_gems brew node vim
-
-update: brew node vim
+all: symlinks ruby_env ruby_gems brew node
+ echo "Vim plugins are managed within Vim with Vundle."
symlinks:
ln -nsf $(DIR)/zsh/zsh ~/.zsh
@@ -29,6 +28,3 @@ brew: brews.txt
node:
ruby $(DIR)/scripts/npm_bundles.rb
-
-vim: vim_plugins.json
- ruby $(DIR)/scripts/vim_bundles.rb
View
@@ -1,80 +0,0 @@
-require 'fileutils'
-require 'open-uri'
-require 'json'
-
-class Vim
- def initialize(argv)
- @argv = argv
- @bundles_dir = File.join(File.expand_path("~/dotfiles/vim/vim"), "bundle")
- @bundles = get_bundles
- @reinstall_single = @argv[0]
- end
-
- def install_plugins
- prepare_file_system
- FileUtils.cd(@bundles_dir)
- process_items
- tidy_up
- end
-
- private
-
- def process_items
- @bundles.each do |item|
- name = name_for_url(item)
- if !@reinstall_single.nil? && item.include?(@reinstall_single)
- FileUtils.rm_rf(name)
- clone_item(item)
- else
- unless File.directory?(name)
- clone_item(item)
- end
- end
- end
- end
-
- def tidy_up
- Dir["*/.git"].each {|f| FileUtils.rm_rf(f) }
- uninstall_old_bundles
- end
-
- def uninstall_old_bundles
- bundle_names = @bundles.map { |item|
- name_for_url(item)
- }
-
- folder_names = Dir.glob('*').map { |item|
- item.split("/").last
- }
-
- to_uninstall = folder_names.select { |folder| !bundle_names.include?(folder) }
- to_uninstall.each do |folder|
- puts "Uninstalling plugin: #{folder}"
- FileUtils.rm_rf(File.expand_path(folder))
- end
- end
-
- def prepare_file_system
- FileUtils.rm_rf(@bundles_dir) if @reinstall_all
- FileUtils.mkdir_p(@bundles_dir)
- end
-
- def name_for_url(url)
- url.split("/").last
- end
-
- def clone_url_for_item(item)
- "git://github.com/#{item}.git"
- end
-
- def clone_item(item)
- name = name_for_url(item)
- puts "Cloned: #{item}"
- clone_url = clone_url_for_item(item)
- `git clone -q #{clone_url}`
- end
-
- def get_bundles
- JSON.parse(IO.read('vim_plugins.json'))
- end
-end
View
@@ -1,5 +0,0 @@
-#!/usr/bin/env ruby
-require_relative 'lib/vim'
-
-Vim.new(ARGV).install_plugins
-
Oops, something went wrong.

0 comments on commit 62861ec

Please sign in to comment.