vimenv

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

commit cd001beba07d647bc92d36fa89321cfac2adbe4f
parent e9fd0dd44c2eeb01362f93ce80caab89a5f9da3c
Author: Xiaodong Xu <xxdlhy@gmail.com>
Date:   Sun Jul  8 12:41:55 +0800

Add commentary and textobj-entire

Diffstat:
.gitignore | 1+
.gitmodules | 12+++++++++---
_vim/bundle/commentary | 1+
_vim/bundle/ctrlp | 2+-
_vim/bundle/powerline | 2+-
_vim/bundle/syntastic | 2+-
_vim/bundle/textobj-entire | 1+
_vim/conf/plugin.vim | 7++++---
vimenv | 41+++++++++++++++++------------------------
9 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -0,0 +1 @@ +_vim/bundle/vim-tn diff --git a/.gitmodules b/.gitmodules @@ -61,12 +61,18 @@ [submodule "_vim/bundle/syntastic"] path = _vim/bundle/syntastic url = git://github.com/scrooloose/syntastic.git -[submodule "_vim/bundle/powerline"] - path = _vim/bundle/powerline - url = git://github.com/xuxiaodong/vim-powerline.git [submodule "_vim/bundle/matchtag"] path = _vim/bundle/matchtag url = git://github.com/gregsexton/MatchTag.git [submodule "_vim/bundle/numbers"] path = _vim/bundle/numbers url = git://github.com/xuxiaodong/numbers.vim.git +[submodule "_vim/bundle/powerline"] + path = _vim/bundle/powerline + url = git://github.com/xuxiaodong/vim-powerline.git +[submodule "_vim/bundle/commentary"] + path = _vim/bundle/commentary + url = git://github.com/tpope/vim-commentary.git +[submodule "_vim/bundle/textobj-entire"] + path = _vim/bundle/textobj-entire + url = git://github.com/kana/vim-textobj-entire.git diff --git a/_vim/bundle/commentary b/_vim/bundle/commentary @@ -0,0 +1 @@ +Subproject commit 50b055633580c65c381ebb310bc1786ff14e3340 diff --git a/_vim/bundle/ctrlp b/_vim/bundle/ctrlp @@ -1 +1 @@ -Subproject commit 5885da54beba301be4f7b13f7556e97e570193e5 +Subproject commit 4d5b39c0cf005bc48e6d5916e631c0b444ebc419 diff --git a/_vim/bundle/powerline b/_vim/bundle/powerline @@ -1 +1 @@ -Subproject commit 4e481112f75cfff0a27eff1a4e796ba1eb590146 +Subproject commit 1986d3409def8fe9439b0aaf7d02a6ae5b0b0d35 diff --git a/_vim/bundle/syntastic b/_vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit 25e81cbe5dd27c6725a2f9733551d449841eea72 +Subproject commit 7b3b63e6df60733382047086eb26b2cc59b3a239 diff --git a/_vim/bundle/textobj-entire b/_vim/bundle/textobj-entire @@ -0,0 +1 @@ +Subproject commit 6eadc96df0c0a94a05b92e1b1ad83bb9cfab6340 diff --git a/_vim/conf/plugin.vim b/_vim/conf/plugin.vim @@ -1,6 +1,6 @@ " " author : Xu Xiaodong <xxdlhy@gmail.com> -" modified : 2012 Jun 30 +" modified : 2012 Jul 07 " "-- plugin --" @@ -17,12 +17,13 @@ vmap <silent> <leader>i( <esc>:AlignPush<cr>:AlignCtrl lp0P0<cr>:'<,'>Align (<cr " powerline let g:Powerline_symbols='fancy' +let g:Powerline_theme='codefun' " nerdtree let g:NERDTreeWinSize=25 let g:NERDTreeMinimalUI=1 -autocmd vimenter * NERDTree -autocmd vimenter * exe 'winc w' +"autocmd vimenter * NERDTree +"autocmd vimenter * exe 'winc w' nmap nc :NERDTreeToggle<cr> " tagbar diff --git a/vimenv b/vimenv @@ -4,7 +4,7 @@ # author : Xu Xiaodong <xxdlhy@gmail.com> # license : GPL # created : 2012 Apr 14 -# modified : 2012 Jul 02 +# modified : 2012 Jul 08 # require 'fileutils' @@ -13,18 +13,16 @@ require 'optparse' def init conf = %w[vimrc vim] conf.each do |item| - orig = "#{Dir.pwd}/_#{item}" + orig = "#{Dir.pwd}/_#{item}" target = "#{ENV['HOME']}/.#{item}" # oops... 1.8.5 does not support Dir.home - bak = "#{target}.old" + bak = "#{target}.old" if File.exist?(target) && ! File.symlink?(target) puts "Backuping #{target} to #{bak}" FileUtils.mv(target, bak) end - if File.symlink?(target) - FileUtils.rm(target) - end + FileUtils.rm(target) if File.symlink?(target) puts "Symlinking #{orig} to #{target}" FileUtils.symlink(orig, target) @@ -39,7 +37,7 @@ end def add(author_slash_name) name = author_slash_name.gsub(/^.*\/(?:vim-)?(.*?)(?:[-\.]vim)?(?:-theme)?$/, '\1').downcase - src = "git://github.com/#{author_slash_name}.git" + src = "git://github.com/#{author_slash_name}.git" desc = "_vim/bundle/#{name}" puts "Adding #{src} to #{desc}" @@ -47,16 +45,14 @@ def add(author_slash_name) end def remove(name) - path = "_vim/bundle/#{name.downcase}" + path = "_vim/bundle/#{name.downcase}" git_path = ".git/modules/#{path}" - files = [".git/config", ".gitmodules"] + files = [".git/config", ".gitmodules"] puts "Removing #{path}" system "git rm --cached #{path} >/dev/null" - files.each do |file| - system "git config -f #{file} --remove-section submodule.#{path}" - end + files.each { |file| system "git config -f #{file} --remove-section submodule.#{path}" } FileUtils.rmtree(path) FileUtils.rmtree(git_path) @@ -66,14 +62,11 @@ def update puts "Updating Vim plugins" arg = ["init", "update", "foreach git pull origin master"] - - arg.each do |elt| - system "git submodule #{elt}" - end + arg.each { |elt| system "git submodule #{elt}" } end def list - bundle = Dir.entries('_vim/bundle') + bundle = Dir.entries('_vim/bundle') plugins = bundle[2, bundle.size].sort plugins.each { |name| puts " * Installed #{name} ..." } @@ -83,13 +76,13 @@ def list 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 } -opts.on("-h", "--help", "Show help") { puts opts.to_s } +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 } +opts.on("-h", "--help" , "Show help") { puts opts.to_s } if ARGV.empty? puts opts.to_s