<commit_before><commit_msg>Added vim-plugin management<commit_after>require 'erb'

module Brim
  class VimPlugins < ::Thor
    include Thor::Actions
    namespace :"vim-plugins"

    desc "#{namespace}:setup", "Setup your vim directory for pathogen"
    def setup
      say "Installing vim-pathogen", :blue
      if not File.exists?('~/.vim/bundle')
        mute { run "mkdir -p ~/.vim/autoload ~/.vim/bundle; \
                 curl -Sso ~/.vim/autoload/pathogen.vim \
                   https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim" }
        say "Complete", :green
      else
        say "Previously installed", :red
      end
    end
  
    desc "#{namespace}:install REPO", "Install a git hosted vim-plugin"
    def install repo
      reponame = repo.match(/\/(.*).git/)[1]
      repopath = repo.match(/github.com/) ? repo : "http://github.com/#{repo}"
      
      say "Installing #{reponame}", :blue
      mute { run "git clone #{repopath} ~/.vim/bundle/#{reponame}" }
      say "Complete", :green
    end

    desc "#{namespace}:remove PLUGIN", "Remove a plugin from your bundle"
    def remove plugin
      mute { run "rm -r ~/.vim/bundle/#{plugin}" }
      say "Removed #{plugin}", :red
    end

    desc "#{namespace}:list", "Show a list of your installed plugins"
    def list
      mute { run "ls ~/.vim/bundle" }
    end
  
    private

    def mute &block
      self.shell.mute &block
    end
    
    def self.source_root
      File.expand_path('../../templates', __FILE__)
    end
  
    def filetime
      Time.now.strftime('%Y%m%d%H%M%S')
    end
  end
end
{'fraction_non_alphanumeric': 0.14366021236727045, 'fraction_numerical': 0.0006246096189881324, 'mean_word_length': 2.276073619631902, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5499168', 'n_tokens_mistral': 540, 'n_tokens_neox': 517, 'n_words': 137}