vimenv

configure vim environment
git clone git://git.unixkoans.com/vimenv.git
Log | Files | Refs | Submodules

commit 931af81d25412719b7e0d775e78f510d98ef6df6
parent b7822424358c63840c532962be8f6f8b052d5b36
Author: Xiaodong Xu <xxdlhy@gmail.com>
Date:   Sun Apr 15 20:34:32 +0800

New feature: list Vim plugins

Diffstat:
.gitmodules | 6++++++
_vim/bundle/gist | 1+
_vim/bundle/snipmate | 1+
vimenv | 13++++++++++++-
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.gitmodules b/.gitmodules @@ -28,3 +28,9 @@ [submodule "_vim/bundle/command-t"] path = _vim/bundle/command-t url = git://github.com/wincent/Command-T.git +[submodule "_vim/bundle/gist"] + path = _vim/bundle/gist + url = git://github.com/mattn/gist-vim.git +[submodule "_vim/bundle/snipmate"] + path = _vim/bundle/snipmate + url = git://github.com/msanders/snipmate.vim.git diff --git a/_vim/bundle/gist b/_vim/bundle/gist @@ -0,0 +1 @@ +Subproject commit 2e2cbcb1bb92d6bcf3ab7e288b94de6c63c75ba7 diff --git a/_vim/bundle/snipmate b/_vim/bundle/snipmate @@ -0,0 +1 @@ +Subproject commit f5a75d075d3c005ebe69e3f5e56cf99516e8aa3b diff --git a/vimenv b/vimenv @@ -28,7 +28,7 @@ def edit end def add(author_slash_name) - name = author_slash_name.gsub(/^.*\/(?:vim-)?(.*?)(?:\.vim)?$/, '\1').downcase + name = author_slash_name.gsub(/^.*\/(?:vim-)?(.*?)(?:[-\.]vim)?$/, '\1').downcase src = 'git://github.com/' + author_slash_name + '.git' desc = '_vim/bundle/' + name @@ -61,12 +61,23 @@ def update end end +def list + bundle = Dir.entries('_vim/bundle') + plugins = bundle[2, bundle.size].sort + + plugins.each { |dir| puts "Installed #{dir}" } + + total = plugins.size + puts "Total #{total} plugins" +end + opts = OptionParser.new opts.on("-i", "--init", "Initialize Vim environment") { init } opts.on("-e", "--edit", "Edit Vim configuration file") { edit } opts.on("-a", "--add NAME", "Add Vim plugins") { |name| add(name) } opts.on("-r", "--remove NAME", "Remove Vim plugins") { |name| remove(name) } opts.on("-u", "--update", "Update Vim plugins") { update } +opts.on("-l", "--list", "List Vim plugins") { list } if ARGV.empty? puts opts.to_s