]> git.r.bdr.sh - rbdr/dotfiles/commitdiff
Add vim again :)
authorBen Beltran <redacted>
Mon, 8 Oct 2012 16:44:10 +0000 (11:44 -0500)
committerBen Beltran <redacted>
Mon, 8 Oct 2012 16:44:10 +0000 (11:44 -0500)
419 files changed:
vim/.VimballRecord [new file with mode: 0644]
vim/.netrwhist [new file with mode: 0644]
vim/CHANGELOG [new file with mode: 0644]
vim/README.markdown [new file with mode: 0644]
vim/Rakefile [new file with mode: 0644]
vim/after/plugin/snipMate.vim [new file with mode: 0644]
vim/after/syntax/html.vim [new file with mode: 0644]
vim/autoload/.DS_Store [new file with mode: 0644]
vim/autoload/Align.vim [new file with mode: 0644]
vim/autoload/AlignMaps.vim [new file with mode: 0644]
vim/autoload/EasyMotion.vim [new file with mode: 0755]
vim/autoload/ZoomWin.vim [new file with mode: 0644]
vim/autoload/conque_term.vim [new file with mode: 0644]
vim/autoload/delimitMate.vim [new file with mode: 0644]
vim/autoload/pathogen.vim [new file with mode: 0644]
vim/autoload/rails.vim [new file with mode: 0644]
vim/autoload/snipMate.vim [new file with mode: 0644]
vim/autoload/syntastic.vim [new file with mode: 0644]
vim/autoload/syntastic/c.vim [new file with mode: 0644]
vim/autoload/tagbar.vim [new file with mode: 0644]
vim/autoload/togglebg.vim [new file with mode: 0644]
vim/bootstrap.sh [new file with mode: 0755]
vim/bundle/ctrlp.vim [new submodule]
vim/colors/adaryn.vim [new file with mode: 0644]
vim/colors/adrian.vim [new file with mode: 0644]
vim/colors/aiseered.vim [new file with mode: 0644]
vim/colors/anotherdark.vim [new file with mode: 0644]
vim/colors/aqua.vim [new file with mode: 0644]
vim/colors/astronaut.vim [new file with mode: 0644]
vim/colors/asu1dark.vim [new file with mode: 0644]
vim/colors/autumn.vim [new file with mode: 0644]
vim/colors/autumn2.vim [new file with mode: 0644]
vim/colors/autumnleaf.vim [new file with mode: 0644]
vim/colors/baycomb.vim [new file with mode: 0644]
vim/colors/bclear.vim [new file with mode: 0644]
vim/colors/biogoo.vim [new file with mode: 0644]
vim/colors/blacksea.vim [new file with mode: 0644]
vim/colors/bluegreen.vim [new file with mode: 0644]
vim/colors/borland.vim [new file with mode: 0644]
vim/colors/breeze.vim [new file with mode: 0644]
vim/colors/brookstream.vim [new file with mode: 0644]
vim/colors/buttercream.vim [new file with mode: 0644]
vim/colors/calmar256-dark.vim [new file with mode: 0644]
vim/colors/calmar256-light.vim [new file with mode: 0644]
vim/colors/camo.vim [new file with mode: 0644]
vim/colors/candy.vim [new file with mode: 0644]
vim/colors/candycode.vim [new file with mode: 0644]
vim/colors/chela_light.vim [new file with mode: 0644]
vim/colors/chocolateliquor.vim [new file with mode: 0644]
vim/colors/clarity.vim [new file with mode: 0644]
vim/colors/cleanphp.vim [new file with mode: 0644]
vim/colors/colorer.vim [new file with mode: 0644]
vim/colors/dante.vim [new file with mode: 0644]
vim/colors/darkZ.vim [new file with mode: 0644]
vim/colors/darkblue2.vim [new file with mode: 0644]
vim/colors/darkbone.vim [new file with mode: 0644]
vim/colors/darkslategray.vim [new file with mode: 0644]
vim/colors/darkspectrum.vim [new file with mode: 0644]
vim/colors/dawn.vim [new file with mode: 0644]
vim/colors/denim.vim [new file with mode: 0644]
vim/colors/desert256.vim [new file with mode: 0644]
vim/colors/desertEx.vim [new file with mode: 0644]
vim/colors/dusk.vim [new file with mode: 0644]
vim/colors/dw_blue.vim [new file with mode: 0644]
vim/colors/dw_cyan.vim [new file with mode: 0644]
vim/colors/dw_green.vim [new file with mode: 0644]
vim/colors/dw_orange.vim [new file with mode: 0644]
vim/colors/dw_purple.vim [new file with mode: 0644]
vim/colors/dw_red.vim [new file with mode: 0644]
vim/colors/dw_yellow.vim [new file with mode: 0644]
vim/colors/earendel.vim [new file with mode: 0644]
vim/colors/eclipse.vim [new file with mode: 0644]
vim/colors/ekvoli.vim [new file with mode: 0644]
vim/colors/fine_blue.vim [new file with mode: 0644]
vim/colors/fine_blue2.vim [new file with mode: 0644]
vim/colors/fnaqevan.vim [new file with mode: 0644]
vim/colors/fog.vim [new file with mode: 0644]
vim/colors/freya.vim [new file with mode: 0644]
vim/colors/fruit.vim [new file with mode: 0644]
vim/colors/fruity.vim [new file with mode: 0644]
vim/colors/golden.vim [new file with mode: 0644]
vim/colors/guardian.vim [new file with mode: 0644]
vim/colors/habilight.vim [new file with mode: 0644]
vim/colors/herald.vim [new file with mode: 0644]
vim/colors/impact.vim [new file with mode: 0644]
vim/colors/inkpot.vim [new file with mode: 0644]
vim/colors/ir_black.vim [new file with mode: 0644]
vim/colors/ironman.vim [new file with mode: 0644]
vim/colors/jammy.vim [new file with mode: 0644]
vim/colors/jellybeans+.vim [new file with mode: 0644]
vim/colors/jellybeans.vim [new file with mode: 0644]
vim/colors/kellys.vim [new file with mode: 0644]
vim/colors/leo.vim [new file with mode: 0644]
vim/colors/lettuce.vim [new file with mode: 0644]
vim/colors/lucius.vim [new file with mode: 0644]
vim/colors/manxome.vim [new file with mode: 0644]
vim/colors/marklar.vim [new file with mode: 0644]
vim/colors/maroloccio.vim [new file with mode: 0644]
vim/colors/martin_krischik.vim [new file with mode: 0644]
vim/colors/matrix.vim [new file with mode: 0644]
vim/colors/molokai.vim [new file with mode: 0644]
vim/colors/moria.vim [new file with mode: 0644]
vim/colors/moss.vim [new file with mode: 0644]
vim/colors/motus.vim [new file with mode: 0644]
vim/colors/mustang.vim [new file with mode: 0644]
vim/colors/navajo-night.vim [new file with mode: 0644]
vim/colors/navajo.vim [new file with mode: 0644]
vim/colors/neon.vim [new file with mode: 0644]
vim/colors/neverness.vim [new file with mode: 0644]
vim/colors/night.vim [new file with mode: 0644]
vim/colors/nightshimmer.vim [new file with mode: 0644]
vim/colors/no_quarter.vim [new file with mode: 0644]
vim/colors/northland.vim [new file with mode: 0644]
vim/colors/nuvola.vim [new file with mode: 0644]
vim/colors/oceanblack.vim [new file with mode: 0644]
vim/colors/oceandeep.vim [new file with mode: 0644]
vim/colors/oceanlight.vim [new file with mode: 0644]
vim/colors/olive.vim [new file with mode: 0644]
vim/colors/papayawhip.vim [new file with mode: 0644]
vim/colors/peaksea.vim [new file with mode: 0644]
vim/colors/print_bw.vim [new file with mode: 0644]
vim/colors/pyte.vim [new file with mode: 0644]
vim/colors/railscasts+.vim [new file with mode: 0644]
vim/colors/railscasts.vim [new file with mode: 0644]
vim/colors/railscasts2.vim [new file with mode: 0644]
vim/colors/rdark.vim [new file with mode: 0644]
vim/colors/relaxedgreen.vim [new file with mode: 0644]
vim/colors/robinhood.vim [new file with mode: 0644]
vim/colors/rootwater.vim [new file with mode: 0644]
vim/colors/satori.vim [new file with mode: 0644]
vim/colors/sea.vim [new file with mode: 0644]
vim/colors/settlemyer.vim [new file with mode: 0644]
vim/colors/sienna.vim [new file with mode: 0644]
vim/colors/silent.vim [new file with mode: 0644]
vim/colors/simpleandfriendly.vim [new file with mode: 0644]
vim/colors/softblue.vim [new file with mode: 0644]
vim/colors/solarized.vim [new file with mode: 0644]
vim/colors/soso.vim [new file with mode: 0644]
vim/colors/spring.vim [new file with mode: 0644]
vim/colors/summerfruit256.vim [new file with mode: 0644]
vim/colors/synic.vim [new file with mode: 0644]
vim/colors/tabula.vim [new file with mode: 0644]
vim/colors/tango.vim [new file with mode: 0644]
vim/colors/tango2.vim [new file with mode: 0644]
vim/colors/taqua.vim [new file with mode: 0644]
vim/colors/tcsoft.vim [new file with mode: 0644]
vim/colors/tir_black.vim [new file with mode: 0644]
vim/colors/tolerable.vim [new file with mode: 0644]
vim/colors/torte.vim [new file with mode: 0644]
vim/colors/twilight.vim [new file with mode: 0644]
vim/colors/two2tango.vim [new file with mode: 0644]
vim/colors/vc.vim [new file with mode: 0644]
vim/colors/vibrantink.vim [new file with mode: 0644]
vim/colors/vividchalk.vim [new file with mode: 0644]
vim/colors/vwilight.vim [new file with mode: 0644]
vim/colors/vylight.vim [new file with mode: 0644]
vim/colors/winter.vim [new file with mode: 0644]
vim/colors/wombat.vim [new file with mode: 0644]
vim/colors/wombat256.vim [new file with mode: 0644]
vim/colors/wood.vim [new file with mode: 0644]
vim/colors/wuye.vim [new file with mode: 0644]
vim/colors/xemacs.vim [new file with mode: 0644]
vim/colors/xoria256.vim [new file with mode: 0644]
vim/colors/zenburn.vim [new file with mode: 0644]
vim/colors/zmrok.vim [new file with mode: 0644]
vim/doc/.DS_Store [new file with mode: 0644]
vim/doc/Align.txt [new file with mode: 0644]
vim/doc/NERD_commenter.txt [new file with mode: 0644]
vim/doc/NERD_tree.txt [new file with mode: 0644]
vim/doc/ZoomWin.txt [new file with mode: 0644]
vim/doc/ack.txt [new file with mode: 0644]
vim/doc/coffee-script.txt [new file with mode: 0644]
vim/doc/command-t.txt [new file with mode: 0644]
vim/doc/conque_term.txt [new file with mode: 0644]
vim/doc/delimitMate.txt [new file with mode: 0644]
vim/doc/easymotion.txt [new file with mode: 0755]
vim/doc/ft-gitcommit-plugin.txt [new file with mode: 0644]
vim/doc/fugitive.txt [new file with mode: 0644]
vim/doc/gist-vim.txt [new file with mode: 0644]
vim/doc/indent-object.txt [new file with mode: 0644]
vim/doc/rails.txt [new file with mode: 0644]
vim/doc/showmarks.txt [new file with mode: 0644]
vim/doc/snipMate.txt [new file with mode: 0644]
vim/doc/solarized.txt [new file with mode: 0644]
vim/doc/supertab.txt [new file with mode: 0644]
vim/doc/surround.txt [new file with mode: 0644]
vim/doc/syntastic.txt [new file with mode: 0644]
vim/doc/tagbar.txt [new file with mode: 0644]
vim/doc/taglist.txt [new file with mode: 0644]
vim/doc/tags [new file with mode: 0644]
vim/doc/textile.txt [new file with mode: 0644]
vim/doc/unimpaired.txt [new file with mode: 0644]
vim/ftdetect/arduino.vim [new file with mode: 0644]
vim/ftdetect/coffee.vim [new file with mode: 0644]
vim/ftdetect/cucumber.vim [new file with mode: 0644]
vim/ftdetect/eco.vim [new file with mode: 0644]
vim/ftdetect/git.vim [new file with mode: 0644]
vim/ftdetect/haml.vim [new file with mode: 0644]
vim/ftdetect/markdown.vim [new file with mode: 0644]
vim/ftdetect/mustache.vim [new file with mode: 0644]
vim/ftdetect/puppet.vim [new file with mode: 0644]
vim/ftdetect/scala.vim [new file with mode: 0644]
vim/ftdetect/textile.vim [new file with mode: 0644]
vim/ftplugin/coffee.vim [new file with mode: 0644]
vim/ftplugin/cucumber.vim [new file with mode: 0644]
vim/ftplugin/git.vim [new file with mode: 0644]
vim/ftplugin/gitcommit.vim [new file with mode: 0644]
vim/ftplugin/gitconfig.vim [new file with mode: 0644]
vim/ftplugin/gitrebase.vim [new file with mode: 0644]
vim/ftplugin/gitsendemail.vim [new file with mode: 0644]
vim/ftplugin/haml.vim [new file with mode: 0644]
vim/ftplugin/html_snip_helper.vim [new file with mode: 0644]
vim/ftplugin/markdown.vim [new file with mode: 0644]
vim/ftplugin/puppet.vim [new file with mode: 0644]
vim/ftplugin/sass.vim [new file with mode: 0644]
vim/ftplugin/scss.vim [new file with mode: 0644]
vim/ftplugin/textile.vim [new file with mode: 0644]
vim/gvimrc [new file with mode: 0644]
vim/indent/coffee.vim [new file with mode: 0644]
vim/indent/cucumber.vim [new file with mode: 0644]
vim/indent/gitconfig.vim [new file with mode: 0644]
vim/indent/haml.vim [new file with mode: 0644]
vim/indent/javascript.vim [new file with mode: 0644]
vim/indent/puppet.vim [new file with mode: 0644]
vim/indent/sass.vim [new file with mode: 0644]
vim/indent/scala.vim [new file with mode: 0644]
vim/indent/scss.vim [new file with mode: 0644]
vim/nerdtree_plugin/exec_menuitem.vim [new file with mode: 0644]
vim/nerdtree_plugin/fs_menu.vim [new file with mode: 0644]
vim/plugin/.DS_Store [new file with mode: 0644]
vim/plugin/31-create-scala.vim [new file with mode: 0644]
vim/plugin/AlignMapsPlugin.vim [new file with mode: 0644]
vim/plugin/AlignPlugin.vim [new file with mode: 0644]
vim/plugin/EasyMotion.vim [new file with mode: 0755]
vim/plugin/NERD_commenter.vim [new file with mode: 0644]
vim/plugin/NERD_tree.vim [new file with mode: 0644]
vim/plugin/SearchComplete.vim [new file with mode: 0644]
vim/plugin/ZoomWinPlugin.vim [new file with mode: 0644]
vim/plugin/ack.vim [new file with mode: 0644]
vim/plugin/cecutil.vim [new file with mode: 0644]
vim/plugin/color_sample_pack.vim [new file with mode: 0644]
vim/plugin/conque_term.vim [new file with mode: 0644]
vim/plugin/delimitMate.vim [new file with mode: 0644]
vim/plugin/endwise.vim [new file with mode: 0644]
vim/plugin/fugitive.vim [new file with mode: 0644]
vim/plugin/gist.vim [new file with mode: 0644]
vim/plugin/indent-object.vim [new file with mode: 0644]
vim/plugin/rails.vim [new file with mode: 0644]
vim/plugin/searchfold_0.9.vim [new file with mode: 0644]
vim/plugin/showmarks.vim [new file with mode: 0644]
vim/plugin/snipMate.vim [new file with mode: 0644]
vim/plugin/supertab.vim [new file with mode: 0644]
vim/plugin/surround.vim [new file with mode: 0644]
vim/plugin/syntastic.vim [new file with mode: 0644]
vim/plugin/tagbar.vim [new file with mode: 0644]
vim/plugin/taglist.vim [new file with mode: 0644]
vim/plugin/unimpaired.vim [new file with mode: 0644]
vim/plugin/vim-rspec.rb [new file with mode: 0644]
vim/plugin/vim-rspec.vim [new file with mode: 0644]
vim/plugin/vim-rspec.xsl [new file with mode: 0644]
vim/ruby/.DS_Store [new file with mode: 0644]
vim/snippets/_.snippets [new file with mode: 0644]
vim/snippets/autoit.snippets [new file with mode: 0644]
vim/snippets/c.snippets [new file with mode: 0644]
vim/snippets/cpp.snippets [new file with mode: 0644]
vim/snippets/erlang.snippets [new file with mode: 0644]
vim/snippets/html.snippets [new file with mode: 0644]
vim/snippets/java.snippets [new file with mode: 0644]
vim/snippets/javascript.snippets [new file with mode: 0644]
vim/snippets/mako.snippets [new file with mode: 0644]
vim/snippets/objc.snippets [new file with mode: 0644]
vim/snippets/perl.snippets [new file with mode: 0644]
vim/snippets/php.snippets [new file with mode: 0644]
vim/snippets/puppet.snippets [new file with mode: 0644]
vim/snippets/python.snippets [new file with mode: 0644]
vim/snippets/ruby.snippets [new file with mode: 0644]
vim/snippets/sh.snippets [new file with mode: 0644]
vim/snippets/snippet.snippets [new file with mode: 0644]
vim/snippets/tcl.snippets [new file with mode: 0644]
vim/snippets/tex.snippets [new file with mode: 0644]
vim/snippets/vim.snippets [new file with mode: 0644]
vim/snippets/zsh.snippets [new file with mode: 0644]
vim/syntax/arduino.vim [new file with mode: 0644]
vim/syntax/coffee.vim [new file with mode: 0755]
vim/syntax/conque_term.vim [new file with mode: 0644]
vim/syntax/cucumber.vim [new file with mode: 0644]
vim/syntax/eco.vim [new file with mode: 0644]
vim/syntax/git.vim [new file with mode: 0644]
vim/syntax/gitcommit.vim [new file with mode: 0644]
vim/syntax/gitconfig.vim [new file with mode: 0644]
vim/syntax/gitrebase.vim [new file with mode: 0644]
vim/syntax/gitsendemail.vim [new file with mode: 0644]
vim/syntax/javascript.vim [new file with mode: 0644]
vim/syntax/markdown.vim [new file with mode: 0644]
vim/syntax/mustache.vim [new file with mode: 0644]
vim/syntax/puppet.vim [new file with mode: 0644]
vim/syntax/sass.vim [new file with mode: 0644]
vim/syntax/scala.vim [new file with mode: 0644]
vim/syntax/scss.vim [new file with mode: 0644]
vim/syntax/snippet.vim [new file with mode: 0644]
vim/syntax/tagbar.vim [new file with mode: 0644]
vim/syntax/textile.vim [new file with mode: 0644]
vim/syntax/vim-rspec.vim [new file with mode: 0644]
vim/syntax_checkers/applescript.vim [new file with mode: 0644]
vim/syntax_checkers/c.vim [new file with mode: 0644]
vim/syntax_checkers/coffee.vim [new file with mode: 0644]
vim/syntax_checkers/cpp.vim [new file with mode: 0644]
vim/syntax_checkers/css.vim [new file with mode: 0644]
vim/syntax_checkers/cucumber.vim [new file with mode: 0644]
vim/syntax_checkers/cuda.vim [new file with mode: 0644]
vim/syntax_checkers/docbk.vim [new file with mode: 0644]
vim/syntax_checkers/efm_perl.pl [new file with mode: 0644]
vim/syntax_checkers/erlang.vim [new file with mode: 0644]
vim/syntax_checkers/erlang_check_file.erl [new file with mode: 0755]
vim/syntax_checkers/eruby.vim [new file with mode: 0644]
vim/syntax_checkers/fortran.vim [new file with mode: 0644]
vim/syntax_checkers/gentoo_metadata.vim [new file with mode: 0644]
vim/syntax_checkers/go.vim [new file with mode: 0644]
vim/syntax_checkers/go/6g.vim [new file with mode: 0644]
vim/syntax_checkers/go/gofmt.vim [new file with mode: 0644]
vim/syntax_checkers/haml.vim [new file with mode: 0644]
vim/syntax_checkers/haskell.vim [new file with mode: 0644]
vim/syntax_checkers/haxe.vim [new file with mode: 0644]
vim/syntax_checkers/html.vim [new file with mode: 0644]
vim/syntax_checkers/javascript.vim [new file with mode: 0644]
vim/syntax_checkers/javascript/gjslint.vim [new file with mode: 0644]
vim/syntax_checkers/javascript/jshint.vim [new file with mode: 0644]
vim/syntax_checkers/javascript/jsl.vim [new file with mode: 0644]
vim/syntax_checkers/javascript/jslint.vim [new file with mode: 0644]
vim/syntax_checkers/json.vim [new file with mode: 0644]
vim/syntax_checkers/json/jsonlint.vim [new file with mode: 0644]
vim/syntax_checkers/json/jsonval.vim [new file with mode: 0644]
vim/syntax_checkers/less.vim [new file with mode: 0644]
vim/syntax_checkers/lua.vim [new file with mode: 0644]
vim/syntax_checkers/matlab.vim [new file with mode: 0644]
vim/syntax_checkers/ocaml.vim [new file with mode: 0644]
vim/syntax_checkers/perl.vim [new file with mode: 0644]
vim/syntax_checkers/php.vim [new file with mode: 0644]
vim/syntax_checkers/puppet.vim [new file with mode: 0644]
vim/syntax_checkers/python.vim [new file with mode: 0644]
vim/syntax_checkers/rst.vim [new file with mode: 0644]
vim/syntax_checkers/ruby.vim [new file with mode: 0644]
vim/syntax_checkers/rust.vim [new file with mode: 0644]
vim/syntax_checkers/sass.vim [new file with mode: 0644]
vim/syntax_checkers/scss.vim [new file with mode: 0644]
vim/syntax_checkers/sh.vim [new file with mode: 0644]
vim/syntax_checkers/tcl.vim [new file with mode: 0644]
vim/syntax_checkers/tex.vim [new file with mode: 0644]
vim/syntax_checkers/vala.vim [new file with mode: 0644]
vim/syntax_checkers/xhtml.vim [new file with mode: 0644]
vim/syntax_checkers/xml.vim [new file with mode: 0644]
vim/syntax_checkers/xslt.vim [new file with mode: 0644]
vim/syntax_checkers/yaml.vim [new file with mode: 0644]
vim/syntax_checkers/zpt.vim [new file with mode: 0644]
vim/tmp/ack.vim [new submodule]
vim/tmp/align [new submodule]
vim/tmp/arduino [new submodule]
vim/tmp/color-sampler [new submodule]
vim/tmp/command-t-1.2.1.vba [new file with mode: 0644]
vim/tmp/command_t/doc/command-t.txt [new file with mode: 0644]
vim/tmp/command_t/plugin/command-t.vim [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/controller.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/depend [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/ext.c [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/ext.h [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/extconf.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/finder.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/finder/buffer_finder.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/finder/file_finder.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/match.c [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/match.h [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/match_window.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/matcher.c [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/matcher.h [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/prompt.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/ruby_compat.h [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/scanner.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/scanner/buffer_scanner.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/scanner/file_scanner.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/settings.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/stub.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/vim.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/vim/path_utilities.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/vim/screen.rb [new file with mode: 0644]
vim/tmp/command_t/ruby/command-t/vim/window.rb [new file with mode: 0644]
vim/tmp/conque/autoload/conque_term.vim [new file with mode: 0644]
vim/tmp/conque/doc/conque_term.txt [new file with mode: 0644]
vim/tmp/conque/plugin/conque_term.vim [new file with mode: 0644]
vim/tmp/conque/syntax/conque_term.vim [new file with mode: 0644]
vim/tmp/conque_1.1.tar.gz [new file with mode: 0644]
vim/tmp/cucumber [new submodule]
vim/tmp/endwise [new submodule]
vim/tmp/fugitive [new submodule]
vim/tmp/gist-vim [new submodule]
vim/tmp/git [new submodule]
vim/tmp/haml [new submodule]
vim/tmp/indent_object [new submodule]
vim/tmp/irblack [new submodule]
vim/tmp/javascript [new submodule]
vim/tmp/markdown [new submodule]
vim/tmp/nerdcommenter [new submodule]
vim/tmp/nerdtree [new submodule]
vim/tmp/puppet [new submodule]
vim/tmp/rails [new submodule]
vim/tmp/rspec [new submodule]
vim/tmp/scala [new submodule]
vim/tmp/searchfold [new submodule]
vim/tmp/snipmate [new submodule]
vim/tmp/solarized [new submodule]
vim/tmp/supertab [new submodule]
vim/tmp/surround [new submodule]
vim/tmp/syntastic [new submodule]
vim/tmp/taglist [new submodule]
vim/tmp/textile [new submodule]
vim/tmp/unimpaired [new submodule]
vim/tmp/vim-coffee-script [new submodule]
vim/tmp/vividchalk [new submodule]
vim/tmp/zoomwin [new submodule]
vim/vimrc [new file with mode: 0644]

diff --git a/vim/.VimballRecord b/vim/.VimballRecord
new file mode 100644 (file)
index 0000000..058155c
--- /dev/null
@@ -0,0 +1,4 @@
+command-t-1.3.1.vba: call delete('/Users/benbeltran/.vim/ruby/command-t/controller.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/extconf.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/finder/buffer_finder.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/finder/file_finder.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/finder/jump_finder.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/finder.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/match_window.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/prompt.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/scanner/buffer_scanner.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/scanner/file_scanner.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/scanner/jump_scanner.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/scanner.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/settings.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/stub.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/vim/path_utilities.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/vim/screen.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/vim/window.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/vim.rb')|call delete('/Users/benbeltran/.vim/ruby/command-t/ext.c')|call delete('/Users/benbeltran/.vim/ruby/command-t/match.c')|call delete('/Users/benbeltran/.vim/ruby/command-t/matcher.c')|call delete('/Users/benbeltran/.vim/ruby/command-t/ext.h')|call delete('/Users/benbeltran/.vim/ruby/command-t/match.h')|call delete('/Users/benbeltran/.vim/ruby/command-t/matcher.h')|call delete('/Users/benbeltran/.vim/ruby/command-t/ruby_compat.h')|call delete('/Users/benbeltran/.vim/ruby/command-t/depend')|call delete('/Users/benbeltran/.vim/doc/command-t.txt')|call delete('/Users/benbeltran/.vim/plugin/command-t.vim')
+supertab.vba: call delete('/Users/benbeltran/.vim/doc/supertab.txt')|call delete('/Users/benbeltran/.vim/plugin/supertab.vim')
+tagbar.vmb: call delete('/Users/benbeltran/.vim/autoload/tagbar.vim')|call delete('/Users/benbeltran/.vim/doc/tagbar.txt')|call delete('/Users/benbeltran/.vim/plugin/tagbar.vim')|call delete('/Users/benbeltran/.vim/syntax/tagbar.vim')
+delimitMate-2.6.vba: call delete('/Users/benbeltran/.vim/plugin/delimitMate.vim')|call delete('/Users/benbeltran/.vim/autoload/delimitMate.vim')|call delete('/Users/benbeltran/.vim/doc/delimitMate.txt')
diff --git a/vim/.netrwhist b/vim/.netrwhist
new file mode 100644 (file)
index 0000000..ac734e4
--- /dev/null
@@ -0,0 +1,4 @@
+let g:netrw_dirhistmax  =10
+let g:netrw_dirhist_cnt =2
+let g:netrw_dirhist_1='/Users/benbeltran/.newsbeuter'
+let g:netrw_dirhist_2='/Users/benbeltran/.vim'
diff --git a/vim/CHANGELOG b/vim/CHANGELOG
new file mode 100644 (file)
index 0000000..040e0e8
--- /dev/null
@@ -0,0 +1,18 @@
+2010-12-29  wycats
+
+       * FEATURE: Opening with an explicit directory starts on NERDTree
+       * FEATURE: If you close the last window before NERDTree, close NERDTree
+       * EXTERNAL: Block insert mode in NERDTree [wycats/nerdtree]
+       * FEATURE: Add a Mkdir NERDTree/Command-T aware alias
+
+2010-12-28  wycats
+
+       * TAG: 0.9.0
+       * BUGFIX: Interaction bug between NERDTree and ZoomWin
+       * BUGFIX: Arrow keys not working in xterm [akatz]
+       * FEATURE: SearchFold
+       * FEATURE: Refresh NERDTree and CommandT on refocus
+       * FEATURE: <Leader><Leader> triggers ZoomWin
+       * FEATURE: JSLint plugin
+       * FEATURE: Improved, more modern-looking NERDTree
+       * FEATURE: irblack theme (now default)
diff --git a/vim/README.markdown b/vim/README.markdown
new file mode 100644 (file)
index 0000000..96b3193
--- /dev/null
@@ -0,0 +1,303 @@
+# Janus: Carlhuda's vim Distribution
+
+This is a basic distribution of vim plugins and tools intended to be run
+on top of the latest MacVIM snapshot.
+
+We (Carl and Yehuda) both use this distribution for our own use, and
+welcome patches and contributions to help make it an effective way to
+get started with vim and then use it productively for years to come.
+
+At present, we are still learning to use vim ourselves, so you should
+anticipate a period of rapid development while we get a handle on the
+best tools for the job. So far, we have mostly integrated existing
+plugins and tools, and we anticipate to continue doing so while also
+writing our own plugins as appropriate.
+
+In general, you can expect that the tools we use work well together and
+that we have given careful thought to the experience of using MacVIM
+with the tools in question. If you run into an issue using it, please
+report an issue to the issue tracker.
+
+## Pre-requisites
+
+Janus is built primarily for [MacVim](http://code.google.com/p/macvim/) on OSX.
+Download it [here](https://github.com/b4winckler/macvim/downloads).
+
+Alternatively, you can use Janus with the bundled console `vim` installation on
+OSX (via Terminal), or with any other `vim` or `gvim` installation.
+
+Linux users can install `gvim` for an experience identical to MacVim.
+On Debian/Ubuntu, simply `apt-get install vim-gnome`. For remote
+servers, install console vim with `apt-get install vim-nox`.
+
+On a fresh Ubuntu install you also have to install the packages `rake` and `ruby-dev`
+before running the install script and `exuberant-ctags` for ctags
+support.
+
+## Installation
+
+0. `for i in ~/.vim ~/.vimrc ~/.gvimrc; do [ -e $i ] && mv $i $i.old;
+   done`
+1. `git clone git://github.com/carlhuda/janus.git ~/.vim`
+2. `cd ~/.vim`
+3. `rake`
+
+or
+
+  `curl https://raw.github.com/carlhuda/janus/master/bootstrap.sh -o - | sh`
+
+## Customization
+
+Create `~/.vimrc.local` and `~/.gvimrc.local` for any local
+customizations.
+
+For example, to override the default color schemes:
+
+    echo color desert  > ~/.vimrc.local
+    echo color molokai > ~/.gvimrc.local
+
+If you want to add additional Vim plugins you can do so by adding a
+`~/.janus.rake` like so:
+
+    vim_plugin_task "zencoding", "git://github.com/mattn/zencoding-vim.git"
+    vim_plugin_task "minibufexpl", "git://github.com/fholgado/minibufexpl.vim.git"
+
+If you do not wish to use one of the plugins Janus provides out of the
+box you can have it skipped using the `skip_vim_plugin` method in
+`~/.janus.rake`:
+
+    skip_vim_plugin "color-sampler"
+
+**Note**: Skipping the plugin will only apply to installation. It won't
+remove configurations or mappings Janus might have added for it.
+
+## Updating to the latest version
+
+To update to the latest version of the distribution, just run `rake`
+again inside your `~/.vim` directory.
+
+# Intro to VIM
+
+Here's some tips if you've never used VIM before:
+
+## Tutorials
+
+* Type `vimtutor` into a shell to go through a brief interactive
+  tutorial inside VIM.
+* Read the slides at [VIM: Walking Without Crutches](http://walking-without-crutches.heroku.com/#1).
+* Watch the screencasts at [vimcasts.org](http://vimcasts.org/)
+* Watch Derek Wyatt's energetic tutorial videos at [his site](http://www.derekwyatt.org/vim/vim-tutorial-videos/)
+* Read wycats' perspective on learning vim at
+  [Everyone who tried to convince me to use vim was wrong](http://yehudakatz.com/2010/07/29/everyone-who-tried-to-convince-me-to-use-vim-was-wrong/)
+* Read this and other answers to a question about vim at StackOverflow:
+  [Your problem with Vim is that you don't grok vi](http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118)
+
+## Modes
+
+* VIM has two modes:
+  * insert mode- stuff you type is added to the buffer
+  * normal mode- keys you hit are interpretted as commands
+* To enter insert mode, hit `i`
+* To exit insert mode, hit `<ESC>`
+
+## Useful commands
+
+* Use `:q` to exit vim
+* Certain commands are prefixed with a `<Leader>` key, which maps to `\`
+  by default. Use `let mapleader = ","` to change this.
+* Keyboard [cheat sheet](http://walking-without-crutches.heroku.com/image/images/vi-vim-cheat-sheet.png).
+
+# Features
+
+This vim distribution includes a number of packages built by others.
+
+## Base Customizations
+
+Janus ships with a number of basic customizations for vim:
+
+* Line numbers
+* Ruler (line and column numbers)
+* No wrap (turn off per-buffer via set :wrap)
+* Soft 2-space tabs, and default hard tabs to 2 spaces
+* Show tailing whitespace as `.`
+* Make searching highlighted, incremental, and case insensitive unless a
+  capital letter is used
+* Always show a status line
+* Allow backspacing over everything (identations, eol, and start
+  characters) in insert mode
+* `<Leader>e` expands to `:e {directory of current file}/` (open in the
+  current buffer)
+* `<Leader>tr` expands to `:te {directory of current file}/` (open in a
+  new MacVIM tab)
+* `<C-P>` inserts the directory of the current file into a command
+
+## "Project Drawer" aka [NERDTree](http://github.com/wycats/nerdtree)
+
+NERDTree is a file explorer plugin that provides "project drawer"
+functionality to your vim projects.  You can learn more about it with
+:help NERDTree.
+
+**Customizations**: Janus adds a number of customizations to the core
+NERDTree:
+
+* Use `<Leader>n` to toggle NERDTree
+* Ignore `*.rbc` and `*~` files
+* Automatically activate NERDTree when MacVIM opens and make the
+  original buffer the active one
+* Provide alternative :e, :cd, :rm and :touch abbreviations which also
+  refresh NERDTree when done (when NERDTree is open)
+* When opening vim with vim /path, open the left NERDTree to that
+  directory, set the vim pwd, and clear the right buffer
+* Disallow `:e`ing files into the NERDTree buffer
+* In general, assume that there is a single NERDTree buffer on the left
+  and one or more editing buffers on the right
+
+## [Ack.vim](http://github.com/mileszs/ack.vim)
+
+
+Ack.vim uses ack to search inside the current directory for a pattern.
+You can learn more about it with :help Ack
+
+**Customizations**: Janus rebinds command-shift-f (`<D-F>`) to bring up
+`:Ack `.
+
+## [Align](http://github.com/tsaleh/vim-align)
+
+Align lets you align statements on their equal signs, make comment
+boxes, align comments, align declarations, etc.
+
+* `:5,10Align =>` to align lines 5-10 on `=>`'s
+
+## [Command-T](https://wincent.com/products/command-t)
+
+Command-T provides a mechanism for searching for a file inside the
+current working directory. It behaves similarly to command-t in
+Textmate.
+
+**Customizations**: Janus rebinds command-t (`<D-t>`) to bring up this
+plugin. It defaults to `<Leader>t`.
+
+## [ConqueTerm](http://code.google.com/p/conque/)
+
+ConqueTerm embeds a basic terminal inside a vim buffer. The terminal has
+an insert mode in which you can type commands, tab complete and use the
+terminal like normal. You can also escape out of insert mode to use
+other vim commands on the buffer, like yank and paste.
+
+**Customizations**: Janus binds command-e (`<D-e>`) to bring up
+`:ConqueTerm bash --login` in the current buffer.
+
+**Note**: To get colors working, you might have to `export TERM=xterm`
+and use `ls -G` or `gls --color`
+
+## [indent\_object](http://github.com/michaeljsmith/vim-indent-object)
+
+Indent object creates a "text object" that is relative to the current
+ident. Text objects work inside of visual mode, and with `c` (change),
+`d` (delete) and `y` (yank). For instance, try going into a method in
+normal mode, and type `v ii`. Then repeat `ii`.
+
+**Note**: indent\_object seems a bit busted. It would also be nice if
+there was a text object for Ruby `class` and `def` blocks.
+
+## [surround](http://github.com/tpope/vim-surround)
+
+Surround allows you to modify "surroundings" around the current text.
+For instance, if the cursor was inside `"foo bar"`, you could type
+`cs"'` to convert the text to `'foo bar'`.
+
+There's a lot more; check it out at `:help surround`
+
+## [NERDCommenter](http://github.com/ddollar/nerdcommenter)
+
+NERDCommenter allows you to wrangle your code comments, regardless of
+filetype. View `:help NERDCommenter` for all the details.
+
+**Customizations**: Janus binds command-/ (`<D-/>`) to toggle comments.
+
+## [SuperTab](http://github.com/ervandew/supertab)
+
+In insert mode, start typing something and hit `<TAB>` to tab-complete
+based on the current context.
+
+## ctags
+
+Janus includes the [TagList](http://github.com/vim-scripts/taglist.vim)
+plugin, which binds `:Tlist` to an overview panel that lists all ctags
+for easy navigation.
+
+**Customizations**: Janus binds `<Leader>rt` to the ctags command to
+update tags.
+
+**Note**: For full language support, run `brew install ctags` to install
+exuberant-ctags.
+
+**Tip**: Check out `:help ctags` for information about VIM's built-in
+ctag support. Tag navigation creates a stack which can traversed via
+`Ctrl-]` (to find the source of a token) and `Ctrl-T` (to jump back up
+one level).
+
+## Git Support ([Fugitive](http://github.com/tpope/vim-fugitive))
+
+Fugitive adds pervasive git support to git directories in vim. For more
+information, use `:help fugitive`
+
+Use `:Gstatus` to view `git status` and type `-` on any file to stage or
+unstage it. Type `p` on a file to enter `git add -p` and stage specific
+hunks in the file.
+
+Use `:Gdiff` on an open file to see what changes have been made to that
+file
+
+## [Gist-vim](http://github.com/mattn/gist-vim)
+
+Nice [gist integration](https://github.com/mattn/gist-vim) by mattn.
+Requires exporting your `GITHUB_TOKEN` and `GITHUB_USER` as environment
+variables or setup your [GitHub token config](http://help.github.com/git-email-settings/).
+
+Try `:Gist`, `:Gist -p` and visual blocks.
+
+## [ZoomWin](http://github.com/vim-scripts/ZoomWin)
+
+When working with split windows, ZoomWin lets you zoom into a window and
+out again using `Ctrl-W o`
+
+**Customizations**: Janus binds `<Leader><Leader>` to `:ZoomWin`
+
+## Additional Syntaxes
+
+Janus ships with a few additional syntaxes:
+
+* Markdown (bound to \*.markdown, \*.md, and \*.mk)
+* Mustache (bound to \*.mustache)
+* Arduino  (bound to \*.pde)
+* Haml (bound to \*.haml)
+* Sass (bound to \*.sass)
+* SCSS (bound to \*.scss)
+* An improved JavaScript syntax (bound to \*.js)
+* Map Gemfile, Rakefile, Vagrantfile and Thorfile to Ruby
+* Git commits (set your `EDITOR` to `mvim -f`)
+
+## Color schemes
+
+Janus includes the vim color sampler pack, which includes [over 100
+popular color themes](http://www.vi-improved.org/color_sampler_pack/):
+
+* jellybeans
+* matrix
+* railscasts2
+* tango
+* vibrantink
+* vividchalk
+* wombat
+* xoria256
+
+Use `:color vibrantink` to switch to a color scheme.
+
+Janus also has a few customized versions of popular themes:
+
+* jellybeans+
+* molokai
+* railscasts+
+* vwilight
+
diff --git a/vim/Rakefile b/vim/Rakefile
new file mode 100644 (file)
index 0000000..d2c938d
--- /dev/null
@@ -0,0 +1,247 @@
+module VIM
+  Dirs = %w[ after autoload doc plugin ruby snippets syntax ftdetect ftplugin colors indent ]
+end
+
+directory "tmp"
+VIM::Dirs.each do |dir|
+  directory(dir)
+end
+
+def vim_plugin_task(name, repo=nil)
+  cwd = File.expand_path("../", __FILE__)
+  dir = File.expand_path("tmp/#{name}")
+  subdirs = VIM::Dirs
+
+  namespace(name) do
+    if repo
+      file dir => "tmp" do
+        if repo =~ /git$/
+          sh "git clone #{repo} #{dir}"
+
+        elsif repo =~ /download_script/
+          if filename = `curl --silent --head #{repo} | grep attachment`[/filename=(.+)/,1]
+            filename.strip!
+            sh "curl #{repo} > tmp/#{filename}"
+          else
+            raise ArgumentError, 'unable to determine script type'
+          end
+
+        elsif repo =~ /(tar|gz|vba|zip)$/
+          filename = File.basename(repo)
+          sh "curl #{repo} > tmp/#{filename}"
+
+        else
+          raise ArgumentError, 'unrecognized source url for plugin'
+        end
+
+        case filename
+        when /zip$/
+          sh "unzip -o tmp/#{filename} -d #{dir}"
+
+        when /tar\.gz$/
+          dirname  = File.basename(filename, '.tar.gz')
+
+          sh "tar zxvf tmp/#{filename}"
+          sh "mv #{dirname} #{dir}"
+
+        when /vba(\.gz)?$/
+          if filename =~ /gz$/
+            sh "gunzip -f tmp/#{filename}"
+            filename = File.basename(filename, '.gz')
+          end
+
+          # TODO: move this into the install task
+          mkdir_p dir
+          lines = File.readlines("tmp/#{filename}")
+          current = lines.shift until current =~ /finish$/ # find finish line
+
+          while current = lines.shift
+            # first line is the filename (possibly followed by garbage)
+            # some vimballs use win32 style path separators
+            path = current[/^(.+?)(\t\[{3}\d)?$/, 1].gsub '\\', '/'
+
+            # then the size of the payload in lines
+            current = lines.shift
+            num_lines = current[/^(\d+)$/, 1].to_i
+
+            # the data itself
+            data = lines.slice!(0, num_lines).join
+
+            # install the data
+            Dir.chdir dir do
+              mkdir_p File.dirname(path)
+              File.open(path, 'w'){ |f| f.write(data) }
+            end
+          end
+        end
+      end
+
+      task :pull => dir do
+        if repo =~ /git$/
+          Dir.chdir dir do
+            sh "git pull"
+          end
+        end
+      end
+
+      task :install => [:pull] + subdirs do
+        Dir.chdir dir do
+          if File.exists?("Rakefile") and `rake -T` =~ /^rake install/
+            sh "rake install"
+          elsif File.exists?("install.sh")
+            sh "sh install.sh"
+          else
+            subdirs.each do |subdir|
+              if File.exists?(subdir)
+                sh "cp -RfL #{subdir}/* #{cwd}/#{subdir}/"
+              end
+            end
+          end
+        end
+
+        yield if block_given?
+      end
+    else
+      task :install => subdirs do
+        yield if block_given?
+      end
+    end
+  end
+
+  desc "Install #{name} plugin"
+  task name do
+    puts
+    puts "*" * 40
+    puts "*#{"Installing #{name}".center(38)}*"
+    puts "*" * 40
+    puts
+    Rake::Task["#{name}:install"].invoke
+  end
+  task :default => name
+end
+
+def skip_vim_plugin(name)
+  Rake::Task[:default].prerequisites.delete(name)
+end
+
+vim_plugin_task "ack.vim",          "git://github.com/mileszs/ack.vim.git"
+vim_plugin_task "color-sampler",    "git://github.com/vim-scripts/Color-Sampler-Pack.git"
+vim_plugin_task "conque",           "http://conque.googlecode.com/files/conque_1.1.tar.gz"
+vim_plugin_task "fugitive",         "git://github.com/tpope/vim-fugitive.git"
+vim_plugin_task "git",              "git://github.com/tpope/vim-git.git"
+vim_plugin_task "haml",             "git://github.com/tpope/vim-haml.git"
+vim_plugin_task "indent_object",    "git://github.com/michaeljsmith/vim-indent-object.git"
+vim_plugin_task "javascript",       "git://github.com/pangloss/vim-javascript.git"
+vim_plugin_task "nerdtree",         "git://github.com/wycats/nerdtree.git"
+vim_plugin_task "nerdcommenter",    "git://github.com/ddollar/nerdcommenter.git"
+vim_plugin_task "surround",         "git://github.com/tpope/vim-surround.git"
+vim_plugin_task "taglist",          "git://github.com/vim-scripts/taglist.vim.git"
+vim_plugin_task "vividchalk",       "git://github.com/tpope/vim-vividchalk.git"
+vim_plugin_task "solarized",        "git://github.com/altercation/vim-colors-solarized.git"
+vim_plugin_task "supertab",         "git://github.com/ervandew/supertab.git"
+vim_plugin_task "cucumber",         "git://github.com/tpope/vim-cucumber.git"
+vim_plugin_task "textile",          "git://github.com/timcharper/textile.vim.git"
+vim_plugin_task "rails",            "git://github.com/tpope/vim-rails.git"
+vim_plugin_task "rspec",            "git://github.com/taq/vim-rspec.git"
+vim_plugin_task "zoomwin",          "git://github.com/vim-scripts/ZoomWin.git"
+vim_plugin_task "snipmate",         "git://github.com/msanders/snipmate.vim.git"
+vim_plugin_task "markdown",         "git://github.com/tpope/vim-markdown.git"
+vim_plugin_task "align",            "git://github.com/tsaleh/vim-align.git"
+vim_plugin_task "unimpaired",       "git://github.com/tpope/vim-unimpaired.git"
+vim_plugin_task "searchfold",       "git://github.com/vim-scripts/searchfold.vim.git"
+vim_plugin_task "endwise",          "git://github.com/tpope/vim-endwise.git"
+vim_plugin_task "irblack",          "git://github.com/wgibbs/vim-irblack.git"
+vim_plugin_task "vim-coffee-script","git://github.com/kchmck/vim-coffee-script.git"
+vim_plugin_task "syntastic",        "git://github.com/scrooloose/syntastic.git"
+vim_plugin_task "puppet",           "git://github.com/ajf/puppet-vim.git"
+vim_plugin_task "scala",            "git://github.com/bdd/vim-scala.git"
+vim_plugin_task "gist-vim",         "git://github.com/mattn/gist-vim.git"
+
+#vim_plugin_task "hammer",           "git://github.com/robgleeson/hammer.vim.git" do
+#  sh "gem install github-markup redcarpet"
+#end
+
+vim_plugin_task "janus_themes" do
+  # custom version of railscasts theme
+  File.open(File.expand_path("../colors/railscasts+.vim", __FILE__), "w") do |file|
+    file.puts <<-VIM.gsub(/^ +/, "").gsub("<SP>", " ")
+      runtime colors/railscasts.vim
+      let g:colors_name = "railscasts+"
+
+      set fillchars=vert:\\<SP>
+      set fillchars=stl:\\<SP>
+      set fillchars=stlnc:\\<SP>
+      hi  StatusLine guibg=#cccccc guifg=#000000
+      hi  VertSplit  guibg=#dddddd
+    VIM
+  end
+
+  # custom version of jellybeans theme
+  File.open(File.expand_path("../colors/jellybeans+.vim", __FILE__), "w") do |file|
+    file.puts <<-VIM.gsub(/^      /, "")
+      runtime colors/jellybeans.vim
+      let g:colors_name = "jellybeans+"
+
+      hi  VertSplit    guibg=#888888
+      hi  StatusLine   guibg=#cccccc guifg=#000000
+      hi  StatusLineNC guibg=#888888 guifg=#000000
+    VIM
+  end
+end
+
+vim_plugin_task "molokai" do
+  sh "curl https://raw.github.com/mrtazz/molokai.vim/master/colors/molokai.vim > colors/molokai.vim"
+end
+vim_plugin_task "mustache" do
+  sh "curl https://raw.github.com/defunkt/mustache/master/contrib/mustache.vim > syntax/mustache.vim"
+  File.open(File.expand_path('../ftdetect/mustache.vim', __FILE__), 'w') do |file|
+    file << "au BufNewFile,BufRead *.mustache        setf mustache"
+  end
+end
+vim_plugin_task "arduino","git://github.com/vim-scripts/Arduino-syntax-file.git" do
+  File.open(File.expand_path('../ftdetect/arduino.vim', __FILE__), 'w') do |file|
+    file << "au BufNewFile,BufRead *.pde             setf arduino"
+  end
+end
+vim_plugin_task "vwilight" do
+  sh "curl https://raw.github.com/gist/796172/724c7ca237a7f6b8d857c4ac2991cfe5ffb18087 > colors/vwilight.vim"
+end
+
+if File.exists?(janus = File.expand_path("~/.janus.rake"))
+  puts "Loading your custom rake file"
+  import(janus)
+end
+
+desc "Update the documentation"
+task :update_docs do
+  puts "Updating VIM Documentation..."
+  system "vim -e -s <<-EOF\n:helptags ~/.vim/doc\n:quit\nEOF"
+end
+
+desc "link vimrc to ~/.vimrc"
+task :link_vimrc do
+  %w[ vimrc gvimrc ].each do |file|
+    dest = File.expand_path("~/.#{file}")
+    unless File.exist?(dest)
+      ln_s(File.expand_path("../#{file}", __FILE__), dest)
+    end
+  end
+end
+
+task :clean do
+  system "git clean -dfx"
+end
+
+desc "Pull the latest"
+task :pull do
+  system "git pull"
+end
+
+task :default => [
+  :update_docs,
+  :link_vimrc
+]
+
+desc "Clear out all build artifacts and rebuild the latest Janus"
+task :upgrade => [:clean, :pull, :default]
+
diff --git a/vim/after/plugin/snipMate.vim b/vim/after/plugin/snipMate.vim
new file mode 100644 (file)
index 0000000..bdbe199
--- /dev/null
@@ -0,0 +1,40 @@
+" These are the mappings for snipMate.vim. Putting it here ensures that it
+" will be mapped after other plugins such as supertab.vim.
+if !exists('loaded_snips') || exists('s:did_snips_mappings')
+       finish
+endif
+let s:did_snips_mappings = 1
+
+" This is put here in the 'after' directory in order for snipMate to override
+" other plugin mappings (e.g., supertab).
+"
+" You can safely adjust these mappings to your preferences (as explained in
+" :help snipMate-remap).
+ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
+snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
+ino <silent> <s-tab> <c-r>=BackwardsSnippet()<cr>
+snor <silent> <s-tab> <esc>i<right><c-r>=BackwardsSnippet()<cr>
+ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>
+
+" The default mappings for these are annoying & sometimes break snipMate.
+" You can change them back if you want, I've put them here for convenience.
+snor <bs> b<bs>
+snor <right> <esc>a
+snor <left> <esc>bi
+snor ' b<bs>'
+snor ` b<bs>`
+snor % b<bs>%
+snor U b<bs>U
+snor ^ b<bs>^
+snor \ b<bs>\
+snor <c-x> b<bs><c-x>
+
+" By default load snippets in snippets_dir
+if empty(snippets_dir)
+       finish
+endif
+
+call GetSnippets(snippets_dir, '_') " Get global snippets
+
+au FileType * if &ft != 'help' | call GetSnippets(snippets_dir, &ft) | endif
+" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/after/syntax/html.vim b/vim/after/syntax/html.vim
new file mode 100644 (file)
index 0000000..63ebaec
--- /dev/null
@@ -0,0 +1,10 @@
+" Language:    CoffeeScript
+" Maintainer:  Mick Koch <kchmck@gmail.com>
+" URL:         http://github.com/kchmck/vim-coffee-script
+" License:     WTFPL
+
+" Syntax highlighting for text/coffeescript script tags
+syn include @htmlCoffeeScript syntax/coffee.vim
+syn region coffeeScript start=+<script [^>]*type *=[^>]*text/coffeescript[^>]*>+
+\                       end=+</script>+me=s-1 keepend
+\                       contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
diff --git a/vim/autoload/.DS_Store b/vim/autoload/.DS_Store
new file mode 100644 (file)
index 0000000..5008ddf
Binary files /dev/null and b/vim/autoload/.DS_Store differ
diff --git a/vim/autoload/Align.vim b/vim/autoload/Align.vim
new file mode 100644 (file)
index 0000000..bce3542
--- /dev/null
@@ -0,0 +1,1029 @@
+" Align: tool to align multiple fields based on one or more separators
+"   Author:            Charles E. Campbell, Jr.
+"   Date:              Mar 03, 2009
+"   Version:   35
+" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
+" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
+" Copyright:    Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
+"               Permission is hereby granted to use and distribute this code,
+"               with or without modifications, provided that this copyright
+"               notice is copied with it. Like anything else that's free,
+"               Align.vim is provided *as is* and comes with no warranty
+"               of any kind, either expressed or implied. By using this
+"               plugin, you agree that in no event will the copyright
+"               holder be liable for any damages resulting from the use
+"               of this software.
+"
+" Romans 1:16,17a : For I am not ashamed of the gospel of Christ, for it is {{{1
+" the power of God for salvation for everyone who believes; for the Jew first,
+" and also for the Greek.  For in it is revealed God's righteousness from
+" faith to faith.
+
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if exists("g:loaded_Align") || &cp
+ finish
+endif
+let g:loaded_Align = "v35"
+if v:version < 700
+ echohl WarningMsg
+ echo "***warning*** this version of Align needs vim 7.0"
+ echohl Normal
+ finish
+endif
+let s:keepcpo= &cpo
+set cpo&vim
+"DechoTabOn
+
+" ---------------------------------------------------------------------
+" Debugging Support: {{{1
+"if !exists("g:loaded_Decho") | runtime plugin/Decho.vim | endif
+
+" ---------------------------------------------------------------------
+" Options: {{{1
+if !exists("g:Align_xstrlen")
+ if &enc == "latin1" || $LANG == "en_US.UTF-8" || !has("multi_byte")
+  let g:Align_xstrlen= 0
+ else
+  let g:Align_xstrlen= 1
+ endif
+endif
+
+" ---------------------------------------------------------------------
+" Align#AlignCtrl: enter alignment patterns here {{{1
+"
+"   Styles   =  all alignment-break patterns are equivalent
+"            C  cycle through alignment-break pattern(s)
+"            l  left-justified alignment
+"            r  right-justified alignment
+"            c  center alignment
+"            -  skip separator, treat as part of field
+"            :  treat rest of line as field
+"            +  repeat previous [lrc] style
+"            <  left justify separators
+"            >  right justify separators
+"            |  center separators
+"
+"   Builds   =  s:AlignPat  s:AlignCtrl  s:AlignPatQty
+"            C  s:AlignPat  s:AlignCtrl  s:AlignPatQty
+"            p  s:AlignPrePad
+"            P  s:AlignPostPad
+"            w  s:AlignLeadKeep
+"            W  s:AlignLeadKeep
+"            I  s:AlignLeadKeep
+"            l  s:AlignStyle
+"            r  s:AlignStyle
+"            -  s:AlignStyle
+"            +  s:AlignStyle
+"            :  s:AlignStyle
+"            c  s:AlignStyle
+"            g  s:AlignGPat
+"            v  s:AlignVPat
+"            <  s:AlignSep
+"            >  s:AlignSep
+"            |  s:AlignSep
+fun! Align#AlignCtrl(...)
+
+"  call Dfunc("AlignCtrl(...) a:0=".a:0)
+
+  " save options that will be changed
+  let keep_search = @/
+  let keep_ic     = &ic
+
+  " turn ignorecase off
+  set noic
+
+  " clear visual mode so that old visual-mode selections don't
+  " get applied to new invocations of Align().
+  if v:version < 602
+   if !exists("s:Align_gavemsg")
+       let s:Align_gavemsg= 1
+    echomsg "Align needs at least Vim version 6.2 to clear visual-mode selection"
+   endif
+  elseif exists("s:dovisclear")
+"   call Decho("clearing visual mode a:0=".a:0." a:1<".a:1.">")
+   let clearvmode= visualmode(1)
+  endif
+
+  " set up a list akin to an argument list
+  if a:0 > 0
+   let A= s:QArgSplitter(a:1)
+  else
+   let A=[0]
+  endif
+
+  if A[0] > 0
+   let style = A[1]
+
+   " Check for bad separator patterns (zero-length matches)
+   " (but zero-length patterns for g/v is ok)
+   if style !~# '[gv]'
+    let ipat= 2
+    while ipat <= A[0]
+     if "" =~ A[ipat]
+      echoerr "AlignCtrl: separator<".A[ipat]."> matches zero-length string"
+         let &ic= keep_ic
+"      call Dret("AlignCtrl")
+      return
+     endif
+     let ipat= ipat + 1
+    endwhile
+   endif
+  endif
+
+"  call Decho("AlignCtrl() A[0]=".A[0])
+  if !exists("s:AlignStyle")
+   let s:AlignStyle= "l"
+  endif
+  if !exists("s:AlignPrePad")
+   let s:AlignPrePad= 0
+  endif
+  if !exists("s:AlignPostPad")
+   let s:AlignPostPad= 0
+  endif
+  if !exists("s:AlignLeadKeep")
+   let s:AlignLeadKeep= 'w'
+  endif
+
+  if A[0] == 0
+   " ----------------------
+   " List current selection
+   " ----------------------
+   if !exists("s:AlignPatQty")
+       let s:AlignPatQty= 0
+   endif
+   echo "AlignCtrl<".s:AlignCtrl."> qty=".s:AlignPatQty." AlignStyle<".s:AlignStyle."> Padding<".s:AlignPrePad."|".s:AlignPostPad."> LeadingWS=".s:AlignLeadKeep." AlignSep=".s:AlignSep
+"   call Decho("AlignCtrl<".s:AlignCtrl."> qty=".s:AlignPatQty." AlignStyle<".s:AlignStyle."> Padding<".s:AlignPrePad."|".s:AlignPostPad."> LeadingWS=".s:AlignLeadKeep." AlignSep=".s:AlignSep)
+   if      exists("s:AlignGPat") && !exists("s:AlignVPat")
+       echo "AlignGPat<".s:AlignGPat.">"
+   elseif !exists("s:AlignGPat") &&  exists("s:AlignVPat")
+       echo "AlignVPat<".s:AlignVPat.">"
+   elseif exists("s:AlignGPat") &&  exists("s:AlignVPat")
+       echo "AlignGPat<".s:AlignGPat."> AlignVPat<".s:AlignVPat.">"
+   endif
+   let ipat= 1
+   while ipat <= s:AlignPatQty
+       echo "Pat".ipat."<".s:AlignPat_{ipat}.">"
+"      call Decho("Pat".ipat."<".s:AlignPat_{ipat}.">")
+       let ipat= ipat + 1
+   endwhile
+
+  else
+   " ----------------------------------
+   " Process alignment control settings
+   " ----------------------------------
+"   call Decho("process the alignctrl settings")
+"   call Decho("style<".style.">")
+
+   if style ==? "default"
+     " Default:  preserve initial leading whitespace, left-justified,
+     "           alignment on '=', one space padding on both sides
+        if exists("s:AlignCtrlStackQty")
+         " clear AlignCtrl stack
+      while s:AlignCtrlStackQty > 0
+          call Align#AlignPop()
+         endwhile
+         unlet s:AlignCtrlStackQty
+        endif
+        " Set AlignCtrl to its default value
+     call Align#AlignCtrl("Ilp1P1=<",'=')
+        call Align#AlignCtrl("g")
+        call Align#AlignCtrl("v")
+        let s:dovisclear = 1
+        let &ic          = keep_ic
+        let @/           = keep_search
+"     call Dret("AlignCtrl")
+        return
+   endif
+
+   if style =~# 'm'
+       " map support: Do an AlignPush now and the next call to Align()
+       "              will do an AlignPop at exit
+"      call Decho("style case m: do AlignPush")
+       call Align#AlignPush()
+       let s:DoAlignPop= 1
+   endif
+
+   " = : record a list of alignment patterns that are equivalent
+   if style =~# "="
+"      call Decho("style case =: record list of equiv alignment patterns")
+    let s:AlignCtrl  = '='
+       if A[0] >= 2
+     let s:AlignPatQty= 1
+     let s:AlignPat_1 = A[2]
+     let ipat         = 3
+     while ipat <= A[0]
+      let s:AlignPat_1 = s:AlignPat_1.'\|'.A[ipat]
+      let ipat         = ipat + 1
+     endwhile
+     let s:AlignPat_1= '\('.s:AlignPat_1.'\)'
+"     call Decho("AlignCtrl<".s:AlignCtrl."> AlignPat<".s:AlignPat_1.">")
+       endif
+
+    "c : cycle through alignment pattern(s)
+   elseif style =~# 'C'
+"      call Decho("style case C: cycle through alignment pattern(s)")
+    let s:AlignCtrl  = 'C'
+       if A[0] >= 2
+     let s:AlignPatQty= A[0] - 1
+     let ipat         = 1
+     while ipat < A[0]
+      let s:AlignPat_{ipat}= A[ipat+1]
+"     call Decho("AlignCtrl<".s:AlignCtrl."> AlignQty=".s:AlignPatQty." AlignPat_".ipat."<".s:AlignPat_{ipat}.">")
+      let ipat= ipat + 1
+     endwhile
+       endif
+   endif
+
+   if style =~# 'p'
+    let s:AlignPrePad= substitute(style,'^.*p\(\d\+\).*$','\1','')
+"      call Decho("style case p".s:AlignPrePad.": pre-separator padding")
+    if s:AlignPrePad == ""
+     echoerr "AlignCtrl: 'p' needs to be followed by a numeric argument'
+     let @/ = keep_search
+        let &ic= keep_ic
+"     call Dret("AlignCtrl")
+     return
+       endif
+   endif
+
+   if style =~# 'P'
+    let s:AlignPostPad= substitute(style,'^.*P\(\d\+\).*$','\1','')
+"      call Decho("style case P".s:AlignPostPad.": post-separator padding")
+    if s:AlignPostPad == ""
+     echoerr "AlignCtrl: 'P' needs to be followed by a numeric argument'
+     let @/ = keep_search
+        let &ic= keep_ic
+"     call Dret("AlignCtrl")
+     return
+       endif
+   endif
+
+   if     style =~# 'w'
+"      call Decho("style case w: ignore leading whitespace")
+       let s:AlignLeadKeep= 'w'
+   elseif style =~# 'W'
+"      call Decho("style case w: keep leading whitespace")
+       let s:AlignLeadKeep= 'W'
+   elseif style =~# 'I'
+"      call Decho("style case w: retain initial leading whitespace")
+       let s:AlignLeadKeep= 'I'
+   endif
+
+   if style =~# 'g'
+       " first list item is a "g" selector pattern
+"      call Decho("style case g: global selector pattern")
+       if A[0] < 2
+        if exists("s:AlignGPat")
+         unlet s:AlignGPat
+"        call Decho("unlet s:AlignGPat")
+        endif
+       else
+        let s:AlignGPat= A[2]
+"       call Decho("s:AlignGPat<".s:AlignGPat.">")
+       endif
+   elseif style =~# 'v'
+       " first list item is a "v" selector pattern
+"      call Decho("style case v: global selector anti-pattern")
+       if A[0] < 2
+        if exists("s:AlignVPat")
+         unlet s:AlignVPat
+"        call Decho("unlet s:AlignVPat")
+        endif
+       else
+        let s:AlignVPat= A[2]
+"       call Decho("s:AlignVPat<".s:AlignVPat.">")
+       endif
+   endif
+
+    "[-lrc+:] : set up s:AlignStyle
+   if style =~# '[-lrc+:]'
+"      call Decho("style case [-lrc+:]: field justification")
+    let s:AlignStyle= substitute(style,'[^-lrc:+]','','g')
+"    call Decho("AlignStyle<".s:AlignStyle.">")
+   endif
+
+   "[<>|] : set up s:AlignSep
+   if style =~# '[<>|]'
+"      call Decho("style case [-lrc+:]: separator justification")
+       let s:AlignSep= substitute(style,'[^<>|]','','g')
+"      call Decho("AlignSep ".s:AlignSep)
+   endif
+  endif
+
+  " sanity
+  if !exists("s:AlignCtrl")
+   let s:AlignCtrl= '='
+  endif
+
+  " restore search and options
+  let @/ = keep_search
+  let &ic= keep_ic
+
+"  call Dret("AlignCtrl ".s:AlignCtrl.'p'.s:AlignPrePad.'P'.s:AlignPostPad.s:AlignLeadKeep.s:AlignStyle)
+  return s:AlignCtrl.'p'.s:AlignPrePad.'P'.s:AlignPostPad.s:AlignLeadKeep.s:AlignStyle
+endfun
+
+" ---------------------------------------------------------------------
+" s:MakeSpace: returns a string with spacecnt blanks {{{1
+fun! s:MakeSpace(spacecnt)
+"  call Dfunc("MakeSpace(spacecnt=".a:spacecnt.")")
+  let str      = ""
+  let spacecnt = a:spacecnt
+  while spacecnt > 0
+   let str      = str . " "
+   let spacecnt = spacecnt - 1
+  endwhile
+"  call Dret("MakeSpace <".str.">")
+  return str
+endfun
+
+" ---------------------------------------------------------------------
+" Align#Align: align selected text based on alignment pattern(s) {{{1
+fun! Align#Align(hasctrl,...) range
+"  call Dfunc("Align#Align(hasctrl=".a:hasctrl.",...) a:0=".a:0)
+
+  " sanity checks
+  if string(a:hasctrl) != "0" && string(a:hasctrl) != "1"
+   echohl Error|echo 'usage: Align#Align(hasctrl<'.a:hasctrl.'> (should be 0 or 1),"separator(s)"  (you have '.a:0.') )'|echohl None
+"   call Dret("Align#Align")
+   return
+  endif
+  if exists("s:AlignStyle") && s:AlignStyle == ":"
+   echohl Error |echo '(Align#Align) your AlignStyle is ":", which implies "do-no-alignment"!'|echohl None
+"   call Dret("Align#Align")
+   return
+  endif
+
+  " set up a list akin to an argument list
+  if a:0 > 0
+   let A= s:QArgSplitter(a:1)
+  else
+   let A=[0]
+  endif
+
+  " if :Align! was used, then the first argument is (should be!) an AlignCtrl string
+  " Note that any alignment control set this way will be temporary.
+  let hasctrl= a:hasctrl
+"  call Decho("hasctrl=".hasctrl)
+  if a:hasctrl && A[0] >= 1
+"   call Decho("Align! : using A[1]<".A[1]."> for AlignCtrl")
+   if A[1] =~ '[gv]'
+       let hasctrl= hasctrl + 1
+       call Align#AlignCtrl('m')
+    call Align#AlignCtrl(A[1],A[2])
+"    call Decho("Align! : also using A[2]<".A[2]."> for AlignCtrl")
+   elseif A[1] !~ 'm'
+    call Align#AlignCtrl(A[1]."m")
+   else
+    call Align#AlignCtrl(A[1])
+   endif
+  endif
+
+  " Check for bad separator patterns (zero-length matches)
+  let ipat= 1 + hasctrl
+  while ipat <= A[0]
+   if "" =~ A[ipat]
+       echoerr "Align: separator<".A[ipat]."> matches zero-length string"
+"    call Dret("Align#Align")
+       return
+   endif
+   let ipat= ipat + 1
+  endwhile
+
+  " record current search pattern for subsequent restoration
+  let keep_search= @/
+  let keep_ic    = &ic
+  let keep_report= &report
+  set noic report=10000
+
+  if A[0] > hasctrl
+  " Align will accept a list of separator regexps
+"   call Decho("A[0]=".A[0].": accepting list of separator regexp")
+
+   if s:AlignCtrl =~# "="
+       "= : consider all separators to be equivalent
+"    call Decho("AlignCtrl: record list of equivalent alignment patterns")
+    let s:AlignCtrl  = '='
+    let s:AlignPat_1 = A[1 + hasctrl]
+    let s:AlignPatQty= 1
+    let ipat         = 2 + hasctrl
+    while ipat <= A[0]
+     let s:AlignPat_1 = s:AlignPat_1.'\|'.A[ipat]
+     let ipat         = ipat + 1
+    endwhile
+    let s:AlignPat_1= '\('.s:AlignPat_1.'\)'
+"    call Decho("AlignCtrl<".s:AlignCtrl."> AlignPat<".s:AlignPat_1.">")
+
+   elseif s:AlignCtrl =~# 'C'
+    "c : cycle through alignment pattern(s)
+"    call Decho("AlignCtrl: cycle through alignment pattern(s)")
+    let s:AlignCtrl  = 'C'
+    let s:AlignPatQty= A[0] - hasctrl
+    let ipat         = 1
+    while ipat <= s:AlignPatQty
+     let s:AlignPat_{ipat}= A[(ipat + hasctrl)]
+"     call Decho("AlignCtrl<".s:AlignCtrl."> AlignQty=".s:AlignPatQty." AlignPat_".ipat."<".s:AlignPat_{ipat}.">")
+     let ipat= ipat + 1
+    endwhile
+   endif
+  endif
+
+  " Initialize so that begline<endline and begcol<endcol.
+  " Ragged right: check if the column associated with '< or '>
+  "               is greater than the line's string length -> ragged right.
+  " Have to be careful about visualmode() -- it returns the last visual
+  " mode used whether or not it was used currently.
+  let begcol   = virtcol("'<")-1
+  let endcol   = virtcol("'>")-1
+  if begcol > endcol
+   let begcol  = virtcol("'>")-1
+   let endcol  = virtcol("'<")-1
+  endif
+"  call Decho("begcol=".begcol." endcol=".endcol)
+  let begline  = a:firstline
+  let endline  = a:lastline
+  if begline > endline
+   let begline = a:lastline
+   let endline = a:firstline
+  endif
+"  call Decho("begline=".begline." endline=".endline)
+  let fieldcnt = 0
+  if (begline == line("'>") && endline == line("'<")) || (begline == line("'<") && endline == line("'>"))
+   let vmode= visualmode()
+"   call Decho("vmode=".vmode)
+   if vmode == "\<c-v>"
+       if exists("g:Align_xstrlen") && g:Align_xstrlen
+     let ragged   = ( col("'>") > s:Strlen(getline("'>")) || col("'<") > s:Strlen(getline("'<")) )
+       else
+     let ragged   = ( col("'>") > strlen(getline("'>")) || col("'<") > strlen(getline("'<")) )
+       endif
+   else
+       let ragged= 1
+   endif
+  else
+   let ragged= 1
+  endif
+  if ragged
+   let begcol= 0
+  endif
+"  call Decho("lines[".begline.",".endline."] col[".begcol.",".endcol."] ragged=".ragged." AlignCtrl<".s:AlignCtrl.">")
+
+  " Keep user options
+  let etkeep   = &l:et
+  let pastekeep= &l:paste
+  setlocal et paste
+
+  " convert selected range of lines to use spaces instead of tabs
+  " but if first line's initial white spaces are to be retained
+  " then use 'em
+  if begcol <= 0 && s:AlignLeadKeep == 'I'
+   " retain first leading whitespace for all subsequent lines
+   let bgntxt= substitute(getline(begline),'^\(\s*\).\{-}$','\1','')
+"   call Decho("retaining 1st leading whitespace: bgntxt<".bgntxt.">")
+   set noet
+  endif
+  exe begline.",".endline."ret"
+
+  " Execute two passes
+  " First  pass: collect alignment data (max field sizes)
+  " Second pass: perform alignment
+  let pass= 1
+  while pass <= 2
+"   call Decho(" ")
+"   call Decho("---- Pass ".pass.": ----")
+
+   let line= begline
+   while line <= endline
+    " Process each line
+    let txt = getline(line)
+"    call Decho(" ")
+"    call Decho("Pass".pass.": Line ".line." <".txt.">")
+
+    " AlignGPat support: allows a selector pattern (akin to g/selector/cmd )
+    if exists("s:AlignGPat")
+"       call Decho("Pass".pass.": AlignGPat<".s:AlignGPat.">")
+        if match(txt,s:AlignGPat) == -1
+"        call Decho("Pass".pass.": skipping")
+         let line= line + 1
+         continue
+        endif
+    endif
+
+    " AlignVPat support: allows a selector pattern (akin to v/selector/cmd )
+    if exists("s:AlignVPat")
+"       call Decho("Pass".pass.": AlignVPat<".s:AlignVPat.">")
+        if match(txt,s:AlignVPat) != -1
+"        call Decho("Pass".pass.": skipping")
+         let line= line + 1
+         continue
+        endif
+    endif
+
+       " Always skip blank lines
+       if match(txt,'^\s*$') != -1
+"        call Decho("Pass".pass.": skipping")
+        let line= line + 1
+        continue
+       endif
+
+    " Extract visual-block selected text (init bgntxt, endtxt)
+       if exists("g:Align_xstrlen") && g:Align_xstrlen
+     let txtlen= s:Strlen(txt)
+       else
+     let txtlen= strlen(txt)
+       endif
+    if begcol > 0
+        " Record text to left of selected area
+     let bgntxt= strpart(txt,0,begcol)
+"        call Decho("Pass".pass.": record text to left: bgntxt<".bgntxt.">")
+    elseif s:AlignLeadKeep == 'W'
+        let bgntxt= substitute(txt,'^\(\s*\).\{-}$','\1','')
+"        call Decho("Pass".pass.": retaining all leading ws: bgntxt<".bgntxt.">")
+    elseif s:AlignLeadKeep == 'w' || !exists("bgntxt")
+        " No beginning text
+        let bgntxt= ""
+"        call Decho("Pass".pass.": no beginning text")
+    endif
+    if ragged
+        let endtxt= ""
+    else
+     " Elide any text lying outside selected columnar region
+     let endtxt= strpart(txt,endcol+1,txtlen-endcol)
+     let txt   = strpart(txt,begcol,endcol-begcol+1)
+    endif
+"    call Decho(" ")
+"    call Decho("Pass".pass.": bgntxt<".bgntxt.">")
+"    call Decho("Pass".pass.":    txt<". txt  .">")
+"    call Decho("Pass".pass.": endtxt<".endtxt.">")
+       if !exists("s:AlignPat_{1}")
+        echohl Error|echo "no separators specified!"|echohl None
+"     call Dret("Align#Align")
+        return
+       endif
+
+    " Initialize for both passes
+    let seppat      = s:AlignPat_{1}
+    let ifield      = 1
+    let ipat        = 1
+    let bgnfield    = 0
+    let endfield    = 0
+    let alignstyle  = s:AlignStyle
+    let doend       = 1
+       let newtxt      = ""
+    let alignprepad = s:AlignPrePad
+    let alignpostpad= s:AlignPostPad
+       let alignsep    = s:AlignSep
+       let alignophold = " "
+       let alignop     = "l"
+"      call Decho("Pass".pass.": initial alignstyle<".alignstyle."> seppat<".seppat.">")
+
+    " Process each field on the line
+    while doend > 0
+
+         " C-style: cycle through pattern(s)
+     if s:AlignCtrl == 'C' && doend == 1
+         let seppat   = s:AlignPat_{ipat}
+"        call Decho("Pass".pass.": processing field: AlignCtrl=".s:AlignCtrl." ipat=".ipat." seppat<".seppat.">")
+         let ipat     = ipat + 1
+         if ipat > s:AlignPatQty
+          let ipat = 1
+         endif
+     endif
+
+        " cyclic alignment/justification operator handling
+        let alignophold  = alignop
+        let alignop      = strpart(alignstyle,0,1)
+        if alignop == '+' || doend == 2
+         let alignop= alignophold
+        else
+         let alignstyle   = strpart(alignstyle,1).strpart(alignstyle,0,1)
+         let alignopnxt   = strpart(alignstyle,0,1)
+         if alignop == ':'
+          let seppat  = '$'
+          let doend   = 2
+"         call Decho("Pass".pass.": alignop<:> case: setting seppat<$> doend==2")
+         endif
+        endif
+
+        " cylic separator alignment specification handling
+        let alignsepop= strpart(alignsep,0,1)
+        let alignsep  = strpart(alignsep,1).alignsepop
+
+        " mark end-of-field and the subsequent end-of-separator.
+        " Extend field if alignop is '-'
+     let endfield = match(txt,seppat,bgnfield)
+        let sepfield = matchend(txt,seppat,bgnfield)
+     let skipfield= sepfield
+"       call Decho("Pass".pass.": endfield=match(txt<".txt.">,seppat<".seppat.">,bgnfield=".bgnfield.")=".endfield)
+        while alignop == '-' && endfield != -1
+         let endfield  = match(txt,seppat,skipfield)
+         let sepfield  = matchend(txt,seppat,skipfield)
+         let skipfield = sepfield
+         let alignop   = strpart(alignstyle,0,1)
+         let alignstyle= strpart(alignstyle,1).strpart(alignstyle,0,1)
+"        call Decho("Pass".pass.": extend field: endfield<".strpart(txt,bgnfield,endfield-bgnfield)."> alignop<".alignop."> alignstyle<".alignstyle.">")
+        endwhile
+        let seplen= sepfield - endfield
+"       call Decho("Pass".pass.": seplen=[sepfield=".sepfield."] - [endfield=".endfield."]=".seplen)
+
+        if endfield != -1
+         if pass == 1
+          " ---------------------------------------------------------------------
+          " Pass 1: Update FieldSize to max
+"         call Decho("Pass".pass.": before lead/trail remove: field<".strpart(txt,bgnfield,endfield-bgnfield).">")
+          let field      = substitute(strpart(txt,bgnfield,endfield-bgnfield),'^\s*\(.\{-}\)\s*$','\1','')
+       if s:AlignLeadKeep == 'W'
+           let field = bgntxt.field
+           let bgntxt= ""
+          endif
+          if exists("g:Align_xstrlen") && g:Align_xstrlen
+           let fieldlen   = s:Strlen(field)
+          else
+           let fieldlen   = strlen(field)
+          endif
+          let sFieldSize = "FieldSize_".ifield
+          if !exists(sFieldSize)
+           let FieldSize_{ifield}= fieldlen
+"          call Decho("Pass".pass.":  set FieldSize_{".ifield."}=".FieldSize_{ifield}." <".field.">")
+          elseif fieldlen > FieldSize_{ifield}
+           let FieldSize_{ifield}= fieldlen
+"          call Decho("Pass".pass.": oset FieldSize_{".ifield."}=".FieldSize_{ifield}." <".field.">")
+          endif
+          let sSepSize= "SepSize_".ifield
+          if !exists(sSepSize)
+               let SepSize_{ifield}= seplen
+"          call Decho(" set SepSize_{".ifield."}=".SepSize_{ifield}." <".field.">")
+          elseif seplen > SepSize_{ifield}
+               let SepSize_{ifield}= seplen
+"          call Decho("Pass".pass.": oset SepSize_{".ifield."}=".SepSize_{ifield}." <".field.">")
+          endif
+
+         else
+          " ---------------------------------------------------------------------
+          " Pass 2: Perform Alignment
+          let prepad       = strpart(alignprepad,0,1)
+          let postpad      = strpart(alignpostpad,0,1)
+          let alignprepad  = strpart(alignprepad,1).strpart(alignprepad,0,1)
+          let alignpostpad = strpart(alignpostpad,1).strpart(alignpostpad,0,1)
+          let field        = substitute(strpart(txt,bgnfield,endfield-bgnfield),'^\s*\(.\{-}\)\s*$','\1','')
+       if s:AlignLeadKeep == 'W'
+           let field = bgntxt.field
+           let bgntxt= ""
+          endif
+          if doend == 2
+               let prepad = 0
+               let postpad= 0
+          endif
+          if exists("g:Align_xstrlen") && g:Align_xstrlen
+           let fieldlen   = s:Strlen(field)
+          else
+           let fieldlen   = strlen(field)
+          endif
+          let sep        = s:MakeSpace(prepad).strpart(txt,endfield,sepfield-endfield).s:MakeSpace(postpad)
+          if seplen < SepSize_{ifield}
+               if alignsepop == "<"
+                " left-justify separators
+                let sep       = sep.s:MakeSpace(SepSize_{ifield}-seplen)
+               elseif alignsepop == ">"
+                " right-justify separators
+                let sep       = s:MakeSpace(SepSize_{ifield}-seplen).sep
+               else
+                " center-justify separators
+                let sepleft   = (SepSize_{ifield} - seplen)/2
+                let sepright  = SepSize_{ifield} - seplen - sepleft
+                let sep       = s:MakeSpace(sepleft).sep.s:MakeSpace(sepright)
+               endif
+          endif
+          let spaces     = FieldSize_{ifield} - fieldlen
+"         call Decho("Pass".pass.": Field #".ifield."<".field."> spaces=".spaces." be[".bgnfield.",".endfield."] pad=".prepad.','.postpad." FS_".ifield."<".FieldSize_{ifield}."> sep<".sep."> ragged=".ragged." doend=".doend." alignop<".alignop.">")
+
+           " Perform alignment according to alignment style justification
+          if spaces > 0
+           if     alignop == 'c'
+                " center the field
+            let spaceleft = spaces/2
+            let spaceright= FieldSize_{ifield} - spaceleft - fieldlen
+            let newtxt    = newtxt.s:MakeSpace(spaceleft).field.s:MakeSpace(spaceright).sep
+           elseif alignop == 'r'
+                " right justify the field
+            let newtxt= newtxt.s:MakeSpace(spaces).field.sep
+           elseif ragged && doend == 2
+                " left justify rightmost field (no trailing blanks needed)
+            let newtxt= newtxt.field
+               else
+                " left justfiy the field
+            let newtxt= newtxt.field.s:MakeSpace(spaces).sep
+           endif
+          elseif ragged && doend == 2
+               " field at maximum field size and no trailing blanks needed
+           let newtxt= newtxt.field
+          else
+               " field is at maximum field size already
+           let newtxt= newtxt.field.sep
+          endif
+"         call Decho("Pass".pass.": newtxt<".newtxt.">")
+         endif " pass 1/2
+
+         " bgnfield indexes to end of separator at right of current field
+         " Update field counter
+         let bgnfield= sepfield
+      let ifield  = ifield + 1
+         if doend == 2
+          let doend= 0
+         endif
+          " handle end-of-text as end-of-field
+        elseif doend == 1
+         let seppat  = '$'
+         let doend   = 2
+        else
+         let doend   = 0
+        endif          " endfield != -1
+    endwhile   " doend loop (as well as regularly separated fields)
+
+       if pass == 2
+        " Write altered line to buffer
+"     call Decho("Pass".pass.": bgntxt<".bgntxt."> line=".line)
+"     call Decho("Pass".pass.": newtxt<".newtxt.">")
+"     call Decho("Pass".pass.": endtxt<".endtxt.">")
+        call setline(line,bgntxt.newtxt.endtxt)
+       endif
+
+    let line = line + 1
+   endwhile    " line loop
+
+   let pass= pass + 1
+  endwhile     " pass loop
+"  call Decho("end of two pass loop")
+
+  " Restore user options
+  let &l:et    = etkeep
+  let &l:paste = pastekeep
+
+  if exists("s:DoAlignPop")
+   " AlignCtrl Map support
+   call Align#AlignPop()
+   unlet s:DoAlignPop
+  endif
+
+  " restore current search pattern
+  let @/      = keep_search
+  let &ic     = keep_ic
+  let &report = keep_report
+
+"  call Dret("Align#Align")
+  return
+endfun
+
+" ---------------------------------------------------------------------
+" Align#AlignPush: this command/function pushes an alignment control string onto a stack {{{1
+fun! Align#AlignPush()
+"  call Dfunc("AlignPush()")
+
+  " initialize the stack
+  if !exists("s:AlignCtrlStackQty")
+   let s:AlignCtrlStackQty= 1
+  else
+   let s:AlignCtrlStackQty= s:AlignCtrlStackQty + 1
+  endif
+
+  " construct an AlignCtrlStack entry
+  if !exists("s:AlignSep")
+   let s:AlignSep= ''
+  endif
+  let s:AlignCtrlStack_{s:AlignCtrlStackQty}= s:AlignCtrl.'p'.s:AlignPrePad.'P'.s:AlignPostPad.s:AlignLeadKeep.s:AlignStyle.s:AlignSep
+"  call Decho("AlignPush: AlignCtrlStack_".s:AlignCtrlStackQty."<".s:AlignCtrlStack_{s:AlignCtrlStackQty}.">")
+
+  " push [GV] patterns onto their own stack
+  if exists("s:AlignGPat")
+   let s:AlignGPat_{s:AlignCtrlStackQty}= s:AlignGPat
+  else
+   let s:AlignGPat_{s:AlignCtrlStackQty}=  ""
+  endif
+  if exists("s:AlignVPat")
+   let s:AlignVPat_{s:AlignCtrlStackQty}= s:AlignVPat
+  else
+   let s:AlignVPat_{s:AlignCtrlStackQty}=  ""
+  endif
+
+"  call Dret("AlignPush")
+endfun
+
+" ---------------------------------------------------------------------
+" Align#AlignPop: this command/function pops an alignment pattern from a stack {{{1
+"           and into the AlignCtrl variables.
+fun! Align#AlignPop()
+"  call Dfunc("Align#AlignPop()")
+
+  " sanity checks
+  if !exists("s:AlignCtrlStackQty")
+   echoerr "AlignPush needs to be used prior to AlignPop"
+"   call Dret("Align#AlignPop <> : AlignPush needs to have been called first")
+   return ""
+  endif
+  if s:AlignCtrlStackQty <= 0
+   unlet s:AlignCtrlStackQty
+   echoerr "AlignPush needs to be used prior to AlignPop"
+"   call Dret("Align#AlignPop <> : AlignPop needs to have been called first")
+   return ""
+  endif
+
+  " pop top of AlignCtrlStack and pass value to AlignCtrl
+  let retval=s:AlignCtrlStack_{s:AlignCtrlStackQty}
+  unlet s:AlignCtrlStack_{s:AlignCtrlStackQty}
+  call Align#AlignCtrl(retval)
+
+  " pop G pattern stack
+  if s:AlignGPat_{s:AlignCtrlStackQty} != ""
+   call Align#AlignCtrl('g',s:AlignGPat_{s:AlignCtrlStackQty})
+  else
+   call Align#AlignCtrl('g')
+  endif
+  unlet s:AlignGPat_{s:AlignCtrlStackQty}
+
+  " pop V pattern stack
+  if s:AlignVPat_{s:AlignCtrlStackQty} != ""
+   call Align#AlignCtrl('v',s:AlignVPat_{s:AlignCtrlStackQty})
+  else
+   call Align#AlignCtrl('v')
+  endif
+
+  unlet s:AlignVPat_{s:AlignCtrlStackQty}
+  let s:AlignCtrlStackQty= s:AlignCtrlStackQty - 1
+
+"  call Dret("Align#AlignPop <".retval."> : AlignCtrlStackQty=".s:AlignCtrlStackQty)
+  return retval
+endfun
+
+" ---------------------------------------------------------------------
+" Align#AlignReplaceQuotedSpaces: {{{1
+fun! Align#AlignReplaceQuotedSpaces() 
+"  call Dfunc("AlignReplaceQuotedSpaces()")
+
+  let l:line          = getline(line("."))
+  if exists("g:Align_xstrlen") && g:Align_xstrlen
+   let l:linelen      = s:Strlen(l:line)
+  else
+   let l:linelen      = strlen(l:line)
+  endif
+  let l:startingPos   = 0
+  let l:startQuotePos = 0
+  let l:endQuotePos   = 0
+  let l:spacePos      = 0
+  let l:quoteRe       = '\\\@<!"'
+
+"  "call Decho("in replace spaces.  line=" . line('.'))
+  while (1)
+    let l:startQuotePos = match(l:line, l:quoteRe, l:startingPos)
+    if (l:startQuotePos < 0) 
+"      "call Decho("No more quotes to the end of line")
+      break
+    endif
+    let l:endQuotePos = match(l:line, l:quoteRe, l:startQuotePos + 1)
+    if (l:endQuotePos < 0)
+"      "call Decho("Mismatched quotes")
+      break
+    endif
+    let l:spaceReplaceRe = '^.\{' . (l:startQuotePos + 1) . '}.\{-}\zs\s\ze.*.\{' . (linelen - l:endQuotePos) . '}$'
+"    "call Decho('spaceReplaceRe="' . l:spaceReplaceRe . '"')
+    let l:newStr = substitute(l:line, l:spaceReplaceRe, '%', '')
+    while (l:newStr != l:line)
+"      "call Decho('newstr="' . l:newStr . '"')
+      let l:line = l:newStr
+      let l:newStr = substitute(l:line, l:spaceReplaceRe, '%', '')
+    endwhile
+    let l:startingPos = l:endQuotePos + 1
+  endwhile
+  call setline(line('.'), l:line)
+
+"  call Dret("AlignReplaceQuotedSpaces")
+endfun
+
+" ---------------------------------------------------------------------
+" s:QArgSplitter: to avoid \ processing by <f-args>, <q-args> is needed. {{{1
+" However, <q-args> doesn't split at all, so this function returns a list
+" of arguments which has been:
+"   * split at whitespace
+"   * unless inside "..."s.  One may escape characters with a backslash inside double quotes.
+" along with a leading length-of-list.
+"
+"   Examples:   %Align "\""   will align on "s
+"               %Align " "    will align on spaces
+"
+" The resulting list:  qarglist[0] corresponds to a:0
+"                      qarglist[i] corresponds to a:{i}
+fun! s:QArgSplitter(qarg)
+"  call Dfunc("s:QArgSplitter(qarg<".a:qarg.">)")
+
+  if a:qarg =~ '".*"'
+   " handle "..." args, which may include whitespace
+   let qarglist = []
+   let args     = a:qarg
+"   call Decho("handle quoted arguments: args<".args.">")
+   while args != ""
+       let iarg   = 0
+       let arglen = strlen(args)
+"      call Decho("args[".iarg."]<".args[iarg]."> arglen=".arglen)
+       " find index to first not-escaped '"'
+       while args[iarg] != '"' && iarg < arglen
+        if args[iarg] == '\'
+         let args= strpart(args,1)
+        endif
+        let iarg= iarg + 1
+       endwhile
+"      call Decho("args<".args."> iarg=".iarg." arglen=".arglen)
+
+       if iarg > 0
+        " handle left of quote or remaining section
+"       call Decho("handle left of quote or remaining section")
+        if args[iarg] == '"'
+         let qarglist= qarglist + split(strpart(args,0,iarg-1))
+        else
+         let qarglist= qarglist + split(strpart(args,0,iarg))
+        endif
+        let args    = strpart(args,iarg)
+        let arglen  = strlen(args)
+
+       elseif iarg < arglen && args[0] == '"'
+        " handle "quoted" section
+"       call Decho("handle quoted section")
+        let iarg= 1
+        while args[iarg] != '"' && iarg < arglen
+         if args[iarg] == '\'
+          let args= strpart(args,1)
+         endif
+         let iarg= iarg + 1
+        endwhile
+"       call Decho("args<".args."> iarg=".iarg." arglen=".arglen)
+        if args[iarg] == '"'
+         call add(qarglist,strpart(args,1,iarg-1))
+         let args= strpart(args,iarg+1)
+        else
+         let qarglist = qarglist + split(args)
+         let args     = ""
+        endif
+       endif
+"      call Decho("qarglist".string(qarglist)." iarg=".iarg." args<".args.">")
+   endwhile
+
+  else
+   " split at all whitespace
+   let qarglist= split(a:qarg)
+  endif
+
+  let qarglistlen= len(qarglist)
+  let qarglist   = insert(qarglist,qarglistlen)
+"  call Dret("s:QArgSplitter ".string(qarglist))
+  return qarglist
+endfun
+
+" ---------------------------------------------------------------------
+" s:Strlen: this function returns the length of a string, even if its {{{1
+"           using two-byte etc characters.
+"           Currently, its only used if g:Align_xstrlen is set to a
+"           nonzero value.  Solution from Nicolai Weibull, vim docs
+"           (:help strlen()), Tony Mechelynck, and my own invention.
+fun! s:Strlen(x)
+"  call Dfunc("s:Strlen(x<".a:x.">")
+  if g:Align_xstrlen == 1
+   " number of codepoints (Latin a + combining circumflex is two codepoints)
+   " (comment from TM, solution from NW)
+   let ret= strlen(substitute(a:x,'.','c','g'))
+
+  elseif g:Align_xstrlen == 2
+   " number of spacing codepoints (Latin a + combining circumflex is one spacing 
+   " codepoint; a hard tab is one; wide and narrow CJK are one each; etc.)
+   " (comment from TM, solution from TM)
+   let ret=strlen(substitute(a:x, '.\Z', 'x', 'g')) 
+
+  elseif g:Align_xstrlen == 3
+   " virtual length (counting, for instance, tabs as anything between 1 and 
+   " 'tabstop', wide CJK as 2 rather than 1, Arabic alif as zero when immediately 
+   " preceded by lam, one otherwise, etc.)
+   " (comment from TM, solution from me)
+   let modkeep= &l:mod
+   exe "norm! o\<esc>"
+   call setline(line("."),a:x)
+   let ret= virtcol("$") - 1
+   d
+   let &l:mod= modkeep
+
+  else
+   " at least give a decent default
+   ret= strlen(a:x)
+  endif
+"  call Dret("s:Strlen ".ret)
+  return ret
+endfun
+
+" ---------------------------------------------------------------------
+" Set up default values: {{{1
+"call Decho("-- Begin AlignCtrl Initialization --")
+call Align#AlignCtrl("default")
+"call Decho("-- End AlignCtrl Initialization --")
+
+" ---------------------------------------------------------------------
+"  Restore: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+" vim: ts=4 fdm=marker
diff --git a/vim/autoload/AlignMaps.vim b/vim/autoload/AlignMaps.vim
new file mode 100644 (file)
index 0000000..ace2de8
--- /dev/null
@@ -0,0 +1,330 @@
+" AlignMaps.vim : support functions for AlignMaps
+"   Author: Charles E. Campbell, Jr.
+"   Date:   Mar 03, 2009
+" Version:           41
+" ---------------------------------------------------------------------
+"  Load Once: {{{1
+if &cp || exists("g:loaded_AlignMaps")
+ finish
+endif
+let g:loaded_AlignMaps= "v41"
+let s:keepcpo         = &cpo
+set cpo&vim
+
+" =====================================================================
+" Functions: {{{1
+
+" ---------------------------------------------------------------------
+" AlignMaps#WrapperStart: {{{2
+fun! AlignMaps#WrapperStart(vis) range
+"  call Dfunc("AlignMaps#WrapperStart(vis=".a:vis.")")
+
+  if a:vis
+   norm! '<ma'>
+  endif
+
+  if line("'y") == 0 || line("'z") == 0 || !exists("s:alignmaps_wrapcnt") || s:alignmaps_wrapcnt <= 0
+"   call Decho("wrapper initialization")
+   let s:alignmaps_wrapcnt    = 1
+   let s:alignmaps_keepgd     = &gdefault
+   let s:alignmaps_keepsearch = @/
+   let s:alignmaps_keepch     = &ch
+   let s:alignmaps_keepmy     = SaveMark("'y")
+   let s:alignmaps_keepmz     = SaveMark("'z")
+   let s:alignmaps_posn       = SaveWinPosn(0)
+   " set up fencepost blank lines
+   put =''
+   norm! mz'a
+   put! =''
+   ky
+   let s:alignmaps_zline      = line("'z")
+   exe "'y,'zs/@/\177/ge"
+  else
+"   call Decho("embedded wrapper")
+   let s:alignmaps_wrapcnt    = s:alignmaps_wrapcnt + 1
+   norm! 'yjma'zk
+  endif
+
+  " change some settings to align-standard values
+  set nogd
+  set ch=2
+  AlignPush
+  norm! 'zk
+"  call Dret("AlignMaps#WrapperStart : alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#WrapperEnd:        {{{2
+fun! AlignMaps#WrapperEnd() range
+"  call Dfunc("AlignMaps#WrapperEnd() alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
+
+  " remove trailing white space introduced by whatever in the modification zone
+  'y,'zs/ \+$//e
+
+  " restore AlignCtrl settings
+  AlignPop
+
+  let s:alignmaps_wrapcnt= s:alignmaps_wrapcnt - 1
+  if s:alignmaps_wrapcnt <= 0
+   " initial wrapper ending
+   exe "'y,'zs/\177/@/ge"
+
+   " if the 'z line hasn't moved, then go ahead and restore window position
+   let zstationary= s:alignmaps_zline == line("'z")
+
+   " remove fencepost blank lines.
+   " restore 'a
+   norm! 'yjmakdd'zdd
+
+   " restore original 'y, 'z, and window positioning
+   call RestoreMark(s:alignmaps_keepmy)
+   call RestoreMark(s:alignmaps_keepmz)
+   if zstationary > 0
+    call RestoreWinPosn(s:alignmaps_posn)
+"    call Decho("restored window positioning")
+   endif
+
+   " restoration of options
+   let &gd= s:alignmaps_keepgd
+   let &ch= s:alignmaps_keepch
+   let @/ = s:alignmaps_keepsearch
+
+   " remove script variables
+   unlet s:alignmaps_keepch
+   unlet s:alignmaps_keepsearch
+   unlet s:alignmaps_keepmy
+   unlet s:alignmaps_keepmz
+   unlet s:alignmaps_keepgd
+   unlet s:alignmaps_posn
+  endif
+
+"  call Dret("AlignMaps#WrapperEnd : alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#StdAlign: some semi-standard align calls {{{2
+fun! AlignMaps#StdAlign(mode) range
+"  call Dfunc("AlignMaps#StdAlign(mode=".a:mode.")")
+  if     a:mode == 1
+   " align on @
+"   call Decho("align on @")
+   AlignCtrl mIp1P1=l @
+   'a,.Align
+  elseif a:mode == 2
+   " align on @, retaining all initial white space on each line
+"   call Decho("align on @, retaining all initial white space on each line")
+   AlignCtrl mWp1P1=l @
+   'a,.Align
+  elseif a:mode == 3
+   " like mode 2, but ignore /* */-style comments
+"   call Decho("like mode 2, but ignore /* */-style comments")
+   AlignCtrl v ^\s*/[/*]
+   AlignCtrl mWp1P1=l @
+   'a,.Align
+  else
+   echoerr "(AlignMaps) AlignMaps#StdAlign doesn't support mode#".a:mode
+  endif
+"  call Dret("AlignMaps#StdAlign")
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#CharJoiner: joins lines which end in the given character (spaces {{{2
+"             at end are ignored)
+fun! AlignMaps#CharJoiner(chr)
+"  call Dfunc("AlignMaps#CharJoiner(chr=".a:chr.")")
+  let aline = line("'a")
+  let rep   = line(".") - aline
+  while rep > 0
+       norm! 'a
+       while match(getline(aline),a:chr . "\s*$") != -1 && rep >= 0
+         " while = at end-of-line, delete it and join with next
+         norm! 'a$
+         j!
+         let rep = rep - 1
+       endwhile
+       " update rep(eat) count
+       let rep = rep - 1
+       if rep <= 0
+         " terminate loop if at end-of-block
+         break
+       endif
+       " prepare for next line
+       norm! jma
+       let aline = line("'a")
+  endwhile
+"  call Dret("AlignMaps#CharJoiner")
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#Equals: supports \t= and \T= {{{2
+fun! AlignMaps#Equals() range
+"  call Dfunc("AlignMaps#Equals()")
+  'a,'zs/\s\+\([*/+\-%|&\~^]\==\)/ \1/e
+  'a,'zs@ \+\([*/+\-%|&\~^]\)=@\1=@ge
+  'a,'zs/==/\="\<Char-0x0f>\<Char-0x0f>"/ge
+  'a,'zs/\([!<>:]\)=/\=submatch(1)."\<Char-0x0f>"/ge
+  norm g'zk
+  AlignCtrl mIp1P1=l =
+  AlignCtrl g =
+  'a,'z-1Align
+  'a,'z-1s@\([*/+\-%|&\~^!=]\)\( \+\)=@\2\1=@ge
+  'a,'z-1s/\( \+\);/;\1/ge
+  if &ft == "c" || &ft == "cpp"
+"   call Decho("exception for ".&ft)
+   'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e
+   'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e
+   if exists("g:mapleader")
+    exe "norm 'zk"
+    call AlignMaps#StdAlign(1)
+   else
+    exe "norm 'zk"
+    call AlignMaps#StdAlign(1)
+   endif
+   'y,'zs/^\(\s*\) @/\1/e
+  endif
+  'a,'z-1s/\%x0f/=/ge
+  'y,'zs/ @//eg
+"  call Dret("AlignMaps#Equals")
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#Afnc: useful for splitting one-line function beginnings {{{2
+"            into one line per argument format
+fun! AlignMaps#Afnc()
+"  call Dfunc("AlignMaps#Afnc()")
+
+  " keep display quiet
+  let chkeep = &ch
+  let gdkeep = &gd
+  let vekeep = &ve
+  set ch=2 nogd ve=
+
+  " will use marks y,z ; save current values
+  let mykeep = SaveMark("'y")
+  let mzkeep = SaveMark("'z")
+
+  " Find beginning of function -- be careful to skip over comments
+  let cmmntid  = synIDtrans(hlID("Comment"))
+  let stringid = synIDtrans(hlID("String"))
+  exe "norm! ]]"
+  while search(")","bW") != 0
+"   call Decho("line=".line(".")." col=".col("."))
+   let parenid= synIDtrans(synID(line("."),col("."),1))
+   if parenid != cmmntid && parenid != stringid
+       break
+   endif
+  endwhile
+  norm! %my
+  s/(\s*\(\S\)/(\r  \1/e
+  exe "norm! `y%"
+  s/)\s*\(\/[*/]\)/)\r\1/e
+  exe "norm! `y%mz"
+  'y,'zs/\s\+$//e
+  'y,'zs/^\s\+//e
+  'y+1,'zs/^/  /
+
+  " insert newline after every comma only one parenthesis deep
+  sil! exe "norm! `y\<right>h"
+  let parens   = 1
+  let cmmnt    = 0
+  let cmmntline= -1
+  while parens >= 1
+"   call Decho("parens=".parens." @a=".@a)
+   exe 'norm! ma "ay`a '
+   if @a == "("
+    let parens= parens + 1
+   elseif @a == ")"
+    let parens= parens - 1
+
+   " comment bypass:  /* ... */  or //...
+   elseif cmmnt == 0 && @a == '/'
+    let cmmnt= 1
+   elseif cmmnt == 1
+       if @a == '/'
+        let cmmnt    = 2   " //...
+        let cmmntline= line(".")
+       elseif @a == '*'
+        let cmmnt= 3   " /*...
+       else
+        let cmmnt= 0
+       endif
+   elseif cmmnt == 2 && line(".") != cmmntline
+       let cmmnt    = 0
+       let cmmntline= -1
+   elseif cmmnt == 3 && @a == '*'
+       let cmmnt= 4
+   elseif cmmnt == 4
+       if @a == '/'
+        let cmmnt= 0   " ...*/
+       elseif @a != '*'
+        let cmmnt= 3
+       endif
+
+   elseif @a == "," && parens == 1 && cmmnt == 0
+       exe "norm! i\<CR>\<Esc>"
+   endif
+  endwhile
+  norm! `y%mz%
+  sil! 'y,'zg/^\s*$/d
+
+  " perform substitutes to mark fields for Align
+  sil! 'y+1,'zv/^\//s/^\s\+\(\S\)/  \1/e
+  sil! 'y+1,'zv/^\//s/\(\S\)\s\+/\1 /eg
+  sil! 'y+1,'zv/^\//s/\* \+/*/ge
+  sil! 'y+1,'zv/^\//s/\w\zs\s*\*/ */ge
+  "                                                 func
+  "                    ws  <- declaration   ->    <-ptr  ->   <-var->    <-[array][]    ->   <-glop->      <-end->
+  sil! 'y+1,'zv/^\//s/^\s*\(\(\K\k*\s*\)\+\)\s\+\([(*]*\)\s*\(\K\k*\)\s*\(\(\[.\{-}]\)*\)\s*\(.\{-}\)\=\s*\([,)]\)\s*$/  \1@#\3@\4\5@\7\8/e
+  sil! 'y+1,'z+1g/^\s*\/[*/]/norm! kJ
+  sil! 'y+1,'z+1s%/[*/]%@&@%ge
+  sil! 'y+1,'z+1s%*/%@&%ge
+  AlignCtrl mIp0P0=l @
+  sil! 'y+1,'zAlign
+  sil! 'y,'zs%@\(/[*/]\)@%\t\1 %e
+  sil! 'y,'zs%@\*/% */%e
+  sil! 'y,'zs/@\([,)]\)/\1/
+  sil! 'y,'zs/@/ /
+  AlignCtrl mIlrp0P0= # @
+  sil! 'y+1,'zAlign
+  sil! 'y+1,'zs/#/ /
+  sil! 'y+1,'zs/@//
+  sil! 'y+1,'zs/\(\s\+\)\([,)]\)/\2\1/e
+
+  " Restore
+  call RestoreMark(mykeep)
+  call RestoreMark(mzkeep)
+  let &ch= chkeep
+  let &gd= gdkeep
+  let &ve= vekeep
+
+"  call Dret("AlignMaps#Afnc")
+endfun
+
+" ---------------------------------------------------------------------
+"  AlignMaps#FixMultiDec: converts a   type arg,arg,arg;   line to multiple lines {{{2
+fun! AlignMaps#FixMultiDec()
+"  call Dfunc("AlignMaps#FixMultiDec()")
+
+  " save register x
+  let xkeep   = @x
+  let curline = getline(".")
+"  call Decho("curline<".curline.">")
+
+  " Get the type.  I'm assuming one type per line (ie.  int x; double y;   on one line will not be handled properly)
+  let @x=substitute(curline,'^\(\s*[a-zA-Z_ \t][a-zA-Z0-9_ \t]*\)\s\+[(*]*\h.*$','\1','')
+"  call Decho("@x<".@x.">")
+
+  " transform line
+  exe 's/,/;\r'.@x.' /ge'
+
+  "restore register x
+  let @x= xkeep
+
+"  call Dret("AlignMaps#FixMultiDec : my=".line("'y")." mz=".line("'z"))
+endfun
+
+" ---------------------------------------------------------------------
+"  Restore: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+" vim: ts=4 fdm=marker
diff --git a/vim/autoload/EasyMotion.vim b/vim/autoload/EasyMotion.vim
new file mode 100755 (executable)
index 0000000..7c79dd8
--- /dev/null
@@ -0,0 +1,573 @@
+" EasyMotion - Vim motions on speed!
+"
+" Author: Kim Silkebรฆkken <kim.silkebaekken+vim@gmail.com>
+" Source repository: https://github.com/Lokaltog/vim-easymotion
+
+" Default configuration functions {{{
+       function! EasyMotion#InitOptions(options) " {{{
+               for [key, value] in items(a:options)
+                       if ! exists('g:EasyMotion_' . key)
+                               exec 'let g:EasyMotion_' . key . ' = ' . string(value)
+                       endif
+               endfor
+       endfunction " }}}
+       function! EasyMotion#InitHL(group, colors) " {{{
+               let group_default = a:group . 'Default'
+
+               " Prepare highlighting variables
+               let guihl = printf('guibg=%s guifg=%s gui=%s', a:colors.gui[0], a:colors.gui[1], a:colors.gui[2])
+               if !exists('g:CSApprox_loaded')
+                       let ctermhl = &t_Co == 256
+                               \ ? printf('ctermbg=%s ctermfg=%s cterm=%s', a:colors.cterm256[0], a:colors.cterm256[1], a:colors.cterm256[2])
+                               \ : printf('ctermbg=%s ctermfg=%s cterm=%s', a:colors.cterm[0], a:colors.cterm[1], a:colors.cterm[2])
+               else
+                       let ctermhl = ''
+               endif
+
+               " Create default highlighting group
+               execute printf('hi default %s %s %s', group_default, guihl, ctermhl)
+
+               " Check if the hl group exists
+               if hlexists(a:group)
+                       redir => hlstatus | exec 'silent hi ' . a:group | redir END
+
+                       " Return if the group isn't cleared
+                       if hlstatus !~ 'cleared'
+                               return
+                       endif
+               endif
+
+               " No colors are defined for this group, link to defaults
+               execute printf('hi default link %s %s', a:group, group_default)
+       endfunction " }}}
+       function! EasyMotion#InitMappings(motions) "{{{
+               for motion in keys(a:motions)
+                       call EasyMotion#InitOptions({ 'mapping_' . motion : g:EasyMotion_leader_key . motion })
+               endfor
+
+               if g:EasyMotion_do_mapping
+                       for [motion, fn] in items(a:motions)
+                               if empty(g:EasyMotion_mapping_{motion})
+                                       continue
+                               endif
+
+                               silent exec 'nnoremap <silent> ' . g:EasyMotion_mapping_{motion} . '      :call EasyMotion#' . fn.name . '(0, ' . fn.dir . ')<CR>'
+                               silent exec 'onoremap <silent> ' . g:EasyMotion_mapping_{motion} . '      :call EasyMotion#' . fn.name . '(0, ' . fn.dir . ')<CR>'
+                               silent exec 'vnoremap <silent> ' . g:EasyMotion_mapping_{motion} . ' :<C-U>call EasyMotion#' . fn.name . '(1, ' . fn.dir . ')<CR>'
+                       endfor
+               endif
+       endfunction "}}}
+" }}}
+" Motion functions {{{
+       function! EasyMotion#F(visualmode, direction) " {{{
+               let char = s:GetSearchChar(a:visualmode)
+
+               if empty(char)
+                       return
+               endif
+
+               let re = '\C' . escape(char, '.$^~')
+
+               call s:EasyMotion(re, a:direction, a:visualmode ? visualmode() : '', mode(1))
+       endfunction " }}}
+       function! EasyMotion#T(visualmode, direction) " {{{
+               let char = s:GetSearchChar(a:visualmode)
+
+               if empty(char)
+                       return
+               endif
+
+               if a:direction == 1
+                       let re = '\C' . escape(char, '.$^~') . '\zs.'
+               else
+                       let re = '\C.' . escape(char, '.$^~')
+               endif
+
+               call s:EasyMotion(re, a:direction, a:visualmode ? visualmode() : '', mode(1))
+       endfunction " }}}
+       function! EasyMotion#WB(visualmode, direction) " {{{
+               call s:EasyMotion('\(\<.\|^$\)', a:direction, a:visualmode ? visualmode() : '', '')
+       endfunction " }}}
+       function! EasyMotion#WBW(visualmode, direction) " {{{
+               call s:EasyMotion('\(\(^\|\s\)\@<=\S\|^$\)', a:direction, a:visualmode ? visualmode() : '', '')
+       endfunction " }}}
+       function! EasyMotion#E(visualmode, direction) " {{{
+               call s:EasyMotion('\(.\>\|^$\)', a:direction, a:visualmode ? visualmode() : '', mode(1))
+       endfunction " }}}
+       function! EasyMotion#EW(visualmode, direction) " {{{
+               call s:EasyMotion('\(\S\(\s\|$\)\|^$\)', a:direction, a:visualmode ? visualmode() : '', mode(1))
+       endfunction " }}}
+       function! EasyMotion#JK(visualmode, direction) " {{{
+               call s:EasyMotion('^\(\w\|\s*\zs\|$\)', a:direction, a:visualmode ? visualmode() : '', '')
+       endfunction " }}}
+       function! EasyMotion#Search(visualmode, direction) " {{{
+               call s:EasyMotion(@/, a:direction, a:visualmode ? visualmode() : '', '')
+       endfunction " }}}
+" }}}
+" Helper functions {{{
+       function! s:Message(message) " {{{
+               echo 'EasyMotion: ' . a:message
+       endfunction " }}}
+       function! s:Prompt(message) " {{{
+               echohl Question
+               echo a:message . ': '
+               echohl None
+       endfunction " }}}
+       function! s:VarReset(var, ...) " {{{
+               if ! exists('s:var_reset')
+                       let s:var_reset = {}
+               endif
+
+               let buf = bufname("")
+
+               if a:0 == 0 && has_key(s:var_reset, a:var)
+                       " Reset var to original value
+                       call setbufvar(buf, a:var, s:var_reset[a:var])
+               elseif a:0 == 1
+                       let new_value = a:0 == 1 ? a:1 : ''
+
+                       " Store original value
+                       let s:var_reset[a:var] = getbufvar(buf, a:var)
+
+                       " Set new var value
+                       call setbufvar(buf, a:var, new_value)
+               endif
+       endfunction " }}}
+       function! s:SetLines(lines, key) " {{{
+               try
+                       " Try to join changes with previous undo block
+                       undojoin
+               catch
+               endtry
+
+               for [line_num, line] in a:lines
+                       call setline(line_num, line[a:key])
+               endfor
+       endfunction " }}}
+       function! s:GetChar() " {{{
+               let char = getchar()
+
+               if char == 27
+                       " Escape key pressed
+                       redraw
+
+                       call s:Message('Cancelled')
+
+                       return ''
+               endif
+
+               return nr2char(char)
+       endfunction " }}}
+       function! s:GetSearchChar(visualmode) " {{{
+               call s:Prompt('Search for character')
+
+               let char = s:GetChar()
+
+               " Check that we have an input char
+               if empty(char)
+                       " Restore selection
+                       if ! empty(a:visualmode)
+                               silent exec 'normal! gv'
+                       endif
+
+                       return ''
+               endif
+
+               return char
+       endfunction " }}}
+" }}}
+" Grouping algorithms {{{
+       let s:grouping_algorithms = {
+       \   1: 'SCTree'
+       \ , 2: 'Original'
+       \ }
+       " Single-key/closest target priority tree {{{
+               " This algorithm tries to assign one-key jumps to all the targets closest to the cursor.
+               " It works recursively and will work correctly with as few keys as two.
+               function! s:GroupingAlgorithmSCTree(targets, keys)
+                       " Prepare variables for working
+                       let targets_len = len(a:targets)
+                       let keys_len = len(a:keys)
+
+                       let groups = {}
+
+                       let keys = reverse(copy(a:keys))
+
+                       " Semi-recursively count targets {{{
+                               " We need to know exactly how many child nodes (targets) this branch will have
+                               " in order to pass the correct amount of targets to the recursive function.
+
+                               " Prepare sorted target count list {{{
+                                       " This is horrible, I know. But dicts aren't sorted in vim, so we need to
+                                       " work around that. That is done by having one sorted list with key counts,
+                                       " and a dict which connects the key with the keys_count list.
+
+                                       let keys_count = []
+                                       let keys_count_keys = {}
+
+                                       let i = 0
+                                       for key in keys
+                                               call add(keys_count, 0)
+
+                                               let keys_count_keys[key] = i
+
+                                               let i += 1
+                                       endfor
+                               " }}}
+
+                               let targets_left = targets_len
+                               let level = 0
+                               let i = 0
+
+                               while targets_left > 0
+                                       " Calculate the amount of child nodes based on the current level
+                                       let childs_len = (level == 0 ? 1 : (keys_len - 1) )
+
+                                       for key in keys
+                                               " Add child node count to the keys_count array
+                                               let keys_count[keys_count_keys[key]] += childs_len
+
+                                               " Subtract the child node count
+                                               let targets_left -= childs_len
+
+                                               if targets_left <= 0
+                                                       " Subtract the targets left if we added too many too
+                                                       " many child nodes to the key count
+                                                       let keys_count[keys_count_keys[key]] += targets_left
+
+                                                       break
+                                               endif
+
+                                               let i += 1
+                                       endfor
+
+                                       let level += 1
+                               endwhile
+                       " }}}
+                       " Create group tree {{{
+                               let i = 0
+                               let key = 0
+
+                               call reverse(keys_count)
+
+                               for key_count in keys_count
+                                       if key_count > 1
+                                               " We need to create a subgroup
+                                               " Recurse one level deeper
+                                               let groups[a:keys[key]] = s:GroupingAlgorithmSCTree(a:targets[i : i + key_count - 1], a:keys)
+                                       elseif key_count == 1
+                                               " Assign single target key
+                                               let groups[a:keys[key]] = a:targets[i]
+                                       else
+                                               " No target
+                                               continue
+                                       endif
+
+                                       let key += 1
+                                       let i += key_count
+                               endfor
+                       " }}}
+
+                       " Finally!
+                       return groups
+               endfunction
+       " }}}
+       " Original {{{
+               function! s:GroupingAlgorithmOriginal(targets, keys)
+                       " Split targets into groups (1 level)
+                       let targets_len = len(a:targets)
+                       let keys_len = len(a:keys)
+
+                       let groups = {}
+
+                       let i = 0
+                       let root_group = 0
+                       try
+                               while root_group < targets_len
+                                       let groups[a:keys[root_group]] = {}
+
+                                       for key in a:keys
+                                               let groups[a:keys[root_group]][key] = a:targets[i]
+
+                                               let i += 1
+                                       endfor
+
+                                       let root_group += 1
+                               endwhile
+                       catch | endtry
+
+                       " Flatten the group array
+                       if len(groups) == 1
+                               let groups = groups[a:keys[0]]
+                       endif
+
+                       return groups
+               endfunction
+       " }}}
+       " Coord/key dictionary creation {{{
+               function! s:CreateCoordKeyDict(groups, ...)
+                       " Dict structure:
+                       " 1,2 : a
+                       " 2,3 : b
+                       let sort_list = []
+                       let coord_keys = {}
+                       let group_key = a:0 == 1 ? a:1 : ''
+
+                       for [key, item] in items(a:groups)
+                               let key = ( ! empty(group_key) ? group_key : key)
+
+                               if type(item) == 3
+                                       " Destination coords
+
+                                       " The key needs to be zero-padded in order to
+                                       " sort correctly
+                                       let dict_key = printf('%05d,%05d', item[0], item[1])
+                                       let coord_keys[dict_key] = key
+
+                                       " We need a sorting list to loop correctly in
+                                       " PromptUser, dicts are unsorted
+                                       call add(sort_list, dict_key)
+                               else
+                                       " Item is a dict (has children)
+                                       let coord_key_dict = s:CreateCoordKeyDict(item, key)
+
+                                       " Make sure to extend both the sort list and the
+                                       " coord key dict
+                                       call extend(sort_list, coord_key_dict[0])
+                                       call extend(coord_keys, coord_key_dict[1])
+                               endif
+
+                               unlet item
+                       endfor
+
+                       return [sort_list, coord_keys]
+               endfunction
+       " }}}
+" }}}
+" Core functions {{{
+       function! s:PromptUser(groups) "{{{
+               " If only one possible match, jump directly to it {{{
+                       let group_values = values(a:groups)
+
+                       if len(group_values) == 1
+                               redraw
+
+                               return group_values[0]
+                       endif
+               " }}}
+               " Prepare marker lines {{{
+                       let lines = {}
+                       let hl_coords = []
+                       let coord_key_dict = s:CreateCoordKeyDict(a:groups)
+
+                       for dict_key in sort(coord_key_dict[0])
+                               let target_key = coord_key_dict[1][dict_key]
+                               let [line_num, col_num] = split(dict_key, ',')
+
+                               let line_num = str2nr(line_num)
+                               let col_num = str2nr(col_num)
+
+                               " Add original line and marker line
+                               if ! has_key(lines, line_num)
+                                       let current_line = getline(line_num)
+
+                                       let lines[line_num] = { 'orig': current_line, 'marker': current_line, 'mb_compensation': 0 }
+                               endif
+
+                               " Compensate for byte difference between marker
+                               " character and target character
+                               "
+                               " This has to be done in order to match the correct
+                               " column; \%c matches the byte column and not display
+                               " column.
+                               let target_char_len = strlen(matchstr(lines[line_num]['marker'], '\%' . col_num . 'c.'))
+                               let target_key_len = strlen(target_key)
+
+                               " Solve multibyte issues by matching the byte column
+                               " number instead of the visual column
+                               let col_num -= lines[line_num]['mb_compensation']
+
+                               if strlen(lines[line_num]['marker']) > 0
+                                       " Substitute marker character if line length > 0
+                                       let lines[line_num]['marker'] = substitute(lines[line_num]['marker'], '\%' . col_num . 'c.', target_key, '')
+                               else
+                                       " Set the line to the marker character if the line is empty
+                                       let lines[line_num]['marker'] = target_key
+                               endif
+
+                               " Add highlighting coordinates
+                               call add(hl_coords, '\%' . line_num . 'l\%' . col_num . 'c')
+
+                               " Add marker/target lenght difference for multibyte
+                               " compensation
+                               let lines[line_num]['mb_compensation'] += (target_char_len - target_key_len)
+                       endfor
+
+                       let lines_items = items(lines)
+               " }}}
+               " Highlight targets {{{
+                       let target_hl_id = matchadd(g:EasyMotion_hl_group_target, join(hl_coords, '\|'), 1)
+               " }}}
+
+               try
+                       " Set lines with markers
+                       call s:SetLines(lines_items, 'marker')
+
+                       redraw
+
+                       " Get target character {{{
+                               call s:Prompt('Target key')
+
+                               let char = s:GetChar()
+                       " }}}
+               finally
+                       " Restore original lines
+                       call s:SetLines(lines_items, 'orig')
+
+                       " Un-highlight targets {{{
+                               if exists('target_hl_id')
+                                       call matchdelete(target_hl_id)
+                               endif
+                       " }}}
+
+                       redraw
+               endtry
+
+               " Check if we have an input char {{{
+                       if empty(char)
+                               throw 'Cancelled'
+                       endif
+               " }}}
+               " Check if the input char is valid {{{
+                       if ! has_key(a:groups, char)
+                               throw 'Invalid target'
+                       endif
+               " }}}
+
+               let target = a:groups[char]
+
+               if type(target) == 3
+                       " Return target coordinates
+                       return target
+               else
+                       " Prompt for new target character
+                       return s:PromptUser(target)
+               endif
+       endfunction "}}}
+       function! s:EasyMotion(regexp, direction, visualmode, mode) " {{{
+               let orig_pos = [line('.'), col('.')]
+               let targets = []
+
+               try
+                       " Reset properties {{{
+                               call s:VarReset('&scrolloff', 0)
+                               call s:VarReset('&modified', 0)
+                               call s:VarReset('&modifiable', 1)
+                               call s:VarReset('&readonly', 0)
+                               call s:VarReset('&spell', 0)
+                               call s:VarReset('&virtualedit', '')
+                       " }}}
+                       " Find motion targets {{{
+                               let search_direction = (a:direction == 1 ? 'b' : '')
+                               let search_stopline = line(a:direction == 1 ? 'w0' : 'w$')
+
+                               while 1
+                                       let pos = searchpos(a:regexp, search_direction, search_stopline)
+
+                                       " Reached end of search range
+                                       if pos == [0, 0]
+                                               break
+                                       endif
+
+                                       " Skip folded lines
+                                       if foldclosed(pos[0]) != -1
+                                               continue
+                                       endif
+
+                                       call add(targets, pos)
+                               endwhile
+
+                               let targets_len = len(targets)
+                               if targets_len == 0
+                                       throw 'No matches'
+                               endif
+                       " }}}
+
+                       let GroupingFn = function('s:GroupingAlgorithm' . s:grouping_algorithms[g:EasyMotion_grouping])
+                       let groups = GroupingFn(targets, split(g:EasyMotion_keys, '\zs'))
+
+                       " Shade inactive source {{{
+                               if g:EasyMotion_do_shade
+                                       let shade_hl_pos = '\%' . orig_pos[0] . 'l\%'. orig_pos[1] .'c'
+
+                                       if a:direction == 1
+                                               " Backward
+                                               let shade_hl_re = '\%'. line('w0') .'l\_.*' . shade_hl_pos
+                                       else
+                                               " Forward
+                                               let shade_hl_re = shade_hl_pos . '\_.*\%'. line('w$') .'l'
+                                       endif
+
+                                       let shade_hl_id = matchadd(g:EasyMotion_hl_group_shade, shade_hl_re, 0)
+                               endif
+                       " }}}
+
+                       " Prompt user for target group/character
+                       let coords = s:PromptUser(groups)
+
+                       " Update selection {{{
+                               if ! empty(a:visualmode)
+                                       keepjumps call cursor(orig_pos[0], orig_pos[1])
+
+                                       exec 'normal! ' . a:visualmode
+                               endif
+                       " }}}
+                       " Handle operator-pending mode {{{
+                               if a:mode == 'no'
+                                       " This mode requires that we eat one more
+                                       " character to the right if we're using
+                                       " a forward motion
+                                       if a:direction != 1
+                                               let coords[1] += 1
+                                       endif
+                               endif
+                       " }}}
+
+                       " Update cursor position
+                       call cursor(orig_pos[0], orig_pos[1])
+                       mark '
+                       call cursor(coords[0], coords[1])
+
+                       call s:Message('Jumping to [' . coords[0] . ', ' . coords[1] . ']')
+               catch
+                       redraw
+
+                       " Show exception message
+                       call s:Message(v:exception)
+
+                       " Restore original cursor position/selection {{{
+                               if ! empty(a:visualmode)
+                                       silent exec 'normal! gv'
+                               else
+                                       keepjumps call cursor(orig_pos[0], orig_pos[1])
+                               endif
+                       " }}}
+               finally
+                       " Restore properties {{{
+                               call s:VarReset('&scrolloff')
+                               call s:VarReset('&modified')
+                               call s:VarReset('&modifiable')
+                               call s:VarReset('&readonly')
+                               call s:VarReset('&spell')
+                               call s:VarReset('&virtualedit')
+                       " }}}
+                       " Remove shading {{{
+                               if g:EasyMotion_do_shade && exists('shade_hl_id')
+                                       call matchdelete(shade_hl_id)
+                               endif
+                       " }}}
+               endtry
+       endfunction " }}}
+" }}}
+
+" vim: fdm=marker:noet:ts=4:sw=4:sts=4
diff --git a/vim/autoload/ZoomWin.vim b/vim/autoload/ZoomWin.vim
new file mode 100644 (file)
index 0000000..d2d993f
--- /dev/null
@@ -0,0 +1,380 @@
+" ZoomWin:     Brief-like ability to zoom into/out-of a window
+" Author:      Charles Campbell
+"                      original version by Ron Aaron
+" Date:                Jan 26, 2009
+" Version:     23
+" History: see :help zoomwin-history {{{1
+" GetLatestVimScripts: 508 1 :AutoInstall: ZoomWin.vim
+
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if &cp || exists("g:loaded_ZoomWin")
+ finish
+endif
+if v:version < 702
+ echohl WarningMsg
+ echo "***warning*** this version of ZoomWin needs vim 7.2"
+ echohl Normal
+ finish
+endif
+let s:keepcpo        = &cpo
+let g:loaded_ZoomWin = "v23"
+set cpo&vim
+"DechoTabOn
+
+" =====================================================================
+"  Functions: {{{1
+
+" ---------------------------------------------------------------------
+" ZoomWin#ZoomWin: toggles between a single-window and a multi-window layout {{{2
+"          The original version was by Ron Aaron.
+fun! ZoomWin#ZoomWin()
+"  let g:decho_hide= 1         "Decho
+"  call Dfunc("ZoomWin#ZoomWin() winbufnr(2)=".winbufnr(2))
+
+  " if the vim doesn't have +mksession, only a partial zoom is available {{{3
+  if !has("mksession")
+   if !exists("s:partialzoom")
+    echomsg "missing the +mksession feature; only a partial zoom is available"
+       let s:partialzoom= 0
+   endif
+   if v:version < 630
+       echoerr "***sorry*** you need an updated vim, preferably with +mksession"
+   elseif s:partialzoom
+       " partial zoom out
+       let s:partialzoom= 0
+       exe s:winrestore
+   else
+       " partial zoom in
+       let s:partialzoom= 1
+       let s:winrestore = winrestcmd()
+       res
+   endif
+"  call Dret("ZoomWin#ZoomWin : partialzoom=".s:partialzoom)
+   return
+  endif
+
+  " Close certain windows {{{3
+  call s:ZoomWinPreserve(0)
+
+  " save options.  Force window minimum height/width to be >= 1 {{{3
+  let keep_hidden = &hidden
+  let keep_write  = &write
+
+  if v:version < 603
+   if &wmh == 0 || &wmw == 0
+    let keep_wmh = &wmh
+    let keep_wmw = &wmw
+    silent! set wmh=1 wmw=1
+   endif
+  endif
+  set hidden write
+
+  if winbufnr(2) == -1
+    " there's only one window - restore to multiple-windows mode {{{3
+"      call Decho("there's only one window - restore to multiple windows")
+
+    if exists("s:sessionfile") && filereadable(s:sessionfile)
+         " save position in current one-window-only
+"        call Decho("save position in current one-window-only in sponly")
+      let sponly     = s:SavePosn(0)
+      let s:origline = line(".")
+      let s:origcol  = virtcol(".")
+
+      " source session file to restore window layout
+         let ei_keep= &ei
+         set ei=all
+         exe 'silent! so '.fnameescape(s:sessionfile)
+"        Decho("@@<".@@.">")
+      let v:this_session= s:sesskeep
+
+      if exists("s:savedposn1")
+        " restore windows' positioning and buffers
+"              call Decho("restore windows, positions, buffers")
+        windo call s:RestorePosn(s:savedposn{winnr()})|unlet s:savedposn{winnr()}
+        call s:GotoWinNum(s:winkeep)
+        unlet s:winkeep
+      endif
+
+         if line(".") != s:origline || virtcol(".") != s:origcol
+          " If the cursor hasn't moved from the original position,
+          " then let the position remain what it was in the original
+          " multi-window layout.
+"         call Decho("restore position using sponly")
+       call s:RestorePosn(sponly)
+         endif
+
+         " delete session file and variable holding its name
+"        call Decho("delete session file")
+      call delete(s:sessionfile)
+      unlet s:sessionfile
+         let &ei=ei_keep
+    endif
+
+  else " there's more than one window - go to only-one-window mode {{{3
+"      call Decho("there's multiple windows - goto one-window-only")
+
+    let s:winkeep    = winnr()
+    let s:sesskeep   = v:this_session
+
+       " doesn't work with the command line window (normal mode q:)
+       if &bt == "nofile" && expand("%") == (v:version < 702 ? 'command-line' : '[Command Line]')
+        echoerr "***error*** ZoomWin#ZoomWin doesn't work with the ".expand("%")." window"
+"     call Dret("ZoomWin#ZoomWin : ".expand('%')." window error")
+        return
+       endif
+"      call Decho("1: @@<".@@.">")
+
+       " disable all events (autocmds)
+"      call Decho("disable events")
+    let ei_keep= &ei
+       set ei=all
+"      call Decho("2: @@<".@@.">")
+
+    " save window positioning commands
+"      call Decho("save window positioning commands")
+    windo let s:savedposn{winnr()}= s:SavePosn(1)
+    call s:GotoWinNum(s:winkeep)
+
+    " set up name of session file
+"      call Decho("3: @@<".@@.">")
+    let s:sessionfile= tempname()
+"      call Decho("4: @@<".@@.">")
+
+    " save session
+"      call Decho("save session")
+    let ssop_keep = &ssop
+       let &ssop     = 'blank,help,winsize,folds,globals,localoptions,options'
+"      call Decho("5: @@<".@@.">")
+       exe 'mksession! '.fnameescape(s:sessionfile)
+"      call Decho("6: @@<".@@.">")
+       let keepyy= @@
+       let keepy0= @0
+       let keepy1= @1
+       let keepy2= @2
+       let keepy3= @3
+       let keepy4= @4
+       let keepy5= @5
+       let keepy6= @6
+       let keepy7= @7
+       let keepy8= @8
+       let keepy9= @9
+    set lz ei=all bh=
+       if v:version >= 700
+        try
+         exe "keepalt keepmarks new! ".fnameescape(s:sessionfile)
+        catch /^Vim\%((\a\+)\)\=:E/
+         echoerr "Too many windows"
+      silent! call delete(s:sessionfile)
+      unlet s:sessionfile
+"      call Dret("ZoomWin#ZoomWin : too many windows")
+      return
+        endtry
+     silent! keepjumps keepmarks v/wincmd\|split\|resize/d
+     keepalt w!
+     keepalt bw!
+       else
+        exe "new! ".fnameescape(s:sessionfile)
+     v/wincmd\|split\|resize/d
+     w!
+     bw!
+    endif
+       let @@= keepyy
+       let @0= keepy0
+       let @1= keepy1
+       let @2= keepy2
+       let @3= keepy3
+       let @4= keepy4
+       let @5= keepy5
+       let @6= keepy6
+       let @7= keepy7
+       let @8= keepy8
+       let @9= keepy9
+    call histdel('search', -1)
+    let @/ = histget('search', -1)
+"      call Decho("7: @@<".@@.">")
+
+    " restore user's session options and restore event handling
+"      call Decho("restore user session options and event handling")
+    set nolz
+    let &ssop = ssop_keep
+    silent! only!
+"      call Decho("8: @@<".@@.">")
+    let &ei   = ei_keep
+    echomsg expand("%")
+"      call Decho("9: @@<".@@.">")
+  endif
+
+  " restore user option settings {{{3
+"  call Decho("restore user option settings")
+  let &hidden= keep_hidden
+  let &write = keep_write
+  if v:version < 603
+   if exists("keep_wmw")
+    let &wmh= keep_wmh
+    let &wmw= keep_wmw
+   endif
+  endif
+
+  " Re-open certain windows {{{3
+  call s:ZoomWinPreserve(1)
+
+"  call Dret("ZoomWin#ZoomWin")
+endfun
+
+" ---------------------------------------------------------------------
+" SavePosn: this function sets up a savedposn variable that {{{2
+"          has the commands necessary to restore the view
+"          of the current window.
+fun! s:SavePosn(savewinhoriz)
+"  call Dfunc("SavePosn(savewinhoriz=".a:savewinhoriz.") file<".expand("%").">")
+  let swline    = line(".")
+  if swline == 1 && getline(1) == ""
+   " empty buffer
+   let savedposn= "silent b ".winbufnr(0)
+"   call Dret("SavePosn savedposn<".savedposn.">")
+   return savedposn
+  endif
+  let swcol     = col(".")
+  let swwline   = winline()-1
+  let swwcol    = virtcol(".") - wincol()
+  let savedposn = "silent b ".winbufnr(0)."|".swline."|silent norm! z\<cr>"
+  if swwline > 0
+   let savedposn= savedposn.":silent norm! ".swwline."\<c-y>\<cr>:silent norm! zs\<cr>"
+  endif
+  let savedposn= savedposn.":silent call cursor(".swline.",".swcol.")\<cr>"
+
+  if a:savewinhoriz
+   if swwcol > 0
+    let savedposn= savedposn.":silent norm! ".swwcol."zl\<cr>"
+   endif
+
+   " handle certain special settings for the multi-window savedposn call
+   "   bufhidden buftype buflisted
+   let settings= ""
+   if &bh != ""
+       let settings="bh=".&bh
+       setlocal bh=hide
+   endif
+   if !&bl
+       let settings= settings." nobl"
+       setlocal bl
+   endif
+   if &bt != ""
+       let settings= settings." bt=".&bt
+       setlocal bt=
+   endif
+   if settings != ""
+       let savedposn= savedposn.":setlocal ".settings."\<cr>"
+   endif
+
+  endif
+"  call Dret("SavePosn savedposn<".savedposn.">")
+  return savedposn
+endfun
+
+" ---------------------------------------------------------------------
+" s:RestorePosn: this function restores noname and scratch windows {{{2
+fun! s:RestorePosn(savedposn)
+"  call Dfunc("RestorePosn(savedposn<".a:savedposn.">) file<".expand("%").">")
+  if &scb
+   setlocal noscb
+   exe a:savedposn
+   setlocal scb
+  else
+   exe a:savedposn
+  endif
+"  call Dret("RestorePosn")
+endfun
+
+" ---------------------------------------------------------------------
+" CleanupSessionFile: if you exit Vim before cleaning up the {{{2
+"                     supposed-to-be temporary session file
+fun! ZoomWin#CleanupSessionFile()
+"  call Dfunc("ZoomWin#CleanupSessionFile()")
+  if exists("s:sessionfile") && filereadable(s:sessionfile)
+"   call Decho("sessionfile exists and is readable; deleting it")
+   silent! call delete(s:sessionfile)
+   unlet s:sessionfile
+  endif
+"  call Dret("ZoomWin#CleanupSessionFile")
+endfun
+
+" ---------------------------------------------------------------------
+" GotoWinNum: this function puts cursor into specified window {{{2
+fun! s:GotoWinNum(winnum)
+"  call Dfunc("GotoWinNum(winnum=".a:winnum.") winnr=".winnr())
+  if a:winnum != winnr()
+   exe a:winnum."wincmd w"
+  endif
+"  call Dret("GotoWinNum")
+endfun
+
+
+" ---------------------------------------------------------------------
+" ZoomWinPreserve:  This function, largely written by David Fishburn, {{{2
+"   allows ZoomWin to "preserve" certain windows:
+"
+"      TagList, by Yegappan Lakshmanan
+"        http://vim.sourceforge.net/scripts/script.php?script_id=273
+"
+"      WinManager, by Srinath Avadhanula
+"        http://vim.sourceforge.net/scripts/script.php?script_id=95
+"
+"  It does so by closing the associated window upon entry to ZoomWin
+"  and re-opening it upon exit by using commands provided by the
+"  utilities themselves.
+fun! s:ZoomWinPreserve(open)
+"  call Dfunc("ZoomWinPreserve(open=".a:open.")")
+
+  if a:open == 0
+
+   " Close Taglist
+   if exists('g:zoomwin_preserve_taglist') && exists('g:loaded_taglist')
+       " If taglist window is open then close it.
+       let s:taglist_winnum = bufwinnr(g:TagList_title)
+       if s:taglist_winnum != -1
+           " Close the window
+           exec "silent! Tlist"
+       endif
+   endif
+
+   " Close Winmanager
+   if exists('g:zoomwin_preserve_winmanager') && exists('g:loaded_winmanager')
+       " If the winmanager window is open then close it.
+       let s:is_winmgr_vis = IsWinManagerVisible()
+       if s:is_winmgr_vis == 1
+           exec "WMClose"
+       endif
+   endif
+
+  else
+
+   " Re-open Taglist
+   if exists('g:zoomwin_preserve_taglist') && exists('g:loaded_taglist')
+       " If taglist window was open, open it again
+       if s:taglist_winnum != -1
+           exec "silent! Tlist"
+       endif
+   endif
+
+   " Re-Open Winmanager
+   if exists('g:zoomwin_preserve_winmanager') && exists('g:loaded_winmanager')
+       " If the winmanager window is open then close it.
+       if s:is_winmgr_vis == 1
+           exec "WManager"
+       endif
+   endif
+  endif
+
+"  call Dret("ZoomWinPreserve")
+endfun
+
+" =====================================================================
+"  Restore: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+
+" ---------------------------------------------------------------------
+"  Modelines: {{{1
+" vim: ts=4 fdm=marker
diff --git a/vim/autoload/conque_term.vim b/vim/autoload/conque_term.vim
new file mode 100644 (file)
index 0000000..2780c7d
--- /dev/null
@@ -0,0 +1,1590 @@
+" FILE:     plugin/conque_term.vim {{{
+"
+" AUTHOR:   Nico Raffo <nicoraffo@gmail.com>
+" MODIFIED: 2010-05-27
+" VERSION:  1.1, for Vim 7.0
+" LICENSE:
+" Conque - pty interaction in Vim
+" Copyright (C) 2009-2010 Nico Raffo 
+"
+" MIT License
+" 
+" Permission is hereby granted, free of charge, to any person obtaining a copy
+" of this software and associated documentation files (the "Software"), to deal
+" in the Software without restriction, including without limitation the rights
+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+" copies of the Software, and to permit persons to whom the Software is
+" furnished to do so, subject to the following conditions:
+" 
+" The above copyright notice and this permission notice shall be included in
+" all copies or substantial portions of the Software.
+" 
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+" THE SOFTWARE.
+" }}}
+
+
+" **********************************************************************************************************
+" **** VIM FUNCTIONS ***************************************************************************************
+" **********************************************************************************************************
+
+" launch conque
+function! conque_term#open(...) "{{{
+    let command = get(a:000, 0, '')
+    let hooks   = get(a:000, 1, [])
+
+    " bare minimum validation
+    if has('python') != 1
+        echohl WarningMsg | echomsg "Conque requires the Python interface to be installed" | echohl None
+        return 0
+    endif
+    if empty(command)
+        echohl WarningMsg | echomsg "No command found" | echohl None
+        return 0
+    else
+        let l:cargs = split(command, '\s')
+        if !executable(l:cargs[0])
+            echohl WarningMsg | echomsg "Not an executable: " . l:cargs[0] | echohl None
+            return 0
+        endif
+    endif
+
+    " set buffer window options
+    let g:ConqueTerm_BufName = substitute(command, ' ', '\\ ', 'g') . "\\ -\\ " . g:ConqueTerm_Idx
+    call conque_term#set_buffer_settings(command, hooks)
+    let b:ConqueTerm_Var = 'ConqueTerm_' . g:ConqueTerm_Idx
+    let g:ConqueTerm_Var = 'ConqueTerm_' . g:ConqueTerm_Idx
+    let g:ConqueTerm_Idx += 1
+
+    " open command
+    try
+        let l:config = '{"color":' . string(g:ConqueTerm_Color) . ',"TERM":"' . g:ConqueTerm_TERM . '"}'
+        execute 'python ' . b:ConqueTerm_Var . ' = Conque()'
+        execute "python " . b:ConqueTerm_Var . ".open('" . conque_term#python_escape(command) . "', " . l:config . ")"
+    catch 
+        echohl WarningMsg | echomsg "Unable to open command: " . command | echohl None
+        return 0
+    endtry
+
+    " set buffer mappings and auto commands 
+    call conque_term#set_mappings('start')
+
+    startinsert!
+    return 1
+endfunction "}}}
+
+" set buffer options
+function! conque_term#set_buffer_settings(command, pre_hooks) "{{{
+
+    " optional hooks to execute, e.g. 'split'
+    for h in a:pre_hooks
+        sil exe h
+    endfor
+    sil exe "edit " . g:ConqueTerm_BufName
+
+    " buffer settings 
+    setlocal nocompatible      " conque won't work in compatible mode
+    setlocal nopaste           " conque won't work in paste mode
+    setlocal buftype=nofile    " this buffer is not a file, you can't save it
+    setlocal nonumber          " hide line numbers
+    setlocal foldcolumn=0      " reasonable left margin
+    setlocal nowrap            " default to no wrap (esp with MySQL)
+    setlocal noswapfile        " don't bother creating a .swp file
+    setlocal updatetime=50     " trigger cursorhold event after 50ms / XXX - global
+    setlocal scrolloff=0       " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal sidescrolloff=0   " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal sidescroll=1      " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal foldmethod=manual " don't fold on {{{}}} and stuff
+    setlocal bufhidden=hide    " when buffer is no longer displayed, don't wipe it out
+    setfiletype conque_term    " useful
+    sil exe "setlocal syntax=" . g:ConqueTerm_Syntax
+
+endfunction " }}}
+
+" set key mappings and auto commands
+function! conque_term#set_mappings(action) "{{{
+
+    " set action
+    if a:action == 'toggle'
+        if exists('b:conque_on') && b:conque_on == 1
+            let l:action = 'stop'
+            echohl WarningMsg | echomsg "Terminal is paused" | echohl None
+        else
+            let l:action = 'start'
+            echohl WarningMsg | echomsg "Terminal is resumed" | echohl None
+        endif
+    else
+        let l:action = a:action
+    endif
+
+    " if mappings are being removed, add 'un'
+    let map_modifier = 'nore'
+    if l:action == 'stop'
+        let map_modifier = 'un'
+    endif
+
+    " remove all auto commands
+    if l:action == 'stop'
+        execute 'autocmd! ' . b:ConqueTerm_Var
+
+    else
+        execute 'augroup ' . b:ConqueTerm_Var
+
+        " handle unexpected closing of shell, passes HUP to parent and all child processes
+        execute 'autocmd ' . b:ConqueTerm_Var . ' BufUnload <buffer> python ' . b:ConqueTerm_Var . '.proc.signal(1)'
+
+        " check for resized/scrolled buffer when entering buffer
+        execute 'autocmd ' . b:ConqueTerm_Var . ' BufEnter <buffer> python ' . b:ConqueTerm_Var . '.update_window_size()'
+        execute 'autocmd ' . b:ConqueTerm_Var . ' VimResized python ' . b:ConqueTerm_Var . '.update_window_size()'
+
+        " set/reset updatetime on entering/exiting buffer
+        autocmd BufEnter <buffer> set updatetime=50
+        autocmd BufLeave <buffer> set updatetime=2000
+
+        " check for resized/scrolled buffer when entering insert mode
+        " XXX - messed up since we enter insert mode at each updatetime
+        "execute 'autocmd InsertEnter <buffer> python ' . b:ConqueTerm_Var . '.screen.align()'
+
+        " read more output when this isn't the current buffer
+        if g:ConqueTerm_ReadUnfocused == 1
+            execute 'autocmd ' . b:ConqueTerm_Var . ' CursorHold * call conque_term#read_all()'
+        endif
+
+        " poll for more output
+        sil execute 'autocmd ' . b:ConqueTerm_Var . ' CursorHoldI <buffer> python ' .  b:ConqueTerm_Var . '.auto_read()'
+    endif
+
+    " use F22 key to get more input
+    if l:action == 'start'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F22> "\<left>\<right>"'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F23> "\<right>\<left>"'
+    else
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F22>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F23>'
+    endif
+
+    " map ASCII 1-31
+    for c in range(1, 31)
+        " <Esc>
+        if c == 27
+            continue
+        endif
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <C-' . nr2char(64 + c) . '> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(' . c . '))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <C-' . nr2char(64 + c) . '>'
+        endif
+    endfor
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> <C-c> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(3))<CR>'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> <C-c>'
+    endif
+
+    " leave insert mode
+    if !exists('g:ConqueTerm_EscKey') || g:ConqueTerm_EscKey == '<Esc>'
+        " use <Esc><Esc> to send <Esc> to terminal
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc><Esc> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(27))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc><Esc>'
+        endif
+    else
+        " use <Esc> to send <Esc> to terminal
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> ' . g:ConqueTerm_EscKey . ' <Esc>'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(27))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> ' . g:ConqueTerm_EscKey
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc>'
+        endif
+    endif
+
+    " Map <C-w> in insert mode
+    if exists('g:ConqueTerm_CWInsert') && g:ConqueTerm_CWInsert == 1
+        inoremap <silent> <buffer> <C-w>j <Esc><C-w>j
+        inoremap <silent> <buffer> <C-w>k <Esc><C-w>k
+        inoremap <silent> <buffer> <C-w>h <Esc><C-w>h
+        inoremap <silent> <buffer> <C-w>l <Esc><C-w>l
+        inoremap <silent> <buffer> <C-w>w <Esc><C-w>w
+    endif
+
+    " map ASCII 33-127
+    for i in range(33, 127)
+        " <Bar>
+        if i == 124
+            if l:action == 'start'
+                sil exe "i" . map_modifier . "map <silent> <buffer> <Bar> <C-o>:python " . b:ConqueTerm_Var . ".write(chr(124))<CR>"
+            else
+                sil exe "i" . map_modifier . "map <silent> <buffer> <Bar>"
+            endif
+            continue
+        endif
+        if l:action == 'start'
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i) . " <C-o>:python " . b:ConqueTerm_Var . ".write(chr(" . i . "))<CR>"
+        else
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i)
+        endif
+    endfor
+
+    " map ASCII 128-255
+    for i in range(128, 255)
+        if l:action == 'start'
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i) . " <C-o>:python " . b:ConqueTerm_Var . ".write('" . nr2char(i) . "')<CR>"
+        else
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i)
+        endif
+    endfor
+
+    " Special cases
+    if l:action == 'start'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u0008")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space> <C-o>:python ' . b:ConqueTerm_Var . '.write(" ")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[A")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[B")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[C")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Left> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[D")<CR>'
+    else
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Left>'
+    endif
+
+    " send selected text into conque
+    if l:action == 'start'
+        sil exe 'v' . map_modifier . 'map <silent> <F9> :<C-u>call conque_term#send_selected(visualmode())<CR>'
+    else
+        sil exe 'v' . map_modifier . 'map <silent> <F9>'
+    endif
+
+    " remap paste keys
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> P :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> ]p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> [p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> p'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> P'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> ]p'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> [p'
+    endif
+    if has('gui_running')
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <buffer> <S-Insert> <Esc>:<C-u>python ' . b:ConqueTerm_Var . ".write(vim.eval('@+'))<CR>a"
+        else
+            sil exe 'i' . map_modifier . 'map <buffer> <S-Insert>'
+        endif
+    endif
+
+    " disable other normal mode keys which insert text
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> r :echo "Replace mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> R :echo "Replace mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> c :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> C :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> s :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> S :echo "Change mode disabled in shell."<CR>'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> r'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> R'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> c'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> C'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> s'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> S'
+    endif
+
+    " set conque as on or off
+    if l:action == 'start'
+        let b:conque_on = 1
+    else
+        let b:conque_on = 0
+    endif
+
+    " map command to start stop the shell
+    if a:action == 'start'
+        nnoremap <F5> :<C-u>call conque_term#set_mappings('toggle')<CR>
+    endif
+
+endfunction " }}}
+
+
+" send selected text from another buffer
+function! conque_term#send_selected(type) "{{{
+    let reg_save = @@
+
+    " save user's sb settings
+    let sb_save = &switchbuf
+    set switchbuf=usetab
+
+    " yank current selection
+    sil exe "normal! `<" . a:type . "`>y"
+
+    " format yanked text
+    let @@ = substitute(@@, '^[\r\n]*', '', '')
+    let @@ = substitute(@@, '[\r\n]*$', '', '')
+
+    " execute yanked text
+    sil exe ":sb " . g:ConqueTerm_BufName
+    sil exe 'python ' . g:ConqueTerm_Var . '.paste_selection()'
+
+    " reset original values
+    let @@ = reg_save
+    sil exe 'set switchbuf=' . sb_save
+
+    " scroll buffer left
+    startinsert!
+    normal 0zH
+endfunction "}}}
+
+" read from all known conque buffers
+function! conque_term#read_all() "{{{
+    " don't run this if we're in a conque buffer
+    if exists('b:ConqueTerm_Var')
+        return
+    endif
+
+    try
+        for i in range(1, g:ConqueTerm_Idx - 1)
+            execute 'python ConqueTerm_' . string(i) . '.read(1)'
+        endfor
+    catch
+        " probably a deleted buffer
+    endtry
+
+    " restart updatetime
+    call feedkeys("f\e")
+endfunction "}}}
+
+" util function to add enough \s to pass a string to python
+function! conque_term#python_escape(input) "{{{
+    let l:cleaned = a:input
+    let l:cleaned = substitute(l:cleaned, '\\', '\\\\', 'g')
+    let l:cleaned = substitute(l:cleaned, '\n', '\\n', 'g')
+    let l:cleaned = substitute(l:cleaned, '\r', '\\r', 'g')
+    let l:cleaned = substitute(l:cleaned, "'", "\\\\'", 'g')
+    return l:cleaned
+endfunction "}}}
+
+" **********************************************************************************************************
+" **** PYTHON **********************************************************************************************
+" **********************************************************************************************************
+
+if has('python')
+
+python << EOF
+
+import vim, re, time, math
+
+# CONFIG CONSTANTS  {{{
+
+CONQUE_CTL = {
+     7:'bel', # bell
+     8:'bs',  # backspace
+     9:'tab', # tab
+    10:'nl',  # new line
+    13:'cr'   # carriage return
+}
+#    11 : 'vt',  # vertical tab
+#    12 : 'ff',  # form feed
+#    14 : 'so',  # shift out
+#    15 : 'si'   # shift in
+
+# Escape sequences 
+CONQUE_ESCAPE = { 
+    'm':'font',
+    'J':'clear_screen',
+    'K':'clear_line',
+    '@':'add_spaces',
+    'A':'cursor_up',
+    'B':'cursor_down',
+    'C':'cursor_right',
+    'D':'cursor_left',
+    'G':'cursor_to_column',
+    'H':'cursor',
+    'P':'delete_chars',
+    'f':'cursor',
+    'g':'tab_clear',
+    'r':'set_coords',
+    'h':'set',
+    'l':'reset'
+}
+#    'L':'insert_lines',
+#    'M':'delete_lines',
+#    'd':'cusor_vpos',
+
+# Alternate escape sequences, no [
+CONQUE_ESCAPE_PLAIN = {
+    'D':'scroll_up',
+    'E':'next_line',
+    'H':'set_tab',
+    'M':'scroll_down'
+}
+#    'N':'single_shift_2',
+#    'O':'single_shift_3',
+#    '=':'alternate_keypad',
+#    '>':'numeric_keypad',
+#    '7':'save_cursor',
+#    '8':'restore_cursor',
+
+# Uber alternate escape sequences, with # or ?
+CONQUE_ESCAPE_QUESTION = {
+    '1h':'new_line_mode',
+    '3h':'132_cols',
+    '4h':'smooth_scrolling',
+    '5h':'reverse_video',
+    '6h':'relative_origin',
+    '7h':'set_auto_wrap',
+    '8h':'set_auto_repeat',
+    '9h':'set_interlacing_mode',
+    '1l':'set_cursor_key',
+    '2l':'set_vt52',
+    '3l':'80_cols',
+    '4l':'set_jump_scrolling',
+    '5l':'normal_video',
+    '6l':'absolute_origin',
+    '7l':'reset_auto_wrap',
+    '8l':'reset_auto_repeat',
+    '9l':'reset_interlacing_mode'
+}
+
+CONQUE_ESCAPE_HASH = {
+    '8':'screen_alignment_test'
+} 
+#    '3':'double_height_top',
+#    '4':'double_height_bottom',
+#    '5':'single_height_single_width',
+#    '6':'single_height_double_width',
+
+# Font codes {{{
+CONQUE_FONT = {
+    0: {'description':'Normal (default)', 'attributes': {'cterm':'NONE','ctermfg':'NONE','ctermbg':'NONE','gui':'NONE','guifg':'NONE','guibg':'NONE'}, 'normal':True},
+    1: {'description':'Bold', 'attributes': {'cterm':'BOLD','gui':'BOLD'}, 'normal':False},
+    4: {'description':'Underlined', 'attributes': {'cterm':'UNDERLINE','gui':'UNDERLINE'}, 'normal':False},
+    5: {'description':'Blink (appears as Bold)', 'attributes': {'cterm':'BOLD','gui':'BOLD'}, 'normal':False},
+    7: {'description':'Inverse', 'attributes': {'cterm':'REVERSE','gui':'REVERSE'}, 'normal':False},
+    8: {'description':'Invisible (hidden)', 'attributes': {'ctermfg':'0','ctermbg':'0','guifg':'#000000','guibg':'#000000'}, 'normal':False},
+    22: {'description':'Normal (neither bold nor faint)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    24: {'description':'Not underlined', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    25: {'description':'Steady (not blinking)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    27: {'description':'Positive (not inverse)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    28: {'description':'Visible (not hidden)', 'attributes': {'ctermfg':'NONE','ctermbg':'NONE','guifg':'NONE','guibg':'NONE'}, 'normal':True},
+    30: {'description':'Set foreground color to Black', 'attributes': {'ctermfg':'16','guifg':'#000000'}, 'normal':False},
+    31: {'description':'Set foreground color to Red', 'attributes': {'ctermfg':'1','guifg':'#ff0000'}, 'normal':False},
+    32: {'description':'Set foreground color to Green', 'attributes': {'ctermfg':'2','guifg':'#00ff00'}, 'normal':False},
+    33: {'description':'Set foreground color to Yellow', 'attributes': {'ctermfg':'3','guifg':'#ffff00'}, 'normal':False},
+    34: {'description':'Set foreground color to Blue', 'attributes': {'ctermfg':'4','guifg':'#0000ff'}, 'normal':False},
+    35: {'description':'Set foreground color to Magenta', 'attributes': {'ctermfg':'5','guifg':'#990099'}, 'normal':False},
+    36: {'description':'Set foreground color to Cyan', 'attributes': {'ctermfg':'6','guifg':'#009999'}, 'normal':False},
+    37: {'description':'Set foreground color to White', 'attributes': {'ctermfg':'7','guifg':'#ffffff'}, 'normal':False},
+    39: {'description':'Set foreground color to default (original)', 'attributes': {'ctermfg':'NONE','guifg':'NONE'}, 'normal':True},
+    40: {'description':'Set background color to Black', 'attributes': {'ctermbg':'16','guibg':'#000000'}, 'normal':False},
+    41: {'description':'Set background color to Red', 'attributes': {'ctermbg':'1','guibg':'#ff0000'}, 'normal':False},
+    42: {'description':'Set background color to Green', 'attributes': {'ctermbg':'2','guibg':'#00ff00'}, 'normal':False},
+    43: {'description':'Set background color to Yellow', 'attributes': {'ctermbg':'3','guibg':'#ffff00'}, 'normal':False},
+    44: {'description':'Set background color to Blue', 'attributes': {'ctermbg':'4','guibg':'#0000ff'}, 'normal':False},
+    45: {'description':'Set background color to Magenta', 'attributes': {'ctermbg':'5','guibg':'#990099'}, 'normal':False},
+    46: {'description':'Set background color to Cyan', 'attributes': {'ctermbg':'6','guibg':'#009999'}, 'normal':False},
+    47: {'description':'Set background color to White', 'attributes': {'ctermbg':'7','guibg':'#ffffff'}, 'normal':False},
+    49: {'description':'Set background color to default (original).', 'attributes': {'ctermbg':'NONE','guibg':'NONE'}, 'normal':True},
+    90: {'description':'Set foreground color to Black', 'attributes': {'ctermfg':'8','guifg':'#000000'}, 'normal':False},
+    91: {'description':'Set foreground color to Red', 'attributes': {'ctermfg':'9','guifg':'#ff0000'}, 'normal':False},
+    92: {'description':'Set foreground color to Green', 'attributes': {'ctermfg':'10','guifg':'#00ff00'}, 'normal':False},
+    93: {'description':'Set foreground color to Yellow', 'attributes': {'ctermfg':'11','guifg':'#ffff00'}, 'normal':False},
+    94: {'description':'Set foreground color to Blue', 'attributes': {'ctermfg':'12','guifg':'#0000ff'}, 'normal':False},
+    95: {'description':'Set foreground color to Magenta', 'attributes': {'ctermfg':'13','guifg':'#990099'}, 'normal':False},
+    96: {'description':'Set foreground color to Cyan', 'attributes': {'ctermfg':'14','guifg':'#009999'}, 'normal':False},
+    97: {'description':'Set foreground color to White', 'attributes': {'ctermfg':'15','guifg':'#ffffff'}, 'normal':False},
+    100: {'description':'Set background color to Black', 'attributes': {'ctermbg':'8','guibg':'#000000'}, 'normal':False},
+    101: {'description':'Set background color to Red', 'attributes': {'ctermbg':'9','guibg':'#ff0000'}, 'normal':False},
+    102: {'description':'Set background color to Green', 'attributes': {'ctermbg':'10','guibg':'#00ff00'}, 'normal':False},
+    103: {'description':'Set background color to Yellow', 'attributes': {'ctermbg':'11','guibg':'#ffff00'}, 'normal':False},
+    104: {'description':'Set background color to Blue', 'attributes': {'ctermbg':'12','guibg':'#0000ff'}, 'normal':False},
+    105: {'description':'Set background color to Magenta', 'attributes': {'ctermbg':'13','guibg':'#990099'}, 'normal':False},
+    106: {'description':'Set background color to Cyan', 'attributes': {'ctermbg':'14','guibg':'#009999'}, 'normal':False},
+    107: {'description':'Set background color to White', 'attributes': {'ctermbg':'15','guibg':'#ffffff'}, 'normal':False}
+} 
+# }}}
+
+# regular expression matching (almost) all control sequences
+CONQUE_SEQ_REGEX       = re.compile(ur"(\u001b\[?\??#?[0-9;]*[a-zA-Z@]|\u001b\][0-9];.*?\u0007|[\u0007-\u000f])", re.UNICODE)
+CONQUE_SEQ_REGEX_CTL   = re.compile(ur"^[\u0007-\u000f]$", re.UNICODE)
+CONQUE_SEQ_REGEX_CSI   = re.compile(ur"^\u001b\[", re.UNICODE)
+CONQUE_SEQ_REGEX_TITLE = re.compile(ur"^\u001b\]", re.UNICODE)
+CONQUE_SEQ_REGEX_HASH  = re.compile(ur"^\u001b#", re.UNICODE)
+CONQUE_SEQ_REGEX_ESC   = re.compile(ur"^\u001b", re.UNICODE)
+
+# match table output
+CONQUE_TABLE_OUTPUT   = re.compile("^\s*\|\s.*\s\|\s*$|^\s*\+[=+-]+\+\s*$")
+
+# }}}
+
+###################################################################################################
+class Conque:
+
+    # CLASS PROPERTIES {{{ 
+
+    # screen object
+    screen          = None
+
+    # subprocess object
+    proc            = None
+
+    # terminal dimensions and scrolling region
+    columns         = 80 # same as $COLUMNS
+    lines           = 24 # same as $LINES
+    working_columns = 80 # can be changed by CSI ? 3 l/h
+    working_lines   = 24 # can be changed by CSI r
+
+    # top/bottom of the scroll region
+    top             = 1  # relative to top of screen
+    bottom          = 24 # relative to top of screen
+
+    # cursor position
+    l               = 1  # current cursor line
+    c               = 1  # current cursor column
+
+    # autowrap mode
+    autowrap        = True
+
+    # absolute coordinate mode
+    absolute_coords = True
+
+    # tabstop positions
+    tabstops        = []
+
+    # enable colors
+    enable_colors = True
+
+    # color changes
+    color_changes = {}
+
+    # color history
+    color_history = {}
+
+    # don't wrap table output
+    unwrap_tables = True
+
+    # wrap CUF/CUB around line breaks
+    wrap_cursor = False
+
+    # }}}
+
+    # constructor
+    def __init__(self): # {{{
+        self.screen = ConqueScreen()
+        # }}}
+
+    # start program and initialize this instance
+    def open(self, command, options): # {{{
+
+        # int vars
+        self.columns = vim.current.window.width
+        self.lines = vim.current.window.height
+        self.working_columns = vim.current.window.width
+        self.working_lines = vim.current.window.height
+        self.bottom = vim.current.window.height
+
+        # init color
+        self.enable_colors = options['color']
+
+        # init tabstops
+        self.init_tabstops()
+
+        # open command
+        self.proc = ConqueSubprocess()
+        self.proc.open(command, { 'TERM' : options['TERM'], 'CONQUE' : '1', 'LINES' : str(self.lines), 'COLUMNS' : str(self.columns)})
+        # }}}
+
+    # write to pty
+    def write(self, input): # {{{
+
+
+        # check if window size has changed
+        self.update_window_size()
+
+        # write and read
+        self.proc.write(input)
+        self.read(1)
+        # }}}
+
+    # read from pty, and update buffer
+    def read(self, timeout = 1): # {{{
+        # read from subprocess
+        output = self.proc.read(timeout)
+        # and strip null chars
+        output = output.replace(chr(0), '')
+
+        if output == '':
+            return
+
+
+
+
+
+        chunks = CONQUE_SEQ_REGEX.split(output)
+
+
+
+
+
+        # don't go through all the csi regex if length is one (no matches)
+        if len(chunks) == 1:
+
+            self.plain_text(chunks[0])
+
+        else:
+            for s in chunks:
+                if s == '':
+                    continue
+
+
+
+
+
+
+                # Check for control character match {{{
+                if CONQUE_SEQ_REGEX_CTL.match(s[0]):
+
+                    nr = ord(s[0])
+                    if nr in CONQUE_CTL:
+                        getattr(self, 'ctl_' + CONQUE_CTL[nr])()
+                    else:
+
+                        pass
+                    # }}}
+
+                # check for escape sequence match {{{
+                elif CONQUE_SEQ_REGEX_CSI.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE:
+                        csi = self.parse_csi(s[2:])
+
+                        getattr(self, 'csi_' + CONQUE_ESCAPE[s[-1]])(csi)
+                    else:
+
+                        pass
+                    # }}}
+        
+                # check for title match {{{
+                elif CONQUE_SEQ_REGEX_TITLE.match(s):
+
+                    self.change_title(s[2], s[4:-1])
+                    # }}}
+        
+                # check for hash match {{{
+                elif CONQUE_SEQ_REGEX_HASH.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE_HASH:
+                        getattr(self, 'hash_' + CONQUE_ESCAPE_HASH[s[-1]])()
+                    else:
+
+                        pass
+                    # }}}
+                
+                # check for other escape match {{{
+                elif CONQUE_SEQ_REGEX_ESC.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE_PLAIN:
+                        getattr(self, 'esc_' + CONQUE_ESCAPE_PLAIN[s[-1]])()
+                    else:
+
+                        pass
+                    # }}}
+                
+                # else process plain text {{{
+                else:
+                    self.plain_text(s)
+                    # }}}
+
+        # set cursor position
+        self.screen.set_cursor(self.l, self.c)
+
+        vim.command('redraw')
+
+
+    # }}}
+
+    # for polling
+    def auto_read(self): # {{{
+        self.read(1)
+        if self.c == 1:
+            vim.command('call feedkeys("\<F23>", "t")')
+        else:
+            vim.command('call feedkeys("\<F22>", "t")')
+        self.screen.set_cursor(self.l, self.c)
+    # }}}
+
+    ###############################################################################################
+    # Plain text # {{{
+
+    def plain_text(self, input):
+
+        current_line = self.screen[self.l]
+
+        if len(current_line) < self.working_columns:
+            current_line = current_line + ' ' * (self.c - len(current_line))
+
+        # if line is wider than screen
+        if self.c + len(input) - 1 > self.working_columns:
+            # Table formatting hack
+            if self.unwrap_tables and CONQUE_TABLE_OUTPUT.match(input):
+                self.screen[self.l] = current_line[ : self.c - 1] + input + current_line[ self.c + len(input) - 1 : ]
+                self.apply_color(self.c, self.c + len(input))
+                self.c += len(input)
+                return
+
+            diff = self.c + len(input) - self.working_columns - 1
+            # if autowrap is enabled
+            if self.autowrap:
+                self.screen[self.l] = current_line[ : self.c - 1] + input[ : -1 * diff ]
+                self.apply_color(self.c, self.working_columns)
+                self.ctl_nl()
+                self.ctl_cr()
+                remaining = input[ -1 * diff : ]
+
+                self.plain_text(remaining)
+            else:
+                self.screen[self.l] = current_line[ : self.c - 1] + input[ : -1 * diff - 1 ] + input[-1]
+                self.apply_color(self.c, self.working_columns)
+                self.c = self.working_columns
+
+        # no autowrap
+        else:
+            self.screen[self.l] = current_line[ : self.c - 1] + input + current_line[ self.c + len(input) - 1 : ]
+            self.apply_color(self.c, self.c + len(input))
+            self.c += len(input)
+
+    def apply_color(self, start, end):
+
+
+        # stop here if coloration is disabled
+        if not self.enable_colors:
+            return
+
+        real_line = self.screen.get_real_line(self.l)
+
+        # check for previous overlapping coloration
+
+        to_del = []
+        if self.color_history.has_key(real_line):
+            for i in range(len(self.color_history[real_line])):
+                syn = self.color_history[real_line][i]
+
+                if syn['start'] >= start and syn['start'] < end:
+
+                    vim.command('syn clear ' + syn['name'])
+                    to_del.append(i)
+                    # outside
+                    if syn['end'] > end:
+
+                        self.exec_highlight(real_line, end, syn['end'], syn['highlight'])
+                elif syn['end'] > start and syn['end'] <= end:
+
+                    vim.command('syn clear ' + syn['name'])
+                    to_del.append(i)
+                    # outside
+                    if syn['start'] < start:
+
+                        self.exec_highlight(real_line, syn['start'], start, syn['highlight'])
+
+        if len(to_del) > 0:
+            to_del.reverse()
+            for di in to_del:
+                del self.color_history[real_line][di]
+
+        # if there are no new colors
+        if len(self.color_changes) == 0:
+            return
+
+        highlight = ''
+        for attr in self.color_changes.keys():
+            highlight = highlight + ' ' + attr + '=' + self.color_changes[attr]
+
+        # execute the highlight
+        self.exec_highlight(real_line, start, end, highlight)
+
+    def exec_highlight(self, real_line, start, end, highlight):
+        unique_key = str(self.proc.pid)
+
+        syntax_name = 'EscapeSequenceAt_' + unique_key + '_' + str(self.l) + '_' + str(start) + '_' + str(len(self.color_history) + 1)
+        syntax_options = ' contains=ALLBUT,ConqueString,MySQLString,MySQLKeyword oneline'
+        syntax_region = 'syntax match ' + syntax_name + ' /\%' + str(real_line) + 'l\%>' + str(start - 1) + 'c.*\%<' + str(end + 1) + 'c/' + syntax_options
+        syntax_highlight = 'highlight ' + syntax_name + highlight
+
+        vim.command(syntax_region)
+        vim.command(syntax_highlight)
+
+        # add syntax name to history
+        if not self.color_history.has_key(real_line):
+            self.color_history[real_line] = []
+
+        self.color_history[real_line].append({'name':syntax_name, 'start':start, 'end':end, 'highlight':highlight})
+
+    # }}}
+
+    ###############################################################################################
+    # Control functions {{{
+
+    def ctl_nl(self):
+        # if we're in a scrolling region, scroll instead of moving cursor down
+        if self.lines != self.working_lines and self.l == self.bottom:
+            del self.screen[self.top]
+            self.screen.insert(self.bottom, '')
+        elif self.l == self.bottom:
+            self.screen.append('')
+        else:
+            self.l += 1
+
+        self.color_changes = {}
+
+    def ctl_cr(self):
+        self.c = 1
+
+        self.color_changes = {}
+
+    def ctl_bs(self):
+        if self.c > 1:
+            self.c += -1
+
+    def ctl_bel(self):
+        print 'BELL'
+
+    def ctl_tab(self):
+        # default tabstop location
+        ts = self.working_columns
+
+        # check set tabstops
+        for i in range(self.c, len(self.tabstops)):
+            if self.tabstops[i]:
+                ts = i + 1
+                break
+
+
+
+        self.c = ts
+
+    # }}}
+
+    ###############################################################################################
+    # CSI functions {{{
+
+    def csi_font(self, csi): # {{{
+        if not self.enable_colors:
+            return
+        
+        # defaults to 0
+        if len(csi['vals']) == 0:
+            csi['vals'] = [0]
+
+        # 256 xterm color foreground
+        if len(csi['vals']) == 3 and csi['vals'][0] == 38 and csi['vals'][1] == 5:
+            self.color_changes['ctermfg'] = str(csi['vals'][2])
+            self.color_changes['guifg'] = '#' + self.xterm_to_rgb(csi['vals'][2])
+
+        # 256 xterm color background
+        elif len(csi['vals']) == 3 and csi['vals'][0] == 48 and csi['vals'][1] == 5:
+            self.color_changes['ctermbg'] = str(csi['vals'][2])
+            self.color_changes['guibg'] = '#' + self.xterm_to_rgb(csi['vals'][2])
+
+        # 16 colors
+        else:
+            for val in csi['vals']:
+                if CONQUE_FONT.has_key(val):
+
+                    # ignore starting normal colors
+                    if CONQUE_FONT[val]['normal'] and len(self.color_changes) == 0:
+
+                        continue
+                    # clear color changes
+                    elif CONQUE_FONT[val]['normal']:
+
+                        self.color_changes = {}
+                    # save these color attributes for next plain_text() call
+                    else:
+
+                        for attr in CONQUE_FONT[val]['attributes'].keys():
+                            if self.color_changes.has_key(attr) and (attr == 'cterm' or attr == 'gui'):
+                                self.color_changes[attr] += ',' + CONQUE_FONT[val]['attributes'][attr]
+                            else:
+                                self.color_changes[attr] = CONQUE_FONT[val]['attributes'][attr]
+        # }}}
+
+    def csi_clear_line(self, csi): # {{{
+
+
+        # this escape defaults to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+
+
+
+        # 0 means cursor right
+        if csi['val'] == 0:
+            self.screen[self.l] = self.screen[self.l][0 : self.c - 1]
+
+        # 1 means cursor left
+        elif csi['val'] == 1:
+            self.screen[self.l] = ' ' * (self.c) + self.screen[self.l][self.c : ]
+
+        # clear entire line
+        elif csi['val'] == 2:
+            self.screen[self.l] = ''
+
+        # clear colors
+        if csi['val'] == 2 or (csi['val'] == 0 and self.c == 1):
+            real_line = self.screen.get_real_line(self.l)
+            if self.color_history.has_key(real_line):
+                for syn in self.color_history[real_line]:
+                    vim.command('syn clear ' + syn['name'])
+
+
+
+        # }}}
+
+    def csi_cursor_right(self, csi): # {{{
+        # we use 1 even if escape explicitly specifies 0
+        if csi['val'] == 0:
+            csi['val'] = 1
+
+
+
+
+        if self.wrap_cursor and self.c + csi['val'] > self.working_columns:
+            self.l += int(math.floor( (self.c + csi['val']) / self.working_columns ))
+            self.c = (self.c + csi['val']) % self.working_columns
+            return
+
+        self.c = self.bound(self.c + csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_left(self, csi): # {{{
+        # we use 1 even if escape explicitly specifies 0
+        if csi['val'] == 0:
+            csi['val'] = 1
+
+        if self.wrap_cursor and csi['val'] >= self.c:
+            self.l += int(math.floor( (self.c - csi['val']) / self.working_columns ))
+            self.c = self.working_columns - (csi['val'] - self.c) % self.working_columns
+            return
+
+        self.c = self.bound(self.c - csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_to_column(self, csi): # {{{
+        self.c = self.bound(csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_up(self, csi): # {{{
+        self.l = self.bound(self.l - csi['val'], self.top, self.bottom)
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_cursor_down(self, csi): # {{{
+        self.l = self.bound(self.l + csi['val'], self.top, self.bottom)
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_clear_screen(self, csi): # {{{
+        # default to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+        # 2 == clear entire screen
+        if csi['val'] == 2:
+            self.l = 1
+            self.c = 1
+            self.screen.clear()
+
+        # 0 == clear down
+        elif csi['val'] == 0:
+            for l in range(self.bound(self.l + 1, 1, self.lines), self.lines + 1):
+                self.screen[l] = ''
+            
+            # clear end of current line
+            self.csi_clear_line(self.parse_csi('K'))
+
+        # 1 == clear up
+        elif csi['val'] == 1:
+            for l in range(1, self.bound(self.l, 1, self.lines + 1)):
+                self.screen[l] = ''
+
+            # clear beginning of current line
+            self.csi_clear_line(self.parse_csi('1K'))
+
+        # clear coloration
+        if csi['val'] == 2 or csi['val'] == 0:
+            real_line = self.screen.get_real_line(self.l)
+            for line in self.color_history.keys():
+                if line >= real_line:
+                    for syn in self.color_history[line]:
+                        vim.command('syn clear ' + syn['name'])
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_delete_chars(self, csi): # {{{
+        self.screen[self.l] = self.screen[self.l][ : self.c ] + self.screen[self.l][ self.c + csi['val'] : ]
+        # }}}
+
+    def csi_add_spaces(self, csi): # {{{
+        self.screen[self.l] = self.screen[self.l][ : self.c - 1] + ' ' * csi['val'] + self.screen[self.l][self.c : ]
+        # }}}
+
+    def csi_cursor(self, csi): # {{{
+        if len(csi['vals']) == 2:
+            new_line = csi['vals'][0]
+            new_col = csi['vals'][1]
+        else:
+            new_line = 1
+            new_col = 1
+
+        if self.absolute_coords:
+            self.l = self.bound(new_line, 1, self.lines)
+        else:
+            self.l = self.bound(self.top + new_line - 1, self.top, self.bottom)
+
+        self.c = self.bound(new_col, 1, self.working_columns)
+        if self.c > len(self.screen[self.l]):
+            self.screen[self.l] = self.screen[self.l] + ' ' * (self.c - len(self.screen[self.l]))
+
+        # }}}
+
+    def csi_set_coords(self, csi): # {{{
+        if len(csi['vals']) == 2:
+            new_start = csi['vals'][0]
+            new_end = csi['vals'][1]
+        else:
+            new_start = 1
+            new_end = vim.current.window.height
+
+        self.top = new_start
+        self.bottom = new_end
+        self.working_lines = new_end - new_start + 1
+
+        # if cursor is outside scrolling region, reset it
+        if self.l < self.top:
+            self.l = self.top
+        elif self.l > self.bottom:
+            self.l = self.bottom
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_tab_clear(self, csi): # {{{
+        # this escape defaults to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+
+
+        if csi['val'] == 0:
+            self.tabstops[self.c - 1] = False
+        elif csi['val'] == 3:
+            for i in range(0, self.columns + 1):
+                self.tabstops[i] = False
+        # }}}
+
+    def csi_set(self, csi): # {{{
+        # 132 cols
+        if csi['val'] == 3: 
+            self.csi_clear_screen(self.parse_csi('2J'))
+            self.working_columns = 132
+
+        # relative_origin
+        elif csi['val'] == 6: 
+            self.absolute_coords = False
+
+        # set auto wrap
+        elif csi['val'] == 7: 
+            self.autowrap = True
+
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_reset(self, csi): # {{{
+        # 80 cols
+        if csi['val'] == 3: 
+            self.csi_clear_screen(self.parse_csi('2J'))
+            self.working_columns = 80
+
+        # absolute origin
+        elif csi['val'] == 6: 
+            self.absolute_coords = True
+
+        # reset auto wrap
+        elif csi['val'] == 7: 
+            self.autowrap = False
+
+
+        self.color_changes = {}
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # ESC functions {{{
+
+    def esc_scroll_up(self): # {{{
+        self.ctl_nl()
+
+        self.color_changes = {}
+        # }}}
+
+    def esc_next_line(self): # {{{
+        self.ctl_nl()
+        self.c = 1
+        # }}}
+
+    def esc_set_tab(self): # {{{
+
+        if self.c <= len(self.tabstops):
+            self.tabstops[self.c - 1] = True
+        # }}}
+
+    def esc_scroll_down(self): # {{{
+        if self.l == self.top:
+            del self.screen[self.bottom]
+            self.screen.insert(self.top, '')
+        else:
+            self.l += -1
+
+        self.color_changes = {}
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # HASH functions {{{
+
+    def hash_screen_alignment_test(self): # {{{
+        self.csi_clear_screen(self.parse_csi('2J'))
+        self.working_lines = self.lines
+        for l in range(1, self.lines + 1):
+            self.screen[l] = 'E' * self.working_columns
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # Random stuff {{{
+
+    def change_title(self, key, val):
+
+
+        if key == '0' or key == '2':
+
+            vim.command('setlocal statusline=' + re.escape(val))
+
+    def paste(self):
+        self.write(vim.eval('@@'))
+        self.read(50)
+
+    def paste_selection(self):
+        self.write(vim.eval('@@'))
+
+    def update_window_size(self):
+        # resize if needed
+        if vim.current.window.width != self.columns or vim.current.window.height != self.lines:
+
+            # reset all window size attributes to default
+            self.columns = vim.current.window.width
+            self.lines = vim.current.window.height
+            self.working_columns = vim.current.window.width
+            self.working_lines = vim.current.window.height
+            self.bottom = vim.current.window.height
+
+            # reset screen object attributes
+            self.l = self.screen.reset_size(self.l)
+
+            # reset tabstops
+            self.init_tabstops()
+
+
+
+            # signal process that screen size has changed
+            self.proc.window_resize(self.lines, self.columns)
+
+    def init_tabstops(self):
+        for i in range(0, self.columns + 1):
+            if i % 8 == 0:
+                self.tabstops.append(True)
+            else:
+                self.tabstops.append(False)
+
+    # }}}
+
+    ###############################################################################################
+    # Utility {{{
+    
+    def parse_csi(self, s): # {{{
+        attr = { 'key' : s[-1], 'flag' : '', 'val' : 1, 'vals' : [] }
+
+        if len(s) == 1:
+            return attr
+
+        full = s[0:-1]
+
+        if full[0] == '?':
+            full = full[1:]
+            attr['flag'] = '?'
+
+        if full != '':
+            vals = full.split(';')
+            for val in vals:
+
+                val = re.sub("\D", "", val)
+
+                if val != '':
+                    attr['vals'].append(int(val))
+
+        if len(attr['vals']) == 1:
+            attr['val'] = int(attr['vals'][0])
+            
+        return attr
+        # }}}
+
+    def bound(self, val, min, max): # {{{
+        if val > max:
+            return max
+
+        if val < min:
+            return min
+
+        return val
+        # }}}
+
+    def xterm_to_rgb(self, color_code): # {{{
+        if color_code < 16:
+            ascii_colors = ['000000', 'CD0000', '00CD00', 'CDCD00', '0000EE', 'CD00CD', '00CDCD', 'E5E5E5', 
+                   '7F7F7F', 'FF0000', '00FF00', 'FFFF00', '5C5CFF', 'FF00FF', '00FFFF', 'FFFFFF']
+            return ascii_colors[color_code]
+
+        elif color_code < 232:
+            cc = int(color_code) - 16
+
+            p1 = "%02x" % (math.floor(cc / 36) * (255/5))
+            p2 = "%02x" % (math.floor((cc % 36) / 6) * (255/5))
+            p3 = "%02x" % (math.floor(cc % 6) * (255/5))
+
+            return p1 + p2 + p3
+        else:
+            grey_tone = "%02x" % math.floor((255/24) * (color_code - 232))
+            return grey_tone + grey_tone + grey_tone
+        # }}}
+
+    # }}}
+
+
+import os, signal, pty, tty, select, fcntl, termios, struct
+
+###################################################################################################
+class ConqueSubprocess:
+
+    # process id
+    pid = 0
+    
+    # stdout+stderr file descriptor
+    fd = None
+
+    # constructor
+    def __init__(self): # {{{
+        self.pid = 0
+        # }}}
+
+    # create the pty or whatever (whatever == windows)
+    def open(self, command, env = {}): # {{{
+        command_arr  = command.split()
+        executable   = command_arr[0]
+        args         = command_arr
+
+        try:
+            self.pid, self.fd = pty.fork()
+
+        except:
+            pass
+
+
+        # child proc, replace with command after altering terminal attributes
+        if self.pid == 0:
+
+            # set requested environment variables
+            for k in env.keys():
+                os.environ[k] = env[k]
+
+            # set some attributes
+            try:
+                attrs = tty.tcgetattr(1)
+                attrs[0] = attrs[0] ^ tty.IGNBRK
+                attrs[0] = attrs[0] | tty.BRKINT | tty.IXANY | tty.IMAXBEL
+                attrs[2] = attrs[2] | tty.HUPCL
+                attrs[3] = attrs[3] | tty.ICANON | tty.ECHO | tty.ISIG | tty.ECHOKE
+                attrs[6][tty.VMIN]  = 1
+                attrs[6][tty.VTIME] = 0
+                tty.tcsetattr(1, tty.TCSANOW, attrs)
+            except:
+                pass
+
+            os.execvp(executable, args)
+
+        # else master, do nothing
+        else:
+            pass
+
+        # }}}
+
+    # read from pty
+    # XXX - select.poll() doesn't work in OS X!!!!!!!
+    def read(self, timeout = 1): # {{{
+
+        output = ''
+        read_timeout = float(timeout) / 1000
+
+        try:
+            # what, no do/while?
+            while 1:
+                s_read, s_write, s_error = select.select( [ self.fd ], [], [], read_timeout)
+
+                lines = ''
+                for s_fd in s_read:
+                    try:
+                        lines = os.read( self.fd, 32 )
+                    except:
+                        pass
+                    output = output + lines
+
+                if lines == '':
+                    break
+        except:
+            pass
+
+        return output
+        # }}}
+
+    # I guess this one's not bad
+    def write(self, input): # {{{
+        try:
+            os.write(self.fd, input)
+        except:
+            pass
+        # }}}
+
+    # signal process
+    def signal(self, signum): # {{{
+        try:
+            os.kill(self.pid, signum)
+        except:
+            pass
+        # }}}
+
+    # get process status
+    def get_status(self): #{{{
+
+        p_status = True
+
+        try:
+            if os.waitpid( self.pid, os.WNOHANG )[0]:
+                p_status = False
+        except:
+            p_status = False
+
+        return p_status
+
+        # }}}
+
+    # update window size in kernel, then send SIGWINCH to fg process
+    def window_resize(self, lines, columns): # {{{
+        try:
+            fcntl.ioctl(self.fd, termios.TIOCSWINSZ, struct.pack("HHHH", lines, columns, 0, 0))
+            os.kill(self.pid, signal.SIGWINCH)
+        except:
+            pass
+
+        # }}}
+
+
+###################################################################################################
+# ConqueScreen is an extention of the vim.current.buffer object
+# It restricts the working indices of the buffer object to the scroll region which pty is expecting
+# It also uses 1-based indexes, to match escape sequence commands
+#
+# E.g.:
+#   s = ConqueScreen()
+#   ...
+#   s[5] = 'Set 5th line in terminal to this line'
+#   s.append('Add new line to terminal')
+#   s[5] = 'Since previous append() command scrolled the terminal down, this is a different line than first cb[5] call'
+#
+
+import vim
+
+class ConqueScreen(object):
+
+    # CLASS PROPERTIES  {{{
+
+    # the buffer
+    buffer          = None
+
+    # screen and scrolling regions
+    screen_top      = 1
+
+    # screen width
+    screen_width    = 80
+    screen_height    = 80
+
+    # }}}
+
+    def __init__(self): # {{{
+        self.buffer = vim.current.buffer
+
+        self.screen_top = 1
+        self.screen_width = vim.current.window.width
+        self.screen_height = vim.current.window.height
+    # }}}
+
+    ###############################################################################################
+    # List overload {{{
+    def __len__(self): # {{{
+        return len(self.buffer)
+    # }}}
+
+    def __getitem__(self, key): # {{{
+        real_line = self.get_real_idx(key)
+
+        # if line is past buffer end, add lines to buffer
+        if real_line >= len(self.buffer):
+            for i in range(len(self.buffer), real_line + 1):
+                self.append(' ' * self.screen_width)
+
+        return self.buffer[ real_line ]
+    # }}}
+
+    def __setitem__(self, key, value): # {{{
+        real_line = self.get_real_idx(key)
+
+        # if line is past end of screen, append
+        if real_line == len(self.buffer):
+            self.buffer.append(value)
+        else:
+            self.buffer[ real_line ] = value
+    # }}}
+
+    def __delitem__(self, key): # {{{
+        del self.buffer[ self.screen_top + key - 2 ]
+    # }}}
+
+    def append(self, value): # {{{
+        if len(self.buffer) > self.screen_top + self.screen_height - 1:
+            self.buffer[len(self.buffer) - 1] = value
+        else:
+            self.buffer.append(value)
+
+        if len(self.buffer) > self.screen_top + self.screen_height - 1:
+            self.screen_top += 1
+        if vim.current.buffer.number == self.buffer.number:
+            vim.command('normal G')
+    # }}}
+
+    def insert(self, line, value): # {{{
+
+        l = self.screen_top + line - 2
+        self.buffer[l:l] = [ value ]
+    
+    # }}}
+    # }}}
+
+    ###############################################################################################
+    # Util {{{
+    def get_top(self): # {{{
+        return self.screen_top
+    # }}}
+
+    def get_real_idx(self, line): # {{{
+        return (self.screen_top + line - 2)
+    # }}}
+
+    def get_real_line(self, line): # {{{
+        return (self.screen_top + line - 1)
+    # }}}
+
+    def set_screen_width(self, width): # {{{
+        self.screen_width = width
+    # }}}
+
+    # }}}
+
+    ###############################################################################################
+    def clear(self): # {{{
+        self.buffer.append(' ')
+        vim.command('normal Gzt')
+        self.screen_top = len(self.buffer)
+    # }}}
+
+    def set_cursor(self, line, column): # {{{
+        # figure out line
+        real_line =  self.screen_top + line - 1
+        if real_line > len(self.buffer):
+            for l in range(len(self.buffer) - 1, real_line):
+                self.buffer.append('')
+
+        # figure out column
+        real_column = column
+        if len(self.buffer[real_line - 1]) < real_column:
+            self.buffer[real_line - 1] = self.buffer[real_line - 1] + ' ' * (real_column - len(self.buffer[real_line - 1]))
+
+        # python version is occasionally grumpy
+        try:
+            vim.current.window.cursor = (real_line, real_column - 1)
+        except:
+            vim.command('call cursor(' + str(real_line) + ', ' + str(real_column) + ')')
+    # }}}
+
+    def reset_size(self, line): # {{{
+
+
+
+
+        # save cursor line number
+        real_line = self.screen_top + line
+
+        # reset screen size
+        self.screen_width = vim.current.window.width
+        self.screen_height = vim.current.window.height
+        self.screen_top = len(self.buffer) - vim.current.window.height + 1
+        if self.screen_top < 1:
+            self.screen_top = 1
+
+
+        # align bottom of buffer to bottom of screen
+        vim.command('normal ' + str(self.screen_height) + 'kG')
+
+        # return new relative line number
+        return (real_line - self.screen_top)
+    # }}}
+
+    def scroll_to_bottom(self): # {{{
+        vim.current.window.cursor = (len(self.buffer) - 1, 1)
+    # }}}
+        
+    def align(self): # {{{
+        # align bottom of buffer to bottom of screen
+        vim.command('normal ' + str(self.screen_height) + 'kG')
+    # }}}
+
+
+EOF
+
+endif
+
diff --git a/vim/autoload/delimitMate.vim b/vim/autoload/delimitMate.vim
new file mode 100644 (file)
index 0000000..bd10975
--- /dev/null
@@ -0,0 +1,586 @@
+" File:        autoload/delimitMate.vim
+" Version:     2.6
+" Modified:    2011-01-14
+" Description: This plugin provides auto-completion for quotes, parens, etc.
+" Maintainer:  Israel Chauca F. <israelchauca@gmail.com>
+" Manual:      Read ":help delimitMate".
+" ============================================================================
+
+" Utilities {{{
+
+let delimitMate_loaded = 1
+
+function! delimitMate#ShouldJump() "{{{
+       " Returns 1 if the next character is a closing delimiter.
+       let col = col('.')
+       let lcol = col('$')
+       let char = getline('.')[col - 1]
+
+       " Closing delimiter on the right.
+       for cdel in b:_l_delimitMate_right_delims + b:_l_delimitMate_quotes_list
+               if char == cdel
+                       return 1
+               endif
+       endfor
+
+       " Closing delimiter with space expansion.
+       let nchar = getline('.')[col]
+       if b:_l_delimitMate_expand_space && char == " "
+               for cdel in b:_l_delimitMate_right_delims + b:_l_delimitMate_quotes_list
+                       if nchar == cdel
+                               return 1
+                       endif
+               endfor
+       endif
+
+       " Closing delimiter with CR expansion.
+       let uchar = getline(line('.') + 1)[0]
+       if b:_l_delimitMate_expand_cr && char == ""
+               for cdel in b:_l_delimitMate_right_delims + b:_l_delimitMate_quotes_list
+                       if uchar == cdel
+                               return 1
+                       endif
+               endfor
+       endif
+
+       return 0
+endfunction "}}}
+
+function! delimitMate#IsEmptyPair(str) "{{{
+       for pair in b:_l_delimitMate_matchpairs_list
+               if a:str == join( split( pair, ':' ),'' )
+                       return 1
+               endif
+       endfor
+       for quote in b:_l_delimitMate_quotes_list
+               if a:str == quote . quote
+                       return 1
+               endif
+       endfor
+       return 0
+endfunction "}}}
+
+function! delimitMate#IsCRExpansion() " {{{
+       let nchar = getline(line('.')-1)[-1:]
+       let schar = getline(line('.')+1)[:0]
+       let isEmpty = getline('.') == ""
+       if index(b:_l_delimitMate_left_delims, nchar) > -1 &&
+                               \ index(b:_l_delimitMate_left_delims, nchar) == index(b:_l_delimitMate_right_delims, schar) &&
+                               \ isEmpty
+               return 1
+       elseif index(b:_l_delimitMate_quotes_list, nchar) > -1 &&
+                               \ index(b:_l_delimitMate_quotes_list, nchar) == index(b:_l_delimitMate_quotes_list, schar) &&
+                               \ isEmpty
+               return 1
+       else
+               return 0
+       endif
+endfunction " }}} delimitMate#IsCRExpansion()
+
+function! delimitMate#IsSpaceExpansion() " {{{
+       let line = getline('.')
+       let col = col('.')-2
+       if col > 0
+               let pchar = line[col - 1]
+               let nchar = line[col + 2]
+               let isSpaces = (line[col] == line[col+1] && line[col] == " ")
+
+               if index(b:_l_delimitMate_left_delims, pchar) > -1 &&
+                               \ index(b:_l_delimitMate_left_delims, pchar) == index(b:_l_delimitMate_right_delims, nchar) &&
+                               \ isSpaces
+                       return 1
+               elseif index(b:_l_delimitMate_quotes_list, pchar) > -1 &&
+                               \ index(b:_l_delimitMate_quotes_list, pchar) == index(b:_l_delimitMate_quotes_list, nchar) &&
+                               \ isSpaces
+                       return 1
+               endif
+       endif
+       return 0
+endfunction " }}} IsSpaceExpansion()
+
+function! delimitMate#WithinEmptyPair() "{{{
+       let cur = strpart( getline('.'), col('.')-2, 2 )
+       return delimitMate#IsEmptyPair( cur )
+endfunction "}}}
+
+function! delimitMate#WriteBefore(str) "{{{
+       let len = len(a:str)
+       let line = getline('.')
+       let col = col('.')-2
+       if col < 0
+               call setline('.',line[(col+len+1):])
+       else
+               call setline('.',line[:(col)].line[(col+len+1):])
+       endif
+       return a:str
+endfunction " }}}
+
+function! delimitMate#WriteAfter(str) "{{{
+       let len = len(a:str)
+       let line = getline('.')
+       let col = col('.')-2
+       if (col) < 0
+               call setline('.',a:str.line)
+       else
+               call setline('.',line[:(col)].a:str.line[(col+len):])
+       endif
+       return ''
+endfunction " }}}
+
+function! delimitMate#GetSyntaxRegion(line, col) "{{{
+       return synIDattr(synIDtrans(synID(a:line, a:col, 1)), 'name')
+endfunction " }}}
+
+function! delimitMate#GetCurrentSyntaxRegion() "{{{
+       let col = col('.')
+       if  col == col('$')
+               let col = col - 1
+       endif
+       return delimitMate#GetSyntaxRegion(line('.'), col)
+endfunction " }}}
+
+function! delimitMate#GetCurrentSyntaxRegionIf(char) "{{{
+       let col = col('.')
+       let origin_line = getline('.')
+       let changed_line = strpart(origin_line, 0, col - 1) . a:char . strpart(origin_line, col - 1)
+       call setline('.', changed_line)
+       let region = delimitMate#GetSyntaxRegion(line('.'), col)
+       call setline('.', origin_line)
+       return region
+endfunction "}}}
+
+function! delimitMate#IsForbidden(char) "{{{
+       if b:_l_delimitMate_excluded_regions_enabled == 0
+               return 0
+       endif
+       "let result = index(b:_l_delimitMate_excluded_regions_list, delimitMate#GetCurrentSyntaxRegion()) >= 0
+       if index(b:_l_delimitMate_excluded_regions_list, delimitMate#GetCurrentSyntaxRegion()) >= 0
+               "echom "Forbidden 1!"
+               return 1
+       endif
+       let region = delimitMate#GetCurrentSyntaxRegionIf(a:char)
+       "let result = index(b:_l_delimitMate_excluded_regions_list, region) >= 0
+       "return result || region == 'Comment'
+       "echom "Forbidden 2!"
+       return index(b:_l_delimitMate_excluded_regions_list, region) >= 0
+endfunction "}}}
+
+function! delimitMate#FlushBuffer() " {{{
+       let b:_l_delimitMate_buffer = []
+       return ''
+endfunction " }}}
+
+function! delimitMate#BalancedParens(char) "{{{
+       " Returns:
+       " = 0 => Parens balanced.
+       " > 0 => More opening parens.
+       " < 0 => More closing parens.
+
+       let line = getline('.')
+       let col = col('.') - 2
+       let col = col >= 0 ? col : 0
+       let list = split(line, '\zs')
+       let left = b:_l_delimitMate_left_delims[index(b:_l_delimitMate_right_delims, a:char)]
+       let right = a:char
+       let opening = 0
+       let closing = 0
+
+       " If the cursor is not at the beginning, count what's behind it.
+       if col > 0
+                 " Find the first opening paren:
+                 let start = index(list, left)
+                 " Must be before cursor:
+                 let start = start < col ? start : col - 1
+                 " Now count from the first opening until the cursor, this will prevent
+                 " extra closing parens from being counted.
+                 let opening = count(list[start : col - 1], left)
+                 let closing = count(list[start : col - 1], right)
+                 " I don't care if there are more closing parens than opening parens.
+                 let closing = closing > opening ? opening : closing
+       endif
+
+       " Evaluate parens from the cursor to the end:
+       let opening += count(list[col :], left)
+       let closing += count(list[col :], right)
+
+       "echom "โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“"
+       "echom line
+       "echom col
+       ""echom left.":".a:char
+       "echom string(list)
+       "echom string(list[start : col - 1]) . " : " . string(list[col :])
+       "echom opening . " - " . closing . " = " . (opening - closing)
+
+       " Return the found balance:
+       return opening - closing
+endfunction "}}}
+
+function! delimitMate#RmBuffer(num) " {{{
+       if len(b:_l_delimitMate_buffer) > 0
+          call remove(b:_l_delimitMate_buffer, 0, (a:num-1))
+       endif
+       return ""
+endfunction " }}}
+
+" }}}
+
+" Doers {{{
+function! delimitMate#SkipDelim(char) "{{{
+       if delimitMate#IsForbidden(a:char)
+               return a:char
+       endif
+       let col = col('.') - 1
+       let line = getline('.')
+       if col > 0
+               let cur = line[col]
+               let pre = line[col-1]
+       else
+               let cur = line[col]
+               let pre = ""
+       endif
+       if pre == "\\"
+               " Escaped character
+               return a:char
+       elseif cur == a:char
+               " Exit pair
+               "return delimitMate#WriteBefore(a:char)
+               return a:char . delimitMate#Del()
+       elseif delimitMate#IsEmptyPair( pre . a:char )
+               " Add closing delimiter and jump back to the middle.
+               call insert(b:_l_delimitMate_buffer, a:char)
+               return delimitMate#WriteAfter(a:char)
+       else
+               " Nothing special here, return the same character.
+               return a:char
+       endif
+endfunction "}}}
+
+function! delimitMate#ParenDelim(char) " {{{
+       if delimitMate#IsForbidden(a:char)
+               return ''
+       endif
+       " Try to balance matchpairs
+       if b:_l_delimitMate_balance_matchpairs &&
+                               \ delimitMate#BalancedParens(a:char) <= 0
+               return ''
+       endif
+       let line = getline('.')
+       let col = col('.')-2
+       let left = b:_l_delimitMate_left_delims[index(b:_l_delimitMate_right_delims,a:char)]
+       let smart_matchpairs = substitute(b:_l_delimitMate_smart_matchpairs, '\\!', left, 'g')
+       let smart_matchpairs = substitute(smart_matchpairs, '\\#', a:char, 'g')
+       "echom left.':'.smart_matchpairs . ':' . matchstr(line[col+1], smart_matchpairs)
+       if b:_l_delimitMate_smart_matchpairs != '' &&
+                               \ line[col+1:] =~ smart_matchpairs
+               return ''
+       elseif (col) < 0
+               call setline('.',a:char.line)
+               call insert(b:_l_delimitMate_buffer, a:char)
+       else
+               "echom string(col).':'.line[:(col)].'|'.line[(col+1):]
+               call setline('.',line[:(col)].a:char.line[(col+1):])
+               call insert(b:_l_delimitMate_buffer, a:char)
+       endif
+       return ''
+endfunction " }}}
+
+function! delimitMate#QuoteDelim(char) "{{{
+       if delimitMate#IsForbidden(a:char)
+               return a:char
+       endif
+       let line = getline('.')
+       let col = col('.') - 2
+       if line[col] == "\\"
+               " Seems like a escaped character, insert one quotation mark.
+               return a:char
+       elseif line[col + 1] == a:char &&
+                               \ index(b:_l_delimitMate_nesting_quotes, a:char) < 0
+               " Get out of the string.
+               return a:char . delimitMate#Del()
+       elseif (line[col] =~ '\w' && a:char == "'") ||
+                               \ (b:_l_delimitMate_smart_quotes &&
+                               \ (line[col] =~ '\w' ||
+                               \ line[col + 1] =~ '\w'))
+               " Seems like an apostrophe or a smart quote case, insert a single quote.
+               return a:char
+       elseif (line[col] == a:char && line[col + 1 ] != a:char) && b:_l_delimitMate_smart_quotes
+               " Seems like we have an unbalanced quote, insert one quotation mark and jump to the middle.
+               call insert(b:_l_delimitMate_buffer, a:char)
+               return delimitMate#WriteAfter(a:char)
+       else
+               " Insert a pair and jump to the middle.
+               call insert(b:_l_delimitMate_buffer, a:char)
+               call delimitMate#WriteAfter(a:char)
+               return a:char
+       endif
+endfunction "}}}
+
+function! delimitMate#JumpOut(char) "{{{
+       if delimitMate#IsForbidden(a:char)
+               return a:char
+       endif
+       let line = getline('.')
+       let col = col('.')-2
+       if line[col+1] == a:char
+               return a:char . delimitMate#Del()
+       else
+               return a:char
+       endif
+endfunction " }}}
+
+function! delimitMate#JumpAny(key) " {{{
+       if delimitMate#IsForbidden('')
+               return a:key
+       endif
+       if !delimitMate#ShouldJump()
+               return a:key
+       endif
+       " Let's get the character on the right.
+       let char = getline('.')[col('.')-1]
+       if char == " "
+               " Space expansion.
+               "let char = char . getline('.')[col('.')] . delimitMate#Del()
+               return char . getline('.')[col('.')] . delimitMate#Del() . delimitMate#Del()
+               "call delimitMate#RmBuffer(1)
+       elseif char == ""
+               " CR expansion.
+               "let char = "\<CR>" . getline(line('.') + 1)[0] . "\<Del>"
+               let b:_l_delimitMate_buffer = []
+               return "\<CR>" . getline(line('.') + 1)[0] . "\<Del>"
+       else
+               "call delimitMate#RmBuffer(1)
+               return char . delimitMate#Del()
+       endif
+endfunction " delimitMate#JumpAny() }}}
+
+function! delimitMate#JumpMany() " {{{
+       let line = getline('.')[col('.') - 1 : ]
+       let len = len(line)
+       let rights = ""
+       let found = 0
+       let i = 0
+       while i < len
+               let char = line[i]
+               if index(b:_l_delimitMate_quotes_list, char) >= 0 ||
+                                       \ index(b:_l_delimitMate_right_delims, char) >= 0
+                       let rights .= "\<Right>"
+                       let found = 1
+               elseif found == 0
+                       let rights .= "\<Right>"
+               else
+                       break
+               endif
+               let i += 1
+       endwhile
+       if found == 1
+               return rights
+       else
+               return ''
+       endif
+endfunction " delimitMate#JumpMany() }}}
+
+function! delimitMate#ExpandReturn() "{{{
+       if delimitMate#IsForbidden("")
+               return "\<CR>"
+       endif
+       if delimitMate#WithinEmptyPair()
+               " Expand:
+               call delimitMate#FlushBuffer()
+               "return "\<Esc>a\<CR>x\<CR>\<Esc>k$\"_xa"
+               return "\<CR>\<UP>\<Esc>o"
+       else
+               return "\<CR>"
+       endif
+endfunction "}}}
+
+function! delimitMate#ExpandSpace() "{{{
+       if delimitMate#IsForbidden("\<Space>")
+               return "\<Space>"
+       endif
+       if delimitMate#WithinEmptyPair()
+               " Expand:
+               call insert(b:_l_delimitMate_buffer, 's')
+               return delimitMate#WriteAfter(' ') . "\<Space>"
+       else
+               return "\<Space>"
+       endif
+endfunction "}}}
+
+function! delimitMate#BS() " {{{
+       if delimitMate#IsForbidden("")
+               return "\<BS>"
+       endif
+       if delimitMate#WithinEmptyPair()
+               "call delimitMate#RmBuffer(1)
+               return "\<BS>" . delimitMate#Del()
+"        return "\<Right>\<BS>\<BS>"
+       elseif delimitMate#IsSpaceExpansion()
+               "call delimitMate#RmBuffer(1)
+               return "\<BS>" . delimitMate#Del()
+       elseif delimitMate#IsCRExpansion()
+               return "\<BS>\<Del>"
+       else
+               return "\<BS>"
+       endif
+endfunction " }}} delimitMate#BS()
+
+function! delimitMate#Del() " {{{
+       if len(b:_l_delimitMate_buffer) > 0
+               let line = getline('.')
+               let col = col('.') - 2
+               call delimitMate#RmBuffer(1)
+               call setline('.', line[:col] . line[col+2:])
+               return ''
+       else
+               return "\<Del>"
+       endif
+endfunction " }}}
+
+function! delimitMate#Finish(move_back) " {{{
+       let len = len(b:_l_delimitMate_buffer)
+       if len > 0
+               let buffer = join(b:_l_delimitMate_buffer, '')
+               let len2 = len(buffer)
+               " Reset buffer:
+               let b:_l_delimitMate_buffer = []
+               let line = getline('.')
+               let col = col('.') -2
+               "echom 'col: ' . col . '-' . line[:col] . "|" . line[col+len+1:] . '%' . buffer
+               if col < 0
+                       call setline('.', line[col+len2+1:])
+               else
+                       call setline('.', line[:col] . line[col+len2+1:])
+               endif
+               let i = 1
+               let lefts = ""
+               while i <= len && a:move_back
+                       let lefts = lefts . "\<Left>"
+                       let i += 1
+               endwhile
+               return substitute(buffer, "s", "\<Space>", 'g') . lefts
+       endif
+       return ''
+endfunction " }}}
+
+" }}}
+
+" Tools: {{{
+function! delimitMate#TestMappings() "{{{
+       let options = sort(keys(delimitMate#OptionsList()))
+       let optoutput = ['delimitMate Report', '==================', '', '* Options: ( ) default, (g) global, (b) buffer','']
+       for option in options
+               exec 'call add(optoutput, ''('.(exists('b:delimitMate_'.option) ? 'b' : exists('g:delimitMate_'.option) ? 'g' : ' ').') delimitMate_''.option.'' = ''.string(b:_l_delimitMate_'.option.'))'
+       endfor
+       call append(line('$'), optoutput + ['--------------------',''])
+
+       " Check if mappings were set. {{{
+       let imaps = b:_l_delimitMate_right_delims
+       let imaps = imaps + ( b:_l_delimitMate_autoclose ? b:_l_delimitMate_left_delims : [] )
+       let imaps = imaps +
+                               \ b:_l_delimitMate_quotes_list +
+                               \ b:_l_delimitMate_apostrophes_list +
+                               \ ['<BS>', '<S-BS>', '<Del>', '<S-Tab>', '<Esc>'] +
+                               \ ['<Up>', '<Down>', '<Left>', '<Right>', '<LeftMouse>', '<RightMouse>'] +
+                               \ ['<Home>', '<End>', '<PageUp>', '<PageDown>', '<S-Down>', '<S-Up>', '<C-G>g']
+       let imaps = imaps + ( b:_l_delimitMate_expand_cr ?  ['<CR>'] : [] )
+       let imaps = imaps + ( b:_l_delimitMate_expand_space ?  ['<Space>'] : [] )
+
+       let vmaps =
+                               \ b:_l_delimitMate_right_delims +
+                               \ b:_l_delimitMate_left_delims +
+                               \ b:_l_delimitMate_quotes_list
+
+       let ibroken = []
+       for map in imaps
+               if maparg(map, "i") !~? 'delimitMate'
+                       let output = ''
+                       if map == '|'
+                               let map = '<Bar>'
+                       endif
+                       redir => output | execute "verbose imap ".map | redir END
+                       let ibroken = ibroken + [map.": is not set:"] + split(output, '\n')
+               endif
+       endfor
+
+       unlet! output
+       if ibroken == []
+               let output = ['* Mappings:', '', 'All mappings were set-up.', '--------------------', '', '']
+       else
+               let output = ['* Mappings:', ''] + ibroken + ['--------------------', '']
+       endif
+       call append('$', output+['* Showcase:', ''])
+       " }}}
+       if b:_l_delimitMate_autoclose
+               " {{{
+               for i in range(len(b:_l_delimitMate_left_delims))
+                       exec "normal Go0\<C-D>Open: " . b:_l_delimitMate_left_delims[i]. "|"
+                       exec "normal o0\<C-D>Delete: " . b:_l_delimitMate_left_delims[i] . "\<BS>|"
+                       exec "normal o0\<C-D>Exit: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . "|"
+                       if b:_l_delimitMate_expand_space == 1
+                               exec "normal o0\<C-D>Space: " . b:_l_delimitMate_left_delims[i] . " |"
+                               exec "normal o0\<C-D>Delete space: " . b:_l_delimitMate_left_delims[i] . " \<BS>|"
+                       endif
+                       if b:_l_delimitMate_expand_cr == 1
+                               exec "normal o0\<C-D>Car return: " . b:_l_delimitMate_left_delims[i] . "\<CR>|"
+                               exec "normal Go0\<C-D>Delete car return: " . b:_l_delimitMate_left_delims[i] . "\<CR>0\<C-D>\<BS>|"
+                       endif
+                       call append(line('$'), '')
+               endfor
+               for i in range(len(b:_l_delimitMate_quotes_list))
+                       exec "normal Go0\<C-D>Open: " . b:_l_delimitMate_quotes_list[i] . "|"
+                       exec "normal o0\<C-D>Delete: " . b:_l_delimitMate_quotes_list[i] . "\<BS>|"
+                       exec "normal o0\<C-D>Exit: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "|"
+                       if b:_l_delimitMate_expand_space == 1
+                               exec "normal o0\<C-D>Space: " . b:_l_delimitMate_quotes_list[i] . " |"
+                               exec "normal o0\<C-D>Delete space: " . b:_l_delimitMate_quotes_list[i] . " \<BS>|"
+                       endif
+                       if b:_l_delimitMate_expand_cr == 1
+                               exec "normal o0\<C-D>Car return: " . b:_l_delimitMate_quotes_list[i] . "\<CR>|"
+                               exec "normal Go0\<C-D>Delete car return: " . b:_l_delimitMate_quotes_list[i] . "\<CR>\<BS>|"
+                       endif
+                       call append(line('$'), '')
+               endfor
+               "}}}
+       else
+               "{{{
+               for i in range(len(b:_l_delimitMate_left_delims))
+                       exec "normal GoOpen & close: " . b:_l_delimitMate_left_delims[i]        . b:_l_delimitMate_right_delims[i] . "|"
+                       exec "normal oDelete: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . "\<BS>|"
+                       exec "normal oExit: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . b:_l_delimitMate_right_delims[i] . "|"
+                       if b:_l_delimitMate_expand_space == 1
+                               exec "normal oSpace: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . " |"
+                               exec "normal oDelete space: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . " \<BS>|"
+                       endif
+                       if b:_l_delimitMate_expand_cr == 1
+                               exec "normal oCar return: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . "\<CR>|"
+                               exec "normal GoDelete car return: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . "\<CR>\<BS>|"
+                       endif
+                       call append(line('$'), '')
+               endfor
+               for i in range(len(b:_l_delimitMate_quotes_list))
+                       exec "normal GoOpen & close: " . b:_l_delimitMate_quotes_list[i]        . b:_l_delimitMate_quotes_list[i] . "|"
+                       exec "normal oDelete: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "\<BS>|"
+                       exec "normal oExit: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "|"
+                       if b:_l_delimitMate_expand_space == 1
+                               exec "normal oSpace: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . " |"
+                               exec "normal oDelete space: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . " \<BS>|"
+                       endif
+                       if b:_l_delimitMate_expand_cr == 1
+                               exec "normal oCar return: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "\<CR>|"
+                               exec "normal GoDelete car return: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "\<CR>\<BS>|"
+                       endif
+                       call append(line('$'), '')
+               endfor
+       endif "}}}
+       redir => setoptions | set | filetype | redir END
+       call append(line('$'), split(setoptions,"\n")
+                               \ + ['--------------------'])
+       setlocal nowrap
+endfunction "}}}
+
+function! delimitMate#OptionsList() "{{{
+       return {'autoclose' : 1,'matchpairs': &matchpairs, 'quotes' : '" '' `', 'nesting_quotes' : [], 'expand_cr' : 0, 'expand_space' : 0, 'smart_quotes' : 1, 'smart_matchpairs' : '\w', 'balance_matchpairs' : 0, 'excluded_regions' : 'Comment', 'excluded_ft' : '', 'apostrophes' : ''}
+endfunction " delimitMate#OptionsList }}}
+"}}}
+
+" vim:foldmethod=marker:foldcolumn=4
diff --git a/vim/autoload/pathogen.vim b/vim/autoload/pathogen.vim
new file mode 100644 (file)
index 0000000..4071992
--- /dev/null
@@ -0,0 +1,250 @@
+" pathogen.vim - path option manipulation
+" Maintainer:   Tim Pope <http://tpo.pe/>
+" Version:      2.0
+
+" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
+"
+" For management of individually installed plugins in ~/.vim/bundle (or
+" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc
+" prior to `filetype plugin indent on` is the only other setup necessary.
+"
+" The API is documented inline below.  For maximum ease of reading,
+" :set foldmethod=marker
+
+if exists("g:loaded_pathogen") || &cp
+  finish
+endif
+let g:loaded_pathogen = 1
+
+" Point of entry for basic default usage.  Give a directory name to invoke
+" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path
+" to invoke pathogen#runtime_prepend_subdirectories().  Afterwards,
+" pathogen#cycle_filetype() is invoked.
+function! pathogen#infect(...) abort " {{{1
+  let source_path = a:0 ? a:1 : 'bundle'
+  if source_path =~# '[\\/]'
+    call pathogen#runtime_prepend_subdirectories(source_path)
+  else
+    call pathogen#runtime_append_all_bundles(source_path)
+  endif
+  call pathogen#cycle_filetype()
+endfunction " }}}1
+
+" Split a path into a list.
+function! pathogen#split(path) abort " {{{1
+  if type(a:path) == type([]) | return a:path | endif
+  let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+  return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction " }}}1
+
+" Convert a list to a path.
+function! pathogen#join(...) abort " {{{1
+  if type(a:1) == type(1) && a:1
+    let i = 1
+    let space = ' '
+  else
+    let i = 0
+    let space = ''
+  endif
+  let path = ""
+  while i < a:0
+    if type(a:000[i]) == type([])
+      let list = a:000[i]
+      let j = 0
+      while j < len(list)
+        let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+        let path .= ',' . escaped
+        let j += 1
+      endwhile
+    else
+      let path .= "," . a:000[i]
+    endif
+    let i += 1
+  endwhile
+  return substitute(path,'^,','','')
+endfunction " }}}1
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort " {{{1
+  return call('pathogen#join',[1] + a:000)
+endfunction " }}}1
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort " {{{1
+  let i = 0
+  let seen = {}
+  while i < len(a:list)
+    if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
+      call remove(a:list,i)
+    elseif a:list[i] ==# ''
+      let i += 1
+      let empty = 1
+    else
+      let seen[a:list[i]] = 1
+      let i += 1
+    endif
+  endwhile
+  return a:list
+endfunction " }}}1
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#separator() abort " {{{1
+  return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction " }}}1
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort " {{{1
+  let files = split(glob(a:pattern),"\n")
+  return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
+endfunction "}}}1
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort " {{{1
+  return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction "}}}1
+
+" Turn filetype detection off and back on again if it was already enabled.
+function! pathogen#cycle_filetype() " {{{1
+  if exists('g:did_load_filetypes')
+    filetype off
+    filetype on
+  endif
+endfunction " }}}1
+
+" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
+" its 'basename()' is included in g:pathogen_disabled[]' or ends in a tilde.
+function! pathogen#is_disabled(path) " {{{1
+  if a:path =~# '\~$'
+    return 1
+  elseif !exists("g:pathogen_disabled")
+    return 0
+  endif
+  let sep = pathogen#separator()
+  return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
+endfunction "}}}1
+
+" Prepend all subdirectories of path to the rtp, and append all 'after'
+" directories in those subdirectories.
+function! pathogen#runtime_prepend_subdirectories(path) " {{{1
+  let sep    = pathogen#separator()
+  let before = filter(pathogen#glob_directories(a:path.sep."*"), '!pathogen#is_disabled(v:val)')
+  let after  = filter(pathogen#glob_directories(a:path.sep."*".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
+  let rtp = pathogen#split(&rtp)
+  let path = expand(a:path)
+  call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
+  let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
+  return &rtp
+endfunction " }}}1
+
+" For each directory in rtp, check for a subdirectory named dir.  If it
+" exists, add all subdirectories of that subdirectory to the rtp, immediately
+" after the original directory.  If no argument is given, 'bundle' is used.
+" Repeated calls with the same arguments are ignored.
+function! pathogen#runtime_append_all_bundles(...) " {{{1
+  let sep = pathogen#separator()
+  let name = a:0 ? a:1 : 'bundle'
+  if "\n".s:done_bundles =~# "\\M\n".name."\n"
+    return ""
+  endif
+  let s:done_bundles .= name . "\n"
+  let list = []
+  for dir in pathogen#split(&rtp)
+    if dir =~# '\<after$'
+      let list +=  filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
+    else
+      let list +=  [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
+    endif
+  endfor
+  let &rtp = pathogen#join(pathogen#uniq(list))
+  return 1
+endfunction
+
+let s:done_bundles = ''
+" }}}1
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() " {{{1
+  let sep = pathogen#separator()
+  for dir in pathogen#split(&rtp)
+    if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
+      helptags `=dir.'/doc'`
+    endif
+  endfor
+endfunction " }}}1
+
+command! -bar Helptags :call pathogen#helptags()
+
+" Like findfile(), but hardcoded to use the runtimepath.
+function! pathogen#runtime_findfile(file,count) "{{{1
+  let rtp = pathogen#join(1,pathogen#split(&rtp))
+  let file = findfile(a:file,rtp,a:count)
+  if file ==# ''
+    return ''
+  else
+    return fnamemodify(file,':p')
+  endif
+endfunction " }}}1
+
+" Backport of fnameescape().
+function! pathogen#fnameescape(string) " {{{1
+  if exists('*fnameescape')
+    return fnameescape(a:string)
+  elseif a:string ==# '-'
+    return '\-'
+  else
+    return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
+  endif
+endfunction " }}}1
+
+function! s:find(count,cmd,file,lcd) " {{{1
+  let rtp = pathogen#join(1,pathogen#split(&runtimepath))
+  let file = pathogen#runtime_findfile(a:file,a:count)
+  if file ==# ''
+    return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
+  elseif a:lcd
+    let path = file[0:-strlen(a:file)-2]
+    execute 'lcd `=path`'
+    return a:cmd.' '.pathogen#fnameescape(a:file)
+  else
+    return a:cmd.' '.pathogen#fnameescape(file)
+  endif
+endfunction " }}}1
+
+function! s:Findcomplete(A,L,P) " {{{1
+  let sep = pathogen#separator()
+  let cheats = {
+        \'a': 'autoload',
+        \'d': 'doc',
+        \'f': 'ftplugin',
+        \'i': 'indent',
+        \'p': 'plugin',
+        \'s': 'syntax'}
+  if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
+    let request = cheats[a:A[0]].a:A[1:-1]
+  else
+    let request = a:A
+  endif
+  let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
+  let found = {}
+  for path in pathogen#split(&runtimepath)
+    let path = expand(path, ':p')
+    let matches = split(glob(path.sep.pattern),"\n")
+    call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
+    call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
+    for match in matches
+      let found[match] = 1
+    endfor
+  endfor
+  return sort(keys(found))
+endfunction " }}}1
+
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve       :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit    :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen    :execute s:find(<count>,'edit<bang>',<q-args>,1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit   :execute s:find(<count>,'split',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit  :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit   :execute s:find(<count>,'pedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread    :execute s:find(<count>,'read',<q-args>,<bang>1)
+
+" vim:set ft=vim ts=8 sw=2 sts=2:
diff --git a/vim/autoload/rails.vim b/vim/autoload/rails.vim
new file mode 100644 (file)
index 0000000..ca36075
--- /dev/null
@@ -0,0 +1,4560 @@
+" autoload/rails.vim
+" Author:       Tim Pope <http://tpo.pe/>
+
+" Install this file as autoload/rails.vim.
+
+if exists('g:autoloaded_rails') || &cp
+  finish
+endif
+let g:autoloaded_rails = '4.4'
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Utility Functions {{{1
+
+let s:app_prototype = {}
+let s:file_prototype = {}
+let s:buffer_prototype = {}
+let s:readable_prototype = {}
+
+function! s:add_methods(namespace, method_names)
+  for name in a:method_names
+    let s:{a:namespace}_prototype[name] = s:function('s:'.a:namespace.'_'.name)
+  endfor
+endfunction
+
+function! s:function(name)
+    return function(substitute(a:name,'^s:',matchstr(expand('<sfile>'), '<SNR>\d\+_'),''))
+endfunction
+
+function! s:sub(str,pat,rep)
+  return substitute(a:str,'\v\C'.a:pat,a:rep,'')
+endfunction
+
+function! s:gsub(str,pat,rep)
+  return substitute(a:str,'\v\C'.a:pat,a:rep,'g')
+endfunction
+
+function! s:startswith(string,prefix)
+  return strpart(a:string, 0, strlen(a:prefix)) ==# a:prefix
+endfunction
+
+function! s:compact(ary)
+  return s:sub(s:sub(s:gsub(a:ary,'\n\n+','\n'),'\n$',''),'^\n','')
+endfunction
+
+function! s:uniq(list)
+  let seen = {}
+  let i = 0
+  while i < len(a:list)
+    if has_key(seen,a:list[i])
+      call remove(a:list, i)
+    else
+      let seen[a:list[i]] = 1
+      let i += 1
+    endif
+  endwhile
+  return a:list
+endfunction
+
+function! s:scrub(collection,item)
+  " Removes item from a newline separated collection
+  let col = "\n" . a:collection
+  let idx = stridx(col,"\n".a:item."\n")
+  let cnt = 0
+  while idx != -1 && cnt < 100
+    let col = strpart(col,0,idx).strpart(col,idx+strlen(a:item)+1)
+    let idx = stridx(col,"\n".a:item."\n")
+    let cnt += 1
+  endwhile
+  return strpart(col,1)
+endfunction
+
+function! s:escarg(p)
+  return s:gsub(a:p,'[ !%#]','\\&')
+endfunction
+
+function! s:esccmd(p)
+  return s:gsub(a:p,'[!%#]','\\&')
+endfunction
+
+function! s:rquote(str)
+  " Imperfect but adequate for Ruby arguments
+  if a:str =~ '^[A-Za-z0-9_/.:-]\+$'
+    return a:str
+  elseif &shell =~? 'cmd'
+    return '"'.s:gsub(s:gsub(a:str,'\','\\'),'"','\\"').'"'
+  else
+    return "'".s:gsub(s:gsub(a:str,'\','\\'),"'","'\\\\''")."'"
+  endif
+endfunction
+
+function! s:sname()
+  return fnamemodify(s:file,':t:r')
+endfunction
+
+function! s:pop_command()
+  if exists("s:command_stack") && len(s:command_stack) > 0
+    exe remove(s:command_stack,-1)
+  endif
+endfunction
+
+function! s:push_chdir(...)
+  if !exists("s:command_stack") | let s:command_stack = [] | endif
+  if exists("b:rails_root") && (a:0 ? getcwd() !=# rails#app().path() : !s:startswith(getcwd(), rails#app().path()))
+    let chdir = exists("*haslocaldir") && haslocaldir() ? "lchdir " : "chdir "
+    call add(s:command_stack,chdir.s:escarg(getcwd()))
+    exe chdir.s:escarg(rails#app().path())
+  else
+    call add(s:command_stack,"")
+  endif
+endfunction
+
+function! s:app_path(...) dict
+  return join([self.root]+a:000,'/')
+endfunction
+
+function! s:app_has_file(file) dict
+  return filereadable(self.path(a:file))
+endfunction
+
+function! s:app_find_file(name, ...) dict abort
+  let trim = strlen(self.path())+1
+  if a:0
+    let path = s:pathjoin(map(s:pathsplit(a:1),'self.path(v:val)'))
+  else
+    let path = s:pathjoin([self.path()])
+  endif
+  let suffixesadd = s:pathjoin(get(a:000,1,&suffixesadd))
+  let default = get(a:000,2,'')
+  let oldsuffixesadd = &l:suffixesadd
+  try
+    let &suffixesadd = suffixesadd
+    " Versions before 7.1.256 returned directories from findfile
+    if type(default) == type(0) && (v:version < 702 || default == -1)
+      let all = findfile(a:name,path,-1)
+      if v:version < 702
+        call filter(all,'!isdirectory(v:val)')
+      endif
+      call map(all,'s:gsub(strpart(fnamemodify(v:val,":p"),trim),"\\\\","/")')
+      return default < 0 ? all : get(all,default-1,'')
+    elseif type(default) == type(0)
+      let found = findfile(a:name,path,default)
+    else
+      let i = 1
+      let found = findfile(a:name,path)
+      while v:version < 702 && found != "" && isdirectory(found)
+        let i += 1
+        let found = findfile(a:name,path,i)
+      endwhile
+    endif
+    return found == "" ? default : s:gsub(strpart(fnamemodify(found,':p'),trim),'\\','/')
+  finally
+    let &l:suffixesadd = oldsuffixesadd
+  endtry
+endfunction
+
+call s:add_methods('app',['path','has_file','find_file'])
+
+" Split a path into a list.  From pathogen.vim
+function! s:pathsplit(path) abort
+  if type(a:path) == type([]) | return copy(a:path) | endif
+  let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+  return map(split,'substitute(v:val,''\\\([\\, ]\)'',''\1'',"g")')
+endfunction
+
+" Convert a list to a path.  From pathogen.vim
+function! s:pathjoin(...) abort
+  let i = 0
+  let path = ""
+  while i < a:0
+    if type(a:000[i]) == type([])
+      let list = a:000[i]
+      let j = 0
+      while j < len(list)
+        let escaped = substitute(list[j],'[\\, ]','\\&','g')
+        if exists("+shellslash") && !&shellslash
+          let escaped = substitute(escaped,'^\(\w:\\\)\\','\1','')
+        endif
+        let path .= ',' . escaped
+        let j += 1
+      endwhile
+    else
+      let path .= "," . a:000[i]
+    endif
+    let i += 1
+  endwhile
+  return substitute(path,'^,','','')
+endfunction
+
+function! s:readable_end_of(lnum) dict abort
+  if a:lnum == 0
+    return 0
+  endif
+  if self.name() =~# '\.yml$'
+    return -1
+  endif
+  let cline = self.getline(a:lnum)
+  let spc = matchstr(cline,'^\s*')
+  let endpat = '\<end\>'
+  if matchstr(self.getline(a:lnum+1),'^'.spc) && !matchstr(self.getline(a:lnum+1),'^'.spc.endpat) && matchstr(cline,endpat)
+    return a:lnum
+  endif
+  let endl = a:lnum
+  while endl <= self.line_count()
+    let endl += 1
+    if self.getline(endl) =~ '^'.spc.endpat
+      return endl
+    elseif self.getline(endl) =~ '^=begin\>'
+      while self.getline(endl) !~ '^=end\>' && endl <= self.line_count()
+        let endl += 1
+      endwhile
+      let endl += 1
+    elseif self.getline(endl) !~ '^'.spc && self.getline(endl) !~ '^\s*\%(#.*\)\=$'
+      return 0
+    endif
+  endwhile
+  return 0
+endfunction
+
+function! s:endof(lnum)
+  return rails#buffer().end_of(a:lnum)
+endfunction
+
+function! s:readable_last_opening_line(start,pattern,limit) dict abort
+  let line = a:start
+  while line > a:limit && self.getline(line) !~ a:pattern
+    let line -= 1
+  endwhile
+  let lend = self.end_of(line)
+  if line > a:limit && (lend < 0 || lend >= a:start)
+    return line
+  else
+    return -1
+  endif
+endfunction
+
+function! s:lastopeningline(pattern,limit,start)
+  return rails#buffer().last_opening_line(a:start,a:pattern,a:limit)
+endfunction
+
+function! s:readable_define_pattern() dict abort
+  if self.name() =~ '\.yml$'
+    return '^\%(\h\k*:\)\@='
+  endif
+  let define = '^\s*def\s\+\(self\.\)\='
+  if self.name() =~# '\.rake$'
+    let define .= "\\\|^\\s*\\%(task\\\|file\\)\\s\\+[:'\"]"
+  endif
+  if self.name() =~# '/schema\.rb$'
+    let define .= "\\\|^\\s*create_table\\s\\+[:'\"]"
+  endif
+  if self.type_name('test')
+    let define .= '\|^\s*test\s*[''"]'
+  endif
+  return define
+endfunction
+
+function! s:readable_last_method_line(start) dict abort
+  return self.last_opening_line(a:start,self.define_pattern(),0)
+endfunction
+
+function! s:lastmethodline(start)
+  return rails#buffer().last_method_line(a:start)
+endfunction
+
+function! s:readable_last_method(start) dict abort
+  let lnum = self.last_method_line(a:start)
+  let line = self.getline(lnum)
+  if line =~# '^\s*test\s*\([''"]\).*\1'
+    let string = matchstr(line,'^\s*\w\+\s*\([''"]\)\zs.*\ze\1')
+    return 'test_'.s:gsub(string,' +','_')
+  elseif lnum
+    return s:sub(matchstr(line,'\%('.self.define_pattern().'\)\zs\h\%(\k\|[:.]\)*[?!=]\='),':$','')
+  else
+    return ""
+  endif
+endfunction
+
+function! s:lastmethod(...)
+  return rails#buffer().last_method(a:0 ? a:1 : line("."))
+endfunction
+
+function! s:readable_last_format(start) dict abort
+  if self.type_name('view')
+    let format = fnamemodify(self.path(),':r:e')
+    if format == ''
+      return get({'rhtml': 'html', 'rxml': 'xml', 'rjs': 'js', 'haml': 'html'},fnamemodify(self.path(),':e'),'')
+    else
+      return format
+    endif
+  endif
+  let rline = self.last_opening_line(a:start,'\C^\s*\%(mail\>.*\|respond_to\)\s*\%(\<do\|{\)\s*|\zs\h\k*\ze|',self.last_method_line(a:start))
+  if rline
+    let variable = matchstr(self.getline(rline),'\C^\s*\%(mail\>.*\|respond_to\)\s*\%(\<do\|{\)\s*|\zs\h\k*\ze|')
+    let line = a:start
+    while line > rline
+      let match = matchstr(self.getline(line),'\C^\s*'.variable.'\s*\.\s*\zs\h\k*')
+      if match != ''
+        return match
+      endif
+      let line -= 1
+    endwhile
+  endif
+  return ""
+endfunction
+
+function! s:lastformat(start)
+  return rails#buffer().last_format(a:start)
+endfunction
+
+function! s:format(...)
+  let format = rails#buffer().last_format(a:0 > 1 ? a:2 : line("."))
+  return format ==# '' && a:0 ? a:1 : format
+endfunction
+
+call s:add_methods('readable',['end_of','last_opening_line','last_method_line','last_method','last_format','define_pattern'])
+
+let s:view_types = split('rhtml,erb,rxml,builder,rjs,mab,liquid,haml,dryml,mn,slim',',')
+
+function! s:viewspattern()
+  return '\%('.join(s:view_types,'\|').'\)'
+endfunction
+
+function! s:controller(...)
+  return rails#buffer().controller_name(a:0 ? a:1 : 0)
+endfunction
+
+function! s:readable_controller_name(...) dict abort
+  let f = self.name()
+  if has_key(self,'getvar') && self.getvar('rails_controller') != ''
+    return self.getvar('rails_controller')
+  elseif f =~ '\<app/views/layouts/'
+    return s:sub(f,'.*<app/views/layouts/(.{-})\..*','\1')
+  elseif f =~ '\<app/views/'
+    return s:sub(f,'.*<app/views/(.{-})/\k+\.\k+%(\.\k+)=$','\1')
+  elseif f =~ '\<app/helpers/.*_helper\.rb$'
+    return s:sub(f,'.*<app/helpers/(.{-})_helper\.rb$','\1')
+  elseif f =~ '\<app/controllers/.*\.rb$'
+    return s:sub(f,'.*<app/controllers/(.{-})%(_controller)=\.rb$','\1')
+  elseif f =~ '\<app/mailers/.*\.rb$'
+    return s:sub(f,'.*<app/mailers/(.{-})\.rb$','\1')
+  elseif f =~ '\<app/apis/.*_api\.rb$'
+    return s:sub(f,'.*<app/apis/(.{-})_api\.rb$','\1')
+  elseif f =~ '\<test/functional/.*_test\.rb$'
+    return s:sub(f,'.*<test/functional/(.{-})%(_controller)=_test\.rb$','\1')
+  elseif f =~ '\<test/unit/helpers/.*_helper_test\.rb$'
+    return s:sub(f,'.*<test/unit/helpers/(.{-})_helper_test\.rb$','\1')
+  elseif f =~ '\<spec/controllers/.*_spec\.rb$'
+    return s:sub(f,'.*<spec/controllers/(.{-})%(_controller)=_spec\.rb$','\1')
+  elseif f =~ '\<spec/helpers/.*_helper_spec\.rb$'
+    return s:sub(f,'.*<spec/helpers/(.{-})_helper_spec\.rb$','\1')
+  elseif f =~ '\<spec/views/.*/\w\+_view_spec\.rb$'
+    return s:sub(f,'.*<spec/views/(.{-})/\w+_view_spec\.rb$','\1')
+  elseif f =~ '\<components/.*_controller\.rb$'
+    return s:sub(f,'.*<components/(.{-})_controller\.rb$','\1')
+  elseif f =~ '\<components/.*\.'.s:viewspattern().'$'
+    return s:sub(f,'.*<components/(.{-})/\k+\.\k+$','\1')
+  elseif f =~ '\<app/models/.*\.rb$' && self.type_name('mailer')
+    return s:sub(f,'.*<app/models/(.{-})\.rb$','\1')
+  elseif f =~ '\<\%(public\|app/assets\)/stylesheets/.*\.css\%(\.\w\+\)\=$'
+    return s:sub(f,'.*<%(public|app/assets)/stylesheets/(.{-})\.css%(\.\w+)=$','\1')
+  elseif f =~ '\<\%(public\|app/assets\)/javascripts/.*\.js\%(\.\w\+\)\=$'
+    return s:sub(f,'.*<%(public|app/assets)/javascripts/(.{-})\.js%(\.\w+)=$','\1')
+  elseif a:0 && a:1
+    return rails#pluralize(self.model_name())
+  endif
+  return ""
+endfunction
+
+function! s:model(...)
+  return rails#buffer().model_name(a:0 ? a:1 : 0)
+endfunction
+
+function! s:readable_model_name(...) dict abort
+  let f = self.name()
+  if has_key(self,'getvar') && self.getvar('rails_model') != ''
+    return self.getvar('rails_model')
+  elseif f =~ '\<app/models/.*_observer.rb$'
+    return s:sub(f,'.*<app/models/(.*)_observer\.rb$','\1')
+  elseif f =~ '\<app/models/.*\.rb$'
+    return s:sub(f,'.*<app/models/(.*)\.rb$','\1')
+  elseif f =~ '\<test/unit/.*_observer_test\.rb$'
+    return s:sub(f,'.*<test/unit/(.*)_observer_test\.rb$','\1')
+  elseif f =~ '\<test/unit/.*_test\.rb$'
+    return s:sub(f,'.*<test/unit/(.*)_test\.rb$','\1')
+  elseif f =~ '\<spec/models/.*_spec\.rb$'
+    return s:sub(f,'.*<spec/models/(.*)_spec\.rb$','\1')
+  elseif f =~ '\<\%(test\|spec\)/fixtures/.*\.\w*\~\=$'
+    return rails#singularize(s:sub(f,'.*<%(test|spec)/fixtures/(.*)\.\w*\~=$','\1'))
+  elseif f =~ '\<\%(test\|spec\)/blueprints/.*\.rb$'
+    return s:sub(f,'.*<%(test|spec)/blueprints/(.{-})%(_blueprint)=\.rb$','\1')
+  elseif f =~ '\<\%(test\|spec\)/exemplars/.*_exemplar\.rb$'
+    return s:sub(f,'.*<%(test|spec)/exemplars/(.*)_exemplar\.rb$','\1')
+  elseif f =~ '\<\%(test/\|spec/\)\=factories/.*\.rb$'
+    return s:sub(f,'.*<%(test/|spec/)=factories/(.{-})%(_factory)=\.rb$','\1')
+  elseif f =~ '\<\%(test/\|spec/\)\=fabricators/.*\.rb$'
+    return s:sub(f,'.*<%(test/|spec/)=fabricators/(.{-})%(_fabricator)=\.rb$','\1')
+  elseif a:0 && a:1
+    return rails#singularize(self.controller_name())
+  endif
+  return ""
+endfunction
+
+call s:add_methods('readable',['controller_name','model_name'])
+
+function! s:readfile(path,...)
+  let nr = bufnr('^'.a:path.'$')
+  if nr < 0 && exists('+shellslash') && ! &shellslash
+    let nr = bufnr('^'.s:gsub(a:path,'/','\\').'$')
+  endif
+  if bufloaded(nr)
+    return getbufline(nr,1,a:0 ? a:1 : '$')
+  elseif !filereadable(a:path)
+    return []
+  elseif a:0
+    return readfile(a:path,'',a:1)
+  else
+    return readfile(a:path)
+  endif
+endfunction
+
+function! s:file_lines() dict abort
+  let ftime = getftime(self.path)
+  if ftime > get(self,last_lines_ftime,0)
+    let self.last_lines = readfile(self.path())
+    let self.last_lines_ftime = ftime
+  endif
+  return get(self,'last_lines',[])
+endfunction
+
+function! s:file_getline(lnum,...) dict abort
+  if a:0
+    return self.lines[lnum-1 : a:1-1]
+  else
+    return self.lines[lnum-1]
+  endif
+endfunction
+
+function! s:buffer_lines() dict abort
+  return self.getline(1,'$')
+endfunction
+
+function! s:buffer_getline(...) dict abort
+  if a:0 == 1
+    return get(call('getbufline',[self.number()]+a:000),0,'')
+  else
+    return call('getbufline',[self.number()]+a:000)
+  endif
+endfunction
+
+function! s:readable_line_count() dict abort
+  return len(self.lines())
+endfunction
+
+function! s:environment()
+  if exists('$RAILS_ENV')
+    return $RAILS_ENV
+  else
+    return "development"
+  endif
+endfunction
+
+function! s:Complete_environments(...)
+  return s:completion_filter(rails#app().environments(),a:0 ? a:1 : "")
+endfunction
+
+function! s:warn(str)
+  echohl WarningMsg
+  echomsg a:str
+  echohl None
+  " Sometimes required to flush output
+  echo ""
+  let v:warningmsg = a:str
+endfunction
+
+function! s:error(str)
+  echohl ErrorMsg
+  echomsg a:str
+  echohl None
+  let v:errmsg = a:str
+endfunction
+
+function! s:debug(str)
+  if exists("g:rails_debug") && g:rails_debug
+    echohl Debug
+    echomsg a:str
+    echohl None
+  endif
+endfunction
+
+function! s:buffer_getvar(varname) dict abort
+  return getbufvar(self.number(),a:varname)
+endfunction
+
+function! s:buffer_setvar(varname, val) dict abort
+  return setbufvar(self.number(),a:varname,a:val)
+endfunction
+
+call s:add_methods('buffer',['getvar','setvar'])
+
+" }}}1
+" "Public" Interface {{{1
+
+" RailsRoot() is the only official public function
+
+function! rails#underscore(str)
+  let str = s:gsub(a:str,'::','/')
+  let str = s:gsub(str,'(\u+)(\u\l)','\1_\2')
+  let str = s:gsub(str,'(\l|\d)(\u)','\1_\2')
+  let str = tolower(str)
+  return str
+endfunction
+
+function! rails#camelize(str)
+  let str = s:gsub(a:str,'/(.=)','::\u\1')
+  let str = s:gsub(str,'%([_-]|<)(.)','\u\1')
+  return str
+endfunction
+
+function! rails#singularize(word)
+  " Probably not worth it to be as comprehensive as Rails but we can
+  " still hit the common cases.
+  let word = a:word
+  if word =~? '\.js$' || word == ''
+    return word
+  endif
+  let word = s:sub(word,'eople$','ersons')
+  let word = s:sub(word,'%([Mm]ov|[aeio])@<!ies$','ys')
+  let word = s:sub(word,'xe[ns]$','xs')
+  let word = s:sub(word,'ves$','fs')
+  let word = s:sub(word,'ss%(es)=$','sss')
+  let word = s:sub(word,'s$','')
+  let word = s:sub(word,'%([nrt]ch|tatus|lias)\zse$','')
+  let word = s:sub(word,'%(nd|rt)\zsice$','ex')
+  return word
+endfunction
+
+function! rails#pluralize(word)
+  let word = a:word
+  if word == ''
+    return word
+  endif
+  let word = s:sub(word,'[aeio]@<!y$','ie')
+  let word = s:sub(word,'%(nd|rt)@<=ex$','ice')
+  let word = s:sub(word,'%([osxz]|[cs]h)$','&e')
+  let word = s:sub(word,'f@<!f$','ve')
+  let word .= 's'
+  let word = s:sub(word,'ersons$','eople')
+  return word
+endfunction
+
+function! rails#app(...)
+  let root = a:0 ? a:1 : RailsRoot()
+  " TODO: populate dynamically
+  " TODO: normalize path
+  return get(s:apps,root,0)
+endfunction
+
+function! rails#buffer(...)
+  return extend(extend({'#': bufnr(a:0 ? a:1 : '%')},s:buffer_prototype,'keep'),s:readable_prototype,'keep')
+  endif
+endfunction
+
+function! s:buffer_app() dict abort
+  if self.getvar('rails_root') != ''
+    return rails#app(self.getvar('rails_root'))
+  else
+    return 0
+  endif
+endfunction
+
+function! s:readable_app() dict abort
+  return self._app
+endfunction
+
+function! RailsRevision()
+  return 1000*matchstr(g:autoloaded_rails,'^\d\+')+matchstr(g:autoloaded_rails,'[1-9]\d*$')
+endfunction
+
+function! RailsRoot()
+  if exists("b:rails_root")
+    return b:rails_root
+  else
+    return ""
+  endif
+endfunction
+
+function! s:app_file(name)
+  return extend(extend({'_app': self, '_name': a:name}, s:file_prototype,'keep'),s:readable_prototype,'keep')
+endfunction
+
+function! s:file_path() dict abort
+  return self.app().path(self._name)
+endfunction
+
+function! s:file_name() dict abort
+  return self._name
+endfunction
+
+function! s:buffer_number() dict abort
+  return self['#']
+endfunction
+
+function! s:buffer_path() dict abort
+  return s:gsub(fnamemodify(bufname(self.number()),':p'),'\\ @!','/')
+endfunction
+
+function! s:buffer_name() dict abort
+  let app = self.app()
+  let f = s:gsub(resolve(fnamemodify(bufname(self.number()),':p')),'\\ @!','/')
+  let f = s:sub(f,'/$','')
+  let sep = matchstr(f,'^[^\\/]\{3,\}\zs[\\/]')
+  if sep != ""
+    let f = getcwd().sep.f
+  endif
+  if s:startswith(tolower(f),s:gsub(tolower(app.path()),'\\ @!','/')) || f == ""
+    return strpart(f,strlen(app.path())+1)
+  else
+    if !exists("s:path_warn")
+      let s:path_warn = 1
+      call s:warn("File ".f." does not appear to be under the Rails root ".self.app().path().". Please report to the rails.vim author!")
+    endif
+    return f
+  endif
+endfunction
+
+function! RailsFilePath()
+  if !exists("b:rails_root")
+    return ""
+  else
+    return rails#buffer().name()
+  endif
+endfunction
+
+function! RailsFile()
+  return RailsFilePath()
+endfunction
+
+function! RailsFileType()
+  if !exists("b:rails_root")
+    return ""
+  else
+    return rails#buffer().type_name()
+  end
+endfunction
+
+function! s:readable_calculate_file_type() dict abort
+  let f = self.name()
+  let e = fnamemodify(f,':e')
+  let r = "-"
+  let full_path = self.path()
+  let nr = bufnr('^'.full_path.'$')
+  if nr < 0 && exists('+shellslash') && ! &shellslash
+    let nr = bufnr('^'.s:gsub(full_path,'/','\\').'$')
+  endif
+  if f == ""
+    let r = f
+  elseif nr > 0 && getbufvar(nr,'rails_file_type') != ''
+    return getbufvar(nr,'rails_file_type')
+  elseif f =~ '_controller\.rb$' || f =~ '\<app/controllers/.*\.rb$'
+    if join(s:readfile(full_path,50),"\n") =~ '\<wsdl_service_name\>'
+      let r = "controller-api"
+    else
+      let r = "controller"
+    endif
+  elseif f =~ '_api\.rb'
+    let r = "api"
+  elseif f =~ '\<test/test_helper\.rb$'
+    let r = "test"
+  elseif f =~ '\<spec/spec_helper\.rb$'
+    let r = "spec"
+  elseif f =~ '_helper\.rb$'
+    let r = "helper"
+  elseif f =~ '\<app/metal/.*\.rb$'
+    let r = "metal"
+  elseif f =~ '\<app/mailers/.*\.rb'
+    let r = "mailer"
+  elseif f =~ '\<app/models/'
+    let top = join(s:readfile(full_path,50),"\n")
+    let class = matchstr(top,'\<Acti\w\w\u\w\+\%(::\h\w*\)\+\>')
+    if class == "ActiveResource::Base"
+      let class = "ares"
+      let r = "model-ares"
+    elseif class == 'ActionMailer::Base'
+      let r = "mailer"
+    elseif class != ''
+      let class = tolower(s:gsub(class,'[^A-Z]',''))
+      let r = "model-".class
+    elseif f =~ '_mailer\.rb$'
+      let r = "mailer"
+    elseif top =~ '\<\%(validates_\w\+_of\|set_\%(table_name\|primary_key\)\|has_one\|has_many\|belongs_to\)\>'
+      let r = "model-arb"
+    else
+      let r = "model"
+    endif
+  elseif f =~ '\<app/views/layouts\>.*\.'
+    let r = "view-layout-" . e
+  elseif f =~ '\<\%(app/views\|components\)/.*/_\k\+\.\k\+\%(\.\k\+\)\=$'
+    let r = "view-partial-" . e
+  elseif f =~ '\<app/views\>.*\.' || f =~ '\<components/.*/.*\.'.s:viewspattern().'$'
+    let r = "view-" . e
+  elseif f =~ '\<test/unit/.*_test\.rb$'
+    let r = "test-unit"
+  elseif f =~ '\<test/functional/.*_test\.rb$'
+    let r = "test-functional"
+  elseif f =~ '\<test/integration/.*_test\.rb$'
+    let r = "test-integration"
+  elseif f =~ '\<spec/lib/.*_spec\.rb$'
+    let r = 'spec-lib'
+  elseif f =~ '\<lib/.*\.rb$'
+    let r = 'lib'
+  elseif f =~ '\<spec/\w*s/.*_spec\.rb$'
+    let r = s:sub(f,'.*<spec/(\w*)s/.*','spec-\1')
+  elseif f =~ '\<features/.*\.feature$'
+    let r = 'cucumber-feature'
+  elseif f =~ '\<features/step_definitions/.*_steps\.rb$'
+    let r = 'cucumber-steps'
+  elseif f =~ '\<features/.*\.rb$'
+    let r = 'cucumber'
+  elseif f =~ '\<\%(test\|spec\)/fixtures\>'
+    if e == "yml"
+      let r = "fixtures-yaml"
+    else
+      let r = "fixtures" . (e == "" ? "" : "-" . e)
+    endif
+  elseif f =~ '\<test/.*_test\.rb'
+    let r = "test"
+  elseif f =~ '\<spec/.*_spec\.rb'
+    let r = "spec"
+  elseif f =~ '\<spec/support/.*\.rb'
+    let r = "spec"
+  elseif f =~ '\<db/migrate\>'
+    let r = "db-migration"
+  elseif f=~ '\<db/schema\.rb$'
+    let r = "db-schema"
+  elseif f =~ '\<vendor/plugins/.*/recipes/.*\.rb$' || f =~ '\.rake$' || f =~ '\<\%(Rake\|Cap\)file$' || f =~ '\<config/deploy\.rb$'
+    let r = "task"
+  elseif f =~ '\<log/.*\.log$'
+    let r = "log"
+  elseif e == "css" || e =~ "s[ac]ss" || e == "less"
+    let r = "stylesheet-".e
+  elseif e == "js"
+    let r = "javascript"
+  elseif e == "coffee"
+    let r = "javascript-coffee"
+  elseif e == "html"
+    let r = e
+  elseif f =~ '\<config/routes\>.*\.rb$'
+    let r = "config-routes"
+  elseif f =~ '\<config/'
+    let r = "config"
+  endif
+  return r
+endfunction
+
+function! s:buffer_type_name(...) dict abort
+  let type = getbufvar(self.number(),'rails_cached_file_type')
+  if type == ''
+    let type = self.calculate_file_type()
+  endif
+  return call('s:match_type',[type == '-' ? '' : type] + a:000)
+endfunction
+
+function! s:readable_type_name() dict abort
+  let type = self.calculate_file_type()
+  return call('s:match_type',[type == '-' ? '' : type] + a:000)
+endfunction
+
+function! s:match_type(type,...)
+  if a:0
+    return !empty(filter(copy(a:000),'a:type =~# "^".v:val."\\%(-\\|$\\)"'))
+  else
+    return a:type
+  endif
+endfunction
+
+function! s:app_environments() dict
+  if self.cache.needs('environments')
+    call self.cache.set('environments',self.relglob('config/environments/','**/*','.rb'))
+  endif
+  return copy(self.cache.get('environments'))
+endfunction
+
+function! s:app_default_locale() dict abort
+  if self.cache.needs('default_locale')
+    let candidates = map(filter(s:readfile(self.path('config/environment.rb')),'v:val =~ "^ *config.i18n.default_locale = :[\"'']\\=[A-Za-z-]\\+[\"'']\\= *$"'),'matchstr(v:val,"[A-Za-z-]\\+[\"'']\\= *$")')
+    call self.cache.set('default_locale',get(candidates,0,'en'))
+  endif
+  return self.cache.get('default_locale')
+endfunction
+
+function! s:app_has(feature) dict
+  let map = {
+        \'test': 'test/',
+        \'spec': 'spec/',
+        \'cucumber': 'features/',
+        \'sass': 'public/stylesheets/sass/',
+        \'lesscss': 'app/stylesheets/',
+        \'coffee': 'app/scripts/'}
+  if self.cache.needs('features')
+    call self.cache.set('features',{})
+  endif
+  let features = self.cache.get('features')
+  if !has_key(features,a:feature)
+    let path = get(map,a:feature,a:feature.'/')
+    let features[a:feature] = isdirectory(rails#app().path(path))
+  endif
+  return features[a:feature]
+endfunction
+
+" Returns the subset of ['test', 'spec', 'cucumber'] present on the app.
+function! s:app_test_suites() dict
+  return filter(['test','spec','cucumber'],'self.has(v:val)')
+endfunction
+
+call s:add_methods('app',['default_locale','environments','file','has','test_suites'])
+call s:add_methods('file',['path','name','lines','getline'])
+call s:add_methods('buffer',['app','number','path','name','lines','getline','type_name'])
+call s:add_methods('readable',['app','calculate_file_type','type_name','line_count'])
+
+" }}}1
+" Ruby Execution {{{1
+
+function! s:app_ruby_shell_command(cmd) dict abort
+  if self.path() =~ '://'
+    return "ruby ".a:cmd
+  else
+    return "ruby -C ".s:rquote(self.path())." ".a:cmd
+  endif
+endfunction
+
+function! s:app_script_shell_command(cmd) dict abort
+  if self.has_file('script/rails') && a:cmd !~# '^rails\>'
+    let cmd = 'script/rails '.a:cmd
+  else
+    let cmd = 'script/'.a:cmd
+  endif
+  return self.ruby_shell_command(cmd)
+endfunction
+
+function! s:app_background_script_command(cmd) dict abort
+  let cmd = s:esccmd(self.script_shell_command(a:cmd))
+  if has_key(self,'options') && has_key(self.options,'gnu_screen')
+    let screen = self.options.gnu_screen
+  else
+    let screen = g:rails_gnu_screen
+  endif
+  if has("gui_win32")
+    if &shellcmdflag == "-c" && ($PATH . &shell) =~? 'cygwin'
+      silent exe "!cygstart -d ".s:rquote(self.path())." ruby ".a:cmd
+    else
+      exe "!start ".cmd
+    endif
+  elseif exists("$STY") && !has("gui_running") && screen && executable("screen")
+    silent exe "!screen -ln -fn -t ".s:sub(s:sub(a:cmd,'\s.*',''),'^%(script|-rcommand)/','rails-').' '.cmd
+  elseif exists("$TMUX") && !has("gui_running") && screen && executable("tmux")
+    silent exe '!tmux new-window -d -n "'.s:sub(s:sub(a:cmd,'\s.*',''),'^%(script|-rcommand)/','rails-').'" "'.cmd.'"'
+  else
+    exe "!".cmd
+  endif
+  return v:shell_error
+endfunction
+
+function! s:app_execute_script_command(cmd) dict abort
+  exe '!'.s:esccmd(self.script_shell_command(a:cmd))
+  return v:shell_error
+endfunction
+
+function! s:app_lightweight_ruby_eval(ruby,...) dict abort
+  let def = a:0 ? a:1 : ""
+  if !executable("ruby")
+    return def
+  endif
+  let args = '-e '.s:rquote('begin; require %{rubygems}; rescue LoadError; end; begin; require %{active_support}; rescue LoadError; end; '.a:ruby)
+  let cmd = self.ruby_shell_command(args)
+  " If the shell is messed up, this command could cause an error message
+  silent! let results = system(cmd)
+  return v:shell_error == 0 ? results : def
+endfunction
+
+function! s:app_eval(ruby,...) dict abort
+  let def = a:0 ? a:1 : ""
+  if !executable("ruby")
+    return def
+  endif
+  let args = "-r./config/boot -r ".s:rquote(self.path("config/environment"))." -e ".s:rquote(a:ruby)
+  let cmd = self.ruby_shell_command(args)
+  " If the shell is messed up, this command could cause an error message
+  silent! let results = system(cmd)
+  return v:shell_error == 0 ? results : def
+endfunction
+
+call s:add_methods('app', ['ruby_shell_command','script_shell_command','execute_script_command','background_script_command','lightweight_ruby_eval','eval'])
+
+" }}}1
+" Commands {{{1
+
+function! s:prephelp()
+  let fn = fnamemodify(s:file,':h:h').'/doc/'
+  if filereadable(fn.'rails.txt')
+    if !filereadable(fn.'tags') || getftime(fn.'tags') <= getftime(fn.'rails.txt')
+      silent! helptags `=fn`
+    endif
+  endif
+endfunction
+
+function! RailsHelpCommand(...)
+  call s:prephelp()
+  let topic = a:0 ? a:1 : ""
+  if topic == "" || topic == "-"
+    return "help rails"
+  elseif topic =~ '^g:'
+    return "help ".topic
+  elseif topic =~ '^-'
+    return "help rails".topic
+  else
+    return "help rails-".topic
+  endif
+endfunction
+
+function! s:BufCommands()
+  call s:BufFinderCommands()
+  call s:BufNavCommands()
+  call s:BufScriptWrappers()
+  command! -buffer -bar -nargs=? -bang -count -complete=customlist,s:Complete_rake    Rake     :call s:Rake(<bang>0,!<count> && <line1> ? -1 : <count>,<q-args>)
+  command! -buffer -bar -nargs=? -bang -range -complete=customlist,s:Complete_preview Rpreview :call s:Preview(<bang>0,<line1>,<q-args>)
+  command! -buffer -bar -nargs=? -bang -complete=customlist,s:Complete_environments   Rlog     :call s:Log(<bang>0,<q-args>)
+  command! -buffer -bar -nargs=* -bang -complete=customlist,s:Complete_set            Rset     :call s:Set(<bang>0,<f-args>)
+  command! -buffer -bar -nargs=0 Rtags       :call rails#app().tags_command()
+  " Embedding all this logic directly into the command makes the error
+  " messages more concise.
+  command! -buffer -bar -nargs=? -bang Rdoc  :
+        \ if <bang>0 || <q-args> =~ "^\\([:'-]\\|g:\\)" |
+        \   exe RailsHelpCommand(<q-args>) |
+        \ else | call s:Doc(<bang>0,<q-args>) | endif
+  command! -buffer -bar -nargs=0 -bang Rrefresh :if <bang>0|unlet! g:autoloaded_rails|source `=s:file`|endif|call s:Refresh(<bang>0)
+  if exists(":NERDTree")
+    command! -buffer -bar -nargs=? -complete=customlist,s:Complete_cd Rtree :NERDTree `=rails#app().path(<f-args>)`
+  endif
+  if exists("g:loaded_dbext")
+    command! -buffer -bar -nargs=? -complete=customlist,s:Complete_environments Rdbext  :call s:BufDatabase(2,<q-args>)|let b:dbext_buffer_defaulted = 1
+  endif
+  let ext = expand("%:e")
+  if ext =~ s:viewspattern()
+    " TODO: complete controller names with trailing slashes here
+    command! -buffer -bar -bang -nargs=? -range -complete=customlist,s:controllerList Rextract :<line1>,<line2>call s:Extract(<bang>0,<f-args>)
+  endif
+  if RailsFilePath() =~ '\<db/migrate/.*\.rb$'
+    command! -buffer -bar                 Rinvert  :call s:Invert(<bang>0)
+  endif
+endfunction
+
+function! s:Doc(bang, string)
+  if a:string != ""
+    if exists("g:rails_search_url")
+      let query = substitute(a:string,'[^A-Za-z0-9_.~-]','\="%".printf("%02X",char2nr(submatch(0)))','g')
+      let url = printf(g:rails_search_url, query)
+    else
+      return s:error("specify a g:rails_search_url with %s for a query placeholder")
+    endif
+  elseif isdirectory(rails#app().path("doc/api/classes"))
+    let url = rails#app().path("/doc/api/index.html")
+  elseif s:getpidfor("0.0.0.0","8808") > 0
+    let url = "http://localhost:8808"
+  else
+    let url = "http://api.rubyonrails.org"
+  endif
+  call s:initOpenURL()
+  if exists(":OpenURL")
+    exe "OpenURL ".s:escarg(url)
+  else
+    return s:error("No :OpenURL command found")
+  endif
+endfunction
+
+function! s:Log(bang,arg)
+  if a:arg == ""
+    let lf = "log/".s:environment().".log"
+  else
+    let lf = "log/".a:arg.".log"
+  endif
+  let size = getfsize(rails#app().path(lf))
+  if size >= 1048576
+    call s:warn("Log file is ".((size+512)/1024)."KB.  Consider :Rake log:clear")
+  endif
+  if a:bang
+    exe "cgetfile ".lf
+    clast
+  else
+    if exists(":Tail")
+      Tail  `=rails#app().path(lf)`
+    else
+      pedit `=rails#app().path(lf)`
+    endif
+  endif
+endfunction
+
+function! rails#new_app_command(bang,...)
+  if a:0 == 0
+    let msg = "rails.vim ".g:autoloaded_rails
+    if a:bang && exists('b:rails_root') && rails#buffer().type_name() == ''
+      echo msg." (Rails)"
+    elseif a:bang && exists('b:rails_root')
+      echo msg." (Rails-".rails#buffer().type_name().")"
+    elseif a:bang
+      echo msg
+    else
+      !rails
+    endif
+    return
+  endif
+  let args = map(copy(a:000),'expand(v:val)')
+  if a:bang
+    let args = ['--force'] + args
+  endif
+  exe '!rails '.join(map(copy(args),'s:rquote(v:val)'),' ')
+  for dir in args
+    if dir !~# '^-' && filereadable(dir.'/'.g:rails_default_file)
+      edit `=dir.'/'.g:rails_default_file`
+      return
+    endif
+  endfor
+endfunction
+
+function! s:app_tags_command() dict
+  if exists("g:Tlist_Ctags_Cmd")
+    let cmd = g:Tlist_Ctags_Cmd
+  elseif executable("exuberant-ctags")
+    let cmd = "exuberant-ctags"
+  elseif executable("ctags-exuberant")
+    let cmd = "ctags-exuberant"
+  elseif executable("ctags")
+    let cmd = "ctags"
+  elseif executable("ctags.exe")
+    let cmd = "ctags.exe"
+  else
+    return s:error("ctags not found")
+  endif
+  exe '!'.cmd.' -f '.s:escarg(self.path("tmp/tags")).' -R --langmap="ruby:+.rake.builder.rjs" '.g:rails_ctags_arguments.' '.s:escarg(self.path())
+endfunction
+
+call s:add_methods('app',['tags_command'])
+
+function! s:Refresh(bang)
+  if exists("g:rubycomplete_rails") && g:rubycomplete_rails && has("ruby") && exists('g:rubycomplete_completions')
+    silent! ruby ActiveRecord::Base.reset_subclasses if defined?(ActiveRecord)
+    silent! ruby if defined?(ActiveSupport::Dependencies); ActiveSupport::Dependencies.clear; elsif defined?(Dependencies); Dependencies.clear; end
+    if a:bang
+      silent! ruby ActiveRecord::Base.clear_reloadable_connections! if defined?(ActiveRecord)
+    endif
+  endif
+  call rails#app().cache.clear()
+  silent doautocmd User BufLeaveRails
+  if a:bang
+    for key in keys(s:apps)
+      if type(s:apps[key]) == type({})
+        call s:apps[key].cache.clear()
+      endif
+      call extend(s:apps[key],filter(copy(s:app_prototype),'type(v:val) == type(function("tr"))'),'force')
+    endfor
+  endif
+  let i = 1
+  let max = bufnr('$')
+  while i <= max
+    let rr = getbufvar(i,"rails_root")
+    if rr != ""
+      call setbufvar(i,"rails_refresh",1)
+    endif
+    let i += 1
+  endwhile
+  silent doautocmd User BufEnterRails
+endfunction
+
+function! s:RefreshBuffer()
+  if exists("b:rails_refresh") && b:rails_refresh
+    let oldroot = b:rails_root
+    unlet! b:rails_root
+    let b:rails_refresh = 0
+    call RailsBufInit(oldroot)
+    unlet! b:rails_refresh
+  endif
+endfunction
+
+" }}}1
+" Rake {{{1
+
+function! s:app_rake_tasks() dict
+  if self.cache.needs('rake_tasks')
+    call s:push_chdir()
+    try
+      let lines = split(system("rake -T"),"\n")
+    finally
+      call s:pop_command()
+    endtry
+    if v:shell_error != 0
+      return []
+    endif
+    call map(lines,'matchstr(v:val,"^rake\\s\\+\\zs\\S*")')
+    call filter(lines,'v:val != ""')
+    call self.cache.set('rake_tasks',lines)
+  endif
+  return self.cache.get('rake_tasks')
+endfunction
+
+call s:add_methods('app', ['rake_tasks'])
+
+let s:efm_backtrace='%D(in\ %f),'
+      \.'%\\s%#from\ %f:%l:%m,'
+      \.'%\\s%#from\ %f:%l:,'
+      \.'%\\s#{RAILS_ROOT}/%f:%l:\ %#%m,'
+      \.'%\\s%##\ %f:%l:%m,'
+      \.'%\\s%##\ %f:%l,'
+      \.'%\\s%#[%f:%l:\ %#%m,'
+      \.'%\\s%#%f:%l:\ %#%m,'
+      \.'%\\s%#%f:%l:,'
+      \.'%m\ [%f:%l]:'
+
+function! s:makewithruby(arg,bang,...)
+  let old_make = &makeprg
+  try
+    let &l:makeprg = rails#app().ruby_shell_command(a:arg)
+    exe 'make'.(a:bang ? '!' : '')
+    if !a:bang
+      cwindow
+    endif
+  finally
+    let &l:makeprg = old_make
+  endtry
+endfunction
+
+function! s:Rake(bang,lnum,arg)
+  let self = rails#app()
+  let lnum = a:lnum < 0 ? 0 : a:lnum
+  let old_makeprg = &l:makeprg
+  let old_errorformat = &l:errorformat
+  try
+    if exists('b:bundler_root') && b:bundler_root ==# rails#app().path()
+      let &l:makeprg = 'bundle exec rake'
+    else
+      let &l:makeprg = 'rake'
+    endif
+    let &l:errorformat = s:efm_backtrace
+    let arg = a:arg
+    if &filetype == "ruby" && arg == '' && g:rails_modelines
+      let mnum = s:lastmethodline(lnum)
+      let str = getline(mnum)."\n".getline(mnum+1)."\n".getline(mnum+2)."\n"
+      let pat = '\s\+\zs.\{-\}\ze\%(\n\|\s\s\|#{\@!\|$\)'
+      let mat = matchstr(str,'#\s*rake'.pat)
+      let mat = s:sub(mat,'\s+$','')
+      if mat != ""
+        let arg = mat
+      endif
+    endif
+    if arg == ''
+      let opt = s:getopt('task','bl')
+      if opt != ''
+        let arg = opt
+      else
+        let arg = rails#buffer().default_rake_task(lnum)
+      endif
+    endif
+    if !has_key(self,'options') | let self.options = {} | endif
+    if arg == '-'
+      let arg = get(self.options,'last_rake_task','')
+    endif
+    let self.options['last_rake_task'] = arg
+    let withrubyargs = '-r ./config/boot -r '.s:rquote(self.path('config/environment')).' -e "puts \%((in \#{Dir.getwd}))" '
+    if arg =~# '^notes\>'
+      let &l:errorformat = '%-P%f:,\ \ *\ [%*[\ ]%l]\ [%t%*[^]]] %m,\ \ *\ [%*[\ ]%l] %m,%-Q'
+      " %D to chdir is apparently incompatible with %P multiline messages
+      call s:push_chdir(1)
+      exe 'make! '.arg
+      call s:pop_command()
+      if !a:bang
+        cwindow
+      endif
+    elseif arg =~# '^\%(stats\|routes\|secret\|time:zones\|db:\%(charset\|collation\|fixtures:identify\>.*\|migrate:status\|version\)\)\%([: ]\|$\)'
+      let &l:errorformat = '%D(in\ %f),%+G%.%#'
+      exe 'make! '.arg
+      if !a:bang
+        copen
+      endif
+    elseif arg =~ '^preview\>'
+      exe (lnum == 0 ? '' : lnum).'R'.s:gsub(arg,':','/')
+    elseif arg =~ '^runner:'
+      let arg = s:sub(arg,'^runner:','')
+      let root = matchstr(arg,'%\%(:\w\)*')
+      let file = expand(root).matchstr(arg,'%\%(:\w\)*\zs.*')
+      if file =~ '#.*$'
+        let extra = " -- -n ".matchstr(file,'#\zs.*')
+        let file = s:sub(file,'#.*','')
+      else
+        let extra = ''
+      endif
+      if self.has_file(file) || self.has_file(file.'.rb')
+        call s:makewithruby(withrubyargs.'-r"'.file.'"'.extra,a:bang,file !~# '_\%(spec\|test\)\%(\.rb\)\=$')
+      else
+        call s:makewithruby(withrubyargs.'-e '.s:esccmd(s:rquote(arg)),a:bang)
+      endif
+    elseif arg == 'run' || arg == 'runner'
+      call s:makewithruby(withrubyargs.'-r"'.RailsFilePath().'"',a:bang,RailsFilePath() !~# '_\%(spec\|test\)\%(\.rb\)\=$')
+    elseif arg =~ '^run:'
+      let arg = s:sub(arg,'^run:','')
+      let arg = s:sub(arg,'^\%:h',expand('%:h'))
+      let arg = s:sub(arg,'^%(\%|$|#@=)',expand('%'))
+      let arg = s:sub(arg,'#(\w+[?!=]=)$',' -- -n\1')
+      call s:makewithruby(withrubyargs.'-r'.arg,a:bang,arg !~# '_\%(spec\|test\)\.rb$')
+    else
+      exe 'make! '.arg
+      if !a:bang
+        cwindow
+      endif
+    endif
+  finally
+    let &l:errorformat = old_errorformat
+    let &l:makeprg = old_makeprg
+  endtry
+endfunction
+
+function! s:readable_default_rake_task(lnum) dict abort
+  let app = self.app()
+  let lnum = a:lnum < 0 ? 0 : a:lnum
+  if self.getvar('&buftype') == 'quickfix'
+    return '-'
+  elseif self.getline(lnum) =~# '# rake '
+    return matchstr(self.getline(lnum),'\C# rake \zs.*')
+  elseif self.getline(self.last_method_line(lnum)-1) =~# '# rake '
+    return matchstr(self.getline(self.last_method_line(lnum)-1),'\C# rake \zs.*')
+  elseif self.getline(self.last_method_line(lnum)) =~# '# rake '
+    return matchstr(self.getline(self.last_method_line(lnum)),'\C# rake \zs.*')
+  elseif self.getline(1) =~# '# rake ' && !lnum
+    return matchstr(self.getline(1),'\C# rake \zs.*')
+  elseif self.type_name('config-routes')
+    return 'routes'
+  elseif self.type_name('fixtures-yaml') && lnum
+    return "db:fixtures:identify LABEL=".self.last_method(lnum)
+  elseif self.type_name('fixtures') && lnum == 0
+    return "db:fixtures:load FIXTURES=".s:sub(fnamemodify(self.name(),':r'),'^.{-}/fixtures/','')
+  elseif self.type_name('task')
+    let mnum = self.last_method_line(lnum)
+    let line = getline(mnum)
+    " We can't grab the namespace so only run tasks at the start of the line
+    if line =~# '^\%(task\|file\)\>'
+      return self.last_method(a:lnum)
+    else
+      return matchstr(self.getline(1),'\C# rake \zs.*')
+    endif
+  elseif self.type_name('spec')
+    if self.name() =~# '\<spec/spec_helper\.rb$'
+      return 'spec'
+    elseif lnum > 0
+      return 'spec SPEC="'.self.path().'":'.lnum
+    else
+      return 'spec SPEC="'.self.path().'"'
+    endif
+  elseif self.type_name('test')
+    let meth = self.last_method(lnum)
+    if meth =~ '^test_'
+      let call = " -n".meth.""
+    else
+      let call = ""
+    endif
+    if self.type_name('test-unit','test-functional','test-integration')
+      return s:sub(s:gsub(self.type_name(),'-',':'),'unit$|functional$','&s').' TEST="'.self.path().'"'.s:sub(call,'^ ',' TESTOPTS=')
+    elseif self.name() =~# '\<test/test_helper\.rb$'
+      return 'test'
+    else
+      return 'test:recent TEST="'.self.path().'"'.s:sub(call,'^ ',' TESTOPTS=')
+    endif
+  elseif self.type_name('db-migration')
+    let ver = matchstr(self.name(),'\<db/migrate/0*\zs\d*\ze_')
+    if ver != ""
+      let method = self.last_method(lnum)
+      if method == "down" || lnum == 1
+        return "db:migrate:down VERSION=".ver
+      elseif method == "up" || lnum == line('$')
+        return "db:migrate:up VERSION=".ver
+      elseif lnum > 0
+        return "db:migrate:down db:migrate:up VERSION=".ver
+      else
+        return "db:migrate VERSION=".ver
+      endif
+    else
+      return 'db:migrate'
+    endif
+  elseif self.name() =~# '\<db/seeds\.rb$'
+    return 'db:seed'
+  elseif self.type_name('controller') && lnum
+    let lm = self.last_method(lnum)
+    if lm != ''
+      " rake routes doesn't support ACTION... yet...
+      return 'routes CONTROLLER='.self.controller_name().' ACTION='.lm
+    else
+      return 'routes CONTROLLER='.self.controller_name()
+    endif
+  elseif app.has('spec') && self.name() =~# '^app/.*\.\w\+$' && app.has_file(s:sub(self.name(),'^app/(.*)\.\w\+$','spec/\1_spec.rb'))
+    return 'spec SPEC="'.fnamemodify(s:sub(self.name(),'<app/','spec/'),':p:r').'_spec.rb"'
+  elseif app.has('spec') && self.name() =~# '^app/.*\.\w\+$' && app.has_file(s:sub(self.name(),'^app/(.*)$','spec/\1_spec.rb'))
+    return 'spec SPEC="'.fnamemodify(s:sub(self.name(),'<app/','spec/'),':p').'_spec.rb"'
+  elseif self.type_name('model')
+    return 'test:units TEST="'.fnamemodify(s:sub(self.name(),'<app/models/','test/unit/'),':p:r').'_test.rb"'
+  elseif self.type_name('api','mailer')
+    return 'test:units TEST="'.fnamemodify(s:sub(self.name(),'<app/%(apis|mailers|models)/','test/functional/'),':p:r').'_test.rb"'
+  elseif self.type_name('helper')
+    return 'test:units TEST="'.fnamemodify(s:sub(self.name(),'<app/','test/unit/'),':p:r').'_test.rb"'
+  elseif self.type_name('controller','helper','view')
+    if self.name() =~ '\<app/' && s:controller() !~# '^\%(application\)\=$'
+      return 'test:functionals TEST="'.s:escarg(app.path('test/functional/'.s:controller().'_controller_test.rb')).'"'
+    else
+      return 'test:functionals'
+    endif
+  elseif self.type_name('cucumber-feature')
+    if lnum > 0
+      return 'cucumber FEATURE="'.self.path().'":'.lnum
+    else
+      return 'cucumber FEATURE="'.self.path().'"'
+    endif
+  elseif self.type_name('cucumber')
+    return 'cucumber'
+  else
+    return ''
+  endif
+endfunction
+
+function! s:Complete_rake(A,L,P)
+  return s:completion_filter(rails#app().rake_tasks(),a:A)
+endfunction
+
+call s:add_methods('readable',['default_rake_task'])
+
+" }}}1
+" Preview {{{1
+
+function! s:initOpenURL()
+  if !exists(":OpenURL")
+    if has("gui_mac") || has("gui_macvim") || exists("$SECURITYSESSIONID")
+      command -bar -nargs=1 OpenURL :!open <args>
+    elseif has("gui_win32")
+      command -bar -nargs=1 OpenURL :!start cmd /cstart /b <args>
+    elseif executable("sensible-browser")
+      command -bar -nargs=1 OpenURL :!sensible-browser <args>
+    endif
+  endif
+endfunction
+
+function! s:scanlineforuris(line)
+  let url = matchstr(a:line,"\\v\\C%(%(GET|PUT|POST|DELETE)\\s+|\\w+://[^/]*)/[^ \n\r\t<>\"]*[^] .,;\n\r\t<>\":]")
+  if url =~ '\C^\u\+\s\+'
+    let method = matchstr(url,'^\u\+')
+    let url = matchstr(url,'\s\+\zs.*')
+    if method !=? "GET"
+      let url .= (url =~ '?' ? '&' : '?') . '_method='.tolower(method)
+    endif
+  endif
+  if url != ""
+    return [url]
+  else
+    return []
+  endif
+endfunction
+
+function! s:readable_preview_urls(lnum) dict abort
+  let urls = []
+  let start = self.last_method_line(a:lnum) - 1
+  while start > 0 && self.getline(start) =~ '^\s*\%(\%(-\=\|<%\)#.*\)\=$'
+    let urls = s:scanlineforuris(self.getline(start)) + urls
+    let start -= 1
+  endwhile
+  let start = 1
+  while start < self.line_count() && self.getline(start) =~ '^\s*\%(\%(-\=\|<%\)#.*\)\=$'
+    let urls += s:scanlineforuris(self.getline(start))
+    let start += 1
+  endwhile
+  if has_key(self,'getvar') && self.getvar('rails_preview') != ''
+    let url += [self.getvar('rails_preview')]
+  end
+  if self.name() =~ '^public/stylesheets/sass/'
+    let urls = urls + [s:sub(s:sub(self.name(),'^public/stylesheets/sass/','/stylesheets/'),'\.s[ac]ss$','.css')]
+  elseif self.name() =~ '^public/'
+    let urls = urls + [s:sub(self.name(),'^public','')]
+  elseif self.name() =~ '^app/assets/stylesheets/'
+    let urls = urls + ['/assets/application.css']
+  elseif self.name() =~ '^app/assets/javascripts/'
+    let urls = urls + ['/assets/application.js']
+  elseif self.name() =~ '^app/stylesheets/'
+    let urls = urls + [s:sub(s:sub(self.name(),'^app/stylesheets/','/stylesheets/'),'\.less$','.css')]
+  elseif self.name() =~ '^app/scripts/'
+    let urls = urls + [s:sub(s:sub(self.name(),'^app/scripts/','/javascripts/'),'\.coffee$','.js')]
+  elseif self.controller_name() != '' && self.controller_name() != 'application'
+    if self.type_name('controller') && self.last_method(a:lnum) != ''
+      let urls += ['/'.self.controller_name().'/'.self.last_method(a:lnum).'/']
+    elseif self.type_name('controller','view-layout','view-partial')
+      let urls += ['/'.self.controller_name().'/']
+    elseif self.type_name('view')
+      let urls += ['/'.s:controller().'/'.fnamemodify(self.name(),':t:r:r').'/']
+    endif
+  endif
+  return urls
+endfunction
+
+call s:add_methods('readable',['preview_urls'])
+
+function! s:Preview(bang,lnum,arg)
+  let root = s:getopt("root_url")
+  if root == ''
+    let root = s:getopt("url")
+  endif
+  let root = s:sub(root,'/$','')
+  if a:arg =~ '://'
+    let uri = a:arg
+  elseif a:arg != ''
+    let uri = root.'/'.s:sub(a:arg,'^/','')
+  else
+    let uri = get(rails#buffer().preview_urls(a:lnum),0,'')
+    let uri = root.'/'.s:sub(s:sub(uri,'^/',''),'/$','')
+  endif
+  call s:initOpenURL()
+  if exists(':OpenURL') && !a:bang
+    exe 'OpenURL '.uri
+  else
+    " Work around bug where URLs ending in / get handled as FTP
+    let url = uri.(uri =~ '/$' ? '?' : '')
+    silent exe 'pedit '.url
+    wincmd w
+    if &filetype == ''
+      if uri =~ '\.css$'
+        setlocal filetype=css
+      elseif uri =~ '\.js$'
+        setlocal filetype=javascript
+      elseif getline(1) =~ '^\s*<'
+        setlocal filetype=xhtml
+      endif
+    endif
+    call RailsBufInit(rails#app().path())
+    map <buffer> <silent> q :bwipe<CR>
+    wincmd p
+    if !a:bang
+      call s:warn("Define a :OpenURL command to use a browser")
+    endif
+  endif
+endfunction
+
+function! s:Complete_preview(A,L,P)
+  return rails#buffer().preview_urls(a:L =~ '^\d' ? matchstr(a:L,'^\d\+') : line('.'))
+endfunction
+
+" }}}1
+" Script Wrappers {{{1
+
+function! s:BufScriptWrappers()
+  command! -buffer -bar -nargs=*       -complete=customlist,s:Complete_script   Rscript       :call rails#app().script_command(<bang>0,<f-args>)
+  command! -buffer -bar -nargs=*       -complete=customlist,s:Complete_generate Rgenerate     :call rails#app().generate_command(<bang>0,<f-args>)
+  command! -buffer -bar -nargs=*       -complete=customlist,s:Complete_destroy  Rdestroy      :call rails#app().destroy_command(<bang>0,<f-args>)
+  command! -buffer -bar -nargs=? -bang -complete=customlist,s:Complete_server   Rserver       :call rails#app().server_command(<bang>0,<q-args>)
+  command! -buffer -bang -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rrunner       :call rails#app().runner_command(<bang>0 ? -2 : (<count>==<line2>?<count>:-1),<f-args>)
+  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rp            :call rails#app().runner_command(<count>==<line2>?<count>:-1,'p begin '.<f-args>.' end')
+  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rpp           :call rails#app().runner_command(<count>==<line2>?<count>:-1,'require %{pp}; pp begin '.<f-args>.' end')
+  command! -buffer       -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Ry            :call rails#app().runner_command(<count>==<line2>?<count>:-1,'y begin '.<f-args>.' end')
+endfunction
+
+function! s:app_generators() dict
+  if self.cache.needs('generators')
+    let generators = self.relglob("vendor/plugins/","*/generators/*")
+    let generators += self.relglob("","lib/generators/*")
+    call filter(generators,'v:val =~ "/$"')
+    let generators += split(glob(expand("~/.rails/generators")."/*"),"\n")
+    call map(generators,'s:sub(v:val,"^.*[\\\\/]generators[\\\\/]\\ze.","")')
+    call map(generators,'s:sub(v:val,"[\\\\/]$","")')
+    call self.cache.set('generators',generators)
+  endif
+  return sort(split(g:rails_generators,"\n") + self.cache.get('generators'))
+endfunction
+
+function! s:app_script_command(bang,...) dict
+  let str = ""
+  let cmd = a:0 ? a:1 : "console"
+  let c = 2
+  while c <= a:0
+    let str .= " " . s:rquote(a:{c})
+    let c += 1
+  endwhile
+  if cmd ==# "plugin"
+    call self.cache.clear('generators')
+  endif
+  if a:bang || cmd =~# 'console'
+    return self.background_script_command(cmd.str)
+  else
+    return self.execute_script_command(cmd.str)
+  endif
+endfunction
+
+function! s:app_runner_command(count,args) dict
+  if a:count == -2
+    return self.script_command(a:bang,"runner",a:args)
+  else
+    let str = self.ruby_shell_command('-r./config/boot -e "require '."'commands/runner'".'" '.s:rquote(a:args))
+    let res = s:sub(system(str),'\n$','')
+    if a:count < 0
+      echo res
+    else
+      exe a:count.'put =res'
+    endif
+  endif
+endfunction
+
+function! s:getpidfor(bind,port)
+    if has("win32") || has("win64")
+      let netstat = system("netstat -anop tcp")
+      let pid = matchstr(netstat,'\<'.a:bind.':'.a:port.'\>.\{-\}LISTENING\s\+\zs\d\+')
+    elseif executable('lsof')
+      let pid = system("lsof -i 4tcp@".a:bind.':'.a:port."|grep LISTEN|awk '{print $2}'")
+      let pid = s:sub(pid,'\n','')
+    else
+      let pid = ""
+    endif
+    return pid
+endfunction
+
+function! s:app_server_command(bang,arg) dict
+  let port = matchstr(a:arg,'\%(-p\|--port=\=\)\s*\zs\d\+')
+  if port == ''
+    let port = "3000"
+  endif
+  " TODO: Extract bind argument
+  let bind = "0.0.0.0"
+  if a:bang && executable("ruby")
+    let pid = s:getpidfor(bind,port)
+    if pid =~ '^\d\+$'
+      echo "Killing server with pid ".pid
+      if !has("win32")
+        call system("ruby -e 'Process.kill(:TERM,".pid.")'")
+        sleep 100m
+      endif
+      call system("ruby -e 'Process.kill(9,".pid.")'")
+      sleep 100m
+    endif
+    if a:arg == "-"
+      return
+    endif
+  endif
+  if has_key(self,'options') && has_key(self.options,'gnu_screen')
+    let screen = self.options.gnu_screen
+  else
+    let screen = g:rails_gnu_screen
+  endif
+  if has("win32") || has("win64") || (exists("$STY") && !has("gui_running") && screen && executable("screen")) || (exists("$TMUX") && !has("gui_running") && screen && executable("tmux"))
+    call self.background_script_command('server '.a:arg)
+  else
+    " --daemon would be more descriptive but lighttpd does not support it
+    call self.execute_script_command('server '.a:arg." -d")
+  endif
+  call s:setopt('a:root_url','http://'.(bind=='0.0.0.0'?'localhost': bind).':'.port.'/')
+endfunction
+
+function! s:app_destroy_command(bang,...) dict
+  if a:0 == 0
+    return self.execute_script_command('destroy')
+  elseif a:0 == 1
+    return self.execute_script_command('destroy '.s:rquote(a:1))
+  endif
+  let str = ""
+  let c = 1
+  while c <= a:0
+    let str .= " " . s:rquote(a:{c})
+    let c += 1
+  endwhile
+  call self.execute_script_command('destroy'.str)
+  call self.cache.clear('user_classes')
+endfunction
+
+function! s:app_generate_command(bang,...) dict
+  if a:0 == 0
+    return self.execute_script_command('generate')
+  elseif a:0 == 1
+    return self.execute_script_command('generate '.s:rquote(a:1))
+  endif
+  let cmd = join(map(copy(a:000),'s:rquote(v:val)'),' ')
+  if cmd !~ '-p\>' && cmd !~ '--pretend\>'
+    let execstr = self.script_shell_command('generate '.cmd.' -p -f')
+    let res = system(execstr)
+    let g:res = res
+    let junk = '\%(\e\[[0-9;]*m\)\='
+    let file = matchstr(res,junk.'\s\+\%(create\|force\)'.junk.'\s\+\zs\f\+\.rb\ze\n')
+    if file == ""
+      let file = matchstr(res,junk.'\s\+\%(identical\)'.junk.'\s\+\zs\f\+\.rb\ze\n')
+    endif
+  else
+    let file = ""
+  endif
+  if !self.execute_script_command('generate '.cmd) && file != ''
+    call self.cache.clear('user_classes')
+    call self.cache.clear('features')
+    if file =~ '^db/migrate/\d\d\d\d'
+      let file = get(self.relglob('',s:sub(file,'\d+','[0-9]*[0-9]')),-1,file)
+    endif
+    edit `=self.path(file)`
+  endif
+endfunction
+
+call s:add_methods('app', ['generators','script_command','runner_command','server_command','destroy_command','generate_command'])
+
+function! s:Complete_script(ArgLead,CmdLine,P)
+  let cmd = s:sub(a:CmdLine,'^\u\w*\s+','')
+  if cmd !~ '^[ A-Za-z0-9_=:-]*$'
+    return []
+  elseif cmd =~# '^\w*$'
+    return s:completion_filter(rails#app().relglob("script/","**/*"),a:ArgLead)
+  elseif cmd =~# '^\%(plugin\)\s\+'.a:ArgLead.'$'
+    return s:completion_filter(["discover","list","install","update","remove","source","unsource","sources"],a:ArgLead)
+  elseif cmd =~# '\%(plugin\)\s\+\%(install\|remove\)\s\+'.a:ArgLead.'$' || cmd =~ '\%(generate\|destroy\)\s\+plugin\s\+'.a:ArgLead.'$'
+    return s:pluginList(a:ArgLead,a:CmdLine,a:P)
+  elseif cmd =~# '^\%(generate\|destroy\)\s\+'.a:ArgLead.'$'
+    return s:completion_filter(rails#app().generators(),a:ArgLead)
+  elseif cmd =~# '^\%(generate\|destroy\)\s\+\w\+\s\+'.a:ArgLead.'$'
+    let target = matchstr(cmd,'^\w\+\s\+\%(\w\+:\)\=\zs\w\+\ze\s\+')
+    if target =~# '^\w*controller$'
+      return filter(s:controllerList(a:ArgLead,"",""),'v:val !=# "application"')
+    elseif target ==# 'generator'
+      return s:completion_filter(map(rails#app().relglob('lib/generators/','*'),'s:sub(v:val,"/$","")'))
+    elseif target ==# 'helper'
+      return s:helperList(a:ArgLead,"","")
+    elseif target ==# 'integration_test' || target ==# 'integration_spec' || target ==# 'feature'
+      return s:integrationtestList(a:ArgLead,"","")
+    elseif target ==# 'metal'
+      return s:metalList(a:ArgLead,"","")
+    elseif target ==# 'migration' || target ==# 'session_migration'
+      return s:migrationList(a:ArgLead,"","")
+    elseif target =~# '^\w*\%(model\|resource\)$' || target =~# '\w*scaffold\%(_controller\)\=$' || target ==# 'mailer'
+      return s:modelList(a:ArgLead,"","")
+    elseif target ==# 'observer'
+      let observers = s:observerList("","","")
+      let models = s:modelList("","","")
+      if cmd =~# '^destroy\>'
+        let models = []
+      endif
+      call filter(models,'index(observers,v:val) < 0')
+      return s:completion_filter(observers + models,a:ArgLead)
+    else
+      return []
+    endif
+  elseif cmd =~# '^\%(generate\|destroy\)\s\+scaffold\s\+\w\+\s\+'.a:ArgLead.'$'
+    return filter(s:controllerList(a:ArgLead,"",""),'v:val !=# "application"')
+    return s:completion_filter(rails#app().environments())
+  elseif cmd =~# '^\%(console\)\s\+\(--\=\w\+\s\+\)\='.a:ArgLead."$"
+    return s:completion_filter(rails#app().environments()+["-s","--sandbox"],a:ArgLead)
+  elseif cmd =~# '^\%(server\)\s\+.*-e\s\+'.a:ArgLead."$"
+    return s:completion_filter(rails#app().environments(),a:ArgLead)
+  elseif cmd =~# '^\%(server\)\s\+'
+    if a:ArgLead =~# '^--environment='
+      return s:completion_filter(map(copy(rails#app().environments()),'"--environment=".v:val'),a:ArgLead)
+    else
+      return filter(["-p","-b","-e","-m","-d","-u","-c","-h","--port=","--binding=","--environment=","--mime-types=","--daemon","--debugger","--charset=","--help"],'s:startswith(v:val,a:ArgLead)')
+    endif
+  endif
+  return ""
+endfunction
+
+function! s:CustomComplete(A,L,P,cmd)
+  let L = "Rscript ".a:cmd." ".s:sub(a:L,'^\h\w*\s+','')
+  let P = a:P - strlen(a:L) + strlen(L)
+  return s:Complete_script(a:A,L,P)
+endfunction
+
+function! s:Complete_server(A,L,P)
+  return s:CustomComplete(a:A,a:L,a:P,"server")
+endfunction
+
+function! s:Complete_console(A,L,P)
+  return s:CustomComplete(a:A,a:L,a:P,"console")
+endfunction
+
+function! s:Complete_generate(A,L,P)
+  return s:CustomComplete(a:A,a:L,a:P,"generate")
+endfunction
+
+function! s:Complete_destroy(A,L,P)
+  return s:CustomComplete(a:A,a:L,a:P,"destroy")
+endfunction
+
+function! s:Complete_ruby(A,L,P)
+  return s:completion_filter(rails#app().user_classes()+["ActiveRecord::Base"],a:A)
+endfunction
+
+" }}}1
+" Navigation {{{1
+
+function! s:BufNavCommands()
+  command! -buffer -bar -nargs=? -complete=customlist,s:Complete_cd Rcd   :cd `=rails#app().path(<q-args>)`
+  command! -buffer -bar -nargs=? -complete=customlist,s:Complete_cd Rlcd :lcd `=rails#app().path(<q-args>)`
+  command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find Rfind    :call s:warn( 'Rfind has been deprecated in favor of :1R or :find' )|call s:Find(<count>,'<bang>' ,<f-args>)
+  command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find REfind   :call s:warn('REfind has been deprecated in favor of :1RE or :find')|call s:Find(<count>,'E<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find RSfind   :call s:warn('RSfind has been deprecated in favor of :1RS or :find')|call s:Find(<count>,'S<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find RVfind   :call s:warn('RVfind has been deprecated in favor of :1RV or :find')|call s:Find(<count>,'V<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find RTfind   :call s:warn('RTfind has been deprecated in favor of :1RT or :find')|call s:Find(<count>,'T<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find Rsfind   :call s:warn('Rsfind has been deprecated in favor of :1RS or :sfind')|<count>RSfind<bang> <args>
+  command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find Rtabfind :call s:warn('Rtabfind has been deprecated in favor of :1RT or :tabfind')|<count>RTfind<bang> <args>
+  command! -buffer -bar -nargs=* -bang    -complete=customlist,s:Complete_edit Redit    :call s:warn( 'Redit has been deprecated in favor of :R')|call s:Edit(<count>,'<bang>' ,<f-args>)
+  command! -buffer -bar -nargs=* -bang    -complete=customlist,s:Complete_edit REedit   :call s:warn('REedit has been deprecated in favor of :RE')|call s:Edit(<count>,'E<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -bang    -complete=customlist,s:Complete_edit RSedit   :call s:warn('RSedit has been deprecated in favor of :RS')|call s:Edit(<count>,'S<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -bang    -complete=customlist,s:Complete_edit RVedit   :call s:warn('RVedit has been deprecated in favor of :RV')|call s:Edit(<count>,'V<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -bang    -complete=customlist,s:Complete_edit RTedit   :call s:warn('RTedit has been deprecated in favor of :RT')|call s:Edit(<count>,'T<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_edit RDedit   :call s:warn('RDedit has been deprecated in favor of :RD')|call s:Edit(<count>,'<line1>D<bang>',<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related A     :call s:Alternate('<bang>', <line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AE    :call s:Alternate('E<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AS    :call s:Alternate('S<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AV    :call s:Alternate('V<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AT    :call s:Alternate('T<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AD    :call s:Alternate('D<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AN    :call s:Related('<bang>' ,<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related R     :call s:Related('<bang>' ,<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RE    :call s:Related('E<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RS    :call s:Related('S<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RV    :call s:Related('V<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RT    :call s:Related('T<bang>',<line1>,<line2>,<count>,<f-args>)
+  command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RD    :call s:Related('D<bang>',<line1>,<line2>,<count>,<f-args>)
+endfunction
+
+function! s:djump(def)
+  let def = s:sub(a:def,'^[#:]','')
+  if def =~ '^\d\+$'
+    exe def
+  elseif def =~ '^!'
+    if expand('%') !~ '://' && !isdirectory(expand('%:p:h'))
+      call mkdir(expand('%:p:h'),'p')
+    endif
+  elseif def != ''
+    let ext = matchstr(def,'\.\zs.*')
+    let def = matchstr(def,'[^.]*')
+    let v:errmsg = ''
+    silent! exe "djump ".def
+    if ext != '' && (v:errmsg == '' || v:errmsg =~ '^E387')
+      let rpat = '\C^\s*\%(mail\>.*\|respond_to\)\s*\%(\<do\|{\)\s*|\zs\h\k*\ze|'
+      let end = s:endof(line('.'))
+      let rline = search(rpat,'',end)
+      if rline > 0
+        let variable = matchstr(getline(rline),rpat)
+        let success = search('\C^\s*'.variable.'\s*\.\s*\zs'.ext.'\>','',end)
+        if !success
+          silent! exe "djump ".def
+        endif
+      endif
+    endif
+  endif
+endfunction
+
+function! s:Find(count,cmd,...)
+  let str = ""
+  if a:0
+    let i = 1
+    while i < a:0
+      let str .= s:escarg(a:{i}) . " "
+      let i += 1
+    endwhile
+    let file = a:{i}
+    let tail = matchstr(file,'[#!].*$\|:\d*\%(:in\>.*\)\=$')
+    if tail != ""
+      let file = s:sub(file,'[#!].*$|:\d*%(:in>.*)=$','')
+    endif
+    if file != ""
+      let file = s:RailsIncludefind(file)
+    endif
+  else
+    let file = s:RailsFind()
+    let tail = ""
+  endif
+  call s:findedit((a:count==1?'' : a:count).a:cmd,file.tail,str)
+endfunction
+
+function! s:Edit(count,cmd,...)
+  if a:0
+    let str = ""
+    let i = 1
+    while i < a:0
+      let str .= "`=a:".i."` "
+      let i += 1
+    endwhile
+    let file = a:{i}
+    call s:findedit(s:editcmdfor(a:cmd),file,str)
+  else
+    exe s:editcmdfor(a:cmd)
+  endif
+endfunction
+
+function! s:fuzzyglob(arg)
+  return s:gsub(s:gsub(a:arg,'[^/.]','[&]*'),'%(/|^)\.@!|\.','&*')
+endfunction
+
+function! s:Complete_find(ArgLead, CmdLine, CursorPos)
+  let paths = s:pathsplit(&l:path)
+  let seen = {}
+  for path in paths
+    if s:startswith(path,rails#app().path()) && path !~ '[][*]'
+      let path = path[strlen(rails#app().path()) + 1 : ]
+      for file in rails#app().relglob(path == '' ? '' : path.'/',s:fuzzyglob(rails#underscore(a:ArgLead)), a:ArgLead =~# '\u' ? '.rb' : '')
+        let seen[file] = 1
+      endfor
+    endif
+  endfor
+  return s:autocamelize(sort(keys(seen)),a:ArgLead)
+endfunction
+
+function! s:Complete_edit(ArgLead, CmdLine, CursorPos)
+  return s:completion_filter(rails#app().relglob("",s:fuzzyglob(a:ArgLead)),a:ArgLead)
+endfunction
+
+function! s:Complete_cd(ArgLead, CmdLine, CursorPos)
+  let all = rails#app().relglob("",a:ArgLead."*")
+  call filter(all,'v:val =~ "/$"')
+  return filter(all,'s:startswith(v:val,a:ArgLead)')
+endfunction
+
+function! RailsIncludeexpr()
+  " Is this foolproof?
+  if mode() =~ '[iR]' || expand("<cfile>") != v:fname
+    return s:RailsIncludefind(v:fname)
+  else
+    return s:RailsIncludefind(v:fname,1)
+  endif
+endfunction
+
+function! s:linepeak()
+  let line = getline(line("."))
+  let line = s:sub(line,'^(.{'.col(".").'}).*','\1')
+  let line = s:sub(line,'([:"'."'".']|\%[qQ]=[[({<])=\f*$','')
+  return line
+endfunction
+
+function! s:matchcursor(pat)
+  let line = getline(".")
+  let lastend = 0
+  while lastend >= 0
+    let beg = match(line,'\C'.a:pat,lastend)
+    let end = matchend(line,'\C'.a:pat,lastend)
+    if beg < col(".") && end >= col(".")
+      return matchstr(line,'\C'.a:pat,lastend)
+    endif
+    let lastend = end
+  endwhile
+  return ""
+endfunction
+
+function! s:findit(pat,repl)
+  let res = s:matchcursor(a:pat)
+  if res != ""
+    return substitute(res,'\C'.a:pat,a:repl,'')
+  else
+    return ""
+  endif
+endfunction
+
+function! s:findamethod(func,repl)
+  return s:findit('\s*\<\%('.a:func.'\)\s*(\=\s*[@:'."'".'"]\(\f\+\)\>.\=',a:repl)
+endfunction
+
+function! s:findasymbol(sym,repl)
+  return s:findit('\s*\%(:\%('.a:sym.'\)\s*=>\|\<'.a:sym.':\)\s*(\=\s*[@:'."'".'"]\(\f\+\)\>.\=',a:repl)
+endfunction
+
+function! s:findfromview(func,repl)
+  "                     (   )            (           )                      ( \1  )                   (      )
+  return s:findit('\s*\%(<%\)\==\=\s*\<\%('.a:func.'\)\s*(\=\s*[@:'."'".'"]\(\f\+\)\>['."'".'"]\=\s*\%(%>\s*\)\=',a:repl)
+endfunction
+
+function! s:RailsFind()
+  if filereadable(expand("<cfile>"))
+    return expand("<cfile>")
+  endif
+
+  " UGH
+  let buffer = rails#buffer()
+  let format = s:format('html')
+
+  let res = s:findit('\v\s*<require\s*\(=\s*File.dirname\(__FILE__\)\s*\+\s*[:'."'".'"](\f+)>.=',expand('%:h').'/\1')
+  if res != ""|return res.(fnamemodify(res,':e') == '' ? '.rb' : '')|endif
+
+  let res = s:findit('\v<File.dirname\(__FILE__\)\s*\+\s*[:'."'".'"](\f+)>['."'".'"]=',expand('%:h').'\1')
+  if res != ""|return res|endif
+
+  let res = rails#underscore(s:findit('\v\s*<%(include|extend)\(=\s*<([[:alnum:]_:]+)>','\1'))
+  if res != ""|return res.".rb"|endif
+
+  let res = s:findamethod('require','\1')
+  if res != ""|return res.(fnamemodify(res,':e') == '' ? '.rb' : '')|endif
+
+  let res = s:findamethod('belongs_to\|has_one\|composed_of\|validates_associated\|scaffold','app/models/\1.rb')
+  if res != ""|return res|endif
+
+  let res = rails#singularize(s:findamethod('has_many\|has_and_belongs_to_many','app/models/\1'))
+  if res != ""|return res.".rb"|endif
+
+  let res = rails#singularize(s:findamethod('create_table\|change_table\|drop_table\|add_column\|rename_column\|remove_column\|add_index','app/models/\1'))
+  if res != ""|return res.".rb"|endif
+
+  let res = rails#singularize(s:findasymbol('through','app/models/\1'))
+  if res != ""|return res.".rb"|endif
+
+  let res = s:findamethod('fixtures','fixtures/\1')
+  if res != ""
+    return RailsFilePath() =~ '\<spec/' ? 'spec/'.res : res
+  endif
+
+  let res = s:findamethod('\%(\w\+\.\)\=resources','app/controllers/\1_controller.rb')
+  if res != ""|return res|endif
+
+  let res = s:findamethod('\%(\w\+\.\)\=resource','app/controllers/\1')
+  if res != ""|return rails#pluralize(res)."_controller.rb"|endif
+
+  let res = s:findasymbol('to','app/controllers/\1')
+  if res =~ '#'|return s:sub(res,'#','_controller.rb#')|endif
+
+  let res = s:findamethod('root\s*\%(:to\s*=>\|\<to:\)\s*','app/controllers/\1')
+  if res =~ '#'|return s:sub(res,'#','_controller.rb#')|endif
+
+  let res = s:findamethod('\%(match\|get\|put\|post\|delete\|redirect\)\s*(\=\s*[:''"][^''"]*[''"]\=\s*\%(\%(,\s*:to\s*\)\==>\|,\s*to:\)\s*','app/controllers/\1')
+  if res =~ '#'|return s:sub(res,'#','_controller.rb#')|endif
+
+  let res = s:findamethod('layout','\=s:findlayout(submatch(1))')
+  if res != ""|return res|endif
+
+  let res = s:findasymbol('layout','\=s:findlayout(submatch(1))')
+  if res != ""|return res|endif
+
+  let res = s:findamethod('helper','app/helpers/\1_helper.rb')
+  if res != ""|return res|endif
+
+  let res = s:findasymbol('controller','app/controllers/\1_controller.rb')
+  if res != ""|return res|endif
+
+  let res = s:findasymbol('action','\1')
+  if res != ""|return res|endif
+
+  let res = s:findasymbol('template','app/views/\1')
+  if res != ""|return res|endif
+
+  let res = s:sub(s:sub(s:findasymbol('partial','\1'),'^/',''),'[^/]+$','_&')
+  if res != ""|return res."\n".s:findview(res)|endif
+
+  let res = s:sub(s:sub(s:findfromview('render\s*(\=\s*\%(:partial\s\+=>\|partial:\)\s*','\1'),'^/',''),'[^/]+$','_&')
+  if res != ""|return res."\n".s:findview(res)|endif
+
+  let res = s:findamethod('render\>\s*\%(:\%(template\|action\)\s\+=>\|template:\|action:\)\s*','\1.'.format.'\n\1')
+  if res != ""|return res|endif
+
+  let res = s:sub(s:findfromview('render','\1'),'^/','')
+  if buffer.type_name('view') | let res = s:sub(res,'[^/]+$','_&') | endif
+  if res != ""|return res."\n".s:findview(res)|endif
+
+  let res = s:findamethod('redirect_to\s*(\=\s*\%\(:action\s\+=>\|\<action:\)\s*','\1')
+  if res != ""|return res|endif
+
+  let res = s:findfromview('stylesheet_link_tag','public/stylesheets/\1')
+  if res != '' && fnamemodify(res, ':e') == '' " Append the default extension iff the filename doesn't already contains an extension
+    let res .= '.css'
+  end
+  if res != ""|return res|endif
+
+  let res = s:sub(s:findfromview('javascript_include_tag','public/javascripts/\1'),'/defaults>','/application')
+  if res != '' && fnamemodify(res, ':e') == '' " Append the default extension iff the filename doesn't already contains an extension
+    let res .= '.js'
+  end
+  if res != ""|return res|endif
+
+  if buffer.type_name('controller')
+    let contr = s:controller()
+    let view = s:findit('\s*\<def\s\+\(\k\+\)\>(\=','/\1')
+    let res = s:findview(contr.'/'.view)
+    if res != ""|return res|endif
+  endif
+
+  let old_isfname = &isfname
+  try
+    set isfname=@,48-57,/,-,_,:,#
+    " TODO: grab visual selection in visual mode
+    let cfile = expand("<cfile>")
+  finally
+    let &isfname = old_isfname
+  endtry
+  let res = s:RailsIncludefind(cfile,1)
+  return res
+endfunction
+
+function! s:app_named_route_file(route) dict
+  call self.route_names()
+  if self.cache.has("named_routes") && has_key(self.cache.get("named_routes"),a:route)
+    return self.cache.get("named_routes")[a:route]
+  endif
+  return ""
+endfunction
+
+function! s:app_route_names() dict
+  if self.cache.needs("named_routes")
+    let exec = "ActionController::Routing::Routes.named_routes.each {|n,r| puts %{#{n} app/controllers/#{r.requirements[:controller]}_controller.rb##{r.requirements[:action]}}}"
+    let string = self.eval(exec)
+    let routes = {}
+    for line in split(string,"\n")
+      let route = split(line," ")
+      let name = route[0]
+      let routes[name] = route[1]
+    endfor
+    call self.cache.set("named_routes",routes)
+  endif
+
+  return keys(self.cache.get("named_routes"))
+endfunction
+
+call s:add_methods('app', ['route_names','named_route_file'])
+
+function! RailsNamedRoutes()
+  return rails#app().route_names()
+endfunction
+
+function! s:RailsIncludefind(str,...)
+  if a:str ==# "ApplicationController"
+    return "application_controller.rb\napp/controllers/application.rb"
+  elseif a:str ==# "Test::Unit::TestCase"
+    return "test/unit/testcase.rb"
+  endif
+  let str = a:str
+  if a:0 == 1
+    " Get the text before the filename under the cursor.
+    " We'll cheat and peak at this in a bit
+    let line = s:linepeak()
+    let line = s:sub(line,'([:"'."'".']|\%[qQ]=[[({<])=\f*$','')
+  else
+    let line = ""
+  endif
+  let str = s:sub(str,'^\s*','')
+  let str = s:sub(str,'\s*$','')
+  let str = s:sub(str,'^:=[:@]','')
+  let str = s:sub(str,':0x\x+$','') " For #<Object:0x...> style output
+  let str = s:gsub(str,"[\"']",'')
+  if line =~# '\<\(require\|load\)\s*(\s*$'
+    return str
+  elseif str =~# '^\l\w*#\w\+$'
+    return 'app/controllers/'.s:sub(str,'#','_controller.rb#')
+  endif
+  let str = rails#underscore(str)
+  let fpat = '\(\s*\%("\f*"\|:\f*\|'."'\\f*'".'\)\s*,\s*\)*'
+  if a:str =~# '\u'
+    " Classes should always be in .rb files
+    let str .= '.rb'
+  elseif line =~# ':partial\s*=>\s*'
+    let str = s:sub(str,'[^/]+$','_&')
+    let str = s:findview(str)
+  elseif line =~# '\<layout\s*(\=\s*' || line =~# ':layout\s*=>\s*'
+    let str = s:findview(s:sub(str,'^/=','layouts/'))
+  elseif line =~# ':controller\s*=>\s*'
+    let str = 'app/controllers/'.str.'_controller.rb'
+  elseif line =~# '\<helper\s*(\=\s*'
+    let str = 'app/helpers/'.str.'_helper.rb'
+  elseif line =~# '\<fixtures\s*(\='.fpat
+    if RailsFilePath() =~# '\<spec/'
+      let str = s:sub(str,'^/@!','spec/fixtures/')
+    else
+      let str = s:sub(str,'^/@!','test/fixtures/')
+    endif
+  elseif line =~# '\<stylesheet_\(link_tag\|path\)\s*(\='.fpat
+    let str = s:sub(str,'^/@!','/stylesheets/')
+    if str != '' && fnamemodify(str, ':e') == ''
+      let str .= '.css'
+    endif
+  elseif line =~# '\<javascript_\(include_tag\|path\)\s*(\='.fpat
+    if str ==# "defaults"
+      let str = "application"
+    endif
+    let str = s:sub(str,'^/@!','/javascripts/')
+    if str != '' && fnamemodify(str, ':e') == ''
+      let str .= '.js'
+    endif
+  elseif line =~# '\<\(has_one\|belongs_to\)\s*(\=\s*'
+    let str = 'app/models/'.str.'.rb'
+  elseif line =~# '\<has_\(and_belongs_to_\)\=many\s*(\=\s*'
+    let str = 'app/models/'.rails#singularize(str).'.rb'
+  elseif line =~# '\<def\s\+' && expand("%:t") =~# '_controller\.rb'
+    let str = s:findview(str)
+  elseif str =~# '_\%(path\|url\)$' || (line =~# ':as\s*=>\s*$' && rails#buffer().type_name('config-routes'))
+    if line !~# ':as\s*=>\s*$'
+      let str = s:sub(str,'_%(path|url)$','')
+      let str = s:sub(str,'^hash_for_','')
+    endif
+    let file = rails#app().named_route_file(str)
+    if file == ""
+      let str = s:sub(str,'^formatted_','')
+      if str =~# '^\%(new\|edit\)_'
+        let str = 'app/controllers/'.s:sub(rails#pluralize(str),'^(new|edit)_(.*)','\2_controller.rb#\1')
+      elseif str ==# rails#singularize(str)
+        " If the word can't be singularized, it's probably a link to the show
+        " method.  We should verify by checking for an argument, but that's
+        " difficult the way things here are currently structured.
+        let str = 'app/controllers/'.rails#pluralize(str).'_controller.rb#show'
+      else
+        let str = 'app/controllers/'.str.'_controller.rb#index'
+      endif
+    else
+      let str = file
+    endif
+  elseif str !~ '/'
+    " If we made it this far, we'll risk making it singular.
+    let str = rails#singularize(str)
+    let str = s:sub(str,'_id$','')
+  endif
+  if str =~ '^/' && !filereadable(str)
+    let str = s:sub(str,'^/','')
+  endif
+  if str =~# '^lib/' && !filereadable(str)
+    let str = s:sub(str,'^lib/','')
+  endif
+  return str
+endfunction
+
+" }}}1
+" File Finders {{{1
+
+function! s:addfilecmds(type)
+  let l = s:sub(a:type,'^.','\l&')
+  let cmds = 'ESVTD '
+  let cmd = ''
+  while cmds != ''
+    let cplt = " -complete=customlist,".s:sid.l."List"
+    exe "command! -buffer -bar ".(cmd == 'D' ? '-range=0 ' : '')."-nargs=*".cplt." R".cmd.l." :call s:".l.'Edit("'.(cmd == 'D' ? '<line1>' : '').cmd.'<bang>",<f-args>)'
+    let cmd = strpart(cmds,0,1)
+    let cmds = strpart(cmds,1)
+  endwhile
+endfunction
+
+function! s:BufFinderCommands()
+  command! -buffer -bar -nargs=+ Rnavcommand :call s:Navcommand(<bang>0,<f-args>)
+  call s:addfilecmds("metal")
+  call s:addfilecmds("model")
+  call s:addfilecmds("view")
+  call s:addfilecmds("controller")
+  call s:addfilecmds("mailer")
+  call s:addfilecmds("migration")
+  call s:addfilecmds("observer")
+  call s:addfilecmds("helper")
+  call s:addfilecmds("layout")
+  call s:addfilecmds("fixtures")
+  call s:addfilecmds("locale")
+  if rails#app().has('test') || rails#app().has('spec')
+    call s:addfilecmds("unittest")
+    call s:addfilecmds("functionaltest")
+  endif
+  if rails#app().has('test') || rails#app().has('spec') || rails#app().has('cucumber')
+    call s:addfilecmds("integrationtest")
+  endif
+  if rails#app().has('spec')
+    call s:addfilecmds("spec")
+  endif
+  call s:addfilecmds("stylesheet")
+  call s:addfilecmds("javascript")
+  call s:addfilecmds("plugin")
+  call s:addfilecmds("task")
+  call s:addfilecmds("lib")
+  call s:addfilecmds("environment")
+  call s:addfilecmds("initializer")
+endfunction
+
+function! s:completion_filter(results,A)
+  let results = sort(type(a:results) == type("") ? split(a:results,"\n") : copy(a:results))
+  call filter(results,'v:val !~# "\\~$"')
+  let filtered = filter(copy(results),'s:startswith(v:val,a:A)')
+  if !empty(filtered) | return filtered | endif
+  let regex = s:gsub(a:A,'[^/]','[&].*')
+  let filtered = filter(copy(results),'v:val =~# "^".regex')
+  if !empty(filtered) | return filtered | endif
+  let regex = s:gsub(a:A,'.','[&].*')
+  let filtered = filter(copy(results),'v:val =~# regex')
+  return filtered
+endfunction
+
+function! s:autocamelize(files,test)
+  if a:test =~# '^\u'
+    return s:completion_filter(map(copy(a:files),'rails#camelize(v:val)'),a:test)
+  else
+    return s:completion_filter(a:files,a:test)
+  endif
+endfunction
+
+function! s:app_relglob(path,glob,...) dict
+  if exists("+shellslash") && ! &shellslash
+    let old_ss = &shellslash
+    let &shellslash = 1
+  endif
+  let path = a:path
+  if path !~ '^/' && path !~ '^\w:'
+    let path = self.path(path)
+  endif
+  let suffix = a:0 ? a:1 : ''
+  let full_paths = split(glob(path.a:glob.suffix),"\n")
+  let relative_paths = []
+  for entry in full_paths
+    if suffix == '' && isdirectory(entry) && entry !~ '/$'
+      let entry .= '/'
+    endif
+    let relative_paths += [entry[strlen(path) : -strlen(suffix)-1]]
+  endfor
+  if exists("old_ss")
+    let &shellslash = old_ss
+  endif
+  return relative_paths
+endfunction
+
+call s:add_methods('app', ['relglob'])
+
+function! s:relglob(...)
+  return join(call(rails#app().relglob,a:000,rails#app()),"\n")
+endfunction
+
+function! s:helperList(A,L,P)
+  return s:autocamelize(rails#app().relglob("app/helpers/","**/*","_helper.rb"),a:A)
+endfunction
+
+function! s:controllerList(A,L,P)
+  let con = rails#app().relglob("app/controllers/","**/*",".rb")
+  call map(con,'s:sub(v:val,"_controller$","")')
+  return s:autocamelize(con,a:A)
+endfunction
+
+function! s:mailerList(A,L,P)
+  return s:autocamelize(rails#app().relglob("app/mailers/","**/*",".rb"),a:A)
+endfunction
+
+function! s:viewList(A,L,P)
+  let c = s:controller(1)
+  let top = rails#app().relglob("app/views/",s:fuzzyglob(a:A))
+  call filter(top,'v:val !~# "\\~$"')
+  if c != '' && a:A !~ '/'
+    let local = rails#app().relglob("app/views/".c."/","*.*[^~]")
+    return s:completion_filter(local+top,a:A)
+  endif
+  return s:completion_filter(top,a:A)
+endfunction
+
+function! s:layoutList(A,L,P)
+  return s:completion_filter(rails#app().relglob("app/views/layouts/","*"),a:A)
+endfunction
+
+function! s:stylesheetList(A,L,P)
+  let list = rails#app().relglob('app/assets/stylesheets/','**/*.*','')
+  call map(list,'s:sub(v:val,"\\..*$","")')
+  let list += rails#app().relglob('public/stylesheets/','**/*','.css')
+  if rails#app().has('sass')
+    call extend(list,rails#app().relglob('public/stylesheets/sass/','**/*','.s?ss'))
+    call s:uniq(list)
+  endif
+  return s:completion_filter(list,a:A)
+endfunction
+
+function! s:javascriptList(A,L,P)
+  let list = rails#app().relglob('app/assets/javascripts/','**/*.*','')
+  call map(list,'s:sub(v:val,"\\..*$","")')
+  let list += rails#app().relglob("public/javascripts/","**/*",".js")
+  return s:completion_filter(list,a:A)
+endfunction
+
+function! s:metalList(A,L,P)
+  return s:autocamelize(rails#app().relglob("app/metal/","**/*",".rb"),a:A)
+endfunction
+
+function! s:modelList(A,L,P)
+  let models = rails#app().relglob("app/models/","**/*",".rb")
+  call filter(models,'v:val !~# "_observer$"')
+  return s:autocamelize(models,a:A)
+endfunction
+
+function! s:observerList(A,L,P)
+  return s:autocamelize(rails#app().relglob("app/models/","**/*","_observer.rb"),a:A)
+endfunction
+
+function! s:fixturesList(A,L,P)
+  return s:completion_filter(rails#app().relglob("test/fixtures/","**/*")+rails#app().relglob("spec/fixtures/","**/*"),a:A)
+endfunction
+
+function! s:localeList(A,L,P)
+  return s:completion_filter(rails#app().relglob("config/locales/","**/*"),a:A)
+endfunction
+
+function! s:migrationList(A,L,P)
+  if a:A =~ '^\d'
+    let migrations = rails#app().relglob("db/migrate/",a:A."[0-9_]*",".rb")
+    return map(migrations,'matchstr(v:val,"^[0-9]*")')
+  else
+    let migrations = rails#app().relglob("db/migrate/","[0-9]*[0-9]_*",".rb")
+    call map(migrations,'s:sub(v:val,"^[0-9]*_","")')
+    return s:autocamelize(migrations,a:A)
+  endif
+endfunction
+
+function! s:unittestList(A,L,P)
+  let found = []
+  if rails#app().has('test')
+    let found += rails#app().relglob("test/unit/","**/*","_test.rb")
+  endif
+  if rails#app().has('spec')
+    let found += rails#app().relglob("spec/models/","**/*","_spec.rb")
+  endif
+  return s:autocamelize(found,a:A)
+endfunction
+
+function! s:functionaltestList(A,L,P)
+  let found = []
+  if rails#app().has('test')
+    let found += rails#app().relglob("test/functional/","**/*","_test.rb")
+  endif
+  if rails#app().has('spec')
+    let found += rails#app().relglob("spec/controllers/","**/*","_spec.rb")
+    let found += rails#app().relglob("spec/mailers/","**/*","_spec.rb")
+  endif
+  return s:autocamelize(found,a:A)
+endfunction
+
+function! s:integrationtestList(A,L,P)
+  if a:A =~# '^\u'
+    return s:autocamelize(rails#app().relglob("test/integration/","**/*","_test.rb"),a:A)
+  endif
+  let found = []
+  if rails#app().has('test')
+    let found += rails#app().relglob("test/integration/","**/*","_test.rb")
+  endif
+  if rails#app().has('spec')
+    let found += rails#app().relglob("spec/requests/","**/*","_spec.rb")
+    let found += rails#app().relglob("spec/integration/","**/*","_spec.rb")
+  endif
+  if rails#app().has('cucumber')
+    let found += rails#app().relglob("features/","**/*",".feature")
+  endif
+  return s:completion_filter(found,a:A)
+endfunction
+
+function! s:specList(A,L,P)
+  return s:completion_filter(rails#app().relglob("spec/","**/*","_spec.rb"),a:A)
+endfunction
+
+function! s:pluginList(A,L,P)
+  if a:A =~ '/'
+    return s:completion_filter(rails#app().relglob('vendor/plugins/',matchstr(a:A,'.\{-\}/').'**/*'),a:A)
+  else
+    return s:completion_filter(rails#app().relglob('vendor/plugins/',"*","/init.rb"),a:A)
+  endif
+endfunction
+
+" Task files, not actual rake tasks
+function! s:taskList(A,L,P)
+  let all = rails#app().relglob("lib/tasks/","**/*",".rake")
+  if RailsFilePath() =~ '\<vendor/plugins/.'
+    let path = s:sub(RailsFilePath(),'<vendor/plugins/[^/]*/\zs.*','')
+    let all = rails#app().relglob(path."tasks/","**/*",".rake")+rails#app().relglob(path."lib/tasks/","**/*",".rake")+all
+  endif
+  return s:autocamelize(all,a:A)
+endfunction
+
+function! s:libList(A,L,P)
+  let all = rails#app().relglob('lib/',"**/*",".rb")
+  if RailsFilePath() =~ '\<vendor/plugins/.'
+    let path = s:sub(RailsFilePath(),'<vendor/plugins/[^/]*/\zs.*','lib/')
+    let all = rails#app().relglob(path,"**/*",".rb") + all
+  endif
+  return s:autocamelize(all,a:A)
+endfunction
+
+function! s:environmentList(A,L,P)
+  return s:completion_filter(rails#app().relglob("config/environments/","**/*",".rb"),a:A)
+endfunction
+
+function! s:initializerList(A,L,P)
+  return s:completion_filter(rails#app().relglob("config/initializers/","**/*",".rb"),a:A)
+endfunction
+
+function! s:Navcommand(bang,...)
+  let suffix = ".rb"
+  let filter = "**/*"
+  let prefix = ""
+  let default = ""
+  let name = ""
+  let i = 0
+  while i < a:0
+    let i += 1
+    let arg = a:{i}
+    if arg =~# '^-suffix='
+      let suffix = matchstr(arg,'-suffix=\zs.*')
+    elseif arg =~# '^-default='
+      let default = matchstr(arg,'-default=\zs.*')
+    elseif arg =~# '^-\%(glob\|filter\)='
+      let filter = matchstr(arg,'-\w*=\zs.*')
+    elseif arg !~# '^-'
+      " A literal '\n'.  For evaluation below
+      if name == ""
+        let name = arg
+      else
+        let prefix .= "\\n".s:sub(arg,'/=$','/')
+      endif
+    endif
+  endwhile
+  let prefix = s:sub(prefix,'^\\n','')
+  if name !~ '^[A-Za-z]\+$'
+    return s:error("E182: Invalid command name")
+  endif
+  let cmds = 'ESVTD '
+  let cmd = ''
+  while cmds != ''
+    exe 'command! -buffer -bar -bang -nargs=* -complete=customlist,'.s:sid.'CommandList R'.cmd.name." :call s:CommandEdit('".cmd."<bang>','".name."',\"".prefix."\",".string(suffix).",".string(filter).",".string(default).",<f-args>)"
+    let cmd = strpart(cmds,0,1)
+    let cmds = strpart(cmds,1)
+  endwhile
+endfunction
+
+function! s:CommandList(A,L,P)
+  let cmd = matchstr(a:L,'\CR[A-Z]\=\w\+')
+  exe cmd." &"
+  let lp = s:last_prefix . "\n"
+  let res = []
+  while lp != ""
+    let p = matchstr(lp,'.\{-\}\ze\n')
+    let lp = s:sub(lp,'.{-}\n','')
+    let res += rails#app().relglob(p,s:last_filter,s:last_suffix)
+  endwhile
+  if s:last_camelize
+    return s:autocamelize(res,a:A)
+  else
+    return s:completion_filter(res,a:A)
+  endif
+endfunction
+
+function! s:CommandEdit(cmd,name,prefix,suffix,filter,default,...)
+  if a:0 && a:1 == "&"
+    let s:last_prefix = a:prefix
+    let s:last_suffix = a:suffix
+    let s:last_filter = a:filter
+    let s:last_camelize = (a:suffix =~# '\.rb$')
+  else
+    if a:default == "both()"
+      if s:model() != ""
+        let default = s:model()
+      else
+        let default = s:controller()
+      endif
+    elseif a:default == "model()"
+      let default = s:model(1)
+    elseif a:default == "controller()"
+      let default = s:controller(1)
+    else
+      let default = a:default
+    endif
+    call s:EditSimpleRb(a:cmd,a:name,a:0 ? a:1 : default,a:prefix,a:suffix)
+  endif
+endfunction
+
+function! s:EditSimpleRb(cmd,name,target,prefix,suffix,...)
+  let cmd = s:findcmdfor(a:cmd)
+  if a:target == ""
+    " Good idea to emulate error numbers like this?
+    return s:error("E471: Argument required")
+  endif
+  let f = a:0 ? a:target : rails#underscore(a:target)
+  let jump = matchstr(f,'[#!].*\|:\d*\%(:in\)\=$')
+  let f = s:sub(f,'[#!].*|:\d*%(:in)=$','')
+  if jump =~ '^!'
+    let cmd = s:editcmdfor(cmd)
+  endif
+  if f == '.'
+    let f = s:sub(f,'\.$','')
+  else
+    let f .= a:suffix.jump
+  endif
+  let f = s:gsub(a:prefix,'\n',f.'\n').f
+  return s:findedit(cmd,f)
+endfunction
+
+function! s:app_migration(file) dict
+  let arg = a:file
+  if arg =~ '^0$\|^0\=[#:]'
+    let suffix = s:sub(arg,'^0*','')
+    if self.has_file('db/schema.rb')
+      return 'db/schema.rb'.suffix
+    elseif self.has_file('db/'.s:environment().'_structure.sql')
+      return 'db/'.s:environment().'_structure.sql'.suffix
+    else
+      return 'db/schema.rb'.suffix
+    endif
+  elseif arg =~ '^\d$'
+    let glob = '00'.arg.'_*.rb'
+  elseif arg =~ '^\d\d$'
+    let glob = '0'.arg.'_*.rb'
+  elseif arg =~ '^\d\d\d$'
+    let glob = ''.arg.'_*.rb'
+  elseif arg == ''
+    let glob = '*.rb'
+  else
+    let glob = '*'.rails#underscore(arg).'*rb'
+  endif
+  let files = split(glob(self.path('db/migrate/').glob),"\n")
+  if arg == ''
+    return get(files,-1,'')
+  endif
+  call map(files,'strpart(v:val,1+strlen(self.path()))')
+  let keep = get(files,0,'')
+  if glob =~# '^\*.*\*rb'
+    let pattern = glob[1:-4]
+    call filter(files,'v:val =~# ''db/migrate/\d\+_''.pattern.''\.rb''')
+    let keep = get(files,0,keep)
+  endif
+  return keep
+endfunction
+
+call s:add_methods('app', ['migration'])
+
+function! s:migrationEdit(cmd,...)
+  let cmd = s:findcmdfor(a:cmd)
+  let arg = a:0 ? a:1 : ''
+  let migr = arg == "." ? "db/migrate" : rails#app().migration(arg)
+  if migr != ''
+    call s:findedit(cmd,migr)
+  else
+    return s:error("Migration not found".(arg=='' ? '' : ': '.arg))
+  endif
+endfunction
+
+function! s:fixturesEdit(cmd,...)
+  if a:0
+    let c = rails#underscore(a:1)
+  else
+    let c = rails#pluralize(s:model(1))
+  endif
+  if c == ""
+    return s:error("E471: Argument required")
+  endif
+  let e = fnamemodify(c,':e')
+  let e = e == '' ? e : '.'.e
+  let c = fnamemodify(c,':r')
+  let file = get(rails#app().test_suites(),0,'test').'/fixtures/'.c.e
+  if file =~ '\.\w\+$' && rails#app().find_file(c.e,["test/fixtures","spec/fixtures"]) ==# ''
+    call s:edit(a:cmd,file)
+  else
+    call s:findedit(a:cmd,rails#app().find_file(c.e,["test/fixtures","spec/fixtures"],[".yml",".csv"],file))
+  endif
+endfunction
+
+function! s:localeEdit(cmd,...)
+  let c = a:0 ? a:1 : rails#app().default_locale()
+  if c =~# '\.'
+    call s:edit(a:cmd,rails#app().find_file(c,'config/locales',[],'config/locales/'.c))
+  else
+    call s:findedit(a:cmd,rails#app().find_file(c,'config/locales',['.yml','.rb'],'config/locales/'.c))
+  endif
+endfunction
+
+function! s:metalEdit(cmd,...)
+  if a:0
+    call s:EditSimpleRb(a:cmd,"metal",a:1,"app/metal/",".rb")
+  else
+    call s:EditSimpleRb(a:cmd,"metal",'config/boot',"",".rb")
+  endif
+endfunction
+
+function! s:modelEdit(cmd,...)
+  call s:EditSimpleRb(a:cmd,"model",a:0? a:1 : s:model(1),"app/models/",".rb")
+endfunction
+
+function! s:observerEdit(cmd,...)
+  call s:EditSimpleRb(a:cmd,"observer",a:0? a:1 : s:model(1),"app/models/","_observer.rb")
+endfunction
+
+function! s:viewEdit(cmd,...)
+  if a:0 && a:1 =~ '^[^!#:]'
+    let view = matchstr(a:1,'[^!#:]*')
+  elseif rails#buffer().type_name('controller','mailer')
+    let view = s:lastmethod(line('.'))
+  else
+    let view = ''
+  endif
+  if view == ''
+    return s:error("No view name given")
+  elseif view == '.'
+    return s:edit(a:cmd,'app/views')
+  elseif view !~ '/' && s:controller(1) != ''
+    let view = s:controller(1) . '/' . view
+  endif
+  if view !~ '/'
+    return s:error("Cannot find view without controller")
+  endif
+  let file = "app/views/".view
+  let found = s:findview(view)
+  if found != ''
+    let dir = fnamemodify(rails#app().path(found),':h')
+    if !isdirectory(dir)
+      if a:0 && a:1 =~ '!'
+        call mkdir(dir,'p')
+      else
+        return s:error('No such directory')
+      endif
+    endif
+    call s:edit(a:cmd,found)
+  elseif file =~ '\.\w\+$'
+    call s:findedit(a:cmd,file)
+  else
+    let format = s:format(rails#buffer().type_name('mailer') ? 'text' : 'html')
+    if glob(rails#app().path(file.'.'.format).'.*[^~]') != ''
+      let file .= '.' . format
+    endif
+    call s:findedit(a:cmd,file)
+  endif
+endfunction
+
+function! s:findview(name)
+  let self = rails#buffer()
+  let name = a:name
+  let pre = 'app/views/'
+  if name !~# '/'
+    let controller = self.controller_name(1)
+    if controller != ''
+      let name = controller.'/'.name
+    endif
+  endif
+  if name =~# '\.\w\+\.\w\+$' || name =~# '\.'.s:viewspattern().'$'
+    return pre.name
+  else
+    for format in ['.'.s:format('html'), '']
+      for type in s:view_types
+        if self.app().has_file(pre.name.format.'.'.type)
+          return pre.name.format.'.'.type
+        endif
+      endfor
+    endfor
+  endif
+  return ''
+endfunction
+
+function! s:findlayout(name)
+  return s:findview("layouts/".(a:name == '' ? 'application' : a:name))
+endfunction
+
+function! s:layoutEdit(cmd,...)
+  if a:0
+    return s:viewEdit(a:cmd,"layouts/".a:1)
+  endif
+  let file = s:findlayout(s:controller(1))
+  if file == ""
+    let file = s:findlayout("application")
+  endif
+  if file == ""
+    let file = "app/views/layouts/application.html.erb"
+  endif
+  call s:edit(a:cmd,s:sub(file,'^/',''))
+endfunction
+
+function! s:controllerEdit(cmd,...)
+  let suffix = '.rb'
+  if a:0 == 0
+    let controller = s:controller(1)
+    if rails#buffer().type_name() =~# '^view\%(-layout\|-partial\)\@!'
+      let suffix .= '#'.expand('%:t:r')
+    endif
+  else
+    let controller = a:1
+  endif
+  if rails#app().has_file("app/controllers/".controller."_controller.rb") || !rails#app().has_file("app/controllers/".controller.".rb")
+    let suffix = "_controller".suffix
+  endif
+  return s:EditSimpleRb(a:cmd,"controller",controller,"app/controllers/",suffix)
+endfunction
+
+function! s:mailerEdit(cmd,...)
+  return s:EditSimpleRb(a:cmd,"mailer",a:0? a:1 : s:controller(1),"app/mailers/\napp/models/",".rb")
+endfunction
+
+function! s:helperEdit(cmd,...)
+  return s:EditSimpleRb(a:cmd,"helper",a:0? a:1 : s:controller(1),"app/helpers/","_helper.rb")
+endfunction
+
+function! s:stylesheetEdit(cmd,...)
+  let name = a:0 ? a:1 : s:controller(1)
+  if rails#app().has('sass') && rails#app().has_file('public/stylesheets/sass/'.name.'.sass')
+    return s:EditSimpleRb(a:cmd,"stylesheet",name,"public/stylesheets/sass/",".sass",1)
+  elseif rails#app().has('sass') && rails#app().has_file('public/stylesheets/sass/'.name.'.scss')
+    return s:EditSimpleRb(a:cmd,"stylesheet",name,"public/stylesheets/sass/",".scss",1)
+  elseif rails#app().has('lesscss') && rails#app().has_file('app/stylesheets/'.name.'.less')
+    return s:EditSimpleRb(a:cmd,"stylesheet",name,"app/stylesheets/",".less",1)
+  else
+    let types = rails#app().relglob('app/assets/stylesheets/'.name,'.*','')
+    if !empty(types)
+      return s:EditSimpleRb(a:cmd,'stylesheet',name,'app/assets/stylesheets/',types[0],1)
+    else
+      return s:EditSimpleRb(a:cmd,'stylesheet',name,'public/stylesheets/','.css',1)
+    endif
+  endif
+endfunction
+
+function! s:javascriptEdit(cmd,...)
+  let name = a:0 ? a:1 : s:controller(1)
+  if rails#app().has('coffee') && rails#app().has_file('app/scripts/'.name.'.coffee')
+    return s:EditSimpleRb(a:cmd,'javascript',name,'app/scripts/','.coffee',1)
+  elseif rails#app().has('coffee') && rails#app().has_file('app/scripts/'.name.'.js')
+    return s:EditSimpleRb(a:cmd,'javascript',name,'app/scripts/','.js',1)
+  else
+    let types = rails#app().relglob('app/assets/javascripts/'.name,'.*','')
+    if !empty(types)
+      return s:EditSimpleRb(a:cmd,'javascript',name,'app/assets/javascripts/',types[0],1)
+    else
+      return s:EditSimpleRb(a:cmd,'javascript',name,'public/javascripts/','.js',1)
+    endif
+  endif
+endfunction
+
+function! s:unittestEdit(cmd,...)
+  let f = rails#underscore(a:0 ? matchstr(a:1,'[^!#:]*') : s:model(1))
+  let jump = a:0 ? matchstr(a:1,'[!#:].*') : ''
+  if jump =~ '!'
+    let cmd = s:editcmdfor(a:cmd)
+  else
+    let cmd = s:findcmdfor(a:cmd)
+  endif
+  let mapping = {'test': ['test/unit/','_test.rb'], 'spec': ['spec/models/','_spec.rb']}
+  let tests = map(filter(rails#app().test_suites(),'has_key(mapping,v:val)'),'get(mapping,v:val)')
+  if empty(tests)
+    let tests = [mapping['test']]
+  endif
+  for [prefix, suffix] in tests
+    if !a:0 && rails#buffer().type_name('model-aro') && f != '' && f !~# '_observer$'
+      if rails#app().has_file(prefix.f.'_observer'.suffix)
+        return s:findedit(cmd,prefix.f.'_observer'.suffix.jump)
+      endif
+    endif
+  endfor
+  for [prefix, suffix] in tests
+    if rails#app().has_file(prefix.f.suffix)
+      return s:findedit(cmd,prefix.f.suffix.jump)
+    endif
+  endfor
+  return s:EditSimpleRb(a:cmd,"unittest",f.jump,tests[0][0],tests[0][1],1)
+endfunction
+
+function! s:functionaltestEdit(cmd,...)
+  let f = rails#underscore(a:0 ? matchstr(a:1,'[^!#:]*') : s:controller(1))
+  let jump = a:0 ? matchstr(a:1,'[!#:].*') : ''
+  if jump =~ '!'
+    let cmd = s:editcmdfor(a:cmd)
+  else
+    let cmd = s:findcmdfor(a:cmd)
+  endif
+  let mapping = {'test': [['test/functional/'],['_test.rb','_controller_test.rb']], 'spec': [['spec/controllers/','spec/mailers/'],['_spec.rb','_controller_spec.rb']]}
+  let tests = map(filter(rails#app().test_suites(),'has_key(mapping,v:val)'),'get(mapping,v:val)')
+  if empty(tests)
+    let tests = [mapping[tests]]
+  endif
+  for [prefixes, suffixes] in tests
+    for prefix in prefixes
+      for suffix in suffixes
+        if rails#app().has_file(prefix.f.suffix)
+          return s:findedit(cmd,prefix.f.suffix.jump)
+        endif
+      endfor
+    endfor
+  endfor
+  return s:EditSimpleRb(a:cmd,"functionaltest",f.jump,tests[0][0][0],tests[0][1][0],1)
+endfunction
+
+function! s:integrationtestEdit(cmd,...)
+  if !a:0
+    return s:EditSimpleRb(a:cmd,"integrationtest","test/test_helper\nfeatures/support/env\nspec/spec_helper","",".rb")
+  endif
+  let f = rails#underscore(matchstr(a:1,'[^!#:]*'))
+  let jump = matchstr(a:1,'[!#:].*')
+  if jump =~ '!'
+    let cmd = s:editcmdfor(a:cmd)
+  else
+    let cmd = s:findcmdfor(a:cmd)
+  endif
+  let tests = [['test/integration/','_test.rb'], [ 'spec/requests/','_spec.rb'], [ 'spec/integration/','_spec.rb'], [ 'features/','.feature']]
+  call filter(tests, 'isdirectory(rails#app().path(v:val[0]))')
+  if empty(tests)
+    let tests = [['test/integration/','_test.rb']]
+  endif
+  for [prefix, suffix] in tests
+    if rails#app().has_file(prefix.f.suffix)
+      return s:findedit(cmd,prefix.f.suffix.jump)
+    elseif rails#app().has_file(prefix.rails#underscore(f).suffix)
+      return s:findedit(cmd,prefix.rails#underscore(f).suffix.jump)
+    endif
+  endfor
+  return s:EditSimpleRb(a:cmd,"integrationtest",f.jump,tests[0][0],tests[0][1],1)
+endfunction
+
+function! s:specEdit(cmd,...)
+  if a:0
+    return s:EditSimpleRb(a:cmd,"spec",a:1,"spec/","_spec.rb")
+  else
+    call s:EditSimpleRb(a:cmd,"spec","spec_helper","spec/",".rb")
+  endif
+endfunction
+
+function! s:pluginEdit(cmd,...)
+  let cmd = s:findcmdfor(a:cmd)
+  let plugin = ""
+  let extra = ""
+  if RailsFilePath() =~ '\<vendor/plugins/.'
+    let plugin = matchstr(RailsFilePath(),'\<vendor/plugins/\zs[^/]*\ze')
+    let extra = "vendor/plugins/" . plugin . "/\n"
+  endif
+  if a:0
+    if a:1 =~ '^[^/.]*/\=$' && rails#app().has_file("vendor/plugins/".a:1."/init.rb")
+      return s:EditSimpleRb(a:cmd,"plugin",s:sub(a:1,'/$',''),"vendor/plugins/","/init.rb")
+    elseif plugin == ""
+      call s:edit(cmd,"vendor/plugins/".s:sub(a:1,'\.$',''))
+    elseif a:1 == "."
+      call s:findedit(cmd,"vendor/plugins/".plugin)
+    elseif isdirectory(rails#app().path("vendor/plugins/".matchstr(a:1,'^[^/]*')))
+      call s:edit(cmd,"vendor/plugins/".a:1)
+    else
+      call s:findedit(cmd,"vendor/plugins/".a:1."\nvendor/plugins/".plugin."/".a:1)
+    endif
+  else
+    call s:findedit(a:cmd,"Gemfile")
+  endif
+endfunction
+
+function! s:taskEdit(cmd,...)
+  let plugin = ""
+  let extra = ""
+  if RailsFilePath() =~ '\<vendor/plugins/.'
+    let plugin = matchstr(RailsFilePath(),'\<vendor/plugins/[^/]*')
+    let extra = plugin."/tasks/\n".plugin."/lib/tasks/\n"
+  endif
+  if a:0
+    call s:EditSimpleRb(a:cmd,"task",a:1,extra."lib/tasks/",".rake")
+  else
+    call s:findedit(a:cmd,(plugin != "" ? plugin."/Rakefile\n" : "")."Rakefile")
+  endif
+endfunction
+
+function! s:libEdit(cmd,...)
+  let extra = ""
+  if RailsFilePath() =~ '\<vendor/plugins/.'
+    let extra = s:sub(RailsFilePath(),'<vendor/plugins/[^/]*/\zs.*','lib/')."\n"
+  endif
+  if a:0
+    call s:EditSimpleRb(a:cmd,"lib",a:0? a:1 : "",extra."lib/",".rb")
+  else
+    call s:EditSimpleRb(a:cmd,"lib","seeds","db/",".rb")
+  endif
+endfunction
+
+function! s:environmentEdit(cmd,...)
+  if a:0 || rails#app().has_file('config/application.rb')
+    return s:EditSimpleRb(a:cmd,"environment",a:0? a:1 : "../application","config/environments/",".rb")
+  else
+    return s:EditSimpleRb(a:cmd,"environment","environment","config/",".rb")
+  endif
+endfunction
+
+function! s:initializerEdit(cmd,...)
+  return s:EditSimpleRb(a:cmd,"initializer",a:0? a:1 : "../routes","config/initializers/",".rb")
+endfunction
+
+" }}}1
+" Alternate/Related {{{1
+
+function! s:findcmdfor(cmd)
+  let bang = ''
+  if a:cmd =~ '\!$'
+    let bang = '!'
+    let cmd = s:sub(a:cmd,'\!$','')
+  else
+    let cmd = a:cmd
+  endif
+  if cmd =~ '^\d'
+    let num = matchstr(cmd,'^\d\+')
+    let cmd = s:sub(cmd,'^\d+','')
+  else
+    let num = ''
+  endif
+  if cmd == '' || cmd == 'E' || cmd == 'F'
+    return num.'find'.bang
+  elseif cmd == 'S'
+    return num.'sfind'.bang
+  elseif cmd == 'V'
+    return 'vert '.num.'sfind'.bang
+  elseif cmd == 'T'
+    return num.'tabfind'.bang
+  elseif cmd == 'D'
+    return num.'read'.bang
+  else
+    return num.cmd.bang
+  endif
+endfunction
+
+function! s:editcmdfor(cmd)
+  let cmd = s:findcmdfor(a:cmd)
+  let cmd = s:sub(cmd,'<sfind>','split')
+  let cmd = s:sub(cmd,'find>','edit')
+  return cmd
+endfunction
+
+function! s:try(cmd) abort
+  if !exists(":try")
+    " I've seen at least one weird setup without :try
+    exe a:cmd
+  else
+    try
+      exe a:cmd
+    catch
+      call s:error(s:sub(v:exception,'^.{-}:\zeE',''))
+      return 0
+    endtry
+  endif
+  return 1
+endfunction
+
+function! s:findedit(cmd,files,...) abort
+  let cmd = s:findcmdfor(a:cmd)
+  let files = type(a:files) == type([]) ? copy(a:files) : split(a:files,"\n")
+  if len(files) == 1
+    let file = files[0]
+  else
+    let file = get(filter(copy(files),'rails#app().has_file(s:sub(v:val,"#.*|:\\d*$",""))'),0,get(files,0,''))
+  endif
+  if file =~ '[#!]\|:\d*\%(:in\)\=$'
+    let djump = matchstr(file,'!.*\|#\zs.*\|:\zs\d*\ze\%(:in\)\=$')
+    let file = s:sub(file,'[#!].*|:\d*%(:in)=$','')
+  else
+    let djump = ''
+  endif
+  if file == ''
+    let testcmd = "edit"
+  elseif isdirectory(rails#app().path(file))
+    let arg = file == "." ? rails#app().path() : rails#app().path(file)
+    let testcmd = s:editcmdfor(cmd).' '.(a:0 ? a:1 . ' ' : '').s:escarg(arg)
+    exe testcmd
+    return
+  elseif rails#app().path() =~ '://' || cmd =~ 'edit' || cmd =~ 'split'
+    if file !~ '^/' && file !~ '^\w:' && file !~ '://'
+      let file = s:escarg(rails#app().path(file))
+    endif
+    let testcmd = s:editcmdfor(cmd).' '.(a:0 ? a:1 . ' ' : '').file
+  else
+    let testcmd = cmd.' '.(a:0 ? a:1 . ' ' : '').file
+  endif
+  if s:try(testcmd)
+    call s:djump(djump)
+  endif
+endfunction
+
+function! s:edit(cmd,file,...)
+  let cmd = s:editcmdfor(a:cmd)
+  let cmd .= ' '.(a:0 ? a:1 . ' ' : '')
+  let file = a:file
+  if file !~ '^/' && file !~ '^\w:' && file !~ '://'
+    exe cmd."`=fnamemodify(rails#app().path(file),':.')`"
+  else
+    exe cmd.file
+  endif
+endfunction
+
+function! s:Alternate(cmd,line1,line2,count,...)
+  if a:0
+    if a:count && a:cmd !~# 'D'
+      return call('s:Find',[1,a:line1.a:cmd]+a:000)
+    elseif a:count
+      return call('s:Edit',[1,a:line1.a:cmd]+a:000)
+    else
+      return call('s:Edit',[1,a:cmd]+a:000)
+    endif
+  else
+    let file = s:getopt(a:count ? 'related' : 'alternate', 'bl')
+    if file == ''
+      let file = rails#buffer().related(a:count)
+    endif
+    if file != ''
+      call s:findedit(a:cmd,file)
+    else
+      call s:warn("No alternate file is defined")
+    endif
+  endif
+endfunction
+
+function! s:Related(cmd,line1,line2,count,...)
+  if a:count == 0 && a:0 == 0
+    return s:Alternate(a:cmd,a:line1,a:line1,a:line1)
+  else
+    return call('s:Alternate',[a:cmd,a:line1,a:line2,a:count]+a:000)
+  endif
+endfunction
+
+function! s:Complete_related(A,L,P)
+  if a:L =~# '^[[:alpha:]]'
+    return s:Complete_edit(a:A,a:L,a:P)
+  else
+    return s:Complete_find(a:A,a:L,a:P)
+  endif
+endfunction
+
+function! s:readable_related(...) dict abort
+  let f = self.name()
+  if a:0 && a:1
+    let lastmethod = self.last_method(a:1)
+    if self.type_name('controller','mailer') && lastmethod != ""
+      let root = s:sub(s:sub(s:sub(f,'/application%(_controller)=\.rb$','/shared_controller.rb'),'/%(controllers|models|mailers)/','/views/'),'%(_controller)=\.rb$','/'.lastmethod)
+      let format = self.last_format(a:1)
+      if format == ''
+        let format = self.type_name('mailer') ? 'text' : 'html'
+      endif
+      if glob(self.app().path().'/'.root.'.'.format.'.*[^~]') != ''
+        return root . '.' . format
+      else
+        return root
+      endif
+    elseif f =~ '\<config/environments/'
+      return "config/database.yml#". fnamemodify(f,':t:r')
+    elseif f =~ '\<config/database\.yml$'
+      if lastmethod != ""
+        return "config/environments/".lastmethod.".rb"
+      else
+        return "config/application.rb\nconfig/environment.rb"
+      endif
+    elseif f =~ '\<config/routes\.rb$'      | return "config/database.yml"
+    elseif f =~ '\<config/\%(application\|environment\)\.rb$'
+      return "config/routes.rb"
+    elseif self.type_name('view-layout')
+      return s:sub(s:sub(f,'/views/','/controllers/'),'/layouts/(\k+)\..*$','/\1_controller.rb')
+    elseif self.type_name('view')
+      let controller  = s:sub(s:sub(f,'/views/','/controllers/'),'/(\k+%(\.\k+)=)\..*$','_controller.rb#\1')
+      let controller2 = s:sub(s:sub(f,'/views/','/controllers/'),'/(\k+%(\.\k+)=)\..*$','.rb#\1')
+      let mailer      = s:sub(s:sub(f,'/views/','/mailers/'),'/(\k+%(\.\k+)=)\..*$','.rb#\1')
+      let model       = s:sub(s:sub(f,'/views/','/models/'),'/(\k+)\..*$','.rb#\1')
+      if self.app().has_file(s:sub(controller,'#.{-}$',''))
+        return controller
+      elseif self.app().has_file(s:sub(controller2,'#.{-}$',''))
+        return controller2
+      elseif self.app().has_file(s:sub(mailer,'#.{-}$',''))
+        return mailer
+      elseif self.app().has_file(s:sub(model,'#.{-}$','')) || model =~ '_mailer\.rb#'
+        return model
+      else
+        return controller
+      endif
+    elseif self.type_name('controller')
+      return s:sub(s:sub(f,'/controllers/','/helpers/'),'%(_controller)=\.rb$','_helper.rb')
+    " elseif self.type_name('helper')
+      " return s:findlayout(s:controller())
+    elseif self.type_name('model-arb')
+      let table_name = matchstr(join(self.getline(1,50),"\n"),'\n\s*set_table_name\s*[:"'']\zs\w\+')
+      if table_name == ''
+        let table_name = rails#pluralize(s:gsub(s:sub(fnamemodify(f,':r'),'.{-}<app/models/',''),'/','_'))
+      endif
+      return self.app().migration('0#'.table_name)
+    elseif self.type_name('model-aro')
+      return s:sub(f,'_observer\.rb$','.rb')
+    elseif self.type_name('db-schema')
+      return self.app().migration(1)
+    endif
+  endif
+  if f =~ '\<config/environments/'
+    return "config/application.rb\nconfig/environment.rb"
+  elseif f == 'README'
+    return "config/database.yml"
+  elseif f =~ '\<config/database\.yml$'   | return "config/routes.rb"
+  elseif f =~ '\<config/routes\.rb$'
+    return "config/application.rb\nconfig/environment.rb"
+  elseif f =~ '\<config/\%(application\|environment\)\.rb$'
+    return "config/database.yml"
+  elseif f ==# 'Gemfile'
+    return 'Gemfile.lock'
+  elseif f ==# 'Gemfile.lock'
+    return 'Gemfile'
+  elseif f =~ '\<db/migrate/'
+    let migrations = sort(self.app().relglob('db/migrate/','*','.rb'))
+    let me = matchstr(f,'\<db/migrate/\zs.*\ze\.rb$')
+    if !exists('l:lastmethod') || lastmethod == 'down'
+      let candidates = reverse(filter(copy(migrations),'v:val < me'))
+      let migration = "db/migrate/".get(candidates,0,migrations[-1]).".rb"
+    else
+      let candidates = filter(copy(migrations),'v:val > me')
+      let migration = "db/migrate/".get(candidates,0,migrations[0]).".rb"
+    endif
+    return migration . (exists('l:lastmethod') && lastmethod != '' ? '#'.lastmethod : '')
+  elseif f =~ '\<application\.js$'
+    return "app/helpers/application_helper.rb"
+  elseif self.type_name('javascript')
+    return "public/javascripts/application.js"
+  elseif self.type_name('db/schema')
+    return self.app().migration('')
+  elseif self.type_name('view')
+    let spec1 = fnamemodify(f,':s?\<app/?spec/?')."_spec.rb"
+    let spec2 = fnamemodify(f,':r:s?\<app/?spec/?')."_spec.rb"
+    let spec3 = fnamemodify(f,':r:r:s?\<app/?spec/?')."_spec.rb"
+    if self.app().has_file(spec1)
+      return spec1
+    elseif self.app().has_file(spec2)
+      return spec2
+    elseif self.app().has_file(spec3)
+      return spec3
+    elseif self.app().has('spec')
+      return spec2
+    else
+      if self.type_name('view-layout')
+        let dest = fnamemodify(f,':r:s?/layouts\>??').'/layout.'.fnamemodify(f,':e')
+      else
+        let dest = f
+      endif
+      return s:sub(s:sub(dest,'<app/views/','test/functional/'),'/[^/]*$','_controller_test.rb')
+    endif
+  elseif self.type_name('controller-api')
+    let api = s:sub(s:sub(f,'/controllers/','/apis/'),'_controller\.rb$','_api.rb')
+    return api
+  elseif self.type_name('api')
+    return s:sub(s:sub(f,'/apis/','/controllers/'),'_api\.rb$','_controller.rb')
+  elseif self.type_name('fixtures') && f =~ '\<spec/'
+    let file = rails#singularize(fnamemodify(f,":t:r")).'_spec.rb'
+    return file
+  elseif self.type_name('fixtures')
+    let file = rails#singularize(fnamemodify(f,":t:r")).'_test.rb'
+    return file
+  elseif f == ''
+    call s:warn("No filename present")
+  elseif f =~ '\<test/unit/routing_test\.rb$'
+    return 'config/routes.rb'
+  elseif self.type_name('spec-view')
+    return s:sub(s:sub(f,'<spec/','app/'),'_spec\.rb$','')
+  elseif fnamemodify(f,":e") == "rb"
+    let file = fnamemodify(f,":r")
+    if file =~ '_\%(test\|spec\)$'
+      let file = s:sub(file,'_%(test|spec)$','.rb')
+    else
+      let file .= '_test.rb'
+    endif
+    if self.type_name('helper')
+      return s:sub(file,'<app/helpers/','test/unit/helpers/')."\n".s:sub(s:sub(file,'_test\.rb$','_spec.rb'),'<app/helpers/','spec/helpers/')
+    elseif self.type_name('model')
+      return s:sub(file,'<app/models/','test/unit/')."\n".s:sub(s:sub(file,'_test\.rb$','_spec.rb'),'<app/models/','spec/models/')
+    elseif self.type_name('controller')
+      return s:sub(file,'<app/controllers/','test/functional/')."\n".s:sub(s:sub(file,'_test\.rb$','_spec.rb'),'app/controllers/','spec/controllers/')
+    elseif self.type_name('mailer')
+      return s:sub(file,'<app/m%(ailer|odel)s/','test/unit/')."\n".s:sub(s:sub(file,'_test\.rb$','_spec.rb'),'<app/','spec/')
+    elseif self.type_name('test-unit')
+      return s:sub(s:sub(file,'test/unit/helpers/','app/helpers/'),'test/unit/','app/models/')."\n".s:sub(file,'test/unit/','lib/')
+    elseif self.type_name('test-functional')
+      if file =~ '_api\.rb'
+        return s:sub(file,'test/functional/','app/apis/')
+      elseif file =~ '_controller\.rb'
+        return s:sub(file,'test/functional/','app/controllers/')
+      else
+        return s:sub(file,'test/functional/','')
+      endif
+    elseif self.type_name('spec-lib')
+      return s:sub(file,'<spec/','')
+    elseif self.type_name('lib')
+      return s:sub(f, '<lib/(.*)\.rb$', 'test/unit/\1_test.rb')."\n".s:sub(f, '<lib/(.*)\.rb$', 'spec/lib/\1_spec.rb')
+    elseif self.type_name('spec')
+      return s:sub(file,'<spec/','app/')
+    elseif file =~ '\<vendor/.*/lib/'
+      return s:sub(file,'<vendor/.{-}/\zslib/','test/')
+    elseif file =~ '\<vendor/.*/test/'
+      return s:sub(file,'<vendor/.{-}/\zstest/','lib/')
+    else
+      return fnamemodify(file,':t')."\n".s:sub(s:sub(f,'\.rb$','_spec.rb'),'^app/','spec/')
+    endif
+  else
+    return ""
+  endif
+endfunction
+
+call s:add_methods('readable',['related'])
+
+" }}}1
+" Partial Extraction {{{1
+
+function! s:Extract(bang,...) range abort
+  if a:0 == 0 || a:0 > 1
+    return s:error("Incorrect number of arguments")
+  endif
+  if a:1 =~ '[^a-z0-9_/.]'
+    return s:error("Invalid partial name")
+  endif
+  let rails_root = rails#app().path()
+  let ext = expand("%:e")
+  let file = s:sub(a:1,'%(/|^)\zs_\ze[^/]*$','')
+  let first = a:firstline
+  let last = a:lastline
+  let range = first.",".last
+  if rails#buffer().type_name('view-layout')
+    if RailsFilePath() =~ '\<app/views/layouts/application\>'
+      let curdir = 'app/views/shared'
+      if file !~ '/'
+        let file = "shared/" .file
+      endif
+    else
+      let curdir = s:sub(RailsFilePath(),'.*<app/views/layouts/(.*)%(\.\w*)$','app/views/\1')
+    endif
+  else
+    let curdir = fnamemodify(RailsFilePath(),':h')
+  endif
+  let curdir = rails_root."/".curdir
+  let dir = fnamemodify(file,":h")
+  let fname = fnamemodify(file,":t")
+  if fnamemodify(fname,":e") == ""
+    let name = fname
+    let fname .= ".".matchstr(expand("%:t"),'\.\zs.*')
+  elseif fnamemodify(fname,":e") !~ '^'.s:viewspattern().'$'
+    let name = fnamemodify(fname,":r")
+    let fname .= ".".ext
+  else
+    let name = fnamemodify(fname,":r:r")
+  endif
+  let var = "@".name
+  let collection = ""
+  if dir =~ '^/'
+    let out = (rails_root).dir."/_".fname
+  elseif dir == "" || dir == "."
+    let out = (curdir)."/_".fname
+  elseif isdirectory(curdir."/".dir)
+    let out = (curdir)."/".dir."/_".fname
+  else
+    let out = (rails_root)."/app/views/".dir."/_".fname
+  endif
+  if filereadable(out) && !a:bang
+    return s:error('E13: File exists (add ! to override)')
+  endif
+  if !isdirectory(fnamemodify(out,':h'))
+    if a:bang
+      call mkdir(fnamemodify(out,':h'),'p')
+    else
+      return s:error('No such directory')
+    endif
+  endif
+  " No tabs, they'll just complicate things
+  if ext =~? '^\%(rhtml\|erb\|dryml\)$'
+    let erub1 = '\<\%\s*'
+    let erub2 = '\s*-=\%\>'
+  else
+    let erub1 = ''
+    let erub2 = ''
+  endif
+  let spaces = matchstr(getline(first),"^ *")
+  if getline(last+1) =~ '\v^\s*'.erub1.'end'.erub2.'\s*$'
+    let fspaces = matchstr(getline(last+1),"^ *")
+    if getline(first-1) =~ '\v^'.fspaces.erub1.'for\s+(\k+)\s+in\s+([^ %>]+)'.erub2.'\s*$'
+      let collection = s:sub(getline(first-1),'^'.fspaces.erub1.'for\s+(\k+)\s+in\s+([^ >]+)'.erub2.'\s*$','\1>\2')
+    elseif getline(first-1) =~ '\v^'.fspaces.erub1.'([^ %>]+)\.each\s+do\s+\|\s*(\k+)\s*\|'.erub2.'\s*$'
+      let collection = s:sub(getline(first-1),'^'.fspaces.erub1.'([^ %>]+)\.each\s+do\s+\|\s*(\k+)\s*\|'.erub2.'\s*$','\2>\1')
+    endif
+    if collection != ''
+      let var = matchstr(collection,'^\k\+')
+      let collection = s:sub(collection,'^\k+\>','')
+      let first -= 1
+      let last += 1
+    endif
+  else
+    let fspaces = spaces
+  endif
+  let renderstr = "render :partial => '".fnamemodify(file,":r:r")."'"
+  if collection != ""
+    let renderstr .= ", :collection => ".collection
+  elseif "@".name != var
+    let renderstr .= ", :object => ".var
+  endif
+  if ext =~? '^\%(rhtml\|erb\|dryml\)$'
+    let renderstr = "<%= ".renderstr." %>"
+  elseif ext == "rxml" || ext == "builder"
+    let renderstr = "xml << ".s:sub(renderstr,"render ","render(").")"
+  elseif ext == "rjs"
+    let renderstr = "page << ".s:sub(renderstr,"render ","render(").")"
+  elseif ext == "haml"
+    let renderstr = "= ".renderstr
+  elseif ext == "mn"
+    let renderstr = "_".renderstr
+  endif
+  let buf = @@
+  silent exe range."yank"
+  let partial = @@
+  let @@ = buf
+  let old_ai = &ai
+  try
+    let &ai = 0
+    silent exe "norm! :".first.",".last."change\<CR>".fspaces.renderstr."\<CR>.\<CR>"
+  finally
+    let &ai = old_ai
+  endtry
+  if renderstr =~ '<%'
+    norm ^6w
+  else
+    norm ^5w
+  endif
+  let ft = &ft
+  let shortout = fnamemodify(out,':.')
+  silent split `=shortout`
+  silent %delete
+  let &ft = ft
+  let @@ = partial
+  silent put
+  0delete
+  let @@ = buf
+  if spaces != ""
+    silent! exe '%substitute/^'.spaces.'//'
+  endif
+  silent! exe '%substitute?\%(\w\|[@:"'."'".'-]\)\@<!'.var.'\>?'.name.'?g'
+  1
+endfunction
+
+" }}}1
+" Migration Inversion {{{1
+
+function! s:mkeep(str)
+  " Things to keep (like comments) from a migration statement
+  return matchstr(a:str,' #[^{].*')
+endfunction
+
+function! s:mextargs(str,num)
+  if a:str =~ '^\s*\w\+\s*('
+    return s:sub(matchstr(a:str,'^\s*\w\+\s*\zs(\%([^,)]\+[,)]\)\{,'.a:num.'\}'),',$',')')
+  else
+    return s:sub(s:sub(matchstr(a:str,'\w\+\>\zs\s*\%([^,){ ]*[, ]*\)\{,'.a:num.'\}'),'[, ]*$',''),'^\s+',' ')
+  endif
+endfunction
+
+function! s:migspc(line)
+  return matchstr(a:line,'^\s*')
+endfunction
+
+function! s:invertrange(beg,end)
+  let str = ""
+  let lnum = a:beg
+  while lnum <= a:end
+    let line = getline(lnum)
+    let add = ""
+    if line == ''
+      let add = ' '
+    elseif line =~ '^\s*\(#[^{].*\)\=$'
+      let add = line
+    elseif line =~ '\<create_table\>'
+      let add = s:migspc(line)."drop_table".s:mextargs(line,1).s:mkeep(line)
+      let lnum = s:endof(lnum)
+    elseif line =~ '\<drop_table\>'
+      let add = s:sub(line,'<drop_table>\s*\(=\s*([^,){ ]*).*','create_table \1 do |t|'."\n".matchstr(line,'^\s*').'end').s:mkeep(line)
+    elseif line =~ '\<add_column\>'
+      let add = s:migspc(line).'remove_column'.s:mextargs(line,2).s:mkeep(line)
+    elseif line =~ '\<remove_column\>'
+      let add = s:sub(line,'<remove_column>','add_column')
+    elseif line =~ '\<add_index\>'
+      let add = s:migspc(line).'remove_index'.s:mextargs(line,1)
+      let mat = matchstr(line,':name\s*=>\s*\zs[^ ,)]*')
+      if mat != ''
+        let add = s:sub(add,'\)=$',', :name => '.mat.'&')
+      else
+        let mat = matchstr(line,'\<add_index\>[^,]*,\s*\zs\%(\[[^]]*\]\|[:"'."'".']\w*["'."'".']\=\)')
+        if mat != ''
+          let add = s:sub(add,'\)=$',', :column => '.mat.'&')
+        endif
+      endif
+      let add .= s:mkeep(line)
+    elseif line =~ '\<remove_index\>'
+      let add = s:sub(s:sub(line,'<remove_index','add_index'),':column\s*\=\>\s*','')
+    elseif line =~ '\<rename_\%(table\|column\|index\)\>'
+      let add = s:sub(line,'<rename_%(table\s*\(=\s*|%(column|index)\s*\(=\s*[^,]*,\s*)\zs([^,]*)(,\s*)([^,]*)','\3\2\1')
+    elseif line =~ '\<change_column\>'
+      let add = s:migspc(line).'change_column'.s:mextargs(line,2).s:mkeep(line)
+    elseif line =~ '\<change_column_default\>'
+      let add = s:migspc(line).'change_column_default'.s:mextargs(line,2).s:mkeep(line)
+    elseif line =~ '\.update_all(\(["'."'".']\).*\1)$' || line =~ '\.update_all \(["'."'".']\).*\1$'
+      " .update_all('a = b') => .update_all('b = a')
+      let pre = matchstr(line,'^.*\.update_all[( ][}'."'".'"]')
+      let post = matchstr(line,'["'."'".'])\=$')
+      let mat = strpart(line,strlen(pre),strlen(line)-strlen(pre)-strlen(post))
+      let mat = s:gsub(','.mat.',','%(,\s*)@<=([^ ,=]{-})(\s*\=\s*)([^,=]{-})%(\s*,)@=','\3\2\1')
+      let add = pre.s:sub(s:sub(mat,'^,',''),',$','').post
+    elseif line =~ '^s\*\%(if\|unless\|while\|until\|for\)\>'
+      let lnum = s:endof(lnum)
+    endif
+    if lnum == 0
+      return -1
+    endif
+    if add == ""
+      let add = s:sub(line,'^\s*\zs.*','raise ActiveRecord::IrreversibleMigration')
+    elseif add == " "
+      let add = ""
+    endif
+    let str = add."\n".str
+    let lnum += 1
+  endwhile
+  let str = s:gsub(str,'(\s*raise ActiveRecord::IrreversibleMigration\n)+','\1')
+  return str
+endfunction
+
+function! s:Invert(bang)
+  let err = "Could not parse method"
+  let src = "up"
+  let dst = "down"
+  let beg = search('\%('.&l:define.'\).*'.src.'\>',"w")
+  let end = s:endof(beg)
+  if beg + 1 == end
+    let src = "down"
+    let dst = "up"
+    let beg = search('\%('.&l:define.'\).*'.src.'\>',"w")
+    let end = s:endof(beg)
+  endif
+  if !beg || !end
+    return s:error(err)
+  endif
+  let str = s:invertrange(beg+1,end-1)
+  if str == -1
+    return s:error(err)
+  endif
+  let beg = search('\%('.&l:define.'\).*'.dst.'\>',"w")
+  let end = s:endof(beg)
+  if !beg || !end
+    return s:error(err)
+  endif
+  if foldclosed(beg) > 0
+    exe beg."foldopen!"
+  endif
+  if beg + 1 < end
+    exe (beg+1).",".(end-1)."delete _"
+  endif
+  if str != ''
+    exe beg.'put =str'
+    exe 1+beg
+  endif
+endfunction
+
+" }}}1
+" Cache {{{1
+
+let s:cache_prototype = {'dict': {}}
+
+function! s:cache_clear(...) dict
+  if a:0 == 0
+    let self.dict = {}
+  elseif has_key(self,'dict') && has_key(self.dict,a:1)
+    unlet! self.dict[a:1]
+  endif
+endfunction
+
+function! rails#cache_clear(...)
+  if exists('b:rails_root')
+    return call(rails#app().cache.clear,a:000,rails#app().cache)
+  endif
+endfunction
+
+function! s:cache_get(...) dict
+  if a:0 == 1
+    return self.dict[a:1]
+  else
+    return self.dict
+  endif
+endfunction
+
+function! s:cache_has(key) dict
+  return has_key(self.dict,a:key)
+endfunction
+
+function! s:cache_needs(key) dict
+  return !has_key(self.dict,a:key)
+endfunction
+
+function! s:cache_set(key,value) dict
+  let self.dict[a:key] = a:value
+endfunction
+
+call s:add_methods('cache', ['clear','needs','has','get','set'])
+
+let s:app_prototype.cache = s:cache_prototype
+
+" }}}1
+" Syntax {{{1
+
+function! s:resetomnicomplete()
+  if exists("+completefunc") && &completefunc == 'syntaxcomplete#Complete'
+    if exists("g:loaded_syntax_completion")
+      " Ugly but necessary, until we have our own completion
+      unlet g:loaded_syntax_completion
+      silent! delfunction syntaxcomplete#Complete
+    endif
+  endif
+endfunction
+
+function! s:helpermethods()
+  return ""
+        \."action_name atom_feed audio_path audio_tag auto_discovery_link_tag "
+        \."button_tag button_to button_to_function "
+        \."cache capture cdata_section check_box check_box_tag collection_select concat content_for content_tag content_tag_for controller controller_name controller_path convert_to_model cookies csrf_meta_tag csrf_meta_tags current_cycle cycle "
+        \."date_select datetime_select debug distance_of_time_in_words distance_of_time_in_words_to_now div_for dom_class dom_id "
+        \."email_field email_field_tag escape_javascript escape_once excerpt "
+        \."favicon_link_tag field_set_tag fields_for file_field file_field_tag flash form_for form_tag "
+        \."grouped_collection_select grouped_options_for_select "
+        \."headers hidden_field hidden_field_tag highlight "
+        \."image_alt image_path image_submit_tag image_tag "
+        \."j javascript_cdata_section javascript_include_tag javascript_path javascript_tag "
+        \."l label label_tag link_to link_to_function link_to_if link_to_unless link_to_unless_current localize logger "
+        \."mail_to "
+        \."number_field number_field_tag number_to_currency number_to_human number_to_human_size number_to_percentage number_to_phone number_with_delimiter number_with_precision "
+        \."option_groups_from_collection_for_select options_for_select options_from_collection_for_select "
+        \."params password_field password_field_tag path_to_audio path_to_image path_to_javascript path_to_stylesheet path_to_video phone_field phone_field_tag pluralize provide "
+        \."radio_button radio_button_tag range_field range_field_tag raw render request request_forgery_protection_token reset_cycle response "
+        \."safe_concat safe_join sanitize sanitize_css search_field search_field_tag select select_date select_datetime select_day select_hour select_minute select_month select_second select_tag select_time select_year session simple_format strip_links strip_tags stylesheet_link_tag stylesheet_path submit_tag "
+        \."t tag telephone_field telephone_field_tag text_area text_area_tag text_field text_field_tag time_ago_in_words time_select time_tag time_zone_options_for_select time_zone_select translate truncate "
+        \."url_field url_field_tag url_for url_options "
+        \."video_path video_tag "
+        \."word_wrap"
+endfunction
+
+function! s:app_user_classes() dict
+  if self.cache.needs("user_classes")
+    let controllers = self.relglob("app/controllers/","**/*",".rb")
+    call map(controllers,'v:val == "application" ? v:val."_controller" : v:val')
+    let classes =
+          \ self.relglob("app/models/","**/*",".rb") +
+          \ controllers +
+          \ self.relglob("app/helpers/","**/*",".rb") +
+          \ self.relglob("lib/","**/*",".rb")
+    call map(classes,'rails#camelize(v:val)')
+    call self.cache.set("user_classes",classes)
+  endif
+  return self.cache.get('user_classes')
+endfunction
+
+function! s:app_user_assertions() dict
+  if self.cache.needs("user_assertions")
+    if self.has_file("test/test_helper.rb")
+      let assertions = map(filter(s:readfile(self.path("test/test_helper.rb")),'v:val =~ "^  def assert_"'),'matchstr(v:val,"^  def \\zsassert_\\w\\+")')
+    else
+      let assertions = []
+    endif
+    call self.cache.set("user_assertions",assertions)
+  endif
+  return self.cache.get('user_assertions')
+endfunction
+
+call s:add_methods('app', ['user_classes','user_assertions'])
+
+function! s:BufSyntax()
+  if (!exists("g:rails_syntax") || g:rails_syntax)
+    let buffer = rails#buffer()
+    let s:javascript_functions = "$ $$ $A $F $H $R $w jQuery"
+    let classes = s:gsub(join(rails#app().user_classes(),' '),'::',' ')
+    if &syntax == 'ruby'
+      if classes != ''
+        exe "syn keyword rubyRailsUserClass ".classes." containedin=rubyClassDeclaration,rubyModuleDeclaration,rubyClass,rubyModule"
+      endif
+      if buffer.type_name() == ''
+        syn keyword rubyRailsMethod params request response session headers cookies flash
+      endif
+      if buffer.type_name('api')
+        syn keyword rubyRailsAPIMethod api_method inflect_names
+      endif
+      if buffer.type_name() ==# 'model' || buffer.type_name('model-arb')
+        syn keyword rubyRailsARMethod default_scope named_scope scope serialize
+        syn keyword rubyRailsARAssociationMethod belongs_to has_one has_many has_and_belongs_to_many composed_of accepts_nested_attributes_for
+        syn keyword rubyRailsARCallbackMethod before_create before_destroy before_save before_update before_validation before_validation_on_create before_validation_on_update
+        syn keyword rubyRailsARCallbackMethod after_create after_destroy after_save after_update after_validation after_validation_on_create after_validation_on_update
+        syn keyword rubyRailsARCallbackMethod around_create around_destroy around_save around_update
+        syn keyword rubyRailsARCallbackMethod after_commit after_find after_initialize after_rollback after_touch
+        syn keyword rubyRailsARClassMethod attr_accessible attr_protected attr_readonly establish_connection set_inheritance_column set_locking_column set_primary_key set_sequence_name set_table_name
+        syn keyword rubyRailsARValidationMethod validate validates validate_on_create validate_on_update validates_acceptance_of validates_associated validates_confirmation_of validates_each validates_exclusion_of validates_format_of validates_inclusion_of validates_length_of validates_numericality_of validates_presence_of validates_size_of validates_uniqueness_of
+        syn keyword rubyRailsMethod logger
+      endif
+      if buffer.type_name('model-aro')
+        syn keyword rubyRailsARMethod observe
+      endif
+      if buffer.type_name('mailer')
+        syn keyword rubyRailsMethod logger url_for polymorphic_path polymorphic_url
+        syn keyword rubyRailsRenderMethod mail render
+        syn keyword rubyRailsControllerMethod attachments default helper helper_attr helper_method
+      endif
+      if buffer.type_name('helper','view')
+        syn keyword rubyRailsViewMethod polymorphic_path polymorphic_url
+        exe "syn keyword rubyRailsHelperMethod ".s:gsub(s:helpermethods(),'<%(content_for|select)\s+','')
+        syn match rubyRailsHelperMethod '\<select\>\%(\s*{\|\s*do\>\|\s*(\=\s*&\)\@!'
+        syn match rubyRailsHelperMethod '\<\%(content_for?\=\|current_page?\)'
+        syn match rubyRailsViewMethod '\.\@<!\<\(h\|html_escape\|u\|url_encode\)\>'
+        if buffer.type_name('view-partial')
+          syn keyword rubyRailsMethod local_assigns
+        endif
+      elseif buffer.type_name('controller')
+        syn keyword rubyRailsMethod params request response session headers cookies flash
+        syn keyword rubyRailsRenderMethod render
+        syn keyword rubyRailsMethod logger polymorphic_path polymorphic_url
+        syn keyword rubyRailsControllerMethod helper helper_attr helper_method filter layout url_for serialize exempt_from_layout filter_parameter_logging hide_action cache_sweeper protect_from_forgery caches_page cache_page caches_action expire_page expire_action rescue_from
+        syn keyword rubyRailsRenderMethod head redirect_to render_to_string respond_with
+        syn match   rubyRailsRenderMethod '\<respond_to\>?\@!'
+        syn keyword rubyRailsFilterMethod before_filter append_before_filter prepend_before_filter after_filter append_after_filter prepend_after_filter around_filter append_around_filter prepend_around_filter skip_before_filter skip_after_filter
+        syn keyword rubyRailsFilterMethod verify
+      endif
+      if buffer.type_name('db-migration','db-schema')
+        syn keyword rubyRailsMigrationMethod create_table change_table drop_table rename_table add_column rename_column change_column change_column_default remove_column add_index remove_index rename_index execute
+      endif
+      if buffer.type_name('test')
+        if !empty(rails#app().user_assertions())
+          exe "syn keyword rubyRailsUserMethod ".join(rails#app().user_assertions())
+        endif
+        syn keyword rubyRailsTestMethod add_assertion assert assert_block assert_equal assert_in_delta assert_instance_of assert_kind_of assert_match assert_nil assert_no_match assert_not_equal assert_not_nil assert_not_same assert_nothing_raised assert_nothing_thrown assert_operator assert_raise assert_respond_to assert_same assert_send assert_throws assert_recognizes assert_generates assert_routing flunk fixtures fixture_path use_transactional_fixtures use_instantiated_fixtures assert_difference assert_no_difference assert_valid
+        syn keyword rubyRailsTestMethod test setup teardown
+        if !buffer.type_name('test-unit')
+          syn match   rubyRailsTestControllerMethod  '\.\@<!\<\%(get\|post\|put\|delete\|head\|process\|assigns\)\>'
+          syn keyword rubyRailsTestControllerMethod get_via_redirect post_via_redirect put_via_redirect delete_via_redirect request_via_redirect
+          syn keyword rubyRailsTestControllerMethod assert_response assert_redirected_to assert_template assert_recognizes assert_generates assert_routing assert_dom_equal assert_dom_not_equal assert_select assert_select_rjs assert_select_encoded assert_select_email assert_tag assert_no_tag
+        endif
+      elseif buffer.type_name('spec')
+        syn keyword rubyRailsTestMethod describe context it its specify shared_examples_for it_should_behave_like before after around subject fixtures controller_name helper_name
+        syn match rubyRailsTestMethod '\<let\>!\='
+        syn keyword rubyRailsTestMethod violated pending expect double mock mock_model stub_model
+        syn match rubyRailsTestMethod '\.\@<!\<stub\>!\@!'
+        if !buffer.type_name('spec-model')
+          syn match   rubyRailsTestControllerMethod  '\.\@<!\<\%(get\|post\|put\|delete\|head\|process\|assigns\)\>'
+          syn keyword rubyRailsTestControllerMethod  integrate_views
+          syn keyword rubyRailsMethod params request response session flash
+          syn keyword rubyRailsMethod polymorphic_path polymorphic_url
+        endif
+      endif
+      if buffer.type_name('task')
+        syn match rubyRailsRakeMethod '^\s*\zs\%(task\|file\|namespace\|desc\|before\|after\|on\)\>\%(\s*=\)\@!'
+      endif
+      if buffer.type_name('model-awss')
+        syn keyword rubyRailsMethod member
+      endif
+      if buffer.type_name('config-routes')
+        syn match rubyRailsMethod '\.\zs\%(connect\|named_route\)\>'
+        syn keyword rubyRailsMethod match get put post delete redirect root resource resources collection member nested scope namespace controller constraints
+      endif
+      syn keyword rubyRailsMethod debugger
+      syn keyword rubyRailsMethod alias_attribute alias_method_chain attr_accessor_with_default attr_internal attr_internal_accessor attr_internal_reader attr_internal_writer delegate mattr_accessor mattr_reader mattr_writer superclass_delegating_accessor superclass_delegating_reader superclass_delegating_writer
+      syn keyword rubyRailsMethod cattr_accessor cattr_reader cattr_writer class_inheritable_accessor class_inheritable_array class_inheritable_array_writer class_inheritable_hash class_inheritable_hash_writer class_inheritable_option class_inheritable_reader class_inheritable_writer inheritable_attributes read_inheritable_attribute reset_inheritable_attributes write_inheritable_array write_inheritable_attribute write_inheritable_hash
+      syn keyword rubyRailsInclude require_dependency
+
+      syn region  rubyString   matchgroup=rubyStringDelimiter start=+\%(:order\s*=>\s*\)\@<="+ skip=+\\\\\|\\"+ end=+"+ contains=@rubyStringSpecial,railsOrderSpecial
+      syn region  rubyString   matchgroup=rubyStringDelimiter start=+\%(:order\s*=>\s*\)\@<='+ skip=+\\\\\|\\'+ end=+'+ contains=@rubyStringSpecial,railsOrderSpecial
+      syn match   railsOrderSpecial +\c\<\%(DE\|A\)SC\>+ contained
+      syn region  rubyString   matchgroup=rubyStringDelimiter start=+\%(:conditions\s*=>\s*\[\s*\)\@<="+ skip=+\\\\\|\\"+ end=+"+ contains=@rubyStringSpecial,railsConditionsSpecial
+      syn region  rubyString   matchgroup=rubyStringDelimiter start=+\%(:conditions\s*=>\s*\[\s*\)\@<='+ skip=+\\\\\|\\'+ end=+'+ contains=@rubyStringSpecial,railsConditionsSpecial
+      syn match   railsConditionsSpecial +?\|:\h\w*+ contained
+      syn cluster rubyNotTop add=railsOrderSpecial,railsConditionsSpecial
+
+      " XHTML highlighting inside %Q<>
+      unlet! b:current_syntax
+      let removenorend = !exists("g:html_no_rendering")
+      let g:html_no_rendering = 1
+      syn include @htmlTop syntax/xhtml.vim
+      if removenorend
+          unlet! g:html_no_rendering
+      endif
+      let b:current_syntax = "ruby"
+      " Restore syn sync, as best we can
+      if !exists("g:ruby_minlines")
+        let g:ruby_minlines = 50
+      endif
+      syn sync fromstart
+      exe "syn sync minlines=" . g:ruby_minlines
+      syn case match
+      syn region  rubyString   matchgroup=rubyStringDelimiter start=+%Q\=<+ end=+>+ contains=@htmlTop,@rubyStringSpecial
+      syn cluster htmlArgCluster add=@rubyStringSpecial
+      syn cluster htmlPreProc    add=@rubyStringSpecial
+
+    elseif &syntax =~# '^eruby\>' || &syntax == 'haml'
+      syn case match
+      if classes != ''
+        exe 'syn keyword '.&syntax.'RailsUserClass '.classes.' contained containedin=@'.&syntax.'RailsRegions'
+      endif
+      if &syntax == 'haml'
+        exe 'syn cluster hamlRailsRegions contains=hamlRubyCodeIncluded,hamlRubyCode,hamlRubyHash,@hamlEmbeddedRuby,rubyInterpolation'
+      else
+        exe 'syn cluster erubyRailsRegions contains=erubyOneLiner,erubyBlock,erubyExpression,rubyInterpolation'
+      endif
+      exe 'syn keyword '.&syntax.'RailsHelperMethod '.s:gsub(s:helpermethods(),'<%(content_for|select)\s+','').' contained containedin=@'.&syntax.'RailsRegions'
+      exe 'syn match '.&syntax.'RailsHelperMethod "\<select\>\%(\s*{\|\s*do\>\|\s*(\=\s*&\)\@!" contained containedin=@'.&syntax.'RailsRegions'
+      exe 'syn match '.&syntax.'RailsHelperMethod "\<\%(content_for?\=\|current_page?\)" contained containedin=@'.&syntax.'RailsRegions'
+      exe 'syn keyword '.&syntax.'RailsMethod debugger polymorphic_path polymorphic_url contained containedin=@'.&syntax.'RailsRegions'
+      exe 'syn match '.&syntax.'RailsViewMethod "\.\@<!\<\(h\|html_escape\|u\|url_encode\)\>" contained containedin=@'.&syntax.'RailsRegions'
+      if buffer.type_name('view-partial')
+        exe 'syn keyword '.&syntax.'RailsMethod local_assigns contained containedin=@'.&syntax.'RailsRegions'
+      endif
+      exe 'syn keyword '.&syntax.'RailsRenderMethod render contained containedin=@'.&syntax.'RailsRegions'
+      exe 'syn case match'
+      set isk+=$
+      exe 'syn keyword javascriptRailsFunction contained '.s:javascript_functions
+      exe 'syn cluster htmlJavaScript add=javascriptRailsFunction'
+    elseif &syntax == "yaml"
+      syn case match
+      " Modeled after syntax/eruby.vim
+      unlet! b:current_syntax
+      let g:main_syntax = 'eruby'
+      syn include @rubyTop syntax/ruby.vim
+      unlet g:main_syntax
+      syn cluster yamlRailsRegions contains=yamlRailsOneLiner,yamlRailsBlock,yamlRailsExpression
+      syn region  yamlRailsOneLiner   matchgroup=yamlRailsDelimiter start="^%%\@!" end="$"  contains=@rubyRailsTop      containedin=ALLBUT,@yamlRailsRegions,yamlRailsComment keepend oneline
+      syn region  yamlRailsBlock      matchgroup=yamlRailsDelimiter start="<%%\@!" end="%>" contains=@rubyTop           containedin=ALLBUT,@yamlRailsRegions,yamlRailsComment
+      syn region  yamlRailsExpression matchgroup=yamlRailsDelimiter start="<%="    end="%>" contains=@rubyTop           containedin=ALLBUT,@yamlRailsRegions,yamlRailsComment
+      syn region  yamlRailsComment    matchgroup=yamlRailsDelimiter start="<%#"    end="%>" contains=rubyTodo,@Spell    containedin=ALLBUT,@yamlRailsRegions,yamlRailsComment keepend
+      syn match yamlRailsMethod '\.\@<!\<\(h\|html_escape\|u\|url_encode\)\>' contained containedin=@yamlRailsRegions
+      if classes != ''
+        exe "syn keyword yamlRailsUserClass ".classes." contained containedin=@yamlRailsRegions"
+      endif
+      let b:current_syntax = "yaml"
+    elseif &syntax == "html"
+      syn case match
+      set isk+=$
+      exe "syn keyword javascriptRailsFunction contained ".s:javascript_functions
+      syn cluster htmlJavaScript add=javascriptRailsFunction
+    elseif &syntax == "javascript" || &syntax == "coffee"
+      " The syntax file included with Vim incorrectly sets syn case ignore.
+      syn case match
+      set isk+=$
+      exe "syn keyword javascriptRailsFunction ".s:javascript_functions
+
+    endif
+  endif
+  call s:HiDefaults()
+endfunction
+
+function! s:HiDefaults()
+  hi def link rubyRailsAPIMethod              rubyRailsMethod
+  hi def link rubyRailsARAssociationMethod    rubyRailsARMethod
+  hi def link rubyRailsARCallbackMethod       rubyRailsARMethod
+  hi def link rubyRailsARClassMethod          rubyRailsARMethod
+  hi def link rubyRailsARValidationMethod     rubyRailsARMethod
+  hi def link rubyRailsARMethod               rubyRailsMethod
+  hi def link rubyRailsRenderMethod           rubyRailsMethod
+  hi def link rubyRailsHelperMethod           rubyRailsMethod
+  hi def link rubyRailsViewMethod             rubyRailsMethod
+  hi def link rubyRailsMigrationMethod        rubyRailsMethod
+  hi def link rubyRailsControllerMethod       rubyRailsMethod
+  hi def link rubyRailsFilterMethod           rubyRailsMethod
+  hi def link rubyRailsTestControllerMethod   rubyRailsTestMethod
+  hi def link rubyRailsTestMethod             rubyRailsMethod
+  hi def link rubyRailsRakeMethod             rubyRailsMethod
+  hi def link rubyRailsMethod                 railsMethod
+  hi def link rubyRailsInclude                rubyInclude
+  hi def link rubyRailsUserClass              railsUserClass
+  hi def link rubyRailsUserMethod             railsUserMethod
+  hi def link erubyRailsHelperMethod          erubyRailsMethod
+  hi def link erubyRailsViewMethod            erubyRailsMethod
+  hi def link erubyRailsRenderMethod          erubyRailsMethod
+  hi def link erubyRailsMethod                railsMethod
+  hi def link erubyRailsUserMethod            railsUserMethod
+  hi def link erubyRailsUserClass             railsUserClass
+  hi def link hamlRailsHelperMethod           hamlRailsMethod
+  hi def link hamlRailsViewMethod             hamlRailsMethod
+  hi def link hamlRailsRenderMethod           hamlRailsMethod
+  hi def link hamlRailsMethod                 railsMethod
+  hi def link hamlRailsUserMethod             railsUserMethod
+  hi def link hamlRailsUserClass              railsUserClass
+  hi def link railsUserMethod                 railsMethod
+  hi def link yamlRailsDelimiter              Delimiter
+  hi def link yamlRailsMethod                 railsMethod
+  hi def link yamlRailsComment                Comment
+  hi def link yamlRailsUserClass              railsUserClass
+  hi def link yamlRailsUserMethod             railsUserMethod
+  hi def link javascriptRailsFunction         railsMethod
+  hi def link railsUserClass                  railsClass
+  hi def link railsMethod                     Function
+  hi def link railsClass                      Type
+  hi def link railsOrderSpecial               railsStringSpecial
+  hi def link railsConditionsSpecial          railsStringSpecial
+  hi def link railsStringSpecial              Identifier
+endfunction
+
+function! rails#log_syntax()
+  if has('conceal')
+    syn match railslogEscape      '\e\[[0-9;]*m' conceal
+    syn match railslogEscapeMN    '\e\[[0-9;]*m' conceal nextgroup=railslogModelNum,railslogEscapeMN skipwhite contained
+    syn match railslogEscapeSQL   '\e\[[0-9;]*m' conceal nextgroup=railslogSQL,railslogEscapeSQL skipwhite contained
+  else
+    syn match railslogEscape      '\e\[[0-9;]*m'
+    syn match railslogEscapeMN    '\e\[[0-9;]*m' nextgroup=railslogModelNum,railslogEscapeMN skipwhite contained
+    syn match railslogEscapeSQL   '\e\[[0-9;]*m' nextgroup=railslogSQL,railslogEscapeSQL skipwhite contained
+  endif
+  syn match   railslogRender      '\%(^\s*\%(\e\[[0-9;]*m\)\=\)\@<=\%(Processing\|Rendering\|Rendered\|Redirected\|Completed\)\>'
+  syn match   railslogComment     '^\s*# .*'
+  syn match   railslogModel       '\%(^\s*\%(\e\[[0-9;]*m\)\=\)\@<=\u\%(\w\|:\)* \%(Load\%( Including Associations\| IDs For Limited Eager Loading\)\=\|Columns\|Count\|Create\|Update\|Destroy\|Delete all\)\>' skipwhite nextgroup=railslogModelNum,railslogEscapeMN
+  syn match   railslogModel       '\%(^\s*\%(\e\[[0-9;]*m\)\=\)\@<=SQL\>' skipwhite nextgroup=railslogModelNum,railslogEscapeMN
+  syn region  railslogModelNum    start='(' end=')' contains=railslogNumber contained skipwhite nextgroup=railslogSQL,railslogEscapeSQL
+  syn match   railslogSQL         '\u[^\e]*' contained
+  " Destroy generates multiline SQL, ugh
+  syn match   railslogSQL         '\%(^ \%(\e\[[0-9;]*m\)\=\)\@<=\%(FROM\|WHERE\|ON\|AND\|OR\|ORDER\) .*$'
+  syn match   railslogNumber      '\<\d\+\>%'
+  syn match   railslogNumber      '[ (]\@<=\<\d\+\.\d\+\>\.\@!'
+  syn region  railslogString      start='"' skip='\\"' end='"' oneline contained
+  syn region  railslogHash        start='{' end='}' oneline contains=railslogHash,railslogString
+  syn match   railslogIP          '\<\d\{1,3\}\%(\.\d\{1,3}\)\{3\}\>'
+  syn match   railslogTimestamp   '\<\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\>'
+  syn match   railslogSessionID   '\<\x\{32\}\>'
+  syn match   railslogIdentifier  '^\s*\%(Session ID\|Parameters\)\ze:'
+  syn match   railslogSuccess     '\<2\d\d \u[A-Za-z0-9 ]*\>'
+  syn match   railslogRedirect    '\<3\d\d \u[A-Za-z0-9 ]*\>'
+  syn match   railslogError       '\<[45]\d\d \u[A-Za-z0-9 ]*\>'
+  syn match   railslogError       '^DEPRECATION WARNING\>'
+  syn keyword railslogHTTP        OPTIONS GET HEAD POST PUT DELETE TRACE CONNECT
+  syn region  railslogStackTrace  start=":\d\+:in `\w\+'$" end="^\s*$" keepend fold
+  hi def link railslogEscapeMN    railslogEscape
+  hi def link railslogEscapeSQL   railslogEscape
+  hi def link railslogEscape      Ignore
+  hi def link railslogComment     Comment
+  hi def link railslogRender      Keyword
+  hi def link railslogModel       Type
+  hi def link railslogSQL         PreProc
+  hi def link railslogNumber      Number
+  hi def link railslogString      String
+  hi def link railslogSessionID   Constant
+  hi def link railslogIdentifier  Identifier
+  hi def link railslogRedirect    railslogSuccess
+  hi def link railslogSuccess     Special
+  hi def link railslogError       Error
+  hi def link railslogHTTP        Special
+endfunction
+
+" }}}1
+" Mappings {{{1
+
+function! s:BufMappings()
+  nnoremap <buffer> <silent> <Plug>RailsFind       :<C-U>call <SID>Find(v:count1,'E')<CR>
+  nnoremap <buffer> <silent> <Plug>RailsSplitFind  :<C-U>call <SID>Find(v:count1,'S')<CR>
+  nnoremap <buffer> <silent> <Plug>RailsVSplitFind :<C-U>call <SID>Find(v:count1,'V')<CR>
+  nnoremap <buffer> <silent> <Plug>RailsTabFind    :<C-U>call <SID>Find(v:count1,'T')<CR>
+  if g:rails_mappings
+    if !hasmapto("<Plug>RailsFind")
+      nmap <buffer> gf              <Plug>RailsFind
+    endif
+    if !hasmapto("<Plug>RailsSplitFind")
+      nmap <buffer> <C-W>f          <Plug>RailsSplitFind
+    endif
+    if !hasmapto("<Plug>RailsTabFind")
+      nmap <buffer> <C-W>gf         <Plug>RailsTabFind
+    endif
+    if exists("$CREAM")
+      imap <buffer> <C-CR> <C-O><Plug>RailsFind
+      imap <buffer> <M-[>  <C-O><Plug>RailsAlternate
+      imap <buffer> <M-]>  <C-O><Plug>RailsRelated
+    endif
+  endif
+  " SelectBuf you're a dirty hack
+  let v:errmsg = ""
+endfunction
+
+" }}}1
+" Database {{{1
+
+function! s:extractdbvar(str,arg)
+  return matchstr("\n".a:str."\n",'\n'.a:arg.'=\zs.\{-\}\ze\n')
+endfunction
+
+function! s:app_dbext_settings(environment) dict
+  if self.cache.needs('dbext_settings')
+    call self.cache.set('dbext_settings',{})
+  endif
+  let cache = self.cache.get('dbext_settings')
+  if !has_key(cache,a:environment)
+    let dict = {}
+    if self.has_file("config/database.yml")
+      let cmdb = 'require %{yaml}; File.open(%q{'.self.path().'/config/database.yml}) {|f| y = YAML::load(f); e = y[%{'
+      let cmde = '}]; i=0; e=y[e] while e.respond_to?(:to_str) && (i+=1)<16; e.each{|k,v|puts k.to_s+%{=}+v.to_s}}'
+      let out = self.lightweight_ruby_eval(cmdb.a:environment.cmde)
+      let adapter = s:extractdbvar(out,'adapter')
+      let adapter = get({'mysql2': 'mysql', 'postgresql': 'pgsql', 'sqlite3': 'sqlite', 'sqlserver': 'sqlsrv', 'sybase': 'asa', 'oracle': 'ora'},adapter,adapter)
+      let dict['type'] = toupper(adapter)
+      let dict['user'] = s:extractdbvar(out,'username')
+      let dict['passwd'] = s:extractdbvar(out,'password')
+      if dict['passwd'] == '' && adapter == 'mysql'
+        " Hack to override password from .my.cnf
+        let dict['extra'] = ' --password='
+      else
+        let dict['extra'] = ''
+      endif
+      let dict['dbname'] = s:extractdbvar(out,'database')
+      if dict['dbname'] == ''
+        let dict['dbname'] = s:extractdbvar(out,'dbfile')
+      endif
+      if dict['dbname'] != '' && dict['dbname'] !~ '^:' && adapter =~? '^sqlite'
+        let dict['dbname'] = self.path(dict['dbname'])
+      endif
+      let dict['profile'] = ''
+      if adapter == 'ora'
+        let dict['srvname'] = s:extractdbvar(out,'database')
+      else
+        let dict['srvname'] = s:extractdbvar(out,'host')
+      endif
+      let dict['host'] = s:extractdbvar(out,'host')
+      let dict['port'] = s:extractdbvar(out,'port')
+      let dict['dsnname'] = s:extractdbvar(out,'dsn')
+      if dict['host'] =~? '^\cDBI:'
+        if dict['host'] =~? '\c\<Trusted[_ ]Connection\s*=\s*yes\>'
+          let dict['integratedlogin'] = 1
+        endif
+        let dict['host'] = matchstr(dict['host'],'\c\<\%(Server\|Data Source\)\s*=\s*\zs[^;]*')
+      endif
+      call filter(dict,'v:val != ""')
+    endif
+    let cache[a:environment] = dict
+  endif
+  return cache[a:environment]
+endfunction
+
+function! s:BufDatabase(...)
+  if exists("s:lock_database") || !exists('g:loaded_dbext') || !exists('b:rails_root')
+    return
+  endif
+  let self = rails#app()
+  let s:lock_database = 1
+  if (a:0 && a:1 > 1)
+    call self.cache.clear('dbext_settings')
+  endif
+  if (a:0 > 1 && a:2 != '')
+    let env = a:2
+  else
+    let env = s:environment()
+  endif
+  if (!self.cache.has('dbext_settings') || !has_key(self.cache.get('dbext_settings'),env)) && (a:0 ? a:1 : 0) <= 0
+    unlet! s:lock_database
+    return
+  endif
+  let dict = self.dbext_settings(env)
+  for key in ['type', 'profile', 'bin', 'user', 'passwd', 'dbname', 'srvname', 'host', 'port', 'dsnname', 'extra', 'integratedlogin']
+    let b:dbext_{key} = get(dict,key,'')
+  endfor
+  if b:dbext_type == 'PGSQL'
+    let $PGPASSWORD = b:dbext_passwd
+  elseif exists('$PGPASSWORD')
+    let $PGPASSWORD = ''
+  endif
+  unlet! s:lock_database
+endfunction
+
+call s:add_methods('app', ['dbext_settings'])
+
+" }}}1
+" Abbreviations {{{1
+
+function! s:selectiveexpand(pat,good,default,...)
+  if a:0 > 0
+    let nd = a:1
+  else
+    let nd = ""
+  endif
+  let c = nr2char(getchar(0))
+  let good = a:good
+  if c == "" " ^]
+    return s:sub(good.(a:0 ? " ".a:1 : ''),'\s+$','')
+  elseif c == "\t"
+    return good.(a:0 ? " ".a:1 : '')
+  elseif c =~ a:pat
+    return good.c.(a:0 ? a:1 : '')
+  else
+    return a:default.c
+  endif
+endfunction
+
+function! s:TheCWord()
+  let l = s:linepeak()
+  if l =~ '\<\%(find\|first\|last\|all\|paginate\)\>'
+    return s:selectiveexpand('..',':conditions => ',':c')
+  elseif l =~ '\<render\s*(\=\s*:partial\s*=>\s*'
+    return s:selectiveexpand('..',':collection => ',':c')
+  elseif l =~ '\<\%(url_for\|link_to\|form_tag\)\>' || l =~ ':url\s*=>\s*{\s*'
+    return s:selectiveexpand('..',':controller => ',':c')
+  else
+    return s:selectiveexpand('..',':conditions => ',':c')
+  endif
+endfunction
+
+function! s:AddSelectiveExpand(abbr,pat,expn,...)
+  let expn  = s:gsub(s:gsub(a:expn        ,'[\"|]','\\&'),'\<','\\<Lt>')
+  let expn2 = s:gsub(s:gsub(a:0 ? a:1 : '','[\"|]','\\&'),'\<','\\<Lt>')
+  if a:0
+    exe "inoreabbrev <buffer> <silent> ".a:abbr." <C-R>=<SID>selectiveexpand(".string(a:pat).",\"".expn."\",".string(a:abbr).",\"".expn2."\")<CR>"
+  else
+    exe "inoreabbrev <buffer> <silent> ".a:abbr." <C-R>=<SID>selectiveexpand(".string(a:pat).",\"".expn."\",".string(a:abbr).")<CR>"
+  endif
+endfunction
+
+function! s:AddTabExpand(abbr,expn)
+  call s:AddSelectiveExpand(a:abbr,'..',a:expn)
+endfunction
+
+function! s:AddBracketExpand(abbr,expn)
+  call s:AddSelectiveExpand(a:abbr,'[[.]',a:expn)
+endfunction
+
+function! s:AddColonExpand(abbr,expn)
+  call s:AddSelectiveExpand(a:abbr,'[:.]',a:expn)
+endfunction
+
+function! s:AddParenExpand(abbr,expn,...)
+  if a:0
+    call s:AddSelectiveExpand(a:abbr,'(',a:expn,a:1)
+  else
+    call s:AddSelectiveExpand(a:abbr,'(',a:expn,'')
+  endif
+endfunction
+
+function! s:BufAbbreviations()
+  command! -buffer -bar -nargs=* -bang Rabbrev :call s:Abbrev(<bang>0,<f-args>)
+  " Some of these were cherry picked from the TextMate snippets
+  if g:rails_abbreviations
+    let buffer = rails#buffer()
+    " Limit to the right filetypes.  But error on the liberal side
+    if buffer.type_name('controller','view','helper','test-functional','test-integration')
+      Rabbrev pa[ params
+      Rabbrev rq[ request
+      Rabbrev rs[ response
+      Rabbrev se[ session
+      Rabbrev hd[ headers
+      Rabbrev coo[ cookies
+      Rabbrev fl[ flash
+      Rabbrev rr( render
+      Rabbrev ra( render :action\ =>\ 
+      Rabbrev rc( render :controller\ =>\ 
+      Rabbrev rf( render :file\ =>\ 
+      Rabbrev ri( render :inline\ =>\ 
+      Rabbrev rj( render :json\ =>\ 
+      Rabbrev rl( render :layout\ =>\ 
+      Rabbrev rp( render :partial\ =>\ 
+      Rabbrev rt( render :text\ =>\ 
+      Rabbrev rx( render :xml\ =>\ 
+    endif
+    if buffer.type_name('view','helper')
+      Rabbrev dotiw distance_of_time_in_words
+      Rabbrev taiw  time_ago_in_words
+    endif
+    if buffer.type_name('controller')
+      Rabbrev re(  redirect_to
+      Rabbrev rea( redirect_to :action\ =>\ 
+      Rabbrev rec( redirect_to :controller\ =>\ 
+      Rabbrev rst( respond_to
+    endif
+    if buffer.type_name() ==# 'model' || buffer.type_name('model-arb')
+      Rabbrev bt(    belongs_to
+      Rabbrev ho(    has_one
+      Rabbrev hm(    has_many
+      Rabbrev habtm( has_and_belongs_to_many
+      Rabbrev co(    composed_of
+      Rabbrev va(    validates_associated
+      Rabbrev vb(    validates_acceptance_of
+      Rabbrev vc(    validates_confirmation_of
+      Rabbrev ve(    validates_exclusion_of
+      Rabbrev vf(    validates_format_of
+      Rabbrev vi(    validates_inclusion_of
+      Rabbrev vl(    validates_length_of
+      Rabbrev vn(    validates_numericality_of
+      Rabbrev vp(    validates_presence_of
+      Rabbrev vu(    validates_uniqueness_of
+    endif
+    if buffer.type_name('db-migration','db-schema')
+      Rabbrev mac(  add_column
+      Rabbrev mrnc( rename_column
+      Rabbrev mrc(  remove_column
+      Rabbrev mct(  create_table
+      Rabbrev mcht( change_table
+      Rabbrev mrnt( rename_table
+      Rabbrev mdt(  drop_table
+      Rabbrev mcc(  t.column
+    endif
+    if buffer.type_name('test')
+      Rabbrev ase(  assert_equal
+      Rabbrev asko( assert_kind_of
+      Rabbrev asnn( assert_not_nil
+      Rabbrev asr(  assert_raise
+      Rabbrev asre( assert_response
+      Rabbrev art(  assert_redirected_to
+    endif
+    Rabbrev :a    :action\ =>\ 
+    " hax
+    Rabbrev :c    :co________\ =>\ 
+    inoreabbrev <buffer> <silent> :c <C-R>=<SID>TheCWord()<CR>
+    Rabbrev :i    :id\ =>\ 
+    Rabbrev :o    :object\ =>\ 
+    Rabbrev :p    :partial\ =>\ 
+    Rabbrev logd( logger.debug
+    Rabbrev logi( logger.info
+    Rabbrev logw( logger.warn
+    Rabbrev loge( logger.error
+    Rabbrev logf( logger.fatal
+    Rabbrev fi(   find
+    Rabbrev AR::  ActiveRecord
+    Rabbrev AV::  ActionView
+    Rabbrev AC::  ActionController
+    Rabbrev AD::  ActionDispatch
+    Rabbrev AS::  ActiveSupport
+    Rabbrev AM::  ActionMailer
+    Rabbrev AO::  ActiveModel
+    Rabbrev AE::  ActiveResource
+  endif
+endfunction
+
+function! s:Abbrev(bang,...) abort
+  if !exists("b:rails_abbreviations")
+    let b:rails_abbreviations = {}
+  endif
+  if a:0 > 3 || (a:bang && (a:0 != 1))
+    return s:error("Rabbrev: invalid arguments")
+  endif
+  if a:0 == 0
+    for key in sort(keys(b:rails_abbreviations))
+      echo key . join(b:rails_abbreviations[key],"\t")
+    endfor
+    return
+  endif
+  let lhs = a:1
+  let root = s:sub(lhs,'%(::|\(|\[)$','')
+  if a:bang
+    if has_key(b:rails_abbreviations,root)
+      call remove(b:rails_abbreviations,root)
+    endif
+    exe "iunabbrev <buffer> ".root
+    return
+  endif
+  if a:0 > 3 || a:0 < 2
+    return s:error("Rabbrev: invalid arguments")
+  endif
+  let rhs = a:2
+  if has_key(b:rails_abbreviations,root)
+    call remove(b:rails_abbreviations,root)
+  endif
+  if lhs =~ '($'
+    let b:rails_abbreviations[root] = ["(", rhs . (a:0 > 2 ? "\t".a:3 : "")]
+    if a:0 > 2
+      call s:AddParenExpand(root,rhs,a:3)
+    else
+      call s:AddParenExpand(root,rhs)
+    endif
+    return
+  endif
+  if a:0 > 2
+    return s:error("Rabbrev: invalid arguments")
+  endif
+  if lhs =~ ':$'
+    call s:AddColonExpand(root,rhs)
+  elseif lhs =~ '\[$'
+    call s:AddBracketExpand(root,rhs)
+  elseif lhs =~ '\w$'
+    call s:AddTabExpand(lhs,rhs)
+  else
+    return s:error("Rabbrev: unimplemented")
+  endif
+  let b:rails_abbreviations[root] = [matchstr(lhs,'\W*$'),rhs]
+endfunction
+
+" }}}1
+" Settings {{{1
+
+function! s:Set(bang,...)
+  let c = 1
+  let defscope = ''
+  for arg in a:000
+    if arg =~? '^<[abgl]\=>$'
+      let defscope = (matchstr(arg,'<\zs.*\ze>'))
+    elseif arg !~ '='
+      if defscope != '' && arg !~ '^\w:'
+        let arg = defscope.':'.opt
+      endif
+      let val = s:getopt(arg)
+      if val == '' && !has_key(s:opts(),arg)
+        call s:error("No such rails.vim option: ".arg)
+      else
+        echo arg."=".val
+      endif
+    else
+      let opt = matchstr(arg,'[^=]*')
+      let val = s:sub(arg,'^[^=]*\=','')
+      if defscope != '' && opt !~ '^\w:'
+        let opt = defscope.':'.opt
+      endif
+      call s:setopt(opt,val)
+    endif
+  endfor
+endfunction
+
+function! s:getopt(opt,...)
+  let app = rails#app()
+  let opt = a:opt
+  if a:0
+    let scope = a:1
+  elseif opt =~ '^[abgl]:'
+    let scope = tolower(matchstr(opt,'^\w'))
+    let opt = s:sub(opt,'^\w:','')
+  else
+    let scope = 'abgl'
+  endif
+  let lnum = a:0 > 1 ? a:2 : line('.')
+  if scope =~ 'l' && &filetype != 'ruby'
+    let scope = s:sub(scope,'l','b')
+  endif
+  if scope =~ 'l'
+    call s:LocalModelines(lnum)
+  endif
+  let var = s:sname().'_'.opt
+  let lastmethod = s:lastmethod(lnum)
+  if lastmethod == '' | let lastmethod = ' ' | endif
+  " Get buffer option
+  if scope =~ 'l' && exists('b:_'.var) && has_key(b:_{var},lastmethod)
+    return b:_{var}[lastmethod]
+  elseif exists('b:'.var) && (scope =~ 'b' || (scope =~ 'l' && lastmethod == ' '))
+    return b:{var}
+  elseif scope =~ 'a' && has_key(app,'options') && has_key(app.options,opt)
+    return app.options[opt]
+  elseif scope =~ 'g' && exists("g:".s:sname()."_".opt)
+    return g:{var}
+  else
+    return ""
+  endif
+endfunction
+
+function! s:setopt(opt,val)
+  let app = rails#app()
+  if a:opt =~? '[abgl]:'
+    let scope = matchstr(a:opt,'^\w')
+    let opt = s:sub(a:opt,'^\w:','')
+  else
+    let scope = ''
+    let opt = a:opt
+  endif
+  let defscope = get(s:opts(),opt,'a')
+  if scope == ''
+    let scope = defscope
+  endif
+  if &filetype != 'ruby' && (scope ==# 'B' || scope ==# 'l')
+    let scope = 'b'
+  endif
+  let var = s:sname().'_'.opt
+  if opt =~ '\W'
+    return s:error("Invalid option ".a:opt)
+  elseif scope ==# 'B' && defscope == 'l'
+    if !exists('b:_'.var) | let b:_{var} = {} | endif
+    let b:_{var}[' '] = a:val
+  elseif scope =~? 'b'
+    let b:{var} = a:val
+  elseif scope =~? 'a'
+    if !has_key(app,'options') | let app.options = {} | endif
+    let app.options[opt] = a:val
+  elseif scope =~? 'g'
+    let g:{var} = a:val
+  elseif scope =~? 'l'
+    if !exists('b:_'.var) | let b:_{var} = {} | endif
+    let lastmethod = s:lastmethod(lnum)
+    let b:_{var}[lastmethod == '' ? ' ' : lastmethod] = a:val
+  else
+    return s:error("Invalid scope for ".a:opt)
+  endif
+endfunction
+
+function! s:opts()
+  return {'alternate': 'b', 'controller': 'b', 'gnu_screen': 'a', 'model': 'b', 'preview': 'l', 'task': 'b', 'related': 'l', 'root_url': 'a'}
+endfunction
+
+function! s:Complete_set(A,L,P)
+  if a:A =~ '='
+    let opt = matchstr(a:A,'[^=]*')
+    return [opt."=".s:getopt(opt)]
+  else
+    let extra = matchstr(a:A,'^[abgl]:')
+    return filter(sort(map(keys(s:opts()),'extra.v:val')),'s:startswith(v:val,a:A)')
+  endif
+  return []
+endfunction
+
+function! s:BufModelines()
+  if !g:rails_modelines
+    return
+  endif
+  let lines = getline("$")."\n".getline(line("$")-1)."\n".getline(1)."\n".getline(2)."\n".getline(3)."\n"
+  let pat = '\s\+\zs.\{-\}\ze\%(\n\|\s\s\|#{\@!\|%>\|-->\|$\)'
+  let cnt = 1
+  let mat    = matchstr(lines,'\C\<Rset'.pat)
+  let matend = matchend(lines,'\C\<Rset'.pat)
+  while mat != "" && cnt < 10
+    let mat = s:sub(mat,'\s+$','')
+    let mat = s:gsub(mat,'\|','\\|')
+    if mat != ''
+      silent! exe "Rset <B> ".mat
+    endif
+    let mat    = matchstr(lines,'\C\<Rset'.pat,matend)
+    let matend = matchend(lines,'\C\<Rset'.pat,matend)
+    let cnt += 1
+  endwhile
+endfunction
+
+function! s:LocalModelines(lnum)
+  if !g:rails_modelines
+    return
+  endif
+  let lbeg = s:lastmethodline(a:lnum)
+  let lend = s:endof(lbeg)
+  if lbeg == 0 || lend == 0
+    return
+  endif
+  let lines = "\n"
+  let lnum = lbeg
+  while lnum < lend && lnum < lbeg + 5
+    let lines .= getline(lnum) . "\n"
+    let lnum += 1
+  endwhile
+  let pat = '\s\+\zs.\{-\}\ze\%(\n\|\s\s\|#{\@!\|%>\|-->\|$\)'
+  let cnt = 1
+  let mat    = matchstr(lines,'\C\<rset'.pat)
+  let matend = matchend(lines,'\C\<rset'.pat)
+  while mat != "" && cnt < 10
+    let mat = s:sub(mat,'\s+$','')
+    let mat = s:gsub(mat,'\|','\\|')
+    if mat != ''
+      silent! exe "Rset <l> ".mat
+    endif
+    let mat    = matchstr(lines,'\C\<rset'.pat,matend)
+    let matend = matchend(lines,'\C\<rset'.pat,matend)
+    let cnt += 1
+  endwhile
+endfunction
+
+" }}}1
+" Detection {{{1
+
+function! s:app_source_callback(file) dict
+  if self.cache.needs('existence')
+    call self.cache.set('existence',{})
+  endif
+  let cache = self.cache.get('existence')
+  if !has_key(cache,a:file)
+    let cache[a:file] = self.has_file(a:file)
+  endif
+  if cache[a:file]
+    sandbox source `=self.path(a:file)`
+  endif
+endfunction
+
+call s:add_methods('app',['source_callback'])
+
+function! RailsBufInit(path)
+  let firsttime = !(exists("b:rails_root") && b:rails_root == a:path)
+  let b:rails_root = a:path
+  if !has_key(s:apps,a:path)
+    let s:apps[a:path] = deepcopy(s:app_prototype)
+    let s:apps[a:path].root = a:path
+  endif
+  let app = s:apps[a:path]
+  let buffer = rails#buffer()
+  " Apparently rails#buffer().calculate_file_type() can be slow if the
+  " underlying file system is slow (even though it doesn't really do anything
+  " IO related).  This caching is a temporary hack; if it doesn't cause
+  " problems it should probably be refactored.
+  let b:rails_cached_file_type = buffer.calculate_file_type()
+  if g:rails_history_size > 0
+    if !exists("g:RAILS_HISTORY")
+      let g:RAILS_HISTORY = ""
+    endif
+    let path = a:path
+    let g:RAILS_HISTORY = s:scrub(g:RAILS_HISTORY,path)
+    if has("win32")
+      let g:RAILS_HISTORY = s:scrub(g:RAILS_HISTORY,s:gsub(path,'\\','/'))
+    endif
+    let path = fnamemodify(path,':p:~:h')
+    let g:RAILS_HISTORY = s:scrub(g:RAILS_HISTORY,path)
+    if has("win32")
+      let g:RAILS_HISTORY = s:scrub(g:RAILS_HISTORY,s:gsub(path,'\\','/'))
+    endif
+    let g:RAILS_HISTORY = path."\n".g:RAILS_HISTORY
+    let g:RAILS_HISTORY = s:sub(g:RAILS_HISTORY,'%(.{-}\n){,'.g:rails_history_size.'}\zs.*','')
+  endif
+  call app.source_callback("config/syntax.vim")
+  if expand('%:t') =~ '\.yml\.example$'
+    setlocal filetype=yaml
+  elseif expand('%:e') =~ '^\%(rjs\|rxml\|builder\)$'
+    setlocal filetype=ruby
+  elseif firsttime
+    " Activate custom syntax
+    let &syntax = &syntax
+  endif
+  if expand('%:e') == 'log'
+    nnoremap <buffer> <silent> R :checktime<CR>
+    nnoremap <buffer> <silent> G :checktime<Bar>$<CR>
+    nnoremap <buffer> <silent> q :bwipe<CR>
+    setlocal modifiable filetype=railslog noswapfile autoread foldmethod=syntax
+    if exists('+concealcursor')
+      setlocal concealcursor=nc conceallevel=2
+    else
+      silent %s/\%(\e\[[0-9;]*m\|\r$\)//ge
+    endif
+    setlocal readonly nomodifiable
+    $
+  endif
+  call s:BufSettings()
+  call s:BufCommands()
+  call s:BufAbbreviations()
+  " snippetsEmu.vim
+  if exists('g:loaded_snippet')
+    silent! runtime! ftplugin/rails_snippets.vim
+    " filetype snippets need to come last for higher priority
+    exe "silent! runtime! ftplugin/".&filetype."_snippets.vim"
+  endif
+  let t = rails#buffer().type_name()
+  let t = "-".t
+  let f = '/'.RailsFilePath()
+  if f =~ '[ !#$%\,]'
+    let f = ''
+  endif
+  runtime! macros/rails.vim
+  silent doautocmd User Rails
+  if t != '-'
+    exe "silent doautocmd User Rails".s:gsub(t,'-','.')
+  endif
+  if f != ''
+    exe "silent doautocmd User Rails".f
+  endif
+  call app.source_callback("config/rails.vim")
+  call s:BufModelines()
+  call s:BufMappings()
+  return b:rails_root
+endfunction
+
+function! s:SetBasePath()
+  let self = rails#buffer()
+  if self.app().path() =~ '://'
+    return
+  endif
+  let transformed_path = s:pathsplit(s:pathjoin([self.app().path()]))[0]
+  let add_dot = self.getvar('&path') =~# '^\.\%(,\|$\)'
+  let old_path = s:pathsplit(s:sub(self.getvar('&path'),'^\.%(,|$)',''))
+  call filter(old_path,'!s:startswith(v:val,transformed_path)')
+
+  let path = ['app', 'app/models', 'app/controllers', 'app/helpers', 'config', 'lib', 'app/views']
+  if self.controller_name() != ''
+    let path += ['app/views/'.self.controller_name(), 'public']
+  endif
+  if self.app().has('test')
+    let path += ['test', 'test/unit', 'test/functional', 'test/integration']
+  endif
+  if self.app().has('spec')
+    let path += ['spec', 'spec/models', 'spec/controllers', 'spec/helpers', 'spec/views', 'spec/lib', 'spec/requests', 'spec/integration']
+  endif
+  let path += ['app/*', 'vendor', 'vendor/plugins/*/lib', 'vendor/plugins/*/test', 'vendor/rails/*/lib', 'vendor/rails/*/test']
+  call map(path,'self.app().path(v:val)')
+  call self.setvar('&path',(add_dot ? '.,' : '').s:pathjoin([self.app().path()],path,old_path))
+endfunction
+
+function! s:BufSettings()
+  if !exists('b:rails_root')
+    return ''
+  endif
+  let self = rails#buffer()
+  call s:SetBasePath()
+  let rp = s:gsub(self.app().path(),'[ ,]','\\&')
+  if stridx(&tags,rp.'/tmp/tags') == -1
+    let &l:tags = rp . '/tmp/tags,' . &tags . ',' . rp . '/tags'
+  endif
+  if has("gui_win32") || has("gui_running")
+    let code      = '*.rb;*.rake;Rakefile'
+    let templates = '*.'.join(s:view_types,';*.')
+    let fixtures  = '*.yml;*.csv'
+    let statics   = '*.html;*.css;*.js;*.xml;*.xsd;*.sql;.htaccess;README;README_FOR_APP'
+    let b:browsefilter = ""
+          \."All Rails Files\t".code.';'.templates.';'.fixtures.';'.statics."\n"
+          \."Source Code (*.rb, *.rake)\t".code."\n"
+          \."Templates (*.rhtml, *.rxml, *.rjs)\t".templates."\n"
+          \."Fixtures (*.yml, *.csv)\t".fixtures."\n"
+          \."Static Files (*.html, *.css, *.js)\t".statics."\n"
+          \."All Files (*.*)\t*.*\n"
+  endif
+  call self.setvar('&includeexpr','RailsIncludeexpr()')
+  call self.setvar('&suffixesadd', ".rb,.".join(s:view_types,',.'))
+  let ft = self.getvar('&filetype')
+  if ft =~ '^\%(e\=ruby\|[yh]aml\|coffee\|css\|s[ac]ss\|lesscss\)$'
+    call self.setvar('&shiftwidth',2)
+    call self.setvar('&softtabstop',2)
+    call self.setvar('&expandtab',1)
+    if exists('+completefunc') && self.getvar('&completefunc') == ''
+      call self.setvar('&completefunc','syntaxcomplete#Complete')
+    endif
+  endif
+  if ft == 'ruby'
+    call self.setvar('&define',self.define_pattern())
+    " This really belongs in after/ftplugin/ruby.vim but we'll be nice
+    if exists('g:loaded_surround') && self.getvar('surround_101') == ''
+      call self.setvar('surround_5',   "\r\nend")
+      call self.setvar('surround_69',  "\1expr: \1\rend")
+      call self.setvar('surround_101', "\r\nend")
+    endif
+  elseif ft == 'yaml' || fnamemodify(self.name(),':e') == 'yml'
+    call self.setvar('&define',self.define_pattern())
+  elseif ft =~# '^eruby\>'
+    if exists("g:loaded_allml")
+      call self.setvar('allml_stylesheet_link_tag', "<%= stylesheet_link_tag '\r' %>")
+      call self.setvar('allml_javascript_include_tag', "<%= javascript_include_tag '\r' %>")
+      call self.setvar('allml_doctype_index', 10)
+    endif
+    if exists("g:loaded_ragtag")
+      call self.setvar('ragtag_stylesheet_link_tag', "<%= stylesheet_link_tag '\r' %>")
+      call self.setvar('ragtag_javascript_include_tag', "<%= javascript_include_tag '\r' %>")
+      call self.setvar('ragtag_doctype_index', 10)
+    endif
+  elseif ft == 'haml'
+    if exists("g:loaded_allml")
+      call self.setvar('allml_stylesheet_link_tag', "= stylesheet_link_tag '\r'")
+      call self.setvar('allml_javascript_include_tag', "= javascript_include_tag '\r'")
+      call self.setvar('allml_doctype_index', 10)
+    endif
+    if exists("g:loaded_ragtag")
+      call self.setvar('ragtag_stylesheet_link_tag', "= stylesheet_link_tag '\r'")
+      call self.setvar('ragtag_javascript_include_tag', "= javascript_include_tag '\r'")
+      call self.setvar('ragtag_doctype_index', 10)
+    endif
+  endif
+  if ft =~# '^eruby\>' || ft ==# 'yaml'
+    " surround.vim
+    if exists("g:loaded_surround")
+      " The idea behind the || part here is that one can normally define the
+      " surrounding to omit the hyphen (since standard ERuby does not use it)
+      " but have it added in Rails ERuby files.  Unfortunately, this makes it
+      " difficult if you really don't want a hyphen in Rails ERuby files.  If
+      " this is your desire, you will need to accomplish it via a rails.vim
+      " autocommand.
+      if self.getvar('surround_45') == '' || self.getvar('surround_45') == "<% \r %>" " -
+        call self.setvar('surround_45', "<% \r -%>")
+      endif
+      if self.getvar('surround_61') == '' " =
+        call self.setvar('surround_61', "<%= \r %>")
+      endif
+      if self.getvar("surround_35") == '' " #
+        call self.setvar('surround_35', "<%# \r %>")
+      endif
+      if self.getvar('surround_101') == '' || self.getvar('surround_101')== "<% \r %>\n<% end %>" "e
+        call self.setvar('surround_5',   "<% \r -%>\n<% end -%>")
+        call self.setvar('surround_69',  "<% \1expr: \1 -%>\r<% end -%>")
+        call self.setvar('surround_101', "<% \r -%>\n<% end -%>")
+      endif
+    endif
+  endif
+endfunction
+
+" }}}1
+" Autocommands {{{1
+
+augroup railsPluginAuto
+  autocmd!
+  autocmd User BufEnterRails call s:RefreshBuffer()
+  autocmd User BufEnterRails call s:resetomnicomplete()
+  autocmd User BufEnterRails call s:BufDatabase(-1)
+  autocmd User dbextPreConnection call s:BufDatabase(1)
+  autocmd BufWritePost */config/database.yml      call rails#cache_clear("dbext_settings")
+  autocmd BufWritePost */test/test_helper.rb      call rails#cache_clear("user_assertions")
+  autocmd BufWritePost */config/routes.rb         call rails#cache_clear("named_routes")
+  autocmd BufWritePost */config/environment.rb    call rails#cache_clear("default_locale")
+  autocmd BufWritePost */config/environments/*.rb call rails#cache_clear("environments")
+  autocmd BufWritePost */tasks/**.rake            call rails#cache_clear("rake_tasks")
+  autocmd BufWritePost */generators/**            call rails#cache_clear("generators")
+  autocmd FileType * if exists("b:rails_root") | call s:BufSettings() | endif
+  autocmd Syntax ruby,eruby,yaml,haml,javascript,coffee,railslog if exists("b:rails_root") | call s:BufSyntax() | endif
+  autocmd QuickFixCmdPre  *make* call s:push_chdir()
+  autocmd QuickFixCmdPost *make* call s:pop_command()
+augroup END
+
+" }}}1
+" Initialization {{{1
+
+map <SID>xx <SID>xx
+let s:sid = s:sub(maparg("<SID>xx"),'xx$','')
+unmap <SID>xx
+let s:file = expand('<sfile>:p')
+
+if !exists('s:apps')
+  let s:apps = {}
+endif
+
+" }}}1
+
+let &cpo = s:cpo_save
+
+" vim:set sw=2 sts=2:
diff --git a/vim/autoload/snipMate.vim b/vim/autoload/snipMate.vim
new file mode 100644 (file)
index 0000000..0ad5a58
--- /dev/null
@@ -0,0 +1,435 @@
+fun! Filename(...)
+       let filename = expand('%:t:r')
+       if filename == '' | return a:0 == 2 ? a:2 : '' | endif
+       return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g')
+endf
+
+fun s:RemoveSnippet()
+       unl! g:snipPos s:curPos s:snipLen s:endCol s:endLine s:prevLen
+            \ s:lastBuf s:oldWord
+       if exists('s:update')
+               unl s:startCol s:origWordLen s:update
+               if exists('s:oldVars') | unl s:oldVars s:oldEndCol | endif
+       endif
+       aug! snipMateAutocmds
+endf
+
+fun snipMate#expandSnip(snip, col)
+       let lnum = line('.') | let col = a:col
+
+       let snippet = s:ProcessSnippet(a:snip)
+       " Avoid error if eval evaluates to nothing
+       if snippet == '' | return '' | endif
+
+       " Expand snippet onto current position with the tab stops removed
+       let snipLines = split(substitute(snippet, '$\d\+\|${\d\+.\{-}}', '', 'g'), "\n", 1)
+
+       let line = getline(lnum)
+       let afterCursor = strpart(line, col - 1)
+       " Keep text after the cursor
+       if afterCursor != "\t" && afterCursor != ' '
+               let line = strpart(line, 0, col - 1)
+               let snipLines[-1] .= afterCursor
+       else
+               let afterCursor = ''
+               " For some reason the cursor needs to move one right after this
+               if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore'
+                       let col += 1
+               endif
+       endif
+
+       call setline(lnum, line.snipLines[0])
+
+       " Autoindent snippet according to previous indentation
+       let indent = matchend(line, '^.\{-}\ze\(\S\|$\)') + 1
+       call append(lnum, map(snipLines[1:], "'".strpart(line, 0, indent - 1)."'.v:val"))
+
+       " Open any folds snippet expands into
+       if &fen | sil! exe lnum.','.(lnum + len(snipLines) - 1).'foldopen' | endif
+
+       let [g:snipPos, s:snipLen] = s:BuildTabStops(snippet, lnum, col - indent, indent)
+
+       if s:snipLen
+               aug snipMateAutocmds
+                       au CursorMovedI * call s:UpdateChangedSnip(0)
+                       au InsertEnter * call s:UpdateChangedSnip(1)
+               aug END
+               let s:lastBuf = bufnr(0) " Only expand snippet while in current buffer
+               let s:curPos = 0
+               let s:endCol = g:snipPos[s:curPos][1]
+               let s:endLine = g:snipPos[s:curPos][0]
+
+               call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1])
+               let s:prevLen = [line('$'), col('$')]
+               if g:snipPos[s:curPos][2] != -1 | return s:SelectWord() | endif
+       else
+               unl g:snipPos s:snipLen
+               " Place cursor at end of snippet if no tab stop is given
+               let newlines = len(snipLines) - 1
+               call cursor(lnum + newlines, indent + len(snipLines[-1]) - len(afterCursor)
+                                       \ + (newlines ? 0: col - 1))
+       endif
+       return ''
+endf
+
+" Prepare snippet to be processed by s:BuildTabStops
+fun s:ProcessSnippet(snip)
+       let snippet = a:snip
+       " Evaluate eval (`...`) expressions.
+       " Backquotes prefixed with a backslash "\" are ignored.
+       " Using a loop here instead of a regex fixes a bug with nested "\=".
+       if stridx(snippet, '`') != -1
+               while match(snippet, '\(^\|[^\\]\)`.\{-}[^\\]`') != -1
+                       let snippet = substitute(snippet, '\(^\|[^\\]\)\zs`.\{-}[^\\]`\ze',
+                               \ substitute(eval(matchstr(snippet, '\(^\|[^\\]\)`\zs.\{-}[^\\]\ze`')),
+                               \ "\n\\%$", '', ''), '')
+               endw
+               let snippet = substitute(snippet, "\r", "\n", 'g')
+               let snippet = substitute(snippet, '\\`', '`', 'g')
+       endif
+
+       " Place all text after a colon in a tab stop after the tab stop
+       " (e.g. "${#:foo}" becomes "${:foo}foo").
+       " This helps tell the position of the tab stops later.
+       let snippet = substitute(snippet, '${\d\+:\(.\{-}\)}', '&\1', 'g')
+
+       " Update the a:snip so that all the $# become the text after
+       " the colon in their associated ${#}.
+       " (e.g. "${1:foo}" turns all "$1"'s into "foo")
+       let i = 1
+       while stridx(snippet, '${'.i) != -1
+               let s = matchstr(snippet, '${'.i.':\zs.\{-}\ze}')
+               if s != ''
+                       let snippet = substitute(snippet, '$'.i, s.'&', 'g')
+               endif
+               let i += 1
+       endw
+
+       if &et " Expand tabs to spaces if 'expandtab' is set.
+               return substitute(snippet, '\t', repeat(' ', &sts ? &sts : &sw), 'g')
+       endif
+       return snippet
+endf
+
+" Counts occurences of haystack in needle
+fun s:Count(haystack, needle)
+       let counter = 0
+       let index = stridx(a:haystack, a:needle)
+       while index != -1
+               let index = stridx(a:haystack, a:needle, index+1)
+               let counter += 1
+       endw
+       return counter
+endf
+
+" Builds a list of a list of each tab stop in the snippet containing:
+" 1.) The tab stop's line number.
+" 2.) The tab stop's column number
+"     (by getting the length of the string between the last "\n" and the
+"     tab stop).
+" 3.) The length of the text after the colon for the current tab stop
+"     (e.g. "${1:foo}" would return 3). If there is no text, -1 is returned.
+" 4.) If the "${#:}" construct is given, another list containing all
+"     the matches of "$#", to be replaced with the placeholder. This list is
+"     composed the same way as the parent; the first item is the line number,
+"     and the second is the column.
+fun s:BuildTabStops(snip, lnum, col, indent)
+       let snipPos = []
+       let i = 1
+       let withoutVars = substitute(a:snip, '$\d\+', '', 'g')
+       while stridx(a:snip, '${'.i) != -1
+               let beforeTabStop = matchstr(withoutVars, '^.*\ze${'.i.'\D')
+               let withoutOthers = substitute(withoutVars, '${\('.i.'\D\)\@!\d\+.\{-}}', '', 'g')
+
+               let j = i - 1
+               call add(snipPos, [0, 0, -1])
+               let snipPos[j][0] = a:lnum + s:Count(beforeTabStop, "\n")
+               let snipPos[j][1] = a:indent + len(matchstr(withoutOthers, '.*\(\n\|^\)\zs.*\ze${'.i.'\D'))
+               if snipPos[j][0] == a:lnum | let snipPos[j][1] += a:col | endif
+
+               " Get all $# matches in another list, if ${#:name} is given
+               if stridx(withoutVars, '${'.i.':') != -1
+                       let snipPos[j][2] = len(matchstr(withoutVars, '${'.i.':\zs.\{-}\ze}'))
+                       let dots = repeat('.', snipPos[j][2])
+                       call add(snipPos[j], [])
+                       let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g')
+                       while match(withoutOthers, '$'.i.'\(\D\|$\)') != -1
+                               let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\(\D\|$\)')
+                               call add(snipPos[j][3], [0, 0])
+                               let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n")
+                               let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum
+                                                          \ ? len(matchstr(beforeMark, '.*\n\zs.*'))
+                                                          \ : a:col + len(beforeMark))
+                               let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\(\D\|$\)', '', '')
+                       endw
+               endif
+               let i += 1
+       endw
+       return [snipPos, i - 1]
+endf
+
+fun snipMate#jumpTabStop(backwards)
+       let leftPlaceholder = exists('s:origWordLen')
+                             \ && s:origWordLen != g:snipPos[s:curPos][2]
+       if leftPlaceholder && exists('s:oldEndCol')
+               let startPlaceholder = s:oldEndCol + 1
+       endif
+
+       if exists('s:update')
+               call s:UpdatePlaceholderTabStops()
+       else
+               call s:UpdateTabStops()
+       endif
+
+       " Don't reselect placeholder if it has been modified
+       if leftPlaceholder && g:snipPos[s:curPos][2] != -1
+               if exists('startPlaceholder')
+                       let g:snipPos[s:curPos][1] = startPlaceholder
+               else
+                       let g:snipPos[s:curPos][1] = col('.')
+                       let g:snipPos[s:curPos][2] = 0
+               endif
+       endif
+
+       let s:curPos += a:backwards ? -1 : 1
+       " Loop over the snippet when going backwards from the beginning
+       if s:curPos < 0 | let s:curPos = s:snipLen - 1 | endif
+
+       if s:curPos == s:snipLen
+               let sMode = s:endCol == g:snipPos[s:curPos-1][1]+g:snipPos[s:curPos-1][2]
+               call s:RemoveSnippet()
+               return sMode ? "\<tab>" : TriggerSnippet()
+       endif
+
+       call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1])
+
+       let s:endLine = g:snipPos[s:curPos][0]
+       let s:endCol = g:snipPos[s:curPos][1]
+       let s:prevLen = [line('$'), col('$')]
+
+       return g:snipPos[s:curPos][2] == -1 ? '' : s:SelectWord()
+endf
+
+fun s:UpdatePlaceholderTabStops()
+       let changeLen = s:origWordLen - g:snipPos[s:curPos][2]
+       unl s:startCol s:origWordLen s:update
+       if !exists('s:oldVars') | return | endif
+       " Update tab stops in snippet if text has been added via "$#"
+       " (e.g., in "${1:foo}bar$1${2}").
+       if changeLen != 0
+               let curLine = line('.')
+
+               for pos in g:snipPos
+                       if pos == g:snipPos[s:curPos] | continue | endif
+                       let changed = pos[0] == curLine && pos[1] > s:oldEndCol
+                       let changedVars = 0
+                       let endPlaceholder = pos[2] - 1 + pos[1]
+                       " Subtract changeLen from each tab stop that was after any of
+                       " the current tab stop's placeholders.
+                       for [lnum, col] in s:oldVars
+                               if lnum > pos[0] | break | endif
+                               if pos[0] == lnum
+                                       if pos[1] > col || (pos[2] == -1 && pos[1] == col)
+                                               let changed += 1
+                                       elseif col < endPlaceholder
+                                               let changedVars += 1
+                                       endif
+                               endif
+                       endfor
+                       let pos[1] -= changeLen * changed
+                       let pos[2] -= changeLen * changedVars " Parse variables within placeholders
+                                                  " e.g., "${1:foo} ${2:$1bar}"
+
+                       if pos[2] == -1 | continue | endif
+                       " Do the same to any placeholders in the other tab stops.
+                       for nPos in pos[3]
+                               let changed = nPos[0] == curLine && nPos[1] > s:oldEndCol
+                               for [lnum, col] in s:oldVars
+                                       if lnum > nPos[0] | break | endif
+                                       if nPos[0] == lnum && nPos[1] > col
+                                               let changed += 1
+                                       endif
+                               endfor
+                               let nPos[1] -= changeLen * changed
+                       endfor
+               endfor
+       endif
+       unl s:endCol s:oldVars s:oldEndCol
+endf
+
+fun s:UpdateTabStops()
+       let changeLine = s:endLine - g:snipPos[s:curPos][0]
+       let changeCol = s:endCol - g:snipPos[s:curPos][1]
+       if exists('s:origWordLen')
+               let changeCol -= s:origWordLen
+               unl s:origWordLen
+       endif
+       let lnum = g:snipPos[s:curPos][0]
+       let col = g:snipPos[s:curPos][1]
+       " Update the line number of all proceeding tab stops if <cr> has
+       " been inserted.
+       if changeLine != 0
+               let changeLine -= 1
+               for pos in g:snipPos
+                       if pos[0] >= lnum
+                               if pos[0] == lnum | let pos[1] += changeCol | endif
+                               let pos[0] += changeLine
+                       endif
+                       if pos[2] == -1 | continue | endif
+                       for nPos in pos[3]
+                               if nPos[0] >= lnum
+                                       if nPos[0] == lnum | let nPos[1] += changeCol | endif
+                                       let nPos[0] += changeLine
+                               endif
+                       endfor
+               endfor
+       elseif changeCol != 0
+               " Update the column of all proceeding tab stops if text has
+               " been inserted/deleted in the current line.
+               for pos in g:snipPos
+                       if pos[1] >= col && pos[0] == lnum
+                               let pos[1] += changeCol
+                       endif
+                       if pos[2] == -1 | continue | endif
+                       for nPos in pos[3]
+                               if nPos[0] > lnum | break | endif
+                               if nPos[0] == lnum && nPos[1] >= col
+                                       let nPos[1] += changeCol
+                               endif
+                       endfor
+               endfor
+       endif
+endf
+
+fun s:SelectWord()
+       let s:origWordLen = g:snipPos[s:curPos][2]
+       let s:oldWord = strpart(getline('.'), g:snipPos[s:curPos][1] - 1,
+                               \ s:origWordLen)
+       let s:prevLen[1] -= s:origWordLen
+       if !empty(g:snipPos[s:curPos][3])
+               let s:update = 1
+               let s:endCol = -1
+               let s:startCol = g:snipPos[s:curPos][1] - 1
+       endif
+       if !s:origWordLen | return '' | endif
+       let l = col('.') != 1 ? 'l' : ''
+       if &sel == 'exclusive'
+               return "\<esc>".l.'v'.s:origWordLen."l\<c-g>"
+       endif
+       return s:origWordLen == 1 ? "\<esc>".l.'gh'
+                                                       \ : "\<esc>".l.'v'.(s:origWordLen - 1)."l\<c-g>"
+endf
+
+" This updates the snippet as you type when text needs to be inserted
+" into multiple places (e.g. in "${1:default text}foo$1bar$1",
+" "default text" would be highlighted, and if the user types something,
+" UpdateChangedSnip() would be called so that the text after "foo" & "bar"
+" are updated accordingly)
+"
+" It also automatically quits the snippet if the cursor is moved out of it
+" while in insert mode.
+fun s:UpdateChangedSnip(entering)
+       if exists('g:snipPos') && bufnr(0) != s:lastBuf
+               call s:RemoveSnippet()
+       elseif exists('s:update') " If modifying a placeholder
+               if !exists('s:oldVars') && s:curPos + 1 < s:snipLen
+                       " Save the old snippet & word length before it's updated
+                       " s:startCol must be saved too, in case text is added
+                       " before the snippet (e.g. in "foo$1${2}bar${1:foo}").
+                       let s:oldEndCol = s:startCol
+                       let s:oldVars = deepcopy(g:snipPos[s:curPos][3])
+               endif
+               let col = col('.') - 1
+
+               if s:endCol != -1
+                       let changeLen = col('$') - s:prevLen[1]
+                       let s:endCol += changeLen
+               else " When being updated the first time, after leaving select mode
+                       if a:entering | return | endif
+                       let s:endCol = col - 1
+               endif
+
+               " If the cursor moves outside the snippet, quit it
+               if line('.') != g:snipPos[s:curPos][0] || col < s:startCol ||
+                                       \ col - 1 > s:endCol
+                       unl! s:startCol s:origWordLen s:oldVars s:update
+                       return s:RemoveSnippet()
+               endif
+
+               call s:UpdateVars()
+               let s:prevLen[1] = col('$')
+       elseif exists('g:snipPos')
+               if !a:entering && g:snipPos[s:curPos][2] != -1
+                       let g:snipPos[s:curPos][2] = -2
+               endif
+
+               let col = col('.')
+               let lnum = line('.')
+               let changeLine = line('$') - s:prevLen[0]
+
+               if lnum == s:endLine
+                       let s:endCol += col('$') - s:prevLen[1]
+                       let s:prevLen = [line('$'), col('$')]
+               endif
+               if changeLine != 0
+                       let s:endLine += changeLine
+                       let s:endCol = col
+               endif
+
+               " Delete snippet if cursor moves out of it in insert mode
+               if (lnum == s:endLine && (col > s:endCol || col < g:snipPos[s:curPos][1]))
+                       \ || lnum > s:endLine || lnum < g:snipPos[s:curPos][0]
+                       call s:RemoveSnippet()
+               endif
+       endif
+endf
+
+" This updates the variables in a snippet when a placeholder has been edited.
+" (e.g., each "$1" in "${1:foo} $1bar $1bar")
+fun s:UpdateVars()
+       let newWordLen = s:endCol - s:startCol + 1
+       let newWord = strpart(getline('.'), s:startCol, newWordLen)
+       if newWord == s:oldWord || empty(g:snipPos[s:curPos][3])
+               return
+       endif
+
+       let changeLen = g:snipPos[s:curPos][2] - newWordLen
+       let curLine = line('.')
+       let startCol = col('.')
+       let oldStartSnip = s:startCol
+       let updateTabStops = changeLen != 0
+       let i = 0
+
+       for [lnum, col] in g:snipPos[s:curPos][3]
+               if updateTabStops
+                       let start = s:startCol
+                       if lnum == curLine && col <= start
+                               let s:startCol -= changeLen
+                               let s:endCol -= changeLen
+                       endif
+                       for nPos in g:snipPos[s:curPos][3][(i):]
+                               " This list is in ascending order, so quit if we've gone too far.
+                               if nPos[0] > lnum | break | endif
+                               if nPos[0] == lnum && nPos[1] > col
+                                       let nPos[1] -= changeLen
+                               endif
+                       endfor
+                       if lnum == curLine && col > start
+                               let col -= changeLen
+                               let g:snipPos[s:curPos][3][i][1] = col
+                       endif
+                       let i += 1
+               endif
+
+               " "Very nomagic" is used here to allow special characters.
+               call setline(lnum, substitute(getline(lnum), '\%'.col.'c\V'.
+                                               \ escape(s:oldWord, '\'), escape(newWord, '\&'), ''))
+       endfor
+       if oldStartSnip != s:startCol
+               call cursor(0, startCol + s:startCol - oldStartSnip)
+       endif
+
+       let s:oldWord = newWord
+       let g:snipPos[s:curPos][2] = newWordLen
+endf
+" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/autoload/syntastic.vim b/vim/autoload/syntastic.vim
new file mode 100644 (file)
index 0000000..a477736
--- /dev/null
@@ -0,0 +1,24 @@
+
+function! syntastic#ErrorBalloonExpr()
+    if !exists('b:syntastic_balloons') | return '' | endif
+    return get(b:syntastic_balloons, v:beval_lnum, '')
+endfunction
+
+function! syntastic#HighlightErrors(errors, termfunc, ...)
+    call clearmatches()
+    let forcecb = a:0 && a:1
+    for item in a:errors
+        let group = item['type'] == 'E' ? 'SpellBad' : 'SpellCap'
+        if item['col'] && !forcecb
+            let lastcol = col([item['lnum'], '$'])
+            let lcol = min([lastcol, item['col']])
+            call matchadd(group, '\%'.item['lnum'].'l\%'.lcol.'c')
+        else
+            let term = a:termfunc(item)
+            if len(term) > 0
+                call matchadd(group, '\%' . item['lnum'] . 'l' . term)
+            endif
+        endif
+    endfor
+endfunction
+
diff --git a/vim/autoload/syntastic/c.vim b/vim/autoload/syntastic/c.vim
new file mode 100644 (file)
index 0000000..c7232df
--- /dev/null
@@ -0,0 +1,171 @@
+if exists("g:loaded_syntastic_c_autoload")
+    finish
+endif
+let g:loaded_syntastic_c_autoload = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" initialize c/cpp syntax checker handlers
+function! s:Init()
+    let s:handlers = []
+    let s:cflags = {}
+
+    call s:RegHandler('gtk', 'syntastic#c#CheckPKG',
+                \ ['gtk', 'gtk+-2.0', 'gtk+', 'glib-2.0', 'glib'])
+    call s:RegHandler('glib', 'syntastic#c#CheckPKG',
+                \ ['glib', 'glib-2.0', 'glib'])
+    call s:RegHandler('glade', 'syntastic#c#CheckPKG',
+                \ ['glade', 'libglade-2.0', 'libglade'])
+    call s:RegHandler('libsoup', 'syntastic#c#CheckPKG',
+                \ ['libsoup', 'libsoup-2.4', 'libsoup-2.2'])
+    call s:RegHandler('webkit', 'syntastic#c#CheckPKG',
+                \ ['webkit', 'webkit-1.0'])
+    call s:RegHandler('cairo', 'syntastic#c#CheckPKG',
+                \ ['cairo', 'cairo'])
+    call s:RegHandler('pango', 'syntastic#c#CheckPKG',
+                \ ['pango', 'pango'])
+    call s:RegHandler('libxml', 'syntastic#c#CheckPKG',
+                \ ['libxml', 'libxml-2.0', 'libxml'])
+    call s:RegHandler('freetype', 'syntastic#c#CheckPKG',
+                \ ['freetype', 'freetype2', 'freetype'])
+    call s:RegHandler('SDL', 'syntastic#c#CheckPKG',
+                \ ['sdl', 'sdl'])
+    call s:RegHandler('opengl', 'syntastic#c#CheckPKG',
+                \ ['opengl', 'gl'])
+    call s:RegHandler('ruby', 'syntastic#c#CheckRuby', [])
+    call s:RegHandler('Python\.h', 'syntastic#c#CheckPython', [])
+    call s:RegHandler('php\.h', 'syntastic#c#CheckPhp', [])
+endfunction
+
+" search the first 100 lines for include statements that are
+" given in the handlers dictionary
+function! syntastic#c#SearchHeaders()
+    let includes = ''
+    let files = []
+    let found = []
+    let lines = filter(getline(1, 100), 'v:val =~# "#\s*include"')
+
+    " search current buffer
+    for line in lines
+        let file = matchstr(line, '"\zs\S\+\ze"')
+        if file != ''
+            call add(files, file)
+            continue
+        endif
+        for handler in s:handlers
+            if line =~# handler["regex"]
+                let includes .= call(handler["func"], handler["args"])
+                call add(found, handler["regex"])
+                break
+            endif
+        endfor
+    endfor
+
+    " search included headers
+    for hfile in files
+        if hfile != ''
+            let filename = expand('%:p:h') . ((has('win32') || has('win64')) ?
+                        \ '\' : '/') . hfile
+            try
+                let lines = readfile(filename, '', 100)
+            catch /E484/
+                continue
+            endtry
+            let lines = filter(lines, 'v:val =~# "#\s*include"')
+            for handler in s:handlers
+                if index(found, handler["regex"]) != -1
+                    continue
+                endif
+                for line in lines
+                    if line =~# handler["regex"]
+                        let includes .= call(handler["func"], handler["args"])
+                        call add(found, handler["regex"])
+                        break
+                    endif
+                endfor
+            endfor
+        endif
+    endfor
+
+    return includes
+endfunction
+
+" try to find library with 'pkg-config'
+" search possible libraries from first to last given
+" argument until one is found
+function! syntastic#c#CheckPKG(name, ...)
+    if executable('pkg-config')
+        if !has_key(s:cflags, a:name)
+            for i in range(a:0)
+                let l:cflags = system('pkg-config --cflags '.a:000[i])
+                " since we cannot necessarily trust the pkg-config exit code
+                " we have to check for an error output as well
+                if v:shell_error == 0 && l:cflags !~? 'not found'
+                    let l:cflags = ' '.substitute(l:cflags, "\n", '', '')
+                    let s:cflags[a:name] = l:cflags
+                    return l:cflags
+                endif
+            endfor
+        else
+            return s:cflags[a:name]
+        endif
+    endif
+    return ''
+endfunction
+
+" try to find PHP includes with 'php-config'
+function! syntastic#c#CheckPhp()
+    if executable('php-config')
+        if !exists('s:php_flags')
+            let s:php_flags = system('php-config --includes')
+            let s:php_flags = ' ' . substitute(s:php_flags, "\n", '', '')
+        endif
+        return s:php_flags
+    endif
+    return ''
+endfunction
+
+" try to find the ruby headers with 'rbconfig'
+function! syntastic#c#CheckRuby()
+    if executable('ruby')
+        if !exists('s:ruby_flags')
+            let s:ruby_flags = system('ruby -r rbconfig -e '
+                        \ . '''puts Config::CONFIG["archdir"]''')
+            let s:ruby_flags = substitute(s:ruby_flags, "\n", '', '')
+            let s:ruby_flags = ' -I' . s:ruby_flags
+        endif
+        return s:ruby_flags
+    endif
+    return ''
+endfunction
+
+" try to find the python headers with distutils
+function! syntastic#c#CheckPython()
+    if executable('python')
+        if !exists('s:python_flags')
+            let s:python_flags = system('python -c ''from distutils import '
+                        \ . 'sysconfig; import sys; sys.stdout.write(sysconfig.get_python_inc())''')
+            let s:python_flags = substitute(s:python_flags, "\n", '', '')
+            let s:python_flags = ' -I' . s:python_flags
+        endif
+        return s:python_flags
+    endif
+    return ''
+endfunction
+
+" return a handler dictionary object
+function! s:RegHandler(regex, function, args)
+    let handler = {}
+    let handler["regex"] = a:regex
+    let handler["func"] = function(a:function)
+    let handler["args"] = a:args
+    call add(s:handlers, handler)
+endfunction
+
+call s:Init()
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set et sts=4 sw=4:
diff --git a/vim/autoload/tagbar.vim b/vim/autoload/tagbar.vim
new file mode 100644 (file)
index 0000000..48ad320
--- /dev/null
@@ -0,0 +1,3099 @@
+" ============================================================================
+" File:        tagbar.vim
+" Description: List the current file's tags in a sidebar, ordered by class etc
+" Author:      Jan Larres <jan@majutsushi.net>
+" Licence:     Vim licence
+" Website:     http://majutsushi.github.com/tagbar/
+" Version:     2.3
+" Note:        This plugin was heavily inspired by the 'Taglist' plugin by
+"              Yegappan Lakshmanan and uses a small amount of code from it.
+"
+" Original taglist copyright notice:
+"              Permission is hereby granted to use and distribute this code,
+"              with or without modifications, provided that this copyright
+"              notice is copied with it. Like anything else that's free,
+"              taglist.vim is provided *as is* and comes with no warranty of
+"              any kind, either expressed or implied. In no event will the
+"              copyright holder be liable for any damamges resulting from the
+"              use of this software.
+" ============================================================================
+
+scriptencoding utf-8
+
+" Initialization {{{1
+
+" Basic init {{{2
+
+if !exists('g:tagbar_ctags_bin')
+    if executable('ctags-exuberant')
+        let g:tagbar_ctags_bin = 'ctags-exuberant'
+    elseif executable('exuberant-ctags')
+        let g:tagbar_ctags_bin = 'exuberant-ctags'
+    elseif executable('exctags')
+        let g:tagbar_ctags_bin = 'exctags'
+    elseif has('macunix') && executable('/usr/local/bin/ctags')
+        " Homebrew default location
+        let g:tagbar_ctags_bin = '/usr/local/bin/ctags'
+    elseif has('macunix') && executable('/opt/local/bin/ctags')
+        " Macports default location
+        let g:tagbar_ctags_bin = '/opt/local/bin/ctags'
+    elseif executable('ctags')
+        let g:tagbar_ctags_bin = 'ctags'
+    elseif executable('ctags.exe')
+        let g:tagbar_ctags_bin = 'ctags.exe'
+    elseif executable('tags')
+        let g:tagbar_ctags_bin = 'tags'
+    else
+        echomsg 'Tagbar: Exuberant ctags not found, skipping plugin'
+        finish
+    endif
+else
+    " reset 'wildignore' temporarily in case *.exe is included in it
+    let wildignore_save = &wildignore
+    set wildignore&
+
+    let g:tagbar_ctags_bin = expand(g:tagbar_ctags_bin)
+
+    let &wildignore = wildignore_save
+
+    if !executable(g:tagbar_ctags_bin)
+        echomsg 'Tagbar: Exuberant ctags not found in specified place,'
+              \ 'skipping plugin'
+        finish
+    endif
+endif
+
+redir => s:ftype_out
+silent filetype
+redir END
+if s:ftype_out !~# 'detection:ON'
+    echomsg 'Tagbar: Filetype detection is turned off, skipping plugin'
+    unlet s:ftype_out
+    finish
+endif
+unlet s:ftype_out
+
+let s:icon_closed = g:tagbar_iconchars[0]
+let s:icon_open   = g:tagbar_iconchars[1]
+
+let s:type_init_done    = 0
+let s:autocommands_done = 0
+let s:checked_ctags     = 0
+let s:window_expanded   = 0
+
+let s:access_symbols = {
+    \ 'public'    : '+',
+    \ 'protected' : '#',
+    \ 'private'   : '-'
+\ }
+
+let g:loaded_tagbar = 1
+
+let s:last_highlight_tline = 0
+let s:debug = 0
+let s:debug_file = ''
+
+" s:Init() {{{2
+function! s:Init()
+    if !s:type_init_done
+        call s:InitTypes()
+    endif
+
+    if !s:checked_ctags
+        if !s:CheckForExCtags()
+            return
+        endif
+    endif
+endfunction
+
+" s:InitTypes() {{{2
+function! s:InitTypes()
+    call s:LogDebugMessage('Initializing types')
+
+    let s:known_types = {}
+
+    " Ant {{{3
+    let type_ant = {}
+    let type_ant.ctagstype = 'ant'
+    let type_ant.kinds     = [
+        \ {'short' : 'p', 'long' : 'projects', 'fold' : 0},
+        \ {'short' : 't', 'long' : 'targets',  'fold' : 0}
+    \ ]
+    let s:known_types.ant = type_ant
+    " Asm {{{3
+    let type_asm = {}
+    let type_asm.ctagstype = 'asm'
+    let type_asm.kinds     = [
+        \ {'short' : 'm', 'long' : 'macros',  'fold' : 0},
+        \ {'short' : 't', 'long' : 'types',   'fold' : 0},
+        \ {'short' : 'd', 'long' : 'defines', 'fold' : 0},
+        \ {'short' : 'l', 'long' : 'labels',  'fold' : 0}
+    \ ]
+    let s:known_types.asm = type_asm
+    " ASP {{{3
+    let type_aspvbs = {}
+    let type_aspvbs.ctagstype = 'asp'
+    let type_aspvbs.kinds     = [
+        \ {'short' : 'd', 'long' : 'constants',   'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',     'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',   'fold' : 0},
+        \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables',   'fold' : 0}
+    \ ]
+    let s:known_types.aspvbs = type_aspvbs
+    " Awk {{{3
+    let type_awk = {}
+    let type_awk.ctagstype = 'awk'
+    let type_awk.kinds     = [
+        \ {'short' : 'f', 'long' : 'functions', 'fold' : 0}
+    \ ]
+    let s:known_types.awk = type_awk
+    " Basic {{{3
+    let type_basic = {}
+    let type_basic.ctagstype = 'basic'
+    let type_basic.kinds     = [
+        \ {'short' : 'c', 'long' : 'constants',    'fold' : 0},
+        \ {'short' : 'g', 'long' : 'enumerations', 'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',    'fold' : 0},
+        \ {'short' : 'l', 'long' : 'labels',       'fold' : 0},
+        \ {'short' : 't', 'long' : 'types',        'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables',    'fold' : 0}
+    \ ]
+    let s:known_types.basic = type_basic
+    " BETA {{{3
+    let type_beta = {}
+    let type_beta.ctagstype = 'beta'
+    let type_beta.kinds     = [
+        \ {'short' : 'f', 'long' : 'fragments', 'fold' : 0},
+        \ {'short' : 's', 'long' : 'slots',     'fold' : 0},
+        \ {'short' : 'v', 'long' : 'patterns',  'fold' : 0}
+    \ ]
+    let s:known_types.beta = type_beta
+    " C {{{3
+    let type_c = {}
+    let type_c.ctagstype = 'c'
+    let type_c.kinds     = [
+        \ {'short' : 'd', 'long' : 'macros',      'fold' : 1},
+        \ {'short' : 'p', 'long' : 'prototypes',  'fold' : 1},
+        \ {'short' : 'g', 'long' : 'enums',       'fold' : 0},
+        \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0},
+        \ {'short' : 't', 'long' : 'typedefs',    'fold' : 0},
+        \ {'short' : 's', 'long' : 'structs',     'fold' : 0},
+        \ {'short' : 'u', 'long' : 'unions',      'fold' : 0},
+        \ {'short' : 'm', 'long' : 'members',     'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables',   'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',   'fold' : 0}
+    \ ]
+    let type_c.sro        = '::'
+    let type_c.kind2scope = {
+        \ 'g' : 'enum',
+        \ 's' : 'struct',
+        \ 'u' : 'union'
+    \ }
+    let type_c.scope2kind = {
+        \ 'enum'   : 'g',
+        \ 'struct' : 's',
+        \ 'union'  : 'u'
+    \ }
+    let s:known_types.c = type_c
+    " C++ {{{3
+    let type_cpp = {}
+    let type_cpp.ctagstype = 'c++'
+    let type_cpp.kinds     = [
+        \ {'short' : 'd', 'long' : 'macros',      'fold' : 1},
+        \ {'short' : 'p', 'long' : 'prototypes',  'fold' : 1},
+        \ {'short' : 'g', 'long' : 'enums',       'fold' : 0},
+        \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0},
+        \ {'short' : 't', 'long' : 'typedefs',    'fold' : 0},
+        \ {'short' : 'n', 'long' : 'namespaces',  'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',     'fold' : 0},
+        \ {'short' : 's', 'long' : 'structs',     'fold' : 0},
+        \ {'short' : 'u', 'long' : 'unions',      'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',   'fold' : 0},
+        \ {'short' : 'm', 'long' : 'members',     'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables',   'fold' : 0}
+    \ ]
+    let type_cpp.sro        = '::'
+    let type_cpp.kind2scope = {
+        \ 'g' : 'enum',
+        \ 'n' : 'namespace',
+        \ 'c' : 'class',
+        \ 's' : 'struct',
+        \ 'u' : 'union'
+    \ }
+    let type_cpp.scope2kind = {
+        \ 'enum'      : 'g',
+        \ 'namespace' : 'n',
+        \ 'class'     : 'c',
+        \ 'struct'    : 's',
+        \ 'union'     : 'u'
+    \ }
+    let s:known_types.cpp = type_cpp
+    " C# {{{3
+    let type_cs = {}
+    let type_cs.ctagstype = 'c#'
+    let type_cs.kinds     = [
+        \ {'short' : 'd', 'long' : 'macros',      'fold' : 1},
+        \ {'short' : 'f', 'long' : 'fields',      'fold' : 0},
+        \ {'short' : 'g', 'long' : 'enums',       'fold' : 0},
+        \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0},
+        \ {'short' : 't', 'long' : 'typedefs',    'fold' : 0},
+        \ {'short' : 'n', 'long' : 'namespaces',  'fold' : 0},
+        \ {'short' : 'i', 'long' : 'interfaces',  'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',     'fold' : 0},
+        \ {'short' : 's', 'long' : 'structs',     'fold' : 0},
+        \ {'short' : 'E', 'long' : 'events',      'fold' : 0},
+        \ {'short' : 'm', 'long' : 'methods',     'fold' : 0},
+        \ {'short' : 'p', 'long' : 'properties',  'fold' : 0}
+    \ ]
+    let type_cs.sro        = '.'
+    let type_cs.kind2scope = {
+        \ 'n' : 'namespace',
+        \ 'i' : 'interface',
+        \ 'c' : 'class',
+        \ 's' : 'struct',
+        \ 'g' : 'enum'
+    \ }
+    let type_cs.scope2kind = {
+        \ 'namespace' : 'n',
+        \ 'interface' : 'i',
+        \ 'class'     : 'c',
+        \ 'struct'    : 's',
+        \ 'enum'      : 'g'
+    \ }
+    let s:known_types.cs = type_cs
+    " COBOL {{{3
+    let type_cobol = {}
+    let type_cobol.ctagstype = 'cobol'
+    let type_cobol.kinds     = [
+        \ {'short' : 'd', 'long' : 'data items',        'fold' : 0},
+        \ {'short' : 'f', 'long' : 'file descriptions', 'fold' : 0},
+        \ {'short' : 'g', 'long' : 'group items',       'fold' : 0},
+        \ {'short' : 'p', 'long' : 'paragraphs',        'fold' : 0},
+        \ {'short' : 'P', 'long' : 'program ids',       'fold' : 0},
+        \ {'short' : 's', 'long' : 'sections',          'fold' : 0}
+    \ ]
+    let s:known_types.cobol = type_cobol
+    " DOS Batch {{{3
+    let type_dosbatch = {}
+    let type_dosbatch.ctagstype = 'dosbatch'
+    let type_dosbatch.kinds     = [
+        \ {'short' : 'l', 'long' : 'labels',    'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables', 'fold' : 0}
+    \ ]
+    let s:known_types.dosbatch = type_dosbatch
+    " Eiffel {{{3
+    let type_eiffel = {}
+    let type_eiffel.ctagstype = 'eiffel'
+    let type_eiffel.kinds     = [
+        \ {'short' : 'c', 'long' : 'classes',  'fold' : 0},
+        \ {'short' : 'f', 'long' : 'features', 'fold' : 0}
+    \ ]
+    let type_eiffel.sro        = '.' " Not sure, is nesting even possible?
+    let type_eiffel.kind2scope = {
+        \ 'c' : 'class',
+        \ 'f' : 'feature'
+    \ }
+    let type_eiffel.scope2kind = {
+        \ 'class'   : 'c',
+        \ 'feature' : 'f'
+    \ }
+    let s:known_types.eiffel = type_eiffel
+    " Erlang {{{3
+    let type_erlang = {}
+    let type_erlang.ctagstype = 'erlang'
+    let type_erlang.kinds     = [
+        \ {'short' : 'm', 'long' : 'modules',            'fold' : 0},
+        \ {'short' : 'd', 'long' : 'macro definitions',  'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',          'fold' : 0},
+        \ {'short' : 'r', 'long' : 'record definitions', 'fold' : 0}
+    \ ]
+    let type_erlang.sro        = '.' " Not sure, is nesting even possible?
+    let type_erlang.kind2scope = {
+        \ 'm' : 'module'
+    \ }
+    let type_erlang.scope2kind = {
+        \ 'module' : 'm'
+    \ }
+    let s:known_types.erlang = type_erlang
+    " Flex {{{3
+    " Vim doesn't support Flex out of the box, this is based on rough
+    " guesses and probably requires
+    " http://www.vim.org/scripts/script.php?script_id=2909
+    " Improvements welcome!
+    let type_mxml = {}
+    let type_mxml.ctagstype = 'flex'
+    let type_mxml.kinds     = [
+        \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',          'fold' : 0},
+        \ {'short' : 'm', 'long' : 'methods',          'fold' : 0},
+        \ {'short' : 'p', 'long' : 'properties',       'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',        'fold' : 0},
+        \ {'short' : 'x', 'long' : 'mxtags',           'fold' : 0}
+    \ ]
+    let type_mxml.sro        = '.'
+    let type_mxml.kind2scope = {
+        \ 'c' : 'class'
+    \ }
+    let type_mxml.scope2kind = {
+        \ 'class' : 'c'
+    \ }
+    let s:known_types.mxml = type_mxml
+    " Fortran {{{3
+    let type_fortran = {}
+    let type_fortran.ctagstype = 'fortran'
+    let type_fortran.kinds     = [
+        \ {'short' : 'm', 'long' : 'modules',                      'fold' : 0},
+        \ {'short' : 'p', 'long' : 'programs',                     'fold' : 0},
+        \ {'short' : 'k', 'long' : 'components',                   'fold' : 0},
+        \ {'short' : 't', 'long' : 'derived types and structures', 'fold' : 0},
+        \ {'short' : 'c', 'long' : 'common blocks',                'fold' : 0},
+        \ {'short' : 'b', 'long' : 'block data',                   'fold' : 0},
+        \ {'short' : 'e', 'long' : 'entry points',                 'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',                    'fold' : 0},
+        \ {'short' : 's', 'long' : 'subroutines',                  'fold' : 0},
+        \ {'short' : 'l', 'long' : 'labels',                       'fold' : 0},
+        \ {'short' : 'n', 'long' : 'namelists',                    'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables',                    'fold' : 0}
+    \ ]
+    let type_fortran.sro        = '.' " Not sure, is nesting even possible?
+    let type_fortran.kind2scope = {
+        \ 'm' : 'module',
+        \ 'p' : 'program',
+        \ 'f' : 'function',
+        \ 's' : 'subroutine'
+    \ }
+    let type_fortran.scope2kind = {
+        \ 'module'     : 'm',
+        \ 'program'    : 'p',
+        \ 'function'   : 'f',
+        \ 'subroutine' : 's'
+    \ }
+    let s:known_types.fortran = type_fortran
+    " HTML {{{3
+    let type_html = {}
+    let type_html.ctagstype = 'html'
+    let type_html.kinds     = [
+        \ {'short' : 'f', 'long' : 'JavaScript funtions', 'fold' : 0},
+        \ {'short' : 'a', 'long' : 'named anchors',       'fold' : 0}
+    \ ]
+    let s:known_types.html = type_html
+    " Java {{{3
+    let type_java = {}
+    let type_java.ctagstype = 'java'
+    let type_java.kinds     = [
+        \ {'short' : 'p', 'long' : 'packages',       'fold' : 1},
+        \ {'short' : 'f', 'long' : 'fields',         'fold' : 0},
+        \ {'short' : 'g', 'long' : 'enum types',     'fold' : 0},
+        \ {'short' : 'e', 'long' : 'enum constants', 'fold' : 0},
+        \ {'short' : 'i', 'long' : 'interfaces',     'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',        'fold' : 0},
+        \ {'short' : 'm', 'long' : 'methods',        'fold' : 0}
+    \ ]
+    let type_java.sro        = '.'
+    let type_java.kind2scope = {
+        \ 'g' : 'enum',
+        \ 'i' : 'interface',
+        \ 'c' : 'class'
+    \ }
+    let type_java.scope2kind = {
+        \ 'enum'      : 'g',
+        \ 'interface' : 'i',
+        \ 'class'     : 'c'
+    \ }
+    let s:known_types.java = type_java
+    " JavaScript {{{3
+    " JavaScript is weird -- it does have scopes, but ctags doesn't seem to
+    " properly generate the information for them, instead it simply uses the
+    " complete name. So ctags has to be fixed before I can do anything here.
+    " Alternatively jsctags/doctorjs will be used if available.
+    let type_javascript = {}
+    let type_javascript.ctagstype = 'javascript'
+    let jsctags = s:CheckFTCtags('jsctags', 'javascript')
+    if jsctags != ''
+        let type_javascript.kinds = [
+            \ {'short' : 'v', 'long' : 'variables', 'fold' : 0},
+            \ {'short' : 'f', 'long' : 'functions', 'fold' : 0}
+        \ ]
+        let type_javascript.sro        = '.'
+        let type_javascript.kind2scope = {
+            \ 'v' : 'namespace',
+            \ 'f' : 'namespace'
+        \ }
+        let type_javascript.scope2kind = {
+            \ 'namespace' : 'v'
+        \ }
+        let type_javascript.ctagsbin   = jsctags
+        let type_javascript.ctagsargs  = '-f -'
+    else
+        let type_javascript.kinds = [
+            \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0},
+            \ {'short' : 'c', 'long' : 'classes',          'fold' : 0},
+            \ {'short' : 'p', 'long' : 'properties',       'fold' : 0},
+            \ {'short' : 'm', 'long' : 'methods',          'fold' : 0},
+            \ {'short' : 'f', 'long' : 'functions',        'fold' : 0}
+        \ ]
+    endif
+    let s:known_types.javascript = type_javascript
+    " Lisp {{{3
+    let type_lisp = {}
+    let type_lisp.ctagstype = 'lisp'
+    let type_lisp.kinds     = [
+        \ {'short' : 'f', 'long' : 'functions', 'fold' : 0}
+    \ ]
+    let s:known_types.lisp = type_lisp
+    " Lua {{{3
+    let type_lua = {}
+    let type_lua.ctagstype = 'lua'
+    let type_lua.kinds     = [
+        \ {'short' : 'f', 'long' : 'functions', 'fold' : 0}
+    \ ]
+    let s:known_types.lua = type_lua
+    " Make {{{3
+    let type_make = {}
+    let type_make.ctagstype = 'make'
+    let type_make.kinds     = [
+        \ {'short' : 'm', 'long' : 'macros', 'fold' : 0}
+    \ ]
+    let s:known_types.make = type_make
+    " Matlab {{{3
+    let type_matlab = {}
+    let type_matlab.ctagstype = 'matlab'
+    let type_matlab.kinds     = [
+        \ {'short' : 'f', 'long' : 'functions', 'fold' : 0}
+    \ ]
+    let s:known_types.matlab = type_matlab
+    " Ocaml {{{3
+    let type_ocaml = {}
+    let type_ocaml.ctagstype = 'ocaml'
+    let type_ocaml.kinds     = [
+        \ {'short' : 'M', 'long' : 'modules or functors', 'fold' : 0},
+        \ {'short' : 'v', 'long' : 'global variables',    'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',             'fold' : 0},
+        \ {'short' : 'C', 'long' : 'constructors',        'fold' : 0},
+        \ {'short' : 'm', 'long' : 'methods',             'fold' : 0},
+        \ {'short' : 'e', 'long' : 'exceptions',          'fold' : 0},
+        \ {'short' : 't', 'long' : 'type names',          'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',           'fold' : 0},
+        \ {'short' : 'r', 'long' : 'structure fields',    'fold' : 0}
+    \ ]
+    let type_ocaml.sro        = '.' " Not sure, is nesting even possible?
+    let type_ocaml.kind2scope = {
+        \ 'M' : 'Module',
+        \ 'c' : 'class',
+        \ 't' : 'type'
+    \ }
+    let type_ocaml.scope2kind = {
+        \ 'Module' : 'M',
+        \ 'class'  : 'c',
+        \ 'type'   : 't'
+    \ }
+    let s:known_types.ocaml = type_ocaml
+    " Pascal {{{3
+    let type_pascal = {}
+    let type_pascal.ctagstype = 'pascal'
+    let type_pascal.kinds     = [
+        \ {'short' : 'f', 'long' : 'functions',  'fold' : 0},
+        \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0}
+    \ ]
+    let s:known_types.pascal = type_pascal
+    " Perl {{{3
+    let type_perl = {}
+    let type_perl.ctagstype = 'perl'
+    let type_perl.kinds     = [
+        \ {'short' : 'p', 'long' : 'packages',    'fold' : 1},
+        \ {'short' : 'c', 'long' : 'constants',   'fold' : 0},
+        \ {'short' : 'f', 'long' : 'formats',     'fold' : 0},
+        \ {'short' : 'l', 'long' : 'labels',      'fold' : 0},
+        \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0}
+    \ ]
+    let s:known_types.perl = type_perl
+    " PHP {{{3
+    let type_php = {}
+    let type_php.ctagstype = 'php'
+    let type_php.kinds     = [
+        \ {'short' : 'i', 'long' : 'interfaces',           'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',              'fold' : 0},
+        \ {'short' : 'd', 'long' : 'constant definitions', 'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',            'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables',            'fold' : 0},
+        \ {'short' : 'j', 'long' : 'javascript functions', 'fold' : 0}
+    \ ]
+    let s:known_types.php = type_php
+    " Python {{{3
+    let type_python = {}
+    let type_python.ctagstype = 'python'
+    let type_python.kinds     = [
+        \ {'short' : 'i', 'long' : 'imports',   'fold' : 1},
+        \ {'short' : 'c', 'long' : 'classes',   'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions', 'fold' : 0},
+        \ {'short' : 'm', 'long' : 'members',   'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables', 'fold' : 0}
+    \ ]
+    let type_python.sro        = '.'
+    let type_python.kind2scope = {
+        \ 'c' : 'class',
+        \ 'f' : 'function',
+        \ 'm' : 'function'
+    \ }
+    let type_python.scope2kind = {
+        \ 'class'    : 'c',
+        \ 'function' : 'f'
+    \ }
+    let s:known_types.python = type_python
+    " REXX {{{3
+    let type_rexx = {}
+    let type_rexx.ctagstype = 'rexx'
+    let type_rexx.kinds     = [
+        \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0}
+    \ ]
+    let s:known_types.rexx = type_rexx
+    " Ruby {{{3
+    let type_ruby = {}
+    let type_ruby.ctagstype = 'ruby'
+    let type_ruby.kinds     = [
+        \ {'short' : 'm', 'long' : 'modules',           'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',           'fold' : 0},
+        \ {'short' : 'f', 'long' : 'methods',           'fold' : 0},
+        \ {'short' : 'F', 'long' : 'singleton methods', 'fold' : 0}
+    \ ]
+    let type_ruby.sro        = '.'
+    let type_ruby.kind2scope = {
+        \ 'c' : 'class',
+        \ 'm' : 'class'
+    \ }
+    let type_ruby.scope2kind = {
+        \ 'class' : 'c'
+    \ }
+    let s:known_types.ruby = type_ruby
+    " Scheme {{{3
+    let type_scheme = {}
+    let type_scheme.ctagstype = 'scheme'
+    let type_scheme.kinds     = [
+        \ {'short' : 'f', 'long' : 'functions', 'fold' : 0},
+        \ {'short' : 's', 'long' : 'sets',      'fold' : 0}
+    \ ]
+    let s:known_types.scheme = type_scheme
+    " Shell script {{{3
+    let type_sh = {}
+    let type_sh.ctagstype = 'sh'
+    let type_sh.kinds     = [
+        \ {'short' : 'f', 'long' : 'functions', 'fold' : 0}
+    \ ]
+    let s:known_types.sh = type_sh
+    let s:known_types.csh = type_sh
+    let s:known_types.zsh = type_sh
+    " SLang {{{3
+    let type_slang = {}
+    let type_slang.ctagstype = 'slang'
+    let type_slang.kinds     = [
+        \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',  'fold' : 0}
+    \ ]
+    let s:known_types.slang = type_slang
+    " SML {{{3
+    let type_sml = {}
+    let type_sml.ctagstype = 'sml'
+    let type_sml.kinds     = [
+        \ {'short' : 'e', 'long' : 'exception declarations', 'fold' : 0},
+        \ {'short' : 'f', 'long' : 'function definitions',   'fold' : 0},
+        \ {'short' : 'c', 'long' : 'functor definitions',    'fold' : 0},
+        \ {'short' : 's', 'long' : 'signature declarations', 'fold' : 0},
+        \ {'short' : 'r', 'long' : 'structure declarations', 'fold' : 0},
+        \ {'short' : 't', 'long' : 'type definitions',       'fold' : 0},
+        \ {'short' : 'v', 'long' : 'value bindings',         'fold' : 0}
+    \ ]
+    let s:known_types.sml = type_sml
+    " SQL {{{3
+    " The SQL ctags parser seems to be buggy for me, so this just uses the
+    " normal kinds even though scopes should be available. Improvements
+    " welcome!
+    let type_sql = {}
+    let type_sql.ctagstype = 'sql'
+    let type_sql.kinds     = [
+        \ {'short' : 'P', 'long' : 'packages',               'fold' : 1},
+        \ {'short' : 'c', 'long' : 'cursors',                'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',              'fold' : 0},
+        \ {'short' : 'F', 'long' : 'record fields',          'fold' : 0},
+        \ {'short' : 'L', 'long' : 'block label',            'fold' : 0},
+        \ {'short' : 'p', 'long' : 'procedures',             'fold' : 0},
+        \ {'short' : 's', 'long' : 'subtypes',               'fold' : 0},
+        \ {'short' : 't', 'long' : 'tables',                 'fold' : 0},
+        \ {'short' : 'T', 'long' : 'triggers',               'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables',              'fold' : 0},
+        \ {'short' : 'i', 'long' : 'indexes',                'fold' : 0},
+        \ {'short' : 'e', 'long' : 'events',                 'fold' : 0},
+        \ {'short' : 'U', 'long' : 'publications',           'fold' : 0},
+        \ {'short' : 'R', 'long' : 'services',               'fold' : 0},
+        \ {'short' : 'D', 'long' : 'domains',                'fold' : 0},
+        \ {'short' : 'V', 'long' : 'views',                  'fold' : 0},
+        \ {'short' : 'n', 'long' : 'synonyms',               'fold' : 0},
+        \ {'short' : 'x', 'long' : 'MobiLink Table Scripts', 'fold' : 0},
+        \ {'short' : 'y', 'long' : 'MobiLink Conn Scripts',  'fold' : 0}
+    \ ]
+    let s:known_types.sql = type_sql
+    " Tcl {{{3
+    let type_tcl = {}
+    let type_tcl.ctagstype = 'tcl'
+    let type_tcl.kinds     = [
+        \ {'short' : 'c', 'long' : 'classes',    'fold' : 0},
+        \ {'short' : 'm', 'long' : 'methods',    'fold' : 0},
+        \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0}
+    \ ]
+    let s:known_types.tcl = type_tcl
+    " LaTeX {{{3
+    let type_tex = {}
+    let type_tex.ctagstype = 'tex'
+    let type_tex.kinds     = [
+        \ {'short' : 'p', 'long' : 'parts',          'fold' : 0},
+        \ {'short' : 'c', 'long' : 'chapters',       'fold' : 0},
+        \ {'short' : 's', 'long' : 'sections',       'fold' : 0},
+        \ {'short' : 'u', 'long' : 'subsections',    'fold' : 0},
+        \ {'short' : 'b', 'long' : 'subsubsections', 'fold' : 0},
+        \ {'short' : 'P', 'long' : 'paragraphs',     'fold' : 0},
+        \ {'short' : 'G', 'long' : 'subparagraphs',  'fold' : 0}
+    \ ]
+    let s:known_types.tex = type_tex
+    " Vera {{{3
+    " Why are variables 'virtual'?
+    let type_vera = {}
+    let type_vera.ctagstype = 'vera'
+    let type_vera.kinds     = [
+        \ {'short' : 'd', 'long' : 'macros',      'fold' : 1},
+        \ {'short' : 'g', 'long' : 'enums',       'fold' : 0},
+        \ {'short' : 'T', 'long' : 'typedefs',    'fold' : 0},
+        \ {'short' : 'c', 'long' : 'classes',     'fold' : 0},
+        \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0},
+        \ {'short' : 'm', 'long' : 'members',     'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',   'fold' : 0},
+        \ {'short' : 't', 'long' : 'tasks',       'fold' : 0},
+        \ {'short' : 'v', 'long' : 'variables',   'fold' : 0},
+        \ {'short' : 'p', 'long' : 'programs',    'fold' : 0}
+    \ ]
+    let type_vera.sro        = '.' " Nesting doesn't seem to be possible
+    let type_vera.kind2scope = {
+        \ 'g' : 'enum',
+        \ 'c' : 'class',
+        \ 'v' : 'virtual'
+    \ }
+    let type_vera.scope2kind = {
+        \ 'enum'      : 'g',
+        \ 'class'     : 'c',
+        \ 'virtual'   : 'v'
+    \ }
+    let s:known_types.vera = type_vera
+    " Verilog {{{3
+    let type_verilog = {}
+    let type_verilog.ctagstype = 'verilog'
+    let type_verilog.kinds     = [
+        \ {'short' : 'c', 'long' : 'constants',           'fold' : 0},
+        \ {'short' : 'e', 'long' : 'events',              'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',           'fold' : 0},
+        \ {'short' : 'm', 'long' : 'modules',             'fold' : 0},
+        \ {'short' : 'n', 'long' : 'net data types',      'fold' : 0},
+        \ {'short' : 'p', 'long' : 'ports',               'fold' : 0},
+        \ {'short' : 'r', 'long' : 'register data types', 'fold' : 0},
+        \ {'short' : 't', 'long' : 'tasks',               'fold' : 0}
+    \ ]
+    let s:known_types.verilog = type_verilog
+    " VHDL {{{3
+    " The VHDL ctags parser unfortunately doesn't generate proper scopes
+    let type_vhdl = {}
+    let type_vhdl.ctagstype = 'vhdl'
+    let type_vhdl.kinds     = [
+        \ {'short' : 'P', 'long' : 'packages',   'fold' : 1},
+        \ {'short' : 'c', 'long' : 'constants',  'fold' : 0},
+        \ {'short' : 't', 'long' : 'types',      'fold' : 0},
+        \ {'short' : 'T', 'long' : 'subtypes',   'fold' : 0},
+        \ {'short' : 'r', 'long' : 'records',    'fold' : 0},
+        \ {'short' : 'e', 'long' : 'entities',   'fold' : 0},
+        \ {'short' : 'f', 'long' : 'functions',  'fold' : 0},
+        \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0}
+    \ ]
+    let s:known_types.vhdl = type_vhdl
+    " Vim {{{3
+    let type_vim = {}
+    let type_vim.ctagstype = 'vim'
+    let type_vim.kinds     = [
+        \ {'short' : 'v', 'long' : 'variables',          'fold' : 1},
+        \ {'short' : 'f', 'long' : 'functions',          'fold' : 0},
+        \ {'short' : 'a', 'long' : 'autocommand groups', 'fold' : 1},
+        \ {'short' : 'c', 'long' : 'commands',           'fold' : 0},
+        \ {'short' : 'm', 'long' : 'maps',               'fold' : 1}
+    \ ]
+    let s:known_types.vim = type_vim
+    " YACC {{{3
+    let type_yacc = {}
+    let type_yacc.ctagstype = 'yacc'
+    let type_yacc.kinds     = [
+        \ {'short' : 'l', 'long' : 'labels', 'fold' : 0}
+    \ ]
+    let s:known_types.yacc = type_yacc
+    " }}}3
+
+    let user_defs = s:GetUserTypeDefs()
+    for [key, value] in items(user_defs)
+        if !has_key(s:known_types, key) ||
+         \ (has_key(value, 'replace') && value.replace)
+            let s:known_types[key] = value
+        else
+            call extend(s:known_types[key], value)
+        endif
+    endfor
+
+    " Create a dictionary of the kind order for fast
+    " access in sorting functions
+    for type in values(s:known_types)
+        let i = 0
+        let type.kinddict = {}
+        for kind in type.kinds
+            let type.kinddict[kind.short] = i
+            let i += 1
+        endfor
+    endfor
+
+    let s:type_init_done = 1
+endfunction
+
+" s:GetUserTypeDefs() {{{2
+function! s:GetUserTypeDefs()
+    call s:LogDebugMessage('Initializing user types')
+
+    redir => defs
+    silent execute 'let g:'
+    redir END
+
+    let deflist = split(defs, '\n')
+    call map(deflist, 'substitute(v:val, ''^\S\+\zs.*'', "", "")')
+    call filter(deflist, 'v:val =~ "^tagbar_type_"')
+
+    let defdict = {}
+    for defstr in deflist
+        let type = substitute(defstr, '^tagbar_type_', '', '')
+        execute 'let defdict["' . type . '"] = g:' . defstr
+    endfor
+
+    " If the user only specified one of kind2scope and scope2kind use it to
+    " generate the other one
+    " Also, transform the 'kind' definitions into dictionary format
+    for def in values(defdict)
+        if has_key(def, 'kinds')
+            let kinds = def.kinds
+            let def.kinds = []
+            for kind in kinds
+                let kindlist = split(kind, ':')
+                let kinddict = {'short' : kindlist[0], 'long' : kindlist[1]}
+                if len(kindlist) == 3
+                    let kinddict.fold = kindlist[2]
+                else
+                    let kinddict.fold = 0
+                endif
+                call add(def.kinds, kinddict)
+            endfor
+        endif
+
+        if has_key(def, 'kind2scope') && !has_key(def, 'scope2kind')
+            let def.scope2kind = {}
+            for [key, value] in items(def.kind2scope)
+                let def.scope2kind[value] = key
+            endfor
+        elseif has_key(def, 'scope2kind') && !has_key(def, 'kind2scope')
+            let def.kind2scope = {}
+            for [key, value] in items(def.scope2kind)
+                let def.kind2scope[value] = key
+            endfor
+        endif
+    endfor
+
+    return defdict
+endfunction
+
+" s:RestoreSession() {{{2
+" Properly restore Tagbar after a session got loaded
+function! s:RestoreSession()
+    call s:LogDebugMessage('Restoring session')
+
+    let tagbarwinnr = bufwinnr('__Tagbar__')
+    if tagbarwinnr == -1
+        " Tagbar wasn't open in the saved session, nothing to do
+        return
+    else
+        let in_tagbar = 1
+        if winnr() != tagbarwinnr
+            execute tagbarwinnr . 'wincmd w'
+            let in_tagbar = 0
+        endif
+    endif
+
+    call s:Init()
+
+    call s:InitWindow(g:tagbar_autoclose)
+
+    " Leave the Tagbar window and come back so the update event gets triggered
+    wincmd p
+    execute tagbarwinnr . 'wincmd w'
+
+    if !in_tagbar
+        wincmd p
+    endif
+endfunction
+
+" s:MapKeys() {{{2
+function! s:MapKeys()
+    call s:LogDebugMessage('Mapping keys')
+
+    nnoremap <script> <silent> <buffer> <2-LeftMouse>
+                                              \ :call <SID>JumpToTag(0)<CR>
+    nnoremap <script> <silent> <buffer> <LeftRelease>
+                                 \ <LeftRelease>:call <SID>CheckMouseClick()<CR>
+
+    inoremap <script> <silent> <buffer> <2-LeftMouse>
+                                              \ <C-o>:call <SID>JumpToTag(0)<CR>
+    inoremap <script> <silent> <buffer> <LeftRelease>
+                            \ <LeftRelease><C-o>:call <SID>CheckMouseClick()<CR>
+
+    nnoremap <script> <silent> <buffer> <CR>    :call <SID>JumpToTag(0)<CR>
+    nnoremap <script> <silent> <buffer> p       :call <SID>JumpToTag(1)<CR>
+    nnoremap <script> <silent> <buffer> <Space> :call <SID>ShowPrototype()<CR>
+
+    nnoremap <script> <silent> <buffer> +        :call <SID>OpenFold()<CR>
+    nnoremap <script> <silent> <buffer> <kPlus>  :call <SID>OpenFold()<CR>
+    nnoremap <script> <silent> <buffer> zo       :call <SID>OpenFold()<CR>
+    nnoremap <script> <silent> <buffer> -        :call <SID>CloseFold()<CR>
+    nnoremap <script> <silent> <buffer> <kMinus> :call <SID>CloseFold()<CR>
+    nnoremap <script> <silent> <buffer> zc       :call <SID>CloseFold()<CR>
+    nnoremap <script> <silent> <buffer> o        :call <SID>ToggleFold()<CR>
+    nnoremap <script> <silent> <buffer> za       :call <SID>ToggleFold()<CR>
+
+    nnoremap <script> <silent> <buffer> *    :call <SID>SetFoldLevel(99)<CR>
+    nnoremap <script> <silent> <buffer> <kMultiply>
+                                           \ :call <SID>SetFoldLevel(99)<CR>
+    nnoremap <script> <silent> <buffer> zR   :call <SID>SetFoldLevel(99)<CR>
+    nnoremap <script> <silent> <buffer> =    :call <SID>SetFoldLevel(0)<CR>
+    nnoremap <script> <silent> <buffer> zM   :call <SID>SetFoldLevel(0)<CR>
+
+    nnoremap <script> <silent> <buffer> <C-N>
+                                        \ :call <SID>GotoNextToplevelTag(1)<CR>
+    nnoremap <script> <silent> <buffer> <C-P>
+                                        \ :call <SID>GotoNextToplevelTag(-1)<CR>
+
+    nnoremap <script> <silent> <buffer> s    :call <SID>ToggleSort()<CR>
+    nnoremap <script> <silent> <buffer> x    :call <SID>ZoomWindow()<CR>
+    nnoremap <script> <silent> <buffer> q    :call <SID>CloseWindow()<CR>
+    nnoremap <script> <silent> <buffer> <F1> :call <SID>ToggleHelp()<CR>
+endfunction
+
+" s:CreateAutocommands() {{{2
+function! s:CreateAutocommands()
+    call s:LogDebugMessage('Creating autocommands')
+
+    augroup TagbarAutoCmds
+        autocmd!
+        autocmd BufEnter   __Tagbar__ nested call s:QuitIfOnlyWindow()
+        autocmd BufUnload  __Tagbar__ call s:CleanUp()
+        autocmd CursorHold __Tagbar__ call s:ShowPrototype()
+
+        autocmd BufWritePost *
+            \ if line('$') < g:tagbar_updateonsave_maxlines |
+                \ call s:AutoUpdate(fnamemodify(expand('<afile>'), ':p')) |
+            \ endif
+        autocmd BufEnter,CursorHold,FileType * call
+                    \ s:AutoUpdate(fnamemodify(expand('<afile>'), ':p'))
+        autocmd BufDelete * call
+                    \ s:CleanupFileinfo(fnamemodify(expand('<afile>'), ':p'))
+    augroup END
+
+    let s:autocommands_done = 1
+endfunction
+
+" s:CheckForExCtags() {{{2
+" Test whether the ctags binary is actually Exuberant Ctags and not GNU ctags
+" (or something else)
+function! s:CheckForExCtags()
+    call s:LogDebugMessage('Checking for Exuberant Ctags')
+
+    let ctags_cmd = s:EscapeCtagsCmd(g:tagbar_ctags_bin, '--version')
+    if ctags_cmd == ''
+        return
+    endif
+
+    let ctags_output = s:ExecuteCtags(ctags_cmd)
+
+    if v:shell_error || ctags_output !~# 'Exuberant Ctags'
+        echoerr 'Tagbar: Ctags doesn''t seem to be Exuberant Ctags!'
+        echomsg 'GNU ctags will NOT WORK.'
+              \ 'Please download Exuberant Ctags from ctags.sourceforge.net'
+              \ 'and install it in a directory in your $PATH'
+              \ 'or set g:tagbar_ctags_bin.'
+        echomsg 'Executed command: "' . ctags_cmd . '"'
+        if !empty(ctags_output)
+            echomsg 'Command output:'
+            for line in split(ctags_output, '\n')
+                echomsg line
+            endfor
+        endif
+        return 0
+    elseif !s:CheckExCtagsVersion(ctags_output)
+        echoerr 'Tagbar: Exuberant Ctags is too old!'
+        echomsg 'You need at least version 5.5 for Tagbar to work.'
+              \ 'Please download a newer version from ctags.sourceforge.net.'
+        echomsg 'Executed command: "' . ctags_cmd . '"'
+        if !empty(ctags_output)
+            echomsg 'Command output:'
+            for line in split(ctags_output, '\n')
+                echomsg line
+            endfor
+        endif
+        return 0
+    else
+        let s:checked_ctags = 1
+        return 1
+    endif
+endfunction
+
+" s:CheckExCtagsVersion() {{{2
+function! s:CheckExCtagsVersion(output)
+    call s:LogDebugMessage('Checking Exuberant Ctags version')
+
+    if a:output =~ 'Exuberant Ctags Development'
+        return 1
+    endif
+
+    let matchlist = matchlist(a:output, '\vExuberant Ctags (\d+)\.(\d+)')
+    let major     = matchlist[1]
+    let minor     = matchlist[2]
+
+    return major >= 6 || (major == 5 && minor >= 5)
+endfunction
+
+" s:CheckFTCtags() {{{2
+function! s:CheckFTCtags(bin, ftype)
+    if executable(a:bin)
+        return a:bin
+    endif
+
+    if exists('g:tagbar_type_' . a:ftype)
+        execute 'let userdef = ' . 'g:tagbar_type_' . a:ftype
+        if has_key(userdef, 'ctagsbin')
+            return userdef.ctagsbin
+        else
+            return ''
+        endif
+    endif
+
+    return ''
+endfunction
+
+" Prototypes {{{1
+" Base tag {{{2
+let s:BaseTag = {}
+
+" s:BaseTag._init() {{{3
+function! s:BaseTag._init(name) dict
+    let self.name        = a:name
+    let self.fields      = {}
+    let self.fields.line = 0
+    let self.path        = ''
+    let self.fullpath    = a:name
+    let self.depth       = 0
+    let self.parent      = {}
+    let self.tline       = -1
+    let self.fileinfo    = {}
+endfunction
+
+" s:BaseTag.isNormalTag() {{{3
+function! s:BaseTag.isNormalTag() dict
+    return 0
+endfunction
+
+" s:BaseTag.isPseudoTag() {{{3
+function! s:BaseTag.isPseudoTag() dict
+    return 0
+endfunction
+
+" s:BaseTag.isKindheader() {{{3
+function! s:BaseTag.isKindheader() dict
+    return 0
+endfunction
+
+" s:BaseTag.getPrototype() {{{3
+function! s:BaseTag.getPrototype() dict
+    return ''
+endfunction
+
+" s:BaseTag._getPrefix() {{{3
+function! s:BaseTag._getPrefix() dict
+    let fileinfo = self.fileinfo
+
+    if has_key(self, 'children') && !empty(self.children)
+        if fileinfo.tagfolds[self.fields.kind][self.fullpath]
+            let prefix = s:icon_closed
+        else
+            let prefix = s:icon_open
+        endif
+    else
+        let prefix = ' '
+    endif
+    if has_key(self.fields, 'access')
+        let prefix .= get(s:access_symbols, self.fields.access, ' ')
+    else
+        let prefix .= ' '
+    endif
+
+    return prefix
+endfunction
+
+" s:BaseTag.initFoldState() {{{3
+function! s:BaseTag.initFoldState() dict
+    let fileinfo = self.fileinfo
+
+    if s:known_files.has(fileinfo.fpath) &&
+     \ has_key(fileinfo._tagfolds_old[self.fields.kind], self.fullpath)
+        " The file has been updated and the tag was there before, so copy its
+        " old fold state
+        let fileinfo.tagfolds[self.fields.kind][self.fullpath] =
+                    \ fileinfo._tagfolds_old[self.fields.kind][self.fullpath]
+    elseif self.depth >= fileinfo.foldlevel
+        let fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1
+    else
+        let fileinfo.tagfolds[self.fields.kind][self.fullpath] =
+                    \ fileinfo.kindfolds[self.fields.kind]
+    endif
+endfunction
+
+" s:BaseTag.getClosedParentTline() {{{3
+function! s:BaseTag.getClosedParentTline() dict
+    let tagline = self.tline
+    let fileinfo = self.fileinfo
+
+    let parent = self.parent
+    while !empty(parent)
+        if parent.isFolded()
+            let tagline = parent.tline
+            break
+        endif
+        let parent = parent.parent
+    endwhile
+
+    return tagline
+endfunction
+
+" s:BaseTag.isFoldable() {{{3
+function! s:BaseTag.isFoldable() dict
+    return has_key(self, 'children') && !empty(self.children)
+endfunction
+
+" s:BaseTag.isFolded() {{{3
+function! s:BaseTag.isFolded() dict
+    return self.fileinfo.tagfolds[self.fields.kind][self.fullpath]
+endfunction
+
+" s:BaseTag.openFold() {{{3
+function! s:BaseTag.openFold() dict
+    if self.isFoldable()
+        let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 0
+    endif
+endfunction
+
+" s:BaseTag.closeFold() {{{3
+function! s:BaseTag.closeFold() dict
+    let newline = line('.')
+
+    if !empty(self.parent) && self.parent.isKindheader()
+        " Tag is child of generic 'kind'
+        call self.parent.closeFold()
+        let newline = self.parent.tline
+    elseif self.isFoldable() && !self.isFolded()
+        " Tag is parent of a scope and is not folded
+        let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1
+        let newline = self.tline
+    elseif !empty(self.parent)
+        " Tag is normal child, so close parent
+        let parent = self.parent
+        let self.fileinfo.tagfolds[parent.fields.kind][parent.fullpath] = 1
+        let newline = parent.tline
+    endif
+
+    return newline
+endfunction
+
+" s:BaseTag.setFolded() {{{3
+function! s:BaseTag.setFolded(folded) dict
+    let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = a:folded
+endfunction
+
+" s:BaseTag.openParents() {{{3
+function! s:BaseTag.openParents() dict
+    let parent = self.parent
+
+    while !empty(parent)
+        call parent.openFold()
+        let parent = parent.parent
+    endwhile
+endfunction
+
+" Normal tag {{{2
+let s:NormalTag = copy(s:BaseTag)
+
+" s:NormalTag.New() {{{3
+function! s:NormalTag.New(name) dict
+    let newobj = copy(self)
+
+    call newobj._init(a:name)
+
+    return newobj
+endfunction
+
+" s:NormalTag.isNormalTag() {{{3
+function! s:NormalTag.isNormalTag() dict
+    return 1
+endfunction
+
+" s:NormalTag.str() {{{3
+function! s:NormalTag.str() dict
+    let fileinfo = self.fileinfo
+    let typeinfo = s:known_types[fileinfo.ftype]
+
+    let suffix = get(self.fields, 'signature', '')
+    if has_key(self.fields, 'type')
+        let suffix .= ' : ' . self.fields.type
+    elseif has_key(typeinfo, 'kind2scope') &&
+         \ has_key(typeinfo.kind2scope, self.fields.kind)
+        let suffix .= ' : ' . typeinfo.kind2scope[self.fields.kind]
+    endif
+
+    return self._getPrefix() . self.name . suffix . "\n"
+endfunction
+
+" s:NormalTag.getPrototype() {{{3
+function! s:NormalTag.getPrototype() dict
+    return self.prototype
+endfunction
+
+" Pseudo tag {{{2
+let s:PseudoTag = copy(s:BaseTag)
+
+" s:PseudoTag.New() {{{3
+function! s:PseudoTag.New(name) dict
+    let newobj = copy(self)
+
+    call newobj._init(a:name)
+
+    return newobj
+endfunction
+
+" s:PseudoTag.isPseudoTag() {{{3
+function! s:PseudoTag.isPseudoTag() dict
+    return 1
+endfunction
+
+" s:PseudoTag.str() {{{3
+function! s:PseudoTag.str() dict
+    let fileinfo = self.fileinfo
+    let typeinfo = s:known_types[fileinfo.ftype]
+
+    let suffix = get(self.fields, 'signature', '')
+    if has_key(typeinfo.kind2scope, self.fields.kind)
+        let suffix .= ' : ' . typeinfo.kind2scope[self.fields.kind]
+    endif
+
+    return self._getPrefix() . self.name . '*' . suffix
+endfunction
+
+" Kind header {{{2
+let s:KindheaderTag = copy(s:BaseTag)
+
+" s:KindheaderTag.New() {{{3
+function! s:KindheaderTag.New(name) dict
+    let newobj = copy(self)
+
+    call newobj._init(a:name)
+
+    return newobj
+endfunction
+
+" s:KindheaderTag.isKindheader() {{{3
+function! s:KindheaderTag.isKindheader() dict
+    return 1
+endfunction
+
+" s:KindheaderTag.getPrototype() {{{3
+function! s:KindheaderTag.getPrototype() dict
+    return self.name . ': ' .
+         \ self.numtags . ' ' . (self.numtags > 1 ? 'tags' : 'tag')
+endfunction
+
+" s:KindheaderTag.isFoldable() {{{3
+function! s:KindheaderTag.isFoldable() dict
+    return 1
+endfunction
+
+" s:KindheaderTag.isFolded() {{{3
+function! s:KindheaderTag.isFolded() dict
+    return self.fileinfo.kindfolds[self.short]
+endfunction
+
+" s:KindheaderTag.openFold() {{{3
+function! s:KindheaderTag.openFold() dict
+    let self.fileinfo.kindfolds[self.short] = 0
+endfunction
+
+" s:KindheaderTag.closeFold() {{{3
+function! s:KindheaderTag.closeFold() dict
+    let self.fileinfo.kindfolds[self.short] = 1
+    return line('.')
+endfunction
+
+" s:KindheaderTag.toggleFold() {{{3
+function! s:KindheaderTag.toggleFold() dict
+    let fileinfo = s:known_files.getCurrent()
+
+    let fileinfo.kindfolds[self.short] = !fileinfo.kindfolds[self.short]
+endfunction
+
+" File info {{{2
+let s:FileInfo = {}
+
+" s:FileInfo.New() {{{3
+function! s:FileInfo.New(fname, ftype) dict
+    let newobj = copy(self)
+
+    " The complete file path
+    let newobj.fpath = a:fname
+
+    " File modification time
+    let newobj.mtime = getftime(a:fname)
+
+    " The vim file type
+    let newobj.ftype = a:ftype
+
+    " List of the tags that are present in the file, sorted according to the
+    " value of 'g:tagbar_sort'
+    let newobj.tags = []
+
+    " Dictionary of the tags, indexed by line number in the file
+    let newobj.fline = {}
+
+    " Dictionary of the tags, indexed by line number in the tagbar
+    let newobj.tline = {}
+
+    " Dictionary of the folding state of 'kind's, indexed by short name
+    let newobj.kindfolds = {}
+    let typeinfo = s:known_types[a:ftype]
+    " copy the default fold state from the type info
+    for kind in typeinfo.kinds
+        let newobj.kindfolds[kind.short] =
+                    \ g:tagbar_foldlevel == 0 ? 1 : kind.fold
+    endfor
+
+    " Dictionary of dictionaries of the folding state of individual tags,
+    " indexed by kind and full path
+    let newobj.tagfolds = {}
+    for kind in typeinfo.kinds
+        let newobj.tagfolds[kind.short] = {}
+    endfor
+
+    " The current foldlevel of the file
+    let newobj.foldlevel = g:tagbar_foldlevel
+
+    return newobj
+endfunction
+
+" s:FileInfo.reset() {{{3
+" Reset stuff that gets regenerated while processing a file and save the old
+" tag folds
+function! s:FileInfo.reset() dict
+    let self.mtime = getftime(self.fpath)
+    let self.tags  = []
+    let self.fline = {}
+    let self.tline = {}
+
+    let self._tagfolds_old = self.tagfolds
+    let self.tagfolds = {}
+
+    let typeinfo = s:known_types[self.ftype]
+    for kind in typeinfo.kinds
+        let self.tagfolds[kind.short] = {}
+    endfor
+endfunction
+
+" s:FileInfo.clearOldFolds() {{{3
+function! s:FileInfo.clearOldFolds() dict
+    if exists('self._tagfolds_old')
+        unlet self._tagfolds_old
+    endif
+endfunction
+
+" s:FileInfo.sortTags() {{{3
+function! s:FileInfo.sortTags() dict
+    if has_key(s:compare_typeinfo, 'sort')
+        if s:compare_typeinfo.sort
+            call s:SortTags(self.tags, 's:CompareByKind')
+        else
+            call s:SortTags(self.tags, 's:CompareByLine')
+        endif
+    elseif g:tagbar_sort
+        call s:SortTags(self.tags, 's:CompareByKind')
+    else
+        call s:SortTags(self.tags, 's:CompareByLine')
+    endif
+endfunction
+
+" s:FileInfo.openKindFold() {{{3
+function! s:FileInfo.openKindFold(kind) dict
+    let self.kindfolds[a:kind.short] = 0
+endfunction
+
+" s:FileInfo.closeKindFold() {{{3
+function! s:FileInfo.closeKindFold(kind) dict
+    let self.kindfolds[a:kind.short] = 1
+endfunction
+
+" Known files {{{2
+let s:known_files = {
+    \ '_current' : {},
+    \ '_files'   : {}
+\ }
+
+" s:known_files.getCurrent() {{{3
+function! s:known_files.getCurrent() dict
+    return self._current
+endfunction
+
+" s:known_files.setCurrent() {{{3
+function! s:known_files.setCurrent(fileinfo) dict
+    let self._current = a:fileinfo
+endfunction
+
+" s:known_files.get() {{{3
+function! s:known_files.get(fname) dict
+    return get(self._files, a:fname, {})
+endfunction
+
+" s:known_files.put() {{{3
+" Optional second argument is the filename
+function! s:known_files.put(fileinfo, ...) dict
+    if a:0 == 1
+        let self._files[a:1] = a:fileinfo
+    else
+        let fname = a:fileinfo.fpath
+        let self._files[fname] = a:fileinfo
+    endif
+endfunction
+
+" s:known_files.has() {{{3
+function! s:known_files.has(fname) dict
+    return has_key(self._files, a:fname)
+endfunction
+
+" s:known_files.rm() {{{3
+function! s:known_files.rm(fname) dict
+    if s:known_files.has(a:fname)
+        call remove(self._files, a:fname)
+    endif
+endfunction
+
+" Window management {{{1
+" s:ToggleWindow() {{{2
+function! s:ToggleWindow()
+    let tagbarwinnr = bufwinnr("__Tagbar__")
+    if tagbarwinnr != -1
+        call s:CloseWindow()
+        return
+    endif
+
+    call s:OpenWindow('')
+endfunction
+
+" s:OpenWindow() {{{2
+function! s:OpenWindow(flags)
+    let autofocus = a:flags =~# 'f'
+    let jump      = a:flags =~# 'j'
+    let autoclose = a:flags =~# 'c'
+
+    " If the tagbar window is already open check jump flag
+    " Also set the autoclose flag if requested
+    let tagbarwinnr = bufwinnr('__Tagbar__')
+    if tagbarwinnr != -1
+        if winnr() != tagbarwinnr && jump
+            execute tagbarwinnr . 'wincmd w'
+            if autoclose
+                let w:autoclose = autoclose
+            endif
+        endif
+        return
+    endif
+
+    call s:Init()
+
+    " Expand the Vim window to accomodate for the Tagbar window if requested
+    if g:tagbar_expand && !s:window_expanded && has('gui_running')
+        let &columns += g:tagbar_width + 1
+        let s:window_expanded = 1
+    endif
+
+    let eventignore_save = &eventignore
+    set eventignore=all
+
+    let openpos = g:tagbar_left ? 'topleft vertical ' : 'botright vertical '
+    exe 'silent keepalt ' . openpos . g:tagbar_width . 'split ' . '__Tagbar__'
+
+    let &eventignore = eventignore_save
+
+    call s:InitWindow(autoclose)
+
+    wincmd p
+
+    " Jump back to the tagbar window if autoclose or autofocus is set. Can't
+    " just stay in it since it wouldn't trigger the update event
+    if g:tagbar_autoclose || autofocus || g:tagbar_autofocus
+        let tagbarwinnr = bufwinnr('__Tagbar__')
+        execute tagbarwinnr . 'wincmd w'
+    endif
+endfunction
+
+" s:InitWindow() {{{2
+function! s:InitWindow(autoclose)
+    setlocal noreadonly " in case the "view" mode is used
+    setlocal buftype=nofile
+    setlocal bufhidden=hide
+    setlocal noswapfile
+    setlocal nobuflisted
+    setlocal nomodifiable
+    setlocal filetype=tagbar
+    setlocal nolist
+    setlocal nonumber
+    setlocal nowrap
+    setlocal winfixwidth
+    setlocal textwidth=0
+    setlocal nocursorline
+    setlocal nocursorcolumn
+
+    if exists('+relativenumber')
+        setlocal norelativenumber
+    endif
+
+    setlocal nofoldenable
+    setlocal foldcolumn=0
+    " Reset fold settings in case a plugin set them globally to something
+    " expensive. Apparently 'foldexpr' gets executed even if 'foldenable' is
+    " off, and then for every appended line (like with :put).
+    setlocal foldmethod&
+    setlocal foldexpr&
+
+    " Earlier versions have a bug in local, evaluated statuslines
+    if v:version > 701 || (v:version == 701 && has('patch097'))
+        setlocal statusline=%!TagbarGenerateStatusline()
+    else
+        setlocal statusline=Tagbar
+    endif
+
+    " Script-local variable needed since compare functions can't
+    " take extra arguments
+    let s:compare_typeinfo = {}
+
+    let s:is_maximized = 0
+    let s:short_help   = 1
+
+    let w:autoclose = a:autoclose
+
+    if has('balloon_eval')
+        setlocal balloonexpr=TagbarBalloonExpr()
+        set ballooneval
+    endif
+
+    let cpoptions_save = &cpoptions
+    set cpoptions&vim
+
+    if !hasmapto('JumpToTag', 'n')
+        call s:MapKeys()
+    endif
+
+    if !s:autocommands_done
+        call s:CreateAutocommands()
+    endif
+
+    let &cpoptions = cpoptions_save
+endfunction
+
+" s:CloseWindow() {{{2
+function! s:CloseWindow()
+    let tagbarwinnr = bufwinnr('__Tagbar__')
+    if tagbarwinnr == -1
+        return
+    endif
+
+    let tagbarbufnr = winbufnr(tagbarwinnr)
+
+    if winnr() == tagbarwinnr
+        if winbufnr(2) != -1
+            " Other windows are open, only close the tagbar one
+            close
+            wincmd p
+        endif
+    else
+        " Go to the tagbar window, close it and then come back to the
+        " original window
+        let curbufnr = bufnr('%')
+        execute tagbarwinnr . 'wincmd w'
+        close
+        " Need to jump back to the original window only if we are not
+        " already in that window
+        let winnum = bufwinnr(curbufnr)
+        if winnr() != winnum
+            exe winnum . 'wincmd w'
+        endif
+    endif
+
+    " If the Vim window has been expanded, and Tagbar is not open in any other
+    " tabpages, shrink the window again
+    if s:window_expanded
+        let tablist = []
+        for i in range(tabpagenr('$'))
+            call extend(tablist, tabpagebuflist(i + 1))
+        endfor
+
+        if index(tablist, tagbarbufnr) == -1
+            let &columns -= g:tagbar_width + 1
+            let s:window_expanded = 0
+        endif
+    endif
+endfunction
+
+" s:ZoomWindow() {{{2
+function! s:ZoomWindow()
+    if s:is_maximized
+        execute 'vert resize ' . g:tagbar_width
+        let s:is_maximized = 0
+    else
+        vert resize
+        let s:is_maximized = 1
+    endif
+endfunction
+
+" Tag processing {{{1
+" s:ProcessFile() {{{2
+" Execute ctags and put the information into a 'FileInfo' object
+function! s:ProcessFile(fname, ftype)
+    call s:LogDebugMessage('ProcessFile called on ' . a:fname)
+
+    if !s:IsValidFile(a:fname, a:ftype)
+        call s:LogDebugMessage('Not a valid file, returning')
+        return
+    endif
+
+    let ctags_output = s:ExecuteCtagsOnFile(a:fname, a:ftype)
+
+    if ctags_output == -1
+        call s:LogDebugMessage('Ctags error when processing file')
+        " put an empty entry into known_files so the error message is only
+        " shown once
+        call s:known_files.put({}, a:fname)
+        return
+    elseif ctags_output == ''
+        call s:LogDebugMessage('Ctags output empty')
+        return
+    endif
+
+    " If the file has only been updated preserve the fold states, otherwise
+    " create a new entry
+    if s:known_files.has(a:fname)
+        let fileinfo = s:known_files.get(a:fname)
+        call fileinfo.reset()
+    else
+        let fileinfo = s:FileInfo.New(a:fname, a:ftype)
+    endif
+
+    let typeinfo = s:known_types[a:ftype]
+
+    " Parse the ctags output lines
+    call s:LogDebugMessage('Parsing ctags output')
+    let rawtaglist = split(ctags_output, '\n\+')
+    for line in rawtaglist
+        " skip comments
+        if line =~# '^!_TAG_'
+            continue
+        endif
+
+        let parts = split(line, ';"')
+        if len(parts) == 2 " Is a valid tag line
+            let taginfo = s:ParseTagline(parts[0], parts[1], typeinfo, fileinfo)
+            let fileinfo.fline[taginfo.fields.line] = taginfo
+            call add(fileinfo.tags, taginfo)
+        endif
+    endfor
+
+    " Process scoped tags
+    let processedtags = []
+    if has_key(typeinfo, 'kind2scope')
+        call s:LogDebugMessage('Processing scoped tags')
+
+        let scopedtags = []
+        let is_scoped = 'has_key(typeinfo.kind2scope, v:val.fields.kind) ||
+                       \ has_key(v:val, "scope")'
+        let scopedtags += filter(copy(fileinfo.tags), is_scoped)
+        call filter(fileinfo.tags, '!(' . is_scoped . ')')
+
+        call s:AddScopedTags(scopedtags, processedtags, {}, 0,
+                           \ typeinfo, fileinfo)
+
+        if !empty(scopedtags)
+            echoerr 'Tagbar: ''scopedtags'' not empty after processing,'
+                  \ 'this should never happen!'
+                  \ 'Please contact the script maintainer with an example.'
+        endif
+    endif
+    call s:LogDebugMessage('Number of top-level tags: ' . len(processedtags))
+
+    " Create a placeholder tag for the 'kind' header for folding purposes
+    for kind in typeinfo.kinds
+
+        let curtags = filter(copy(fileinfo.tags),
+                           \ 'v:val.fields.kind ==# kind.short')
+        call s:LogDebugMessage('Processing kind: ' . kind.short .
+                             \ ', number of tags: ' . len(curtags))
+
+        if empty(curtags)
+            continue
+        endif
+
+        let kindtag          = s:KindheaderTag.New(kind.long)
+        let kindtag.short    = kind.short
+        let kindtag.numtags  = len(curtags)
+        let kindtag.fileinfo = fileinfo
+
+        for tag in curtags
+            let tag.parent = kindtag
+        endfor
+    endfor
+
+    if !empty(processedtags)
+        call extend(fileinfo.tags, processedtags)
+    endif
+
+    " Clear old folding information from previous file version to prevent leaks
+    call fileinfo.clearOldFolds()
+
+    " Sort the tags
+    let s:compare_typeinfo = typeinfo
+    call fileinfo.sortTags()
+
+    call s:known_files.put(fileinfo)
+endfunction
+
+" s:ExecuteCtagsOnFile() {{{2
+function! s:ExecuteCtagsOnFile(fname, ftype)
+    call s:LogDebugMessage('ExecuteCtagsOnFile called on ' . a:fname)
+
+    let typeinfo = s:known_types[a:ftype]
+
+    if has_key(typeinfo, 'ctagsargs')
+        let ctags_args = ' ' . typeinfo.ctagsargs . ' '
+    else
+        let ctags_args  = ' -f - '
+        let ctags_args .= ' --format=2 '
+        let ctags_args .= ' --excmd=pattern '
+        let ctags_args .= ' --fields=nksSa '
+        let ctags_args .= ' --extra= '
+        let ctags_args .= ' --sort=yes '
+
+        " Include extra type definitions
+        if has_key(typeinfo, 'deffile')
+            let ctags_args .= ' --options=' . typeinfo.deffile . ' '
+        endif
+
+        let ctags_type = typeinfo.ctagstype
+
+        let ctags_kinds = ''
+        for kind in typeinfo.kinds
+            let ctags_kinds .= kind.short
+        endfor
+
+        let ctags_args .= ' --language-force=' . ctags_type .
+                        \ ' --' . ctags_type . '-kinds=' . ctags_kinds . ' '
+    endif
+
+    if has_key(typeinfo, 'ctagsbin')
+        " reset 'wildignore' temporarily in case *.exe is included in it
+        let wildignore_save = &wildignore
+        set wildignore&
+        let ctags_bin = expand(typeinfo.ctagsbin)
+        let &wildignore = wildignore_save
+    else
+        let ctags_bin = g:tagbar_ctags_bin
+    endif
+
+    let ctags_cmd = s:EscapeCtagsCmd(ctags_bin, ctags_args, a:fname)
+    if ctags_cmd == ''
+        return ''
+    endif
+
+    let ctags_output = s:ExecuteCtags(ctags_cmd)
+
+    if v:shell_error || ctags_output =~ 'Warning: cannot open source file'
+        echoerr 'Tagbar: Could not execute ctags for ' . a:fname . '!'
+        echomsg 'Executed command: "' . ctags_cmd . '"'
+        if !empty(ctags_output)
+            call s:LogDebugMessage('Command output:')
+            call s:LogDebugMessage(ctags_output)
+            echomsg 'Command output:'
+            for line in split(ctags_output, '\n')
+                echomsg line
+            endfor
+        endif
+        return -1
+    endif
+
+    call s:LogDebugMessage('Ctags executed successfully')
+    return ctags_output
+endfunction
+
+" s:ParseTagline() {{{2
+" Structure of a tag line:
+" tagname<TAB>filename<TAB>expattern;"fields
+" fields: <TAB>name:value
+" fields that are always present: kind, line
+function! s:ParseTagline(part1, part2, typeinfo, fileinfo)
+    let basic_info  = split(a:part1, '\t')
+
+    let taginfo      = s:NormalTag.New(basic_info[0])
+    let taginfo.file = basic_info[1]
+
+    " the pattern can contain tabs and thus may have been split up, so join
+    " the rest of the items together again
+    let pattern = join(basic_info[2:], "\t")
+    let start   = 2 " skip the slash and the ^
+    let end     = strlen(pattern) - 1
+    if pattern[end - 1] ==# '$'
+        let end -= 1
+        let dollar = '\$'
+    else
+        let dollar = ''
+    endif
+    let pattern           = strpart(pattern, start, end - start)
+    let taginfo.pattern   = '\V\^\C' . pattern . dollar
+    let prototype         = substitute(pattern,   '^[[:space:]]\+', '', '')
+    let prototype         = substitute(prototype, '[[:space:]]\+$', '', '')
+    let taginfo.prototype = prototype
+
+    let fields = split(a:part2, '\t')
+    let taginfo.fields.kind = remove(fields, 0)
+    for field in fields
+        " can't use split() since the value can contain ':'
+        let delimit             = stridx(field, ':')
+        let key                 = strpart(field, 0, delimit)
+        let val                 = strpart(field, delimit + 1)
+        if len(val) > 0
+            let taginfo.fields[key] = val
+        endif
+    endfor
+    " Needed for jsctags
+    if has_key(taginfo.fields, 'lineno')
+        let taginfo.fields.line = taginfo.fields.lineno
+    endif
+
+    " Make some information easier accessible
+    if has_key(a:typeinfo, 'scope2kind')
+        for scope in keys(a:typeinfo.scope2kind)
+            if has_key(taginfo.fields, scope)
+                let taginfo.scope = scope
+                let taginfo.path  = taginfo.fields[scope]
+
+                let taginfo.fullpath = taginfo.path . a:typeinfo.sro .
+                                     \ taginfo.name
+                break
+            endif
+        endfor
+        let taginfo.depth = len(split(taginfo.path, '\V' . a:typeinfo.sro))
+    endif
+
+    let taginfo.fileinfo = a:fileinfo
+
+    " Needed for folding
+    try
+        call taginfo.initFoldState()
+    catch /^Vim(\a\+):E716:/ " 'Key not present in Dictionary'
+        " The tag has a 'kind' that doesn't exist in the type definition
+        echoerr 'Your ctags and Tagbar configurations are out of sync!'
+              \ 'Please read '':help tagbar-extend''.'
+    endtry
+
+    return taginfo
+endfunction
+
+" s:AddScopedTags() {{{2
+" Recursively process tags. Unfortunately there is a problem: not all tags in
+" a hierarchy are actually there. For example, in C++ a class can be defined
+" in a header file and implemented in a .cpp file (so the class itself doesn't
+" appear in the .cpp file and thus doesn't generate a tag). Another example
+" are anonymous structures like namespaces, structs, enums, and unions, that
+" also don't get a tag themselves. These tags are thus called 'pseudo-tags' in
+" Tagbar. Properly parsing them is quite tricky, so try not to think about it
+" too much.
+function! s:AddScopedTags(tags, processedtags, parent, depth,
+                        \ typeinfo, fileinfo)
+    if !empty(a:parent)
+        let curpath = a:parent.fullpath
+        let pscope  = a:typeinfo.kind2scope[a:parent.fields.kind]
+    else
+        let curpath = ''
+        let pscope  = ''
+    endif
+
+    let is_cur_tag = 'v:val.depth == a:depth'
+
+    if !empty(curpath)
+        " Check whether the tag is either a direct child at the current depth
+        " or at least a proper grandchild with pseudo-tags in between. If it
+        " is a direct child also check for matching scope.
+        let is_cur_tag .= ' &&
+        \ (v:val.path ==# curpath ||
+         \ match(v:val.path, ''\V\^\C'' . curpath . a:typeinfo.sro) == 0) &&
+        \ (v:val.path ==# curpath ? (v:val.scope ==# pscope) : 1)'
+    endif
+
+    let curtags = filter(copy(a:tags), is_cur_tag)
+
+    if !empty(curtags)
+        call filter(a:tags, '!(' . is_cur_tag . ')')
+
+        let realtags   = []
+        let pseudotags = []
+
+        while !empty(curtags)
+            let tag = remove(curtags, 0)
+
+            if tag.path != curpath
+                " tag is child of a pseudo-tag, so create a new pseudo-tag and
+                " add all its children to it
+                let pseudotag = s:ProcessPseudoTag(curtags, tag, a:parent,
+                                                 \ a:typeinfo, a:fileinfo)
+
+                call add(pseudotags, pseudotag)
+            else
+                call add(realtags, tag)
+            endif
+        endwhile
+
+        " Recursively add the children of the tags on the current level
+        for tag in realtags
+            let tag.parent = a:parent
+
+            if !has_key(a:typeinfo.kind2scope, tag.fields.kind)
+                continue
+            endif
+
+            if !has_key(tag, 'children')
+                let tag.children = []
+            endif
+
+            call s:AddScopedTags(a:tags, tag.children, tag, a:depth + 1,
+                               \ a:typeinfo, a:fileinfo)
+        endfor
+        call extend(a:processedtags, realtags)
+
+        " Recursively add the children of the tags that are children of the
+        " pseudo-tags on the current level
+        for tag in pseudotags
+            call s:ProcessPseudoChildren(a:tags, tag, a:depth, a:typeinfo,
+                                       \ a:fileinfo)
+        endfor
+        call extend(a:processedtags, pseudotags)
+    endif
+
+    " Now we have to check if there are any pseudo-tags at the current level
+    " so we have to check for real tags at a lower level, i.e. grandchildren
+    let is_grandchild = 'v:val.depth > a:depth'
+
+    if !empty(curpath)
+        let is_grandchild .=
+        \ ' && match(v:val.path, ''\V\^\C'' . curpath . a:typeinfo.sro) == 0'
+    endif
+
+    let grandchildren = filter(copy(a:tags), is_grandchild)
+
+    if !empty(grandchildren)
+        call s:AddScopedTags(a:tags, a:processedtags, a:parent, a:depth + 1,
+                           \ a:typeinfo, a:fileinfo)
+    endif
+endfunction
+
+" s:ProcessPseudoTag() {{{2
+function! s:ProcessPseudoTag(curtags, tag, parent, typeinfo, fileinfo)
+    let curpath = !empty(a:parent) ? a:parent.fullpath : ''
+
+    let pseudoname = substitute(a:tag.path, curpath, '', '')
+    let pseudoname = substitute(pseudoname, '\V\^' . a:typeinfo.sro, '', '')
+    let pseudotag  = s:CreatePseudoTag(pseudoname, a:parent, a:tag.scope,
+                                     \ a:typeinfo, a:fileinfo)
+    let pseudotag.children = [a:tag]
+
+    " get all the other (direct) children of the current pseudo-tag
+    let ispseudochild = 'v:val.path ==# a:tag.path && v:val.scope ==# a:tag.scope'
+    let pseudochildren = filter(copy(a:curtags), ispseudochild)
+    if !empty(pseudochildren)
+        call filter(a:curtags, '!(' . ispseudochild . ')')
+        call extend(pseudotag.children, pseudochildren)
+    endif
+
+    return pseudotag
+endfunction
+
+" s:ProcessPseudoChildren() {{{2
+function! s:ProcessPseudoChildren(tags, tag, depth, typeinfo, fileinfo)
+    for childtag in a:tag.children
+        let childtag.parent = a:tag
+
+        if !has_key(a:typeinfo.kind2scope, childtag.fields.kind)
+            continue
+        endif
+
+        if !has_key(childtag, 'children')
+            let childtag.children = []
+        endif
+
+        call s:AddScopedTags(a:tags, childtag.children, childtag, a:depth + 1,
+                           \ a:typeinfo, a:fileinfo)
+    endfor
+
+    let is_grandchild = 'v:val.depth > a:depth &&
+                       \ match(v:val.path, ''^\C'' . a:tag.fullpath) == 0'
+    let grandchildren = filter(copy(a:tags), is_grandchild)
+    if !empty(grandchildren)
+        call s:AddScopedTags(a:tags, a:tag.children, a:tag, a:depth + 1,
+                           \ a:typeinfo, a:fileinfo)
+    endif
+endfunction
+
+" s:CreatePseudoTag() {{{2
+function! s:CreatePseudoTag(name, parent, scope, typeinfo, fileinfo)
+    if !empty(a:parent)
+        let curpath = a:parent.fullpath
+        let pscope  = a:typeinfo.kind2scope[a:parent.fields.kind]
+    else
+        let curpath = ''
+        let pscope  = ''
+    endif
+
+    let pseudotag             = s:PseudoTag.New(a:name)
+    let pseudotag.fields.kind = a:typeinfo.scope2kind[a:scope]
+
+    let parentscope = substitute(curpath, a:name . '$', '', '')
+    let parentscope = substitute(parentscope,
+                               \ '\V\^' . a:typeinfo.sro . '\$', '', '')
+
+    if pscope != ''
+        let pseudotag.fields[pscope] = parentscope
+        let pseudotag.scope    = pscope
+        let pseudotag.path     = parentscope
+        let pseudotag.fullpath =
+                    \ pseudotag.path . a:typeinfo.sro . pseudotag.name
+    endif
+    let pseudotag.depth = len(split(pseudotag.path, '\V' . a:typeinfo.sro))
+
+    let pseudotag.parent = a:parent
+
+    let pseudotag.fileinfo = a:fileinfo
+
+    call pseudotag.initFoldState()
+
+    return pseudotag
+endfunction
+
+" Sorting {{{1
+" s:SortTags() {{{2
+function! s:SortTags(tags, comparemethod)
+    call sort(a:tags, a:comparemethod)
+
+    for tag in a:tags
+        if has_key(tag, 'children')
+            call s:SortTags(tag.children, a:comparemethod)
+        endif
+    endfor
+endfunction
+
+" s:CompareByKind() {{{2
+function! s:CompareByKind(tag1, tag2)
+    let typeinfo = s:compare_typeinfo
+
+    if typeinfo.kinddict[a:tag1.fields.kind] <#
+     \ typeinfo.kinddict[a:tag2.fields.kind]
+        return -1
+    elseif typeinfo.kinddict[a:tag1.fields.kind] >#
+         \ typeinfo.kinddict[a:tag2.fields.kind]
+        return 1
+    else
+        " Ignore '~' prefix for C++ destructors to sort them directly under
+        " the constructors
+        if a:tag1.name[0] ==# '~'
+            let name1 = a:tag1.name[1:]
+        else
+            let name1 = a:tag1.name
+        endif
+        if a:tag2.name[0] ==# '~'
+            let name2 = a:tag2.name[1:]
+        else
+            let name2 = a:tag2.name
+        endif
+
+        if name1 <=# name2
+            return -1
+        else
+            return 1
+        endif
+    endif
+endfunction
+
+" s:CompareByLine() {{{2
+function! s:CompareByLine(tag1, tag2)
+    return a:tag1.fields.line - a:tag2.fields.line
+endfunction
+
+" s:ToggleSort() {{{2
+function! s:ToggleSort()
+    let fileinfo = s:known_files.getCurrent()
+    if empty(fileinfo)
+        return
+    endif
+
+    let curline = line('.')
+
+    match none
+
+    let s:compare_typeinfo = s:known_types[fileinfo.ftype]
+
+    if has_key(s:compare_typeinfo, 'sort')
+        let s:compare_typeinfo.sort = !s:compare_typeinfo.sort
+    else
+        let g:tagbar_sort = !g:tagbar_sort
+    endif
+
+    call fileinfo.sortTags()
+
+    call s:RenderContent()
+
+    execute curline
+endfunction
+
+" Display {{{1
+" s:RenderContent() {{{2
+function! s:RenderContent(...)
+    call s:LogDebugMessage('RenderContent called')
+
+    if a:0 == 1
+        let fileinfo = a:1
+    else
+        let fileinfo = s:known_files.getCurrent()
+    endif
+
+    if empty(fileinfo)
+        call s:LogDebugMessage('Empty fileinfo, returning')
+        return
+    endif
+
+    let tagbarwinnr = bufwinnr('__Tagbar__')
+
+    if &filetype == 'tagbar'
+        let in_tagbar = 1
+    else
+        let in_tagbar = 0
+        let prevwinnr = winnr()
+        execute tagbarwinnr . 'wincmd w'
+    endif
+
+    if !empty(s:known_files.getCurrent()) &&
+     \ fileinfo.fpath ==# s:known_files.getCurrent().fpath
+        " We're redisplaying the same file, so save the view
+        call s:LogDebugMessage('Redisplaying file' . fileinfo.fpath)
+        let saveline = line('.')
+        let savecol  = col('.')
+        let topline  = line('w0')
+    endif
+
+    let lazyredraw_save = &lazyredraw
+    set lazyredraw
+    let eventignore_save = &eventignore
+    set eventignore=all
+
+    setlocal modifiable
+
+    silent %delete _
+
+    call s:PrintHelp()
+
+    let typeinfo = s:known_types[fileinfo.ftype]
+
+    " Print tags
+    call s:PrintKinds(typeinfo, fileinfo)
+
+    " Delete empty lines at the end of the buffer
+    for linenr in range(line('$'), 1, -1)
+        if getline(linenr) =~ '^$'
+            execute 'silent ' . linenr . 'delete _'
+        else
+            break
+        endif
+    endfor
+
+    setlocal nomodifiable
+
+    if !empty(s:known_files.getCurrent()) &&
+     \ fileinfo.fpath ==# s:known_files.getCurrent().fpath
+        let scrolloff_save = &scrolloff
+        set scrolloff=0
+
+        call cursor(topline, 1)
+        normal! zt
+        call cursor(saveline, savecol)
+
+        let &scrolloff = scrolloff_save
+    else
+        " Make sure as much of the Tagbar content as possible is shown in the
+        " window by jumping to the top after drawing
+        execute 1
+        call winline()
+
+        " Invalidate highlight cache from old file
+        let s:last_highlight_tline = 0
+    endif
+
+    let &lazyredraw  = lazyredraw_save
+    let &eventignore = eventignore_save
+
+    if !in_tagbar
+        execute prevwinnr . 'wincmd w'
+    endif
+endfunction
+
+" s:PrintKinds() {{{2
+function! s:PrintKinds(typeinfo, fileinfo)
+    call s:LogDebugMessage('PrintKinds called')
+
+    let first_tag = 1
+
+    for kind in a:typeinfo.kinds
+        let curtags = filter(copy(a:fileinfo.tags),
+                           \ 'v:val.fields.kind ==# kind.short')
+        call s:LogDebugMessage('Printing kind: ' . kind.short .
+                             \ ', number of (top-level) tags: ' . len(curtags))
+
+        if empty(curtags)
+            continue
+        endif
+
+        if has_key(a:typeinfo, 'kind2scope') &&
+         \ has_key(a:typeinfo.kind2scope, kind.short)
+            " Scoped tags
+            for tag in curtags
+                if g:tagbar_compact && first_tag && s:short_help
+                    silent 0put =tag.str()
+                else
+                    silent  put =tag.str()
+                endif
+
+                " Save the current tagbar line in the tag for easy
+                " highlighting access
+                let curline                   = line('.')
+                let tag.tline                 = curline
+                let a:fileinfo.tline[curline] = tag
+
+                " Print children
+                if tag.isFoldable() && !tag.isFolded()
+                    for ckind in a:typeinfo.kinds
+                        let childtags = filter(copy(tag.children),
+                                          \ 'v:val.fields.kind ==# ckind.short')
+                        if len(childtags) > 0
+                            " Print 'kind' header of following children
+                            if !has_key(a:typeinfo.kind2scope, ckind.short)
+                                silent put ='    [' . ckind.long . ']'
+                                let a:fileinfo.tline[line('.')] = tag
+                            endif
+                            for childtag in childtags
+                                call s:PrintTag(childtag, 1,
+                                              \ a:fileinfo, a:typeinfo)
+                            endfor
+                        endif
+                    endfor
+                endif
+
+                if !g:tagbar_compact
+                    silent put _
+                endif
+
+                let first_tag = 0
+            endfor
+        else
+            " Non-scoped tags
+            let kindtag = curtags[0].parent
+
+            if kindtag.isFolded()
+                let foldmarker = s:icon_closed
+            else
+                let foldmarker = s:icon_open
+            endif
+
+            if g:tagbar_compact && first_tag && s:short_help
+                silent 0put =foldmarker . ' ' . kind.long
+            else
+                silent  put =foldmarker . ' ' . kind.long
+            endif
+
+            let curline                   = line('.')
+            let kindtag.tline             = curline
+            let a:fileinfo.tline[curline] = kindtag
+
+            if !kindtag.isFolded()
+                for tag in curtags
+                    let str = tag.str()
+                    silent put ='  ' . str
+
+                    " Save the current tagbar line in the tag for easy
+                    " highlighting access
+                    let curline                   = line('.')
+                    let tag.tline                 = curline
+                    let a:fileinfo.tline[curline] = tag
+                    let tag.depth                 = 1
+                endfor
+            endif
+
+            if !g:tagbar_compact
+                silent put _
+            endif
+
+            let first_tag = 0
+        endif
+    endfor
+endfunction
+
+" s:PrintTag() {{{2
+function! s:PrintTag(tag, depth, fileinfo, typeinfo)
+    " Print tag indented according to depth
+    silent put =repeat(' ', a:depth * 2) . a:tag.str()
+
+    " Save the current tagbar line in the tag for easy
+    " highlighting access
+    let curline                   = line('.')
+    let a:tag.tline               = curline
+    let a:fileinfo.tline[curline] = a:tag
+
+    " Recursively print children
+    if a:tag.isFoldable() && !a:tag.isFolded()
+        for ckind in a:typeinfo.kinds
+            let childtags = filter(copy(a:tag.children),
+                                 \ 'v:val.fields.kind ==# ckind.short')
+            if len(childtags) > 0
+                " Print 'kind' header of following children
+                if !has_key(a:typeinfo.kind2scope, ckind.short)
+                    silent put ='    ' . repeat(' ', a:depth * 2) .
+                              \ '[' . ckind.long . ']'
+                    let a:fileinfo.tline[line('.')] = a:tag
+                endif
+                for childtag in childtags
+                    call s:PrintTag(childtag, a:depth + 1,
+                                  \ a:fileinfo, a:typeinfo)
+                endfor
+            endif
+        endfor
+    endif
+endfunction
+
+" s:PrintHelp() {{{2
+function! s:PrintHelp()
+    if !g:tagbar_compact && s:short_help
+        silent 0put ='\" Press <F1> for help'
+        silent  put _
+    elseif !s:short_help
+        silent 0put ='\" Tagbar keybindings'
+        silent  put ='\"'
+        silent  put ='\" --------- General ---------'
+        silent  put ='\" <Enter>   : Jump to tag definition'
+        silent  put ='\" <Space>   : Display tag prototype'
+        silent  put ='\"'
+        silent  put ='\" ---------- Folds ----------'
+        silent  put ='\" +, zo     : Open fold'
+        silent  put ='\" -, zc     : Close fold'
+        silent  put ='\" o, za     : Toggle fold'
+        silent  put ='\" *, zR     : Open all folds'
+        silent  put ='\" =, zM     : Close all folds'
+        silent  put ='\"'
+        silent  put ='\" ---------- Misc -----------'
+        silent  put ='\" s          : Toggle sort'
+        silent  put ='\" x          : Zoom window in/out'
+        silent  put ='\" q          : Close window'
+        silent  put ='\" <F1>       : Remove help'
+        silent  put _
+    endif
+endfunction
+
+" s:RenderKeepView() {{{2
+" The gist of this function was taken from NERDTree by Martin Grenfell.
+function! s:RenderKeepView(...)
+    if a:0 == 1
+        let line = a:1
+    else
+        let line = line('.')
+    endif
+
+    let curcol  = col('.')
+    let topline = line('w0')
+
+    call s:RenderContent()
+
+    let scrolloff_save = &scrolloff
+    set scrolloff=0
+
+    call cursor(topline, 1)
+    normal! zt
+    call cursor(line, curcol)
+
+    let &scrolloff = scrolloff_save
+
+    redraw
+endfunction
+
+" User actions {{{1
+" s:HighlightTag() {{{2
+function! s:HighlightTag()
+    let tagline = 0
+
+    let tag = s:GetNearbyTag()
+    if !empty(tag)
+        let tagline = tag.tline
+    endif
+
+    " Don't highlight the tag again if it's the same one as last time.
+    " This prevents the Tagbar window from jumping back after scrolling with
+    " the mouse.
+    if tagline == s:last_highlight_tline
+        return
+    else
+        let s:last_highlight_tline = tagline
+    endif
+
+    let eventignore_save = &eventignore
+    set eventignore=all
+
+    let tagbarwinnr = bufwinnr('__Tagbar__')
+    let prevwinnr   = winnr()
+    execute tagbarwinnr . 'wincmd w'
+
+    match none
+
+    " No tag above cursor position so don't do anything
+    if tagline == 0
+        execute prevwinnr . 'wincmd w'
+        let &eventignore = eventignore_save
+        redraw
+        return
+    endif
+
+    if g:tagbar_autoshowtag
+        call s:OpenParents(tag)
+    endif
+
+    " Check whether the tag is inside a closed fold and highlight the parent
+    " instead in that case
+    let tagline = tag.getClosedParentTline()
+
+    " Go to the line containing the tag
+    execute tagline
+
+    " Make sure the tag is visible in the window
+    call winline()
+
+    let foldpat = '[' . s:icon_open . s:icon_closed . ' ]'
+    let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\zs[^( ]\+\ze/'
+    execute 'match TagbarHighlight ' . pattern
+
+    execute prevwinnr . 'wincmd w'
+
+    let &eventignore = eventignore_save
+
+    redraw
+endfunction
+
+" s:JumpToTag() {{{2
+function! s:JumpToTag(stay_in_tagbar)
+    let taginfo = s:GetTagInfo(line('.'), 1)
+
+    let autoclose = w:autoclose
+
+    if empty(taginfo) || has_key(taginfo, 'numtags')
+        return
+    endif
+
+    let tagbarwinnr = winnr()
+
+    let eventignore_save = &eventignore
+    set eventignore=all
+
+    " This elaborate construct will try to switch to the correct
+    " buffer/window; if the buffer isn't currently shown in a window it will
+    " open it in the first window with a non-special buffer in it
+    wincmd p
+    let filebufnr = bufnr(taginfo.fileinfo.fpath)
+    if bufnr('%') != filebufnr
+        let filewinnr = bufwinnr(filebufnr)
+        if filewinnr != -1
+            execute filewinnr . 'wincmd w'
+        else
+            for i in range(1, winnr('$'))
+                execute i . 'wincmd w'
+                if &buftype == ''
+                    execute 'buffer ' . filebufnr
+                    break
+                endif
+            endfor
+        endif
+        " To make ctrl-w_p work we switch between the Tagbar window and the
+        " correct window once
+        execute tagbarwinnr . 'wincmd w'
+        wincmd p
+    endif
+
+    " Mark current position so it can be jumped back to
+    mark '
+
+    " Jump to the line where the tag is defined. Don't use the search pattern
+    " since it doesn't take the scope into account and thus can fail if tags
+    " with the same name are defined in different scopes (e.g. classes)
+    execute taginfo.fields.line
+
+    " If the file has been changed but not saved, the tag may not be on the
+    " saved line anymore, so search for it in the vicinity of the saved line
+    if match(getline('.'), taginfo.pattern) == -1
+        let interval = 1
+        let forward  = 1
+        while search(taginfo.pattern, 'W' . forward ? '' : 'b') == 0
+            if !forward
+                if interval > line('$')
+                    break
+                else
+                    let interval = interval * 2
+                endif
+            endif
+            let forward = !forward
+        endwhile
+    endif
+
+    " If the tag is on a different line after unsaved changes update the tag
+    " and file infos/objects
+    let curline = line('.')
+    if taginfo.fields.line != curline
+        let taginfo.fields.line = curline
+        let taginfo.fileinfo.fline[curline] = taginfo
+    endif
+
+    " Center the tag in the window
+    normal! z.
+
+    if foldclosed('.') != -1
+        .foldopen!
+    endif
+
+    redraw
+
+    let &eventignore = eventignore_save
+
+    if a:stay_in_tagbar
+        call s:HighlightTag()
+        execute tagbarwinnr . 'wincmd w'
+    elseif g:tagbar_autoclose || autoclose
+        call s:CloseWindow()
+    else
+        call s:HighlightTag()
+    endif
+endfunction
+
+" s:ShowPrototype() {{{2
+function! s:ShowPrototype()
+    let taginfo = s:GetTagInfo(line('.'), 1)
+
+    if empty(taginfo)
+        return
+    endif
+
+    echo taginfo.getPrototype()
+endfunction
+
+" s:ToggleHelp() {{{2
+function! s:ToggleHelp()
+    let s:short_help = !s:short_help
+
+    " Prevent highlighting from being off after adding/removing the help text
+    match none
+
+    call s:RenderContent()
+
+    execute 1
+    redraw
+endfunction
+
+" s:GotoNextToplevelTag() {{{2
+function! s:GotoNextToplevelTag(direction)
+    let curlinenr = line('.')
+    let newlinenr = line('.')
+
+    if a:direction == 1
+        let range = range(line('.') + 1, line('$'))
+    else
+        let range = range(line('.') - 1, 1, -1)
+    endif
+
+    for tmplinenr in range
+        let taginfo = s:GetTagInfo(tmplinenr, 0)
+
+        if empty(taginfo)
+            continue
+        elseif empty(taginfo.parent)
+            let newlinenr = tmplinenr
+            break
+        endif
+    endfor
+
+    if curlinenr != newlinenr
+        execute newlinenr
+        call winline()
+    endif
+
+    redraw
+endfunction
+
+" Folding {{{1
+" s:OpenFold() {{{2
+function! s:OpenFold()
+    let fileinfo = s:known_files.getCurrent()
+    if empty(fileinfo)
+        return
+    endif
+
+    let curline = line('.')
+
+    let tag = s:GetTagInfo(curline, 0)
+    if empty(tag)
+        return
+    endif
+
+    call tag.openFold()
+
+    call s:RenderKeepView()
+endfunction
+
+" s:CloseFold() {{{2
+function! s:CloseFold()
+    let fileinfo = s:known_files.getCurrent()
+    if empty(fileinfo)
+        return
+    endif
+
+    match none
+
+    let curline = line('.')
+
+    let curtag = s:GetTagInfo(curline, 0)
+    if empty(curtag)
+        return
+    endif
+
+    let newline = curtag.closeFold()
+
+    call s:RenderKeepView(newline)
+endfunction
+
+" s:ToggleFold() {{{2
+function! s:ToggleFold()
+    let fileinfo = s:known_files.getCurrent()
+    if empty(fileinfo)
+        return
+    endif
+
+    match none
+
+    let curtag = s:GetTagInfo(line('.'), 0)
+    if empty(curtag)
+        return
+    endif
+
+    let newline = line('.')
+
+    if curtag.isKindheader()
+        call curtag.toggleFold()
+    elseif curtag.isFoldable()
+        if curtag.isFolded()
+            call curtag.openFold()
+        else
+            let newline = curtag.closeFold()
+        endif
+    else
+        let newline = curtag.closeFold()
+    endif
+
+    call s:RenderKeepView(newline)
+endfunction
+
+" s:SetFoldLevel() {{{2
+function! s:SetFoldLevel(level)
+    if a:level < 0
+        echoerr 'Foldlevel can''t be negative'
+        return
+    endif
+
+    let fileinfo = s:known_files.getCurrent()
+    if empty(fileinfo)
+        return
+    endif
+
+    call s:SetFoldLevelRecursive(fileinfo, fileinfo.tags, a:level)
+
+    let typeinfo = s:known_types[fileinfo.ftype]
+
+    " Apply foldlevel to 'kind's
+    if a:level == 0
+        for kind in typeinfo.kinds
+            call fileinfo.closeKindFold(kind)
+        endfor
+    else
+        for kind in typeinfo.kinds
+            call fileinfo.openKindFold(kind)
+        endfor
+    endif
+
+    let fileinfo.foldlevel = a:level
+
+    call s:RenderContent()
+endfunction
+
+" s:SetFoldLevelRecursive() {{{2
+" Apply foldlevel to normal tags
+function! s:SetFoldLevelRecursive(fileinfo, tags, level)
+    for tag in a:tags
+        if tag.depth >= a:level
+            call tag.setFolded(1)
+        else
+            call tag.setFolded(0)
+        endif
+
+        if has_key(tag, 'children')
+            call s:SetFoldLevelRecursive(a:fileinfo, tag.children, a:level)
+        endif
+    endfor
+endfunction
+
+" s:OpenParents() {{{2
+function! s:OpenParents(...)
+    let tagline = 0
+
+    if a:0 == 1
+        let tag = a:1
+    else
+        let tag = s:GetNearbyTag()
+    endif
+
+    call tag.openParents()
+
+    call s:RenderKeepView()
+endfunction
+
+" Helper functions {{{1
+" s:CleanUp() {{{2
+function! s:CleanUp()
+    silent autocmd! TagbarAutoCmds
+
+    unlet s:is_maximized
+    unlet s:compare_typeinfo
+    unlet s:short_help
+endfunction
+
+" s:CleanupFileinfo() {{{2
+function! s:CleanupFileinfo(fname)
+    call s:known_files.rm(a:fname)
+endfunction
+
+" s:QuitIfOnlyWindow() {{{2
+function! s:QuitIfOnlyWindow()
+    " Before quitting Vim, delete the tagbar buffer so that
+    " the '0 mark is correctly set to the previous buffer.
+    if winbufnr(2) == -1
+        " Check if there is more than one tab page
+        if tabpagenr('$') == 1
+            bdelete
+            quit
+        else
+            close
+        endif
+    endif
+endfunction
+
+" s:AutoUpdate() {{{2
+function! s:AutoUpdate(fname)
+    call s:LogDebugMessage('AutoUpdate called on ' . a:fname)
+
+    " Don't do anything if tagbar is not open or if we're in the tagbar window
+    let tagbarwinnr = bufwinnr('__Tagbar__')
+    if tagbarwinnr == -1 || &filetype == 'tagbar'
+        call s:LogDebugMessage('Tagbar window not open or in Tagbar window')
+        return
+    endif
+
+    " Only consider the main filetype in cases like 'python.django'
+    let ftype = get(split(&filetype, '\.'), 0, '')
+    call s:LogDebugMessage('Vim filetype: ' . &filetype .
+                         \ ', sanitized filetype: ' . ftype)
+
+    " Don't do anything if the file isn't supported
+    if !s:IsValidFile(a:fname, ftype)
+        call s:LogDebugMessage('Not a valid file, stopping processing')
+        return
+    endif
+
+    " Process the file if it's unknown or the information is outdated
+    " Also test for entries that exist but are empty, which will be the case
+    " if there was an error during the ctags execution
+    if s:known_files.has(a:fname) && !empty(s:known_files.get(a:fname))
+        if s:known_files.get(a:fname).mtime != getftime(a:fname)
+            call s:LogDebugMessage('Filedata outdated, updating ' . a:fname)
+            call s:ProcessFile(a:fname, ftype)
+        endif
+    elseif !s:known_files.has(a:fname)
+        call s:LogDebugMessage('Unknown file, processing ' . a:fname)
+        call s:ProcessFile(a:fname, ftype)
+    endif
+
+    let fileinfo = s:known_files.get(a:fname)
+
+    " If we don't have an entry for the file by now something must have gone
+    " wrong, so don't change the tagbar content
+    if empty(fileinfo)
+        call s:LogDebugMessage('fileinfo empty after processing: ' . a:fname)
+        return
+    endif
+
+    " Display the tagbar content
+    call s:RenderContent(fileinfo)
+
+    " Call setCurrent after rendering so RenderContent can check whether the
+    " same file is redisplayed
+    if !empty(fileinfo)
+        call s:LogDebugMessage('Setting current file to ' . a:fname)
+        call s:known_files.setCurrent(fileinfo)
+    endif
+
+    call s:HighlightTag()
+    call s:LogDebugMessage('AutoUpdate finished successfully')
+endfunction
+
+" s:IsValidFile() {{{2
+function! s:IsValidFile(fname, ftype)
+    if a:fname == '' || a:ftype == ''
+        call s:LogDebugMessage('Empty filename or type')
+        return 0
+    endif
+
+    if !filereadable(a:fname)
+        call s:LogDebugMessage('File not readable')
+        return 0
+    endif
+
+    if !has_key(s:known_types, a:ftype)
+        call s:LogDebugMessage('Unsupported filetype: ' . a:ftype)
+        return 0
+    endif
+
+    return 1
+endfunction
+
+" s:EscapeCtagsCmd() {{{2
+" Assemble the ctags command line in a way that all problematic characters are
+" properly escaped and converted to the system's encoding
+" Optional third parameter is a file name to run ctags on
+function! s:EscapeCtagsCmd(ctags_bin, args, ...)
+    call s:LogDebugMessage('EscapeCtagsCmd called')
+    call s:LogDebugMessage('ctags_bin: ' . a:ctags_bin)
+    call s:LogDebugMessage('ctags_args: ' . a:args)
+
+    if exists('+shellslash')
+        let shellslash_save = &shellslash
+        set noshellslash
+    endif
+
+    if a:0 == 1
+        let fname = shellescape(a:1)
+    else
+        let fname = ''
+    endif
+
+    let ctags_cmd = shellescape(a:ctags_bin) . ' ' . a:args . ' ' . fname
+
+    if exists('+shellslash')
+        let &shellslash = shellslash_save
+    endif
+
+    " Needed for cases where 'encoding' is different from the system's
+    " encoding
+    if g:tagbar_systemenc != &encoding
+        let ctags_cmd = iconv(ctags_cmd, &encoding, g:tagbar_systemenc)
+    elseif $LANG != ''
+        let ctags_cmd = iconv(ctags_cmd, &encoding, $LANG)
+    endif
+
+    call s:LogDebugMessage('Escaped ctags command: ' . ctags_cmd)
+
+    if ctags_cmd == ''
+        echoerr 'Tagbar: Encoding conversion failed!'
+              \ 'Please make sure your system is set up correctly'
+              \ 'and that Vim is compiled with the "iconv" feature.'
+    endif
+
+    return ctags_cmd
+endfunction
+
+" s:ExecuteCtags() {{{2
+" Execute ctags with necessary shell settings
+" Partially based on the discussion at
+" http://vim.1045645.n5.nabble.com/bad-default-shellxquote-in-Widows-td1208284.html
+function! s:ExecuteCtags(ctags_cmd)
+    if exists('+shellslash')
+        let shellslash_save = &shellslash
+        set noshellslash
+    endif
+
+    if &shell =~ 'cmd\.exe'
+        let shellxquote_save = &shellxquote
+        set shellxquote=\"
+        let shellcmdflag_save = &shellcmdflag
+        set shellcmdflag=/s\ /c
+    endif
+
+    let ctags_output = system(a:ctags_cmd)
+
+    if &shell =~ 'cmd\.exe'
+        let &shellxquote  = shellxquote_save
+        let &shellcmdflag = shellcmdflag_save
+    endif
+
+    if exists('+shellslash')
+        let &shellslash = shellslash_save
+    endif
+
+    return ctags_output
+endfunction
+
+" s:GetTagInfo() {{{2
+" Return the info dictionary of the tag on the specified line. If the line
+" does not contain a valid tag (for example because it is empty or only
+" contains a pseudo-tag) return an empty dictionary.
+function! s:GetTagInfo(linenr, ignorepseudo)
+    let fileinfo = s:known_files.getCurrent()
+
+    if empty(fileinfo)
+        return {}
+    endif
+
+    " Don't do anything in empty and comment lines
+    let curline = getline(a:linenr)
+    if curline =~ '^\s*$' || curline[0] == '"'
+        return {}
+    endif
+
+    " Check if there is a tag on the current line
+    if !has_key(fileinfo.tline, a:linenr)
+        return {}
+    endif
+
+    let taginfo = fileinfo.tline[a:linenr]
+
+    " Check if the current tag is not a pseudo-tag
+    if a:ignorepseudo && taginfo.isPseudoTag()
+        return {}
+    endif
+
+    return taginfo
+endfunction
+
+" s:GetNearbyTag() {{{2
+" Get the tag info for a file near the cursor in the current file
+function! s:GetNearbyTag()
+    let fileinfo = s:known_files.getCurrent()
+
+    let curline = line('.')
+    let tag = {}
+
+    " If a tag appears in a file more than once (for example namespaces in
+    " C++) only one of them has a 'tline' entry and can thus be highlighted.
+    " The only way to solve this would be to go over the whole tag list again,
+    " making everything slower. Since this should be a rare occurence and
+    " highlighting isn't /that/ important ignore it for now.
+    for line in range(curline, 1, -1)
+        if has_key(fileinfo.fline, line)
+            let tag = fileinfo.fline[line]
+            break
+        endif
+    endfor
+
+    return tag
+endfunction
+
+" s:CheckMouseClick() {{{2
+function! s:CheckMouseClick()
+    let line   = getline('.')
+    let curcol = col('.')
+
+    if (match(line, s:icon_open . '[-+ ]') + 1) == curcol
+        call s:CloseFold()
+    elseif (match(line, s:icon_closed . '[-+ ]') + 1) == curcol
+        call s:OpenFold()
+    elseif g:tagbar_singleclick
+        call s:JumpToTag(0)
+    endif
+endfunction
+
+" s:DetermineFiletype() {{{2
+function! s:DetectFiletype(bufnr)
+    " Filetype has already been detected for loaded buffers, but not
+    " necessarily for unloaded ones
+    let ftype = getbufvar(a:bufnr, '&filetype')
+
+    if bufloaded(a:bufnr)
+        return ftype
+    endif
+
+    if ftype != ''
+        return ftype
+    endif
+
+    " Unloaded buffer with non-detected filetype, need to detect filetype
+    " manually
+    let bufname = bufname(a:bufnr)
+
+    let eventignore_save = &eventignore
+    set eventignore=FileType
+    let filetype_save = &filetype
+
+    exe 'doautocmd filetypedetect BufRead ' . bufname
+    let ftype = &filetype
+
+    let &filetype = filetype_save
+    let &eventignore = eventignore_save
+
+    return ftype
+endfunction
+
+
+" TagbarBalloonExpr() {{{2
+function! TagbarBalloonExpr()
+    let taginfo = s:GetTagInfo(v:beval_lnum, 1)
+
+    if empty(taginfo)
+        return
+    endif
+
+    return taginfo.getPrototype()
+endfunction
+
+" TagbarGenerateStatusline() {{{2
+function! TagbarGenerateStatusline()
+    if g:tagbar_sort
+        let text = '[Name]'
+    else
+        let text = '[Order]'
+    endif
+
+    if !empty(s:known_files.getCurrent())
+        let filename = fnamemodify(s:known_files.getCurrent().fpath, ':t')
+        let text .= ' ' . filename
+    endif
+
+    return text
+endfunction
+
+" Debugging {{{1
+" s:StartDebug() {{{2
+function! s:StartDebug(filename)
+    if empty(a:filename)
+        let s:debug_file = 'tagbardebug.log'
+    else
+        let s:debug_file = a:filename
+    endif
+
+    " Empty log file
+    exe 'redir! > ' . s:debug_file
+    redir END
+
+    " Check whether the log file could be created
+    if !filewritable(s:debug_file)
+        echomsg 'Tagbar: Unable to create log file ' . s:debug_file
+        let s:debug_file = ''
+        return
+    endif
+
+    let s:debug = 1
+endfunction
+
+" s:StopDebug() {{{2
+function! s:StopDebug()
+    let s:debug = 0
+    let s:debug_file = ''
+endfunction
+
+" s:LogDebugMessage() {{{2
+function! s:LogDebugMessage(msg)
+    if s:debug
+        exe 'redir >> ' . s:debug_file
+        silent echon strftime('%H:%M:%S') . ': ' . a:msg . "\n"
+        redir END
+    endif
+endfunction
+
+" Autoload functions {{{1
+function! tagbar#ToggleWindow()
+    call s:ToggleWindow()
+endfunction
+
+function! tagbar#OpenWindow(...)
+    let flags = a:0 > 0 ? a:1 : ''
+    call s:OpenWindow(flags)
+endfunction
+
+function! tagbar#CloseWindow()
+    call s:CloseWindow()
+endfunction
+
+function! tagbar#SetFoldLevel(...)
+    call s:SetFoldLevel(a:1)
+endfunction
+
+function! tagbar#OpenParents()
+    call s:OpenParents()
+endfunction
+
+function! tagbar#StartDebug(...)
+    let filename = a:0 > 0 ? a:1 : ''
+    call s:StartDebug(filename)
+endfunction
+
+function! tagbar#StopDebug()
+    call s:StopDebug()
+endfunction
+
+function! tagbar#RestoreSession()
+    call s:RestoreSession()
+endfunction
+
+" Automatically open Tagbar if one of the open buffers contains a supported
+" file
+function! tagbar#autoopen()
+    call s:Init()
+
+    for bufnr in range(1, bufnr('$'))
+        if buflisted(bufnr)
+            let ftype = s:DetectFiletype(bufnr)
+            if s:IsValidFile(bufname(bufnr), ftype)
+                call s:OpenWindow('')
+                return
+            endif
+        endif
+    endfor
+endfunction
+
+" Modeline {{{1
+" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
diff --git a/vim/autoload/togglebg.vim b/vim/autoload/togglebg.vim
new file mode 100644 (file)
index 0000000..108511f
--- /dev/null
@@ -0,0 +1,55 @@
+" Toggle Background
+" Modified:     2011 Apr 29
+" Maintainer:   Ethan Schoonover
+" License:      OSI approved MIT license
+
+if exists("g:loaded_togglebg")
+    finish
+endif
+let g:loaded_togglebg = 1
+
+" noremap is a bit misleading here if you are unused to vim mapping.
+" in fact, there is remapping, but only of script locally defined remaps, in 
+" this case <SID>TogBG. The <script> argument modifies the noremap scope in 
+" this regard (and the noremenu below).
+nnoremap <unique> <script> <Plug>ToggleBackground <SID>TogBG
+inoremap <unique> <script> <Plug>ToggleBackground <ESC><SID>TogBG<ESC>a
+vnoremap <unique> <script> <Plug>ToggleBackground <ESC><SID>TogBG<ESC>gv
+nnoremenu <script> Window.Toggle\ Background <SID>TogBG
+inoremenu <script> Window.Toggle\ Background <ESC><SID>TogBG<ESC>a
+vnoremenu <script> Window.Toggle\ Background <ESC><SID>TogBG<ESC>gv
+tmenu Window.Toggle\ Background Toggle light and dark background modes
+nnoremenu <script> ToolBar.togglebg <SID>TogBG
+inoremenu <script> ToolBar.togglebg <ESC><SID>TogBG<ESC>a
+vnoremenu <script> ToolBar.togglebg <ESC><SID>TogBG<ESC>gv
+tmenu ToolBar.togglebg Toggle light and dark background modes
+noremap <SID>TogBG  :call <SID>TogBG()<CR>
+
+function! s:TogBG()
+    let &background = ( &background == "dark"? "light" : "dark" )
+    if exists("g:colors_name")
+        exe "colorscheme " . g:colors_name
+    endif
+endfunction
+
+if !exists(":ToggleBG")
+    command ToggleBG :call s:TogBG()
+endif
+
+function! ToggleBackground()
+    echo "Please update your ToggleBackground mapping. ':help togglebg' for information."
+endfunction
+
+function! togglebg#map(mapActivation)
+    try
+        exe "silent! nmap <unique> ".a:mapActivation." <Plug>ToggleBackground"
+        exe "silent! imap <unique> ".a:mapActivation." <Plug>ToggleBackground"
+        exe "silent! vmap <unique> ".a:mapActivation." <Plug>ToggleBackground"
+    finally
+        return 0
+    endtry
+endfunction
+
+if !exists("no_plugin_maps") && !hasmapto('<Plug>ToggleBackground')
+    call togglebg#map("<F5>")
+endif
diff --git a/vim/bootstrap.sh b/vim/bootstrap.sh
new file mode 100755 (executable)
index 0000000..782fa52
--- /dev/null
@@ -0,0 +1,4 @@
+for i in ~/.vim ~/.vimrc ~/.gvimrc; do [ -e $i ] && mv $i $i.old; done
+git clone git://github.com/carlhuda/janus.git ~/.vim
+cd ~/.vim
+rake
diff --git a/vim/bundle/ctrlp.vim b/vim/bundle/ctrlp.vim
new file mode 160000 (submodule)
index 0000000..6ddbfe2
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 6ddbfe2cc00a7eeb2a4450552b78276488a2e2c9
diff --git a/vim/colors/adaryn.vim b/vim/colors/adaryn.vim
new file mode 100644 (file)
index 0000000..1b17f22
--- /dev/null
@@ -0,0 +1,72 @@
+" Vim color file
+" Maintainer:  Glenn T. Norton <gtnorton@adaryn.com>
+" Last Change: 2003-04-11
+
+" adaryn - A color scheme named after my daughter, Adaryn. (A-da-rin)
+" I like deep, sharp colors and this scheme is inspired by 
+" Bohdan Vlasyuk's darkblue.
+" The cterm background is black since the dark blue was just too light.
+" Also the cterm colors are very close to an old Borland C++ color setup.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+       syntax reset
+endif
+
+let colors_name = "adaryn"
+
+hi Normal   guifg=#fffff0 guibg=#00003F ctermfg=white ctermbg=Black
+hi ErrorMsg guifg=#ffffff guibg=#287eff        ctermfg=white ctermbg=red
+hi Visual   guifg=#8080ff guibg=fg gui=reverse ctermfg=blue ctermbg=fg cterm=reverse
+
+hi VisualNOS guifg=#8080ff guibg=fg gui=reverse,underline ctermfg=lightblue ctermbg=fg cterm=reverse,underline
+
+hi Todo guifg=#d14a14 guibg=#1248d1 ctermfg=red        ctermbg=darkblue
+
+hi Search guifg=#90fff0 guibg=#2050d0  ctermfg=white ctermbg=darkblue cterm=underline term=underline
+
+hi IncSearch    guifg=#b0ffff guibg=#2050d0 ctermfg=darkblue ctermbg=gray
+
+hi SpecialKey   guifg=cyan ctermfg=darkcyan
+hi Directory    guifg=cyan ctermfg=cyan
+hi Title       guifg=#BDD094 gui=none ctermfg=magenta cterm=bold
+hi WarningMsg  guifg=red ctermfg=red
+hi WildMenu    guifg=yellow guibg=black ctermfg=yellow ctermbg=black cterm=none term=none
+hi ModeMsg     guifg=#22cce2 ctermfg=lightblue
+hi MoreMsg     ctermfg=darkgreen ctermfg=darkgreen
+hi Question    guifg=green gui=none ctermfg=green cterm=none
+hi NonText     guifg=#0030ff ctermfg=darkblue
+
+hi StatusLine   guifg=blue guibg=darkgray gui=none ctermfg=blue ctermbg=gray term=none cterm=none
+
+hi StatusLineNC guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none
+
+hi VertSplit guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none
+
+hi Folded   guifg=#808080 guibg=#000040        ctermfg=darkgrey ctermbg=black cterm=bold term=bold
+
+hi FoldColumn   guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold
+
+hi LineNr   guifg=#90f020   ctermfg=green cterm=none
+
+hi DiffAdd  guibg=darkblue ctermbg=darkblue term=none cterm=none
+hi DiffChange   guibg=darkmagenta ctermbg=magenta cterm=none
+hi DiffDelete  ctermfg=blue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan
+hi DiffText    cterm=bold ctermbg=red gui=bold guibg=Red
+
+hi Cursor      guifg=#000020 guibg=#ffaf38 ctermfg=bg ctermbg=brown
+hi lCursor     guifg=#ffffff guibg=#000000 ctermfg=bg ctermbg=darkgreen
+
+
+hi Comment     guifg=yellow ctermfg=Yellow
+hi Constant    ctermfg=green guifg=green cterm=none
+hi Special     ctermfg=White guifg=#FFFFFF cterm=none gui=none
+hi Identifier  ctermfg=DarkRed guifg=#BDD094 cterm=none
+hi Statement   ctermfg=LightCyan cterm=none guifg=#A9A900 gui=none
+hi PreProc     ctermfg=DarkRed guifg=#ffffff gui=none cterm=none
+hi type                ctermfg=LightCyan guifg=LightBlue gui=none cterm=none
+hi Underlined  cterm=underline term=underline
+hi Ignore      guifg=bg ctermfg=bg
+
+
diff --git a/vim/colors/adrian.vim b/vim/colors/adrian.vim
new file mode 100644 (file)
index 0000000..ba830cd
--- /dev/null
@@ -0,0 +1,97 @@
+" Vim colorscheme file
+" Maintainer:   Adrian Nagle <vim@naglenet.org>
+" Last Change:  2001-09-25 07:48:15 Mountain Daylight Time
+" URL:          http://www.naglenet.org/vim/syntax/adrian.vim
+" MAIN URL:     http://www.naglenet.org/vim
+
+" This is my custom syntax file to override the defaults provided with Vim.
+" This file should be located in $HOME/vimfiles/colors.
+
+" This file should automatically be sourced by $RUNTIMEPATH.
+
+" NOTE(S):
+" *(1)
+" The color definitions assumes and is intended for a black or dark
+" background.
+
+" *(2)
+" This file is specifically in Unix style EOL format so that I can simply
+" copy this file between Windows and Unix systems.  VIM can source files in
+" with the UNIX EOL format (only <NL> instead of <CR><NR> for DOS) in any
+" operating system if the 'fileformats' is not empty and there is no <CR>
+" just before the <NL> on the first line.  See ':help :source_crnl' and
+" ':help fileformats'.
+"
+" *(3)
+" Move this file to adrian.vim for vim6.0aw.
+"
+
+
+
+hi clear
+set background=dark
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "adrian"
+
+" Normal is for the normal (unhighlighted) text and background.
+" NonText is below the last line (~ lines).
+highlight Normal                  guibg=Black      guifg=Green 
+highlight Cursor                  guibg=Grey70     guifg=White
+highlight NonText                 guibg=Grey80
+highlight StatusLine     gui=bold guibg=DarkGrey   guifg=Orange
+highlight StatusLineNC            guibg=DarkGrey   guifg=Orange
+
+highlight Comment    term=bold      ctermfg=LightGrey                  guifg=#d1ddff
+highlight Constant   term=underline ctermfg=White                      guifg=#ffa0a0
+"highlight Number   term=underline ctermfg=Yellow                     guifg=Yellow
+highlight Identifier term=underline ctermfg=Cyan                       guifg=#40ffff
+highlight Statement  term=bold      ctermfg=Yellow           gui=bold  guifg=#ffff60
+highlight PreProc    term=underline ctermfg=Blue                       guifg=#ff4500
+highlight Type       term=underline ctermfg=DarkGrey         gui=bold  guifg=#7d96ff
+highlight Special    term=bold      ctermfg=Magenta                    guifg=Orange
+highlight Ignore                    ctermfg=black                      guifg=bg
+highlight Error                     ctermfg=White      ctermbg=Red     guifg=White    guibg=Red
+highlight Todo                      ctermfg=Blue       ctermbg=Yellow  guifg=Blue     guibg=Yellow
+
+" Change the highlight of search matches (for use with :set hls).
+highlight Search                    ctermfg=Black      ctermbg=Yellow  guifg=Black    guibg=Yellow  
+
+" Change the highlight of visual highlight.
+highlight Visual      cterm=NONE    ctermfg=Black      ctermbg=LightGrey  gui=NONE    guifg=Black guibg=Grey70
+
+highlight Float                     ctermfg=Blue                       guifg=#88AAEE
+highlight Exception                 ctermfg=Red        ctermbg=White   guifg=Red      guibg=White
+highlight Typedef                   ctermfg=White      ctermbg=Blue    gui=bold       guifg=White guibg=Blue
+highlight SpecialChar               ctermfg=Black      ctermbg=White   guifg=Black    guibg=White
+highlight Delimiter                 ctermfg=White      ctermbg=Black   guifg=White    guibg=Black
+highlight SpecialComment            ctermfg=Black      ctermbg=Green   guifg=Black    guibg=Green
+
+" Common groups that link to default highlighting.
+" You can specify other highlighting easily.
+highlight link String          Constant
+highlight link Character       Constant
+highlight link Number          Constant
+highlight link Boolean         Statement
+"highlight link Float           Number
+highlight link Function        Identifier
+highlight link Conditional     Type
+highlight link Repeat          Type
+highlight link Label           Type
+highlight link Operator        Type
+highlight link Keyword         Type
+"highlight link Exception       Type
+highlight link Include         PreProc
+highlight link Define          PreProc
+highlight link Macro           PreProc
+highlight link PreCondit       PreProc
+highlight link StorageClass    Type
+highlight link Structure       Type
+"highlight link Typedef         Type
+"highlight link SpecialChar     Special
+highlight link Tag             Special
+"highlight link Delimiter       Special
+"highlight link SpecialComment  Special
+highlight link Debug           Special
+
diff --git a/vim/colors/aiseered.vim b/vim/colors/aiseered.vim
new file mode 100644 (file)
index 0000000..7e71108
--- /dev/null
@@ -0,0 +1,37 @@
+" gVim color file for working with files in GDL/VCG format.
+" Works nice in conjunction with gdl.vim
+" (see www.vim.org or www.aisee.com)
+" Works fine for C/C++, too.
+
+" Author : Alexander A. Evstyugov-Babaev <alex@absint.com>
+" Version: 0.2 for gVim/Linux,
+"          tested with gVim 6.3.25 under Ubuntu Linux (Warty)
+"          by Jo Vermeulen <jo@lumumba.luc.ac.be>
+" Date   : January 25th 2005
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let g:colors_name="aiseered"
+
+hi Normal guifg=lightred guibg=#600000
+hi Cursor guifg=bg guibg=fg
+hi ErrorMsg guibg=red ctermfg=1
+hi Search term=reverse ctermfg=darkred ctermbg=lightred guibg=lightred guifg=#060000
+
+hi Comment guifg=#ffffff
+hi Constant guifg=#88ddee
+hi String guifg=#ffcc88
+hi Character guifg=#ffaa00
+hi Number guifg=#88ddee
+hi Identifier guifg=#cfcfcf
+hi Statement guifg=#eeff99 gui=bold
+hi PreProc guifg=firebrick1 gui=italic
+hi Type guifg=#88ffaa gui=none
+hi Special guifg=#ffaa00
+hi SpecialChar guifg=#ffaa00
+hi StorageClass guifg=#ddaacc
+hi Error guifg=red guibg=white
diff --git a/vim/colors/anotherdark.vim b/vim/colors/anotherdark.vim
new file mode 100644 (file)
index 0000000..72a3341
--- /dev/null
@@ -0,0 +1,108 @@
+" Vim color file
+" Maintainer:  Hans Fugal <hans@fugal.net>
+" Last Change: $Date: 2003/05/06 16:37:49 $
+" Last Change: $Date: 2003/06/02 19:40:21 $
+" URL:         http://hans.fugal.net/vim/colors/desert.vim
+" Version:     $Id: desert.vim,v 1.6 2003/06/02 19:40:21 fugalh Exp $
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+       syntax reset
+    endif
+endif
+let g:colors_name="anotherdark"
+
+hi Normal      guifg=White guibg=grey20
+
+" highlight groups
+hi Cursor      guibg=khaki guifg=slategrey
+"hi CursorIM
+"hi Directory
+"hi DiffAdd
+"hi DiffChange
+"hi DiffDelete
+"hi DiffText
+"hi ErrorMsg
+hi VertSplit   guibg=#c2bfa5 guifg=grey50 gui=none
+hi Folded      guibg=grey30 guifg=gold
+hi FoldColumn  guibg=grey30 guifg=tan
+hi IncSearch   guifg=slategrey guibg=khaki
+"hi LineNr
+hi ModeMsg     guifg=goldenrod
+hi MoreMsg     guifg=SeaGreen
+hi NonText     guifg=LightBlue guibg=grey30
+hi Question    guifg=springgreen
+hi Search      guibg=peru guifg=wheat
+hi SpecialKey  guifg=yellowgreen
+hi StatusLine  guibg=#c2bfa5 guifg=black gui=none
+hi StatusLineNC        guibg=#c2bfa5 guifg=grey50 gui=none
+hi Title       guifg=indianred
+hi Visual      gui=none guifg=khaki guibg=olivedrab
+"hi VisualNOS
+hi WarningMsg  guifg=salmon
+"hi WildMenu
+"hi Menu
+"hi Scrollbar
+"hi Tooltip
+
+" syntax highlighting groups
+hi Comment     guifg=orange
+hi Constant    guifg=#ffa0a0
+hi Identifier  guifg=palegreen
+hi Statement   guifg=khaki
+hi PreProc     guifg=indianred
+hi Type                guifg=darkkhaki
+hi Special     guifg=navajowhite
+"hi Underlined
+hi Ignore      guifg=grey40
+"hi Error
+hi Todo                guifg=orangered guibg=yellow2
+
+" color terminal definitions
+hi SpecialKey  ctermfg=darkgreen
+hi NonText     cterm=bold ctermfg=darkblue
+hi Directory   ctermfg=darkcyan
+hi ErrorMsg    cterm=bold ctermfg=7 ctermbg=1
+hi IncSearch   cterm=NONE ctermfg=yellow ctermbg=green
+hi Search      cterm=NONE ctermfg=grey ctermbg=blue
+hi MoreMsg     ctermfg=darkgreen
+hi ModeMsg     cterm=NONE ctermfg=brown
+hi LineNr      ctermfg=3
+hi Question    ctermfg=green
+hi StatusLine  cterm=bold,reverse
+hi StatusLineNC cterm=reverse
+hi VertSplit   cterm=reverse
+hi Title       ctermfg=5
+hi Visual      cterm=reverse
+hi VisualNOS   cterm=bold,underline
+hi WarningMsg  ctermfg=1
+hi WildMenu    ctermfg=0 ctermbg=3
+hi Folded      ctermfg=darkgrey ctermbg=NONE
+hi FoldColumn  ctermfg=darkgrey ctermbg=NONE
+hi DiffAdd     ctermbg=4
+hi DiffChange  ctermbg=5
+hi DiffDelete  cterm=bold ctermfg=4 ctermbg=6
+hi DiffText    cterm=bold ctermbg=1
+hi Comment     ctermfg=lightblue
+hi Constant    ctermfg=darkred
+hi Special     ctermfg=red
+hi Identifier  ctermfg=6
+hi Statement   ctermfg=3
+hi PreProc     ctermfg=5
+hi Type                ctermfg=2
+hi Underlined  cterm=underline ctermfg=5
+hi Ignore      cterm=bold ctermfg=7
+hi Ignore      ctermfg=darkgrey
+hi Error       cterm=bold ctermfg=7 ctermbg=1
+
+
+"vim: sw=4
diff --git a/vim/colors/aqua.vim b/vim/colors/aqua.vim
new file mode 100644 (file)
index 0000000..483b6ac
--- /dev/null
@@ -0,0 +1,44 @@
+" Vim color file
+" Maintainer:   tranquility@portugalmail.pt
+" Last Change:  6 Apr 2002
+
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="aqua"
+
+hi Normal                              guibg=steelblue guifg=linen
+hi Cursor                              guibg=lightblue3 guifg=black gui=bold
+hi VertSplit           guifg=white guibg=navyblue gui=none
+hi Folded                              guibg=darkblue guifg=white
+hi FoldColumn          guibg=lightgray guifg=navyblue
+hi ModeMsg                     guifg=black guibg=steelblue1
+hi MoreMsg                     guifg=black guibg=steelblue1
+hi NonText                     guifg=white guibg=steelblue4 gui=none
+hi Question                    guifg=snow
+hi Search                              guibg=#FFFFFF guifg=midnightblue gui=bold
+hi SpecialKey          guifg=navyblue
+hi StatusLine          guibg=skyblue3 guifg=black gui=none
+hi StatusLineNC        guibg=skyblue1 guifg=black gui=none
+hi Title                               guifg=bisque3
+hi Subtitle                    guifg=black
+hi Visual                              guifg=white guibg=royalblue4 gui=none
+hi WarningMsg          guifg=salmon4 guibg=gray60 gui=bold
+hi Comment                     guifg=lightskyblue
+hi Constant                    guifg=turquoise gui=bold
+hi Identifier          guifg=lightcyan
+hi Statement           guifg=royalblue4
+hi PreProc                     guifg=black gui=bold
+hi Type                                        guifg=lightgreen
+hi Special                     guifg=navajowhite
+hi Ignore                              guifg=grey29
+hi Todo                                        guibg=black guifg=white
+hi WildMenu                    guibg=aquamarine
diff --git a/vim/colors/astronaut.vim b/vim/colors/astronaut.vim
new file mode 100644 (file)
index 0000000..8caec73
--- /dev/null
@@ -0,0 +1,164 @@
+" astronaut.vim: a colorscheme
+"    Maintainer: Charles E. Campbell, Jr. <charles.e.campbell.1@gsfc.nasa.gov>
+"          Date: Feb 21, 2006
+"       Version: 7
+"
+"  Usage:
+"  Put into your <.vimrc> file:
+"    color astronaut
+"
+"  Optional Modifiers:
+"  let g:astronaut_bold=1      : term, cterm, and gui receive bold modifier
+"  let g:astronaut_dark=1      : dark colors used (otherwise some terminals
+"                                make everything bold, which can be all one
+"                                color)
+"  let g:astronaut_underline=1 : assume that underlining works on your terminal
+"  let g:astronaut_italic=1    : allows italic to be used in gui
+"  Examples:
+"   iris       : let astronaut_dark=1
+"   Linux xterm: no modifiers needed
+"
+" GetLatestVimScripts: 122 1 :AutoInstall: astronaut.vim
+
+set background=dark
+hi clear
+if exists( "syntax_on" )
+    syntax reset
+endif
+let g:colors_name      = "astronaut"
+let g:loaded_astronaut = "v7"
+
+" ---------------------------------------------------------------------
+" Default option values
+if !exists("g:astronaut_bold")
+ " on some machines, notably SGIs, a bold qualifier means everything is
+ " one color (SGIs: yellow)
+ let g:astronaut_bold= 0
+endif
+if !exists("g:astronaut_dark")
+ " this option, if true, means darkcolor (ex. darkred, darkmagenta, etc)
+ " is understood and wanted
+ let g:astronaut_dark= 0
+endif
+if !exists("g:astronaut_underline")
+ let g:astronaut_underline= 1
+endif
+if !exists("g:astronaut_italic")
+ let g:astronaut_italic= 0
+endif
+
+" ---------------------------------------------------------------------
+"  Settings based on options
+if g:astronaut_bold != 0
+ let s:bold=",bold"
+else
+ let s:bold=""
+endif
+
+if g:astronaut_italic != 0
+ let s:italic= ",italic"
+else
+ let s:italic= ""
+endif
+
+if g:astronaut_dark != 0
+ let s:black   = "black"
+ let s:red     = "darkred"
+ let s:green   = "darkgreen"
+ let s:yellow  = "darkyellow"
+ let s:blue    = "darkblue"
+ let s:magenta = "darkmagenta"
+ let s:cyan    = "darkcyan"
+ let s:white   = "white"
+else
+ let s:black   = "black"
+ let s:red     = "red"
+ let s:green   = "green"
+ let s:yellow  = "yellow"
+ let s:blue    = "blue"
+ let s:magenta = "magenta"
+ let s:cyan    = "cyan"
+ let s:white   = "white"
+endif
+
+if g:astronaut_underline != 0
+ let s:underline= ",underline"
+ let s:ulbg     = ""
+else
+ let s:underline= "none"
+ if exists("g:astronaut_dark")
+  let s:ulbg     = "ctermbg=darkmagenta guibg=magenta4"
+ else
+  let s:ulbg     = "ctermbg=magenta guibg=magenta"
+ endif
+endif
+
+" ---------------------------------------------------------------------
+exe "hi Blue           start=\e[m\e[34m      stop=\e[m\e[32m   ctermfg=".s:blue."                              guifg=blue        guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Comment        start=\e[m\e[37m      stop=\e[m\e[32m   ctermfg=".s:white."                             guifg=white                           term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Conceal                                                ctermfg=".s:blue."      ctermbg=".s:black."     guifg=Blue        guibg=Black         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Constant       start=\e[m\e[33m      stop=\e[m\e[32m   ctermfg=".s:yellow."                            guifg=yellow      guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Cursor                                                                                                 guifg=blue        guibg=green         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Cyan           start=\e[m\e[36m      stop=\e[m\e[32m   ctermfg=".s:cyan."                              guifg=cyan        guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Debug          start=\e[m\e[31m      stop=\e[m\e[32m   ctermfg=".s:magenta."   ctermbg=".s:black."     guifg=magenta     guibg=black         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Delimiter      start=\e[m\e[37m      stop=\e[m\e[32m   ctermfg=".s:white."                             guifg=white       guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi DiffAdd                                                ctermfg=".s:white."     ctermbg=".s:magenta."   guifg=White       guibg=Magenta       term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi DiffChange                                             ctermfg=".s:yellow."    ctermbg=".s:blue."      guifg=Yellow      guibg=Blue          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi DiffDelete                                             ctermfg=".s:white."     ctermbg=".s:blue."      guifg=White       guibg=Blue          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi DiffText                                               ctermfg=".s:white."     ctermbg=".s:red."       guifg=White       guibg=Red           term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Directory      start=\e[m\e[37m      stop=\e[m\e[32m   ctermfg=".s:white."                             guifg=white                           term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Error          start=\e[m\e[37;41m   stop=\e[m\e[32m   ctermfg=".s:white."     ctermbg=".s:red."       guifg=white       guibg=red           term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi ErrorMsg                                               ctermfg=".s:white."     ctermbg=".s:red."       guifg=White       guibg=Red           term=standout".s:bold."         cterm=none".s:bold."              gui=none".s:bold
+exe "hi FoldColumn     start=\e[m\e[36;40m   stop=\e[m\e[32m   ctermfg=".s:cyan."      ctermbg=".s:black."     guifg=Cyan        guibg=Brown         term=standout".s:bold."         cterm=none".s:bold."              gui=none".s:bold
+exe "hi Folded         start=\e[m\e[35;40m   stop=\e[m\e[32m   ctermfg=".s:magenta."   ctermbg=".s:black."     guifg=magenta     guibg=black         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Function       start=\e[m\e[36m      stop=\e[m\e[32m   ctermfg=".s:cyan."                              guifg=cyan        guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Green          start=\e[m\e[32m      stop=\e[m\e[32m   ctermfg=".s:green."                             guifg=green       guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Identifier     start=\e[m\e[45m      stop=\e[m\e[32m   ctermfg=".s:magenta."                           guifg=magenta     guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Ignore                                                 ctermfg=".s:black  ."                           guifg=bg                              term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi IncSearch      start=\e[m\e[30;42m   stop=\e[m\e[32m   ctermfg=".s:black  ."   ctermbg=".s:green."     guifg=black       guibg=green         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi LineNr                                                 ctermfg=".s:yellow." ".s:ulbg."                 guifg=Yellow                          term=none".s:underline.s:bold." cterm=none".s:bold."              gui=none".s:bold
+exe "hi Magenta        start=\e[m\e[35m      stop=\e[m\e[32m   ctermfg=".s:magenta."                           guifg=magenta     guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Menu                                                                                                   guifg=black       guibg=gray75        term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi ModeMsg                                                ctermfg=".s:green."                             guifg=SeaGreen                        term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi MoreMsg                                                ctermfg=".s:green."                             guifg=SeaGreen                        term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi NonText                                                ctermfg=".s:blue."                              guifg=Blue                            term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Normal         start=\e[m\e[32m      stop=\e[m\e[32m   ctermfg=".s:green."                             guifg=green       guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi PreProc        start=\e[m\e[37;44m   stop=\e[m\e[32m   ctermfg=".s:white."     ctermbg=".s:blue."      guifg=white       guibg=blue3         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Question       start=\e[m\e[33m      stop=\e[m\e[32m   ctermfg=".s:yellow."                            guifg=yellow                          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Red            start=\e[m\e[31m      stop=\e[m\e[32m   ctermfg=".s:red."                               guifg=red         guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Scrollbar                                                                                              guifg=gray80      guibg=gray70        term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Search         start=\e[m\e[33;44m   stop=\e[m\e[32m   ctermfg=".s:yellow."    ctermbg=".s:blue."      guifg=yellow      guibg=blue          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Special        start=\e[m\e[32;44m   stop=\e[m\e[32m   ctermfg=".s:green."     ctermbg=".s:blue."      guifg=green       guibg=blue          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi SpecialKey     start=\e[m\e[30;45m   stop=\e[m\e[32m   ctermfg=".s:black."     ctermbg=".s:magenta."   guifg=black       guibg=magenta       term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Statement      start=\e[m\e[36m      stop=\e[m\e[32m   ctermfg=".s:cyan."                              guifg=cyan        guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi StatusLine     start=\e[m\e[30;46m   stop=\e[m\e[32m   ctermfg=".s:black."     ctermbg=".s:cyan."      guifg=black       guibg=cyan          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi StatusLineNC   start=\e[m\e[30;42m   stop=\e[m\e[32m   ctermfg=".s:black."     ctermbg=".s:green."     guifg=black       guibg=green         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi String         start=\e[m\e[33m      stop=\e[m\e[32m   ctermfg=".s:yellow."                            guifg=yellow      guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Subtitle       start=\e[m\e[35m      stop=\e[m\e[32m   ctermfg=".s:magenta."                           guifg=magenta     guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+if v:version >= 700
+ exe "hi TabLine        start=\e[m\e[30;44m   stop=\e[m\e[32m   ctermfg=".s:black."     ctermbg=".s:blue."      guifg=black       guibg=blue          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold.s:underline.s:italic
+ exe "hi TabLineSel     start=\e[m\e[37;44m   stop=\e[m\e[32m   ctermfg=".s:green."     ctermbg=".s:blue."      guifg=green       guibg=blue          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold.s:underline.s:italic
+ exe "hi TabLineFill    start=\e[m\e[34;44m   stop=\e[m\e[32m   ctermfg=".s:blue."      ctermbg=".s:blue."      guifg=blue        guibg=blue          term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+endif
+exe "hi Tags           start=\e[m\e[33;44m   stop=\e[m\e[32m   ctermfg=".s:yellow."    ctermbg=".s:blue."      guifg=yellow      guibg=blue3         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Title          start=\e[m\e[37m      stop=\e[m\e[32m   ctermfg=".s:white."                             guifg=white                           term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Todo           start=\e[m\e[37;45m   stop=\e[m\e[32m   ctermfg=".s:white."     ctermbg=".s:magenta."   guifg=white       guibg=magenta       term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Type           start=\e[m\e[4;32m    stop=\e[m\e[32m   ctermfg=".s:green."    ".s:ulbg."               guifg=seagreen1                       term=none".s:underline.s:bold." cterm=none".s:bold.s:underline."  gui=none".s:bold.s:underline
+exe "hi Underlined                                             ctermfg=".s:green."     ".s:ulbg."              guifg=green                           term=none".s:underline.s:bold." cterm=none".s:bold.s:underline."  gui=none".s:bold.s:underline
+exe "hi Unique         start=\e[m\e[34;47m   stop=\e[m\e[32m   ctermfg=".s:blue."      ctermbg=".s:white."     guifg=blue3       guibg=white         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi AltUnique      start=\e[m\e[35;47m   stop=\e[m\e[32m   ctermfg=".s:magenta."   ctermbg=".s:white."     guifg=magenta     guibg=white         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi AltAltUnique   start=\e[m\e[30;47m   stop=\e[m\e[32m   ctermfg=".s:black."     ctermbg=".s:white."     guifg=black       guibg=white         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi VertSplit      start=\e[m\e[30;42m   stop=\e[m\e[32m   ctermfg=".s:black."     ctermbg=".s:green."     guifg=black       guibg=green         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi Visual         start=\e[m\e[40;32m   stop=\e[m\e[32m   ctermfg=black           ctermbg=green           guifg=Grey        guibg=fg            term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi VisualNOS                                                                      ".s:ulbg."                                                    term=none".s:underline.s:bold." cterm=none".s:bold.s:underline."  gui=none".s:bold.s:underline
+exe "hi WarningMsg     start=\e[m\e[30;43m   stop=\e[m\e[32m   ctermfg=".s:black."     ctermbg=".s:yellow."    guifg=black       guibg=yellow        term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi White          start=\e[m\e[37m      stop=\e[m\e[32m   ctermfg=".s:white."                             guifg=white       guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi WildMenu                                               ctermfg=".s:black."     ctermbg=".s:yellow."    guifg=Black       guibg=Yellow        term=standout".s:bold."         cterm=none".s:bold."              gui=none".s:bold
+exe "hi Yellow         start=\e[m\e[33m      stop=\e[m\e[32m   ctermfg=".s:yellow."                            guifg=yellow      guibg=navyblue      term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi lCursor                                                                                                guifg=bg          guibg=fg            term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold
+exe "hi AltConstant    start=\e[m\e[33;40m   stop=\e[m\e[32m   ctermfg=".s:yellow."    ctermbg=".s:black."     guifg=yellow      guibg=black         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold.s:italic
+exe "hi AltFunction    start=\e[m\e[32;40m   stop=\e[m\e[32m   ctermfg=".s:green."     ctermbg=".s:black."     guifg=green       guibg=black         term=none".s:bold."             cterm=none".s:bold."              gui=none".s:bold.s:italic
+exe "hi AltType        start=\e[m\e[4;32;40m stop=\e[m\e[32m   ctermfg=".s:green."     ctermbg=".s:black."     guifg=seagreen1   guibg=black         term=none".s:underline.s:bold." cterm=none".s:bold.s:underline."  gui=none".s:bold.s:underline.s:italic
+exe "hi User1                                                  ctermfg=".s:white."     ctermbg=".s:blue."      guifg=white       guibg=blue"
+exe "hi User2                                                  ctermfg=".s:cyan."      ctermbg=".s:blue."      guifg=cyan        guibg=blue"
+" vim: nowrap
diff --git a/vim/colors/asu1dark.vim b/vim/colors/asu1dark.vim
new file mode 100644 (file)
index 0000000..ce5f90f
--- /dev/null
@@ -0,0 +1,59 @@
+" Vim color file
+" Maintainer:   A. Sinan Unur
+" Last Change:  2001/10/04
+
+" Dark color scheme
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="asu1dark"
+
+" Console Color Scheme
+hi Normal       term=NONE cterm=NONE ctermfg=LightGray   ctermbg=Black
+hi NonText      term=NONE cterm=NONE ctermfg=Brown       ctermbg=Black
+hi Function     term=NONE cterm=NONE ctermfg=DarkCyan    ctermbg=Black
+hi Statement    term=BOLD cterm=BOLD ctermfg=DarkBlue    ctermbg=Black
+hi Special      term=NONE cterm=NONE ctermfg=DarkGreen   ctermbg=Black
+hi SpecialChar  term=NONE cterm=NONE ctermfg=Cyan        ctermbg=Black
+hi Constant     term=NONE cterm=NONE ctermfg=Blue        ctermbg=Black
+hi Comment      term=NONE cterm=NONE ctermfg=DarkGray    ctermbg=Black
+hi Preproc      term=NONE cterm=NONE ctermfg=DarkGreen   ctermbg=Black
+hi Type         term=NONE cterm=NONE ctermfg=DarkMagenta ctermbg=Black
+hi Identifier   term=NONE cterm=NONE ctermfg=Cyan        ctermbg=Black
+hi StatusLine   term=BOLD cterm=NONE ctermfg=Yellow      ctermbg=DarkBlue
+hi StatusLineNC term=NONE cterm=NONE ctermfg=Black       ctermbg=Gray
+hi Visual       term=NONE cterm=NONE ctermfg=White       ctermbg=DarkCyan
+hi Search       term=NONE cterm=NONE ctermbg=Yellow      ctermfg=DarkBlue
+hi VertSplit    term=NONE cterm=NONE ctermfg=Black       ctermbg=Gray
+hi Directory    term=NONE cterm=NONE ctermfg=Green       ctermbg=Black
+hi WarningMsg   term=NONE cterm=NONE ctermfg=Blue        ctermbg=Yellow
+hi Error        term=NONE cterm=NONE ctermfg=DarkRed     ctermbg=Gray
+hi Cursor                            ctermfg=Black       ctermbg=Cyan
+hi LineNr       term=NONE cterm=NONE ctermfg=Red         ctermbg=Black
+
+" GUI Color Scheme
+hi Normal       gui=NONE     guifg=White   guibg=#110022
+hi NonText      gui=NONE     guifg=#ff9999 guibg=#444444
+hi Function     gui=NONE     guifg=#7788ff guibg=#110022
+hi Statement    gui=BOLD     guifg=Yellow  guibg=#110022
+hi Special      gui=NONE     guifg=Cyan    guibg=#110022
+hi Constant     gui=NONE     guifg=#ff9900 guibg=#110022
+hi Comment      gui=NONE     guifg=#99cc99 guibg=#110022
+hi Preproc      gui=NONE     guifg=#33ff66 guibg=#110022
+hi Type         gui=NONE     guifg=#ff5577 guibg=#110022
+hi Identifier   gui=NONE     guifg=Cyan    guibg=#110022
+hi StatusLine   gui=BOLD     guifg=White   guibg=#336600
+hi StatusLineNC gui=NONE     guifg=Black   guibg=#cccccc
+hi Visual       gui=NONE     guifg=White   guibg=#00aa33
+hi Search       gui=BOLD     guibg=Yellow  guifg=DarkBlue
+hi VertSplit    gui=NONE     guifg=White   guibg=#666666
+hi Directory    gui=NONE     guifg=Green   guibg=#110022
+hi WarningMsg   gui=STANDOUT guifg=#0000cc guibg=Yellow
+hi Error        gui=NONE     guifg=White   guibg=Red
+hi Cursor                    guifg=White   guibg=#00ff33
+hi LineNr       gui=NONE     guifg=#cccccc guibg=#334444
+hi ModeMsg      gui=NONE     guifg=Blue    guibg=White
+hi Question     gui=NONE     guifg=#66ff99 guibg=#110022
diff --git a/vim/colors/autumn.vim b/vim/colors/autumn.vim
new file mode 100644 (file)
index 0000000..f269b35
--- /dev/null
@@ -0,0 +1,69 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/10/14 Mon 16:41.
+"     version: 1.0
+" This color scheme uses a light background.
+
+set background=light
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "autumn"
+
+hi Normal       guifg=#404040 guibg=#fff4e8
+
+" Search
+hi IncSearch    gui=UNDERLINE guifg=#404040 guibg=#e0e040
+hi Search       gui=NONE guifg=#544060 guibg=#f0c0ff
+
+" Messages
+hi ErrorMsg     gui=BOLD guifg=#f8f8f8 guibg=#4040ff
+hi WarningMsg   gui=BOLD guifg=#f8f8f8 guibg=#4040ff
+hi ModeMsg      gui=NONE guifg=#d06000 guibg=NONE
+hi MoreMsg      gui=NONE guifg=#0090a0 guibg=NONE
+hi Question     gui=NONE guifg=#8000ff guibg=NONE
+
+" Split area
+hi StatusLine   gui=BOLD guifg=#f8f8f8 guibg=#904838
+hi StatusLineNC gui=BOLD guifg=#c0b0a0 guibg=#904838
+hi VertSplit    gui=NONE guifg=#f8f8f8 guibg=#904838
+hi WildMenu     gui=BOLD guifg=#f8f8f8 guibg=#ff3030
+
+" Diff
+hi DiffText     gui=NONE guifg=#2850a0 guibg=#c0d0f0
+hi DiffChange   gui=NONE guifg=#208040 guibg=#c0f0d0
+hi DiffDelete   gui=NONE guifg=#ff2020 guibg=#eaf2b0
+hi DiffAdd      gui=NONE guifg=#ff2020 guibg=#eaf2b0
+
+" Cursor
+hi Cursor       gui=NONE guifg=#ffffff guibg=#0080f0
+hi lCursor      gui=NONE guifg=#ffffff guibg=#8040ff
+hi CursorIM     gui=NONE guifg=#ffffff guibg=#8040ff
+
+" Fold
+hi Folded       gui=NONE guifg=#804030 guibg=#ffc0a0
+hi FoldColumn   gui=NONE guifg=#a05040 guibg=#f8d8c4
+
+" Other
+hi Directory    gui=NONE guifg=#7050ff guibg=NONE
+hi LineNr       gui=NONE guifg=#e0b090 guibg=NONE
+hi NonText      gui=BOLD guifg=#a05040 guibg=#ffe4d4
+hi SpecialKey   gui=NONE guifg=#0080ff guibg=NONE
+hi Title        gui=BOLD guifg=fg      guibg=NONE
+hi Visual       gui=NONE guifg=#804020 guibg=#ffc0a0
+" hi VisualNOS  gui=NONE guifg=#604040 guibg=#e8dddd
+
+" Syntax group
+hi Comment      gui=NONE guifg=#ff5050 guibg=NONE
+hi Constant     gui=NONE guifg=#00884c guibg=NONE
+hi Error        gui=BOLD guifg=#f8f8f8 guibg=#4040ff
+hi Identifier   gui=NONE guifg=#b07800 guibg=NONE
+hi Ignore       gui=NONE guifg=bg guibg=NONE
+hi PreProc      gui=NONE guifg=#0090a0 guibg=NONE
+hi Special      gui=NONE guifg=#8040f0 guibg=NONE
+hi Statement    gui=BOLD guifg=#80a030 guibg=NONE
+hi Todo         gui=BOLD,UNDERLINE guifg=#0080f0 guibg=NONE
+hi Type         gui=BOLD guifg=#b06c58 guibg=NONE
+hi Underlined   gui=UNDERLINE guifg=blue guibg=NONE
diff --git a/vim/colors/autumn2.vim b/vim/colors/autumn2.vim
new file mode 100644 (file)
index 0000000..22a5ef0
--- /dev/null
@@ -0,0 +1,88 @@
+" Vim colour file
+" Maintainer:   Antony Scriven <ad_scriven@postmaster.co.uk>
+" Last Change:  2003-06-12
+"
+set background=light
+hi clear
+if exists("syntax_on")
+        syntax reset
+endif
+
+let colors_name = "autumn"
+
+hi Normal       term=none      cterm=none ctermfg=black         ctermbg=White           gui=none guifg=Black            guibg=#f0f2f0
+hi Cursor       term=none      cterm=none ctermfg=white         ctermbg=darkgrey        gui=none guifg=black            guibg=red
+hi DiffAdd      term=bold       cterm=none      ctermfg=white   ctermbg=DarkBlue        gui=none guifg=#aaeeaa          guibg=#447744
+hi DiffChange   term=bold       cterm=none      ctermfg=white   ctermbg=DarkMagenta     gui=none guifg=lightyellow      guibg=#ddbb55
+hi DiffDelete   term=bold       cterm=none      ctermfg=blue    ctermbg=darkcyan        gui=none guifg=#336633          guibg=#aaccaa
+hi difftext     term=reverse    cterm=bold      ctermfg=white   ctermbg=red             gui=none guifg=lightyellow      guibg=#cc7733
+hi Directory    term=none      cterm=none ctermfg=Red           ctermbg=white           gui=none guifg=Red              guibg=bg
+hi ErrorMsg     term=standout  cterm=none ctermfg=white         ctermbg=DarkRed         gui=none guifg=white            guibg=DarkRed
+hi Folded       term=reverse   cterm=none ctermfg=darkblue      ctermbg=lightgrey       gui=none guifg=darkblue         guibg=lightgrey
+"8 col term
+hi FoldColumn   term=reverse   cterm=none ctermfg=darkblue      ctermbg=grey            gui=none guifg=darkblue         guibg=grey
+hi IncSearch    term=reverse   cterm=none ctermfg=yellow        ctermbg=darkgreen       gui=none guifg=yellow           guibg=#449944 
+hi lCursor      term=reverse   cterm=none ctermfg=black         ctermbg=cyan            gui=none guifg=black            guibg=Cyan
+hi LineNr       term=reverse   cterm=none ctermfg=darkred       ctermbg=grey            gui=none guifg=brown            guibg=lightgrey 
+hi ModeMsg      term=bold      cterm=none ctermfg=green         ctermbg=darkgreen       gui=none guifg=#007700          guibg=#aaccaa
+hi MoreMsg      term=bold      cterm=none ctermfg=darkGreen     ctermbg=white           gui=none guifg=darkgreen        guibg=bg
+hi Question     term=bold      cterm=none ctermfg=darkGreen     ctermbg=white           gui=none guifg=darkgreen        guibg=bg
+hi Search       term=reverse   cterm=none ctermfg=black         ctermbg=yellow          gui=none guifg=black            guibg=yellow
+hi SpecialKey   term=italic    cterm=none ctermfg=lightgrey     ctermbg=white           gui=none guifg=lightblue        guibg=bg
+hi NonText      term=bold      cterm=none ctermfg=lightgrey     ctermbg=white           gui=none guifg=#c6c6c6          guibg=bg
+hi StatusLine   term=reverse   cterm=none ctermfg=white         ctermbg=black           gui=none guifg=#80624d          guibg=#ddd9b8
+hi Title        term=bold      cterm=none ctermfg=DarkMagenta   ctermbg=white           gui=none guifg=DarkMagenta      guibg=bg
+if has("gui_running") || &t_Co > 8
+        hi Visual       term=reverse   cterm=none ctermfg=black         ctermbg=lightgrey       gui=none guifg=black       guibg=lightgreen
+        hi VertSplit    term=reverse   cterm=none ctermfg=darkgrey      ctermbg=darkgrey        gui=none guifg=#c7c7c2     guibg=#d7d7d2 
+        hi StatusLineNC term=reverse   cterm=none ctermfg=white         ctermbg=darkgrey        gui=none guifg=darkgrey    guibg=#d7d7d2
+        hi Comment      term=italic    cterm=none ctermfg=grey          ctermbg=white           gui=none guifg=#ccaaaa     guibg=bg
+else
+        hi Visual       term=reverse   cterm=none ctermfg=green         ctermbg=darkgreen       gui=none guifg=black    guibg=lightgreen
+        hi VertSplit    term=reverse   cterm=none ctermfg=darkcyan      ctermbg=darkblue        gui=none guifg=darkgrey guibg=darkgrey 
+        hi StatusLineNC term=reverse   cterm=none ctermfg=white         ctermbg=darkblue        gui=none guifg=white    guibg=darkgrey
+        hi Comment      term=italic    cterm=none ctermfg=darkcyan      ctermbg=white           gui=none guifg=#ccaaaa  guibg=bg
+endif
+hi VisualNOS    term=bold      cterm=none ctermfg=grey         ctermbg=black        gui=none guifg=grey         guibg=black
+hi WarningMsg   term=standout  cterm=none ctermfg=Red          ctermbg=white        gui=none guifg=Red          guibg=bg
+hi WildMenu     term=bold      cterm=none ctermfg=darkblue     ctermbg=yellow       gui=none guifg=black        guibg=lightyellow
+
+hi Constant     term=underline  cterm=none      ctermfg=darkred         ctermbg=bg      gui=none guifg=#bb6666  guibg=bg
+hi Special      term=bold       cterm=none      ctermfg=darkcyan        ctermbg=white   gui=none guifg=darkcyan guibg=bg
+hi identifier   term=underline  cterm=none      ctermfg=darkmagenta     ctermbg=white   gui=none guifg=darkcyan guibg=bg
+hi statement    term=bold       cterm=none      ctermfg=darkgreen       ctermbg=white   gui=none guifg=#44aa44  guibg=bg
+hi preproc      term=underline  cterm=none      ctermfg=darkgrey        ctermbg=white   gui=none guifg=darkgrey guibg=bg
+hi type         term=none       cterm=none      ctermfg=brown           ctermbg=white   gui=none guifg=#bb9900  guibg=bg
+hi underlined   term=underline  cterm=underline ctermfg=darkmagenta     ctermbg=white   gui=underline guifg=darkmagenta guibg=bg
+hi Ignore       term=italic     cterm=none      ctermfg=lightgrey       ctermbg=white   gui=none guifg=grey     guibg=bg
+"hi todo         term=underline  cterm=bold      ctermfg=yellow          ctermbg=brown   gui=none guifg=#333333     guibg=#ddee33
+hi todo   term=bold       cterm=none      ctermfg=yellow   ctermbg=brown     gui=bold guifg=#229900      guibg=#ddd9b8
+hi function     term=bold       cterm=none      ctermfg=blue            ctermbg=white   gui=none guifg=#0055cc  guibg=bg
+
+hi link String          Constant
+hi link Character       Constant
+hi link Number          Constant
+hi link Boolean         Constant
+hi link Float           Number
+hi link Conditional     Statement
+hi link Repeat          Statement
+hi link Label           Statement
+hi link Operator        Statement
+hi link Keyword         Statement
+hi link Exception       Statement
+hi link Include         PreProc
+hi link Define          PreProc
+hi link Macro           PreProc
+hi link PreCondit       PreProc
+hi link StorageClass    Type
+hi link Structure       Type
+hi link Typedef         Type
+hi link Tag             Special
+hi link SpecialChar     Special
+hi link Delimiter       Special
+hi link SpecialComment  Special
+hi link Debug           Special
+hi link vimfunction     function
+
+
+" vim: set ts=8 sw=8 et sts=8 tw=72 fo-=t ff=unix :
diff --git a/vim/colors/autumnleaf.vim b/vim/colors/autumnleaf.vim
new file mode 100644 (file)
index 0000000..f7af59f
--- /dev/null
@@ -0,0 +1,154 @@
+" Vim color file
+" Maintainer: Anders Korte
+" Last Change: 17 Oct 2004
+
+" AutumnLeaf color scheme 1.0
+
+set background=light
+
+hi clear
+
+if exists("syntax_on")
+    syntax reset
+endif
+
+let colors_name="AutumnLeaf"
+
+
+" Colors for the User Interface.
+
+hi Cursor      guibg=#aa7733   guifg=#ffeebb   gui=bold
+hi Normal      guibg=#fffdfa   guifg=black     gui=none
+hi NonText     guibg=#eafaea   guifg=#000099   gui=bold
+hi Visual      guibg=#fff8cc   guifg=black     gui=none
+" hi VisualNOS
+
+hi Linenr      guibg=bg        guifg=#999999 gui=none
+
+" Uncomment these if you use Diff...??
+" hi DiffText  guibg=#cc0000   guifg=white gui=none
+" hi DiffAdd   guibg=#0000cc   guifg=white gui=none
+" hi DiffChange        guibg=#990099   guifg=white gui=none
+" hi DiffDelete        guibg=#888888   guifg=#333333 gui=none
+
+hi Directory   guibg=bg        guifg=#337700   gui=none
+
+hi IncSearch   guibg=#c8e8ff   guifg=black     gui=none
+hi Search      guibg=#c8e8ff   guifg=black     gui=none
+hi SpecialKey  guibg=bg        guifg=fg        gui=none
+hi Titled      guibg=bg        guifg=fg        gui=none
+
+hi ErrorMsg        guibg=bg    guifg=#cc0000   gui=bold
+hi ModeMsg         guibg=bg    guifg=#003399   gui=none
+hi link        MoreMsg     ModeMsg
+hi link Question    ModeMsg
+hi WarningMsg      guibg=bg    guifg=#cc0000   gui=bold
+
+hi StatusLine  guibg=#ffeebb   guifg=black     gui=bold
+hi StatusLineNC        guibg=#aa8866   guifg=#f8e8cc   gui=none
+hi VertSplit   guibg=#aa8866   guifg=#ffe0bb   gui=none
+
+" hi Folded
+" hi FoldColumn
+" hi SignColumn
+
+
+" Colors for Syntax Highlighting.
+
+hi Comment guibg=#ddeedd guifg=#002200 gui=none
+
+hi Constant    guibg=bg    guifg=#003399 gui=bold
+hi String      guibg=bg    guifg=#003399 gui=italic
+hi Character   guibg=bg    guifg=#003399 gui=italic
+hi Number      guibg=bg    guifg=#003399 gui=bold
+hi Boolean     guibg=bg    guifg=#003399 gui=bold
+hi Float       guibg=bg    guifg=#003399 gui=bold
+
+hi Identifier  guibg=bg    guifg=#003399 gui=none
+hi Function    guibg=bg    guifg=#0055aa gui=bold
+hi Statement   guibg=bg    guifg=#003399 gui=none
+
+hi Conditional guibg=bg    guifg=#aa7733 gui=bold
+hi Repeat      guibg=bg    guifg=#aa5544 gui=bold
+hi link        Label   Conditional
+hi Operator    guibg=bg    guifg=#aa7733 gui=bold
+hi link Keyword        Statement
+hi Exception   guibg=bg    guifg=#228877 gui=bold
+
+hi PreProc         guibg=bg    guifg=#aa7733 gui=bold
+hi Include         guibg=bg    guifg=#558811 gui=bold
+hi link Define     Include
+hi link Macro      Include
+hi link PreCondit   Include
+
+hi Type                        guibg=bg    guifg=#007700 gui=bold
+hi link StorageClass   Type
+hi link Structure      Type
+hi Typedef             guibg=bg    guifg=#009900 gui=italic
+
+hi Special         guibg=bg        guifg=fg        gui=none
+hi SpecialChar     guibg=bg        guifg=fg        gui=bold
+hi Tag             guibg=bg        guifg=#003399   gui=bold
+hi link Delimiter   Special
+hi SpecialComment   guibg=#dddddd   guifg=#aa0000   gui=none
+hi link Debug      Special
+
+hi Underlined guibg=bg guifg=blue gui=underline
+
+hi Title    guibg=bg   guifg=fg        gui=bold
+hi Ignore   guibg=bg   guifg=#999999   gui=none
+hi Error    guibg=red  guifg=white     gui=none
+hi Todo            guibg=bg    guifg=#aa0000   gui=none
+
+
+
+" The same in cterm colors.
+hi Cursor      ctermbg=6   ctermfg=14
+hi Normal      ctermbg=15  ctermfg=0
+hi NonText     ctermbg=10  ctermfg=1
+hi Visual      ctermbg=14  ctermfg=0
+" hi VisualNOS
+hi Linenr      ctermbg=bg  ctermfg=7
+" hi DiffText  ctermbg=4   ctermfg=15
+" hi DiffAdd   ctermbg=1   ctermfg=15
+" hi DiffChange        ctermbg=5   ctermfg=15
+" hi DiffDelete        ctermbg=7   ctermfg=8
+hi Directory   ctermbg=bg  ctermfg=2 
+hi IncSearch   ctermbg=9   ctermfg=0
+hi Search      ctermbg=9   ctermfg=0
+hi SpecialKey  ctermbg=bg  ctermfg=fg 
+hi Titled      ctermbg=bg  ctermfg=fg
+hi ErrorMsg    ctermbg=bg  ctermfg=12 
+hi ModeMsg     ctermbg=bg  ctermfg=9  
+hi WarningMsg  ctermbg=bg  ctermfg=12 
+hi StatusLine  ctermbg=14  ctermfg=0
+hi StatusLineNC        ctermbg=6   ctermfg=14
+hi VertSplit   ctermbg=6   ctermfg=14
+" hi Folded
+" hi FoldColumn
+" hi SignColumn
+hi Comment     ctermbg=10  ctermfg=2
+hi Constant    ctermbg=bg  ctermfg=9
+hi String      ctermbg=bg  ctermfg=9  cterm=italic
+hi Character   ctermbg=bg  ctermfg=9  cterm=italic
+hi Number      ctermbg=bg  ctermfg=9  cterm=bold
+hi Boolean     ctermbg=bg  ctermfg=9  cterm=bold
+hi Float       ctermbg=bg  ctermfg=9  cterm=bold
+hi Function    ctermbg=bg  ctermfg=9  cterm=bold
+hi Statement   ctermbg=bg  ctermfg=9  cterm=bold
+hi Conditional ctermbg=bg  ctermfg=6  cterm=bold
+hi Repeat      ctermbg=bg  ctermfg=6  cterm=bold
+hi Operator    ctermbg=bg  ctermfg=6  cterm=bold
+hi Exception   ctermbg=bg  ctermfg=2  cterm=bold
+hi PreProc     ctermbg=bg  ctermfg=6
+hi Include     ctermbg=bg  ctermfg=2  cterm=bold
+hi Type                ctermbg=bg  ctermfg=2  cterm=bold
+hi Typedef     ctermbg=bg  ctermfg=2  cterm=italic
+hi Special     ctermbg=bg  ctermfg=fg cterm=bold
+hi Tag         ctermbg=bg  ctermfg=9  cterm=bold
+hi SpecialComment ctermbg=7 ctermfg=4
+hi Underlined  ctermbg=bg  ctermfg=9  cterm=underline
+hi Title       ctermbg=bg  ctermfg=fg cterm=bold 
+hi Ignore      ctermbg=bg  ctermfg=7
+hi Error       ctermbg=12  ctermfg=15
+hi Todo                ctermbg=bg  ctermfg=15
diff --git a/vim/colors/baycomb.vim b/vim/colors/baycomb.vim
new file mode 100644 (file)
index 0000000..1311e72
--- /dev/null
@@ -0,0 +1,319 @@
+" Vim color file
+" baycomb v2.4
+" http://www.vim.org/scripts/script.php?script_id=1454
+" 
+" Maintainer:  Shawn Axsom <axs221@gmail.com>
+"
+"   * Place :colo baycomb in your VimRC/GVimRC file
+"   * Also add :set background=dark  or :setbackground=light
+"     depending on your preference.
+"
+"   - Thanks to Desert and OceanDeep for their color scheme 
+"     file layouts
+"   - Thanks to Raimon Grau and Bob Lied for their feedback
+
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+               syntax reset
+    endif
+endif
+
+let g:colors_name="baycomb"
+
+if &background == "dark"
+hi Normal       guifg=#a0b4e0 guibg=#11121a   "1a1823
+hi NonText      guifg=#382920 guibg=bg
+
+hi Folded       guibg=#232235 guifg=grey
+hi FoldColumn  guibg=#0a0a18 guifg=#dbcaa5
+hi LineNr       guibg=#101124 guifg=#206aa9 
+hi StatusLine  guibg=#354070 guifg=#6880ea gui=none
+hi StatusLineNC        guibg=#2c3054 guifg=#5c6dbe gui=none
+hi VertSplit   guibg=#22253c guifg=#223355  gui=none
+
+hi tablinesel   guibg=#515a71 guifg=#50aae5 gui=none
+hi tabline      guibg=#4d4d5f guifg=#5b7098 gui=none
+hi tablinefill  guibg=#2d2d3f guifg=#aaaaaa gui=none
+
+"hi SpellBad
+"hi SpellCap
+"hi SpellLocal
+"hi SpellRare
+
+hi MatchParen  guibg=#7b5a55 guifg=#001122
+
+" syntax highlighting """"""""""""""""""""""""""""""""""""""""
+
+
+hi Comment             guifg=#349d58 guibg=bg
+hi Title           guifg=#e5e5ca gui=none
+hi Underlined   guifg=#bac5ba gui=none
+
+hi Statement    guifg=#fca8ad gui=none "a080aa
+hi Type                    guifg=#0490e8  gui=bold
+hi Constant        guifg=#5c78f0 "guibg=#111a2a
+hi Number       guifg=#4580b4 "guibg=#111a2a
+hi PreProc      guifg=#ba75cf
+hi Special         guifg=#aaaaca
+hi Ignore       guifg=grey40
+hi Todo                    guifg=orangered guibg=yellow2
+hi Error        guibg=#b03452
+hi Function     guifg=#bab588 guibg=bg gui=bold 
+hi Identifier   guifg=#5094c4   
+"""""this section borrowed from OceanDeep/Midnight"""""
+highlight Conditional gui=None guifg=#d0688d guibg=bg
+highlight Repeat gui=None guifg=#e06070 guibg=bg
+"hi Label gui=None guifg=LightGreen guibg=bg
+highlight Operator gui=None guifg=#e8cdc0 guibg=bg
+highlight Keyword gui=bold guifg=grey guibg=bg
+highlight Exception gui=bold guifg=#d0a8ad guibg=bg
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""
+"end syntax highlighting """""""""""""""""""""""""""""""""""""
+
+" highlight groups
+"hi CursorIM
+hi Directory   guifg=#bbd0df
+hi DiffText    guibg=#004335
+hi DiffChange   guibg=#685b5c
+hi DiffAdd      guibg=#0a4b8c
+hi DiffDelete   guifg=#300845 guibg=#200845
+hi ErrorMsg     guibg=#ff4545
+
+hi Cursor       guibg=#cad5c0 guifg=#0000aa
+
+
+hi Search       guibg=darkyellow guifg=black
+hi IncSearch   guifg=#babeaa guibg=#3a4520 
+
+hi ModeMsg     guifg=#00AACC
+hi MoreMsg      guifg=SeaGreen
+hi Question            guifg=#AABBCC
+hi SpecialKey  guifg=#90dcb0
+hi Visual       guifg=#102030 guibg=#80a0f0
+hi VisualNOS    guifg=#201a30 guibg=#a3a5FF
+hi WarningMsg  guifg=salmon
+"hi WildMenu
+"hi Menu
+"hi Scrollbar  guibg=grey30 guifg=tan
+"hi Tooltip
+
+
+" new Vim 7.0 items
+hi Pmenu        guibg=#3a6595 guifg=#9aadd5
+hi PmenuSel     guibg=#4a85ba guifg=#b0d0f0                    
+
+
+
+
+
+" color terminal definitions
+hi Cursor ctermfg=black ctermbg=white
+hi Normal ctermfg=grey ctermbg=black
+hi Number ctermfg=darkgreen
+highlight Operator ctermfg=yellow
+highlight Conditional ctermfg=darkred
+highlight Repeat ctermfg=darkred
+hi Exception ctermfg=darkred
+hi SpecialKey  ctermfg=darkgreen
+hi NonText     cterm=bold ctermfg=darkgrey
+hi Directory   ctermfg=darkcyan
+hi ErrorMsg    cterm=bold ctermfg=7 ctermbg=1
+hi IncSearch   ctermfg=yellow ctermbg=darkyellow cterm=NONE
+hi Search      ctermfg=black ctermbg=darkyellow cterm=NONE
+hi MoreMsg     ctermfg=darkgreen
+hi ModeMsg     cterm=NONE ctermfg=brown
+hi LineNr      ctermfg=darkcyan ctermbg=black
+hi Question    ctermfg=green
+hi StatusLine  ctermfg=yellow ctermbg=darkblue cterm=NONE
+hi StatusLineNC ctermfg=grey ctermbg=darkblue cterm=NONE
+hi VertSplit   ctermfg=black ctermbg=darkgrey cterm=NONE
+hi Title       ctermfg=yellow cterm=NONE
+hi Visual      ctermbg=grey ctermfg=blue cterm=NONE
+hi VisualNOS   ctermbg=grey ctermfg=blue cterm=NONE
+hi WarningMsg  ctermfg=1
+hi WildMenu    ctermfg=0 ctermbg=3
+hi Folded      ctermfg=darkgreen ctermbg=darkblue cterm=NONE
+hi FoldColumn  ctermfg=yellow ctermbg=black
+hi DiffAdd     ctermbg=4
+hi DiffChange  ctermbg=5
+hi DiffDelete  cterm=bold ctermfg=4 ctermbg=6
+hi DiffText    cterm=bold ctermbg=1
+hi Comment             ctermfg=darkgreen ctermbg=black
+hi Identifier   ctermfg=cyan
+
+"set comments to grey on non-Windows OS's to make sure
+"it is readable
+if &term == "builtin_gui" || &term == "win32"
+       hi function ctermfg=grey
+       hi Type         ctermfg=darkyellow ctermbg=darkblue
+       hi IncSearch    ctermfg=black ctermbg=grey cterm=NONE
+       hi Search       ctermfg=black ctermbg=darkgrey cterm=NONE
+else
+       hi function ctermfg=white
+       hi Type         ctermfg=grey
+       hi IncSearch    ctermfg=yellow ctermbg=darkyellow cterm=NONE
+       hi Search       ctermfg=black ctermbg=darkyellow cterm=NONE
+endif
+""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+hi Constant    ctermfg=darkcyan
+hi Special     ctermfg=white
+hi Statement   ctermfg=yellow
+hi PreProc     ctermfg=darkred
+hi Underlined  ctermfg=cyan cterm=NONE
+hi Ignore      cterm=bold ctermfg=7
+hi Ignore      ctermfg=darkgrey
+hi Error       cterm=bold ctermfg=7 ctermbg=1
+
+" new Vim 7.0 items
+hi Pmenu        ctermbg=darkblue ctermfg=lightgrey
+hi PmenuSel     ctermbg=lightblue ctermfg=white                    
+
+hi tablinesel   ctermfg=cyan ctermbg=blue
+hi tabline      ctermfg=black ctermbg=blue
+hi tablinefill  ctermfg=green ctermbg=darkblue
+"vim: sw=4
+"
+hi MatchParen  ctermfg=black ctermbg=green
+
+
+elseif &background == "light"
+
+hi Normal       guifg=#003255 guibg=#e8ebf0 "greyish blue2
+hi NonText      guifg=#382920 guibg=#152555
+
+" syntax highlighting """"""""""""""""""""""""""""""""""""""""
+
+"set comments to grey on non-Windows OS's to make sure
+"it is readable
+if &term == "builtin_gui" || &term == "win32"
+       hi Comment              guifg=#daddb8  guibg=#308ae5
+else
+       hi Comment              guifg=darkyellow  guibg=#207ada
+endif
+""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+hi Title               guifg=#857540  gui=none
+hi Underlined   guifg=#8a758a  
+
+hi Statement    guifg=#da302a  gui=none
+hi Type                        guifg=#307aca  gui=none
+hi Constant            guifg=#3a40aa  gui=none
+hi PreProc      guifg=#9570b5 
+hi Identifier   guifg=#856075  "gui=bold
+hi Special             guifg=#652a7a 
+hi Ignore       guifg=grey40
+hi Todo                        guifg=orangered guibg=yellow2
+hi Error        guibg=#b03452
+"""""this section borrowed from OceanDeep/Midnight"""""
+hi Number guifg=#006bcd 
+hi Function gui=None guifg=#d06d50 "or green 50b3b0 
+highlight Conditional gui=None guifg=#a50a4a
+highlight Repeat gui=None guifg=#700d8a
+"hi Label gui=None guifg=LightGreen guibg=bg
+highlight Operator gui=None guifg=#e0b045
+highlight Keyword gui=bold guifg=grey guibg=bg
+highlight Exception gui=none guifg=#ea5460
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""
+"end syntax highlighting """""""""""""""""""""""""""""""""""""
+
+" highlight groups
+"hi CursorIM
+hi Directory   guifg=#bbd0df
+"hi DiffAdd
+"hi DiffChange
+"hi DiffDelete
+"hi DiffText
+hi ErrorMsg     guibg=#ff4545
+
+hi Cursor       guibg=#cadaca guifg=#05293d
+
+hi FoldColumn  guibg=#409ae0 guifg=darkgrey
+"hi FoldColumn guibg=#83a5cd guifg=#70459F
+hi LineNr       guibg=#409ae0 guifg=darkblue gui=bold
+"hi LineNr       guibg=#081c30 guifg=#80a0dA 
+hi StatusLine  guibg=#20b5fd guifg=#0a150d gui=none
+hi StatusLineNC        guibg=#0580da guifg=#302d34 gui=none
+
+hi Search       guibg=#babdad guifg=#3a4520
+hi IncSearch   guifg=#dadeca guibg=#3a4520 
+
+hi VertSplit   guibg=#525f95 guifg=grey50 gui=none
+hi Folded       guibg=#252f5d guifg=#BBDDCC
+hi ModeMsg     guifg=#00AACC
+hi MoreMsg      guifg=SeaGreen
+hi Question            guifg=#AABBCC
+hi SpecialKey  guifg=#308c70
+hi Visual       guifg=#008FBF guibg=#33DFEF
+"hi VisualNOS
+hi WarningMsg  guifg=salmon
+"hi WildMenu
+"hi Menu
+"hi Scrollbar  guibg=grey30 guifg=tan
+"hi Tooltip
+
+
+" new Vim 7.0 items
+hi Pmenu        guibg=#3a6595 guifg=#9aadd5
+hi PmenuSel     guibg=#4a85ba guifg=#b0d0f0                    
+
+
+
+
+
+" color terminal definitions
+hi Normal ctermfg=black ctermbg=white
+hi Number ctermfg=blue
+highlight Operator ctermfg=yellow
+highlight Conditional ctermfg=magenta
+highlight Repeat ctermfg=magenta
+hi Exception ctermfg=red
+hi function ctermfg=darkyellow
+hi SpecialKey  ctermfg=darkgreen
+hi NonText     cterm=bold ctermfg=darkgrey ctermbg=grey
+hi Directory   ctermfg=darkcyan
+hi ErrorMsg    cterm=bold ctermfg=7 ctermbg=1
+hi IncSearch   ctermfg=yellow ctermbg=darkyellow cterm=NONE
+hi Search      ctermfg=white ctermbg=darkyellow cterm=NONE
+hi MoreMsg     ctermfg=darkgreen
+hi ModeMsg     cterm=NONE ctermfg=brown
+hi LineNr      ctermfg=black ctermbg=blue
+hi Question    ctermfg=green
+hi StatusLine  ctermfg=cyan ctermbg=blue cterm=NONE
+hi StatusLineNC ctermfg=grey ctermbg=darkblue cterm=NONE
+hi VertSplit   ctermfg=black ctermbg=black cterm=NONE
+hi Title       ctermfg=darkyellow ctermbg=white
+hi Visual      ctermbg=darkcyan ctermfg=cyan cterm=NONE
+hi VisualNOS   ctermbg=darkcyan ctermfg=white cterm=NONE
+hi WarningMsg  ctermfg=1
+hi WildMenu    ctermfg=0 ctermbg=3
+hi Folded      ctermfg=black ctermbg=white cterm=NONE
+hi FoldColumn  ctermfg=green ctermbg=blue
+hi DiffAdd     ctermbg=4
+hi DiffChange  ctermbg=5
+hi DiffDelete  cterm=bold ctermfg=4 ctermbg=6
+hi DiffText    cterm=bold ctermbg=1
+
+hi Comment             ctermfg=grey  ctermbg=blue
+
+hi Constant    ctermfg=darkblue
+hi Special     ctermfg=darkmagenta
+hi Identifier  ctermfg=darkyellow cterm=NONE
+hi Statement   ctermfg=red
+hi PreProc     ctermfg=magenta
+hi Type                ctermfg=darkcyan "or darkcyan
+hi Underlined  ctermfg=black ctermbg=white
+hi Ignore      cterm=bold ctermfg=7
+hi Ignore      ctermfg=darkgrey
+hi Error       cterm=bold ctermfg=7 ctermbg=1
+
+" new Vim 7.0 items
+hi Pmenu        ctermbg=darkblue ctermfg=lightgrey
+hi PmenuSel     ctermbg=lightblue ctermfg=white                    
+
+"vim: sw=4
+
+endif
diff --git a/vim/colors/bclear.vim b/vim/colors/bclear.vim
new file mode 100644 (file)
index 0000000..60a9cac
--- /dev/null
@@ -0,0 +1,67 @@
+" Vim colorscheme
+" Name:         bclear
+" Maintainer:   Ricky Cintron 'borosai' [borosai at gmail dot com]
+" Last Change:  2009-08-04
+
+hi clear
+set background=light
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "bclear"
+
+"---GUI settings
+hi SpecialKey   guifg=#000000   guibg=#ffcde6
+hi NonText      guifg=#969696   guibg=#f0f0f0   gui=none
+hi Directory    guifg=#78681a
+hi ErrorMsg     guifg=#ffffff   guibg=#a01010
+hi IncSearch    guifg=#ffffff   guibg=#ff8000   gui=none
+hi Search       guifg=#000000   guibg=#ffd073
+hi MoreMsg      guifg=#ffffff   guibg=#3c960f   gui=none
+hi ModeMsg      guifg=#323232                   gui=none
+hi LineNr       guifg=#969696   guibg=#f0f0f0
+hi Question     guifg=#000000   guibg=#ffde37   gui=none
+hi StatusLine   guifg=#ffffff   guibg=#323232   gui=none
+hi StatusLineNC guifg=#f0f0f0   guibg=#646464   gui=none
+hi VertSplit    guifg=#f0f0f0   guibg=#646464   gui=none
+hi Title        guifg=#323232                   gui=none
+hi Visual       guifg=#ffffff   guibg=#1994d1
+hi VisualNOS    guifg=#000000   guibg=#1994d1   gui=none
+hi WarningMsg   guifg=#c8c8c8   guibg=#a01010
+hi WildMenu     guifg=#ffffff   guibg=#1994d1
+hi Folded       guifg=#969696   guibg=#f0f0f0
+hi FoldColumn   guifg=#969696   guibg=#f0f0f0
+hi DiffAdd                      guibg=#deffcd
+hi DiffChange                   guibg=#dad7ff
+hi DiffDelete   guifg=#c8c8c8   guibg=#ffffff   gui=none
+hi DiffText     guifg=#ffffff   guibg=#767396   gui=none
+hi SignColumn   guifg=#969696   guibg=#f0f0f0
+hi SpellBad     guifg=#000000   guibg=#fff5c3   guisp=#f01818   gui=undercurl
+hi SpellCap     guifg=#000000   guibg=#fff5c3   guisp=#14b9c8   gui=undercurl
+hi SpellRare    guifg=#000000   guibg=#fff5c3   guisp=#4cbe13   gui=undercurl
+hi SpellLocal   guifg=#000000   guibg=#fff5c3   guisp=#000000   gui=undercurl
+hi Pmenu        guifg=#ffffff   guibg=#323232
+hi PmenuSel     guifg=#ffffff   guibg=#1994d1
+hi PmenuSbar    guifg=#323232   guibg=#323232
+hi PmenuThumb   guifg=#646464   guibg=#646464   gui=none
+hi TabLine      guifg=#f0f0f0   guibg=#646464   gui=none
+hi TabLineSel   guifg=#ffffff   guibg=#323232   gui=none
+hi TabLineFill  guifg=#646464   guibg=#646464   gui=none
+hi CursorColumn                 guibg=#e1f5ff
+hi CursorLine                   guibg=#e1f5ff   gui=none
+hi Cursor       guifg=#ffffff   guibg=#323232
+hi lCursor      guifg=#ffffff   guibg=#004364
+hi MatchParen   guifg=#ffffff   guibg=#f00078
+hi Normal       guifg=#323232   guibg=#ffffff
+hi Comment      guifg=#969696
+hi Constant     guifg=#1094a0
+hi Special      guifg=#dc6816
+hi Identifier   guifg=#3c960f
+hi Statement    guifg=#3b6ac8                   gui=none
+hi PreProc      guifg=#294a8c
+hi Type         guifg=#a00050                   gui=none
+hi Underlined   guifg=#323232                   gui=underline
+hi Ignore       guifg=#c8c8c8
+hi Error        guifg=#ffffff   guibg=#c81414
+hi Todo         guifg=#c81414   guibg=#ffffff
+
diff --git a/vim/colors/biogoo.vim b/vim/colors/biogoo.vim
new file mode 100644 (file)
index 0000000..e99dd14
--- /dev/null
@@ -0,0 +1,115 @@
+" Vim color File
+" Name:                        biogoo
+" Maintainer:  Benjamin Esham <bdesham@gmail.com>
+" Last Change: 2006-11-20
+" Version:             1.5
+"
+" Colorful text on a light gray background.  It's pretty easy on the eyes in
+" my opinion.  Any feedback is greatly appreciated!
+"
+" Installation:
+"      Copy to ~/.vim/colors; do :color biogoo
+"
+" Customization Options:
+"      Use a 'normal' cursor color:
+"              let g:biogoo_normal_cursor = 1
+"
+" Props:
+"      Jani Nurminen's zenburn.vim as an example file.
+"      Scott F. and Matt F. for feature suggestions.
+"      Bill McCarthy for his Vim mailing list post about Vim 7 support.
+"
+" Version History:
+"      1.5:    should fully support Vim 7 now
+"      1.4:    more support for Vim 7: added the `MatchParen' group for ()[]{} matching
+"      1.3:    added support for Vim 7: added groups for the new spellchecking, and
+"                      added a conditional to display Visual mode correctly in any version.            
+"      1.2:    added `SpellErrors' group for use with vimspell.
+"      1.1:    added `IncSearch' group for improved visibility in incremental searches.
+"      1.0:    minor tweaks
+"      0.95:   initial release
+"
+" TODO: Add new groups as needed.  E-mail me with any suggestions!
+
+set background=light
+hi clear
+if exists("syntax_on")
+       syntax reset
+endif
+let g:colors_name = "biogoo"
+
+hi Comment                     guifg=#0000c3
+hi Constant                    guifg=#0000ff
+hi CursorColumn                guibg=#ffffff
+hi CursorLine          guibg=#ffffff
+hi Delimiter           guifg=#00007f
+hi DiffAdd                     guifg=#007f00 guibg=#e5e5e5
+hi DiffChange          guifg=#00007f guibg=#e5e5e5
+hi DiffDelete          guifg=#7f0000 guibg=#e5e5e5
+hi DiffText                    guifg=#ee0000 guibg=#e5e5e5
+hi Directory           guifg=#b85d00
+hi Error                       guifg=#d6d6d6 guibg=#7f0000
+hi ErrorMsg                    guifg=#ffffff guibg=#ff0000 gui=bold
+hi Float                       guifg=#b85d00
+hi FoldColumn          guifg=#00007f guibg=#e5e5e5
+hi Folded                      guifg=#00007f guibg=#e5e5e5
+hi Function                    guifg=#7f0000
+hi Identifier          guifg=#004000
+hi Include                     guifg=#295498 gui=bold
+hi IncSearch           guifg=#ffffff guibg=#0000ff gui=bold
+hi LineNr                      guifg=#303030 guibg=#e5e5e5 gui=underline
+hi Keyword                     guifg=#00007f
+hi Macro                       guifg=#295498
+hi MatchParen          guifg=#ffffff guibg=#00a000
+hi ModeMsg                     guifg=#00007f
+hi MoreMsg                     guifg=#00007f
+hi NonText                     guifg=#007f00
+hi Normal                      guifg=#000000 guibg=#d6d6d6
+hi Number                      guifg=#b85d00
+hi Operator                    guifg=#00007f
+hi Pmenu                       guifg=#000000 guibg=#cc9999
+hi PmenuSel                    guifg=#ffffff guibg=#993333
+hi PmenuSbar           guibg=#99cc99
+hi PmenuThumb          guifg=#339933
+hi PreCondit           guifg=#295498 gui=bold
+hi PreProc                     guifg=#0c3b6b gui=bold
+hi Question                    guifg=#00007f
+hi Search                      guibg=#ffff00
+hi Special                     guifg=#007f00
+hi SpecialKey          guifg=#00007f
+hi SpellBad                    guifg=#ffffff guibg=#7f0000 gui=undercurl guisp=#d6d6d6
+hi SpellCap                    guifg=#ffffff guibg=#7f007f gui=undercurl guisp=#d6d6d6
+hi SpellLocal          guifg=#ffffff guibg=#007f7f gui=undercurl guisp=#d6d6d6
+hi SpellRare           guifg=#ffffff guibg=#b85d00 gui=undercurl guisp=#d6d6d6
+hi Statement           guifg=#00007f gui=none
+hi StatusLine          guifg=#00007f guibg=#ffffff
+hi StatusLineNC                guifg=#676767 guibg=#ffffff
+hi String                      guifg=#d10000
+hi TabLine                     guifg=#222222 guibg=#d6d6d6
+hi TabLineFill         guifg=#d6d6d6
+hi TabLineSel          guifg=#00007f guibg=#eeeeee gui=bold
+hi Title                       guifg=#404040 gui=bold
+hi Todo                                guifg=#00007f guibg=#e5e5e5 gui=underline
+hi Type                                guifg=#540054 gui=bold
+hi Underlined          guifg=#b85d00
+hi VertSplit           guifg=#676767 guibg=#ffffff
+if version < 700
+       hi Visual               guifg=#7f7f7f guibg=#ffffff
+else
+       hi Visual               guifg=#ffffff guibg=#7f7f7f
+endif
+hi VisualNOS           guifg=#007f00 guibg=#e5e5e5
+hi WarningMsg          guifg=#500000
+hi WildMenu                    guifg=#540054
+
+" Non-standard highlighting (e.g. for plugins)
+
+" vimspell
+hi SpellErrors         guifg=#ffffff guibg=#7f0000 gui=undercurl guisp=#d6d6d6
+
+if !exists("g:biogoo_normal_cursor")
+       " use a gray-on-blue cursor
+       hi Cursor               guifg=#ffffff guibg=#00007f
+endif
+
+" vim:noet:ts=4 sw=4
diff --git a/vim/colors/blacksea.vim b/vim/colors/blacksea.vim
new file mode 100644 (file)
index 0000000..a98b7ca
--- /dev/null
@@ -0,0 +1,37 @@
+" Vim color file
+" Maintainer:   Gerald S. Williams
+" Last Change:  2007 Jun 13
+
+" This is a dark version/opposite of "seashell". The cterm version of this is
+" very similar to "evening".
+"
+" Only values that differ from defaults are specified.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "BlackSea"
+
+hi Normal guibg=Black guifg=seashell ctermfg=White
+hi NonText guifg=LavenderBlush ctermfg=LightMagenta
+hi DiffDelete guibg=DarkRed guifg=Black ctermbg=DarkRed ctermfg=White
+hi DiffAdd guibg=DarkGreen ctermbg=DarkGreen ctermfg=White
+hi DiffChange guibg=Gray30 ctermbg=DarkCyan ctermfg=White
+hi DiffText gui=NONE guibg=DarkCyan ctermbg=DarkCyan ctermfg=Yellow
+hi Comment guifg=LightBlue
+hi PreProc ctermfg=Magenta
+hi StatusLine guibg=#1f001f guifg=DarkSeaGreen cterm=NONE ctermfg=White ctermbg=DarkGreen
+hi StatusLineNC guifg=Gray
+hi VertSplit guifg=Gray
+hi Type gui=NONE
+hi Identifier guifg=Cyan
+hi Statement guifg=brown3 ctermfg=DarkRed
+hi Search guibg=Gold3 ctermfg=White
+hi Folded guibg=gray20
+hi FoldColumn guibg=gray10
+
+" Original values:
+"hi Constant guifg=DeepPink
+"hi PreProc guifg=Magenta ctermfg=Magenta
diff --git a/vim/colors/bluegreen.vim b/vim/colors/bluegreen.vim
new file mode 100644 (file)
index 0000000..fd32bfe
--- /dev/null
@@ -0,0 +1,50 @@
+" Vim color file
+" Maintainer:   
+" Last Change:  
+" URL:                   
+
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="mine"
+
+hi Normal       guifg=White guibg=#061A3E
+
+" highlight groups
+hi Cursor       guibg=#D74141 guifg=#e3e3e3
+hi VertSplit guibg=#C0FFFF guifg=#075554 gui=none
+hi Folded               guibg=#FFC0C0 guifg=black
+hi FoldColumn   guibg=#800080 guifg=tan
+"hi IncSearch   cterm=none ctermbg=blue ctermfg=grey guifg=slategrey guibg=khaki
+hi ModeMsg guifg=#404040 guibg=#C0C0C0
+hi MoreMsg guifg=darkturquoise guibg=#188F90
+hi NonText guibg=#334C75 guifg=#9FADC5
+hi Question     guifg=#F4BB7E
+hi Search guibg=fg guifg=bg 
+hi SpecialKey   guifg=#BF9261
+hi StatusLine   guibg=#004443 guifg=#c0ffff gui=none
+hi StatusLineNC guibg=#067C7B guifg=#004443 gui=bold
+hi Title        guifg=#8DB8C3
+hi Visual gui=bold guifg=black guibg=#C0FFC0
+hi WarningMsg   guifg=#F60000 gui=underline
+
+" syntax highlighting groups
+hi Comment guifg=#DABEA2
+hi Constant guifg=#72A5E4 gui=bold
+hi Identifier   guifg=#ADCBF1
+hi Statement guifg=#7E75B5
+hi PreProc guifg=#14F07C
+hi Type guifg=#A9EE8A
+hi Special guifg=#EEBABA
+hi Ignore       guifg=grey60
+hi Todo guibg=#9C8C84 guifg=#244C0A
+
+"vim: ts=4
diff --git a/vim/colors/borland.vim b/vim/colors/borland.vim
new file mode 100644 (file)
index 0000000..c39c101
--- /dev/null
@@ -0,0 +1,60 @@
+" Vim color file
+" Maintainer:   Yegappan Lakshmanan
+" Last Change:  2001 Sep 9
+
+" Color settings similar to that used in Borland IDE's.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="borland"
+
+hi Normal       term=NONE cterm=NONE ctermfg=Yellow ctermbg=DarkBlue
+hi Normal       gui=NONE guifg=Yellow guibg=DarkBlue
+hi NonText      term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue
+hi NonText      gui=NONE guifg=White guibg=DarkBlue
+
+hi Statement    term=NONE cterm=NONE ctermfg=White  ctermbg=DarkBlue
+hi Statement    gui=NONE guifg=White guibg=DarkBlue
+hi Special      term=NONE cterm=NONE ctermfg=Cyan ctermbg=DarkBlue
+hi Special      gui=NONE guifg=Cyan guibg=DarkBlue
+hi Constant     term=NONE cterm=NONE ctermfg=Magenta ctermbg=DarkBlue
+hi Constant     gui=NONE guifg=Magenta guibg=DarkBlue
+hi Comment      term=NONE cterm=NONE ctermfg=Gray ctermbg=DarkBlue
+hi Comment      gui=NONE guifg=Gray guibg=DarkBlue
+hi Preproc      term=NONE cterm=NONE ctermfg=Green ctermbg=DarkBlue
+hi Preproc      gui=NONE guifg=Green guibg=DarkBlue
+hi Type         term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue
+hi Type         gui=NONE guifg=White guibg=DarkBlue
+hi Identifier   term=NONE cterm=NONE ctermfg=White ctermbg=DarkBlue
+hi Identifier   gui=NONE guifg=White guibg=DarkBlue
+
+hi StatusLine   term=bold cterm=bold ctermfg=Black ctermbg=White
+hi StatusLine   gui=bold guifg=Black guibg=White
+
+hi StatusLineNC term=NONE cterm=NONE ctermfg=Black ctermbg=White
+hi StatusLineNC gui=NONE guifg=Black guibg=White
+
+hi Visual       term=NONE cterm=NONE ctermfg=Black ctermbg=DarkCyan
+hi Visual       gui=NONE guifg=Black guibg=DarkCyan
+
+hi Search       term=NONE cterm=NONE ctermbg=Gray
+hi Search       gui=NONE guibg=Gray
+
+hi VertSplit    term=NONE cterm=NONE ctermfg=Black ctermbg=White
+hi VertSplit    gui=NONE guifg=Black guibg=White
+
+hi Directory    term=NONE cterm=NONE ctermfg=Green ctermbg=DarkBlue
+hi Directory    gui=NONE guifg=Green guibg=DarkBlue
+
+hi WarningMsg   term=standout cterm=NONE ctermfg=Red ctermbg=DarkBlue
+hi WarningMsg   gui=standout guifg=Red guibg=DarkBlue
+
+hi Error        term=NONE cterm=NONE ctermfg=White ctermbg=Red
+hi Error        gui=NONE guifg=White guibg=Red
+
+hi Cursor       ctermfg=Black ctermbg=Yellow
+hi Cursor       guifg=Black guibg=Yellow
+
diff --git a/vim/colors/breeze.vim b/vim/colors/breeze.vim
new file mode 100644 (file)
index 0000000..21cf417
--- /dev/null
@@ -0,0 +1,70 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/10/30 Wed 00:08.
+"     version: 1.0
+" This color scheme uses a dark background.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "breeze"
+
+hi Normal       guifg=#ffffff guibg=#005c70
+
+" Search
+hi IncSearch    gui=UNDERLINE guifg=#60ffff guibg=#6060ff
+hi Search       gui=NONE guifg=#ffffff guibg=#6060ff
+
+" Messages
+hi ErrorMsg     gui=BOLD guifg=#ffffff guibg=#ff40a0
+hi WarningMsg   gui=BOLD guifg=#ffffff guibg=#ff40a0
+hi ModeMsg      gui=NONE guifg=#60ffff guibg=NONE
+hi MoreMsg      gui=NONE guifg=#ffc0ff guibg=NONE
+hi Question     gui=NONE guifg=#ffff60 guibg=NONE
+
+" Split area
+hi StatusLine   gui=NONE guifg=#000000 guibg=#d0d0e0
+hi StatusLineNC gui=NONE guifg=#606080 guibg=#d0d0e0
+hi VertSplit    gui=NONE guifg=#606080 guibg=#d0d0e0
+hi WildMenu     gui=NONE guifg=#000000 guibg=#00c8f0
+
+" Diff
+hi DiffText     gui=UNDERLINE guifg=#ffff00 guibg=#000000
+hi DiffChange   gui=NONE guifg=#ffffff guibg=#000000
+hi DiffDelete   gui=NONE guifg=#60ff60 guibg=#000000
+hi DiffAdd      gui=NONE guifg=#60ff60 guibg=#000000
+
+" Cursor
+hi Cursor       gui=NONE guifg=#ffffff guibg=#d86020
+hi lCursor      gui=NONE guifg=#ffffff guibg=#e000b0
+hi CursorIM     gui=NONE guifg=#ffffff guibg=#e000b0
+
+" Fold
+hi Folded       gui=NONE guifg=#ffffff guibg=#0088c0
+" hi Folded       gui=NONE guifg=#ffffff guibg=#2080d0
+hi FoldColumn   gui=NONE guifg=#60e0e0 guibg=#006c7f
+
+" Other
+hi Directory    gui=NONE guifg=#00e0ff guibg=NONE
+hi LineNr       gui=NONE guifg=#60a8bc guibg=NONE
+hi NonText      gui=BOLD guifg=#00c0c0 guibg=#006276
+hi SpecialKey   gui=NONE guifg=#e0a0ff guibg=NONE
+hi Title        gui=BOLD guifg=#ffffff guibg=NONE
+hi Visual       gui=NONE guifg=#ffffff guibg=#6060d0
+" hi VisualNOS  gui=NONE guifg=#ffffff guibg=#6060d0
+
+" Syntax group
+hi Comment      gui=NONE guifg=#c8d0d0 guibg=NONE
+hi Constant     gui=NONE guifg=#60ffff guibg=NONE
+hi Error        gui=BOLD guifg=#ffffff guibg=#ff40a0
+hi Identifier   gui=NONE guifg=#cacaff guibg=NONE
+hi Ignore       gui=NONE guifg=#006074 guibg=NONE
+hi PreProc      gui=NONE guifg=#ffc0ff guibg=NONE
+hi Special      gui=NONE guifg=#ffd074 guibg=NONE
+hi Statement    gui=NONE guifg=#ffff80 guibg=NONE
+hi Todo         gui=BOLD,UNDERLINE guifg=#ffb0b0 guibg=NONE
+hi Type         gui=NONE guifg=#80ffa0 guibg=NONE
+hi Underlined   gui=UNDERLINE guifg=#ffffff guibg=NONE
diff --git a/vim/colors/brookstream.vim b/vim/colors/brookstream.vim
new file mode 100644 (file)
index 0000000..ee907c6
--- /dev/null
@@ -0,0 +1,83 @@
+"--------------------------------------------------------------------
+" Name Of File: brookstream.vim.
+" Description: Gvim colorscheme, works best with version 6.1 GUI .
+" Maintainer: Peter Bรคckstrรถm.
+" Creator: Peter Bรคckstrรถm.
+" URL: http://www.brookstream.org (Swedish).
+" Credits: Inspiration from the darkdot scheme.
+" Last Change: Friday, April 13, 2003.
+" Installation: Drop this file in your $VIMRUNTIME/colors/ directory.
+"--------------------------------------------------------------------
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="brookstream"
+
+"--------------------------------------------------------------------
+
+hi Normal                                      gui=none        guibg=#000000   guifg=#bbbbbb
+hi Cursor                                                                              guibg=#44ff44 guifg=#000000
+hi Directory                                                                                                                   guifg=#44ffff
+hi DiffAdd                                                                     guibg=#080808   guifg=#ffff00
+hi DiffDelete                                                          guibg=#080808   guifg=#444444
+hi DiffChange                                                          guibg=#080808   guifg=#ffffff
+hi DiffText                                                                    guibg=#080808   guifg=#bb0000
+hi ErrorMsg                                                                    guibg=#880000   guifg=#ffffff
+hi Folded                                                                                                                                      guifg=#000088
+hi IncSearch                                                           guibg=#000000   guifg=#bbcccc
+hi LineNr                                                                              guibg=#050505   guifg=#4682b4
+hi ModeMsg                                                                                                                             guifg=#ffffff
+hi MoreMsg                                                                                                                             guifg=#44ff44
+hi NonText                                                                                                                             guifg=#4444ff
+hi Question                                                                                                                            guifg=#ffff00
+hi SpecialKey                                                                                                                  guifg=#4444ff
+hi StatusLine                  gui=none        guibg=#2f4f4f   guifg=#ffffff
+hi StatusLineNC                gui=none        guibg=#bbbbbb   guifg=#000000           
+hi Title                                                                                                                                       guifg=#ffffff
+hi Visual                                      gui=none        guibg=#bbbbbb   guifg=#000000
+hi WarningMsg                                                          guifg=#ffff00
+
+" syntax highlighting groups ----------------------------------------
+
+hi Comment                                                                     guifg=#696969
+hi Constant                                                                    guifg=#00aaaa
+hi Identifier                                                          guifg=#00e5ee
+hi Statement                                                           guifg=#00ffff
+hi PreProc                                                                     guifg=#8470ff
+hi Type                                                                                        guifg=#ffffff
+hi Special             gui=none                        guifg=#87cefa
+hi Underlined  gui=bold                  guifg=#4444ff
+hi Ignore                                                                              guifg=#444444
+hi Error                       guibg=#000000   guifg=#bb0000
+hi Todo                                guibg=#aa0006   guifg=#fff300
+hi Operator    gui=none                        guifg=#00bfff
+hi Function                                    guifg=#1e90ff
+hi String              gui=None                        guifg=#4682b4
+hi Boolean                                                                     guifg=#9bcd9b
+
+"hi link Character Constant
+"hi link Number    Constant
+"hi link Boolean   Constant
+"hi link Float   Number
+"hi link Conditional Statement
+"hi link Label   Statement
+"hi link Keyword   Statement
+"hi link Exception Statement
+"hi link Repeat    Statement
+"hi link Include   PreProc
+"hi link Define    PreProc
+"hi link Macro   PreProc
+"hi link PreCondit PreProc
+"hi link StorageClass  Type
+"hi link Structure Type
+"hi link Typedef   Type
+"hi link Tag   Special
+"hi link Delimiter Special
+"hi link SpecialComment  Special
+"hi link Debug   Special
+"hi link FoldColumn  Folded
+
+"- end of colorscheme -----------------------------------------------  
diff --git a/vim/colors/buttercream.vim b/vim/colors/buttercream.vim
new file mode 100644 (file)
index 0000000..05931f8
--- /dev/null
@@ -0,0 +1,59 @@
+" Vim color file
+" vim: tw=0 ts=8 sw=4
+" Scriptname:   buttercream
+" Maintainer:   Hรฅkan Wikstrรถm <hakan@prinsig.se>
+" Version:      1.1
+" Last Change:  20060413
+" As of now only gui is supported
+" Based on the theme fog theme by Thomas R. Kimpton <tomk@emcity.net>
+
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let colors_name = "buttercream"
+
+"  Highlight            Foreground              Background                      Extras
+
+hi Normal               guifg=#213a58           guibg=#ffffde
+hi NonText              guifg=LightBlue         guibg=#eee9bf                   gui=bold
+hi Comment              guifg=#2f8e99
+hi Constant             guifg=#7070a0
+hi Statement            guifg=DarkGreen                                         gui=bold
+hi identifier           guifg=DarkGreen
+hi preproc              guifg=#408040
+hi type                 guifg=DarkBlue
+hi label                guifg=#c06000
+hi operator             guifg=DarkGreen                                         gui=bold
+hi StorageClass         guifg=#a02060                                           gui=bold
+hi Number               guifg=Blue
+hi Special              guifg=#aa8822
+hi Cursor               guifg=LightGrey         guibg=#880088
+hi lCursor              guifg=Black             guibg=Cyan
+hi ErrorMsg             guifg=White             guibg=DarkRed
+hi DiffText                                     guibg=DarkRed                   gui=bold
+hi Directory            guifg=DarkGrey                                          gui=underline
+hi LineNr               guifg=#ccaa22
+hi MoreMsg              guifg=SeaGreen                                          gui=bold
+hi Question             guifg=DarkGreen                                         gui=bold
+hi Search               guifg=Black             guibg=#887722
+hi SpecialKey           guifg=Blue
+hi SpecialChar          guifg=DarkGrey                                          gui=bold
+hi Title                guifg=DarkMagenta                                       gui=underline
+hi WarningMsg           guifg=DarkBlue          guibg=#9999cc
+hi WildMenu             guifg=Black             guibg=Yellow                    gui=underline
+hi Folded               guifg=DarkBlue          guibg=LightGrey
+hi FoldColumn           guifg=DarkBLue          guibg=Grey
+hi DiffAdd                                      guibg=DarkBlue
+hi DiffChange                                   guibg=DarkMagenta
+hi DiffDelete           guifg=Blue              guibg=DarkCyan                  gui=bold
+hi Ignore               guifg=grey90
+hi IncSearch                                                                    gui=reverse
+hi ModeMsg                                                                      gui=bold
+hi StatusLine                                                                   gui=reverse,bold
+hi StatusLineNC                                                                 gui=reverse
+hi VertSplit                                                                    gui=reverse
+hi Visual               guifg=LightGrey                                         gui=reverse
+hi VisualNOS                                                                    gui=underline,bold
+hi Todo                                         guibg=#ccaa22                   gui=bold,underline
diff --git a/vim/colors/calmar256-dark.vim b/vim/colors/calmar256-dark.vim
new file mode 100644 (file)
index 0000000..7c823fb
--- /dev/null
@@ -0,0 +1,247 @@
+" Vim color file:  calmar256-dark.vim
+" Last Change: 21. Aug 2007
+" License: public domain
+" Maintainer:: calmar <mac@calmar.ws>
+"
+" for a 256 color capable terminal like xterm-256color, ... or gvim as well
+" "{{{
+" it only works in such a terminal and when you have:
+" set t_Co=256
+" in your vimrc"}}}
+
+" {{{ t_Co=256 is set - check 
+if &t_Co != 256 && ! has("gui_running")
+    echomsg ""
+    echomsg "write 'set t_Co=256' in your .vimrc or this file won't load"
+    echomsg ""
+    finish
+endif
+" }}}
+" {{{ reset colors and set colors_name and store cpo setting
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let g:colors_name = "calmar256-dark"
+
+let s:save_cpo = &cpo
+set cpo&vim
+" }}}
+
+" FORMAT:"{{{
+"
+" \ ["color-group", "term-style", "foreground-color", "background-color", "gui-style", "under-curl-color" ],
+"
+" 'term-style'/'gui-style' can be: 
+"              bold, underline, undercurl, reverse, inverse, italic, standout, NONE
+"
+" if gui-style is empty, the term-style value is used for the gui
+"
+" (Note: not everything is supported by a terminal nor the gui)
+"
+" besides empty values defaults to 'NONE"
+"
+" may also check:  :help highlight-groups
+"                  :help hl-<highlight-group> "
+"
+" for the Color numbers (0-255) for the foreground/background and under-curl-colors:
+" http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
+"}}}
+"============================================================
+"             EDIT/ADD your style/colors below
+"------------------------------------------------------------
+" Format:   \ ["color-group",   
+"                               "term-style", 
+"                                       "foreground-color", 
+"                                                "background-color", 
+"                                                       "gui-style", 
+"                                                                   "under-curl-color" ],
+
+let s:colors256 = [
+            \ ["Normal",        "",     "41",   "232",  "",         ""   ],
+            \ ["Cursor",        "",     "255",  "33",   "",         ""   ],
+            \ ["CursorLine",    "",     "",     "233",  "",         ""   ],
+            \ ["CursorColumn",  "",     "",     "223",  "",         ""   ],
+            \ ["Incsearch",     "bold", "195",  "124",  "",         ""   ],
+            \ ["Search",        "",     "",     "52",   "",         ""   ],
+            \ ["ErrorMsg",      "bold", "16",   "202",  "",         ""   ],
+            \ ["WarningMsg",    "bold", "16",   "190",  "",         ""   ],
+            \ ["ModeMsg",       "bold", "226",  "18",   "",         ""   ],
+            \ ["MoreMsg",       "bold", "16",   "154",  "",         ""   ],
+            \ ["Question",      "bold", "70",   "",     "",         ""   ],
+            \ ["StatusLine",    "",     "190",  "22",   "",         ""   ],
+            \ ["StatusLineNC",  "",     "84",   "234",  "",         ""   ],
+            \ ["User1",         "bold", "28",   "",     "",         ""   ],
+            \ ["User2",         "bold", "39",   "",     "",         ""   ],
+            \ ["VertSplit",     "",     "84",   "22",   "",         ""   ],
+            \ ["WildMenu",      "bold", "87",   "35",   "",         ""   ],
+            \ ["DiffText",      "",     "16",   "190",  "",         ""   ],
+            \ ["DiffChange",    "",     "18",   "83",   "",         ""   ],
+            \ ["DiffDelete",    "",     "79",   "124",  "",         ""   ],
+            \ ["DiffAdd",       "",     "79",   "21",   "",         ""   ],
+            \ ["Folded",        "bold", "38",   "234",  "",         ""   ],
+            \ ["FoldedColumn",  "",     "39",   "190",  "",         ""   ],
+            \ ["FoldColumn",    "",     "38",   "234",  "",         ""   ],
+            \ ["Directory",     "",     "28",   "",     "",         ""   ],
+            \ ["LineNr",        "",     "28",   "16",   "",         ""   ],
+            \ ["NonText",       "",     "244",  "16",   "",         ""   ],
+            \ ["SpecialKey",    "",     "190",  "",     "",         ""   ],
+            \ ["Title",         "bold", "98",   "",     "",         ""   ],
+            \ ["Visual",        "",     "",     "238",  "",         ""   ],
+            \ ["Comment",       "",     "37",   "",     "",         ""   ],
+            \ ["Costant",       "",     "73",   "",     "",         ""   ],
+            \ ["String",        "",     "190",  "",     "",         ""   ],
+            \ ["Error",         "",     "69",   "",     "",         ""   ],
+            \ ["Identifier",    "",     "81",   "",     "",         ""   ],
+            \ ["Ignore",        "",     "",     "",     "",         ""   ],
+            \ ["Number",        "bold", "50",   "",     "",         ""   ],
+            \ ["PreProc",       "",     "178",  "",     "",         ""   ],
+            \ ["Special",       "",     "15",   "234",  "",         ""   ],
+            \ ["SpecialChar",   "",     "155",  "",     "",         ""   ],
+            \ ["Statement",     "",     "36",   "",     "",         ""   ],
+            \ ["Todo",          "bold", "16",   "148",  "",         ""   ],
+            \ ["Type",          "",     "71",   "",     "",         ""   ],
+            \ ["Underlined",    "bold", "77",   "",     "",         ""   ],
+            \ ["TaglistTagName","bold", "48",   "124",  "",         ""   ]]
+
+let s:colorvim7 = [
+            \ ["Pmenu",         "",     "228",  "236",  "",         ""   ],
+            \ ["PmenuSel",      "bold", "226",  "232",  "",         ""   ],
+            \ ["PmenuSbar",     "",     "119",  "16",   "",         ""   ],
+            \ ["PmenuThumb",    "",     "11",   "16",   "",         ""   ],
+            \ ["SpellBad",      "underline", "","",     "undercurl","160"],
+            \ ["SpellRare",     "",     "82",   "233",  "",         ""   ],
+            \ ["SpellLocal",    "",     "227",  "234",  "",         ""   ],
+            \ ["SpellCap",      "",     "46",   "236",  "",         ""   ],
+            \ ["MatchParen",    "bold", "15",   "22",   "",         ""   ],
+            \ ["TabLine",       "",     "253",  "30",   "",         ""   ],
+            \ ["TabLineSel",    "bold", "247",  "16",   "",         ""   ],
+            \ ["TabLineFill",   "",     "247",  "16",   "",         ""   ]]
+
+"============================================================
+"        * NO NEED * to edit below (unless bugfixing)
+"============================================================
+"
+" {{{ change empty fields to "NONE"
+
+for s:col in s:colors256
+    for i in  [1, 2, 3, 4, 5]
+        if s:col[i] == "" 
+            let s:col[i] = "NONE"
+        endif
+    endfor
+endfor
+
+for s:col in s:colorvim7
+    for i in  [1, 2, 3, 4, 5]
+        if s:col[i] == "" 
+            let s:col[i] = "NONE"
+        endif
+    endfor
+endfor
+" }}}
+" {{{ check args helper function
+function! s:checkargs(arg)
+    if a:arg+0 == 0 && a:arg != "0"  "its a string
+        return a:arg
+    else
+        return s:cmap[a:arg+0]       "get rgb color based on the number
+    endif
+endfunction
+" }}}
+" {{{ guisetcolor helper function
+"
+function! s:guisetcolor(colarg)
+    " if gui-style is empty use (c)term-style also for gui
+        if a:colarg[4] == ""
+            let guival = a:colarg[1]
+        else
+            let guival = a:colarg[4]
+        endif
+
+        let fg = s:checkargs(a:colarg[2])
+        let bg = s:checkargs(a:colarg[3])
+        let sp = s:checkargs(a:colarg[5])
+
+        exec "hi ".a:colarg[0]." gui=".guival." guifg=".fg." guibg=".bg." guisp=".sp
+endfunction
+" }}}
+" {{{ color setup for terminal
+if ! has("gui_running")
+    for s:col in s:colors256
+        exec "hi ".s:col[0]." cterm=".s:col[1]." ctermfg=".s:col[2]." ctermbg=".s:col[3]
+    endfor
+    if v:version >= 700
+        for s:col in s:colorvim7
+            exec "hi ".s:col[0]." cterm=".s:col[1]." ctermfg=".s:col[2]." ctermbg=".s:col[3]
+        endfor
+    endif
+else
+" }}}
+    " color-mapping array {{{
+    " number of vim colors and #html colors equivalent for gui
+    let s:cmap =   [ 
+                \ "#000000", "#800000", "#008000", "#808000", 
+                \ "#000080", "#800080", "#008080", "#c0c0c0", 
+                \ "#808080", "#ff0000", "#00ff00", "#ffff00", 
+                \ "#0000ff", "#ff00ff", "#00ffff", "#ffffff", 
+                \
+                \ "#000000", "#00005f", "#000087", "#0000af", "#0000d7", "#0000ff", 
+                \ "#005f00", "#005f5f", "#005f87", "#005faf", "#005fd7", "#005fff", 
+                \ "#008700", "#00875f", "#008787", "#0087af", "#0087d7", "#0087ff", 
+                \ "#00af00", "#00af5f", "#00af87", "#00afaf", "#00afd7", "#00afff", 
+                \ "#00d700", "#00d75f", "#00d787", "#00d7af", "#00d7d7", "#00d7ff", 
+                \ "#00ff00", "#00ff5f", "#00ff87", "#00ffaf", "#00ffd7", "#00ffff", 
+                \ "#5f0000", "#5f005f", "#5f0087", "#5f00af", "#5f00d7", "#5f00ff", 
+                \ "#5f5f00", "#5f5f5f", "#5f5f87", "#5f5faf", "#5f5fd7", "#5f5fff", 
+                \ "#5f8700", "#5f875f", "#5f8787", "#5f87af", "#5f87d7", "#5f87ff", 
+                \ "#5faf00", "#5faf5f", "#5faf87", "#5fafaf", "#5fafd7", "#5fafff", 
+                \ "#5fd700", "#5fd75f", "#5fd787", "#5fd7af", "#5fd7d7", "#5fd7ff", 
+                \ "#5fff00", "#5fff5f", "#5fff87", "#5fffaf", "#5fffd7", "#5fffff", 
+                \ "#870000", "#87005f", "#870087", "#8700af", "#8700d7", "#8700ff", 
+                \ "#875f00", "#875f5f", "#875f87", "#875faf", "#875fd7", "#875fff", 
+                \ "#878700", "#87875f", "#878787", "#8787af", "#8787d7", "#8787ff", 
+                \ "#87af00", "#87af5f", "#87af87", "#87afaf", "#87afd7", "#87afff", 
+                \ "#87d700", "#87d75f", "#87d787", "#87d7af", "#87d7d7", "#87d7ff", 
+                \ "#87ff00", "#87ff5f", "#87ff87", "#87ffaf", "#87ffd7", "#87ffff", 
+                \ "#af0000", "#af005f", "#af0087", "#af00af", "#af00d7", "#af00ff", 
+                \ "#af5f00", "#af5f5f", "#af5f87", "#af5faf", "#af5fd7", "#af5fff", 
+                \ "#af8700", "#af875f", "#af8787", "#af87af", "#af87d7", "#af87ff", 
+                \ "#afaf00", "#afaf5f", "#afaf87", "#afafaf", "#afafd7", "#afafff", 
+                \ "#afd700", "#afd75f", "#afd787", "#afd7af", "#afd7d7", "#afd7ff", 
+                \ "#afff00", "#afff5f", "#afff87", "#afffaf", "#afffd7", "#afffff", 
+                \ "#d70000", "#d7005f", "#d70087", "#d700af", "#d700d7", "#d700ff", 
+                \ "#d75f00", "#d75f5f", "#d75f87", "#d75faf", "#d75fd7", "#d75fff", 
+                \ "#d78700", "#d7875f", "#d78787", "#d787af", "#d787d7", "#d787ff", 
+                \ "#d7af00", "#d7af5f", "#d7af87", "#d7afaf", "#d7afd7", "#d7afff", 
+                \ "#d7d700", "#d7d75f", "#d7d787", "#d7d7af", "#d7d7d7", "#d7d7ff", 
+                \ "#d7ff00", "#d7ff5f", "#d7ff87", "#d7ffaf", "#d7ffd7", "#d7ffff", 
+                \ "#ff0000", "#ff005f", "#ff0087", "#ff00af", "#ff00d7", "#ff00ff", 
+                \ "#ff5f00", "#ff5f5f", "#ff5f87", "#ff5faf", "#ff5fd7", "#ff5fff", 
+                \ "#ff8700", "#ff875f", "#ff8787", "#ff87af", "#ff87d7", "#ff87ff", 
+                \ "#ffaf00", "#ffaf5f", "#ffaf87", "#ffafaf", "#ffafd7", "#ffafff", 
+                \ "#ffd700", "#ffd75f", "#ffd787", "#ffd7af", "#ffd7d7", "#ffd7ff", 
+                \ "#ffff00", "#ffff5f", "#ffff87", "#ffffaf", "#ffffd7", "#ffffff", 
+                \
+                \ "#080808", "#121212", "#1c1c1c", "#262626", "#303030", "#3a3a3a", 
+                \ "#444444", "#4e4e4e", "#585858", "#606060", "#666666", "#767676", 
+                \ "#808080", "#8a8a8a", "#949494", "#9e9e9e", "#a8a8a8", "#b2b2b2", 
+                \ "#bcbcbc", "#c6c6c6", "#d0d0d0", "#dadada", "#e4e4e4", "#eeeeee" ]
+    " }}}
+" {{{ color setup for gvim
+    for s:col in s:colors256
+        call s:guisetcolor(s:col)
+    endfor
+    if v:version >= 700
+        for s:col in s:colorvim7
+            call s:guisetcolor(s:col)
+        endfor
+    endif
+endif
+" }}}
+let &cpo = s:save_cpo   " restoring &cpo value
+" vim: set fdm=marker fileformat=unix:
diff --git a/vim/colors/calmar256-light.vim b/vim/colors/calmar256-light.vim
new file mode 100644 (file)
index 0000000..941f8ea
--- /dev/null
@@ -0,0 +1,247 @@
+" Vim color file:  calmar256-dark.vim
+" Last Change: 21. Aug 2007
+" License: public domain
+" Maintainer:: calmar <mac@calmar.ws>
+"
+" for a 256 color capable terminal like xterm-256color, ... or gvim as well
+" "{{{
+" it only works in such a terminal and when you have:
+" set t_Co=256
+" in your vimrc"}}}
+
+" {{{ t_Co=256 is set - check 
+if &t_Co != 256 && ! has("gui_running")
+    echomsg ""
+    echomsg "write 'set t_Co=256' in your .vimrc or this file won't load"
+    echomsg ""
+    finish
+endif
+" }}}
+" {{{ reset colors and set colors_name and store cpo setting
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let g:colors_name = "calmar256-light"
+
+let s:save_cpo = &cpo
+set cpo&vim
+" }}}
+
+" FORMAT:"{{{
+"
+" \ ["color-group", "term-style", "foreground-color", "background-color", "gui-style", "under-curl-color" ],
+"
+" 'term-style'/'gui-style' can be: 
+"              bold, underline, undercurl, reverse, inverse, italic, standout, NONE
+"
+" if gui-style is empty, the term-style value is used for the gui
+"
+" (Note: not everything is supported by a terminal nor the gui)
+"
+" besides empty values defaults to 'NONE"
+"
+" may also check:  :help highlight-groups
+"                  :help hl-<highlight-group> "
+"
+" for the Color numbers (0-255) for the foreground/background and under-curl-colors:
+" http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
+"}}}
+"============================================================
+"             EDIT/ADD your style/colors below
+"------------------------------------------------------------
+" Format:   \ ["color-group",   
+"                               "term-style", 
+"                                       "foreground-color", 
+"                                                "background-color", 
+"                                                       "gui-style", 
+"                                                                   "under-curl-color" ],
+
+let s:colors256 = [
+            \ ["Normal",        "",     "17",   "230",  "",         ""   ],
+            \ ["Cursor",        "",     "",     "226",  "",         ""   ],
+            \ ["CursorLine",    "",     "",     "222",  "",         ""   ],
+            \ ["CursorColumn",  "",     "",     "223",  "",         ""   ],
+            \ ["Incsearch",     "bold", "195",  "28",   "",         ""   ],
+            \ ["Search",        "",     "",     "119",  "",         ""   ],
+            \ ["ErrorMsg",      "bold", "16",   "202",  "",         ""   ],
+            \ ["WarningMsg",    "bold", "16",   "190",  "",         ""   ],
+            \ ["ModeMsg",       "bold", "16",   "51",   "",         ""   ],
+            \ ["MoreMsg",       "bold", "16",   "154",  "",         ""   ],
+            \ ["Question",      "bold", "27",   "",     "",         ""   ],
+            \ ["StatusLine",    "",     "231",  "30",   "",         ""   ],
+            \ ["StatusLineNC",  "",     "20",   "250",  "",         ""   ],
+            \ ["User1",         "bold", "28",   "",     "",         ""   ],
+            \ ["User2",         "bold", "39",   "",     "",         ""   ],
+            \ ["VertSplit",     "",     "84",   "22",   "",         ""   ],
+            \ ["WildMenu",      "bold", "87",   "35",   "",         ""   ],
+            \ ["DiffText",      "",     "16",   "190",  "",         ""   ],
+            \ ["DiffChange",    "",     "16",   "83",   "",         ""   ],
+            \ ["DiffDelete",    "",     "79",   "124",  "",         ""   ],
+            \ ["DiffAdd",       "",     "79",   "21",   "",         ""   ],
+            \ ["Folded",        "bold", "19",   "115",  "",         ""   ],
+            \ ["FoldedColumn",  "",     "39",   "190",  "",         ""   ],
+            \ ["FoldColumn",    "",     "19",   "115",  "",         ""   ],
+            \ ["Directory",     "",     "28",   "",     "",         ""   ],
+            \ ["LineNr",        "",     "63",   "228",  "",         ""   ],
+            \ ["NonText",       "",     "243",  "229",  "",         ""   ],
+            \ ["SpecialKey",    "",     "190",  "",     "",         ""   ],
+            \ ["Title",         "bold", "18",   "",     "",         ""   ],
+            \ ["Visual",        "",     "",     "220",  "",         ""   ],
+            \ ["Comment",       "",     "21",   "255",  "",         ""   ],
+            \ ["Costant",       "",     "58",   "",     "",         ""   ],
+            \ ["String",        "",     "160",  "",     "",         ""   ],
+            \ ["Error",         "",     "130",  "",     "",         ""   ],
+            \ ["Identifier",    "",     "31",   "",     "",         ""   ],
+            \ ["Ignore",        "",     "",     "",     "",         ""   ],
+            \ ["Number",        "bold", "23",   "",     "",         ""   ],
+            \ ["PreProc",       "",     "26",   "255",  "",         ""   ],
+            \ ["Special",       "",     "",     "229",  "",         ""   ],
+            \ ["SpecialChar",   "",     "22",   "",     "",         ""   ],
+            \ ["Statement",     "",     "36",   "",     "",         ""   ],
+            \ ["Todo",          "",     "",     "229",  "",         ""   ],
+            \ ["Type",          "",     "20",   "",     "",         ""   ],
+            \ ["Underlined",    "bold", "25",   "",     "",         ""   ],
+            \ ["TaglistTagName","bold", "29",   "118",  "",         ""   ]]
+
+let s:colorvim7 = [
+            \ ["Pmenu",         "",     "229",  "29",   "",         ""   ],
+            \ ["PmenuSel",      "bold", "232",  "226",  "",         ""   ],
+            \ ["PmenuSbar",     "",     "16",   "119",  "",         ""   ],
+            \ ["PmenuThumb",    "",     "16",   "11",   "",         ""   ],
+            \ ["SpellBad",      "undercurl", "","",     "undercurl","160"  ],
+            \ ["SpellRare",     "",     "",     "228",  "",         ""   ],
+            \ ["SpellLocal",    "",     "",     "224",  "",         ""   ],
+            \ ["SpellCap",      "",     "",     "247",  "",         ""   ],
+            \ ["MatchParen",    "bold", "15",   "22",   "",         ""   ],
+            \ ["TabLine",       "",     "252",  "22",   "",         ""   ],
+            \ ["TabLineSel",    "bold", "253",  "30",   "",         ""   ],
+            \ ["TabLineFill",   "",     "247",  "16",   "",         ""   ]]
+
+"============================================================
+"        * NO NEED * to edit below (unless bugfixing)
+"============================================================
+"
+" {{{ change empty fields to "NONE"
+
+for s:col in s:colors256
+    for i in  [1, 2, 3, 4, 5]
+        if s:col[i] == "" 
+            let s:col[i] = "NONE"
+        endif
+    endfor
+endfor
+
+for s:col in s:colorvim7
+    for i in  [1, 2, 3, 4, 5]
+        if s:col[i] == "" 
+            let s:col[i] = "NONE"
+        endif
+    endfor
+endfor
+" }}}
+" {{{ check args helper function
+function! s:checkargs(arg)
+    if a:arg+0 == 0 && a:arg != "0"  "its a string
+        return a:arg
+    else
+        return s:cmap[a:arg+0]       "get rgb color based on the number
+    endif
+endfunction
+" }}}
+" {{{ guisetcolor helper function
+"
+function! s:guisetcolor(colarg)
+    " if gui-style is empty use (c)term-style also for gui
+        if a:colarg[4] == ""
+            let guival = a:colarg[1]
+        else
+            let guival = a:colarg[4]
+        endif
+
+        let fg = s:checkargs(a:colarg[2])
+        let bg = s:checkargs(a:colarg[3])
+        let sp = s:checkargs(a:colarg[5])
+
+        exec "hi ".a:colarg[0]." gui=".guival." guifg=".fg." guibg=".bg." guisp=".sp
+endfunction
+" }}}
+" {{{ color setup for terminal
+if ! has("gui_running")
+    for s:col in s:colors256
+        exec "hi ".s:col[0]." cterm=".s:col[1]." ctermfg=".s:col[2]." ctermbg=".s:col[3]
+    endfor
+    if v:version >= 700
+        for s:col in s:colorvim7
+            exec "hi ".s:col[0]." cterm=".s:col[1]." ctermfg=".s:col[2]." ctermbg=".s:col[3]
+        endfor
+    endif
+else
+" }}}
+    " color-mapping array {{{
+    " number of vim colors and #html colors equivalent for gui
+    let s:cmap =   [ 
+                \ "#000000", "#800000", "#008000", "#808000", 
+                \ "#000080", "#800080", "#008080", "#c0c0c0", 
+                \ "#808080", "#ff0000", "#00ff00", "#ffff00", 
+                \ "#0000ff", "#ff00ff", "#00ffff", "#ffffff", 
+                \
+                \ "#000000", "#00005f", "#000087", "#0000af", "#0000d7", "#0000ff", 
+                \ "#005f00", "#005f5f", "#005f87", "#005faf", "#005fd7", "#005fff", 
+                \ "#008700", "#00875f", "#008787", "#0087af", "#0087d7", "#0087ff", 
+                \ "#00af00", "#00af5f", "#00af87", "#00afaf", "#00afd7", "#00afff", 
+                \ "#00d700", "#00d75f", "#00d787", "#00d7af", "#00d7d7", "#00d7ff", 
+                \ "#00ff00", "#00ff5f", "#00ff87", "#00ffaf", "#00ffd7", "#00ffff", 
+                \ "#5f0000", "#5f005f", "#5f0087", "#5f00af", "#5f00d7", "#5f00ff", 
+                \ "#5f5f00", "#5f5f5f", "#5f5f87", "#5f5faf", "#5f5fd7", "#5f5fff", 
+                \ "#5f8700", "#5f875f", "#5f8787", "#5f87af", "#5f87d7", "#5f87ff", 
+                \ "#5faf00", "#5faf5f", "#5faf87", "#5fafaf", "#5fafd7", "#5fafff", 
+                \ "#5fd700", "#5fd75f", "#5fd787", "#5fd7af", "#5fd7d7", "#5fd7ff", 
+                \ "#5fff00", "#5fff5f", "#5fff87", "#5fffaf", "#5fffd7", "#5fffff", 
+                \ "#870000", "#87005f", "#870087", "#8700af", "#8700d7", "#8700ff", 
+                \ "#875f00", "#875f5f", "#875f87", "#875faf", "#875fd7", "#875fff", 
+                \ "#878700", "#87875f", "#878787", "#8787af", "#8787d7", "#8787ff", 
+                \ "#87af00", "#87af5f", "#87af87", "#87afaf", "#87afd7", "#87afff", 
+                \ "#87d700", "#87d75f", "#87d787", "#87d7af", "#87d7d7", "#87d7ff", 
+                \ "#87ff00", "#87ff5f", "#87ff87", "#87ffaf", "#87ffd7", "#87ffff", 
+                \ "#af0000", "#af005f", "#af0087", "#af00af", "#af00d7", "#af00ff", 
+                \ "#af5f00", "#af5f5f", "#af5f87", "#af5faf", "#af5fd7", "#af5fff", 
+                \ "#af8700", "#af875f", "#af8787", "#af87af", "#af87d7", "#af87ff", 
+                \ "#afaf00", "#afaf5f", "#afaf87", "#afafaf", "#afafd7", "#afafff", 
+                \ "#afd700", "#afd75f", "#afd787", "#afd7af", "#afd7d7", "#afd7ff", 
+                \ "#afff00", "#afff5f", "#afff87", "#afffaf", "#afffd7", "#afffff", 
+                \ "#d70000", "#d7005f", "#d70087", "#d700af", "#d700d7", "#d700ff", 
+                \ "#d75f00", "#d75f5f", "#d75f87", "#d75faf", "#d75fd7", "#d75fff", 
+                \ "#d78700", "#d7875f", "#d78787", "#d787af", "#d787d7", "#d787ff", 
+                \ "#d7af00", "#d7af5f", "#d7af87", "#d7afaf", "#d7afd7", "#d7afff", 
+                \ "#d7d700", "#d7d75f", "#d7d787", "#d7d7af", "#d7d7d7", "#d7d7ff", 
+                \ "#d7ff00", "#d7ff5f", "#d7ff87", "#d7ffaf", "#d7ffd7", "#d7ffff", 
+                \ "#ff0000", "#ff005f", "#ff0087", "#ff00af", "#ff00d7", "#ff00ff", 
+                \ "#ff5f00", "#ff5f5f", "#ff5f87", "#ff5faf", "#ff5fd7", "#ff5fff", 
+                \ "#ff8700", "#ff875f", "#ff8787", "#ff87af", "#ff87d7", "#ff87ff", 
+                \ "#ffaf00", "#ffaf5f", "#ffaf87", "#ffafaf", "#ffafd7", "#ffafff", 
+                \ "#ffd700", "#ffd75f", "#ffd787", "#ffd7af", "#ffd7d7", "#ffd7ff", 
+                \ "#ffff00", "#ffff5f", "#ffff87", "#ffffaf", "#ffffd7", "#ffffff", 
+                \
+                \ "#080808", "#121212", "#1c1c1c", "#262626", "#303030", "#3a3a3a", 
+                \ "#444444", "#4e4e4e", "#585858", "#606060", "#666666", "#767676", 
+                \ "#808080", "#8a8a8a", "#949494", "#9e9e9e", "#a8a8a8", "#b2b2b2", 
+                \ "#bcbcbc", "#c6c6c6", "#d0d0d0", "#dadada", "#e4e4e4", "#eeeeee" ]
+    " }}}
+" {{{ color setup for gvim
+    for s:col in s:colors256
+        call s:guisetcolor(s:col)
+    endfor
+    if v:version >= 700
+        for s:col in s:colorvim7
+            call s:guisetcolor(s:col)
+        endfor
+    endif
+endif
+" }}}
+let &cpo = s:save_cpo   " restoring &cpo value
+" vim: set fdm=marker fileformat=unix:
diff --git a/vim/colors/camo.vim b/vim/colors/camo.vim
new file mode 100644 (file)
index 0000000..059af42
--- /dev/null
@@ -0,0 +1,76 @@
+" Vim color file
+" Maintainer:   Tim Aldrich <aldy0169@yahoo.com>
+" Last Change:  19 January 2002
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="camo"
+hi Normal       guifg=bisque            guibg=grey15
+hi Cursor       guifg=snow              guibg=bisque3
+hi CursorIM     guifg=OliveDrab4        guibg=bisque
+hi Directory    guifg=OliveDrab4        guibg=grey15
+hi DiffAdd      guifg=DarkOliveGreen1   guibg=grey15
+hi DiffChange   guifg=PaleGreen         guibg=grey15
+hi DiffDelete   guifg=red               guibg=grey15
+hi DiffText     guifg=grey15            guibg=red
+hi ErrorMsg     guifg=snow              guibg=red
+hi VertSplit    guifg=bisque4           guibg=DarkOliveGreen1
+hi Folded       guifg=DarkOliveGreen2   guibg=grey30
+hi FoldColumn   guifg=DarkOliveGreen2   guibg=grey30
+hi IncSearch    guifg=bisque            guibg=red
+hi LineNr       guifg=OliveDrab4        guibg=grey15
+hi ModeMsg      guifg=khaki3            guibg=grey15
+hi MoreMsg      guifg=khaki3            guibg=grey15
+hi NonText      guifg=DarkSalmon        guibg=grey10
+hi Question     guifg=IndianRed         guibg=grey10
+hi Search       guifg=DarkSalmon        guibg=grey15
+hi SpecialKey   guifg=yellow            guibg=grey15
+hi StatusLine   guifg=bisque4           guibg=DarkOliveGreen1
+hi StatusLineNC guifg=bisque4           guibg=DarkOliveGreen3
+hi Title        guifg=IndianRed         guibg=grey15
+hi Visual       guifg=OliveDrab4        guibg=bisque1
+hi WarningMsg   guifg=bisque            guibg=red
+hi WildMenu     guifg=LightBlue         guibg=DarkViolet
+
+
+"Syntax hilight groups
+
+hi Comment      guifg=tan
+hi Constant     guifg=khaki
+hi String       guifg=moccasin
+hi Character    guifg=chocolate
+hi Number       guifg=chocolate
+hi Boolean      guifg=OliveDrab3
+hi Float        guifg=chocolate
+hi Identifier   guifg=khaki4
+hi Function     guifg=OliveDrab4
+hi Statement    guifg=khaki
+hi Conditional  guifg=khaki
+hi Repeat       guifg=khaki
+hi Label        guifg=khaki
+hi Operator     guifg=DarkKhaki
+hi Keyword      guifg=DarkKhaki
+hi Exception    guifg=khaki
+hi PreProc      guifg=khaki4
+hi Include      guifg=khaki4
+hi Define       guifg=khaki1
+hi Macro        guifg=khaki2
+hi PreCondit    guifg=khaki3
+hi Type         guifg=khaki3
+hi StorageClass guifg=tan
+hi Structure    guifg=DarkGoldenrod
+hi Typedef      guifg=khaki3
+hi Special      guifg=IndianRed
+hi SpecialChar  guifg=DarkGoldenrod
+hi Tag          guifg=DarkKhaki
+hi Delimiter    guifg=DarkGoldenrod
+hi SpecialComment   guifg=cornsilk
+hi Debug        guifg=brown
+hi Underlined   guifg=IndianRed
+hi Ignore       guifg=grey30
+hi Error        guifg=bisque    guibg=red
+hi Todo         guifg=red       guibg=bisque
+
diff --git a/vim/colors/candy.vim b/vim/colors/candy.vim
new file mode 100644 (file)
index 0000000..545ff7c
--- /dev/null
@@ -0,0 +1,78 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/04/28 Sun 19:35.
+"     version: 1.0
+" This color scheme uses a dark background.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "candy"
+
+hi Normal       guifg=#f0f0f8 guibg=#000000
+
+" Search
+hi IncSearch    gui=UNDERLINE guifg=#80ffff guibg=#0060c0
+hi Search       gui=NONE guifg=#f0f0f8 guibg=#0060c0
+
+" Messages
+hi ErrorMsg     gui=BOLD guifg=#ffa0ff guibg=NONE
+hi WarningMsg   gui=BOLD guifg=#ffa0ff guibg=NONE
+hi ModeMsg      gui=BOLD guifg=#40f0d0 guibg=NONE
+hi MoreMsg      gui=BOLD guifg=#00ffff guibg=#008070
+hi Question     gui=BOLD guifg=#e8e800 guibg=NONE
+
+" Split area
+hi StatusLine   gui=NONE guifg=#000000 guibg=#c8c8d8
+hi StatusLineNC gui=NONE guifg=#707080 guibg=#c8c8d8
+hi VertSplit    gui=NONE guifg=#606080 guibg=#c8c8d8
+hi WildMenu     gui=NONE guifg=#000000 guibg=#a0a0ff
+
+" Diff
+hi DiffText     gui=NONE guifg=#ff78f0 guibg=#a02860
+hi DiffChange   gui=NONE guifg=#e03870 guibg=#601830
+hi DiffDelete   gui=NONE guifg=#a0d0ff guibg=#0020a0
+hi DiffAdd      gui=NONE guifg=#a0d0ff guibg=#0020a0
+
+" Cursor
+hi Cursor       gui=NONE guifg=#00ffff guibg=#008070
+hi lCursor      gui=NONE guifg=#ffffff guibg=#8800ff
+hi CursorIM     gui=NONE guifg=#ffffff guibg=#8800ff
+
+" Fold
+hi Folded       gui=NONE guifg=#40f0f0 guibg=#005080
+hi FoldColumn   gui=NONE guifg=#40c0ff guibg=#00305c
+
+" Other
+hi Directory    gui=NONE guifg=#40f0d0 guibg=NONE
+hi LineNr       gui=NONE guifg=#9090a0 guibg=NONE
+hi NonText      gui=BOLD guifg=#4080ff guibg=NONE
+hi SpecialKey   gui=BOLD guifg=#8080ff guibg=NONE
+hi Title        gui=BOLD guifg=#f0f0f8 guibg=NONE
+hi Visual       gui=NONE guifg=#e0e0f0 guibg=#707080
+
+" Syntax group
+hi Comment      gui=NONE guifg=#c0c0d0 guibg=NONE
+hi Constant     gui=NONE guifg=#90d0ff guibg=NONE
+hi Error        gui=BOLD guifg=#ffffff guibg=#ff0088
+hi Identifier   gui=NONE guifg=#40f0f0 guibg=NONE
+hi Ignore       gui=NONE guifg=#000000 guibg=NONE
+hi PreProc      gui=NONE guifg=#40f0a0 guibg=NONE
+hi Special      gui=NONE guifg=#e0e080 guibg=NONE
+hi Statement    gui=NONE guifg=#ffa0ff guibg=NONE
+hi Todo         gui=BOLD,UNDERLINE guifg=#ffa0a0 guibg=NONE
+hi Type         gui=NONE guifg=#ffc864 guibg=NONE
+hi Underlined   gui=UNDERLINE guifg=#f0f0f8 guibg=NONE
+
+" HTML
+hi htmlLink                 gui=UNDERLINE
+hi htmlBold                 gui=BOLD
+hi htmlBoldItalic           gui=BOLD,ITALIC
+hi htmlBoldUnderline        gui=BOLD,UNDERLINE
+hi htmlBoldUnderlineItalic  gui=BOLD,UNDERLINE,ITALIC
+hi htmlItalic               gui=ITALIC
+hi htmlUnderline            gui=UNDERLINE
+hi htmlUnderlineItalic      gui=UNDERLINE,ITALIC
diff --git a/vim/colors/candycode.vim b/vim/colors/candycode.vim
new file mode 100644 (file)
index 0000000..3800d9d
--- /dev/null
@@ -0,0 +1,174 @@
+" Vim color file -- candycode
+" Maintainer:   Justin Constantino <goflyapig-at-gmail-com>
+" Last Change:  2006 Aug 12
+
+set background=dark
+highlight clear
+let g:colors_name="candycode"
+
+let save_cpo = &cpo
+set cpo&vim
+
+" basic highlight groups (:help highlight-groups) {{{
+
+" text {{{
+
+hi Normal       guifg=#ffffff       guibg=#050505       gui=NONE
+            \   ctermfg=white       ctermbg=black       cterm=NONE
+
+hi Folded       guifg=#c2bfa5       guibg=#050505       gui=underline
+            \   ctermfg=lightgray   ctermbg=black       cterm=underline
+
+hi LineNr       guifg=#928c75       guibg=NONE          gui=NONE
+            \   ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+
+hi Directory    guifg=#00bbdd       guibg=NONE          gui=NONE
+            \   ctermfg=cyan        ctermbg=NONE        cterm=NONE
+hi NonText      guifg=#77ff22       guibg=NONE          gui=bold
+            \   ctermfg=yellow      ctermbg=NONE        cterm=NONE
+hi SpecialKey   guifg=#559933       guibg=NONE          gui=NONE
+            \   ctermfg=green       ctermbg=NONE        cterm=NONE
+
+hi SpellBad     guifg=NONE          guibg=NONE          gui=undercurl
+            \   ctermfg=white       ctermbg=darkred     guisp=#ff0011
+hi SpellCap     guifg=NONE          guibg=NONE          gui=undercurl
+            \   ctermfg=white       ctermbg=darkblue    guisp=#0044ff
+hi SpellLocal   guifg=NONE          guibg=NONE          gui=undercurl
+            \   ctermfg=black       ctermbg=cyan        guisp=#00dd99   
+hi SpellRare    guifg=NONE          guibg=NONE          gui=undercurl
+            \   ctermfg=white       ctermbg=darkmagenta guisp=#ff22ee   
+
+hi DiffAdd      guifg=#ffffff       guibg=#126493       gui=NONE
+            \   ctermfg=white       ctermbg=darkblue    cterm=NONE
+hi DiffChange   guifg=#000000       guibg=#976398       gui=NONE
+            \   ctermfg=black       ctermbg=darkmagenta cterm=NONE
+hi DiffDelete   guifg=#000000       guibg=#be1923       gui=bold
+            \   ctermfg=black       ctermbg=red         cterm=bold
+hi DiffText     guifg=#ffffff       guibg=#976398       gui=bold
+            \   ctermfg=white       ctermbg=green       cterm=bold
+
+" }}}
+" borders / separators / menus {{{
+
+hi FoldColumn   guifg=#c8bcb9       guibg=#786d65       gui=bold            
+            \   ctermfg=lightgray   ctermbg=darkgray    cterm=NONE
+hi SignColumn   guifg=#c8bcb9       guibg=#786d65       gui=bold
+            \   ctermfg=lightgray   ctermbg=darkgray    cterm=NONE
+
+hi Pmenu        guifg=#000000       guibg=#a6a190       gui=NONE
+            \   ctermfg=white       ctermbg=darkgray    cterm=NONE
+hi PmenuSel     guifg=#ffffff       guibg=#133293       gui=NONE
+            \   ctermfg=white       ctermbg=lightblue   cterm=NONE
+hi PmenuSbar    guifg=NONE          guibg=#555555       gui=NONE
+            \   ctermfg=black       ctermbg=black       cterm=NONE
+hi PmenuThumb   guifg=NONE          guibg=#cccccc       gui=NONE
+            \   ctermfg=gray        ctermbg=gray        cterm=NONE
+
+hi StatusLine   guifg=#000000       guibg=#c2bfa5       gui=bold    
+            \   ctermfg=black       ctermbg=white       cterm=bold
+hi StatusLineNC guifg=#444444       guibg=#c2bfa5       gui=NONE    
+            \   ctermfg=darkgray    ctermbg=white       cterm=NONE
+hi WildMenu     guifg=#ffffff       guibg=#133293       gui=bold
+            \   ctermfg=white       ctermbg=darkblue    cterm=bold
+hi VertSplit    guifg=#c2bfa5       guibg=#c2bfa5       gui=NONE
+            \   ctermfg=white       ctermbg=white       cterm=NONE
+
+hi TabLine      guifg=#000000       guibg=#c2bfa5       gui=NONE
+            \   ctermfg=black       ctermbg=white       cterm=NONE
+hi TabLineFill  guifg=#000000       guibg=#c2bfa5       gui=NONE
+            \   ctermfg=black       ctermbg=white       cterm=NONE
+hi TabLineSel   guifg=#ffffff       guibg=#133293       gui=NONE
+            \   ctermfg=white       ctermbg=black       cterm=NONE
+
+"hi Menu
+"hi Scrollbar
+"hi Tooltip
+
+" }}}
+" cursor / dynamic / other {{{
+
+hi Cursor       guifg=#000000       guibg=#ffff99       gui=NONE
+            \   ctermfg=black       ctermbg=white       cterm=NONE
+hi CursorIM     guifg=#000000       guibg=#aaccff       gui=NONE
+            \   ctermfg=black       ctermbg=white       cterm=reverse
+hi CursorLine   guifg=NONE          guibg=#1b1b1b       gui=NONE
+            \   ctermfg=NONE        ctermbg=NONE        cterm=NONE
+hi CursorColumn guifg=NONE          guibg=#1b1b1b       gui=NONE
+            \   ctermfg=NONE        ctermbg=NONE        cterm=NONE
+
+hi Visual       guifg=#ffffff       guibg=#606070       gui=NONE
+            \   ctermfg=white       ctermbg=lightblue   cterm=NONE
+
+hi IncSearch    guifg=#000000       guibg=#eedd33       gui=bold 
+            \   ctermfg=white       ctermbg=yellow      cterm=NONE
+hi Search       guifg=#efefd0       guibg=#937340       gui=NONE
+            \   ctermfg=white       ctermbg=darkgreen   cterm=NONE
+
+hi MatchParen   guifg=NONE          guibg=#3377aa       gui=NONE
+            \   ctermfg=white       ctermbg=blue        cterm=NONE
+
+"hi VisualNOS
+
+" }}}
+" listings / messages {{{
+
+hi ModeMsg      guifg=#eecc18       guibg=NONE          gui=NONE
+            \   ctermfg=yellow      ctermbg=NONE        cterm=NONE
+hi Title        guifg=#dd4452       guibg=NONE          gui=bold
+            \   ctermfg=red         ctermbg=NONE        cterm=bold
+hi Question     guifg=#66d077       guibg=NONE          gui=NONE
+            \   ctermfg=green       ctermbg=NONE        cterm=NONE
+hi MoreMsg      guifg=#39d049       guibg=NONE          gui=NONE
+            \   ctermfg=green       ctermbg=NONE        cterm=NONE
+
+hi ErrorMsg     guifg=#ffffff       guibg=#ff0000       gui=bold
+            \   ctermfg=white       ctermbg=red         cterm=bold
+hi WarningMsg   guifg=#ccae22       guibg=NONE          gui=bold    
+            \   ctermfg=yellow      ctermbg=NONE        cterm=bold
+
+" }}}
+
+" }}}
+" syntax highlighting groups (:help group-name) {{{
+
+hi Comment      guifg=#ff9922       guibg=NONE          gui=NONE
+            \   ctermfg=brown       ctermbg=NONE        cterm=NONE
+
+hi Constant     guifg=#ff6050       guibg=NONE          gui=NONE
+            \   ctermfg=red         ctermbg=NONE        cterm=NONE
+hi Boolean      guifg=#ff6050       guibg=NONE          gui=bold  
+            \   ctermfg=red         ctermbg=NONE        cterm=bold
+
+hi Identifier   guifg=#eecc44       guibg=NONE          gui=NONE
+            \   ctermfg=yellow      ctermbg=NONE        cterm=NONE
+
+hi Statement    guifg=#66d077       guibg=NONE          gui=bold
+            \   ctermfg=green       ctermbg=NONE        cterm=bold
+
+hi PreProc      guifg=#bb88dd       guibg=NONE          gui=NONE
+            \   ctermfg=darkmagenta ctermbg=NONE        cterm=NONE
+
+hi Type         guifg=#4093cc       guibg=NONE          gui=bold
+            \   ctermfg=lightblue   ctermbg=NONE        cterm=bold
+
+hi Special      guifg=#9999aa       guibg=NONE          gui=bold  
+            \   ctermfg=lightgray   ctermbg=NONE        cterm=bold
+
+hi Underlined   guifg=#80a0ff       guibg=NONE          gui=underline
+            \   ctermfg=NONE        ctermbg=NONE        cterm=underline
+            \   term=underline 
+
+hi Ignore       guifg=#888888       guibg=NONE          gui=NONE
+            \   ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+
+hi Error        guifg=#ffffff       guibg=#ff0000       gui=NONE
+            \   ctermfg=white       ctermbg=red         cterm=NONE
+
+hi Todo         guifg=#ffffff       guibg=#ee7700       gui=bold
+            \   ctermfg=black       ctermbg=yellow      cterm=bold
+
+" }}}
+
+let &cpo = save_cpo
+
+" vim: fdm=marker fdl=0
diff --git a/vim/colors/chela_light.vim b/vim/colors/chela_light.vim
new file mode 100644 (file)
index 0000000..3cde34d
--- /dev/null
@@ -0,0 +1,110 @@
+" Vim color file
+"
+" Maintainer:   Stefan Karlsson <stefan.74@comhem.se>
+" Last Change:  8 August 2006
+
+
+set background=light
+
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name="chela_light"
+
+
+"Syntax Groups =============================================
+
+hi comment      guibg=#fafafa   guifg=#339900   gui=none
+
+hi constant     guibg=#fafafa   guifg=#cc2222   gui=none
+
+hi identifier   guibg=#fafafa   guifg=#2222ff   gui=none
+
+hi statement    guibg=#fafafa   guifg=#2222ff   gui=none
+
+hi preproc      guibg=#fafafa   guifg=#2222ff   gui=none
+hi precondit    guibg=#fafafa   guifg=#cc00cc   gui=none
+
+hi type         guibg=#fafafa   guifg=#2222ff   gui=none
+
+hi special      guibg=#fafafa   guifg=#cc00cc   gui=none
+hi specialchar  guibg=#fafafa   guifg=#cc2222   gui=underline
+
+hi underlined   guibg=#fafafa   guifg=#2222ff   gui=underline
+
+hi error        guibg=#ff2222   guifg=#ffffff   gui=none
+
+hi todo         guibg=#339933   guifg=#ffffff   gui=none
+
+
+"General Groups ============================================
+
+hi cursor       guibg=#000000   guifg=#ffffff   gui=none
+"  cursorim?
+hi cursorcolumn guibg=#eeeeee                   gui=none
+hi cursorline   guibg=#eeeeee                   gui=none
+
+hi directory    guibg=#fafafa   guifg=#2222ff   gui=none
+
+hi diffadd      guibg=#66ff66   guifg=#000000   gui=none
+hi diffchange   guibg=#ffff00   guifg=#cccc99   gui=none
+hi diffdelete   guibg=#ff6666   guifg=#ff6666   gui=none
+hi difftext     guibg=#ffff00   guifg=#000000   gui=none
+
+hi errormsg     guibg=#ff2222   guifg=#ffffff   gui=none
+
+hi vertsplit    guibg=#2222ff   guifg=#2222ff   gui=none
+
+hi folded       guibg=#eeeeee   guifg=#2222ff   gui=none
+hi foldcolumn   guibg=#eeeeee   guifg=#999999   gui=none
+
+"  signcolumn?
+
+hi incsearch    guibg=#ffbb00   guifg=#000000   gui=none
+
+hi linenr       guibg=#fafafa   guifg=#cccccc   gui=none
+
+hi matchparen   guibg=#cccccc                   gui=none
+
+hi modemsg      guibg=#fafafa   guifg=#999999   gui=none
+
+hi moremsg      guibg=#339900   guifg=#ffffff   gui=none
+
+hi nontext      guibg=#fafafa   guifg=#999999   gui=none
+
+hi normal       guibg=#fafafa   guifg=#222222   gui=none
+
+hi pmenu        guibg=#cccccc   guifg=#222222   gui=none
+hi pmenusel     guibg=#2222ff   guifg=#ffffff   gui=none
+"  pmenusbar?
+"  pmenuthumb?
+
+hi question     guibg=#339900   guifg=#ffffff   gui=none
+
+hi search       guibg=#ffff00   guifg=#000000   gui=none
+
+hi specialkey   guibg=#fafafa   guifg=#cc00cc   gui=none
+
+hi spellbad                                     gui=undercurl guisp=#ff2222
+hi spellcap                                     gui=undercurl guisp=#ff2222
+hi spelllocal                                   gui=undercurl guisp=#cc2222
+hi spellrare                                    gui=undercurl guisp=#22cc22
+
+hi statusline   guibg=#2222ff   guifg=#ffffff   gui=none
+hi statuslinenc guibg=#2222ff   guifg=#999999   gui=none
+
+hi tabline      guibg=#cccccc   guifg=#222222   gui=none
+hi tablinesel   guibg=#2222ff   guifg=#ffffff   gui=none
+hi tablinefill  guibg=#aaaaaa   guifg=#aaaaaa   gui=none
+
+hi title        guibg=#fafafa   guifg=#6666ff   gui=none
+
+hi visual       guibg=#cccccc   guifg=#333333   gui=none
+"  visualnos?
+
+hi warningmsg   guibg=#fafafa   guifg=#ff0000   gui=none
+
+hi wildmenu     guibg=#339900   guifg=#ffffff   gui=none
+
diff --git a/vim/colors/chocolateliquor.vim b/vim/colors/chocolateliquor.vim
new file mode 100644 (file)
index 0000000..9dfa712
--- /dev/null
@@ -0,0 +1,36 @@
+" Vim color file
+" Maintainer:   Gerald S. Williams
+" Last Change:  2007 Jun 13
+
+" This started as a dark version (perhaps opposite is a better term) of
+" PapayaWhip, but took on a life of its own. Easy on the eyes, but still has
+" good contrast. Not bad on a color terminal, either (especially if yours
+" default to PapayaWhip text on a ChocolateLiquor/#3f1f1f background).
+"
+" Only values that differ from defaults are specified.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "ChocolateLiquor"
+
+hi Normal guibg=#3f1f1f guifg=PapayaWhip ctermfg=White
+hi NonText guibg=#1f0f0f guifg=Brown2 ctermfg=Brown ctermbg=Black
+hi LineNr guibg=#1f0f0f guifg=Brown2
+hi DiffDelete guibg=DarkRed guifg=White ctermbg=DarkRed ctermfg=White
+hi DiffAdd guibg=DarkGreen guifg=White ctermbg=DarkGreen ctermfg=White
+hi DiffText gui=NONE guibg=DarkCyan guifg=Yellow ctermbg=DarkCyan ctermfg=Yellow
+hi DiffChange guibg=DarkCyan guifg=White ctermbg=DarkCyan ctermfg=White
+hi Constant ctermfg=Red
+hi Comment guifg=LightBlue3
+hi PreProc guifg=Plum ctermfg=Magenta
+hi StatusLine guibg=White guifg=Sienna4 cterm=NONE ctermfg=Black ctermbg=Brown
+hi StatusLineNC gui=NONE guifg=Black guibg=Gray ctermbg=Black ctermfg=Gray
+hi VertSplit guifg=Gray
+hi Search guibg=Gold3 ctermfg=Blue
+hi Type gui=NONE guifg=DarkSeaGreen2
+hi Statement gui=NONE guifg=Gold3
+hi FoldColumn guibg=#1f0f0f ctermfg=Cyan ctermbg=Black
+hi Folded guibg=grey20 ctermfg=Cyan ctermbg=Black
diff --git a/vim/colors/clarity.vim b/vim/colors/clarity.vim
new file mode 100644 (file)
index 0000000..3440ba3
--- /dev/null
@@ -0,0 +1,52 @@
+" Vim color - Clarity
+"  
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="clarity"
+
+highlight Normal         gui=NONE guifg=LightBlue2   guibg=#1F3055
+highlight Comment        gui=NONE guifg=Grey62       guibg=bg 
+highlight PreProc        gui=NONE guifg=Salmon       guibg=bg 
+highlight Precondit      gui=NONE guifg=Khaki3       guibg=bg
+highlight Identifier     gui=NONE guifg=Khaki3       guibg=bg 
+highlight Type           gui=BOLD guifg=Orange       guibg=bg 
+highlight StorageClass   gui=BOLD guifg=Cornsilk2    guibg=bg
+highlight Todo           gui=BOLD guifg=#1F3055      guibg=White 
+highlight NonText        gui=NONE guifg=#334C51      guibg=SteelBlue4 
+highlight LineNr         gui=NONE guifg=HoneyDew2    guibg=Grey25 
+highlight StatusLineNC   gui=NONE guifg=Grey80       guibg=LightBlue4 
+highlight StatusLine     gui=NONE guifg=DarkBlue     guibg=#FFFFCA 
+highlight IncSearch      gui=NONE guifg=Black        guibg=#FFE568
+highlight Search         gui=UNDERLINE,BOLD          guifg=#FFE568 guibg=bg
+highlight Cursor         gui=NONE guifg=Grey50       guibg=#FFE568
+highlight CursorIM       gui=NONE guifg=Grey50       guibg=#FFE568
+highlight Title          gui=BOLD guifg=OliveDrab3   guibg=bg
+highlight WarningMsg     gui=BOLD guifg=White        guibg=Red4
+highlight String         gui=NONE guifg=Grey80       guibg=bg      
+highlight Number         gui=NONE guifg=OliveDrab2   guibg=bg
+highlight Constant       gui=NONE guifg=#ACEDAB      guibg=bg 
+highlight Visual         gui=BOLD guifg=White        guibg=bg
+highlight Directory      gui=NONE guifg=PeachPuff    guibg=bg
+highlight DiffAdd        gui=NONE guifg=white        guibg=SeaGreen
+highlight DiffChange     gui=BOLD guifg=white        guibg=Blue
+highlight DiffDelete     gui=NONE guifg=Grey40       guibg=Grey20 
+highlight DiffText       gui=BOLD guifg=HoneyDew1    guibg=FireBrick 
+highlight Typedef        gui=NONE guifg=Cornsilk     guibg=bg
+highlight Define         gui=NONE guifg=White        guibg=bg
+highlight Tag            gui=NONE guifg=LightBlue2   guibg=bg
+highlight Debug          gui=BOLD guifg=Green        guibg=bg
+highlight Special        gui=NONE guifg=NavajoWhite  guibg=bg         
+highlight SpecialChar    gui=NONE guifg=NavajoWhite  guibg=bg         
+highlight Delimiter      gui=NONE guifg=NavajoWhite  guibg=bg         
+highlight SpecialComment gui=NONE guifg=NavajoWhite3 guibg=bg         
+highlight Conditional    gui=BOLD guifg=Wheat2       guibg=bg         
+highlight Statement      gui=BOLD guifg=Pink3        guibg=bg 
+highlight WildMenu       gui=NONE guifg=White        guibg=FireBrick
+highlight browseSuffixes gui=NONE guifg=Cornsilk3    guibg=bg
+
+
+
diff --git a/vim/colors/cleanphp.vim b/vim/colors/cleanphp.vim
new file mode 100644 (file)
index 0000000..c0af691
--- /dev/null
@@ -0,0 +1,81 @@
+" Vim color file
+" Maintainer:  Billy McIntosh <billymcintosh@ntlworld.com>
+" Last Change: June 24, 2003
+" Licence:         Public Domain
+
+" This package offers a eye-catching color scheme for PHP syntax
+
+" First remove all existing highlighting.
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "cleanphp"
+
+hi Normal guifg=#008000 guibg=#d3e4f8
+
+hi ErrorMsg guibg=#d3e4f8 guifg=Red
+hi IncSearch gui=reverse
+hi ModeMsg gui=bold
+hi StatusLine gui=reverse,bold
+hi StatusLineNC gui=reverse
+hi VertSplit gui=reverse
+hi Visual gui=reverse guifg=#c0c0c0 guibg=fg
+hi VisualNOS gui=underline,bold
+hi DiffText gui=bold guibg=Red
+hi Cursor guibg=Black guifg=NONE
+hi lCursor guibg=Black guifg=NONE
+hi Directory guifg=#ff8040
+hi LineNr guifg=#008000
+hi MoreMsg gui=bold guifg=SeaGreen
+hi NonText gui=bold guifg=#ff8040 guibg=#d3e4f8
+hi Question gui=bold guifg=Black
+hi Search guibg=#008000 guifg=NONE
+hi SpecialKey guifg=#ff8040
+hi Title gui=bold guifg=Magenta
+hi WarningMsg guifg=Red
+hi WildMenu guibg=Cyan guifg=#d3e4f8
+hi Folded guibg=White guifg=Darkblue
+hi FoldColumn guibg=#c0c0c0 guifg=Darkblue
+hi DiffAdd guibg=Lightblue
+hi DiffChange guibg=LightMagenta
+hi DiffDelete gui=bold guifg=#ff8040 guibg=LightCyan
+
+hi Comment guifg=#ff8040 guibg=#d3e4f8
+hi Constant guifg=#BB0000 guibg=#d3e4f8
+hi PreProc guifg=#008080 guibg=#d3e4f8
+hi Statement gui=NONE guifg=#008000 guibg=#d3e4f8
+hi Special guifg=#008080 guibg=#d3e4f8
+hi Ignore guifg=#c0c0c0
+hi Identifier guifg=#000080 guibg=#d3e4f8
+hi Type guifg=#00BB00 guibg=#d3e4f8
+
+hi link IncSearch              Visual
+hi link String                 Constant
+hi link Character              Constant
+hi link Number                 Constant
+hi link Boolean                        Constant
+hi link Float                  Number
+hi link Function               Identifier
+hi link Conditional            Statement
+hi link Repeat                 Statement
+hi link Label                  Statement
+hi link Operator               Statement
+hi link Keyword                        Statement
+hi link Exception              Statement
+hi link Include                        PreProc
+hi link Define                 PreProc
+hi link Macro                  PreProc
+hi link PreCondit              PreProc
+hi link StorageClass   Type
+hi link Structure              Type
+hi link Typedef                        Type
+hi link Tag                            Special
+hi link SpecialChar            Special
+hi link Delimiter              Special
+hi link SpecialComment Special
+hi link Debug                  Special
+
+" vim: sw=2
\ No newline at end of file
diff --git a/vim/colors/colorer.vim b/vim/colors/colorer.vim
new file mode 100644 (file)
index 0000000..30e1277
--- /dev/null
@@ -0,0 +1,79 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer:  Sergey V. Beduev <shaman@interdon.net>
+" Last Change: Sun Mar 28 11:19:38 EEST 2004
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "colorer"
+
+hi Normal              ctermfg=Gray guifg=DarkGray guibg=black
+hi Visual              ctermfg=DarkCyan guibg=black guifg=DarkCyan
+hi Comment             ctermfg=Brown guifg=#B46918     gui=NONE
+hi PerlPOD             ctermfg=Brown guifg=#B86A18     gui=NONE
+hi Constant            ctermfg=White guifg=White gui=NONE
+hi Charachter      ctermfg=Yellow guifg=Yellow gui=NONE
+hi String           ctermfg=Yellow guifg=Yellow        gui=NONE
+hi Number              ctermfg=White guifg=White gui=NONE
+hi Boolean             ctermfg=Cyan guifg=DarkGray     gui=NONE
+hi Special             ctermfg=DarkMagenta     guifg=Red gui=NONE
+hi Define              ctermfg=LightMagenta guifg=Magenta gui=NONE
+hi Identifier      ctermfg=Green guifg=Green gui=NONE
+hi Exception       ctermfg=White guifg=White gui=NONE
+hi Statement       ctermfg=White guifg=White gui=NONE
+hi Label               ctermfg=White guifg=White gui=NONE
+hi Keyword             ctermfg=White guifg=White gui=NONE
+hi PreProc             ctermfg=Green guifg=Green gui=NONE
+hi Type                        ctermfg=LightGreen guifg=Green gui=NONE
+hi Function            ctermfg=White guifg=White gui=NONE
+hi Repeat              ctermfg=White guifg=White gui=NONE
+hi Operator            ctermfg=White guifg=White gui=NONE
+hi Ignore              ctermfg=black guifg=bg
+hi Folded           ctermbg=LightBlue ctermfg=Gray guibg=DarkBlue guifg=DarkGray gui=NONE
+hi Error               term=reverse ctermbg=Red ctermfg=White guibg=darkRed guifg=White gui=NONE
+hi Todo                        term=standout ctermbg=Yellow ctermfg=Black guifg=Black guibg=#AD5500 gui=NONE
+hi Done                        term=standout ctermbg=Gray ctermfg=White guifg=White guibg=Gray gui=NONE
+
+hi SpellErrors      ctermfg=DarkRed guifg=Black        gui=NONE
+
+hi MailQ            ctermfg=darkcyan guibg=black       gui=NONE
+hi MailQu           ctermfg=darkgreen guibg=black      gui=NONE
+hi MyDiffNew       ctermfg=magenta guifg=red   gui=NONE
+hi MyDiffCommLine   ctermfg=white      ctermbg=red     guifg=white guibg=darkred gui=NONE
+hi MyDiffRemoved    ctermfg=LightRed guifg=red gui=NONE
+hi MyDiffSubName    ctermfg=DarkCyan guifg=Cyan gui=NONE
+hi MyDiffNormal            ctermbg=White ctermfg=black guibg=White guifg=black gui=NONE
+hi MoreMsg          gui=NONE
+hi ModeMsg          gui=NONE
+hi Title            gui=NONE
+hi NonText          gui=NONE
+hi DiffDelete       gui=NONE
+hi DiffText         gui=NONE
+hi StatusLine       guifg=black guibg=gray gui=NONE
+hi Question         gui=NONE
+" Common groups that link to default highlighting.
+" You can specify other highlighting easily.
+"hi link String        Constant
+"hi link Character     Constant
+"hi link Number                Constant
+"hi link Boolean       Constant
+hi link Float          Number
+hi link Conditional    Repeat
+hi link Include                PreProc
+hi link Structure      Define
+hi link Macro          PreProc
+hi link PreCondit      PreProc
+hi link StorageClass   Type
+hi link Structure      Type
+hi link Typedef                Type
+hi link Tag            Special
+hi link SpecialChar    Special
+hi link Delimiter      Normal
+hi link SpecialComment         Special
+hi link Debug          Special
+
diff --git a/vim/colors/dante.vim b/vim/colors/dante.vim
new file mode 100644 (file)
index 0000000..f584889
--- /dev/null
@@ -0,0 +1,83 @@
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" File: "/home/caciano/.vim/dante.vim"
+" Created: "Thu, 23 May 2002 00:12:20 -0300 (caciano)"
+" Updated: "Sat, 24 Aug 2002 14:04:21 -0300 (caciano)"
+" Copyright (C) 2002, Caciano Machado <caciano@inf.ufrgs.br>
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Colorscheme Option:
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+hi clear
+if exists("syntax on")
+       syntax reset
+endif
+let g:colors_name = "dante"
+
+" General colors
+hi Normal      ctermfg=gray guifg=peachpuff3 guibg=black
+hi Directory   term=bold ctermfg=blue guifg=royalblue
+hi ErrorMsg    term=standout ctermfg=white ctermbg=red guifg=white guibg=red3
+hi NonText     term=bold ctermfg=darkgray guibg=gray3 guifg=gray20
+hi SpecialKey  term=bold ctermfg=darkgray guifg=gray30
+hi LineNr      term=underline ctermfg=darkgray guifg=ivory4 guibg=gray4
+hi IncSearch   term=reverse cterm=reverse gui=reverse,bold guifg=darkgoldenrod2
+hi Search      term=reverse ctermfg=black ctermbg=yellow guifg=gray10 guibg=gold2
+hi Visual      term=bold,reverse cterm=bold,reverse ctermfg=gray ctermbg=black gui=bold,reverse guifg=gray40 guibg=black
+hi VisualNOS   term=bold,underline cterm=bold,underline gui=bold,underline
+hi MoreMsg     term=bold ctermfg=green gui=bold guifg=olivedrab1
+hi ModeMsg     term=bold cterm=bold gui=bold
+hi Question    term=standout ctermfg=green gui=bold guifg=olivedrab1
+hi WarningMsg  term=standout ctermfg=red gui=bold guifg=red3
+hi WildMenu    term=standout ctermfg=black ctermbg=yellow guifg=black guibg=gold2
+hi Folded      term=standout ctermfg=blue ctermbg=white guifg=royalblue1 guibg=white
+hi FoldColumn  term=standout ctermfg=blue ctermbg=white guifg=royalblue3 guibg=white
+hi DiffAdd     term=bold ctermbg=blue guibg=royalblue2
+hi DiffChange  term=bold ctermbg=darkmagenta guibg=maroon
+hi DiffDelete  term=bold cterm=bold ctermfg=lightblue ctermbg=cyan gui=bold guifg=lightblue guibg=cyan4
+hi DiffText    term=reverse cterm=bold ctermbg=red gui=bold guibg=red3
+hi Cursor      guifg=bg guibg=fg
+hi lCursor     guifg=bg guibg=fg
+hi StatusLine  term=reverse cterm=reverse gui=reverse guifg=gray60
+hi StatusLineNC        term=reverse cterm=reverse gui=reverse guifg=gray40
+hi VertSplit   term=reverse cterm=reverse gui=bold,reverse guifg=gray40
+hi Title       term=bold ctermfg=magenta gui=bold guifg=aquamarine
+
+" syntax hi colors
+hi Comment     term=bold ctermfg=darkcyan guifg=cyan4
+hi PreProc     term=underline ctermfg=darkblue guifg=dodgerblue4
+hi Constant    term=underline ctermfg=darkred guifg=firebrick3
+hi Type                term=underline ctermfg=darkgreen gui=none guifg=chartreuse3
+hi Statement   term=bold ctermfg=darkyellow gui=none guifg=gold3
+hi Identifier  term=underline ctermfg=darkgreen guifg=darkolivegreen4
+hi Ignore      term=bold ctermfg=darkgray guifg=gray45
+hi Special     term=underline ctermfg=brown guifg=sienna
+hi Error       term=reverse ctermfg=gray ctermbg=red guifg=gray guibg=red3
+hi Todo                term=standout ctermfg=black ctermbg=yellow gui=bold guifg=gray10 guibg=yellow4
+hi Underlined  term=underline cterm=underline ctermfg=darkblue gui=underline guifg=slateblue
+hi Number      term=underline ctermfg=darkred guifg=red2
+" syntax hi links
+hi link String         Constant
+hi link Character      Constant
+hi link Number         Constant
+hi link Boolean                Constant
+hi link Float          Number
+hi link Function       Identifier
+hi link Number         Constant
+hi link Conditional    Statement
+hi link Repeat         Statement
+hi link Label          Statement
+hi link Keyword                Statement
+hi link Exception      Statement
+hi link Operator       Statement
+hi link Include                PreProc
+hi link Define         PreProc
+hi link Macro          PreProc
+hi link PreCondit      PreProc
+hi link StorageClass   Type
+hi link Structure      Type
+hi link Typedef                Type
+hi link Tag            Special
+hi link SpecialChar    Special
+hi link Delimiter      Special
+hi link SpecialComment Special
+hi link Debug          Special
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
diff --git a/vim/colors/darkZ.vim b/vim/colors/darkZ.vim
new file mode 100644 (file)
index 0000000..246f69a
--- /dev/null
@@ -0,0 +1,91 @@
+" Vim color file
+" Create by Andy
+" QQ24375048
+
+set background=dark
+if version > 580
+    hi clear
+    if exists("syntax_on")
+       syntax reset
+    endif
+endif
+let g:colors_name="darkZ"
+
+hi Normal      guifg=#DFD6C1 guibg=gray14 gui=none
+
+" highlight groups
+hi Cursor       guifg=black          guibg=yellow              gui=none
+hi ErrorMsg     guifg=white          guibg=red                 gui=none
+hi VertSplit    guifg=gray40         guibg=gray40              gui=none
+hi Folded       guifg=DarkSlateGray3 guibg=grey30              gui=none
+hi FoldColumn   guifg=tan            guibg=grey30              gui=none
+hi IncSearch    guifg=#b0ffff        guibg=#2050d0
+hi LineNr       guifg=burlywood3     gui=none
+hi ModeMsg      guifg=SkyBlue        gui=none
+hi MoreMsg      guifg=SeaGreen       gui=none
+hi NonText      guifg=cyan           gui=none
+hi Question     guifg=springgreen    gui=none
+hi Search       guifg=gray80         guibg=#445599             gui=none
+hi SpecialKey   guifg=cyan           gui=none
+hi StatusLine   guifg=black          guibg=Pink                gui=bold
+hi StatusLineNC guifg=grey           guibg=gray40              gui=none
+hi Title        guifg=#ff4400        gui=none                  gui=bold
+hi Visual       guifg=gray17         guibg=tan1                        gui=none
+hi WarningMsg   guifg=salmon         gui=none
+hi Pmenu        guifg=white          guibg=#445599             gui=none
+hi PmenuSel     guifg=#445599        guibg=gray
+hi WildMenu     guifg=gray           guibg=gray17              gui=none
+hi MatchParen  guifg=cyan           guibg=#6C6C6C              gui=bold
+hi DiffAdd      guifg=black          guibg=wheat1
+hi DiffChange   guifg=black          guibg=skyblue1
+hi DiffText     guifg=black          guibg=hotpink1            gui=none
+hi DiffDelete   guibg=gray45         guifg=black               gui=none
+
+" syntax highlighting groups
+hi Comment      guifg=gray50         gui=italic
+hi Constant     guifg=#FF77FF        gui=none
+hi Identifier   guifg=#6FDEF8        gui=none
+hi Function     guifg=#82EF2A        gui=none
+hi Statement    guifg=#FCFC63        gui=none
+hi PreProc      guifg=#82EF2A        gui=none
+hi Type         guifg=#33AFF3        gui=none
+hi Special      guifg=orange          gui=none
+hi Ignore       guifg=red            gui=none
+hi Todo         guifg=red            guibg=yellow2     gui=none
+
+" color terminal definitions
+hi SpecialKey   ctermfg=red
+hi NonText      cterm=bold           ctermfg=darkblue
+hi Directory    ctermfg=darkcyan
+hi ErrorMsg     cterm=bold           ctermfg=7         ctermbg=1
+hi IncSearch    cterm=NONE           ctermfg=yellow    ctermbg=green
+hi Search       cterm=NONE           ctermfg=white     ctermbg=grey
+hi MoreMsg      ctermfg=darkgreen
+hi ModeMsg      cterm=NONE           ctermfg=brown
+hi LineNr       ctermfg=3
+hi Question     ctermfg=green
+hi StatusLine   cterm=bold,reverse
+hi StatusLineNC cterm=reverse
+hi VertSplit    cterm=reverse
+hi Title        ctermfg=5
+hi Visual       cterm=reverse
+hi VisualNOS    cterm=bold,underline
+hi WarningMsg   ctermfg=1
+hi WildMenu     ctermfg=0            ctermbg=3
+hi Folded       ctermfg=darkgrey     ctermbg=NONE
+hi FoldColumn   ctermfg=darkgrey     ctermbg=NONE
+hi DiffAdd      ctermbg=4
+hi DiffChange   ctermbg=5
+hi DiffDelete   cterm=bold           ctermfg=4         ctermbg=6
+hi DiffText     cterm=bold           ctermbg=1
+hi Comment      ctermfg=darkcyan
+hi Constant     ctermfg=brown
+hi Special      ctermfg=5
+hi Identifier   ctermfg=6
+hi Statement    ctermfg=3
+hi PreProc      ctermfg=5
+hi Type         ctermfg=2
+hi Underlined   cterm=underline      ctermfg=5
+hi Ignore       ctermfg=darkgrey
+hi Error        cterm=bold           ctermfg=7         ctermbg=1
+
diff --git a/vim/colors/darkblue2.vim b/vim/colors/darkblue2.vim
new file mode 100644 (file)
index 0000000..eee2cc7
--- /dev/null
@@ -0,0 +1,105 @@
+" Vim color file
+" Maintainer: Datila Carvalho <datila@hotmail.com>
+" Last Change: May, 19, 2005
+" Version: 0.2
+
+" This is a VIM's version of the emacs color theme
+" _Dark Blue2_ created by Chris McMahan.
+
+""" Init stuff
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let g:colors_name = "darkblue2"
+
+
+""" Colors
+
+" GUI colors
+hi Cursor               guifg=#233b5a guibg=Yellow
+hi CursorIM             guifg=NONE guibg=Yellow
+hi Directory            gui=bold guifg=cyan
+"hi DiffAdd
+"hi DiffChange
+"hi DiffDelete
+hi DiffText             guibg=grey50
+hi ErrorMsg             gui=bold guifg=White guibg=gray85
+hi VertSplit            gui=bold guifg=NONE guibg=gray80
+"hi Folded
+"hi FoldColumn
+"hi IncSearch
+hi LineNr                              gui=bold guifg=lightsteelblue guibg=#132b4a
+hi ModeMsg              gui=bold
+"hi MoreMsg
+"hi NonText
+hi Normal               guibg=#233b5a guifg=#fff8dc
+"hi Question
+hi Search               gui=bold guifg=#233b5a guibg=lightgoldenrod
+"hi SpecialKey
+hi StatusLine           guifg=steelblue4 guibg=lightgray 
+hi StatusLineNC         guifg=royalblue4 guibg=lightsteelblue
+"hi Title
+hi Visual               guifg=steelblue guibg=fg
+hi VisualNOS            gui=bold guifg=steelblue guibg=fg
+hi WarningMsg           guifg=White guibg=Tomato
+"hi WildMenu
+
+hi User2                               guifg=lightskyblue guibg=#021a39 gui=bold
+
+" If using Motif/Athena
+hi Menu                 guibg=#233b5a guifg=#fff8dc
+hi Scrollbar            guibg=bg
+
+" Colors for syntax highlighting
+hi Comment              gui=italic guifg=mediumaquamarine
+
+hi Constant             gui=bold guifg=lightgoldenrod1
+    hi String           guifg=aquamarine
+    hi Character        guifg=aquamarine
+    hi Number           gui=bold guifg=lightgoldenrod1
+    hi Boolean          gui=bold guifg=lightgoldenrod1
+    hi Float            gui=bold guifg=lightgoldenrod1
+
+hi Identifier           gui=bold guifg=palegreen
+    hi Function         guifg=lightskyblue
+
+hi Statement            gui=bold guifg=cyan
+    hi Conditional      gui=bold guifg=cyan
+    hi Repeat           gui=bold guifg=cyan
+    hi Label            guifg=cyan
+    hi Operator         guifg=cyan
+    "hi Keyword
+    "hi Exception
+
+hi PreProc              guifg=lightsteelblue
+    hi Include          gui=bold guifg=lightsteelblue
+    hi Define           guifg=lightsteelblue
+    hi Macro            guifg=lightsteelblue
+    hi PreCondit        guifg=lightsteelblue
+
+hi Type                 gui=bold guifg=palegreen
+    hi StorageClass     gui=bold guifg=lightgoldenrod1
+    hi Structure        gui=bold guifg=lightgoldenrod1
+    hi Typedef          gui=bold guifg=lightgoldenrod1
+
+"hi Special
+    ""Underline Character
+    "hi SpecialChar
+    "hi Tag
+    ""Statement
+    "hi Delimiter
+    ""Bold comment (in Java at least)
+    "hi SpecialComment
+    "hi Debug
+
+hi Underlined           gui=underline
+
+hi Ignore               guifg=bg
+
+hi Error                gui=bold guifg=White guibg=Red
+
+"hi Todo
diff --git a/vim/colors/darkbone.vim b/vim/colors/darkbone.vim
new file mode 100644 (file)
index 0000000..a97c8fe
--- /dev/null
@@ -0,0 +1,102 @@
+" Name:                darkbone.vim
+" Maintainer:  Kojo Sugita
+" Last Change: 2008-11-22
+" Revision:    1.1
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = 'darkbone'
+
+"default colors
+hi Normal      guifg=#a0a0c0 guibg=#000000
+hi NonText     guifg=#606080 guibg=#101020 gui=none
+hi SpecialKey  guifg=#404060
+hi Cursor      guifg=#000000 guibg=#a0a0c0
+hi CursorLine  guibg=#303050
+hi CursorColumn        guibg=#303050
+hi lCursor     guifg=#000000 guibg=#a0a0c0
+hi CursorIM    guifg=#000000 guibg=#a0a0c0
+
+" Directory
+hi Directory   guifg=#e0e0ff guibg=#000000 gui=bold
+
+" Diff
+hi DiffAdd     guifg=#8090f0 guibg=#000000 gui=none
+hi DiffChange  guifg=#8090f0 guibg=#000000 gui=none
+hi DiffDelete  guifg=#8090f0 guibg=#000000 gui=none
+hi DiffText    guifg=#8090f0 guibg=#000000 gui=bold
+
+" Message
+hi ModeMsg     guifg=#a0a0c0 guibg=#000000
+hi MoreMsg     guifg=#a0a0c0 guibg=#000000
+hi ErrorMsg    guifg=#ee1111 guibg=#000000
+hi WarningMsg  guifg=#ee1111 guibg=#000000
+
+hi VertSplit   guifg=#606080 guibg=#606080
+
+" Folds
+hi Folded      guifg=#a0a0c0 guibg=#000000
+hi FoldColumn  guifg=#a0a0c0 guibg=#102010
+
+" Search
+hi Search      guifg=#000000 guibg=#c0c0ff gui=none
+hi IncSearch   guifg=#000000 guibg=#c0c0ff gui=none
+
+hi LineNr      guifg=#606080 guibg=#000000 gui=none
+hi Question    guifg=#a0a0c0 guibg=#000000
+
+"\n, \0, %d, %s, etc...
+" hi Special   guifg=#d0e080 guibg=#000000 gui=none
+hi Special     guifg=#808080 guibg=#000000 gui=none
+
+" status line
+hi StatusLine  guifg=#c0c0ff guibg=#000000 gui=bold,underline
+hi StatusLineNC        guifg=#606080 guibg=#000000 gui=bold,underline
+hi WildMenu    guifg=#000000 guibg=#c0c0ff
+
+hi Title       guifg=#c0c0ff guibg=#000000 gui=bold
+hi Visual      guifg=#000000 guibg=#707090 gui=none
+hi VisualNOS   guifg=#a0a0c0 guibg=#000000
+
+hi Number      guifg=#d0e080 guibg=#000000
+hi Char                guifg=#d0e080 guibg=#000000
+hi String      guifg=#d0e080 guibg=#000000
+
+hi Boolean     guifg=#d0e080 guibg=#000000
+hi Comment     guifg=#606080
+hi Constant    guifg=#f0a0b0 guibg=#000000 gui=none
+hi Identifier  guifg=#8090f0
+hi Statement   guifg=#8090f0 gui=none
+
+"Procedure name
+hi Function    guifg=#f0b040
+
+"Define, def
+" hi PreProc   guifg=#f0a0b0 gui=none
+hi PreProc     guifg=#e0e0ff gui=none
+
+hi Type                guifg=#e0e0ff gui=none
+hi Underlined  guifg=#a0a0c0 gui=underline
+hi Error       guifg=#ee1111 guibg=#000000
+hi Todo                guifg=#8090f0 guibg=#000000 gui=none
+hi SignColumn   guibg=#000000
+
+" Matches
+hi MatchParen  guifg=#a0a0c0 guibg=#404080 gui=none
+
+if version >= 700
+  " Pmenu
+  hi Pmenu     guibg=#202040
+  hi PmenuSel  guibg=#404080 guifg=#a0a0c0
+  hi PmenuSbar guibg=#202040
+
+  " Tab
+  hi TabLine     guifg=#606080 guibg=black gui=underline
+  hi TabLineFill  guifg=#a0a0c0 guibg=black gui=none
+  hi TabLineSel          guifg=#c0c0ff guibg=#606080 gui=bold
+endif
+
+" vim:set ts=8 sts=2 sw=2 tw=0:
diff --git a/vim/colors/darkslategray.vim b/vim/colors/darkslategray.vim
new file mode 100644 (file)
index 0000000..b36aef0
--- /dev/null
@@ -0,0 +1,117 @@
+" vim: set tw=0 sw=4 sts=4 et:
+
+" Vim color file
+" Maintainer: Tuomas Susi <tsusi@cc.hut.fi>
+" Last Change: 2004 October 05
+" Version: 1.7
+
+" Emacs in RedHat Linux used to have (still does?) a kind of 'Wheat on
+" DarkSlateGray' color scheme by default. This color scheme is created in the
+" same spirit.
+"
+" Darkslategray is intended to be nice to your eyes (low contrast) and to take
+" advantage of syntax hilighting as much as possible.
+"
+" This color scheme is for the GUI only, I'm happy with default console colors.
+" Needs at least vim 6.0.
+
+
+" Init stuff
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let g:colors_name = "darkslategray"
+
+
+" GUI colors
+
+hi Cursor               guifg=fg guibg=#da70d6
+hi CursorIM             guifg=NONE guibg=#ff83fa
+hi Directory            guifg=#e0ffff
+hi DiffAdd              guibg=#528b8b
+hi DiffChange           guibg=#8b636c
+hi DiffDelete           gui=bold guifg=fg guibg=#000000
+hi DiffText             gui=bold guibg=#6959cd
+hi ErrorMsg             gui=bold guifg=#ffffff guibg=#ff0000
+hi VertSplit            gui=bold guifg=#bdb76b guibg=#000000
+hi Folded               guifg=#000000 guibg=#bdb76b
+hi FoldColumn           guifg=#000000 guibg=#bdb76b
+hi SignColumn           gui=bold guifg=#bdb76b guibg=#20b2aa
+hi IncSearch            gui=bold guifg=#000000 guibg=#ffffff
+hi LineNr               gui=bold guifg=#bdb76b guibg=#528b8b
+hi ModeMsg              gui=bold
+hi MoreMsg              gui=bold guifg=#20b2aa
+hi NonText              gui=bold guifg=#ffffff
+hi Normal               guibg=#2f4f4f guifg=#f5deb3
+hi Question             gui=bold guifg=#ff6347
+hi Search               gui=bold guifg=#000000 guibg=#ffd700
+hi SpecialKey           guifg=#00ffff
+hi StatusLine           gui=bold guifg=#f0e68c guibg=#000000
+hi StatusLineNC         guibg=#bdb76b guifg=#404040
+hi Title                gui=bold guifg=#ff6347
+hi Visual               guifg=#000000 guibg=fg
+hi VisualNOS            gui=bold guifg=#000000 guibg=fg
+hi WarningMsg           guifg=#ffffff guibg=#ff6347
+hi WildMenu             gui=bold guifg=#000000 guibg=#ffff00
+
+
+" I use GTK and don't wanna change these
+"hi Menu foobar
+"hi Scrollbar foobar
+"hi Tooltip foobar
+
+
+" Colors for syntax highlighting
+hi Comment              guifg=#da70d6
+
+hi Constant             guifg=#cdcd00
+    hi String           guifg=#7fffd4
+    hi Character        guifg=#7fffd4
+    hi Number           guifg=#ff6347
+    hi Boolean          guifg=#cdcd00
+    hi Float            guifg=#ff6347
+
+hi Identifier           guifg=#afeeee
+    hi Function         guifg=#ffffff
+
+hi Statement            gui=bold guifg=#4682b4
+    hi Conditional      gui=bold guifg=#4682b4
+    hi Repeat           gui=bold guifg=#4682b4
+    hi Label            gui=bold guifg=#4682b4
+    hi Operator         gui=bold guifg=#4682b4
+    hi Keyword          gui=bold guifg=#4682b4
+    hi Exception        gui=bold guifg=#4682b4
+
+hi PreProc              guifg=#cdcd00
+    hi Include          guifg=#ffff00
+    hi Define           guifg=#cdcd00
+    hi Macro            guifg=#cdcd00
+    hi PreCondit        guifg=#cdcd00
+
+hi Type                 gui=bold guifg=#98fb98
+    hi StorageClass     guifg=#00ff00
+    hi Structure        guifg=#20b2aa
+    hi Typedef          guifg=#00ff7f
+
+hi Special              guifg=#ff6347
+    "Underline Character
+    hi SpecialChar      gui=underline guifg=#7fffd4
+    hi Tag              guifg=#ff6347
+    "Statement
+    hi Delimiter        gui=bold guifg=#b0c4de
+    "Bold comment (in Java at least)
+    hi SpecialComment   gui=bold guifg=#da70d6
+    hi Debug            gui=bold guifg=#ff0000
+
+hi Underlined           gui=underline
+
+hi Ignore               guifg=bg
+
+hi Error                gui=bold guifg=#ffffff guibg=#ff0000
+
+hi Todo                 gui=bold guifg=#000000 guibg=#ff83fa
+
diff --git a/vim/colors/darkspectrum.vim b/vim/colors/darkspectrum.vim
new file mode 100644 (file)
index 0000000..26ed7f3
--- /dev/null
@@ -0,0 +1,130 @@
+" Vim color file
+"
+" Author: Brian Mock <mock.brian@gmail.com>
+"
+" Note: Based on Oblivion color scheme for gedit (gtk-source-view)
+"
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+hi clear
+
+set background=dark
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+       syntax reset
+    endif
+endif
+let g:colors_name="darkspectrum"
+
+hi Normal guifg=#efefef guibg=#2A2A2A
+
+" highlight groups
+hi Cursor              guibg=#ffffff guifg=#000000
+hi CursorLine  guibg=#000000
+"hi CursorLine guibg=#3e4446
+hi CursorColumn        guibg=#464646
+
+"hi DiffText     guibg=#4e9a06 guifg=#FFFFFF gui=bold
+"hi DiffChange   guibg=#4e9a06 guifg=#FFFFFF gui=bold
+"hi DiffAdd      guibg=#204a87 guifg=#FFFFFF gui=bold
+"hi DiffDelete   guibg=#5c3566 guifg=#FFFFFF gui=bold
+
+hi DiffAdd         guifg=#ffcc7f guibg=#a67429 gui=none
+hi DiffChange      guifg=#7fbdff guibg=#425c78 gui=none
+hi DiffText        guifg=#8ae234 guibg=#4e9a06 gui=none
+"hi DiffDelete      guifg=#252723 guibg=#000000 gui=none
+hi DiffDelete      guifg=#000000 guibg=#000000 gui=none
+"hi ErrorMsg
+
+hi Number              guifg=#fce94f
+
+hi Folded              guibg=#000000 guifg=#FFFFFF gui=bold
+hi vimFold             guibg=#000000 guifg=#FFFFFF gui=bold
+hi FoldColumn  guibg=#000000 guifg=#FFFFFF gui=bold
+
+hi LineNr              guifg=#535353 guibg=#202020
+hi NonText             guifg=#535353 guibg=#202020
+hi Folded              guifg=#535353 guibg=#202020 gui=bold
+hi FoldeColumn  guifg=#535353 guibg=#202020 gui=bold
+"hi VertSplit  guibg=#ffffff guifg=#ffffff gui=none
+
+hi VertSplit   guibg=#3C3C3C guifg=#3C3C3C gui=none
+hi StatusLine   guifg=#FFFFFF guibg=#3C3C3C gui=none
+hi StatusLineNC guifg=#808080 guibg=#3C3C3C gui=none
+
+hi ModeMsg             guifg=#fce94f
+hi MoreMsg             guifg=#fce94f
+hi Visual              guifg=#FFFFFF guibg=#3465a4 gui=none
+hi VisualNOS    guifg=#FFFFFF guibg=#204a87 gui=none
+hi IncSearch   guibg=#FFFFFF guifg=#ef5939
+hi Search              guibg=#ad7fa8 guifg=#FFFFFF
+hi SpecialKey  guifg=#8ae234
+
+hi Title               guifg=#ef5939
+hi WarningMsg  guifg=#ef5939
+hi Number              guifg=#fcaf3e
+
+hi MatchParen  guibg=#ad7fa8 guifg=#FFFFFF
+hi Comment             guifg=#8a8a8a
+hi Constant            guifg=#ef5939 gui=none
+hi String              guifg=#fce94f
+hi Identifier  guifg=#729fcf
+hi Statement   guifg=#ffffff gui=bold
+hi PreProc             guifg=#ffffff gui=bold
+hi Type                        guifg=#8ae234 gui=bold
+hi Special             guifg=#e9b96e
+hi Underlined  guifg=#ad7fa8 gui=underline
+hi Directory   guifg=#729fcf
+hi Ignore              guifg=#555753
+hi Todo                        guifg=#FFFFFF guibg=#ef5939 gui=bold
+hi Function            guifg=#ad7fa8
+
+"hi WildMenu     guibg=#2e3436 guifg=#ffffff gui=bold
+"hi WildMenu     guifg=#7fbdff guibg=#425c78 gui=none
+hi WildMenu     guifg=#ffffff guibg=#3465a4 gui=none
+
+hi Pmenu        guibg=#000000 guifg=#c0c0c0
+hi PmenuSel     guibg=#3465a4 guifg=#ffffff
+hi PmenuSbar    guibg=#444444 guifg=#444444
+hi PmenuThumb   guibg=#888888 guifg=#888888 
+
+hi cppSTLType   guifg=#729fcf gui=bold
+
+hi spellBad     guisp=#fcaf3e
+hi spellCap     guisp=#73d216
+hi spellRare    guisp=#ad7fa8
+hi spellLocal   guisp=#729fcf
+
+hi link cppSTL          Function
+hi link Error                  Todo
+hi link Character              Number
+hi link rubySymbol             Number
+hi link htmlTag                        htmlEndTag
+"hi link htmlTagName     htmlTag
+hi link htmlLink               Underlined
+hi link pythonFunction Identifier
+hi link Question               Type
+hi link CursorIM               Cursor
+hi link VisualNOS              Visual
+hi link xmlTag                 Identifier
+hi link xmlTagName             Identifier
+hi link shDeref                        Identifier
+hi link shVariable             Function
+hi link rubySharpBang  Special
+hi link perlSharpBang  Special
+hi link schemeFunc      Statement
+"hi link shSpecialVariables Constant
+"hi link bashSpecialVariables Constant
+
+" tabs (non gui)
+hi TabLine             guifg=#A3A3A3 guibg=#202020 gui=none
+hi TabLineFill guifg=#535353 guibg=#202020 gui=none
+hi TabLineSel  guifg=#FFFFFF gui=bold
+"hi TabLineSel guifg=#FFFFFF guibg=#000000 gui=bold
+" vim: sw=4 ts=4
diff --git a/vim/colors/dawn.vim b/vim/colors/dawn.vim
new file mode 100644 (file)
index 0000000..a97c5ad
--- /dev/null
@@ -0,0 +1,78 @@
+" Vim color file
+" Maintainer:  Ajit J. Thakkar (ajit AT unb DOT ca)
+" Last Change: 2005 Nov. 24
+" Version:     1.5
+" URL:         http://www.unb.ca/chem/ajit/vim.htm
+
+" This GUI-only color scheme has a light grey background, and is a softer
+" variant of the default and morning color schemes.
+
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "dawn"
+
+hi Normal      guifg=Black guibg=grey90
+"hi Normal     guifg=Black guibg=grey80
+
+" Groups used in the 'highlight' and 'guicursor' options default value.
+hi ErrorMsg    gui=NONE guifg=Red guibg=Linen
+hi IncSearch   gui=NONE guifg=fg guibg=LightGreen
+hi ModeMsg     gui=NONE guifg=fg guibg=bg
+hi StatusLine  gui=NONE guifg=DarkBlue guibg=grey70
+hi StatusLineNC        gui=NONE guifg=grey90 guibg=grey70
+hi VertSplit   gui=NONE guifg=grey70 guibg=grey70
+hi Visual      gui=reverse guifg=Grey guibg=fg
+hi VisualNOS   gui=underline,bold guifg=fg guibg=bg
+hi DiffText    gui=NONE guifg=Blue guibg=LightYellow
+"hi DiffText   gui=NONE guifg=Blue guibg=MistyRose2
+hi Cursor      guifg=NONE guibg=Green
+hi lCursor     guifg=NONE guibg=Cyan
+hi Directory   guifg=Blue guibg=bg
+hi LineNr      guifg=Brown guibg=grey80
+hi MoreMsg     gui=NONE guifg=SeaGreen guibg=bg
+hi NonText     gui=NONE guifg=Blue guibg=grey80
+hi Question    gui=NONE guifg=SeaGreen guibg=bg
+hi Search      guifg=fg guibg=PeachPuff
+hi SpecialKey  guifg=Blue guibg=bg
+hi Title       gui=NONE guifg=Magenta guibg=bg
+hi WarningMsg  guifg=Red guibg=bg
+hi WildMenu    guifg=fg guibg=PeachPuff
+hi Folded      guifg=Grey40 guibg=bg " guifg=DarkBlue guibg=LightGrey
+hi FoldColumn  guifg=DarkBlue guibg=Grey
+hi DiffAdd     gui=NONE guifg=Blue guibg=LightCyan
+hi DiffChange  gui=NONE guifg=fg guibg=MistyRose2
+hi DiffDelete  gui=NONE guifg=LightBlue guibg=LightCyan
+
+" Colors for syntax highlighting
+hi Constant    gui=NONE guifg=azure4 guibg=bg
+"hi Constant   gui=NONE guifg=DeepSkyBlue4 guibg=bg
+hi String      gui=NONE guifg=DarkOliveGreen4 guibg=bg
+hi Special     gui=NONE guifg=Cyan4 guibg=bg
+hi Statement   gui=NONE guifg=SlateBlue4 guibg=bg
+hi Operator    gui=NONE guifg=Purple guibg=bg
+hi Ignore      gui=NONE guifg=bg guibg=bg
+if v:version >= 700
+  hi SpellBad  gui=undercurl guisp=DeepPink1 guifg=fg guibg=bg
+  hi SpellCap  gui=undercurl guisp=Blue guifg=fg guibg=bg
+  hi SpellRare gui=undercurl guisp=Black guifg=fg guibg=bg
+  hi SpellLocal        gui=undercurl guisp=SeaGreen guifg=fg guibg=bg
+endif
+hi ToDo                gui=NONE guifg=DeepPink1 guibg=bg
+hi Error       gui=NONE guifg=Red guibg=Linen
+hi Comment     gui=NONE guifg=RoyalBlue guibg=NONE
+hi Identifier  gui=NONE guifg=DodgerBlue3 guibg=NONE
+"hi Identifier gui=NONE guifg=SteelBlue4 guibg=NONE
+hi PreProc     gui=NONE guifg=Magenta4 guibg=NONE
+hi Type                gui=NONE guifg=Brown guibg=NONE
+hi Underlined  gui=underline guifg=SlateBlue guibg=bg
+"if exists("g:minimal_colors")
+"  hi Statement        gui=NONE guifg=fg guibg=bg
+"  hi Identifier       gui=NONE guifg=fg guibg=bg
+"  hi Type     gui=NONE guifg=fg guibg=bg
+"endif
+
+" vim: sw=2
diff --git a/vim/colors/denim.vim b/vim/colors/denim.vim
new file mode 100644 (file)
index 0000000..c41af9f
--- /dev/null
@@ -0,0 +1,141 @@
+" Maintainer:   Tim Aldrich <aldy0169@yahoo.com>
+" Last Change:  19 November 2001
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="denim"
+" GUI colors {{{
+hi Normal              guifg=#FFFFFF guibg=#000038
+hi Cursor              guifg=#000038 guibg=#FFFFFF
+hi CursorIM            guifg=#6699CC guibg=#99CCCC
+hi Directory   guifg=#33CCFF guibg=#6699CC
+hi DiffAdd             guifg=#FFFFCC guibg=#000038
+hi DiffChange  guifg=#FF9900 guibg=#000038
+hi DiffDelete  guifg=#999999 guibg=#000038
+hi DiffText            guifg=#FFFFFF guibg=#000038
+hi ErrorMsg            guifg=#FFFFFF guibg=#FF0000
+hi VertSplit   guifg=#FFFFFF guibg=#000038
+hi Folded              guifg=#999999 guibg=#003366
+hi FoldColumn  guifg=#0000EE guibg=#6699CC
+hi IncSearch   guifg=#FFFF00 guibg=#000038
+hi LineNr              guifg=#FFFFEE guibg=#000038
+hi ModeMsg             guifg=#FFFFFF guibg=#000038
+hi MoreMsg             guifg=#FFFFFF guibg=#000038
+hi NonText             guifg=#FFFFFF guibg=#00003D
+hi Question            guifg=#FFFFFF guibg=#0000EE
+hi Search              guifg=#993300 guibg=#6699CC
+hi SpecialKey  guifg=#FFFF00 guibg=#000038
+hi StatusLine  guifg=#FFFFFF guibg=#000038
+hi StatusLineNC        guifg=#CCCCCC guibg=#000038
+hi Title               guifg=#FFFFFF guibg=#FF9900
+hi Visual              guifg=#003366 guibg=#6699FF
+hi WarningMsg  guifg=#FF0000 guibg=#FFFFFF
+hi WildMenu            guifg=#000038 guibg=#999999
+" }}}
+
+" cterm colors {{{
+hi Normal              ctermfg=white ctermbg=darkblue
+hi Cursor              ctermfg=darkblue ctermbg=white
+hi CursorIM            ctermfg=lightcyan ctermbg=lightcyan
+hi Directory   ctermfg=lightblue ctermbg=lightcyan
+hi DiffAdd             ctermfg=LightYellow ctermbg=darkblue
+hi DiffChange  ctermfg=darkred ctermbg=darkblue
+hi DiffDelete  ctermfg=grey ctermbg=darkblue
+hi DiffText            ctermfg=white   ctermbg=darkblue
+hi ErrorMsg            ctermfg=red ctermbg=lightcyan
+hi VertSplit   ctermfg=white   ctermbg=darkblue
+hi Folded              ctermfg=grey ctermbg=darkblue
+hi FoldColumn  ctermfg=darkred ctermbg=lightcyan
+hi IncSearch   ctermfg=yellow ctermbg=darkblue
+hi LineNr              ctermfg=lightyellow ctermbg=darkblue
+hi ModeMsg             ctermfg=white   ctermbg=darkblue
+hi MoreMsg             ctermfg=white   ctermbg=darkblue
+hi NonText             ctermfg=white   ctermbg=lightblue
+hi Question            ctermfg=white   ctermbg=darkblue
+hi Search              ctermfg=darkred ctermbg=lightcyan
+hi SpecialKey  ctermfg=yellow ctermbg=darkblue
+hi StatusLine  ctermfg=white   ctermbg=darkblue
+hi StatusLineNC        ctermfg=lightgrey ctermbg=darkblue
+hi Title               ctermfg=white   ctermbg=yellow
+hi Visual              ctermfg=lightblue ctermbg=cyan
+hi WarningMsg  ctermfg=red ctermbg=white
+hi WildMenu            ctermfg=darkblue ctermbg=grey
+" }}}
+
+" GUI hilight groups {{{
+
+hi Comment             guifg=#999999
+hi Constant            guifg=#33FF33
+hi String              guifg=#CCCC99
+hi Character   guifg=#33FF33
+hi Number              guifg=#33FF33
+hi Boolean             guifg=#33FF33
+hi Float               guifg=#33FF33
+hi Identifier  guifg=#33FFFF
+hi Function            guifg=#33FFFF
+hi Statement   guifg=#FFFFCC
+hi Conditional guifg=#FFFFCC
+hi Repeat              guifg=#FFFFCC
+hi Label               guifg=#33FF99
+hi Operator            guifg=#FFFF00
+hi Keyword             guifg=#FFFF00
+hi Exception   guifg=#FFFFAA
+hi PreProc             guifg=#66CCFF
+hi Include             guifg=#66CCFF
+hi Define              guifg=#66CCFF
+hi Macro               guifg=#66CCFF
+hi PreCondit   guifg=#66CCFF
+hi Type                        guifg=#33FF99
+hi StorageClass        guifg=#33FF99
+hi Structure   guifg=#33FF99
+hi Typedef             guifg=#33FF99
+hi Special             guifg=#00FF00
+hi SpecialChar guifg=#00FF00
+hi Tag                 guifg=#CCCCFF
+hi Delimiter   guifg=#CCCCFF
+hi SpecialComment      guifg=#FFFFCC
+hi Debug               guifg=#CC3300
+hi Ignore              guifg=#0066AA
+hi Error               guifg=#FF0000 guibg=#FFFFFF
+hi Todo                        guifg=#999999 guibg=#FFFFFF
+" }}}
+
+" cterm hilight groups {{{
+hi Comment             ctermfg=grey
+hi Constant            ctermfg=lightgreen
+hi String              ctermfg=brown
+hi Character   ctermfg=lightgreen
+hi Number              ctermfg=lightgreen
+hi Boolean             ctermfg=lightgreen
+hi Float               ctermfg=lightgreen
+hi Identifier  ctermfg=lightcyan
+hi Function            ctermfg=lightcyan
+hi Statement   ctermfg=lightyellow
+hi Conditional ctermfg=lightyellow
+hi Repeat              ctermfg=lightyellow
+hi Label               ctermfg=lightcyan
+hi Operator            ctermfg=yellow
+hi Keyword             ctermfg=yellow
+hi Exception   ctermfg=yellow
+hi PreProc             ctermfg=darkcyan
+hi Include             ctermfg=darkcyan
+hi Define              ctermfg=darkcyan
+hi Macro               ctermfg=darkcyan
+hi PreCondit   ctermfg=darkcyan
+hi Type                        ctermfg=lightcyan
+hi StorageClass        ctermfg=lightcyan
+hi Structure   ctermfg=lightcyan
+hi Typedef             ctermfg=lightcyan
+hi Special             ctermfg=green
+hi SpecialChar ctermfg=green
+hi Tag                 ctermfg=brown
+hi Delimiter   ctermfg=brown
+hi SpecialComment      ctermfg=lightyellow
+hi Debug               ctermfg=magenta
+hi Ignore              ctermfg=lightblue
+hi Error               ctermfg=red ctermbg=white
+hi Todo                        ctermfg=grey ctermbg=white
+" }}}
diff --git a/vim/colors/desert256.vim b/vim/colors/desert256.vim
new file mode 100644 (file)
index 0000000..7a97742
--- /dev/null
@@ -0,0 +1,338 @@
+" Vim color file
+" Maintainer: Henry So, Jr. <henryso@panix.com>
+
+" These are the colors of the "desert" theme by Hans Fugal with a few small
+" modifications (namely that I lowered the intensity of the normal white and
+" made the normal and nontext backgrounds black), modified to work with 88-
+" and 256-color xterms.
+"
+" The original "desert" theme is available as part of the vim distribution or
+" at http://hans.fugal.net/vim/colors/.
+"
+" The real feature of this color scheme, with a wink to the "inkpot" theme, is
+" the programmatic approximation of the gui colors to the palettes of 88- and
+" 256- color xterms.  The functions that do this (folded away, for
+" readability) are calibrated to the colors used for Thomas E. Dickey's xterm
+" (version 200), which is available at http://dickey.his.com/xterm/xterm.html.
+"
+" I struggled with trying to parse the rgb.txt file to avoid the necessity of
+" converting color names to #rrggbb form, but decided it was just not worth
+" the effort.  Maybe someone seeing this may decide otherwise...
+
+set background=dark
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+        syntax reset
+    endif
+endif
+let g:colors_name="desert256"
+
+if has("gui_running") || &t_Co == 88 || &t_Co == 256
+    " functions {{{
+    " returns an approximate grey index for the given grey level
+    fun <SID>grey_number(x)
+        if &t_Co == 88
+            if a:x < 23
+                return 0
+            elseif a:x < 69
+                return 1
+            elseif a:x < 103
+                return 2
+            elseif a:x < 127
+                return 3
+            elseif a:x < 150
+                return 4
+            elseif a:x < 173
+                return 5
+            elseif a:x < 196
+                return 6
+            elseif a:x < 219
+                return 7
+            elseif a:x < 243
+                return 8
+            else
+                return 9
+            endif
+        else
+            if a:x < 14
+                return 0
+            else
+                let l:n = (a:x - 8) / 10
+                let l:m = (a:x - 8) % 10
+                if l:m < 5
+                    return l:n
+                else
+                    return l:n + 1
+                endif
+            endif
+        endif
+    endfun
+
+    " returns the actual grey level represented by the grey index
+    fun <SID>grey_level(n)
+        if &t_Co == 88
+            if a:n == 0
+                return 0
+            elseif a:n == 1
+                return 46
+            elseif a:n == 2
+                return 92
+            elseif a:n == 3
+                return 115
+            elseif a:n == 4
+                return 139
+            elseif a:n == 5
+                return 162
+            elseif a:n == 6
+                return 185
+            elseif a:n == 7
+                return 208
+            elseif a:n == 8
+                return 231
+            else
+                return 255
+            endif
+        else
+            if a:n == 0
+                return 0
+            else
+                return 8 + (a:n * 10)
+            endif
+        endif
+    endfun
+
+    " returns the palette index for the given grey index
+    fun <SID>grey_color(n)
+        if &t_Co == 88
+            if a:n == 0
+                return 16
+            elseif a:n == 9
+                return 79
+            else
+                return 79 + a:n
+            endif
+        else
+            if a:n == 0
+                return 16
+            elseif a:n == 25
+                return 231
+            else
+                return 231 + a:n
+            endif
+        endif
+    endfun
+
+    " returns an approximate color index for the given color level
+    fun <SID>rgb_number(x)
+        if &t_Co == 88
+            if a:x < 69
+                return 0
+            elseif a:x < 172
+                return 1
+            elseif a:x < 230
+                return 2
+            else
+                return 3
+            endif
+        else
+            if a:x < 75
+                return 0
+            else
+                let l:n = (a:x - 55) / 40
+                let l:m = (a:x - 55) % 40
+                if l:m < 20
+                    return l:n
+                else
+                    return l:n + 1
+                endif
+            endif
+        endif
+    endfun
+
+    " returns the actual color level for the given color index
+    fun <SID>rgb_level(n)
+        if &t_Co == 88
+            if a:n == 0
+                return 0
+            elseif a:n == 1
+                return 139
+            elseif a:n == 2
+                return 205
+            else
+                return 255
+            endif
+        else
+            if a:n == 0
+                return 0
+            else
+                return 55 + (a:n * 40)
+            endif
+        endif
+    endfun
+
+    " returns the palette index for the given R/G/B color indices
+    fun <SID>rgb_color(x, y, z)
+        if &t_Co == 88
+            return 16 + (a:x * 16) + (a:y * 4) + a:z
+        else
+            return 16 + (a:x * 36) + (a:y * 6) + a:z
+        endif
+    endfun
+
+    " returns the palette index to approximate the given R/G/B color levels
+    fun <SID>color(r, g, b)
+        " get the closest grey
+        let l:gx = <SID>grey_number(a:r)
+        let l:gy = <SID>grey_number(a:g)
+        let l:gz = <SID>grey_number(a:b)
+
+        " get the closest color
+        let l:x = <SID>rgb_number(a:r)
+        let l:y = <SID>rgb_number(a:g)
+        let l:z = <SID>rgb_number(a:b)
+
+        if l:gx == l:gy && l:gy == l:gz
+            " there are two possibilities
+            let l:dgr = <SID>grey_level(l:gx) - a:r
+            let l:dgg = <SID>grey_level(l:gy) - a:g
+            let l:dgb = <SID>grey_level(l:gz) - a:b
+            let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
+            let l:dr = <SID>rgb_level(l:gx) - a:r
+            let l:dg = <SID>rgb_level(l:gy) - a:g
+            let l:db = <SID>rgb_level(l:gz) - a:b
+            let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
+            if l:dgrey < l:drgb
+                " use the grey
+                return <SID>grey_color(l:gx)
+            else
+                " use the color
+                return <SID>rgb_color(l:x, l:y, l:z)
+            endif
+        else
+            " only one possibility
+            return <SID>rgb_color(l:x, l:y, l:z)
+        endif
+    endfun
+
+    " returns the palette index to approximate the 'rrggbb' hex string
+    fun <SID>rgb(rgb)
+        let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
+        let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
+        let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
+
+        return <SID>color(l:r, l:g, l:b)
+    endfun
+
+    " sets the highlighting for the given group
+    fun <SID>X(group, fg, bg, attr)
+        if a:fg != ""
+            exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . <SID>rgb(a:fg)
+        endif
+        if a:bg != ""
+            exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . <SID>rgb(a:bg)
+        endif
+        if a:attr != ""
+            exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
+        endif
+    endfun
+    " }}}
+
+    call <SID>X("Normal", "cccccc", "000000", "")
+
+    " highlight groups
+    call <SID>X("Cursor", "708090", "f0e68c", "")
+    "CursorIM
+    "Directory
+    "DiffAdd
+    "DiffChange
+    "DiffDelete
+    "DiffText
+    "ErrorMsg
+    call <SID>X("VertSplit", "c2bfa5", "7f7f7f", "reverse")
+    call <SID>X("Folded", "ffd700", "4d4d4d", "")
+    call <SID>X("FoldColumn", "d2b48c", "4d4d4d", "")
+    call <SID>X("IncSearch", "708090", "f0e68c", "")
+    "LineNr
+    call <SID>X("ModeMsg", "daa520", "", "")
+    call <SID>X("MoreMsg", "2e8b57", "", "")
+    call <SID>X("NonText", "addbe7", "000000", "bold")
+    call <SID>X("Question", "00ff7f", "", "")
+    call <SID>X("Search", "f5deb3", "cd853f", "")
+    call <SID>X("SpecialKey", "9acd32", "", "")
+    call <SID>X("StatusLine", "c2bfa5", "000000", "reverse")
+    call <SID>X("StatusLineNC", "c2bfa5", "7f7f7f", "reverse")
+    call <SID>X("Title", "cd5c5c", "", "")
+    call <SID>X("Visual", "6b8e23", "f0e68c", "reverse")
+    "VisualNOS
+    call <SID>X("WarningMsg", "fa8072", "", "")
+    "WildMenu
+    "Menu
+    "Scrollbar
+    "Tooltip
+
+    " syntax highlighting groups
+    call <SID>X("Comment", "87ceeb", "", "")
+    call <SID>X("Constant", "ffa0a0", "", "")
+    call <SID>X("Identifier", "98fb98", "", "none")
+    call <SID>X("Statement", "f0e68c", "", "bold")
+    call <SID>X("PreProc", "cd5c5c", "", "")
+    call <SID>X("Type", "bdb76b", "", "bold")
+    call <SID>X("Special", "ffdead", "", "")
+    "Underlined
+    call <SID>X("Ignore", "666666", "", "")
+    "Error
+    call <SID>X("Todo", "ff4500", "eeee00", "")
+
+    " delete functions {{{
+    delf <SID>X
+    delf <SID>rgb
+    delf <SID>color
+    delf <SID>rgb_color
+    delf <SID>rgb_level
+    delf <SID>rgb_number
+    delf <SID>grey_color
+    delf <SID>grey_level
+    delf <SID>grey_number
+    " }}}
+else
+    " color terminal definitions
+    hi SpecialKey    ctermfg=darkgreen
+    hi NonText       cterm=bold ctermfg=darkblue
+    hi Directory     ctermfg=darkcyan
+    hi ErrorMsg      cterm=bold ctermfg=7 ctermbg=1
+    hi IncSearch     cterm=NONE ctermfg=yellow ctermbg=green
+    hi Search        cterm=NONE ctermfg=grey ctermbg=blue
+    hi MoreMsg       ctermfg=darkgreen
+    hi ModeMsg       cterm=NONE ctermfg=brown
+    hi LineNr        ctermfg=3
+    hi Question      ctermfg=green
+    hi StatusLine    cterm=bold,reverse
+    hi StatusLineNC  cterm=reverse
+    hi VertSplit     cterm=reverse
+    hi Title         ctermfg=5
+    hi Visual        cterm=reverse
+    hi VisualNOS     cterm=bold,underline
+    hi WarningMsg    ctermfg=1
+    hi WildMenu      ctermfg=0 ctermbg=3
+    hi Folded        ctermfg=darkgrey ctermbg=NONE
+    hi FoldColumn    ctermfg=darkgrey ctermbg=NONE
+    hi DiffAdd       ctermbg=4
+    hi DiffChange    ctermbg=5
+    hi DiffDelete    cterm=bold ctermfg=4 ctermbg=6
+    hi DiffText      cterm=bold ctermbg=1
+    hi Comment       ctermfg=darkcyan
+    hi Constant      ctermfg=brown
+    hi Special       ctermfg=5
+    hi Identifier    ctermfg=6
+    hi Statement     ctermfg=3
+    hi PreProc       ctermfg=5
+    hi Type          ctermfg=2
+    hi Underlined    cterm=underline ctermfg=5
+    hi Ignore        ctermfg=darkgrey
+    hi Error         cterm=bold ctermfg=7 ctermbg=1
+endif
+
+" vim: set fdl=0 fdm=marker:
diff --git a/vim/colors/desertEx.vim b/vim/colors/desertEx.vim
new file mode 100644 (file)
index 0000000..08ef878
--- /dev/null
@@ -0,0 +1,98 @@
+" Vim color file
+" Maintainer:   Mingbai <mbbill AT gmail DOT com>
+" Last Change:  2006-12-24 20:09:09
+
+set background=dark
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+       syntax reset
+    endif
+endif
+let g:colors_name="desertEx"
+
+hi Normal      guifg=gray guibg=grey17 gui=none
+
+" AlignCtrl default
+" AlignCtrl =P0 guifg guibg gui
+" Align
+
+" highlight groups
+hi Cursor       guifg=black          guibg=yellow   gui=none
+hi ErrorMsg     guifg=white          guibg=red      gui=none
+hi VertSplit    guifg=gray40         guibg=gray40   gui=none
+hi Folded       guifg=DarkSlateGray3 guibg=grey30   gui=none
+hi FoldColumn   guifg=tan            guibg=grey30   gui=none
+hi IncSearch    guifg=#b0ffff        guibg=#2050d0
+hi LineNr       guifg=burlywood3     gui=none
+hi ModeMsg      guifg=SkyBlue        gui=none
+hi MoreMsg      guifg=SeaGreen       gui=none
+hi NonText      guifg=cyan           gui=none
+hi Question     guifg=springgreen    gui=none
+hi Search       guifg=gray80         guibg=#445599  gui=none
+hi SpecialKey   guifg=cyan           gui=none
+hi StatusLine   guifg=black          guibg=#c2bfa5  gui=bold
+hi StatusLineNC guifg=grey           guibg=gray40   gui=none
+hi Title        guifg=indianred      gui=none
+hi Visual       guifg=gray17         guibg=tan1     gui=none
+hi WarningMsg   guifg=salmon         gui=none
+hi Pmenu        guifg=white          guibg=#445599  gui=none
+hi PmenuSel     guifg=#445599        guibg=gray
+hi WildMenu     guifg=gray           guibg=gray17   gui=none
+hi MatchParen  guifg=cyan           guibg=NONE     gui=bold
+hi DiffAdd      guifg=black          guibg=wheat1
+hi DiffChange   guifg=black          guibg=skyblue1
+hi DiffText     guifg=black          guibg=hotpink1  gui=none
+hi DiffDelete   guibg=gray45         guifg=black     gui=none
+
+
+
+" syntax highlighting groups
+hi Comment      guifg=PaleGreen3     gui=italic
+hi Constant     guifg=salmon         gui=none
+hi Identifier   guifg=Skyblue        gui=none
+hi Function     guifg=Skyblue        gui=none
+hi Statement    guifg=lightgoldenrod2 gui=none
+hi PreProc      guifg=PaleVioletRed2 gui=none
+hi Type         guifg=tan1           gui=none
+hi Special      guifg=aquamarine2    gui=none
+hi Ignore       guifg=grey40         gui=none
+hi Todo         guifg=orangered      guibg=yellow2 gui=none
+
+" color terminal definitions
+hi SpecialKey   ctermfg=darkgreen
+hi NonText      cterm=bold           ctermfg=darkblue
+hi Directory    ctermfg=darkcyan
+hi ErrorMsg     cterm=bold           ctermfg=7        ctermbg=1
+hi IncSearch    cterm=NONE           ctermfg=yellow   ctermbg=green
+hi Search       cterm=NONE           ctermfg=grey     ctermbg=blue
+hi MoreMsg      ctermfg=darkgreen
+hi ModeMsg      cterm=NONE           ctermfg=brown
+hi LineNr       ctermfg=3
+hi Question     ctermfg=green
+hi StatusLine   cterm=bold,reverse
+hi StatusLineNC cterm=reverse
+hi VertSplit    cterm=reverse
+hi Title        ctermfg=5
+hi Visual       cterm=reverse
+hi VisualNOS    cterm=bold,underline
+hi WarningMsg   ctermfg=1
+hi WildMenu     ctermfg=0            ctermbg=3
+hi Folded       ctermfg=darkgrey     ctermbg=NONE
+hi FoldColumn   ctermfg=darkgrey     ctermbg=NONE
+hi DiffAdd      ctermbg=4
+hi DiffChange   ctermbg=5
+hi DiffDelete   cterm=bold           ctermfg=4        ctermbg=6
+hi DiffText     cterm=bold           ctermbg=1
+hi Comment      ctermfg=darkcyan
+hi Constant     ctermfg=brown
+hi Special      ctermfg=5
+hi Identifier   ctermfg=6
+hi Statement    ctermfg=3
+hi PreProc      ctermfg=5
+hi Type         ctermfg=2
+hi Underlined   cterm=underline      ctermfg=5
+hi Ignore       ctermfg=darkgrey
+hi Error        cterm=bold           ctermfg=7        ctermbg=1
diff --git a/vim/colors/dusk.vim b/vim/colors/dusk.vim
new file mode 100644 (file)
index 0000000..8feddd7
--- /dev/null
@@ -0,0 +1,71 @@
+" Vim color file
+" Maintainer:  Ajit J. Thakkar (ajit AT unb DOT ca)
+" Last Change: 2005 Nov. 21
+" Version:     1.1
+" URL:         http://www.unb.ca/chem/ajit/vim.htm
+
+" This GUI-only color scheme has a blue-black background
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "dusk"
+
+hi Normal      guifg=ivory guibg=#1f3048
+
+" Groups used in the 'highlight' and 'guicursor' options default value.
+hi ErrorMsg    gui=NONE guifg=Red guibg=Linen
+hi IncSearch   gui=NONE guibg=LightGreen guifg=Black
+hi ModeMsg     gui=NONE guifg=fg guibg=bg
+hi StatusLine  gui=NONE guifg=DarkBlue guibg=Grey
+hi StatusLineNC        gui=NONE guifg=Grey50 guibg=Grey
+hi VertSplit   gui=NONE guifg=Grey guibg=Grey
+hi Visual      gui=reverse guifg=fg guibg=LightSkyBlue4
+hi VisualNOS   gui=underline guifg=fg guibg=bg
+hi DiffText    gui=NONE guifg=Yellow guibg=LightSkyBlue4
+hi Cursor      guibg=Green guifg=Black
+hi lCursor     guibg=Cyan guifg=Black
+hi Directory   guifg=LightGreen guibg=bg
+hi LineNr      guifg=MistyRose3 guibg=bg
+hi MoreMsg     gui=NONE guifg=SeaGreen guibg=bg
+hi NonText     gui=NONE guifg=Cyan4 guibg=#102848
+hi Question    gui=NONE guifg=LimeGreen guibg=bg
+hi Search      gui=NONE guifg=SkyBlue4 guibg=Bisque
+hi SpecialKey  guifg=Cyan guibg=bg
+hi Title       gui=NONE guifg=Yellow2 guibg=bg
+hi WarningMsg  guifg=Tomato3 guibg=Linen
+hi WildMenu    gui=NONE guifg=SkyBlue4 guibg=Bisque
+"hi Folded     guifg=MistyRose2 guibg=bg
+hi Folded      guifg=MistyRose2 guibg=#102848
+hi FoldColumn  guifg=DarkBlue guibg=Grey
+hi DiffAdd     gui=NONE guifg=Blue guibg=LightCyan
+hi DiffChange  gui=NONE guifg=white guibg=LightCyan4
+hi DiffDelete  gui=NONE guifg=LightBlue guibg=LightCyan
+
+" Colors for syntax highlighting
+hi Constant    gui=NONE guifg=MistyRose3 guibg=bg
+hi String      gui=NONE guifg=LightBlue3 guibg=bg
+hi Special     gui=NONE guifg=GoldenRod guibg=bg
+hi Statement   gui=NONE guifg=khaki guibg=bg
+"hi Statement  gui=NONE guifg=#d7cd7b guibg=bg
+hi Operator    gui=NONE guifg=Chartreuse guibg=bg
+hi Ignore      gui=NONE guifg=bg guibg=bg
+if v:version >= 700
+  hi SpellBad  gui=undercurl guisp=Red guifg=fg guibg=bg
+  hi SpellCap  gui=undercurl guisp=GoldenRod guifg=fg guibg=bg
+  hi SpellRare gui=undercurl guisp=Ivory guifg=fg guibg=bg
+  hi SpellLocal        gui=undercurl guisp=SeaGreen guifg=fg guibg=bg
+endif
+hi ToDo                gui=NONE guifg=DodgerBlue guibg=bg
+hi Error       gui=NONE guifg=Red guibg=Linen
+hi Comment     gui=NONE guifg=SlateGrey guibg=bg
+"hi Comment    gui=NONE guifg=Lavender guibg=bg
+hi Identifier  gui=NONE guifg=BlanchedAlmond guibg=bg
+hi PreProc     gui=NONE guifg=#ffa0a0 guibg=bg
+hi Type                gui=NONE guifg=NavajoWhite guibg=bg
+hi Underlined  gui=underline guifg=fg guibg=bg
+
+" vim: sw=2
diff --git a/vim/colors/dw_blue.vim b/vim/colors/dw_blue.vim
new file mode 100644 (file)
index 0000000..bba8c2f
--- /dev/null
@@ -0,0 +1,66 @@
+"--------------------------------------------------------------------
+" Name Of File: dw_blue.vim.
+" Description: Gvim colorscheme, designed against VIM 7.0 GUI
+" By: Steve Cadwallader
+" Contact: demwiz@gmail.com
+" Credits: Inspiration from the brookstream and redblack schemes.
+" Last Change: Saturday, September 17, 2006.
+" Installation: Drop this file in your $VIMRUNTIME/colors/ directory.
+"--------------------------------------------------------------------
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="dw_blue"
+
+"--------------------------------------------------------------------
+
+hi Boolean                                       guifg=#0000ff
+hi cDefine                                       guifg=#0000ff
+hi cInclude                                      guifg=#ffffff
+hi Comment                                       guifg=#696969
+hi Constant                                      guifg=#0000ff
+hi Cursor                         guibg=#444444  guifg=#ffffff
+hi CursorColumn                   guibg=#000011
+hi CursorLine                     guibg=#000018
+hi DiffAdd                        guibg=#333333  guifg=#0000ff
+hi DiffChange                     guibg=#333333  guifg=#0000ff
+hi DiffDelete                     guibg=#333333  guifg=#0000ff
+hi DiffText                       guibg=#333333  guifg=#ffffff
+hi Directory                      guibg=#000000  guifg=#0000ff
+hi ErrorMsg                       guibg=#ffffff  guifg=#000000
+hi FoldColumn                     guibg=#222222  guifg=#ff0000
+hi Folded                         guibg=#222222  guifg=#ff0000
+hi Function                       guibg=#000000  guifg=#0000ff
+hi Identifier                     guibg=#000000  guifg=#0000cc
+hi IncSearch       gui=none       guibg=#0000bb  guifg=#000000
+hi LineNr                         guibg=#000000  guifg=#000088
+hi MatchParen      gui=none       guibg=#222222  guifg=#0000ff
+hi ModeMsg                        guibg=#000000  guifg=#0000ff
+hi MoreMsg                        guibg=#000000  guifg=#0000ff
+hi NonText                        guibg=#000000  guifg=#ffffff
+hi Normal          gui=none       guibg=#000000  guifg=#c0c0c0
+hi Operator        gui=none                      guifg=#696969
+hi PreProc         gui=none                      guifg=#ffffff
+hi Question                                      guifg=#0000ff
+hi Search          gui=none       guibg=#0000ff  guifg=#000000
+hi SignColumn                     guibg=#111111  guifg=#ffffff
+hi Special         gui=none       guibg=#000000  guifg=#ffffff
+hi SpecialKey                     guibg=#000000  guifg=#0000ff
+hi Statement       gui=bold                      guifg=#0000ff
+hi StatusLine      gui=none       guibg=#0000ff  guifg=#000000
+hi StatusLineNC    gui=none       guibg=#444444  guifg=#000000
+hi String          gui=none                      guifg=#0000bb
+hi TabLine         gui=none       guibg=#444444  guifg=#000000
+hi TabLineFill     gui=underline  guibg=#000000  guifg=#ffffff
+hi TabLineSel      gui=none       guibg=#0000aa  guifg=#000000
+hi Title           gui=none                      guifg=#0000ff
+hi Todo            gui=none       guibg=#000000  guifg=#ff0000
+hi Type            gui=none                      guifg=#ffffff
+hi VertSplit       gui=none       guibg=#000000  guifg=#ffffff
+hi Visual                         guibg=#0000dd  guifg=#000000
+hi WarningMsg                     guibg=#888888  guifg=#000000
+
+"- end of colorscheme -----------------------------------------------  
diff --git a/vim/colors/dw_cyan.vim b/vim/colors/dw_cyan.vim
new file mode 100644 (file)
index 0000000..158d578
--- /dev/null
@@ -0,0 +1,66 @@
+"--------------------------------------------------------------------
+" Name Of File: dw_cyan.vim.
+" Description: Gvim colorscheme, designed against VIM 7.0 GUI
+" By: Steve Cadwallader
+" Contact: demwiz@gmail.com
+" Credits: Inspiration from the brookstream and redblack schemes.
+" Last Change: Saturday, September 17, 2006.
+" Installation: Drop this file in your $VIMRUNTIME/colors/ directory.
+"--------------------------------------------------------------------
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="dw_cyan"
+
+"--------------------------------------------------------------------
+
+hi Boolean                                       guifg=#00ffff
+hi cDefine                                       guifg=#00ffff
+hi cInclude                                      guifg=#ffffff
+hi Comment                                       guifg=#696969
+hi Constant                                      guifg=#00ffff
+hi Cursor                         guibg=#444444  guifg=#ffffff
+hi CursorColumn                   guibg=#001111
+hi CursorLine                     guibg=#001818
+hi DiffAdd                        guibg=#333333  guifg=#00ffff
+hi DiffChange                     guibg=#333333  guifg=#00ffff
+hi DiffDelete                     guibg=#333333  guifg=#00ffff
+hi DiffText                       guibg=#333333  guifg=#ffffff
+hi Directory                      guibg=#000000  guifg=#00ffff
+hi ErrorMsg                       guibg=#ffffff  guifg=#000000
+hi FoldColumn                     guibg=#222222  guifg=#ff0000
+hi Folded                         guibg=#222222  guifg=#ff0000
+hi Function                       guibg=#000000  guifg=#00ffff
+hi Identifier                     guibg=#000000  guifg=#00cccc
+hi IncSearch       gui=none       guibg=#00bbbb  guifg=#000000
+hi LineNr                         guibg=#000000  guifg=#008888
+hi MatchParen      gui=none       guibg=#222222  guifg=#00ffff
+hi ModeMsg                        guibg=#000000  guifg=#00ffff
+hi MoreMsg                        guibg=#000000  guifg=#00ffff
+hi NonText                        guibg=#000000  guifg=#ffffff
+hi Normal          gui=none       guibg=#000000  guifg=#c0c0c0
+hi Operator        gui=none                      guifg=#696969
+hi PreProc         gui=none                      guifg=#ffffff
+hi Question                                      guifg=#00ffff
+hi Search          gui=none       guibg=#00ffff  guifg=#000000
+hi SignColumn                     guibg=#111111  guifg=#ffffff
+hi Special         gui=none       guibg=#000000  guifg=#ffffff
+hi SpecialKey                     guibg=#000000  guifg=#00ffff
+hi Statement       gui=bold                      guifg=#00ffff
+hi StatusLine      gui=none       guibg=#00ffff  guifg=#000000
+hi StatusLineNC    gui=none       guibg=#444444  guifg=#000000
+hi String          gui=none                      guifg=#00bbbb
+hi TabLine         gui=none       guibg=#444444  guifg=#000000
+hi TabLineFill     gui=underline  guibg=#000000  guifg=#ffffff
+hi TabLineSel      gui=none       guibg=#00aaaa  guifg=#000000
+hi Title           gui=none                      guifg=#00ffff
+hi Todo            gui=none       guibg=#000000  guifg=#ff0000
+hi Type            gui=none                      guifg=#ffffff
+hi VertSplit       gui=none       guibg=#000000  guifg=#ffffff
+hi Visual                         guibg=#00dddd  guifg=#000000
+hi WarningMsg                     guibg=#888888  guifg=#000000
+
+"- end of colorscheme -----------------------------------------------  
diff --git a/vim/colors/dw_green.vim b/vim/colors/dw_green.vim
new file mode 100644 (file)
index 0000000..de742f9
--- /dev/null
@@ -0,0 +1,66 @@
+"--------------------------------------------------------------------
+" Name Of File: dw_green.vim.
+" Description: Gvim colorscheme, designed against VIM 7.0 GUI
+" By: Steve Cadwallader
+" Contact: demwiz@gmail.com
+" Credits: Inspiration from the brookstream and redblack schemes.
+" Last Change: Saturday, September 17, 2006.
+" Installation: Drop this file in your $VIMRUNTIME/colors/ directory.
+"--------------------------------------------------------------------
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="dw_green"
+
+"--------------------------------------------------------------------
+
+hi Boolean                                       guifg=#00ff00
+hi cDefine                                       guifg=#00ff00
+hi cInclude                                      guifg=#ffffff
+hi Comment                                       guifg=#696969
+hi Constant                                      guifg=#00ff00
+hi Cursor                         guibg=#444444  guifg=#ffffff
+hi CursorColumn                   guibg=#001100
+hi CursorLine                     guibg=#001800
+hi DiffAdd                        guibg=#333333  guifg=#00ff00
+hi DiffChange                     guibg=#333333  guifg=#00ff00
+hi DiffDelete                     guibg=#333333  guifg=#00ff00
+hi DiffText                       guibg=#333333  guifg=#ffffff
+hi Directory                      guibg=#000000  guifg=#00ff00
+hi ErrorMsg                       guibg=#ffffff  guifg=#000000
+hi FoldColumn                     guibg=#222222  guifg=#ff0000
+hi Folded                         guibg=#222222  guifg=#ff0000
+hi Function                       guibg=#000000  guifg=#00ff00
+hi Identifier                     guibg=#000000  guifg=#00bb00
+hi IncSearch       gui=none       guibg=#00bb00  guifg=#000000
+hi LineNr                         guibg=#000000  guifg=#008800
+hi MatchParen      gui=none       guibg=#222222  guifg=#00ff00
+hi ModeMsg                        guibg=#000000  guifg=#00ff00
+hi MoreMsg                        guibg=#000000  guifg=#00ff00
+hi NonText                        guibg=#000000  guifg=#ffffff
+hi Normal          gui=none       guibg=#000000  guifg=#c0c0c0
+hi Operator        gui=none                      guifg=#696969
+hi PreProc         gui=none                      guifg=#ffffff
+hi Question                                      guifg=#00ff00
+hi Search          gui=none       guibg=#00ff00  guifg=#000000
+hi SignColumn                     guibg=#111111  guifg=#ffffff
+hi Special         gui=none       guibg=#000000  guifg=#ffffff
+hi SpecialKey                     guibg=#000000  guifg=#00ff00
+hi Statement       gui=bold                      guifg=#00ff00
+hi StatusLine      gui=none       guibg=#008800  guifg=#000000
+hi StatusLineNC    gui=none       guibg=#444444  guifg=#000000
+hi String          gui=none                      guifg=#00bb00
+hi TabLine         gui=none       guibg=#444444  guifg=#000000
+hi TabLineFill     gui=underline  guibg=#000000  guifg=#ffffff
+hi TabLineSel      gui=none       guibg=#00aa00  guifg=#000000
+hi Title           gui=none                      guifg=#00ff00
+hi Todo            gui=none       guibg=#000000  guifg=#ff0000
+hi Type            gui=none                      guifg=#ffffff
+hi VertSplit       gui=none       guibg=#000000  guifg=#ffffff
+hi Visual                         guibg=#00dd00  guifg=#000000
+hi WarningMsg                     guibg=#888888  guifg=#000000
+
+"- end of colorscheme -----------------------------------------------  
diff --git a/vim/colors/dw_orange.vim b/vim/colors/dw_orange.vim
new file mode 100644 (file)
index 0000000..b36b312
--- /dev/null
@@ -0,0 +1,66 @@
+"--------------------------------------------------------------------
+" Name Of File: dw_orange.vim.
+" Description: Gvim colorscheme, designed against VIM 7.0 GUI
+" By: Steve Cadwallader
+" Contact: demwiz@gmail.com
+" Credits: Inspiration from the brookstream and redblack schemes.
+" Last Change: Saturday, September 17, 2006.
+" Installation: Drop this file in your $VIMRUNTIME/colors/ directory.
+"--------------------------------------------------------------------
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="dw_orange"
+
+"--------------------------------------------------------------------
+
+hi Boolean                                       guifg=#ffff00
+hi cDefine                                       guifg=#ffff00
+hi cInclude                                      guifg=#ffffff
+hi Comment                                       guifg=#696969
+hi Constant                                      guifg=#ffff00
+hi Cursor                         guibg=#555555  guifg=#000000
+hi CursorColumn                   guibg=#140500
+hi CursorLine                     guibg=#260a00
+hi DiffAdd                        guibg=#333333  guifg=#ffff00
+hi DiffChange                     guibg=#333333  guifg=#ffff00
+hi DiffDelete                     guibg=#333333  guifg=#ffff00
+hi DiffText                       guibg=#333333  guifg=#ffffff
+hi Directory                      guibg=#000000  guifg=#ffffff
+hi ErrorMsg                       guibg=#ffffff  guifg=#000000
+hi FoldColumn                     guibg=#222222  guifg=#ff0000
+hi Folded                         guibg=#222222  guifg=#ff0000
+hi Function                                      guifg=#ffff00
+hi Identifier                     guibg=#000000  guifg=#d13800
+hi IncSearch       gui=none       guibg=#bf3300  guifg=#000000
+hi LineNr                         guibg=#000000  guifg=#de3b00
+hi MatchParen      gui=none       guibg=#000000  guifg=#ffff00
+hi ModeMsg                        guibg=#000000  guifg=#ff4400
+hi MoreMsg                        guibg=#000000  guifg=#ffff00
+hi NonText                        guibg=#000000  guifg=#ffffff
+hi Normal          gui=none       guibg=#000000  guifg=#c0c0c0
+hi Operator        gui=none                      guifg=#696969
+hi PreProc         gui=none                      guifg=#ffffff
+hi Question                                      guifg=#ffff00
+hi Search          gui=none       guibg=#ff4400  guifg=#000000
+hi SignColumn                     guibg=#111111  guifg=#ffffff
+hi Special         gui=none       guibg=#000000  guifg=#ffa600
+hi SpecialKey                     guibg=#000000  guifg=#ff4400
+hi Statement       gui=bold                      guifg=#ff4400
+hi StatusLine      gui=none       guibg=#ff3200  guifg=#000000
+hi StatusLineNC    gui=none       guibg=#444444  guifg=#000000
+hi String          gui=none                      guifg=#d13800
+hi TabLine         gui=none       guibg=#555555  guifg=#000000
+hi TabLineFill     gui=underline  guibg=#000000  guifg=#ffffff
+hi TabLineSel      gui=none       guibg=#ff4400  guifg=#000000
+hi Title           gui=none                      guifg=#ffffff
+hi Todo            gui=none       guibg=#000000  guifg=#ff0000
+hi Type            gui=none                      guifg=#ffffff
+hi VertSplit       gui=none       guibg=#000000  guifg=#ffffff
+hi Visual                         guibg=#d13800  guifg=#000000
+hi WarningMsg                     guibg=#888888  guifg=#000000
+
+"- end of colorscheme -----------------------------------------------  
diff --git a/vim/colors/dw_purple.vim b/vim/colors/dw_purple.vim
new file mode 100644 (file)
index 0000000..59dc8dd
--- /dev/null
@@ -0,0 +1,66 @@
+"--------------------------------------------------------------------
+" Name Of File: dw_purple.vim.
+" Description: Gvim colorscheme, designed against VIM 7.0 GUI
+" By: Steve Cadwallader
+" Contact: demwiz@gmail.com
+" Credits: Inspiration from the brookstream and redblack schemes.
+" Last Change: Saturday, September 17, 2006.
+" Installation: Drop this file in your $VIMRUNTIME/colors/ directory.
+"--------------------------------------------------------------------
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="dw_purple"
+
+"--------------------------------------------------------------------
+
+hi Boolean                                       guifg=#ff00ff
+hi cDefine                                       guifg=#ff00ff
+hi cInclude                                      guifg=#ffffff
+hi Comment                                       guifg=#696969
+hi Constant                                      guifg=#ff00ff
+hi Cursor                         guibg=#444444  guifg=#ffffff
+hi CursorColumn                   guibg=#110011
+hi CursorLine                     guibg=#180018
+hi DiffAdd                        guibg=#333333  guifg=#ff00ff
+hi DiffChange                     guibg=#333333  guifg=#ff00ff
+hi DiffDelete                     guibg=#333333  guifg=#ff00ff
+hi DiffText                       guibg=#333333  guifg=#ffffff
+hi Directory                      guibg=#000000  guifg=#ff00ff
+hi ErrorMsg                       guibg=#ffffff  guifg=#000000
+hi FoldColumn                     guibg=#222222  guifg=#ff0000
+hi Folded                         guibg=#222222  guifg=#ff0000
+hi Function                       guibg=#000000  guifg=#ff00ff
+hi Identifier                     guibg=#000000  guifg=#cc00cc
+hi IncSearch       gui=none       guibg=#bb00bb  guifg=#000000
+hi LineNr                         guibg=#000000  guifg=#880088
+hi MatchParen      gui=none       guibg=#222222  guifg=#ff00ff
+hi ModeMsg                        guibg=#000000  guifg=#ff00ff
+hi MoreMsg                        guibg=#000000  guifg=#ff00ff
+hi NonText                        guibg=#000000  guifg=#ffffff
+hi Normal          gui=none       guibg=#000000  guifg=#c0c0c0
+hi Operator        gui=none                      guifg=#696969
+hi PreProc         gui=none                      guifg=#ffffff
+hi Question                                      guifg=#ff00ff
+hi Search          gui=none       guibg=#ff00ff  guifg=#000000
+hi SignColumn                     guibg=#111111  guifg=#ffffff
+hi Special         gui=none       guibg=#000000  guifg=#ffffff
+hi SpecialKey                     guibg=#000000  guifg=#ff00ff
+hi Statement       gui=bold                      guifg=#ff00ff
+hi StatusLine      gui=none       guibg=#ff00ff  guifg=#000000
+hi StatusLineNC    gui=none       guibg=#444444  guifg=#000000
+hi String          gui=none                      guifg=#bb00bb
+hi TabLine         gui=none       guibg=#444444  guifg=#000000
+hi TabLineFill     gui=underline  guibg=#000000  guifg=#ffffff
+hi TabLineSel      gui=none       guibg=#aa00aa  guifg=#000000
+hi Title           gui=none                      guifg=#ff00ff
+hi Todo            gui=none       guibg=#000000  guifg=#ff0000
+hi Type            gui=none                      guifg=#ffffff
+hi VertSplit       gui=none       guibg=#000000  guifg=#ffffff
+hi Visual                         guibg=#dd00dd  guifg=#000000
+hi WarningMsg                     guibg=#888888  guifg=#000000
+
+"- end of colorscheme -----------------------------------------------  
diff --git a/vim/colors/dw_red.vim b/vim/colors/dw_red.vim
new file mode 100644 (file)
index 0000000..c8a2c80
--- /dev/null
@@ -0,0 +1,66 @@
+"--------------------------------------------------------------------
+" Name Of File: dw_red.vim.
+" Description: Gvim colorscheme, designed against VIM 7.0 GUI
+" By: Steve Cadwallader
+" Contact: demwiz@gmail.com
+" Credits: Inspiration from the brookstream and redblack schemes.
+" Last Change: Saturday, September 17, 2006.
+" Installation: Drop this file in your $VIMRUNTIME/colors/ directory.
+"--------------------------------------------------------------------
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="dw_red"
+
+"--------------------------------------------------------------------
+
+hi Boolean                                       guifg=#ff0000
+hi cDefine                                       guifg=#ff0000
+hi cInclude                                      guifg=#ffffff
+hi Comment                                       guifg=#696969
+hi Constant                                      guifg=#ff0000
+hi Cursor                         guibg=#444444  guifg=#ffffff
+hi CursorColumn                   guibg=#110000
+hi CursorLine                     guibg=#180000
+hi DiffAdd                        guibg=#333333  guifg=#ff0000
+hi DiffChange                     guibg=#333333  guifg=#ff0000
+hi DiffDelete                     guibg=#333333  guifg=#ff0000
+hi DiffText                       guibg=#333333  guifg=#ffffff
+hi Directory                      guibg=#000000  guifg=#ff0000
+hi ErrorMsg                       guibg=#ffffff  guifg=#000000
+hi FoldColumn                     guibg=#222222  guifg=#ff0000
+hi Folded                         guibg=#222222  guifg=#ff0000
+hi Function                       guibg=#000000  guifg=#ff0000
+hi Identifier                     guibg=#000000  guifg=#cc0000
+hi IncSearch       gui=none       guibg=#bb0000  guifg=#000000
+hi LineNr                         guibg=#000000  guifg=#880000
+hi MatchParen      gui=none       guibg=#222222  guifg=#ff0000
+hi ModeMsg                        guibg=#000000  guifg=#ff0000
+hi MoreMsg                        guibg=#000000  guifg=#ff0000
+hi NonText                        guibg=#000000  guifg=#ffffff
+hi Normal          gui=none       guibg=#000000  guifg=#c0c0c0
+hi Operator        gui=none                      guifg=#696969
+hi PreProc         gui=none                      guifg=#ffffff
+hi Question                                      guifg=#ff0000
+hi Search          gui=none       guibg=#ff0000  guifg=#000000
+hi SignColumn                     guibg=#111111  guifg=#ffffff
+hi Special         gui=none       guibg=#000000  guifg=#ffffff
+hi SpecialKey                     guibg=#000000  guifg=#ff0000
+hi Statement       gui=bold                      guifg=#ff0000
+hi StatusLine      gui=none       guibg=#ff0000  guifg=#000000
+hi StatusLineNC    gui=none       guibg=#444444  guifg=#000000
+hi String          gui=none                      guifg=#bb0000
+hi TabLine         gui=none       guibg=#444444  guifg=#000000
+hi TabLineFill     gui=underline  guibg=#000000  guifg=#ffffff
+hi TabLineSel      gui=none       guibg=#aa0000  guifg=#000000
+hi Title           gui=none                      guifg=#ff0000
+hi Todo            gui=none       guibg=#000000  guifg=#ff0000
+hi Type            gui=none                      guifg=#ffffff
+hi VertSplit       gui=none       guibg=#000000  guifg=#ffffff
+hi Visual                         guibg=#dd0000  guifg=#000000
+hi WarningMsg                     guibg=#888888  guifg=#000000
+
+"- end of colorscheme -----------------------------------------------  
diff --git a/vim/colors/dw_yellow.vim b/vim/colors/dw_yellow.vim
new file mode 100644 (file)
index 0000000..011b092
--- /dev/null
@@ -0,0 +1,66 @@
+"--------------------------------------------------------------------
+" Name Of File: dw_yellow.vim.
+" Description: Gvim colorscheme, designed against VIM 7.0 GUI
+" By: Steve Cadwallader
+" Contact: demwiz@gmail.com
+" Credits: Inspiration from the brookstream and redblack schemes.
+" Last Change: Saturday, September 17, 2006.
+" Installation: Drop this file in your $VIMRUNTIME/colors/ directory.
+"--------------------------------------------------------------------
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="dw_yellow"
+
+"--------------------------------------------------------------------
+
+hi Boolean                                       guifg=#ffff00
+hi cDefine                                       guifg=#ffff00
+hi cInclude                                      guifg=#ffffff
+hi Comment                                       guifg=#696969
+hi Constant                                      guifg=#ffff00
+hi Cursor                         guibg=#444444  guifg=#ffffff
+hi CursorColumn                   guibg=#111100
+hi CursorLine                     guibg=#181800
+hi DiffAdd                        guibg=#333333  guifg=#ffff00
+hi DiffChange                     guibg=#333333  guifg=#ffff00
+hi DiffDelete                     guibg=#333333  guifg=#ffff00
+hi DiffText                       guibg=#333333  guifg=#ffffff
+hi Directory                      guibg=#000000  guifg=#ffff00
+hi ErrorMsg                       guibg=#ffffff  guifg=#000000
+hi FoldColumn                     guibg=#222222  guifg=#ff0000
+hi Folded                         guibg=#222222  guifg=#ff0000
+hi Function                       guibg=#000000  guifg=#ffff00
+hi Identifier                     guibg=#000000  guifg=#cccc00
+hi IncSearch       gui=none       guibg=#bbbb00  guifg=#000000
+hi LineNr                         guibg=#000000  guifg=#888800
+hi MatchParen      gui=none       guibg=#222222  guifg=#ffff00
+hi ModeMsg                        guibg=#000000  guifg=#ffff00
+hi MoreMsg                        guibg=#000000  guifg=#ffff00
+hi NonText                        guibg=#000000  guifg=#ffffff
+hi Normal          gui=none       guibg=#000000  guifg=#c0c0c0
+hi Operator        gui=none                      guifg=#696969
+hi PreProc         gui=none                      guifg=#ffffff
+hi Question                                      guifg=#ffff00
+hi Search          gui=none       guibg=#ffff00  guifg=#000000
+hi SignColumn                     guibg=#111111  guifg=#ffffff
+hi Special         gui=none       guibg=#000000  guifg=#ffffff
+hi SpecialKey                     guibg=#000000  guifg=#ffff00
+hi Statement       gui=bold                      guifg=#ffff00
+hi StatusLine      gui=none       guibg=#ffff00  guifg=#000000
+hi StatusLineNC    gui=none       guibg=#444444  guifg=#000000
+hi String          gui=none                      guifg=#bbbb00
+hi TabLine         gui=none       guibg=#444444  guifg=#000000
+hi TabLineFill     gui=underline  guibg=#000000  guifg=#ffffff
+hi TabLineSel      gui=none       guibg=#aaaa00  guifg=#000000
+hi Title           gui=none                      guifg=#ffff00
+hi Todo            gui=none       guibg=#000000  guifg=#ff0000
+hi Type            gui=none                      guifg=#ffffff
+hi VertSplit       gui=none       guibg=#000000  guifg=#ffffff
+hi Visual                         guibg=#dddd00  guifg=#000000
+hi WarningMsg                     guibg=#888888  guifg=#000000
+
+"- end of colorscheme -----------------------------------------------  
diff --git a/vim/colors/earendel.vim b/vim/colors/earendel.vim
new file mode 100644 (file)
index 0000000..52aa178
--- /dev/null
@@ -0,0 +1,159 @@
+hi clear
+
+if exists("syntax_on")
+    syntax reset
+endif
+
+let colors_name = "earendel"
+
+execute "command! -nargs=1 Colo set background=<args>"
+
+if &background == "light"
+    hi Normal ctermbg=15 ctermfg=0 guibg=#ffffff guifg=#000000 gui=none
+
+    hi Cursor guibg=#000000 guifg=#ffffff gui=none
+    hi CursorColumn ctermbg=7 ctermfg=fg guibg=#dfdfdf gui=none
+    hi CursorLine ctermbg=7 ctermfg=fg guibg=#dfdfdf gui=none
+    hi DiffAdd guibg=#bae981 guifg=fg gui=none
+    hi DiffChange guibg=#8495e6 guifg=fg gui=none
+    hi DiffDelete guibg=#ff95a5 guifg=fg gui=none
+    hi DiffText guibg=#b9c2f0 guifg=fg gui=bold
+    hi Directory guibg=bg guifg=#272fc2 gui=none
+    hi ErrorMsg guibg=#ca001f guifg=#ffffff gui=bold
+    hi FoldColumn ctermbg=bg guibg=bg guifg=#656565 gui=none
+    hi Folded guibg=#cacaca guifg=#324263 gui=bold
+    hi IncSearch guibg=#f7b69d gui=none
+    hi LineNr guibg=bg guifg=#656565 gui=none
+    hi ModeMsg ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=bold
+    hi MoreMsg guibg=bg guifg=#4a4a4a gui=bold
+    hi NonText ctermfg=8 guibg=bg guifg=#656565 gui=bold
+    hi Pmenu guibg=#aab8d5 guifg=fg gui=none
+    hi PmenuSbar guibg=#6a83b5 guifg=fg gui=none
+    hi PmenuSel guibg=#fee06b guifg=fg gui=none
+    hi PmenuThumb guibg=#c7cfe2 guifg=fg gui=none
+    hi Question guibg=bg guifg=#4a4a4a gui=bold
+    hi Search guibg=#fee481 gui=none
+    hi SignColumn ctermbg=bg guibg=bg guifg=#656565 gui=none
+    hi SpecialKey guibg=bg guifg=#844631 gui=none
+    hi StatusLine ctermbg=0 ctermfg=15 guibg=#96aad3 guifg=fg gui=bold
+    hi StatusLineNC ctermbg=7 ctermfg=fg guibg=#bcc7de guifg=#384547 gui=none
+    if has("spell")
+        hi SpellBad guisp=#ca001f gui=undercurl
+        hi SpellCap guisp=#272fc2 gui=undercurl
+        hi SpellLocal guisp=#0f8674 gui=undercurl
+        hi SpellRare guisp=#d16c7a gui=undercurl
+    endif
+    hi TabLine guibg=#d4d4d4 guifg=fg gui=underline
+    hi TabLineFill guibg=#d4d4d4 guifg=fg gui=underline
+    hi TabLineSel guibg=bg guifg=fg gui=bold
+    hi Title guifg=fg gui=bold
+    hi VertSplit ctermbg=7 ctermfg=fg guibg=#bcc7de guifg=#384547 gui=none
+    if version >= 700
+        hi Visual ctermbg=7 ctermfg=fg guibg=#b5c5e6 gui=none
+    else
+        hi Visual ctermbg=7 ctermfg=fg guibg=#b5c5e6 guifg=fg gui=none
+    endif    
+    hi VisualNOS ctermbg=8 ctermfg=fg guibg=bg guifg=#4069bf gui=bold,underline
+    hi WarningMsg guibg=bg guifg=#ca001f gui=bold
+    hi WildMenu guibg=#fedc56 guifg=fg gui=bold
+
+    hi Comment guibg=bg guifg=#558817 gui=none
+    hi Constant guibg=bg guifg=#a8660d gui=none
+    hi Error guibg=bg guifg=#bf001d gui=none
+    hi Identifier guibg=bg guifg=#0e7c6b gui=none
+    hi Ignore guibg=bg guifg=bg gui=none
+    hi lCursor guibg=#79bf21 guifg=#ffffff gui=none
+    hi MatchParen guibg=#0f8674 guifg=#ffffff gui=none
+    hi PreProc guibg=bg guifg=#a33243 gui=none
+    hi Special guibg=bg guifg=#844631 gui=none
+    hi Statement guibg=bg guifg=#2239a8 gui=bold
+    hi Todo guibg=#fedc56 guifg=#512b1e gui=bold
+    hi Type guibg=bg guifg=#1d318d gui=bold
+    hi Underlined ctermbg=bg ctermfg=fg guibg=bg guifg=#272fc2 gui=underline
+
+    hi htmlBold ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=bold
+    hi htmlBoldItalic ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=bold,italic
+    hi htmlBoldUnderline ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=bold,underline
+    hi htmlBoldUnderlineItalic ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=bold,underline,italic
+    hi htmlItalic ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=italic
+    hi htmlUnderline ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=underline
+    hi htmlUnderlineItalic ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=underline,italic
+else
+    hi Normal ctermbg=0 ctermfg=7 guibg=#181818 guifg=#cacaca gui=none
+
+    hi Cursor guibg=#e5e5e5 guifg=#000000 gui=none
+    hi CursorColumn ctermbg=8 ctermfg=15 guibg=#404040 gui=none
+    hi CursorLine ctermbg=8 ctermfg=15 guibg=#404040 gui=none
+    hi DiffAdd guibg=#558817 guifg=#dadada gui=none
+    hi DiffChange guibg=#1b2e85 guifg=#dadada gui=none
+    hi DiffDelete guibg=#9f0018 guifg=#dadada gui=none
+    hi DiffText guibg=#2540ba guifg=#dadada gui=bold
+    hi Directory guibg=bg guifg=#8c91e8 gui=none
+    hi ErrorMsg guibg=#ca001f guifg=#e5e5e5 gui=bold
+    hi FoldColumn ctermbg=bg guibg=bg guifg=#9a9a9a gui=none
+    hi Folded guibg=#555555 guifg=#bfcadf gui=bold
+    hi IncSearch guibg=#a7380e guifg=#dadada gui=none
+    hi LineNr guibg=bg guifg=#9a9a9a gui=none
+    hi ModeMsg ctermbg=bg ctermfg=fg guibg=bg guifg=fg gui=bold
+    hi MoreMsg guibg=bg guifg=#b5b5b5 gui=bold
+    hi NonText ctermfg=8 guibg=bg guifg=#9a9a9a gui=bold
+    hi Pmenu guibg=#3d5078 guifg=#dadada gui=none
+    hi PmenuSbar guibg=#324263 guifg=#dadada gui=none
+    hi PmenuSel guibg=#f3c201 guifg=#000000 gui=none
+    hi PmenuThumb guibg=#5c77ad guifg=#dadada gui=none
+    hi Question guibg=bg guifg=#b5b5b5 gui=bold
+    hi Search guibg=#947601 guifg=#dadada gui=none
+    hi SignColumn ctermbg=bg guibg=bg guifg=#9a9a9a gui=none
+    hi SpecialKey guibg=bg guifg=#d3a901 gui=none
+    hi StatusLine ctermbg=7 ctermfg=0 guibg=#41609e guifg=#e5e5e5 gui=bold
+    hi StatusLineNC ctermbg=7 ctermfg=0 guibg=#35466a guifg=#afbacf gui=none
+    if has("spell")
+        hi SpellBad guisp=#ea0023 gui=undercurl
+        hi SpellCap guisp=#8c91e8 gui=undercurl
+        hi SpellLocal guisp=#16c9ae gui=undercurl
+        hi SpellRare guisp=#e09ea8 gui=undercurl
+    endif
+    hi TabLine guibg=#4a4a4a guifg=#e5e5e5 gui=underline
+    hi TabLineFill guibg=#4a4a4a guifg=#e5e5e5 gui=underline
+    hi TabLineSel guibg=bg guifg=#e5e5e5 gui=bold
+    hi Title ctermbg=bg ctermfg=15 guifg=#e5e5e5 gui=bold
+    hi VertSplit ctermbg=7 ctermfg=0 guibg=#35466a guifg=#afbacf gui=none
+    if version >= 700
+        hi Visual ctermbg=7 ctermfg=0 guibg=#274278 gui=none
+    else
+        hi Visual ctermbg=7 ctermfg=0 guibg=#274278 guifg=fg gui=none
+    endif    
+    hi VisualNOS ctermbg=8 ctermfg=0 guibg=bg guifg=#5c77ad gui=bold,underline
+    hi WarningMsg guibg=bg guifg=#ea0023 gui=bold
+    hi WildMenu guibg=#fbca01 guifg=#000000 gui=bold
+
+    hi Comment guibg=bg guifg=#77be21 gui=none
+    hi Constant guibg=bg guifg=#dc8511 gui=none
+    hi Error guibg=bg guifg=#ea0023 gui=none
+    hi Identifier guibg=bg guifg=#16c9ae gui=none
+    hi Ignore guibg=bg guifg=bg gui=none
+    hi lCursor guibg=#c4ec93 guifg=#000000 gui=none
+    hi MatchParen guibg=#17d2b7 guifg=#000000 gui=none
+    hi PreProc guibg=bg guifg=#e09ea8 gui=none
+    hi Special guibg=bg guifg=#d3a901 gui=none
+    hi Statement guibg=bg guifg=#a7b4ed gui=bold
+    hi Todo guibg=#fedc56 guifg=#512b1e gui=bold
+    hi Type guibg=bg guifg=#95a4ea gui=bold
+    hi Underlined ctermbg=bg ctermfg=15 guibg=bg guifg=#8c91e8 gui=underline
+
+    hi htmlBold ctermbg=bg ctermfg=15 guibg=bg guifg=fg gui=bold
+    hi htmlBoldItalic ctermbg=bg ctermfg=15 guibg=bg guifg=fg gui=bold,italic
+    hi htmlBoldUnderline ctermbg=bg ctermfg=15 guibg=bg guifg=fg gui=bold,underline
+    hi htmlBoldUnderlineItalic ctermbg=bg ctermfg=15 guibg=bg guifg=fg gui=bold,underline,italic
+    hi htmlItalic ctermbg=bg ctermfg=15 guibg=bg guifg=fg gui=italic
+    hi htmlUnderline ctermbg=bg ctermfg=15 guibg=bg guifg=fg gui=underline
+    hi htmlUnderlineItalic ctermbg=bg ctermfg=15 guibg=bg guifg=fg gui=underline,italic
+endif
+
+hi! default link bbcodeBold htmlBold
+hi! default link bbcodeBoldItalic htmlBoldItalic
+hi! default link bbcodeBoldItalicUnderline htmlBoldUnderlineItalic
+hi! default link bbcodeBoldUnderline htmlBoldUnderline
+hi! default link bbcodeItalic htmlItalic
+hi! default link bbcodeItalicUnderline htmlUnderlineItalic
+hi! default link bbcodeUnderline htmlUnderline
diff --git a/vim/colors/eclipse.vim b/vim/colors/eclipse.vim
new file mode 100644 (file)
index 0000000..0d7d36a
--- /dev/null
@@ -0,0 +1,92 @@
+" Vim color file
+" Maintainer:  Juan frias <juandfrias at gmail dot com>
+" Last Change: 2007 Feb 25
+" Version:     1.0.1
+" URL:         http://www.axisym3.net/jdany/vim-the-editor/#eclipse
+set background=light
+highlight clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let g:colors_name = "eclipse"
+
+highlight Normal gui=none guifg=#000000 guibg=#ffffff ctermfg=Gray
+
+" Search
+highlight IncSearch gui=underline guifg=#404040 guibg=#e0e040
+highlight Search    gui=none      guifg=#544060 guibg=#f0c0ff ctermbg=1
+
+" Messages
+highlight ErrorMsg   gui=none guifg=#f8f8f8 guibg=#4040ff
+highlight WarningMsg gui=none guifg=#f8f8f8 guibg=#4040ff
+highlight ModeMsg    gui=none guifg=#d06000 guibg=bg
+highlight MoreMsg    gui=none guifg=#0090a0 guibg=bg
+highlight Question   gui=none guifg=#8000ff guibg=bg
+
+" Split area
+highlight StatusLine   gui=none guifg=#ffffff guibg=#4570aa cterm=bold       ctermbg=blue     ctermfg=white
+highlight StatusLineNC gui=none guifg=#ffffff guibg=#75a0da cterm=none       ctermfg=darkgrey ctermbg=blue
+highlight VertSplit    gui=none guifg=#f8f8f8 guibg=#904838 ctermfg=darkgrey cterm=none       ctermbg=blue
+highlight WildMenu     gui=none guifg=#f8f8f8 guibg=#ff3030
+
+" Diff
+highlight DiffText   gui=none guifg=red   guibg=#ffd0d0 cterm=bold    ctermbg=5  ctermfg=3
+highlight DiffChange gui=none guifg=black guibg=#ffe7e7 cterm=none    ctermbg=5  ctermfg=7
+highlight DiffDelete gui=none guifg=bg    guibg=#e7e7ff ctermbg=black
+highlight DiffAdd    gui=none guifg=blue  guibg=#e7e7ff ctermbg=green cterm=bold
+
+" Cursor
+highlight Cursor   gui=none guifg=#ffffff guibg=#0080f0
+highlight lCursor  gui=none guifg=#ffffff guibg=#8040ff
+highlight CursorIM gui=none guifg=#ffffff guibg=#8040ff
+
+" Fold
+highlight Folded     gui=none guifg=#804030 guibg=#fff0d0 ctermbg=black ctermfg=black cterm=bold
+highlight FoldColumn gui=none guifg=#6b6b6b guibg=#e7e7e7 ctermfg=black ctermbg=white
+
+" Popup Menu
+highlight PMenu      ctermbg=green ctermfg=white
+highlight PMenuSel   ctermbg=white ctermfg=black
+highlight PMenuSBar  ctermbg=red   ctermfg=white
+highlight PMenuThumb ctermbg=white ctermfg=red
+
+" Other
+highlight Directory  gui=none guifg=#7050ff guibg=bg
+highlight LineNr     gui=none guifg=#6b6b6b guibg=#eeeeee
+highlight NonText    gui=none guifg=#707070 guibg=#e7e7e7
+highlight SpecialKey gui=none guifg=#c0c0c0 guibg=bg      cterm=none       ctermfg=4
+highlight Title      gui=bold guifg=#0033cc guibg=bg
+highlight Visual     gui=none guifg=#804020 guibg=#ffc0a0 ctermfg=DarkCyan
+
+" Syntax group
+highlight Comment    gui=none guifg=#236e25 guibg=bg      ctermfg=2
+highlight Constant   gui=none guifg=#00884c guibg=bg      ctermfg=White
+highlight Error      gui=none guifg=#f8f8f8 guibg=#4040ff term=reverse        ctermbg=Red    ctermfg=White
+highlight Identifier gui=none guifg=#b07800 guibg=bg      ctermfg=Green
+highlight Ignore     gui=none guifg=bg      guibg=bg      ctermfg=black
+highlight PreProc    gui=none guifg=#683821 guibg=bg      ctermfg=Green
+highlight Special    gui=none guifg=#8040f0 guibg=bg      ctermfg=DarkMagenta
+highlight Statement  gui=none guifg=#b64f90 guibg=bg      ctermfg=White
+highlight Todo       gui=none guifg=#ff5050 guibg=white   term=standout       ctermbg=Yellow ctermfg=Black
+highlight Type       gui=bold guifg=#7f0055 guibg=bg      ctermfg=LightGreen
+highlight Underlined gui=none guifg=blue    guibg=bg
+highlight String     gui=none guifg=#8010a0 guibg=bg      ctermfg=Yellow
+highlight Number     gui=none guifg=#0000ff guibg=bg      ctermfg=White
+
+if !has("gui_running")
+    hi link Float          Number
+    hi link Conditional    Repeat
+    hi link Include        PreProc
+    hi link Macro          PreProc
+    hi link PreCondit      PreProc
+    hi link StorageClass   Type
+    hi link Structure      Type
+    hi link Typedef        Type
+    hi link Tag            Special
+    hi link Delimiter      Normal
+    hi link SpecialComment Special
+    hi link Debug          Special
+endif
+
+" vim:ff=unix:
diff --git a/vim/colors/ekvoli.vim b/vim/colors/ekvoli.vim
new file mode 100644 (file)
index 0000000..3362968
--- /dev/null
@@ -0,0 +1,105 @@
+" Vim color file
+" Maintainer:  Preben Randhol <randhol+ekvoli@pvv.org>
+" Last Change: 2008 Feb 24
+" License:             GNU Public License (GPL) v2
+"
+" Version 1.6: Added colours for TVO and changed folding colour
+
+
+highlight clear Normal
+set background&
+
+" Remove all existing highlighting and set the defaults.
+highlight clear
+
+" Load the syntax highlighting defaults, if it's enabled.
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "ekvoli"
+
+hi Cursor              guifg=white gui=reverse,bold     
+hi iCursor             guifg=white gui=reverse,bold     
+hi rCursor             guifg=white gui=reverse,bold     
+hi vCursor             guifg=white gui=reverse,bold     
+hi lCursor             guifg=white gui=reverse,bold     
+hi nCursor             guifg=white gui=reverse,bold     
+hi CursorLine          guibg=#05456f gui=none
+hi CursorColumn        guibg=#05456f gui=none          
+
+
+hi Normal                      guifg=white guibg=#001535
+hi Error                       guibg=#6000a0 gui=bold,italic,undercurl guisp=white
+hi ErrorMsg                    guifg=white guibg=#287eff gui=bold,italic
+hi Visual                      guibg=#2080c0 guifg=white gui=bold
+hi VisualNOS           guibg=#6080a0 guifg=white gui=bold
+hi Todo                                guibg=#00a0d0 guifg=white gui=underline
+
+hi NonText                     guifg=#6590f0
+
+hi Search                      guibg=#667799 guifg=white gui=bold 
+hi IncSearch           guibg=#667799 guifg=white gui=bold 
+
+hi SpecialKey          guifg=#00c0e0
+hi Directory           guifg=#00c0e0
+hi Title                       guifg=#00a0f0 gui=none 
+hi WarningMsg          guifg=lightblue                 
+hi WildMenu                    guifg=white guibg=#0080c0
+hi Pmenu                       guifg=white guibg=#005090
+hi PmenuSel                    guifg=white guibg=#3070c0
+hi ModeMsg                     guifg=#22cce2           
+hi MoreMsg                     guifg=#22cce2 gui=bold  
+hi Question                    guifg=#22cce2 gui=none 
+
+hi MatchParen          guifg=white guibg=#3070c0 gui=bold
+
+hi StatusLine          guifg=white guibg=#104075 gui=bold
+hi StatusLineNC                guifg=#65a0f0 guibg=#104075 gui=none
+hi VertSplit           guifg=#305885 guibg=#305885 gui=none
+hi Folded                      guifg=#65b0f6 guibg=#122555 gui=italic
+hi FoldColumn          guifg=white guibg=#103366 gui=none
+hi LineNr                      guifg=#5080b0 gui=bold
+
+hi DiffAdd                     guibg=#2080a0 guifg=white gui=bold
+hi DiffChange          guibg=#2080a0 guifg=white gui=bold
+hi DiffDelete          guibg=#306080 guifg=white gui=none 
+hi DiffText                    guibg=#8070a0 guifg=white gui=bold 
+
+hi SpellBad            gui=undercurl,italic guisp=#76daff 
+hi SpellCap            gui=undercurl guisp=#7ba2ba 
+hi SpellRare           gui=undercurl guisp=#8080f0
+hi SpellLocal                  gui=undercurl guisp=#c0c0e0
+
+hi Comment             guifg=#9590d5 gui=italic
+
+
+hi Constant                    guifg=#87c6f0 gui=italic
+hi Special                     guifg=#50a0e0 gui=bold
+hi Identifier          guifg=#7fe9ff 
+hi Statement           guifg=white gui=bold
+hi PreProc                     guifg=#3f8fff gui=none
+
+hi type                                guifg=#90bfd0 gui=none 
+hi Ignore                      guifg=bg 
+hi Underlined          gui=underline cterm=underline term=underline
+
+
+" TVO - The Vim Outliner
+hi otlTab0    gui=bold,underline guifg=#eeeeff
+hi otlTab1    gui=bold,underline guifg=#3377ee
+hi otlTab2    gui=bold,underline guifg=#22cae2
+hi otlTab3    gui=bold,underline guifg=#9966ff
+hi otlTab5    gui=bold,underline guifg=#22aae2
+hi otlTab4    gui=bold,underline guifg=#92caf2
+hi otlTab7    gui=bold,underline guifg=#22bae2
+hi otlTab6    gui=bold,underline guifg=#8866ee
+hi otlTab8    gui=bold,underline guifg=#1166ee
+hi otlTab9    gui=bold,underline guifg=#99ddee
+hi otlTodo    gui=bold,underline guifg=white guibg=#00a0d0
+hi otlTagRef  guifg=white guibg=#8070a0   
+hi otlTagDef  guifg=white guibg=#005090
+
+
+
+
diff --git a/vim/colors/fine_blue.vim b/vim/colors/fine_blue.vim
new file mode 100644 (file)
index 0000000..89c280c
--- /dev/null
@@ -0,0 +1,71 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/10/30 Wed 00:12.
+"     version: 1.7
+" This color scheme uses a light background.
+
+set background=light
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "fine_blue"
+
+hi Normal       guifg=#404048 guibg=#f8f8f8
+
+" Search
+hi IncSearch    gui=UNDERLINE guifg=#404054 guibg=#40ffff
+hi Search       gui=NONE guifg=#404054 guibg=#ffffa0
+
+" Messages
+hi ErrorMsg     gui=NONE guifg=#ff0070 guibg=#ffe0f4
+hi WarningMsg   gui=NONE guifg=#ff0070 guibg=#ffe0f4
+hi ModeMsg      gui=NONE guifg=#0070ff guibg=NONE
+hi MoreMsg      gui=NONE guifg=#a800ff guibg=NONE
+hi Question     gui=NONE guifg=#008050 guibg=NONE
+
+" Split area
+hi StatusLine   gui=BOLD guifg=#f8f8f8 guibg=#404054
+hi StatusLineNC gui=NONE guifg=#b8b8c0 guibg=#404054
+hi VertSplit    gui=NONE guifg=#f8f8f8 guibg=#404054
+hi WildMenu     gui=BOLD guifg=#f8f8f8 guibg=#00aacc
+
+" Diff
+hi DiffText     gui=NONE guifg=#4040ff guibg=#c0c0ff
+hi DiffChange   gui=NONE guifg=#5050ff guibg=#e0e0ff
+hi DiffDelete   gui=NONE guifg=#4040ff guibg=#c8f2ea
+hi DiffAdd      gui=NONE guifg=#4040ff guibg=#c8f2ea
+
+" Cursor
+hi Cursor       gui=NONE guifg=#0000ff guibg=#00e0ff
+hi lCursor      gui=NONE guifg=#f8f8f8 guibg=#8000ff
+hi CursorIM     gui=NONE guifg=#f8f8f8 guibg=#8000ff
+
+" Fold
+hi Folded       gui=NONE guifg=#7820ff guibg=#e0d8ff
+hi FoldColumn   gui=NONE guifg=#aa60ff guibg=#f0f0f4
+" hi Folded       gui=NONE guifg=#58587c guibg=#e0e0e8
+" hi FoldColumn   gui=NONE guifg=#9090b0 guibg=#f0f0f4
+
+" Other
+hi Directory    gui=NONE guifg=#0070b8 guibg=NONE
+hi LineNr       gui=NONE guifg=#a0a0b0 guibg=NONE
+hi NonText      gui=BOLD guifg=#4000ff guibg=#ececf0
+hi SpecialKey   gui=NONE guifg=#d87000 guibg=NONE
+hi Title        gui=NONE guifg=#004060 guibg=#c8f0f8
+hi Visual       gui=NONE guifg=#404060 guibg=#dddde8
+" hi VisualNOS  gui=NONE guifg=#404060 guibg=#dddde8
+
+" Syntax group
+hi Comment      gui=NONE guifg=#ff00c0 guibg=NONE
+hi Constant     gui=NONE guifg=#2020ff guibg=#e8e8ff
+hi Error        gui=BOLD guifg=#ffffff guibg=#ff4080
+hi Identifier   gui=NONE guifg=#c800ff guibg=NONE
+hi Ignore       gui=NONE guifg=#f8f8f8 guibg=NONE
+hi PreProc      gui=NONE guifg=#0070e6 guibg=NONE
+hi Special      gui=NONE guifg=#005858 guibg=#ccf7ee
+hi Statement    gui=NONE guifg=#008858 guibg=NONE
+hi Todo         gui=NONE guifg=#ff0070 guibg=#ffe0f4
+hi Type         gui=NONE guifg=#7040ff guibg=NONE
+hi Underlined   gui=UNDERLINE guifg=#0000ff guibg=NONE
diff --git a/vim/colors/fine_blue2.vim b/vim/colors/fine_blue2.vim
new file mode 100644 (file)
index 0000000..89c280c
--- /dev/null
@@ -0,0 +1,71 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/10/30 Wed 00:12.
+"     version: 1.7
+" This color scheme uses a light background.
+
+set background=light
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "fine_blue"
+
+hi Normal       guifg=#404048 guibg=#f8f8f8
+
+" Search
+hi IncSearch    gui=UNDERLINE guifg=#404054 guibg=#40ffff
+hi Search       gui=NONE guifg=#404054 guibg=#ffffa0
+
+" Messages
+hi ErrorMsg     gui=NONE guifg=#ff0070 guibg=#ffe0f4
+hi WarningMsg   gui=NONE guifg=#ff0070 guibg=#ffe0f4
+hi ModeMsg      gui=NONE guifg=#0070ff guibg=NONE
+hi MoreMsg      gui=NONE guifg=#a800ff guibg=NONE
+hi Question     gui=NONE guifg=#008050 guibg=NONE
+
+" Split area
+hi StatusLine   gui=BOLD guifg=#f8f8f8 guibg=#404054
+hi StatusLineNC gui=NONE guifg=#b8b8c0 guibg=#404054
+hi VertSplit    gui=NONE guifg=#f8f8f8 guibg=#404054
+hi WildMenu     gui=BOLD guifg=#f8f8f8 guibg=#00aacc
+
+" Diff
+hi DiffText     gui=NONE guifg=#4040ff guibg=#c0c0ff
+hi DiffChange   gui=NONE guifg=#5050ff guibg=#e0e0ff
+hi DiffDelete   gui=NONE guifg=#4040ff guibg=#c8f2ea
+hi DiffAdd      gui=NONE guifg=#4040ff guibg=#c8f2ea
+
+" Cursor
+hi Cursor       gui=NONE guifg=#0000ff guibg=#00e0ff
+hi lCursor      gui=NONE guifg=#f8f8f8 guibg=#8000ff
+hi CursorIM     gui=NONE guifg=#f8f8f8 guibg=#8000ff
+
+" Fold
+hi Folded       gui=NONE guifg=#7820ff guibg=#e0d8ff
+hi FoldColumn   gui=NONE guifg=#aa60ff guibg=#f0f0f4
+" hi Folded       gui=NONE guifg=#58587c guibg=#e0e0e8
+" hi FoldColumn   gui=NONE guifg=#9090b0 guibg=#f0f0f4
+
+" Other
+hi Directory    gui=NONE guifg=#0070b8 guibg=NONE
+hi LineNr       gui=NONE guifg=#a0a0b0 guibg=NONE
+hi NonText      gui=BOLD guifg=#4000ff guibg=#ececf0
+hi SpecialKey   gui=NONE guifg=#d87000 guibg=NONE
+hi Title        gui=NONE guifg=#004060 guibg=#c8f0f8
+hi Visual       gui=NONE guifg=#404060 guibg=#dddde8
+" hi VisualNOS  gui=NONE guifg=#404060 guibg=#dddde8
+
+" Syntax group
+hi Comment      gui=NONE guifg=#ff00c0 guibg=NONE
+hi Constant     gui=NONE guifg=#2020ff guibg=#e8e8ff
+hi Error        gui=BOLD guifg=#ffffff guibg=#ff4080
+hi Identifier   gui=NONE guifg=#c800ff guibg=NONE
+hi Ignore       gui=NONE guifg=#f8f8f8 guibg=NONE
+hi PreProc      gui=NONE guifg=#0070e6 guibg=NONE
+hi Special      gui=NONE guifg=#005858 guibg=#ccf7ee
+hi Statement    gui=NONE guifg=#008858 guibg=NONE
+hi Todo         gui=NONE guifg=#ff0070 guibg=#ffe0f4
+hi Type         gui=NONE guifg=#7040ff guibg=NONE
+hi Underlined   gui=UNDERLINE guifg=#0000ff guibg=NONE
diff --git a/vim/colors/fnaqevan.vim b/vim/colors/fnaqevan.vim
new file mode 100644 (file)
index 0000000..d936cee
--- /dev/null
@@ -0,0 +1,67 @@
+" Vim color file
+" Maintainer: Rafal Sulejman <rms@poczta.onet.pl>
+" Last Change:  2002.06.18
+"
+" This color scheme uses a black (dark) background.
+
+" First remove all existing highlighting.
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "fnaqevan"
+
+hi Normal       guibg=#000000 guifg=#C0C0C0 gui=NONE
+
+" Main colors
+hi Constant     guibg=#000000 guifg=#00B8E0 gui=NONE
+hi Identifier   guibg=#000000 guifg=#FFA850 gui=NONE
+hi Special      guibg=#000000 guifg=#B899C8 gui=NONE
+hi Statement    guibg=#000000 guifg=#EEE840 gui=NONE
+hi Preproc      guibg=#000000 guifg=#00B098 gui=NONE
+hi Type         guibg=#000000 guifg=#40D040 gui=NONE
+
+" Secondary colors
+hi Comment      guibg=#000000 guifg=#006699 gui=NONE
+hi Visual       guibg=#005900 guifg=#40C940 gui=NONE
+hi VisualNOS    guibg=#005900 guifg=#40C940 gui=NONE
+hi Search       guibg=#707000 guifg=#FFFF00 gui=NONE
+hi IncSearch    guibg=#D05000 guifg=#FFE000 gui=NONE
+
+" Special colors
+hi WarningMsg   guibg=#707000 guifg=#FFFF00 gui=NONE
+hi MoreMsg      guibg=#000070 guifg=#00B8E0 gui=NONE
+hi ErrorMsg     guibg=#CC0000 guifg=#FFEE00 gui=NONE
+hi ModeMsg      guibg=#000000 guifg=#E8E8E8 gui=NONE
+hi WildMenu     guibg=#5f5f5f guifg=#FFEE60 gui=NONE
+hi StatusLine   guibg=#1f1f1f guifg=#F0F0F0 gui=NONE
+hi StatusLineNC guibg=#0f0f0f guifg=#eaea3a gui=NONE
+hi VertSplit    guibg=#1f1f1f guifg=#F0F0F0 gui=NONE
+hi Error        guibg=#EE0000 guifg=#FFDD60 gui=NONE
+hi Todo         guibg=#EEE000 guifg=#000000 gui=NONE
+hi Title        guibg=#000000 guifg=#ffffff gui=NONE
+hi Question     guibg=#005900 guifg=#40E840 gui=NONE
+hi LineNr       guibg=#000000 guifg=#F0B0E0 gui=NONE
+hi Directory    guibg=#000000 guifg=#D0D0D0 gui=NONE
+hi NonText      guibg=#000000 guifg=#FFDDAA gui=NONE
+hi SpecialKey   guibg=#000000 guifg=#FFFFFF gui=NONE
+
+" Diff colors
+hi DiffAdd      guibg=#505050 guifg=#D0D0D0 gui=NONE
+hi DiffChange   guibg=#505050 guifg=#D0D0D0 gui=NONE
+hi DiffDelete   guibg=#505050 guifg=#D0D0D0 gui=NONE
+hi DiffText     guibg=#707070 guifg=#F0F0F0 gui=NONE
+
+" Folding colors
+hi Folded       guibg=#703070 guifg=#DDB8DD gui=NONE
+hi FoldColumn   guibg=#C4153B guifg=#F0F0F0 gui=NONE
+
+" Cursor colors
+hi Cursor       guibg=#FFFFFF guifg=#000000 gui=NONE
+hi icursor      guibg=#FFEE00 guifg=#000000 gui=NONE
+hi ncursor      guibg=#FFFFFF guifg=#000000 gui=NONE
+hi rcursor      guibg=#00CCFF guifg=#000000 gui=NONE
+hi lcursor      guibg=#40D040 guifg=#000000 gui=NONE
+
diff --git a/vim/colors/fog.vim b/vim/colors/fog.vim
new file mode 100644 (file)
index 0000000..ab263ab
--- /dev/null
@@ -0,0 +1,170 @@
+" Vim color file
+" vim: tw=0 ts=4 sw=4
+" Maintainer:  Thomas R. Kimpton <tomk@emcity.net>
+" Last Change: 2001 Nov 8
+" This color scheme is meant for the person that spends hours
+" and hours and hours and... in vim and wants some contrast to
+" help pick things out in the files they edit, but doesn't want
+" **C**O**N**T**R**A**S**T**!
+
+set background=light
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "fog"
+
+hi Normal              ctermbg=White           ctermfg=Black
+" 660066 = darkish purple
+hi Normal              guifg=#660066           guibg=grey80
+
+hi NonText             term=bold
+hi NonText             ctermfg=LightBlue
+hi NonText             gui=bold                        guifg=LightBlue                 guibg=grey80
+
+hi Comment             ctermfg=DarkGrey        ctermbg=White
+" 444499 = darkish blue grey
+hi Comment             guifg=#444499
+
+hi Constant            term=underline
+hi Constant            ctermfg=Magenta
+hi Constant            guifg=#7070a0
+
+hi Statement   term=bold
+hi Statement   cterm=bold                      ctermfg=DarkGreen               ctermbg=White
+hi Statement   guifg=DarkGreen         gui=bold
+
+hi identifier  ctermfg=DarkGreen
+hi identifier  guifg=DarkGreen
+
+hi preproc             ctermfg=DarkGreen
+hi preproc             guifg=#408040
+
+hi type                        ctermfg=DarkBlue
+hi type                        guifg=DarkBlue
+
+hi label               ctermfg=yellow
+hi label               guifg=#c06000
+
+hi operator            ctermfg=darkYellow
+hi operator            guifg=DarkGreen         gui=bold
+
+hi StorageClass        ctermfg=DarkRed                 ctermbg=White
+hi StorageClass        guifg=#a02060                   gui=bold
+
+hi Number              ctermfg=Blue            ctermbg=White
+hi Number              guifg=Blue
+
+hi Special             term=bold
+hi Special             ctermfg=LightRed
+hi Special             guifg=#aa8822
+
+hi Cursor              ctermbg=DarkMagenta
+hi Cursor              guibg=#880088           guifg=LightGrey
+
+hi lCursor             guibg=Cyan                      guifg=Black
+
+hi ErrorMsg            term=standout
+hi ErrorMsg            ctermbg=DarkRed         ctermfg=White
+hi ErrorMsg            guibg=DarkRed           guifg=White
+
+hi DiffText            term=reverse
+hi DiffText            cterm=bold                      ctermbg=DarkRed
+hi DiffText            gui=bold                        guibg=DarkRed
+
+hi Directory   term=bold
+hi Directory   ctermfg=LightRed
+hi Directory   guifg=Red gui=underline
+
+hi LineNr              term=underline
+hi LineNr              ctermfg=Yellow
+hi LineNr              guifg=#ccaa22
+
+hi MoreMsg             term=bold
+hi MoreMsg             ctermfg=LightGreen
+hi MoreMsg             gui=bold                        guifg=SeaGreen
+
+hi Question            term=standout
+hi Question            ctermfg=LightGreen
+hi Question            gui=bold                        guifg=DarkGreen
+
+hi Search              term=reverse
+hi Search              ctermbg=DarkYellow      ctermfg=Black
+hi Search              guibg=#887722           guifg=Black
+
+hi SpecialKey  term=bold
+hi SpecialKey  ctermfg=LightBlue
+hi SpecialKey  guifg=Blue
+
+hi SpecialChar ctermfg=DarkGrey        ctermbg=White
+hi SpecialChar guifg=DarkGrey          gui=bold
+
+hi Title               term=bold
+hi Title               ctermfg=LightMagenta
+hi Title               gui=underline                   guifg=DarkMagenta
+
+hi WarningMsg  term=standout
+hi WarningMsg  ctermfg=LightRed
+hi WarningMsg  guifg=DarkBlue          guibg=#9999cc
+
+hi WildMenu            term=standout
+hi WildMenu            ctermbg=Yellow          ctermfg=Black
+hi WildMenu            guibg=Yellow            guifg=Black gui=underline
+
+hi Folded              term=standout
+hi Folded              ctermbg=LightGrey       ctermfg=DarkBlue
+hi Folded              guibg=LightGrey         guifg=DarkBlue
+
+hi FoldColumn  term=standout
+hi FoldColumn  ctermbg=LightGrey       ctermfg=DarkBlue
+hi FoldColumn  guibg=Grey                      guifg=DarkBlue
+
+hi DiffAdd             term=bold
+hi DiffAdd             ctermbg=DarkBlue
+hi DiffAdd             guibg=DarkBlue
+
+hi DiffChange  term=bold
+hi DiffChange  ctermbg=DarkMagenta
+hi DiffChange  guibg=DarkMagenta
+
+hi DiffDelete  term=bold
+hi DiffDelete  ctermfg=Blue            ctermbg=DarkCyan
+hi DiffDelete  gui=bold                        guifg=Blue                      guibg=DarkCyan
+
+hi Ignore              ctermfg=LightGrey
+hi Ignore              guifg=grey90
+
+hi IncSearch   term=reverse
+hi IncSearch   cterm=reverse
+hi IncSearch   gui=reverse
+
+hi ModeMsg             term=bold
+hi ModeMsg             cterm=bold
+hi ModeMsg             gui=bold
+
+hi StatusLine  term=reverse,bold
+hi StatusLine  cterm=reverse,bold
+hi StatusLine  gui=reverse,bold
+
+hi StatusLineNC        term=reverse
+hi StatusLineNC        cterm=reverse
+hi StatusLineNC        gui=reverse
+
+hi VertSplit   term=reverse
+hi VertSplit   cterm=reverse
+hi VertSplit   gui=reverse
+
+hi Visual              term=reverse
+hi Visual              cterm=reverse
+hi Visual              gui=reverse                     guifg=DarkGrey          guibg=fg
+
+hi VisualNOS   term=underline,bold
+hi VisualNOS   cterm=underline,bold
+hi VisualNOS   gui=underline,bold
+
+hi Todo                        gui=reverse
+
+" vim: sw=2
diff --git a/vim/colors/freya.vim b/vim/colors/freya.vim
new file mode 100644 (file)
index 0000000..a8adbd4
--- /dev/null
@@ -0,0 +1,79 @@
+set background=dark
+
+hi clear
+
+if exists("syntax_on")
+    syntax reset
+endif
+
+let colors_name = "freya"
+
+hi Normal ctermbg=0 ctermfg=7 cterm=none guibg=#2a2a2a guifg=#dcdccc gui=none
+
+hi Cursor guibg=fg guifg=bg gui=none
+hi CursorColumn guibg=#3f3f3f gui=none
+hi CursorLine guibg=#3f3f3f gui=none
+hi DiffAdd guibg=#008b00 guifg=fg gui=none
+hi DiffChange guibg=#00008b guifg=fg gui=none
+hi DiffDelete guibg=#8b0000 guifg=fg gui=none
+hi DiffText guibg=#0000cd guifg=fg gui=bold
+hi Directory guibg=bg guifg=#d4b064 gui=none
+hi ErrorMsg guibg=bg guifg=#f07070 gui=bold
+hi FoldColumn ctermbg=bg guibg=bg guifg=#c2b680 gui=none
+hi Folded guibg=#101010 guifg=#c2b680 gui=none
+hi IncSearch guibg=#866a4f guifg=fg gui=none
+hi LineNr guibg=bg guifg=#9f8f80 gui=none
+hi ModeMsg guibg=bg guifg=fg gui=bold
+hi MoreMsg guibg=bg guifg=#dabfa5 gui=bold
+hi NonText ctermfg=8 guibg=bg guifg=#9f8f80 gui=bold
+hi Pmenu guibg=#a78869 guifg=#000000 gui=none
+hi PmenuSbar guibg=#B99F86 guifg=fg gui=none
+hi PmenuSel guibg=#c0aa94 guifg=bg gui=none
+hi PmenuThumb guibg=#f7f7f1 guifg=bg gui=none
+hi Question guibg=bg guifg=#dabfa5 gui=bold
+hi Search guibg=#c0aa94 guifg=bg gui=none
+hi SignColumn ctermbg=bg guibg=bg guifg=#c2b680 gui=none
+hi SpecialKey guibg=bg guifg=#d4b064 gui=none
+if has("spell")
+    hi SpellBad guisp=#f07070 gui=undercurl
+    hi SpellCap guisp=#7070f0 gui=undercurl
+    hi SpellLocal guisp=#70f0f0 gui=undercurl
+    hi SpellRare guisp=#f070f0 gui=undercurl
+endif
+hi StatusLine ctermbg=7 ctermfg=0 guibg=#736559 guifg=#f7f7f1 gui=bold
+hi StatusLineNC ctermbg=8 ctermfg=0 guibg=#564d43 guifg=#f7f7f1 gui=none
+hi TabLine guibg=#564d43 guifg=#f7f7f1 gui=underline
+hi TabLineFill guibg=#564d43 guifg=#f7f7f1 gui=underline
+hi TabLineSel guibg=bg guifg=#f7f7f1 gui=bold
+hi Title ctermbg=0 ctermfg=15 guifg=#f7f7f1 gui=bold
+hi VertSplit ctermbg=7 ctermfg=0 guibg=#564d43 guifg=#f7f7f1 gui=none
+if version >= 700
+    hi Visual ctermbg=7 ctermfg=0 guibg=#5f5f5f gui=none
+else
+    hi Visual ctermbg=7 ctermfg=0 guibg=#5f5f5f guifg=fg gui=none
+endif
+hi VisualNOS guibg=bg guifg=#c0aa94 gui=bold,underline
+hi WarningMsg guibg=bg guifg=#f07070 gui=none
+hi WildMenu guibg=#c0aa94 guifg=bg gui=bold
+
+hi Comment guibg=bg guifg=#c2b680 gui=none
+hi Constant guibg=bg guifg=#afe091 gui=none
+hi Error guibg=bg guifg=#f07070 gui=none
+hi Identifier guibg=bg guifg=#dabfa5 gui=none
+hi Ignore guibg=bg guifg=bg gui=none
+hi lCursor guibg=#c0aa94 guifg=bg gui=none
+hi MatchParen guibg=#008b8b gui=none
+hi PreProc guibg=bg guifg=#c2aed0 gui=none
+hi Special guibg=bg guifg=#d4b064 gui=none
+hi Statement guibg=bg guifg=#e0af91 gui=bold
+hi Todo guibg=#aed0ae guifg=bg gui=none
+hi Type guibg=bg guifg=#dabfa5 gui=bold
+hi Underlined guibg=bg guifg=#d4b064 gui=underline
+
+hi htmlBold ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=bold
+hi htmlItalic ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=italic
+hi htmlUnderline ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=underline
+hi htmlBoldItalic ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=bold,italic
+hi htmlBoldUnderline ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=bold,underline
+hi htmlBoldUnderlineItalic ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=bold,underline,italic
+hi htmlUnderlineItalic ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=underline,italic
diff --git a/vim/colors/fruit.vim b/vim/colors/fruit.vim
new file mode 100644 (file)
index 0000000..624b90f
--- /dev/null
@@ -0,0 +1,69 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/08/28 Wed 00:28.
+"     version: 1.3
+" This color scheme uses a light background.
+
+set background=light
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "fruit"
+
+hi Normal       guifg=#404040 guibg=#f8f8f8
+
+" Search
+hi IncSearch    gui=UNDERLINE guifg=#404040 guibg=#40ffff
+hi Search       gui=NONE guifg=#404040 guibg=#ffff60
+
+" Messages
+hi ErrorMsg     gui=NONE guifg=#ff0000 guibg=#ffe4e4
+hi WarningMsg   gui=NONE guifg=#ff0000 guibg=#ffe4e4
+hi ModeMsg      gui=NONE guifg=#ff4080 guibg=NONE
+hi MoreMsg      gui=NONE guifg=#009070 guibg=NONE
+hi Question     gui=NONE guifg=#f030d0 guibg=NONE
+
+" Split area
+hi StatusLine   gui=BOLD guifg=#f8f8f8 guibg=#404040
+hi StatusLineNC gui=NONE guifg=#a4a4a4 guibg=#404040
+hi VertSplit    gui=NONE guifg=#f8f8f8 guibg=#404040
+hi WildMenu     gui=BOLD guifg=#f8f8f8 guibg=#ff4080
+
+" Diff
+hi DiffText     gui=NONE guifg=#e04040 guibg=#ffd8d8
+hi DiffChange   gui=NONE guifg=#408040 guibg=#d0f0d0
+hi DiffDelete   gui=NONE guifg=#4848ff guibg=#ffd0ff
+hi DiffAdd      gui=NONE guifg=#4848ff guibg=#ffd0ff
+
+" Cursor
+hi Cursor       gui=NONE guifg=#0000ff guibg=#00e0ff
+hi lCursor      gui=NONE guifg=#f8f8f8 guibg=#8000ff
+hi CursorIM     gui=NONE guifg=#f8f8f8 guibg=#8000ff
+
+" Fold
+hi Folded       gui=NONE guifg=#20605c guibg=#b8e8dc
+hi FoldColumn   gui=NONE guifg=#40a098 guibg=#f0f0f0
+
+" Other
+hi Directory    gui=NONE guifg=#0070b8 guibg=NONE
+hi LineNr       gui=NONE guifg=#acacac guibg=NONE
+hi NonText      gui=BOLD guifg=#00a0c0 guibg=#ececec
+hi SpecialKey   gui=NONE guifg=#4040ff guibg=NONE
+hi Title        gui=NONE guifg=#0050a0 guibg=#c0e8ff
+hi Visual       gui=NONE guifg=#484848 guibg=#e0e0e0
+" hi VisualNOS    gui=NONE guifg=#484848 guibg=#e0e0e0
+
+" Syntax group
+hi Comment      gui=NONE guifg=#ff4080 guibg=NONE
+hi Constant     gui=NONE guifg=#8016ff guibg=NONE
+hi Error        gui=BOLD guifg=#ffffff guibg=#ff4080
+hi Identifier   gui=NONE guifg=#008888 guibg=NONE
+hi Ignore       gui=NONE guifg=#f8f8f8 guibg=NONE
+hi PreProc      gui=NONE guifg=#e06800 guibg=NONE
+hi Special      gui=NONE guifg=#4a9400 guibg=NONE
+hi Statement    gui=NONE guifg=#f030d0 guibg=NONE
+hi Todo         gui=UNDERLINE guifg=#ff0070 guibg=#ffe0f4
+hi Type         gui=NONE guifg=#0070e6 guibg=NONE
+hi Underlined   gui=UNDERLINE guifg=fg guibg=NONE
diff --git a/vim/colors/fruity.vim b/vim/colors/fruity.vim
new file mode 100644 (file)
index 0000000..3c9a7df
--- /dev/null
@@ -0,0 +1,147 @@
+"
+" Fruity Color Scheme
+" ===================
+"
+" Author:   Armin Ronacher <armin.ronacher@active-4.com>
+" Version:  0.2
+"
+set background=dark
+
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let colors_name = "fruity"
+
+" Default Colors
+hi Normal       guifg=#ffffff   guibg=#111111
+hi NonText      guifg=#444444   guibg=#000000
+hi Cursor       guibg=#aaaaaa
+hi lCursor      guibg=#aaaaaa
+
+" Search
+hi Search       guifg=#800000   guibg=#ffae00
+hi IncSearch    guifg=#800000   guibg=#ffae00
+
+" Window Elements
+hi StatusLine   guifg=#ffffff   guibg=#8090a0   gui=bold
+hi StatusLineNC guifg=#506070   guibg=#a0b0c0
+hi VertSplit    guifg=#a0b0c0   guibg=#a0b0c0
+hi Folded       guifg=#111111   guibg=#8090a0
+hi IncSearch    guifg=#708090   guibg=#f0e68c
+hi Pmenu        guifg=#ffffff   guibg=#cb2f27
+hi SignColumn   guibg=#111111
+hi CursorLine   guibg=#181818
+hi LineNr       guifg=#aaaaaa   guibg=#222222
+
+" Specials
+hi Todo         guifg=#e50808   guibg=#520000   gui=bold
+hi Title        guifg=#ffffff                   gui=bold
+hi Special      guifg=#fd8900
+
+" Syntax Elements
+hi String       guifg=#0086d2
+hi Constant     guifg=#0086d2
+hi Number       guifg=#0086f7                   gui=bold
+hi Statement    guifg=#fb660a                   gui=bold
+hi Function     guifg=#ff0086                   gui=bold
+hi PreProc      guifg=#ff0007                   gui=bold
+hi Comment      guifg=#00d2ff   guibg=#0f140f   gui=italic
+hi Type         guifg=#cdcaa9                   gui=bold
+hi Error        guifg=#ffffff   guibg=#ab0000
+hi Identifier   guifg=#ff0086                   gui=bold
+hi Label        guifg=#ff0086
+
+" Python Highlighting for python.vim
+hi pythonCoding guifg=#ff0086
+hi pythonRun    guifg=#ff0086
+hi pythonBuiltinObj     guifg=#2b6ba2           gui=bold
+hi pythonBuiltinFunc    guifg=#2b6ba2           gui=bold
+hi pythonException      guifg=#ee0000           gui=bold
+hi pythonExClass        guifg=#66cd66           gui=bold
+hi pythonSpaceError     guibg=#270000
+hi pythonDocTest    guifg=#2f5f49
+hi pythonDocTest2   guifg=#3b916a
+hi pythonFunction   guifg=#ee0000               gui=bold
+hi pythonClass      guifg=#ff0086               gui=bold
+
+" JavaScript Highlighting
+hi javaScript                   guifg=#ffffff
+hi javaScriptRegexpString       guifg=#aa6600
+hi javaScriptDocComment         guifg=#aaaaaa
+hi javaScriptCssStyles          guifg=#dd7700
+hi javaScriptDomElemFuncs       guifg=#66cd66
+hi javaScriptHtmlElemFuncs      guifg=#dd7700
+hi javaScriptLabel              guifg=#00bdec   gui=italic
+hi javaScriptPrototype          guifg=#00bdec
+hi javaScriptConditional        guifg=#ff0007   gui=bold
+hi javaScriptRepeat             guifg=#ff0007   gui=bold
+hi javaScriptFunction           guifg=#ff0086   gui=bold
+
+" CSS Highlighting
+hi cssIdentifier            guifg=#66cd66       gui=bold
+hi cssBraces                guifg=#00bdec       gui=bold
+
+" Ruby Highlighting
+hi rubyFunction     guifg=#0066bb               gui=bold
+hi rubyClass        guifg=#ff0086               gui=bold
+hi rubyModule       guifg=#ff0086               gui=bold,underline
+hi rubyKeyword      guifg=#008800               gui=bold
+hi rubySymbol       guifg=#aa6600
+hi rubyIndentifier              guifg=#008aff
+hi rubyGlobalVariable           guifg=#dd7700
+hi rubyConstant                 guifg=#5894d2   gui=bold
+hi rubyBlockParameter           guifg=#66cd66
+hi rubyPredefinedIdentifier     guifg=#555555   gui=bold
+hi rubyString           guifg=#0086d2
+hi rubyStringDelimiter  guifg=#dd7700
+hi rubySpaceError       guibg=#270000
+hi rubyDocumentation    guifg=#aaaaaa
+hi rubyData             guifg=#555555
+
+" XML Highlighting
+hi xmlTag           guifg=#00bdec
+hi xmlTagName       guifg=#00bdec
+hi xmlEndTag        guifg=#00bdec
+hi xmlNamespace     guifg=#00bdec                   gui=underline
+hi xmlAttribPunct   guifg=#cccaa9                   gui=bold
+hi xmlEqual         guifg=#cccaa9                   gui=bold
+hi xmlCdata         guifg=#bf0945                   gui=bold
+hi xmlCdataCdata        guifg=#ac1446   guibg=#23010c   gui=none
+hi xmlCdataStart        guifg=#bf0945                   gui=bold
+hi xmlCdataEnd          guifg=#bf0945                   gui=bold
+
+" HTML Highlighting
+hi htmlTag          guifg=#00bdec               gui=bold
+hi htmlEndTag       guifg=#00bdec               gui=bold
+hi htmlSpecialTagName   guifg=#66cd66
+hi htmlTagName      guifg=#66cd66
+hi htmlTagN         guifg=#66cd66
+hi htmlEvent        guifg=#ffffff
+
+" Django Highlighting
+hi djangoTagBlock   guifg=#ff0007   guibg=#200000   gui=bold
+hi djangoVarBlock   guifg=#ff0007   guibg=#200000
+hi djangoArgument   guifg=#0086d2   guibg=#200000
+hi djangoStatement  guifg=#fb660a   guibg=#200000   gui=bold
+hi djangoComment    guifg=#008800   guibg=#002300   gui=italic
+hi djangoFilter     guifg=#ff0086   guibg=#200000   gui=italic
+
+" Jinja Highlighting
+hi jinjaTagBlock    guifg=#ff0007   guibg=#200000   gui=bold
+hi jinjaVarBlock    guifg=#ff0007   guibg=#200000
+hi jinjaString      guifg=#0086d2   guibg=#200000
+hi jinjaNumber      guifg=#bf0945   guibg=#200000   gui=bold
+hi jinjaStatement   guifg=#fb660a   guibg=#200000   gui=bold
+hi jinjaComment     guifg=#008800   guibg=#002300   gui=italic
+hi jinjaFilter      guifg=#ff0086   guibg=#200000
+hi jinjaRaw         guifg=#aaaaaa   guibg=#200000
+hi jinjaOperator    guifg=#ffffff   guibg=#200000
+hi jinjaVariable    guifg=#92cd35   guibg=#200000
+hi jinjaAttribute   guifg=#dd7700   guibg=#200000
+hi jinjaSpecial     guifg=#008ffd   guibg=#200000
+
+" ERuby Highlighting (for my eruby.vim)
+hi erubyRubyDelim   guifg=#2c8a16                   gui=bold
+hi erubyComment     guifg=#4d9b3a                   gui=italic
diff --git a/vim/colors/golden.vim b/vim/colors/golden.vim
new file mode 100644 (file)
index 0000000..8cceaf7
--- /dev/null
@@ -0,0 +1,70 @@
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+"
+" Creator: Ryan Phillips <ryan@trolocsis.com>
+" Credits: This color scheme originated from the idea of 
+"          Jeffrey Bakker, the creator of webcpp (http://webcpp.sourceforge.net/).
+"     URL: http://www.trolocsis.com/vim/golden.vim
+"
+
+hi clear
+set background=dark
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "golden"
+hi Normal                ctermfg=yellow guifg=#ddbb00  guibg=black
+hi Scrollbar     ctermfg=Yellow guifg=#ddbb00  guibg=black
+hi Menu                          ctermfg=darkyellow guifg=#ffddaa  guibg=black
+hi SpecialKey    ctermfg=yellow term=bold  cterm=bold  guifg=#ffddaa 
+hi NonText               ctermfg=LightBlue term=bold  cterm=bold  gui=bold     guifg=#DBCA98
+hi Directory     ctermfg=DarkYellow term=bold  cterm=bold  guifg=#ffddaa
+hi ErrorMsg              term=standout  cterm=bold  ctermfg=White  ctermbg=Red  guifg=White  guibg=Red
+hi Search                term=reverse  ctermfg=white  ctermbg=red      guifg=white  guibg=Red
+hi MoreMsg               term=bold  cterm=bold  ctermfg=Yellow gui=bold  guifg=#ddbb00
+hi ModeMsg               term=bold  ctermfg=DarkYellow cterm=bold  gui=bold  guifg=Black       guibg=#ddbb00
+hi LineNr                term=underline ctermfg=Brown cterm=bold guifg=#978345
+hi Question              term=standout  cterm=bold  ctermfg=Brown      gui=bold  guifg=#ffddaa
+hi StatusLine    term=bold,reverse  cterm=bold ctermfg=Black ctermbg=DarkGrey gui=bold guifg=#978345 guibg=#2E2E2E
+hi StatusLineNC   term=reverse ctermfg=white ctermbg=black guifg=grey guibg=#3E3E3E
+hi Title                 term=bold  cterm=bold  ctermfg=brown  gui=bold        guifg=#DBCA98
+hi Visual                term=reverse  cterm=reverse  gui=reverse
+hi WarningMsg    term=standout  cterm=bold  ctermfg=darkblue  guifg=Red
+hi Cursor                guifg=bg      guibg=#FF5E06 ctermbg=Brown
+hi Comment               term=bold  cterm=bold ctermfg=brown  guifg=#978345
+hi Constant              term=underline  cterm=bold ctermfg=red  guifg=Red
+hi Special               term=bold  cterm=bold ctermfg=red guifg=Orange
+hi Identifier    term=underline ctermfg=lightgray  guifg=#DBCA98
+hi Statement     term=bold  cterm=bold ctermfg=lightgreen      gui=bold  guifg=#ffff60
+hi PreProc               term=underline  ctermfg=brown guifg=#ffddaa
+hi Type                          term=underline  cterm=bold ctermfg=lightgreen  gui=bold  guifg=#FFE13F
+hi Error                 term=reverse  ctermfg=darkcyan  ctermbg=black  guifg=Red      guibg=Black
+hi Todo                          term=standout  ctermfg=black  ctermbg=yellow  guifg=#FFE13F  guibg=#2E2E2E
+hi VertSplit      guifg=#2E2E2E guibg=#978345 ctermfg=black ctermbg=darkgrey
+hi Folded                guifg=orange  guibg=#2E2E2E ctermfg=yellow
+
+hi link IncSearch              Visual
+hi link String                 Constant
+hi link Character              Constant
+hi link Number                 Constant
+hi link Boolean                        Constant
+hi link Float                  Number
+hi link Function               Identifier
+hi link Conditional            Statement
+hi link Repeat                 Statement
+hi link Label                  Statement
+hi link Operator               Statement
+hi link Keyword                        Statement
+hi link Exception              Statement
+hi link Include                        PreProc
+hi link Define                 PreProc
+hi link Macro                  PreProc
+hi link PreCondit              PreProc
+hi link StorageClass   Type
+hi link Structure              Type
+hi link Typedef                        Type
+hi link Tag                            Special
+hi link SpecialChar            Special
+hi link Delimiter              Special
+hi link SpecialComment Special
+hi link Debug                  Special
diff --git a/vim/colors/guardian.vim b/vim/colors/guardian.vim
new file mode 100644 (file)
index 0000000..5bba649
--- /dev/null
@@ -0,0 +1,103 @@
+" Vim color file
+" Maintainer: Anders Korte <anderskorte@eml.cc>
+" Last Change: 6 Apr 2005
+
+" Guardian color scheme 1.2
+
+" Rich-syntax colors for source editing and other vimming.
+
+set background=dark
+hi clear
+syntax reset
+
+" Colors for the User Interface.
+
+hi Cursor      guibg=#cc4455  guifg=white    gui=bold ctermbg=4 ctermfg=15
+hi link CursorIM Cursor
+hi Normal      guibg=#332211  guifg=white    gui=none ctermbg=0 ctermfg=15
+hi NonText     guibg=#445566  guifg=#ffeecc  gui=bold ctermbg=8 ctermfg=14
+hi Visual      guibg=#557799  guifg=white    gui=none ctermbg=9 ctermfg=15
+
+hi Linenr      guibg=bg              guifg=#aaaaaa  gui=none ctermbg=bg ctermfg=7
+
+hi Directory   guibg=bg              guifg=#337700  gui=none ctermbg=bg ctermfg=10
+
+hi IncSearch   guibg=#0066cc  guifg=white    gui=none ctermbg=1 ctermfg=15
+hi link Seach IncSearch
+
+hi SpecialKey  guibg=bg        guifg=fg       gui=none ctermbg=bg ctermfg=fg
+hi Titled      guibg=bg        guifg=fg       gui=none ctermbg=bg ctermfg=fg
+
+hi ErrorMsg    guibg=bg        guifg=#ff0000  gui=bold ctermbg=bg ctermfg=12
+hi ModeMsg     guibg=bg        guifg=#ffeecc  gui=none ctermbg=bg ctermfg=14
+hi link         MoreMsg     ModeMsg
+hi Question    guibg=bg        guifg=#ccffcc  gui=bold ctermbg=bg ctermfg=10
+hi link         WarningMsg  ErrorMsg
+
+hi StatusLine    guibg=#ffeecc  guifg=black    gui=bold ctermbg=14 ctermfg=0
+hi StatusLineNC          guibg=#cc4455  guifg=white    gui=none ctermbg=4  ctermfg=11
+hi VertSplit     guibg=#cc4455  guifg=white    gui=none ctermbg=4  ctermfg=11
+
+hi DiffAdd     guibg=#446688  guifg=fg   gui=none ctermbg=1 ctermfg=fg
+hi DiffChange  guibg=#558855  guifg=fg   gui=none ctermbg=2 ctermfg=fg
+hi DiffDelete  guibg=#884444  guifg=fg   gui=none ctermbg=4 ctermfg=fg
+hi DiffText    guibg=#884444  guifg=fg   gui=bold ctermbg=4 ctermfg=fg
+
+" Colors for Syntax Highlighting.
+
+hi Comment  guibg=#334455  guifg=#dddddd  gui=none    ctermbg=8          ctermfg=7
+
+hi Constant    guibg=bg           guifg=white    gui=bold    ctermbg=8   ctermfg=15
+hi String      guibg=bg           guifg=#ffffcc  gui=italic  ctermbg=bg  ctermfg=14
+hi Character   guibg=bg           guifg=#ffffcc  gui=bold    ctermbg=bg  ctermfg=14
+hi Number      guibg=bg           guifg=#bbddff  gui=bold    ctermbg=1   ctermfg=15
+hi Boolean     guibg=bg           guifg=#bbddff  gui=none    ctermbg=1   ctermfg=15
+hi Float       guibg=bg           guifg=#bbddff  gui=bold    ctermbg=1   ctermfg=15
+
+hi Identifier  guibg=bg    guifg=#ffddaa  gui=bold    ctermbg=bg  ctermfg=12
+hi Function    guibg=bg    guifg=#ffddaa  gui=bold    ctermbg=bg  ctermfg=12
+hi Statement   guibg=bg    guifg=#ffffcc  gui=bold    ctermbg=bg  ctermfg=14
+
+hi Conditional guibg=bg    guifg=#ff6666  gui=bold    ctermbg=bg  ctermfg=12
+hi Repeat      guibg=bg    guifg=#ff9900  gui=bold    ctermbg=4   ctermfg=14
+hi Label       guibg=bg    guifg=#ffccff  gui=bold    ctermbg=bg   ctermfg=13
+hi Operator    guibg=bg    guifg=#cc9966  gui=bold    ctermbg=6   ctermfg=15
+hi Keyword     guibg=bg           guifg=#66ffcc  gui=bold    ctermbg=bg  ctermfg=10
+hi Exception   guibg=bg           guifg=#66ffcc  gui=bold    ctermbg=bg  ctermfg=10
+
+hi PreProc       guibg=bg       guifg=#ffcc99  gui=bold ctermbg=4  ctermfg=14
+hi Include       guibg=bg       guifg=#99cc99  gui=bold ctermbg=bg ctermfg=10
+hi link Define   Include
+hi link Macro    Include
+hi link PreCondit Include
+
+hi Type                  guibg=bg       guifg=#ff7788  gui=bold    ctermbg=bg  ctermfg=12
+hi StorageClass          guibg=bg       guifg=#99cc99  gui=bold    ctermbg=bg  ctermfg=10
+hi Structure     guibg=bg       guifg=#99ff99  gui=bold    ctermbg=bg  ctermfg=10
+hi Typedef       guibg=bg       guifg=#99cc99  gui=italic  ctermbg=bg  ctermfg=10
+
+hi Special       guibg=bg       guifg=#bbddff  gui=bold    ctermbg=1   ctermfg=15
+hi SpecialChar   guibg=bg       guifg=#bbddff  gui=bold    ctermbg=1   ctermfg=15
+hi Tag           guibg=bg       guifg=#bbddff  gui=bold    ctermbg=1   ctermfg=15
+hi Delimiter     guibg=bg       guifg=fg       gui=bold    ctermbg=1   ctermfg=fg
+hi SpecialComment guibg=#334455         guifg=#dddddd  gui=italic  ctermbg=1   ctermfg=15
+hi Debug         guibg=bg       guifg=#ff9999  gui=none    ctermbg=8   ctermfg=12
+
+hi Underlined guibg=bg guifg=#99ccff gui=underline ctermbg=bg ctermfg=9 cterm=underline
+
+hi Title    guibg=#445566  guifg=white   gui=bold    ctermbg=1   ctermfg=15
+hi Ignore   guibg=bg      guifg=#cccccc  gui=italic  ctermbg=bg  ctermfg=8
+hi Error    guibg=#ff0000  guifg=white   gui=bold    ctermbg=12  ctermfg=15
+hi Todo            guibg=#556677  guifg=#ff0000  gui=bold    ctermbg=1   ctermfg=12
+
+hi htmlH2 guibg=bg guifg=fg gui=bold ctermbg=8 ctermfg=fg
+hi link htmlH3 htmlH2
+hi link htmlH4 htmlH3
+hi link htmlH5 htmlH4
+hi link htmlH6 htmlH5
+
+" And finally.
+
+let g:colors_name = "Guardian"
+let colors_name   = "Guardian"
+
diff --git a/vim/colors/habilight.vim b/vim/colors/habilight.vim
new file mode 100644 (file)
index 0000000..ea294f5
--- /dev/null
@@ -0,0 +1,138 @@
+" Vim color file
+" A version of nuvola.vim colorscheme, original by Dr. J. Pfefferl
+" I changed some colors and added some highlights for C and Vim 7
+
+" vim: tw=0 ts=4 sw=4
+" Maintainer:  Christian Habermann
+" Email:       christian( at )habermann-net( point )de
+" Version:     1.2
+" History:     1.2: nicer colors for paren matching
+"              1.1: Vim 7 support added (completion, spell checker, paren, tabs)
+"              1.0: initial version
+"
+" Intro {{{1
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "habiLight"
+
+" Normal {{{1
+hi Normal ctermfg=black ctermbg=NONE guifg=black guibg=#F9F5F9
+
+" Search {{{1
+hi IncSearch cterm=UNDERLINE ctermfg=Black ctermbg=brown gui=UNDERLINE guifg=Black guibg=#FFE568
+hi Search term=reverse cterm=UNDERLINE ctermfg=Black ctermbg=brown gui=NONE guifg=Black guibg=#FFE568
+
+" Messages {{{1
+hi ErrorMsg gui=BOLD guifg=#EB1513 guibg=NONE
+hi! link WarningMsg ErrorMsg
+hi ModeMsg gui=BOLD guifg=#0070ff guibg=NONE
+hi MoreMsg guibg=NONE guifg=seagreen
+hi! link Question MoreMsg
+
+" Split area {{{1
+hi StatusLine term=BOLD,reverse cterm=NONE ctermfg=Yellow ctermbg=DarkGray gui=BOLD guibg=#56A0EE guifg=white
+hi StatusLineNC gui=NONE guibg=#56A0EE guifg=#E9E9F4
+hi! link VertSplit StatusLineNC
+hi WildMenu gui=UNDERLINE guifg=#56A0EE guibg=#E9E9F4
+
+" Diff {{{1
+hi DiffText   gui=NONE guifg=#f83010 guibg=#ffeae0
+hi DiffChange gui=NONE guifg=#006800 guibg=#d0ffd0
+hi DiffDelete gui=NONE guifg=#2020ff guibg=#c8f2ea
+hi! link DiffAdd DiffDelete
+
+" Cursor {{{1
+hi Cursor       gui=none guifg=black guibg=orange
+"hi lCursor      gui=NONE guifg=#f8f8f8 guibg=#8000ff
+hi CursorIM     gui=NONE guifg=#f8f8f8 guibg=#8000ff
+
+" Fold {{{1
+hi Folded gui=NONE guibg=#B5EEB5 guifg=black
+"hi FoldColumn gui=NONE guibg=#9FD29F guifg=black
+hi! link FoldColumn Folded
+
+" Other {{{1
+hi Directory    gui=NONE guifg=#0000ff guibg=NONE
+hi LineNr       gui=NONE guifg=#8080a0 guibg=NONE
+hi NonText      gui=BOLD guifg=#4000ff guibg=#EFEFF7
+"hi SpecialKey   gui=NONE guifg=#A35B00 guibg=NONE
+hi Title        gui=BOLD guifg=#1014AD guibg=NONE
+hi Visual term=reverse ctermfg=yellow ctermbg=black gui=NONE guifg=Black guibg=#BDDFFF
+hi VisualNOS term=reverse ctermfg=yellow ctermbg=black gui=UNDERLINE guifg=Black guibg=#BDDFFF
+
+" Syntax group {{{1
+hi Comment term=BOLD ctermfg=darkgray guifg=darkcyan
+hi Constant term=UNDERLINE ctermfg=red guifg=#B91F49
+hi Error term=REVERSE ctermfg=15 ctermbg=9 guibg=Red guifg=White
+hi Identifier term=UNDERLINE ctermfg=Blue guifg=Blue
+hi Number   term=UNDERLINE ctermfg=red gui=NONE guifg=#00C226
+hi PreProc term=UNDERLINE ctermfg=darkblue guifg=#1071CE
+hi Special term=BOLD ctermfg=darkmagenta guifg=red2
+hi Statement term=BOLD ctermfg=DarkRed gui=NONE guifg=#F06F00
+hi Tag term=BOLD ctermfg=DarkGreen guifg=DarkGreen
+hi Todo term=STANDOUT ctermbg=Yellow ctermfg=blue guifg=Blue guibg=Yellow
+hi Type term=UNDERLINE ctermfg=Blue gui=NONE guifg=Blue
+hi! link String        Constant
+hi! link Character     Constant
+hi! link Boolean       Constant
+hi! link Float         Number
+hi! link Function      Identifier
+hi! link Conditional   Statement
+hi! link Repeat        Statement
+hi! link Label         Statement
+hi! link Operator      Statement
+hi! link Keyword       Statement
+hi! link Exception     Statement
+hi! link Include       PreProc
+hi! link Define        PreProc
+hi! link Macro         PreProc
+hi! link PreCondit     PreProc
+hi! link StorageClass  Type
+hi! link Structure     Type
+hi! link Typedef       Type
+hi! link SpecialChar   Special
+hi! link Delimiter     Special
+hi! link SpecialComment Special
+hi! link Debug         Special
+
+" HTML {{{1
+hi htmlLink                 gui=UNDERLINE guifg=#0000ff guibg=NONE
+hi htmlBold                 gui=BOLD
+hi htmlBoldItalic           gui=BOLD,ITALIC
+hi htmlBoldUnderline        gui=BOLD,UNDERLINE
+hi htmlBoldUnderlineItalic  gui=BOLD,UNDERLINE,ITALIC
+hi htmlItalic               gui=ITALIC
+hi htmlUnderline            gui=UNDERLINE
+hi htmlUnderlineItalic      gui=UNDERLINE,ITALIC
+
+" Tabs {{{1
+highlight TabLine     term=underline cterm=underline ctermfg=0 ctermbg=7 gui=underline guibg=LightGrey
+highlight TabLineFill term=reverse cterm=reverse gui=reverse
+highlight TabLineSel  term=bold cterm=bold gui=bold
+
+" Spell Checker {{{1
+if v:version >= 700
+    highlight SpellBad    term=reverse   ctermbg=12 gui=undercurl guisp=Red
+    highlight SpellCap    term=reverse   ctermbg=9  gui=undercurl guisp=Blue
+    highlight SpellRare   term=reverse   ctermbg=13 gui=undercurl guisp=Magenta
+    highlight SpellLocale term=underline ctermbg=11 gui=undercurl guisp=DarkCyan
+endif 
+
+" Completion {{{1
+highlight Pmenu      ctermbg=13  guifg=Black   guibg=#BDDFFF
+highlight PmenuSel   ctermbg=7   guifg=Black   guibg=Orange
+highlight PmenuSbar  ctermbg=7   guifg=#CCCCCC guibg=#CCCCCC
+highlight PmenuThumb cterm=reverse  gui=reverse guifg=Black   guibg=#AAAAAA
+
+" Misc {{{1
+highlight KDE              guifg=magenta gui=NONE
+highlight mySpecialSymbols guifg=magenta gui=NONE 
+
+
+highlight MatchParen  term=reverse ctermbg=11 gui=bold guibg=#B5EEB5 guifg=black
+
+
+" vim600:foldmethod=marker
diff --git a/vim/colors/herald.vim b/vim/colors/herald.vim
new file mode 100644 (file)
index 0000000..23bab56
--- /dev/null
@@ -0,0 +1,385 @@
+" Vim color file
+" Name:       herald.vim
+" Author:     Fabio Cevasco <h3rald@h3rald.com>
+" Version:    0.2.0
+" Notes:      Supports 8, 16, 256 and 16,777,216 (RGB) color modes
+
+hi clear
+
+if exists("syntax_on")
+       syntax reset
+endif
+
+let colors_name = "herald"
+
+set background=dark
+
+" Set some syntax-related variables
+let ruby_operators = 1
+
+if has("gui_running")
+
+       " -> Text; Miscellaneous
+       hi Normal         guibg=#1F1F1F guifg=#D0D0D0 gui=none
+       hi SpecialKey     guibg=#1F1F1F guifg=#E783E9 gui=none
+       hi VertSplit      guibg=#1F1F1F guifg=#FFEE68 gui=none
+       hi SignColumn     guibg=#1F1F1F guifg=#BF81FA gui=none
+       hi NonText        guibg=#1F1F1F guifg=#FC6984 gui=none
+       hi Directory      guibg=#1F1F1F guifg=#FFEE68 gui=none 
+       hi Title          guibg=#1F1F1F guifg=#6DF584 gui=bold
+
+       " -> Cursor 
+       hi Cursor         guibg=#FFEE68 guifg=#1F1F1F gui=none
+       hi CursorIM       guibg=#FFEE68 guifg=#1F1F1F gui=none
+       hi CursorColumn   guibg=#000000               gui=none
+       hi CursorLine     guibg=#000000               gui=none
+
+       " -> Folding
+       hi FoldColumn     guibg=#001336 guifg=#003DAD gui=none
+       hi Folded         guibg=#001336 guifg=#003DAD gui=none
+
+       " -> Line info  
+       hi LineNr         guibg=#000000 guifg=#696567 gui=none
+       hi StatusLine     guibg=#000000 guifg=#696567 gui=none
+       hi StatusLineNC   guibg=#25365a guifg=#696567 gui=none
+
+       " -> Messages
+       hi ErrorMsg       guibg=#A32024 guifg=#D0D0D0 gui=none
+       hi Question       guibg=#1F1F1F guifg=#FFA500 gui=none
+       hi WarningMsg     guibg=#FFA500 guifg=#000000 gui=none
+       hi MoreMsg        guibg=#1F1F1F guifg=#FFA500 gui=none
+       hi ModeMsg        guibg=#1F1F1F guifg=#FFA500 gui=none
+
+       " -> Search 
+       hi Search         guibg=#696567 guifg=#FFEE68 gui=none 
+       hi IncSearch      guibg=#696567 guifg=#FFEE68 gui=none
+
+       " -> Diff
+       hi DiffAdd        guibg=#006124 guifg=#ED9000 gui=none
+       hi DiffChange     guibg=#0B294A guifg=#A36000 gui=none
+       hi DiffDelete     guibg=#081F38 guifg=#ED9000 gui=none
+       hi DiffText       guibg=#12457D guifg=#ED9000 gui=underline
+
+       " -> Menu
+       hi Pmenu          guibg=#140100 guifg=#660300 gui=none
+       hi PmenuSel       guibg=#F17A00 guifg=#4C0200 gui=none
+       hi PmenuSbar      guibg=#430300               gui=none
+       hi PmenuThumb     guibg=#720300               gui=none
+       hi PmenuSel       guibg=#F17A00 guifg=#4C0200 gui=none
+
+       " -> Tabs
+       hi TabLine        guibg=#141414 guifg=#1F1F1F gui=none
+       hi TabLineFill    guibg=#000000               gui=none
+       hi TabLineSel     guibg=#1F1F1F guifg=#D0D0D0 gui=bold  
+       "
+       " -> Visual Mode
+       hi Visual         guibg=#000000 guifg=#FFB539 gui=none
+       hi VisualNOS      guibg=#000000 guifg=#696567 gui=none
+
+       " -> Code
+       hi Comment        guibg=#1F1F1F guifg=#696567 gui=none
+       hi Constant       guibg=#1F1F1F guifg=#6DF584 gui=none
+       hi String         guibg=#1F1F1F guifg=#FFB539 gui=none
+       hi Error          guibg=#1F1F1F guifg=#FC4234 gui=none
+       hi Identifier     guibg=#1F1F1F guifg=#70BDF1 gui=none
+       hi Function       guibg=#1F1F1F guifg=#90CBF1 gui=none
+       hi Ignore         guibg=#1F1F1F guifg=#1F1F1F gui=none
+       hi MatchParen     guibg=#FFA500 guifg=#1F1F1F gui=none
+       hi PreProc        guibg=#1F1F1F guifg=#BF81FA gui=none
+       hi Special        guibg=#1F1F1F guifg=#FFEE68 gui=none
+       hi Todo           guibg=#1F1F1F guifg=#FC4234 gui=bold
+       hi Underlined     guibg=#1F1F1F guifg=#FC4234 gui=underline
+       hi Statement      guibg=#1F1F1F guifg=#E783E9 gui=none
+       hi Operator       guibg=#1F1F1F guifg=#FC6984 gui=none
+       hi Delimiter      guibg=#1F1F1F guifg=#FC6984 gui=none
+       hi Type           guibg=#1F1F1F guifg=#FFEE68 gui=none
+       hi Exception      guibg=#1F1F1F guifg=#FC4234 gui=none
+
+       " -> HTML-specific
+       hi htmlBold                 guibg=#1F1F1F guifg=#D0D0D0 gui=bold
+       hi htmlBoldItalic           guibg=#1F1F1F guifg=#D0D0D0 gui=bold,italic
+       hi htmlBoldUnderline        guibg=#1F1F1F guifg=#D0D0D0 gui=bold,underline
+       hi htmlBoldUnderlineItalic  guibg=#1F1F1F guifg=#D0D0D0 gui=bold,underline,italic
+       hi htmlItalic               guibg=#1F1F1F guifg=#D0D0D0 gui=italic
+       hi htmlUnderline            guibg=#1F1F1F guifg=#D0D0D0 gui=underline
+       hi htmlUnderlineItalic      guibg=#1F1F1F guifg=#D0D0D0 gui=underline,italic
+
+elseif &t_Co == 256
+
+       " -> Text; Miscellaneous
+       hi Normal         ctermbg=234  ctermfg=252   cterm=none
+       hi SpecialKey     ctermbg=234  ctermfg=176   cterm=none
+       hi VertSplit      ctermbg=234  ctermfg=227   cterm=none
+       hi SignColumn     ctermbg=234  ctermfg=141   cterm=none
+       hi NonText        ctermbg=234  ctermfg=204   cterm=none
+       hi Directory      ctermbg=234  ctermfg=227   cterm=none 
+       hi Title          ctermbg=234  ctermfg=84    cterm=bold
+
+       " -> Cursor 
+       hi Cursor         ctermbg=227  ctermfg=234   cterm=none
+       hi CursorIM       ctermbg=227  ctermfg=234   cterm=none
+       hi CursorColumn   ctermbg=0                  cterm=none
+       hi CursorLine     ctermbg=0                  cterm=none
+
+       " -> Folding
+       hi FoldColumn     ctermbg=234  ctermfg=25    cterm=none
+       hi Folded         ctermbg=234  ctermfg=25    cterm=none
+
+       " -> Line info  
+       hi LineNr         ctermbg=0    ctermfg=241   cterm=none
+       hi StatusLine     ctermbg=0    ctermfg=241   cterm=none
+       hi StatusLineNC   ctermbg=237  ctermfg=241   cterm=none
+
+       " -> Messages
+       hi ErrorMsg       ctermbg=124  ctermfg=252   cterm=none
+       hi Question       ctermbg=234  ctermfg=214   cterm=none
+       hi WarningMsg     ctermbg=214  ctermfg=0     cterm=none
+       hi MoreMsg        ctermbg=234  ctermfg=214   cterm=none
+       hi ModeMsg        ctermbg=234  ctermfg=214   cterm=none
+
+       " -> Search 
+       hi Search         ctermbg=241  ctermfg=227   cterm=none 
+       hi IncSearch      ctermbg=241  ctermfg=227   cterm=none
+
+       " -> Diff
+       hi DiffAdd        ctermbg=22   ctermfg=208   cterm=none
+       hi DiffChange     ctermbg=235  ctermfg=130   cterm=none
+       hi DiffDelete     ctermbg=234  ctermfg=208   cterm=none
+       hi DiffText       ctermbg=24   ctermfg=208   cterm=underline
+
+       " -> Menu
+       hi Pmenu          ctermbg=0    ctermfg=52    cterm=none
+       hi PmenuSel       ctermbg=208  ctermfg=52    cterm=none
+       hi PmenuSbar      ctermbg=52                 cterm=none
+       hi PmenuThumb     ctermbg=52                 cterm=none
+       hi PmenuSel       ctermbg=208  ctermfg=52    cterm=none
+
+       " -> Tabs
+       hi TabLine        ctermbg=233  ctermfg=234   cterm=none
+       hi TabLineFill    ctermbg=0                  cterm=none
+       hi TabLineSel     ctermbg=234  ctermfg=252   cterm=bold 
+       "
+       " -> Visual Mode
+       hi Visual         ctermbg=0    ctermfg=215   cterm=none 
+       hi VisualNOS      ctermbg=0    ctermfg=241   cterm=none
+
+       " -> Code
+       hi Comment        ctermbg=234  ctermfg=241   cterm=none
+       hi Constant       ctermbg=234  ctermfg=84    cterm=none
+       hi String         ctermbg=234  ctermfg=215   cterm=none
+       hi Error          ctermbg=234  ctermfg=203   cterm=none
+       hi Identifier     ctermbg=234  ctermfg=75    cterm=none
+       hi Function       ctermbg=234  ctermfg=117   cterm=none
+       hi Ignore         ctermbg=234  ctermfg=234   cterm=none
+       hi MatchParen     ctermbg=214  ctermfg=234   cterm=none
+       hi PreProc        ctermbg=234  ctermfg=141   cterm=none
+       hi Special        ctermbg=234  ctermfg=227   cterm=none
+       hi Todo           ctermbg=234  ctermfg=203   cterm=bold
+       hi Underlined     ctermbg=234  ctermfg=203   cterm=underline
+       hi Statement      ctermbg=234  ctermfg=176   cterm=none
+       hi Operator       ctermbg=234  ctermfg=204   cterm=none
+       hi Delimiter      ctermbg=234  ctermfg=204   cterm=none
+       hi Type           ctermbg=234  ctermfg=227   cterm=none
+       hi Exception      ctermbg=234  ctermfg=203   cterm=none 
+
+       " -> HTML-specific
+       hi htmlBold                 ctermbg=234  ctermfg=252   cterm=bold
+       hi htmlBoldItalic           ctermbg=234  ctermfg=252   cterm=bold,italic
+       hi htmlBoldUnderline        ctermbg=234  ctermfg=252   cterm=bold,underline
+       hi htmlBoldUnderlineItalic  ctermbg=234  ctermfg=252   cterm=bold,underline,italic
+       hi htmlItalic               ctermbg=234  ctermfg=252   cterm=italic
+       hi htmlUnderline            ctermbg=234  ctermfg=252   cterm=underline
+       hi htmlUnderlineItalic      ctermbg=234  ctermfg=252   cterm=underline,italic
+
+elseif &t_Co == 16
+
+       " -> Text; Miscellaneous
+       hi Normal         ctermbg=8  ctermfg=15 cterm=none
+       hi SpecialKey     ctermbg=8  ctermfg=5  cterm=none
+       hi VertSplit      ctermbg=8  ctermfg=14  cterm=none
+       hi SignColumn     ctermbg=8  ctermfg=5  cterm=none
+  hi NonText        ctermbg=8  ctermfg=4  cterm=none
+  hi Directory      ctermbg=8  ctermfg=14  cterm=none 
+  hi Title          ctermbg=8  ctermfg=10 cterm=bold
+
+  " -> Cursor 
+  hi Cursor         ctermbg=14 ctermfg=8  cterm=none
+  hi CursorIM       ctermbg=14 ctermfg=8  cterm=none
+  hi CursorColumn   ctermbg=0            cterm=none
+  hi CursorLine     ctermbg=0            cterm=none
+
+  " -> Folding
+  hi FoldColumn     ctermbg=0  ctermfg=1  cterm=none
+  hi Folded         ctermbg=0  ctermfg=1  cterm=none
+
+  " -> Line info  
+  hi LineNr         ctermbg=0  ctermfg=7  cterm=none
+  hi StatusLine     ctermbg=0  ctermfg=7  cterm=none
+  hi StatusLineNC   ctermbg=0  ctermfg=7  cterm=none
+
+  " -> Messages
+  hi ErrorMsg       ctermbg=4  ctermfg=7  cterm=none
+  hi Question       ctermbg=8  ctermfg=14 cterm=none
+  hi WarningMsg     ctermbg=14 ctermfg=0  cterm=none
+  hi MoreMsg        ctermbg=8  ctermfg=14 cterm=none
+  hi ModeMsg        ctermbg=8  ctermfg=14 cterm=none
+
+  " -> Search 
+  hi Search         ctermbg=7  ctermfg=14 cterm=none 
+  hi IncSearch      ctermbg=7  ctermfg=14 cterm=none
+
+  " -> Diff
+  hi DiffAdd        ctermbg=0  ctermfg=10 cterm=none
+  hi DiffChange     ctermbg=0  ctermfg=14 cterm=none
+  hi DiffDelete     ctermbg=0  ctermfg=12 cterm=none
+  hi DiffText       ctermbg=1  ctermfg=14 cterm=underline
+
+  " -> Menu
+  hi Pmenu          ctermbg=0  ctermfg=4  cterm=none
+  hi PmenuSel       ctermbg=14 ctermfg=4  cterm=none
+  hi PmenuSbar      ctermbg=0             cterm=none
+  hi PmenuThumb     ctermbg=4             cterm=none
+  hi PmenuSel       ctermbg=14 ctermfg=4  cterm=none
+
+  " -> Tabs
+  hi TabLine        ctermbg=7  ctermfg=8  cterm=none
+  hi TabLineFill    ctermbg=0             cterm=none
+  hi TabLineSel     ctermbg=8  ctermfg=7  cterm=bold  
+  "
+  " -> Visual Mode
+  hi Visual         ctermbg=0  ctermfg=14 cterm=none
+  hi VisualNOS      ctermbg=0  ctermfg=7  cterm=none
+
+  " -> Code
+  hi Comment        ctermbg=8  ctermfg=7  cterm=none
+  hi Constant       ctermbg=8  ctermfg=10 cterm=none
+  hi String         ctermbg=8  ctermfg=6  cterm=none
+  hi Error          ctermbg=8  ctermfg=4  cterm=none
+  hi Identifier     ctermbg=8  ctermfg=11 cterm=none
+  hi Function       ctermbg=8  ctermfg=11 cterm=none
+  hi Ignore         ctermbg=8  ctermfg=8  cterm=none
+  hi MatchParen     ctermbg=14 ctermfg=8  cterm=none
+  hi PreProc        ctermbg=8  ctermfg=5  cterm=none
+  hi Special        ctermbg=8  ctermfg=14 cterm=none
+  hi Todo           ctermbg=8  ctermfg=12 cterm=bold
+  hi Underlined     ctermbg=8  ctermfg=12 cterm=underline
+  hi Statement      ctermbg=8  ctermfg=13 cterm=none
+  hi Operator       ctermbg=8  ctermfg=4  cterm=none
+  hi Delimiter      ctermbg=8  ctermfg=4 cterm=none
+  hi Type           ctermbg=8  ctermfg=14 cterm=none
+  hi Exception      ctermbg=8  ctermfg=12 cterm=none
+
+  " -> HTML-specific
+  hi htmlBold                  ctermbg=8 ctermfg=7 cterm=bold
+  hi htmlBoldItalic            ctermbg=8 ctermfg=7 cterm=bold,italic
+  hi htmlBoldUnderline         ctermbg=8 ctermfg=7 cterm=bold,underline
+  hi htmlBoldUnderlineItalic   ctermbg=8 ctermfg=7 cterm=bold,underline,italic
+  hi htmlItalic                ctermbg=8 ctermfg=7 cterm=italic
+  hi htmlUnderline             ctermbg=8 ctermfg=7 cterm=underline
+  hi htmlUnderlineItalic       ctermbg=8 ctermfg=7 cterm=underline,italic
+
+
+elseif &t_Co == 8
+
+       " -> Text; Miscellaneous
+       hi Normal         ctermbg=8  ctermfg=7  cterm=none
+       hi SpecialKey     ctermbg=8  ctermfg=5  cterm=none
+       hi VertSplit      ctermbg=8  ctermfg=6  cterm=none
+       hi SignColumn     ctermbg=8  ctermfg=5  cterm=none
+  hi NonText        ctermbg=8  ctermfg=4  cterm=none
+  hi Directory      ctermbg=8  ctermfg=6  cterm=none 
+  hi Title          ctermbg=8  ctermfg=2  cterm=bold
+
+  " -> Cursor 
+  hi Cursor         ctermbg=6  ctermfg=8  cterm=none
+  hi CursorIM       ctermbg=6  ctermfg=8  cterm=none
+  hi CursorColumn   ctermbg=0             cterm=none
+  hi CursorLine     ctermbg=0             cterm=none
+
+  " -> Folding
+  hi FoldColumn     ctermbg=0  ctermfg=1  cterm=none
+  hi Folded         ctermbg=0  ctermfg=1  cterm=none
+
+  " -> Line info  
+  hi LineNr         ctermbg=0  ctermfg=7  cterm=none
+  hi StatusLine     ctermbg=0  ctermfg=7  cterm=none
+  hi StatusLineNC   ctermbg=0  ctermfg=7  cterm=none
+
+  " -> Messages
+  hi ErrorMsg       ctermbg=4  ctermfg=7  cterm=none
+  hi Question       ctermbg=8  ctermfg=6  cterm=none
+  hi WarningMsg     ctermbg=6  ctermfg=0  cterm=none
+  hi MoreMsg        ctermbg=8  ctermfg=6  cterm=none
+  hi ModeMsg        ctermbg=8  ctermfg=6  cterm=none
+
+  " -> Search 
+  hi Search         ctermbg=7  ctermfg=6  cterm=none 
+  hi IncSearch      ctermbg=7  ctermfg=6  cterm=none
+
+  " -> Diff
+  hi DiffAdd        ctermbg=0  ctermfg=2  cterm=none
+  hi DiffChange     ctermbg=0  ctermfg=6  cterm=none
+  hi DiffDelete     ctermbg=0  ctermfg=4  cterm=none
+  hi DiffText       ctermbg=1  ctermfg=6  cterm=underline
+
+  " -> Menu
+  hi Pmenu          ctermbg=0  ctermfg=4  cterm=none
+  hi PmenuSel       ctermbg=6  ctermfg=4  cterm=none
+  hi PmenuSbar      ctermbg=0             cterm=none
+  hi PmenuThumb     ctermbg=4             cterm=none
+  hi PmenuSel       ctermbg=6  ctermfg=4  cterm=none
+
+  " -> Tabs
+  hi TabLine        ctermbg=7  ctermfg=8  cterm=none
+  hi TabLineFill    ctermbg=0             cterm=none
+  hi TabLineSel     ctermbg=8  ctermfg=7  cterm=bold  
+  "
+  " -> Visual Mode
+  hi Visual         ctermbg=0  ctermfg=6 cterm=none
+  hi VisualNOS      ctermbg=0  ctermfg=7  cterm=none
+
+  " -> Code
+  hi Comment        ctermbg=8  ctermfg=7  cterm=none
+  hi Constant       ctermbg=8  ctermfg=2 cterm=none
+  hi String         ctermbg=8  ctermfg=6  cterm=none
+  hi Error          ctermbg=8  ctermfg=4  cterm=none
+  hi Identifier     ctermbg=8  ctermfg=3 cterm=none
+  hi Function       ctermbg=8  ctermfg=3 cterm=none
+  hi Ignore         ctermbg=8  ctermfg=8  cterm=none
+  hi MatchParen     ctermbg=6  ctermfg=8  cterm=none
+  hi PreProc        ctermbg=8  ctermfg=5  cterm=none
+  hi Special        ctermbg=8  ctermfg=6 cterm=none
+  hi Todo           ctermbg=8  ctermfg=4 cterm=bold
+  hi Underlined     ctermbg=8  ctermfg=4 cterm=underline
+  hi Statement      ctermbg=8  ctermfg=5 cterm=none
+  hi Operator       ctermbg=8  ctermfg=4  cterm=none
+  hi Delimiter      ctermbg=8  ctermfg=4 cterm=none
+  hi Type           ctermbg=8  ctermfg=6 cterm=none
+  hi Exception      ctermbg=8  ctermfg=4 cterm=none
+
+  " -> HTML-specific
+  hi htmlBold                  ctermbg=8 ctermfg=7 cterm=bold
+  hi htmlBoldItalic            ctermbg=8 ctermfg=7 cterm=bold,italic
+  hi htmlBoldUnderline         ctermbg=8 ctermfg=7 cterm=bold,underline
+  hi htmlBoldUnderlineItalic   ctermbg=8 ctermfg=7 cterm=bold,underline,italic
+  hi htmlItalic                ctermbg=8 ctermfg=7 cterm=italic
+  hi htmlUnderline             ctermbg=8 ctermfg=7 cterm=underline
+  hi htmlUnderlineItalic       ctermbg=8 ctermfg=7 cterm=underline,italic
+
+endif
+
+hi! default link bbcodeBold htmlBold
+hi! default link bbcodeBoldItalic htmlBoldItalic
+hi! default link bbcodeBoldItalicUnderline htmlBoldUnderlineItalic
+hi! default link bbcodeBoldUnderline htmlBoldUnderline
+hi! default link bbcodeItalic htmlItalic
+hi! default link bbcodeItalicUnderline htmlUnderlineItalic
+hi! default link bbcodeUnderline htmlUnderline
+
+" Spellcheck formatting
+if has("spell")
+       hi SpellBad   guisp=#FC4234 gui=undercurl
+       hi SpellCap   guisp=#70BDF1 gui=undercurl
+       hi SpellLocal guisp=#FFEE68 gui=undercurl
+       hi SpellRare  guisp=#6DF584 gui=undercurl
+endif
diff --git a/vim/colors/impact.vim b/vim/colors/impact.vim
new file mode 100644 (file)
index 0000000..507ff3d
--- /dev/null
@@ -0,0 +1,66 @@
+" Vim color file
+" Maintainer:   Shirk <shirk@gmx.net>
+" Last Change:  19 September 2005 - 0.2
+" URL: trinity.gentoofreaks.org
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark     "or light
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="impact"
+
+if exists("g:impact_transbg")
+        hi Normal       ctermfg=LightGray ctermbg=none
+        hi NonText      ctermfg=DarkGray  ctermbg=none
+
+        hi Statement    ctermfg=Blue      ctermbg=none
+        hi Comment      ctermfg=DarkGray  ctermbg=none cterm=bold term=bold
+        hi Constant     ctermfg=DarkCyan  ctermbg=none
+        hi Identifier   ctermfg=Cyan      ctermbg=none
+        hi Type         ctermfg=DarkGreen ctermbg=none
+        hi Folded       ctermfg=DarkGreen ctermbg=none cterm=underline term=none
+        hi Special      ctermfg=Blue      ctermbg=none
+        hi PreProc      ctermfg=LightGray ctermbg=none cterm=bold term=bold
+        hi Scrollbar    ctermfg=Blue      ctermbg=none
+        hi Cursor       ctermfg=white     ctermbg=none
+        hi ErrorMsg     ctermfg=Red       ctermbg=none cterm=bold term=bold
+        hi WarningMsg   ctermfg=Yellow    ctermbg=none
+        hi VertSplit    ctermfg=White     ctermbg=none
+        hi Directory    ctermfg=Cyan      ctermbg=DarkBlue
+        hi Visual       ctermfg=White     ctermbg=DarkGray cterm=underline term=none
+        hi Title        ctermfg=White     ctermbg=DarkBlue
+
+        hi StatusLine   term=bold cterm=bold,underline ctermfg=White ctermbg=Black
+        hi StatusLineNC term=bold cterm=bold,underline ctermfg=Gray  ctermbg=Black
+        hi LineNr       term=bold cterm=bold ctermfg=White ctermbg=DarkGray
+else
+        hi Normal       ctermfg=LightGray ctermbg=Black
+        hi NonText      ctermfg=DarkGray  ctermbg=Black
+
+        hi Statement    ctermfg=Blue      ctermbg=Black
+        hi Comment      ctermfg=DarkGray  ctermbg=Black cterm=bold term=bold
+        hi Constant     ctermfg=DarkCyan  ctermbg=Black
+        hi Identifier   ctermfg=Cyan      ctermbg=Black
+        hi Type         ctermfg=DarkGreen ctermbg=Black
+        hi Folded       ctermfg=DarkGreen ctermbg=Black cterm=underline term=none
+        hi Special      ctermfg=Blue      ctermbg=Black
+        hi PreProc      ctermfg=LightGray ctermbg=Black cterm=bold term=bold
+        hi Scrollbar    ctermfg=Blue      ctermbg=Black
+        hi Cursor       ctermfg=white     ctermbg=Black
+        hi ErrorMsg     ctermfg=Red       ctermbg=Black cterm=bold term=bold
+        hi WarningMsg   ctermfg=Yellow    ctermbg=Black
+        hi VertSplit    ctermfg=White     ctermbg=Black
+        hi Directory    ctermfg=Cyan      ctermbg=DarkBlue
+        hi Visual       ctermfg=White     ctermbg=DarkGray cterm=underline term=none
+        hi Title        ctermfg=White     ctermbg=DarkBlue
+
+        hi StatusLine   term=bold cterm=bold,underline ctermfg=White ctermbg=Black
+        hi StatusLineNC term=bold cterm=bold,underline ctermfg=Gray  ctermbg=Black
+        hi LineNr       term=bold cterm=bold ctermfg=White ctermbg=DarkGray
+endif
diff --git a/vim/colors/inkpot.vim b/vim/colors/inkpot.vim
new file mode 100644 (file)
index 0000000..c6ecb46
--- /dev/null
@@ -0,0 +1,216 @@
+" Vim color file
+" Name:       inkpot.vim
+" Maintainer: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
+" Homepage:   http://github.com/ciaranm/inkpot/
+"
+" This should work in the GUI, rxvt-unicode (88 colour mode) and xterm (256
+" colour mode). It won't work in 8/16 colour terminals.
+"
+" To use a black background, :let g:inkpot_black_background = 1
+
+set background=dark
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "inkpot"
+
+" map a urxvt cube number to an xterm-256 cube number
+fun! <SID>M(a)
+    return strpart("0135", a:a, 1) + 0
+endfun
+
+" map a urxvt colour to an xterm-256 colour
+fun! <SID>X(a)
+    if &t_Co == 88
+        return a:a
+    else
+        if a:a == 8
+            return 237
+        elseif a:a < 16
+            return a:a
+        elseif a:a > 79
+            return 232 + (3 * (a:a - 80))
+        else
+            let l:b = a:a - 16
+            let l:x = l:b % 4
+            let l:y = (l:b / 4) % 4
+            let l:z = (l:b / 16)
+            return 16 + <SID>M(l:x) + (6 * <SID>M(l:y)) + (36 * <SID>M(l:z))
+        endif
+    endif
+endfun
+
+if ! exists("g:inkpot_black_background")
+    let g:inkpot_black_background = 0
+endif
+
+if has("gui_running")
+    if ! g:inkpot_black_background
+        hi Normal         gui=NONE   guifg=#cfbfad   guibg=#1e1e27
+    else
+        hi Normal         gui=NONE   guifg=#cfbfad   guibg=#000000
+    endif
+
+    hi CursorLine         guibg=#2e2e37
+
+    hi IncSearch      gui=BOLD   guifg=#303030   guibg=#cd8b60
+    hi Search         gui=NONE   guifg=#303030   guibg=#ad7b57
+    hi ErrorMsg       gui=BOLD   guifg=#ffffff   guibg=#ce4e4e
+    hi WarningMsg     gui=BOLD   guifg=#ffffff   guibg=#ce8e4e
+    hi ModeMsg        gui=BOLD   guifg=#7e7eae   guibg=NONE
+    hi MoreMsg        gui=BOLD   guifg=#7e7eae   guibg=NONE
+    hi Question       gui=BOLD   guifg=#ffcd00   guibg=NONE
+
+    hi StatusLine     gui=BOLD   guifg=#b9b9b9   guibg=#3e3e5e
+    hi User1          gui=BOLD   guifg=#00ff8b   guibg=#3e3e5e
+    hi User2          gui=BOLD   guifg=#7070a0   guibg=#3e3e5e
+    hi StatusLineNC   gui=NONE   guifg=#b9b9b9   guibg=#3e3e5e
+    hi VertSplit      gui=NONE   guifg=#b9b9b9   guibg=#3e3e5e
+
+    hi WildMenu       gui=BOLD   guifg=#eeeeee   guibg=#6e6eaf
+
+    hi MBENormal                 guifg=#cfbfad   guibg=#2e2e3f
+    hi MBEChanged                guifg=#eeeeee   guibg=#2e2e3f
+    hi MBEVisibleNormal          guifg=#cfcfcd   guibg=#4e4e8f
+    hi MBEVisibleChanged         guifg=#eeeeee   guibg=#4e4e8f
+
+    hi DiffText       gui=NONE   guifg=#ffffcd   guibg=#4a2a4a
+    hi DiffChange     gui=NONE   guifg=#ffffcd   guibg=#306b8f
+    hi DiffDelete     gui=NONE   guifg=#ffffcd   guibg=#6d3030
+    hi DiffAdd        gui=NONE   guifg=#ffffcd   guibg=#306d30
+
+    hi Cursor         gui=NONE   guifg=#404040   guibg=#8b8bff
+    hi lCursor        gui=NONE   guifg=#404040   guibg=#8fff8b
+    hi CursorIM       gui=NONE   guifg=#404040   guibg=#8b8bff
+
+    hi Folded         gui=NONE   guifg=#cfcfcd   guibg=#4b208f
+    hi FoldColumn     gui=NONE   guifg=#8b8bcd   guibg=#2e2e2e
+
+    hi Directory      gui=NONE   guifg=#00ff8b   guibg=NONE
+    hi LineNr         gui=NONE   guifg=#8b8bcd   guibg=#2e2e2e
+    hi NonText        gui=BOLD   guifg=#8b8bcd   guibg=NONE
+    hi SpecialKey     gui=BOLD   guifg=#ab60ed   guibg=NONE
+    hi Title          gui=BOLD   guifg=#af4f4b   guibg=NONE
+    hi Visual         gui=NONE   guifg=#eeeeee   guibg=#4e4e8f
+
+    hi Comment        gui=NONE   guifg=#cd8b00   guibg=NONE
+    hi Constant       gui=NONE   guifg=#ffcd8b   guibg=NONE
+    hi String         gui=NONE   guifg=#ffcd8b   guibg=#404040
+    hi Error          gui=NONE   guifg=#ffffff   guibg=#6e2e2e
+    hi Identifier     gui=NONE   guifg=#ff8bff   guibg=NONE
+    hi Ignore         gui=NONE
+    hi Number         gui=NONE   guifg=#f0ad6d   guibg=NONE
+    hi PreProc        gui=NONE   guifg=#409090   guibg=NONE
+    hi Special        gui=NONE   guifg=#c080d0   guibg=NONE
+    hi SpecialChar    gui=NONE   guifg=#c080d0   guibg=#404040
+    hi Statement      gui=NONE   guifg=#808bed   guibg=NONE
+    hi Todo           gui=BOLD   guifg=#303030   guibg=#d0a060
+    hi Type           gui=NONE   guifg=#ff8bff   guibg=NONE
+    hi Underlined     gui=BOLD   guifg=#df9f2d   guibg=NONE
+    hi TaglistTagName gui=BOLD   guifg=#808bed   guibg=NONE
+
+    hi perlSpecialMatch   gui=NONE guifg=#c080d0   guibg=#404040
+    hi perlSpecialString  gui=NONE guifg=#c080d0   guibg=#404040
+
+    hi cSpecialCharacter  gui=NONE guifg=#c080d0   guibg=#404040
+    hi cFormat            gui=NONE guifg=#c080d0   guibg=#404040
+
+    hi doxygenBrief                 gui=NONE guifg=#fdab60   guibg=NONE
+    hi doxygenParam                 gui=NONE guifg=#fdd090   guibg=NONE
+    hi doxygenPrev                  gui=NONE guifg=#fdd090   guibg=NONE
+    hi doxygenSmallSpecial          gui=NONE guifg=#fdd090   guibg=NONE
+    hi doxygenSpecial               gui=NONE guifg=#fdd090   guibg=NONE
+    hi doxygenComment               gui=NONE guifg=#ad7b20   guibg=NONE
+    hi doxygenSpecial               gui=NONE guifg=#fdab60   guibg=NONE
+    hi doxygenSpecialMultilineDesc  gui=NONE guifg=#ad600b   guibg=NONE
+    hi doxygenSpecialOnelineDesc    gui=NONE guifg=#ad600b   guibg=NONE
+
+    if v:version >= 700
+        hi Pmenu          gui=NONE   guifg=#eeeeee   guibg=#4e4e8f
+        hi PmenuSel       gui=BOLD   guifg=#eeeeee   guibg=#2e2e3f
+        hi PmenuSbar      gui=BOLD   guifg=#eeeeee   guibg=#6e6eaf
+        hi PmenuThumb     gui=BOLD   guifg=#eeeeee   guibg=#6e6eaf
+
+        hi SpellBad     gui=undercurl guisp=#cc6666
+        hi SpellRare    gui=undercurl guisp=#cc66cc
+        hi SpellLocal   gui=undercurl guisp=#cccc66
+        hi SpellCap     gui=undercurl guisp=#66cccc
+
+        hi MatchParen   gui=NONE      guifg=#cfbfad   guibg=#4e4e8f
+    endif
+else
+    if ! g:inkpot_black_background
+        exec "hi Normal         cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(80)
+    else
+        exec "hi Normal         cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(16)
+    endif
+
+    exec "hi IncSearch      cterm=BOLD   ctermfg=" . <SID>X(80) . " ctermbg=" . <SID>X(73)
+    exec "hi Search         cterm=NONE   ctermfg=" . <SID>X(80) . " ctermbg=" . <SID>X(52)
+    exec "hi ErrorMsg       cterm=BOLD   ctermfg=" . <SID>X(16) . " ctermbg=" . <SID>X(48)
+    exec "hi WarningMsg     cterm=BOLD   ctermfg=" . <SID>X(16) . " ctermbg=" . <SID>X(68)
+    exec "hi ModeMsg        cterm=BOLD   ctermfg=" . <SID>X(38) . " ctermbg=" . "NONE"
+    exec "hi MoreMsg        cterm=BOLD   ctermfg=" . <SID>X(38) . " ctermbg=" . "NONE"
+    exec "hi Question       cterm=BOLD   ctermfg=" . <SID>X(52) . " ctermbg=" . "NONE"
+
+    exec "hi StatusLine     cterm=BOLD   ctermfg=" . <SID>X(85) . " ctermbg=" . <SID>X(81)
+    exec "hi User1          cterm=BOLD   ctermfg=" . <SID>X(28) . " ctermbg=" . <SID>X(81)
+    exec "hi User2          cterm=BOLD   ctermfg=" . <SID>X(39) . " ctermbg=" . <SID>X(81)
+    exec "hi StatusLineNC   cterm=NONE   ctermfg=" . <SID>X(84) . " ctermbg=" . <SID>X(81)
+    exec "hi VertSplit      cterm=NONE   ctermfg=" . <SID>X(84) . " ctermbg=" . <SID>X(81)
+
+    exec "hi WildMenu       cterm=BOLD   ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(38)
+
+    exec "hi MBENormal                   ctermfg=" . <SID>X(85) . " ctermbg=" . <SID>X(81)
+    exec "hi MBEChanged                  ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(81)
+    exec "hi MBEVisibleNormal            ctermfg=" . <SID>X(85) . " ctermbg=" . <SID>X(82)
+    exec "hi MBEVisibleChanged           ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(82)
+
+    exec "hi DiffText       cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(34)
+    exec "hi DiffChange     cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(17)
+    exec "hi DiffDelete     cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(32)
+    exec "hi DiffAdd        cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(20)
+
+    exec "hi Folded         cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(35)
+    exec "hi FoldColumn     cterm=NONE   ctermfg=" . <SID>X(39) . " ctermbg=" . <SID>X(80)
+
+    exec "hi Directory      cterm=NONE   ctermfg=" . <SID>X(28) . " ctermbg=" . "NONE"
+    exec "hi LineNr         cterm=NONE   ctermfg=" . <SID>X(39) . " ctermbg=" . <SID>X(80)
+    exec "hi NonText        cterm=BOLD   ctermfg=" . <SID>X(39) . " ctermbg=" . "NONE"
+    exec "hi SpecialKey     cterm=BOLD   ctermfg=" . <SID>X(55) . " ctermbg=" . "NONE"
+    exec "hi Title          cterm=BOLD   ctermfg=" . <SID>X(48) . " ctermbg=" . "NONE"
+    exec "hi Visual         cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(38)
+
+    exec "hi Comment        cterm=NONE   ctermfg=" . <SID>X(52) . " ctermbg=" . "NONE"
+    exec "hi Constant       cterm=NONE   ctermfg=" . <SID>X(73) . " ctermbg=" . "NONE"
+    exec "hi String         cterm=NONE   ctermfg=" . <SID>X(73) . " ctermbg=" . <SID>X(81)
+    exec "hi Error          cterm=NONE   ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(32)
+    exec "hi Identifier     cterm=NONE   ctermfg=" . <SID>X(53) . " ctermbg=" . "NONE"
+    exec "hi Ignore         cterm=NONE"
+    exec "hi Number         cterm=NONE   ctermfg=" . <SID>X(69) . " ctermbg=" . "NONE"
+    exec "hi PreProc        cterm=NONE   ctermfg=" . <SID>X(25) . " ctermbg=" . "NONE"
+    exec "hi Special        cterm=NONE   ctermfg=" . <SID>X(55) . " ctermbg=" . "NONE"
+    exec "hi SpecialChar    cterm=NONE   ctermfg=" . <SID>X(55) . " ctermbg=" . <SID>X(81)
+    exec "hi Statement      cterm=NONE   ctermfg=" . <SID>X(27) . " ctermbg=" . "NONE"
+    exec "hi Todo           cterm=BOLD   ctermfg=" . <SID>X(16) . " ctermbg=" . <SID>X(57)
+    exec "hi Type           cterm=NONE   ctermfg=" . <SID>X(71) . " ctermbg=" . "NONE"
+    exec "hi Underlined     cterm=BOLD   ctermfg=" . <SID>X(77) . " ctermbg=" . "NONE"
+    exec "hi TaglistTagName cterm=BOLD   ctermfg=" . <SID>X(39) . " ctermbg=" . "NONE"
+
+    if v:version >= 700
+        exec "hi Pmenu          cterm=NONE   ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(82)
+        exec "hi PmenuSel       cterm=BOLD   ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(38)
+        exec "hi PmenuSbar      cterm=BOLD   ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(39)
+        exec "hi PmenuThumb     cterm=BOLD   ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(39)
+
+        exec "hi SpellBad       cterm=NONE ctermbg=" . <SID>X(32)
+        exec "hi SpellRare      cterm=NONE ctermbg=" . <SID>X(33)
+        exec "hi SpellLocal     cterm=NONE ctermbg=" . <SID>X(36)
+        exec "hi SpellCap       cterm=NONE ctermbg=" . <SID>X(21)
+        exec "hi MatchParen     cterm=NONE ctermbg=" . <SID>X(14) . "ctermfg=" . <SID>X(25)
+    endif
+endif
+
+" vim: set et :
diff --git a/vim/colors/ir_black.vim b/vim/colors/ir_black.vim
new file mode 100644 (file)
index 0000000..2e151d8
--- /dev/null
@@ -0,0 +1,212 @@
+" ir_black color scheme
+" More at: http://blog.infinitered.com/entries/show/8
+
+
+" ********************************************************************************
+" Standard colors used in all ir_black themes:
+" Note, x:x:x are RGB values
+"
+"  normal: #f6f3e8
+" 
+"  string: #A8FF60  168:255:96                   
+"    string inner (punc, code, etc): #00A0A0  0:160:160
+"  number: #FF73FD  255:115:253                 
+"  comments: #7C7C7C  124:124:124
+"  keywords: #96CBFE  150:203:254             
+"  operators: white
+"  class: #FFFFB6  255:255:182
+"  method declaration name: #FFD2A7  255:210:167
+"  regular expression: #E9C062  233:192:98
+"    regexp alternate: #FF8000  255:128:0
+"    regexp alternate 2: #B18A3D  177:138:61
+"  variable: #C6C5FE  198:197:254
+"  
+" Misc colors:
+"  red color (used for whatever): #FF6C60   255:108:96 
+"     light red: #FFB6B0   255:182:176
+"
+"  brown: #E18964  good for special
+"
+"  lightpurpleish: #FFCCFF
+" 
+" Interface colors:
+"  background color: black
+"  cursor (where underscore is used): #FFA560  255:165:96
+"  cursor (where block is used): white
+"  visual selection: #1D1E2C  
+"  current line: #151515  21:21:21
+"  search selection: #07281C  7:40:28
+"  line number: #3D3D3D  61:61:61
+
+
+" ********************************************************************************
+" The following are the preferred 16 colors for your terminal
+"           Colors      Bright Colors
+" Black     #4E4E4E     #7C7C7C
+" Red       #FF6C60     #FFB6B0
+" Green     #A8FF60     #CEFFAB
+" Yellow    #FFFFB6     #FFFFCB
+" Blue      #96CBFE     #FFFFCB
+" Magenta   #FF73FD     #FF9CFE
+" Cyan      #C6C5FE     #DFDFFE
+" White     #EEEEEE     #FFFFFF
+
+
+" ********************************************************************************
+set background=dark
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "ir_black"
+
+
+"hi Example         guifg=NONE        guibg=NONE        gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+
+" General colors
+hi Normal           guifg=#f6f3e8     guibg=black       gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+hi NonText          guifg=#070707     guibg=black       gui=NONE      ctermfg=black       ctermbg=NONE        cterm=NONE
+
+hi Cursor           guifg=black       guibg=white       gui=NONE      ctermfg=black       ctermbg=white       cterm=reverse
+hi LineNr           guifg=#3D3D3D     guibg=black       gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+
+hi VertSplit        guifg=#202020     guibg=#202020     gui=NONE      ctermfg=darkgray    ctermbg=darkgray    cterm=NONE
+hi StatusLine       guifg=#CCCCCC     guibg=#202020     gui=italic    ctermfg=white       ctermbg=darkgray    cterm=NONE
+hi StatusLineNC     guifg=black       guibg=#202020     gui=NONE      ctermfg=blue        ctermbg=darkgray    cterm=NONE  
+
+hi Folded           guifg=#a0a8b0     guibg=#384048     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+hi Title            guifg=#f6f3e8     guibg=NONE        gui=bold      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+hi Visual           guifg=NONE        guibg=#262D51     gui=NONE      ctermfg=NONE        ctermbg=darkgray    cterm=NONE
+
+hi SpecialKey       guifg=#808080     guibg=#343434     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+
+hi WildMenu         guifg=green       guibg=yellow      gui=NONE      ctermfg=black       ctermbg=yellow      cterm=NONE
+hi PmenuSbar        guifg=black       guibg=white       gui=NONE      ctermfg=black       ctermbg=white       cterm=NONE
+"hi Ignore           guifg=gray        guibg=black       gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+
+hi Error            guifg=NONE        guibg=NONE        gui=undercurl ctermfg=white       ctermbg=red         cterm=NONE     guisp=#FF6C60 " undercurl color
+hi ErrorMsg         guifg=white       guibg=#FF6C60     gui=BOLD      ctermfg=white       ctermbg=red         cterm=NONE
+hi WarningMsg       guifg=white       guibg=#FF6C60     gui=BOLD      ctermfg=white       ctermbg=red         cterm=NONE
+
+" Message displayed in lower left, such as --INSERT--
+hi ModeMsg          guifg=black       guibg=#C6C5FE     gui=BOLD      ctermfg=black       ctermbg=cyan        cterm=BOLD
+
+if version >= 700 " Vim 7.x specific colors
+  hi CursorLine     guifg=NONE        guibg=#121212     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=BOLD
+  hi CursorColumn   guifg=NONE        guibg=#121212     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=BOLD
+  hi MatchParen     guifg=#f6f3e8     guibg=#857b6f     gui=BOLD      ctermfg=white       ctermbg=darkgray    cterm=NONE
+  hi Pmenu          guifg=#f6f3e8     guibg=#444444     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+  hi PmenuSel       guifg=#000000     guibg=#cae682     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+  hi Search         guifg=NONE        guibg=NONE        gui=underline ctermfg=NONE        ctermbg=NONE        cterm=underline
+endif
+
+" Syntax highlighting
+hi Comment          guifg=#7C7C7C     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+hi String           guifg=#A8FF60     guibg=NONE        gui=NONE      ctermfg=green       ctermbg=NONE        cterm=NONE
+hi Number           guifg=#FF73FD     guibg=NONE        gui=NONE      ctermfg=magenta     ctermbg=NONE        cterm=NONE
+
+hi Keyword          guifg=#96CBFE     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE
+hi PreProc          guifg=#96CBFE     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE
+hi Conditional      guifg=#6699CC     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE  " if else end
+
+hi Todo             guifg=#8f8f8f     guibg=NONE        gui=NONE      ctermfg=red         ctermbg=NONE        cterm=NONE
+hi Constant         guifg=#99CC99     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
+
+hi Identifier       guifg=#C6C5FE     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
+hi Function         guifg=#FFD2A7     guibg=NONE        gui=NONE      ctermfg=brown       ctermbg=NONE        cterm=NONE
+hi Type             guifg=#FFFFB6     guibg=NONE        gui=NONE      ctermfg=yellow      ctermbg=NONE        cterm=NONE
+hi Statement        guifg=#6699CC     guibg=NONE        gui=NONE      ctermfg=lightblue   ctermbg=NONE        cterm=NONE
+
+hi Special          guifg=#E18964     guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
+hi Delimiter        guifg=#00A0A0     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
+hi Operator         guifg=white       guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
+
+hi link Character       Constant
+hi link Boolean         Constant
+hi link Float           Number
+hi link Repeat          Statement
+hi link Label           Statement
+hi link Exception       Statement
+hi link Include         PreProc
+hi link Define          PreProc
+hi link Macro           PreProc
+hi link PreCondit       PreProc
+hi link StorageClass    Type
+hi link Structure       Type
+hi link Typedef         Type
+hi link Tag             Special
+hi link SpecialChar     Special
+hi link SpecialComment  Special
+hi link Debug           Special
+
+
+" Special for Ruby
+hi rubyRegexp                  guifg=#B18A3D      guibg=NONE      gui=NONE      ctermfg=brown          ctermbg=NONE      cterm=NONE
+hi rubyRegexpDelimiter         guifg=#FF8000      guibg=NONE      gui=NONE      ctermfg=brown          ctermbg=NONE      cterm=NONE
+hi rubyEscape                  guifg=white        guibg=NONE      gui=NONE      ctermfg=cyan           ctermbg=NONE      cterm=NONE
+hi rubyInterpolationDelimiter  guifg=#00A0A0      guibg=NONE      gui=NONE      ctermfg=blue           ctermbg=NONE      cterm=NONE
+hi rubyControl                 guifg=#6699CC      guibg=NONE      gui=NONE      ctermfg=blue           ctermbg=NONE      cterm=NONE  "and break, etc
+"hi rubyGlobalVariable          guifg=#FFCCFF      guibg=NONE      gui=NONE      ctermfg=lightblue      ctermbg=NONE      cterm=NONE  "yield
+hi rubyStringDelimiter         guifg=#336633      guibg=NONE      gui=NONE      ctermfg=lightgreen     ctermbg=NONE      cterm=NONE
+"rubyInclude
+"rubySharpBang
+"rubyAccess
+"rubyPredefinedVariable
+"rubyBoolean
+"rubyClassVariable
+"rubyBeginEnd
+"rubyRepeatModifier
+"hi link rubyArrayDelimiter    Special  " [ , , ]
+"rubyCurlyBlock  { , , }
+
+hi link rubyClass             Keyword 
+hi link rubyModule            Keyword 
+hi link rubyKeyword           Keyword 
+hi link rubyOperator          Operator
+hi link rubyIdentifier        Identifier
+hi link rubyInstanceVariable  Identifier
+hi link rubyGlobalVariable    Identifier
+hi link rubyClassVariable     Identifier
+hi link rubyConstant          Type  
+
+
+" Special for Java
+" hi link javaClassDecl    Type
+hi link javaScopeDecl         Identifier 
+hi link javaCommentTitle      javaDocSeeTag 
+hi link javaDocTags           javaDocSeeTag 
+hi link javaDocParam          javaDocSeeTag 
+hi link javaDocSeeTagParam    javaDocSeeTag 
+
+hi javaDocSeeTag              guifg=#CCCCCC     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+hi javaDocSeeTag              guifg=#CCCCCC     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+"hi javaClassDecl              guifg=#CCFFCC     guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
+
+
+" Special for XML
+hi link xmlTag          Keyword 
+hi link xmlTagName      Conditional 
+hi link xmlEndTag       Identifier 
+
+
+" Special for HTML
+hi link htmlTag         Keyword 
+hi link htmlTagName     Conditional 
+hi link htmlEndTag      Identifier 
+
+
+" Special for Javascript
+hi link javaScriptNumber      Number 
+
+
+" Special for Python
+"hi  link pythonEscape         Keyword      
+
+
+" Special for CSharp
+hi  link csXmlTag             Keyword      
+
+
+" Special for PHP
diff --git a/vim/colors/ironman.vim b/vim/colors/ironman.vim
new file mode 100644 (file)
index 0000000..d98a936
--- /dev/null
@@ -0,0 +1,133 @@
+" Vim color file
+" Maintainer:  Michael Boehler
+" Mail:        michael@familie-boehler.de
+" Last Change: 2008-2-21
+" Version:     3.2
+" This color scheme uses a light background.
+" GUI only
+" inspired by colorsheme PYTE
+
+set background=light
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "ironman"
+
+hi Normal                    guifg=#222222 guibg=#F0F0F0
+                             
+" Search
+hi IncSearch                 gui=NONE guifg=Black guibg=#FFFF4B
+hi Search                    gui=NONE guifg=Black guibg=#FFFF8F
+
+" Messages
+hi ErrorMsg                  gui=NONE guifg=#FF0000 guibg=NONE    
+hi WarningMsg                gui=NONE guifg=#FF6600 guibg=NONE
+hi ModeMsg                   gui=NONE guifg=#0070ff guibg=NONE
+hi MoreMsg                   gui=NONE guifg=#FF6600 guibg=NONE
+hi Question                  gui=NONE guifg=#008050 guibg=NONE
+
+" Completion Popup Menu
+hi Pmenu                     gui=NONE guifg=#303040 guibg=#ccff00
+hi PmenuSel                  gui=NONE guifg=#303040 guibg=#ffff00
+" hi PmenuSbar scrollbar  |hl-PmenuSbar|
+" hi PmenuThumb        thumb of the scrollbar  |hl-PmenuThumb|
+
+" Split area
+hi StatusLine                gui=ITALIC guifg=white   guibg=#8090a0
+hi StatusLineNC              gui=ITALIC guifg=#506070 guibg=#a0b0c0
+hi VertSplit                 gui=NONE guifg=#a0b0c0 guibg=#a0b0c0
+hi WarningMsgildMenu         gui=NONE guifg=Black   guibg=Orange
+" hi WildMenu                  gui=UNDERLINE guifg=#56A0EE guibg=#E9E9F4
+
+" Diff
+hi DiffText                  gui=NONE guifg=#2020ff guibg=#c8f2ea
+hi DiffDelete                gui=NONE guifg=#f83010 guibg=#ffeae0
+hi DiffAdd                   gui=NONE guifg=#006800 guibg=#d0ffd0
+hi DiffChange                gui=NONE guifg=#2020ff guibg=#c8f2ea
+                             
+" Cursor
+hi Cursor                    gui=NONE guifg=#ffffff guibg=#DE7171
+hi lCursor                   gui=NONE guifg=#f8f8f8 guibg=#8000ff
+hi CursorIM                  gui=NONE guifg=#f8f8f8 guibg=#8000ff
+hi CursorLine                gui=NONE guifg=NONE    guibg=#f6f6f6
+hi CursorColumn              gui=NONE guifg=NONE    guibg=#F9F9F9
+                             
+" Fold
+hi Folded                    gui=NONE guifg=#3399ff guibg=#EAF5FF
+hi FoldColumn                gui=NONE guifg=#3399ff guibg=#EAF5FF
+                             
+" Other hi Directory         gui=NONE guifg=#0000ff guibg=NONE
+hi LineNr                    gui=NONE guifg=#FFFFFF guibg=#C0D0E0
+hi NonText                   gui=NONE guifg=#C0C0C0 guibg=#E0E0E0
+hi SpecialKey                gui=NONE guifg=#35E0DF guibg=NONE
+hi Title                     gui=NONE guifg=#004060 guibg=#c8f0f8
+hi Visual                    gui=NONE guibg=#BDDFFF
+hi MatchParen                gui=NONE guifg=NONE    guibg=#9FFF82
+
+" Syntax group
+hi Comment                   gui=ITALIC guifg=#A0B0C0 guibg=#EFEFFF
+hi Paren                     gui=NONE guifg=#9326C1 guibg=NONE
+hi Comma                     gui=NONE guifg=#C12660 guibg=NONE
+hi Constant                  gui=NONE guifg=NONE    guibg=#E8F1FF
+hi Statement                 gui=NONE guifg=#005EC4 guibg=NONE
+hi Error                     gui=BOLD,UNDERLINE     guifg=#ff4080 guibg=NONE
+hi Identifier                gui=NONE guifg=#339933 guibg=NONE
+hi Ignore                    gui=NONE guifg=#f8f8f8 guibg=NONE
+hi Number                    gui=NONE guifg=#087B4D
+hi PreProc                   gui=NONE guifg=#0070e6 guibg=NONE
+hi Special                   gui=NONE guifg=#0000ff guibg=#ccf7ee
+hi Delimiter                 gui=BOLD guifg=#A8360F guibg=NONE
+hi Todo                      gui=NONE guifg=#ff0070 guibg=#ffe0f4
+hi Type                      gui=NONE guifg=#eb7950 guibg=NONE
+hi Underlined                gui=UNDERLINE guifg=#0000ff guibg=NONE
+
+hi Conditional               gui=None guifg=#0053FF guibg=bg
+hi Repeat                    gui=None guifg=SeaGreen2 guibg=bg
+hi Operator                  gui=None guifg=#0085B1 guibg=bg
+hi Keyword                   gui=None guifg=DarkBlue guibg=bg
+hi Exception                 gui=None guifg=DarkBlue guibg=bg
+hi Function                  gui=BOLD guifg=#3E0F70
+
+hi! link String        Constant
+hi! link SpecialComment Comment
+hi! link Character     Constant
+hi! link Boolean       Constant
+hi! link Float         Number
+hi! link Label         Statement
+hi! link Include       PreProc
+hi! link Define        PreProc
+hi! link Macro         PreProc
+hi! link PreCondit     PreProc
+hi! link StorageClass  Type
+hi! link Structure     Type
+hi! link Typedef       Type
+hi! link SpecialChar   Special
+hi! link Debug         Special
+
+" HTML
+hi htmlLink                  gui=UNDERLINE guifg=#0000ff guibg=NONE
+hi htmlBold                  gui=BOLD
+hi htmlBoldItalic            gui=BOLD,ITALIC
+hi htmlBoldUnderline         gui=BOLD,UNDERLINE
+hi htmlBoldUnderlineItalic   gui=BOLD,UNDERLINE,ITALIC
+hi htmlItalic                gui=ITALIC
+hi htmlUnderline             gui=UNDERLINE
+hi htmlUnderlineItalic       gui=UNDERLINE,ITALIC
+
+" Tabs {{{1
+highlight TabLine            gui=underline guibg=LightGrey
+highlight TabLineFill        gui=reverse
+highlight TabLineSel         gui=bold
+
+highlight SpellBad           gui=undercurl guisp=Red
+highlight SpellCap           gui=undercurl guisp=Blue
+highlight SpellRare          gui=undercurl guisp=Magenta
+highlight SpellLocale        gui=undercurl guisp=DarkCyan
+
+" Completion {{{1
+highlight Pmenu              guifg=Black   guibg=#BDDFFF
+highlight PmenuSel           guifg=Black   guibg=Orange
+highlight PmenuSbar          guifg=#CCCCCC guibg=#CCCCCC
+highlight PmenuThumb         gui=reverse guifg=Black   guibg=#AAAAAA
diff --git a/vim/colors/jammy.vim b/vim/colors/jammy.vim
new file mode 100644 (file)
index 0000000..b12ed5f
--- /dev/null
@@ -0,0 +1,111 @@
+" Vim color file inherit from the desrt.vim 
+" Maintainer:  Jammy Lee<mistapostle@gmail.com>
+" Last Change: $Date: 2008/03/20 19:30:30 $
+" Version:     $Id: jammy.vim,v 1.1 2008/03/20 $
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+       syntax reset
+    endif
+endif
+let g:colors_name="jammy"
+
+hi Normal      guifg=White guibg=Black
+
+" highlight groups
+hi Cursor      guibg=khaki guifg=slategrey
+"hi CursorIM
+"hi Directory
+"hi DiffAdd
+"hi DiffChange
+"hi DiffDelete
+"hi DiffText
+"hi ErrorMsg
+hi String      guifg=Skyblue
+hi VertSplit   guibg=#c2bfa5 guifg=grey50 gui=none
+hi Folded      guibg=grey30 guifg=gold
+hi FoldColumn  guibg=grey30 guifg=tan
+hi IncSearch   guifg=slategrey guibg=khaki
+"hi LineNr
+hi ModeMsg     guifg=goldenrod
+hi MoreMsg     guifg=SeaGreen
+hi NonText     guifg=LightBlue guibg=black
+hi Question    guifg=springgreen
+hi Search      guibg=peru guifg=wheat
+hi SpecialKey  guifg=yellowgreen
+hi StatusLine  guibg=#c2bfa5 guifg=black gui=none
+hi StatusLineNC        guibg=#c2bfa5 guifg=grey50 gui=none
+hi Title       guifg=indianred
+hi Visual      gui=none   guibg=grey30
+"hi VisualNOS
+hi WarningMsg  guifg=salmon
+"hi WildMenu
+"hi Menu
+"hi Scrollbar
+"hi Tooltip
+
+" syntax highlighting groups
+hi Comment     guifg=grey60
+hi Constant    guifg=indianred
+
+hi Identifier  guifg=palegreen 
+"hi Identifier guifg=#D18B2C
+"palegreen
+"hi Statement  guifg=khaki
+hi Statement    guifg=#E6DB74
+hi PreProc     guifg=Skyblue
+hi Type                guifg=darkkhaki
+hi Special     guifg=navajowhite
+"hi Underlined
+hi Ignore      guifg=grey40
+"hi Error
+hi Todo                guifg=orangered guibg=yellow2
+
+" color terminal definitions
+hi SpecialKey  ctermfg=darkgreen
+hi NonText     cterm=bold ctermfg=darkblue
+hi Directory   ctermfg=darkcyan
+hi ErrorMsg    cterm=bold ctermfg=7 ctermbg=1
+hi IncSearch   cterm=NONE ctermfg=yellow ctermbg=green
+hi Search      cterm=NONE ctermfg=grey ctermbg=blue
+hi MoreMsg     ctermfg=darkgreen
+hi ModeMsg     cterm=NONE ctermfg=brown
+hi LineNr      ctermfg=3
+hi Question    ctermfg=green
+hi StatusLine  cterm=bold,reverse
+hi StatusLineNC cterm=reverse
+hi VertSplit   cterm=reverse
+hi Title       ctermfg=5
+hi Visual      cterm=reverse
+hi VisualNOS   cterm=bold,underline
+hi WarningMsg  ctermfg=1
+hi WildMenu    ctermfg=0 ctermbg=3
+hi Folded      ctermfg=darkgrey ctermbg=NONE
+hi FoldColumn  ctermfg=darkgrey ctermbg=NONE
+hi DiffAdd     ctermbg=4
+hi DiffChange  ctermbg=5
+hi DiffDelete  cterm=bold ctermfg=4 ctermbg=6
+hi DiffText    cterm=bold ctermbg=1
+hi Comment     ctermfg=darkcyan
+hi Constant    ctermfg=brown
+hi Special     ctermfg=5
+hi Identifier  ctermfg=6
+hi Statement   ctermfg=3
+hi PreProc     ctermfg=5
+hi Type                ctermfg=2
+hi Underlined  cterm=underline ctermfg=5
+hi Ignore      cterm=bold ctermfg=7
+hi Ignore      ctermfg=darkgrey
+hi Error       cterm=bold ctermfg=7 ctermbg=1
+
+
+"vim: sw=4
diff --git a/vim/colors/jellybeans+.vim b/vim/colors/jellybeans+.vim
new file mode 100644 (file)
index 0000000..00702b7
--- /dev/null
@@ -0,0 +1,6 @@
+runtime colors/jellybeans.vim
+let g:colors_name = "jellybeans+"
+
+hi  VertSplit    guibg=#888888
+hi  StatusLine   guibg=#cccccc guifg=#000000
+hi  StatusLineNC guibg=#888888 guifg=#000000
diff --git a/vim/colors/jellybeans.vim b/vim/colors/jellybeans.vim
new file mode 100644 (file)
index 0000000..606d558
--- /dev/null
@@ -0,0 +1,491 @@
+" Vim color file
+"
+"  "    __       _ _       _                             "
+"  "    \ \  ___| | |_   _| |__   ___  __ _ _ __  ___    "
+"  "     \ \/ _ \ | | | | |  _ \ / _ \/ _  |  _ \/ __|   "
+"  "  /\_/ /  __/ | | |_| | |_| |  __/ |_| | | | \__ \   "
+"  "  \___/ \___|_|_|\__  |____/ \___|\____|_| |_|___/   "
+"  "                 \___/                               "
+"
+"         "A colorful, dark color scheme for Vim."
+"
+" File:         jellybeans.vim
+" Maintainer:   NanoTech <http://nanotech.nanotechcorp.net/>
+" Version:      1.5
+" Last Change:  January 15th, 2012
+" Contributors: Daniel Herbert <http://pocket-ninja.com/>,
+"               Henry So, Jr. <henryso@panix.com>,
+"               David Liang <bmdavll at gmail dot com>,
+"               Rich Healey (richoH),
+"               Andrew Wong (w0ng)
+"
+" Copyright (c) 2009-2012 NanoTech
+"
+" Permission is hereby granted, free of charge, to any person obtaining a copy
+" of this software and associated documentation files (the "Software"), to deal
+" in the Software without restriction, including without limitation the rights
+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+" copies of the Software, and to permit persons to whom the Software is
+" furnished to do so, subject to the following conditions:
+"
+" The above copyright notice and this permission notice shall be included in
+" all copies or substantial portions of the Software.
+"
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+" THE SOFTWARE.
+
+set background=dark
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "jellybeans"
+
+if has("gui_running") || &t_Co == 88 || &t_Co == 256
+  let s:low_color = 0
+else
+  let s:low_color = 1
+endif
+
+" Color approximation functions by Henry So, Jr. and David Liang {{{
+" Added to jellybeans.vim by Daniel Herbert
+
+" returns an approximate grey index for the given grey level
+fun! s:grey_number(x)
+  if &t_Co == 88
+    if a:x < 23
+      return 0
+    elseif a:x < 69
+      return 1
+    elseif a:x < 103
+      return 2
+    elseif a:x < 127
+      return 3
+    elseif a:x < 150
+      return 4
+    elseif a:x < 173
+      return 5
+    elseif a:x < 196
+      return 6
+    elseif a:x < 219
+      return 7
+    elseif a:x < 243
+      return 8
+    else
+      return 9
+    endif
+  else
+    if a:x < 14
+      return 0
+    else
+      let l:n = (a:x - 8) / 10
+      let l:m = (a:x - 8) % 10
+      if l:m < 5
+        return l:n
+      else
+        return l:n + 1
+      endif
+    endif
+  endif
+endfun
+
+" returns the actual grey level represented by the grey index
+fun! s:grey_level(n)
+  if &t_Co == 88
+    if a:n == 0
+      return 0
+    elseif a:n == 1
+      return 46
+    elseif a:n == 2
+      return 92
+    elseif a:n == 3
+      return 115
+    elseif a:n == 4
+      return 139
+    elseif a:n == 5
+      return 162
+    elseif a:n == 6
+      return 185
+    elseif a:n == 7
+      return 208
+    elseif a:n == 8
+      return 231
+    else
+      return 255
+    endif
+  else
+    if a:n == 0
+      return 0
+    else
+      return 8 + (a:n * 10)
+    endif
+  endif
+endfun
+
+" returns the palette index for the given grey index
+fun! s:grey_color(n)
+  if &t_Co == 88
+    if a:n == 0
+      return 16
+    elseif a:n == 9
+      return 79
+    else
+      return 79 + a:n
+    endif
+  else
+    if a:n == 0
+      return 16
+    elseif a:n == 25
+      return 231
+    else
+      return 231 + a:n
+    endif
+  endif
+endfun
+
+" returns an approximate color index for the given color level
+fun! s:rgb_number(x)
+  if &t_Co == 88
+    if a:x < 69
+      return 0
+    elseif a:x < 172
+      return 1
+    elseif a:x < 230
+      return 2
+    else
+      return 3
+    endif
+  else
+    if a:x < 75
+      return 0
+    else
+      let l:n = (a:x - 55) / 40
+      let l:m = (a:x - 55) % 40
+      if l:m < 20
+        return l:n
+      else
+        return l:n + 1
+      endif
+    endif
+  endif
+endfun
+
+" returns the actual color level for the given color index
+fun! s:rgb_level(n)
+  if &t_Co == 88
+    if a:n == 0
+      return 0
+    elseif a:n == 1
+      return 139
+    elseif a:n == 2
+      return 205
+    else
+      return 255
+    endif
+  else
+    if a:n == 0
+      return 0
+    else
+      return 55 + (a:n * 40)
+    endif
+  endif
+endfun
+
+" returns the palette index for the given R/G/B color indices
+fun! s:rgb_color(x, y, z)
+  if &t_Co == 88
+    return 16 + (a:x * 16) + (a:y * 4) + a:z
+  else
+    return 16 + (a:x * 36) + (a:y * 6) + a:z
+  endif
+endfun
+
+" returns the palette index to approximate the given R/G/B color levels
+fun! s:color(r, g, b)
+  " get the closest grey
+  let l:gx = s:grey_number(a:r)
+  let l:gy = s:grey_number(a:g)
+  let l:gz = s:grey_number(a:b)
+
+  " get the closest color
+  let l:x = s:rgb_number(a:r)
+  let l:y = s:rgb_number(a:g)
+  let l:z = s:rgb_number(a:b)
+
+  if l:gx == l:gy && l:gy == l:gz
+    " there are two possibilities
+    let l:dgr = s:grey_level(l:gx) - a:r
+    let l:dgg = s:grey_level(l:gy) - a:g
+    let l:dgb = s:grey_level(l:gz) - a:b
+    let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
+    let l:dr = s:rgb_level(l:gx) - a:r
+    let l:dg = s:rgb_level(l:gy) - a:g
+    let l:db = s:rgb_level(l:gz) - a:b
+    let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
+    if l:dgrey < l:drgb
+      " use the grey
+      return s:grey_color(l:gx)
+    else
+      " use the color
+      return s:rgb_color(l:x, l:y, l:z)
+    endif
+  else
+    " only one possibility
+    return s:rgb_color(l:x, l:y, l:z)
+  endif
+endfun
+
+" returns the palette index to approximate the 'rrggbb' hex string
+fun! s:rgb(rgb)
+  let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
+  let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
+  let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
+  return s:color(l:r, l:g, l:b)
+endfun
+
+" sets the highlighting for the given group
+fun! s:X(group, fg, bg, attr, lcfg, lcbg)
+  if s:low_color
+    let l:fge = empty(a:lcfg)
+    let l:bge = empty(a:lcbg)
+
+    if !l:fge && !l:bge
+      exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg
+    elseif !l:fge && l:bge
+      exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE"
+    elseif l:fge && !l:bge
+      exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg
+    endif
+  else
+    let l:fge = empty(a:fg)
+    let l:bge = empty(a:bg)
+
+    if !l:fge && !l:bge
+      exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".s:rgb(a:bg)
+    elseif !l:fge && l:bge
+      exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)." ctermbg=NONE"
+    elseif l:fge && !l:bge
+      exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermfg=NONE ctermbg=".s:rgb(a:bg)
+    endif
+  endif
+
+  if a:attr == ""
+    exec "hi ".a:group." gui=none cterm=none"
+  else
+    let noitalic = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",")
+    if empty(noitalic)
+      let noitalic = "none"
+    endif
+    exec "hi ".a:group." gui=".a:attr." cterm=".noitalic
+  endif
+endfun
+" }}}
+
+call s:X("Normal","e8e8d3","151515","","White","")
+set background=dark
+
+if !exists("g:jellybeans_use_lowcolor_black") || g:jellybeans_use_lowcolor_black
+    let s:termBlack = "Black"
+else
+    let s:termBlack = "Grey"
+endif
+
+if version >= 700
+  call s:X("CursorLine","","1c1c1c","","",s:termBlack)
+  call s:X("CursorColumn","","1c1c1c","","",s:termBlack)
+  call s:X("MatchParen","ffffff","80a090","bold","","DarkCyan")
+
+  call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack)
+  call s:X("TabLineFill","9098a0","","","",s:termBlack)
+  call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White")
+
+  " Auto-completion
+  call s:X("Pmenu","ffffff","606060","","White",s:termBlack)
+  call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White")
+endif
+
+call s:X("Visual","","404040","","",s:termBlack)
+call s:X("Cursor","","b0d0f0","","","")
+
+call s:X("LineNr","605958","151515","none",s:termBlack,"")
+call s:X("Comment","888888","","italic","Grey","")
+call s:X("Todo","808080","","bold","White",s:termBlack)
+
+call s:X("StatusLine","000000","dddddd","italic","","White")
+call s:X("StatusLineNC","ffffff","403c41","italic","White","Black")
+call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack)
+call s:X("WildMenu","f0a0c0","302028","","Magenta","")
+
+call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"")
+call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack)
+call s:X("SignColumn","777777","333333","","",s:termBlack)
+call s:X("ColorColumn","","000000","","",s:termBlack)
+
+call s:X("Title","70b950","","bold","Green","")
+
+call s:X("Constant","cf6a4c","","","Red","")
+call s:X("Special","799d6a","","","Green","")
+call s:X("Delimiter","668799","","","Grey","")
+
+call s:X("String","99ad6a","","","Green","")
+call s:X("StringDelimiter","556633","","","DarkGreen","")
+
+call s:X("Identifier","c6b6ee","","","LightCyan","")
+call s:X("Structure","8fbfdc","","","LightCyan","")
+call s:X("Function","fad07a","","","Yellow","")
+call s:X("Statement","8197bf","","","DarkBlue","")
+call s:X("PreProc","8fbfdc","","","LightBlue","")
+
+hi! link Operator Normal
+
+call s:X("Type","ffb964","","","Yellow","")
+call s:X("NonText","606060","151515","",s:termBlack,"")
+
+call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"")
+
+call s:X("Search","f0a0c0","302028","underline","Magenta","")
+
+call s:X("Directory","dad085","","","Yellow","")
+call s:X("ErrorMsg","","902020","","","DarkRed")
+hi! link Error ErrorMsg
+hi! link MoreMsg Special
+call s:X("Question","65C254","","","Green","")
+
+
+" Spell Checking
+
+call s:X("SpellBad","","902020","underline","","DarkRed")
+call s:X("SpellCap","","0000df","underline","","Blue")
+call s:X("SpellRare","","540063","underline","","DarkMagenta")
+call s:X("SpellLocal","","2D7067","underline","","Green")
+
+" Diff
+
+hi! link diffRemoved Constant
+hi! link diffAdded String
+
+" VimDiff
+
+call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen")
+call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed")
+call s:X("DiffChange","","2B5B77","","White","DarkBlue")
+call s:X("DiffText","8fbfdc","000000","reverse","Yellow","")
+
+" PHP
+
+hi! link phpFunctions Function
+call s:X("StorageClass","c59f6f","","","Red","")
+hi! link phpSuperglobal Identifier
+hi! link phpQuoteSingle StringDelimiter
+hi! link phpQuoteDouble StringDelimiter
+hi! link phpBoolean Constant
+hi! link phpNull Constant
+hi! link phpArrayPair Operator
+
+" Ruby
+
+hi! link rubySharpBang Comment
+call s:X("rubyClass","447799","","","DarkBlue","")
+call s:X("rubyIdentifier","c6b6fe","","","Cyan","")
+hi! link rubyConstant Type
+hi! link rubyFunction Function
+
+call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","")
+call s:X("rubySymbol","7697d6","","","Blue","")
+hi! link rubyGlobalVariable rubyInstanceVariable
+hi! link rubyModule rubyClass
+call s:X("rubyControl","7597c6","","","Blue","")
+
+hi! link rubyString String
+hi! link rubyStringDelimiter StringDelimiter
+hi! link rubyInterpolationDelimiter Identifier
+
+call s:X("rubyRegexpDelimiter","540063","","","Magenta","")
+call s:X("rubyRegexp","dd0093","","","DarkMagenta","")
+call s:X("rubyRegexpSpecial","a40073","","","Magenta","")
+
+call s:X("rubyPredefinedIdentifier","de5577","","","Red","")
+
+" JavaScript
+
+hi! link javaScriptValue Constant
+hi! link javaScriptRegexpString rubyRegexp
+
+" CoffeeScript
+
+hi! link coffeeRegExp javaScriptRegexpString
+
+" Lua
+
+hi! link luaOperator Conditional
+
+" C
+
+hi! link cOperator Constant
+
+" Objective-C/Cocoa
+
+hi! link objcClass Type
+hi! link cocoaClass objcClass
+hi! link objcSubclass objcClass
+hi! link objcSuperclass objcClass
+hi! link objcDirective rubyClass
+hi! link objcStatement Constant
+hi! link cocoaFunction Function
+hi! link objcMethodName Identifier
+hi! link objcMethodArg Normal
+hi! link objcMessageName Identifier
+
+" Debugger.vim
+
+call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue")
+call s:X("DbgBreakPt","","4F0037","","","DarkMagenta")
+
+" vim-indent-guides
+
+if !exists("g:indent_guides_auto_colors")
+  let g:indent_guides_auto_colors = 0
+endif
+call s:X("IndentGuidesOdd","","202020","","","")
+call s:X("IndentGuidesEven","","1c1c1c","","","")
+
+" Plugins, etc.
+
+hi! link TagListFileName Directory
+call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green")
+
+" Manual overrides for 256-color terminals. Dark colors auto-map badly.
+if !s:low_color
+  hi StatusLineNC ctermbg=235
+  hi Folded ctermbg=236
+  hi FoldColumn ctermbg=234
+  hi SignColumn ctermbg=236
+  hi CursorColumn ctermbg=234
+  hi CursorLine ctermbg=234
+  hi SpecialKey ctermbg=234
+  hi NonText ctermbg=233
+  hi LineNr ctermbg=233
+  hi DiffText ctermfg=81
+  hi Normal ctermbg=233
+  hi DbgBreakPt ctermbg=53
+endif
+
+" delete functions {{{
+delf s:X
+delf s:rgb
+delf s:color
+delf s:rgb_color
+delf s:rgb_level
+delf s:rgb_number
+delf s:grey_color
+delf s:grey_level
+delf s:grey_number
+" }}}
diff --git a/vim/colors/kellys.vim b/vim/colors/kellys.vim
new file mode 100644 (file)
index 0000000..d52713a
--- /dev/null
@@ -0,0 +1,236 @@
+" Description: a colour scheme inspired by kellys bicycles
+"  Maintainer: kamil.stachowski@gmail.com
+"     License: gpl 3+
+"     Version: 0.3 (2008.12.07)
+
+" changelog:
+"         0.3: 2008.12.07
+"                              finished ada, haskell, html, lisp, pascal, php, python, ruby, scheme, sh, xml and vim
+"                              changed preproc to slightly darker
+"                              changed statement to bold
+"         0.2: 2008.12.02
+"                              added support for 256-colour terminal
+"                              added diff*, pmenu* and wildmenu
+"                              added some cpp, java*, python*, some sh and ruby*
+"                              removed italic from comments and made them slightly lighter
+"         0.1: 2008.11.28
+"                      initial version
+
+
+set background=dark
+
+if version > 580
+       hi clear
+       if exists("syntax_on")
+               syntax reset
+       endif
+endif
+
+let colors_name = "kellys"
+
+" black                        2a2b2f  235
+" blue                 62acce  81
+" blue slight  9ab2c8  74
+" brown slight d1c79e  144
+" green        yellowy d1d435  184
+" grey dark            67686b  240
+" grey light   e1e0e5  254
+" orange               e6ac32  178
+" red                  9d0e15  124
+
+" tabline
+
+if has("gui_running")
+       hi Comment              guifg=#67686b   guibg=#2a2b2f   gui=none
+       hi Cursor               guifg=#2a2b2f   guibg=#e1e0e5   gui=none
+       hi Constant     guifg=#d1c79e   guibg=#2a2b2f   gui=none
+       hi CursorLine                           guibg=#303132   gui=none
+       hi DiffAdd              guifg=#2a2b2f   guibg=#9ab2c8   gui=none
+       hi DiffChange   guifg=#2a2b2f   guibg=#d1c79e   gui=none
+       hi DiffDelete   guifg=#67686b   guibg=#2a2b2f   gui=none
+       hi DiffText             guifg=#9d0e15   guibg=#d1c79e   gui=none
+       hi Folded               guifg=#2a2b2f   guibg=#67686b   gui=none
+       hi MatchParen   guifg=#d1d435   guibg=#2a2b2f   gui=bold,underline
+       hi ModeMsg              guifg=#e1e0e5   guibg=#2a2b2f   gui=bold
+       hi Normal               guifg=#e1e0e5   guibg=#2a2b2f   gui=none
+       hi Pmenu                guifg=#2a2b2f   guibg=#9ab2c8   gui=none
+       hi PmenuSel             guifg=#2a2b2f   guibg=#62acce   gui=bold
+       hi PmenuSbar    guifg=#2a2b2f   guibg=#2a2b2f   gui=none
+       hi PmenuThumb   guifg=#2a2b2f   guibg=#62acce   gui=none
+       hi PreProc              guifg=#d1d435   guibg=#2a2b2f   gui=none 
+       hi Search               guifg=#2a2b2f   guibg=#e1e0e5   gui=none
+       hi Special              guifg=#9ab2c8   guibg=#2a2b2f   gui=none
+       hi Statement    guifg=#62acce   guibg=#2a2b2f   gui=bold
+       hi StatusLine   guifg=#2a2b2f   guibg=#62acce   gui=bold
+       hi StatusLineNC guifg=#2a2b2f   guibg=#e1e0e5   gui=none
+       hi Todo                 guifg=#e1e0e5   guibg=#9d0e15   gui=bold
+       hi Type                 guifg=#e6ac32   guibg=#2a2b2f   gui=none
+       hi Underlined   guifg=#e1e0e5   guibg=#2a2b2f   gui=underline
+       hi Visual               guifg=#2a2b2f   guibg=#e1e0e5   gui=none
+       hi Wildmenu             guifg=#62acce   guibg=#2a2b2f   gui=bold
+else
+       if &t_Co == 256
+               hi Comment              ctermfg=239     ctermbg=235     cterm=none
+               hi Cursor               ctermfg=235     ctermbg=254     cterm=none
+               hi Constant     ctermfg=144     ctermbg=235     cterm=none
+               hi CursorLine                   ctermbg=236     cterm=none
+               hi DiffAdd              ctermfg=235     ctermbg=74      cterm=none
+               hi DiffChange   ctermfg=235     ctermbg=144     cterm=none
+               hi DiffDelete   ctermfg=239     ctermbg=235     cterm=none
+               hi DiffText             ctermfg=124     ctermbg=144     cterm=none
+               hi Folded               ctermfg=239     ctermbg=235     cterm=none
+               hi MatchParen   ctermfg=184     ctermbg=235     cterm=bold,underline
+               hi ModeMsg              ctermfg=254     ctermbg=235     cterm=bold
+               hi Normal               ctermfg=254     ctermbg=235     cterm=none
+               hi Pmenu                ctermfg=235     ctermbg=74      cterm=none
+               hi PmenuSel             ctermfg=235     ctermbg=81      cterm=bold
+               hi PmenuSbar    ctermfg=235     ctermbg=235     cterm=none
+               hi PmenuThumb   ctermfg=235     ctermbg=81      cterm=none
+               hi PreProc              ctermfg=184     ctermbg=235     cterm=none 
+               hi Search               ctermfg=235     ctermbg=254     cterm=none
+               hi Special              ctermfg=74      ctermbg=235     cterm=none
+               hi Statement    ctermfg=81      ctermbg=235     cterm=none
+               hi StatusLine   ctermfg=235     ctermbg=81      cterm=bold
+               hi StatusLineNC ctermfg=235     ctermbg=254     cterm=none
+               hi Todo                 ctermfg=254     ctermbg=124     cterm=bold
+               hi Type                 ctermfg=178     ctermbg=234     cterm=none
+               hi Underlined   ctermfg=254     ctermbg=234     cterm=underline
+               hi Visual               ctermfg=235     ctermbg=254     cterm=none
+               hi Wildmenu             ctermfg=81      ctermbg=234     cterm=bold
+       endif
+endif
+
+hi! link Boolean               Constant
+hi! link Character             Constant
+hi! link Conditional   Statement
+hi! link CursorColumn  CursorLine
+hi! link Debug                 Special 
+hi! link Define                        PreProc
+hi! link Delimiter             Special
+hi! link Directory             Type
+hi! link Error                 Todo
+hi! link ErrorMsg              Error
+hi! link Exception             Statement
+hi! link Float                 Constant
+hi! link FoldColumn            Folded
+hi! link Function              Normal
+hi! link Identifier            Special
+hi! link Ignore                        Comment
+hi! link IncSearch             Search
+hi! link Include               PreProc
+hi! link Keyword               Statement
+hi! link Label                 Statement
+hi! link LineNr                        Comment
+hi! link Macro                 PreProc
+hi! link MoreMsg               ModeMsg
+hi! link NonText               Comment
+hi! link Number                        Constant
+hi! link Operator              Special
+hi! link PreCondit             PreProc
+hi! link Question              MoreMsg
+hi! link Repeat                        Statement
+hi! link SignColumn            FoldColumn
+hi! link SpecialChar   Special
+hi! link SpecialComment        Special
+hi! link SpecialKey            Special
+hi! link SpellBad              Error
+hi! link SpellCap              Error
+hi! link SpellLocal            Error
+hi! link SpellRare             Error
+hi! link StorageClass  Type
+hi! link String                        Constant
+hi! link Structure             Type
+hi! link Tag                   Special
+hi! link Title                 ModeMsg
+hi! link Typedef               Type
+hi! link VertSplit             StatusLineNC
+hi! link WarningMsg            Error
+
+" ada
+hi! link adaBegin                      Type
+hi! link adaEnd                                Type
+hi! link adaKeyword                    Special
+" c++
+hi! link cppAccess                     Type
+hi! link cppStatement          Special
+" hs
+hi! link ConId                         Type
+hi! link hsPragma                      PreProc
+hi! link hsConSym                      Operator
+" html
+hi! link htmlArg                       Statement
+hi! link htmlEndTag                    Special
+hi! link htmlLink                      Underlined
+hi! link htmlSpecialTagName    PreProc
+hi! link htmlTag                       Special
+hi! link htmlTagName           Type
+" java
+hi! link javaTypeDef           Special
+" lisp
+hi! link lispAtom                      Constant
+hi! link lispAtomMark          Constant
+hi! link lispConcat                    Special
+hi! link lispDecl                      Type
+hi! link lispFunc                      Special
+hi! link lispKey                       PreProc
+" pas
+hi! link pascalAsmKey          Statement
+hi! link pascalDirective       PreProc
+hi! link pascalModifier                PreProc
+hi! link pascalPredefined      Special
+hi! link pascalStatement       Type
+hi! link pascalStruct          Type
+" php
+hi! link phpComparison         Special
+hi! link phpDefine                     Normal
+hi! link phpIdentifier         Normal
+hi! link phpMemberSelector     Special
+hi! link phpRegion                     Special
+hi! link phpVarSelector                Special
+" py
+hi! link pythonStatement       Type
+" rb
+hi! link rubyConstant          Special
+hi! link rubyDefine                    Type
+hi! link rubyRegexp                    Special
+" scm
+hi! link schemeSyntax          Special
+" sh
+hi! link shArithRegion         Normal
+hi! link shDerefSimple         Normal
+hi! link shDerefVar                    Normal
+hi! link shFunction                    Type
+hi! link shLoop                                Statement
+hi! link shStatement           Special
+hi! link shVariable                    Normal
+" sql
+hi! link sqlKeyword                    Statement
+" vim
+hi! link vimCommand                    Statement
+hi! link vimCommentTitle       Normal
+hi! link vimEnvVar                     Special
+hi! link vimFuncKey                    Type
+hi! link vimGroup                      Special
+hi! link vimHiAttrib           Constant
+hi! link vimHiCTerm                    Special
+hi! link vimHiCtermFgBg                Special
+hi! link vimHighlight          Special
+hi! link vimHiGui                      Special
+hi! link vimHiGuiFgBg          Special
+hi! link vimOption                     Special
+hi! link vimSyntax                     Special
+hi! link vimSynType                    Special
+hi! link vimUserAttrb          Special
+" xml
+hi! link xmlAttrib                     Special
+hi! link xmlCdata                      Normal
+hi! link xmlCdataCdata         Statement
+hi! link xmlCdataEnd           PreProc
+hi! link xmlCdataStart         PreProc
+hi! link xmlDocType                    PreProc
+hi! link xmlDocTypeDecl                PreProc
+hi! link xmlDocTypeKeyword     PreProc
+hi! link xmlEndTag                     Statement
+hi! link xmlProcessingDelim    PreProc
+hi! link xmlNamespace          PreProc
+hi! link xmlTagName                    Statement
diff --git a/vim/colors/leo.vim b/vim/colors/leo.vim
new file mode 100644 (file)
index 0000000..f11cbea
--- /dev/null
@@ -0,0 +1,150 @@
+" Vim color file
+" Maintainer:           Lorenzo Leonini <vim-theme[a]leonini[.]net>
+" Last Change:  2009 Feb 23
+" URL:                                  http://www.leonini.net
+
+" Description:
+" A contrasted theme for long programming sessions.
+" Specially for 256-colors term (xterm, Eterm, konsole, gnome-terminal, ...)
+" Very good with Ruby, C, Lua, PHP, HTML, shell...
+" (but no using language specific settings)
+
+" Note:
+" If your term report 8 colors (but is 256 capable), put 'set t_Co=256'
+" in your .vimrc
+
+" Tips:
+" :verbose hi StatusLine
+" Color numbers (0-255) see:
+"               http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
+"       :so $VIMRUNTIME/syntax/hitest.vim
+
+" 0.81 => 0.82
+" menu backgrounf lighter
+" LineNr
+" gui comments in italic
+"
+" 0.8 => 0.81
+" invisible char
+" line number
+" status bar
+" add MatchParen
+" add Underlined
+"
+" 0.6 => 0.8
+" GUI fixed, color < 16 fixed
+" comments from 247 => 249
+" main color 255 => 254
+" boolean and numbers more visible
+"
+" 0.5 => 0.6
+" Synchro with GUI
+
+" 0.3 => 0.5
+" Ligther vertical separation
+" Better diff
+" Better pmenu
+" Uniformisation between status bar, tabs and pmenu
+" Added spell hl
+" Change search highlight (I don't use it...)
+" Folding done
+" All in 256 code
+
+if !has("gui_running")
+        if &t_Co != 256
+                echomsg "err: Please use a 256-colors terminal (so that t_Co=256 could be set)."
+                echomsg ""
+                finish
+        end
+endif
+
+let g:colors_name = "leo256"
+
+set background=dark
+if v:version > 580
+        highlight clear
+        if exists("syntax_on")
+                syntax reset
+        endif
+endif
+
+" Normal should come first
+hi Normal                               cterm=none              ctermfg=255             ctermbg=16 guibg=#000000 guifg=#ffffff
+hi CursorLine           cterm=none              ctermbg=16              guibg=#101010
+hi DiffAdd                      cterm=none              ctermbg=235             guibg=#262626
+hi DiffChange           cterm=none              ctermbg=235             guibg=#262626
+hi DiffDelete           cterm=none              ctermfg=238             ctermbg=244             guibg=#808080   guifg=#444444
+hi DiffText                     cterm=bold              ctermfg=255             ctermbg=196             guifg=#ffffff
+hi Directory            cterm=none              ctermfg=196
+hi ErrorMsg                     cterm=none              ctermfg=255             ctermbg=160             guifg=#ffffff
+hi FoldColumn           cterm=none              ctermfg=110             ctermbg=16              guibg=#000000
+hi SignColumn           cterm=none              ctermbg=16              guibg=#000000
+hi Folded                               cterm=none              ctermfg=16              ctermbg=110             guifg=#000000   guibg=#87afd7
+hi IncSearch            cterm=reverse
+hi LineNr                               cterm=none              ctermfg=228             ctermbg=16              guifg=#ffff87   guibg=#000000
+hi ModeMsg                      cterm=bold
+hi MoreMsg                      cterm=none              ctermfg=40
+hi NonText                      cterm=none              ctermfg=27
+hi Question                     cterm=none              ctermfg=40
+hi Search                               cterm=none              ctermfg=16              ctermbg=248             guifg=#000000   guibg=#a8a8a8
+hi SpecialKey           cterm=none              ctermfg=245             ctermbg=233             guifg=#8a8a8a   guibg=#121212
+hi StatusLine           cterm=bold              ctermfg=255             ctermbg=19              guifg=#0000ff   guibg=#ffffff
+hi StatusLineNC cterm=none              ctermfg=252             ctermbg=17              guibg=#d0d0d0 guifg=#00005f
+hi Title                                cterm=none              ctermfg=33
+hi VertSplit            cterm=none              ctermfg=254             ctermbg=16              guibg=#EEEEEE guifg=#000000
+hi Visual                               cterm=reverse   ctermbg=none
+hi VisualNOS            cterm=underline,bold
+hi WarningMsg           cterm=none              ctermfg=255             guifg=#ffffff
+hi WildMenu                     cterm=none              ctermfg=16              ctermbg=11
+
+if v:version >= 700
+        " light
+        "hi Pmenu                               cterm=none      ctermfg=16              ctermbg=252
+        "hi PmenuSel                    cterm=none      ctermfg=255             ctermbg=21
+        "hi PmenuSbar           cterm=none      ctermfg=240             ctermbg=240
+  "hi PmenuThumb                cterm=none      ctermfg=255             ctermbg=255
+
+        "dark
+        hi Pmenu                                cterm=none              ctermfg=255             ctermbg=237             guibg=#262626           guifg=#ffffff
+        hi PmenuSel                     cterm=none              ctermfg=255             ctermbg=21              guibg=#0000ff           guifg=#ffffff
+        hi PmenuSbar            cterm=none              ctermfg=240             ctermbg=240             guibg=#444444
+  hi PmenuThumb         cterm=none              ctermfg=255             ctermbg=255             guifg=#ffffff
+
+        hi SpellBad                     cterm=none    ctermfg=16                ctermbg=196
+        hi SpellCap                     cterm=none    ctermfg=16                ctermbg=196
+        hi SpellLocal           cterm=none    ctermfg=16                ctermbg=196
+        hi SpellRare            cterm=none    ctermfg=16                ctermbg=196
+        
+        " No need for GUI colors :)
+        hi TabLine                      cterm=none      ctermfg=252             ctermbg=17
+        hi TabLineSel           cterm=none      ctermfg=255             ctermbg=21
+        hi TabLineFill  cterm=none      ctermfg=17              ctermbg=17
+
+        hi MatchParen           cterm=none      ctermfg=16              ctermbg=226             guibg=#ffff00   guifg=#000000
+endif
+
+" syntax highlighting
+hi Boolean                      cterm=none              ctermfg=171             guifg=#d75fff
+hi Character            cterm=none              ctermfg=184
+hi Comment                      cterm=none              ctermfg=248             gui=italic              guifg=#a8a8a8
+hi Constant                     cterm=none              ctermfg=226             guifg=#ffff00
+hi Conditional  cterm=none              ctermfg=154             guifg=#afff00
+hi Define                               cterm=bold              ctermfg=27              gui=bold                        guifg=#005fff
+hi Delimiter            cterm=none              ctermfg=196             guifg=#ff0000
+hi Exception            cterm=bold              ctermfg=226             gui=bold                        guifg=#ffff00
+hi Error                                cterm=none              ctermfg=255             ctermbg=9                       guifg=#ffffff
+hi Keyword                      cterm=none              ctermfg=159             guifg=#afffff
+hi Function                     cterm=none              ctermfg=196             guifg=#ff0000
+hi Identifier           cterm=none              ctermfg=33              guifg=#0087ff
+hi Number                               cterm=none              ctermfg=209             guifg=#ff875f
+hi Operator                     cterm=none              ctermfg=226             guifg=#ffff00
+hi PreProc                      cterm=none              ctermfg=202             guifg=#ff5f00
+hi Special                      cterm=none              ctermfg=206             ctermbg=234             guifg=#ff5fd7 guibg=#1c1c1c
+hi Statement            cterm=none              ctermfg=40              gui=none                        guifg=#00d700
+hi String                               cterm=none              ctermfg=224             ctermbg=234             guifg=#ffd7d7   guibg=#1c1c1c
+hi Todo                                 cterm=none              ctermfg=16              ctermbg=226             guifg=#000000 guibg=#ffff00
+hi Type                                 cterm=none              ctermfg=75              gui=none                        guifg=#5fafff
+hi Underlined           cterm=underline ctermfg=39      gui=underline   guifg=#00afff
+
+" ADDITIONNAL
+hi Repeat               cterm=none              ctermfg=142             guifg=#afaf00
diff --git a/vim/colors/lettuce.vim b/vim/colors/lettuce.vim
new file mode 100644 (file)
index 0000000..223dc36
--- /dev/null
@@ -0,0 +1,215 @@
+" Vim color file
+"     Version:    1.2 2007.08.08
+"     Author:     Valyaeff Valentin <hhyperr AT gmail DOT com>
+"     License:    GPL
+"
+" Copyright 2007 Valyaeff Valentin
+"
+" This program is free software: you can redistribute it and/or modify
+" it under the terms of the GNU General Public License as published by
+" the Free Software Foundation, either version 3 of the License, or
+" (at your option) any later version.
+"
+" This program is distributed in the hope that it will be useful,
+" but WITHOUT ANY WARRANTY; without even the implied warranty of
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+" GNU General Public License for more details.
+"
+" You should have received a copy of the GNU General Public License
+" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="lettuce"
+
+
+augroup Syntax_extensions
+    au!
+    au Syntax c,cpp,ruby,javascript syn match Operator "[*/%&|!=><^~,.;:?+-]\+" display contains=TOP
+    au Syntax c,cpp syn region cParen matchgroup=Operator transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+    au Syntax c,cpp syn region cCppParen matchgroup=Operator transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
+    au Syntax c,cpp syn region cBracket matchgroup=Operator transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+    au Syntax c,cpp syn region cCppBracket matchgroup=Operator transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
+    au Syntax c,cpp syn region cBlock matchgroup=OperatorCurlyBrackets start="{" end="}" transparent fold
+    au Syntax ruby syn match rubyBlockParameter "\%(\%(\<do\>\|{\)\s*\)\@<=|\s*[( ,a-zA-Z0-9_*)]\+\ze\s*|"hs=s+1 display
+    au Syntax ruby syn region rubyCurlyBlock matchgroup=Operator start="{" end="}" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold
+    au Syntax ruby syn region rubyParentheses matchgroup=Operator start="(" end=")" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo
+    au Syntax ruby syn region rubySquareBrackets matchgroup=Operator start="\[" end="\]" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo
+    au Syntax javascript syn region javascriptCurlyBrackets matchgroup=Operator start="{" end="}" transparent fold
+    au Syntax javascript syn region javascriptParentheses matchgroup=Operator start="(" end=")" transparent
+    au Syntax javascript syn region javascriptSquareBrackets matchgroup=Operator start="\[" end="\]" transparent
+augroup END
+
+
+if !has("gui_running")
+
+hi rubyGlobalVariable       cterm=none                   ctermfg=64
+hi rubyPredefinedIdentifier cterm=bold                   ctermfg=64
+hi def link rubyStringDelimiter String
+
+hi Normal           cterm=none       ctermbg=232 ctermfg=189
+hi StatusLine       cterm=none       ctermbg=236 ctermfg=231
+hi StatusLineNC     cterm=none       ctermbg=236 ctermfg=103
+hi User1            cterm=bold       ctermbg=236 ctermfg=223
+hi User2            cterm=none       ctermbg=236 ctermfg=240
+hi VertSplit        cterm=none       ctermbg=236 ctermfg=103
+hi TabLine          cterm=none       ctermbg=236 ctermfg=145
+hi TabLineFill      cterm=none       ctermbg=236
+hi TabLineSel       cterm=none       ctermbg=240 ctermfg=253
+hi LineNr           cterm=none                   ctermfg=238
+hi NonText          cterm=bold       ctermbg=233 ctermfg=241
+hi Folded           cterm=none       ctermbg=234 ctermfg=136
+hi FoldColumn       cterm=none       ctermbg=236 ctermfg=103
+hi SignColumn       cterm=none       ctermbg=236 ctermfg=103
+hi CursorColumn     cterm=none       ctermbg=234
+hi CursorLine       cterm=none       ctermbg=234
+hi IncSearch        cterm=bold       ctermbg=63  ctermfg=232
+hi Search           cterm=none       ctermbg=36  ctermfg=232
+hi Visual           cterm=none       ctermbg=24
+hi WildMenu         cterm=bold       ctermbg=35  ctermfg=232
+hi ModeMsg          cterm=bold                   ctermfg=110
+hi MoreMsg          cterm=bold                   ctermfg=121
+hi Question         cterm=bold                   ctermfg=121
+hi ErrorMsg         cterm=none       ctermbg=88  ctermfg=255
+hi WarningMsg       cterm=none       ctermbg=58  ctermfg=255
+hi SpecialKey       cterm=none                   ctermfg=77
+hi Title            cterm=bold                   ctermfg=147
+hi Directory                                     ctermfg=105
+hi DiffAdd          cterm=none       ctermbg=18
+hi DiffChange       cterm=none       ctermbg=58
+hi DiffDelete       cterm=none       ctermbg=52  ctermfg=58
+hi DiffText         cterm=none       ctermbg=53
+hi Pmenu            cterm=none       ctermbg=17  ctermfg=121
+hi PmenuSel         cterm=none       ctermbg=24  ctermfg=121
+hi PmenuSbar        cterm=none       ctermbg=19
+hi PmenuThumb       cterm=none       ctermbg=37
+hi MatchParen       cterm=bold       ctermbg=24
+hi SpellBad         cterm=none       ctermbg=88
+hi SpellCap         cterm=none       ctermbg=18
+hi SpellLocal       cterm=none       ctermbg=30
+hi SpellRare        cterm=none       ctermbg=90
+
+hi Comment          cterm=none                   ctermfg=138
+hi Constant         cterm=none                   ctermfg=215
+ hi String          cterm=none       ctermbg=235 ctermfg=215
+ hi Character       cterm=none       ctermbg=235 ctermfg=215
+ hi Number          cterm=none                   ctermfg=34
+ hi Float           cterm=none                   ctermfg=41
+hi Identifier       cterm=none                   ctermfg=186
+ hi Function        cterm=none                   ctermfg=210
+hi Statement        cterm=bold                   ctermfg=63
+ hi Exception       cterm=bold                   ctermfg=99
+ hi Operator        cterm=none                   ctermfg=75
+ hi Label           cterm=none                   ctermfg=63
+hi PreProc          cterm=bold                   ctermfg=36
+hi Type             cterm=bold                   ctermfg=71
+hi Special          cterm=none       ctermbg=235 ctermfg=87
+hi Underlined       cterm=underline              ctermfg=227
+hi Ignore           cterm=bold                   ctermfg=235
+hi Error            cterm=bold       ctermbg=52  ctermfg=231
+hi Todo             cterm=bold       ctermbg=143 ctermfg=16
+
+hi OperatorCurlyBrackets cterm=bold ctermfg=75
+
+" highlight modes
+autocmd InsertEnter * hi StatusLine ctermbg=52
+autocmd InsertEnter * hi User1      ctermbg=52
+autocmd InsertEnter * hi User2      ctermbg=52
+autocmd InsertLeave * hi User2      ctermbg=236
+autocmd InsertLeave * hi User1      ctermbg=236
+autocmd InsertLeave * hi StatusLine ctermbg=236
+autocmd CmdwinEnter * hi StatusLine ctermbg=22
+autocmd CmdwinEnter * hi User1      ctermbg=22
+autocmd CmdwinEnter * hi User2      ctermbg=22
+autocmd CmdwinLeave * hi User2      ctermbg=236
+autocmd CmdwinLeave * hi User1      ctermbg=236
+autocmd CmdwinLeave * hi StatusLine ctermbg=236
+
+else
+
+hi rubyGlobalVariable       gui=none                   guifg=#5f8700
+hi rubyPredefinedIdentifier gui=bold                   guifg=#5f8700
+hi def link rubyStringDelimiter String
+
+hi Normal           gui=none       guibg=#080808 guifg=#dfdfff
+hi StatusLine       gui=none       guibg=#303030 guifg=#ffffff
+hi StatusLineNC     gui=none       guibg=#303030 guifg=#8787af
+hi User1            gui=bold       guibg=#303030 guifg=#ffdfaf
+hi User2            gui=none       guibg=#303030 guifg=#585858
+hi VertSplit        gui=none       guibg=#303030 guifg=#8787af
+hi TabLine          gui=none       guibg=#303030 guifg=#afafaf
+hi TabLineFill      gui=none       guibg=#303030
+hi TabLineSel       gui=none       guibg=#585858 guifg=#dadada
+hi LineNr           gui=none                   guifg=#444444
+hi NonText          gui=bold       guibg=#121212 guifg=#606060
+hi Folded           gui=none       guibg=#1c1c1c guifg=#af8700
+hi FoldColumn       gui=none       guibg=#303030 guifg=#8787af
+hi SignColumn       gui=none       guibg=#303030 guifg=#8787af
+hi CursorColumn     gui=none       guibg=#1c1c1c
+hi CursorLine       gui=none       guibg=#1c1c1c
+hi IncSearch        gui=bold       guibg=#5f5fff  guifg=#080808
+hi Search           gui=none       guibg=#00af87  guifg=#080808
+hi Visual           gui=none       guibg=#005f87
+hi WildMenu         gui=bold       guibg=#00af5f  guifg=#080808
+hi ModeMsg          gui=bold                   guifg=#87afdf
+hi MoreMsg          gui=bold                   guifg=#87ffaf
+hi Question         gui=bold                   guifg=#87ffaf
+hi ErrorMsg         gui=none       guibg=#870000  guifg=#eeeeee
+hi WarningMsg       gui=none       guibg=#5f5f00  guifg=#eeeeee
+hi SpecialKey       gui=none                   guifg=#5fdf5f
+hi Title            gui=bold                   guifg=#afafff
+hi Directory                                     guifg=#8787ff
+hi DiffAdd          gui=none       guibg=#000087
+hi DiffChange       gui=none       guibg=#5f5f00
+hi DiffDelete       gui=none       guibg=#5f0000  guifg=#5f5f00
+hi DiffText         gui=none       guibg=#5f005f
+hi Pmenu            gui=none       guibg=#00005f  guifg=#87ffaf
+hi PmenuSel         gui=none       guibg=#005f87  guifg=#87ffaf
+hi PmenuSbar        gui=none       guibg=#0000af
+hi PmenuThumb       gui=none       guibg=#00afaf
+hi MatchParen       gui=bold       guibg=#005f87
+hi SpellBad         gui=none       guibg=#870000
+hi SpellCap         gui=none       guibg=#000087
+hi SpellLocal       gui=none       guibg=#008787
+hi SpellRare        gui=none       guibg=#870087
+
+hi Comment          gui=none                   guifg=#af8787
+hi Constant         gui=none                   guifg=#ffaf5f
+ hi String          gui=none       guibg=#262626 guifg=#ffaf5f
+ hi Character       gui=none       guibg=#262626 guifg=#ffaf5f
+ hi Number          gui=none                   guifg=#00af00
+ hi Float           gui=none                   guifg=#00df5f
+hi Identifier       gui=none                   guifg=#dfdf87
+ hi Function        gui=none                   guifg=#ff8787
+hi Statement        gui=bold                   guifg=#5f5fff
+ hi Exception       gui=bold                   guifg=#875fff
+ hi Operator        gui=none                   guifg=#5fafff
+ hi Label           gui=none                   guifg=#5f5fff
+hi PreProc          gui=bold                   guifg=#00af87
+hi Type             gui=bold                   guifg=#5faf5f
+hi Special          gui=none       guibg=#262626 guifg=#5fffff
+hi Underlined       gui=underline              guifg=#ffff5f
+hi Ignore           gui=bold                   guifg=#262626
+hi Error            gui=bold       guibg=#5f0000  guifg=#ffffff
+hi Todo             gui=bold       guibg=#afaf5f guifg=#000000
+
+hi OperatorCurlyBrackets gui=bold guifg=#5fafff
+
+" highlight modes
+autocmd InsertEnter * hi StatusLine guibg=#5f0000
+autocmd InsertEnter * hi User1      guibg=#5f0000
+autocmd InsertEnter * hi User2      guibg=#5f0000
+autocmd InsertLeave * hi User2      guibg=#303030
+autocmd InsertLeave * hi User1      guibg=#303030
+autocmd InsertLeave * hi StatusLine guibg=#303030
+autocmd CmdwinEnter * hi StatusLine guibg=#005f00
+autocmd CmdwinEnter * hi User1      guibg=#005f00
+autocmd CmdwinEnter * hi User2      guibg=#005f00
+autocmd CmdwinLeave * hi User2      guibg=#303030
+autocmd CmdwinLeave * hi User1      guibg=#303030
+autocmd CmdwinLeave * hi StatusLine guibg=#303030
+
+end
diff --git a/vim/colors/lucius.vim b/vim/colors/lucius.vim
new file mode 100644 (file)
index 0000000..f83c92a
--- /dev/null
@@ -0,0 +1,346 @@
+" Vim color file
+" Maintainer:   Jonathan Filip <jfilip1024@gmail.com>
+" Last Modified: Wed Oct 21, 2009  11:39AM
+" Version: 3.1
+"
+" GUI / 256 color terminal
+"
+" I started out trying to combine my favorite parts of other schemes and ended
+" up with this (oceandeep, moria, peaksea, wombat, zenburn).
+"
+" This file also tries to have descriptive comments for each higlighting group
+" so it is easy to understand what each part does.
+
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let colors_name="lucius"
+
+" Some other colors to save
+" blue: 3eb8e5
+" green: 92d400
+" c green: d5f876, cae682
+" new blue: 002D62
+" new gray: CCCCCC
+
+
+" Base color
+" ----------
+hi Normal           guifg=#e0e0e0           guibg=#202020
+hi Normal           ctermfg=253             ctermbg=235
+
+
+" Comment Group
+" -------------
+" any comment
+hi Comment          guifg=#606060                                   gui=none
+hi Comment          ctermfg=240                                     cterm=none
+
+
+" Constant Group
+" --------------
+" any constant
+hi Constant         guifg=#8cd0d3                                   gui=none
+hi Constant         ctermfg=116                                     cterm=none
+" strings
+hi String           guifg=#80c0d9                                   gui=none
+hi String           ctermfg=110                                     cterm=none
+" character constant
+hi Character        guifg=#80c0d9                                   gui=none
+hi Character        ctermfg=110                                     cterm=none
+" numbers decimal/hex
+hi Number           guifg=#8cd0d3                                   gui=none
+hi Number           ctermfg=116                                     cterm=none
+" true, false
+hi Boolean          guifg=#8cd0d3                                   gui=none
+hi Boolean          ctermfg=116                                     cterm=none
+" float
+hi Float            guifg=#8cd0d3                                   gui=none
+hi Float            ctermfg=116                                     cterm=none
+
+
+" Identifier Group
+" ----------------
+" any variable name
+hi Identifier       guifg=#efaf7f                                   gui=none
+hi Identifier       ctermfg=216                                     cterm=none
+" function, method, class
+hi Function         guifg=#efaf7f                                   gui=none
+hi Function         ctermfg=216                                     cterm=none
+
+
+" Statement Group
+" ---------------
+" any statement
+hi Statement        guifg=#b3d38c                                   gui=none
+hi Statement        ctermfg=150                                     cterm=none
+" if, then, else
+hi Conditional      guifg=#b3d38c                                   gui=none
+hi Conditional      ctermfg=150                                     cterm=none
+" try, catch, throw, raise
+hi Exception        guifg=#b3d38c                                   gui=none
+hi Exception        ctermfg=150                                     cterm=none
+" for, while, do
+hi Repeat           guifg=#b3d38c                                   gui=none
+hi Repeat           ctermfg=150                                     cterm=none
+" case, default
+hi Label            guifg=#b3d38c                                   gui=none
+hi Label            ctermfg=150                                     cterm=none
+" sizeof, +, *
+hi Operator         guifg=#b3d38c                                   gui=none
+hi Operator         ctermfg=150                                     cterm=none
+" any other keyword
+hi Keyword          guifg=#b3d38c                                   gui=none
+hi Keyword          ctermfg=150                                     cterm=none
+
+
+" Preprocessor Group
+" ------------------
+" generic preprocessor
+hi PreProc          guifg=#f0dfaf                                   gui=none
+hi PreProc          ctermfg=223                                     cterm=none
+" #include
+hi Include          guifg=#f0dfaf                                   gui=none
+hi Include          ctermfg=223                                     cterm=none
+" #define
+hi Define           guifg=#f0dfaf                                   gui=none
+hi Define           ctermfg=223                                     cterm=none
+" same as define
+hi Macro            guifg=#f0dfaf                                   gui=none
+hi Macro            ctermfg=223                                     cterm=none
+" #if, #else, #endif
+hi PreCondit        guifg=#f0dfaf                                   gui=none
+hi PreCondit        ctermfg=223                                     cterm=none
+
+
+" Type Group
+" ----------
+" int, long, char
+hi Type             guifg=#93d6a9                                   gui=none
+hi Type             ctermfg=115                                     cterm=none
+" static, register, volative
+hi StorageClass     guifg=#93d6a9                                   gui=none
+hi StorageClass     ctermfg=115                                     cterm=none
+" struct, union, enum
+hi Structure        guifg=#93d6a9                                   gui=none
+hi Structure        ctermfg=115                                     cterm=none
+" typedef
+hi Typedef          guifg=#93d6a9                                   gui=none
+hi Typedef          ctermfg=115                                     cterm=none
+
+
+" Special Group
+" -------------
+" any special symbol
+hi Special          guifg=#cca3b3                                   gui=none
+hi Special          ctermfg=181                                     cterm=none
+" special character in a constant
+hi SpecialChar      guifg=#cca3b3                                   gui=none
+hi SpecialChar      ctermfg=181                                     cterm=none
+" things you can CTRL-]
+hi Tag              guifg=#cca3b3                                   gui=none
+hi Tag              ctermfg=181                                     cterm=none
+" character that needs attention
+hi Delimiter        guifg=#cca3b3                                   gui=none
+hi Delimiter        ctermfg=181                                     cterm=none
+" special things inside a comment
+hi SpecialComment   guifg=#cca3b3                                   gui=none
+hi SpecialComment   ctermfg=181                                     cterm=none
+" debugging statements
+hi Debug            guifg=#cca3b3           guibg=NONE              gui=none
+hi Debug            ctermfg=181             ctermbg=NONE            cterm=none
+
+
+" Underlined Group
+" ----------------
+" text that stands out, html links
+hi Underlined       guifg=fg                                        gui=underline
+hi Underlined       ctermfg=fg                                      cterm=underline
+
+
+" Ignore Group
+" ------------
+" left blank, hidden
+hi Ignore           guifg=bg
+hi Ignore           ctermfg=bg
+
+
+" Error Group
+" -----------
+" any erroneous construct
+hi Error            guifg=#e37170           guibg=#432323           gui=none
+hi Error            ctermfg=167             ctermbg=52            cterm=none
+
+
+" Todo Group
+" ----------
+" todo, fixme, note, xxx
+hi Todo             guifg=#efef8f           guibg=NONE              gui=underline
+hi Todo             ctermfg=228             ctermbg=NONE            cterm=underline
+
+
+" Spelling
+" --------
+" word not recognized
+hi SpellBad         guisp=#ee0000                                   gui=undercurl
+hi SpellBad                                 ctermbg=9               cterm=undercurl
+" word not capitalized
+hi SpellCap         guisp=#eeee00                                   gui=undercurl
+hi SpellCap                                 ctermbg=12              cterm=undercurl
+" rare word
+hi SpellRare        guisp=#ffa500                                   gui=undercurl
+hi SpellRare                                ctermbg=13              cterm=undercurl
+" wrong spelling for selected region
+hi SpellLocal       guisp=#ffa500                                   gui=undercurl
+hi SpellLocal                               ctermbg=14              cterm=undercurl
+
+
+" Cursor
+" ------
+" character under the cursor
+hi Cursor           guifg=bg                guibg=#a3e3ed
+hi Cursor           ctermfg=bg              ctermbg=153
+" like cursor, but used when in IME mode
+hi CursorIM         guifg=bg                guibg=#96cdcd
+hi CursorIM         ctermfg=bg              ctermbg=116
+" cursor column
+hi CursorColumn     guifg=NONE              guibg=#202438           gui=none
+hi CursorColumn     ctermfg=NONE            ctermbg=236             cterm=none
+" cursor line/row
+hi CursorLine       gui=NONE                guibg=#202438           gui=none
+hi CursorLine       cterm=NONE              ctermbg=236             cterm=none
+
+
+" Misc
+" ----
+" directory names and other special names in listings
+hi Directory        guifg=#c0e0b0                                   gui=none
+hi Directory        ctermfg=151                                     cterm=none
+" error messages on the command line
+hi ErrorMsg         guifg=#ee0000           guibg=NONE              gui=none
+hi ErrorMsg         ctermfg=196             ctermbg=NONE            cterm=none
+" column separating vertically split windows
+hi VertSplit        guifg=#777777           guibg=#363946           gui=none
+hi VertSplit        ctermfg=242             ctermbg=237             cterm=none
+" columns where signs are displayed (used in IDEs)
+hi SignColumn       guifg=#9fafaf           guibg=#181818           gui=none
+hi SignColumn       ctermfg=145             ctermbg=233             cterm=none
+" line numbers
+hi LineNr           guifg=#818698           guibg=#363946
+hi LineNr           ctermfg=102             ctermbg=237
+" match parenthesis, brackets
+hi MatchParen       guifg=#00ff00           guibg=NONE              gui=bold
+hi MatchParen       ctermfg=46              ctermbg=NONE            cterm=bold
+" the 'more' prompt when output takes more than one line
+hi MoreMsg          guifg=#2e8b57                                   gui=none
+hi MoreMsg          ctermfg=29                                      cterm=none
+" text showing what mode you are in
+hi ModeMsg          guifg=#76d5f8           guibg=NONE              gui=none
+hi ModeMsg          ctermfg=117             ctermbg=NONE            cterm=none
+" the '~' and '@' and showbreak, '>' double wide char doesn't fit on line
+hi NonText          guifg=#404040                                   gui=none
+hi NonText          ctermfg=235                                     cterm=none
+" the hit-enter prompt (show more output) and yes/no questions
+hi Question         guifg=fg                                        gui=none
+hi Question         ctermfg=fg                                      cterm=none
+" meta and special keys used with map, unprintable characters
+hi SpecialKey       guifg=#404040
+hi SpecialKey       ctermfg=237
+" titles for output from :set all, :autocmd, etc
+hi Title            guifg=#62bdde                                   gui=none
+hi Title            ctermfg=74                                      cterm=none
+"hi Title            guifg=#5ec8e5                                   gui=none
+" warning messages
+hi WarningMsg       guifg=#e5786d                                   gui=none
+hi WarningMsg       ctermfg=173                                     cterm=none
+" current match in the wildmenu completion
+hi WildMenu         guifg=#cae682           guibg=#363946           gui=bold,underline
+hi WildMenu         ctermfg=16              ctermbg=186             cterm=bold
+
+
+" Diff
+" ----
+" added line
+hi DiffAdd          guifg=#80a090           guibg=#313c36           gui=none
+hi DiffAdd          ctermfg=108             ctermbg=22              cterm=none
+" changed line
+hi DiffChange       guifg=NONE              guibg=#4a343a           gui=none
+hi DiffChange       ctermfg=fg              ctermbg=52              cterm=none
+" deleted line
+hi DiffDelete       guifg=#6c6661           guibg=#3c3631           gui=none
+hi DiffDelete       ctermfg=59              ctermbg=58              cterm=none
+" changed text within line
+hi DiffText         guifg=#f05060           guibg=#4a343a           gui=bold
+hi DiffText         ctermfg=203             ctermbg=52             cterm=bold
+
+
+" Folds
+" -----
+" line used for closed folds
+hi Folded           guifg=#91d6f8           guibg=#363946           gui=none
+hi Folded           ctermfg=117             ctermbg=238             cterm=none
+" column on side used to indicated open and closed folds
+hi FoldColumn       guifg=#91d6f8           guibg=#363946           gui=none
+hi FoldColumn       ctermfg=117             ctermbg=238             cterm=none
+
+
+" Search
+" ------
+" highlight incremental search text; also highlight text replaced with :s///c
+hi IncSearch        guifg=#66ffff                                   gui=reverse
+hi IncSearch        ctermfg=87                                      cterm=reverse
+" hlsearch (last search pattern), also used for quickfix
+hi Search                                    guibg=#ffaa33          gui=none
+hi Search                                    ctermbg=214            cterm=none
+
+
+" Popup Menu
+" ----------
+" normal item in popup
+hi Pmenu            guifg=#e0e0e0           guibg=#303840           gui=none
+hi Pmenu            ctermfg=253             ctermbg=233             cterm=none
+" selected item in popup
+hi PmenuSel         guifg=#cae682           guibg=#505860           gui=none
+hi PmenuSel         ctermfg=186             ctermbg=237             cterm=none
+" scrollbar in popup
+hi PMenuSbar                                guibg=#505860           gui=none
+hi PMenuSbar                                ctermbg=59              cterm=none
+" thumb of the scrollbar in the popup
+hi PMenuThumb                               guibg=#808890           gui=none
+hi PMenuThumb                               ctermbg=102             cterm=none
+
+
+" Status Line
+" -----------
+" status line for current window
+hi StatusLine       guifg=#e0e0e0           guibg=#363946           gui=bold
+hi StatusLine       ctermfg=254             ctermbg=237             cterm=bold
+" status line for non-current windows
+hi StatusLineNC     guifg=#767986           guibg=#363946           gui=none
+hi StatusLineNC     ctermfg=244             ctermbg=237             cterm=none
+
+
+" Tab Lines
+" ---------
+" tab pages line, not active tab page label
+hi TabLine          guifg=#b6bf98           guibg=#363946           gui=none
+hi TabLine          ctermfg=244             ctermbg=236             cterm=none
+" tab pages line, where there are no labels
+hi TabLineFill      guifg=#cfcfaf           guibg=#363946           gui=none
+hi TabLineFill      ctermfg=187             ctermbg=236             cterm=none
+" tab pages line, active tab page label
+hi TabLineSel       guifg=#efefef           guibg=#414658           gui=bold
+hi TabLineSel       ctermfg=254             ctermbg=236             cterm=bold
+
+
+" Visual
+" ------
+" visual mode selection
+hi Visual           guifg=NONE              guibg=#364458
+hi Visual           ctermfg=NONE            ctermbg=24
+" visual mode selection when vim is not owning the selection (x11 only)
+hi VisualNOS        guifg=fg                                        gui=underline
+hi VisualNOS        ctermfg=fg                                      cterm=underline
diff --git a/vim/colors/manxome.vim b/vim/colors/manxome.vim
new file mode 100644 (file)
index 0000000..0db38ea
--- /dev/null
@@ -0,0 +1,47 @@
+""" local syntax file - set colors on a per-machine basis:
+""" Vim color file
+""" Title:                     Manxome Foes Color Scheme
+""" Maintainer:                Ricardo SIGNES <rjbs-vim@lists.manxome.org>
+""" This Version:      R2v2 [2003-07-16]
+""" suggested vim editing options: tw=0 ts=4 sw=4
+
+""  clear and re-initialize global variables
+hi clear
+set background=dark
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "manxome"
+
+""  set highlight groups
+""             you'll notice that the ctermbg is often 'none'; this is so that when
+""             console vim runs in a terminal, transparency (if any) is not broken
+
+highlight Title                        ctermfg=3       ctermbg=none    cterm=bold      guifg=#ffff00   guibg=#000000   gui=none
+highlight Directory    ctermfg=4       ctermbg=none    cterm=bold      guifg=#0000ff   guibg=#000000   gui=none
+highlight StatusLine   ctermfg=7       ctermbg=4               cterm=bold      guifg=#ffffff   guibg=#0000ff   gui=none
+highlight StatusLineNC         ctermfg=0       ctermbg=4               cterm=bold      guifg=#000000   guibg=#0000ff   gui=none
+highlight Normal               ctermfg=7       ctermbg=none    cterm=none      guifg=#cccccc   guibg=#000000   gui=none
+highlight Search               ctermfg=7       ctermbg=4               cterm=bold      guifg=#ffffff   guibg=#0000ff   gui=none
+highlight Visual               ctermfg=7       ctermbg=6               cterm=bold      guifg=#ffffff   guibg=#00aaaa   gui=none
+
+""  set major preferred groups
+
+highlight Comment              ctermfg=2       ctermbg=none    cterm=bold      guifg=#00ff00   guibg=#000000   gui=none
+highlight Constant             ctermfg=6       ctermbg=none    cterm=bold      guifg=#00ffff   guibg=#000000   gui=none
+highlight Identifier   ctermfg=4       ctermbg=none    cterm=bold      guifg=#0000ee   guibg=#000000   gui=none
+highlight Statement    ctermfg=6       ctermbg=none    cterm=none      guifg=#00aaaa   guibg=#000000   gui=none
+highlight PreProc              ctermfg=7       ctermbg=none    cterm=bold      guifg=#ffffff   guibg=#000000   gui=none
+highlight Type                 ctermfg=6       ctermbg=none    cterm=none      guifg=#00aaaa   guibg=#000000   gui=none
+highlight Special              ctermfg=7       ctermbg=none    cterm=bold      guifg=#ffffff   guibg=#000000   gui=none
+highlight Underlined   ctermfg=2       ctermbg=none    cterm=none      guifg=#00aa00   guibg=#000000   gui=none
+highlight Ignore               ctermfg=0       ctermbg=none    cterm=bold  guifg=#aaaaaa       guibg=#000000   gui=none
+highlight Error                        ctermfg=1       ctermbg=none    cterm=bold      guibg=#ff0000   guibg=#000000   gui=none
+highlight Todo                 ctermfg=3       ctermbg=none    cterm=none      guifg=#aaaa00   guibg=#000000   gui=none
+
+"  set syntax-specific groups
+"      I'd like to avoid using these, but the default settings for these two are
+"      just no good.  Seeing italic text in Vim is just plain wrong.
+
+highlight htmlBold             ctermfg=7       ctermbg=none    cterm=bold      guifg=#ffffff   guibg=#000000   gui=none
+highlight htmlItalic   ctermfg=5       ctermbg=none    cterm=bold      guifg=#ff00ff   guibg=#000000   gui=none
diff --git a/vim/colors/marklar.vim b/vim/colors/marklar.vim
new file mode 100644 (file)
index 0000000..ea9395f
--- /dev/null
@@ -0,0 +1,174 @@
+" ------------------------------------------------------------------
+" Filename:     marklar.vim
+" Last Modified: Nov, 30 2006 (13:01)
+" Version:       0.5
+" Maintainer:   SM Smithfield (m_smithfield AT yahoo DOT com)
+" Copyright:    2006 SM Smithfield
+"                This script is free software; you can redistribute it and/or 
+"                modify it under the terms of the GNU General Public License as 
+"                published by the Free Software Foundation; either version 2 of 
+"                the License, or (at your option) any later version. 
+" Description:   Vim colorscheme file.
+" Install:       Put this file in the users colors directory (~/.vim/colors)
+"                then load it with :colorscheme marklar
+" ------------------------------------------------------------------
+
+hi clear
+set background=dark
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name = "marklar"
+
+if !exists("s:main")
+
+    " OPTIONS:
+    let s:bold_opt = 0
+    let s:ignore_opt = 1
+
+    function! s:main()
+        if version >= 700
+            call s:apply_opts()
+        endif
+
+        if s:bold_opt
+            let s:bold = 'bold'
+        else
+            let s:bold = 'NONE'
+        endif
+
+        if s:ignore_opt
+            " completely invisible
+            let s:ignore = 'bg'
+        else
+            " nearly invisible
+            let s:ignore = '#467C5C'
+        endif
+
+        execute "hi Constant         guifg=#FFFFFF guibg=NONE                 ctermfg=7 cterm=NONE"
+        execute "hi Identifier       guifg=#38FF56 guibg=NONE gui=".s:bold."  ctermfg=8 cterm=bold"
+        execute "hi Statement        guifg=#FFFF00 guibg=NONE gui=".s:bold."  ctermfg=3 cterm=bold"
+        execute "hi Special          guifg=#25B9F8 guibg=bg   gui=".s:bold."  ctermfg=2 cterm=underline"
+        execute "hi PreProc          guifg=#FF80FF guibg=bg   gui=NONE        ctermfg=2"
+        execute "hi Type             guifg=#00FFFF guibg=NONE gui=".s:bold."  ctermfg=6 cterm=bold"
+
+        execute "hi Ignore           guifg=".s:ignore." guibg=NONE               ctermfg=0"
+
+        hi Comment          guifg=#00BBBB guibg=NONE               ctermfg=6 cterm=none
+        hi Cursor           guifg=NONE    guibg=#FF0000
+        hi DiffAdd          guifg=NONE    guibg=#136769            ctermfg=4 ctermbg=7 cterm=NONE
+        hi DiffDelete       guifg=NONE    guibg=#50694A            ctermfg=1 ctermbg=7 cterm=NONE
+        hi DiffChange       guifg=fg      guibg=#00463c gui=NONE   ctermfg=4 ctermbg=2 cterm=NONE
+        hi DiffText         guifg=#7CFC94 guibg=#00463c gui=bold   ctermfg=4 ctermbg=3 cterm=NONE
+        hi Directory        guifg=#25B9F8 guibg=NONE               ctermfg=2
+        hi Error            guifg=#FFFFFF guibg=#000000            ctermfg=7 ctermbg=0 cterm=bold
+        hi ErrorMsg         guifg=#8eff2e guibg=#204d40
+        hi FoldColumn       guifg=#00BBBB guibg=#204d40
+        hi Folded           guifg=#44DDDD guibg=#204d40            ctermfg=0 ctermbg=8 cterm=bold
+
+        hi IncSearch        guibg=#52891f gui=bold
+        hi LineNr           guifg=#38ff56 guibg=#204d40
+        hi ModeMsg          guifg=#FFFFFF guibg=#0000FF            ctermfg=7 ctermbg=4 cterm=bold
+        hi MoreMsg          guifg=#FFFFFF guibg=#00A261            ctermfg=7 ctermbg=2 cterm=bold
+        hi NonText          guifg=#00bbbb guibg=#204d40
+        hi Normal           guifg=#71C293 guibg=#06544a
+        hi Question         guifg=#FFFFFF guibg=#00A261
+        hi Search           guifg=NONE    guibg=#0f374c            ctermfg=3 ctermbg=0 cterm=bold
+
+        hi SignColumn       guifg=#00BBBB guibg=#204d40
+        hi SpecialKey       guifg=#00FFFF guibg=#266955
+        hi StatusLine       guifg=#245748 guibg=#71C293 gui=NONE   cterm=reverse
+        hi StatusLineNC     guifg=#245748 guibg=#689C7C gui=NONE
+        hi Title            guifg=#7CFC94 guibg=NONE gui=bold      ctermfg=2 cterm=bold
+        hi Todo             guifg=#FFFFFF guibg=#884400            ctermfg=6 ctermbg=4 cterm=NONE
+        hi Underlined       guifg=#df820c guibg=NONE gui=underline ctermfg=8 cterm=underline
+        hi Visual           guibg=#0B7260 gui=NONE
+        hi WarningMsg       guifg=#FFFFFF guibg=#FF0000            ctermfg=7 ctermbg=1 cterm=bold
+        hi WildMenu         guifg=#20012e guibg=#00a675 gui=bold   ctermfg=NONE ctermbg=NONE cterm=bold
+        "
+        if version >= 700
+            hi SpellBad     guisp=#FF0000
+            hi SpellCap     guisp=#0000FF
+            hi SpellRare    guisp=#ff4046
+            hi SpellLocal   guisp=#000000                          ctermbg=0
+            hi Pmenu        guifg=#00ffff guibg=#000000            ctermbg=0 ctermfg=6
+            hi PmenuSel     guifg=#ffff00 guibg=#000000 gui=bold   cterm=bold ctermfg=3
+            hi PmenuSbar    guibg=#204d40                          ctermbg=6
+            hi PmenuThumb   guifg=#38ff56                          ctermfg=3
+            hi CursorColumn guibg=#096354
+            hi CursorLine   guibg=#096354
+            hi Tabline      guifg=bg      guibg=fg gui=NONE        cterm=reverse,bold ctermfg=NONE ctermbg=NONE
+            hi TablineSel   guifg=#20012e guibg=#00a675 gui=bold
+            hi TablineFill  guifg=#689C7C
+            hi MatchParen   guifg=#38ff56 guibg=#0000ff gui=bold   ctermbg=4
+        endif
+        "
+        hi Tag              guifg=#7CFC94 guibg=NONE gui=bold      ctermfg=2 cterm=bold
+        hi link Bold Tag
+        "
+        hi pythonPreCondit                                         ctermfg=2 cterm=NONE
+        execute "hi tkWidget         guifg=#ffa0a0 guibg=bg gui=".s:bold." ctermfg=7 cterm=bold"
+    endfunction
+
+    if version >= 700
+
+        let s:opts = {'bold': 0, 'ignore': 1}
+
+        " preserves vim<7 compat, while letting me reuses some code
+        function! s:apply_opts()
+            let s:bold_opt = s:opts['bold']
+            let s:ignore_opt = s:opts['ignore']
+        endfunction
+
+        function! s:print_opts(...)
+            let d = a:000
+            if len(a:000) == 0
+                let d = keys(s:opts)
+            endif
+            for k in d
+                echo k.': '.s:opts[k]
+            endfor
+        endfunction
+
+        function! s:Marklar(...)
+            let args = a:000
+            if len(args) == 0
+                call s:print_opts()
+            else
+                while len(args)>0
+                    " take first arg
+                    let k = args[0]
+                    let args = args[1:]
+                    " is it a key?
+                    if k =~ '\a\+!'
+                        " does it bang?
+                        let k = strpart(k,0,strlen(k)-1)
+                        let s:opts[k] = !s:opts[k]
+                        call s:main()
+                    elseif k =~ '\a\+?'
+                        " does it quiz?
+                        let k = strpart(k,0,strlen(k)-1)
+                        call s:print_opts(k)
+                    elseif len(args)
+                        " is there another arg?
+                        " take it
+                        let v = args[0]
+                        let args = args[1:]
+                        " is it legal value?
+                        if v == 0 || v == 1
+                            " assign val->key
+                            let s:opts[k] = v
+                            call s:main()
+                        else
+                            echoerr "(".v.") Bad value. Expected 0 or 1."
+                        endif
+                    else
+                    endif
+                endwhile
+            endif
+        endfunction
+        command! -nargs=*  Marklar  :call s:Marklar(<f-args>)
+    endif
+endif
+
+call s:main()
diff --git a/vim/colors/maroloccio.vim b/vim/colors/maroloccio.vim
new file mode 100644 (file)
index 0000000..732bbae
--- /dev/null
@@ -0,0 +1,594 @@
+" File        : maroloccio.vim
+" Description : a colour scheme for Vim (GUI only)
+" Scheme      : maroloccio
+" Maintainer  : Marco Ippolito < m a r o l o c c i o [at] g m a i l . c o m >
+" Comment     : works well in GUI mode
+" Version     : v0.3.0 inspired by watermark
+" Date        : 6 may 2009
+"
+" History:
+"
+" 0.3.0 Greatly improved cterm colours when t_Co=256 thanks to Kyle and CSApprox
+" 0.2.9 Improved readability of cterm searches for dark backgrounds
+" 0.2.8 Added VimDiff colouring
+" 0.2.7 Further improved readability of cterm colours
+" 0.2.6 Improved readability of cterm colours on different terminals
+" 0.2.5 Reinstated minimal cterm support
+" 0.2.4 Added full colour descriptions and reinstated minimal cterm support
+" 0.2.3 Added FoldColumn to the list of hlights as per David Hall's suggestion
+" 0.2.2 Removed cterm support, changed visual highlight, fixed bolds
+" 0.2.1 Changed search highlight
+" 0.2.0 Removed italics
+" 0.1.9 Improved search and menu highlighting
+" 0.1.8 Added minimal cterm support
+" 0.1.7 Uploaded to vim.org
+" 0.1.6 Removed redundant highlight definitions
+" 0.1.5 Improved display of folded sections
+" 0.1.4 Removed linked sections for improved compatibility, more Python friendly
+" 0.1.3 Removed settings which usually belong to .vimrc (as in 0.1.1)
+" 0.1.2 Fixed versioning system, added .vimrc -like commands
+" 0.1.1 Corrected typo in header comments, changed colour for Comment
+" 0.1.0 Inital upload to vim.org
+
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name="maroloccio"
+
+" --- GUI section
+"
+hi Normal         guifg=#8b9aaa guibg=#1a202a  gui=none                         " watermark-foreground on watermark-background
+hi Constant       guifg=#82ade0 guibg=bg       gui=none                         " cyan on background
+hi Boolean        guifg=#82ade0 guibg=bg       gui=none                         " cyan on background
+hi Character      guifg=#82ade0 guibg=bg       gui=none                         " cyan on background
+hi Float          guifg=#82ade0 guibg=bg       gui=none                         " cyan on background
+hi Comment        guifg=#006666 guibg=bg       gui=none                         " teal on background
+hi Type           guifg=#ffcc00 guibg=bg       gui=none                         " yellow on background
+hi Typedef        guifg=#ffcc00 guibg=bg       gui=none                         " yellow on background
+hi Structure      guifg=#ffcc00 guibg=bg       gui=none                         " yellow on background
+hi Function       guifg=#ffcc00 guibg=bg       gui=none                         " yellow on background
+hi StorageClass   guifg=#ffcc00 guibg=bg       gui=none                         " yellow on background
+hi Conditional    guifg=#ff9900 guibg=bg       gui=none                         " orange on background
+hi Repeat         guifg=#78ba42 guibg=bg       gui=none                         " light green on background
+hi Visual         guifg=fg      guibg=#3741ad  gui=none                         " foreground on blue
+hi DiffChange     guifg=fg      guibg=#3741ad  gui=none                         " foreground on blue
+if version>= 700
+hi Pmenu          guifg=fg      guibg=#3741ad  gui=none                         " foreground on blue
+endif
+hi String         guifg=#4c4cad guibg=bg       gui=none                         " violet on background
+hi Folded         guifg=fg      guibg=#333366  gui=none                         " foreground on dark violet
+hi VertSplit      guifg=fg      guibg=#333366  gui=none                         " foreground on dark violet
+if version>= 700
+hi PmenuSel       guifg=fg      guibg=#333366  gui=none                         " foreground on dark violet
+endif
+hi Search         guifg=#78ba42 guibg=#107040  gui=none                         " light green on green
+hi DiffAdd        guifg=#78ba42 guibg=#107040  gui=none                         " light green on green
+hi Exception      guifg=#8f3231 guibg=bg       gui=none                         " red on background
+hi Title          guifg=#8f3231 guibg=bg       gui=none                         " red on background
+hi Error          guifg=fg      guibg=#8f3231  gui=none                         " foreground on red
+hi DiffDelete     guifg=fg      guibg=#8f3231  gui=none                         " foreground on red
+hi Todo           guifg=#8f3231 guibg=#0e1219  gui=bold,undercurl guisp=#cbc32a " red on dark grey
+hi LineNr         guifg=#2c3138 guibg=#0e1219  gui=none                         " grey on dark grey
+hi Statement      guifg=#9966cc guibg=bg       gui=none                         " lavender on background
+hi Underlined                                  gui=bold,underline               " underline
+if version>= 700
+hi CursorLine     guibg=#0e1219 gui=none                                        " foreground on dark grey
+hi CursorColumn   guibg=#0e1219 gui=none                                        " foreground on dark grey
+endif
+hi Include        guifg=#107040 guibg=bg       gui=none                         " green on background
+hi Define         guifg=#107040 guibg=bg       gui=none                         " green on background
+hi Macro          guifg=#107040 guibg=bg       gui=none                         " green on background
+hi PreProc        guifg=#107040 guibg=bg       gui=none                         " green on background
+hi PreCondit      guifg=#107040 guibg=bg       gui=none                         " green on background
+hi StatusLineNC   guifg=#2c3138 guibg=black    gui=none                         " grey on black
+hi StatusLine     guifg=fg      guibg=black    gui=none                         " foreground on black
+hi WildMenu       guifg=fg      guibg=#0e1219  gui=none                         " foreground on dark grey
+hi FoldColumn     guifg=#333366 guibg=#0e1219  gui=none                         " dark violet on dark grey
+hi IncSearch      guifg=#0e1219 guibg=#82ade0  gui=bold                         " dark grey on cyan
+hi DiffText       guifg=#0e1219 guibg=#82ade0  gui=bold                         " dark grey on cyan
+hi Label          guifg=#7e28a9 guibg=bg       gui=none                         " purple on background
+hi Operator       guifg=#6d5279 guibg=bg       gui=none                         " pink on background
+hi Number         guifg=#8b8b00 guibg=bg       gui=none                         " dark yellow on background
+if version>= 700
+hi MatchParen   guifg=#0e1219 guibg=#78ba42  gui=none                           " dark grey on light green
+endif
+hi SpecialKey     guifg=#333366 guibg=bg       gui=none                         " metal on background
+
+hi Cursor         guifg=#0e1219 guibg=#8b9aaa  gui=none                         " dark grey on foreground
+hi TabLine        guifg=fg      guibg=black    gui=none                         " foreground on black
+hi NonText        guifg=#333366 guibg=bg       gui=none                         " metal on background
+hi Tag            guifg=#3741ad guibg=bg       gui=none                         " blue on background
+hi Delimiter      guifg=#3741ad guibg=bg       gui=none                         " blue on background
+hi Special        guifg=#3741ad guibg=bg       gui=none                         " blue on background
+hi SpecialChar    guifg=#3741ad guibg=bg       gui=none                         " blue on background
+hi SpecialComment guifg=#2680af guibg=bg       gui=none                         " blue2 on background
+
+" --- CTerm8 section
+if &t_Co == 8
+
+  " --- CTerm8 (Dark)
+  if &background == "dark"
+    "hi Normal        ctermfg=Grey          "ctermbg=DarkGrey
+    hi Constant       ctermfg=DarkGreen
+    hi Boolean        ctermfg=DarkGreen
+    hi Character      ctermfg=DarkGreen
+    hi Float          ctermfg=DarkGreen
+    hi Comment        ctermfg=DarkCyan
+    hi Type           ctermfg=Brown
+    hi Typedef        ctermfg=Brown
+    hi Structure      ctermfg=Brown
+    hi Function       ctermfg=Brown
+    hi StorageClass   ctermfg=Brown
+    hi Conditional    ctermfg=Brown
+    hi Repeat         ctermfg=Brown
+    hi Visual         ctermfg=Brown         ctermbg=Black
+    hi DiffChange     ctermfg=Grey          ctermbg=DarkBlue
+    if version>= 700
+    hi Pmenu          ctermfg=Grey          ctermbg=DarkBlue
+    endif
+    hi String         ctermfg=DarkGreen
+    hi Folded         ctermfg=DarkGrey      ctermbg=Black
+    hi VertSplit      ctermfg=DarkGrey      ctermbg=DarkGrey
+    if version>= 700
+    hi PmenuSel       ctermfg=DarkBlue      ctermbg=Grey
+    endif
+    hi Search         ctermfg=Black         ctermbg=Brown
+    hi DiffAdd        ctermfg=Black         ctermbg=DarkGreen
+    hi Exception      ctermfg=Brown
+    hi Title          ctermfg=DarkRed
+    hi Error          ctermfg=Brown         ctermbg=DarkRed
+    hi DiffDelete     ctermfg=Brown         ctermbg=DarkRed
+    hi Todo           ctermfg=Brown         ctermbg=DarkRed
+    hi LineNr         ctermfg=DarkGrey
+    hi Statement      ctermfg=Brown
+    hi Underlined     cterm=Underline
+    if version>= 700
+    hi CursorLine     ctermbg=Black         cterm=Underline
+    hi CursorColumn   ctermfg=Grey          ctermbg=Black
+    endif
+    hi Include        ctermfg=DarkMagenta
+    hi Define         ctermfg=DarkMagenta
+    hi Macro          ctermfg=DarkMagenta
+    hi PreProc        ctermfg=DarkMagenta
+    hi PreCondit      ctermfg=DarkMagenta
+    hi StatusLineNC   ctermfg=DarkGrey      ctermbg=Black
+    hi StatusLine     ctermfg=Grey          ctermbg=DarkGrey
+    hi WildMenu       ctermfg=Grey          ctermbg=DarkGrey
+    hi FoldColumn     ctermfg=DarkGrey
+    hi IncSearch      ctermfg=DarkCyan      ctermbg=Black
+    hi DiffText       ctermfg=DarkBlue      ctermbg=Grey
+    hi Label          ctermfg=Brown
+    hi Operator       ctermfg=Brown
+    hi Number         ctermfg=DarkGreen
+    if version>= 700
+    hi MatchParen     ctermfg=Grey          ctermbg=Green
+    endif
+    hi SpecialKey     ctermfg=DarkRed
+
+    hi Cursor         ctermfg=Black         ctermbg=Grey
+    hi Delimiter      ctermfg=Brown
+    hi NonText        ctermfg=DarkRed
+    hi Special        ctermfg=Brown
+    hi SpecialChar    ctermfg=Brown
+    hi SpecialComment ctermfg=DarkCyan
+    hi TabLine        ctermfg=DarkGrey      ctermbg=Grey
+    hi Tag            ctermfg=Brown
+
+  " --- CTerm8 (Light)
+  elseif &background == "light"
+    hi Normal         ctermfg=Black         ctermbg=White
+    hi Constant       ctermfg=DarkCyan
+    hi Boolean        ctermfg=DarkCyan
+    hi Character      ctermfg=DarkCyan
+    hi Float          ctermfg=DarkCyan
+    hi Comment        ctermfg=DarkGreen
+    hi Type           ctermfg=DarkBlue
+    hi Typedef        ctermfg=DarkBlue
+    hi Structure      ctermfg=DarkBlue
+    hi Function       ctermfg=DarkBlue
+    hi StorageClass   ctermfg=DarkBlue
+    hi Conditional    ctermfg=DarkBlue
+    hi Repeat         ctermfg=DarkBlue
+    hi Visual         ctermfg=Brown         ctermbg=Black
+    hi DiffChange     ctermfg=Grey          ctermbg=DarkBlue
+    if version>= 700
+    hi Pmenu          ctermfg=Grey          ctermbg=DarkBlue
+    endif
+    hi String         ctermfg=DarkRed
+    hi Folded         ctermfg=Black         ctermbg=DarkCyan
+    hi VertSplit      ctermfg=Grey          ctermbg=Black
+    if version>= 700
+    hi PmenuSel       ctermfg=DarkBlue      ctermbg=Grey
+    endif
+    hi Search         ctermfg=Grey          ctermbg=DarkGreen
+    hi DiffAdd        ctermfg=Black         ctermbg=DarkGreen
+    hi Exception      ctermfg=DarkBlue
+    hi Title          ctermfg=DarkRed
+    hi Error          ctermfg=Brown         ctermbg=DarkRed
+    hi DiffDelete     ctermfg=Brown         ctermbg=DarkRed
+    hi Todo           ctermfg=Brown         ctermbg=DarkRed
+    hi LineNr         ctermfg=Black         ctermbg=Grey
+    hi Statement      ctermfg=DarkBlue
+    hi Underlined     cterm=Underline
+    if version>= 700
+    hi CursorLine     ctermbg=Grey          cterm=Underline
+    hi CursorColumn   ctermfg=Black         ctermbg=Grey
+    endif
+    hi Include        ctermfg=DarkMagenta
+    hi Define         ctermfg=DarkMagenta
+    hi Macro          ctermfg=DarkMagenta
+    hi PreProc        ctermfg=DarkMagenta
+    hi PreCondit      ctermfg=DarkMagenta
+    hi StatusLineNC   ctermfg=Grey          ctermbg=DarkBlue
+    hi StatusLine     ctermfg=Grey          ctermbg=Black
+    hi WildMenu       ctermfg=Grey          ctermbg=DarkBlue
+    hi FoldColumn     ctermfg=Black         ctermbg=Grey
+    hi IncSearch      ctermfg=Brown         ctermbg=Black
+    hi DiffText       ctermfg=DarkBlue      ctermbg=Grey
+    hi Label          ctermfg=DarkBlue
+    hi Operator       ctermfg=DarkBlue
+    hi Number         ctermfg=DarkCyan
+    if version>= 700
+    hi MatchParen     ctermfg=Grey          ctermbg=Green
+    endif
+    hi SpecialKey     ctermfg=Red
+
+    hi Cursor         ctermfg=Black         ctermbg=Grey
+    hi Delimiter      ctermfg=DarkBlue
+    hi NonText        ctermfg=Red
+    hi Special        ctermfg=DarkBlue
+    hi SpecialChar    ctermfg=DarkBlue
+    hi SpecialComment ctermfg=DarkGreen
+    hi TabLine        ctermfg=DarkBlue      ctermbg=Grey
+    hi Tag            ctermfg=DarkBlue
+  endif
+
+" --- CTerm256 section
+elseif &t_Co == 256
+
+  if v:version < 700
+   command! -nargs=+ CSAHi exe "hi" substitute(substitute(<q-args>, "undercurl", "underline", "g"), "guisp\\S\\+", "", "g")
+  else
+   command! -nargs=+ CSAHi exe "hi" <q-args>
+  endif
+  if has("gui_running") || (&t_Co == 256 && (&term ==# "xterm" || &term =~# "^screen") && exists("g:CSApprox_konsole") && g:CSApprox_konsole) || &term =~? "^konsole"
+    CSAHi Normal ctermbg=59 ctermfg=145
+    CSAHi Constant term=underline ctermbg=59 ctermfg=146
+    CSAHi Boolean ctermbg=59 ctermfg=146
+    CSAHi Character ctermbg=59 ctermfg=146
+    CSAHi Float ctermbg=59 ctermfg=146
+    CSAHi Comment term=bold ctermbg=59 ctermfg=30
+    CSAHi Type term=underline ctermbg=59 ctermfg=220
+    CSAHi Typedef ctermbg=59 ctermfg=220
+    CSAHi Structure ctermbg=59 ctermfg=220
+    CSAHi Function ctermbg=59 ctermfg=220
+    CSAHi StorageClass ctermbg=59 ctermfg=220
+    CSAHi Conditional ctermbg=59 ctermfg=214
+    CSAHi Repeat ctermbg=59 ctermfg=113
+    CSAHi Visual term=reverse ctermbg=61 ctermfg=white
+    CSAHi DiffChange term=bold ctermbg=61 ctermfg=white
+    CSAHi Pmenu ctermbg=61 ctermfg=white
+    CSAHi String ctermbg=59 ctermfg=61
+    CSAHi Folded ctermbg=61 ctermfg=black
+    CSAHi VertSplit term=reverse ctermbg=black ctermfg=61
+    CSAHi PmenuSel ctermbg=220 ctermfg=black
+    CSAHi Search term=reverse ctermbg=29 ctermfg=113
+    CSAHi DiffAdd term=bold ctermbg=29 ctermfg=113
+    CSAHi Exception ctermbg=59 ctermfg=red
+    CSAHi Title term=bold ctermbg=59 ctermfg=red
+    CSAHi Error term=reverse ctermbg=red ctermfg=white
+    CSAHi DiffDelete term=bold ctermbg=red ctermfg=white
+    CSAHi Todo cterm=bold,undercurl ctermbg=black ctermfg=red
+    CSAHi LineNr term=underline ctermbg=black ctermfg=61
+    CSAHi Statement term=bold ctermbg=59 ctermfg=140
+    CSAHi Underlined term=underline cterm=bold,underline ctermfg=147
+    CSAHi CursorLine term=underline cterm=underline ctermbg=black
+    CSAHi CursorColumn term=reverse ctermfg=white ctermbg=29
+    CSAHi Include ctermbg=59 ctermfg=97
+    CSAHi Define ctermbg=59 ctermfg=97
+    CSAHi Macro ctermbg=59 ctermfg=97
+    CSAHi PreProc term=underline ctermbg=59 ctermfg=97
+    CSAHi PreCondit ctermbg=59 ctermfg=97
+    CSAHi StatusLineNC term=reverse ctermbg=16 ctermfg=61
+    CSAHi StatusLine term=reverse,bold ctermbg=16 ctermfg=220
+    CSAHi WildMenu ctermbg=16 ctermfg=145
+    CSAHi FoldColumn ctermbg=16 ctermfg=61
+    CSAHi IncSearch term=reverse cterm=bold ctermbg=146 ctermfg=16
+    CSAHi DiffText term=reverse cterm=bold ctermbg=146 ctermfg=16
+    CSAHi Label ctermbg=59 ctermfg=140
+    CSAHi Operator ctermbg=59 ctermfg=142
+    CSAHi Number ctermbg=59 ctermfg=146
+    CSAHi MatchParen term=reverse ctermbg=113 ctermfg=16
+    CSAHi SpecialKey term=bold ctermbg=59 ctermfg=97
+
+    CSAHi Cursor ctermbg=145 ctermfg=16
+    CSAHi lCursor ctermbg=145 ctermfg=59
+    CSAHi Delimiter ctermbg=59 ctermfg=61
+    CSAHi Directory term=bold ctermfg=39
+    CSAHi ErrorMsg ctermbg=160 ctermfg=231
+    CSAHi Identifier term=underline ctermfg=87
+    CSAHi Ignore ctermfg=59
+    CSAHi ModeMsg term=bold cterm=bold
+    CSAHi MoreMsg term=bold cterm=bold ctermfg=72
+    CSAHi NonText term=bold ctermbg=59 ctermfg=60
+    CSAHi PmenuSbar ctermbg=250
+    CSAHi PmenuThumb ctermbg=145 ctermfg=59
+    CSAHi Question cterm=bold ctermfg=28
+    CSAHi SignColumn ctermbg=250 ctermfg=39
+    CSAHi Special term=bold ctermbg=59 ctermfg=61
+    CSAHi SpecialChar ctermbg=59 ctermfg=61
+    CSAHi SpecialComment ctermbg=59 ctermfg=73
+    CSAHi SpellBad term=reverse cterm=undercurl ctermfg=196
+    CSAHi SpellCap term=reverse cterm=undercurl ctermfg=21
+    CSAHi SpellLocal term=underline cterm=undercurl ctermfg=51
+    CSAHi SpellRare term=reverse cterm=undercurl ctermfg=201
+    CSAHi TabLine term=underline ctermbg=16 ctermfg=145
+    CSAHi TabLineFill term=reverse ctermbg=145 ctermfg=59
+    CSAHi TabLineSel term=bold cterm=bold
+    CSAHi Tag ctermbg=59 ctermfg=61
+    CSAHi VisualNOS term=bold,underline cterm=bold,underline
+    CSAHi WarningMsg ctermfg=160
+    CSAHi htmlBold term=bold cterm=bold
+    CSAHi htmlBoldItalic term=bold,italic cterm=bold
+    CSAHi htmlBoldUnderline term=bold,underline cterm=bold,underline
+    CSAHi htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,underline
+    CSAHi htmlItalic term=italic
+    CSAHi htmlUnderline term=underline cterm=underline
+    CSAHi htmlUnderlineItalic term=italic,underline cterm=underline
+  elseif has("gui_running") || (&t_Co == 256 && (&term ==# "xterm" || &term =~# "^screen") && exists("g:CSApprox_eterm") && g:CSApprox_eterm) || &term =~? "^eterm"
+    CSAHi Normal ctermbg=59 ctermfg=152
+    CSAHi Constant term=underline ctermbg=59 ctermfg=153
+    CSAHi Boolean ctermbg=59 ctermfg=153
+    CSAHi Character ctermbg=59 ctermfg=153
+    CSAHi Float ctermbg=59 ctermfg=153
+    CSAHi Comment term=bold ctermbg=59 ctermfg=30
+    CSAHi Type term=underline ctermbg=59 ctermfg=226
+    CSAHi Typedef ctermbg=59 ctermfg=226
+    CSAHi Structure ctermbg=59 ctermfg=226
+    CSAHi Function ctermbg=59 ctermfg=226
+    CSAHi StorageClass ctermbg=59 ctermfg=226
+    CSAHi Conditional ctermbg=59 ctermfg=220
+    CSAHi Repeat ctermbg=59 ctermfg=150
+    CSAHi Visual term=reverse ctermbg=68 ctermfg=white
+    CSAHi DiffChange term=bold ctermbg=68 ctermfg=white
+    CSAHi Pmenu ctermbg=68 ctermfg=white
+    CSAHi String ctermbg=59 ctermfg=104
+    CSAHi Folded ctermbg=104 ctermfg=black
+    CSAHi VertSplit term=reverse ctermbg=black ctermfg=104
+    CSAHi PmenuSel ctermbg=226 ctermfg=black
+    CSAHi Search term=reverse ctermbg=36 ctermfg=150
+    CSAHi DiffAdd term=bold ctermbg=36 ctermfg=150
+    CSAHi Exception ctermbg=59 ctermfg=red
+    CSAHi Title term=bold ctermbg=59 ctermfg=red
+    CSAHi Error term=reverse ctermbg=red ctermfg=white
+    CSAHi DiffDelete term=bold ctermbg=red ctermfg=white
+    CSAHi Todo cterm=bold,undercurl ctermbg=black ctermfg=red
+    CSAHi LineNr term=underline ctermbg=black ctermfg=104
+    CSAHi Statement term=bold ctermbg=59 ctermfg=177
+    CSAHi Underlined term=underline cterm=bold,underline ctermfg=153
+    CSAHi CursorLine term=underline cterm=underline ctermbg=black
+    CSAHi CursorColumn term=reverse ctermfg=white ctermbg=36
+    CSAHi Include ctermbg=59 ctermfg=134
+    CSAHi Define ctermbg=59 ctermfg=134
+    CSAHi Macro ctermbg=59 ctermfg=134
+    CSAHi PreProc term=underline ctermbg=59 ctermfg=134
+    CSAHi PreCondit ctermbg=59 ctermfg=134
+    CSAHi StatusLineNC term=reverse ctermbg=16 ctermfg=104
+    CSAHi StatusLine term=reverse,bold ctermbg=16 ctermfg=226
+    CSAHi WildMenu ctermbg=17 ctermfg=152
+    CSAHi FoldColumn ctermbg=17 ctermfg=104
+    CSAHi IncSearch term=reverse cterm=bold ctermbg=153 ctermfg=17
+    CSAHi DiffText term=reverse cterm=bold ctermbg=153 ctermfg=17
+    CSAHi Label ctermbg=59 ctermfg=177
+    CSAHi Operator ctermbg=59 ctermfg=142
+    CSAHi Number ctermbg=59 ctermfg=153
+    CSAHi MatchParen term=reverse ctermbg=150 ctermfg=17
+    CSAHi SpecialKey term=bold ctermbg=59 ctermfg=134
+
+    CSAHi Cursor ctermbg=152 ctermfg=17
+    CSAHi lCursor ctermbg=152 ctermfg=59
+    CSAHi TabLine term=underline ctermbg=16 ctermfg=152
+    CSAHi Ignore ctermfg=59
+    CSAHi NonText term=bold ctermbg=59 ctermfg=60
+    CSAHi Directory term=bold ctermfg=45
+    CSAHi ErrorMsg ctermbg=196 ctermfg=255
+    CSAHi MoreMsg term=bold cterm=bold ctermfg=72
+    CSAHi ModeMsg term=bold cterm=bold
+    CSAHi htmlBoldUnderline term=bold,underline cterm=bold,underline
+    CSAHi htmlBoldItalic term=bold,italic cterm=bold
+    CSAHi htmlBold term=bold cterm=bold
+    CSAHi htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,underline
+    CSAHi PmenuSbar ctermbg=250
+    CSAHi PmenuThumb ctermbg=152 ctermfg=59
+    CSAHi TabLineSel term=bold cterm=bold
+    CSAHi TabLineFill term=reverse ctermbg=152 ctermfg=59
+    CSAHi Question cterm=bold ctermfg=28
+    CSAHi VisualNOS term=bold,underline cterm=bold,underline
+    CSAHi WarningMsg ctermfg=196
+    CSAHi htmlUnderlineItalic term=italic,underline cterm=underline
+    CSAHi htmlUnderline term=underline cterm=underline
+    CSAHi Special term=bold ctermbg=59 ctermfg=68
+    CSAHi Identifier term=underline ctermfg=123
+    CSAHi Tag ctermbg=59 ctermfg=68
+    CSAHi SpecialChar ctermbg=59 ctermfg=68
+    CSAHi Delimiter ctermbg=59 ctermfg=68
+    CSAHi SpecialComment ctermbg=59 ctermfg=74
+    CSAHi SignColumn ctermbg=250 ctermfg=45
+    CSAHi SpellBad term=reverse cterm=undercurl ctermfg=196
+    CSAHi SpellCap term=reverse cterm=undercurl ctermfg=21
+    CSAHi SpellRare term=reverse cterm=undercurl ctermfg=201
+    CSAHi SpellLocal term=underline cterm=undercurl ctermfg=51
+    CSAHi htmlItalic term=italic
+  elseif has("gui_running") || &t_Co == 256
+    CSAHi Normal ctermbg=16 ctermfg=103
+    CSAHi Constant term=underline ctermbg=16 ctermfg=110
+    CSAHi Boolean ctermbg=16 ctermfg=110
+    CSAHi Character ctermbg=16 ctermfg=110
+    CSAHi Float ctermbg=16 ctermfg=110
+    CSAHi Comment term=bold ctermbg=16 ctermfg=23
+    CSAHi Type term=underline ctermbg=16 ctermfg=220
+    CSAHi Typedef ctermbg=16 ctermfg=220
+    CSAHi Structure ctermbg=16 ctermfg=220
+    CSAHi Function ctermbg=16 ctermfg=220
+    CSAHi StorageClass ctermbg=16 ctermfg=220
+    CSAHi Conditional ctermbg=16 ctermfg=208
+    CSAHi Repeat ctermbg=16 ctermfg=107
+    CSAHi Visual term=reverse ctermbg=61 ctermfg=white
+    CSAHi DiffChange term=bold ctermbg=61 ctermfg=white
+    CSAHi Pmenu ctermbg=61 ctermfg=white
+    CSAHi String ctermbg=16 ctermfg=61
+    CSAHi Folded ctermbg=61 ctermfg=black
+    CSAHi VertSplit term=reverse ctermbg=black ctermfg=61
+    CSAHi PmenuSel ctermbg=220 ctermfg=black
+    CSAHi Search term=reverse ctermbg=23 ctermfg=107
+    CSAHi DiffAdd term=bold ctermbg=23 ctermfg=107
+    CSAHi Exception ctermbg=16 ctermfg=red
+    CSAHi Title term=bold ctermbg=16 ctermfg=red
+    CSAHi Error term=reverse ctermbg=red ctermfg=white
+    CSAHi DiffDelete term=bold ctermbg=red ctermfg=white
+    CSAHi Todo cterm=bold,undercurl ctermbg=black ctermfg=red
+    CSAHi LineNr term=underline ctermbg=black ctermfg=61
+    CSAHi Statement term=bold ctermbg=16 ctermfg=98
+    CSAHi Underlined term=underline cterm=bold,underline ctermfg=111
+    CSAHi CursorLine term=underline cterm=underline ctermbg=black
+    CSAHi CursorColumn term=reverse ctermbg=23 ctermfg=white
+    CSAHi Include ctermbg=16 ctermfg=91
+    CSAHi Define ctermbg=16 ctermfg=91
+    CSAHi Macro ctermbg=16 ctermfg=91
+    CSAHi PreProc term=underline ctermbg=16 ctermfg=91
+    CSAHi PreCondit ctermbg=16 ctermfg=91
+    CSAHi StatusLineNC term=reverse ctermbg=16 ctermfg=61
+    CSAHi StatusLine term=reverse,bold ctermbg=16 ctermfg=220
+    CSAHi WildMenu ctermbg=16 ctermfg=103
+    CSAHi FoldColumn ctermbg=16 ctermfg=61
+    CSAHi IncSearch term=reverse cterm=bold ctermbg=110 ctermfg=16
+    CSAHi DiffText term=reverse cterm=bold ctermbg=110 ctermfg=16
+    CSAHi Label ctermbg=16 ctermfg=98
+    CSAHi Operator ctermbg=16 ctermfg=100
+    CSAHi Number ctermbg=16 ctermfg=110
+    CSAHi MatchParen term=reverse ctermbg=107 ctermfg=16
+    CSAHi SpecialKey term=bold ctermbg=16 ctermfg=91
+
+    CSAHi Cursor ctermbg=103 ctermfg=16
+    CSAHi lCursor ctermbg=103 ctermfg=16
+    CSAHi Delimiter ctermbg=16 ctermfg=61
+    CSAHi Directory term=bold ctermfg=38
+    CSAHi ErrorMsg ctermbg=160 ctermfg=231
+    CSAHi Identifier term=underline ctermfg=87
+    CSAHi Ignore ctermfg=16
+    CSAHi ModeMsg term=bold cterm=bold
+    CSAHi MoreMsg term=bold cterm=bold ctermfg=29
+    CSAHi NonText term=bold ctermbg=16 ctermfg=59
+    CSAHi PmenuSbar ctermbg=250
+    CSAHi PmenuThumb ctermbg=103 ctermfg=16
+    CSAHi Question cterm=bold ctermfg=22
+    CSAHi SignColumn ctermbg=250 ctermfg=38
+    CSAHi Special term=bold ctermbg=16 ctermfg=61
+    CSAHi SpecialChar ctermbg=16 ctermfg=61
+    CSAHi SpecialComment ctermbg=16 ctermfg=31
+    CSAHi SpellBad term=reverse cterm=undercurl ctermfg=196
+    CSAHi SpellCap term=reverse cterm=undercurl ctermfg=21
+    CSAHi SpellLocal term=underline cterm=undercurl ctermfg=51
+    CSAHi SpellRare term=reverse cterm=undercurl ctermfg=201
+    CSAHi TabLine term=underline ctermbg=16 ctermfg=103
+    CSAHi TabLineFill term=reverse ctermbg=103 ctermfg=16
+    CSAHi TabLineSel term=bold cterm=bold
+    CSAHi Tag ctermbg=16 ctermfg=61
+    CSAHi VisualNOS term=bold,underline cterm=bold,underline
+    CSAHi WarningMsg ctermfg=160
+    CSAHi htmlBold term=bold cterm=bold
+    CSAHi htmlBoldItalic term=bold,italic cterm=bold
+    CSAHi htmlBoldUnderline term=bold,underline cterm=bold,underline
+    CSAHi htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,underline
+    CSAHi htmlItalic term=italic
+    CSAHi htmlUnderline term=underline cterm=underline
+    CSAHi htmlUnderlineItalic term=italic,underline cterm=underline
+  elseif has("gui_running") || &t_Co == 88
+    CSAHi Normal ctermbg=80 ctermfg=37
+    CSAHi Constant term=underline ctermbg=80 ctermfg=42
+    CSAHi Boolean ctermbg=80 ctermfg=42
+    CSAHi Character ctermbg=80 ctermfg=42
+    CSAHi Float ctermbg=80 ctermfg=42
+    CSAHi Comment term=bold ctermbg=80 ctermfg=21
+    CSAHi Type term=underline ctermbg=80 ctermfg=72
+    CSAHi Typedef ctermbg=80 ctermfg=72
+    CSAHi Structure ctermbg=80 ctermfg=72
+    CSAHi Function ctermbg=80 ctermfg=72
+    CSAHi StorageClass ctermbg=80 ctermfg=72
+    CSAHi Conditional ctermbg=80 ctermfg=68
+    CSAHi Repeat ctermbg=80 ctermfg=40
+    CSAHi Visual term=reverse ctermbg=18 ctermfg=white
+    CSAHi DiffChange term=bold ctermbg=18 ctermfg=white
+    CSAHi Pmenu ctermbg=18 ctermfg=white
+    CSAHi String ctermbg=80 ctermfg=38
+    CSAHi Folded ctermbg=38 ctermfg=black
+    CSAHi VertSplit term=reverse ctermbg=black ctermfg=38
+    CSAHi PmenuSel ctermbg=72 ctermfg=black
+    CSAHi Search term=reverse ctermbg=20 ctermfg=40
+    CSAHi DiffAdd term=bold ctermbg=20 ctermfg=40
+    CSAHi Exception ctermbg=80 ctermfg=red
+    CSAHi Title term=bold ctermbg=80 ctermfg=red
+    CSAHi Error term=reverse ctermbg=red ctermfg=white
+    CSAHi DiffDelete term=bold ctermbg=red ctermfg=white
+    CSAHi Todo cterm=bold,undercurl ctermbg=black ctermfg=white
+    CSAHi LineNr term=underline ctermbg=black ctermfg=38
+    CSAHi Statement term=bold ctermbg=80 ctermfg=38
+    CSAHi Underlined term=underline cterm=bold,underline ctermfg=39
+    CSAHi CursorLine term=underline ctermbg=black
+    CSAHi CursorColumn term=reverse ctermbg=20 ctermfg=white
+    CSAHi Include ctermbg=80 ctermfg=33
+    CSAHi Define ctermbg=80 ctermfg=33
+    CSAHi Macro ctermbg=80 ctermfg=33
+    CSAHi PreProc term=underline ctermbg=80 ctermfg=33
+    CSAHi PreCondit ctermbg=80 ctermfg=33
+    CSAHi StatusLineNC term=reverse ctermbg=16 ctermfg=38
+    CSAHi StatusLine term=reverse,bold ctermbg=16 ctermfg=72
+    CSAHi WildMenu ctermbg=16 ctermfg=37
+    CSAHi FoldColumn ctermbg=16 ctermfg=38
+    CSAHi IncSearch term=reverse cterm=bold ctermbg=42 ctermfg=16
+    CSAHi DiffText term=reverse cterm=bold ctermbg=42 ctermfg=16
+    CSAHi Label ctermbg=80 ctermfg=38
+    CSAHi Operator ctermbg=80 ctermfg=36
+    CSAHi Number ctermbg=80 ctermfg=42
+    CSAHi MatchParen term=reverse ctermbg=40 ctermfg=16
+    CSAHi SpecialKey term=bold ctermbg=80 ctermfg=33
+
+    CSAHi Cursor ctermbg=37 ctermfg=16
+    CSAHi lCursor ctermbg=37 ctermfg=80
+    CSAHi Delimiter ctermbg=80 ctermfg=18
+    CSAHi Directory term=bold ctermfg=23
+    CSAHi ErrorMsg ctermbg=48 ctermfg=79
+    CSAHi Identifier term=underline ctermfg=31
+    CSAHi Ignore ctermfg=80
+    CSAHi ModeMsg term=bold cterm=bold
+    CSAHi MoreMsg term=bold cterm=bold ctermfg=21
+    CSAHi NonText term=bold ctermbg=80 ctermfg=17
+    CSAHi PmenuSbar ctermbg=85
+    CSAHi PmenuThumb ctermbg=37 ctermfg=80
+    CSAHi Question cterm=bold ctermfg=20
+    CSAHi SignColumn ctermbg=85 ctermfg=23
+    CSAHi Special term=bold ctermbg=80 ctermfg=18
+    CSAHi SpecialChar ctermbg=80 ctermfg=18
+    CSAHi SpecialComment ctermbg=80 ctermfg=22
+    CSAHi SpellBad term=reverse cterm=undercurl ctermfg=64
+    CSAHi SpellCap term=reverse cterm=undercurl ctermfg=19
+    CSAHi SpellLocal term=underline cterm=undercurl ctermfg=31
+    CSAHi SpellRare term=reverse cterm=undercurl ctermfg=67
+    CSAHi TabLine term=underline ctermbg=16 ctermfg=37
+    CSAHi TabLineFill term=reverse ctermbg=37 ctermfg=80
+    CSAHi TabLineSel term=bold cterm=bold
+    CSAHi Tag ctermbg=80 ctermfg=18
+    CSAHi VisualNOS term=bold,underline cterm=bold,underline
+    CSAHi WarningMsg ctermfg=48
+    CSAHi htmlBold term=bold cterm=bold
+    CSAHi htmlBoldItalic term=bold,italic cterm=bold
+    CSAHi htmlBoldUnderline term=bold,underline cterm=bold,underline
+    CSAHi htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,underline
+    CSAHi htmlItalic term=italic
+    CSAHi htmlUnderline term=underline cterm=underline
+    CSAHi htmlUnderlineItalic term=italic,underline cterm=underline
+  endif
+  delcommand CSAHi
+
+endif
diff --git a/vim/colors/martin_krischik.vim b/vim/colors/martin_krischik.vim
new file mode 100644 (file)
index 0000000..0975ba0
--- /dev/null
@@ -0,0 +1,397 @@
+"-------------------------------------------------------------------------------
+"  Description: My personal colors
+"          $Id: martin_krischik.vim 458 2006-11-18 09:42:10Z krischik $
+"    Copyright: Copyright (C) 2006 Martin Krischik
+"   Maintainer:        Martin Krischik
+"      $Author: krischik $
+"        $Date: 2006-11-18 10:42:10 +0100 (Sa, 18 Nov 2006) $
+"      Version: 3.2
+"    $Revision: 458 $
+"     $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/colors/martin_krischik.vim $
+"        Note: Tried and Tested for 'builtin_gui', 'xterm' (KDE Konsole)
+"              'vt320'" (OpenVMS) and 'linux' (Linux Console).
+"      History: 16.05.2006 MK Check that all vim 7.0 colors are set
+"              16.05.2006 MK Split GUI from terminal.
+"              24.05.2006 MK Unified Headers
+"              24.07.2006 MK Omni-Completion Colors.
+"               15.10.2006 MK Bram's suggestion for runtime integration
+"       Usage: copy to colors directory
+"------------------------------------------------------------------------------
+
+" First remove all existing highlighting.
+
+set background=light
+highlight clear
+
+if exists ("syntax_on")
+    syntax reset
+endif
+
+let colors_name = "martin_krischik"
+
+if version < 700
+   " Section: works only with vim 7.0 use default otherwise {{{1
+   "
+   colorscheme default
+   "
+   " }}}1
+   finish
+elseif (&term == "builtin_gui")
+    " Section: Set GUI colors. {{{1
+    "
+    " Subsection: User-Interface Colors {{{2
+    "
+    " Group: Normal Text Colors {{{3
+    "
+    highlight Normal           gui=none                guifg=black         guibg=white
+    highlight Search                                                       guibg=Yellow
+    highlight SpecialKey                               guifg=Blue
+    highlight Title            gui=bold                guifg=Magenta
+    highlight LineNr                                   guifg=Brown         guibg=grey80
+    highlight NonText          gui=bold                guifg=Blue          guibg=grey80
+    highlight MatchParen                                                   guibg=Cyan
+    highlight IncSearch                gui=reverse
+    "
+    " Group: Messages {{{3
+    "
+    highlight WarningMsg                               guifg=Red
+    highlight ErrorMsg                                 guifg=White         guibg=Red
+    highlight ModeMsg          gui=bold
+    highlight MoreMsg          gui=bold                guifg=SeaGreen
+    highlight Question         gui=bold                guifg=SeaGreen
+    "
+    " Group: Spell Checker {{{3
+    "
+    highlight SpellBad         gui=undercurl                                                   guisp=Red
+    highlight SpellCap         gui=undercurl                                                   guisp=Blue
+    highlight SpellLocal       gui=undercurl                                                   guisp=DarkCyan
+    highlight SpellRare                gui=undercurl                                                   guisp=Magenta
+    "
+    " Group: Status line {{{3
+    "
+    highlight StatusLine       gui=bold,reverse        guifg=LightBlue2    guibg=black
+    highlight StatusLineNC     gui=reverse             guifg=grey75        guibg=black
+    highlight VertSplit                gui=reverse             guifg=LightBlue3    guibg=black
+    "
+    " Group: Visual selektio {{{3n
+    "
+    highlight Visual           gui=reverse             guifg=firebrick     guibg=white
+    highlight VisualNOS                gui=reverse             guifg=firebrick     guibg=black
+    "
+    " Group: tab pages line {{{3
+    "
+    highlight TabLine          gui=reverse             guifg=grey75        guibg=black
+    highlight TabLineFill      gui=reverse
+    highlight TabLineSel       gui=bold,reverse        guifg=LightBlue2    guibg=black
+    "
+    " Group: Competion (omni and otherwise) menu colors {{{3
+    "
+    highlight Pmenu                                                        guibg=Grey
+    highlight PmenuSel                                 guifg=White         guibg=firebrick
+    highlight PmenuSbar                                        guibg=LightGrey     guibg=DarkGrey
+    highlight PmenuThumb       gui=reverse
+    highlight WildMenu                                 guifg=White         guibg=firebrick
+    "
+    " Group: Diff colors {{{3
+    "
+    highlight DiffAdd                                                      guibg=LightBlue
+    highlight DiffChange                                                   guibg=LightMagenta
+    highlight DiffDelete       gui=bold                guifg=Blue          guibg=LightCyan
+    highlight DiffText         gui=bold                                    guibg=Red
+    "
+    " Group: Fold colors {{{3
+    "
+    highlight FoldColumn                               guifg=DarkBlue      guibg=Grey
+    highlight Folded                                   guifg=DarkBlue      guibg=LightGrey
+    "
+    " Group: Other Syntax Highlight Colors {{{3
+    "
+    highlight Directory                guifg=Blue
+    highlight SignColumn       guifg=DarkBlue      guibg=Grey
+    "
+    " Group: Motif and Athena widget colors. {{{3
+    "
+    highlight Menu             guifg=Black         guibg=LightGrey
+    highlight Scrollbar                guifg=LightGrey     guibg=DarkGrey
+    highlight Tooltip          guifg=Black         guibg=LightGrey
+
+    " Subsection: Syntax Colors  {{{2
+    "
+    " Group: Comment colors syntax-group
+    "
+    highlight Comment                                  guifg=grey30
+    "
+    " Group: Constant colors group {{{3
+    "
+    highlight Boolean                                  guifg=DarkOrchid3   guibg=grey95
+    highlight Character                                        guifg=RoyalBlue3    guibg=grey95
+    highlight Constant                                 guifg=MediumOrchid3 guibg=grey95
+    highlight Float                                    guifg=MediumOrchid4 guibg=grey95
+    highlight Number                                   guifg=DarkOrchid4   guibg=grey95
+    highlight String                                   guifg=RoyalBlue4    guibg=grey95
+    "
+    " Group: Identifier colors group {{{3
+    "
+    highlight Function                                 guifg=SteelBlue
+    highlight Identifier                               guifg=DarkCyan
+    "
+    " Group: Statement colors group {{{3
+    "
+    highlight Conditional      gui=bold                guifg=DodgerBlue4
+    highlight Exception                gui=none                guifg=SlateBlue4
+    highlight Keyword          gui=bold                guifg=RoyalBlue4
+    highlight Label            gui=none                guifg=SlateBlue3
+    highlight Operator         gui=none                guifg=RoyalBlue3
+    highlight Repeat           gui=bold                guifg=DodgerBlue3
+    highlight Statement                gui=none                guifg=RoyalBlue4
+    "
+    " Group: Preprocessor colors group {{{3
+    "
+    highlight Define                                   guifg=brown4        guibg=snow
+    highlight Include                                  guifg=firebrick3    guibg=snow
+    highlight Macro                                    guifg=brown3        guibg=snow
+    highlight PreCondit                                        guifg=red           guibg=snow
+    highlight PreProc                                  guifg=firebrick4    guibg=snow
+    "
+    " Group: type group {{{3
+    "
+    highlight StorageClass     gui=none                guifg=SeaGreen3
+    highlight Structure                gui=none                guifg=DarkSlateGray4
+    highlight Type             gui=none                guifg=SeaGreen4
+    highlight Typedef          gui=none                guifg=DarkSeaGreen4
+    "
+    " Group: special symbol group {{{3
+    "
+    highlight Special                                  guifg=SlateBlue     guibg=GhostWhite
+    highlight SpecialChar                              guifg=DeepPink      guibg=GhostWhite
+    highlight Tag                                      guifg=DarkSlateBlue guibg=GhostWhite
+    highlight Delimiter                                        guifg=DarkOrchid    guibg=GhostWhite
+    highlight SpecialComment                           guifg=VioletRed     guibg=GhostWhite
+    highlight Debug                                    guifg=maroon        guibg=GhostWhite
+    "
+    " Group: text that stands out {{{3
+    "
+    highlight Underlined       gui=underline           guifg=SlateBlue
+    "
+    " Group: left blank, hidden {{{3
+    "
+    highlight Ignore                                   guifg=bg
+    "
+    " Group: any erroneous construct {{{3
+    "
+    highlight Error            gui=undercurl           guifg=Red           guibg=MistyRose
+    "
+    " Group: anything that needs extra attention {{{3
+    "
+    highlight Todo                                     guifg=Blue          guibg=Yellow
+
+    " Subsection: Cursor Colors {{{2
+    "
+    " Group: Mouse Cursor {{{3
+    "
+    highlight cCursor       guifg=bg    guibg=DarkRed
+    highlight Cursor        guifg=bg    guibg=DarkGreen
+    highlight CursorColumn              guibg=FloralWhite
+    highlight CursorIM      guifg=bg    guibg=DarkGrey
+    highlight CursorLine                guibg=cornsilk
+    highlight lCursor       guifg=bg    guibg=DarkMagenta
+    highlight oCursor       guifg=bg    guibg=DarkCyan
+    highlight vCursor       guifg=bg    guibg=DarkYellow
+    "
+    " Group: Text Cursor {{{3
+    "
+    set guicursor=n:block-lCursor,
+                \i:ver25-Cursor,
+                \r:hor25-Cursor,
+                \v:block-vCursor,
+               \ve:ver35-vCursor,
+                \o:hor50-oCursor-blinkwait75-blinkoff50-blinkon75,
+                \c:block-cCursor,
+               \ci:ver20-cCursor,
+               \cr:hor20-cCursor,
+               \sm:block-Cursor-blinkwait175-blinkoff150-blinkon175
+
+   syntax enable
+
+   " }}}1
+   finish
+elseif (&term == "xterm")  ||
+      \ (&term == "vt320")  ||
+      \ (&term == "linux")
+    " Section: Only set colors for terminals we actualy know of {{{1
+    "
+    if &term=="vt320"
+       set t_Co=8
+    else
+       set t_Co=16
+    endif
+
+    " Subsection: User Interface Colors {{{2
+    "
+    " Group: Normal Text Colors {{{3
+    "
+    highlight Normal           term=none           cterm=none              ctermfg=Black       ctermbg=LightGray
+    highlight Search           term=reverse                                                    ctermbg=DarkYellow
+    highlight SpecialKey       term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    highlight Title            term=bold                                   ctermfg=DarkMagenta ctermbg=LightGray
+    highlight LineNr           term=underline                              ctermfg=DarkRed     ctermbg=DarkGray
+    highlight NonText          term=bold                                   ctermfg=LightBlue   ctermbg=LightGray
+    highlight MatchParen       term=reverse                                ctermbg=DarkYellow
+    highlight IncSearch                term=reverse        cterm=reverse
+    "
+    " Group: Messages {{{3
+    "
+    highlight WarningMsg       term=standout                               ctermfg=DarkRed     ctermbg=LightGray
+    highlight ErrorMsg         term=standout                               ctermfg=White       ctermbg=DarkRed
+    highlight ModeMsg          term=bold           cterm=bold                                  ctermbg=LightGray
+    highlight MoreMsg          term=bold                                   ctermfg=DarkGreen   ctermbg=LightGray
+    highlight Question         term=standout                               ctermfg=DarkGreen   ctermbg=LightGray
+    "
+    " Group: Spell Checker {{{3
+    "
+    highlight SpellBad         term=reverse                                                    ctermbg=LightRed
+    highlight SpellCap         term=reverse                                                    ctermbg=LightBlue
+    highlight SpellLocal       term=underline                                                  ctermbg=LightCyan
+    highlight SpellRare                term=reverse                                                    ctermbg=LightMagenta
+    "
+    " Group: Status line {{{3
+    "
+    highlight StatusLine       term=bold,reverse   cterm=bold,reverse
+    highlight StatusLineNC     term=reverse        cterm=reverse
+    highlight VertSplit                term=reverse        cterm=reverse
+    "
+    " Group: Visual selektion {{{3
+    "
+    highlight Visual           term=reverse        cterm=reverse           ctermfg=DarkRed     ctermbg=LightGray
+    highlight VisualNOS                term=bold,underline cterm=bold,underline
+    "
+    " Group: tab pages line {{{3
+    "
+    highlight TabLine          term=reverse        cterm=reverse
+    highlight TabLineFill      term=reverse        cterm=reverse
+    highlight TabLineSel       term=bold,reverse   cterm=bold,reverse
+    "
+    " Group: Menu colors {{{3
+    "
+    highlight Pmenu                                                                            ctermbg=Grey
+    highlight PmenuSel                                                     ctermfg=White       ctermbg=Red
+    highlight PmenuSbar                                                            ctermfg=LightGrey   ctermbg=DarkGray
+    highlight PmenuThumb                           cterm=reverse
+    highlight WildMenu         term=standout                               ctermfg=White       ctermbg=Red
+    "
+    " Group: Diff colors {{{3
+    "
+    highlight DiffAdd          term=bold                                                       ctermbg=LightBlue
+    highlight DiffChange       term=bold                                                       ctermbg=LightMagenta
+    highlight DiffDelete       term=bold                                   ctermfg=LightBlue   ctermbg=LightCyan
+    highlight DiffText         term=reverse        cterm=bold                                  ctermbg=LightRed
+    "
+    " Group: Fold colors {{{3
+    "
+    highlight FoldColumn       term=standout                               ctermfg=DarkBlue    ctermbg=DarkGray
+    highlight Folded           term=standout                               ctermfg=DarkBlue    ctermbg=DarkGray
+    "
+    " Group: Other Syntax Highlight Colors {{{3
+    "
+    highlight Directory                term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    highlight SignColumn       term=standout                               ctermfg=DarkBlue    ctermbg=DarkGray
+
+    " Subsection: Syntax Colors {{{2
+    "
+    " Group: Comment colors syntax-group {{{3
+    "
+    highlight Comment          term=bold                                   ctermfg=DarkGray    ctermbg=LightGray
+    "
+    " Group: Constant colors group {{{3
+    "
+    highlight Boolean          term=underline                              ctermfg=DarkRed     ctermbg=LightGray
+    highlight Character                term=underline                              ctermfg=DarkRed     ctermbg=LightGray
+    highlight Constant         term=underline                              ctermfg=DarkRed     ctermbg=LightGray
+    highlight Float            term=underline                              ctermfg=DarkRed     ctermbg=LightGray
+    highlight Number           term=underline                              ctermfg=DarkRed     ctermbg=LightGray
+    highlight String           term=underline                              ctermfg=DarkRed     ctermbg=LightGray
+    "
+    " Group: Identifier colors group {{{3
+    "
+    highlight Function         term=underline                              ctermfg=DarkCyan    ctermbg=LightGray
+    highlight Identifier       term=underline                              ctermfg=DarkCyan    ctermbg=LightGray
+    "
+    " Group: Statement colors group {{{3
+    "
+    highlight Conditional      term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    highlight Exception                term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    highlight Keyword          term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    highlight Label            term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    highlight Operator         term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    highlight Repeat           term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    highlight Statement                term=bold                                   ctermfg=DarkBlue    ctermbg=LightGray
+    "
+    " Group: Preprocessor colors group {{{3
+    "
+    highlight Define           term=underline                              ctermfg=DarkMagenta ctermbg=LightGray
+    highlight Include          term=underline                              ctermfg=DarkMagenta ctermbg=LightGray
+    highlight Macro            term=underline                              ctermfg=DarkMagenta ctermbg=LightGray
+    highlight PreCondit                term=underline                              ctermfg=DarkMagenta ctermbg=LightGray
+    highlight PreProc          term=underline                              ctermfg=DarkMagenta ctermbg=LightGray
+    "
+    " Group: type group {{{3
+    "
+    highlight StorageClass     term=underline                              ctermfg=DarkGreen   ctermbg=LightGray
+    highlight Structure                term=underline                              ctermfg=DarkGreen   ctermbg=LightGray
+    highlight Type             term=underline                              ctermfg=DarkGreen   ctermbg=LightGray
+    highlight Typedef          term=underline                              ctermfg=DarkGreen   ctermbg=LightGray
+    "
+    " Group: special symbol group {{{3
+    "
+    highlight Special          term=bold                                   ctermfg=DarkMagenta ctermbg=LightGray
+    highlight SpecialChar      term=bold                                   ctermfg=DarkMagenta ctermbg=LightGray
+    highlight Tag              term=bold                                   ctermfg=DarkMagenta ctermbg=LightGray
+    highlight Delimiter                term=bold                                   ctermfg=DarkMagenta ctermbg=LightGray
+    highlight SpecialComment   term=bold                                   ctermfg=DarkMagenta ctermbg=LightGray
+    highlight Debug            term=bold                                   ctermfg=DarkMagenta ctermbg=LightGray
+    "
+    " Group: text that stands out {{{3
+    "
+    highlight Underlined       term=underline      cterm=underline         ctermfg=DarkMagenta ctermbg=LightGray
+    "
+    " Group: left blank, hidden {{{3
+    "
+    highlight Ignore                                                       ctermfg=White       ctermbg=grey
+    "
+    " Group: any erroneous construct {{{3
+    "
+    highlight Error            term=reverse                                ctermfg=White       ctermbg=LightRed
+    "
+    " Group: anything that needs extra attention {{{3
+    "
+    highlight Todo             term=standout                               ctermfg=Black       ctermbg=Yellow
+
+    " Subsection: Cursor Colors {{{2
+    "
+    " Group: Mouse Cursor {{{3
+    "
+    highlight Cursor                               ctermfg=bg              ctermbg=DarkGreen
+    highlight CursorColumn     term=reverse                                ctermbg=LightGray
+    highlight CursorIM                             ctermfg=bg              ctermbg=DarkGrey
+    highlight CursorLine       term=reverse                                ctermbg=LightGray
+
+    syntax enable
+
+   " }}}1
+    finish
+else
+   " Section: terminal is completely unknown - fallback to system default {{{1
+   "
+   set t_Co=8
+
+   " }}}1
+   finish
+endif
+
+"------------------------------------------------------------------------------
+"   Copyright (C) 2006  Martin Krischik
+"
+"   Vim is Charityware - see ":help license" or uganda.txt for licence details.
+"------------------------------------------------------------------------------
+" vim: nowrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
+" vim: filetype=vim foldmethod=marker textwidth=0
diff --git a/vim/colors/matrix.vim b/vim/colors/matrix.vim
new file mode 100644 (file)
index 0000000..75a0950
--- /dev/null
@@ -0,0 +1,80 @@
+" vim:set ts=8 sts=2 sw=2 tw=0:
+"
+" matrix.vim - MATRIX like colorscheme.
+"
+" Maintainer:   MURAOKA Taro <koron@tka.att.ne.jp>
+" Last Change:  10-Jun-2003.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = 'matrix'
+
+" the character under the cursor
+hi Cursor       guifg=#226622 guibg=#55ff55
+hi lCursor      guifg=#226622 guibg=#55ff55
+" like Cursor, but used when in IME mode |CursorIM|
+hi CursorIM     guifg=#226622 guibg=#55ff55
+" directory names (and other special names in listings)
+hi Directory    guifg=#55ff55 guibg=#000000
+" diff mode: Added line |diff.txt|
+hi DiffAdd      guifg=#55ff55 guibg=#226622 gui=none
+" diff mode: Changed line |diff.txt|
+hi DiffChange   guifg=#55ff55 guibg=#226622 gui=none
+" diff mode: Deleted line |diff.txt|
+hi DiffDelete   guifg=#113311 guibg=#113311 gui=none
+" diff mode: Changed text within a changed line |diff.txt|
+hi DiffText     guifg=#55ff55 guibg=#339933 gui=bold
+" error messages on the command line
+hi ErrorMsg     guifg=#55ff55 guibg=#339933
+" the column separating vertically split windows
+hi VertSplit    guifg=#339933 guibg=#339933
+" line used for closed folds
+hi Folded       guifg=#44cc44 guibg=#113311
+" 'foldcolumn'
+hi FoldColumn   guifg=#44cc44 guibg=#226622
+" 'incsearch' highlighting; also used for the text replaced with
+hi IncSearch    guifg=#226622 guibg=#55ff55 gui=none
+" line number for ":number" and ":#" commands, and when 'number'
+hi LineNr       guifg=#44cc44 guibg=#000000
+" 'showmode' message (e.g., "-- INSERT --")
+hi ModeMsg      guifg=#44cc44 guibg=#000000
+" |more-prompt|
+hi MoreMsg      guifg=#44cc44 guibg=#000000
+" '~' and '@' at the end of the window, characters from
+hi NonText      guifg=#44cc44 guibg=#113311
+" normal text
+hi Normal       guifg=#44cc44 guibg=#000000
+" |hit-enter| prompt and yes/no questions
+hi Question     guifg=#44cc44 guibg=#000000
+" Last search pattern highlighting (see 'hlsearch').
+hi Search       guifg=#113311 guibg=#44cc44 gui=none
+" Meta and special keys listed with ":map", also for text used
+hi SpecialKey   guifg=#44cc44 guibg=#000000
+" status line of current window
+hi StatusLine   guifg=#55ff55 guibg=#339933 gui=none
+" status lines of not-current windows
+hi StatusLineNC guifg=#113311 guibg=#339933 gui=none
+" titles for output from ":set all", ":autocmd" etc.
+hi Title        guifg=#55ff55 guibg=#113311 gui=bold
+" Visual mode selection
+hi Visual       guifg=#55ff55 guibg=#339933 gui=none
+" Visual mode selection when vim is "Not Owning the Selection".
+hi VisualNOS    guifg=#44cc44 guibg=#000000
+" warning messages
+hi WarningMsg   guifg=#55ff55 guibg=#000000
+" current match in 'wildmenu' completion
+hi WildMenu     guifg=#226622 guibg=#55ff55
+
+hi Comment      guifg=#226622 guibg=#000000
+hi Constant     guifg=#55ff55 guibg=#226622
+hi Special      guifg=#44cc44 guibg=#226622
+hi Identifier   guifg=#55ff55 guibg=#000000
+hi Statement    guifg=#55ff55 guibg=#000000 gui=bold
+hi PreProc      guifg=#339933 guibg=#000000
+hi Type         guifg=#55ff55 guibg=#000000 gui=bold
+hi Underlined   guifg=#55ff55 guibg=#000000 gui=underline
+hi Error        guifg=#55ff55 guibg=#339933
+hi Todo         guifg=#113311 guibg=#44cc44 gui=none
diff --git a/vim/colors/molokai.vim b/vim/colors/molokai.vim
new file mode 100644 (file)
index 0000000..aae9420
--- /dev/null
@@ -0,0 +1,211 @@
+" Vim color file
+"
+" Author: Tomas Restrepo <tomas@winterdom.com>
+"
+" Note: Based on the monokai theme for textmate
+" by Wimer Hazenberg and its darker variant 
+" by Hamish Stuart Macpherson
+"
+
+hi clear
+
+set background=dark
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+        syntax reset
+    endif
+endif
+let g:colors_name="molokai"
+
+if exists("g:molokai_original")
+    let s:molokai_original = g:molokai_original
+else
+    let s:molokai_original = 0
+endif
+
+
+hi Boolean         guifg=#AE81FF
+hi Character       guifg=#E6DB74
+hi Number          guifg=#AE81FF
+hi String          guifg=#E6DB74
+hi Conditional     guifg=#F92672               gui=bold
+hi Constant        guifg=#AE81FF               gui=bold
+hi Cursor          guifg=#000000 guibg=#F8F8F0
+hi Debug           guifg=#BCA3A3               gui=bold
+hi Define          guifg=#66D9EF
+hi Delimiter       guifg=#8F8F8F
+hi DiffAdd                       guibg=#13354A
+hi DiffChange      guifg=#89807D guibg=#4C4745
+hi DiffDelete      guifg=#960050 guibg=#1E0010
+hi DiffText                      guibg=#4C4745 gui=italic,bold
+
+hi Directory       guifg=#A6E22E               gui=bold
+hi Error           guifg=#960050 guibg=#1E0010
+hi ErrorMsg        guifg=#F92672 guibg=#232526 gui=bold
+hi Exception       guifg=#A6E22E               gui=bold
+hi Float           guifg=#AE81FF
+hi FoldColumn      guifg=#465457 guibg=#000000
+hi Folded          guifg=#465457 guibg=#000000
+hi Function        guifg=#A6E22E
+hi Identifier      guifg=#FD971F
+hi Ignore          guifg=#808080 guibg=bg
+hi IncSearch       guifg=#C4BE89 guibg=#000000
+
+hi Keyword         guifg=#F92672               gui=bold
+hi Label           guifg=#E6DB74               gui=none
+hi Macro           guifg=#C4BE89               gui=italic
+hi SpecialKey      guifg=#66D9EF               gui=italic
+
+hi MatchParen      guifg=#000000 guibg=#FD971F gui=bold
+hi ModeMsg         guifg=#E6DB74
+hi MoreMsg         guifg=#E6DB74
+hi Operator        guifg=#F92672
+
+" complete menu
+hi Pmenu           guifg=#66D9EF guibg=#000000
+hi PmenuSel                      guibg=#808080
+hi PmenuSbar                     guibg=#080808
+hi PmenuThumb      guifg=#66D9EF
+
+hi PreCondit       guifg=#A6E22E               gui=bold
+hi PreProc         guifg=#A6E22E
+hi Question        guifg=#66D9EF
+hi Repeat          guifg=#F92672               gui=bold
+hi Search          guifg=#FFFFFF guibg=#455354
+" marks column
+hi SignColumn      guifg=#A6E22E guibg=#232526
+hi SpecialChar     guifg=#F92672               gui=bold
+hi SpecialComment  guifg=#465457               gui=bold
+hi Special         guifg=#66D9EF guibg=bg      gui=italic
+hi SpecialKey      guifg=#888A85               gui=italic
+if has("spell")
+    hi SpellBad    guisp=#FF0000 gui=undercurl
+    hi SpellCap    guisp=#7070F0 gui=undercurl
+    hi SpellLocal  guisp=#70F0F0 gui=undercurl
+    hi SpellRare   guisp=#FFFFFF gui=undercurl
+endif
+hi Statement       guifg=#F92672               gui=bold
+hi StatusLine      guifg=#455354 guibg=fg
+hi StatusLineNC    guifg=#808080 guibg=#080808
+hi StorageClass    guifg=#FD971F               gui=italic
+hi Structure       guifg=#66D9EF
+hi Tag             guifg=#F92672               gui=italic
+hi Title           guifg=#ef5939
+hi Todo            guifg=#FFFFFF guibg=bg      gui=bold
+
+hi Typedef         guifg=#66D9EF
+hi Type            guifg=#66D9EF               gui=none
+hi Underlined      guifg=#808080               gui=underline
+
+hi VertSplit       guifg=#808080 guibg=#080808 gui=bold
+hi VisualNOS                     guibg=#403D3D
+hi Visual                        guibg=#403D3D
+hi WarningMsg      guifg=#FFFFFF guibg=#333333 gui=bold
+hi WildMenu        guifg=#66D9EF guibg=#000000
+
+if s:molokai_original == 1
+   hi Normal          guifg=#F8F8F2 guibg=#272822
+   hi Comment         guifg=#75715E
+   hi CursorLine                    guibg=#3E3D32
+   hi CursorColumn                  guibg=#3E3D32
+   hi LineNr          guifg=#BCBCBC guibg=#3B3A32
+   hi NonText         guifg=#BCBCBC guibg=#3B3A32
+else
+   hi Normal          guifg=#F8F8F2 guibg=#1B1D1E
+   hi Comment         guifg=#465457
+   hi CursorLine                    guibg=#293739
+   hi CursorColumn                  guibg=#293739
+   hi LineNr          guifg=#BCBCBC guibg=#232526
+   hi NonText         guifg=#BCBCBC guibg=#232526
+end
+
+"
+" Support for 256-color terminal
+"
+if &t_Co > 255
+   hi Boolean         ctermfg=135
+   hi Character       ctermfg=144
+   hi Number          ctermfg=135
+   hi String          ctermfg=144
+   hi Conditional     ctermfg=161               cterm=bold
+   hi Constant        ctermfg=135               cterm=bold
+   hi Cursor          ctermfg=16  ctermbg=253
+   hi Debug           ctermfg=225               cterm=bold
+   hi Define          ctermfg=81
+   hi Delimiter       ctermfg=241
+
+   hi DiffAdd                     ctermbg=24
+   hi DiffChange      ctermfg=181 ctermbg=239
+   hi DiffDelete      ctermfg=162 ctermbg=53
+   hi DiffText                    ctermbg=102 cterm=bold
+
+   hi Directory       ctermfg=118               cterm=bold
+   hi Error           ctermfg=219 ctermbg=89
+   hi ErrorMsg        ctermfg=199 ctermbg=16    cterm=bold
+   hi Exception       ctermfg=118               cterm=bold
+   hi Float           ctermfg=135
+   hi FoldColumn      ctermfg=67  ctermbg=16
+   hi Folded          ctermfg=67  ctermbg=16
+   hi Function        ctermfg=118
+   hi Identifier      ctermfg=208
+   hi Ignore          ctermfg=244 ctermbg=232
+   hi IncSearch       ctermfg=193 ctermbg=16
+
+   hi Keyword         ctermfg=161               cterm=bold
+   hi Label           ctermfg=229               cterm=none
+   hi Macro           ctermfg=193
+   hi SpecialKey      ctermfg=81
+
+   hi MatchParen      ctermfg=16  ctermbg=208 cterm=bold
+   hi ModeMsg         ctermfg=229
+   hi MoreMsg         ctermfg=229
+   hi Operator        ctermfg=161
+
+   " complete menu
+   hi Pmenu           ctermfg=81  ctermbg=16
+   hi PmenuSel                    ctermbg=244
+   hi PmenuSbar                   ctermbg=232
+   hi PmenuThumb      ctermfg=81
+
+   hi PreCondit       ctermfg=118               cterm=bold
+   hi PreProc         ctermfg=118
+   hi Question        ctermfg=81
+   hi Repeat          ctermfg=161               cterm=bold
+   hi Search          ctermfg=253 ctermbg=66
+
+   " marks column
+   hi SignColumn      ctermfg=118 ctermbg=235
+   hi SpecialChar     ctermfg=161               cterm=bold
+   hi SpecialComment  ctermfg=245               cterm=bold
+   hi Special         ctermfg=81  ctermbg=232
+   hi SpecialKey      ctermfg=245
+
+   hi Statement       ctermfg=161               cterm=bold
+   hi StatusLine      ctermfg=238 ctermbg=253
+   hi StatusLineNC    ctermfg=244 ctermbg=232
+   hi StorageClass    ctermfg=208
+   hi Structure       ctermfg=81
+   hi Tag             ctermfg=161
+   hi Title           ctermfg=166
+   hi Todo            ctermfg=231 ctermbg=232   cterm=bold
+
+   hi Typedef         ctermfg=81
+   hi Type            ctermfg=81                cterm=none
+   hi Underlined      ctermfg=244               cterm=underline
+
+   hi VertSplit       ctermfg=244 ctermbg=232   cterm=bold
+   hi VisualNOS                   ctermbg=238
+   hi Visual                      ctermbg=235
+   hi WarningMsg      ctermfg=231 ctermbg=238   cterm=bold
+   hi WildMenu        ctermfg=81  ctermbg=16
+
+   hi Normal          ctermfg=252 ctermbg=233
+   hi Comment         ctermfg=59
+   hi CursorLine                  ctermbg=234   cterm=none
+   hi CursorColumn                ctermbg=234
+   hi LineNr          ctermfg=250 ctermbg=234
+   hi NonText         ctermfg=250 ctermbg=234
+end
diff --git a/vim/colors/moria.vim b/vim/colors/moria.vim
new file mode 100644 (file)
index 0000000..6562cb7
--- /dev/null
@@ -0,0 +1,247 @@
+if exists("g:moria_style")
+    let s:moria_style = g:moria_style
+else
+    let s:moria_style = &background
+endif
+
+if exists("g:moria_monochrome")
+    let s:moria_monochrome = g:moria_monochrome
+else
+    let s:moria_monochrome = 0
+endif
+
+if exists("g:moria_fontface")
+    let s:moria_fontface = g:moria_fontface
+else
+    let s:moria_fontface = "plain"
+endif
+
+execute "command! -nargs=1 Colo let g:moria_style = \"<args>\" | colo moria"
+
+if s:moria_style == "black" || s:moria_style == "dark"
+    set background=dark
+elseif s:moria_style == "light" || s:moria_style == "white"
+    set background=light
+else
+    let s:moria_style = &background 
+endif
+
+hi clear
+
+if exists("syntax_on")
+    syntax reset
+endif
+
+let colors_name = "moria"
+
+if &background == "dark"
+    if s:moria_style == "dark"
+        hi Normal ctermbg=Black ctermfg=LightGray guibg=#202020 guifg=#d0d0d0 gui=none
+
+        hi CursorColumn ctermbg=DarkGray ctermfg=White guibg=#404040 gui=none
+        hi CursorLine ctermbg=DarkGray ctermfg=White guibg=#404040 gui=none
+    elseif s:moria_style == "black"
+        hi Normal ctermbg=Black ctermfg=LightGray guibg=#000000 guifg=#d0d0d0 gui=none
+
+        hi CursorColumn ctermbg=DarkGray ctermfg=White guibg=#3a3a3a gui=none
+        hi CursorLine ctermbg=DarkGray ctermfg=White guibg=#3a3a3a gui=none
+    endif
+    if s:moria_monochrome == 1
+        hi FoldColumn ctermbg=bg guibg=bg guifg=#a0a0a0 gui=none
+        hi LineNr guifg=#a0a0a0 gui=none
+        hi MoreMsg guibg=bg guifg=#b6b6b6 gui=bold
+        hi NonText ctermfg=DarkGray guibg=bg guifg=#a0a0a0 gui=bold
+        hi Pmenu guibg=#909090 guifg=#000000 gui=none
+        hi PmenuSbar guibg=#707070 guifg=fg gui=none
+        hi PmenuThumb guibg=#d0d0d0 guifg=bg gui=none
+        hi SignColumn ctermbg=bg guibg=bg guifg=#a0a0a0 gui=none
+        hi StatusLine ctermbg=LightGray ctermfg=Black guibg=#4c4c4c guifg=fg gui=bold
+        hi StatusLineNC ctermbg=DarkGray ctermfg=Black guibg=#404040 guifg=fg gui=none
+        hi TabLine guibg=#6e6e6e guifg=fg gui=underline
+        hi TabLineFill guibg=#6e6e6e guifg=fg gui=underline
+        hi VertSplit ctermbg=LightGray ctermfg=Black guibg=#404040 guifg=fg gui=none
+        if s:moria_fontface == "mixed"
+            hi Folded guibg=#4e4e4e guifg=#c0c0c0 gui=bold
+        else
+            hi Folded guibg=#4e4e4e guifg=#c0c0c0 gui=none
+        endif            
+    else
+        hi FoldColumn ctermbg=bg guibg=bg guifg=#8fa5d1 gui=none
+        hi LineNr guifg=#8fa5d1 gui=none
+        hi MoreMsg guibg=bg guifg=#97abd5 gui=bold
+        hi NonText ctermfg=DarkGray guibg=bg guifg=#8fa5d1 gui=bold
+        hi Pmenu guibg=#6381be guifg=#000000 gui=none
+        hi PmenuSbar guibg=#41609e guifg=fg gui=none
+        hi PmenuThumb guibg=#bdcae3 guifg=bg gui=none
+        hi SignColumn ctermbg=bg guibg=bg guifg=#8fa5d1 gui=none
+        hi StatusLine ctermbg=LightGray ctermfg=Black guibg=#334b7d guifg=fg gui=bold
+        hi StatusLineNC ctermbg=DarkGray ctermfg=Black guibg=#25365a guifg=fg gui=none
+        hi TabLine guibg=#41609e guifg=fg gui=underline
+        hi TabLineFill guibg=#41609e guifg=fg gui=underline
+        hi VertSplit ctermbg=LightGray ctermfg=Black guibg=#25365a guifg=fg gui=none
+        if s:moria_fontface == "mixed"
+            hi Folded guibg=#4e4e4e guifg=#bdcae3 gui=bold
+        else
+            hi Folded guibg=#4e4e4e guifg=#bdcae3 gui=none
+        endif            
+    endif
+    hi Cursor guibg=#ffa500 guifg=bg gui=none
+    hi DiffAdd guibg=#008b00 guifg=fg gui=none
+    hi DiffChange guibg=#00008b guifg=fg gui=none
+    hi DiffDelete guibg=#8b0000 guifg=fg gui=none
+    hi DiffText guibg=#0000cd guifg=fg gui=bold
+    hi Directory guibg=bg guifg=#1e90ff gui=none
+    hi ErrorMsg guibg=#ee2c2c guifg=#ffffff gui=bold
+    hi IncSearch guibg=#e0cd78 guifg=#000000 gui=none
+    hi ModeMsg guibg=bg guifg=fg gui=bold
+    hi PmenuSel guibg=#e0e000 guifg=#000000 gui=none
+    hi Question guibg=bg guifg=#e8b87e gui=bold
+    hi Search guibg=#90e090 guifg=#000000 gui=none
+    hi SpecialKey guibg=bg guifg=#e8b87e gui=none
+    if has("spell")
+        hi SpellBad guisp=#ee2c2c gui=undercurl
+        hi SpellCap guisp=#2c2cee gui=undercurl
+        hi SpellLocal guisp=#2ceeee gui=undercurl
+        hi SpellRare guisp=#ee2cee gui=undercurl
+    endif
+    hi TabLineSel guibg=bg guifg=fg gui=bold
+    hi Title ctermbg=Black ctermfg=White guifg=fg gui=bold
+    if version >= 700
+        hi Visual ctermbg=LightGray ctermfg=Black guibg=#606060 gui=none
+    else
+        hi Visual ctermbg=LightGray ctermfg=Black guibg=#606060 guifg=fg gui=none
+    endif
+    hi VisualNOS ctermbg=DarkGray ctermfg=Black guibg=bg guifg=#a0a0a0 gui=bold,underline
+    hi WarningMsg guibg=bg guifg=#ee2c2c gui=bold
+    hi WildMenu guibg=#e0e000 guifg=#000000 gui=bold
+
+    hi Comment guibg=bg guifg=#d0d0a0 gui=none
+    hi Constant guibg=bg guifg=#87df71 gui=none
+    hi Error guibg=bg guifg=#ee2c2c gui=none
+    hi Identifier guibg=bg guifg=#7ee0ce gui=none
+    hi Ignore guibg=bg guifg=bg gui=none
+    hi lCursor guibg=#00e700 guifg=#000000 gui=none
+    hi MatchParen guibg=#008b8b gui=none
+    hi PreProc guibg=bg guifg=#d7a0d7 gui=none
+    hi Special guibg=bg guifg=#e8b87e gui=none
+    hi Todo guibg=#e0e000 guifg=#000000 gui=none
+    hi Underlined ctermbg=Black ctermfg=White guibg=bg guifg=#00a0ff gui=underline    
+
+    if s:moria_fontface == "mixed"
+        hi Statement guibg=bg guifg=#7ec0ee gui=bold
+        hi Type guibg=bg guifg=#f09479 gui=bold
+    else
+        hi Statement guibg=bg guifg=#7ec0ee gui=none
+        hi Type guibg=bg guifg=#f09479 gui=none
+    endif
+
+    hi htmlBold ctermbg=Black ctermfg=White guibg=bg guifg=fg gui=bold
+    hi htmlBoldItalic ctermbg=Black ctermfg=White guibg=bg guifg=fg gui=bold,italic
+    hi htmlBoldUnderline ctermbg=Black ctermfg=White guibg=bg guifg=fg gui=bold,underline
+    hi htmlBoldUnderlineItalic ctermbg=Black ctermfg=White guibg=bg guifg=fg gui=bold,underline,italic
+    hi htmlItalic ctermbg=Black ctermfg=White guibg=bg guifg=fg gui=italic
+    hi htmlUnderline ctermbg=Black ctermfg=White guibg=bg guifg=fg gui=underline
+    hi htmlUnderlineItalic ctermbg=Black ctermfg=White guibg=bg guifg=fg gui=underline,italic
+elseif &background == "light"
+    if s:moria_style == "light"
+        hi Normal ctermbg=White ctermfg=Black guibg=#f0f0f0 guifg=#000000 gui=none
+
+        hi CursorColumn ctermbg=LightGray ctermfg=Black guibg=#d8d8d8 gui=none
+        hi CursorLine ctermbg=LightGray ctermfg=Black guibg=#d8d8d8 gui=none
+    elseif s:moria_style == "white"
+        hi Normal ctermbg=White ctermfg=Black guibg=#ffffff guifg=#000000 gui=none
+
+        hi CursorColumn ctermbg=LightGray ctermfg=Black guibg=#dfdfdf gui=none
+        hi CursorLine ctermbg=LightGray ctermfg=Black guibg=#dfdfdf gui=none
+    endif
+    if s:moria_monochrome == 1
+        hi FoldColumn ctermbg=bg guibg=bg guifg=#7a7a7a gui=none
+        hi Folded guibg=#cfcfcf guifg=#404040 gui=bold
+        hi LineNr guifg=#7a7a7a gui=none
+        hi MoreMsg guibg=bg guifg=#505050 gui=bold
+        hi NonText ctermfg=DarkGray guibg=bg guifg=#7a7a7a gui=bold
+        hi Pmenu guibg=#9a9a9a guifg=#000000 gui=none
+        hi PmenuSbar guibg=#808080 guifg=fg gui=none
+        hi PmenuThumb guibg=#c0c0c0 guifg=fg gui=none
+        hi SignColumn ctermbg=bg guibg=bg guifg=#7a7a7a gui=none
+        hi StatusLine ctermbg=Black ctermfg=White guibg=#a0a0a0 guifg=fg gui=bold
+        hi StatusLineNC ctermbg=LightGray ctermfg=Black guibg=#b0b0b0 guifg=fg gui=none
+        hi TabLine guibg=#cdcdcd guifg=fg gui=underline
+        hi TabLineFill guibg=#cdcdcd guifg=fg gui=underline
+        hi VertSplit ctermbg=LightGray ctermfg=Black guibg=#b0b0b0 guifg=fg gui=none
+    else
+        hi FoldColumn ctermbg=bg guibg=bg guifg=#375288 gui=none
+        hi Folded guibg=#cfcfcf guifg=#25365a gui=bold
+        hi LineNr guifg=#375288 gui=none
+        hi MoreMsg guibg=bg guifg=#2f4471 gui=bold
+        hi NonText ctermfg=DarkGray guibg=bg guifg=#375288 gui=bold
+        hi Pmenu guibg=#708bc5 guifg=#000000 gui=none
+        hi PmenuSbar guibg=#4a6db5 guifg=fg gui=none
+        hi PmenuThumb guibg=#a6b7db guifg=fg gui=none
+        hi SignColumn ctermbg=bg guibg=bg guifg=#375288 gui=none
+        hi StatusLine ctermbg=Black ctermfg=White guibg=#8fa5d1 guifg=fg gui=bold
+        hi StatusLineNC ctermbg=LightGray ctermfg=Black guibg=#a6b7db guifg=fg gui=none
+        hi TabLine guibg=#b8c6e2 guifg=fg gui=underline
+        hi TabLineFill guibg=#b8c6e2 guifg=fg gui=underline
+        hi VertSplit ctermbg=LightGray ctermfg=Black guibg=#a6b7db guifg=fg gui=none
+    endif
+    hi Cursor guibg=#883400 guifg=bg gui=none
+    hi DiffAdd guibg=#008b00 guifg=#ffffff gui=none
+    hi DiffChange guibg=#00008b guifg=#ffffff gui=none
+    hi DiffDelete guibg=#8b0000 guifg=#ffffff gui=none
+    hi DiffText guibg=#0000cd guifg=#ffffff gui=bold
+    hi Directory guibg=bg guifg=#0000f0 gui=none
+    hi ErrorMsg guibg=#ee2c2c guifg=#ffffff gui=bold
+    hi IncSearch guibg=#ffcd78 gui=none
+    hi ModeMsg ctermbg=White ctermfg=Black guibg=bg guifg=fg gui=bold
+    hi PmenuSel guibg=#ffff00 guifg=#000000 gui=none
+    hi Question guibg=bg guifg=#813f11 gui=bold
+    hi Search guibg=#a0f0a0 gui=none
+    hi SpecialKey guibg=bg guifg=#912f11 gui=none
+    if has("spell")
+        hi SpellBad guisp=#ee2c2c gui=undercurl
+        hi SpellCap guisp=#2c2cee gui=undercurl
+        hi SpellLocal guisp=#008b8b gui=undercurl
+        hi SpellRare guisp=#ee2cee gui=undercurl
+    endif
+    hi TabLineSel guibg=bg guifg=fg gui=bold
+    hi Title guifg=fg gui=bold
+    if version >= 700
+        hi Visual ctermbg=LightGray ctermfg=Black guibg=#c4c4c4 gui=none
+    else
+        hi Visual ctermbg=LightGray ctermfg=Black guibg=#c4c4c4 guifg=fg gui=none
+    endif    
+    hi VisualNOS ctermbg=DarkGray ctermfg=Black guibg=bg guifg=#a0a0a0 gui=bold,underline
+    hi WarningMsg guibg=bg guifg=#ee2c2c gui=bold
+    hi WildMenu guibg=#ffff00 guifg=fg gui=bold
+
+    hi Comment guibg=bg guifg=#786000 gui=none
+    hi Constant guibg=bg guifg=#077807 gui=none
+    hi Error guibg=bg guifg=#ee2c2c gui=none
+    hi Identifier guibg=bg guifg=#007080 gui=none
+    hi Ignore guibg=bg guifg=bg gui=none
+    hi lCursor guibg=#008000 guifg=#ffffff gui=none
+    hi MatchParen guibg=#00ffff gui=none
+    hi PreProc guibg=bg guifg=#800090 gui=none
+    hi Special guibg=bg guifg=#912f11 gui=none
+    hi Statement guibg=bg guifg=#1f3f81 gui=bold
+    hi Todo guibg=#ffff00 guifg=fg gui=none
+    hi Type guibg=bg guifg=#912f11 gui=bold
+    hi Underlined ctermbg=White ctermfg=Black guibg=bg guifg=#0000cd gui=underline
+
+    hi htmlBold ctermbg=White ctermfg=Black guibg=bg guifg=fg gui=bold
+    hi htmlBoldItalic ctermbg=White ctermfg=Black guibg=bg guifg=fg gui=bold,italic
+    hi htmlBoldUnderline ctermbg=White ctermfg=Black guibg=bg guifg=fg gui=bold,underline
+    hi htmlBoldUnderlineItalic ctermbg=White ctermfg=Black guibg=bg guifg=fg gui=bold,underline,italic
+    hi htmlItalic ctermbg=White ctermfg=Black guibg=bg guifg=fg gui=italic
+    hi htmlUnderline ctermbg=White ctermfg=Black guibg=bg guifg=fg gui=underline
+    hi htmlUnderlineItalic ctermbg=White ctermfg=Black guibg=bg guifg=fg gui=underline,italic
+endif
+
+hi! default link bbcodeBold htmlBold
+hi! default link bbcodeBoldItalic htmlBoldItalic
+hi! default link bbcodeBoldItalicUnderline htmlBoldUnderlineItalic
+hi! default link bbcodeBoldUnderline htmlBoldUnderline
+hi! default link bbcodeItalic htmlItalic
+hi! default link bbcodeItalicUnderline htmlUnderlineItalic
+hi! default link bbcodeUnderline htmlUnderline
diff --git a/vim/colors/moss.vim b/vim/colors/moss.vim
new file mode 100644 (file)
index 0000000..fa8f47c
--- /dev/null
@@ -0,0 +1,109 @@
+" ------------------------------------------------------------------
+" Vim color file
+" Name: moss (่‹”)
+" Maintainer: Li Chunlin <yeiicn!gmail.com>
+" Last Change: 2009-10-15
+" Version: 2.0
+" URL: http://vim.sourceforge.net/script.php?script_id=2779
+" ------------------------------------------------------------------
+
+" Init
+" ------------------------------------------------------------------
+set background=dark
+highlight clear
+if exists("syntax_on")
+   syntax reset
+endif
+let g:colors_name = "moss"
+
+" Highlighting groups for various occasions
+" ------------------------------------------------------------------
+hi SpecialKey   guifg=RosyBrown4
+hi NonText      guifg=MidnightBlue guibg=#0C2628
+hi Directory    gui=BOLD guifg=DarkOliveGreen3
+hi ErrorMsg     guifg=LightGoldenRod guibg=Firebrick
+hi IncSearch    gui=BOLD guifg=Firebrick1
+hi Search       gui=REVERSE guifg=NONE guibg=NONE
+hi MoreMsg      guifg=DarkCyan
+hi ModeMsg      guifg=OliveDrab2
+hi LineNr       guifg=DarkSeaGreen3 guibg=#0C2628
+hi Question     guifg=Green
+hi StatusLine   gui=BOLD guifg=LemonChiffon3 guibg=#334680
+hi StatusLineNC gui=BOLD guifg=Honeydew4 guibg=Gray26
+hi VertSplit    gui=BOLD guifg=Gray20 guibg=Gray26
+hi Title        gui=BOLD guifg=RoyalBlue3
+hi Visual       guifg=PowderBlue guibg=#22364C
+hi VisualNOS    gui=BOLD,UNDERLINE guifg=SlateGray
+hi WarningMsg   guifg=Gold
+hi WildMenu     gui=BOLD guifg=Black guibg=Chartreuse3
+hi Folded       guifg=PaleGreen3 guibg=DarkSlateGray
+hi FoldColumn   gui=BOLD guifg=PaleGreen3 guibg=DarkSlateGray
+hi DiffAdd      guifg=SandyBrown guibg=DarkOliveGreen
+hi DiffChange   guibg=#3C444C
+hi DiffDelete   guifg=Gray20 guibg=Black
+hi DiffText     guifg=Chocolate guibg=#033B40
+
+" new Vim 7.0 items
+if v:version >= 700
+   hi CursorColumn guibg=#063C36
+   hi CursorLine   guibg=#063C36
+   hi SignColumn   guifg=PaleGoldenrod guibg=Turquoise4
+   hi TabLine      guifg=CornflowerBlue guibg=Gray26
+   hi TabLineSel   guifg=RoyalBlue guibg=#082926
+   hi TabLineFill  gui=UNDERLINE guifg=CornflowerBlue guibg=Gray20
+   hi Pmenu        guifg=White guibg=MediumPurple4
+   hi PmenuSel     guifg=Wheat guibg=#22364C
+   hi PmenuSbar    guifg=Tan   guibg=SeaShell4
+   hi PmenuThumb   guifg=IndianRed   guibg=SeaShell4
+   hi MatchParen   gui=BOLD guifg=GoldenRod guibg=DarkCyan
+endif
+
+hi Cursor       guifg=Black guibg=LimeGreen
+hi CursorIM     guifg=Black guibg=OrangeRed
+
+" Syntax highlighting groups
+" ------------------------------------------------------------------
+
+hi Normal      gui=NONE guifg=LightBlue3 guibg=#082926
+hi Comment     gui=ITALIC guifg=BurlyWood4
+
+hi Constant    gui=NONE guifg=CadetBlue3
+hi link        String    Constant
+hi link        Character Constant
+hi Number      gui=NONE guifg=Turquoise3
+hi link        Boolean Number
+hi link        Float   Number
+
+hi Identifier  gui=NONE guifg=SteelBlue3
+hi Function    gui=NONE guifg=Aquamarine3
+
+hi Statement   gui=NONE guifg=SpringGreen3
+hi link        Conditional Statement
+hi link        Repeat      Statement
+hi link        Label       Statement
+hi Operator    gui=NONE guifg=SeaGreen3
+hi link        Keyword     Statement
+hi link        Exception   Statement
+
+hi PreProc     gui=NONE guifg=DodgerBlue3
+hi link        Include   PreProc
+hi link        Define    PreProc
+hi link        Macro     PreProc
+hi link        PreCondit PreProc
+
+hi Type        gui=NONE guifg=DeepSkyBlue3
+hi link        StorageClass Type
+hi link        Structure    Type
+hi link        Typedef      Type
+
+hi Special     gui=NONE guifg=SlateBlue
+hi link        Specialchar Special
+hi link        Tag         Special
+hi link        Delimiter   Special
+hi link        Debug       Special
+
+hi Underlined  gui=UNDERLINE guifg=SkyBlue3
+hi Ignore      gui=NONE guifg=Gray18
+hi Error       gui=NONE guifg=Khaki3 guibg=VioletRed4
+hi Todo        gui=BOLD guifg=GoldenRod3 guibg=NONE
+
diff --git a/vim/colors/motus.vim b/vim/colors/motus.vim
new file mode 100644 (file)
index 0000000..146e88d
--- /dev/null
@@ -0,0 +1,66 @@
+" Vim color file
+" Dark (grey on black) color scheme based on on a popular torte config.
+" Maintainer: Sergei Matusevich <motus@motus.kiev.ua>
+" ICQ: 31114346 Yahoo: motus2
+" http://motus.kiev.ua/motus2/Files/motus.vim
+" Last Change: 3 November 2005
+" Orinal torte screme maintainer: Thorsten Maerz <info@netztorte.de>
+" Licence: Public Domain
+
+" INSTALLATION: copy this file to ~/.vim/colors/ directory
+" and add "colorscheme motus" to your ~/.vimrc file
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+"colorscheme default
+let g:colors_name = "motus"
+
+" hardcoded colors :
+" GUI Comment : #80a0ff = Light blue
+
+" GUI
+highlight Normal     guifg=Grey80      guibg=Black
+highlight Search     guifg=Grey guibg=DarkBlue
+highlight Visual     guifg=Black guibg=DarkGrey gui=NONE
+" highlight Cursor     guifg=Black     guibg=Green     gui=bold
+highlight Special    guifg=Orange
+highlight Comment    guifg=#80a0ff
+highlight Statement  guifg=Yellow                      gui=NONE
+highlight Type                                         gui=NONE
+
+highlight VertSplit    gui=bold guifg=Grey25    guibg=Black
+highlight StatusLine   gui=bold guifg=White     guibg=Grey25
+highlight StatusLineNC gui=NONE guifg=LightGrey guibg=Grey25
+
+highlight FoldColumn    gui=bold guifg=White guibg=Black
+
+" Console
+highlight Normal     ctermfg=LightGrey ctermbg=Black
+highlight Search     ctermfg=Grey      ctermbg=DarkBlue        cterm=NONE
+highlight Visual                                       cterm=reverse
+" highlight Cursor     ctermfg=Black   ctermbg=Green   cterm=bold
+highlight Special    ctermfg=Brown
+highlight Comment    ctermfg=Blue
+highlight Statement  ctermfg=Yellow                    cterm=NONE
+highlight Type                                         cterm=NONE
+
+highlight VertSplit    ctermfg=DarkGrey   ctermbg=Black cterm=bold
+highlight StatusLine   ctermfg=White  ctermbg=Grey cterm=bold
+highlight StatusLineNC ctermfg=Black  ctermbg=Grey cterm=NONE
+
+highlight FoldColumn   ctermbg=Black           ctermfg=White cterm=bold
+
+" only for vim 5
+if has("unix")
+  if v:version<600
+    highlight Normal  ctermfg=Grey     ctermbg=Black   cterm=NONE      guifg=Grey80      guibg=Black   gui=NONE
+    highlight Search  ctermfg=Black    ctermbg=Red     cterm=bold      guifg=Black       guibg=Red     gui=bold
+    highlight Visual  ctermfg=Black    ctermbg=yellow  cterm=bold      guifg=Grey25                    gui=bold
+    highlight Special ctermfg=LightBlue                        cterm=NONE      guifg=LightBlue                 gui=NONE
+    highlight Comment ctermfg=Cyan                     cterm=NONE      guifg=LightBlue                 gui=NONE
+  endif
+endif
+
diff --git a/vim/colors/mustang.vim b/vim/colors/mustang.vim
new file mode 100644 (file)
index 0000000..98cf18e
--- /dev/null
@@ -0,0 +1,57 @@
+" Maintainer:  Henrique C. Alves (hcarvalhoalves@gmail.com)
+" Version:      1.0
+" Last Change: September 25 2008
+
+set background=dark
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "mustang"
+
+" Vim >= 7.0 specific colors
+if version >= 700
+  hi CursorLine guibg=#2d2d2d ctermbg=236
+  hi CursorColumn guibg=#2d2d2d ctermbg=236
+  hi MatchParen guifg=#d0ffc0 guibg=#2f2f2f gui=bold ctermfg=157 ctermbg=237 cterm=bold
+  hi Pmenu             guifg=#ffffff guibg=#444444 ctermfg=255 ctermbg=238
+  hi PmenuSel  guifg=#000000 guibg=#b1d631 ctermfg=0 ctermbg=148
+endif
+
+" General colors
+hi Cursor              guifg=NONE    guibg=#626262 gui=none ctermbg=241
+hi Normal              guifg=#e2e2e5 guibg=#202020 gui=none ctermfg=253 ctermbg=234
+hi NonText             guifg=#808080 guibg=#303030 gui=none ctermfg=244 ctermbg=235
+hi LineNr              guifg=#808080 guibg=#000000 gui=none ctermfg=244 ctermbg=232
+hi StatusLine  guifg=#d3d3d5 guibg=#444444 gui=italic ctermfg=253 ctermbg=238 cterm=italic
+hi StatusLineNC guifg=#939395 guibg=#444444 gui=none ctermfg=246 ctermbg=238
+hi VertSplit   guifg=#444444 guibg=#444444 gui=none ctermfg=238 ctermbg=238
+hi Folded              guibg=#384048 guifg=#a0a8b0 gui=none ctermbg=4 ctermfg=248
+hi Title               guifg=#f6f3e8 guibg=NONE        gui=bold ctermfg=254 cterm=bold
+hi Visual              guifg=#faf4c6 guibg=#3c414c gui=none ctermfg=254 ctermbg=4
+hi SpecialKey  guifg=#808080 guibg=#343434 gui=none ctermfg=244 ctermbg=236
+
+" Syntax highlighting
+hi Comment             guifg=#808080 gui=italic ctermfg=244
+hi Todo                guifg=#8f8f8f gui=italic ctermfg=245
+hi Boolean      guifg=#b1d631 gui=none ctermfg=148
+hi String              guifg=#b1d631 gui=italic ctermfg=148
+hi Identifier  guifg=#b1d631 gui=none ctermfg=148
+hi Function    guifg=#ffffff gui=bold ctermfg=255
+hi Type                guifg=#7e8aa2 gui=none ctermfg=103
+hi Statement   guifg=#7e8aa2 gui=none ctermfg=103
+hi Keyword             guifg=#ff9800 gui=none ctermfg=208
+hi Constant    guifg=#ff9800 gui=none  ctermfg=208
+hi Number              guifg=#ff9800 gui=none ctermfg=208
+hi Special             guifg=#ff9800 gui=none ctermfg=208
+hi PreProc             guifg=#faf4c6 gui=none ctermfg=230
+hi Todo         guifg=#000000 guibg=#e6ea50 gui=italic
+
+" Code-specific colors
+hi pythonOperator guifg=#7e8aa2 gui=none ctermfg=103
+
+hi Search     guifg=white      guibg=NONE      cterm=NONE      gui=underline
+
diff --git a/vim/colors/navajo-night.vim b/vim/colors/navajo-night.vim
new file mode 100644 (file)
index 0000000..f0c27f0
--- /dev/null
@@ -0,0 +1,119 @@
+" Vim colour file
+" Maintainer: Matthew Hawkins <matt@mh.dropbear.id.au>
+" Last Change: Mon, 22 Apr 2002 15:28:04 +1000
+" URI: http://mh.dropbear.id.au/vim/navajo-night.png
+"
+" This colour scheme uses a "navajo-black" background
+" I have added colours for the statusbar and for spell checking 
+" as taken from Cream (http://cream.sf.net/) 
+
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "navajo-night"
+
+" This is the list of colour changes from Navajo that
+" weren't a simple mathematical subtraction from 0xffffff
+" DarkBlue -> #ffff74
+" DarkRed -> #74ffff 
+" DarkGreen -> #ff9bff 
+" DarkCyan -> #ff7474 
+" DarkMagenta -> #74ff74 
+" DarkYellow -> #7474ff 
+" DarkGray -> #565656 
+" Blue -> Yellow
+" Red -> Cyan 
+" Yellow -> Blue 
+" Gray -> #414141 
+" Brown -> #5ad5d5 
+" #ff8060 -> #007f9f 
+" #f6e8d0 -> #09172f 
+" #edb5cd -> #124a32 
+" #c0c0c0 -> #3f3f3f 
+" #907050 -> #6f8faf 
+" #808080 -> #7f7f7f
+" #707070 -> #8f8f8f
+" SeaGreen -> #d174a8 
+" LightRed (assuming #ee9090) -> #116f6f 
+" LightBlue -> #522719 
+
+hi Normal ctermfg=White guifg=White guibg=#35536f
+
+hi SpecialKey term=bold ctermfg=darkblue guifg=Yellow
+hi NonText term=bold ctermfg=darkblue cterm=bold gui=bold guifg=#7f7f7f
+hi Directory term=bold ctermfg=darkblue guifg=Yellow
+hi ErrorMsg term=standout ctermfg=grey ctermbg=darkred cterm=bold gui=bold guifg=Black guibg=Cyan
+hi IncSearch term=reverse cterm=reverse gui=reverse
+hi Search term=reverse ctermbg=White ctermfg=Black cterm=reverse guibg=Black guifg=Yellow
+hi MoreMsg term=bold ctermfg=green gui=bold guifg=#d174a8
+hi ModeMsg term=bold cterm=bold gui=bold
+hi LineNr term=underline ctermfg=darkcyan ctermbg=grey guibg=#7f7f7f gui=bold guifg=White
+hi Question term=standout ctermfg=darkgreen gui=bold guifg=#d174a8
+hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold guifg=Black guibg=White
+hi StatusLineNC term=reverse cterm=reverse gui=bold guifg=#116f6f guibg=#8f8f8f
+hi VertSplit term=reverse cterm=reverse gui=bold guifg=Black guibg=#8f8f8f
+hi Title term=bold ctermfg=green gui=bold guifg=#74ff74
+"+++ Cream:
+"hi Visual term=reverse cterm=reverse gui=reverse guifg=#3f3f3f guibg=White
+"+++
+hi VisualNOS term=bold,underline cterm=bold,underline gui=reverse guifg=#414141 guibg=Black
+hi WarningMsg term=standout ctermfg=darkred gui=bold guifg=Cyan
+hi WildMenu term=standout ctermfg=White ctermbg=darkyellow guifg=White guibg=Blue
+hi Folded term=standout ctermfg=darkblue ctermbg=grey guifg=White guibg=NONE guifg=#afcfef
+hi FoldColumn term=standout ctermfg=darkblue ctermbg=grey guifg=#ffff74 guibg=#3f3f3f
+hi DiffAdd term=bold ctermbg=darkblue guibg=Black
+hi DiffChange term=bold ctermbg=darkmagenta guibg=#124a32
+hi DiffDelete term=bold ctermfg=darkblue ctermbg=blue cterm=bold gui=bold guifg=#522719 guibg=#09172f
+hi DiffText term=reverse ctermbg=darkblue cterm=bold gui=bold guibg=#007f9f
+hi Cursor gui=reverse guifg=#bfbfef guibg=Black
+hi lCursor guifg=fg guibg=bg
+hi Match term=bold,reverse ctermbg=Blue ctermfg=Yellow cterm=bold,reverse gui=bold,reverse guifg=Blue guibg=Yellow
+
+
+" Colours for syntax highlighting
+hi Comment term=bold ctermfg=darkblue guifg=#e7e77f
+hi Constant term=underline ctermfg=darkred guifg=#3fffa7
+hi Special term=bold ctermfg=darkgreen guifg=#bfbfef
+hi Identifier term=underline ctermfg=darkcyan cterm=NONE guifg=#ef9f9f
+hi Statement term=bold ctermfg=darkred cterm=bold gui=bold guifg=#5ad5d5
+hi PreProc term=underline ctermfg=darkmagenta guifg=#74ff74
+hi Type term=underline ctermfg=green gui=bold guifg=#d174a8
+hi Ignore ctermfg=grey cterm=bold guifg=bg
+
+hi Error term=reverse ctermfg=grey ctermbg=darkred cterm=bold gui=bold guifg=Black guibg=Cyan
+hi Todo term=standout ctermfg=darkblue ctermbg=Blue guifg=Yellow guibg=Blue
+
+"+++ Cream: statusbar
+" Colours for statusbar
+"hi User1        gui=bold guifg=#565656  guibg=#0c0c0c
+"hi User2        gui=bold guifg=White     guibg=#0c0c0c
+"hi User3        gui=bold guifg=Yellow      guibg=#0c0c0c
+"hi User4        gui=bold guifg=Cyan       guibg=#0c0c0c
+highlight User1        gui=bold guifg=#999933  guibg=#45637f
+highlight User2        gui=bold guifg=#e7e77f     guibg=#45637f
+highlight User3        gui=bold guifg=Black      guibg=#45637f
+highlight User4        gui=bold guifg=#33cc99       guibg=#45637f
+"+++
+
+"+++ Cream: selection
+highlight Visual    gui=bold    guifg=Black guibg=#aacc77
+"+++
+
+"+++ Cream: bookmarks
+highlight Cream_ShowMarksHL ctermfg=blue ctermbg=lightblue cterm=bold guifg=Black guibg=#aacc77 gui=bold
+"+++
+
+"+++ Cream: spell check
+" Colour misspelt words
+"hi BadWord ctermfg=White ctermbg=darkred cterm=bold guifg=Yellow guibg=#522719 gui=bold
+" mathematically correct:
+"highlight BadWord ctermfg=black ctermbg=lightblue gui=NONE guifg=White guibg=#003333
+" adjusted:
+highlight BadWord ctermfg=black ctermbg=lightblue gui=NONE guifg=#ff9999 guibg=#003333
+"+++
+
+
diff --git a/vim/colors/navajo.vim b/vim/colors/navajo.vim
new file mode 100644 (file)
index 0000000..e7eebe7
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Maintainer: R. Edward Ralston <eralston@techsan.org>
+" Last Change: 2002-01-24 09:56:48
+" URI: http://eralston.tripod.com/navajo.png
+"
+" This color scheme uses a "navajo-white" background
+"
+
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "navajo"
+
+" looks good on Linux
+"hi Normal ctermfg=Black guifg=Black guibg=#b39674
+"hi Normal ctermfg=Black guifg=Black guibg=NavajoWhite3
+
+" slightly brighter for w32
+hi Normal ctermfg=Black guifg=Black guibg=#ba9c80
+
+hi SpecialKey term=bold ctermfg=DarkBlue guifg=Blue
+hi NonText term=bold ctermfg=DarkBlue cterm=bold gui=bold guifg=#808080
+hi Directory term=bold ctermfg=DarkBlue guifg=Blue
+hi ErrorMsg term=standout ctermfg=Gray ctermbg=DarkRed cterm=bold gui=bold guifg=White guibg=Red
+hi IncSearch term=reverse cterm=reverse gui=reverse
+hi Search term=reverse ctermbg=Black ctermfg=White cterm=reverse guibg=White
+hi MoreMsg term=bold ctermfg=DarkGreen gui=bold guifg=SeaGreen
+hi ModeMsg term=bold cterm=bold gui=bold
+hi LineNr term=underline ctermfg=DarkCyan ctermbg=Gray guibg=#808080 gui=bold guifg=black
+hi Question term=standout ctermfg=DarkGreen gui=bold guifg=SeaGreen
+hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold guifg=White guibg=Black
+hi StatusLineNC term=reverse cterm=reverse gui=bold guifg=LightRed guibg=#707070
+hi VertSplit term=reverse cterm=reverse gui=bold guifg=White guibg=#707070
+hi Title term=bold ctermfg=DarkMagenta gui=bold guifg=DarkMagenta
+hi Visual term=reverse cterm=reverse gui=reverse guifg=#c0c0c0 guibg=black
+hi VisualNOS term=bold,underline cterm=bold,underline gui=reverse guifg=Grey guibg=white
+hi WarningMsg term=standout ctermfg=DarkRed gui=bold guifg=Red
+hi WildMenu term=standout ctermfg=Black ctermbg=DarkYellow guifg=Black guibg=Yellow
+hi Folded term=standout ctermfg=DarkBlue ctermbg=Gray guifg=Black guibg=NONE guifg=#907050
+hi FoldColumn term=standout ctermfg=DarkBlue ctermbg=Gray guifg=DarkBlue guibg=#c0c0c0
+hi DiffAdd term=bold ctermbg=DarkBlue guibg=White
+hi DiffChange term=bold ctermbg=DarkMagenta guibg=#edb5cd
+hi DiffDelete term=bold ctermfg=DarkBlue ctermbg=6 cterm=bold gui=bold guifg=LightBlue guibg=#f6e8d0
+hi DiffText term=reverse ctermbg=DarkRed cterm=bold gui=bold guibg=#ff8060
+hi Cursor gui=reverse guifg=#404010 guibg=white
+hi lCursor guifg=bg guibg=fg
+hi Match term=bold,reverse ctermbg=Yellow ctermfg=Blue cterm=bold,reverse gui=bold,reverse guifg=yellow guibg=blue
+
+
+" Colors for syntax highlighting
+hi Comment term=bold ctermfg=DarkBlue guifg=#181880
+hi Constant term=underline ctermfg=DarkRed guifg=#c00058
+hi Special term=bold ctermfg=DarkMagenta guifg=#404010
+hi Identifier term=underline ctermfg=DarkCyan cterm=NONE guifg=#106060
+hi Statement term=bold ctermfg=DarkRed cterm=bold gui=bold guifg=Brown
+hi PreProc term=underline ctermfg=DarkMagenta guifg=DarkMagenta
+hi Type term=underline ctermfg=DarkGreen gui=bold guifg=SeaGreen
+hi Ignore ctermfg=Gray cterm=bold guifg=bg
+hi Error term=reverse ctermfg=Gray ctermbg=DarkRed cterm=bold gui=bold guifg=White guibg=Red
+hi Todo term=standout ctermfg=DarkBlue ctermbg=Yellow guifg=Blue guibg=Yellow
+
+" vim:set list et:
diff --git a/vim/colors/neon.vim b/vim/colors/neon.vim
new file mode 100644 (file)
index 0000000..d0ba309
--- /dev/null
@@ -0,0 +1,70 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/10/25 Fri 16:23.
+"     version: 1.2
+" This color scheme uses a dark background.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "neon"
+
+hi Normal       guifg=#f0f0f0 guibg=#303030
+
+" Search
+hi IncSearch    gui=UNDERLINE guifg=#80ffff guibg=#0060c0
+hi Search       gui=NONE guifg=#ffffa8 guibg=#808000
+" hi Search       gui=NONE guifg=#b0ffb0 guibg=#008000
+
+" Messages
+hi ErrorMsg     gui=BOLD guifg=#ffa0ff guibg=NONE
+hi WarningMsg   gui=BOLD guifg=#ffa0ff guibg=NONE
+hi ModeMsg      gui=BOLD guifg=#a0d0ff guibg=NONE
+hi MoreMsg      gui=BOLD guifg=#70ffc0 guibg=#8040ff
+hi Question     gui=BOLD guifg=#e8e800 guibg=NONE
+
+" Split area
+hi StatusLine   gui=NONE guifg=#000000 guibg=#c4c4c4
+hi StatusLineNC gui=NONE guifg=#707070 guibg=#c4c4c4
+hi VertSplit    gui=NONE guifg=#707070 guibg=#c4c4c4
+hi WildMenu     gui=NONE guifg=#000000 guibg=#ff80c0
+
+" Diff
+hi DiffText     gui=NONE guifg=#ff78f0 guibg=#a02860
+hi DiffChange   gui=NONE guifg=#e03870 guibg=#601830
+hi DiffDelete   gui=NONE guifg=#a0d0ff guibg=#0020a0
+hi DiffAdd      gui=NONE guifg=#a0d0ff guibg=#0020a0
+
+" Cursor
+hi Cursor       gui=NONE guifg=#70ffc0 guibg=#8040ff
+hi lCursor      gui=NONE guifg=#ffffff guibg=#8800ff
+hi CursorIM     gui=NONE guifg=#ffffff guibg=#8800ff
+
+" Fold
+hi Folded       gui=NONE guifg=#40f0f0 guibg=#006090
+hi FoldColumn   gui=NONE guifg=#40c0ff guibg=#404040
+
+" Other
+hi Directory    gui=NONE guifg=#c8c8ff guibg=NONE
+hi LineNr       gui=NONE guifg=#707070 guibg=NONE
+hi NonText      gui=BOLD guifg=#d84070 guibg=#383838
+hi SpecialKey   gui=BOLD guifg=#8888ff guibg=NONE
+hi Title        gui=BOLD guifg=fg      guibg=NONE
+hi Visual       gui=NONE guifg=#b0ffb0 guibg=#008000
+hi VisualNOS    gui=NONE guifg=#ffe8c8 guibg=#c06800
+
+" Syntax group
+hi Comment      gui=NONE guifg=#c0c0c0 guibg=NONE
+hi Constant     gui=NONE guifg=#92d4ff guibg=NONE
+hi Error        gui=BOLD guifg=#ffffff guibg=#8000ff
+hi Identifier   gui=NONE guifg=#40f8f8 guibg=NONE
+hi Ignore       gui=NONE guifg=bg      guibg=NONE
+hi PreProc      gui=NONE guifg=#ffa8ff guibg=NONE
+hi Special      gui=NONE guifg=#ffc890 guibg=NONE
+hi Statement    gui=NONE guifg=#dcdc78 guibg=NONE
+hi Todo         gui=BOLD,UNDERLINE guifg=#ff80d0 guibg=NONE
+hi Type         gui=NONE guifg=#60f0a8 guibg=NONE
+hi Underlined   gui=UNDERLINE guifg=fg guibg=NONE
diff --git a/vim/colors/neverness.vim b/vim/colors/neverness.vim
new file mode 100644 (file)
index 0000000..450ea47
--- /dev/null
@@ -0,0 +1,141 @@
+" NEVERNESS colour scheme
+" Author:      Yann GOLANSKI
+" Version:     1.2
+" Last Change: 13 Jan 2010
+" url http://web.njit.edu/~kevin/rgb.txt.html
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = 'neverness'
+
+" Comments: grey
+hi Comment        ctermfg=DarkCyan     guifg=#848484 guibg=#000000 gui=none 
+
+" Constants: SkyBlue
+hi Boolean        ctermfg=Cyan          guifg=#87ceeb guibg=#000000 gui=none
+hi Character      ctermfg=Cyan          guifg=#87ceeb guibg=#000000 gui=none
+hi Constant       ctermfg=Cyan          guifg=#87ceeb guibg=#000000 gui=none
+hi Float          ctermfg=Cyan          guifg=#87ceeb guibg=#000000 gui=none
+hi Number         ctermfg=Cyan          guifg=#87ceeb guibg=#000000 gui=none
+hi String         ctermfg=Cyan          guifg=#87ceeb guibg=#000000 gui=none
+
+" Identifier: SteelBlue1
+hi Identifier     ctermfg=LightCyan     guifg=#63b8ff guibg=#000000 gui=none
+hi Function       ctermfg=LightCyan     guifg=#63b8ff guibg=#000000 gui=none
+
+" Statement: SteelBlue
+hi Conditional    ctermfg=DarkBlue      guifg=#4682b4 guibg=#000000 gui=bold
+hi Exception      ctermfg=DarkBlue      guifg=#4682b4 guibg=#000000 gui=bold
+hi Keyword        ctermfg=DarkBlue      guifg=#4682b4 guibg=#000000 gui=bold
+hi Label          ctermfg=DarkBlue      guifg=#4682b4 guibg=#000000 gui=bold
+hi Operator       ctermfg=DarkBlue      guifg=#4682b4 guibg=#000000 gui=bold
+hi Repeat         ctermfg=DarkBlue      guifg=#4682b4 guibg=#000000 gui=bold
+hi Statement      ctermfg=DarkBlue      guifg=#4682b4 guibg=#000000 gui=bold
+
+" PreProc: DarkOrchid1
+hi PreProc        ctermfg=DarkGreen     guifg=#bf3eff guibg=#000000 gui=none
+hi Include        ctermfg=DarkGreen     guifg=#bf3eff guibg=#000000 gui=none
+hi Define         ctermfg=DarkGreen     guifg=#bf3eff guibg=#000000 gui=none
+hi Macro          ctermfg=DarkGreen     guifg=#bf3eff guibg=#000000 gui=none
+hi PreCondit      ctermfg=DarkGreen     guifg=#bf3eff guibg=#000000 gui=none
+
+" Type: orchid2
+hi Type           ctermfg=DarkGreen     guifg=#ee7ae9 guibg=#000000 gui=bold
+hi StorageClass   ctermfg=DarkGreen     guifg=#ee7ae9 guibg=#000000 gui=bold
+hi Structure      ctermfg=DarkGreen     guifg=#ee7ae9 guibg=#000000 gui=bold
+hi Typedef        ctermfg=DarkGreen     guifg=#ee7ae9 guibg=#000000 gui=bold
+
+" Special: cyan2
+hi Special        ctermfg=DarkGray      guifg=#00eeee guibg=#000000 gui=none
+hi SpecialChar    ctermfg=DarkGray      guifg=#00eeee guibg=#000000 gui=none
+hi Tag            ctermfg=DarkGray      guifg=#00eeee guibg=#000000 gui=none
+hi SpecialComment ctermfg=DarkGray      guifg=#00eeee guibg=#000000 gui=none
+hi Delimiter      ctermfg=DarkGray      guifg=#00eeee guibg=#000000 gui=none
+hi Debug          ctermfg=DarkGray      guifg=#00eeee guibg=#000000 gui=none
+
+" Underline: NavajoWhite2
+hi Underlined     ctermfg=LightGray     guifg=#eecfa1 guibg=#000000 gui=none
+
+" Ignore: black
+hi Ignore         ctermfg=LightGray     guifg=#ffffff guibg=#000000 gui=none
+
+" Error: red
+hi Error          ctermfg=LightGray     guifg=#ff0000 guibg=#232323 gui=bold
+
+" To do: SlateGray3
+hi Todo           ctermfg=LightMagenta     guifg=#9fb6cd guibg=#232323 gui=none
+
+" Spelling...
+hi SpellBad    ctermfg=DarkRed      ctermbg=black
+hi SpellCap    ctermfg=DarkBlue     ctermbg=black
+hi SpellRare   ctermfg=DarkYellow   ctermbg=black
+hi SpellLocal  ctermfg=DarkGreen    ctermbg=black
+
+" "set cursorline"  and "set cursorcolumn" options.
+hi lCursor        guifg=#43705a guibg=#e6fff3 gui=none
+hi CursorColumn   guibg=#222222 gui=none
+hi CursorLine     guibg=#222222 gui=none
+
+" Line number.
+"hi LineNr         ctermfg=DarkMagenta     guifg=#4682b4 guibg=#000000 gui=bold
+hi LineNr         ctermfg=DarkMagenta     guifg=#2b506e guibg=#000000 gui=none
+
+" Normal colour: just white thank you.
+hi Normal         guifg=#ffffff guibg=#000000 gui=none
+
+" Others:  These are "highlight-groups" and "highlight-default" in help section.
+hi Cursor         guifg=#43705a guibg=#e6fff3 gui=none
+hi DiffAdd        guifg=#e6fff3 guibg=#43705a gui=bold
+hi DiffChange     guifg=#e6fff3 guibg=#43705a gui=none
+hi DiffDelete     guifg=#e6fff3 guibg=#43705a gui=none
+hi DiffText       guifg=#000000 guibg=#e6fff3 gui=bold
+hi Directory      guifg=#e6fff3 guibg=#000000 gui=none
+hi ErrorMsg       guifg=#e6fff3 guibg=#61a181 gui=bold
+hi FoldColumn     guifg=#9bcfb5 guibg=#43705a gui=bold
+hi Folded         guifg=#9bcfb5 guibg=#43705a gui=bold
+hi IncSearch      guifg=#1d3026 guibg=#61a181 gui=bold
+hi ModeMsg        guifg=#4EEE94 guibg=#000000 gui=bold
+hi MoreMsg        guifg=#4EEE94 guibg=#000000 gui=bold
+hi NonText        guifg=#c0c0c0 guibg=#000000 gui=bold
+hi Question       guifg=#9bcfb5 guibg=#000000 gui=bold
+hi Search         guifg=#1d3026 guibg=#61a181 gui=bold
+hi SpecialKey     guifg=#9bcfb5 guibg=#000000 gui=none
+"hi StatusLine     guifg=#e6fff3 guibg=#61a181 gui=bold
+"hi StatusLineNC   guifg=#1d3026 guibg=#61a181 gui=bold
+hi StatusLine     guifg=#4EEE94 guibg=#333333 gui=none
+hi StatusLineNC   guifg=#4EEE94 guibg=#222222 gui=none
+hi Title          guifg=#e6fff3 guibg=#1d3026 gui=bold
+hi VertSplit      guifg=#61a181 guibg=#61a181 gui=none
+hi Visual         guifg=#e6fff3 guibg=#61a181 gui=none
+hi VisualNOS      guifg=#9bcfb5 guibg=#000000 gui=none
+hi WarningMsg     guifg=#BF3EFF guibg=#000000 gui=bold
+hi WildMenu       guifg=#43705a guibg=#e6fff3 gui=none
+
+" OTL
+hi normal guifg=white guibg=black      ctermfg=white ctermbg=black
+hi VertSplit guifg=white guibg=black   ctermfg=white ctermbg=black
+hi Folded guifg=darkcyan guibg=bg      ctermfg=cyan ctermbg=black
+hi FoldColumn guifg=darkcyan guibg=bg  ctermfg=cyan ctermbg=black
+
+hi def OL0 ctermfg=1 cterm=bold gui=bold guifg=#36648B term=reverse
+hi def OL1 ctermfg=4 cterm=bold gui=bold guifg=#4682B4 term=reverse
+hi def OL2 ctermfg=2 cterm=bold gui=bold guifg=#4F94CD term=reverse
+hi def OL3 ctermfg=3 cterm=bold gui=bold guifg=#5CACEE term=reverse
+hi def OL4 ctermfg=5 cterm=bold gui=bold guifg=#63B8FF term=reverse
+hi def OL5 ctermfg=6 cterm=bold gui=bold guifg=#708090 term=reverse
+hi def OL6 ctermfg=1 cterm=bold gui=bold guifg=#6C7B8B term=reverse
+hi def OL7 ctermfg=4 cterm=bold gui=bold guifg=#9FB6CD term=reverse
+hi def OL8 ctermfg=2 cterm=bold gui=bold guifg=#B9D3EE term=reverse
+hi def OL9 ctermfg=3 cterm=bold gui=bold guifg=#C6E2FF term=reverse
+
+
+" PMenu from Sam Grรถnblom <sgronblo@gmail.com>
+hi PmenuSel    ctermfg=Black ctermbg=Cyan      guifg=#000000 guibg=#87ceeb gui=none
+hi Pmenu       ctermfg=White ctermbg=DarkBlue  guifg=#000000 guibg=#4682b4 gui=none
+hi PmenuSbar   ctermfg=White ctermbg=LightCyan guifg=#ffffff guibg=#848484 gui=none
+hi PmenuThumb  ctermfg=White ctermbg=DarkGreen guifg=#ffffff guibg=#87ceeb gui=none
+
diff --git a/vim/colors/night.vim b/vim/colors/night.vim
new file mode 100644 (file)
index 0000000..8fb7f56
--- /dev/null
@@ -0,0 +1,70 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/10/13 Sun 16:59.
+"     version: 2.2
+" This color scheme uses a dark background.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "night"
+
+hi Normal       guifg=#f0f0f8 guibg=#303040
+
+" Search
+hi IncSearch    gui=UNDERLINE,BOLD guifg=#f0f0f8 guibg=#d000d0
+hi Search       gui=BOLD guifg=#ffd0ff guibg=#c000c0
+
+" Messages
+hi ErrorMsg     gui=BOLD guifg=#ffffff guibg=#f00080
+hi WarningMsg   gui=BOLD guifg=#ffffff guibg=#f00080
+hi ModeMsg      gui=BOLD guifg=#00e0ff guibg=NONE
+hi MoreMsg      gui=BOLD guifg=#00ffdd guibg=NONE
+hi Question     gui=BOLD guifg=#d0d050 guibg=NONE
+
+" Split area
+hi StatusLine   gui=NONE guifg=#000000 guibg=#c8c8d8
+hi StatusLineNC gui=NONE guifg=#606080 guibg=#c8c8d8
+hi VertSplit    gui=NONE guifg=#606080 guibg=#c8c8d8
+hi WildMenu     gui=NONE guifg=#000000 guibg=#e0e078
+
+" Diff
+hi DiffText     gui=NONE guifg=#ffffff guibg=#40a060
+hi DiffChange   gui=NONE guifg=#ffffff guibg=#007070
+hi DiffDelete   gui=NONE guifg=#ffffff guibg=#40a0c0
+hi DiffAdd      gui=NONE guifg=#ffffff guibg=#40a0c0
+
+" Cursor
+hi Cursor       gui=NONE guifg=#ffffff guibg=#d86020
+hi lCursor      gui=NONE guifg=#ffffff guibg=#e000b0
+hi CursorIM     gui=NONE guifg=#ffffff guibg=#e000b0
+
+" Fold
+hi Folded       gui=NONE guifg=#ffffff guibg=#9060c0
+hi FoldColumn   gui=NONE guifg=#c0a0ff guibg=#404052
+
+" Other
+hi Directory    gui=NONE guifg=#00ffff guibg=NONE
+hi LineNr       gui=NONE guifg=#787894 guibg=NONE
+hi NonText      gui=BOLD guifg=#8040ff guibg=#383848
+hi SpecialKey   gui=BOLD guifg=#60a0ff guibg=NONE
+hi Title        gui=BOLD guifg=#f0f0f8 guibg=#9000a0
+hi Visual       gui=NONE guifg=#ffffff guibg=#c08040
+" hi VisualNOS  gui=NONE guifg=#ffffff guibg=#c08040
+
+" Syntax group
+hi Comment      gui=NONE guifg=#e0e070 guibg=NONE
+hi Constant     gui=NONE guifg=#f0f0f8 guibg=#4830a0
+hi Error        gui=BOLD guifg=#ffffff guibg=#f00080
+hi Identifier   gui=NONE guifg=#ffa0ff guibg=NONE
+hi Ignore       gui=NONE guifg=#303040 guibg=NONE
+hi Number       gui=BOLD guifg=#b8b8c8 guibg=NONE
+hi PreProc      gui=NONE guifg=#40ffa0 guibg=NONE
+hi Special      gui=NONE guifg=#40f8f8 guibg=#4830a0
+hi Statement    gui=BOLD guifg=#00d8f8 guibg=NONE
+hi Todo         gui=BOLD guifg=#00ffe0 guibg=#0080a0
+hi Type         gui=BOLD guifg=#bbaaff guibg=NONE
+hi Underlined   gui=UNDERLINE,BOLD guifg=#f0f0f8 guibg=NONE
diff --git a/vim/colors/nightshimmer.vim b/vim/colors/nightshimmer.vim
new file mode 100644 (file)
index 0000000..53dce84
--- /dev/null
@@ -0,0 +1,111 @@
+" Vim color file
+" Maintainer: Niklas Lindstrรถm <nlm@valtech.se>
+" Last Change: 2002-03-22
+" Version: 0.3
+" URI: http://localhost/
+
+
+""" Init
+set background=dark
+highlight clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name = "nightshimmer"
+
+
+""""""""\ Colors \""""""""
+
+
+"""" GUI Colors
+
+highlight Cursor        gui=None guibg=Green guifg=White
+highlight CursorIM gui=bold guifg=white guibg=Green1
+highlight Directory     guifg=LightSeaGreen guibg=bg
+highlight DiffAdd gui=None guifg=fg guibg=DarkCyan
+highlight DiffChange gui=None guifg=fg guibg=Green4
+highlight DiffDelete gui=None guifg=fg guibg=black
+highlight DiffText gui=bold guifg=fg guibg=bg
+highlight ErrorMsg      guifg=LightYellow  guibg=FireBrick
+" previously 'FillColumn':
+"highlight FillColumn    gui=NONE guifg=black guibg=grey60
+highlight VertSplit    gui=NONE guifg=black guibg=grey60
+highlight Folded        gui=bold guibg=#305060 guifg=#b0d0e0
+highlight FoldColumn        gui=bold guibg=#305060 guifg=#b0d0e0
+highlight IncSearch gui=reverse guifg=fg guibg=bg
+highlight LineNr        gui=bold guibg=grey6 guifg=Purple3
+highlight ModeMsg       guibg=DarkGreen guifg=LightGreen
+highlight MoreMsg       gui=bold  guifg=SeaGreen4 guibg=bg
+if version < 600
+    " same as SpecialKey
+    highlight NonText       guibg=#123A4A guifg=#3D5D6D
+else
+    " Bottom fill (use e.g. same as LineNr)
+    highlight NonText       gui=None guibg=grey6 guifg=Purple
+endif
+highlight Normal        gui=None guibg=#103040 guifg=honeydew2
+highlight Question      gui=bold  guifg=SeaGreen2 guibg=bg
+highlight Search        gui=NONE guibg=Purple4 guifg=NONE
+highlight SpecialKey    guibg=#123A4A guifg=#426272
+highlight StatusLine    gui=bold guibg=grey88 guifg=black
+highlight StatusLineNC  gui=NONE guibg=grey60 guifg=grey10
+highlight Title         gui=bold  guifg=MediumOrchid1 guibg=bg
+highlight Visual        gui=reverse guibg=WHITE guifg=SeaGreen
+highlight VisualNOS     gui=bold,underline guifg=fg guibg=bg
+highlight WarningMsg    gui=bold guifg=FireBrick1 guibg=bg
+highlight WildMenu      gui=bold guibg=Chartreuse guifg=Black
+
+
+"""" Syntax Colors
+
+highlight Comment       gui=reverse guifg=#507080
+"highlight Comment       gui=None guifg=#507080
+
+highlight Constant      guifg=Cyan guibg=bg
+    "hi String gui=None guifg=Cyan guibg=bg
+    "hi Character gui=None guifg=Cyan guibg=bg
+    highlight Number gui=None guifg=Cyan guibg=bg
+    highlight Boolean gui=bold guifg=Cyan guibg=bg
+    "hi Float gui=None guifg=Cyan guibg=bg
+
+highlight Identifier    guifg=orchid1
+    "hi Function gui=None guifg=orchid1 guibg=bg
+
+highlight Statement     gui=NONE guifg=LightGreen
+    highlight Conditional gui=None guifg=LightGreen guibg=bg
+    highlight Repeat gui=None guifg=SeaGreen2 guibg=bg
+    "hi Label gui=None guifg=LightGreen guibg=bg
+    highlight Operator gui=None guifg=Chartreuse guibg=bg
+    highlight Keyword gui=bold guifg=LightGreen guibg=bg
+    highlight Exception gui=bold guifg=LightGreen guibg=bg
+
+highlight PreProc       guifg=MediumPurple1
+    "hi Include gui=None guifg=MediumPurple1 guibg=bg
+    "hi Define gui=None guifg=MediumPurple1g guibg=bg
+    "hi Macro gui=None guifg=MediumPurple1g guibg=bg
+    "hi PreCondit gui=None guifg=MediumPurple1g guibg=bg
+
+highlight Type          gui=NONE guifg=LightBlue
+    "hi StorageClass gui=None guifg=LightBlue guibg=bg
+    "hi Structure gui=None guifg=LightBlue guibg=bg
+    "hi Typedef gui=None guifg=LightBlue guibg=bg
+
+highlight Special       gui=bold guifg=White
+    "hi SpecialChar gui=bold guifg=White guibg=bg
+    "hi Tag gui=bold guifg=White guibg=bg
+    "hi Delimiter gui=bold guifg=White guibg=bg
+    "hi SpecialComment gui=bold guifg=White guibg=bg
+    "hi Debug gui=bold guifg=White guibg=bg
+
+highlight Underlined gui=underline guifg=honeydew4 guibg=bg
+
+highlight Ignore    guifg=#204050
+
+highlight Error      guifg=LightYellow  guibg=FireBrick
+
+highlight Todo          guifg=Cyan guibg=#507080
+
+""" OLD COLORS
+
+
+
diff --git a/vim/colors/no_quarter.vim b/vim/colors/no_quarter.vim
new file mode 100644 (file)
index 0000000..5c0ee20
--- /dev/null
@@ -0,0 +1,134 @@
+" Vim color file
+"  Maintainer: Otavio Fernandes <otaviof@gmail.com>
+" Last Change: 2010/01/03 Sun 22:56
+"     Version: 1.0.6
+"
+" ts=4
+"
+
+set background=dark
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+let colors_name = "no_quarter"
+
+"
+" Vim Colors (( Default Options ))
+"
+
+hi Normal                              guifg=grey90                        guibg=#303030
+
+hi Comment                             gui=NONE                guifg=#647bcf       guibg=NONE
+hi Constant                            gui=NONE                guifg=#b07050       guibg=NONE
+hi Cursor                              gui=NONE                guifg=#424242       guibg=green
+hi CursorIM                            gui=NONE                guifg=#ffffff       guibg=#8800ff
+hi CursorLine           gui=NONE                            guibg=gray25
+hi DiffAdd                             gui=NONE                guifg=#a0d0ff       guibg=#0020a0
+hi DiffChange                  gui=NONE                guifg=#e03870       guibg=#601830
+hi DiffDelete                  gui=NONE                guifg=#a0d0ff       guibg=#0020a0
+hi DiffText                            gui=NONE                guifg=#ff78f0       guibg=#a02860
+hi Directory                   gui=NONE                guifg=lightmagenta  guibg=NONE
+hi Error                               gui=BOLD                guifg=#ffffff       guibg=#8000ff
+hi ErrorMsg                            gui=BOLD                guifg=#ffa0ff       guibg=NONE
+hi FoldColumn                  gui=NONE                guifg=#40c0ff       guibg=#404040
+hi Folded                              gui=NONE                guifg=#40f0f0       guibg=#006090
+hi Identifier                  gui=NONE                guifg=#90c0c0       guibg=NONE
+hi Ignore                              gui=NONE                guifg=bg            guibg=NONE
+hi IncSearch                   gui=UNDERLINE   guifg=#80ffff       guibg=#0060c0
+hi LineNr                              gui=NONE                guifg=#707070       guibg=NONE
+hi ModeMsg                             gui=BOLD                guifg=#a0d0ff       guibg=NONE
+hi MoreMsg                             gui=NONE        guifg=lightred      guibg=bg
+hi NonText                             gui=BOLD                guifg=#707070       guibg=#383838
+hi OverLength           gui=NONE        guifg=fg            guibg=#353535
+hi PreProc                             gui=NONE                guifg=#c090c0       guibg=NONE
+hi Question                            gui=BOLD                guifg=#e8e800       guibg=NONE
+hi Search                              gui=NONE                guifg=bg            guibg=grey60
+hi SignColumn           gui=NONE        guifg=darkyellow    guibg=bg
+hi Special                             gui=NONE                guifg=#c090c0       guibg=NONE
+hi SpecialKey                  gui=BOLD                guifg=green         guibg=NONE
+hi Statement                   gui=NONE                guifg=#c0c090       guibg=NONE
+hi StatusLine                  gui=NONE                guifg=#000000       guibg=#909090
+hi StatusLineNC                        gui=NONE                guifg=#abac84       guibg=#404040
+hi Title                               gui=NONE        guifg=darkcyan      guibg=bg
+hi Todo                                        gui=BOLD                guifg=#ff80d0       guibg=NONE
+hi Type                                        gui=NONE                guifg=#60f0a8       guibg=NONE
+hi Underlined                  gui=UNDERLINE   guifg=#707070       guibg=NONE
+hi VertSplit                   gui=NONE                guifg=#abac84       guibg=#404040
+hi Visual                              gui=NONE                guifg=#b0ffb0       guibg=#008000
+hi VisualNOS                   gui=NONE                guifg=#ffe8c8       guibg=#c06800
+hi WarningMsg                  gui=BOLD                guifg=#ffa0ff       guibg=NONE
+hi WildMenu                            gui=NONE                guifg=#000000       guibg=#abac84
+hi htmlTagName                 gui=NONE                guifg=grey70        guibg=bg
+hi lCursor                             gui=NONE                guifg=#ffffff       guibg=#8800ff
+
+"
+" Tag List
+"
+
+hi MyTagListFileName      gui=underline   guifg=fg        guibg=grey25
+
+"
+" Perl
+"
+
+hi perlIdentifier                      gui=NONE        guifg=#90c0c0   guibg=NONE
+hi perlStatement                       gui=NONE        guifg=#c0c090   guibg=NONE
+hi perlStatementHash           gui=NONE        guifg=#c0c090   guibg=#404040
+hi perlStatementNew                    gui=NONE        guifg=#c0c090   guibg=#424242
+hi perlMatchStartEnd           gui=NONE        guifg=#c0c090   guibg=#424242
+hi perlVarPlain                                gui=NONE        guifg=#74c5c6   guibg=bg
+hi perlVarNotInMatches         gui=NONE        guifg=#915555   guibg=bg
+hi perlVarPlain2                       gui=NONE        guifg=#74c6a8   guibg=bg
+hi perlFunctionName                    gui=NONE        guifg=white     guibg=bg
+hi perlNumber                          gui=NONE        guifg=#80ac7b   guibg=bg
+hi perlQQ                                      gui=NONE        guifg=fg                guibg=#393939
+hi perlSpecialString           gui=NONE        guifg=#dc966b   guibg=bg
+hi perlSpecialMatch                    gui=NONE        guifg=#c864c7   guibg=bg
+hi perlSpecialBEOM                     gui=NONE        guifg=fg                guibg=#404040
+hi perlStringStartEnd          gui=NONE        guifg=#b07050   guibg=#353535
+hi perlShellCommand                    gui=NONE        guibg=#c090c0   guibg=#424242
+hi perlOperator                                gui=NONE        guifg=#c0c090   guibg=#404040
+hi perlLabel                           gui=NONE        guifg=#c0c090   guibg=#404040
+hi perlControl                         gui=NONE        guifg=#c0c090   guibg=#404040
+hi perlSharpBang                       gui=NONE        guifg=#c0c090   guibg=#505050
+hi perlPackageDecl                     gui=NONE        guifg=#80ac7b   guibg=#404040
+hi perlStatementFiledesc       gui=NONE        guifg=#a2c090   guibg=bg
+hi perlRepeat                          gui=NONE        guifg=#c0b790   guibg=bg
+hi perlStatementInclude        gui=NONE        guifg=#c0c090   guibg=#3b4038
+hi perlStatementControl                gui=NONE        guifg=#dcdb6b   guibg=bg
+hi perlStatementSub            gui=NONE        guifg=#c0c090   guibg=bg
+hi perlVarSimpleMember         gui=NONE        guifg=#c0c090   guibg=bg
+hi perlVarSimpleMemberName     gui=NONE        guifg=grey70    guibg=bg
+
+" -------------------------------------------------------------------------------------------------
+" perlStatementRegexp perlSpecialDollar perlSpecialStringU perlSubstitutionBracket
+" perlTranslationBracket perlType perlStatementStorage perlStatementScalar
+" perlStatementNumeric perlStatementList perlStatementIOfunc 
+" perlStatementVector perlStatementFiles perlStatementFlow perlStatementScope
+" perlStatementProc perlStatementSocket perlStatementIPC perlStatementNetwork perlStatementPword
+" perlStatementTime perlStatementMisc perlStatementPackage perlList perlMisc
+" perlVarSlash perlMethod perlFiledescRead perlFiledescStatement perlFormatName
+" perlFloat perlString perlSubstitutionSQ perlSubstitutionDQ
+" perlSubstitutionSlash perlSubstitutionHash perlSubstitutionCurly perlSubstitutionPling
+" perlTranslationSlash perlTranslationHash perlTranslationCurly perlHereDoc perlFormatField
+" perlStringUnexpanded perlCharacter perlSpecialAscii perlConditional perlInclude
+" perlStorageClass perlPackageRef perlFunctionPRef
+" -------------------------------------------------------------------------------------------------
+
+"
+" Omni Menu
+"
+
+hi Pmenu                               guifg=grey10    guibg=grey50
+hi PmenuSel                            guifg=#abac84   guibg=#404040
+hi PmenuSbar                   guibg=grey20
+hi PmenuThumb                  guifg=grey30
+
+"
+" Right Margin
+"
+
+hi rightMargin          guibg=#453030
+
+" EOF
diff --git a/vim/colors/northland.vim b/vim/colors/northland.vim
new file mode 100644 (file)
index 0000000..cb2fd36
--- /dev/null
@@ -0,0 +1,149 @@
+" Vim color file - northland
+" Maintainer:   Luka Djigas <ldigas@gmail.com>
+" URL:          http://www.vim.org/scripts/script.php?script_id=2200
+
+" Version:      0.2
+" Last Change:  24.11.2008. 19:13
+" =====
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="northland"
+" ===== :he highlight-groups
+hi Normal             gui=NONE       guifg=White         guibg=#001020       guisp=NONE
+
+hi StatusLine         gui=NONE       guifg=Black         guibg=DarkRed
+hi StatusLineNC       gui=NONE       guifg=Black         guibg=DarkGray
+ hi VertSplit          gui=NONE       guifg=Black         guibg=DarkGray
+
+hi Cursor             gui=NONE       guifg=White         guibg=PaleTurquoise3
+ hi CursorIM           gui=NONE       guifg=White         guibg=PaleTurquoise3
+hi CursorLine                                            guibg=#003853
+ hi CursorColumn                                          guibg=#003853
+
+hi ErrorMsg           gui=NONE       guifg=Yellow        guibg=NONE
+ hi WarningMsg         gui=NONE       guifg=Yellow        guibg=NONE
+ hi MoreMsg            gui=NONE       guifg=Yellow        guibg=NONE
+ hi Question           gui=NONE       guifg=Yellow        guibg=NONE
+hi ModeMsg            gui=bold       guifg=White         guibg=DarkRed
+
+"hi Directory          gui=NONE       guifg=DarkGreen     guibg=NONE
+"hi Directory gui=bold guifg=#0475B9    "---lighter blue
+hi Directory gui=bold guifg=#035587     "---darker blue
+
+hi Search             gui=NONE       guifg=White         guibg=DarkRed
+ hi IncSearch          gui=NONE       guifg=White         guibg=DarkRed
+
+hi NonText            gui=NONE       guifg=DarkRed       guibg=NONE
+hi SpecialKey         gui=NONE       guifg=#999999       guibg=NONE
+
+hi Pmenu              gui=NONE       guifg=Black         guibg=DarkRed
+hi PmenuSel           gui=NONE       guifg=#507080       guibg=Black
+hi PmenuSbar                                             guibg=#003853
+hi PmenuThumb         gui=NONE                           guibg=Black
+hi WildMenu           gui=NONE       guifg=#507080       guibg=Black
+
+hi MatchParen         gui=bold       guifg=DarkRed       guibg=NONE
+
+hi LineNr             gui=bold       guifg=#507080       guibg=Black
+
+hi Visual             gui=NONE       guifg=NONE          guibg=DarkRed
+hi VisualNOS          gui=underline  guifg=NONE          guibg=DarkRed
+
+hi DiffAdd            gui=NONE       guifg=White         guibg=DarkGreen
+hi DiffChange         gui=NONE       guifg=White         guibg=DarkGray
+hi DiffDelete         gui=NONE       guifg=White         guibg=DarkRed
+hi DiffText           gui=NONE       guifg=White         guibg=NONE
+
+hi Folded             gui=bold       guifg=DarkGreen     guibg=Black
+hi FoldColumn         gui=NONE       guifg=#507080       guibg=Black
+hi SignColumn         gui=bold       guifg=DarkRed       guibg=Black
+
+hi SpellBad           gui=undercurl                                          guisp=Red
+hi SpellCap           gui=undercurl                                          guisp=White
+hi SpellLocal         gui=undercurl                                          guisp=Orange
+ hi SpellRare          gui=undercurl                                          guisp=Orange
+
+hi TabLine            gui=NONE       guifg=#507080       guibg=Black
+hi TabLineSel         gui=bold       guifg=Black         guibg=#507080
+hi TabLineFill        gui=NONE       guifg=White         guibg=Black
+
+hi Title              gui=bold       guifg=#507080       guibg=NONE
+
+"hi Menu
+"hi Scrollbar
+"hi Tooltip
+"hi User1 ... User9
+" ===== :he group-name
+hi Comment gui=italic guifg=DarkGray
+"*Comment       any comment
+"hi Constant gui=none guifg=#0475B9     "---lighter blue
+hi Constant gui=none guifg=#035587      "---darker blue
+"*Constant      any constant
+" String        a string constant: "this is a string"
+" Character     a character constant: 'c', '\n'
+" Number        a number constant: 234, 0xff
+" Boolean       a boolean constant: TRUE, false
+" Float         a floating point constant: 2.3e10
+"hi Identifier gui=bold,italic guifg=#FB000A    "---lighter
+hi Identifier gui=bold,italic guifg=#BC0007     "---darker
+"*Identifier    any variable name
+" Function      function name (also: methods for classes)
+"hi Statement gui=bold guifg=#FF9500            "---lighter
+hi Statement gui=bold guifg=#BF6F00             "---darker
+"*Statement     any statement
+" Conditional   if, then, else, endif, switch, etc.
+" Repeat        for, do, while, etc.
+" Label         case, default, etc.
+" Operator      "sizeof", "+", "*", etc.
+" Keyword       any other keyword
+" Exception     try, catch, throw
+"hi PreProc gui=bold,italic guifg=#640A9B       "---
+"hi PreProc gui=bold,italic guifg=#576D02       "---
+hi PreProc gui=bold,italic guifg=#AD6141
+"*PreProc       generic Preprocessor
+" Include       preprocessor #include
+" Define        preprocessor #define
+" Macro         same as Define
+" PreCondit     preprocessor #if, #else, #endif, etc.
+"hi Type gui=none guifg=#14AE00 "---lighter
+hi Type gui=none guifg=#0F8200  "---darker
+"*Type          int, long, char, etc.
+" StorageClass  static, register, volatile, etc.
+" Structure     struct, union, enum, etc.
+" Typedef       A typedef
+"hi! link Special Constant
+hi! link Special Type
+"*Special       any special symbol
+" SpecialChar   special character in a constant
+" Tag           you can use CTRL-] on this
+" Delimiter     character that needs attention
+" SpecialComment special things inside a comment
+" Debug         debugging statements
+hi clear Underlined
+"*Underlined    text that stands out, HTML links
+hi! link Ignore Constant
+"*Ignore        left blank, hidden
+hi Error gui=bold guifg=Black guibg=Yellow
+"*Error         any erroneous construct
+hi! link Todo LineNr
+"*Todo          anything that needs extra attention; mostly the
+"               keywords TODO FIXME and XXX
+" ===== fortran
+hi fortranUnitHeader gui=bold guifg=Purple
+hi fortranType gui=none guifg=#0F8200
+hi! link fortranTypeR fortranType
+hi! link fortranStructure fortranType
+hi! link fortranOperator Normal         "///
+hi! link fortranNumber Normal           "///
+
+
+
+hi fortranLabelNumber guifg=DarkRed
+
+
+
+"hi fortranTodo guifg=Black guibg=#507080
+"hi fortranContinueMark guifg=White guibg=DarkRed
diff --git a/vim/colors/nuvola.vim b/vim/colors/nuvola.vim
new file mode 100644 (file)
index 0000000..f9a608a
--- /dev/null
@@ -0,0 +1,107 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer:  Dr. J. Pfefferl <johann.pfefferl@agfa.com>
+" Source:      $Source: /MISC/projects/cvsroot/user/pfefferl/vim/colors/nuvola.vim,v $
+" Id:  $Id: nuvola.vim,v 1.14 2003/08/11 14:03:28 pfefferl Exp $
+" Last Change: $Date: 2003/08/11 14:03:28 $
+
+" Intro {{{1
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "nuvola"
+
+" Normal {{{1
+hi Normal ctermfg=black ctermbg=NONE guifg=black guibg=#F9F5F9
+
+" Search {{{1
+hi IncSearch cterm=UNDERLINE ctermfg=Black ctermbg=brown gui=UNDERLINE guifg=Black guibg=#FFE568
+hi Search term=reverse cterm=UNDERLINE ctermfg=Black ctermbg=brown gui=NONE guifg=Black guibg=#FFE568
+
+" Messages {{{1
+hi ErrorMsg gui=BOLD guifg=#EB1513 guibg=NONE
+hi! link WarningMsg ErrorMsg
+hi ModeMsg gui=BOLD guifg=#0070ff guibg=NONE
+hi MoreMsg guibg=NONE guifg=seagreen
+hi! link Question MoreMsg
+
+" Split area {{{1
+hi StatusLine term=BOLD,reverse cterm=NONE ctermfg=Yellow ctermbg=DarkGray gui=BOLD guibg=#56A0EE guifg=white
+hi StatusLineNC gui=NONE guibg=#56A0EE guifg=#E9E9F4
+hi! link VertSplit StatusLineNC
+hi WildMenu gui=UNDERLINE guifg=#56A0EE guibg=#E9E9F4
+
+" Diff {{{1
+hi DiffText   gui=NONE guifg=#f83010 guibg=#ffeae0
+hi DiffChange gui=NONE guifg=#006800 guibg=#d0ffd0
+hi DiffDelete gui=NONE guifg=#2020ff guibg=#c8f2ea
+hi! link DiffAdd DiffDelete
+
+" Cursor {{{1
+hi Cursor       gui=none guifg=black guibg=orange
+"hi lCursor      gui=NONE guifg=#f8f8f8 guibg=#8000ff
+hi CursorIM     gui=NONE guifg=#f8f8f8 guibg=#8000ff
+
+" Fold {{{1
+hi Folded gui=NONE guibg=#B5EEB5 guifg=black
+"hi FoldColumn gui=NONE guibg=#9FD29F guifg=black
+hi! link FoldColumn Folded
+
+" Other {{{1
+hi Directory    gui=NONE guifg=#0000ff guibg=NONE
+hi LineNr       gui=NONE guifg=#8080a0 guibg=NONE
+hi NonText      gui=BOLD guifg=#4000ff guibg=#EFEFF7
+"hi SpecialKey   gui=NONE guifg=#A35B00 guibg=NONE
+hi Title        gui=BOLD guifg=#1014AD guibg=NONE
+hi Visual term=reverse ctermfg=yellow ctermbg=black gui=NONE guifg=Black guibg=#BDDFFF
+hi VisualNOS term=reverse ctermfg=yellow ctermbg=black gui=UNDERLINE guifg=Black guibg=#BDDFFF
+
+" Syntax group {{{1
+hi Comment term=BOLD ctermfg=darkgray guifg=#3F6B5B
+hi Constant term=UNDERLINE ctermfg=red guifg=#B91F49
+hi Error term=REVERSE ctermfg=15 ctermbg=9 guibg=Red guifg=White
+hi Identifier term=UNDERLINE ctermfg=Blue guifg=Blue
+hi Number   term=UNDERLINE ctermfg=red gui=NONE guifg=#00C226
+hi PreProc term=UNDERLINE ctermfg=darkblue guifg=#1071CE
+hi Special term=BOLD ctermfg=darkmagenta guifg=red2
+hi Statement term=BOLD ctermfg=DarkRed gui=NONE guifg=#F06F00
+hi Tag term=BOLD ctermfg=DarkGreen guifg=DarkGreen
+hi Todo term=STANDOUT ctermbg=Yellow ctermfg=blue guifg=Blue guibg=Yellow
+hi Type term=UNDERLINE ctermfg=Blue gui=NONE guifg=Blue
+hi! link String        Constant
+hi! link Character     Constant
+hi! link Boolean       Constant
+hi! link Float         Number
+hi! link Function      Identifier
+hi! link Conditional   Statement
+hi! link Repeat        Statement
+hi! link Label         Statemengreen
+hi! link Operator      Statement
+hi! link Keyword       Statement
+hi! link Exception     Statement
+hi! link Include       PreProc
+hi! link Define        PreProc
+hi! link Macro         PreProc
+hi! link PreCondit     PreProc
+hi! link StorageClass  Type
+hi! link Structure     Type
+hi! link Typedef       Type
+hi! link SpecialChar   Special
+hi! link Delimiter     Special
+hi! link SpecialComment Special
+hi! link Debug         Special
+
+" HTML {{{1
+hi htmlLink                 gui=UNDERLINE guifg=#0000ff guibg=NONE
+hi htmlBold                 gui=BOLD
+hi htmlBoldItalic           gui=BOLD,ITALIC
+hi htmlBoldUnderline        gui=BOLD,UNDERLINE
+hi htmlBoldUnderlineItalic  gui=BOLD,UNDERLINE,ITALIC
+hi htmlItalic               gui=ITALIC
+hi htmlUnderline            gui=UNDERLINE
+hi htmlUnderlineItalic      gui=UNDERLINE,ITALIC
+
+" vim600:foldmethod=marker
diff --git a/vim/colors/oceanblack.vim b/vim/colors/oceanblack.vim
new file mode 100644 (file)
index 0000000..e6e6be3
--- /dev/null
@@ -0,0 +1,115 @@
+" Vim color file
+" Maintainer: Chris Vertonghen <chris@vertonghen.org>
+" Last Change: 2003-03-25
+" Version: 0.1
+" based on Tom Regner's oceanblue.vim
+
+""" Init
+set background=dark
+highlight clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name = "oceanblack"
+
+
+""""""""\ Colors \""""""""
+
+
+"""" GUI Colors
+
+highlight Cursor        gui=None guibg=PaleTurquoise3 guifg=White
+highlight CursorIM gui=bold guifg=white guibg=PaleTurquoise3
+highlight Directory     guifg=LightSeaGreen guibg=bg
+highlight DiffAdd gui=None guifg=fg guibg=DarkCyan
+highlight DiffChange gui=None guifg=fg guibg=Green4
+highlight DiffDelete gui=None guifg=fg guibg=black
+highlight DiffText gui=bold guifg=fg guibg=bg
+highlight ErrorMsg      guifg=LightYellow  guibg=FireBrick
+" previously 'FillColumn':
+"highlight FillColumn    gui=NONE guifg=black guibg=grey60
+highlight VertSplit    gui=NONE guifg=black guibg=grey60
+highlight Folded        gui=bold guibg=#305060 guifg=#b0d0e0
+highlight FoldColumn        gui=None guibg=#305060 guifg=#b0d0e0
+highlight IncSearch gui=reverse guifg=fg guibg=bg
+"highlight LineNr        guibg=grey6 guifg=LightSkyBlue3
+highlight LineNr        guibg=grey6 guifg=#777777
+highlight ModeMsg       guibg=DarkGreen guifg=LightGreen
+highlight MoreMsg       gui=bold  guifg=SeaGreen4 guibg=bg
+if version < 600
+    " same as SpecialKey
+    highlight NonText       guibg=#123A4A guifg=#3D5D6D
+else
+    " Bottom fill (use e.g. same as LineNr)
+    highlight NonText       gui=None guibg=#000000 guifg=LightSkyBlue
+endif
+highlight Normal        gui=None guibg=#000000 guifg=honeydew2
+highlight Question      gui=bold  guifg=SeaGreen2 guibg=bg
+highlight Search        gui=NONE guibg=LightSkyBlue4 guifg=NONE
+highlight SpecialKey    guibg=#103040 guifg=#324262
+highlight StatusLine    gui=bold guibg=grey88 guifg=black
+highlight StatusLineNC  gui=NONE guibg=grey60 guifg=grey10
+highlight Title         gui=bold  guifg=MediumOrchid1 guibg=bg
+highlight Visual        gui=reverse guibg=WHITE guifg=SeaGreen
+highlight VisualNOS     gui=bold,underline guifg=fg guibg=bg
+highlight WarningMsg    gui=bold guifg=FireBrick1 guibg=bg
+highlight WildMenu      gui=bold guibg=Chartreuse guifg=Black
+
+
+"""" Syntax Colors
+
+"highlight Comment       gui=reverse guifg=#507080
+"highlight Comment       gui=None guifg=#507080
+highlight Comment       gui=None guifg=#7C7268
+
+highlight Constant      guifg=cyan3 guibg=bg
+"hi String gui=None guifg=turquoise2 guibg=bg
+hi String gui=None guifg=#80a0ff guibg=bg
+    "hi Character gui=None guifg=Cyan guibg=bg
+    "highlight Number gui=None guifg=Cyan guibg=bg
+    highlight Number gui=None guifg=Cyan guibg=black
+    highlight Boolean gui=bold guifg=Cyan guibg=bg
+    "hi Float gui=None guifg=Cyan guibg=bg
+
+highlight Identifier    guifg=LightSkyBlue3
+hi Function gui=None guifg=DarkSeaGreen3 guibg=bg
+
+highlight Statement     gui=NONE guifg=LightGreen
+    highlight Conditional gui=None guifg=LightGreen guibg=bg
+    highlight Repeat gui=None guifg=SeaGreen2 guibg=bg
+    "hi Label gui=None guifg=LightGreen guibg=bg
+    highlight Operator gui=None guifg=Chartreuse guibg=bg
+    highlight Keyword gui=None guifg=LightGreen guibg=bg
+    highlight Exception gui=None guifg=LightGreen guibg=bg
+
+highlight PreProc       guifg=SkyBlue1
+hi Include gui=None guifg=LightSteelBlue3 guibg=bg
+hi Define gui=None guifg=LightSteelBlue2 guibg=bg
+hi Macro gui=None guifg=LightSkyBlue3 guibg=bg
+hi PreCondit gui=None guifg=LightSkyBlue2 guibg=bg
+
+highlight Type          gui=NONE guifg=LightBlue
+hi StorageClass gui=None guifg=LightBlue guibg=bg
+hi Structure gui=None guifg=LightBlue guibg=bg
+hi Typedef gui=None guifg=LightBlue guibg=bg
+
+"highlight Special       gui=bold guifg=aquamarine3
+highlight Special       guifg=#999999
+    "hi SpecialChar gui=bold guifg=White guibg=bg
+    "hi Tag gui=bold guifg=White guibg=bg
+    "hi Delimiter gui=bold guifg=White guibg=bg
+    "hi SpecialComment gui=bold guifg=White guibg=bg
+    "hi Debug gui=bold guifg=White guibg=bg
+
+highlight Underlined gui=underline guifg=honeydew4 guibg=bg
+
+highlight Ignore    guifg=#204050
+
+highlight Error      guifg=LightYellow  guibg=FireBrick
+
+highlight Todo          guifg=Cyan guibg=#507080
+
+""" OLD COLORS
+
+
+
diff --git a/vim/colors/oceandeep.vim b/vim/colors/oceandeep.vim
new file mode 100644 (file)
index 0000000..08923d0
--- /dev/null
@@ -0,0 +1,140 @@
+" Vim color file
+" Maintainer: Tom Regner <vim@tomsdiner.org>
+" Last Change:
+"
+" 2007-10-16 change by Alexei Alexandrov
+" - highlight CursorColumn
+"
+" 2007-08-20 change by Diederick Niehorster
+" - highlight CursorLine
+"
+" 2007-02-05
+" - included changes from Keffin Barnaby
+"   (vim>=7.0 PMenu and Spellchecking)
+"
+" 2006-09-06
+" - changed String to DarkCyan, Macro to DarkRed
+"
+" 2006-09-05
+" - more console-colors
+" - added console-colors, clean-up
+"
+" Version: 1.2.5
+" URL: http://vim.sourceforge.net/script.php?script_id=368
+
+
+""" Init
+set background=dark
+highlight clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name = "oceandeep"
+
+"""" GUI 
+
+highlight Cursor        gui=None guibg=PaleTurquoise3 guifg=White
+highlight CursorIM      gui=bold guifg=white guibg=PaleTurquoise3
+highlight CursorLine    gui=None guibg=#003853
+highlight CursorColumn  gui=None guibg=#003853
+highlight Directory     guifg=LightSeaGreen guibg=bg
+highlight DiffAdd       gui=None guifg=fg guibg=DarkCyan
+highlight DiffChange    gui=None guifg=fg guibg=Green4
+highlight DiffDelete    gui=None guifg=fg guibg=black
+highlight DiffText      gui=bold guifg=fg guibg=bg
+highlight ErrorMsg      guifg=LightYellow  guibg=FireBrick
+highlight VertSplit     gui=NONE guifg=black guibg=grey60
+highlight Folded        gui=bold guibg=#305060 guifg=#b0d0e0
+highlight FoldColumn    gui=bold guibg=#305060 guifg=#b0d0e0
+highlight IncSearch     gui=reverse guifg=fg guibg=bg
+highlight LineNr        gui=bold guibg=grey6 guifg=LightSkyBlue3
+highlight ModeMsg       guibg=DarkGreen guifg=LightGreen
+highlight MoreMsg       gui=bold  guifg=SeaGreen4 guibg=bg
+if version < 600
+    " same as SpecialKey
+    highlight NonText   guibg=#123A4A guifg=#3D5D6D
+else
+    " Bottom fill (use e.g. same as LineNr)
+    highlight NonText   gui=None guibg=#103040 guifg=LightSkyBlue
+endif
+highlight Normal        gui=None guibg=#103040 guifg=honeydew2
+highlight Question      gui=bold  guifg=SeaGreen2 guibg=bg
+highlight Search        gui=NONE guibg=LightSkyBlue4 guifg=NONE
+highlight SpecialKey    guibg=#103040 guifg=#324262
+highlight StatusLine    gui=bold guibg=grey88 guifg=black
+highlight StatusLineNC  gui=NONE guibg=grey60 guifg=grey10
+highlight Title         gui=bold  guifg=MediumOrchid1 guibg=bg
+highlight Visual        gui=reverse guibg=WHITE guifg=SeaGreen
+highlight VisualNOS     gui=bold,underline guifg=fg guibg=bg
+highlight WarningMsg    gui=bold guifg=FireBrick1 guibg=bg
+highlight WildMenu      gui=bold guibg=Chartreuse guifg=Black
+
+highlight Comment       gui=None guifg=#507080
+highlight Constant      guifg=cyan3 guibg=bg
+highlight String        gui=None guifg=turquoise2 guibg=bg
+highlight Number        gui=None guifg=Cyan guibg=bg
+highlight Boolean       gui=bold guifg=Cyan guibg=bg
+highlight Identifier    guifg=LightSkyBlue3
+highlight Function      gui=None guifg=DarkSeaGreen3 guibg=bg
+
+highlight Statement     gui=NONE guifg=LightGreen
+highlight Conditional   gui=None guifg=LightGreen guibg=bg
+highlight Repeat        gui=None guifg=SeaGreen2 guibg=bg
+highlight Operator      gui=None guifg=Chartreuse guibg=bg
+highlight Keyword       gui=bold guifg=LightGreen guibg=bg
+highlight Exception     gui=bold guifg=LightGreen guibg=bg
+
+highlight PreProc       guifg=SkyBlue1
+highlight Include       gui=None guifg=LightSteelBlue3 guibg=bg
+highlight Define        gui=None guifg=LightSteelBlue2 guibg=bg
+highlight Macro         gui=None guifg=LightSkyBlue3 guibg=bg
+highlight PreCondit     gui=None guifg=LightSkyBlue2 guibg=bg
+
+highlight Type          gui=NONE guifg=LightBlue
+highlight StorageClass  gui=None guifg=LightBlue guibg=bg
+highlight Structure     gui=None guifg=LightBlue guibg=bg
+highlight Typedef       gui=None guifg=LightBlue guibg=bg
+
+highlight Special       gui=bold guifg=aquamarine3
+highlight Underlined    gui=underline guifg=honeydew4 guibg=bg
+highlight Ignore        guifg=#204050
+highlight Error         guifg=LightYellow  guibg=FireBrick
+highlight Todo          guifg=Cyan guibg=#507080
+if v:version >= 700
+    highlight PMenu      gui=bold guibg=LightSkyBlue4 guifg=honeydew2
+    highlight PMenuSel   gui=bold guibg=DarkGreen guifg=honeydew2
+    highlight PMenuSbar  gui=bold guibg=LightSkyBlue4
+    highlight PMenuThumb gui=bold guibg=DarkGreen
+    highlight SpellBad   gui=undercurl guisp=Red
+    highlight SpellRare  gui=undercurl guisp=Orange
+    highlight SpellLocal gui=undercurl guisp=Orange
+    highlight SpellCap   gui=undercurl guisp=Yellow
+endif
+
+""" Console
+if v:version >= 700
+    highlight PMenu      cterm=bold ctermbg=DarkGreen ctermfg=Gray
+    highlight PMenuSel   cterm=bold ctermbg=Yellow ctermfg=Gray
+    highlight PMenuSbar  cterm=bold ctermbg=DarkGreen
+    highlight PMenuThumb cterm=bold ctermbg=Yellow
+    highlight SpellBad   ctermbg=Red
+    highlight SpellRare  ctermbg=Red
+    highlight SpellLocal ctermbg=Red
+    highlight SpellCap   ctermbg=Yellow
+endif
+
+highlight Normal        ctermfg=Gray ctermbg=None
+highlight Search        ctermfg=Black ctermbg=Red cterm=NONE
+highlight Visual        cterm=reverse
+highlight Cursor        ctermfg=Black ctermbg=Green cterm=bold
+highlight Special       ctermfg=Brown
+highlight Comment       ctermfg=DarkGray
+highlight StatusLine    ctermfg=Blue ctermbg=White
+highlight Statement     ctermfg=Yellow cterm=NONE
+highlight Type          cterm=NONE
+highlight Macro         ctermfg=DarkRed
+highlight Identifier    ctermfg=DarkYellow
+highlight Structure     ctermfg=DarkGreen
+highlight String        ctermfg=DarkCyan
+
+" vim: sw=4 ts=4 et
diff --git a/vim/colors/oceanlight.vim b/vim/colors/oceanlight.vim
new file mode 100644 (file)
index 0000000..08fb22e
--- /dev/null
@@ -0,0 +1,105 @@
+" Vim color file
+" Maintainer: Hรฅkan Wikstrรถm <hakan@wikstrom.st>
+" Last Change: 2005-01-06
+" Version: 0.1
+" URL: 
+" Originally based on oceandeep by Tom Regner (Vim script #368)
+
+
+""" Init
+set background=light
+highlight clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name = "oceanlight"
+
+
+""""""""\ Colors \""""""""
+
+
+"""" GUI Colors
+
+highlight Cursor        gui=None guibg=PaleTurquoise3 guifg=White
+highlight CursorIM gui=none guifg=white guibg=PaleTurquoise3
+highlight Directory     guifg=SeaGreen guibg=bg
+highlight DiffAdd gui=None guifg=SteelBlue guibg=LightGray
+highlight DiffChange gui=None guifg=fg guibg=CadetBlue
+highlight DiffDelete gui=None guifg=LightGray guibg=SteelBlue
+highlight DiffText gui=none guifg=fg guibg=bg
+highlight ErrorMsg      guifg=FireBrick  guibg=bg
+highlight VertSplit    gui=NONE guifg=black guibg=grey60
+highlight Folded        gui=none guibg=LightSteelBlue guifg=SteelBlue
+highlight FoldColumn        gui=none guibg=LightSteelBLue guifg=SteelBlue
+highlight IncSearch gui=reverse guifg=fg guibg=bg
+highlight LineNr        gui=none guibg=#d3d3d3 guifg=#5daf83
+highlight ModeMsg       guibg=CadetBlue guifg=LightGrey
+highlight MoreMsg       gui=none  guifg=CadetBlue guibg=bg
+if version < 600
+    " same as SpecialKey
+    highlight NonText       guibg=#d3d3d3 guifg=#3D5D6D
+else
+    " Bottom fill (use e.g. same as LineNr)
+    highlight NonText       gui=None guibg=#d3d3d3 guifg=#5daf83
+endif
+highlight Normal        gui=None guibg=#f5f5f5 guifg=DimGray
+highlight Question      gui=none  guifg=SeaGreen2 guibg=bg
+highlight Search        gui=NONE guibg=SlateGray2 guifg=NONE
+highlight SpecialKey    guibg=LightGray guifg=CadetBlue
+highlight StatusLine    gui=none guibg=SlateGrey guifg=LightGrey
+highlight StatusLineNC  gui=NONE guibg=LightGrey guifg=SlateGrey
+highlight Title         gui=none  guifg=MediumOrchid1 guibg=bg
+highlight Visual        gui=reverse guibg=slategray4 guifg=SlateGray2
+highlight VisualNOS     gui=none,underline guifg=fg guibg=bg
+highlight WarningMsg    gui=none guifg=FireBrick1 guibg=bg
+highlight WildMenu      gui=none guibg=Chartreuse guifg=Black
+
+
+"""" Syntax Colors
+
+"highlight Comment       gui=reverse guifg=#507080
+highlight Comment       gui=None guifg=LightSteelBlue
+
+highlight Constant      guifg=#483d8b guibg=bg
+hi String gui=None guifg=MediumAquamarine guibg=bg
+    "hi Character gui=None guifg=Cyan guibg=bg
+    highlight Number gui=None guifg=MediumSeaGreen guibg=bg
+    highlight Boolean gui=none guifg=DarkSeaGreen guibg=bg
+    "hi Float gui=None guifg=Cyan guibg=bg
+
+highlight Identifier    guifg=CornflowerBlue
+hi Function gui=None guifg=DarkSeaGreen guibg=bg
+
+highlight Statement     gui=NONE guifg=SeaGreen
+    highlight Conditional gui=None guifg=#5daf83 guibg=bg
+    highlight Repeat gui=None guifg=#5daf83 guibg=bg
+    "hi Label gui=None guifg=seagreen guibg=bg
+    highlight Operator gui=None guifg=LightSlateBlue guibg=bg
+    highlight Keyword gui=none guifg=SeaGreen guibg=bg
+    highlight Exception gui=none guifg=SeaGreen guibg=bg
+
+highlight PreProc       guifg=SkyBlue1
+hi Include gui=None guifg=SteelBlue guibg=bg
+hi Define gui=None guifg=LightSteelBlue2 guibg=bg
+hi Macro gui=None guifg=LightSkyBlue3 guibg=bg
+hi PreCondit gui=None guifg=LightSkyBlue2 guibg=bg
+
+highlight Type          gui=NONE guifg=SteelBlue
+hi StorageClass gui=None guifg=SteelBlue guibg=bg
+hi Structure gui=None guifg=SteelBlue guibg=bg
+hi Typedef gui=None guifg=SteelBlue guibg=bg
+
+highlight Special       gui=none guifg=aquamarine3
+    "hi SpecialChar gui=none guifg=White guibg=bg
+    "hi Tag gui=none guifg=White guibg=bg
+    "hi Delimiter gui=none guifg=White guibg=bg
+    "hi SpecialComment gui=none guifg=White guibg=bg
+    "hi Debug gui=none guifg=White guibg=bg
+
+highlight Underlined gui=underline guifg=honeydew4 guibg=bg
+
+highlight Ignore    guifg=#204050
+
+highlight Error      guifg=FireBrick gui=Bold  guibg=bg
+
+highlight Todo          guifg=LightSkyBlue guibg=SlateGray
diff --git a/vim/colors/olive.vim b/vim/colors/olive.vim
new file mode 100644 (file)
index 0000000..8935c52
--- /dev/null
@@ -0,0 +1,119 @@
+" Vim color file
+" Maintainer:   Charles <cherry_avium@yahoo.com>
+" Last Change:  11 June 2004
+" URL:          http://
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="olive"
+
+"=======================================================
+hi Normal               guifg=#D9D9C3       guibg=#333300
+hi Cursor               guifg=black         guibg=white
+hi CursorIM             guifg=black         guibg=green
+hi Directory            guifg=gold                              gui=underline
+"hi DiffAdd             
+"hi DiffChange  
+"hi DiffDelete  
+"hi DiffText    
+hi ErrorMsg                                 guibg=indianred
+"hi VertSplit           guifg=gold
+hi Folded               guifg=khaki         guibg=darkolivegreen    gui=underline
+hi FoldColumn           guifg=khaki         guibg=darkolivegreen    gui=none
+hi IncSearch            guifg=black         guibg=khaki
+hi LineNr               guifg=gray80
+hi ModeMsg              guifg=greenyellow                       gui=bold
+hi MoreMsg              guifg=greenyellow                       gui=bold
+"hi NonText             guibg=black
+hi Question             guifg=yellowgreen                       gui=NONE        
+hi Search               guifg=black         guibg=khaki         gui=NONE
+hi SpecialKey           guifg=black         guibg=darkkhaki
+hi StatusLine           guifg=palegoldenrod guibg=#808000       gui=none
+hi StatusLineNC         guifg=gray          guibg=darkolivegreen    gui=none
+hi Title                guifg=gold                              gui=bold                
+hi Visual               guifg=black         guibg=darkkhaki     gui=NONE
+"hi VisualNOS   
+hi WarningMsg           guifg=palevioletred
+"hi WildMenu    
+"hi Menu                
+"hi Scrollbar
+"hi Tooltip             
+
+
+" ============================================================
+" syntax highlighting groups
+" ============================================================
+hi Comment              guifg=darkkhaki     guibg=#4C4C00       gui=underline 
+
+hi Constant             guifg=navajowhite
+hi String               guifg=greenyellow
+"hi Character
+"hi Number
+"hi Boolean
+"hi Float
+
+hi Identifier           guifg=lightsteelblue    
+" hi Function                               guibg=gray60
+
+hi Statement            guifg=darkseagreen                      gui=bold
+"hi Conditional
+"hi Repeat
+"hi Label
+hi Operator             guifg=gold
+"hi Keyword
+"hi Exception
+
+hi PreProc              guifg=sandybrown                        gui=bold
+"hi Include
+"hi Define
+"hi Macro
+"hi PreCondit
+
+hi Type                 guifg=goldenrod
+"hi StorageClass
+"hi Structure
+"hi Typedef
+
+hi Special              guifg=navajowhite                       gui=underline
+"hi SpecialChar
+"hi Tag
+"hi Delimiter
+"hi SpecialComment
+"hi Debug
+
+hi Underlined                                                   gui=underline
+
+hi Ignore               guifg=black
+
+hi Error                guifg=white
+
+hi Todo                 guifg=black         guibg=gold          gui=NONE
+
+" =================================================================
+" Language specific color
+" =================================================================
+
+" C / C++
+hi cIncluded            guifg=yellowgreen
+
+" HTML
+hi Title                guifg=palegoldenrod 
+
+" VIM
+hi VimError             guifg=red                               gui=bold
+hi VimOption            guifg=gold
+
+" TeX / LaTeX
+hi texSection           guifg=greenyellow
+" tex between { and }
+hi texMatcher           guifg=yellowgreen                       gui=none
+hi texMath                                                      gui=none
+
diff --git a/vim/colors/papayawhip.vim b/vim/colors/papayawhip.vim
new file mode 100644 (file)
index 0000000..5f8725a
--- /dev/null
@@ -0,0 +1,31 @@
+" Vim color file
+" Maintainer:   Gerald S. Williams
+" Last Change:  2003 Apr 17
+
+" A nice light background (you guessed it, PapayaWhip) that's relatively easy
+" on the eyes yet very usable. Not nearly as "puffy" as peachpuff.
+"
+" Only values that differ from defaults are specified.
+
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "PapayaWhip"
+
+hi Normal guifg=#3f1f1f guibg=PapayaWhip ctermbg=Gray ctermfg=Black
+hi NonText guibg=Moccasin guifg=Brown ctermfg=Brown
+hi LineNr guibg=Moccasin
+hi DiffDelete guibg=LightRed guifg=Black ctermbg=DarkRed ctermfg=White
+hi DiffAdd guibg=LightGreen ctermbg=DarkGreen ctermfg=White
+hi DiffChange guibg=LightCyan3 ctermbg=DarkCyan ctermfg=White
+hi DiffText gui=NONE guibg=Gray80 ctermbg=DarkCyan ctermfg=Yellow
+hi Comment guifg=MediumBlue
+hi Constant guifg=DeepPink
+hi PreProc guifg=DarkMagenta
+hi StatusLine guibg=White guifg=#5f3705 cterm=bold ctermbg=Brown ctermfg=White
+hi StatusLineNC gui=None guibg=Gray
+hi VertSplit gui=None guibg=Gray
+hi Identifier guifg=#005f5f
+hi Statement ctermfg=DarkRed
diff --git a/vim/colors/peaksea.vim b/vim/colors/peaksea.vim
new file mode 100644 (file)
index 0000000..359a9ac
--- /dev/null
@@ -0,0 +1,597 @@
+" Vim color file --- psc (peak sea color) "Lite version"
+" Maintainer:  Pan, Shi Zhu <Go to the following URL for my email>
+" URL:         http://vim.sourceforge.net/scripts/script.php?script_id=760
+" Last Change: 31 Oct 2008
+" Version:     3.3
+"
+"      Comments and e-mails are welcomed, thanks.
+"
+"      The peaksea color is simply a colorscheme with the default settings of
+"      the original ps_color. Lite version means there's no custom settings
+"      and fancy features such as integration with reloaded.vim 
+"
+"      The full version of ps_color.vim will be maintained until Vim 8.
+"      By then there will be only the lite version: peaksea.vim
+"
+" Note: Please set the background option in your .vimrc and/or .gvimrc
+"
+"      It is much better *not* to set 'background' option inside
+"      a colorscheme file.  because ":set background" inside a colorscheme
+"      may cause colorscheme be sourced twice or in the worst case result an
+"      infinite loop.
+"
+" Color Scheme Overview: 
+"      :ru syntax/hitest.vim
+"
+" Relevant Help: 
+"      :h highlight-groups
+"      :h psc-cterm-color-table
+"
+" Colors Order:
+"      #rrggbb
+"
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = expand("<sfile>:t:r")
+
+" I don't want to abuse folding, but here folding is used to avoid confusion. 
+if &background=='light' 
+  " for background=light {{{2
+  " LIGHT COLOR DEFINE START
+
+  hi Normal            guifg=#000000   guibg=#e0e0e0   gui=NONE
+  hi Search            guifg=NONE      guibg=#f8f8f8   gui=NONE
+  hi Visual            guifg=NONE      guibg=#a6caf0   gui=NONE
+  hi Cursor            guifg=#f0f0f0   guibg=#008000   gui=NONE
+  " The idea of CursorIM is pretty good, however, the feature is still buggy
+  " in the current version (Vim 7.0).
+  " The following line will be kept commented until the bug fixed.
+  "
+  " hi CursorIM                guifg=#f0f0f0   guibg=#800080
+  hi Special           guifg=#907000   guibg=NONE      gui=NONE
+  hi Comment           guifg=#606000   guibg=NONE      gui=NONE
+  hi Number            guifg=#907000   guibg=NONE      gui=NONE
+  hi Constant          guifg=#007068   guibg=NONE      gui=NONE
+  hi StatusLine                guifg=fg        guibg=#a6caf0   gui=NONE
+  hi LineNr            guifg=#686868   guibg=NONE      gui=NONE
+  hi Question          guifg=fg        guibg=#d0d090   gui=NONE
+  hi PreProc           guifg=#009030   guibg=NONE      gui=NONE
+  hi Statement         guifg=#2060a8   guibg=NONE      gui=NONE
+  hi Type              guifg=#0850a0   guibg=NONE      gui=NONE
+  hi Todo              guifg=#800000   guibg=#e0e090   gui=NONE
+  " NOTE THIS IS IN THE WARM SECTION
+  hi Error             guifg=#c03000   guibg=NONE      gui=NONE
+  hi Identifier                guifg=#a030a0   guibg=NONE      gui=NONE
+  hi ModeMsg           guifg=fg        guibg=#b0b0e0   gui=NONE
+  hi VisualNOS         guifg=fg        guibg=#b0b0e0   gui=NONE
+  hi SpecialKey                guifg=#1050a0   guibg=NONE      gui=NONE
+  hi NonText           guifg=#002090   guibg=#d0d0d0   gui=NONE
+  hi Directory         guifg=#a030a0   guibg=NONE      gui=NONE
+  hi ErrorMsg          guifg=fg        guibg=#f0b090   gui=NONE
+  hi MoreMsg           guifg=#489000   guibg=NONE      gui=NONE
+  hi Title             guifg=#a030a0   guibg=NONE      gui=NONE
+  hi WarningMsg                guifg=#b02000   guibg=NONE      gui=NONE
+  hi WildMenu          guifg=fg        guibg=#d0d090   gui=NONE
+  hi Folded            guifg=NONE      guibg=#b0e0b0   gui=NONE
+  hi FoldColumn                guifg=fg        guibg=#90e090   gui=NONE
+  hi DiffAdd           guifg=NONE      guibg=#b0b0e0   gui=NONE
+  hi DiffChange                guifg=NONE      guibg=#e0b0e0   gui=NONE
+  hi DiffDelete                guifg=#002090   guibg=#d0d0d0   gui=NONE
+  hi DiffText          guifg=NONE      guibg=#c0e080   gui=NONE
+  hi SignColumn                guifg=fg        guibg=#90e090   gui=NONE
+
+  hi IncSearch         guifg=#f0f0f0   guibg=#806060   gui=NONE
+  hi StatusLineNC      guifg=fg        guibg=#c0c0c0   gui=NONE
+  hi VertSplit         guifg=fg        guibg=#c0c0c0   gui=NONE
+  hi Underlined                guifg=#6a5acd   guibg=NONE      gui=underline
+  hi Ignore            guifg=bg        guibg=NONE
+  " NOTE THIS IS IN THE WARM SECTION
+  if v:version >= 700
+    if has('spell')
+      hi SpellBad      guifg=NONE      guibg=NONE      guisp=#c03000
+      hi SpellCap      guifg=NONE      guibg=NONE      guisp=#2060a8
+      hi SpellRare     guifg=NONE      guibg=NONE      guisp=#a030a0
+      hi SpellLocal    guifg=NONE      guibg=NONE      guisp=#007068
+    endif
+    hi Pmenu           guifg=fg        guibg=#e0b0e0
+    hi PmenuSel                guifg=#f0f0f0   guibg=#806060   gui=NONE
+    hi PmenuSbar       guifg=fg        guibg=#c0c0c0   gui=NONE
+    hi PmenuThumb      guifg=fg        guibg=#c0e080   gui=NONE
+    hi TabLine         guifg=fg        guibg=#c0c0c0   gui=NONE
+    hi TabLineFill     guifg=fg        guibg=#c0c0c0   gui=NONE
+    hi TabLineSel      guifg=fg        guibg=NONE      gui=NONE
+    hi CursorColumn    guifg=NONE      guibg=#f0b090
+    hi CursorLine      guifg=NONE      guibg=NONE      gui=underline
+    hi MatchParen      guifg=NONE      guibg=#c0e080
+  endif
+
+  " LIGHT COLOR DEFINE END
+
+  " Vim 7 added stuffs
+  if v:version >= 700
+    hi Ignore          gui=NONE
+
+    " the gui=undercurl guisp could only support in Vim 7
+    if has('spell')
+      hi SpellBad      gui=undercurl
+      hi SpellCap      gui=undercurl
+      hi SpellRare     gui=undercurl
+      hi SpellLocal    gui=undercurl
+    endif
+    hi TabLine         gui=underline
+    hi TabLineFill     gui=underline
+    hi CursorLine      gui=underline
+  endif
+
+  " For reversed stuffs, clear the reversed prop and set the bold prop again
+  hi IncSearch         gui=bold
+  hi StatusLine                gui=bold
+  hi StatusLineNC      gui=bold
+  hi VertSplit         gui=bold
+  hi Visual            gui=bold
+
+  " Enable the bold property
+  hi Question          gui=bold
+  hi DiffText          gui=bold
+  hi Statement         gui=bold
+  hi Type              gui=bold
+  hi MoreMsg           gui=bold
+  hi ModeMsg           gui=bold
+  hi NonText           gui=bold
+  hi Title             gui=bold
+  hi DiffDelete                gui=bold
+  hi TabLineSel                gui=bold
+
+  " gui define for background=light end here
+
+  if &t_Co==256
+    " 256color light terminal support here
+
+    hi Normal          ctermfg=16      ctermbg=254     cterm=NONE
+    " Comment/Uncomment the following line to disable/enable transparency
+    "hi Normal         ctermfg=16      ctermbg=NONE    cterm=NONE
+    hi Search          ctermfg=NONE    ctermbg=231     cterm=NONE
+    hi Visual          ctermfg=NONE    ctermbg=153     cterm=NONE
+    hi Cursor          ctermfg=255     ctermbg=28      cterm=NONE
+    " hi CursorIM      ctermfg=255     ctermbg=90
+    hi Special         ctermfg=94      ctermbg=NONE    cterm=NONE
+    hi Comment         ctermfg=58      ctermbg=NONE    cterm=NONE
+    hi Number          ctermfg=94      ctermbg=NONE    cterm=NONE
+    hi Constant                ctermfg=23      ctermbg=NONE    cterm=NONE
+    hi StatusLine      ctermfg=fg      ctermbg=153     cterm=NONE
+    hi LineNr          ctermfg=242     ctermbg=NONE    cterm=NONE
+    hi Question                ctermfg=fg      ctermbg=186     cterm=NONE
+    hi PreProc         ctermfg=29      ctermbg=NONE    cterm=NONE
+    hi Statement       ctermfg=25      ctermbg=NONE    cterm=NONE
+    hi Type            ctermfg=25      ctermbg=NONE    cterm=NONE
+    hi Todo            ctermfg=88      ctermbg=186     cterm=NONE
+    " NOTE THIS IS IN THE WARM SECTION
+    hi Error           ctermfg=130     ctermbg=NONE    cterm=NONE
+    hi Identifier      ctermfg=133     ctermbg=NONE    cterm=NONE
+    hi ModeMsg         ctermfg=fg      ctermbg=146     cterm=NONE
+    hi VisualNOS       ctermfg=fg      ctermbg=146     cterm=NONE
+    hi SpecialKey      ctermfg=25      ctermbg=NONE    cterm=NONE
+    hi NonText         ctermfg=18      ctermbg=252     cterm=NONE
+    " Comment/Uncomment the following line to disable/enable transparency
+    "hi NonText                ctermfg=18      ctermbg=NONE    cterm=NONE
+    hi Directory       ctermfg=133     ctermbg=NONE    cterm=NONE
+    hi ErrorMsg                ctermfg=fg      ctermbg=216     cterm=NONE
+    hi MoreMsg         ctermfg=64      ctermbg=NONE    cterm=NONE
+    hi Title           ctermfg=133     ctermbg=NONE    cterm=NONE
+    hi WarningMsg      ctermfg=124     ctermbg=NONE    cterm=NONE
+    hi WildMenu                ctermfg=fg      ctermbg=186     cterm=NONE
+    hi Folded          ctermfg=NONE    ctermbg=151     cterm=NONE
+    hi FoldColumn      ctermfg=fg      ctermbg=114     cterm=NONE
+    hi DiffAdd         ctermfg=NONE    ctermbg=146     cterm=NONE
+    hi DiffChange      ctermfg=NONE    ctermbg=182     cterm=NONE
+    hi DiffDelete      ctermfg=18      ctermbg=252     cterm=NONE
+    hi DiffText                ctermfg=NONE    ctermbg=150     cterm=NONE
+    hi SignColumn      ctermfg=fg      ctermbg=114     cterm=NONE
+
+    hi IncSearch       ctermfg=255     ctermbg=95      cterm=NONE
+    hi StatusLineNC    ctermfg=fg      ctermbg=250     cterm=NONE
+    hi VertSplit       ctermfg=fg      ctermbg=250     cterm=NONE
+    hi Underlined      ctermfg=62      ctermbg=NONE    cterm=underline
+    hi Ignore          ctermfg=bg      ctermbg=NONE
+    " NOTE THIS IS IN THE WARM SECTION
+    if v:version >= 700
+      if has('spell')
+        if 0
+          " ctermsp is not supported in Vim7, we ignore it.
+          hi SpellBad  cterm=undercurl ctermbg=NONE    ctermfg=130
+          hi SpellCap  cterm=undercurl ctermbg=NONE    ctermfg=25
+          hi SpellRare cterm=undercurl ctermbg=NONE    ctermfg=133
+          hi SpellLocal        cterm=undercurl ctermbg=NONE    ctermfg=23
+        else
+          hi SpellBad  cterm=undercurl ctermbg=NONE    ctermfg=NONE
+          hi SpellCap  cterm=undercurl ctermbg=NONE    ctermfg=NONE
+          hi SpellRare cterm=undercurl ctermbg=NONE    ctermfg=NONE
+          hi SpellLocal        cterm=undercurl ctermbg=NONE    ctermfg=NONE
+        endif
+      endif
+      hi Pmenu         ctermfg=fg      ctermbg=182
+      hi PmenuSel      ctermfg=255     ctermbg=95      cterm=NONE
+      hi PmenuSbar     ctermfg=fg      ctermbg=250     cterm=NONE
+      hi PmenuThumb    ctermfg=fg      ctermbg=150     cterm=NONE
+      hi TabLine       ctermfg=fg      ctermbg=250     cterm=NONE
+      hi TabLineFill   ctermfg=fg      ctermbg=250     cterm=NONE
+      hi TabLineSel    ctermfg=fg      ctermbg=NONE    cterm=NONE
+      hi CursorColumn  ctermfg=NONE    ctermbg=216
+      hi CursorLine    ctermfg=NONE    ctermbg=NONE    cterm=underline
+      hi MatchParen    ctermfg=NONE    ctermbg=150
+    endif
+
+    hi TabLine         cterm=underline
+    hi TabLineFill     cterm=underline
+    hi CursorLine      cterm=underline
+
+    " For reversed stuffs, clear the reversed prop and set the bold prop again
+    hi IncSearch       cterm=bold
+    hi StatusLine      cterm=bold
+    hi StatusLineNC    cterm=bold
+    hi VertSplit       cterm=bold
+    hi Visual          cterm=bold
+
+    hi NonText         cterm=bold
+    hi Question                cterm=bold
+    hi Title           cterm=bold
+    hi DiffDelete      cterm=bold
+    hi DiffText                cterm=bold
+    hi Statement       cterm=bold
+    hi Type            cterm=bold
+    hi MoreMsg         cterm=bold
+    hi ModeMsg         cterm=bold
+    hi TabLineSel      cterm=bold
+
+    hi lCursor         ctermfg=bg      ctermbg=fg      cterm=NONE
+  endif " t_Co==256
+  " }}}2
+elseif &background=='dark' 
+  " for background=dark {{{2
+  " DARK COLOR DEFINE START
+
+  hi Normal            guifg=#d0d0d0   guibg=#202020   gui=NONE
+  hi Comment           guifg=#d0d090   guibg=NONE      gui=NONE
+  hi Constant          guifg=#80c0e0   guibg=NONE      gui=NONE
+  hi Number            guifg=#e0c060   guibg=NONE      gui=NONE
+  hi Identifier                guifg=#f0c0f0   guibg=NONE      gui=NONE
+  hi Statement         guifg=#c0d8f8   guibg=NONE      gui=NONE
+  hi PreProc           guifg=#60f080   guibg=NONE      gui=NONE
+  hi Type              guifg=#b0d0f0   guibg=NONE      gui=NONE
+  hi Special           guifg=#e0c060   guibg=NONE      gui=NONE
+  hi Error             guifg=#f08060   guibg=NONE      gui=NONE
+  hi Todo              guifg=#800000   guibg=#d0d090   gui=NONE
+  hi Search            guifg=NONE      guibg=#800000   gui=NONE
+  hi Visual            guifg=#000000   guibg=#a6caf0   gui=NONE
+  hi Cursor            guifg=#000000   guibg=#00f000   gui=NONE
+  " NOTE THIS IS IN THE COOL SECTION
+  " hi CursorIM                guifg=#000000   guibg=#f000f0   gui=NONE
+  hi StatusLine                guifg=#000000   guibg=#a6caf0   gui=NONE
+  hi LineNr            guifg=#b0b0b0   guibg=NONE      gui=NONE
+  hi Question          guifg=#000000   guibg=#d0d090   gui=NONE
+  hi ModeMsg           guifg=fg        guibg=#000080   gui=NONE
+  hi VisualNOS         guifg=fg        guibg=#000080   gui=NONE
+  hi SpecialKey                guifg=#b0d0f0   guibg=NONE      gui=NONE
+  hi NonText           guifg=#6080f0   guibg=#101010   gui=NONE
+  hi Directory         guifg=#80c0e0   guibg=NONE      gui=NONE
+  hi ErrorMsg          guifg=#d0d090   guibg=#800000   gui=NONE
+  hi MoreMsg           guifg=#c0e080   guibg=NONE      gui=NONE
+  hi Title             guifg=#f0c0f0   guibg=NONE      gui=NONE
+  hi WarningMsg                guifg=#f08060   guibg=NONE      gui=NONE
+  hi WildMenu          guifg=#000000   guibg=#d0d090   gui=NONE
+  hi Folded            guifg=NONE      guibg=#004000   gui=NONE
+  hi FoldColumn                guifg=#e0e0e0   guibg=#008000   gui=NONE
+  hi DiffAdd           guifg=NONE      guibg=#000080   gui=NONE
+  hi DiffChange                guifg=NONE      guibg=#800080   gui=NONE
+  hi DiffDelete                guifg=#6080f0   guibg=#202020   gui=NONE
+  hi DiffText          guifg=#000000   guibg=#c0e080   gui=NONE
+  hi SignColumn                guifg=#e0e0e0   guibg=#008000   gui=NONE
+  hi IncSearch         guifg=#000000   guibg=#d0d0d0   gui=NONE
+  hi StatusLineNC      guifg=#000000   guibg=#c0c0c0   gui=NONE
+  hi VertSplit         guifg=#000000   guibg=#c0c0c0   gui=NONE
+  hi Underlined                guifg=#80a0ff   guibg=NONE      gui=underline 
+  hi Ignore            guifg=#000000   guibg=NONE
+  " NOTE THIS IS IN THE COOL SECTION
+  if v:version >= 700
+    if has('spell')
+    " the guisp= could only support in Vim 7
+      hi SpellBad      guifg=NONE      guibg=NONE      guisp=#f08060
+      hi SpellCap      guifg=NONE      guibg=NONE      guisp=#6080f0
+      hi SpellRare     guifg=NONE      guibg=NONE      guisp=#f0c0f0
+      hi SpellLocal    guifg=NONE      guibg=NONE      guisp=#c0d8f8
+    endif
+    hi Pmenu           guifg=fg        guibg=#800080
+    hi PmenuSel                guifg=#000000   guibg=#d0d0d0   gui=NONE
+    hi PmenuSbar       guifg=fg        guibg=#000080   gui=NONE
+    hi PmenuThumb      guifg=fg        guibg=#008000   gui=NONE
+    hi TabLine         guifg=fg        guibg=#008000   gui=NONE
+    hi TabLineFill     guifg=fg        guibg=#008000   gui=NONE
+    hi TabLineSel      guifg=fg        guibg=NONE      gui=NONE
+    hi CursorColumn    guifg=NONE      guibg=#800000   gui=NONE
+    hi CursorLine      guifg=NONE      guibg=NONE      gui=underline
+    hi MatchParen      guifg=NONE      guibg=#800080
+  endif
+
+  " DARK COLOR DEFINE END
+
+  " Vim 7 added stuffs
+  if v:version >= 700
+    hi Ignore  gui=NONE  
+
+    " the gui=undercurl could only support in Vim 7
+    if has('spell')
+      hi SpellBad      gui=undercurl  
+      hi SpellCap      gui=undercurl  
+      hi SpellRare     gui=undercurl  
+      hi SpellLocal    gui=undercurl 
+    endif
+    hi TabLine         gui=underline  
+    hi TabLineFill     gui=underline  
+    hi Underlined      gui=underline  
+    hi CursorLine      gui=underline 
+  endif
+
+  " gui define for background=dark end here
+
+  if &t_Co==8 || &t_Co==16
+    " for 8-color and 16-color term
+    hi Normal          ctermfg=LightGrey   ctermbg=Black
+    hi Special         ctermfg=Yellow      ctermbg=bg
+    hi Comment         ctermfg=DarkYellow  ctermbg=bg
+    hi Constant                ctermfg=Blue        ctermbg=bg
+    hi Number          ctermfg=Yellow      ctermbg=bg
+    hi LineNr          ctermfg=DarkGrey    ctermbg=bg
+    hi PreProc         ctermfg=Green       ctermbg=bg
+    hi Statement       ctermfg=Cyan        ctermbg=bg
+    hi Type            ctermfg=Cyan        ctermbg=bg
+    hi Error           ctermfg=Red         ctermbg=bg
+    hi Identifier      ctermfg=Magenta     ctermbg=bg
+    hi SpecialKey      ctermfg=Cyan        ctermbg=bg
+    hi NonText         ctermfg=Blue        ctermbg=bg
+    hi Directory       ctermfg=Blue        ctermbg=bg
+    hi MoreMsg         ctermfg=Green       ctermbg=bg
+    hi Title           ctermfg=Magenta     ctermbg=bg
+    hi WarningMsg      ctermfg=Red         ctermbg=bg
+    hi DiffDelete      ctermfg=Blue        ctermbg=bg
+
+    hi Search          ctermfg=NONE        ctermbg=DarkRed
+    hi Visual          ctermfg=Black       ctermbg=DarkCyan
+    hi Cursor          ctermfg=Black       ctermbg=Green
+    hi StatusLine      ctermfg=Black       ctermbg=DarkCyan
+    hi Question                ctermfg=Black       ctermbg=DarkYellow
+    hi Todo            ctermfg=DarkRed     ctermbg=DarkYellow
+    hi Folded          ctermfg=White       ctermbg=DarkGreen
+    hi ModeMsg         ctermfg=Grey        ctermbg=DarkBlue
+    hi VisualNOS       ctermfg=Grey        ctermbg=DarkBlue
+    hi ErrorMsg                ctermfg=DarkYellow  ctermbg=DarkRed
+    hi WildMenu                ctermfg=Black       ctermbg=DarkYellow
+    hi FoldColumn      ctermfg=White       ctermbg=DarkGreen
+    hi SignColumn      ctermfg=White       ctermbg=DarkGreen
+    hi DiffText                ctermfg=Black       ctermbg=DarkYellow
+
+    if v:version >= 700
+      if has('spell')
+        hi SpellBad    ctermfg=NONE    ctermbg=DarkRed
+        hi SpellCap    ctermfg=NONE    ctermbg=DarkBlue
+        hi SpellRare   ctermfg=NONE    ctermbg=DarkMagenta
+        hi SpellLocal  ctermfg=NONE    ctermbg=DarkGreen
+      endif
+      hi Pmenu         ctermfg=fg      ctermbg=DarkMagenta
+      hi PmenuSel      ctermfg=Black   ctermbg=fg
+      hi PmenuSbar     ctermfg=fg      ctermbg=DarkBlue
+      hi PmenuThumb    ctermfg=fg      ctermbg=DarkGreen
+      hi TabLine       ctermfg=fg      ctermbg=DarkGreen       cterm=underline
+      hi TabLineFill   ctermfg=fg      ctermbg=DarkGreen       cterm=underline
+      hi CursorColumn  ctermfg=NONE    ctermbg=DarkRed
+
+      hi TabLineSel    ctermfg=fg      ctermbg=bg
+      hi CursorLine    ctermfg=NONE    ctermbg=bg              cterm=underline
+
+      hi MatchParen    ctermfg=NONE    ctermbg=DarkMagenta
+    endif
+    if &t_Co==8
+      " 8 colour terminal support, this assumes 16 colour is available through
+      " setting the 'bold' attribute, will get bright foreground colour.
+      " However, the bright background color is not available for 8-color terms.
+      "
+      " You can manually set t_Co=16 in your .vimrc to see if your terminal
+      " supports 16 colours, 
+      hi DiffText      cterm=none  
+      hi Visual                cterm=none  
+      hi Cursor                cterm=none  
+      hi Comment       cterm=none  
+      hi Todo          cterm=none  
+      hi StatusLine    cterm=none  
+      hi Question      cterm=none  
+      hi DiffChange    cterm=none  
+      hi ModeMsg       cterm=none  
+      hi VisualNOS     cterm=none  
+      hi ErrorMsg      cterm=none  
+      hi WildMenu      cterm=none  
+      hi DiffAdd       cterm=none  
+      hi Folded                cterm=none  
+      hi DiffDelete    cterm=none  
+      hi Normal                cterm=none  
+      hi PmenuThumb    cterm=none 
+      hi Search                cterm=bold  
+      hi Special       cterm=bold  
+      hi Constant      cterm=bold  
+      hi Number                cterm=bold  
+      hi LineNr                cterm=bold  
+      hi PreProc       cterm=bold  
+      hi Statement     cterm=bold  
+      hi Type          cterm=bold  
+      hi Error         cterm=bold  
+      hi Identifier    cterm=bold  
+      hi SpecialKey    cterm=bold  
+      hi NonText       cterm=bold  
+      hi MoreMsg       cterm=bold  
+      hi Title         cterm=bold  
+      hi WarningMsg    cterm=bold  
+      hi FoldColumn    cterm=bold  
+      hi SignColumn    cterm=bold  
+      hi Directory     cterm=bold  
+      hi DiffDelete    cterm=bold 
+    else
+      " Background > 7 is only available with 16 or more colors
+
+      hi WarningMsg    cterm=none  
+      hi Search                cterm=none  
+      hi Visual                cterm=none  
+      hi Cursor                cterm=none  
+      hi Special       cterm=none  
+      hi Comment       cterm=none  
+      hi Constant      cterm=none  
+      hi Number                cterm=none  
+      hi LineNr                cterm=none  
+      hi PreProc       cterm=none  
+      hi Todo          cterm=none  
+      hi Error         cterm=none  
+      hi Identifier    cterm=none  
+      hi Folded                cterm=none  
+      hi SpecialKey    cterm=none  
+      hi Directory     cterm=none  
+      hi ErrorMsg      cterm=none  
+      hi Normal                cterm=none  
+      hi PmenuThumb    cterm=none 
+      hi WildMenu      cterm=none  
+      hi FoldColumn    cterm=none  
+      hi SignColumn    cterm=none  
+      hi DiffAdd       cterm=none  
+      hi DiffChange    cterm=none  
+      hi Question      cterm=none  
+      hi StatusLine    cterm=none  
+      hi DiffText      cterm=none 
+      hi IncSearch     cterm=reverse  
+      hi StatusLineNC  cterm=reverse  
+      hi VertSplit     cterm=reverse 
+
+      " Well, well, bold font with color 0-7 is not possible.
+      " So, the Question, StatusLine, DiffText cannot act as expected.
+
+      hi Statement     cterm=none  
+      hi Type          cterm=none  
+      hi MoreMsg       cterm=none  
+      hi ModeMsg       cterm=none  
+      hi NonText       cterm=none  
+      hi Title         cterm=none  
+      hi VisualNOS     cterm=none  
+      hi DiffDelete    cterm=none  
+      hi TabLineSel    cterm=none 
+
+    endif
+  elseif &t_Co==256
+    " 256color dark terminal support here
+    hi Normal          ctermfg=252     ctermbg=234     cterm=NONE
+    " Comment/Uncomment the following line to disable/enable transparency
+    "hi Normal         ctermfg=252     ctermbg=NONE    cterm=NONE
+    hi Comment         ctermfg=186     ctermbg=NONE    cterm=NONE
+    hi Constant                ctermfg=110     ctermbg=NONE    cterm=NONE
+    hi Number          ctermfg=179     ctermbg=NONE    cterm=NONE
+    hi Identifier      ctermfg=219     ctermbg=NONE    cterm=NONE
+    hi Statement       ctermfg=153     ctermbg=NONE    cterm=NONE
+    hi PreProc         ctermfg=84      ctermbg=NONE    cterm=NONE
+    hi Type            ctermfg=153     ctermbg=NONE    cterm=NONE
+    hi Special         ctermfg=179     ctermbg=NONE    cterm=NONE
+    hi Error           ctermfg=209     ctermbg=NONE    cterm=NONE
+    hi Todo            ctermfg=88      ctermbg=186     cterm=NONE
+    hi Search          ctermfg=NONE    ctermbg=88      cterm=NONE
+    hi Visual          ctermfg=16      ctermbg=153     cterm=NONE
+    hi Cursor          ctermfg=16      ctermbg=46      cterm=NONE
+    " NOTE THIS IS IN THE COOL SECTION
+    " hi CursorIM      ctermfg=16      ctermbg=201     cterm=NONE
+    hi StatusLine      ctermfg=16      ctermbg=153     cterm=NONE
+    hi LineNr          ctermfg=249     ctermbg=NONE    cterm=NONE
+    hi Question                ctermfg=16      ctermbg=186     cterm=NONE
+    hi ModeMsg         ctermfg=fg      ctermbg=18      cterm=NONE
+    hi VisualNOS       ctermfg=fg      ctermbg=18      cterm=NONE
+    hi SpecialKey      ctermfg=153     ctermbg=NONE    cterm=NONE
+    hi NonText         ctermfg=69      ctermbg=233     cterm=NONE
+    " Comment/Uncomment the following line to disable/enable transparency
+    "hi NonText                ctermfg=69      ctermbg=NONE    cterm=NONE
+    hi Directory       ctermfg=110     ctermbg=NONE    cterm=NONE
+    hi ErrorMsg                ctermfg=186     ctermbg=88      cterm=NONE
+    hi MoreMsg         ctermfg=150     ctermbg=NONE    cterm=NONE
+    hi Title           ctermfg=219     ctermbg=NONE    cterm=NONE
+    hi WarningMsg      ctermfg=209     ctermbg=NONE    cterm=NONE
+    hi WildMenu                ctermfg=16      ctermbg=186     cterm=NONE
+    hi Folded          ctermfg=NONE    ctermbg=22      cterm=NONE
+    hi FoldColumn      ctermfg=254     ctermbg=28      cterm=NONE
+    hi DiffAdd         ctermfg=NONE    ctermbg=18      cterm=NONE
+    hi DiffChange      ctermfg=NONE    ctermbg=90      cterm=NONE
+    hi DiffDelete      ctermfg=69      ctermbg=234     cterm=NONE
+    hi DiffText                ctermfg=16      ctermbg=150     cterm=NONE
+    hi SignColumn      ctermfg=254     ctermbg=28      cterm=NONE
+    hi IncSearch       ctermfg=16      ctermbg=252     cterm=NONE
+    hi StatusLineNC    ctermfg=16      ctermbg=250     cterm=NONE
+    hi VertSplit       ctermfg=16      ctermbg=250     cterm=NONE
+    hi Underlined      ctermfg=111     ctermbg=NONE    cterm=underline 
+    hi Ignore          ctermfg=16      ctermbg=NONE
+    " NOTE THIS IS IN THE COOL SECTION
+    if v:version >= 700
+      if has('spell')
+        " the ctermsp= is not supported in Vim 7 we simply ignored
+        if 0
+          hi SpellBad  cterm=undercurl ctermbg=NONE    ctermfg=209
+          hi SpellCap  cterm=undercurl ctermbg=NONE    ctermfg=69
+          hi SpellRare cterm=undercurl ctermbg=NONE    ctermfg=219
+          hi SpellLocal        cterm=undercurl ctermbg=NONE    ctermfg=153
+        else
+          hi SpellBad  cterm=undercurl ctermbg=NONE    ctermfg=NONE
+          hi SpellCap  cterm=undercurl ctermbg=NONE    ctermfg=NONE
+          hi SpellRare cterm=undercurl ctermbg=NONE    ctermfg=NONE
+          hi SpellLocal        cterm=undercurl ctermbg=NONE    ctermfg=NONE
+        endif
+      endif
+      hi Pmenu         ctermfg=fg      ctermbg=90
+      hi PmenuSel      ctermfg=16      ctermbg=252     cterm=NONE
+      hi PmenuSbar     ctermfg=fg      ctermbg=18      cterm=NONE
+      hi PmenuThumb    ctermfg=fg      ctermbg=28      cterm=NONE
+      hi TabLine       ctermfg=fg      ctermbg=28      cterm=NONE
+      hi TabLineFill   ctermfg=fg      ctermbg=28      cterm=NONE
+      hi TabLineSel    ctermfg=fg      ctermbg=NONE    cterm=NONE
+      hi CursorColumn  ctermfg=NONE    ctermbg=88      cterm=NONE
+      hi CursorLine    ctermfg=NONE    ctermbg=NONE    cterm=underline
+      hi MatchParen    ctermfg=NONE    ctermbg=90
+      hi TabLine       cterm=underline  
+      hi TabLineFill   cterm=underline  
+      hi Underlined    cterm=underline  
+      hi CursorLine    cterm=underline 
+    endif
+
+  endif " t_Co
+
+  " }}}2
+endif
+
+" Links:
+"
+" COLOR LINKS DEFINE START
+
+hi link                String          Constant
+" Character must be different from strings because in many languages
+" (especially C, C++) a 'char' variable is scalar while 'string' is pointer,
+" mistaken a 'char' for a 'string' will cause disaster!
+hi link                Character       Number
+hi link                SpecialChar     LineNr
+hi link                Tag             Identifier
+hi link                cCppOut         LineNr
+" The following are not standard hi links, 
+" these are used by DrChip
+hi link                Warning         MoreMsg
+hi link                Notice          Constant
+" these are used by Calendar
+hi link                CalToday        PreProc
+" these are used by TagList
+hi link                MyTagListTagName        IncSearch
+hi link                MyTagListTagScope       Constant
+
+" COLOR LINKS DEFINE END
+
+" vim:et:nosta:sw=2:ts=8:
+" vim600:fdm=marker:fdl=1:
diff --git a/vim/colors/print_bw.vim b/vim/colors/print_bw.vim
new file mode 100644 (file)
index 0000000..7a4f5e1
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Maintainer:   Mike Williams <mrw@eandem.co.uk>
+" Last Change:  2nd June 2003
+" Version:  1.1
+
+" Remove all existing highlighting.
+set background=light
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "print_bw"
+
+highlight Normal        cterm=NONE ctermfg=black ctermbg=white gui=NONE guifg=black guibg=white
+highlight NonText       ctermfg=black ctermbg=white guifg=black guibg=white
+highlight LineNr        cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white 
+
+" Syntax highlighting scheme
+highlight Comment       cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white
+
+highlight Constant      ctermfg=black ctermbg=white guifg=black guibg=white
+highlight String        ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Character     ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Number        ctermfg=black ctermbg=white guifg=black guibg=white
+" Boolean defaults to Constant
+highlight Float         ctermfg=black ctermbg=white guifg=black guibg=white
+
+highlight Identifier    ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Function      ctermfg=black ctermbg=white guifg=black guibg=white
+
+highlight Statement     ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Conditional   ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Repeat        ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Label         ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Operator      ctermfg=black ctermbg=white guifg=black guibg=white
+" Keyword defaults to Statement
+" Exception defaults to Statement
+
+highlight PreProc       cterm=bold ctermfg=black ctermbg=white gui=bold guifg=black guibg=white
+" Include defaults to PreProc
+" Define defaults to PreProc
+" Macro defaults to PreProc
+" PreCondit defaults to PreProc
+
+highlight Type          cterm=bold ctermfg=black ctermbg=white gui=bold guifg=black guibg=white
+" StorageClass defaults to Type
+" Structure defaults to Type
+" Typedef defaults to Type
+
+highlight Special       cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white
+" SpecialChar defaults to Special
+" Tag defaults to Special
+" Delimiter defaults to Special
+highlight SpecialComment cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white
+" Debug defaults to Special
+
+highlight Todo          cterm=italic,bold ctermfg=black ctermbg=white gui=italic,bold guifg=black guibg=white
+" Ideally, the bg color would be white but VIM cannot print white on black!
+highlight Error         cterm=bold,reverse ctermfg=black ctermbg=grey gui=bold,reverse guifg=black guibg=grey
+
+" vim:et:ff=unix:tw=0:ts=4:sw=4
+" EOF print_bw.vim
diff --git a/vim/colors/pyte.vim b/vim/colors/pyte.vim
new file mode 100644 (file)
index 0000000..b8471af
--- /dev/null
@@ -0,0 +1,92 @@
+
+set background=light
+
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let colors_name = "pyte"
+
+if version >= 700
+    hi CursorLine guibg=#f6f6f6
+    hi CursorColumn guibg=#eaeaea
+    hi MatchParen guifg=white guibg=#80a090 gui=bold
+
+    "Tabpages
+    hi TabLine guifg=black guibg=#b0b8c0 gui=italic
+    hi TabLineFill guifg=#9098a0
+    hi TabLineSel guifg=black guibg=#f0f0f0 gui=italic,bold
+
+    "P-Menu (auto-completion)
+    hi Pmenu guifg=white guibg=#808080
+    "PmenuSel
+    "PmenuSbar
+    "PmenuThumb
+endif
+"
+" Html-Titles
+hi Title      guifg=#202020 gui=bold
+hi Underlined  guifg=#202020 gui=underline
+
+
+hi Cursor    guifg=black   guibg=#b0b4b8
+hi lCursor   guifg=black   guibg=white
+hi LineNr    guifg=#ffffff guibg=#c0d0e0
+
+hi Normal    guifg=#202020   guibg=#f0f0f0
+
+hi StatusLine guifg=white guibg=#8090a0 gui=bold,italic
+hi StatusLineNC guifg=#506070 guibg=#a0b0c0 gui=italic
+hi VertSplit guifg=#a0b0c0 guibg=#a0b0c0 gui=NONE
+
+hi Folded    guifg=#708090 guibg=#c0d0e0
+
+hi NonText   guifg=#c0c0c0 guibg=#e0e0e0
+" Kommentare
+hi Comment   guifg=#a0b0c0               gui=italic
+
+" Konstanten
+hi Constant  guifg=#a07040
+hi String    guifg=#4070a0 
+hi Number    guifg=#40a070
+hi Float     guifg=#70a040
+"hi Statement guifg=#0070e0 gui=NONE
+" Python: def and so on, html: tag-names
+hi Statement  guifg=#007020 gui=bold
+
+
+" HTML: arguments
+hi Type       guifg=#e5a00d gui=italic
+" Python: Standard exceptions, True&False
+hi Structure  guifg=#007020 gui=italic
+hi Function   guifg=#06287e gui=italic
+
+hi Identifier guifg=#5b3674 gui=italic
+
+hi Repeat      guifg=#7fbf58 gui=bold
+hi Conditional guifg=#4c8f2f gui=bold
+
+" Cheetah: #-Symbol, function-names
+hi PreProc    guifg=#1060a0 gui=NONE
+" Cheetah: def, for and so on, Python: Decorators
+hi Define      guifg=#1060a0 gui=bold
+
+hi Error      guifg=red guibg=white gui=bold,underline
+hi Todo       guifg=#a0b0c0 guibg=NONE gui=italic,bold,underline
+
+" Python: %(...)s - constructs, encoding
+hi Special    guifg=#70a0d0 gui=italic
+
+hi Operator   guifg=#408010
+
+" color of <TAB>s etc...  
+hi SpecialKey guifg=#d8a080 guibg=#e8e8e8 gui=italic  
+
+" Diff
+hi DiffChange guifg=NONE guibg=#e0e0e0 gui=italic,bold
+hi DiffText guifg=NONE guibg=#f0c8c8 gui=italic,bold
+hi DiffAdd guifg=NONE guibg=#c0e0d0 gui=italic,bold
+hi DiffDelete guifg=NONE guibg=#f0e0b0 gui=italic,bold
+
+
diff --git a/vim/colors/railscasts+.vim b/vim/colors/railscasts+.vim
new file mode 100644 (file)
index 0000000..874e826
--- /dev/null
@@ -0,0 +1,8 @@
+runtime colors/railscasts.vim
+let g:colors_name = "railscasts+"
+
+set fillchars=vert:\ 
+set fillchars=stl:\ 
+set fillchars=stlnc:\ 
+hi  StatusLine guibg=#cccccc guifg=#000000
+hi  VertSplit  guibg=#dddddd
diff --git a/vim/colors/railscasts.vim b/vim/colors/railscasts.vim
new file mode 100644 (file)
index 0000000..2055b41
--- /dev/null
@@ -0,0 +1,96 @@
+" Vim color scheme
+"
+" Name:         railscasts.vim
+" Maintainer:   Nick Moffitt <nick@zork.net>
+" Last Change:  01 Mar 2008
+" License:      WTFPL <http://sam.zoy.org/wtfpl/>
+" Version:      2.1
+"
+" This theme is based on Josh O'Rourke's Vim clone of the railscast
+" textmate theme.  The key thing I have done here is supply 256-color
+" terminal equivalents for as many of the colors as possible, and fixed
+" up some of the funny behaviors for editing e-mails and such.
+"
+" To use for gvim:
+" 1: install this file as ~/.vim/colors/railscasts.vim
+" 2: put "colorscheme railscasts" in your .gvimrc
+"
+" If you are using Ubuntu, you can get the benefit of this in your
+" terminals using ordinary vim by taking the following steps:
+"
+" 1: sudo apt-get install ncurses-term
+" 2: put the following in your .vimrc
+"     if $COLORTERM == 'gnome-terminal'
+"         set term=gnome-256color
+"         colorscheme railscasts
+"     else
+"         colorscheme default
+"     endif
+" 3: if you wish to use this with screen, add the following to your .screenrc:
+"     attrcolor b ".I"
+"     termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
+"     defbce "on"
+"     term screen-256color-bce
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "railscasts"
+
+hi link htmlTag                     xmlTag
+hi link htmlTagName                 xmlTagName
+hi link htmlEndTag                  xmlEndTag
+
+highlight Normal                    guifg=#E6E1DC guibg=#111111 
+highlight Cursor                    guifg=#000000 ctermfg=0 guibg=#FFFFFF ctermbg=15   
+highlight CursorLine                guibg=#000000 ctermbg=233 cterm=NONE
+
+highlight Comment                   guifg=#BC9458 ctermfg=180 gui=italic
+highlight Constant                  guifg=#6D9CBE ctermfg=73
+highlight Define                    guifg=#CC7833 ctermfg=173
+highlight Error                     guifg=#FFC66D ctermfg=221 guibg=#990000 ctermbg=88
+highlight Function                  guifg=#FFC66D ctermfg=221 gui=NONE cterm=NONE
+highlight Identifier                guifg=#6D9CBE ctermfg=73 gui=NONE cterm=NONE
+highlight Include                   guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE
+highlight PreCondit                 guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE
+highlight Keyword                   guifg=#CC7833 ctermfg=173 cterm=NONE
+highlight LineNr                    guifg=#2B2B2B ctermfg=159 guibg=#C0C0FF
+highlight Number                    guifg=#A5C261 ctermfg=107
+highlight PreProc                   guifg=#E6E1DC ctermfg=103
+highlight Search                    guifg=NONE ctermfg=NONE guibg=#2b2b2b ctermbg=235 gui=italic cterm=underline
+highlight Statement                 guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE
+highlight String                    guifg=#A5C261 ctermfg=107
+highlight Title                     guifg=#FFFFFF ctermfg=15
+highlight Type                      guifg=#DA4939 ctermfg=167 gui=NONE cterm=NONE
+highlight Visual                    guibg=#5A647E ctermbg=60
+
+highlight DiffAdd                   guifg=#E6E1DC ctermfg=7 guibg=#519F50 ctermbg=71
+highlight DiffDelete                guifg=#E6E1DC ctermfg=7 guibg=#660000 ctermbg=52
+highlight Special                   guifg=#DA4939 ctermfg=167 
+
+highlight pythonBuiltin             guifg=#6D9CBE ctermfg=73 gui=NONE cterm=NONE
+highlight rubyBlockParameter        guifg=#FFFFFF ctermfg=15
+highlight rubyClass                 guifg=#FFFFFF ctermfg=15
+highlight rubyConstant              guifg=#DA4939 ctermfg=167
+highlight rubyInstanceVariable      guifg=#D0D0FF ctermfg=189
+highlight rubyInterpolation         guifg=#519F50 ctermfg=107
+highlight rubyLocalVariableOrMethod guifg=#D0D0FF ctermfg=189
+highlight rubyPredefinedConstant    guifg=#DA4939 ctermfg=167
+highlight rubyPseudoVariable        guifg=#FFC66D ctermfg=221
+highlight rubyStringDelimiter       guifg=#A5C261 ctermfg=143
+
+highlight xmlTag                    guifg=#E8BF6A ctermfg=179
+highlight xmlTagName                guifg=#E8BF6A ctermfg=179
+highlight xmlEndTag                 guifg=#E8BF6A ctermfg=179
+
+highlight mailSubject               guifg=#A5C261 ctermfg=107
+highlight mailHeaderKey             guifg=#FFC66D ctermfg=221
+highlight mailEmail                 guifg=#A5C261 ctermfg=107 gui=italic cterm=underline
+
+highlight SpellBad                  guifg=#D70000 ctermfg=160 ctermbg=NONE cterm=underline
+highlight SpellRare                 guifg=#D75F87 ctermfg=168 guibg=NONE ctermbg=NONE gui=underline cterm=underline
+highlight SpellCap                  guifg=#D0D0FF ctermfg=189 guibg=NONE ctermbg=NONE gui=underline cterm=underline
+highlight MatchParen                guifg=#FFFFFF ctermfg=15 guibg=#005f5f ctermbg=23
diff --git a/vim/colors/railscasts2.vim b/vim/colors/railscasts2.vim
new file mode 100644 (file)
index 0000000..138e876
--- /dev/null
@@ -0,0 +1,124 @@
+" Vim color scheme
+"
+" Name:        railscast.vim
+" Maintainer:  Josh O'Rourke <jorourke23@gmail.com> 
+" License:     public domain
+"
+" A GUI Only port of the RailsCasts TextMate theme [1] to Vim.
+" Some parts of this theme were borrowed from the well-documented Lucius theme [2].
+" 
+" [1] http://railscasts.com/about 
+" [2] http://www.vim.org/scripts/script.php?script_id=2536
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "railscasts"
+
+" Colors
+" Brown        #BC9458
+" Dark Blue    #6D9CBE
+" Dark Green   #519F50
+" Dark Orange  #CC7833
+" Light Blue   #D0D0FF
+" Light Green  #A5C261
+" Tan          #FFC66D
+
+hi Normal                    guifg=#E6E1DC guibg=#2B2B2B
+hi Cursor                    guibg=#FFFFFF
+hi CursorLine                guibg=#333435
+hi LineNr                    guifg=#888888 guibg=#DEDEDE
+hi Search                    guibg=#5A647E
+hi Visual                    guibg=#5A647E
+
+" Folds
+" -----
+" line used for closed folds
+hi Folded                    guifg=#F6F3E8 guibg=#444444 gui=NONE
+
+" Misc
+" ----
+" directory names and other special names in listings
+hi Directory                 guifg=#A5C261 gui=NONE
+
+" Popup Menu
+" ----------
+" normal item in popup
+hi Pmenu                     guifg=#F6F3E8 guibg=#444444 gui=NONE
+" selected item in popup
+hi PmenuSel                  guifg=#000000 guibg=#A5C261 gui=NONE
+" scrollbar in popup
+hi PMenuSbar                 guibg=#5A647E gui=NONE
+" thumb of the scrollbar in the popup
+hi PMenuThumb                guibg=#AAAAAA gui=NONE
+
+
+"rubyComment
+hi Comment                   guifg=#BC9458 gui=italic
+hi Todo                      guifg=#BC9458 guibg=NONE gui=italic
+
+"rubyPseudoVariable
+"nil, self, symbols, etc
+hi Constant                  guifg=#6D9CBE
+
+"rubyClass, rubyModule, rubyDefine
+"def, end, include, etc
+hi Define                    guifg=#CC7833
+
+"rubyInterpolation
+hi Delimiter                 guifg=#519F50
+
+"rubyError, rubyInvalidVariable
+hi Error                     guifg=#FFFFFF guibg=#990000
+
+"rubyFunction
+hi Function                  guifg=#FFC66D gui=NONE
+
+"rubyIdentifier
+"@var, @@var, $var, etc
+hi Identifier                guifg=#D0D0FF gui=NONE
+
+"rubyInclude
+"include, autoload, extend, load, require
+hi Include                   guifg=#CC7833 gui=NONE
+
+"rubyKeyword, rubyKeywordAsMethod
+"alias, undef, super, yield, callcc, caller, lambda, proc
+hi Keyword                   guifg=#CC7833
+
+" same as define
+hi Macro                     guifg=#CC7833 gui=NONE
+
+"rubyInteger
+hi Number                    guifg=#A5C261
+
+" #if, #else, #endif
+hi PreCondit                 guifg=#CC7833 gui=NONE
+
+" generic preprocessor
+hi PreProc                   guifg=#CC7833 gui=NONE
+
+"rubyControl, rubyAccess, rubyEval
+"case, begin, do, for, if unless, while, until else, etc.
+hi Statement                 guifg=#CC7833 gui=NONE
+
+"rubyString
+hi String                    guifg=#A5C261
+
+hi Title                     guifg=#FFFFFF
+
+"rubyConstant
+hi Type                      guifg=#DA4939 gui=NONE
+
+hi DiffAdd                   guifg=#E6E1DC guibg=#144212
+hi DiffDelete                guifg=#E6E1DC guibg=#660000
+
+hi link htmlTag              xmlTag
+hi link htmlTagName          xmlTagName
+hi link htmlEndTag           xmlEndTag
+
+hi xmlTag                    guifg=#E8BF6A
+hi xmlTagName                guifg=#E8BF6A
+hi xmlEndTag                 guifg=#E8BF6A
diff --git a/vim/colors/rdark.vim b/vim/colors/rdark.vim
new file mode 100644 (file)
index 0000000..62c7cdd
--- /dev/null
@@ -0,0 +1,159 @@
+" Vim color file
+" Maintaner: Radu Dineiu <radu.dineiu@gmail.com>
+" URL: http://ld.yi.org/vim/rdark/
+" Last Change: 2007 Jun 23
+" Version: 0.6
+"
+" Features:
+"   - let rdark_current_line = 1 if you want to highlight the current line
+"
+" Changelog:
+"   0.5 - fixed the Pmenu colors
+"   0.6 - added SignColumn colors
+
+set background=dark
+
+hi clear
+if exists("syntax_on")
+       syntax reset
+endif
+
+let colors_name = "rdark"
+
+" Current Line
+if exists('rdark_current_line') && rdark_current_line == 1
+       set cursorline
+       hi CursorLine guibg=#191f21
+endif
+
+" Default Colors
+hi Normal guifg=#babdb6 guibg=#1e2426
+hi NonText guifg=#2c3032 guibg=#2c3032 gui=none
+hi Cursor guibg=#babdb6
+hi ICursor guibg=#babdb6
+
+" Search
+hi Search guifg=#2e3436 guibg=#fcaf3e
+hi IncSearch guibg=#2e3436 guifg=#fcaf3e
+
+" Window Elements
+hi StatusLine guifg=#2e3436 guibg=#babdb6 gui=none
+hi StatusLineNC guifg=#2e3436 guibg=#888a85 gui=none
+hi VertSplit guifg=#555753 guibg=#888a85 gui=none
+hi Visual guibg=#000000
+hi MoreMsg guifg=#729fcf
+hi Question guifg=#8ae234 gui=none
+hi WildMenu guifg=#eeeeec guibg=#0e1416
+hi LineNr guifg=#3f4b4d guibg=#000000
+hi SignColumn guibg=#1e2426
+
+" Pmenu
+hi Pmenu guibg=#2e3436 guifg=#eeeeec
+hi PmenuSel guibg=#ffffff guifg=#1e2426
+hi PmenuSbar guibg=#555753
+hi PmenuThumb guifg=#ffffff
+
+" Diff
+hi DiffDelete guifg=#2e3436 guibg=#0e1416
+hi DiffAdd guibg=#1f2b2d
+hi DiffChange guibg=#2e3436
+hi DiffText guibg=#000000 gui=none
+
+" Folds
+hi Folded guifg=#d3d7cf guibg=#204a87
+hi FoldColumn guifg=#3465a4 guibg=#000000
+
+" Specials
+hi Title guifg=#fcaf3e
+hi Todo guifg=#fcaf3e guibg=bg
+hi SpecialKey guifg=#ef2929
+
+" Tabs
+hi TabLine guibg=#0a1012 guifg=#888a85
+hi TabLineFill guifg=#0a1012
+hi TabLineSel guibg=#555753 guifg=#eeeeec gui=none
+
+" Matches
+hi MatchParen guifg=#2e3436 guibg=#fcaf3e
+
+" Tree
+hi Directory guifg=#ffffff
+
+" Syntax
+hi Comment guifg=#656763
+hi Constant guifg=#8ae234
+hi Number guifg=#8ae234
+hi Statement guifg=#729fcf gui=none
+hi Identifier guifg=#ffffff
+hi PreProc guifg=#fcaf3e
+hi Function guifg=#fcaf3e
+hi Type guifg=#e3e7df gui=none
+hi Keyword guifg=#eeeeec
+hi Special guifg=#888a85
+hi Error guifg=#eeeeec guibg=#cc0000
+
+" PHP
+hi phpRegionDelimiter guifg=#ad7fa8
+hi phpPropertySelector guifg=#888a85
+hi phpPropertySelectorInString guifg=#888a85
+hi phpOperator guifg=#888a85
+hi phpArrayPair guifg=#888a85
+hi phpAssignByRef guifg=#888a85
+hi phpRelation guifg=#888a85
+hi phpMemberSelector guifg=#888a85
+hi phpUnknownSelector guifg=#888a85
+hi phpVarSelector guifg=#babdb6
+hi phpSemicolon guifg=#888a85 gui=none
+hi phpFunctions guifg=#d3d7cf
+hi phpParent guifg=#888a85
+
+" JavaScript
+hi javaScriptBraces guifg=#888a85
+hi javaScriptOperator guifg=#888a85
+
+" HTML
+hi htmlTag guifg=#888a85
+hi htmlEndTag guifg=#888a85
+hi htmlTagName guifg=#babdb6
+hi htmlSpecialTagName guifg=#babdb6
+hi htmlArg guifg=#d3d7cf
+hi htmlTitle guifg=#8ae234 gui=none
+hi link htmlH1 htmlTitle
+hi link htmlH2 htmlH1
+hi link htmlH3 htmlH1
+hi link htmlH4 htmlH1
+hi link htmlH5 htmlH1
+hi link htmlH6 htmlH1
+
+" XML
+hi link xmlTag htmlTag
+hi link xmlEndTag htmlEndTag
+hi link xmlAttrib htmlArg
+
+" CSS
+hi cssSelectorOp guifg=#eeeeec
+hi link cssSelectorOp2 cssSelectorOp
+hi cssUIProp guifg=#d3d7cf
+hi link cssPagingProp cssUIProp
+hi link cssGeneratedContentProp cssUIProp
+hi link cssRenderProp cssUIProp
+hi link cssBoxProp cssUIProp
+hi link cssTextProp cssUIProp
+hi link cssColorProp cssUIProp
+hi link cssFontProp cssUIProp
+hi cssPseudoClassId guifg=#eeeeec
+hi cssBraces guifg=#888a85
+hi cssIdentifier guifg=#fcaf3e
+hi cssTagName guifg=#fcaf3e
+hi link cssInclude Function
+hi link cssCommonAttr Constant
+hi link cssUIAttr Constant
+hi link cssTableAttr Constant
+hi link cssPagingAttr Constant
+hi link cssGeneratedContentAttr Constant
+hi link cssAuralAttr Constant
+hi link cssRenderAttr Constant
+hi link cssBoxAttr Constant
+hi link cssTextAttr Constant
+hi link cssColorAttr Constant
+hi link cssFontAttr Constant
diff --git a/vim/colors/relaxedgreen.vim b/vim/colors/relaxedgreen.vim
new file mode 100644 (file)
index 0000000..9d2bf14
--- /dev/null
@@ -0,0 +1,112 @@
+" ----------------------------------------------------------------------------------------------------------------------------------
+" Filename:      relaxedgreen.vim
+" Last Modified: 13 Feb 2007 09:57:24 PM by Dave V
+" Maintainer:    Dave Vehrs (dvehrs at gmail.com)
+" Copyright:     2002,2003,2004,2005,2006,2007 Dave Vehrs
+"                This script is free software; you can redistribute it and/or 
+"                modify it under the terms of the GNU General Public License as 
+"                published by the Free Software Foundation; either version 2 of 
+"                the License, or (at your option) any later version. 
+" Description:   Vim colorscheme file.
+" Install:       Place this file in the users colors directory (~/.vim/colors) or 
+"                in the shared colors directory (/usr/shared/vim/vim<version>/colors/),
+"                then load it with :colorscheme relaxedgreen
+" ----------------------------------------------------------------------------------------------------------------------------------
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = "relaxedgreen"
+highlight Cursor        term=reverse      ctermfg=green ctermbg=blue                      guifg=#000000 guibg=#559955
+highlight CursorIM      term=reverse      ctermfg=black ctermbg=darkgreen                 guifg=#000000 guibg=#336633
+highlight CursorColumn  term=none         ctermbg=darkred                                 guibg=#663333
+highlight CursorLine    term=none         ctermbg=darkblue                                guibg=#333366
+highlight Comment       term=italic       ctermfg=darkcyan ctermbg=black                  guifg=#00a594
+highlight Constant      term=underline    ctermfg=blue                                    guifg=#0099dd
+highlight Debug         term=bold         ctermfg=red ctermbg=black                       guifg=#dc0000 guibg=#000000
+highlight DiffAdd       term=reverse      ctermfg=black ctermbg=cyan                      guifg=#000000 guibg=#007200
+highlight DiffChange    term=underline    cterm=reverse ctermfg=darkgreen ctermbg=black   guifg=#000000 guibg=#006700
+highlight DiffDelete    term=standout     ctermfg=black ctermbg=cyan                      guifg=#000000 guibg=#007200
+highlight DiffText      term=bold         ctermfg=green ctermbg=black                     guifg=#00ac00 guibg=#000000
+highlight Directory     term=underline    ctermfg=green ctermbg=black                     guifg=#336633 guibg=#000000
+highlight Error         term=reverse,bold ctermfg=black ctermbg=red                       guifg=#000000 guibg=#dc0000
+highlight ErrorMsg      term=reverse,bold ctermfg=white ctermbg=red                       guifg=#ffffff guibg=#dc0000
+highlight Folded                          ctermfg=darkgreen ctermbg=black                 guifg=#20de20 guibg=#000000
+highlight FoldColumn                      ctermfg=darkgreen ctermbg=black                 guifg=#20de20 guibg=#000000
+highlight Function      term=standout     ctermfg=darkgreen                               guifg=#22bb22
+highlight Identifier    term=underline    ctermfg=darkcyan                                gui=underline guifg=#008800
+highlight Ignore                          ctermfg=lightgreen                              guifg=#33bb33
+highlight IncSearch     term=reverse      ctermfg=black ctermbg=darkgreen                 guifg=#000000 guibg=#336633
+highlight LineNr        term=bold         ctermfg=green                                   guifg=#00ff00
+highlight MatchParen    term=bold         ctermbg=green                                   guifg=#009900
+highlight ModeMsg       term=bold         cterm=bold                                      gui=bold
+highlight MoreMsg       term=bold         cterm=bold                                      gui=bold
+highlight NonText                         ctermfg=brown                                   guifg=#b26818
+highlight Normal                          ctermfg=gray ctermbg=black                      guifg=#aaaaaa guibg=#000000
+highlight Pmenu         term=reverse      ctermfg=black ctermbg=green                     guifg=#000000 guibg=#337733 
+highlight PmenuSel      term=bold         ctermfg=black  ctermbg=gray                     guifg=#000000 guibg=#999999 
+highlight PmenuSbar     term=reverse      ctermfg=black ctermbg=green                     guifg=#000000 guibg=#337733 
+highlight PmenuThumb    term=reverse      ctermfg=gray ctermbg=black                      guifg=#999999 guibg=#000000 
+highlight PreProc       term=standout     ctermfg=darkgreen                               guifg=#22bb22
+highlight Question      term=standout     ctermfg=red                                     guifg=#ff0000
+highlight Search        term=reverse      ctermfg=black ctermbg=darkgreen                 guifg=#000000 guibg=#228822
+highlight SignColumn                      ctermfg=darkgreen                               guifg=#20de20 guibg=#000000
+highlight Special       term=bold         ctermfg=green                                   guifg=#00ff00
+highlight SpecialKey    term=bold         ctermfg=green                                   guifg=#00ff00
+highlight SpellBad      term=reverse      cterm=underline ctermfg=red ctermbg=black       gui=undercurl guisp=#ff0000
+highlight SpellCap      term=reverse      cterm=underline ctermfg=yellow ctermbg=black    gui=undercurl guisp=#00ffff
+highlight SpellLocal    term=reverse      cterm=underline ctermfg=blue ctermbg=black      gui=undercurl guisp=#0000ff
+highlight SpellRare     term=reverse      cterm=underline ctermfg=darkgreen ctermbg=black gui=undercurl guisp=#00ff00
+highlight Statement     term=standout     ctermfg=darkred                                 guifg=#ac0000
+highlight StatusLine    term=reverse      ctermfg=darkgreen ctermbg=black                 gui=none guibg=#228822 guifg=#000000
+highlight StatusLineNC  term=reverse      ctermfg=darkgreen ctermbg=blue                  gui=none guibg=#336633 guifg=#000000
+highlight TabLine       term=reverse      cterm=reverse ctermfg=black ctermbg=green       guibg=#222222 guifg=#228822
+highlight TabLineFill   term=reverse      cterm=reverse ctermfg=green ctermbg=black       guibg=#222222 guifg=#226622
+highlight TabLineSel                      ctermfg=black ctermbg=green                     guibg=#228822 guifg=#222222
+highlight Title         term=reverse      ctermfg=black ctermbg=green                     guifg=#000000 guibg=#00ff00
+highlight Todo          term=reverse      cterm=reverse ctermfg=darkgreen ctermbg=black   guibg=#336633 guifg=#000000
+highlight Type          term=standout     ctermfg=green                                   guifg=#559955
+highlight Visual        term=reverse      cterm=reverse ctermfg=darkgreen                 guifg=#000000 guibg=#336633
+highlight VisualNOS     term=reverse,bold cterm=reverse ctermbg=darkgreen                 guifg=#000000 guibg=#228822
+highlight VertSplit     term=reverse      ctermfg=darkgreen                               guifg=#336633
+highlight User1         term=standout     cterm=bold ctermbg=darkgreen ctermfg=red        gui=bold guibg=#228822 guifg=#FF0000
+highlight WarningMsg    term=reverse      ctermfg=black ctermbg=yellow                    guifg=#000000 guibg=#007a7a
+highlight WildMenu      term=reverse      ctermfg=blue ctermbg=darkgreen                  guifg=#000099 guibg=#00ac00   
+
+" ----------------------------------------------------------------------------------------------------------------------------------
+" Common groups that link to other highlight definitions.
+
+highlight link Character      Constant
+highlight link Number         Constant
+highlight link Boolean        Constant
+highlight link String         Constant
+
+highlight link Operator       LineNr
+
+highlight link Float          Number
+
+highlight link Define         PreProc
+highlight link Include        PreProc
+highlight link Macro          PreProc
+highlight link PreCondit      PreProc
+
+highlight link Repeat         Question
+
+highlight link Conditional    Repeat
+
+highlight link Delimiter      Special
+highlight link SpecialChar    Special
+highlight link SpecialComment Special
+highlight link Tag            Special
+
+highlight link Exception     Statement
+highlight link Keyword       Statement
+highlight link Label         Statement
+
+highlight link StorageClass  Type
+highlight link Structure     Type
+highlight link Typedef       Type
+
+" ----------------------------------------------------------------------------------------------------------------------------------
+" vim:tw=132:ts=4:sw=4
diff --git a/vim/colors/robinhood.vim b/vim/colors/robinhood.vim
new file mode 100644 (file)
index 0000000..ab1d14d
--- /dev/null
@@ -0,0 +1,103 @@
+" Vim color file
+" Maintainer: Datila Carvalho <datila@hotmail.com>
+" Last Change: May, 19, 2005
+" Version: 0.2
+
+" This is a VIM's version of the emacs color theme
+" _Robin Hood_ created by Alex Schroede.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let g:colors_name = "robinhood"
+
+
+""" Colors
+
+" GUI colors
+hi Cursor               guifg=fg guibg=gray
+hi CursorIM             guifg=NONE guibg=gray
+"hi Directory
+"hi DiffAdd
+"hi DiffChange
+"hi DiffDelete
+"hi DiffText
+hi ErrorMsg             gui=bold guifg=white guibg=Red
+"hi VertSplit
+"hi Folded
+"hi FoldColumn
+"hi IncSearch
+hi LineNr               gui=bold guifg=yellowgreen guibg=#203010
+"hi ModeMsg
+"hi MoreMsg
+"hi NonText
+hi Normal               guibg=#304020 guifg=wheat
+"hi Question
+hi Search               gui=bold guifg=black guibg=gray
+"hi SpecialKey
+hi StatusLine           guifg=darkolivegreen guibg=wheat
+hi StatusLineNC         guifg=olivedrab guibg=wheat
+"hi Title
+hi Visual               guifg=darkslategrey guibg=fg
+hi VisualNOS            gui=bold guifg=Black guibg=fg
+hi WarningMsg           guifg=White guibg=Tomato
+"hi WildMenu
+
+hi User2                guifg=yellowgreen guibg=#091900 gui=bold
+
+" If using Motif/Athena
+hi Menu                 guibg=#304020 guifg=wheat
+hi Scrollbar            guibg=bg
+
+" Colors for syntax highlighting
+hi Comment              guifg=lightblue
+
+hi Constant             gui=bold guifg=lightcyan
+    hi String           guifg=lightsalmon
+    hi Character        guifg=lightsalmon
+    hi Number           gui=bold guifg=lightcyan
+    hi Boolean          gui=bold guifg=lightcyan
+    hi Float            gui=bold guifg=lightcyan
+
+hi Identifier           gui=bold guifg=palegreen
+    hi Function         guifg=yellowgreen
+
+hi Statement            gui=bold guifg=salmon
+    hi Conditional      gui=bold guifg=salmon
+    hi Repeat           gui=bold guifg=salmon
+    hi Label            guifg=salmon
+    hi Operator         guifg=salmon
+    "hi Keyword
+    "hi Exception
+
+hi PreProc              guifg=palegreen
+    hi Include          gui=bold guifg=palegreen
+    hi Define           guifg=palegreen
+    hi Macro            guifg=aquamarine
+    hi PreCondit        guifg=palegreen
+
+hi Type                 gui=bold guifg=yellowgreen
+    hi StorageClass     gui=bold guifg=aquamarine
+    hi Structure        gui=bold guifg=aquamarine
+    hi Typedef          gui=bold guifg=aquamarine
+
+"hi Special
+    ""Underline Character
+    "hi SpecialChar      gui=underline
+    "hi Tag              gui=bold,underline
+    ""Statement
+    "hi Delimiter        gui=bold
+    ""Bold comment (in Java at least)
+    "hi SpecialComment   gui=bold
+    "hi Debug            gui=bold
+
+hi Underlined           gui=underline
+
+hi Ignore               guifg=bg
+
+hi Error                gui=bold guifg=White guibg=Red
+
+"hi Todo
diff --git a/vim/colors/rootwater.vim b/vim/colors/rootwater.vim
new file mode 100644 (file)
index 0000000..4be5aeb
--- /dev/null
@@ -0,0 +1,98 @@
+" Name: rootwater.vim
+" Maintainer:  Kojo Sugita
+" Last Change:  2008-11-22
+" Revision: 1.2
+"
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let g:colors_name = 'rootwater'
+
+" Default colors
+hi Normal      guifg=#babdb6   guibg=#151b1d
+hi NonText     guifg=#4f5b5d   guibg=#232729   gui=none
+hi SpecialKey  guifg=#4f5b5d   guibg=#2c3032   gui=none
+hi Cursor      guifg=#3a553a   guibg=#77dd88
+hi CursorLine  guibg=#303035
+hi CursorColumn        guibg=#303035
+hi lCursor     guifg=#3a553a   guibg=#77dd88
+hi CursorIM    guifg=#3a553a   guibg=#77dd88
+
+" Directory
+hi Directory   guifg=white gui=bold
+
+" Diff
+hi DiffAdd     guifg=#77dd88   guibg=#3a553a   gui=none
+hi DiffChange  guifg=#77dd88   guibg=#3a553a   gui=none
+hi DiffDelete  guifg=#223322   guibg=#223322   gui=none
+hi DiffText    guifg=#77dd88   guibg=#448844   gui=bold
+
+hi ErrorMsg    guifg=red       guibg=black
+hi VertSplit   guifg=black     guibg=#88ee99
+
+" Folds
+hi Folded      guifg=#55af66   guibg=black
+hi FoldColumn  guifg=#557755   guibg=#102010
+
+" Search
+hi Search      guifg=#223322   guibg=#55af66   gui=none
+hi IncSearch   guifg=#3a553a   guibg=#77dd88   gui=none
+
+" hi LineNr    guifg=#446644 guibg=black gui=none
+hi LineNr      guifg=#607075   guibg=black     gui=none
+hi ModeMsg     guifg=#55af66   guibg=black
+hi MoreMsg     guifg=#55af66   guibg=black
+hi Question    guifg=#55af66   guibg=black
+
+"\n, \0, %d, %s, etc...
+hi Special     guifg=pink                      gui=none
+
+" status line
+hi StatusLine  guifg=#88ee99   guibg=black     gui=none
+hi StatusLineNC        guifg=#446644   guibg=black     gui=none
+
+hi Title       guifg=#88ee99   guibg=#000000   gui=none
+hi Visual      guifg=#77dd88   guibg=#448844   gui=none
+hi VisualNOS   guifg=#55af66   guibg=black
+hi WarningMsg  guifg=#77dd88   guibg=black
+hi WildMenu    guifg=#3a553a   guibg=#77dd88
+
+hi Number      guifg=#77dd88
+hi Char                guifg=#77dd88
+hi String      guifg=#77dd88
+hi Boolean     guifg=#77dd88
+hi Comment     guifg=#656565
+hi Constant    guifg=#88ee99                   gui=none
+hi Identifier  guifg=white
+hi Statement    guifg=#8fffff                  gui=none
+
+" Procedure name
+hi Function     guifg=#ffaa33
+
+" Define, def
+hi PreProc     guifg=lightred                  gui=none
+hi Type                guifg=white                     gui=none
+hi Underlined  guifg=gray                      gui=underline
+hi Error       guifg=red                       guibg=black
+hi Todo                guifg=pink      guibg=black     gui=none
+hi SignColumn   guibg=#151b1d
+
+" Matches
+hi MatchParen  guifg=#000000   guibg=#ffaa33
+
+" Pmenu
+if version >= 700
+  hi Pmenu     guibg=#202530
+  hi PmenuSel  guifg=#88ee99   guibg=black
+  hi PmenuSbar guibg=#202530
+
+  hi TabLine     guifg=#446644 guibg=black     gui=None
+  hi TabLineFill  guibg=#232729        guibg=#232729   gui=None
+  hi TabLineSel          guifg=#88ee99 guibg=black     gui=None
+endif
+
+finish
+
+" vim:set ts=8 sts=2 sw=2 tw=0:
diff --git a/vim/colors/satori.vim b/vim/colors/satori.vim
new file mode 100644 (file)
index 0000000..5c7b250
--- /dev/null
@@ -0,0 +1,47 @@
+" Vim color file
+" Maintainer: Ruda Moura <ruda@rudix.org>
+" Last Change: Sun Feb 24 18:50:47 BRT 2008
+
+highlight clear Normal
+set background&
+
+highlight clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "satori"
+
+" Vim colors
+highlight Normal     ctermfg=NONE    cterm=NONE
+highlight Comment    ctermfg=Cyan    cterm=NONE
+highlight Constant   ctermfg=Red     cterm=NONE
+highlight Number     ctermfg=Red     cterm=NONE
+highlight Identifier ctermfg=NONE    cterm=NONE
+highlight Statement  ctermfg=NONE    cterm=Bold
+highlight PreProc    ctermfg=Blue    cterm=NONE
+highlight Type       ctermfg=Magenta cterm=NONE
+highlight Special    ctermfg=Magenta cterm=NONE
+
+" Vim monochrome
+highlight Normal     term=NONE
+highlight Comment    term=NONE
+highlight Constant   term=Underline
+highlight Number     term=Underline
+highlight Identifier term=NONE
+highlight Statement  term=Bold
+highlight PreProc    term=NONE
+highlight Type       term=Bold
+highlight Special    term=NONE
+
+" GVim colors
+highlight Normal     guifg=NONE     gui=NONE
+highlight Comment    guifg=DarkCyan gui=NONE
+highlight Constant   guifg=Red      gui=NONE
+highlight Number     guifg=Red      gui=Bold
+highlight Identifier guifg=NONE     gui=NONE
+highlight Statement  guifg=NONE     gui=Bold
+highlight PreProc    guifg=Blue     gui=NONE
+highlight Type       guifg=Magenta  gui=NONE
+highlight Special    guifg=Red      gui=Bold
diff --git a/vim/colors/sea.vim b/vim/colors/sea.vim
new file mode 100644 (file)
index 0000000..0c79c47
--- /dev/null
@@ -0,0 +1,69 @@
+" Vim color file
+"  Maintainer: Tiza
+" Last Change: 2002/10/30 Wed 00:01.
+"     version: 1.0
+" This color scheme uses a dark background.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "sea"
+
+hi Normal       guifg=#f0f0f8 guibg=#343478
+
+" Search
+hi IncSearch    gui=UNDERLINE,BOLD guifg=#ffffff guibg=#c030ff
+hi Search       gui=BOLD guifg=#f0e0ff guibg=#b020ff
+
+" Messages
+hi ErrorMsg     gui=BOLD guifg=#ffffff guibg=#f000a0
+hi WarningMsg   gui=BOLD guifg=#ffffff guibg=#f000a0
+hi ModeMsg      gui=BOLD guifg=#00e0ff guibg=NONE
+hi MoreMsg      gui=BOLD guifg=#00ffff guibg=#6060ff
+hi Question     gui=BOLD guifg=#00f0d0 guibg=NONE
+
+" Split area
+hi StatusLine   gui=NONE guifg=#000000 guibg=#d0d0e0
+hi StatusLineNC gui=NONE guifg=#606080 guibg=#d0d0e0
+hi VertSplit    gui=NONE guifg=#606080 guibg=#d0d0e0
+hi WildMenu     gui=NONE guifg=#000000 guibg=#ff90ff
+
+" Diff
+hi DiffText     gui=UNDERLINE guifg=#ffff00 guibg=#000000
+hi DiffChange   gui=NONE guifg=#ffffff guibg=#000000
+hi DiffDelete   gui=NONE guifg=#60ff60 guibg=#000000
+hi DiffAdd      gui=NONE guifg=#60ff60 guibg=#000000
+
+" Cursor
+hi Cursor       gui=NONE guifg=#ffffff guibg=#d86020
+hi lCursor      gui=NONE guifg=#ffffff guibg=#e000b0
+hi CursorIM     gui=NONE guifg=#ffffff guibg=#e000b0
+
+" Fold
+hi Folded       gui=NONE guifg=#ffffff guibg=#0080a0
+hi FoldColumn   gui=NONE guifg=#9090ff guibg=#3c3c88
+
+" Other
+hi Directory    gui=NONE guifg=#00ffff guibg=NONE
+hi LineNr       gui=NONE guifg=#7070e8 guibg=NONE
+hi NonText      gui=BOLD guifg=#8080ff guibg=#2c2c78
+hi SpecialKey   gui=BOLD guifg=#60c0ff guibg=NONE
+hi Title        gui=BOLD guifg=#f0f0f8 guibg=NONE
+hi Visual       gui=NONE guifg=#ffffff guibg=#6060ff
+" hi VisualNOS  gui=NONE guifg=#ffffff guibg=#6060ff
+
+" Syntax group
+hi Comment      gui=NONE guifg=#b0b0c8 guibg=NONE
+hi Constant     gui=NONE guifg=#60ffff guibg=NONE
+hi Error        gui=BOLD guifg=#ffffff guibg=#f000a0
+hi Identifier   gui=NONE guifg=#c0c0ff guibg=NONE
+hi Ignore       gui=NONE guifg=#303080 guibg=NONE
+hi PreProc      gui=NONE guifg=#ffb0ff guibg=NONE
+hi Special      gui=NONE guifg=#ffd858 guibg=NONE
+hi Statement    gui=NONE guifg=#f0f060 guibg=NONE
+hi Todo         gui=BOLD,UNDERLINE guifg=#ff70e0 guibg=NONE
+hi Type         gui=NONE guifg=#40ff80 guibg=NONE
+hi Underlined   gui=UNDERLINE,BOLD guifg=#f0f0f8 guibg=NONE
diff --git a/vim/colors/settlemyer.vim b/vim/colors/settlemyer.vim
new file mode 100644 (file)
index 0000000..91495ff
--- /dev/null
@@ -0,0 +1,53 @@
+" Vim color file
+" Maintainer: Max Lynch <lynch3@wisc.edu>
+" URL:  http://muffinpeddler.com
+" Version: 0.1
+"
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+       syntax reset
+    endif
+endif
+let g:colors_name="settlemyer"
+
+hi Normal guibg=gray25 guifg=gray85
+hi Cursor guibg=red3 guifg=bg
+
+" Syntax Highlighting
+hi Comment guifg=LightPink
+hi Constant guifg=SpringGreen
+" hi Identifier gui=bold guifg=SkyBlue
+" hi Function guifg=Wheat3
+" hi Type guifg=orange1
+hi Keyword guifg=SkyBlue
+hi PreProc guifg=SkyBlue
+hi Statement guifg=SkyBlue
+hi Type gui=bold guifg=SkyBlue
+hi NonText guifg=DarkGray
+hi Tags guifg=orange1
+
+hi link Character              Constant
+hi link Number                 Constant
+hi link Float                  Constant
+hi link Function               Statement
+hi link Conditional            Statement
+hi link Repeat                 Statement
+hi link Label                  Statement
+hi link Operator               Statement
+hi link Keyword                        Statement
+hi link Include                        PreProc
+hi link Define                 PreProc
+hi link Macro                  PreProc
+hi link PreCondit              PreProc
+hi link StorageClass   Type
+hi link Structure              Type
+hi link Typedef                        Type
+hi link Tag                            Tags
diff --git a/vim/colors/sienna.vim b/vim/colors/sienna.vim
new file mode 100644 (file)
index 0000000..08b8eda
--- /dev/null
@@ -0,0 +1,150 @@
+" Vim colour scheme
+" Maintainer:  Georg Dahn
+" Last Change: 26 April 2006
+" Version:     1.6
+"
+" This color scheme has both light and dark styles with harmonic colors
+" easy to distinguish. Terminals are not supported, therefore you should
+" only try it if you use the GUI version of Vim.
+"
+" You can choose the style by adding one of the following lines to your
+" vimrc or gvimrc file before sourcing the color scheme:
+"
+" let g:sienna_style = 'dark'
+" let g:sienna_style = 'light'
+"
+" If none of above lines is given, the light style is choosen.
+"
+" You can switch between these styles by using the :Colo command, like
+" :Colo dark or :Colo light (many thanks to Pan Shizhu).
+
+if exists("g:sienna_style")
+    let s:sienna_style = g:sienna_style
+else
+    let s:sienna_style = 'light'
+endif
+
+execute "command! -nargs=1 Colo let g:sienna_style = \"<args>\" | colo sienna"
+
+if s:sienna_style == 'dark'
+    set background=dark
+elseif s:sienna_style == 'light'
+    set background=light
+else
+    finish
+endif
+
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = 'sienna'
+
+if s:sienna_style == 'dark'
+    hi Normal gui=none guifg=Grey85 guibg=Grey15
+
+    hi Cursor guifg=Black guibg=Grey85
+    hi LineNr gui=none guifg=Grey65
+    hi NonText gui=bold guifg=Grey65 guibg=Grey20
+    hi SpecialKey gui=none guifg=SkyBlue2
+    hi Title gui=bold guifg=Grey85
+    hi Visual gui=bold guifg=Black guibg=LightSalmon1
+
+    hi FoldColumn gui=none guifg=Black guibg=Wheat3
+    hi Folded gui=none guifg=White guibg=Wheat4
+    hi StatusLine gui=bold guifg=Black guibg=Grey85
+    hi StatusLineNC gui=none guifg=White guibg=DimGray
+    hi VertSplit gui=none guifg=White guibg=DimGray
+    hi Wildmenu gui=bold guifg=White guibg=Black
+
+    hi Pmenu guibg=Grey55 guifg=Black gui=none
+    hi PmenuSbar guibg=Grey40 guifg=fg gui=none
+    hi PmenuSel guibg=Yellow2 guifg=Black gui=none
+    hi PmenuThumb guibg=Grey80 guifg=bg gui=none    
+
+    hi IncSearch gui=none guifg=Grey15 guibg=Grey85
+    hi Search gui=none guifg=Black guibg=Yellow2
+
+    hi MoreMsg gui=bold guifg=PaleGreen2
+    hi Question gui=bold guifg=PaleGreen2
+    hi WarningMsg gui=bold guifg=Red
+
+    hi Comment gui=italic guifg=SkyBlue3
+    hi Error gui=none guifg=White guibg=Red2
+    hi Identifier gui=none guifg=LightSalmon2
+    hi Special gui=none guifg=SkyBlue2
+    hi PreProc gui=none guifg=SkyBlue3
+    hi Todo gui=bold guifg=Black guibg=Yellow2
+    hi Type gui=bold guifg=SkyBlue2
+    hi Underlined gui=underline guifg=DodgerBlue
+
+    hi Boolean gui=bold guifg=PaleGreen2
+    hi Constant gui=none guifg=PaleGreen2
+    hi Number gui=bold guifg=PaleGreen2
+    hi String gui=none guifg=PaleGreen2
+
+    hi Label gui=bold,underline guifg=LightSalmon2
+    hi Statement gui=bold guifg=LightSalmon2
+
+    hi htmlBold gui=bold
+    hi htmlItalic gui=italic
+    hi htmlUnderline gui=underline
+    hi htmlBoldItalic gui=bold,italic
+    hi htmlBoldUnderline gui=bold,underline
+    hi htmlBoldUnderlineItalic gui=bold,underline,italic
+    hi htmlUnderlineItalic gui=underline,italic
+elseif s:sienna_style == 'light'
+    hi Normal gui=none guifg=Black guibg=White
+
+    hi Cursor guifg=White guibg=Black
+    hi LineNr gui=none guifg=DarkGray
+    hi NonText gui=bold guifg=DarkGray guibg=Grey95
+    hi SpecialKey gui=none guifg=RoyalBlue4
+    hi Title gui=bold guifg=Black
+    hi Visual gui=bold guifg=Black guibg=Sienna1
+
+    hi FoldColumn gui=none guifg=Black guibg=Wheat2
+    hi Folded gui=none guifg=Black guibg=Wheat1
+    hi StatusLine gui=bold guifg=White guibg=Black
+    hi StatusLineNC gui=none guifg=White guibg=DimGray
+    hi VertSplit gui=none guifg=White guibg=DimGray
+    hi Wildmenu gui=bold guifg=Black guibg=White
+
+    hi Pmenu guibg=Grey65 guifg=Black gui=none
+    hi PmenuSbar guibg=Grey50 guifg=fg gui=none
+    hi PmenuSel guibg=Yellow guifg=Black gui=none
+    hi PmenuThumb guibg=Grey75 guifg=fg gui=none
+
+    hi IncSearch gui=none guifg=White guibg=Black
+    hi Search gui=none guifg=Black guibg=Yellow
+
+    hi MoreMsg gui=bold guifg=ForestGreen
+    hi Question gui=bold guifg=ForestGreen
+    hi WarningMsg gui=bold guifg=Red
+
+    hi Comment gui=italic guifg=RoyalBlue3
+    hi Error gui=none guifg=White guibg=Red
+    hi Identifier gui=none guifg=Sienna4
+    hi Special gui=none guifg=RoyalBlue4
+    hi PreProc gui=none guifg=RoyalBlue3
+    hi Todo gui=bold guifg=Black guibg=Yellow
+    hi Type gui=bold guifg=RoyalBlue4
+    hi Underlined gui=underline guifg=Blue
+
+    hi Boolean gui=bold guifg=ForestGreen
+    hi Constant gui=none guifg=ForestGreen
+    hi Number gui=bold guifg=ForestGreen
+    hi String gui=none guifg=ForestGreen
+
+    hi Label gui=bold,underline guifg=Sienna4
+    hi Statement gui=bold guifg=Sienna4
+
+    hi htmlBold gui=bold
+    hi htmlItalic gui=italic
+    hi htmlUnderline gui=underline
+    hi htmlBoldItalic gui=bold,italic
+    hi htmlBoldUnderline gui=bold,underline
+    hi htmlBoldUnderlineItalic gui=bold,underline,italic
+    hi htmlUnderlineItalic gui=underline,italic
+endif
diff --git a/vim/colors/silent.vim b/vim/colors/silent.vim
new file mode 100644 (file)
index 0000000..679ecd7
--- /dev/null
@@ -0,0 +1,116 @@
+" Vim color file
+" @Author: Pascal Vasilii <jabberroid@gmail.com>       
+
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "silent"
+set background=light
+
+hi Cursor           guibg=#0057ae      guifg=white             gui=NONE
+hi LineNr           guibg=#F1FFC1      guifg=DarkGray  gui=bold,italic 
+hi StatusLineNC     guibg=#bbbbbb      guifg=White             gui=bold,italic
+hi StatusLine       guibg=#1D343B      guifg=#DDDDDD   gui=italic
+hi Title            guibg=white                guifg=Black             gui=bold 
+hi TablineSel       guibg=white                guifg=Black             gui=bold 
+hi CursorLine       guibg=#F1FFC1      guifg=Black             gui=none
+hi CursorColumn     guibg=#fafafa      guifg=black             gui=NONE
+hi MatchParen       guifg=#141312      guibg=Yellow    gui=underline
+hi AutoHiGroup      guibg=Yellow       guifg=black
+"hi TabLineFill      guibg=red guifg=#606060 gui=none
+hi SignColumn       guibg=#F1FFC1      guifg=black             gui=bold
+
+hi Directory       guibg=white         guifg=Black             gui=bold,italic 
+hi Tooltip         guibg=#F1FFC1       guifg=DarkGray  gui=bold,italic 
+hi FoldColumn       guibg=#F1FFC1      guifg=Black             gui=none 
+hi VertSplit        guibg=#F1FFC1      guifg=#F1FFC1   gui=none 
+hi Wildmenu         guibg=White                guifg=Black             gui=bold 
+
+hi Pmenu            guibg=#DDDDDD      guifg=Black             gui=italic
+hi PmenuSbar        guibg=#DDDDDD      guifg=fg                gui=italic
+hi PmenuSel         guibg=#F1FFC1      guifg=Black             gui=italic
+hi PmenuThumb       guibg=#DDDDDD      guifg=fg                gui=none
+
+hi IncSearch        guibg=Black                guifg=White             gui=none
+hi Search           guibg=Yellow       guifg=Black             gui=none
+
+hi Normal              guibg=White             guifg=#141312   gui=NONE
+hi Visual              guibg=#4485FF   guifg=white             gui=bold
+hi VisualNos       guibg=#4485FF       guifg=white             gui=bold
+hi Comment             guibg=white             guifg=#888786   gui=italic
+hi PerlPOD             guibg=white     guifg=#B86A18   gui=NONE
+" dark green 006e26
+hi Constant            guibg=white             guifg=#006e26   gui=bold
+
+hi Character       guibg=white         guifg=#644A9B   gui=NONE
+hi String           guibg=white        guifg=#BF0303   gui=italic
+"hi Number                     guibg=white     guifg=black             gui=bold
+hi Number              guibg=white     guifg=#B07E00   gui=NONE
+hi Boolean             guibg=white     guifg=#B07E00   gui=NONE
+hi Define              guibg=white     guifg=#006E26   gui=bold
+
+" vars 
+hi Identifier      guibg=white         guifg=#0057AE   gui=NONE
+hi Exception       guibg=white         guifg=black             gui=bold
+" return ~olive   
+hi Statement       guibg=white         guifg=#B07E00   gui=NONE
+"hi Label              guibg=white     guifg=#B07E00   gui=NONE
+hi PreProc             guibg=white     guifg=#141312   gui=bold
+hi Function            guibg=white     guifg=#B07E00   gui=NONE
+hi Repeat              guibg=white     guifg=#B07E00   gui=bold
+"$='"[
+hi Operator            guibg=white     guifg=#0057AE   gui=NONE
+hi Ignore              guibg=white     guifg=bg
+hi Folded           guibg=#F1FFC1      guifg=#101010   gui=italic
+hi Error               guibg=#D80000   guifg=#FFD1CC   term=reverse  gui=NONE
+hi Todo                        guibg=#AD5500   guifg=Grey              term=standout gui=NONE
+hi Done                        guibg=Gray              guifg=#CCEEFF   term=standout gui=NONE
+
+hi SpellErrors      guibg=white                guifg=#9C0D0D gui=NONE
+hi SpellBad         guibg=white        gui=undercurl guisp=#9C0D0D
+hi SpellCap         guibg=white        gui=undercurl guisp=#9C0D0D
+hi SpellLocal       guibg=white        gui=undercurl guisp=#9C0D0D
+hi SpellRare        guibg=white        gui=undercurl guisp=#9C0D0D
+
+hi MoreMsg          guibg=white                guifg=black             gui=NONE
+hi ModeMsg          guibg=white                guifg=black             gui=NONE
+hi DiffAdd          guibg=#CCFFCC      guifg=NONE              gui=NONE
+hi DiffDelete       guibg=#FFCCCC      guifg=NONE              gui=NONE
+hi DiffChange       guibg=#F1FFC1      guifg=NONE              gui=NONE
+hi DiffText         guibg=white                guifg=NONE              gui=NONE
+
+hi Question         guibg=white                guifg=black             gui=bold
+hi Conditional         guibg=white     guifg=#B07E00   gui=NONE
+hi Include                     guibg=white     guifg=#141312   gui=bold
+hi SpecialChar         guibg=white     guifg=#141312   gui=bold
+hi Underlined          guibg=white     guifg=#0057ae   gui=underline
+
+" -> 
+hi Structure           guibg=white     guifg=black             gui=none
+hi Chatacter           guibg=white     guifg=black             gui=none
+" dark red #D80000
+hi Float                       guibg=#CCFFCC   guifg=blue              gui=NONE
+hi Macro                       guibg=white             guifg=black             gui=bold
+" #ifdef #endif dark blue 
+hi PreCondit           guibg=white             guifg=#0057ae   gui=bold 
+hi Delimiter           guibg=white             guifg=black             gui=NONE 
+" const static
+hi StorageClass        guibg=white             guifg=#006e26   gui=NONE 
+"type
+hi Typedef                     guibg=#CCFFCC   guifg=#006e26   gui=bold
+" int char 
+hi Type                        guibg=white             guifg=black             gui=NONE 
+hi Tag                         guibg=#CCFFCC   guifg=#0057AE   gui=NONE 
+hi Special             guibg=white             guifg=black             gui=NONE
+hi SpecialKey       guibg=white                guifg=black             gui=none
+"NonText               '~' and '@' at the end of the window, characters from
+               "'showbreak' and other characters that do not really exist in
+               "the text (e.g., ">" displayed when a double-wide character
+               "doesn't fit at the end of the line).
+hi NonText          guibg=white                guifg=black             gui=none
+hi Keyword             guibg=white             guifg=#141312   gui=NONE
+
+hi link SpecialComment         Special
+hi link Debug          Special
diff --git a/vim/colors/simpleandfriendly.vim b/vim/colors/simpleandfriendly.vim
new file mode 100644 (file)
index 0000000..cd6d8b4
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Maintainer:  Thomas Schmall www.oxpal.com
+" Last Change: Nov 2 2009 
+" URL: http://www.vim.org/scripts/script.php?script_id=792
+" Version: 1.4
+
+" This color scheme uses a light grey background.
+
+" Last Changes:
+" *line number colors changed
+" *current line highlighting
+
+
+" First remove all existing highlighting.
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "simpleandfriendly"
+
+"set the highlighting of the current line to true - then give it a color
+"delete next line to turn off current line highlighting for this color scheme
+set cul
+hi cursorline gui=underline 
+"guibg=grey91 
+hi visual guibg=grey80 guifg=black
+
+
+"Set nice colors #DC6210
+"Cursor is Cyan when ":lmap" mappings are active
+hi lCursor guibg=Cyan guifg=NONE
+hi LineNr       guifg=white  guibg=#acbbff
+
+"Text below the last line is darker grey
+hi NonText     guibg=grey80
+"Normal text is black background is grey
+hi Normal      guifg=black             guibg=grey89  ctermfg=Black  ctermbg=LightGrey 
+hi Comment     guifg=Orange    guibg=grey94    ctermfg=DarkCyan        term=bold
+"Constants are not underlined but have a slightly lighter background
+hi Constant    guifg=#8080a0   guibg=grey92    gui=NONE  term=underline
+hi String        guifg=#80a0ff         guibg=grey93    gui=NONE  term=underline        
+hi Number        guifg=#80a5ff         guibg=grey91  gui=NONE  ctermfg=Gray  term=none
+"Words like _if_ or _else_  (Grey27)
+hi Statement   guifg=#4A2B99   gui=NONE        ctermfg=Blue
+
+hi Title    guifg=red          ctermfg=red gui=NONE term=BOLD
+"color for _NONE_ for instance:
+hi PreProc     term=underline  ctermfg=LightBlue       guifg=#DC6210
+"color for _guifg_ for instance: (SlateBlue works here nice too)
+hi Type                guifg=#008080 ctermfg=LightGreen gui=None term=underline        
+hi Function    guifg=#61577A   term=bold       
+"in lingo the defined functions. (alt: SlateBlue)
+hi Identifier  guifg=Seagreen
+"hi Identifier term=underline  cterm=bold ctermfg=Cyan guifg=#40ffff
+
+"hi Repeat     term=underline  ctermfg=White           guifg=white
+"hi Ignore     guifg=bg        ctermfg=black
+hi Error       term=reverse  ctermbg=Red     ctermfg=White guibg=Red guifg=White
+hi Todo                term=standout   ctermbg=Yellow  ctermfg=Black guifg=Blue guibg=Yellow
+"Special Characters
+hi Special     guibg=grey90    guifg=Slateblue gui=UNDERLINE
+
+hi operator guifg=gray25  ctermfg=Black   term=bold   cterm=bold  gui=bold
diff --git a/vim/colors/softblue.vim b/vim/colors/softblue.vim
new file mode 100644 (file)
index 0000000..8d8ee1b
--- /dev/null
@@ -0,0 +1,45 @@
+" Vim color file
+" Maintainer:   Zhang Jing
+" Last Change:  %[% 2005ร„รช12ร”ร‚07รˆร• รร‡ร†รšรˆรฝ 10รŠยฑ41ยทร–49รƒรซ %]%
+
+set background=dark
+if version > 580
+    hi clear
+    if exists("syntax_on")
+       syntax reset
+    endif
+endif
+let g:colors_name="softblue"
+
+hi Normal          guibg=#183058   guifg=#b0b0e0
+
+hi Cursor          guibg=#b3b2df   guifg=grey30    gui=bold
+hi VertSplit   guibg=#466292   guifg=grey50    gui=none
+hi Folded          guibg=#0d2349   guifg=lightblue
+hi FoldColumn  guibg=#0d2349   guifg=lightblue
+hi IncSearch   guifg=slategrey guibg=khaki
+hi LineNr              guifg=grey30
+hi ModeMsg         guifg=SkyBlue
+hi MoreMsg         guifg=SeaGreen
+hi NonText         guifg=LightBlue guibg=#0d2349
+hi Question        guifg=#487cc4
+hi Search          guibg=#787878   guifg=wheat
+hi SpecialKey  guifg=yellowgreen
+hi StatusLine  guibg=#466292   guifg=black     gui=none
+hi StatusLineNC        guibg=#466292   guifg=grey22    gui=none
+hi Title           guifg=#38d9ff
+hi Visual          guifg=lightblue guibg=#001146   gui=none
+hi WarningMsg  guifg=salmon
+hi ErrorMsg     guifg=white     guibg=#b2377a
+
+hi Comment         guifg=#6279a0
+hi Constant        guifg=#9b60be
+hi Identifier  guifg=#00ac55
+hi Statement   guifg=SkyBlue2
+hi PreProc         guifg=#20a0d0
+hi Type                    guifg=#8070ff
+hi Special         guifg=#b6a040"wheat4"#7c9cf5"a2b9e0
+hi Ignore          guifg=grey40
+hi Error        guifg=white     guibg=#b2377a
+hi Todo                    guifg=#54b900   guibg=#622098   gui=bold
+"vim:ts=4:tw=4
diff --git a/vim/colors/solarized.vim b/vim/colors/solarized.vim
new file mode 100644 (file)
index 0000000..70f5223
--- /dev/null
@@ -0,0 +1,1117 @@
+" Name:     Solarized vim colorscheme
+" Author:   Ethan Schoonover <es@ethanschoonover.com>
+" URL:      http://ethanschoonover.com/solarized
+"           (see this url for latest release & screenshots)
+" License:  OSI approved MIT license (see end of this file)
+" Created:  In the middle of the night
+" Modified: 2011 May 05
+"
+" Usage "{{{
+"
+" ---------------------------------------------------------------------
+" ABOUT:
+" ---------------------------------------------------------------------
+" Solarized is a carefully designed selective contrast colorscheme with dual
+" light and dark modes that runs in both GUI, 256 and 16 color modes.
+"
+" See the homepage above for screenshots and details.
+"
+" ---------------------------------------------------------------------
+" OPTIONS:
+" ---------------------------------------------------------------------
+" See the "solarized.txt" help file included with this colorscheme (in the 
+" "doc" subdirectory) for information on options, usage, the Toggle Background 
+" function and more. If you have already installed Solarized, this is available 
+" from the Solarized menu and command line as ":help solarized"
+"
+" ---------------------------------------------------------------------
+" INSTALLATION:
+" ---------------------------------------------------------------------
+" Two options for installation: manual or pathogen
+"
+" MANUAL INSTALLATION OPTION:
+" ---------------------------------------------------------------------
+"
+" 1.  Download the solarized distribution (available on the homepage above)
+"     and unarchive the file.
+" 2.  Move `solarized.vim` to your `.vim/colors` directory.
+" 3.  Move each of the files in each subdirectories to the corresponding .vim
+"     subdirectory (e.g. autoload/togglebg.vim goes into your .vim/autoload 
+"     directory as .vim/autoload/togglebg.vim).
+"
+" RECOMMENDED PATHOGEN INSTALLATION OPTION:
+" ---------------------------------------------------------------------
+"
+" 1.  Download and install Tim Pope's Pathogen from:
+"     https://github.com/tpope/vim-pathogen
+"
+" 2.  Next, move or clone the `vim-colors-solarized` directory so that it is
+"     a subdirectory of the `.vim/bundle` directory.
+"
+"     a. **clone with git:**
+"
+"       $ cd ~/.vim/bundle
+"       $ git clone git://github.com/altercation/vim-colors-solarized.git
+"
+"     b. **or move manually into the pathogen bundle directory:**
+"         In the parent directory of vim-colors-solarized:
+"
+"         $ mv vim-colors-solarized ~/.vim/bundle/
+"
+" MODIFY VIMRC:
+"
+" After either Option 1 or Option 2 above, put the following two lines in your
+" .vimrc:
+"
+"     syntax enable
+"     set background=dark
+"     colorscheme solarized
+"
+" or, for the light background mode of Solarized:
+"
+"     syntax enable
+"     set background=light
+"     colorscheme solarized
+"
+" I like to have a different background in GUI and terminal modes, so I can use
+" the following if-then. However, I find vim's background autodetection to be
+" pretty good and, at least with MacVim, I can leave this background value
+" assignment out entirely and get the same results.
+"
+"     if has('gui_running')
+"       set background=light
+"     else
+"       set background=dark
+"     endif
+"
+" See the Solarized homepage at http://ethanschoonover.com/solarized for
+" screenshots which will help you select either the light or dark background.
+"
+" ---------------------------------------------------------------------
+" COLOR VALUES
+" ---------------------------------------------------------------------
+" Download palettes and files from: http://ethanschoonover.com/solarized
+"
+" L\*a\*b values are canonical (White D65, Reference D50), other values are
+" matched in sRGB space.
+"
+" SOLARIZED HEX     16/8 TERMCOL  XTERM/HEX   L*A*B      sRGB        HSB
+" --------- ------- ---- -------  ----------- ---------- ----------- -----------
+" base03    #002b36  8/4 brblack  234 #1c1c1c 15 -12 -12   0  43  54 193 100  21
+" base02    #073642  0/4 black    235 #262626 20 -12 -12   7  54  66 192  90  26
+" base01    #586e75 10/7 brgreen  240 #4e4e4e 45 -07 -07  88 110 117 194  25  46
+" base00    #657b83 11/7 bryellow 241 #585858 50 -07 -07 101 123 131 195  23  51
+" base0     #839496 12/6 brblue   244 #808080 60 -06 -03 131 148 150 186  13  59
+" base1     #93a1a1 14/4 brcyan   245 #8a8a8a 65 -05 -02 147 161 161 180   9  63
+" base2     #eee8d5  7/7 white    254 #d7d7af 92 -00  10 238 232 213  44  11  93
+" base3     #fdf6e3 15/7 brwhite  230 #ffffd7 97  00  10 253 246 227  44  10  99
+" yellow    #b58900  3/3 yellow   136 #af8700 60  10  65 181 137   0  45 100  71
+" orange    #cb4b16  9/3 brred    166 #d75f00 50  50  55 203  75  22  18  89  80
+" red       #dc322f  1/1 red      160 #d70000 50  65  45 220  50  47   1  79  86
+" magenta   #d33682  5/5 magenta  125 #af005f 50  65 -05 211  54 130 331  74  83
+" violet    #6c71c4 13/5 brmagenta 61 #5f5faf 50  15 -45 108 113 196 237  45  77
+" blue      #268bd2  4/4 blue      33 #0087ff 55 -10 -45  38 139 210 205  82  82
+" cyan      #2aa198  6/6 cyan      37 #00afaf 60 -35 -05  42 161 152 175  74  63
+" green     #859900  2/2 green     64 #5f8700 60 -20  65 133 153   0  68 100  60
+"
+" ---------------------------------------------------------------------
+" COLORSCHEME HACKING
+" ---------------------------------------------------------------------
+"
+" Useful commands for testing colorschemes:
+" :source $VIMRUNTIME/syntax/hitest.vim
+" :help highlight-groups
+" :help cterm-colors
+" :help group-name
+"
+" Useful links for developing colorschemes:
+" http://www.vim.org/scripts/script.php?script_id=2937
+" http://vimcasts.org/episodes/creating-colorschemes-for-vim/
+" http://www.frexx.de/xterm-256-notes/"
+"
+" }}}
+" Environment Specific Overrides "{{{
+" Allow or disallow certain features based on current terminal emulator or 
+" environment.
+
+" Terminals that support italics
+let s:terms_italic=[
+            \"rxvt",
+            \"gnome-terminal"
+            \]
+" For reference only, terminals are known to be incomptible.
+" Terminals that are in neither list need to be tested.
+let s:terms_noitalic=[
+            \"iTerm.app",
+            \"Apple_Terminal"
+            \]
+if has("gui_running")
+    let s:terminal_italic=1 " TODO: could refactor to not require this at all
+else
+    let s:terminal_italic=0 " terminals will be guilty until proven compatible
+    for term in s:terms_italic
+        if $TERM_PROGRAM =~ term
+            let s:terminal_italic=1
+        endif
+    endfor
+endif
+
+" }}}
+" Default option values"{{{
+" ---------------------------------------------------------------------
+" s:options_list is used to autogenerate a list of all non-default options 
+" using "call SolarizedOptions()" or with the "Generate .vimrc commands" 
+" Solarized menu option. See the "Menus" section below for the function itself.
+let s:options_list=[
+            \'" this block of commands has been autogenerated by solarized.vim and',
+            \'" includes the current, non-default Solarized option values.',
+            \'" To use, place these commands in your .vimrc file (replacing any',
+            \'" existing colorscheme commands). See also ":help solarized"',
+            \'',
+            \'" ------------------------------------------------------------------',
+            \'" Solarized Colorscheme Config',
+            \'" ------------------------------------------------------------------',
+            \]
+let s:colorscheme_list=[
+            \'syntax enable',
+            \'set background='.&background,
+            \'colorscheme solarized',
+            \]
+let s:defaults_list=[
+            \'" ------------------------------------------------------------------',
+            \'',
+            \'" The following items are available options, but do not need to be',
+            \'" included in your .vimrc as they are currently set to their defaults.',
+            \''
+            \]
+let s:lazycat_list=[
+            \'" lazy method of appending this onto your .vimrc ":w! >> ~/.vimrc"',
+            \'" ------------------------------------------------------------------',
+            \]
+
+function! s:SetOption(name,default)
+    if type(a:default) == type(0)
+        let l:wrap=''
+        let l:ewrap=''
+    else
+        let l:wrap='"'
+        let l:ewrap='\"'
+    endif
+    if !exists("g:solarized_".a:name) || g:solarized_{a:name}==a:default
+        exe 'let g:solarized_'.a:name.'='.l:wrap.a:default.l:wrap.'"'
+        exe 'call add(s:defaults_list, "\" let g:solarized_'.a:name.'='.l:ewrap.g:solarized_{a:name}.l:ewrap.'")'
+    else
+        exe 'call add(s:options_list,  "let g:solarized_'.a:name.'='.l:ewrap.g:solarized_{a:name}.l:ewrap.'    \"default value is '.a:default.'")'
+    endif
+endfunction
+
+if ($TERM_PROGRAM ==? "apple_terminal" && &t_Co < 256)
+    let s:solarized_termtrans_default = 1
+else
+    let s:solarized_termtrans_default = 0
+endif
+call s:SetOption("termtrans",s:solarized_termtrans_default)
+call s:SetOption("degrade",0)
+call s:SetOption("bold",1)
+call s:SetOption("underline",1)
+call s:SetOption("italic",1) " note that we need to override this later if the terminal doesn't support
+call s:SetOption("termcolors",16)
+call s:SetOption("contrast","normal")
+call s:SetOption("visibility","normal")
+call s:SetOption("diffmode","normal")
+call s:SetOption("hitrail",0)
+call s:SetOption("menu",1)
+
+"}}}
+" Colorscheme initialization "{{{
+" ---------------------------------------------------------------------
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let colors_name = "solarized"
+
+"}}}
+" GUI & CSApprox hexadecimal palettes"{{{
+" ---------------------------------------------------------------------
+"
+" Set both gui and terminal color values in separate conditional statements
+" Due to possibility that CSApprox is running (though I suppose we could just
+" leave the hex values out entirely in that case and include only cterm colors)
+" We also check to see if user has set solarized (force use of the
+" neutral gray monotone palette component)
+if (has("gui_running") && g:solarized_degrade == 0)
+    let s:vmode       = "gui"
+    let s:base03      = "#002b36"
+    let s:base02      = "#073642"
+    let s:base01      = "#586e75"
+    let s:base00      = "#657b83"
+    let s:base0       = "#839496"
+    let s:base1       = "#93a1a1"
+    let s:base2       = "#eee8d5"
+    let s:base3       = "#fdf6e3"
+    let s:yellow      = "#b58900"
+    let s:orange      = "#cb4b16"
+    let s:red         = "#dc322f"
+    let s:magenta     = "#d33682"
+    let s:violet      = "#6c71c4"
+    let s:blue        = "#268bd2"
+    let s:cyan        = "#2aa198"
+    "let s:green       = "#859900" "original
+    let s:green       = "#719e07" "experimental
+elseif (has("gui_running") && g:solarized_degrade == 1)
+    " These colors are identical to the 256 color mode. They may be viewed
+    " while in gui mode via "let g:solarized_degrade=1", though this is not
+    " recommened and is for testing only.
+    let s:vmode       = "gui"
+    let s:base03      = "#1c1c1c"
+    let s:base02      = "#262626"
+    let s:base01      = "#4e4e4e"
+    let s:base00      = "#585858"
+    let s:base0       = "#808080"
+    let s:base1       = "#8a8a8a"
+    let s:base2       = "#d7d7af"
+    let s:base3       = "#ffffd7"
+    let s:yellow      = "#af8700"
+    let s:orange      = "#d75f00"
+    let s:red         = "#af0000"
+    let s:magenta     = "#af005f"
+    let s:violet      = "#5f5faf"
+    let s:blue        = "#0087ff"
+    let s:cyan        = "#00afaf"
+    let s:green       = "#5f8700"
+elseif g:solarized_termcolors != 256 && &t_Co >= 16
+    let s:vmode       = "cterm"
+    let s:base03      = "8"
+    let s:base02      = "0"
+    let s:base01      = "10"
+    let s:base00      = "11"
+    let s:base0       = "12"
+    let s:base1       = "14"
+    let s:base2       = "7"
+    let s:base3       = "15"
+    let s:yellow      = "3"
+    let s:orange      = "9"
+    let s:red         = "1"
+    let s:magenta     = "5"
+    let s:violet      = "13"
+    let s:blue        = "4"
+    let s:cyan        = "6"
+    let s:green       = "2"
+elseif g:solarized_termcolors == 256
+    let s:vmode       = "cterm"
+    let s:base03      = "234"
+    let s:base02      = "235"
+    let s:base01      = "239"
+    let s:base00      = "240"
+    let s:base0       = "244"
+    let s:base1       = "245"
+    let s:base2       = "187"
+    let s:base3       = "230"
+    let s:yellow      = "136"
+    let s:orange      = "166"
+    let s:red         = "124"
+    let s:magenta     = "125"
+    let s:violet      = "61"
+    let s:blue        = "33"
+    let s:cyan        = "37"
+    let s:green       = "64"
+else
+    let s:vmode       = "cterm"
+    let s:bright      = "* term=bold cterm=bold"
+"   let s:base03      = "0".s:bright
+"   let s:base02      = "0"
+"   let s:base01      = "2".s:bright
+"   let s:base00      = "3".s:bright
+"   let s:base0       = "4".s:bright
+"   let s:base1       = "6".s:bright
+"   let s:base2       = "7"
+"   let s:base3       = "7".s:bright
+"   let s:yellow      = "3"
+"   let s:orange      = "1".s:bright
+"   let s:red         = "1"
+"   let s:magenta     = "5"
+"   let s:violet      = "5".s:bright
+"   let s:blue        = "4"
+"   let s:cyan        = "6"
+"   let s:green       = "2"
+    let s:base03      = "DarkGray"      " 0*
+    let s:base02      = "Black"         " 0
+    let s:base01      = "LightGreen"    " 2*
+    let s:base00      = "LightYellow"   " 3*
+    let s:base0       = "LightBlue"     " 4*
+    let s:base1       = "LightCyan"     " 6*
+    let s:base2       = "LightGray"     " 7
+    let s:base3       = "White"         " 7*
+    let s:yellow      = "DarkYellow"    " 3
+    let s:orange      = "LightRed"      " 1*
+    let s:red         = "DarkRed"       " 1
+    let s:magenta     = "DarkMagenta"   " 5
+    let s:violet      = "LightMagenta"  " 5*
+    let s:blue        = "DarkBlue"      " 4
+    let s:cyan        = "DarkCyan"      " 6
+    let s:green       = "DarkGreen"     " 2
+
+endif
+"}}}
+" Formatting options and null values for passthrough effect "{{{
+" ---------------------------------------------------------------------
+    let s:none            = "NONE"
+    let s:none            = "NONE"
+    let s:t_none          = "NONE"
+    let s:n               = "NONE"
+    let s:c               = ",undercurl"
+    let s:r               = ",reverse"
+    let s:s               = ",standout"
+    let s:ou              = ""
+    let s:ob              = ""
+"}}}
+" Background value based on termtrans setting "{{{
+" ---------------------------------------------------------------------
+if (has("gui_running") || g:solarized_termtrans == 0)
+    let s:back        = s:base03
+else
+    let s:back        = "NONE"
+endif
+"}}}
+" Alternate light scheme "{{{
+" ---------------------------------------------------------------------
+if &background == "light"
+    let s:temp03      = s:base03
+    let s:temp02      = s:base02
+    let s:temp01      = s:base01
+    let s:temp00      = s:base00
+    let s:base03      = s:base3
+    let s:base02      = s:base2
+    let s:base01      = s:base1
+    let s:base00      = s:base0
+    let s:base0       = s:temp00
+    let s:base1       = s:temp01
+    let s:base2       = s:temp02
+    let s:base3       = s:temp03
+    if (s:back != "NONE")
+        let s:back    = s:base03
+    endif
+endif
+"}}}
+" Optional contrast schemes "{{{
+" ---------------------------------------------------------------------
+if g:solarized_contrast == "high"
+    let s:base01      = s:base00
+    let s:base00      = s:base0
+    let s:base0       = s:base1
+    let s:base1       = s:base2
+    let s:base2       = s:base3
+    let s:back        = s:back
+endif
+if g:solarized_contrast == "low"
+    let s:back        = s:base02
+    let s:ou          = ",underline"
+endif
+"}}}
+" Overrides dependent on user specified values and environment "{{{
+" ---------------------------------------------------------------------
+if (g:solarized_bold == 0 || &t_Co == 8 )
+    let s:b           = ""
+    let s:bb          = ",bold"
+else
+    let s:b           = ",bold"
+    let s:bb          = ""
+endif
+
+if g:solarized_underline == 0
+    let s:u           = ""
+else
+    let s:u           = ",underline"
+endif
+
+if g:solarized_italic == 0 || s:terminal_italic == 0
+    let s:i           = ""
+else
+    let s:i           = ",italic"
+endif
+"}}}
+" Highlighting primitives"{{{
+" ---------------------------------------------------------------------
+
+exe "let s:bg_none      = ' ".s:vmode."bg=".s:none   ."'"
+exe "let s:bg_back      = ' ".s:vmode."bg=".s:back   ."'"
+exe "let s:bg_base03    = ' ".s:vmode."bg=".s:base03 ."'"
+exe "let s:bg_base02    = ' ".s:vmode."bg=".s:base02 ."'"
+exe "let s:bg_base01    = ' ".s:vmode."bg=".s:base01 ."'"
+exe "let s:bg_base00    = ' ".s:vmode."bg=".s:base00 ."'"
+exe "let s:bg_base0     = ' ".s:vmode."bg=".s:base0  ."'"
+exe "let s:bg_base1     = ' ".s:vmode."bg=".s:base1  ."'"
+exe "let s:bg_base2     = ' ".s:vmode."bg=".s:base2  ."'"
+exe "let s:bg_base3     = ' ".s:vmode."bg=".s:base3  ."'"
+exe "let s:bg_green     = ' ".s:vmode."bg=".s:green  ."'"
+exe "let s:bg_yellow    = ' ".s:vmode."bg=".s:yellow ."'"
+exe "let s:bg_orange    = ' ".s:vmode."bg=".s:orange ."'"
+exe "let s:bg_red       = ' ".s:vmode."bg=".s:red    ."'"
+exe "let s:bg_magenta   = ' ".s:vmode."bg=".s:magenta."'"
+exe "let s:bg_violet    = ' ".s:vmode."bg=".s:violet ."'"
+exe "let s:bg_blue      = ' ".s:vmode."bg=".s:blue   ."'"
+exe "let s:bg_cyan      = ' ".s:vmode."bg=".s:cyan   ."'"
+
+exe "let s:fg_none      = ' ".s:vmode."fg=".s:none   ."'"
+exe "let s:fg_back      = ' ".s:vmode."fg=".s:back   ."'"
+exe "let s:fg_base03    = ' ".s:vmode."fg=".s:base03 ."'"
+exe "let s:fg_base02    = ' ".s:vmode."fg=".s:base02 ."'"
+exe "let s:fg_base01    = ' ".s:vmode."fg=".s:base01 ."'"
+exe "let s:fg_base00    = ' ".s:vmode."fg=".s:base00 ."'"
+exe "let s:fg_base0     = ' ".s:vmode."fg=".s:base0  ."'"
+exe "let s:fg_base1     = ' ".s:vmode."fg=".s:base1  ."'"
+exe "let s:fg_base2     = ' ".s:vmode."fg=".s:base2  ."'"
+exe "let s:fg_base3     = ' ".s:vmode."fg=".s:base3  ."'"
+exe "let s:fg_green     = ' ".s:vmode."fg=".s:green  ."'"
+exe "let s:fg_yellow    = ' ".s:vmode."fg=".s:yellow ."'"
+exe "let s:fg_orange    = ' ".s:vmode."fg=".s:orange ."'"
+exe "let s:fg_red       = ' ".s:vmode."fg=".s:red    ."'"
+exe "let s:fg_magenta   = ' ".s:vmode."fg=".s:magenta."'"
+exe "let s:fg_violet    = ' ".s:vmode."fg=".s:violet ."'"
+exe "let s:fg_blue      = ' ".s:vmode."fg=".s:blue   ."'"
+exe "let s:fg_cyan      = ' ".s:vmode."fg=".s:cyan   ."'"
+
+exe "let s:fmt_none     = ' ".s:vmode."=NONE".          " term=NONE".    "'"
+exe "let s:fmt_bold     = ' ".s:vmode."=NONE".s:b.      " term=NONE".s:b."'"
+exe "let s:fmt_bldi     = ' ".s:vmode."=NONE".s:b.      " term=NONE".s:b."'"
+exe "let s:fmt_undr     = ' ".s:vmode."=NONE".s:u.      " term=NONE".s:u."'"
+exe "let s:fmt_undb     = ' ".s:vmode."=NONE".s:u.s:b.  " term=NONE".s:u.s:b."'"
+exe "let s:fmt_undi     = ' ".s:vmode."=NONE".s:u.      " term=NONE".s:u."'"
+exe "let s:fmt_uopt     = ' ".s:vmode."=NONE".s:ou.     " term=NONE".s:ou."'"
+exe "let s:fmt_curl     = ' ".s:vmode."=NONE".s:c.      " term=NONE".s:c."'"
+exe "let s:fmt_ital     = ' ".s:vmode."=NONE".s:i.      " term=NONE".s:i."'"
+exe "let s:fmt_stnd     = ' ".s:vmode."=NONE".s:s.      " term=NONE".s:s."'"
+exe "let s:fmt_revr     = ' ".s:vmode."=NONE".s:r.      " term=NONE".s:r."'"
+exe "let s:fmt_revb     = ' ".s:vmode."=NONE".s:r.s:b.  " term=NONE".s:r.s:b."'"
+" revbb (reverse bold for bright colors) is only set to actual bold in low 
+" color terminals (t_co=8, such as OS X Terminal.app) and should only be used 
+" with colors 8-15.
+exe "let s:fmt_revbb    = ' ".s:vmode."=NONE".s:r.s:bb.   " term=NONE".s:r.s:bb."'"
+exe "let s:fmt_revbbu   = ' ".s:vmode."=NONE".s:r.s:bb.s:u." term=NONE".s:r.s:bb.s:u."'"
+
+if has("gui_running")
+    exe "let s:sp_none      = ' guisp=".s:none   ."'"
+    exe "let s:sp_back      = ' guisp=".s:back   ."'"
+    exe "let s:sp_base03    = ' guisp=".s:base03 ."'"
+    exe "let s:sp_base02    = ' guisp=".s:base02 ."'"
+    exe "let s:sp_base01    = ' guisp=".s:base01 ."'"
+    exe "let s:sp_base00    = ' guisp=".s:base00 ."'"
+    exe "let s:sp_base0     = ' guisp=".s:base0  ."'"
+    exe "let s:sp_base1     = ' guisp=".s:base1  ."'"
+    exe "let s:sp_base2     = ' guisp=".s:base2  ."'"
+    exe "let s:sp_base3     = ' guisp=".s:base3  ."'"
+    exe "let s:sp_green     = ' guisp=".s:green  ."'"
+    exe "let s:sp_yellow    = ' guisp=".s:yellow ."'"
+    exe "let s:sp_orange    = ' guisp=".s:orange ."'"
+    exe "let s:sp_red       = ' guisp=".s:red    ."'"
+    exe "let s:sp_magenta   = ' guisp=".s:magenta."'"
+    exe "let s:sp_violet    = ' guisp=".s:violet ."'"
+    exe "let s:sp_blue      = ' guisp=".s:blue   ."'"
+    exe "let s:sp_cyan      = ' guisp=".s:cyan   ."'"
+else
+    let s:sp_none      = ""
+    let s:sp_back      = ""
+    let s:sp_base03    = ""
+    let s:sp_base02    = ""
+    let s:sp_base01    = ""
+    let s:sp_base00    = ""
+    let s:sp_base0     = ""
+    let s:sp_base1     = ""
+    let s:sp_base2     = ""
+    let s:sp_base3     = ""
+    let s:sp_green     = ""
+    let s:sp_yellow    = ""
+    let s:sp_orange    = ""
+    let s:sp_red       = ""
+    let s:sp_magenta   = ""
+    let s:sp_violet    = ""
+    let s:sp_blue      = ""
+    let s:sp_cyan      = ""
+endif
+
+"}}}
+" Basic highlighting"{{{
+" ---------------------------------------------------------------------
+" note that link syntax to avoid duplicate configuration doesn't work with the
+" exe compiled formats
+
+exe "hi! Normal"         .s:fmt_none   .s:fg_base0  .s:bg_back
+
+exe "hi! Comment"        .s:fmt_ital   .s:fg_base01 .s:bg_none
+"       *Comment         any comment
+
+exe "hi! Constant"       .s:fmt_none   .s:fg_cyan   .s:bg_none
+"       *Constant        any constant
+"        String          a string constant: "this is a string"
+"        Character       a character constant: 'c', '\n'
+"        Number          a number constant: 234, 0xff
+"        Boolean         a boolean constant: TRUE, false
+"        Float           a floating point constant: 2.3e10
+
+exe "hi! Identifier"     .s:fmt_none   .s:fg_blue   .s:bg_none
+"       *Identifier      any variable name
+"        Function        function name (also: methods for classes)
+"
+exe "hi! Statement"      .s:fmt_none   .s:fg_green  .s:bg_none
+"       *Statement       any statement
+"        Conditional     if, then, else, endif, switch, etc.
+"        Repeat          for, do, while, etc.
+"        Label           case, default, etc.
+"        Operator        "sizeof", "+", "*", etc.
+"        Keyword         any other keyword
+"        Exception       try, catch, throw
+
+exe "hi! PreProc"        .s:fmt_none   .s:fg_orange .s:bg_none
+"       *PreProc         generic Preprocessor
+"        Include         preprocessor #include
+"        Define          preprocessor #define
+"        Macro           same as Define
+"        PreCondit       preprocessor #if, #else, #endif, etc.
+
+exe "hi! Type"           .s:fmt_none   .s:fg_yellow .s:bg_none
+"       *Type            int, long, char, etc.
+"        StorageClass    static, register, volatile, etc.
+"        Structure       struct, union, enum, etc.
+"        Typedef         A typedef
+
+exe "hi! Special"        .s:fmt_none   .s:fg_red    .s:bg_none
+"       *Special         any special symbol
+"        SpecialChar     special character in a constant
+"        Tag             you can use CTRL-] on this
+"        Delimiter       character that needs attention
+"        SpecialComment  special things inside a comment
+"        Debug           debugging statements
+
+exe "hi! Underlined"     .s:fmt_none   .s:fg_violet .s:bg_none
+"       *Underlined      text that stands out, HTML links
+
+exe "hi! Ignore"         .s:fmt_none   .s:fg_none   .s:bg_none
+"       *Ignore          left blank, hidden  |hl-Ignore|
+
+exe "hi! Error"          .s:fmt_bold   .s:fg_red    .s:bg_none
+"       *Error           any erroneous construct
+
+exe "hi! Todo"           .s:fmt_bold   .s:fg_magenta.s:bg_none
+"       *Todo            anything that needs extra attention; mostly the
+"                        keywords TODO FIXME and XXX
+"
+"}}}
+" Extended highlighting "{{{
+" ---------------------------------------------------------------------
+if      (g:solarized_visibility=="high")
+    exe "hi! SpecialKey" .s:fmt_revr   .s:fg_red    .s:bg_none
+    exe "hi! NonText"    .s:fmt_bold   .s:fg_red    .s:bg_none
+elseif  (g:solarized_visibility=="low")
+    exe "hi! SpecialKey" .s:fmt_bold   .s:fg_base02 .s:bg_none
+    exe "hi! NonText"    .s:fmt_bold   .s:fg_base02 .s:bg_none
+else
+    exe "hi! SpecialKey" .s:fmt_bold   .s:fg_base00 .s:bg_base02
+    exe "hi! NonText"    .s:fmt_bold   .s:fg_base00 .s:bg_none
+endif
+exe "hi! StatusLine"     .s:fmt_none   .s:fg_base1  .s:bg_base02 .s:fmt_revbb
+exe "hi! StatusLineNC"   .s:fmt_none   .s:fg_base00 .s:bg_base02 .s:fmt_revbb
+exe "hi! Visual"         .s:fmt_none   .s:fg_base01 .s:bg_base03 .s:fmt_revbb
+exe "hi! Directory"      .s:fmt_none   .s:fg_blue   .s:bg_none
+exe "hi! ErrorMsg"       .s:fmt_revr   .s:fg_red    .s:bg_none
+exe "hi! IncSearch"      .s:fmt_stnd   .s:fg_orange .s:bg_none
+exe "hi! Search"         .s:fmt_revr   .s:fg_yellow .s:bg_none
+exe "hi! MoreMsg"        .s:fmt_none   .s:fg_blue   .s:bg_none
+exe "hi! ModeMsg"        .s:fmt_none   .s:fg_blue   .s:bg_none
+exe "hi! LineNr"         .s:fmt_none   .s:fg_base01 .s:bg_base02
+exe "hi! Question"       .s:fmt_bold   .s:fg_cyan   .s:bg_none
+if ( has("gui_running") || &t_Co > 8 )
+    exe "hi! VertSplit"  .s:fmt_none   .s:fg_base00 .s:bg_base00
+else
+    exe "hi! VertSplit"  .s:fmt_revbb  .s:fg_base00 .s:bg_base02
+endif
+exe "hi! Title"          .s:fmt_bold   .s:fg_orange .s:bg_none
+exe "hi! VisualNOS"      .s:fmt_stnd   .s:fg_none   .s:bg_base02 .s:fmt_revbb
+exe "hi! WarningMsg"     .s:fmt_bold   .s:fg_red    .s:bg_none
+exe "hi! WildMenu"       .s:fmt_none   .s:fg_base2  .s:bg_base02 .s:fmt_revbb
+exe "hi! Folded"         .s:fmt_undb   .s:fg_base0  .s:bg_base02  .s:sp_base03
+exe "hi! FoldColumn"     .s:fmt_none   .s:fg_base0  .s:bg_base02
+if      (g:solarized_diffmode=="high")
+exe "hi! DiffAdd"        .s:fmt_revr   .s:fg_green  .s:bg_none
+exe "hi! DiffChange"     .s:fmt_revr   .s:fg_yellow .s:bg_none
+exe "hi! DiffDelete"     .s:fmt_revr   .s:fg_red    .s:bg_none
+exe "hi! DiffText"       .s:fmt_revr   .s:fg_blue   .s:bg_none
+elseif  (g:solarized_diffmode=="low")
+exe "hi! DiffAdd"        .s:fmt_undr   .s:fg_green  .s:bg_none   .s:sp_green
+exe "hi! DiffChange"     .s:fmt_undr   .s:fg_yellow .s:bg_none   .s:sp_yellow
+exe "hi! DiffDelete"     .s:fmt_bold   .s:fg_red    .s:bg_none
+exe "hi! DiffText"       .s:fmt_undr   .s:fg_blue   .s:bg_none   .s:sp_blue
+else " normal
+    if has("gui_running")
+exe "hi! DiffAdd"        .s:fmt_bold   .s:fg_green  .s:bg_base02 .s:sp_green
+exe "hi! DiffChange"     .s:fmt_bold   .s:fg_yellow .s:bg_base02 .s:sp_yellow
+exe "hi! DiffDelete"     .s:fmt_bold   .s:fg_red    .s:bg_base02
+exe "hi! DiffText"       .s:fmt_bold   .s:fg_blue   .s:bg_base02 .s:sp_blue
+    else
+exe "hi! DiffAdd"        .s:fmt_none   .s:fg_green  .s:bg_base02 .s:sp_green
+exe "hi! DiffChange"     .s:fmt_none   .s:fg_yellow .s:bg_base02 .s:sp_yellow
+exe "hi! DiffDelete"     .s:fmt_none   .s:fg_red    .s:bg_base02
+exe "hi! DiffText"       .s:fmt_none   .s:fg_blue   .s:bg_base02 .s:sp_blue
+    endif
+endif
+exe "hi! SignColumn"     .s:fmt_none   .s:fg_base0
+exe "hi! Conceal"        .s:fmt_none   .s:fg_blue   .s:bg_none
+exe "hi! SpellBad"       .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_red
+exe "hi! SpellCap"       .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_violet
+exe "hi! SpellRare"      .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_cyan
+exe "hi! SpellLocal"     .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_yellow
+exe "hi! Pmenu"          .s:fmt_none   .s:fg_base0  .s:bg_base02  .s:fmt_revbb
+exe "hi! PmenuSel"       .s:fmt_none   .s:fg_base01 .s:bg_base2   .s:fmt_revbb
+exe "hi! PmenuSbar"      .s:fmt_none   .s:fg_base2  .s:bg_base0   .s:fmt_revbb
+exe "hi! PmenuThumb"     .s:fmt_none   .s:fg_base0  .s:bg_base03  .s:fmt_revbb
+exe "hi! TabLine"        .s:fmt_undr   .s:fg_base0  .s:bg_base02  .s:sp_base0
+exe "hi! TabLineFill"    .s:fmt_undr   .s:fg_base0  .s:bg_base02  .s:sp_base0
+exe "hi! TabLineSel"     .s:fmt_undr   .s:fg_base01 .s:bg_base2   .s:sp_base0  .s:fmt_revbbu
+exe "hi! CursorColumn"   .s:fmt_none   .s:fg_none   .s:bg_base02
+exe "hi! CursorLine"     .s:fmt_uopt   .s:fg_none   .s:bg_base02  .s:sp_base1
+exe "hi! ColorColumn"    .s:fmt_none   .s:fg_none   .s:bg_base02
+exe "hi! Cursor"         .s:fmt_none   .s:fg_base03 .s:bg_base0
+hi! link lCursor Cursor
+exe "hi! MatchParen"     .s:fmt_bold   .s:fg_red    .s:bg_base01
+
+"}}}
+" vim syntax highlighting "{{{
+" ---------------------------------------------------------------------
+"exe "hi! vimLineComment" . s:fg_base01 .s:bg_none   .s:fmt_ital
+"hi! link vimComment Comment
+"hi! link vimLineComment Comment
+hi! link vimVar Identifier
+hi! link vimFunc Function
+hi! link vimUserFunc Function
+hi! link helpSpecial Special
+hi! link vimSet Normal
+hi! link vimSetEqual Normal
+exe "hi! vimCommentString"  .s:fmt_none    .s:fg_violet .s:bg_none
+exe "hi! vimCommand"        .s:fmt_none    .s:fg_yellow .s:bg_none
+exe "hi! vimCmdSep"         .s:fmt_bold    .s:fg_blue   .s:bg_none
+exe "hi! helpExample"       .s:fmt_none    .s:fg_base1  .s:bg_none
+exe "hi! helpOption"        .s:fmt_none    .s:fg_cyan   .s:bg_none
+exe "hi! helpNote"          .s:fmt_none    .s:fg_magenta.s:bg_none
+exe "hi! helpVim"           .s:fmt_none    .s:fg_magenta.s:bg_none
+exe "hi! helpHyperTextJump" .s:fmt_undr    .s:fg_blue   .s:bg_none
+exe "hi! helpHyperTextEntry".s:fmt_none    .s:fg_green  .s:bg_none
+exe "hi! vimIsCommand"      .s:fmt_none    .s:fg_base00 .s:bg_none
+exe "hi! vimSynMtchOpt"     .s:fmt_none    .s:fg_yellow .s:bg_none
+exe "hi! vimSynType"        .s:fmt_none    .s:fg_cyan   .s:bg_none
+exe "hi! vimHiLink"         .s:fmt_none    .s:fg_blue   .s:bg_none
+exe "hi! vimHiGroup"        .s:fmt_none    .s:fg_blue   .s:bg_none
+exe "hi! vimGroup"          .s:fmt_undb    .s:fg_blue   .s:bg_none
+"}}}
+" diff highlighting "{{{
+" ---------------------------------------------------------------------
+hi! link diffAdded Statement
+hi! link diffLine Identifier
+"}}}
+" git & gitcommit highlighting "{{{
+"git
+"exe "hi! gitDateHeader"
+"exe "hi! gitIdentityHeader"
+"exe "hi! gitIdentityKeyword"
+"exe "hi! gitNotesHeader"
+"exe "hi! gitReflogHeader"
+"exe "hi! gitKeyword"
+"exe "hi! gitIdentity"
+"exe "hi! gitEmailDelimiter"
+"exe "hi! gitEmail"
+"exe "hi! gitDate"
+"exe "hi! gitMode"
+"exe "hi! gitHashAbbrev"
+"exe "hi! gitHash"
+"exe "hi! gitReflogMiddle"
+"exe "hi! gitReference"
+"exe "hi! gitStage"
+"exe "hi! gitType"
+"exe "hi! gitDiffAdded"
+"exe "hi! gitDiffRemoved"
+"gitcommit
+"exe "hi! gitcommitSummary"      
+exe "hi! gitcommitComment"      .s:fmt_ital     .s:fg_base01    .s:bg_none
+hi! link gitcommitUntracked gitcommitComment
+hi! link gitcommitDiscarded gitcommitComment
+hi! link gitcommitSelected  gitcommitComment
+exe "hi! gitcommitUnmerged"     .s:fmt_bold     .s:fg_green     .s:bg_none
+exe "hi! gitcommitOnBranch"     .s:fmt_bold     .s:fg_base01    .s:bg_none
+exe "hi! gitcommitBranch"       .s:fmt_bold     .s:fg_magenta   .s:bg_none
+hi! link gitcommitNoBranch gitcommitBranch
+exe "hi! gitcommitDiscardedType".s:fmt_none     .s:fg_red       .s:bg_none
+exe "hi! gitcommitSelectedType" .s:fmt_none     .s:fg_green     .s:bg_none
+"exe "hi! gitcommitUnmergedType"
+"exe "hi! gitcommitType"
+"exe "hi! gitcommitNoChanges"
+"exe "hi! gitcommitHeader"
+exe "hi! gitcommitHeader"       .s:fmt_none     .s:fg_base01    .s:bg_none
+exe "hi! gitcommitUntrackedFile".s:fmt_bold     .s:fg_cyan      .s:bg_none
+exe "hi! gitcommitDiscardedFile".s:fmt_bold     .s:fg_red       .s:bg_none
+exe "hi! gitcommitSelectedFile" .s:fmt_bold     .s:fg_green     .s:bg_none
+exe "hi! gitcommitUnmergedFile" .s:fmt_bold     .s:fg_yellow    .s:bg_none
+exe "hi! gitcommitFile"         .s:fmt_bold     .s:fg_base0     .s:bg_none
+hi! link gitcommitDiscardedArrow gitcommitDiscardedFile
+hi! link gitcommitSelectedArrow  gitcommitSelectedFile
+hi! link gitcommitUnmergedArrow  gitcommitUnmergedFile
+"exe "hi! gitcommitArrow"
+"exe "hi! gitcommitOverflow"
+"exe "hi! gitcommitBlank"
+" }}}
+" html highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! htmlTag"           .s:fmt_none .s:fg_base01 .s:bg_none
+exe "hi! htmlEndTag"        .s:fmt_none .s:fg_base01 .s:bg_none
+exe "hi! htmlTagN"          .s:fmt_bold .s:fg_base1  .s:bg_none
+exe "hi! htmlTagName"       .s:fmt_bold .s:fg_blue   .s:bg_none
+exe "hi! htmlSpecialTagName".s:fmt_ital .s:fg_blue   .s:bg_none
+exe "hi! htmlArg"           .s:fmt_none .s:fg_base00 .s:bg_none
+exe "hi! javaScript"        .s:fmt_none .s:fg_yellow .s:bg_none
+"}}}
+" perl highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! perlHereDoc"    . s:fg_base1  .s:bg_back   .s:fmt_none
+exe "hi! perlVarPlain"   . s:fg_yellow .s:bg_back   .s:fmt_none
+exe "hi! perlStatementFileDesc". s:fg_cyan.s:bg_back.s:fmt_none
+
+"}}}
+" tex highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! texStatement"   . s:fg_cyan   .s:bg_back   .s:fmt_none
+exe "hi! texMathZoneX"   . s:fg_yellow .s:bg_back   .s:fmt_none
+exe "hi! texMathMatcher" . s:fg_yellow .s:bg_back   .s:fmt_none
+exe "hi! texMathMatcher" . s:fg_yellow .s:bg_back   .s:fmt_none
+exe "hi! texRefLabel"    . s:fg_yellow .s:bg_back   .s:fmt_none
+"}}}
+" ruby highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! rubyDefine"     . s:fg_base1  .s:bg_back   .s:fmt_bold
+"rubyInclude
+"rubySharpBang
+"rubyAccess
+"rubyPredefinedVariable
+"rubyBoolean
+"rubyClassVariable
+"rubyBeginEnd
+"rubyRepeatModifier
+"hi! link rubyArrayDelimiter    Special  " [ , , ]
+"rubyCurlyBlock  { , , }
+
+"hi! link rubyClass             Keyword
+"hi! link rubyModule            Keyword
+"hi! link rubyKeyword           Keyword
+"hi! link rubyOperator          Operator
+"hi! link rubyIdentifier        Identifier
+"hi! link rubyInstanceVariable  Identifier
+"hi! link rubyGlobalVariable    Identifier
+"hi! link rubyClassVariable     Identifier
+"hi! link rubyConstant          Type
+"}}}
+" haskell syntax highlighting"{{{
+" ---------------------------------------------------------------------
+" For use with syntax/haskell.vim : Haskell Syntax File
+" http://www.vim.org/scripts/script.php?script_id=3034
+" See also Steffen Siering's github repository:
+" http://github.com/urso/dotrc/blob/master/vim/syntax/haskell.vim
+" ---------------------------------------------------------------------
+"
+" Treat True and False specially, see the plugin referenced above
+let hs_highlight_boolean=1
+" highlight delims, see the plugin referenced above
+let hs_highlight_delimiters=1
+
+exe "hi! cPreCondit". s:fg_orange.s:bg_none   .s:fmt_none
+
+exe "hi! VarId"    . s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! ConId"    . s:fg_yellow .s:bg_none   .s:fmt_none
+exe "hi! hsImport" . s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! hsString" . s:fg_base00 .s:bg_none   .s:fmt_none
+
+exe "hi! hsStructure"        . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hs_hlFunctionName"  . s:fg_blue   .s:bg_none
+exe "hi! hsStatement"        . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hsImportLabel"      . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hs_OpFunctionName"  . s:fg_yellow .s:bg_none   .s:fmt_none
+exe "hi! hs_DeclareFunction" . s:fg_orange .s:bg_none   .s:fmt_none
+exe "hi! hsVarSym"           . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hsType"             . s:fg_yellow .s:bg_none   .s:fmt_none
+exe "hi! hsTypedef"          . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hsModuleName"       . s:fg_green  .s:bg_none   .s:fmt_undr
+exe "hi! hsModuleStartLabel" . s:fg_magenta.s:bg_none   .s:fmt_none
+hi! link hsImportParams      Delimiter
+hi! link hsDelimTypeExport   Delimiter
+hi! link hsModuleStartLabel  hsStructure
+hi! link hsModuleWhereLabel  hsModuleStartLabel
+
+" following is for the haskell-conceal plugin
+" the first two items don't have an impact, but better safe
+exe "hi! hsNiceOperator"     . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hsniceoperator"     . s:fg_cyan   .s:bg_none   .s:fmt_none
+
+"}}}
+" pandoc markdown syntax highlighting "{{{
+" ---------------------------------------------------------------------
+
+"PandocHiLink pandocNormalBlock
+exe "hi! pandocTitleBlock"               .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocTitleBlockTitle"          .s:fg_blue   .s:bg_none   .s:fmt_bold
+exe "hi! pandocTitleComment"             .s:fg_blue   .s:bg_none   .s:fmt_bold
+exe "hi! pandocComment"                  .s:fg_base01 .s:bg_none   .s:fmt_ital
+exe "hi! pandocVerbatimBlock"            .s:fg_yellow .s:bg_none   .s:fmt_none
+hi! link pandocVerbatimBlockDeep         pandocVerbatimBlock
+hi! link pandocCodeBlock                 pandocVerbatimBlock
+hi! link pandocCodeBlockDelim            pandocVerbatimBlock
+exe "hi! pandocBlockQuote"               .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader1"        .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader2"        .s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader3"        .s:fg_yellow .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader4"        .s:fg_red    .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader5"        .s:fg_base0  .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader6"        .s:fg_base01 .s:bg_none   .s:fmt_none
+exe "hi! pandocListMarker"               .s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! pandocListReference"            .s:fg_magenta.s:bg_none   .s:fmt_undr
+
+" Definitions
+" ---------------------------------------------------------------------
+let s:fg_pdef = s:fg_violet
+exe "hi! pandocDefinitionBlock"              .s:fg_pdef  .s:bg_none  .s:fmt_none
+exe "hi! pandocDefinitionTerm"               .s:fg_pdef  .s:bg_none  .s:fmt_stnd
+exe "hi! pandocDefinitionIndctr"             .s:fg_pdef  .s:bg_none  .s:fmt_bold
+exe "hi! pandocEmphasisDefinition"           .s:fg_pdef  .s:bg_none  .s:fmt_ital
+exe "hi! pandocEmphasisNestedDefinition"     .s:fg_pdef  .s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasisDefinition"     .s:fg_pdef  .s:bg_none  .s:fmt_bold
+exe "hi! pandocStrongEmphasisNestedDefinition"   .s:fg_pdef.s:bg_none.s:fmt_bldi
+exe "hi! pandocStrongEmphasisEmphasisDefinition" .s:fg_pdef.s:bg_none.s:fmt_bldi
+exe "hi! pandocStrikeoutDefinition"          .s:fg_pdef  .s:bg_none  .s:fmt_revr
+exe "hi! pandocVerbatimInlineDefinition"     .s:fg_pdef  .s:bg_none  .s:fmt_none
+exe "hi! pandocSuperscriptDefinition"        .s:fg_pdef  .s:bg_none  .s:fmt_none
+exe "hi! pandocSubscriptDefinition"          .s:fg_pdef  .s:bg_none  .s:fmt_none
+
+" Tables
+" ---------------------------------------------------------------------
+let s:fg_ptable = s:fg_blue
+exe "hi! pandocTable"                        .s:fg_ptable.s:bg_none  .s:fmt_none
+exe "hi! pandocTableStructure"               .s:fg_ptable.s:bg_none  .s:fmt_none
+hi! link pandocTableStructureTop             pandocTableStructre
+hi! link pandocTableStructureEnd             pandocTableStructre
+exe "hi! pandocTableZebraLight"              .s:fg_ptable.s:bg_base03.s:fmt_none
+exe "hi! pandocTableZebraDark"               .s:fg_ptable.s:bg_base02.s:fmt_none
+exe "hi! pandocEmphasisTable"                .s:fg_ptable.s:bg_none  .s:fmt_ital
+exe "hi! pandocEmphasisNestedTable"          .s:fg_ptable.s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasisTable"          .s:fg_ptable.s:bg_none  .s:fmt_bold
+exe "hi! pandocStrongEmphasisNestedTable"    .s:fg_ptable.s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasisEmphasisTable"  .s:fg_ptable.s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrikeoutTable"               .s:fg_ptable.s:bg_none  .s:fmt_revr
+exe "hi! pandocVerbatimInlineTable"          .s:fg_ptable.s:bg_none  .s:fmt_none
+exe "hi! pandocSuperscriptTable"             .s:fg_ptable.s:bg_none  .s:fmt_none
+exe "hi! pandocSubscriptTable"               .s:fg_ptable.s:bg_none  .s:fmt_none
+
+" Headings
+" ---------------------------------------------------------------------
+let s:fg_phead = s:fg_orange
+exe "hi! pandocHeading"                      .s:fg_phead .s:bg_none.s:fmt_bold
+exe "hi! pandocHeadingMarker"                .s:fg_yellow.s:bg_none.s:fmt_bold
+exe "hi! pandocEmphasisHeading"              .s:fg_phead .s:bg_none.s:fmt_bldi
+exe "hi! pandocEmphasisNestedHeading"        .s:fg_phead .s:bg_none.s:fmt_bldi
+exe "hi! pandocStrongEmphasisHeading"        .s:fg_phead .s:bg_none.s:fmt_bold
+exe "hi! pandocStrongEmphasisNestedHeading"  .s:fg_phead .s:bg_none.s:fmt_bldi
+exe "hi! pandocStrongEmphasisEmphasisHeading".s:fg_phead .s:bg_none.s:fmt_bldi
+exe "hi! pandocStrikeoutHeading"             .s:fg_phead .s:bg_none.s:fmt_revr
+exe "hi! pandocVerbatimInlineHeading"        .s:fg_phead .s:bg_none.s:fmt_bold
+exe "hi! pandocSuperscriptHeading"           .s:fg_phead .s:bg_none.s:fmt_bold
+exe "hi! pandocSubscriptHeading"             .s:fg_phead .s:bg_none.s:fmt_bold
+
+" Links
+" ---------------------------------------------------------------------
+exe "hi! pandocLinkDelim"                .s:fg_base01 .s:bg_none   .s:fmt_none
+exe "hi! pandocLinkLabel"                .s:fg_blue   .s:bg_none   .s:fmt_undr
+exe "hi! pandocLinkText"                 .s:fg_blue   .s:bg_none   .s:fmt_undb
+exe "hi! pandocLinkURL"                  .s:fg_base00 .s:bg_none   .s:fmt_undr
+exe "hi! pandocLinkTitle"                .s:fg_base00 .s:bg_none   .s:fmt_undi
+exe "hi! pandocLinkTitleDelim"           .s:fg_base01 .s:bg_none   .s:fmt_undi   .s:sp_base00
+exe "hi! pandocLinkDefinition"           .s:fg_cyan   .s:bg_none   .s:fmt_undr   .s:sp_base00
+exe "hi! pandocLinkDefinitionID"         .s:fg_blue   .s:bg_none   .s:fmt_bold
+exe "hi! pandocImageCaption"             .s:fg_violet .s:bg_none   .s:fmt_undb
+exe "hi! pandocFootnoteLink"             .s:fg_green  .s:bg_none   .s:fmt_undr
+exe "hi! pandocFootnoteDefLink"          .s:fg_green  .s:bg_none   .s:fmt_bold
+exe "hi! pandocFootnoteInline"           .s:fg_green  .s:bg_none   .s:fmt_undb
+exe "hi! pandocFootnote"                 .s:fg_green  .s:bg_none   .s:fmt_none
+exe "hi! pandocCitationDelim"            .s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! pandocCitation"                 .s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! pandocCitationID"               .s:fg_magenta.s:bg_none   .s:fmt_undr
+exe "hi! pandocCitationRef"              .s:fg_magenta.s:bg_none   .s:fmt_none
+
+" Main Styles
+" ---------------------------------------------------------------------
+exe "hi! pandocStyleDelim"               .s:fg_base01 .s:bg_none  .s:fmt_none
+exe "hi! pandocEmphasis"                 .s:fg_base0  .s:bg_none  .s:fmt_ital
+exe "hi! pandocEmphasisNested"           .s:fg_base0  .s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasis"           .s:fg_base0  .s:bg_none  .s:fmt_bold
+exe "hi! pandocStrongEmphasisNested"     .s:fg_base0  .s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasisEmphasis"   .s:fg_base0  .s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrikeout"                .s:fg_base01 .s:bg_none  .s:fmt_revr
+exe "hi! pandocVerbatimInline"           .s:fg_yellow .s:bg_none  .s:fmt_none
+exe "hi! pandocSuperscript"              .s:fg_violet .s:bg_none  .s:fmt_none
+exe "hi! pandocSubscript"                .s:fg_violet .s:bg_none  .s:fmt_none
+
+exe "hi! pandocRule"                     .s:fg_blue   .s:bg_none  .s:fmt_bold
+exe "hi! pandocRuleLine"                 .s:fg_blue   .s:bg_none  .s:fmt_bold
+exe "hi! pandocEscapePair"               .s:fg_red    .s:bg_none  .s:fmt_bold
+exe "hi! pandocCitationRef"              .s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! pandocNonBreakingSpace"         . s:fg_red   .s:bg_none  .s:fmt_revr
+hi! link pandocEscapedCharacter          pandocEscapePair
+hi! link pandocLineBreak                 pandocEscapePair
+
+" Embedded Code
+" ---------------------------------------------------------------------
+exe "hi! pandocMetadataDelim"            .s:fg_base01 .s:bg_none   .s:fmt_none
+exe "hi! pandocMetadata"                 .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocMetadataKey"              .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocMetadata"                 .s:fg_blue   .s:bg_none   .s:fmt_bold
+hi! link pandocMetadataTitle             pandocMetadata
+
+"}}}
+" Utility autocommand "{{{
+" ---------------------------------------------------------------------
+" In cases where Solarized is initialized inside a terminal vim session and 
+" then transferred to a gui session via the command `:gui`, the gui vim process 
+" does not re-read the colorscheme (or .vimrc for that matter) so any `has_gui` 
+" related code that sets gui specific values isn't executed.
+"
+" Currently, Solarized sets only the cterm or gui values for the colorscheme 
+" depending on gui or terminal mode. It's possible that, if the following 
+" autocommand method is deemed excessively poor form, that approach will be 
+" used again and the autocommand below will be dropped.
+"
+" However it seems relatively benign in this case to include the autocommand 
+" here. It fires only in cases where vim is transferring from terminal to gui 
+" mode (detected with the script scope s:vmode variable). It also allows for 
+" other potential terminal customizations that might make gui mode suboptimal.
+"
+autocmd GUIEnter * if (s:vmode != "gui") | exe "colorscheme " . g:colors_name | endif
+"}}}
+" Highlight Trailing Space {{{
+" Experimental: Different highlight when on cursorline
+function! s:SolarizedHiTrail()
+    if g:solarized_hitrail==0
+        hi! clear solarizedTrailingSpace
+    else
+        syn match solarizedTrailingSpace "\s*$"
+        exe "hi! solarizedTrailingSpace " .s:fmt_undr .s:fg_red .s:bg_none .s:sp_red
+    endif
+endfunction  
+augroup SolarizedHiTrail
+    autocmd!
+    if g:solarized_hitrail==1
+        autocmd! Syntax * call s:SolarizedHiTrail()
+        autocmd! ColorScheme * if g:colors_name == "solarized" | call s:SolarizedHiTrail() | else | augroup! s:SolarizedHiTrail | endif
+    endif
+augroup END
+" }}}
+" Menus "{{{
+" ---------------------------------------------------------------------
+" Turn off Solarized menu by including the following assignment in your .vimrc:
+"
+"    let g:solarized_menu=0
+
+function! s:SolarizedOptions()
+    new "new buffer
+    setf vim "vim filetype
+    let failed = append(0, s:defaults_list)
+    let failed = append(0, s:colorscheme_list)
+    let failed = append(0, s:options_list)
+    let failed = append(0, s:lazycat_list)
+    0 "jump back to the top
+endfunction
+if !exists(":SolarizedOptions")
+    command SolarizedOptions :call s:SolarizedOptions()
+endif
+
+function! SolarizedMenu()
+    if exists("g:loaded_solarized_menu")
+        try
+            silent! aunmenu Solarized
+        endtry
+    endif
+    let g:loaded_solarized_menu = 1
+
+    if g:colors_name == "solarized" && g:solarized_menu != 0
+
+        amenu &Solarized.&Contrast.&Low\ Contrast        :let g:solarized_contrast="low"       \| colorscheme solarized<CR>
+        amenu &Solarized.&Contrast.&Normal\ Contrast     :let g:solarized_contrast="normal"    \| colorscheme solarized<CR>
+        amenu &Solarized.&Contrast.&High\ Contrast       :let g:solarized_contrast="high"      \| colorscheme solarized<CR>
+        an    &Solarized.&Contrast.-sep-                 <Nop>
+        amenu &Solarized.&Contrast.&Help:\ Contrast      :help 'solarized_contrast'<CR>
+
+        amenu &Solarized.&Visibility.&Low\ Visibility    :let g:solarized_visibility="low"     \| colorscheme solarized<CR>
+        amenu &Solarized.&Visibility.&Normal\ Visibility :let g:solarized_visibility="normal"  \| colorscheme solarized<CR>
+        amenu &Solarized.&Visibility.&High\ Visibility   :let g:solarized_visibility="high"    \| colorscheme solarized<CR>
+        an    &Solarized.&Visibility.-sep-                 <Nop>
+        amenu &Solarized.&Visibility.&Help:\ Visibility    :help 'solarized_visibility'<CR>
+
+        amenu &Solarized.&Background.&Toggle\ Background :ToggleBG<CR>
+        amenu &Solarized.&Background.&Dark\ Background   :set background=dark  \| colorscheme solarized<CR>
+        amenu &Solarized.&Background.&Light\ Background  :set background=light \| colorscheme solarized<CR>
+        an    &Solarized.&Background.-sep-               <Nop>
+        amenu &Solarized.&Background.&Help:\ ToggleBG     :help togglebg<CR>
+
+        if g:solarized_bold==0 | let l:boldswitch="On" | else | let l:boldswitch="Off" | endif
+        exe "amenu &Solarized.&Styling.&Turn\\ Bold\\ ".l:boldswitch." :let g:solarized_bold=(abs(g:solarized_bold-1)) \\| colorscheme solarized<CR>"
+        if g:solarized_italic==0 | let l:italicswitch="On" | else | let l:italicswitch="Off" | endif
+        exe "amenu &Solarized.&Styling.&Turn\\ Italic\\ ".l:italicswitch." :let g:solarized_italic=(abs(g:solarized_italic-1)) \\| colorscheme solarized<CR>"
+        if g:solarized_underline==0 | let l:underlineswitch="On" | else | let l:underlineswitch="Off" | endif
+        exe "amenu &Solarized.&Styling.&Turn\\ Underline\\ ".l:underlineswitch." :let g:solarized_underline=(abs(g:solarized_underline-1)) \\| colorscheme solarized<CR>"
+
+        amenu &Solarized.&Diff\ Mode.&Low\ Diff\ Mode    :let g:solarized_diffmode="low"     \| colorscheme solarized<CR>
+        amenu &Solarized.&Diff\ Mode.&Normal\ Diff\ Mode :let g:solarized_diffmode="normal"  \| colorscheme solarized<CR>
+        amenu &Solarized.&Diff\ Mode.&High\ Diff\ Mode   :let g:solarized_diffmode="high"    \| colorscheme solarized<CR>
+
+        if g:solarized_hitrail==0 | let l:hitrailswitch="On" | else | let l:hitrailswitch="Off" | endif
+        exe "amenu &Solarized.&Experimental.&Turn\\ Highlight\\ Trailing\\ Spaces\\ ".l:hitrailswitch." :let g:solarized_hitrail=(abs(g:solarized_hitrail-1)) \\| colorscheme solarized<CR>"
+        an    &Solarized.&Experimental.-sep-               <Nop>
+        amenu &Solarized.&Experimental.&Help:\ HiTrail    :help 'solarized_hitrail'<CR>
+
+        an    &Solarized.-sep1-                          <Nop>
+
+        amenu &Solarized.&Autogenerate\ options          :SolarizedOptions<CR>
+
+        an    &Solarized.-sep2-                          <Nop>
+
+        amenu &Solarized.&Help.&Solarized\ Help          :help solarized<CR>
+        amenu &Solarized.&Help.&Toggle\ Background\ Help :help togglebg<CR>
+        amenu &Solarized.&Help.&Removing\ This\ Menu     :help solarized-menu<CR>
+
+        an 9999.77 &Help.&Solarized\ Colorscheme         :help solarized<CR>
+        an 9999.78 &Help.&Toggle\ Background             :help togglebg<CR>
+        an 9999.79 &Help.-sep3-                          <Nop>
+
+    endif
+endfunction
+
+autocmd ColorScheme * if g:colors_name != "solarized" | silent! aunmenu Solarized | else | call SolarizedMenu() | endif
+
+"}}}
+" License "{{{
+" ---------------------------------------------------------------------
+"
+" Copyright (c) 2011 Ethan Schoonover
+"
+" Permission is hereby granted, free of charge, to any person obtaining a copy
+" of this software and associated documentation files (the "Software"), to deal
+" in the Software without restriction, including without limitation the rights
+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+" copies of the Software, and to permit persons to whom the Software is
+" furnished to do so, subject to the following conditions:
+"
+" The above copyright notice and this permission notice shall be included in
+" all copies or substantial portions of the Software.
+"
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+" THE SOFTWARE.
+"
+" vim:foldmethod=marker:foldlevel=0
+"}}}
diff --git a/vim/colors/soso.vim b/vim/colors/soso.vim
new file mode 100644 (file)
index 0000000..c1e1a02
--- /dev/null
@@ -0,0 +1,67 @@
+"---------------------------------------------------------------------
+" $Id: soso.vim,v 1.3 2007/10/31 06:24:34 soso Exp $
+"
+" Maintainer:  Soeren Sonntag <soeren DOT sonntag AT web DOT de>
+" Last Change: $Date: 2007/10/31 06:24:34 $
+"
+" Description: Vim color file
+"---------------------------------------------------------------------
+
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name="soso"
+
+hi Normal       guifg=black   guibg=#e4e4e4          ctermfg=black    ctermbg=white
+hi DiffAdd                    guibg=#c0ffe0                           ctermbg=3
+hi DiffDelete   guifg=#ff8097 guibg=#ffe0f7          ctermfg=4        ctermbg=5
+hi DiffChange                 guibg=#cfefff                           ctermbg=9
+hi DiffText                   guibg=#bfdfff gui=bold                  ctermbg=6     cterm=bold
+hi NonText      guifg=grey50  guibg=grey86  gui=bold ctermfg=darkblue
+hi SpecialKey   guifg=grey50  guibg=grey86  gui=bold ctermfg=darkblue
+hi NonText      guifg=grey50  guibg=grey86           ctermfg=blue
+hi LineNr       guifg=grey50  guibg=grey86           ctermfg=darkblue
+hi Search                     guibg=#fff999
+hi StatusLine   guifg=bg      guibg=black   gui=bold ctermfg=bg       ctermbg=black cterm=bold
+hi StatusLineNC guifg=bg      guibg=grey40  gui=NONE ctermfg=bg       ctermbg=black cterm=NONE
+hi Visual       guifg=fg      guibg=#ccccdd gui=NONE
+hi VisualNOS    guifg=bg      guibg=#ccccdd gui=NONE
+
+" syntax highlighting groups
+hi Comment      guifg=#000099 guibg=bg               ctermfg=darkblue
+hi String       guifg=#b30000 guibg=bg               ctermfg=darkred
+hi Constant     guifg=#c033ff guibg=bg               ctermfg=darkmagenta
+hi Statement    guifg=black   guibg=bg               ctermfg=black                  cterm=bold
+hi PreProc      guifg=#335588 guibg=bg      gui=bold ctermfg=blue
+hi Type         guifg=#338855 guibg=bg      gui=bold ctermfg=darkgreen
+hi StorageClass guifg=#990000 guibg=bg               ctermfg=red
+hi Special      guifg=#6688ff guibg=bg               ctermfg=darkcyan
+hi Function     guifg=#117777 guibg=bg               ctermfg=red
+
+" showpairs plugin
+"   for cursor on paren
+hi ShowPairsHL                guibg=#c4ffc4                           ctermbg=lightgreen
+"   for cursor between parens
+hi ShowPairsHLp               guibg=#c4f0c4                           ctermbg=lightgreen
+"   unmatched paren
+hi ShowPairsHLe               guibg=#ff5555                           ctermbg=red
+
+" settings for Vim7
+if version >= 700
+  hi MatchParen               guibg=#c4ffc4                                             ctermbg=lightgreen
+  " Spell
+  hi SpellBad   guifg=#cc0000               gui=undercurl guisp=#cc0000 ctermfg=red                        cterm=underline
+  hi SpellRare  guifg=magenta               gui=undercurl               ctermfg=magenta                    cterm=underline
+  hi SpellCap                               gui=undercurl guisp=#22cc22                                    cterm=underline
+  " Completion menu
+  hi Pmenu                    guibg=#ffffcc                                             ctermbg=yellow
+  hi PmenuSel                 guibg=#ddddaa                                             ctermbg=lightcyan  cterm=bold
+  hi PmenuSbar                guibg=#999966                                             ctermbg=lightcyan
+  " Tab line
+  hi TabLine                  guibg=grey70                                                                 cterm=underline
+  hi TabLineSel                             gui=bold                                                       cterm=bold
+  hi TabLineFill guifg=black  guibg=grey80                                                                 cterm=underline
+endif
diff --git a/vim/colors/spring.vim b/vim/colors/spring.vim
new file mode 100644 (file)
index 0000000..06d79d0
--- /dev/null
@@ -0,0 +1,71 @@
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" File Name:      spring.vim
+" Abstract:       A color sheme file (only for GVIM), which make the VIM 
+"                 bright with colors. It looks like the flowers are in 
+"                 blossom in Spring.
+" Author:         CHE Wenlong <chewenlong AT buaa.edu.cn>
+" Version:        1.0
+" Last Change:    September 16, 2008
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+if !has("gui_running")
+    runtime! colors/default.vim
+    finish
+endif
+
+set background=light
+
+hi clear
+
+" Version control
+if version > 580
+    hi clear
+    if exists("syntax_on")
+        syntax reset
+    endif
+endif
+
+let colors_name = "spring"
+
+" Common
+hi Normal           guifg=#000000   guibg=#cce8cf   gui=NONE
+hi Visual           guibg=#ccffff                   gui=NONE
+hi Cursor           guifg=#f5deb3   guibg=#2f4f4f   gui=NONE
+hi Cursorline       guibg=#ccffff
+hi lCursor          guifg=#000000   guibg=#ffffff   gui=NONE
+hi LineNr           guifg=#1060a0   guibg=#e0e0e0   gui=NONE
+hi Title            guifg=#202020   guibg=NONE      gui=bold
+hi Underlined       guifg=#202020   guibg=NONE      gui=underline
+
+" Split
+hi StatusLine       guifg=#f5deb3   guibg=#2f4f4f   gui=bold
+hi StatusLineNC     guifg=#f5deb3   guibg=#2f4f4f   gui=NONE
+hi VertSplit        guifg=#2f4f4f   guibg=#2f4f4f   gui=NONE
+
+" Folder
+hi Folded           guifg=#006699   guibg=#e0e0e0   gui=NONE
+
+" Syntax
+hi Type             guifg=#009933   guibg=NONE      gui=bold
+hi Define           guifg=#1060a0   guibg=NONE      gui=bold
+hi Comment          guifg=#1e90ff   guibg=NONE      gui=NONE
+hi Constant         guifg=#a07040   guibg=NONE      gui=NONE
+hi String           guifg=#a07040   guibg=NONE      gui=NONE
+hi Number           guifg=#cd0000   guibg=NONE      gui=NONE
+hi Statement        guifg=#fc548f   guibg=NONE      gui=bold
+
+" Others
+hi PreProc          guifg=#1060a0    guibg=NONE     gui=NONE
+hi Error            guifg=#ff0000    guibg=#ffffff  gui=bold,underline
+hi Todo             guifg=#a0b0c0    guibg=NONE     gui=bold,underline
+hi Special          guifg=#8B038D    guibg=NONE     gui=NONE
+hi SpecialKey       guifg=#d8a080    guibg=#e8e8e8  gui=NONE
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" vim:tabstop=4
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
diff --git a/vim/colors/summerfruit256.vim b/vim/colors/summerfruit256.vim
new file mode 100644 (file)
index 0000000..d62cbf8
--- /dev/null
@@ -0,0 +1,322 @@
+" Vim color file
+" Maintainer: Martin Baeuml <baeuml@gmail.com>
+" Last Change: 2008-02-09
+"
+" This color file is a modification of the "summerfruit" color scheme by Armin Ronacher
+" so that it can be used on 88- and 256-color xterms. The colors are translated
+" using Henry So's programmatic approximation of gui colors from his "desert256"
+" color scheme.
+"
+" I removed the "italic" option and the background color from
+" comment-coloring because that looks odd on my console.
+"
+" The original "summerfruit" color scheme and "desert256" are available from vim.org.
+
+set background=light
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+        syntax reset
+    endif
+endif
+let g:colors_name="summerfruit256"
+
+if has("gui_running") || &t_Co == 88 || &t_Co == 256
+    " functions {{{
+    " returns an approximate grey index for the given grey level
+    fun <SID>grey_number(x)
+        if &t_Co == 88
+            if a:x < 23
+                return 0
+            elseif a:x < 69
+                return 1
+            elseif a:x < 103
+                return 2
+            elseif a:x < 127
+                return 3
+            elseif a:x < 150
+                return 4
+            elseif a:x < 173
+                return 5
+            elseif a:x < 196
+                return 6
+            elseif a:x < 219
+                return 7
+            elseif a:x < 243
+                return 8
+            else
+                return 9
+            endif
+        else
+            if a:x < 14
+                return 0
+            else
+                let l:n = (a:x - 8) / 10
+                let l:m = (a:x - 8) % 10
+                if l:m < 5
+                    return l:n
+                else
+                    return l:n + 1
+                endif
+            endif
+        endif
+    endfun
+
+    " returns the actual grey level represented by the grey index
+    fun <SID>grey_level(n)
+        if &t_Co == 88
+            if a:n == 0
+                return 0
+            elseif a:n == 1
+                return 46
+            elseif a:n == 2
+                return 92
+            elseif a:n == 3
+                return 115
+            elseif a:n == 4
+                return 139
+            elseif a:n == 5
+                return 162
+            elseif a:n == 6
+                return 185
+            elseif a:n == 7
+                return 208
+            elseif a:n == 8
+                return 231
+            else
+                return 255
+            endif
+        else
+            if a:n == 0
+                return 0
+            else
+                return 8 + (a:n * 10)
+            endif
+        endif
+    endfun
+
+    " returns the palette index for the given grey index
+    fun <SID>grey_color(n)
+        if &t_Co == 88
+            if a:n == 0
+                return 16
+            elseif a:n == 9
+                return 79
+            else
+                return 79 + a:n
+            endif
+        else
+            if a:n == 0
+                return 16
+            elseif a:n == 25
+                return 231
+            else
+                return 231 + a:n
+            endif
+        endif
+    endfun
+
+    " returns an approximate color index for the given color level
+    fun <SID>rgb_number(x)
+        if &t_Co == 88
+            if a:x < 69
+                return 0
+            elseif a:x < 172
+                return 1
+            elseif a:x < 230
+                return 2
+            else
+                return 3
+            endif
+        else
+            if a:x < 75
+                return 0
+            else
+                let l:n = (a:x - 55) / 40
+                let l:m = (a:x - 55) % 40
+                if l:m < 20
+                    return l:n
+                else
+                    return l:n + 1
+                endif
+            endif
+        endif
+    endfun
+
+    " returns the actual color level for the given color index
+    fun <SID>rgb_level(n)
+        if &t_Co == 88
+            if a:n == 0
+                return 0
+            elseif a:n == 1
+                return 139
+            elseif a:n == 2
+                return 205
+            else
+                return 255
+            endif
+        else
+            if a:n == 0
+                return 0
+            else
+                return 55 + (a:n * 40)
+            endif
+        endif
+    endfun
+
+    " returns the palette index for the given R/G/B color indices
+    fun <SID>rgb_color(x, y, z)
+        if &t_Co == 88
+            return 16 + (a:x * 16) + (a:y * 4) + a:z
+        else
+            return 16 + (a:x * 36) + (a:y * 6) + a:z
+        endif
+    endfun
+
+    " returns the palette index to approximate the given R/G/B color levels
+    fun <SID>color(r, g, b)
+        " get the closest grey
+        let l:gx = <SID>grey_number(a:r)
+        let l:gy = <SID>grey_number(a:g)
+        let l:gz = <SID>grey_number(a:b)
+
+        " get the closest color
+        let l:x = <SID>rgb_number(a:r)
+        let l:y = <SID>rgb_number(a:g)
+        let l:z = <SID>rgb_number(a:b)
+
+        if l:gx == l:gy && l:gy == l:gz
+            " there are two possibilities
+            let l:dgr = <SID>grey_level(l:gx) - a:r
+            let l:dgg = <SID>grey_level(l:gy) - a:g
+            let l:dgb = <SID>grey_level(l:gz) - a:b
+            let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
+            let l:dr = <SID>rgb_level(l:gx) - a:r
+            let l:dg = <SID>rgb_level(l:gy) - a:g
+            let l:db = <SID>rgb_level(l:gz) - a:b
+            let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
+            if l:dgrey < l:drgb
+                " use the grey
+                return <SID>grey_color(l:gx)
+            else
+                " use the color
+                return <SID>rgb_color(l:x, l:y, l:z)
+            endif
+        else
+            " only one possibility
+            return <SID>rgb_color(l:x, l:y, l:z)
+        endif
+    endfun
+
+    " returns the palette index to approximate the 'rrggbb' hex string
+    fun <SID>rgb(rgb)
+        let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
+        let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
+        let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
+
+        return <SID>color(l:r, l:g, l:b)
+    endfun
+
+    " sets the highlighting for the given group
+    fun <SID>X(group, fg, bg, attr)
+        if a:fg != ""
+            exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . <SID>rgb(a:fg)
+        endif
+        if a:bg != ""
+            exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . <SID>rgb(a:bg)
+        endif
+        if a:attr != ""
+            exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
+        endif
+    endfun
+    " }}}
+
+    " Global
+    call <SID>X("Normal", "000000", "ffffff", "")
+    call <SID>X("NonText", "438ec3", "b7dce8", "")
+
+    " Search
+    call <SID>X("Search", "800000", "ffae00", "")
+    call <SID>X("IncSearch", "800000", "ffae00", "")
+
+    " Interface Elements
+    call <SID>X("StatusLine", "ffffff", "43c464", "bold")
+    call <SID>X("StatusLineNC", "9bd4a9", "51b069", "")
+    call <SID>X("VertSplit", "3687a2", "3687a2", "")
+    call <SID>X("Folded", "3c78a2", "c3daea", "")
+    call <SID>X("IncSearch", "708090", "f0e68c", "")
+    call <SID>X("Pmenu", "ffffff", "cb2f27", "")
+    call <SID>X("SignColumn", "", "", "")
+    call <SID>X("CursorLine", "", "c0d9eb", "")
+    call <SID>X("LineNr", "eeeeee", "438ec3", "bold")
+    call <SID>X("MatchParen", "", "", "")
+
+    " Specials
+    call <SID>X("Todo", "e50808", "dbf3cd", "bold")
+    call <SID>X("Title", "000000", "", "")
+    call <SID>X("Special", "fd8900", "", "")
+
+    " Syntax Elements
+    call <SID>X("String", "0086d2", "", "")
+    call <SID>X("Constant", "0086d2", "", "")
+    call <SID>X("Number", "0086f7", "", "")
+    call <SID>X("Statement", "fb660a", "", "")
+    call <SID>X("Function", "ff0086", "", "")
+    call <SID>X("PreProc", "ff0007", "", "")
+    call <SID>X("Comment", "22a21f", "", "bold")
+    call <SID>X("Type", "70796b", "", "")
+    call <SID>X("Error", "ffffff", "d40000", "")
+    call <SID>X("Identifier", "ff0086", "", "")
+    call <SID>X("Label", "ff0086", "", "")
+
+    " Python Highlighting
+    call <SID>X("pythonCoding", "ff0086", "", "")
+    call <SID>X("pythonRun", "ff0086", "", "")
+    call <SID>X("pythonBuiltinObj", "2b6ba2", "", "")
+    call <SID>X("pythonBuiltinFunc", "2b6ba2", "", "")
+    call <SID>X("pythonException", "ee0000", "", "")
+    call <SID>X("pythonExClass", "66cd66", "", "")
+    call <SID>X("pythonSpaceError", "", "", "")
+    call <SID>X("pythonDocTest", "2f5f49", "", "")
+    call <SID>X("pythonDocTest2", "3b916a", "", "")
+    call <SID>X("pythonFunction", "ee0000", "", "")
+    call <SID>X("pythonClass", "ff0086", "", "")
+
+    " HTML Highlighting
+    call <SID>X("htmlTag", "00bdec", "", "")
+    call <SID>X("htmlEndTag", "00bdec", "", "")
+    call <SID>X("htmlSpecialTagName", "4aa04a", "", "")
+    call <SID>X("htmlTagName", "4aa04a", "", "")
+    call <SID>X("htmlTagN", "4aa04a", "", "")
+
+    " Jinja Highlighting
+    call <SID>X("jinjaTagBlock", "ff0007", "fbf4c7", "bold")
+    call <SID>X("jinjaVarBlock", "ff0007", "fbf4c7", "")
+    call <SID>X("jinjaString", "0086d2", "fbf4c7", "")
+    call <SID>X("jinjaNumber", "bf0945", "fbf4c7", "bold")
+    call <SID>X("jinjaStatement", "fb660a", "fbf4c7", "bold")
+    call <SID>X("jinjaComment", "008800", "002300", "italic")
+    call <SID>X("jinjaFilter", "ff0086", "fbf4c7", "")
+    call <SID>X("jinjaRaw", "aaaaaa", "fbf4c7", "")
+    call <SID>X("jinjaOperator", "ffffff", "fbf4c7", "")
+    call <SID>X("jinjaVariable", "92cd35", "fbf4c7", "")
+    call <SID>X("jinjaAttribute", "dd7700", "fbf4c7", "")
+    call <SID>X("jinjaSpecial", "008ffd", "fbf4c7", "")
+
+    " delete functions {{{
+    delf <SID>X
+    delf <SID>rgb
+    delf <SID>color
+    delf <SID>rgb_color
+    delf <SID>rgb_level
+    delf <SID>rgb_number
+    delf <SID>grey_color
+    delf <SID>grey_level
+    delf <SID>grey_number
+    " }}}
+endif
+
+" vim: set fdl=0 fdm=marker:
+
diff --git a/vim/colors/synic.vim b/vim/colors/synic.vim
new file mode 100644 (file)
index 0000000..1f47a5c
--- /dev/null
@@ -0,0 +1,81 @@
+" ------------------------------------------------------------------
+" Filename:      synic.vim
+" Last Modified: May, 14 2007 (10:47)
+" Maintainer:    Adam Olsen (arolsen@gmail.com)
+" Copyright:     2007 Adam Olsen
+"                This script is free software; you can redistribute it and/or 
+"                modify it under the terms of the GNU General Public License as 
+"                published by the Free Software Foundation; either version 2 of 
+"                the License, or (at your option) any later version. 
+" Description:   Vim colorscheme file.
+" Install:       Put this file in the users colors directory (~/.vim/colors)
+"                then load it with :colorscheme synic
+" ------------------------------------------------------------------
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+""
+""                        SPECIAL NOTE:
+"" I believe this colorscheme is based off of Hans 
+"" Fugal's colorscheme "desert".  
+"" http://hans.fugal.net/vim/colors/desert.html
+"" I might be wrong on this... if it looks like it was based off 
+"" of your colorscheme, let me know so I can give you credits.
+""
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "synic"
+
+hi Normal       guifg=ivory guibg=Black
+
+hi TabLineFill  guifg=#272d2f guibg=#272d2f gui=None
+hi TabLine  guifg=MistyRose3 guibg=#272d2f gui=None
+hi TabLineSel   guifg=LightBlue3 guibg=#272d2f gui=None
+hi ErrorMsg     gui=NONE guifg=Red guibg=Linen
+hi IncSearch    gui=NONE guibg=LightGreen guifg=Black
+hi ModeMsg      gui=NONE guifg=fg guibg=bg
+hi StatusLine   gui=NONE guifg=LightBlue3 guibg=#272d2f
+hi StatusLineNC gui=NONE guifg=MistyRose3 guibg=#272d2f
+hi VertSplit    gui=NONE guifg=LightBlue4 guibg=Black
+hi Visual       gui=reverse guifg=LightBlue4 guibg=Black
+hi VisualNOS    gui=underline guifg=fg guibg=bg
+hi DiffText     gui=NONE guifg=Yellow guibg=LightSkyBlue4
+hi Cursor       guibg=Lavender guifg=Black
+hi lCursor      guibg=Lavender guifg=Black
+hi Directory    guifg=LightGreen guibg=bg
+hi LineNr       guifg=LightBlue3 guibg=bg
+hi MoreMsg      gui=NONE guifg=SeaGreen guibg=bg
+hi NonText      gui=NONE guifg=Cyan4 guibg=Black
+hi Question     gui=NONE guifg=LimeGreen guibg=bg
+hi Search       gui=NONE guifg=SkyBlue4 guibg=Bisque
+hi SpecialKey   guifg=Cyan guibg=bg
+hi Title        gui=NONE guifg=Yellow2 guibg=bg
+hi WarningMsg   guifg=Tomato3 guibg=Black
+hi WildMenu     gui=NONE guifg=Black guibg=SkyBlue4
+hi Folded       guifg=#f4aba2 guibg=bg
+hi FoldColumn   guifg=DarkBlue guibg=Grey
+hi DiffAdd      gui=NONE guifg=Blue guibg=LightCyan
+hi DiffChange   gui=NONE guifg=white guibg=LightCyan4
+hi DiffDelete   gui=None guifg=LightBlue guibg=LightCyan
+
+hi Constant     gui=NONE guifg=MistyRose3 guibg=bg
+hi String       gui=NONE guifg=LightBlue3 guibg=bg
+hi Special      gui=NONE guifg=GoldenRod guibg=bg
+hi Statement    gui=NONE guifg=khaki guibg=bg
+hi Operator     gui=NONE guifg=#8673e8 guibg=bg
+hi Ignore       gui=NONE guifg=bg guibg=bg
+hi ToDo         gui=NONE guifg=DodgerBlue guibg=bg
+hi Error        gui=NONE guifg=Red guibg=Linen
+hi Comment      gui=NONE guifg=SlateGrey guibg=bg
+hi Comment      gui=NONE guifg=#62c600 guibg=bg
+hi Identifier   gui=bold guifg=LightBlue4 guibg=bg
+hi PreProc      gui=NONE guifg=#ffa0a0 guibg=bg
+hi Type         gui=NONE guifg=NavajoWhite guibg=bg
+hi Underlined   gui=underline guifg=fg guibg=bg
+
+" vim: sw=2
diff --git a/vim/colors/tabula.vim b/vim/colors/tabula.vim
new file mode 100644 (file)
index 0000000..61cd0ee
--- /dev/null
@@ -0,0 +1,698 @@
+" ============================================================================
+" Filename:      tabula.vim
+" Last Modified: 2007-02-08
+" Version:       1.3.2
+" Maintainer:    Bernd Pol (bernd.pol AT online DOT de)
+" Copyright:     2006 Bernd Pol
+"                This script is free software; you can redistribute it and/or 
+"                modify it under the terms of the GNU General Public License as 
+"                published by the Free Software Foundation; either version 2 of 
+"                the License, or (at your option) any later version. 
+" Description:   Vim colorscheme based on marklar.vim by SM Smithfield,
+"                slightly modified for harmonic, yet easily distinguishable
+"                display on GUI and a 256 color xterm as well.
+" Install:       Put this file in the users colors directory (~/.vim/colors)
+"                then load it with :colorscheme tabula
+" =============================================================================
+" Latest Changes:
+" =============================================================================
+" TODO
+" - automize options setting
+" - keep options in some setup file, e.g.:
+"   tabula.rc, sub e.g. "<OPTIONS> ... </OPTIONS>" marks
+" - options set up per directory (autoload option)
+"   such that text files be displayed other than e.g. c sources
+" =============================================================================
+
+hi clear
+set background=dark
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name = "tabula"
+"let g:Tabula_setOptions = 0
+
+"==============================================================================
+"                              Option Settings                             {{{1
+"==============================================================================
+"
+" Use these in your .vimrc file before the ':colorscheme tabula' line
+"
+" Alternatively set the options variable from the command line, e.g.
+"       :let Tabula_LNumUnderline=1
+" and then call
+"       :colorscheme tabula
+" again.
+
+"------------------------------------------------------------------------------
+" Display Statements In Bold:                                              {{{2
+"       Tabula_BoldStatement = 0        statements display not bold
+"       Tabula_BoldStatement = 1        statements display bold
+" Defaults to non-bold display.
+"------------------------------------------------------------------------------
+"
+let s:BoldStatement = 0
+if exists("g:Tabula_BoldStatement")
+  let s:BoldStatement = g:Tabula_BoldStatement
+endif
+
+"------------------------------------------------------------------------------
+" Set GUI Cursor Color:                                                    {{{2
+"       Tabula_CurColor = 'blue'
+"       Tabula_CurColor = 'red'
+"       Tabula_CurColor = 'yellow'
+"       Tabula_CurColor = 'white'
+" Defaults to 'blue'.
+"------------------------------------------------------------------------------
+"
+let s:CurColor = "blue"
+if exists("g:Tabula_CurColor")
+  let s:CurColor = g:Tabula_CurColor
+endif
+
+"------------------------------------------------------------------------------
+" Set Color For Preprocessor Statements:                                   {{{2
+"       Tabula_ColorPre = 'blue'        purple-blue
+"       Tabula_ColorPre = 'red'         orange-red
+"       Tabula_ColorPre = 'yellow'      lightgreen-yellow
+" Defaults to 'blue'.
+"------------------------------------------------------------------------------
+"
+let s:ColorPre = "blue"
+if exists("g:Tabula_ColorPre")
+  if g:Tabula_ColorPre == "red" || g:Tabula_ColorPre == "yellow"
+    let s:ColorPre = g:Tabula_ColorPre
+  endif
+endif
+
+"------------------------------------------------------------------------------
+" Use Dark Error Background:                                               {{{2
+" Sometimes desirable for less distracting error highlighting.
+"       Tabula_DarkError = 0            light red error background
+"       Tabula_DarkError = 1            dark red error background
+" Defaults to light error background.
+"------------------------------------------------------------------------------
+"
+let s:DarkError = 0
+if exists("g:Tabula_DarkError")
+  let s:DarkError = g:Tabula_DarkError
+endif
+
+"------------------------------------------------------------------------------
+" Use Multiple Colors For Constant Values:                                 {{{2
+"       Tabula_FlatConstants = 0        use different color for each type
+"       Tabula_FlatConstants = 1        use common color for all
+" Defaults to using common colors.
+"------------------------------------------------------------------------------
+"
+let s:FlatConstants = 1
+if exists("g:Tabula_FlatConstants")
+  let s:FlatConstants = g:Tabula_FlatConstants
+endif
+
+"------------------------------------------------------------------------------
+" How To Display Ignore And NonText Characters:                            {{{2
+"       Tabula_InvisibleIgnore = 0      slightly visible
+"                                       (good for Vim documentation editing)
+"       Tabula_InvisibleIgnore = 1      invisible on standard background
+" Defaults to invisible display.
+"------------------------------------------------------------------------------
+"
+let s:InvisibleIgnore = 1
+if exists("g:Tabula_InvisibleIgnore")
+  let s:InvisibleIgnore = g:Tabula_InvisibleIgnore
+endif
+
+"------------------------------------------------------------------------------
+" Show Line Numbers Underlined:                                            {{{2
+" Sometimes useful to spot a line more easily.
+"       Tabula_LNumUnderline = 0        not underlined
+"       Tabula_LNumUnderline = 1        line numbers are underlined
+" Defaults to not underlined.
+"------------------------------------------------------------------------------
+"
+let s:LNumUnderline = 0
+if exists("g:Tabula_LNumUnderline")
+  let s:LNumUnderline = g:Tabula_LNumUnderline
+endif
+
+"------------------------------------------------------------------------------
+" Let Search Occurrences Stand Out More Prominently:                       {{{2
+"       Tabula_SearchStandOut = 0       normal dark background display
+"       Tabula_SearchStandOut = 1       prominent underlined display
+"       Tabula_SearchStandOut = 2       even more prominent display
+" Defaults to normal display.
+"------------------------------------------------------------------------------
+"
+let s:SearchStandOut=0
+if exists("g:Tabula_SearchStandOut")
+  let s:SearchStandOut = g:Tabula_SearchStandOut
+endif
+
+"------------------------------------------------------------------------------
+" How To Display TODOs And Similar:                                        {{{2
+"       Tabula_TodoUnderline = 0        display on a blue background
+"       Tabula_TodoUnderline = 1        display them underlined white
+" Defaults to underlined display.
+"------------------------------------------------------------------------------
+"
+let s:TodoUnderline=1
+if exists("g:Tabula_TodoUnderline")
+  let s:TodoUnderline = g:Tabula_TodoUnderline
+endif
+
+"==============================================================================
+"                             Color Definitions                            {{{1
+"==============================================================================
+
+if version >= 700
+    hi SpellBad         guisp=#FF0000
+    hi SpellCap         guisp=#afaf00
+    hi SpellRare        guisp=#bf4040
+    hi SpellLocal       guisp=#00afaf                                                   ctermbg=0
+    hi Pmenu            guifg=#00ffff   guibg=#000000                   ctermfg=51      ctermbg=0
+    hi PmenuSel         guifg=#ffff00   guibg=#000000   gui=bold        ctermfg=226                     cterm=bold
+    hi PmenuSbar                        guibg=#204d40                                   ctermbg=6
+    hi PmenuThumb       guifg=#38ff56                                   ctermfg=3
+    hi CursorColumn                     guibg=#096354                                   ctermbg=29
+    hi CursorLine                       guibg=#096354                                   ctermbg=29
+    hi Tabline          guifg=bg        guibg=fg        gui=NONE        ctermfg=NONE    ctermbg=NONE    cterm=reverse,bold
+    hi TablineSel       guifg=#20012e   guibg=#00a675   gui=bold
+    hi TablineFill      guifg=#689C7C
+    hi MatchParen       guifg=#38ff56   guibg=#0000ff   gui=bold        ctermfg=14      ctermbg=21      cterm=bold
+endif
+"------------------------------------------------------------------------------
+
+"hi Comment             guifg=#00C5E7                                   ctermfg=39      
+hi Comment              guifg=#00C5E7                                   ctermfg=51
+
+"------------------------------------------------------------------------------
+" Constant Colors:
+"------------------------------------------------------------------------------
+"
+if s:FlatConstants
+  hi Constant           guifg=#7DDCDB                                   ctermfg=123
+else
+  hi Boolean            guifg=#7EDBD8                                   ctermfg=123
+  hi Character          guifg=#AFD000                                   ctermfg=148
+  hi Float              guifg=#AF87DF                                   ctermfg=141
+  hi Number             guifg=#00A7F7                                   ctermfg=39
+  hi String             guifg=#00DF00                                   ctermfg=46
+endif
+
+"------------------------------------------------------------------------------
+" Cursor Colors:
+"------------------------------------------------------------------------------
+"
+if s:CurColor == "yellow"
+  hi Cursor             guifg=#000000   guibg=#EFEF00
+elseif s:CurColor == "red"
+  " Note: Input cursor will be invisible on Error Group
+  hi Cursor             guifg=#00007F   guibg=#F70000
+elseif s:CurColor == "blue"
+  hi Cursor             guifg=#00007F   guibg=#00EFEF
+elseif s:CurColor == "white"
+  hi Cursor             guifg=#000000   guibg=#FFFFFF
+endif
+"------------------------------------------------------------------------------
+
+hi DiffAdd              guifg=NONE      guibg=#136769                   ctermfg=4       ctermbg=7       cterm=NONE
+hi DiffDelete           guifg=NONE      guibg=#50694A                   ctermfg=1       ctermbg=7       cterm=NONE
+hi DiffChange           guifg=fg        guibg=#00463c   gui=None        ctermfg=4       ctermbg=2       cterm=NONE
+hi DiffText             guifg=#7CFC94   guibg=#00463c   gui=bold        ctermfg=4       ctermbg=3       cterm=NONE
+hi Directory            guifg=#25B9F8   guibg=NONE                                                      ctermfg=2
+
+"------------------------------------------------------------------------------
+" Error Colors:
+"------------------------------------------------------------------------------
+"
+if s:DarkError
+"  hi Error             guifg=#FF0000   guibg=#303800   gui=NONE        ctermfg=9       ctermbg=236     cterm=NONE
+  hi Error              guifg=NONE      guibg=#303800   gui=NONE        ctermfg=NONE    ctermbg=236     cterm=NONE
+else
+  if s:CurColor == "red"
+    " Note: We need another background in this case to keep the cursor visible.
+    hi Error            guifg=#FF0000   guibg=#FFFF00   gui=bold        ctermfg=11      ctermbg=9       cterm=NONE
+  else
+    hi Error            guifg=#FFFF00   guibg=#FF0000   gui=NONE        ctermfg=11      ctermbg=9       cterm=NONE
+  endif
+endif
+"------------------------------------------------------------------------------
+
+hi ErrorMsg             guifg=#FFFFFF   guibg=#FF0000                   ctermfg=7       ctermbg=1
+hi FoldColumn           guifg=#00BBBB   guibg=#4E4E4E                   ctermfg=14      ctermbg=240
+hi Folded               guifg=#44DDDD   guibg=#4E4E4E                   ctermfg=14      ctermbg=240
+hi Identifier           guifg=#FDAE5A                                   ctermfg=215                     cterm=NONE
+
+"------------------------------------------------------------------------------
+" Ignore Variants:
+"------------------------------------------------------------------------------
+"
+if s:InvisibleIgnore
+  " completely invisible
+  hi Ignore             guifg=bg        guibg=NONE                      ctermfg=23
+  hi NonText            guifg=bg        guibg=NONE                      ctermfg=23
+else
+  " nearly invisible
+  hi Ignore             guifg=#005FAF   guibg=NONE                      ctermfg=26
+  hi NonText            guifg=#005FAF   guibg=NONE                      ctermfg=26
+endif
+"------------------------------------------------------------------------------
+
+"------------------------------------------------------------------------------
+" Line Number Variants:
+" Lines can sometimes be more precisely identified if the line numbers are
+" underlined.
+"------------------------------------------------------------------------------
+"
+if s:LNumUnderline
+  hi LineNr             guifg=#00FF00   guibg=#005080   gui=underline   ctermfg=84      ctermbg=24      cterm=underline
+else
+  hi LineNr             guifg=#00FF00   guibg=#005080                   ctermfg=84      ctermbg=24
+endif
+"------------------------------------------------------------------------------
+
+hi ModeMsg              guifg=#FFFFFF   guibg=#0000FF   gui=NONE        ctermfg=7       ctermbg=4       cterm=NONE
+hi MoreMsg              guifg=#FFFFFF   guibg=#00A261   gui=NONE        ctermfg=7       ctermbg=28      cterm=NONE
+
+hi Normal               guifg=#71D289   guibg=#004A41                   ctermfg=84      ctermbg=23 
+
+"------------------------------------------------------------------------------
+" Preprocessor Variants:
+"------------------------------------------------------------------------------
+"
+if s:ColorPre == "red"
+  hi PreProc            guifg=#FF5F5F   guibg=bg                        ctermfg=203
+elseif s:ColorPre == "yellow"
+  hi PreProc            guifg=#AFFF00   guibg=bg                        ctermfg=154
+elseif s:ColorPre == "blue"
+  hi PreProc            guifg=#918EE4   guibg=bg                        ctermfg=105
+endif
+"------------------------------------------------------------------------------
+
+hi Question             guifg=#E5E500   guibg=NONE      gui=NONE        ctermfg=11      ctermbg=NONE    cterm=NONE
+
+"------------------------------------------------------------------------------
+" Search Stand Out Variants:
+"------------------------------------------------------------------------------
+"
+if s:SearchStandOut == 0
+  hi IncSearch          guifg=#D0D0D0   guibg=#206828   gui=NONE        ctermfg=NONE    ctermbg=22      cterm=NONE
+  hi Search             guifg=NONE      guibg=#212a81                   ctermfg=NONE    ctermbg=18
+elseif s:SearchStandOut == 1
+  hi IncSearch          guifg=#D0D0D0   guibg=#206828   gui=underline   ctermfg=252     ctermbg=22      cterm=underline
+  hi Search             guifg=#FDAD5D   guibg=#202880   gui=underline   ctermfg=215     ctermbg=18      cterm=underline
+elseif s:SearchStandOut == 2
+  hi IncSearch          guibg=#D0D0D0   guifg=#206828   gui=underline   ctermbg=252     ctermfg=22      cterm=underline
+  hi Search             guibg=#FDAD5D   guifg=#202880   gui=underline   ctermbg=215     ctermfg=18      cterm=underline
+endif
+"------------------------------------------------------------------------------
+
+hi SignColumn           guifg=#00BBBB   guibg=#204d40
+hi Special              guifg=#00E0F2   guibg=NONE      gui=NONE        ctermfg=45
+hi SpecialKey           guifg=#00F4F4   guibg=#266955
+
+"------------------------------------------------------------------------------
+" Statement Variants:
+"------------------------------------------------------------------------------
+"
+if s:BoldStatement
+  hi Statement          guifg=#DEDE00                   gui=bold        ctermfg=11                      cterm=bold
+else
+  hi Statement          guifg=#E4E300                   gui=NONE        ctermfg=11
+endif
+"------------------------------------------------------------------------------
+
+hi StatusLine           guifg=#000000   guibg=#7DCEAD   gui=NONE                        ctermbg=00      cterm=reverse
+hi StatusLineNC         guifg=#245748   guibg=#689C7C   gui=NONE        ctermfg=72      ctermbg=23      cterm=reverse
+hi Title                guifg=#7CFC94   guibg=NONE      gui=bold        ctermfg=2                       cterm=bold
+
+"------------------------------------------------------------------------------
+" Todo Variants:
+"------------------------------------------------------------------------------
+"
+if s:TodoUnderline
+  " Underlined
+  hi Todo               guifg=#AFD7D7   guibg=NONE      gui=underline   ctermfg=159     ctermbg=NONE    cterm=underline
+else
+  " Blue background
+  hi Todo               guifg=#00FFFF   guibg=#0000FF                   ctermfg=51      ctermbg=4
+endif
+"------------------------------------------------------------------------------
+
+hi Type                 guifg=#F269E4   guibg=bg        gui=NONE        ctermfg=213
+hi Underlined                                           gui=underline                                   cterm=underline
+hi VertSplit            guifg=#245748   guibg=#689C7C   gui=NONE        ctermfg=72      ctermbg=23      cterm=reverse
+hi Visual                               guibg=#0B7260   gui=NONE
+hi WarningMsg           guifg=#000087   guibg=#FFFF00                   ctermfg=18      ctermbg=11
+hi WildMenu             guifg=#20012e   guibg=#00a675   gui=bold        ctermfg=NONE    ctermbg=NONE    cterm=bold
+"
+hi pythonPreCondit                                                      ctermfg=2                       cterm=NONE
+hi tkWidget             guifg=#D5B11C   guibg=bg        gui=bold        ctermfg=7                       cterm=bold
+hi tclBookends          guifg=#7CFC94   guibg=NONE      gui=bold        ctermfg=2                       cterm=bold
+
+" ------------------------------------------------------------------------------------------------
+" Custom HTML Groups:
+" (see ':help html.vim' for more info)
+"------------------------------------------------------------------------------
+
+let html_my_rendering=1
+
+hi htmlBold             guifg=#87FFD7                   gui=bold        ctermfg=122                     cterm=bold
+hi htmlBoldItalic       guifg=#87D7EF                   gui=bold        ctermfg=117                     cterm=bold
+hi htmlBoldUnderline    guifg=#87FFD7                   gui=bold,underline ctermfg=122                  cterm=bold,underline
+hi htmlBoldUnderlineItalic guifg=#87D7EF                gui=bold,underline ctermfg=117                  cterm=bold,underline
+hi htmlH1               guifg=#00FF00   guibg=NONE      gui=bold,underline ctermfg=2                    cterm=bold,underline
+hi htmlH2               guifg=#00FF00   guibg=NONE      gui=bold        ctermfg=2                       cterm=bold
+hi htmlH3               guifg=#00FF00   guibg=NONE      gui=NONE        ctermfg=2
+hi htmlH4               guifg=#00C700   guibg=NONE      gui=underline   ctermfg=34                      cterm=underline
+hi htmlH5               guifg=#00C700   guibg=NONE      gui=NONE        ctermfg=34
+hi htmlH6               guifg=#00A700   guibg=NONE      gui=underline   ctermfg=28                      cterm=underline
+hi htmlItalic           guifg=#87D7D7                   gui=NONE        ctermfg=116
+hi htmlLink             guifg=#8787D7                   gui=underline   ctermfg=105                     cterm=underline
+hi htmlUnderline                                        gui=underline                                   cterm=underline
+hi htmlUnderlineItalic  guifg=#87D7D7                   gui=underline   ctermfg=116                     cterm=underline
+
+"------------------------------------------------------------------------------
+" VimOutliner Groups:
+" (see http://www.vimoutliner.org)
+" Note: Make sure to add "colorscheme tabula" to the .vimoutlinerrc file.
+"------------------------------------------------------------------------------
+"
+" Indent level colors
+
+hi OL1                  guifg=#02AAFF                                   ctermfg=33
+hi OL2                  guifg=#02CAE9                                   ctermfg=39
+hi OL3                  guifg=#87D7D7                                   ctermfg=44
+hi OL4                  guifg=#87D7D7                                   ctermfg=44
+hi OL5                  guifg=#87D7D7                                   ctermfg=44
+hi OL6                  guifg=#87D7D7                                   ctermfg=44
+hi OL7                  guifg=#87D7D7                                   ctermfg=44
+hi OL8                  guifg=#87D7D7                                   ctermfg=44
+hi OL9                  guifg=#87D7D7                                   ctermfg=44
+
+" colors for tags
+hi outlTags             guifg=#F269E4                                   ctermfg=213
+        
+" color for body text
+hi BT1                  guifg=#71D289                                   ctermfg=84 
+hi BT2                  guifg=#71D289                                   ctermfg=84 
+hi BT3                  guifg=#71D289                                   ctermfg=84 
+hi BT4                  guifg=#71D289                                   ctermfg=84 
+hi BT5                  guifg=#71D289                                   ctermfg=84 
+hi BT6                  guifg=#71D289                                   ctermfg=84 
+hi BT7                  guifg=#71D289                                   ctermfg=84 
+hi BT8                  guifg=#71D289                                   ctermfg=84 
+hi BT9                  guifg=#71D289                                   ctermfg=84 
+
+" color for pre-formatted text
+hi PT1                  guifg=#7DDCDB                                   ctermfg=123
+hi PT2                  guifg=#7DDCDB                                   ctermfg=123
+hi PT3                  guifg=#7DDCDB                                   ctermfg=123
+hi PT4                  guifg=#7DDCDB                                   ctermfg=123
+hi PT5                  guifg=#7DDCDB                                   ctermfg=123
+hi PT6                  guifg=#7DDCDB                                   ctermfg=123
+hi PT7                  guifg=#7DDCDB                                   ctermfg=123
+hi PT8                  guifg=#7DDCDB                                   ctermfg=123
+hi PT9                  guifg=#7DDCDB                                   ctermfg=123
+
+" color for tables 
+hi TA1                  guifg=#918EE4                                   ctermfg=105
+hi TA2                  guifg=#918EE4                                   ctermfg=105
+hi TA3                  guifg=#918EE4                                   ctermfg=105
+hi TA4                  guifg=#918EE4                                   ctermfg=105
+hi TA5                  guifg=#918EE4                                   ctermfg=105
+hi TA6                  guifg=#918EE4                                   ctermfg=105
+hi TA7                  guifg=#918EE4                                   ctermfg=105
+hi TA8                  guifg=#918EE4                                   ctermfg=105
+hi TA9                  guifg=#918EE4                                   ctermfg=105
+
+" color for user text (wrapping)
+hi UT1                  guifg=#71D289                                   ctermfg=84
+hi UT2                  guifg=#71D289                                   ctermfg=84 
+hi UT3                  guifg=#71D289                                   ctermfg=84 
+hi UT4                  guifg=#71D289                                   ctermfg=84 
+hi UT5                  guifg=#71D289                                   ctermfg=84 
+hi UT6                  guifg=#71D289                                   ctermfg=84 
+hi UT7                  guifg=#71D289                                   ctermfg=84 
+hi UT8                  guifg=#71D289                                   ctermfg=84 
+hi UT9                  guifg=#71D289                                   ctermfg=84 
+        
+" color for user text (non-wrapping)
+hi UT1                  guifg=#71D289                                   ctermfg=84 
+hi UT2                  guifg=#71D289                                   ctermfg=84 
+hi UT3                  guifg=#71D289                                   ctermfg=84 
+hi UT4                  guifg=#71D289                                   ctermfg=84 
+hi UT5                  guifg=#71D289                                   ctermfg=84 
+hi UT6                  guifg=#71D289                                   ctermfg=84 
+hi UT7                  guifg=#71D289                                   ctermfg=84 
+hi UT8                  guifg=#71D289                                   ctermfg=84 
+hi UT9                  guifg=#71D289                                   ctermfg=84
+        
+" colors for experimental spelling error highlighting
+" this only works for spellfix.vim with will be cease to exist soon
+hi spellErr             guifg=#E4E300                   gui=underline   ctermfg=11                      cterm=underline
+hi BadWord              guifg=#E4E300                   gui=underline   ctermfg=11                      cterm=underline
+
+
+"==============================================================================
+"                              Options Processor                           {{{1
+"==============================================================================
+"
+"------------------------------------------------------------------------------
+" Main Dialog:                                                             {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula()
+  call inputsave()
+  let thisOption = 1
+  while thisOption >= 1 && thisOption <= 9
+    redraw
+    let thisOption = inputlist([
+          \                  "Select a 'Tabula_' option:",
+          \                  "1. BoldStatement    Display statements in bold",
+          \                  "2. ColorPre         Set Color for preprocessor statements",
+          \                  "3. CurColor         Set GUI cursor color",
+          \                  "4. DarkError        Use dark error background",
+          \                  "5. FlatConstants    Use multiple colors for constant values",
+          \                  "6. InvisibleIgnore  Display of Ignore and NonText characters",
+          \                  "7. LNumUnderline    Show line numbers underlined",
+          \                  "8. SearchStandOut   Display of search occurrences",
+          \                  "9. TodoUnderline    Display of TODOs and similar"
+          \                  ])
+
+    redraw
+    if thisOption >= 1 && thisOption <= 9
+      call Tabula_{thisOption}()
+      "let g:Tabula_setOptions = 1
+    endif
+  endwhile
+  call inputrestore()
+endfunction
+
+"------------------------------------------------------------------------------
+" Bold Statements:                                                         {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_1()
+  let curOption = ""
+  if s:BoldStatement == 0
+    let curOption = "not "
+  endif
+  let optionValue = inputlist([
+        \                     "How to display statements (currently ".curOption."bold)?",
+        \                     "1. bold",
+        \                     "2. not bold"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_BoldStatement = 1
+  elseif optionValue == 2
+    let g:Tabula_BoldStatement = 0
+  endif
+endfunction
+
+"------------------------------------------------------------------------------
+" Color For Preprocessor Statements:                                       {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_2()
+  let optionValue = inputlist([
+        \                     "How to display preprocessor statements (currently ".s:ColorPre.")?",
+        \                     "1. blue",
+        \                     "2. red",
+        \                     "3. yellow"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_ColorPre = "blue"
+  elseif optionValue == 2
+    let g:Tabula_ColorPre = "red"
+  elseif optionValue == 3
+    let g:Tabula_ColorPre = "yellow"
+   endif
+endfunction
+
+"------------------------------------------------------------------------------
+" GUI Cursor Color:                                                        {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_3()
+  let optionValue = inputlist([
+        \                     "Use which cursor color (currently ".s:CurColor.")?",
+        \                     "1. blue",
+        \                     "2. red",
+        \                     "3. yellow",
+        \                     "4. white"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_CurColor = "blue"
+  elseif optionValue == 2
+    let g:Tabula_CurColor = "red"
+  elseif optionValue == 3
+    let g:Tabula_CurColor = "yellow"
+  elseif optionValue == 4
+    let g:Tabula_CurColor = "white"
+  endif
+endfunction
+
+"------------------------------------------------------------------------------
+" Use Dark Error Background:                                               {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_4()
+  let curOption = "light "
+  if s:DarkError
+    let curOption = "dark "
+  endif
+  let optionValue = inputlist([
+        \                     "How to display errors in the text (currently ".curOption."background)?",
+        \                     "1. light background",
+        \                     "2. dark background"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_DarkError = 0
+  elseif optionValue == 2
+    let g:Tabula_DarkError = 1
+  endif
+endfunction
+
+"------------------------------------------------------------------------------
+" Multiple Constant Colors:                                                {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_5()
+  let curOption = "one color"
+  if s:FlatConstants == 0
+    let curOption = "multiple colors"
+  endif
+  let optionValue = inputlist([
+        \                     "How to display constant values (currently ".curOption.")?",
+        \                     "1. use one common color for all",
+        \                     "2. use different color for each type"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_FlatConstants = 1
+  elseif optionValue == 2
+    let g:Tabula_FlatConstants = 0
+  endif
+endfunction
+
+"------------------------------------------------------------------------------
+" Ignore And NonText Characters:                                           {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_6()
+  let curOption = "invisible"
+  if s:InvisibleIgnore == 0
+    let curOption = "slightly visible"
+  endif
+  let optionValue = inputlist([
+        \                     "Show Ignore and NonText characters (currently ".curOption.")?",
+        \                     "1. invisible",
+        \                     "2. slightly visible"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_InvisibleIgnore = 1
+  elseif optionValue == 2
+    let g:Tabula_InvisibleIgnore = 0
+  endif
+endfunction
+
+"------------------------------------------------------------------------------
+" Underlined Line Numbers:                                                 {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_7()
+  let curOption = ""
+  if s:LNumUnderline == 0
+    let curOption = "not "
+  endif
+  let optionValue = inputlist([
+        \                     "How to display line numbers(currently ".curOption."underlined)?",
+        \                     "1. underlined",
+        \                     "2. not underlined"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_LNumUnderline = 1
+  elseif optionValue == 2
+    let g:Tabula_LNumUnderline = 0
+  endif
+endfunction
+
+"------------------------------------------------------------------------------
+" Let Search Occurrences Stand Out More Prominently:                       {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_8()
+  if s:SearchStandOut == 0
+    let curOption = "normal"
+  elseif s:SearchStandOut == 1
+    let curOption = "prominent"
+  elseif s:SearchStandOut == 2
+    let curOption = "very prominent"
+  endif
+  let optionValue = inputlist([
+        \                     "How to display search occurrences (currently ".curOption.")?",
+        \                     "1. normal",
+        \                     "2. prominent",
+        \                     "3. very prominent"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_SearchStandOut = 0
+  elseif optionValue == 2
+    let g:Tabula_SearchStandOut = 1
+  elseif optionValue == 3
+    let g:Tabula_SearchStandOut = 2
+  endif
+endfunction
+
+"------------------------------------------------------------------------------
+" TODOs Display:                                                           {{{2
+"------------------------------------------------------------------------------
+"
+function! Tabula_9()
+  let curOption = ""
+  if s:TodoUnderline == 0
+    let curOption = "not "
+  endif
+  let optionValue = inputlist([
+        \                     "How to display TODOs and similar (currently ".curOption."underlined)?",
+        \                     "1. underlined",
+        \                     "2. not underlined"
+        \                     ])
+  if optionValue == 1
+    let g:Tabula_TodoUnderline = 1
+  elseif optionValue == 2
+    let g:Tabula_TodoUnderline = 0
+  endif
+endfunction
+
+"==========================================================================}}}1
+"
+" FIXME: This can't work!
+"
+"if g:Tabula_setOptions
+"  :exe "color tabula"
+"  let g:Tabula_setOptions = 0
+"endif
+
+" vim:tw=0:fdm=marker:fdl=0:fdc=3:fen
diff --git a/vim/colors/tango.vim b/vim/colors/tango.vim
new file mode 100644 (file)
index 0000000..cdb6c9c
--- /dev/null
@@ -0,0 +1,78 @@
+"
+" Tango Vim Color Scheme
+" =======================
+"
+" For best results, set up your terminal with a Tango palette.
+" Instructions for GNOME Terminal:
+" http://uwstopia.nl/blog/2006/07/tango-terminal
+"
+" author:   Michele Campeotto <micampe@micampe.it>
+"
+set background=dark
+
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let colors_name = "tango"
+
+" Default Colors
+hi Normal       guifg=#eeeeec guibg=#000000
+hi NonText      guifg=#555753 guibg=#000000 gui=none
+hi NonText      ctermfg=darkgray
+hi Cursor       guibg=#d3d7cf
+hi lCursor      guibg=#d3d7cf
+
+" Search
+hi Search       guifg=#eeeeec guibg=#c4a000
+hi Search       cterm=none ctermfg=grey ctermbg=blue
+hi IncSearch    guibg=#eeeeec guifg=#729fcf
+hi IncSearch    cterm=none ctermfg=yellow ctermbg=green
+
+" Window Elements
+hi StatusLine   guifg=#eeeeec guibg=#4e9a06 gui=bold
+hi StatusLine   ctermfg=white ctermbg=green cterm=bold
+hi StatusLineNC guifg=#d3d7df guibg=#4e9a06
+hi StatusLineNC ctermfg=lightgray ctermbg=darkgreen
+hi VertSplit    guifg=#eeeeec guibg=#eeeeec
+hi Folded       guifg=#eeeeec guibg=#75507b
+hi Folded       ctermfg=white ctermbg=magenta
+hi Visual       guifg=#d3d7cf guibg=#4e9a06
+hi Visual       ctermbg=white ctermfg=lightgreen cterm=reverse
+
+" Specials
+hi Todo         guifg=#8ae234 guibg=#4e9a06 gui=bold
+hi Todo         ctermfg=white ctermbg=green
+hi Title        guifg=#eeeeec gui=bold
+hi Title        ctermfg=white cterm=bold
+
+" Syntax
+hi Constant     guifg=#c4a000
+hi Constant     ctermfg=darkyellow
+hi Number       guifg=#729fcf
+hi Number       ctermfg=darkblue
+hi Statement    guifg=#4e9a06 gui=bold
+hi Statement    ctermfg=green
+hi Identifier   guifg=#8ae234
+hi Identifier   ctermfg=darkgreen
+hi PreProc      guifg=#cc0000
+hi PreProc      ctermfg=darkred
+hi Comment      guifg=#06989a gui=italic
+hi Comment      ctermfg=cyan cterm=none
+hi Type         guifg=#d3d7cf gui=bold
+hi Type         ctermfg=gray cterm=bold
+hi Special      guifg=#75507b
+hi Special      ctermfg=magenta cterm=none
+hi Error        guifg=#eeeeec guibg=#ef2929
+hi Error        ctermfg=white ctermbg=red
+
+" Diff
+hi DiffAdd      guifg=fg guibg=#3465a4 gui=none
+hi DiffAdd      ctermfg=gray ctermbg=blue cterm=none
+hi DiffChange   guifg=fg guibg=#555753 gui=none
+hi DiffChange   ctermfg=gray ctermbg=darkgray cterm=none
+hi DiffDelete   guibg=bg
+hi DiffDelete   ctermfg=gray ctermbg=none cterm=none
+hi DiffText     guifg=fg guibg=#c4a000 gui=none
+hi DiffText     ctermfg=gray ctermbg=yellow cterm=none
diff --git a/vim/colors/tango2.vim b/vim/colors/tango2.vim
new file mode 100644 (file)
index 0000000..330fe89
--- /dev/null
@@ -0,0 +1,62 @@
+" =============================================================================
+" Name: Tango2
+" Purpose: Another colour scheme using the Tango colour palette
+" Maintainer: Pranesh Srinivasan
+" Last Modified: Saturday 04 October 2008 02:06:26 AM IST
+" =============================================================================
+
+" Inspired from some Gnome renditions of the Tango colour scheme.
+
+" =============================================================================
+" Preamble
+" =============================================================================
+
+set background=dark
+
+hi clear
+
+if exists("syntax-on")
+syntax reset
+endif
+
+let colors_name = "tango2"
+
+" =============================================================================
+" Vim >= 7.0 specific colours
+" =============================================================================
+
+if version >= 700
+" No support for cursor line yet
+" hi CursorLine term=underline cterm=underline guibg=#111133
+" hi CursorColoumn
+" hi MatchParen
+" hi Pmenu
+" hi PmenuSel
+endif
+
+" =============================================================================
+" General colours
+" =============================================================================
+
+hi Normal guibg=#2E3436 guifg=#eeeeec 
+hi Cursor gui=none guibg=White guifg=Black
+
+hi Folded guibg=#4D585B guibg=#d2d2d2
+" No fold column support yet 
+" hi FoldColumn guifg=Orange guibg=DarkBlue
+" =============================================================================
+" Syntax highlighting
+" =============================================================================
+
+hi Comment gui=italic guifg=#6d7e8a ctermfg=Grey
+hi Todo term=bold guifg=#EBC450 
+hi Constant guifg=#8ae234
+hi Type guifg=#8AE234
+hi Function gui=bold guifg=#9BCF8D
+hi Statement guifg=#729FCF
+hi Identifier guifg=#AD7FA8
+hi PreProc guifg=#e9ba6e 
+hi Special term=underline guifg=#5EAFE5
+
+hi Search guibg=#81ABBD
+" hi QtClass guifg=Orange ctermfg=LightBlue
diff --git a/vim/colors/taqua.vim b/vim/colors/taqua.vim
new file mode 100644 (file)
index 0000000..51e7039
--- /dev/null
@@ -0,0 +1,84 @@
+" Vim color file
+" Maintainer:   TaQ <eustaquiorangel@yahoo.com>
+" Last Change:  18 March 2003
+" URL: http://taq.cjb.net              
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=light
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let colors_name="taqua"
+
+hi Normal  gui=NONE guifg=#303030 guibg=#FFFFFF
+hi NonText gui=BOLD guifg=#303030 guibg=#FFFFFF
+
+" Search
+hi IncSearch gui=BOLD guifg=#008000 guibg=#CCFF00
+hi Search    gui=BOLD guifg=#008000 guibg=#CCFF00
+
+" Messages
+hi ErrorMsg   gui=BOLD guifg=#FFFFFF guibg=#FF0000
+hi WarningMsg gui=BOLD guifg=#008000 guibg=#CCFF00
+
+" Split area
+hi StatusLine   gui=BOLD guifg=#FFFFFF guibg=#0E8ED3
+hi StatusLineNC gui=BOLD guifg=#FFFFFF guibg=#0A6799
+
+" Diff
+hi DiffText     gui=BOLD guifg=#FF0000 guibg=#FFEAE0
+hi DiffChange   gui=BOLD guifg=#303030 guibg=#FFFFFF
+hi DiffDelete   gui=NONE guifg=#FFFFFF guibg=#FF0000
+hi DiffAdd      gui=NONE guifg=#008000 guibg=#00FF00
+
+" Cursor
+hi Cursor       gui=BOLD guifg=#FFFFFF guibg=#000000
+hi lCursor      gui=BOLD guifg=#f8f8f8 guibg=#162CF7
+hi CursorIM     gui=NONE guifg=#f8f8f8 guibg=#162CF7
+
+" Fold
+hi Folded        gui=BOLD guifg=#0E8ED3 guibg=#DBF2FF
+hi FoldColumn gui=NONE guifg=#0E8ED3 guibg=#DBF2FF
+
+" Other
+hi LineNr               gui=BOLD guifg=#00A0FF guibg=#DBF2FF
+hi Directory    gui=BOLD guifg=#0A6799 guibg=#FFFFFF
+hi NonText      gui=BOLD guifg=#009999 guibg=#FFFFFF
+hi SpecialKey   gui=BOLD guifg=#2020FF guibg=#FFFFFF
+hi Title        gui=BOLD guifg=#0000A0 guibg=#FFFFFF
+hi Visual       gui=NONE guifg=#404060 guibg=#dddde8
+
+" Syntax group
+" purple was #8000FF
+hi Comment    gui=NONE guifg=#0E8ED3 guibg=#DBF2FF 
+hi Constant      gui=BOLD guifg=#0384F6 guibg=#DBF2FF
+hi Error      gui=BOLD guifg=#FF0000 guibg=#FFFFFF
+" hi Identifier gui=NONE guifg=#1F89E0 guibg=#FFFFFF 
+hi Identifier gui=NONE guifg=#000000 guibg=#FFFFFF 
+hi Ignore     gui=NONE guifg=#f8f8f8 guibg=#FFFFFF
+hi PreProc       gui=BOLD guifg=#0BBF20 guibg=#FFFFFF
+hi Special    gui=NONE guifg=#0E8ED3 guibg=#DBF2FF
+hi Statement  gui=BOLD guifg=#F36CE5 guibg=#FFFFFF
+hi Todo       gui=NONE guifg=#FF0070 guibg=#FFE0F4
+hi Type                  gui=BOLD guifg=#0971F9 guibg=#FFFFFF
+hi Underlined gui=UNDERLINE guifg=#0000ff guibg=NONE
+
+" HTML
+hi htmlLink                 gui=UNDERLINE guifg=#0000ff guibg=NONE
+hi htmlBold                 gui=BOLD
+hi htmlBoldItalic           gui=BOLD,ITALIC
+hi htmlBoldUnderline        gui=BOLD,UNDERLINE
+hi htmlBoldUnderlineItalic  gui=BOLD,UNDERLINE,ITALIC
+hi htmlItalic               gui=ITALIC
+hi htmlUnderline            gui=UNDERLINE
+hi htmlUnderlineItalic      gui=UNDERLINE,ITALIC
+
+" Scrollbar
+hi Scrollbar  gui=BOLD guifg=#00C0FF guibg=#FFFFFF
+hi VertSplit  gui=BOLD guifg=#FFFFFF guibg=#0E8ED3
+hi Visual        gui=BOLD guifg=#FFFFFF guibg=#1679F9
diff --git a/vim/colors/tcsoft.vim b/vim/colors/tcsoft.vim
new file mode 100644 (file)
index 0000000..3198341
--- /dev/null
@@ -0,0 +1,83 @@
+" Vim Farben-Datei
+" Ersteller:   Ingo Fabbri <vim@tcsoft.net>
+" Letzte ร„nderung:     2007 Jan 19
+
+" Mein persรถnliches Farbschema. Es schont die Augen, da es keine grellen Farben verwendet.
+" Am Besten geignet fรผr PHP
+
+set background=light
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let colors_name = "TCSoft"
+
+if version >= 700
+  hi CursorLine                 guibg=#FFFF33  gui=NONE  "hellgelb
+  hi CursorColumn               guibg=#EAEAEA
+  hi MatchParen guifg=white     guibg=#99CC00  gui=bold
+
+  "Tabpages
+  hi TabLine    guifg=black     guibg=#B0B8C0 gui=italic
+  hi TabLineFill guifg=#9098A0
+  hi TabLineSel guifg=black     guibg=#F0F0F0 gui=italic,bold
+
+  "P-Menu (auto-completion)
+  hi Pmenu      guifg=white     guibg=#808080
+  "PmenuSel
+  "PmenuSbar
+  "PmenuThumb
+endif
+
+" Farb-Einstellungen fรผr das GUI
+hi Normal       guifg=#000000   guibg=#FFFFFF "Schwarze Schrift auf weiรŸem Hintergrund
+
+hi Ignore       guifg=bg
+
+hi Comment      guifg=#000099   gui=italic  "dunkelblau
+hi Constant     guifg=#666666   gui=NONE    "grau
+hi Special      guifg=#FF0000   gui=NONE    "rot
+hi Identifier   guifg=#993300   gui=NONE    "rostfarbig
+hi Statement    guifg=#FF9900   gui=NONE    "orange
+hi PreProc      guifg=#009900   gui=NONE    "dunkelgrรผn
+hi Type         guifg=#FF9900   gui=bold    "orange
+hi Cursor       guifg=#000000   gui=reverse "schwarz
+hi LineNr       guifg=#000000   guibg=#EFEFEF  gui=NONE    "schwarz
+hi StatusLine   guifg=#000000   gui=reverse,bold "schwarz
+
+hi Todo                guifg=Blue      guibg=Yellow
+syn keyword    Todo            TODO FIXME XXX
+syn keyword Error    FEHLER
+
+hi link   Function    PreProc
+hi link   String           Constant
+hi link   Character      Constant
+
+hi! link  MoreMsg     Comment
+hi! link  ErrorMsg    Visual
+hi! link  WarningMsg  ErrorMsg
+hi! link  Question    Comment
+
+hi link   Number           Special
+hi link   Boolean          Constant
+hi link   Float                    Number
+
+hi link   Operator    Identifier
+hi link   Keyword          Statement
+hi link   Exception      Statement
+hi link   Include          PreProc
+hi link   Define           PreProc
+hi link   Macro                    PreProc
+
+hi link   Conditional  Statement
+hi link   Repeat           Statement
+hi link   Label                    Statement
+
+hi link   PreCondit      PreProc
+hi link   StorageClass Type
+hi link   Structure      Type
+hi link   Typedef          Type
+hi link   SpecialChar  Special
+hi link   Delimiter      Special
+hi link   SpecialComment Comment
+hi link   Debug                    Special
diff --git a/vim/colors/tir_black.vim b/vim/colors/tir_black.vim
new file mode 100644 (file)
index 0000000..802dec1
--- /dev/null
@@ -0,0 +1,130 @@
+" tir_black color scheme
+" Based on ir_black from: http://blog.infinitered.com/entries/show/8
+" adds 256 color console support
+" changed WildMenu color to be the same as PMenuSel
+
+set background=dark
+hi clear
+
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "tir_black"
+
+" General colors
+hi Normal guifg=#f6f3e8 guibg=black ctermfg=white ctermbg=0
+hi NonText guifg=#070707 guibg=black ctermfg=232 ctermbg=0
+
+hi Cursor guifg=black guibg=white ctermfg=0 ctermbg=15
+hi LineNr guifg=#3D3D3D guibg=black ctermfg=239 ctermbg=0
+
+hi VertSplit guifg=#202020 guibg=#202020 ctermfg=235 ctermbg=235 
+hi StatusLine guifg=#CCCCCC guibg=#202020 gui=italic ctermfg=235 ctermbg=254
+hi StatusLineNC guifg=black guibg=#202020 ctermfg=0 ctermbg=235 
+
+hi Folded guifg=#a0a8b0 guibg=#384048 ctermfg=103 ctermbg=60
+hi Title guifg=#f6f3e8 gui=bold ctermfg=187 cterm=bold
+hi Visual guibg=#262D51 ctermbg=60
+
+hi SpecialKey guifg=#808080 guibg=#343434 ctermfg=8 ctermbg=236
+
+hi WildMenu guifg=black guibg=#cae682 ctermfg=0 ctermbg=195
+hi PmenuSbar guifg=black guibg=white ctermfg=0 ctermbg=15
+
+hi Error gui=undercurl ctermfg=203 ctermbg=none cterm=underline guisp=#FF6C60
+hi ErrorMsg guifg=white guibg=#FF6C60 gui=bold ctermfg=white ctermbg=203 cterm=bold
+hi WarningMsg guifg=white guibg=#FF6C60 gui=bold ctermfg=white ctermbg=203 cterm=bold
+
+hi ModeMsg guifg=black guibg=#C6C5FE gui=bold ctermfg=0 ctermbg=189 cterm=bold
+
+if version >= 700 " Vim 7.x specific colors
+ hi CursorLine guibg=#121212 gui=none ctermbg=234 cterm=none
+ hi CursorColumn guibg=#121212 gui=none ctermbg=234 cterm=none
+ hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=bold ctermfg=white ctermbg=darkgray 
+ hi Pmenu guifg=#f6f3e8 guibg=#444444 ctermfg=white ctermbg=242 
+ hi PmenuSel guifg=#000000 guibg=#cae682 ctermfg=0 ctermbg=195 
+ hi Search guifg=#000000 guibg=#cae682 ctermfg=0 ctermbg=195 
+endif
+
+" Syntax highlighting
+hi Comment guifg=#7C7C7C ctermfg=8 
+hi String guifg=#A8FF60 ctermfg=155 
+hi Number guifg=#FF73FD ctermfg=207 
+
+hi Keyword guifg=#96CBFE ctermfg=117 
+hi PreProc guifg=#96CBFE ctermfg=117 
+hi Conditional guifg=#6699CC ctermfg=110 
+
+hi Todo guifg=#000000 guibg=#cae682 ctermfg=0 ctermbg=195 
+hi Constant guifg=#99CC99 ctermfg=151 
+
+hi Identifier guifg=#C6C5FE ctermfg=189 
+hi Function guifg=#FFD2A7 ctermfg=223 
+hi Type guifg=#FFFFB6 ctermfg=229 
+hi Statement guifg=#6699CC ctermfg=110 
+
+hi Special guifg=#E18964 ctermfg=173 
+hi Delimiter guifg=#00A0A0 ctermfg=37 
+hi Operator guifg=white ctermfg=white 
+
+hi link Character Constant
+hi link Boolean Constant
+hi link Float Number
+hi link Repeat Statement
+hi link Label Statement
+hi link Exception Statement
+hi link Include PreProc
+hi link Define PreProc
+hi link Macro PreProc
+hi link PreCondit PreProc
+hi link StorageClass Type
+hi link Structure Type
+hi link Typedef Type
+hi link Tag Special
+hi link SpecialChar Special
+hi link SpecialComment Special
+hi link Debug Special
+
+" Special for Ruby
+hi rubyRegexp guifg=#B18A3D ctermfg=brown 
+hi rubyRegexpDelimiter guifg=#FF8000 ctermfg=brown 
+hi rubyEscape guifg=white ctermfg=cyan 
+hi rubyInterpolationDelimiter guifg=#00A0A0 ctermfg=blue 
+hi rubyControl guifg=#6699CC ctermfg=blue "and break, etc
+hi rubyStringDelimiter guifg=#336633 ctermfg=lightgreen 
+hi link rubyClass Keyword 
+hi link rubyModule Keyword 
+hi link rubyKeyword Keyword 
+hi link rubyOperator Operator
+hi link rubyIdentifier Identifier
+hi link rubyInstanceVariable Identifier
+hi link rubyGlobalVariable Identifier
+hi link rubyClassVariable Identifier
+hi link rubyConstant Type 
+
+" Special for Java
+hi link javaScopeDecl Identifier 
+hi link javaCommentTitle javaDocSeeTag 
+hi link javaDocTags javaDocSeeTag 
+hi link javaDocParam javaDocSeeTag 
+hi link javaDocSeeTagParam javaDocSeeTag 
+
+hi javaDocSeeTag guifg=#CCCCCC ctermfg=darkgray 
+hi javaDocSeeTag guifg=#CCCCCC ctermfg=darkgray 
+
+" Special for XML
+hi link xmlTag Keyword 
+hi link xmlTagName Conditional 
+hi link xmlEndTag Identifier 
+
+" Special for HTML
+hi link htmlTag Keyword 
+hi link htmlTagName Conditional 
+hi link htmlEndTag Identifier 
+
+" Special for Javascript
+hi link javaScriptNumber Number 
+
+" Special for CSharp
+hi link csXmlTag Keyword 
diff --git a/vim/colors/tolerable.vim b/vim/colors/tolerable.vim
new file mode 100644 (file)
index 0000000..7b97b9a
--- /dev/null
@@ -0,0 +1,43 @@
+" Vim color file
+" Maintainer:   Ian Langworth
+" Last Change:  2004 Dec 24
+" Email:        <langworth.com>
+
+" Color settings inspired by BBEdit for Mac OS, plus I liked
+" the low-contrast comments from the 'oceandeep' colorscheme
+
+set background=light
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="tolerable"
+
+hi Cursor       guifg=white guibg=darkgreen
+
+hi Normal       gui=none guifg=black guibg=white
+hi NonText      gui=none guifg=orange guibg=white
+
+hi Statement    gui=none guifg=blue
+hi Special      gui=none guifg=red
+hi Constant     gui=none guifg=darkred
+hi Comment      gui=none guifg=#555555
+hi Preproc      gui=none guifg=darkcyan
+hi Type         gui=none guifg=darkmagenta
+hi Identifier   gui=none guifg=darkgreen
+hi Title        gui=none guifg=black
+
+hi StatusLine   gui=none guibg=#333333 guifg=white
+hi StatusLineNC gui=none guibg=#333333 guifg=white
+hi VertSplit    gui=none guibg=#333333 guifg=white
+
+hi Visual       gui=none guibg=green guifg=black
+hi Search       gui=none guibg=yellow
+hi Directory    gui=none guifg=darkblue
+hi WarningMsg   gui=none guifg=red 
+hi Error        gui=none guifg=white guibg=red
+hi Todo         gui=none guifg=black guibg=yellow
+
+hi MoreMsg      gui=none
+hi ModeMsg      gui=none
+
diff --git a/vim/colors/torte.vim b/vim/colors/torte.vim
new file mode 100644 (file)
index 0000000..2971360
--- /dev/null
@@ -0,0 +1,51 @@
+" Vim color file
+" Maintainer:   Thorsten Maerz <info@netztorte.de>
+" Last Change:  2001 Jul 23
+" grey on black
+" optimized for TFT panels
+" $Revision: 1.1 $
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+"colorscheme default
+let g:colors_name = "torte"
+
+" hardcoded colors :
+" GUI Comment : #80a0ff = Light blue
+
+" GUI
+highlight Normal     guifg=Grey80       guibg=Black
+highlight Search     guifg=Black        guibg=Red       gui=bold
+highlight Visual     guifg=Grey25                       gui=bold
+highlight Cursor     guifg=Black        guibg=Green     gui=bold
+highlight Special    guifg=Orange
+highlight Comment    guifg=#80a0ff
+highlight StatusLine guifg=blue         guibg=white
+highlight Statement  guifg=Yellow                       gui=NONE
+highlight Type                                          gui=NONE
+
+" Console
+highlight Normal     ctermfg=LightGrey  ctermbg=Black
+highlight Search     ctermfg=Black      ctermbg=Red     cterm=NONE
+highlight Visual                                        cterm=reverse
+highlight Cursor     ctermfg=Black      ctermbg=Green   cterm=bold
+highlight Special    ctermfg=Brown
+highlight Comment    ctermfg=Blue
+highlight StatusLine ctermfg=blue       ctermbg=white
+highlight Statement  ctermfg=Yellow                     cterm=NONE
+highlight Type                                          cterm=NONE
+
+" only for vim 5
+if has("unix")
+  if v:version<600
+    highlight Normal  ctermfg=Grey      ctermbg=Black   cterm=NONE      guifg=Grey80      guibg=Black   gui=NONE
+    highlight Search  ctermfg=Black     ctermbg=Red     cterm=bold      guifg=Black       guibg=Red     gui=bold
+    highlight Visual  ctermfg=Black     ctermbg=yellow  cterm=bold      guifg=Grey25                    gui=bold
+    highlight Special ctermfg=LightBlue                 cterm=NONE      guifg=LightBlue                 gui=NONE
+    highlight Comment ctermfg=Cyan                      cterm=NONE      guifg=LightBlue                 gui=NONE
+  endif
+endif
+
diff --git a/vim/colors/twilight.vim b/vim/colors/twilight.vim
new file mode 100644 (file)
index 0000000..f2ccdd3
--- /dev/null
@@ -0,0 +1,114 @@
+
+set background=dark
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "twilight"
+
+let s:grey_blue = '#8a9597'
+let s:light_grey_blue = '#a0a8b0'
+let s:dark_grey_blue = '#34383c'
+let s:mid_grey_blue = '#64686c'
+let s:beige = '#ceb67f'
+let s:light_orange = '#ebc471'
+let s:yellow = '#e3d796'
+let s:violet = '#a999ac'
+let s:green = '#a2a96f'
+let s:lightgreen = '#c2c98f'
+let s:red = '#d08356'
+let s:cyan = '#74dad9'
+let s:darkgrey = '#1a1a1a'
+let s:grey = '#303030'
+let s:lightgrey = '#605958'
+let s:white = '#fffedc'
+
+if version >= 700
+  hi CursorLine guibg=#262626
+  hi CursorColumn guibg=#262626
+  hi MatchParen guifg=white guibg=#80a090 gui=bold
+
+  "Tabpages
+  hi TabLine guifg=#a09998 guibg=#202020 gui=underline
+  hi TabLineFill guifg=#a09998 guibg=#202020 gui=underline
+  hi TabLineSel guifg=#a09998 guibg=#404850 gui=underline
+
+  "P-Menu (auto-completion)
+  hi Pmenu guifg=#605958 guibg=#303030 gui=underline
+  hi PmenuSel guifg=#a09998 guibg=#404040 gui=underline
+  "PmenuSbar
+  "PmenuThumb
+endif
+
+hi Visual guibg=#404040
+
+"hi Cursor guifg=NONE guibg=#586068
+hi Cursor guibg=#b0d0f0
+
+
+exe 'hi Normal         guifg='.s:white             .' guibg='.s:darkgrey
+exe 'hi Underlined     guifg='.s:white             .' guibg='.s:darkgrey        .' gui=underline'
+exe 'hi NonText        guifg='.s:lightgrey         .' guibg='.s:grey
+exe 'hi SpecialKey     guifg='.s:grey              .' guibg='.s:darkgrey
+
+exe 'hi LineNr         guifg='.s:mid_grey_blue     .' guibg='.s:dark_grey_blue  .' gui=none'
+exe 'hi StatusLine     guifg='.s:white             .' guibg='.s:grey            .' gui=italic,underline'
+exe 'hi StatusLineNC   guifg='.s:lightgrey         .' guibg='.s:grey            .' gui=italic,underline'
+exe 'hi VertSplit      guifg='.s:grey              .' guibg='.s:grey            .' gui=none'
+
+exe 'hi Folded         guifg='.s:grey_blue         .' guibg='.s:dark_grey_blue  .' gui=none'
+exe 'hi FoldColumn     guifg='.s:grey_blue         .' guibg='.s:dark_grey_blue  .' gui=none'
+exe 'hi SignColumn     guifg='.s:grey_blue         .' guibg='.s:dark_grey_blue  .' gui=none'
+
+exe 'hi Comment        guifg='.s:mid_grey_blue     .' guibg='.s:darkgrey        .' gui=italic'
+exe 'hi TODO           guifg='.s:grey_blue         .' guibg='.s:darkgrey        .' gui=italic,bold'
+
+exe 'hi Title          guifg='.s:red               .' guibg='.s:darkgrey        .' gui=underline'
+
+exe 'hi Constant       guifg='.s:red               .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi String         guifg='.s:green             .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi Special        guifg='.s:lightgreen        .' guibg='.s:darkgrey        .' gui=none'
+
+exe 'hi Identifier     guifg='.s:grey_blue         .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi Statement      guifg='.s:beige             .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi Conditional    guifg='.s:beige             .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi Repeat         guifg='.s:beige             .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi Structure      guifg='.s:beige             .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi Function       guifg='.s:violet            .' guibg='.s:darkgrey        .' gui=none'
+
+exe 'hi PreProc        guifg='.s:grey_blue         .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi Operator       guifg='.s:light_orange      .' guibg='.s:darkgrey        .' gui=none'
+exe 'hi Type           guifg='.s:yellow            .' guibg='.s:darkgrey        .' gui=italic'
+
+"hi Identifier guifg=#7587a6
+" Type d: 'class'
+"hi Structure guifg=#9B859D gui=underline
+"hi Function guifg=#dad085
+" dylan: method, library, ... d: if, return, ...
+"hi Statement guifg=#7187a1 gui=NONE
+" Keywords  d: import, module...
+"hi PreProc guifg=#8fbfdc
+"gui=underline
+"hi Operator guifg=#a07020
+"hi Repeat guifg=#906040 gui=underline
+"hi Type guifg=#708090
+
+"hi Type guifg=#f9ee98 gui=NONE
+
+"hi NonText guifg=#808080 guibg=#303030
+
+"hi Macro guifg=#a0b0c0 gui=underline
+
+"Tabs, trailing spaces, etc (lcs)
+"hi SpecialKey guifg=#808080 guibg=#343434
+
+"hi TooLong guibg=#ff0000 guifg=#f8f8f8
+
+hi Search guifg=#606000 guibg=#c0c000 gui=bold
+
+hi Directory guifg=#dad085 gui=NONE
+hi Error guibg=#602020
+
diff --git a/vim/colors/two2tango.vim b/vim/colors/two2tango.vim
new file mode 100644 (file)
index 0000000..8fa42be
--- /dev/null
@@ -0,0 +1,101 @@
+" Vim color file
+" Name: two2tango
+" Maintainer: Erik Falor <ewfalor@gmail.com>
+" Version: 1.1
+"
+" Big props to Panos Laganakos <panos.laganakos@gmail.com>
+" for the original darktango.vim colorscheme upon which 
+" this scheme is based.
+
+set background=dark
+if version > 580
+       " no guarantees for version 5.8 and below, but this makes it stop
+       " complaining
+       hi clear
+       if exists("syntax_on")
+               syntax reset
+       endif
+endif
+
+let g:colors_name="two2tango"
+
+"Tango palette
+"http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines
+" {{{
+let s:Butter           = ['#fce94f', '#edd400', '#c4a000']
+let s:Chameleon                = ['#8ae234', '#73d216', '#4e9a06']
+let s:Orange           = ['#fcaf3e', '#f57900', '#ce5c00']
+let s:SkyBlue          = ['#729fcf', '#3465a4', '#204a87']
+let s:Plum                     = ['#ad7fa8', '#75507b', '#5c3566']
+let s:Chocolate                = ['#e9b96e', '#c17d11', '#8f5902']
+let s:ScarletRed       = ['#ef2929', '#cc0000', '#a40000']
+let s:Aluminium                = ['#eeeeec', '#d3d7cf', '#babdb6',
+                                       \'#888a85', '#555753', '#2e3436']
+"This color isn't part of the Tango Palette; I use it because there
+"isn't a Tango color that provides enough contrast
+let s:Background    = '#212628'
+" }}}
+
+hi Normal      guibg=#2e3436 guifg=#d3d7cf
+execute "hi Normal      guibg=" . s:Aluminium[5]  . " guifg=" . s:Aluminium[1] 
+
+" {{{ syntax
+execute "hi Comment      gui=italic guifg=" . s:Aluminium[4]
+execute "hi Conditional  gui=bold guifg=" . s:Butter[2]
+execute "hi Constant     guifg=" . s:Chocolate[1]
+execute "hi Error        guifg=" . s:Aluminium[0] . " guibg=" . s:ScarletRed[2]
+execute "hi Identifier   guifg=" . s:Orange[2]
+execute "hi Ignore       guifg=" . s:Aluminium[5] . " guibg=" . s:Aluminium[5]
+execute "hi Operator     guifg=" . s:Butter[1]
+execute "hi PreProc      guifg=" . s:Chocolate[0]
+execute "hi Repeat       gui=bold guifg=" . s:Butter[2]
+execute "hi Special      guifg=" . s:SkyBlue[1]
+execute "hi Statement    guifg=" . s:Aluminium[3]
+execute "hi String       guifg=" . s:SkyBlue[0]
+execute "hi Title        guifg=" . s:Aluminium[0]
+execute "hi Todo         gui=bold guisp=NONE guibg=" . s:Orange[2] 
+                       \. " guifg=" . s:Aluminium[0] 
+execute "hi Type         guifg=" . s:Orange[2]
+execute "hi Underlined   gui=underline guifg=" . s:SkyBlue[0]
+" }}}
+
+" {{{ groups
+execute "hi Cursor       guibg=" . s:ScarletRed[0] . " guifg=" . s:Aluminium[5]
+execute "hi CursorLine   guibg=" . s:Background
+execute "hi CursorColumn guibg=" . s:Background
+"hi CursorIM TODO
+execute "hi Directory    guifg=" . s:SkyBlue[0]
+execute "hi ErrorMsg     guifg=" . s:Aluminium[0] . " guibg=" . s:ScarletRed[2]
+execute "hi FoldColumn   guibg=" . s:Aluminium[5] . " guifg=" . s:Aluminium[4]
+execute "hi Folded       guibg=" . s:Aluminium[4] . " guifg=" . s:Aluminium[2]
+execute "hi IncSearch    gui=none guibg=" . s:Butter[0] . " guifg=" . s:Butter[2] 
+execute "hi LineNr       guibg=" . s:Aluminium[5] . " guifg=" . s:Aluminium[4]
+execute "hi MatchParen   guibg=" . s:Aluminium[2] . " guifg=" . s:Aluminium[5]
+"hi Menu      TODO
+execute "hi ModeMsg      guifg=" . s:Orange[2]
+execute "hi MoreMsg      guifg=" . s:Orange[2]
+execute "hi NonText      guibg=" . s:Aluminium[5] . " guifg=" . s:Aluminium[4]
+execute "hi Pmenu        guibg=" . s:Aluminium[2] . " guifg=" . s:Aluminium[4]
+execute "hi PmenuSel     guibg=" . s:Aluminium[0] . " guifg=" . s:Aluminium[5]
+execute "hi Question     guifg=" . s:Plum[0] 
+"hi Scrollbar TODO
+execute "hi Search       guibg=" . s:Butter[0] . " guifg=" . s:Butter[2]
+execute "hi SpecialKey   guifg=" . s:Orange[2]
+execute "hi StatusLine   gui=none guibg=" . s:Orange[2] . " guifg=" . s:Aluminium[0]
+execute "hi StatusLineNC gui=none guibg=" . s:Aluminium[3] . " guifg=" . s:Aluminium[5]
+"hi TabLine     TODO - non-active tab page label
+"hi TabLineFill TODO - fill color where there are no tabs
+"hi TabLineSel  TODO - active tab page label
+execute "hi Tooltip      gui=none guibg=" . s:SkyBlue[0] . " guifg=" . s:Aluminium[0]
+execute "hi VertSplit    gui=none guibg=" . s:Aluminium[3] . " guifg=" . s:Aluminium[5]
+execute "hi Visual       guibg=" . s:Orange[0] . " guifg=" . s:Orange[2]
+"hi VisualNOS   TODO - Visual mode selection when vim is "Not Owning the Selection".
+execute "hi WarningMsg   guifg=" . s:Orange[0]
+execute "hi WildMenu     guifg=" . s:Butter[2] . " guibg=" . s:Butter[0]
+" }}}
+
+"  {{{ terminal
+" TODO
+" }}}
+
+" vim: sw=4 foldmethod=marker
diff --git a/vim/colors/vc.vim b/vim/colors/vc.vim
new file mode 100644 (file)
index 0000000..53ecc22
--- /dev/null
@@ -0,0 +1,24 @@
+" Vim color file
+" Maintainer:   Vladimir Vrzic <random@bsd.org.yu>
+" Last Change:  28. june 2003.
+" URL:          http://galeb.etf.bg.ac.yu/~random/pub/vim/ 
+
+set background=light
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="vc"
+
+hi Comment             gui=NONE                guifg=SeaGreen          guibg=NONE
+hi Constant            gui=NONE                guifg=#004488           guibg=NONE
+"hi Identifier gui=NONE                guifg=Blue                      guibg=NONE
+hi Statement   gui=NONE                guifg=Blue                      guibg=NONE
+hi PreProc             gui=NONE                guifg=Blue                      guibg=NONE      
+hi Type                        gui=NONE                guifg=Blue                      guibg=NONE
+hi Special             gui=NONE                guifg=SteelBlue guibg=NONE
+"hi Underlined 
+"hi Ignore             
+"hi Error              
+"hi Todo               
+
diff --git a/vim/colors/vibrantink.vim b/vim/colors/vibrantink.vim
new file mode 100644 (file)
index 0000000..46aa23f
--- /dev/null
@@ -0,0 +1,68 @@
+" Vim color scheme
+"
+" Name:         vibrantink.vim
+" Maintainer:   Jo Vermeulen <jo.vermeulen@gmail.com> 
+" Last Change:  5 Mar 2009 
+" License:      public domain
+" Version:      1.3
+"
+" This scheme should work in the GUI and in xterm's 256 color mode. It
+" won't work in 8/16 color terminals.
+"
+" I based it on John Lam's initial Vibrant Ink port to Vim [1]. Thanks
+" to a great tutorial [2], I was able to convert it to xterm 256 color
+" mode. And of course, credits go to Justin Palmer for creating the
+" original Vibrant Ink TextMate color scheme [3].
+"
+" [1] http://www.iunknown.com/articles/2006/09/04/vim-can-save-your-hands-too
+" [2] http://frexx.de/xterm-256-notes/
+" [3] http://encytemedia.com/blog/articles/2006/01/03/textmate-vibrant-ink-theme-and-prototype-bundle
+
+set background=dark
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let g:colors_name = "vibrantink"
+
+if has("gui_running")
+    highlight Normal guifg=White   guibg=Black
+    highlight Cursor guifg=Black   guibg=Yellow
+    highlight Keyword guifg=#FF6600
+    highlight Define guifg=#FF6600
+    highlight Comment guifg=#9933CC
+    highlight Type guifg=White gui=NONE
+    highlight rubySymbol guifg=#339999 gui=NONE
+    highlight Identifier guifg=White gui=NONE
+    highlight rubyStringDelimiter guifg=#66FF00
+    highlight rubyInterpolation guifg=White
+    highlight rubyPseudoVariable guifg=#339999
+    highlight Constant guifg=#FFEE98
+    highlight Function guifg=#FFCC00 gui=NONE
+    highlight Include guifg=#FFCC00 gui=NONE
+    highlight Statement guifg=#FF6600 gui=NONE
+    highlight String guifg=#66FF00
+    highlight Search guibg=White
+    highlight CursorLine guibg=#323300
+else
+    set t_Co=256
+    highlight Normal ctermfg=White ctermbg=Black 
+    highlight Cursor ctermfg=Black ctermbg=Yellow 
+    highlight Keyword ctermfg=202 
+    highlight Define ctermfg=202 
+    highlight Comment ctermfg=98
+    highlight Type ctermfg=White 
+    highlight rubySymbol ctermfg=66 
+    highlight Identifier ctermfg=White 
+    highlight rubyStringDelimiter ctermfg=82 
+    highlight rubyInterpolation ctermfg=White 
+    highlight rubyPseudoVariable ctermfg=66 
+    highlight Constant ctermfg=228 
+    highlight Function ctermfg=220 
+    highlight Include ctermfg=220 
+    highlight Statement ctermfg=202
+    highlight String ctermfg=82 
+    highlight Search ctermbg=White 
+    highlight CursorLine cterm=NONE ctermbg=235
+endif
diff --git a/vim/colors/vividchalk.vim b/vim/colors/vividchalk.vim
new file mode 100644 (file)
index 0000000..638a8f4
--- /dev/null
@@ -0,0 +1,191 @@
+" Vim color scheme
+" Name:         vividchalk.vim
+" Author:       Tim Pope <vimNOSPAM@tpope.info>
+" Version:      2.0
+" GetLatestVimScripts: 1891 1 :AutoInstall: vividchalk.vim
+
+" Based on the Vibrank Ink theme for TextMate
+" Distributable under the same terms as Vim itself (see :help license)
+
+if has("gui_running")
+    set background=dark
+endif
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+let colors_name = "vividchalk"
+
+" First two functions adapted from inkpot.vim
+
+" map a urxvt cube number to an xterm-256 cube number
+fun! s:M(a)
+    return strpart("0245", a:a, 1) + 0
+endfun
+
+" map a urxvt colour to an xterm-256 colour
+fun! s:X(a)
+    if &t_Co == 88
+        return a:a
+    else
+        if a:a == 8
+            return 237
+        elseif a:a < 16
+            return a:a
+        elseif a:a > 79
+            return 232 + (3 * (a:a - 80))
+        else
+            let l:b = a:a - 16
+            let l:x = l:b % 4
+            let l:y = (l:b / 4) % 4
+            let l:z = (l:b / 16)
+            return 16 + s:M(l:x) + (6 * s:M(l:y)) + (36 * s:M(l:z))
+        endif
+    endif
+endfun
+
+function! E2T(a)
+    return s:X(a:a)
+endfunction
+
+function! s:choose(mediocre,good)
+    if &t_Co != 88 && &t_Co != 256
+        return a:mediocre
+    else
+        return s:X(a:good)
+    endif
+endfunction
+
+function! s:hifg(group,guifg,first,second,...)
+    if a:0 && &t_Co == 256
+        let ctermfg = a:1
+    else
+        let ctermfg = s:choose(a:first,a:second)
+    endif
+    exe "highlight ".a:group." guifg=".a:guifg." ctermfg=".ctermfg
+endfunction
+
+function! s:hibg(group,guibg,first,second)
+    let ctermbg = s:choose(a:first,a:second)
+    exe "highlight ".a:group." guibg=".a:guibg." ctermbg=".ctermbg
+endfunction
+
+hi link railsMethod         PreProc
+hi link rubyDefine          Keyword
+hi link rubySymbol          Constant
+hi link rubyAccess          rubyMethod
+hi link rubyAttribute       rubyMethod
+hi link rubyEval            rubyMethod
+hi link rubyException       rubyMethod
+hi link rubyInclude         rubyMethod
+hi link rubyStringDelimiter rubyString
+hi link rubyRegexp          Regexp
+hi link rubyRegexpDelimiter rubyRegexp
+"hi link rubyConstant        Variable
+"hi link rubyGlobalVariable  Variable
+"hi link rubyClassVariable   Variable
+"hi link rubyInstanceVariable Variable
+hi link javascriptRegexpString  Regexp
+hi link javascriptNumber        Number
+hi link javascriptNull          Constant
+highlight link diffAdded        String
+highlight link diffRemoved      Statement
+highlight link diffLine         PreProc
+highlight link diffSubname      Comment
+
+call s:hifg("Normal","#EEEEEE","White",87)
+if &background == "light" || has("gui_running")
+    hi Normal guibg=Black ctermbg=Black
+else
+    hi Normal guibg=Black ctermbg=NONE
+endif
+highlight StatusLine    guifg=Black   guibg=#aabbee gui=bold ctermfg=Black ctermbg=White  cterm=bold
+highlight StatusLineNC  guifg=#444444 guibg=#aaaaaa gui=none ctermfg=Black ctermbg=Grey   cterm=none
+"if &t_Co == 256
+    "highlight StatusLine ctermbg=117
+"else
+    "highlight StatusLine ctermbg=43
+"endif
+
+highlight Ignore        ctermfg=Black
+highlight WildMenu      guifg=Black   guibg=#ffff00 gui=bold ctermfg=Black ctermbg=Yellow cterm=bold
+highlight Cursor        guifg=Black guibg=White ctermfg=Black ctermbg=White
+highlight CursorLine    guibg=#333333 guifg=NONE
+highlight CursorColumn  guibg=#333333 guifg=NONE
+highlight NonText       guifg=#404040 ctermfg=8
+highlight SpecialKey    guifg=#404040 ctermfg=8
+highlight Directory     none
+high link Directory     Identifier
+highlight ErrorMsg      guibg=Red ctermbg=DarkRed guifg=NONE ctermfg=NONE
+highlight Search        guifg=NONE ctermfg=NONE gui=none cterm=none
+call s:hibg("Search"    ,"#555555","DarkBlue",81)
+highlight IncSearch     guifg=White guibg=Black ctermfg=White ctermbg=Black
+highlight MoreMsg       guifg=#00AA00 ctermfg=Green
+highlight LineNr        guifg=#DDEEFF ctermfg=White
+call s:hibg("LineNr"    ,"#222222","DarkBlue",80)
+highlight Question      none
+high link Question      MoreMsg
+highlight Title         guifg=Magenta ctermfg=Magenta
+highlight VisualNOS     gui=none cterm=none
+call s:hibg("Visual"    ,"#555577","LightBlue",83)
+call s:hibg("VisualNOS" ,"#444444","DarkBlue",81)
+call s:hibg("MatchParen","#1100AA","DarkBlue",18)
+highlight WarningMsg    guifg=Red ctermfg=Red
+highlight Error         ctermbg=DarkRed
+highlight SpellBad      ctermbg=DarkRed
+" FIXME: Comments
+highlight SpellRare     ctermbg=DarkMagenta
+highlight SpellCap      ctermbg=DarkBlue
+highlight SpellLocal    ctermbg=DarkCyan
+
+call s:hibg("Folded"    ,"#110077","DarkBlue",17)
+call s:hifg("Folded"    ,"#aaddee","LightCyan",63)
+highlight FoldColumn    none
+high link FoldColumn    Folded
+highlight DiffAdd       ctermbg=4 guibg=DarkBlue
+highlight DiffChange    ctermbg=5 guibg=DarkMagenta
+highlight DiffDelete    ctermfg=12 ctermbg=6 gui=bold guifg=Blue guibg=DarkCyan
+highlight DiffText      ctermbg=DarkRed
+highlight DiffText      cterm=bold ctermbg=9 gui=bold guibg=Red
+
+highlight Pmenu         guifg=White ctermfg=White gui=bold cterm=bold
+highlight PmenuSel      guifg=White ctermfg=White gui=bold cterm=bold
+call s:hibg("Pmenu"     ,"#000099","Blue",18)
+call s:hibg("PmenuSel"  ,"#5555ff","DarkCyan",39)
+highlight PmenuSbar     guibg=Grey ctermbg=Grey
+highlight PmenuThumb    guibg=White ctermbg=White
+highlight TabLine       gui=underline cterm=underline
+call s:hifg("TabLine"   ,"#bbbbbb","LightGrey",85)
+call s:hibg("TabLine"   ,"#333333","DarkGrey",80)
+highlight TabLineSel    guifg=White guibg=Black ctermfg=White ctermbg=Black
+highlight TabLineFill   gui=underline cterm=underline
+call s:hifg("TabLineFill","#bbbbbb","LightGrey",85)
+call s:hibg("TabLineFill","#808080","Grey",83)
+
+hi Type gui=none
+hi Statement gui=none
+if !has("gui_mac")
+    " Mac GUI degrades italics to ugly underlining.
+    hi Comment gui=italic
+    hi railsUserClass  gui=italic
+    hi railsUserMethod gui=italic
+endif
+hi Identifier cterm=none
+" Commented numbers at the end are *old* 256 color values
+"highlight PreProc       guifg=#EDF8F9
+call s:hifg("Comment"        ,"#9933CC","DarkMagenta",34) " 92
+" 26 instead?
+call s:hifg("Constant"       ,"#339999","DarkCyan",21) " 30
+call s:hifg("rubyNumber"     ,"#CCFF33","Yellow",60) " 190
+call s:hifg("String"         ,"#66FF00","LightGreen",44,82) " 82
+call s:hifg("Identifier"     ,"#FFCC00","Yellow",72) " 220
+call s:hifg("Statement"      ,"#FF6600","Brown",68) " 202
+call s:hifg("PreProc"        ,"#AAFFFF","LightCyan",47) " 213
+call s:hifg("railsUserMethod","#AACCFF","LightCyan",27)
+call s:hifg("Type"           ,"#AAAA77","Grey",57) " 101
+call s:hifg("railsUserClass" ,"#AAAAAA","Grey",7) " 101
+call s:hifg("Special"        ,"#33AA00","DarkGreen",24) " 7
+call s:hifg("Regexp"         ,"#44B4CC","DarkCyan",21) " 74
+call s:hifg("rubyMethod"     ,"#DDE93D","Yellow",77) " 191
+"highlight railsMethod   guifg=#EE1122 ctermfg=1
diff --git a/vim/colors/vwilight.vim b/vim/colors/vwilight.vim
new file mode 100644 (file)
index 0000000..724c7ca
--- /dev/null
@@ -0,0 +1,102 @@
+" Vim color file
+" Converted from Textmate theme Twilight using Coloration v0.2.5 (http://github.com/sickill/coloration)
+
+set background=dark
+highlight clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "Twilight"
+
+hi Cursor  guifg=NONE guibg=#fffd00 gui=NONE
+hi Visual  guifg=NONE guibg=#919309 gui=NONE
+hi CursorLine  guifg=NONE guibg=#1b1b1b gui=NONE
+hi CursorColumn  guifg=NONE guibg=#1b1b1b gui=NONE
+hi LineNr  guifg=#868686 guibg=#141414 gui=NONE
+hi VertSplit  guifg=#3f3f3f guibg=#3f3f3f gui=NONE
+hi MatchParen  guifg=#cda869 guibg=NONE gui=NONE
+hi StatusLine  guifg=#f8f8f8 guibg=#3f3f3f gui=bold
+hi StatusLineNC  guifg=#f8f8f8 guibg=#3f3f3f gui=NONE
+hi Pmenu  guifg=#9b703f guibg=NONE gui=NONE
+hi PmenuSel  guifg=NONE guibg=#919309 gui=NONE
+hi IncSearch  guifg=NONE guibg=#343a44 gui=NONE
+hi Search  guifg=NONE guibg=#343a44 gui=NONE
+hi Directory  guifg=#cf6a4c guibg=NONE gui=NONE
+hi Folded  guifg=#5f5a60 guibg=#141414 gui=NONE
+
+hi Normal  guifg=#f8f8f8 guibg=#141414 gui=NONE
+hi Boolean  guifg=#cf6a4c guibg=NONE gui=NONE
+hi Character  guifg=#cf6a4c guibg=NONE gui=NONE
+hi Comment  guifg=#5f5a60 guibg=NONE gui=italic
+hi Conditional  guifg=#cda869 guibg=NONE gui=NONE
+hi Constant  guifg=#cf6a4c guibg=NONE gui=NONE
+hi Define  guifg=#cda869 guibg=NONE gui=NONE
+hi ErrorMsg  guifg=NONE guibg=NONE gui=NONE
+hi WarningMsg  guifg=NONE guibg=NONE gui=NONE
+hi Float  guifg=#cf6a4c guibg=NONE gui=NONE
+hi Function  guifg=#9b703f guibg=NONE gui=NONE
+hi Identifier  guifg=#f9ee98 guibg=NONE gui=NONE
+hi Keyword  guifg=#cda869 guibg=NONE gui=NONE
+hi Label  guifg=#8f9d6a guibg=NONE gui=NONE
+hi NonText  guifg=#4f4f4f guibg=#1b1b1b gui=NONE
+hi Number  guifg=#cf6a4c guibg=NONE gui=NONE
+hi Operator  guifg=#cda869 guibg=NONE gui=NONE
+hi PreProc  guifg=#cda869 guibg=NONE gui=NONE
+hi Special  guifg=#f8f8f8 guibg=NONE gui=NONE
+hi SpecialKey  guifg=#4f4f4f guibg=#1b1b1b gui=NONE
+hi Statement  guifg=#cda869 guibg=NONE gui=NONE
+hi StorageClass  guifg=#f9ee98 guibg=NONE gui=NONE
+hi String  guifg=#8f9d6a guibg=NONE gui=NONE
+hi Tag  guifg=#9b703f guibg=NONE gui=NONE
+hi Title  guifg=#f8f8f8 guibg=NONE gui=bold
+hi Todo  guifg=#5f5a60 guibg=NONE gui=inverse,bold,italic
+hi Type  guifg=#9b703f guibg=NONE gui=NONE
+hi Underlined  guifg=NONE guibg=NONE gui=underline
+hi rubyClass  guifg=#cda869 guibg=NONE gui=NONE
+hi rubyFunction  guifg=#9b703f guibg=NONE gui=NONE
+hi rubyInterpolationDelimiter  guifg=NONE guibg=NONE gui=NONE
+hi rubySymbol  guifg=#cf6a4c guibg=NONE gui=NONE
+hi rubyConstant  guifg=#9b859d guibg=NONE gui=NONE
+hi rubyStringDelimiter  guifg=#8f9d6a guibg=NONE gui=NONE
+hi rubyBlockParameter  guifg=#7587a6 guibg=NONE gui=NONE
+hi rubyInstanceVariable  guifg=#7587a6 guibg=NONE gui=NONE
+hi rubyInclude  guifg=#cda869 guibg=NONE gui=NONE
+hi rubyGlobalVariable  guifg=#7587a6 guibg=NONE gui=NONE
+hi rubyRegexp  guifg=#e9c062 guibg=NONE gui=NONE
+hi rubyRegexpDelimiter  guifg=#e9c062 guibg=NONE gui=NONE
+hi rubyEscape  guifg=#cf6a4c guibg=NONE gui=NONE
+hi rubyControl  guifg=#cda869 guibg=NONE gui=NONE
+hi rubyClassVariable  guifg=#7587a6 guibg=NONE gui=NONE
+hi rubyOperator  guifg=#cda869 guibg=NONE gui=NONE
+hi rubyException  guifg=#cda869 guibg=NONE gui=NONE
+hi rubyPseudoVariable  guifg=#7587a6 guibg=NONE gui=NONE
+hi rubyRailsUserClass  guifg=#9b859d guibg=NONE gui=NONE
+hi rubyRailsARAssociationMethod  guifg=#dad085 guibg=NONE gui=NONE
+hi rubyRailsARMethod  guifg=#dad085 guibg=NONE gui=NONE
+hi rubyRailsRenderMethod  guifg=#dad085 guibg=NONE gui=NONE
+hi rubyRailsMethod  guifg=#dad085 guibg=NONE gui=NONE
+hi erubyDelimiter  guifg=NONE guibg=NONE gui=NONE
+hi erubyComment  guifg=#5f5a60 guibg=NONE gui=italic
+hi erubyRailsMethod  guifg=#dad085 guibg=NONE gui=NONE
+hi htmlTag  guifg=#ac885b guibg=NONE gui=NONE
+hi htmlEndTag  guifg=#ac885b guibg=NONE gui=NONE
+hi htmlTagName  guifg=#ac885b guibg=NONE gui=NONE
+hi htmlArg  guifg=#ac885b guibg=NONE gui=NONE
+hi htmlSpecialChar  guifg=#cf6a4c guibg=NONE gui=NONE
+hi javaScriptFunction  guifg=#f9ee98 guibg=NONE gui=NONE
+hi javaScriptRailsFunction  guifg=#dad085 guibg=NONE gui=NONE
+hi javaScriptBraces  guifg=NONE guibg=NONE gui=NONE
+hi yamlKey  guifg=#9b703f guibg=NONE gui=NONE
+hi yamlAnchor  guifg=#7587a6 guibg=NONE gui=NONE
+hi yamlAlias  guifg=#7587a6 guibg=NONE gui=NONE
+hi yamlDocumentHeader  guifg=#8f9d6a guibg=NONE gui=NONE
+hi cssURL  guifg=#7587a6 guibg=NONE gui=NONE
+hi cssFunctionName  guifg=#dad085 guibg=NONE gui=NONE
+hi cssColor  guifg=#cf6a4c guibg=NONE gui=NONE
+hi cssPseudoClassId  guifg=#9b703f guibg=NONE gui=NONE
+hi cssClassName  guifg=#9b703f guibg=NONE gui=NONE
+hi cssValueLength  guifg=#cf6a4c guibg=NONE gui=NONE
+hi cssCommonAttr  guifg=#cf6a4c guibg=NONE gui=NONE
+hi cssBraces  guifg=NONE guibg=NONE gui=NONE
\ No newline at end of file
diff --git a/vim/colors/vylight.vim b/vim/colors/vylight.vim
new file mode 100644 (file)
index 0000000..156adf3
--- /dev/null
@@ -0,0 +1,81 @@
+"
+" Vim colour file
+"
+" Maintainer:  Vy-Shane Sin Fat <shane@node.mu>
+" Last Change: 20 November 2009
+" Version:     1.1
+"
+" This colour file is meant for GUI use.
+"
+
+set background=light
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="vylight"
+
+
+hi Normal        guifg=#1a1a1a  guibg=white
+hi Title         guifg=black    guibg=white
+hi Cursor        guibg=#111111
+hi LineNr        guifg=#aaaaaa  guibg=#f8f8f8
+hi Visual        guibg=#bbddff
+hi NonText       guifg=#cccccc  guibg=#fafafa
+hi StatusLine    guifg=#222222  guibg=#eeeeee  gui=none
+hi StatusLineNC  guifg=#666666  guibg=#eeeeee  gui=none
+hi VertSplit     guifg=#eeeeee  guibg=#eeeeee  gui=none
+hi ModeMsg       guifg=#007050  guibg=#eeeeee  gui=none
+hi ErrorMsg      guifg=#f03050  guibg=#eeeeee  gui=none
+hi Error         guifg=#bb3355  guibg=white    gui=none
+
+
+" Vim 7.x specific
+if version >= 700
+  hi CursorLine  guibg=#eeeeee  gui=none
+  hi MatchParen  guibg=#ccffdd  gui=none
+  hi Pmenu       guifg=#60656f  guibg=#f0f5ff  gui=none
+  hi PmenuSel    guifg=white    guibg=#3585ef  gui=bold
+  hi PmenuSbar   guifg=#d0d5dd  guibg=#e0e5ee  gui=bold
+  hi PmenuThumb  guifg=#e0e5ee  guibg=#c0c5dd  gui=bold
+  hi Search      guibg=#fcfcaa  gui=none
+  hi IncSearch   guibg=#ffff33  gui=bold
+endif
+
+
+" Syntax highlighting 
+hi Comment       guifg=#668866  gui=none
+"hi Todo          guifg=#225522  guibg=white    gui=italic
+hi Todo          guifg=#446644  guibg=#ddeecc  gui=italic
+hi Operator      guifg=#1a1a1a  gui=none
+hi Identifier    guifg=#1a1a1a  gui=none
+hi Statement     guifg=#0050b0  gui=none
+hi Type          guifg=#0050b0  gui=none
+hi Constant      guifg=#204070  gui=none
+hi Conditional   guifg=#006040  gui=none
+hi Delimiter     guifg=#1a1a1a  gui=none
+hi PreProc       guifg=#007050  gui=none
+hi Special       guifg=#a05050  gui=none
+hi Keyword       guifg=#007050  gui=none
+
+hi link Function        Normal
+hi link Character       Constant
+hi link String          Constant
+hi link Boolean         Constant
+hi link Number          Constant
+hi link Float           Number
+hi link Repeat          Conditional
+hi link Label           Statement
+hi link Exception       Statement
+hi link Include         PreProc
+hi link Define          PreProc
+hi link Macro           PreProc
+hi link PreCondit       PreProc
+hi link StorageClass    Type
+hi link Structure       Type
+hi link Typedef         Type
+hi link Tag             Special
+hi link SpecialChar     Special
+hi link SpecialComment  Special
+hi link Debug           Special
+
diff --git a/vim/colors/winter.vim b/vim/colors/winter.vim
new file mode 100644 (file)
index 0000000..4212187
--- /dev/null
@@ -0,0 +1,87 @@
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+"                                                                              "
+" File_Name__: winter.vim                                                      "
+" Abstract___: A color sheme file (only for GVIM) which uses a light grey      "
+"              background makes the VIM look like the scenes of winter.        "
+" Author_____: CHE Wenlong <chewenlong AT buaa.edu.cn>                         "
+" Version____: 1.3                                                             "
+" Last_Change: February 26, 2009                                               "
+"                                                                              "
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" Preprocess {{{
+
+if !has("gui_running")
+    runtime! colors/default.vim
+    finish
+endif
+
+set background=light
+
+hi clear
+
+if version > 580
+    hi clear
+    if exists("syntax_on")
+        syntax reset
+    endif
+endif
+
+let colors_name = "winter"
+
+" }}}
+
+" Common {{{
+
+hi Normal           guifg=#000000 guibg=#D4D0C8 gui=NONE
+hi Visual           guifg=#FFFFFF guibg=#000080 gui=NONE
+hi Cursor           guifg=#D4D0C8 guibg=#FF0000 gui=NONE
+hi LineNr           guifg=#707070 guibg=NONE    gui=NONE
+hi Title            guifg=#202020 guibg=NONE    gui=NONE
+hi Underlined       guifg=#202020 guibg=NONE    gui=UNDERLINE
+
+" }}}
+
+" Split {{{
+
+hi StatusLine       guifg=#E0E0E0 guibg=#707070 gui=NONE
+hi StatusLineNC     guifg=#E0E0E0 guibg=#909090 gui=NONE
+hi VertSplit        guifg=#909090 guibg=#909090 gui=NONE
+
+" }}}
+
+" Folder {{{
+
+hi Folded           guifg=#707070 guibg=#E0E0E0 gui=NONE
+
+" }}}
+
+" Syntax {{{
+
+hi Type             guifg=#0000FF guibg=NONE    gui=NONE
+hi Define           guifg=#0000FF guibg=NONE    gui=NONE
+hi Comment          guifg=#008000 guibg=NONE    gui=NONE
+hi Constant         guifg=#A000A0 guibg=NONE    gui=NONE
+hi String           guifg=#008080 guibg=NONE    gui=NONE
+hi Number           guifg=#FF0000 guibg=NONE    gui=NONE
+hi Statement        guifg=#0000FF guibg=NONE    gui=NONE
+
+" }}}
+
+" Others {{{
+
+hi PreProc          guifg=#A000A0 guibg=NONE    gui=NONE
+hi Special          guifg=#A000A0 guibg=NONE    gui=NONE
+hi SpecialKey       guifg=#707070 guibg=#E0E0E0 gui=NONE
+hi Error            guifg=#FF0000 guibg=#FFFFFF gui=UNDERLINE
+hi Todo             guifg=#FF0000 guibg=#FFFF00 gui=UNDERLINE
+
+" }}}
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+"                                                                              "
+" vim:foldmethod=marker:tabstop=4
+"                                                                              "
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
diff --git a/vim/colors/wombat.vim b/vim/colors/wombat.vim
new file mode 100644 (file)
index 0000000..9ad1e56
--- /dev/null
@@ -0,0 +1,51 @@
+" Maintainer:  Lars H. Nielsen (dengmao@gmail.com)
+" Last Change: January 22 2007
+
+set background=dark
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "wombat"
+
+
+" Vim >= 7.0 specific colors
+if version >= 700
+  hi CursorLine guibg=#2d2d2d
+  hi CursorColumn guibg=#2d2d2d
+  hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=bold
+  hi Pmenu             guifg=#f6f3e8 guibg=#444444
+  hi PmenuSel  guifg=#000000 guibg=#cae682
+endif
+
+" General colors
+hi Cursor              guifg=NONE    guibg=#656565 gui=none
+hi Normal              guifg=#f6f3e8 guibg=#242424 gui=none
+hi NonText             guifg=#808080 guibg=#303030 gui=none
+hi LineNr              guifg=#857b6f guibg=#000000 gui=none
+hi StatusLine  guifg=#f6f3e8 guibg=#444444 gui=italic
+hi StatusLineNC guifg=#857b6f guibg=#444444 gui=none
+hi VertSplit   guifg=#444444 guibg=#444444 gui=none
+hi Folded              guibg=#384048 guifg=#a0a8b0 gui=none
+hi Title               guifg=#f6f3e8 guibg=NONE        gui=bold
+hi Visual              guifg=#f6f3e8 guibg=#444444 gui=none
+hi SpecialKey  guifg=#808080 guibg=#343434 gui=none
+
+" Syntax highlighting
+hi Comment             guifg=#99968b gui=italic
+hi Todo                guifg=#8f8f8f gui=italic
+hi Constant    guifg=#e5786d gui=none
+hi String              guifg=#95e454 gui=italic
+hi Identifier  guifg=#cae682 gui=none
+hi Function    guifg=#cae682 gui=none
+hi Type                guifg=#cae682 gui=none
+hi Statement   guifg=#8ac6f2 gui=none
+hi Keyword             guifg=#8ac6f2 gui=none
+hi PreProc             guifg=#e5786d gui=none
+hi Number              guifg=#e5786d gui=none
+hi Special             guifg=#e7f6da gui=none
+
+
diff --git a/vim/colors/wombat256.vim b/vim/colors/wombat256.vim
new file mode 100644 (file)
index 0000000..b22e5ba
--- /dev/null
@@ -0,0 +1,64 @@
+" Vim color file
+" Original Maintainer:  Lars H. Nielsen (dengmao@gmail.com)
+" Last Change:  2010-07-23
+"
+" Converting for 256-color terminals by
+" Danila Bespalov (danila.bespalov@gmail.com)
+" with great help of tool by Wolfgang Frisch (xororand@frexx.de)
+" inspired by David Liang's version (bmdavll@gmail.com)
+
+set background=dark
+
+hi clear
+
+if exists("syntax_on")
+       syntax reset
+endif
+
+let colors_name = "wombat256"
+
+
+" General colors
+hi Normal              ctermfg=254             ctermbg=234             cterm=none              guifg=#f6f3e8   guibg=#242424   gui=none
+hi Cursor              ctermfg=none    ctermbg=241             cterm=none              guifg=NONE              guibg=#656565   gui=none
+hi Visual              ctermfg=7               ctermbg=238             cterm=none              guifg=#f6f3e8   guibg=#444444   gui=none
+" hi VisualNOS
+" hi Search
+hi Folded              ctermfg=103             ctermbg=238             cterm=none              guifg=#a0a8b0   guibg=#384048   gui=none
+hi Title               ctermfg=7               ctermbg=none    cterm=bold              guifg=#f6f3e8   guibg=NONE              gui=bold
+hi StatusLine  ctermfg=7               ctermbg=238             cterm=none              guifg=#f6f3e8   guibg=#444444   gui=italic
+hi VertSplit   ctermfg=238             ctermbg=238             cterm=none              guifg=#444444   guibg=#444444   gui=none
+hi StatusLineNC        ctermfg=243             ctermbg=238             cterm=none              guifg=#857b6f   guibg=#444444   gui=none
+hi LineNr              ctermfg=243             ctermbg=0               cterm=none              guifg=#857b6f   guibg=#000000   gui=none
+hi SpecialKey  ctermfg=244             ctermbg=236             cterm=none              guifg=#808080   guibg=#343434   gui=none
+hi NonText             ctermfg=244             ctermbg=236             cterm=none              guifg=#808080   guibg=#303030   gui=none
+
+" Vim >= 7.0 specific colors
+if version >= 700
+hi CursorLine                                  ctermbg=236             cterm=none                                              guibg=#2d2d2d
+hi MatchParen  ctermfg=7               ctermbg=243             cterm=bold              guifg=#f6f3e8   guibg=#857b6f   gui=bold
+hi Pmenu               ctermfg=7               ctermbg=238                                             guifg=#f6f3e8   guibg=#444444
+hi PmenuSel            ctermfg=0               ctermbg=192                                             guifg=#000000   guibg=#cae682
+endif
+
+
+" Syntax highlighting
+hi Keyword             ctermfg=111             cterm=none              guifg=#8ac6f2   gui=none
+hi Statement   ctermfg=111             cterm=none              guifg=#8ac6f2   gui=none
+hi Constant            ctermfg=173             cterm=none              guifg=#e5786d   gui=none
+hi Number              ctermfg=173             cterm=none              guifg=#e5786d   gui=none
+hi PreProc             ctermfg=173             cterm=none              guifg=#e5786d   gui=none
+hi Function            ctermfg=192             cterm=none              guifg=#cae682   gui=none
+hi Identifier  ctermfg=192             cterm=none              guifg=#cae682   gui=none
+hi Type                        ctermfg=192             cterm=none              guifg=#cae682   gui=none
+hi Special             ctermfg=194             cterm=none              guifg=#e7f6da   gui=none
+hi String              ctermfg=113             cterm=none              guifg=#95e454   gui=italic
+hi Comment             ctermfg=246             cterm=none              guifg=#99968b   gui=italic
+hi Todo                        ctermfg=245             cterm=none              guifg=#8f8f8f   gui=italic
+
+
+" Links
+hi! link FoldColumn            Folded
+hi! link CursorColumn  CursorLine
+
+" vim:set ts=4 sw=4 noet:
diff --git a/vim/colors/wood.vim b/vim/colors/wood.vim
new file mode 100644 (file)
index 0000000..2f6059e
--- /dev/null
@@ -0,0 +1,39 @@
+" Vim color file
+" Maintainer:   freddydaoud@netscape.net
+" Last Change:  09 Apr 2005
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="wood"
+
+hi Normal                      guibg=#81816A guifg=linen
+hi Cursor                      guibg=#CFCFC6 guifg=black gui=bold
+hi VertSplit           guifg=#81816A guibg=#CCCCAA gui=none
+hi Folded                      guibg=black guifg=white
+hi FoldColumn          guibg=lightgray guifg=#292926
+hi ModeMsg                     guifg=black guibg=#CFCFC6
+hi MoreMsg                     guifg=black guibg=#CFCFC6
+hi NonText                     guifg=white guibg=#61614A gui=none
+hi Question                    guifg=snow
+hi Search                      guibg=#CFCFC6 guifg=black gui=bold
+hi SpecialKey          guifg=yellow
+hi StatusLine          guibg=#DFDFD6 guifg=black gui=none
+hi StatusLineNC            guibg=#BFBFB6 guifg=black gui=none
+hi Title                       guifg=bisque3
+hi Subtitle                    guifg=black
+hi Visual                      guifg=#292926 guibg=#CFCFC6 gui=none
+hi WarningMsg          guifg=salmon4 guibg=gray60 gui=bold
+hi Comment                     guifg=#D1D1BA
+hi Constant                    guifg=#FFFFCC gui=bold
+hi Identifier          guifg=#FFFFCC
+hi Statement           guifg=#000000
+hi PreProc                     guifg=black gui=bold
+hi Type                                guifg=#FFE0C0
+hi Special                     guifg=navajowhite
+hi Ignore                      guifg=grey29
+hi Todo                                guibg=black guifg=white
+hi WildMenu                    guibg=brown
+hi LineNr           guifg=#CCCCAA guibg=#61614A
diff --git a/vim/colors/wuye.vim b/vim/colors/wuye.vim
new file mode 100644 (file)
index 0000000..88a6126
--- /dev/null
@@ -0,0 +1,82 @@
+" Vim color file
+" Name:        WuYe
+" Maintainer:  Yeii
+" Last Change: 2009-08-12
+" Version:     1.2.1
+" URL:         http://www.vim.org/scripts/script.php?script_id=2088
+
+" Init
+highlight clear
+set background=dark
+if exists("syntax_on")
+   syntax reset
+endif
+let g:colors_name = "wuye"
+
+""""""""\ Highlighting groups for various occasions \""""""""
+hi SpecialKey   guifg=SlateBlue   ctermfg=Blue
+hi NonText      guifg=MidnightBlue   ctermfg=DarkBlue
+hi Directory    gui=BOLD guifg=LightSeaGreen   ctermfg=DarkCyan
+hi ErrorMsg     guifg=Yellow guibg=Firebrick   ctermfg=Yellow ctermbg=DarkRed
+hi IncSearch    gui=BOLD guifg=Red cterm=BOLD   ctermfg=Red
+hi Search       gui=BOLD guifg=MintCream guibg=Red   cterm=BOLD ctermfg=White ctermbg=Red
+hi MoreMsg      gui=BOLD guifg=MediumSpringGreen   cterm=BOLD ctermfg=DarkCyan
+hi ModeMsg      guifg=LawnGreen guibg=DeepSkyBlue4   ctermfg=Yellow ctermbg=DarkCyan
+hi LineNr       gui=UNDERLINE guifg=LightSkyBlue3 guibg=Gray10   cterm=UNDERLINE ctermfg=DarkGray
+hi Question     gui=BOLD guifg=green   cterm=BOLD ctermfg=green
+hi StatusLine   gui=BOLD guifg=White guibg=RoyalBlue4   cterm=BOLD ctermfg=White ctermbg=DarkBlue
+hi StatusLineNC gui=BOLD guifg=Bisque guibg=DimGray   cterm=BOLD ctermfg=Black ctermbg=Gray
+hi VertSplit    gui=BOLD guifg=Bisque guibg=DimGray   cterm=BOLD ctermfg=Black ctermbg=Gray
+hi Title        gui=BOLD guifg=DodgerBlue   cterm=BOLD ctermfg=LightBlue
+hi Visual       gui=REVERSE guibg=Yellow guifg=SlateBlue4   cterm=REVERSE ctermbg=Yellow ctermfg=DarkBlue
+hi WarningMsg   guifg=Gold   ctermfg=Yellow
+hi WildMenu     gui=BOLD guifg=Black guibg=Chartreuse   cterm=BOLD ctermfg=Black ctermbg=Darkgreen
+hi Folded       guifg=LightCyan guibg=DodgerBlue4   ctermfg=White ctermbg=DarkBlue
+hi FoldColumn   gui=BOLD guifg=DodgerBlue guibg=Gray16   cterm=BOLD ctermfg=Blue ctermbg=DarkGray
+hi DiffAdd      guifg=White guibg=Turquoise4   ctermfg=White ctermbg=Darkcyan
+hi DiffChange   guifg=White guibg=ForestGreen   ctermbg=Darkgreen
+hi DiffDelete   guifg=HotPink4 guibg=SlateGray4   ctermfg=DarkMagenta ctermbg=DarkGray
+hi DiffText     gui=BOLD guifg=Tomato guibg=DarkBlue   cterm=BOLD ctermfg=Magenta ctermbg=DarkBlue
+hi Cursor       guifg=Black guibg=Green   ctermfg=Black ctermbg=Green
+hi CursorIM     guifg=Black guibg=Red   ctermfg=Black ctermbg=Red
+hi CursorLine   gui=BOLD guibg=Black
+hi CursorColumn gui=BOLD guibg=Black
+
+""""""\ Syntax highlighting groups \""""""
+hi Normal       gui=NONE guifg=GhostWhite guibg=Gray8   cterm=NONE ctermfg=LightGray ctermbg=NONE
+hi MatchParen   gui=BOLD guifg=Gold   cterm=BOLD ctermfg=Yellow
+hi Comment      guifg=LightSlateGray   ctermfg=DarkGray
+hi Constant     guifg=CornflowerBlue   ctermfg=DarkCyan
+ hi String       guifg=SteelBlue1   ctermfg=DarkCyan
+ hi Character    guifg=SteelBlue   ctermfg=DarkCyan
+ hi Number       guifg=Turquoise   ctermfg=DarkCyan
+ hi Boolean      gui=BOLD guifg=DarkTurquoise   cterm=BOLD ctermfg=DarkCyan
+ hi Float        guifg=Turquoise   ctermfg=DarkCyan
+hi Identifier   guifg=DeepSkyBlue   ctermfg=lightcyan
+ hi Function     gui=BOLD guifg=DeepSkyBlue   cterm=BOLD ctermfg=lightcyan
+hi Statement    guifg=SpringGreen   ctermfg=LightGreen
+ hi Conditional  guifg=SeaGreen1   ctermfg=LightGreen
+ hi Repeat       guifg=SpringGreen   ctermfg=LightGreen
+ hi Label        guifg=MediumSpringGreen   ctermfg=LightGreen
+ hi Operator     guifg=Green2   ctermfg=LightGreen
+ hi Keyword      gui=BOLD guifg=SpringGreen   cterm=BOLD ctermfg=LightGreen
+ hi Exception    gui=BOLD guifg=SpringGreen2   cterm=BOLD ctermfg=LightGreen
+hi PreProc      guifg=Purple   ctermfg=DarkMagenta
+ hi Include      guifg=Purple2   ctermfg=DarkMagenta
+ hi Define       guifg=BlueViolet   ctermfg=DarkMagenta
+ hi Macro        guifg=DarkViolet   ctermfg=DarkMagenta
+ hi PreCondit    guifg=DarkOrchid   ctermfg=DarkMagenta
+hi Type         gui=BOLD guifg=RoyalBlue   cterm=BOLD ctermfg=LightBlue
+ hi StorageClass gui=BOLD guifg=RoyalBlue2   cterm=BOLD ctermfg=LightBlue
+ hi Structure    gui=BOLD guifg=DodgerBlue3   cterm=BOLD ctermfg=LightBlue
+ hi Typedef      gui=BOLD guifg=RoyalBlue1   cterm=BOLD ctermfg=LightBlue
+hi Special      guifg=BurlyWood   ctermfg=DarkYellow
+ hi Tag          guifg=Moccasin   ctermfg=DarkYellow
+ hi Specialchar  guifg=Tan   ctermfg=DarkYellow
+ hi Delimiter    guifg=Wheat3   ctermfg=DarkYellow
+ hi Debug        guifg=peru   ctermfg=DarkYellow
+hi Underlined   gui=UNDERLINE   cterm=UNDERLINE
+hi Ignore       guifg=Gray75   ctermfg=DarkGray
+hi Error        guifg=Khaki guibg=VioletRed   ctermfg=Yellow ctermbg=LightMagenta
+hi Todo         guifg=Yellow guibg=NavyBlue   ctermfg=Yellow ctermbg=DarkBlue
+
diff --git a/vim/colors/xemacs.vim b/vim/colors/xemacs.vim
new file mode 100644 (file)
index 0000000..fcd8761
--- /dev/null
@@ -0,0 +1,46 @@
+
+" Vim color file
+" Maintainer:   tranquility@portugalmail.pt
+" Last Change: 5 June 2002
+
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="xemacs"
+
+hi Normal                               guibg=#cdcecd guifg=black
+hi Cursor                               guibg=red guifg=grey gui=bold
+hi VertSplit            guibg=grey60 guifg=black gui=none
+hi Folded                               guibg=royalblue3 guifg=white
+hi FoldColumn           guibg=royalblue4 guifg=white
+hi ModeMsg                      guifg=#cdcecd guibg=black
+hi MoreMsg                      guifg=#cdcecd guibg=black
+hi NonText                      guifg=black guibg=#cdcecd gui=none
+hi Question                     guifg=black
+hi Search                               guibg=#aceeee
+hi SpecialKey           guifg=navyblue
+hi Special              guifg=navyblue
+hi StatusLine           guibg=#b7b7b7 guifg=black gui=none
+hi StatusLineNC guibg=#a6b7b7 guifg=black gui=none
+hi Title                                guifg=bisque3
+hi Subtitle                     guifg=black
+hi Visual                               guibg=#a4a5a3 guifg=black gui=none
+hi WarningMsg           guibg=#cdcecd guifg=black gui=bold
+hi Comment                      guifg=#00008b
+hi Constant                     guifg=#008900
+hi Identifier           guibg=#cdcecd guifg=black
+hi Statement            guifg=royalblue4
+hi PreProc                      guifg=#0000cd
+hi Type                                 guifg=#4a81b4 gui=NONE
+hi Ignore                               guifg=grey29
+hi Todo                                 guibg=gold guifg=black
+hi WildMenu                     guibg=#b7b7b7 guibg=grey91
+hi Directory            guibg=#cdcecd guifg=navyblue
diff --git a/vim/colors/xoria256.vim b/vim/colors/xoria256.vim
new file mode 100644 (file)
index 0000000..4033569
--- /dev/null
@@ -0,0 +1,173 @@
+" Vim color file
+" Name:     xoria256.vim
+" Version:  0.3.2
+" License:  Public Domain
+" Maintainer:   Dmitriy Y. Zotikov (xio) <xio@ungrund.org>
+"
+" Heavily based on 'moria' color scheme.
+"
+" Sould work in a 256 color terminal (like latest versions of xterm, konsole,
+" etc).  Will not, however, work in 88 color terminals like urxvt.
+"
+" Color numbers (0-255) see:
+" http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
+"
+" TODO:
+"   - Diff (currently *VERY* ugly)
+"   - Html
+
+
+
+if &t_Co != 256 && ! has("gui_running")
+  echomsg ""
+  echomsg "err: please use GUI or a 256-color terminal (so that t_Co=256 could be set)"
+  echomsg ""
+  finish
+endif
+
+set background=dark
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+
+" Which one is right?
+"let colors_name = "xoria256"
+let g:colors_name = "xoria256"
+
+
+
+hi Normal   cterm=none  ctermfg=252 ctermbg=234 gui=none    guifg=#d0d0d0   guibg=#202020
+
+hi Cursor   cterm=none  ctermfg=bg  ctermbg=214 gui=none    guifg=bg    guibg=#ffaf00
+hi CursorColumn cterm=none          ctermbg=238 gui=none            guibg=#444444
+hi CursorLine   cterm=none          ctermbg=238 gui=none            guibg=#444444
+hi lCursor  cterm=none  ctermfg=0   ctermbg=40  gui=none    guifg=#000000   guibg=#00df00
+"hi CursorIM    cterm=      ctermfg=    ctermbg=    gui=        guifg=      guibg=
+hi IncSearch    cterm=none  ctermfg=0   ctermbg=223 gui=none    guifg=#000000   guibg=#ffdfaf
+hi Search   cterm=none  ctermfg=0   ctermbg=149 gui=none    guifg=#000000   guibg=#afdf5f
+hi ErrorMsg cterm=none  ctermfg=15  ctermbg=160 gui=bold    guifg=#ffffff   guibg=#df0000
+hi WarningMsg   cterm=bold  ctermfg=196 ctermbg=bg  gui=bold    guifg=#ff0000   guibg=bg
+hi ModeMsg  cterm=bold  ctermfg=fg  ctermbg=bg  gui=bold    guifg=fg    guibg=bg
+hi MoreMsg  cterm=bold  ctermfg=250 ctermbg=bg  gui=bold    guifg=#bcbcbc   guibg=bg
+hi Question cterm=bold  ctermfg=113 ctermbg=bg  gui=bold    guifg=#87df7f   guibg=bg
+
+hi StatusLine   cterm=bold  ctermfg=fg  ctermbg=239 gui=bold    guifg=fg    guibg=#4e4e4e
+hi StatusLineNC cterm=none  ctermfg=fg  ctermbg=237 gui=none    guifg=fg    guibg=#3a3a3a
+hi User1    cterm=none  ctermfg=15  ctermbg=20  gui=none    guifg=#ffffff   guibg=#0000df
+hi User2    cterm=none  ctermfg=46  ctermbg=20  gui=none    guifg=#00ff00   guibg=#0000df
+hi User3    cterm=none  ctermfg=46  ctermbg=20  gui=none    guifg=#00ff00   guibg=#0000df
+hi User4    cterm=none  ctermfg=50  ctermbg=20  gui=none    guifg=#00ffdf   guibg=#0000df
+hi User5    cterm=none  ctermfg=46  ctermbg=20  gui=none    guifg=#00ff00   guibg=#0000df
+hi VertSplit    cterm=reverse   ctermfg=fg  ctermbg=237 gui=reverse guifg=fg    guibg=#3a3a3a
+
+hi WildMenu cterm=bold  ctermfg=0   ctermbg=184 gui=bold    guifg=#000000   guibg=#dfdf00
+"hi Menu    cterm=      ctermfg=    ctermbg=    gui=        guifg=      guibg=
+"hi Scrollbar   cterm=      ctermfg=    ctermbg=    gui=        guifg=      guibg=
+"hi Tooltip cterm=      ctermfg=    ctermbg=    gui=        guifg=      guibg=
+
+"hi MBENormal   cterm=      ctermfg=    ctermbg=    gui=        guifg=      guibg=
+"hi MBEChanged  cterm=      ctermfg=    ctermbg=    gui=        guifg=      guibg=
+"hi MBEVisibleNormal cterm= ctermfg=    ctermbg=    gui=        guifg=      guibg=
+"hi MBEVisibleChanged cterm=    ctermfg=    ctermbg=    gui=        guifg=      guibg=
+
+"hi DiffText    cterm=bold  ctermfg=fg  ctermbg=20  gui=bold    guifg=fg    guibg=#0000df
+"hi DiffDelete  cterm=none  ctermfg=fg  ctermbg=88  gui=none    guifg=fg    guibg=#870000
+"hi DiffChange  cterm=none  ctermfg=fg  ctermbg=18  gui=none    guifg=fg    guibg=#000087
+"hi DiffAdd cterm=none  ctermfg=fg  ctermbg=28  gui=none    guifg=fg    guibg=#008700
+
+hi Folded   cterm=none  ctermfg=255 ctermbg=60  gui=none    guifg=#eeeeee   guibg=#5f5f87
+"hi Folded  cterm=none  ctermfg=251 ctermbg=240 gui=bold    guifg=#c6c6c6   guibg=#585858
+"hi Folded  cterm=none  ctermfg=251 ctermbg=95  gui=none    guifg=#c6c6c6   guibg=#585858
+hi FoldColumn   cterm=none  ctermfg=248 ctermbg=58  gui=none    guifg=#a8a8a8   guibg=bg
+hi SignColumn   cterm=none  ctermfg=248 ctermbg=bg  gui=none    guifg=#a8a8a8   guibg=bg
+
+hi Directory    cterm=none  ctermfg=39  ctermbg=bg  gui=none    guifg=#00afff   guibg=bg
+hi LineNr   cterm=none  ctermfg=248         gui=none    guifg=#a8a8a8
+hi NonText  cterm=bold  ctermfg=248 ctermbg=bg  gui=bold    guifg=#a8a8a8   guibg=bg
+hi SpecialKey   cterm=none  ctermfg=77  ctermbg=bg  gui=none    guifg=#5fdf5f   guibg=bg
+hi Title    cterm=none  ctermfg=0   ctermbg=184 gui=none    guifg=#000000   guibg=#dfdf00
+hi Visual   cterm=none  ctermfg=24  ctermbg=153 gui=none    guifg=#005f87   guibg=#afdfff
+"hi Visual  cterm=none  ctermfg=18  ctermbg=153 gui=none    guifg=#005f87   guibg=#afdfff
+hi VisualNOS    cterm=bold,underline ctermfg=247 ctermbg=bg gui=bold,underline guifg=#9e9e9e guibg=bg
+
+hi Comment  cterm=none  ctermfg=244 ctermbg=bg  gui=none    guifg=#808080   guibg=bg
+""" COLD
+hi Constant cterm=none  ctermfg=187 ctermbg=bg  gui=none    guifg=#dfdfaf   guibg=bg
+""" COLD-DARK
+"hi Constant    cterm=none  ctermfg=223 ctermbg=bg  gui=none    guifg=#ffdfaf   guibg=bg
+""" NEUTRAL
+"hi Constant    cterm=none  ctermfg=229 ctermbg=bg  gui=none    guifg=#ffffaf   guibg=bg
+""" WARM
+"hi Constant    cterm=none  ctermfg=222 ctermbg=bg  gui=none    guifg=#ffdf87   guibg=bg
+"hi String  cterm=      ctermfg=    ctermbg=    gui=        guifg=      guibg=
+hi Error    cterm=none  ctermfg=196 ctermbg=bg  gui=none    guifg=#ff0000   guibg=bg
+""" COLD
+"hi Identifier  cterm=none  ctermfg=115 ctermbg=bg  gui=none    guifg=#87dfaf   guibg=bg
+""" NEUTRAL
+"hi Identifier  cterm=none  ctermfg=114 ctermbg=bg  gui=none    guifg=#87df87   guibg=bg
+""" WARM
+hi Identifier   cterm=none  ctermfg=150 ctermbg=bg  gui=none    guifg=#afdf87   guibg=bg
+hi Ignore   cterm=none  ctermfg=238 ctermbg=bg  gui=none    guifg=#444444   guibg=bg
+hi Number   cterm=none  ctermfg=180 ctermbg=bg  gui=none    guifg=#dfaf87   guibg=bg
+"hi Number  cterm=none  ctermfg=222 ctermbg=bg  gui=none    guifg=#ffaf87   guibg=bg
+"hi Number  cterm=none  ctermfg=215 ctermbg=bg  gui=none    guifg=#ffaf87   guibg=bg
+"hi Number  cterm=none  ctermfg=209 ctermbg=0   gui=none    guifg=#ff875f   guibg=#000000
+"hi Number  cterm=none  ctermfg=210 ctermbg=0   gui=none    guifg=#ff8787   guibg=#000000
+hi PreProc  cterm=none  ctermfg=182 ctermbg=bg  gui=none    guifg=#dfafdf   guibg=bg
+"hi PreProc cterm=none  ctermfg=218 ctermbg=bg  gui=none    guifg=#ffafdf   guibg=bg
+""" LIGHT
+"hi Special cterm=none  ctermfg=174 ctermbg=bg  gui=none    guifg=#ffafaf   guibg=bg
+""" DARK
+hi Special  cterm=none  ctermfg=174 ctermbg=bg  gui=none    guifg=#df8787   guibg=bg
+"hi Special cterm=none  ctermfg=114 ctermbg=bg  gui=none    guifg=#87df87   guibg=bg
+"hi SpecialChar cterm=      ctermfg=    ctermbg=    gui=        guifg=      guibg=
+hi Statement    cterm=none  ctermfg=74  ctermbg=bg  gui=none    guifg=#5fafdf   guibg=bg
+"hi Statement   cterm=none  ctermfg=75  ctermbg=bg  gui=none    guifg=#5fafff   guibg=bg
+hi Todo     cterm=none  ctermfg=0   ctermbg=184 gui=none    guifg=#000000   guibg=#dfdf00
+"hi Type        cterm=none  ctermfg=153 ctermbg=bg  gui=none    guifg=#afdfff   guibg=bg
+hi Type     cterm=none  ctermfg=146 ctermbg=bg  gui=none    guifg=#afafdf   guibg=bg
+hi Underlined   cterm=underline ctermfg=39  ctermbg=bg  gui=underline   guifg=#00afff   guibg=bg
+
+"hi htmlBold    cterm=      ctermbg=0   ctermfg=15  guibg=bg    guifg=fg    gui=bold
+"hi htmlBoldItalic cterm=   ctermbg=0   ctermfg=15  guibg=bg    guifg=fg    gui=bold,italic
+"hi htmlBoldUnderline cterm=    ctermbg=0   ctermfg=15  guibg=bg    guifg=fg    gui=bold,underline
+"hi htmlBoldUnderlineItalic cterm= ctermbg=0    ctermfg=15  guibg=bg    guifg=fg    gui=bold,underline,italic
+"hi htmlItalic  cterm=      ctermbg=0   ctermfg=15  guibg=bg    guifg=fg    gui=italic
+"hi htmlUnderline cterm=    ctermbg=0   ctermfg=15  guibg=bg    guifg=fg    gui=underline
+"hi htmlUnderlineItalici cterm= ctermbg=0   ctermfg=15  guibg=bg    guifg=fg    gui=underline,italic
+
+
+" For taglist plugin
+if exists('loaded_taglist')
+  hi TagListTagName  cterm=none ctermfg=16  ctermbg=28  gui=none    guifg=#000000   guibg=#008700
+  hi TagListTagScope cterm=none ctermfg=16  ctermbg=28  gui=none    guifg=#000000   guibg=#008700
+  hi TagListTitle    cterm=none ctermfg=199 ctermbg=16  gui=none    guifg=#ff00af   guibg=#000000
+  hi TagListComment  cterm=none ctermfg=16  ctermbg=28  gui=none    guifg=#000000   guibg=#008700
+  hi TagListFileName cterm=none ctermfg=15  ctermbg=90  gui=none    guifg=#ffffff   guibg=#870087
+endif
+
+
+" For features in vim v.7.0 and higher
+if v:version >= 700
+  hi Pmenu      cterm=none  ctermfg=0   ctermbg=246 gui=none    guifg=#000000   guibg=#949494
+  hi PmenuSel   cterm=none  ctermfg=0   ctermbg=243 gui=none    guifg=#000000   guibg=#767676
+  hi PmenuSbar  cterm=none  ctermfg=fg  ctermbg=243 gui=none    guifg=fg    guibg=#767676
+  hi PmenuThumb cterm=none  ctermfg=bg  ctermbg=252 gui=none    guifg=bg    guibg=#d0d0d0
+  
+  "  if has("spell")
+  "     hi SpellBad guisp=#ee2c2c   gui=undercurl
+  "     hi SpellCap guisp=#2c2cee   gui=undercurl
+  "     hi SpellLocal   guisp=#2ceeee   gui=undercurl
+  "     hi SpellRare    guisp=#ee2cee   gui=undercurl
+  "  endif
+  
+  hi MatchParen cterm=none  ctermfg=188 ctermbg=68  gui=bold    guifg=#dfdfdf   guibg=#5f87df
+  "hi MatchParen    cterm=none  ctermfg=24  ctermbg=153 gui=none    guifg=#005f87   guibg=#afdfff
+  "hi MatchParen    cterm=none  ctermfg=117 ctermbg=31  gui=bold    guifg=#87dfff   guibg=#0087af
+  "hi MatchParen    cterm=none  ctermfg=187 ctermbg=67  gui=none    guifg=#005f87   guibg=#afdfff
+
+  hi TabLineSel cterm=bold  ctermfg=fg  ctermbg=bg  gui=bold    guifg=fg    guibg=bg
+  hi TabLine    cterm=underline ctermfg=fg  ctermbg=242 gui=underline   guifg=fg    guibg=#666666
+  hi TabLineFill cterm=underline ctermfg=fg ctermbg=242 gui=underline   guifg=fg    guibg=#666666
+endif
diff --git a/vim/colors/zenburn.vim b/vim/colors/zenburn.vim
new file mode 100644 (file)
index 0000000..edbd6d7
--- /dev/null
@@ -0,0 +1,351 @@
+" Vim color file
+" Maintainer:   Jani Nurminen <slinky@iki.fi>
+" Last Change:  $Id: zenburn.vim,v 2.13 2009/10/24 10:16:01 slinky Exp $
+" URL:         http://slinky.imukuppi.org/zenburnpage/
+" License:      GPL
+"
+" Nothing too fancy, just some alien fruit salad to keep you in the zone.
+" This syntax file was designed to be used with dark environments and 
+" low light situations. Of course, if it works during a daybright office, go
+" ahead :)
+"
+" Owes heavily to other Vim color files! With special mentions
+" to "BlackDust", "Camo" and "Desert".
+"
+" To install, copy to ~/.vim/colors directory.
+"
+" Alternatively, you can use Vimball installation:
+"     vim zenburn.vba
+"     :so %
+"     :q
+"
+" For details, see :help vimball
+"
+" After installation, use it with :colorscheme zenburn.
+" See also :help syntax
+"
+" Credits:
+"  - Jani Nurminen - original Zenburn
+"  - Steve Hall & Cream posse - higher-contrast Visual selection
+"  - Kurt Maier - 256 color console coloring, low and high contrast toggle,
+"                 bug fixing
+"  - Charlie - spotted too bright StatusLine in non-high contrast mode
+"  - Pablo Castellazzi - CursorLine fix for 256 color mode
+"  - Tim Smith - force dark background
+"  - John Gabriele - spotted bad Ignore-group handling
+"  - Zac Thompson - spotted invisible NonText in low contrast mode
+"  - Christophe-Marie Duquesne - suggested making a Vimball
+"
+" CONFIGURABLE PARAMETERS:
+"
+" You can use the default (don't set any parameters), or you can
+" set some parameters to tweak the Zenburn colours.
+"
+" To use them, put them into your .vimrc file before loading the color scheme,
+" example:
+"    let g:zenburn_high_Contrast=1
+"    colors zenburn
+"
+" * You can now set a darker background for bright environments. To activate, use:
+"   contrast Zenburn, use:
+"
+"      let g:zenburn_high_Contrast = 1
+"
+" * For example, Vim help files uses the Ignore-group for the pipes in tags 
+"   like "|somelink.txt|". By default, the pipes are not visible, as they
+"   map to Ignore group. If you wish to enable coloring of the Ignore group,
+"   set the following parameter to 1. Warning, it might make some syntax files
+"   look strange.
+"
+"      let g:zenburn_color_also_Ignore = 1
+"
+" * To get more contrast to the Visual selection, use
+"
+"      let g:zenburn_alternate_Visual = 1
+"
+" * To use alternate colouring for Error message, use
+"
+"      let g:zenburn_alternate_Error = 1
+"
+" * The new default for Include is a duller orange. To use the original
+"   colouring for Include, use
+"
+"      let g:zenburn_alternate_Include = 1
+"
+" * Work-around to a Vim bug, it seems to misinterpret ctermfg and 234 and 237
+"   as light values, and sets background to light for some people. If you have
+"   this problem, use:
+"
+"      let g:zenburn_force_dark_Background = 1
+"
+" NOTE:
+"
+" * To turn the parameter(s) back to defaults, use UNLET:
+"
+"      unlet g:zenburn_alternate_Include
+"
+"   Setting to 0 won't work!
+"
+" That's it, enjoy!
+"
+" TODO
+"   - Visual alternate color is broken? Try GVim >= 7.0.66 if you have trouble
+"   - IME colouring (CursorIM)
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+let g:colors_name="zenburn"
+
+hi Boolean         guifg=#dca3a3
+hi Character       guifg=#dca3a3 gui=bold
+hi Comment         guifg=#7f9f7f gui=italic
+hi Conditional     guifg=#f0dfaf gui=bold
+hi Constant        guifg=#dca3a3 gui=bold
+hi Cursor          guifg=#000d18 guibg=#8faf9f gui=bold
+hi Debug           guifg=#bca3a3 gui=bold
+hi Define          guifg=#ffcfaf gui=bold
+hi Delimiter       guifg=#8f8f8f
+hi DiffAdd         guifg=#709080 guibg=#313c36 gui=bold
+hi DiffChange      guibg=#333333
+hi DiffDelete      guifg=#333333 guibg=#464646
+hi DiffText        guifg=#ecbcbc guibg=#41363c gui=bold
+hi Directory       guifg=#dcdccc gui=bold
+hi ErrorMsg        guifg=#80d4aa guibg=#2f2f2f gui=bold
+hi Exception       guifg=#c3bf9f gui=bold
+hi Float           guifg=#c0bed1
+hi FoldColumn      guifg=#93b3a3 guibg=#3f4040
+hi Folded          guifg=#93b3a3 guibg=#3f4040
+hi Function        guifg=#efef8f
+hi Identifier      guifg=#efdcbc
+hi IncSearch       guibg=#f8f893 guifg=#385f38
+hi Keyword         guifg=#f0dfaf gui=bold
+hi Label           guifg=#dfcfaf gui=underline
+hi LineNr          guifg=#9fafaf guibg=#262626
+hi Macro           guifg=#ffcfaf gui=bold
+hi ModeMsg         guifg=#ffcfaf gui=none
+hi MoreMsg         guifg=#ffffff gui=bold
+hi Number          guifg=#8cd0d3
+hi Operator        guifg=#f0efd0
+hi PreCondit       guifg=#dfaf8f gui=bold
+hi PreProc         guifg=#ffcfaf gui=bold
+hi Question        guifg=#ffffff gui=bold
+hi Repeat          guifg=#ffd7a7 gui=bold
+hi Search          guifg=#ffffe0 guibg=#284f28
+hi SpecialChar     guifg=#dca3a3 gui=bold
+hi SpecialComment  guifg=#82a282 gui=bold
+hi Special         guifg=#cfbfaf
+hi SpecialKey      guifg=#9ece9e
+hi Statement       guifg=#e3ceab gui=none
+hi StatusLine      guifg=#313633 guibg=#ccdc90
+hi StatusLineNC    guifg=#2e3330 guibg=#88b090
+hi StorageClass    guifg=#c3bf9f gui=bold
+hi String          guifg=#cc9393
+hi Structure       guifg=#efefaf gui=bold
+hi Tag             guifg=#e89393 gui=bold
+hi Title           guifg=#efefef gui=bold
+hi Todo            guifg=#dfdfdf guibg=bg gui=bold
+hi Typedef         guifg=#dfe4cf gui=bold
+hi Type            guifg=#dfdfbf gui=bold
+hi Underlined      guifg=#dcdccc gui=underline
+hi VertSplit       guifg=#2e3330 guibg=#688060
+hi VisualNOS       guifg=#333333 guibg=#f18c96 gui=bold,underline
+hi WarningMsg      guifg=#ffffff guibg=#333333 gui=bold
+hi WildMenu        guibg=#2c302d guifg=#cbecd0 gui=underline
+
+hi SpellBad   guisp=#bc6c4c guifg=#dc8c6c
+hi SpellCap   guisp=#6c6c9c guifg=#8c8cbc
+hi SpellRare  guisp=#bc6c9c guifg=#bc8cbc
+hi SpellLocal guisp=#7cac7c guifg=#9ccc9c
+
+" Entering Kurt zone
+if &t_Co > 255
+    hi Boolean         ctermfg=181
+    hi Character       ctermfg=181   cterm=bold
+    hi Comment         ctermfg=108
+    hi Conditional     ctermfg=223   cterm=bold
+    hi Constant        ctermfg=181   cterm=bold
+    hi Cursor          ctermfg=233   ctermbg=109     cterm=bold
+    hi Debug           ctermfg=181   cterm=bold
+    hi Define          ctermfg=223   cterm=bold
+    hi Delimiter       ctermfg=245
+    hi DiffAdd         ctermfg=66    ctermbg=237     cterm=bold
+    hi DiffChange      ctermbg=236
+    hi DiffDelete      ctermfg=236   ctermbg=238
+    hi DiffText        ctermfg=217   ctermbg=237     cterm=bold
+    hi Directory       ctermfg=188   cterm=bold
+    hi ErrorMsg        ctermfg=115   ctermbg=236     cterm=bold
+    hi Exception       ctermfg=249   cterm=bold
+    hi Float           ctermfg=251
+    hi FoldColumn      ctermfg=109   ctermbg=238
+    hi Folded          ctermfg=109   ctermbg=238
+    hi Function        ctermfg=228
+    hi Identifier      ctermfg=223
+    hi IncSearch       ctermbg=228   ctermfg=238
+    hi Keyword         ctermfg=223   cterm=bold
+    hi Label           ctermfg=187   cterm=underline
+    hi LineNr          ctermfg=248   ctermbg=235
+    hi Macro           ctermfg=223   cterm=bold
+    hi ModeMsg         ctermfg=223   cterm=none
+    hi MoreMsg         ctermfg=15    cterm=bold
+    hi Number          ctermfg=116
+    hi Operator        ctermfg=230
+    hi PreCondit       ctermfg=180   cterm=bold
+    hi PreProc         ctermfg=223   cterm=bold
+    hi Question        ctermfg=15    cterm=bold
+    hi Repeat          ctermfg=223   cterm=bold
+    hi Search          ctermfg=230   ctermbg=236
+    hi SpecialChar     ctermfg=181   cterm=bold
+    hi SpecialComment  ctermfg=108   cterm=bold
+    hi Special         ctermfg=181
+    hi SpecialKey      ctermfg=151
+    hi Statement       ctermfg=187   ctermbg=234     cterm=none
+    hi StatusLine      ctermfg=236   ctermbg=186
+    hi StatusLineNC    ctermfg=235   ctermbg=108
+    hi StorageClass    ctermfg=249   cterm=bold
+    hi String          ctermfg=174
+    hi Structure       ctermfg=229   cterm=bold
+    hi Tag             ctermfg=181   cterm=bold
+    hi Title           ctermfg=7     ctermbg=234     cterm=bold
+    hi Todo            ctermfg=108   ctermbg=234     cterm=bold
+    hi Typedef         ctermfg=253   cterm=bold
+    hi Type            ctermfg=187   cterm=bold
+    hi Underlined      ctermfg=188   ctermbg=234     cterm=bold
+    hi VertSplit       ctermfg=236   ctermbg=65
+    hi VisualNOS       ctermfg=236   ctermbg=210     cterm=bold
+    hi WarningMsg      ctermfg=15    ctermbg=236     cterm=bold
+    hi WildMenu        ctermbg=236   ctermfg=194     cterm=bold
+    hi CursorLine      ctermbg=236   cterm=none
+
+    " spellchecking, always "bright" background
+    hi SpellLocal ctermfg=14  ctermbg=237
+    hi SpellBad   ctermfg=9   ctermbg=237
+    hi SpellCap   ctermfg=12  ctermbg=237
+    hi SpellRare  ctermfg=13  ctermbg=237
+
+    " pmenu
+    hi PMenu      ctermfg=248  ctermbg=0
+    hi PMenuSel   ctermfg=223 ctermbg=235
+
+    if exists("g:zenburn_high_Contrast")
+        hi Normal ctermfg=188 ctermbg=234
+        hi NonText         ctermfg=238
+
+        if exists("g:zenburn_color_also_Ignore")
+            hi Ignore          ctermfg=238
+        endif
+    else
+        hi Normal ctermfg=188 ctermbg=237
+        hi Cursor          ctermbg=109
+        hi diffadd         ctermbg=237
+        hi diffdelete      ctermbg=238
+        hi difftext        ctermbg=237
+        hi errormsg        ctermbg=237
+        hi foldcolumn      ctermbg=238
+        hi folded          ctermbg=238
+        hi incsearch       ctermbg=228
+        hi linenr          ctermbg=238
+        hi search          ctermbg=238
+        hi statement       ctermbg=237
+        hi statusline      ctermbg=144
+        hi statuslinenc    ctermbg=108
+        hi title           ctermbg=237
+        hi todo            ctermbg=237
+        hi underlined      ctermbg=237
+        hi vertsplit       ctermbg=65
+        hi visualnos       ctermbg=210
+        hi warningmsg      ctermbg=236
+        hi wildmenu        ctermbg=236
+        hi NonText         ctermfg=240
+        
+        if exists("g:zenburn_color_also_Ignore")
+            hi Ignore          ctermfg=240
+        endif
+    endif
+
+    if exists("g:zenburn_alternate_Error")
+        " use more jumpy Error
+        hi Error ctermfg=210 ctermbg=52 gui=bold
+    else
+        " default is something more zenburn-compatible
+        hi Error ctermfg=228 ctermbg=95 gui=bold
+    endif
+endif
+
+if exists("g:zenburn_force_dark_Background")
+    " Force dark background, because of a bug in VIM:  VIM sets background
+    " automatically during "hi Normal ctermfg=X"; it misinterprets the high
+    " value (234 or 237 above) as a light color, and wrongly sets background to
+    " light.  See ":help highlight" for details.
+    set background=dark
+endif
+
+if exists("g:zenburn_high_Contrast")
+    " use new darker background
+    hi Normal          guifg=#dcdccc guibg=#1f1f1f
+    hi CursorLine      guibg=#121212 gui=bold
+    hi Pmenu           guibg=#242424 guifg=#ccccbc
+    hi PMenuSel        guibg=#353a37 guifg=#ccdc90 gui=bold
+    hi PmenuSbar       guibg=#2e3330 guifg=#000000
+    hi PMenuThumb      guibg=#a0afa0 guifg=#040404
+    hi MatchParen      guifg=#f0f0c0 guibg=#383838 gui=bold
+    hi SignColumn      guifg=#9fafaf guibg=#181818 gui=bold
+    hi TabLineFill     guifg=#cfcfaf guibg=#181818 gui=bold
+    hi TabLineSel      guifg=#efefef guibg=#1c1c1b gui=bold
+    hi TabLine         guifg=#b6bf98 guibg=#181818 gui=bold
+    hi CursorColumn    guifg=#dcdccc guibg=#2b2b2b
+    hi NonText         guifg=#404040 gui=bold
+else
+    " Original, lighter background
+    hi Normal          guifg=#dcdccc guibg=#3f3f3f
+    hi CursorLine      guibg=#434443
+    hi Pmenu           guibg=#2c2e2e guifg=#9f9f9f
+    hi PMenuSel        guibg=#242424 guifg=#d0d0a0 gui=bold
+    hi PmenuSbar       guibg=#2e3330 guifg=#000000
+    hi PMenuThumb      guibg=#a0afa0 guifg=#040404
+    hi MatchParen      guifg=#b2b2a0 guibg=#2e2e2e gui=bold
+    hi SignColumn      guifg=#9fafaf guibg=#343434 gui=bold
+    hi TabLineFill     guifg=#cfcfaf guibg=#353535 gui=bold
+    hi TabLineSel      guifg=#efefef guibg=#3a3a39 gui=bold
+    hi TabLine         guifg=#b6bf98 guibg=#353535 gui=bold
+    hi CursorColumn    guifg=#dcdccc guibg=#4f4f4f
+    hi NonText         guifg=#5b605e gui=bold
+endif
+
+
+if exists("g:zenburn_alternate_Visual")
+    " Visual with more contrast, thanks to Steve Hall & Cream posse
+    " gui=none fixes weird highlight problem in at least GVim 7.0.66, thanks to Kurt Maier
+    hi Visual          guifg=#000000 guibg=#71d3b4 gui=none
+    hi VisualNOS       guifg=#000000 guibg=#71d3b4 gui=none
+else
+    " use default visual
+    hi Visual          guifg=#233323 guibg=#71d3b4 gui=none
+    hi VisualNOS       guifg=#233323 guibg=#71d3b4 gui=none
+endif
+
+if exists("g:zenburn_alternate_Error")
+    " use more jumpy Error
+    hi Error        guifg=#e37170 guibg=#664040 gui=bold
+else
+    " default is something more zenburn-compatible
+    hi Error        guifg=#e37170 guibg=#3d3535 gui=none
+endif
+
+if exists("g:zenburn_alternate_Include")
+    " original setting
+    hi Include      guifg=#ffcfaf gui=bold
+else
+    " new, less contrasted one
+    hi Include      guifg=#dfaf8f gui=bold
+endif
+
+if exists("g:zenburn_color_also_Ignore")
+    " color the Ignore groups
+    " note: if you get strange coloring for your files, turn this off (unlet)
+    hi Ignore guifg=#545a4f
+endif
+
+" TODO check for more obscure syntax groups that they're ok
diff --git a/vim/colors/zmrok.vim b/vim/colors/zmrok.vim
new file mode 100644 (file)
index 0000000..122b051
--- /dev/null
@@ -0,0 +1,59 @@
+" Maintainer: Krzysztof Goj <Krzysztof-dot-Goj-at-gmail-dot-com>
+" Last Change: 27th March 2009
+
+set background=dark
+hi clear
+if exists("syntax_on")
+    syntax reset
+endif
+
+let g:colors_name="zmrok"
+
+" general colors
+hi Normal         guifg=#F8F8F8    guibg=#141414
+hi Cursor         guifg=Black      guibg=Green    gui=none
+hi LineNr         guifg=#777777    guibg=Black
+hi NonText               guifg=#808080    guibg=#202020
+
+hi StatusLine  guifg=#F8F8F8 guibg=#202020 gui=bold
+hi StatusLineNC guifg=#777777 guibg=#202020 gui=none
+hi VertSplit   guifg=#202020 guibg=#202020 gui=none
+
+" Vim >= 7.0 specific colors
+if version >= 700
+    hi CursorLine     guibg=#0d0d0d
+    hi CursorColumn   guibg=#0d0d0d
+    hi MatchParen     guifg=Black      guibg=#FFCC20 gui=bold
+
+    hi Pmenu          guifg=#141414    guibg=#CDA869
+    hi PmenuSel       guifg=#F8F8F8    guibg=#9B703F
+    hi PmenuSbar                       guibg=#DAEFA3
+    hi PmenuThumb     guifg=#8F9D6A
+endif
+
+"Syntax hilighting
+
+hi Comment        guifg=#888888
+hi Error          guifg=red        guibg=#141414
+hi Todo           guifg=red        guibg=#141414      gui=bold
+
+hi Constant       guifg=#CF593C
+hi Exception      guifg=#CF593C
+hi Operator       guifg=#DFCC77
+
+hi Special        guifg=orange
+hi SpecialChar    guifg=orange
+hi String         guifg=#D9FF77
+hi Character      guifg=#FFCE43
+hi Number         guifg=#FACE43
+
+hi Statement      guifg=#A56A30    gui=bold
+hi Keyword        guifg=#A56A30    gui=bold
+hi Label          guifg=#A56A30    gui=bold
+
+hi Identifier     guifg=#C7CA87     gui=none
+hi Type           guifg=#C7CA87     gui=none
+hi Function       guifg=#C7CA87     gui=none
+hi StorageClass   guifg=#C7CA87     gui=none
+
+hi PreProc        guifg=khaki4
diff --git a/vim/doc/.DS_Store b/vim/doc/.DS_Store
new file mode 100644 (file)
index 0000000..5008ddf
Binary files /dev/null and b/vim/doc/.DS_Store differ
diff --git a/vim/doc/Align.txt b/vim/doc/Align.txt
new file mode 100644 (file)
index 0000000..c447372
--- /dev/null
@@ -0,0 +1,1469 @@
+*align.txt*    The Alignment Tool                      Mar 04, 2009
+
+Author:    Charles E. Campbell, Jr.  <NdrOchip@ScampbellPfamily.AbizM>
+           (remove NOSPAM from Campbell's email first)
+Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.   *Align-copyright*
+           The VIM LICENSE applies to Align.vim, AlignMaps.vim, and Align.txt
+           (see |copyright|) except use "Align and AlignMaps" instead of "Vim"
+           NO WARRANTY, EXPRESS OR IMPLIED.  USE AT-YOUR-OWN-RISK.
+
+==============================================================================
+1. Contents                                    *align* *align-contents* {{{1
+
+       1. Contents.................: |align-contents|
+       2. Alignment Manual.........: |align-manual|
+       3. Alignment Usage..........: |align-usage|
+          Alignment Concepts.......: |align-concepts|
+          Alignment Commands.......: |align-commands|
+          Alignment Control........: |align-control|
+            Separators.............: |alignctrl-separators|
+            Initial Whitespace.....: |alignctrl-w| |alignctrl-W| |alignctrl-I|
+            Justification..........: |alignctrl-l| |alignctrl-r| |alignctrl-c|
+            Justification Control..: |alignctrl--| |alignctrl-+| |alignctrl-:|
+            Cyclic/Sequential......: |alignctrl-=| |alignctrl-C|
+            Separator Justification: |alignctrl-<| |alignctrl->| |alignctrl-||
+            Line (de)Selection.....: |alignctrl-g| |alignctrl-v|
+            Temporary Settings.....: |alignctrl-m|
+            Padding................: |alignctrl-p| |alignctrl-P|
+            Current Options........: |alignctrl-settings| |alignctrl-|
+          Alignment................: |align-align|
+       4. Alignment Maps...........: |align-maps|
+            \a,....................: |alignmap-a,|
+            \a?....................: |alignmap-a?|
+            \a<....................: |alignmap-a<|
+            \abox..................: |alignmap-abox|
+            \acom..................: |alignmap-acom|
+            \anum..................: |alignmap-anum|
+            \ascom.................: |alignmap-ascom|
+            \adec..................: |alignmap-adec|
+            \adef..................: |alignmap-adef|
+            \afnc..................: |alignmap-afnc|
+            \adcom.................: |alignmap-adcom|
+            \aocom.................: |alignmap-aocom|
+            \tsp...................: |alignmap-tsp|
+            \tsq...................: |alignmap-tsq|
+            \tt....................: |alignmap-tt|
+            \t=....................: |alignmap-t=|
+            \T=....................: |alignmap-T=|
+            \Htd...................: |alignmap-Htd|
+       5. Alignment Tool History...: |align-history|
+
+==============================================================================
+2. Align Manual                        *alignman* *alignmanual* *align-manual* {{{1
+
+       Align comes as a vimball; simply typing >
+               vim Align.vba.gz
+               :so %
+<      should put its components where they belong.  The components are: >
+               .vim/plugin/AlignPlugin.vim
+               .vim/plugin/AlignMapsPlugin.vim
+               .vim/plugin/cecutil.vim
+               .vim/autoload/Align.vim
+               .vim/autoload/AlignMaps.vim
+               .vim/doc/Align.txt
+<      To see a user's guide, see |align-userguide|
+       To see examples, see |alignctrl| and |alignmaps|
+>
+/=============+=========+=====================================================\
+||            \ Default/                                                     ||
+||  Commands   \ Value/                Explanation                           ||
+||              |    |                                                       ||
+++==============+====+=======================================================++
+||  AlignCtrl   |    |  =Clrc-+:pPIWw [..list-of-separator-patterns..]       ||
+||              |    +-------------------------------------------------------+|
+||              |    |  may be called as a command or as a function:         ||
+||              |    |  :AlignCtrl =lp0P0W & \\                              ||
+||              |    |  :call Align#AlignCtrl('=lp0P0W','&','\\')            ||
+||              |    |                                                       ||
+||              |    +-------------------------------------------------------++
+||   1st arg    |  = | =  all separator patterns are equivalent and are      ||
+||              |    |    simultaneously active. Patterns are |regexp|.      ||
+||              |    | C  cycle through separator patterns.  Patterns are    ||
+||              |    |    |regexp| and are active sequentially.              ||
+||              |    |                                                       ||
+||              |  < | <  left justify separator   Separators are justified, ||
+||              |    | >  right justify separator  too.  Separator styles    ||
+||              |    | |  center separator         are cyclic.               ||
+||              |    |                                                       ||
+||              |  l | l  left justify   Justification styles are always     ||
+||              |    | r  right justify  cyclic (ie. lrc would mean left j., ||
+||              |    | c  center         then right j., then center, repeat. ||
+||              |    | -  skip this separator                                ||
+||              |    | +  re-use last justification method                   ||
+||              |    | :  treat rest of text as a field                      ||
+||              |    |                                                       ||
+||              | p1 | p### pad separator on left  by # blanks               ||
+||              | P1 | P### pad separator on right by # blanks               ||
+||              |    |                                                       ||
+||              |  I | I  preserve and apply first line's leading white      ||
+||              |    |    space to all lines                                 ||
+||              |    | W  preserve leading white space on every line, even   ||
+||              |    |    if it varies from line to line                     ||
+||              |    | w  don't preserve leading white space                 ||
+||              |    |                                                       ||
+||              |    | g  second argument is a selection pattern -- only     ||
+||              |    |    align on lines that have a match  (inspired by     ||
+||              |    |    :g/selection pattern/command)                      ||
+||              |    | v  second argument is a selection pattern -- only     ||
+||              |    |    align on lines that _don't_ have a match (inspired ||
+||              |    |    by :v/selection pattern/command)                   ||
+||              |    |                                                       ||
+||              |    | m  Map support: AlignCtrl will immediately do an      ||
+||              |    |    AlignPush() and the next call to Align() will do   ||
+||              |    |    an AlignPop at the end.  This feature allows maps  ||
+||              |    |    to preserve user settings.                         ||
+||              |    |                                                       ||
+||              |    | default                                               ||
+||              |    |    AlignCtrl default                                  ||
+||              |    |    will clear the AlignCtrl                           ||
+||              |    |    stack & set the default:  AlignCtrl "Ilp1P1=" '='  ||
+||              |    |                                                       ||
+||              +----+-------------------------------------------------------+|
+||  More args   |  More arguments are interpreted as describing separators   ||
+||              +------------------------------------------------------------+|
+||   No args    |  AlignCtrl will display its current settings               ||
+||==============+============================================================+|
+||[range]Align  |   [..list-of-separators..]                                 ||
+||[range]Align! |   [AlignCtrl settings] [..list-of-separators..]            ||
+||              +------------------------------------------------------------+|
+||              |  Aligns text over the given range.  The range may be       ||
+||              |  selected via visual mode (v, V, or ctrl-v) or via         ||
+||              |  the command line.  The Align operation may be invoked     ||
+||              |  as a command or as a function; as a function, the first   ||
+||              |  argument is 0=separators only, 1=AlignCtrl option string  ||
+||              |  followed by a list of separators.                         ||
+||              |   :[range]Align                                            ||
+||              |   :[range]Align [list of separators]                       ||
+||              |   :[range]call Align#Align(0)                              ||
+||              |   :[range]call Align#Align(0,"list","of","separators",...) ||
+\=============================================================================/
+
+==============================================================================
+3. Alignment Usage     *alignusage* *align-usage* *align-userguide* {{{1
+
+
+ALIGNMENT CONCEPTS                     *align-concept* *align-concepts* {{{2
+
+       The typical text to be aligned is considered to be:
+
+               * composed of two or more fields
+               * separated by one or more separator pattern(s):
+               * two or more lines
+>
+               ws field ws separator ws field ws separator ...
+               ws field ws separator ws field ws separator ...
+<
+       where "ws" stands for "white space" such as blanks and/or tabs,
+       and "fields" are arbitrary text.  For example, consider >
+
+               x= y= z= 3;
+               xx= yy= zz= 4;
+               zzz= yyy= zzz= 5;
+               a= b= c= 3;
+<
+       Assume that it is desired to line up all the "=" signs; these,
+       then, are the separators.  The fields are composed of all the
+       alphameric text.  Assuming they lie on lines 1-4, one may align
+       those "=" signs with: >
+               :AlignCtrl l
+               :1,4Align =
+<      The result is: >
+               x   = y   = z   = 3;
+               xx  = yy  = zz  = 4;
+               zzz = yyy = zzz = 5;
+               a   = b   = c   = 3;
+
+<      Note how each "=" sign is surrounded by a single space; the
+       default padding is p1P1 (p1 means one space before the separator,
+       and P1 means one space after it).  If you wish to change the
+       padding, say to no padding, use  (see |alignctrl-p|) >
+               :AlignCtrl lp0P0
+
+<      Next, note how each field is left justified; that's what the "l"
+       (a small letter "ell") does.  If right-justification of the fields
+       had been desired, an "r" could've been used: >
+               :AlignCtrl r
+<      yielding >
+                 x =   y =   z = 3;
+                xx =  yy =  zz = 4;
+               zzz = yyy = zzz = 5;
+                 a =   b =   c = 3;
+<      There are many more options available for field justification: see
+       |alignctrl-c| and |alignctrl--|.
+
+       Separators, although commonly only one character long, are actually
+       specified by regular expressions (see |regexp|), and one may left
+       justify, right justify, or center them, too (see |alignctrl-<|).
+
+       Assume that for some reason a left-right-left-right-... justification
+       sequence was wished.  This wish is simply achieved with >
+               :AlignCtrl lr
+               :1,4Align =
+<      because the justification commands are considered to be "cylic"; ie.
+       lr is the same as lrlrlrlrlrlrlr...
+
+       There's a lot more discussed under |alignctrl|; hopefully the examples
+       there will help, too.
+
+
+ALIGNMENT COMMANDS                     *align-command* *align-commands* {{{2
+
+        The <Align.vim> script includes two primary commands and two
+       minor commands:
+
+         AlignCtrl : this command/function sets up alignment options
+                     which persist until changed for later Align calls.
+                     It controls such things as: how to specify field
+                     separators, initial white space, padding about
+                     separators, left/right/center justification, etc. >
+                       ex.  AlignCtrl wp0P1
+                             Interpretation: during subsequent alignment
+                            operations, preserve each line's initial
+                            whitespace.  Use no padding before separators
+                            but provide one padding space after separators.
+<
+         Align     : this command/function operates on the range given it to
+                     align text based on one or more separator patterns.  The
+                     patterns may be provided via AlignCtrl or via Align
+                     itself. >
+
+                       ex. :%Align ,
+                           Interpretation: align all commas over the entire
+                           file.
+<                    The :Align! format permits alignment control commands
+                     to precede the alignment patterns. >
+                       ex. :%Align! p2P2 =
+<                    This will align all "=" in the file with two padding
+                     spaces on both sides of each "=" sign.
+
+                     NOTE ON USING PATTERNS WITH ALIGN:~
+                     Align and AlignCtrl use |<q-args>| to obtain their
+                     input patterns and they use an internal function to
+                     split arguments at whitespace unless inside "..."s.
+                     One may escape characters inside a double-quote string
+                     by preceding such characters with a backslash.
+
+         AlignPush : this command/function pushes the current AlignCtrl
+                     state onto an internal stack. >
+                       ex. :AlignPush
+                           Interpretation: save the current AlignCtrl
+                           settings, whatever they may be.  They'll
+                           also remain as the current settings until
+                           AlignCtrl is used to change them.
+<
+         AlignPop  : this command/function pops the current AlignCtrl
+                     state from an internal stack. >
+                       ex. :AlignPop
+                           Interpretation: presumably AlignPush was
+                           used (at least once) previously; this command
+                           restores the AlignCtrl settings when AlignPush
+                           was last used.
+<                    Also see |alignctrl-m| for a way to automatically do
+                     an AlignPop after an Align (primarily this is for maps).
+
+ALIGNMENT OPTIONS                      *align-option* *align-options* {{{2
+    *align-utf8* *align-utf* *align-codepoint* *align-strlen* *align-multibyte*
+
+       For those of you who are using 2-byte (or more) characters such as are
+       available with utf-8, Align now provides a special option which you
+       may choose based upon your needs:
+
+       Use Built-in strlen() ~
+>
+                       let g:Align_xstrlen= 0
+
+<       This is the fastest method, but it doesn't handle multibyte characters
+       well.  It is the default for:
+
+         enc=latin1
+         vim compiled without multi-byte support
+         $LANG is en_US.UTF-8 (assuming USA english)
+
+       Number of codepoints (Latin a + combining circumflex is two codepoints)~
+>
+                       let g:Align_xstrlen= 1              (default)
+<
+       Number of spacing codepoints (Latin a + combining circumflex is one~
+       spacing codepoint; a hard tab is one; wide and narrow CJK are one~
+       each; etc.)~
+>
+                       let g:Align_xstrlen= 2
+<
+       Virtual length (counting, for instance, tabs as anything between 1 and~
+       'tabstop', wide CJK as 2 rather than 1, Arabic alif as zero when~
+       immediately preceded by lam, one otherwise, etc.)~
+>
+                       let g:Align_xstrlen= 3
+<
+       By putting one of these settings into your <.vimrc>, Align will use an
+       internal (interpreted) function to determine a string's length instead
+       of the Vim's built-in |strlen()| function.  Since the function is
+       interpreted, Align will run a bit slower but will handle such strings
+       correctly.  The last setting (g:Align_xstrlen= 3) probably will run
+       the slowest but be the most accurate.  (thanks to Tony Mechelynck for
+       these)
+
+
+ALIGNMENT CONTROL                              *alignctrl* *align-control* {{{2
+
+       This command doesn't do the alignment operation itself; instead, it
+       controls subsequent alignment operation(s).
+
+       The first argument to AlignCtrl is a string which may contain one or
+       more alignment control settings.  Most of the settings are specified
+       by single letters; the exceptions are the p# and P# commands which
+       interpret a digit following the p or P as specifying padding about the
+       separator.
+
+       The typical text line is considered to be composed of two or more
+       fields separated by one or more separator pattern(s): >
+
+               ws field ws separator ws field ws separator ...
+<
+       where "ws" stands for "white space" such as blanks and/or tabs.
+
+       
+       SEPARATORS                              *alignctrl-separators* {{{3
+
+       As a result, separators may not have white space (tabs or blanks) on
+       their outsides (ie.  ":  :" is fine as a separator, but " :: " is
+       not).  Usually such separators are not needed, although a map has been
+       provided which works around this limitation and aligns on whitespace
+       (see |alignmap-tsp|).
+
+       However, if you really need to have separators with leading or
+       trailing whitespace, consider handling them by performing a substitute
+       first (ie. s/  ::  /@/g), do the alignment on the temporary pattern
+       (ie. @), and then perform a substitute to revert the separators back
+       to their desired condition (ie. s/@/  ::  /g).
+
+       The Align#Align() function will first convert tabs over the region into
+       spaces and then apply alignment control.  Except for initial white
+       space, white space surrounding the fields is ignored.  One has three
+       options just for handling initial white space:
+
+
+       ---                                             *alignctrl-w*
+       wWI     INITIAL WHITE SPACE                     *alignctrl-W* {{{3
+       ---                                             *alignctrl-I*
+               w : ignore all selected lines' initial white space
+               W : retain all selected lines' initial white space
+               I : retain only the first line's initial white space and
+                   re-use it for subsequent lines
+
+       Example: Leading white space options: >
+                         +---------------+-------------------+-----------------+
+                        |AlignCtrl w= :=|  AlignCtrl W= :=  | AlignCtrl I= := |
+      +------------------+---------------+-------------------+-----------------+
+      |     Original     |   w option    |     W option      |     I option    |
+      +------------------+---------------+-------------------+-----------------+
+      |   a := baaa      |a     := baaa  |   a      : = baaa |   a     := baaa |
+      | caaaa := deeee   |caaaa := deeee | caaaa    : = deeee|   caaaa := deeee|
+      |       ee := f    |ee    := f     |       ee : = f    |   ee    := f    |
+      +------------------+---------------+-------------------+-----------------+
+<
+       The original has at least one leading white space on every line.
+       Using Align with w eliminated each line's leading white space.
+       Using Align with W preserved  each line's leading white space.
+       Using Align with I applied the first line's leading white space
+                          (three spaces) to each line.
+
+
+       ------                                          *alignctrl-l*
+       lrc-+:  FIELD JUSTIFICATION                     *alignctrl-r* {{{3
+       ------                                          *alignctrl-c*
+
+       With "lrc", the fields will be left-justified, right-justified, or
+       centered as indicated by the justification specifiers (lrc).  The
+       "lrc" options are re-used by cycling through them as needed:
+
+               l   means llllll....
+               r   means rrrrrr....
+               lr  means lrlrlr....
+               llr means llrllr....
+
+     Example: Justification options: Align = >
+     +------------+-------------------+-------------------+-------------------+
+     |  Original  |  AlignCtrl l      | AlignCtrl r       | AlignCtrl lr      |
+     +------------+-------------------+-------------------+-------------------+
+     | a=bb=ccc=1 |a   = bb  = ccc = 1|  a =  bb = ccc = 1|a   =  bb = ccc = 1|
+     | ccc=a=bb=2 |ccc = a   = bb  = 2|ccc =   a =  bb = 2|ccc =   a = bb  = 2|
+     | dd=eee=f=3 |dd  = eee = f   = 3| dd = eee =   f = 3|dd  = eee = f   = 3|
+     +------------+-------------------+-------------------+-------------------+
+     | Alignment  |l     l     l     l|  r     r     r   r|l       r   l     r|
+     +------------+-------------------+-------------------+-------------------+
+<
+               AlignCtrl l : The = separator is repeatedly re-used, as the
+                             cycle only consists of one character (the "l").
+                             Every time left-justification is used for fields.
+               AlignCtrl r : The = separator is repeatedly re-used, as the
+                             cycle only consists of one character (the "l").
+                             Every time right-justification is used for fields
+               AlignCtrl lr: Again, the "=" separator is repeatedly re-used,
+                             but the fields are justified alternately between
+                             left and right.
+
+       Even more separator control is available.  With "-+:":
+
+           - : skip treating the separator as a separator.   *alignctrl--*
+           + : repeat use of the last "lrc" justification    *alignctrl-+*
+           : : treat the rest of the line as a single field  *alignctrl-:*
+
+     Example: More justification options:  Align = >
+     +------------+---------------+--------------------+---------------+
+     |  Original  |  AlignCtrl -l | AlignCtrl rl+      | AlignCtrl l:  |
+     +------------+---------------+--------------------+---------------+
+     | a=bb=ccc=1 |a=bb   = ccc=1 |  a = bb  = ccc = 1 |a   = bb=ccc=1 |
+     | ccc=a=bb=2 |ccc=a  = bb=2  |ccc = a   = bb  = 2 |ccc = a=bb=2   |
+     | dd=eee=f=3 |dd=eee = f=3   | dd = eee = f   = 3 |dd  = eee=f=3  |
+     +------------+---------------+--------------------+---------------+
+     | Alignment  |l        l     |  r   l     l     l |l     l        |
+     +------------+---------------+--------------------+---------------+
+<
+       In the first example in "More justification options":
+
+         The first "=" separator is skipped by the "-" specification,
+         and so "a=bb", "ccc=a", and "dd=eee" are considered as single fields.
+
+         The next "=" separator has its (left side) field left-justified.
+         Due to the cyclic nature of separator patterns, the "-l"
+         specification is equivalent to "-l-l-l ...".
+
+         Hence the next specification is a "skip", so "ccc=1", etc are fields.
+
+       In the second example in "More justification options":
+
+         The first field is right-justified, the second field is left
+         justified, and all remaining fields repeat the last justification
+         command (ie. they are left justified, too).
+
+         Hence rl+ is equivalent to         rlllllllll ...
+         (whereas plain rl is equivalent to rlrlrlrlrl ... ).
+
+       In the third example in "More justification options":
+
+         The text following the first separator is treated as a single field.
+
+       Thus using the - and : operators one can apply justification to a
+       single separator.
+
+       ex. 1st separator only:    AlignCtrl l:
+           2nd separator only:    AlignCtrl -l:
+           3rd separator only:    AlignCtrl --l:
+           etc.
+
+
+       ---                                                  *alignctrl-=*
+       =C      CYCLIC VS ALL-ACTIVE SEPARATORS              *alignctrl-C* {{{3
+       ---
+
+       The separators themselves may be considered as equivalent and
+       simultaneously active ("=") or sequentially cycled through ("C").
+       Separators are regular expressions (|regexp|) and are specified as the
+       second, third, etc arguments.  When the separator patterns are
+       equivalent and simultaneously active, there will be one pattern
+       constructed: >
+
+               AlignCtrl ... pat1 pat2 pat3
+               \(pat1\|pat2\|pat3\)
+<
+       Each separator pattern is thus equivalent and simultaneously active.
+       The cyclic separator AlignCtrl option stores a list of patterns, only
+       one of which is active for each field at a time.
+
+       Example: Equivalent/Simultaneously-Active vs Cyclic Separators >
+ +-------------+------------------+---------------------+----------------------+
+ |   Original  | AlignCtrl = = + -| AlignCtrl = =       | AlignCtrl C = + -    |
+ +-------------+------------------+---------------------+----------------------+
+ |a = b + c - d|a = b + c - d     |a = b + c - d        |a = b         + c - d |
+ |x = y = z + 2|x = y = z + 2     |x = y         = z + 2|x = y = z     + 2     |
+ |w = s - t = 0|w = s - t = 0     |w = s - t     = 0    |w = s - t = 0         |
+ +-------------+------------------+---------------------+----------------------+
+<
+       The original is initially aligned with all operators (=+-) being
+       considered as equivalent and simultaneously active field separators.
+       Thus the "AlignCtrl = = + -" example shows no change.
+
+       The second example only accepts the '=' as a field separator;
+       consequently "b + c - d" is now a single field.
+
+       The third example illustrates cyclic field separators and is analyzed
+       in the following illustration: >
+
+       field1 separator field2    separator field3 separator field4
+          a      =      b             +       c        -       d
+          x      =      y = z         +       2
+          w      =      s - t = 0
+<
+       The word "cyclic" is used because the patterns form a cycle of use; in
+       the above case, its = + - = + - = + - = + -...
+
+       Example: Cyclic separators >
+               Label : this is some text discussing ":"s | ex. abc:def:ghi
+               Label : this is some text with a ":" in it | ex. abc:def
+<
+         apply AlignCtrl lWC : | |
+               (select lines)Align >
+                Label : this is some text discussing ":"s  | ex. abc:def:ghi
+                Label : this is some text with a ":" in it | ex. abcd:efg
+<
+       In the current example,
+         : is the first separator        So the first ":"s are aligned
+         | is the second separator       but subsequent ":"s are not.
+         | is the third separator        The "|"s are aligned, too.
+         : is the fourth separator       Since there aren't two bars,
+         | is the fifth separator        the subsequent potential cycles
+         | is the sixth separator        don't appear.
+        ...
+
+       In this case it would probably have been a better idea to have used >
+               AlignCtrl WCl: : |
+<      as that alignment control would guarantee that no more cycling
+       would be used after the vertical bar.
+
+       Example: Cyclic separators
+
+           Original: >
+               a| b&c | (d|e) & f-g-h
+               aa| bb&cc | (dd|ee) & ff-gg-hh
+               aaa| bbb&ccc | (ddd|eee) & fff-ggg-hhh
+<
+           AlignCtrl C | | & - >
+               a   | b&c     | (d|e)     & f   - g-h
+               aa  | bb&cc   | (dd|ee)   & ff  - gg-hh
+               aaa | bbb&ccc | (ddd|eee) & fff - ggg-hhh
+<
+       In this example,
+       the first and second separators are "|",
+       the third            separator  is  "&", and
+       the fourth           separator  is  "-",
+
+       (cycling)
+       the fifth and sixth  separators are "|",
+       the seventh          separator  is  "&", and
+       the eighth           separator  is  "-", etc.
+
+       Thus the first "&"s are (not yet) separators, and hence are treated as
+       part of the field.  Ignoring white space for the moment, the AlignCtrl
+       shown here means that Align will work with >
+
+       field | field | field & field - field | field | field & field - ...
+<
+
+       ---                                             *alignctrl-<*
+       <>|     SEPARATOR JUSTIFICATION                 *alignctrl->* {{{3
+       ---                                             *alignctrl-|*
+
+       Separators may be of differing lengths as shown in the example below.
+       Hence they too may be justified left, right, or centered.
+       Furthermore, separator justification specifications are cyclic:
+
+               <  means <<<<<...    justify separator(s) to the left
+               >  means >>>>>...    justify separator(s) to the right
+               |  means |||||...    center separator(s)
+
+       Example: Separator Justification: Align -\+ >
+                               +-----------------+
+                               |    Original     |
+                               +-----------------+
+                               | a - bbb - c     |
+                               | aa -- bb -- ccc |
+                               | aaa --- b --- cc|
+       +---------------------+-+-----------------+-+---------------------+
+       |     AlignCtrl <     |     AlignCtrl >     |     AlignCtrl |     |
+       +---------------------+---------------------+---------------------+
+       | a   -   bbb -   c   | a     - bbb   - c   | a    -  bbb  -  c   |
+       | aa  --  bb  --  ccc | aa   -- bb   -- ccc | aa  --  bb  --  ccc |
+       | aaa --- b   --- cc  | aaa --- b   --- cc  | aaa --- b   --- cc  |
+       +---------------------+---------------------+---------------------+
+<
+
+       ---                                             *alignctrl-g*
+       gv      SELECTIVE APPLICATION                   *alignctrl-v* {{{3
+       ---
+
+
+       These two options provide a way to select (g) or to deselect (v) lines
+       based on a pattern.  Ideally :g/pat/Align  would work; unfortunately
+       it results in Align#Align() being called on each line satisfying the
+       pattern separately. >
+
+               AlignCtrl g pattern
+<
+       Align will only consider those lines which have the given pattern. >
+
+               AlignCtrl v pattern
+<
+       Align will only consider those lines without the given pattern.  As an
+       example of use, consider the following example: >
+
+                                          :AlignCtrl v ^\s*/\*
+         Original          :Align =       :Align =
+       +----------------+------------------+----------------+
+       |one= 2;         |one     = 2;      |one   = 2;      |
+       |three= 4;       |three   = 4;      |three = 4;      |
+       |/* skip=this */ |/* skip = this */ |/* skip=this */ |
+       |five= 6;        |five    = 6;      |five  = 6;      |
+       +----------------+------------------+----------------+
+<
+       The first "Align =" aligned with all "="s, including that one in the
+       "skip=this" comment.
+
+       The second "Align =" had a AlignCtrl v-pattern which caused it to skip
+       (ignore) the "skip=this" line when aligning.
+       
+       To remove AlignCtrl's g and v patterns, use (as appropriate) >
+
+               AlignCtrl g
+               AlignCtrl v
+<
+       To see what g/v patterns are currently active, just use the reporting
+       capability of an unadorned call to AlignCtrl: >
+
+               AlignCtrl
+<
+
+       ---
+        m      MAP SUPPORT                             *alignctrl-m* {{{3
+       ---
+
+       This option primarily supports the development of maps.  The
+       Align#AlignCtrl() call will first do an Align#AlignPush() (ie. retain
+       current alignment control settings).  The next Align#Align() will, in
+       addition to its alignment job, finish up with an Align#AlignPop().
+       Thus the Align#AlignCtrl settings that follow the "m" are only
+       temporarily in effect for just the next Align#Align().
+
+
+       ---
+       p###                                            *alignctrl-p*
+       P###    PADDING                                 *alignctrl-P* {{{3
+       ---
+
+       These two options control pre-padding and post-padding with blanks
+       about the separator.  One may pad separators with zero to nine spaces;
+       the padding number(s) is/are treated as a cyclic parameter.  Thus one
+       may specify padding separately for each field or re-use a padding
+       pattern. >
+
+       Example:          AlignCtrl p102P0
+       +---------+----------------------------------+
+       | Original| a=b=c=d=e=f=g=h=1                |
+        | Align = | a =b=c  =d =e=f  =g =h=1         |
+        +---------+----------------------------------+
+       | prepad  |   1 0   2  1 0   2  1 0          |
+        +---------+----------------------------------+
+<
+       This example will cause Align to:
+
+               pre-pad the first  "=" with a single blank,
+               pre-pad the second "=" with no blanks,
+               pre-pad the third  "=" with two blanks,
+               pre-pad the fourth "=" with a single blank,
+               pre-pad the fifth  "=" with no blanks,
+               pre-pad the sixth  "=" with two blanks,
+               etc.
+
+       ---------------                         *alignctrl-settings*
+       No option given         DISPLAY STATUS  *alignctrl-*            {{{3
+       ---------------                         *alignctrl-no-option*
+
+       AlignCtrl, when called with no arguments, will display the current
+       alignment control settings.  A typical display is shown below: >
+
+               AlignCtrl<=> qty=1 AlignStyle<l> Padding<1|1>
+               Pat1<\(=\)>
+<
+       Interpreting, this means that the separator patterns are all
+       equivalent; in this case, there's only one (qty=1).  Fields will be
+       padded on the right with spaces (left justification), and separators
+       will be padded on each side with a single space.
+
+       To change one of these items, see:
+
+         AlignCtrl......|alignctrl|
+         qty............|align-concept|
+         AlignStyle.....|alignctrl--| |alignctrl-+| |alignctrl-:||alignctrl-c|
+         Padding........|alignctrl-p| |alignctrl-P|
+
+       One may get a string which can be fed back into AlignCtrl: >
+
+               :let alignctrl= Align#AlignCtrl()
+<
+       This form will put a string describing the current AlignCtrl options,
+       except for the "g" and "v" patterns, into a variable.  The
+       Align#AlignCtrl() function will still echo its settings, however.  One
+       can feed any non-supported "option" to AlignCtrl() to prevent this,
+       however: >
+
+               :let alignctrl= Align#AlignCtrl("d")
+<
+
+ALIGNMENT                                              *align-align* {{{2
+
+       Once the alignment control has been determined, the user specifies a
+       range of lines for the Align command/function to do its thing.
+       Alignment is often done on a line-range basis, but one may also
+       restrict alignment to a visual block using ctrl-v.  For any visual
+       mode, one types the colon (:) and then "Align".  One may, of course,
+       specify a range of lines: >
+
+               :[range]Align [list-of-separators]
+<
+       where the |:range| is the usual Vim-powered set of possibilities; the
+       list of separators is the same as the AlignCtrl capability.  There is
+       only one list of separators, but either AlignCtrl or Align can be used
+       to specify that list.
+
+       An alternative form of the Align command can handle both alignment
+       control and the separator list: >
+
+               :[range]Align! [alignment-control-string] [list-of-separators]
+<
+       The alignment control string will be applied only for this particular
+       application of Align (it uses |alignctrl-m|).  The "g pattern" and
+       "v pattern" alignment controls (see |alignctrl-g| and |alignctrl-v|)
+       are also available via this form of the Align command.
+
+       Align makes two passes over the text to be aligned.  The first pass
+       determines how many fields there are and determines the maximum sizes
+       of each field; these sizes are then stored in a vector.  The second
+       pass pads the field (left/right/centered as specified) to bring its
+       length up to the maximum size of the field.  Then the separator and
+       its AlignCtrl-specified padding is appended.
+
+               Pseudo-Code:~
+                During pass 1
+                | For all fields in the current line
+                || Determine current separator
+                || Examine field specified by current separator
+                || Determine length of field and save if largest thus far
+                Initialize newline based on initial whitespace option (wWI)
+                During pass 2
+                | For all fields in current line
+                || Determine current separator
+                || Extract field specified by current separator
+                || Prepend/append padding as specified by AlignCtrl
+                || (right/left/center)-justify to fit field into max-size field
+                || Append separator with AlignCtrl-specified separator padding
+                || Delete current line, install newly aligned line
+
+       The g and v AlignCtrl patterns cause the passes not to consider lines
+       for alignment, either by requiring that the g-pattern be present or
+       that the v-pattern not be present.
+
+       The whitespace on either side of a separator is ignored.
+
+
+==============================================================================
+4. Alignment Maps                              *alignmaps* *align-maps* {{{1
+
+       There are a number of maps using Align#AlignCtrl() and Align#Align()
+       in the <AlignMapsPlugin.vim> file.  This file may also be put into the
+       plugins subdirectory.  Since AlignCtrl and Align supercede textab and
+       its <ttalign.vim> file, the maps either have a leading "t" (for
+       "textab") or the more complicated ones an "a" (for "alignment") for
+       backwards compatibility.
+
+       The maps are shown below with a leading backslash (\).  Actually, the
+       <Leader> construct is used (see |mapleader|), so the maps' leading
+       kick-off character is easily customized.
+
+       Furthermore, all AlignMapsPlugin.vim maps use the <Plug> construct (see
+       |<Plug>|and |usr_41.txt|).  Hence, if one wishes to override the
+       mapping entirely, one may do that, too.  As an example: >
+               map <Leader>ACOM        <Plug>AM_acom
+<      would have \ACOM do what \acom previously did (assuming that the
+       mapleader has been left at its default value of a backslash).
+
+         \a,   : useful for breaking up comma-separated
+                 declarations prior to \adec                   |alignmap-a,|
+         \a(   : aligns ( and , (useful for prototypes)        *alignmap-a(*
+         \a?   : aligns (...)? ...:... expressions on ? and :  |alignmap-a?|
+         \a<   : aligns << and >> for c++                      |alignmap-a<|
+         \a=   : aligns := assignments                         |alignmap-a=|
+         \abox : draw a C-style comment box around text lines  |alignmap-abox|
+         \acom : useful for aligning comments                  |alignmap-acom|
+         \adcom: useful for aligning comments in declarations  |alignmap-adcom|
+         \anum : useful for aligning numbers                   |alignmap-anum|
+                 NOTE: For the visual-mode use of \anum, <vis.vim> is needed!
+                   See http://mysite.verizon.net/astronaut/vim/index.html#VIS
+         \aenum: align a European-style number                 |alignmap-anum|
+         \aunum: align a USA-style number                      |alignmap-anum|
+         \adec : useful for aligning declarations              |alignmap-adec|
+         \adef : useful for aligning definitions               |alignmap-adef|
+         \afnc : useful for aligning ansi-c style functions'
+                 argument lists                                |alignmap-afnc|
+         \adcom: a variant of \acom, restricted to comment     |alignmap-adcom|
+                 containing lines only, but also only for
+                 those which don't begin with a comment.
+                 Good for certain declaration styles.
+         \aocom: a variant of \acom, restricted to comment     |alignmap-aocom|
+                 containing lines only
+         \tab  : align a table based on tabs                   *alignmap-tab*
+                 (converts to spaces)
+         \tml  : useful for aligning the trailing backslashes  |alignmap-tml|
+                 used to continue lines (shell programming, etc)
+         \tsp  : use Align to make a table separated by blanks |alignmap-tsp|
+                 (left justified)
+         \ts,  : like \t, but swaps whitespace on the right of *alignmap-ts,*
+                 the commas to their left
+         \ts:  : like \t: but swaps whitespace on the right of *alignmap-ts:*
+                 the colons to their left
+         \ts<  : like \t< but swaps whitespace on the right of *alignmap-ts<*
+                 the less-than signs to their left
+         \ts=  : like \t= but swaps whitespace on the right of *alignmap-ts=*
+                 the equals signs to their left
+         \Tsp  : use Align to make a table separated by blanks |alignmap-Tsp|
+                 (right justified)
+         \tsq  : use Align to make a table separated by blanks |alignmap-tsq|
+                 (left justified) -- "strings" are not split up
+         \tt   : useful for aligning LaTeX tabular tables      |alignmap-tt|
+         \Htd  : tabularizes html tables:                      |alignmap-Htd|
+                 <TR><TD> ...field... </TD><TD> ...field... </TD></TR>
+
+                 *alignmap-t|* *alignmap-t#* *alignmap-t,* *alignmap-t:*
+                 *alignmap-t;* *alignmap-t<* *alignmap-t?* *alignmap-t~*
+                 *alignmap-m=*
+         \tx   : make a left-justified  alignment on
+                 character "x" where "x" is: ,:<=@|#           |alignmap-t=|
+         \Tx   : make a right-justified alignment on
+                 character "x" where "x" is: ,:<=@#            |alignmap-T=|
+         \m=   : like \t= but aligns with %... style comments
+
+       The leading backslash is actually <leader> (see |mapleader| for how to
+       customize the leader to be whatever you like).  These maps use the
+       <Align.vim> package and are defined in the <AlignMaps.vim> file.
+       Although the maps use AlignCtrl options, they typically use the "m"
+       option which pushes the options (AlignPush).  The associated Align
+       call which follows will then AlignPop the user's original options
+       back.
+
+       ALIGNMENT MAP USE WITH MARK AND MOVE~
+       In the examples below, one may select the text with a "ma" at the
+       first line, move to the last line, then execute the map.
+
+       ALIGNMENT MAP USE WITH VISUAL MODE~
+       Alternatively, one may select the text with the "V" visual mode
+       command.
+
+       ALIGNMENT MAP USE WITH MENUS~
+       One may use the mark-and-move style (ma, move, use the menu) or
+       the visual mode style (use the V visual mode, move, then select
+       the alignment map with menu selection).  The alignment map menu
+       items are under DrChip.AlignMaps .
+
+       One may even change the top level menu name to whatever is wished; by
+       default, its >
+               let g:DrChipTopLvlMenu= "DrChip."
+<      If you set the variable to the empty string (""), then no menu items
+       will be produced.  Of course, one must have a vim with +menu, the gui
+       must be running, and |'go'| must have the menu bar suboption (ie. m
+       must be included).
+
+       COMPLEX ALIGNMENT MAP METHOD~
+
+       For those complex alignment maps which do alignment on constructs
+       (e.g. \acom, \adec, etc), a series of substitutes is used to insert
+       "@" symbols in appropriate locations.  Align#Align() is then used to
+       do alignment directly on "@"s; then it is followed by further
+       substitutes to do clean-up.  However, the maps \WS and \WE, used by
+       every map supported by AlignMaps, protect any original embedded "@"
+       symbols by first converting them to <DEL> characters, doing the
+       requested job, and then converting them back. >
+
+           \WS  calls AlignMaps#WrapperStart()
+           \WE  calls AlignMaps#WrapperEnd()
+<
+
+       ---------------------------
+       Alignment Map Examples: \a,                     *alignmap-a,* {{{3
+       ---------------------------
+
+       Original: illustrates comma-separated declaration splitting: >
+               int a,b,c;
+               struct ABC_str abc,def;
+<
+       Becomes: >
+               int a;
+               int b;
+               int c;
+               struct ABC_str abc;
+               struct ABC_str def;
+<
+
+       ---------------------------
+       Alignment Map Examples: \a?                     *alignmap-a?* {{{3
+       ---------------------------
+
+       Original: illustrates ()?: aligning >
+               printf("<%s>\n",
+                 (x == ABC)? "abc" :
+                 (x == DEFG)? "defg" :
+                 (x == HIJKL)? "hijkl" : "???");
+<
+       Becomes:  select "(x == ..." lines, then \a? >
+               printf("<%s>\n",
+                 (x == ABC)?   "abc"   :
+                 (x == DEFG)?  "defg"  :
+                 (x == HIJKL)? "hijkl" : "???");
+<
+
+       ---------------------------
+       Alignment Map Examples: \a<                     *alignmap-a<* {{{3
+       ---------------------------
+
+       Original: illustrating aligning of << and >> >
+               cin << x;
+               cin      << y;
+               cout << "this is x=" << x;
+               cout << "but y=" << y << "is not";
+<
+       Becomes:  select "(x == ..." lines, then \a< >
+               cin  << x;
+               cin  << y;
+               cout << "this is x=" << x;
+               cout << "but y="     << y  << "is not";
+<
+
+       ---------------------------
+       Alignment Map Examples: \a=                     *alignmap-a=* {{{3
+       ---------------------------
+
+       Original: illustrates how to align := assignments >
+               aa:=bb:=cc:=1;
+               a:=b:=c:=1;
+               aaa:=bbb:=ccc:=1;
+<      
+       Bcomes: select the three assignment lines, then \a:= >
+               aa  := bb  := cc  := 1;
+               a   := b   := c   := 1;
+               aaa := bbb := ccc := 1;
+<
+
+       ---------------------------
+       Alignment Map Examples: \abox                   *alignmap-abox* {{{3
+       ---------------------------
+
+       Original: illustrates how to comment-box some text >
+               This is some plain text
+               which will
+               soon be surrounded by a
+               comment box.
+<
+       Becomes:  Select "This..box." with ctrl-v, press \abox >
+               /***************************
+                * This is some plain text *
+                * which will              *
+                * soon be surrounded by a *
+                * comment box.            *
+                ***************************/
+<
+
+       ---------------------------
+       Alignment Map Examples: \acom                   *alignmap-acom* {{{3
+       ---------------------------
+
+       Original: illustrates aligning C-style comments (works for //, too) >
+               if(itworks) { /* this */
+                       then= dothis; /* is a */
+                       } /* set of three comments */
+<
+       Becomes: Select the three lines, press \acom >
+               if(itworks) {         /* this                  */
+                       then= dothis; /* is a                  */
+                       }             /* set of three comments */
+<
+       Also see |alignmap-aocom|
+
+
+       ---------------------------
+       Alignment Map Examples: \anum                   *alignmap-anum* {{{3
+       ---------------------------
+
+       Original: illustrates how to get numbers lined up >
+                -1.234 .5678 -.901e-4
+                1.234 5.678 9.01e-4
+                12.34 56.78 90.1e-4
+                123.4 567.8 901.e-4
+<
+       Becomes: Go to first line, ma.  Go to last line, press \anum >
+                 -1.234    .5678   -.901e-4
+                  1.234   5.678    9.01e-4
+                 12.34   56.78    90.1e-4
+                123.4   567.8    901.e-4
+<
+       Original: >
+                | -1.234 .5678 -.901e-4 |
+                | 1.234 5.678 9.01e-4   |
+                | 12.34 56.78 90.1e-4   |
+                | 123.4 567.8 901.e-4   |
+<
+       Becomes: Select the numbers with ctrl-v (visual-block mode), >
+                press \anum
+                |  -1.234    .5678   -.901e-4 |
+                |   1.234   5.678    9.01e-4  |
+                |  12.34   56.78    90.1e-4   |
+                | 123.4   567.8    901.e-4    |
+<
+       Original: >
+                -1,234 ,5678 -,901e-4
+                1,234 5,678 9,01e-4
+                12,34 56,78 90,1e-4
+                123,4 567,8 901,e-4
+<
+       Becomes: Go to first line, ma.  Go to last line, press \anum >
+                 -1,234    ,5678   -,901e-4
+                  1,234   5,678    9,01e-4
+                 12,34   56,78    90,1e-4
+                123,4   567,8    901,e-4
+<
+       In addition:
+         \aenum is provided to support European-style numbers
+         \aunum is provided to support USA-style numbers
+
+       One may get \aenum behavior for \anum >
+         let g:alignmaps_euronumber= 1
+<      or \aunum behavior for \anum if one puts >
+         let g:alignmaps_usanumber= 1
+<      in one's <.vimrc>.
+
+
+       ---------------------------
+       Alignment Map Examples: \ascom                  *alignmap-ascom* {{{3
+       ---------------------------
+
+       Original: >
+               /* A Title */
+               int x; /* this is a comment */
+               int yzw; /* this is another comment*/
+<
+       Becomes: Select the three lines, press \ascom >
+               /* A Title */
+               int x;   /* this is a comment       */
+               int yzw; /* this is another comment */
+<
+
+       ---------------------------
+       Alignment Map Examples: \adec                   *alignmap-adec* {{{3
+       ---------------------------
+
+       Original: illustrates how to clean up C/C++ declarations >
+               int     a;
+               float   b;
+               double *c=NULL;
+               char x[5];
+               struct  abc_str abc;
+               struct  abc_str *pabc;
+               int     a;              /* a   */
+               float   b;              /* b   */
+               double *c=NULL;              /* b   */
+               char x[5]; /* x[5] */
+               struct  abc_str abc;    /* abc */
+               struct  abc_str *pabc;    /* pabc */
+               static   int     a;              /* a   */
+               static   float   b;              /* b   */
+               static   double *c=NULL;              /* b   */
+               static   char x[5]; /* x[5] */
+               static   struct  abc_str abc;    /* abc */
+               static   struct  abc_str *pabc;    /* pabc */
+<
+       Becomes: Select the declarations text, then \adec >
+               int                    a;
+               float                  b;
+               double                *c    = NULL;
+               char                   x[5];
+               struct abc_str         abc;
+               struct abc_str        *pabc;
+               int                    a;           /* a    */
+               float                  b;           /* b    */
+               double                *c    = NULL; /* b    */
+               char                   x[5];        /* x[5] */
+               struct abc_str         abc;         /* abc  */
+               struct abc_str        *pabc;        /* pabc */
+               static int             a;           /* a    */
+               static float           b;           /* b    */
+               static double         *c    = NULL; /* b    */
+               static char            x[5];        /* x[5] */
+               static struct abc_str  abc;         /* abc  */
+               static struct abc_str *pabc;        /* pabc */
+<
+
+       ---------------------------
+       Alignment Map Examples: \adef                   *alignmap-adef* {{{3
+       ---------------------------
+
+       Original: illustrates how to line up #def'initions >
+               #define ONE 1
+               #define TWO 22
+               #define THREE 333
+               #define FOUR 4444
+<
+       Becomes: Select four definition lines, apply \adef >
+       #        define ONE   1
+       #        define TWO   22
+       #        define THREE 333
+       #        define FOUR  4444
+<
+
+       ---------------------------
+       Alignment Map Examples: \afnc                   *alignmap-afnc* {{{3
+       ---------------------------
+
+       This map is an exception to the usual selection rules.
+       It uses "]]" to find the function body's leading "{".
+       Just put the cursor anywhere in the function arguments and
+       the entire function declaration should be processed.
+
+       Because "]]" looks for that "{" in the first column, the
+       "original" and "becomes" examples are in the first column,
+       too.
+
+       Original: illustrates lining up ansi-c style function definitions >
+       int f(
+         struct abc_str ***a, /* one */
+         long *b, /* two */
+         int c) /* three */
+       {
+       }
+<
+       Becomes: put cursor anywhere before the '{', press \afnc >
+       int f(
+         struct abc_str ***a,  /* one   */
+         long             *b,  /* two   */
+         int               c)  /* three */
+       {
+       }
+<
+
+       ---------------------------
+       Alignment Map Examples: \adcom                  *alignmap-adcom* {{{3
+       ---------------------------
+
+       Original: illustrates aligning comments that don't begin
+               lines (optionally after some whitespace). >
+               struct {
+                       /* this is a test */
+                       int x; /* of how */
+                       double y; /* to use adcom */
+                       };
+<
+       Becomes: Select the inside lines of the structure,
+               then press \adcom.  The comment-only
+               line is ignored but the other two comments
+               get aligned. >
+               struct {
+                        /* this is a test */
+                        int x;    /* of how       */
+                        double y; /* to use adcom */
+                       };
+<
+
+       ---------------------------
+       Alignment Map Examples: \aocom                  *alignmap-aocom* {{{3
+       ---------------------------
+
+       Original: illustrates how to align C-style comments (works for //, too)
+                 but restricted only to aligning with those lines containing
+                 comments.  See the difference from \acom (|alignmap-acom|). >
+               if(itworks) { /* this comment */
+                       then= dothis;
+                       } /* only appears on two lines */
+<
+       Becomes: Select the three lines, press \aocom >
+                if(itworks) { /* this comment              */
+                        then= dothis;
+                        }     /* only appears on two lines */
+<
+       Also see |alignmap-acom|
+
+
+       ---------------------------                     *alignmap-Tsp*
+       Alignment Map Examples: \tsp                    *alignmap-tsp* {{{3
+       ---------------------------
+
+       Normally Align can't use white spaces for field separators as such
+       characters are ignored surrounding field separators.  The \tsp and
+       \Tsp maps get around this limitation.
+
+       Original: >
+        one two three four five
+        six seven eight nine ten
+        eleven twelve thirteen fourteen fifteen
+<
+       Becomes: Select the lines, \tsp >
+        one    two    three    four     five
+        six    seven  eight    nine     ten
+        eleven twelve thirteen fourteen fifteen
+<
+       Becomes: Select the lines, \Tsp >
+           one    two    three     four    five
+           six  seven    eight     nine     ten
+        eleven twelve thirteen fourteen fifteen
+<
+
+       ---------------------------
+       Alignment Map Examples: \tsq                    *alignmap-tsq* {{{3
+       ---------------------------
+
+       The \tsp map is useful for aligning tables based on white space,
+       but sometimes one wants double-quoted strings to act as a single
+       object in spite of embedded spaces.  The \tsq map was invented
+       to support this. (thanks to Leif Wickland)
+
+       Original: >
+        "one two" three
+        four "five six"
+<
+       Becomes: Select the lines, \tsq >
+        "one two" three
+        four      "five six"
+<
+
+       ---------------------------
+       Alignment Map Examples: \tt                     *alignmap-tt* {{{3
+       ---------------------------
+
+       Original: illustrates aligning a LaTex Table >
+        \begin{tabular}{||c|l|r||}
+        \hline\hline
+          one&two&three\\ \hline
+          four&five&six\\
+          seven&eight&nine\\
+        \hline\hline
+        \end{tabular}
+<
+       Becomes: Select the three lines inside the table >
+       (ie. one..,four..,seven..) and press \tt
+        \begin{tabular}{||c|l|r||}
+        \hline\hline
+          one   & two   & three \\ \hline
+          four  & five  & six   \\
+          seven & eight & nine  \\
+        \hline\hline
+        \end{tabular}
+<
+
+       ----------------------------
+       Alignment Map Examples: \tml                    *alignmap-tml* {{{3
+       ----------------------------
+
+        Original:  illustrates aligning multi-line continuation marks >
+       one \
+       two three \
+       four five six \
+       seven \\ \
+       eight \nine \
+       ten \
+<
+        Becomes:  >
+        one           \
+        two three     \
+        four five six \
+        seven \\      \
+        eight \nine   \
+        ten           \
+<
+
+       ---------------------------
+       Alignment Map Examples: \t=                     *alignmap-t=* {{{3
+       ---------------------------
+
+       Original: illustrates left-justified aligning of = >
+               aa=bb=cc=1;/*one*/
+               a=b=c=1;/*two*/
+               aaa=bbb=ccc=1;/*three*/
+<
+       Becomes: Select the three equations, press \t= >
+               aa  = bb  = cc  = 1; /* one   */
+               a   = b   = c   = 1; /* two   */
+               aaa = bbb = ccc = 1; /* three */
+<
+
+       ---------------------------
+       Alignment Map Examples: \T=                     *alignmap-T=* {{{3
+       ---------------------------
+
+       Original: illustrates right-justified aligning of = >
+               aa=bb=cc=1; /* one */
+               a=b=c=1; /* two */
+               aaa=bbb=ccc=1; /* three */
+<
+       Becomes: Select the three equations, press \T= >
+                 aa =  bb =  cc = 1; /* one   */
+                  a =   b =   c = 1; /* two   */
+                aaa = bbb = ccc = 1; /* three */
+<
+
+       ---------------------------
+       Alignment Map Examples: \Htd                    *alignmap-Htd* {{{3
+       ---------------------------
+
+       Original: for aligning tables with html >
+         <TR><TD>...field one...</TD><TD>...field two...</TD></TR>
+         <TR><TD>...field three...</TD><TD>...field four...</TD></TR>
+<
+       Becomes: Select <TR>... lines, press \Htd >
+         <TR><TD> ...field one...   </TD><TD> ...field two...  </TD></TR>
+         <TR><TD> ...field three... </TD><TD> ...field four... </TD></TR>
+<
+==============================================================================
+4. Alignment Tools' History                            *align-history* {{{1
+
+ALIGN HISTORY                                                          {{{2
+       35 : Nov 02, 2008 * g:loaded_AlignPlugin testing to prevent re-loading
+                           installed
+            Nov 19, 2008 * new sanity check for an AlignStyle of just ":"
+            Jan 08, 2009 * save&restore of |'mod'| now done with local
+                           variant
+       34 : Jul 08, 2008 * using :AlignCtrl before entering any alignment
+                           control commands was causing an error.
+       33 : Sep 20, 2007 * s:Strlen() introduced to support various ways
+                           used to represent characters and their effects
+                           on string lengths.  See |align-strlen|.
+                         * Align now accepts "..." -- so it can accept
+                           whitespace as separators.
+       32 : Aug 18, 2007 * uses |<q-args>| instead of |<f-args>| plus a
+                           custom argument splitter to allow patterns with
+                           backslashes to slide in unaltered.
+       31 : Aug 06, 2007 * :[range]Align! [AlignCtrl settings] pattern(s)
+                           implemented.
+       30 : Feb 12, 2007 * now uses |setline()|
+       29 : Jan 18, 2006 * cecutil updated to use keepjumps
+            Feb 23, 2006 * Align now converted to vim 7.0 style using
+                           auto-loading functions.
+       28 : Aug 17, 2005 * report option workaround
+            Oct 24, 2005 * AlignCtrl l:  wasn't behaving as expected; fixed
+       27 : Apr 15, 2005 : cpo workaround
+                           ignorecase workaround
+       26 : Aug 20, 2004 : loaded_align now also indicates version number
+                           GetLatestVimScripts :AutoInstall: now supported
+       25 : Jul 27, 2004 : For debugging, uses Dfunc(), Dret(), and Decho()
+       24 : Mar 03, 2004 : (should've done this earlier!) visualmode(1)
+                           not supported until v6.2, now Align will avoid
+                           calling it for earlier versions.  Visualmode
+                           clearing won't take place then, of course.
+       23 : Oct 07, 2003 : Included Leif Wickland's ReplaceQuotedSpaces()
+                           function which supports \tsq
+       22 : Jan 29, 2003 : Now requires 6.1.308 or later to clear visualmode()
+       21 : Jan 10, 2003 : BugFix: similar problem to #19; new code
+                           bypasses "norm! v\<Esc>" until initialization
+                           is over.
+       20 : Dec 30, 2002 : BugFix: more on "unable to highlight" fixed
+       19 : Nov 21, 2002 : BugFix: some terminals gave an "unable to highlight"
+                           message at startup; Hari Krishna Dara tracked it
+                           down; a silent! now included to prevent noise.
+       18 : Nov 04, 2002 : BugFix: re-enabled anti-repeated-loading
+       17 : Nov 04, 2002 : BugFix: forgot to have AlignPush() push s:AlignSep
+                           AlignCtrl now clears visual-block mode when used so
+                           that Align won't try to use old visual-block
+                           selection marks '< '>
+       16 : Sep 18, 2002 : AlignCtrl <>| options implemented (separator
+                           justification)
+       15 : Aug 22, 2002 : bug fix: AlignCtrl's ":" now acts as a modifier of
+                                    the preceding alignment operator (lrc)
+       14 : Aug 20, 2002 : bug fix: AlignCtrl default now keeps &ic unchanged
+                           bug fix: Align, on end-field, wasn't using correct
+                           alignop bug fix: Align, on end-field, was appending
+                           padding
+       13 : Aug 19, 2002 : bug fix: zero-length g/v patterns are accepted
+                           bug fix: always skip blank lines
+                           bug fix: AlignCtrl default now also clears g and v
+                                    patterns
+       12 : Aug 16, 2002 : moved keep_ic above zero-length pattern checks
+                           added "AlignCtrl default"
+                           fixed bug with last field getting separator spaces
+                           at end line
+       11 : Jul 08, 2002 : prevent separator patterns which match zero length
+                           -+: included as additional alignment/justification
+                           styles
+       10 : Jun 26, 2002 : =~# used instead of =~ (for matching case)
+                           ignorecase option handled
+        9 : Jun 25, 2002 : implemented cyclic padding
+
+ALIGNMENT MAP HISTORY                                  *alignmap-history* {{{2
+       v41    Nov 02, 2008   * g:loaded_AlignMapsPlugin testing to prevent
+                              re-loading installed
+                            * AlignMaps now use 0x0f (ctrl-p) for special
+                              character substitutions (instead of 0xff).
+                              Seems to avoid some problems with having to
+                              use Strlen().
+                            * bug fixed with \ts,
+                            * new maps: \ts; \ts, \ts: \ts< \ts= \a(
+       v40    Oct 21, 2008   * Modified AlignMaps so that its maps use <Plug>s
+                              and <script>s.  \t@ and related maps have been
+                              changed to call StdAlign() instead.  The
+                              WrapperStart function now takes an argument and
+                              handles being called via visual mode.  The
+                              former nmaps and vmaps have thus been replaced
+                              with a simple map.
+             Oct 24, 2008   * broke AlignMaps into a plugin and autoload
+                              pair of scripts.
+       v39   Mar 06, 2008 : * \t= only does /* ... */ aligning when in *.c
+                              *.cpp files.
+       v38   Aug 18, 2007 : * \tt altered so that it works with the new
+                              use of |<q-args>| plus a custom argument
+                              splitter
+       v36   Sep 27, 2006 : * AlignWrapperStart() now has tests that marks
+                              y and z are not set
+             May 15, 2007   * \anum and variants improved
+       v35   Sep 01, 2006 : * \t= and cousins used "`"s.  They now use \xff
+                              characters.
+                            * \acom now works with doxygen style /// comments
+                            * <char-0xff> used in \t= \T= \w= and \m= instead
+                              of backquotes.
+       v34   Feb 23, 2006 : * AlignMaps now converted to vim 7.0 style using
+                              auto-loading functions.
+       v33   Oct 12, 2005 : * \ts, now uses P1 in its AlignCtrl call
+       v32   Jun 28, 2005 : * s:WrapperStart() changed to AlignWrapperStart()
+                              s:WrapperEnd() changed to AlignWrapperEnd()
+                              These changes let the AlignWrapper...()s to be
+                              used outside of AlignMaps.vim
+       v31   Feb 01, 2005 : * \adcom included, with help
+                            * \a, now works across multiple lines with
+                              different types
+                            * AlignMaps now uses <cecutil.vim> for its mark and
+                              window-position saving and restoration
+             Mar 04, 2005   * improved \a,
+             Apr 06, 2005   * included \aenum, \aunum, and provided
+                     g:alignmaps_{usa|euro]number} options
+       v30   Aug 20, 2004 : * \a, : handles embedded assignments and does \adec
+                            * \acom  now can handle Doxygen-style comments
+                            * g:loaded_alignmaps now also indicates version
+                            * internal maps \WE and \WS are now re-entrant
+       v29   Jul 27, 2004 : * \tml aligns trailing multi-line single
+                             backslashes (thanks to Raul Benavente!)
+       v28   May 13, 2004 : * \a, had problems with leading blanks; fixed!
+       v27   Mar 31, 2004 : * \T= was having problems with == and !=
+                            * Fixed more problems with \adec
+       v26   Dec 09, 2003 : * \ascom now also ignores lines without comments
+                            * \tt  \& now not matched
+                            * \a< handles both << and >>
+       v25   Nov 14, 2003 : * included \anum (aligns numbers with periods and
+                              commas).  \anum also supported with ctrl-v mode.
+                            * \ts, \Ts, : (aligns on commas, then swaps leading
+                              spaces with commas)
+                            * \adec ignores preprocessor lines and lines with
+                              with comments-only
+       v23   Sep 10, 2003 : * Bugfix for \afnc - no longer overwrites marks y,z
+                            * fixed bug in \tsp, \tab, \Tsp, and \Tab - lines
+                              containing backslashes were having their
+                              backslashes removed.  Included Leif Wickland's
+                              patch for \tsq.
+                            * \adef now ignores lines holding comments only
+       v18   Aug 22, 2003 :   \a< lines up C++'s << operators
+                              saves/restores gdefault option (sets to nogd)
+                              all b:..varname.. are now b:alignmaps_..varname..
+       v17   Nov 04, 2002 :   \afnc now handles // comments correctly and
+                              commas within comments
+       v16   Sep 10, 2002 :   changed : to :silent! for \adec
+       v15   Aug 27, 2002 :   removed some <c-v>s
+       v14   Aug 20, 2002 :   \WS, \WE mostly moved to functions, marks y and z
+                              now restored
+       v11   Jul 08, 2002 :   \abox bug fix
+        v9   Jun 25, 2002 :   \abox now handles leading initial whitespace
+                          :   various bugfixes to \afnc, \T=, etc
+
+==============================================================================
+Modelines: {{{1
+vim:tw=78:ts=8:ft=help:fdm=marker:
diff --git a/vim/doc/NERD_commenter.txt b/vim/doc/NERD_commenter.txt
new file mode 100644 (file)
index 0000000..5309f61
--- /dev/null
@@ -0,0 +1,988 @@
+*NERD_commenter.txt*         Plugin for commenting code
+
+
+                        NERD COMMENTER REFERENCE MANUAL~
+
+
+
+
+
+==============================================================================
+CONTENTS                                               *NERDCommenterContents*
+
+    1.Intro...................................|NERDCommenter|
+    2.Installation............................|NERDComInstallation|
+    3.Functionality provided..................|NERDComFunctionality|
+        3.1 Functionality Summary.............|NERDComFunctionalitySummary|
+        3.2 Functionality Details.............|NERDComFunctionalityDetails|
+            3.2.1 Comment map.................|NERDComComment|
+            3.2.2 Nested comment map..........|NERDComNestedComment|
+            3.2.3 Toggle comment map..........|NERDComToggleComment|
+            3.2.4 Minimal comment map.........|NERDComMinimalComment|
+            3.2.5 Invert comment map..........|NERDComInvertComment|
+            3.2.6 Sexy comment map............|NERDComSexyComment|
+            3.2.7 Yank comment map............|NERDComYankComment|
+            3.2.8 Comment to EOL map..........|NERDComEOLComment|
+            3.2.9 Append com to line map......|NERDComAppendComment|
+            3.2.10 Insert comment map.........|NERDComInsertComment|
+            3.2.11 Use alternate delims map...|NERDComAltDelim|
+            3.2.12 Comment aligned maps.......|NERDComAlignedComment|
+            3.2.13 Uncomment line map.........|NERDComUncommentLine|
+        3.4 Sexy Comments.....................|NERDComSexyComments|
+        3.5 The NERDComment function..........|NERDComNERDComment|
+    4.Options.................................|NERDComOptions|
+        4.1 Options summary...................|NERDComOptionsSummary|
+        4.2 Options details...................|NERDComOptionsDetails|
+        4.3 Default delimiter Options.........|NERDComDefaultDelims|
+    5. Customising key mappings...............|NERDComMappings|
+    6. Issues with the script.................|NERDComIssues|
+        6.1 Delimiter detection heuristics....|NERDComHeuristics|
+        6.2 Nesting issues....................|NERDComNesting|
+    7.About..     ............................|NERDComAbout|
+    8.Changelog...............................|NERDComChangelog|
+    9.Credits.................................|NERDComCredits|
+    10.License................................|NERDComLicense|
+
+==============================================================================
+1. Intro                                                       *NERDCommenter*
+
+The NERD commenter provides many different commenting operations and styles
+which are invoked via key mappings and a menu. These operations are available
+for most filetypes.
+
+There are also options that allow to tweak the commenting engine to your
+taste.
+
+==============================================================================
+2. Installation                                          *NERDComInstallation*
+
+The NERD Commenter requires Vim 7 or higher.
+
+Extract the plugin files in your ~/.vim (*nix) or ~/vimfiles (Windows). You
+should have 2 files: >
+    plugin/NERD_commenter.vim
+    doc/NERD_commenter.txt
+<
+Next, to finish installing the help file run: >
+    :helptags ~/.vim/doc
+<
+See |add-local-help| for more details.
+
+Make sure that you have filetype plugins enabled, as the script makes use of
+|'commentstring'| where possible (which is usually set in a filetype plugin).
+See |filetype-plugin-on| for details, but basically, stick this in your vimrc >
+    filetype plugin on
+<
+
+==============================================================================
+3. Functionality provided                               *NERDComFunctionality*
+
+------------------------------------------------------------------------------
+3.1 Functionality summary                        *NERDComFunctionalitySummary*
+
+The following key mappings are provided by default (there is also a menu
+with items corresponding to all the mappings below):
+
+[count]<leader>cc |NERDComComment|
+Comment out the current line or text selected in visual mode.
+
+
+[count]<leader>cn |NERDComNestedComment|
+Same as <leader>cc but forces nesting.
+
+
+[count]<leader>c<space> |NERDComToggleComment|
+Toggles the comment state of the selected line(s). If the topmost selected
+line is commented, all selected lines are uncommented and vice versa.
+
+
+[count]<leader>cm |NERDComMinimalComment|
+Comments the given lines using only one set of multipart delimiters.
+
+
+[count]<leader>ci |NERDComInvertComment|
+Toggles the comment state of the selected line(s) individually.
+
+
+[count]<leader>cs |NERDComSexyComment|
+Comments out the selected lines ``sexily''
+
+
+[count]<leader>cy |NERDComYankComment|
+Same as <leader>cc except that the commented line(s) are yanked first.
+
+
+<leader>c$ |NERDComEOLComment|
+Comments the current line from the cursor to the end of line.
+
+
+<leader>cA |NERDComAppendComment|
+Adds comment delimiters to the end of line and goes into insert mode between
+them.
+
+
+|NERDComInsertComment|
+Adds comment delimiters at the current cursor position and inserts between.
+Disabled by default.
+
+
+<leader>ca |NERDComAltDelim|
+Switches to the alternative set of delimiters.
+
+
+[count]<leader>cl
+[count]<leader>cb    |NERDComAlignedComment|
+Same as |NERDComComment| except that the delimiters are aligned down the
+left side (<leader>cl) or both sides (<leader>cb).
+
+
+[count]<leader>cu |NERDComUncommentLine|
+Uncomments the selected line(s).
+
+------------------------------------------------------------------------------
+3.2 Functionality details                        *NERDComFunctionalityDetails*
+
+------------------------------------------------------------------------------
+3.2.1 Comment map                                             *NERDComComment*
+
+Default mapping: [count]<leader>cc
+Mapped to: <plug>NERDCommenterComment
+Applicable modes: normal visual visual-line visual-block.
+
+
+Comments out the current line. If multiple lines are selected in visual-line
+mode, they are all commented out.  If some text is selected in visual or
+visual-block mode then the script will try to comment out the exact text that
+is selected using multi-part delimiters if they are available.
+
+If a [count] is given in normal mode, the mapping works as though that many
+lines were selected in visual-line mode.
+
+------------------------------------------------------------------------------
+3.2.2 Nested comment map                                *NERDComNestedComment*
+
+Default mapping: [count]<leader>cn
+Mapped to: <plug>NERDCommenterNest
+Applicable modes: normal visual visual-line visual-block.
+
+Performs nested commenting.  Works the same as <leader>cc except that if a line
+is already commented then it will be commented again.
+
+If |'NERDUsePlaceHolders'| is set then the previous comment delimiters will
+be replaced by place-holder delimiters if needed.  Otherwise the nested
+comment will only be added if the current commenting delimiters have no right
+delimiter (to avoid syntax errors)
+
+If a [count] is given in normal mode, the mapping works as though that many
+lines were selected in visual-line mode.
+
+Related options:
+|'NERDDefaultNesting'|
+
+------------------------------------------------------------------------------
+3.2.3 Toggle comment map                                *NERDComToggleComment*
+
+Default mapping: [count]<leader>c<space>
+Mapped to: <plug>NERDCommenterToggle
+Applicable modes: normal visual-line.
+
+Toggles commenting of the lines selected. The behaviour of this mapping
+depends on whether the first line selected is commented or not.  If so, all
+selected lines are uncommented and vice versa.
+
+With this mapping, a line is only considered to be commented if it starts with
+a left delimiter.
+
+If a [count] is given in normal mode, the mapping works as though that many
+lines were selected in visual-line mode.
+
+------------------------------------------------------------------------------
+3.2.4 Minimal comment map                              *NERDComMinimalComment*
+
+Default mapping: [count]<leader>cm
+Mapped to: <plug>NERDCommenterMinimal
+Applicable modes: normal visual-line.
+
+Comments the selected lines using one set of multipart delimiters if possible.
+
+For example: if you are programming in c and you select 5 lines and press
+<leader>cm then a '/*' will be placed at the start of the top line and a '*/'
+will be placed at the end of the last line.
+
+Sets of multipart comment delimiters that are between the top and bottom
+selected lines are replaced with place holders (see |'NERDLPlace'|) if
+|'NERDUsePlaceHolders'| is set for the current filetype. If it is not, then
+the comment will be aborted if place holders are required to prevent illegal
+syntax.
+
+If a [count] is given in normal mode, the mapping works as though that many
+lines were selected in visual-line mode.
+
+------------------------------------------------------------------------------
+3.2.5 Invert comment map                                *NERDComInvertComment*
+
+Default mapping: <leader>ci
+Mapped to: <plug>NERDCommenterInvert
+Applicable modes: normal visual-line.
+
+Inverts the commented state of each selected line. If the a selected line is
+commented then it is uncommented and vice versa. Each line is examined and
+commented/uncommented individually.
+
+With this mapping, a line is only considered to be commented if it starts with
+a left delimiter.
+
+If a [count] is given in normal mode, the mapping works as though that many
+lines were selected in visual-line mode.
+
+------------------------------------------------------------------------------
+3.2.6 Sexy comment map                                    *NERDComSexyComment*
+
+Default mapping: [count]<leader>cs
+Mapped to: <plug>NERDCommenterSexy
+Applicable modes: normal, visual-line.
+
+Comments the selected line(s) ``sexily''... see |NERDComSexyComments| for
+a description of what sexy comments are. Can only be done on filetypes for
+which there is at least one set of multipart comment delimiters specified.
+
+Sexy comments cannot be nested and lines inside a sexy comment cannot be
+commented again.
+
+If a [count] is given in normal mode, the mapping works as though that many
+lines were selected in visual-line mode.
+
+Related options:
+|'NERDCompactSexyComs'|
+
+------------------------------------------------------------------------------
+3.2.7 Yank comment map                                    *NERDComYankComment*
+
+Default mapping: [count]<leader>cy
+Mapped to: <plug>NERDCommenterYank
+Applicable modes: normal visual visual-line visual-block.
+
+Same as <leader>cc except that it yanks the line(s) that are commented first.
+
+------------------------------------------------------------------------------
+3.2.8 Comment to EOL map                                   *NERDComEOLComment*
+
+Default mapping: <leader>c$
+Mapped to: <plug>NERDCommenterToEOL
+Applicable modes: normal.
+
+Comments the current line from the current cursor position up to the end of
+the line.
+
+------------------------------------------------------------------------------
+3.2.9 Append com to line map                            *NERDComAppendComment*
+
+Default mapping: <leader>cA
+Mapped to: <plug>NERDCommenterAppend
+Applicable modes: normal.
+
+Appends comment delimiters to the end of the current line and goes
+to insert mode between the new delimiters.
+
+------------------------------------------------------------------------------
+3.2.10 Insert comment map                               *NERDComInsertComment*
+
+Default mapping: disabled by default.
+Map it to: <plug>NERDCommenterInInsert
+Applicable modes: insert.
+
+Adds comment delimiters at the current cursor position and inserts
+between them.
+
+NOTE: prior to version 2.1.17 this was mapped to ctrl-c. To restore this
+mapping add >
+    let NERDComInsertMap='<c-c>'
+<
+to your vimrc.
+
+------------------------------------------------------------------------------
+3.2.11 Use alternate delims map                              *NERDComAltDelim*
+
+Default mapping: <leader>ca
+Mapped to: <plug>NERDCommenterAltDelims
+Applicable modes: normal.
+
+Changes to the alternative commenting style if one is available. For example,
+if the user is editing a c++ file using // comments and they hit <leader>ca
+then they will be switched over to /**/ comments.
+
+See also |NERDComDefaultDelims|
+
+------------------------------------------------------------------------------
+3.2.12 Comment aligned maps                            *NERDComAlignedComment*
+
+Default mappings: [count]<leader>cl   [count]<leader>cb
+Mapped to: <plug>NERDCommenterAlignLeft
+           <plug>NERDCommenterAlignBoth
+Applicable modes: normal visual-line.
+
+Same as <leader>cc except that the comment delimiters are aligned on the left
+side or both sides respectively. These comments are always nested if the
+line(s) are already commented.
+
+If a [count] is given in normal mode, the mapping works as though that many
+lines were selected in visual-line mode.
+
+------------------------------------------------------------------------------
+3.2.13 Uncomment line map                               *NERDComUncommentLine*
+
+Default mapping: [count]<leader>cu
+Mapped to: <plug>NERDCommenterUncomment
+Applicable modes: normal visual visual-line visual-block.
+
+Uncomments the current line. If multiple lines are selected in
+visual mode then they are all uncommented.
+
+When uncommenting, if the line contains multiple sets of delimiters then the
+``outtermost'' pair of delimiters will be removed.
+
+The script uses a set of heurisics to distinguish ``real'' delimiters from
+``fake'' ones when uncommenting. See |NERDComIssues| for details.
+
+If a [count] is given in normal mode, the mapping works as though that many
+lines were selected in visual-line mode.
+
+Related  options:
+|'NERDRemoveAltComs'|
+|'NERDRemoveExtraSpaces'|
+
+------------------------------------------------------------------------------
+3.3 Sexy Comments                                        *NERDComSexyComments*
+These are comments that use one set of multipart comment delimiters as well as
+one other marker symbol. For example: >
+    /*
+     * This is a c style sexy comment
+     * So there!
+     */
+
+    /* This is a c style sexy comment
+     * So there!
+     * But this one is ``compact'' style */
+<
+Here the multipart delimiters are /* and */ and the marker is *.
+
+------------------------------------------------------------------------------
+3.4 The NERDComment function                             *NERDComNERDComment*
+
+All of the NERD commenter mappings and menu items invoke a single function
+which delegates the commenting work to other functions. This function is
+public and has the prototype: >
+    function! NERDComment(isVisual, type)
+<
+The arguments to this function are simple:
+    - isVisual: if you wish to do any kind of visual comment then set this to
+      1 and the function will use the '< and '> marks to find the comment
+      boundries. If set to 0 then the function will operate on the current
+      line.
+    - type: is used to specify what type of commenting operation is to be
+      performed, and it can be one of the following: "sexy", "invert",
+      "minimal", "toggle", "alignLeft", "alignBoth", "norm", "nested",
+      "toEOL", "append", "insert", "uncomment", "yank"
+
+For example, if you typed >
+    :call NERDComment(1, 'sexy')
+<
+then the script would do a sexy comment on the last visual selection.
+
+
+==============================================================================
+4. Options                                                    *NERDComOptions*
+
+------------------------------------------------------------------------------
+4.1 Options summary                                    *NERDComOptionsSummary*
+
+|'loaded_nerd_comments'|              Turns off the script.
+|'NERDAllowAnyVisualDelims'|          Allows multipart alternative delims to
+                                      be used when commenting in
+                                      visual/visual-block mode.
+|'NERDBlockComIgnoreEmpty'|           Forces right delims to be placed when
+                                      doing visual-block comments.
+|'NERDCommentWholeLinesInVMode'|      Changes behaviour of visual comments.
+|'NERDCreateDefaultMappings'|         Turn the default mappings on/off.
+|'NERDDefaultNesting'|                Tells the script to use nested comments
+                                      by default.
+|'NERDMenuMode'|                      Specifies how the NERD commenter menu
+                                      will appear (if at all).
+|'NERDLPlace'|                        Specifies what to use as the left
+                                      delimiter placeholder when nesting
+                                      comments.
+|'NERDUsePlaceHolders'|               Specifies which filetypes may use
+                                      placeholders when nesting comments.
+|'NERDRemoveAltComs'|                 Tells the script whether to remove
+                                      alternative comment delimiters when
+                                      uncommenting.
+|'NERDRemoveExtraSpaces'|             Tells the script to always remove the
+                                      extra spaces when uncommenting
+                                      (regardless of whether NERDSpaceDelims
+                                      is set)
+|'NERDRPlace'|                        Specifies what to use as the right
+                                      delimiter placeholder when nesting
+                                      comments.
+|'NERDSpaceDelims'|                   Specifies whether to add extra spaces
+                                      around delimiters when commenting, and
+                                      whether to remove them when
+                                      uncommenting.
+|'NERDCompactSexyComs'|               Specifies whether to use the compact
+                                      style sexy comments.
+
+------------------------------------------------------------------------------
+4.3 Options details                                    *NERDComOptionsDetails*
+
+To enable any of the below options you should put the given line in your
+~/.vimrc
+
+                                                       *'loaded_nerd_comments'*
+If this script is driving you insane you can turn it off by setting this
+option >
+    let loaded_nerd_comments=1
+<
+------------------------------------------------------------------------------
+                                                    *'NERDAllowAnyVisualDelims'*
+Values: 0 or 1.
+Default: 1.
+
+If set to 1 then, when doing a visual or visual-block comment (but not a
+visual-line comment), the script will choose the right delimiters to use for
+the comment. This means either using the current delimiters if they are
+multipart or using the alternative delimiters if THEY are multipart.  For
+example if we are editing the following java code: >
+    float foo = 1221;
+    float bar = 324;
+    System.out.println(foo * bar);
+<
+If we are using // comments and select the "foo" and "bar" in visual-block
+mode, as shown left below (where '|'s are used to represent the visual-block
+boundary), and comment it then the script will use the alternative delims as
+shown on the right: >
+
+    float |foo| = 1221;                   float /*foo*/ = 1221;
+    float |bar| = 324;                    float /*bar*/ = 324;
+    System.out.println(foo * bar);        System.out.println(foo * bar);
+<
+------------------------------------------------------------------------------
+                                                     *'NERDBlockComIgnoreEmpty'*
+Values: 0 or 1.
+Default: 1.
+
+This option  affects visual-block mode commenting. If this option is turned
+on, lines that begin outside the right boundary of the selection block will be
+ignored.
+
+For example, if you are commenting this chunk of c code in visual-block mode
+(where the '|'s are used to represent the visual-block boundary) >
+    #include <sys/types.h>
+    #include <unistd.h>
+    #include <stdio.h>
+   |int| main(){
+   |   | printf("SUCK THIS\n");
+   |   | while(1){
+   |   |     fork();
+   |   | }
+   |}  |
+<
+If NERDBlockComIgnoreEmpty=0 then this code will become: >
+    #include <sys/types.h>
+    #include <unistd.h>
+    #include <stdio.h>
+    /*int*/ main(){
+    /*   */ printf("SUCK THIS\n");
+    /*   */ while(1){
+    /*   */     fork();
+    /*   */ }
+    /*}  */
+<
+Otherwise, the code block would become: >
+    #include <sys/types.h>
+    #include <unistd.h>
+    #include <stdio.h>
+    /*int*/ main(){
+    printf("SUCK THIS\n");
+    while(1){
+        fork();
+    }
+    /*}  */
+<
+------------------------------------------------------------------------------
+                                                *'NERDCommentWholeLinesInVMode'*
+Values: 0, 1 or 2.
+Default: 0.
+
+By default the script tries to comment out exactly what is selected in visual
+mode (v). For example if you select and comment the following c code (using |
+to represent the visual boundary): >
+    in|t foo = 3;
+    int bar =| 9;
+    int baz = foo + bar;
+<
+This will result in: >
+    in/*t foo = 3;*/
+    /*int bar =*/ 9;
+    int baz = foo + bar;
+<
+But some people prefer it if the whole lines are commented like: >
+    /*int foo = 3;*/
+    /*int bar = 9;*/
+    int baz = foo + bar;
+<
+If you prefer the second option then stick this line in your vimrc: >
+    let NERDCommentWholeLinesInVMode=1
+<
+
+If the filetype you are editing only has no multipart delimiters (for example
+a shell script) and you hadnt set this option then the above would become >
+    in#t foo = 3;
+    #int bar = 9;
+<
+(where # is the comment delimiter) as this is the closest the script can
+come to commenting out exactly what was selected. If you prefer for whole
+lines to be commented out when there is no multipart delimiters but the EXACT
+text that was selected to be commented out if there IS multipart delimiters
+then stick the following line in your vimrc: >
+    let NERDCommentWholeLinesInVMode=2
+<
+
+Note that this option does not affect the behaviour of commenting in
+|visual-block| mode.
+
+------------------------------------------------------------------------------
+                                                *'NERDCreateDefaultMappings'*
+Values: 0 or 1.
+Default: 1.
+
+If set to 0, none of the default mappings will be created.
+
+See also |NERDComMappings|.
+
+------------------------------------------------------------------------------
+                                                           *'NERDRemoveAltComs'*
+Values: 0 or 1.
+Default: 1.
+
+When uncommenting a line (for a filetype with an alternative commenting style)
+this option tells the script whether to look for, and remove, comment
+delimiters of the alternative style.
+
+For example, if you are editing a c++ file using // style comments and you go
+<leader>cu on this line: >
+    /* This is a c++ comment baby! */
+<
+It will not be uncommented if the NERDRemoveAltComs is set to 0.
+
+------------------------------------------------------------------------------
+                                                       *'NERDRemoveExtraSpaces'*
+Values: 0 or 1.
+Default: 1.
+
+By default, the NERD commenter will remove spaces around comment delimiters if
+either:
+1. |'NERDSpaceDelims'| is set to 1.
+2. NERDRemoveExtraSpaces is set to 1.
+
+This means that if we have the following lines in a c code file: >
+    /* int foo = 5; */
+    /* int bar = 10; */
+    int baz = foo + bar
+<
+If either of the above conditions hold then if these lines are uncommented
+they will become: >
+    int foo = 5;
+    int bar = 10;
+    int baz = foo + bar
+<
+Otherwise they would become: >
+     int foo = 5;
+     int bar = 10;
+    int baz = foo + bar
+<
+If you want the spaces to be removed only if |'NERDSpaceDelims'| is set then
+set NERDRemoveExtraSpaces to 0.
+
+------------------------------------------------------------------------------
+                                                                  *'NERDLPlace'*
+                                                                  *'NERDRPlace'*
+Values: arbitrary string.
+Default:
+    NERDLPlace: "[>"
+    NERDRPlace: "<]"
+
+These options are used to control the strings used as place-holder delimiters.
+Place holder delimiters are used when performing nested commenting when the
+filetype supports commenting styles with both left and right delimiters.
+To set these options use lines like: >
+    let NERDLPlace="FOO"
+    let NERDRPlace="BAR"
+<
+Following the above example, if we have line of c code: >
+    /* int horse */
+<
+and we comment it with <leader>cn it will be changed to: >
+    /*FOO int horse BAR*/
+<
+When we uncomment this line it will go back to what it was.
+
+------------------------------------------------------------------------------
+                                                                *'NERDMenuMode'*
+Values: 0, 1, 2, 3.
+Default: 3
+
+This option can take 4 values:
+    "0": Turns the menu off.
+    "1": Turns the 'comment' menu on with no menu shortcut.
+    "2": Turns the 'comment 'menu on with <alt>-c as the shortcut.
+    "3": Turns the 'Plugin -> comment' menu on with <alt>-c as the shortcut.
+
+------------------------------------------------------------------------------
+                                                         *'NERDUsePlaceHolders'*
+Values: 0 or 1.
+Default 1.
+
+This option is used to specify whether place-holder delimiters should be used
+when creating a nested comment.
+
+------------------------------------------------------------------------------
+                                                             *'NERDSpaceDelims'*
+Values: 0 or 1.
+Default 0.
+
+Some people prefer a space after the left delimiter and before the right
+delimiter like this: >
+    /* int foo=2; */
+<
+as opposed to this: >
+    /*int foo=2;*/
+<
+If you want spaces to be added then set NERDSpaceDelims to 1 in your vimrc.
+
+See also |'NERDRemoveExtraSpaces'|.
+
+------------------------------------------------------------------------------
+                                                         *'NERDCompactSexyComs'*
+Values: 0 or 1.
+Default 0.
+
+Some people may want their sexy comments to be like this: >
+    /* Hi There!
+     * This is a sexy comment
+     * in c */
+<
+As opposed to like this: >
+    /*
+     * Hi There!
+     * This is a sexy comment
+     * in c
+     */
+<
+If this option is set to 1 then the top style will be used.
+
+------------------------------------------------------------------------------
+                                                          *'NERDDefaultNesting'*
+Values: 0 or 1.
+Default 1.
+
+When this option is set to 1, comments are nested automatically. That is, if
+you hit <leader>cc on a line that is already commented it will be commented
+again.
+
+------------------------------------------------------------------------------
+3.3 Default delimiter customisation                     *NERDComDefaultDelims*
+
+If you want the NERD commenter to use the alternative delimiters for a
+specific filetype by default then put a line of this form into your vimrc: >
+    let NERD_<filetype>_alt_style=1
+<
+Example: java uses // style comments by default, but you want it to default to
+/* */ style comments instead. You would put this line in your vimrc: >
+    let NERD_java_alt_style=1
+<
+
+See |NERDComAltDelim| for switching commenting styles at runtime.
+
+==============================================================================
+5. Key mapping customisation                                *NERDComMappings*
+
+To change a mapping just map another key combo to the internal <plug> mapping.
+For example, to remap the |NERDComComment| mapping to ",omg" you would put
+this line in your vimrc: >
+    map ,omg <plug>NERDCommenterComment
+<
+This will stop the corresponding default mappings from being created.
+
+See the help for the mapping in question to see which <plug> mapping to
+map to.
+
+See also |'NERDCreateDefaultMappings'|.
+
+==============================================================================
+6. Issues with the script                                      *NERDComIssues*
+
+
+------------------------------------------------------------------------------
+6.1 Delimiter detection heuristics                         *NERDComHeuristics*
+
+Heuristics are used to distinguish the real comment delimiters
+
+Because we have comment mappings that place delimiters in the middle of lines,
+removing comment delimiters is a bit tricky. This is because if comment
+delimiters appear in a line doesnt mean they really ARE delimiters. For
+example, Java uses // comments but the line >
+    System.out.println("//");
+<
+clearly contains no real comment delimiters.
+
+To distinguish between ``real'' comment delimiters and ``fake'' ones we use a
+set of heuristics. For example, one such heuristic states that any comment
+delimiter that has an odd number of non-escaped " characters both preceding
+and following it on the line is not a comment because it is probably part of a
+string. These heuristics, while usually pretty accurate, will not work for all
+cases.
+
+------------------------------------------------------------------------------
+6.2 Nesting issues                                            *NERDComNesting*
+
+If we have some line of code like this: >
+    /*int foo */ = /*5 + 9;*/
+<
+This will not be uncommented legally. The NERD commenter will remove the
+"outter most" delimiters so the line will become: >
+    int foo */ = /*5 + 9;
+<
+which almost certainly will not be what you want. Nested sets of comments will
+uncomment fine though. Eg: >
+    /*int/* foo =*/ 5 + 9;*/
+<
+will become: >
+    int/* foo =*/ 5 + 9;
+<
+(Note that in the above examples I have deliberately not used place holders
+for simplicity)
+
+==============================================================================
+7. About                                                        *NERDComAbout*
+
+The author of the NERD commenter is Martyzillatron --- the half robot, half
+dinosaur bastard son of Megatron and Godzilla. He enjoys destroying
+metropolises and eating tourist busses.
+
+Drop him a line at martin_grenfell at msn.com. He would love to hear from you.
+its a lonely life being the worlds premier terror machine. How would you feel
+if your face looked like a toaster and a t-rex put together? :(
+
+The latest stable versions can be found at
+    http://www.vim.org/scripts/script.php?script_id=1218
+
+The latest dev versions are on github
+    http://github.com/scrooloose/nerdcommenter
+
+==============================================================================
+8. Changelog                                                *NERDComChangelog*
+
+2.3.0
+    - remove all filetypes which have a &commentstring in the standard vim
+      runtime for vim > 7.0 unless the script stores an alternate set of
+      delimiters
+    - make the script complain if the user doesnt have filetype plugins enabled
+    - use <leader> instead of comma to start the default mappings
+    - fix a couple of bugs with sexy comments - thanks to Tim Smart
+    - lots of refactoring
+
+2.2.2
+    - remove the NERDShutup option and the message is suppresses, this makes
+      the plugin silently rely on &commentstring for unknown filetypes.
+    - add support for dhcpd, limits, ntp, resolv, rgb, sysctl, udevconf and
+      udevrules. Thanks to Thilo Six.
+    - match filetypes case insensitively
+    - add support for mp (metapost), thanks to Andrey Skvortsov.
+    - add support for htmlcheetah, thanks to Simon Hengel.
+    - add support for javacc, thanks to Matt Tolton.
+    - make <%# %> the default delims for eruby, thanks to tpope.
+    - add support for javascript.jquery, thanks to Ivan Devat.
+    - add support for cucumber and pdf. Fix sass and railslog delims,
+      thanks to tpope
+
+2.2.1
+    - add support for newlisp and clojure, thanks to Matthew Lee Hinman.
+    - fix automake comments, thanks to Elias Pipping
+    - make haml comments default to -# with / as the alternative delimiter,
+      thanks to tpope
+    - add support for actionscript and processing thanks to Edwin Benavides
+    - add support for ps1 (powershell), thanks to Jason Mills
+    - add support for hostsaccess, thanks to Thomas Rowe
+    - add support for CVScommit
+    - add support for asciidoc, git and gitrebase. Thanks to Simon Ruderich.
+    - use # for gitcommit comments, thanks to Simon Ruderich.
+    - add support for mako and genshi, thanks to Keitheis.
+    - add support for conkyrc, thanks to David
+    - add support for SVNannotate, thanks to Miguel Jaque Barbero.
+    - add support for sieve, thanks to Stefan Walk
+    - add support for objj, thanks to Adam Thorsen.
+
+2.2.0
+    - rewrote the mappings system to be more "standard".
+      - removed all the mapping options. Now, mappings to <plug> mappings are
+        used
+      - see :help NERDComMappings, and :help NERDCreateDefaultMappings for
+        more info
+    - remove "prepend comments" and "right aligned comments".
+    - add support for applescript, calbire, man, SVNcommit, potwiki, txt2tags and SVNinfo.
+      Thanks to nicothakis, timberke, sgronblo, mntnoe, Bernhard Grotz, John
+      O'Shea, Franรงois and Giacomo Mariani respectively.
+    - bugfix for haskell delimiters. Thanks to mntnoe.
+2.1.18
+    - add support for llvm. Thanks to nicothakis.
+    - add support for xquery. Thanks to Phillip Kovalev.
+2.1.17
+    - fixed haskell delimiters (hackily). Thanks to Elias Pipping.
+    - add support for mailcap. Thanks to Pascal Brueckner.
+    - add support for stata. Thanks to Jerรณnimo Carballo.
+    - applied a patch from ewfalor to fix an error in the help file with the
+      NERDMapleader doc
+    - disable the insert mode ctrl-c mapping by default, see :help
+      NERDComInsertComment if you wish to restore it
+
+==============================================================================
+9. Credits                                                    *NERDComCredits*
+
+Thanks to the follow people for suggestions and patches:
+
+Nick Brettell
+Matthew Hawkins
+Mathieu Clabaut
+Greg Searle
+Nguyen
+Litchi
+Jorge Scandaliaris
+Shufeng Zheng
+Martin Stubenschrott
+Markus Erlmann
+Brent Rice
+Richard Willis
+Igor Prischepoff
+Harry
+David Bourgeois
+Eike Von Seggern
+Torsten Blix
+Alexander Bosecke
+Stefano Zacchiroli
+Norick Chen
+Joseph Barker
+Gary Church
+Tim Carey-Smith
+Markus Klinik
+Anders
+Seth Mason
+James Hales
+Heptite
+Cheng Fang
+Yongwei Wu
+David Miani
+Jeremy Hinegardner
+Marco
+Ingo Karkat
+Zhang Shuhan
+tpope
+Ben Schmidt
+David Fishburn
+Erik Falor
+JaGoTerr
+Elias Pipping
+mntnoe
+Mark S.
+
+
+Thanks to the following people for sending me new filetypes to support:
+
+The hackers                         The filetypes~
+Sam R                               verilog
+Jonathan                            Derque context, plaintext and mail
+Vigil                               fetchmail
+Michael Brunner                     kconfig
+Antono Vasiljev                     netdict
+Melissa Reid                        omlet
+Ilia N Ternovich                    quickfix
+John O'Shea                         RTF, SVNcommitlog and vcscommit, SVNCommit
+Anders                              occam
+Mark Woodward                       csv
+fREW                                gentoo-package-mask,
+                                    gentoo-package-keywords,
+                                    gentoo-package-use, and vo_base
+Alexey                              verilog_systemverilog, systemverilog
+Lizendir                            fstab
+Michael Bรถhler                      autoit, autohotkey and docbk
+Aaron Small                         cmake
+Ramiro                              htmldjango and django
+Stefano Zacchiroli                  debcontrol, debchangelog, mkd
+Alex Tarkovsky                      ebuild and eclass
+Jorge Rodrigues                     gams
+Rainer Mรผller                       Objective C
+Jason Mills                         Groovy, ps1
+Normandie Azucena                   vera
+Florian Apolloner                   ldif
+David Fishburn                      lookupfile
+Niels Aan de Brugh                  rst
+Don Hatlestad                       ahk
+Christophe Benz                     Desktop and xsd
+Eyolf ร˜strem                        lilypond, bbx and lytex
+Ingo Karkat                         dosbatch
+Nicolas Weber                       markdown, objcpp
+tinoucas                            gentoo-conf-d
+Greg Weber                          D, haml
+Bruce Sherrod                       velocity
+timberke                            cobol, calibre
+Aaron Schaefer                      factor
+Mr X                                asterisk, mplayerconf
+Kuchma Michael                      plsql
+Brett Warneke                       spectre
+Pipp                                lhaskell
+Renald Buter                        scala
+Vladimir Lomov                      asymptote
+Marco                               mrxvtrc, aap
+nicothakis                          SVNAnnotate, CVSAnnotate, SVKAnnotate,
+                                    SVNdiff, gitAnnotate, gitdiff, dtrace
+                                    llvm, applescript
+Chen Xing                           Wikipedia
+Jacobo Diaz                         dakota, patran
+Li Jin                              gentoo-env-d, gentoo-init-d,
+                                    gentoo-make-conf, grub, modconf, sudoers
+SpookeyPeanut                       rib
+Greg Jandl                          pyrex/cython
+Christophe Benz                     services, gitcommit
+A Pontus                            vimperator
+Stromnov                            slice, bzr
+Martin Kustermann                   pamconf
+Indriรฐi Einarsson                   mason
+Chris                               map
+Krzysztof A. Adamski                group
+Pascal Brueckner                    mailcap
+Jerรณnimo Carballo                   stata
+Phillip Kovalev                     xquery
+Bernhard Grotz                      potwiki
+sgronblo                            man
+Franรงois                            txt2tags
+Giacomo Mariani                     SVNinfo
+Matthew Lee Hinman                  newlisp, clojure
+Elias Pipping                       automake
+Edwin Benavides                     actionscript, processing
+Thomas Rowe                         hostsaccess
+Simon Ruderich                      asciidoc, git, gitcommit, gitrebase
+Keitheis                            mako, genshi
+David                               conkyrc
+Miguel Jaque Barbero                SVNannotate
+Stefan Walk                         sieve
+Adam Thorsen                        objj
+Thilo Six                           dhcpd, limits, ntp, resolv, rgb, sysctl,
+                                    udevconf, udevrules
+Andrey Skvortsov                    mp
+Simon Hengel                        htmlcheetah
+Matt Tolton                         javacc
+Ivan Devat                          javascript.jquery
+tpope                               cucumber,pdf
+==============================================================================
+10. License                                                   *NERDComLicense*
+
+The NERD commenter is released under the wtfpl.
+See http://sam.zoy.org/wtfpl/COPYING.
diff --git a/vim/doc/NERD_tree.txt b/vim/doc/NERD_tree.txt
new file mode 100644 (file)
index 0000000..5ff0651
--- /dev/null
@@ -0,0 +1,1226 @@
+*NERD_tree.txt*   A tree explorer plugin that owns your momma!
+
+
+
+    omg its ... ~
+
+    ________  ________   _   ____________  ____     __________  ____________~
+   /_  __/ / / / ____/  / | / / ____/ __ \/ __ \   /_  __/ __ \/ ____/ ____/~
+    / / / /_/ / __/    /  |/ / __/ / /_/ / / / /    / / / /_/ / __/ / __/   ~
+   / / / __  / /___   / /|  / /___/ _, _/ /_/ /    / / / _, _/ /___/ /___   ~
+  /_/ /_/ /_/_____/  /_/ |_/_____/_/ |_/_____/    /_/ /_/ |_/_____/_____/   ~
+
+
+                              Reference Manual~
+
+
+
+
+==============================================================================
+CONTENTS                                                   *NERDTree-contents*
+
+    1.Intro...................................|NERDTree|
+    2.Functionality provided..................|NERDTreeFunctionality|
+        2.1.Global commands...................|NERDTreeGlobalCommands|
+        2.2.Bookmarks.........................|NERDTreeBookmarks|
+            2.2.1.The bookmark table..........|NERDTreeBookmarkTable|
+            2.2.2.Bookmark commands...........|NERDTreeBookmarkCommands|
+            2.2.3.Invalid bookmarks...........|NERDTreeInvalidBookmarks|
+        2.3.NERD tree mappings................|NERDTreeMappings|
+        2.4.The NERD tree menu................|NERDTreeMenu|
+    3.Options.................................|NERDTreeOptions|
+        3.1.Option summary....................|NERDTreeOptionSummary|
+        3.2.Option details....................|NERDTreeOptionDetails|
+    4.The NERD tree API.......................|NERDTreeAPI|
+        4.1.Key map API.......................|NERDTreeKeymapAPI|
+        4.2.Menu API..........................|NERDTreeMenuAPI|
+    5.About...................................|NERDTreeAbout|
+    6.Changelog...............................|NERDTreeChangelog|
+    7.Credits.................................|NERDTreeCredits|
+    8.License.................................|NERDTreeLicense|
+
+==============================================================================
+1. Intro                                                            *NERDTree*
+
+What is this "NERD tree"??
+
+The NERD tree allows you to explore your filesystem and to open files and
+directories. It presents the filesystem to you in the form of a tree which you
+manipulate with the keyboard and/or mouse. It also allows you to perform
+simple filesystem operations.
+
+The following features and functionality are provided by the NERD tree:
+    * Files and directories are displayed in a hierarchical tree structure
+    * Different highlighting is provided for the following types of nodes:
+        * files
+        * directories
+        * sym-links
+        * windows .lnk files
+        * read-only files
+        * executable files
+    * Many (customisable) mappings are provided to manipulate the tree:
+        * Mappings to open/close/explore directory nodes
+        * Mappings to open files in new/existing windows/tabs
+        * Mappings to change the current root of the tree
+        * Mappings to navigate around the tree
+        * ...
+    * Directories and files can be bookmarked.
+    * Most NERD tree navigation can also be done with the mouse
+    * Filtering of tree content (can be toggled at runtime)
+        * custom file filters to prevent e.g. vim backup files being displayed
+        * optional displaying of hidden files (. files)
+        * files can be "turned off" so that only directories are displayed
+    * The position and size of the NERD tree window can be customised
+    * The order in which the nodes in the tree are listed can be customised.
+    * A model of your filesystem is created/maintained as you explore it. This
+      has several advantages:
+        * All filesystem information is cached and is only re-read on demand
+        * If you revisit a part of the tree that you left earlier in your
+          session, the directory nodes will be opened/closed as you left them
+    * The script remembers the cursor position and window position in the NERD
+      tree so you can toggle it off (or just close the tree window) and then
+      reopen it (with NERDTreeToggle) the NERD tree window will appear exactly
+      as you left it
+    * You can have a separate NERD tree for each tab, share trees across tabs,
+      or a mix of both.
+    * By default the script overrides the default file browser (netw), so if
+      you :edit a directory a (slighly modified) NERD tree will appear in the
+      current window
+    * A programmable menu system is provided (simulates right clicking on a
+      node)
+        * one default menu plugin is provided to perform basic filesytem
+          operations (create/delete/move/copy files/directories)
+    * There's an API for adding your own keymappings
+
+
+==============================================================================
+2. Functionality provided                              *NERDTreeFunctionality*
+
+------------------------------------------------------------------------------
+2.1. Global Commands                                  *NERDTreeGlobalCommands*
+
+:NERDTree [<start-directory> | <bookmark>]                         *:NERDTree*
+    Opens a fresh NERD tree. The root of the tree depends on the argument
+    given. There are 3 cases: If no argument is given, the current directory
+    will be used.  If a directory is given, that will be used. If a bookmark
+    name is given, the corresponding directory will be used.  For example: >
+        :NERDTree /home/marty/vim7/src
+        :NERDTree foo   (foo is the name of a bookmark)
+<
+:NERDTreeFromBookmark <bookmark>                       *:NERDTreeFromBookmark*
+    Opens a fresh NERD tree with the root initialized to the dir for
+    <bookmark>.  This only reason to use this command over :NERDTree is for
+    the completion (which is for bookmarks rather than directories).
+
+:NERDTreeToggle [<start-directory> | <bookmark>]             *:NERDTreeToggle*
+    If a NERD tree already exists for this tab, it is reopened and rendered
+    again.  If no NERD tree exists for this tab then this command acts the
+    same as the |:NERDTree| command.
+
+:NERDTreeMirror                                              *:NERDTreeMirror*
+    Shares an existing NERD tree, from another tab, in the current tab.
+    Changes made to one tree are reflected in both as they are actually the
+    same buffer.
+
+    If only one other NERD tree exists, that tree is automatically mirrored. If
+    more than one exists, the script will ask which tree to mirror.
+
+:NERDTreeClose                                                *:NERDTreeClose*
+    Close the NERD tree in this tab.
+
+:NERDTreeFind                                                  *:NERDTreeFind*
+    Find the current file in the tree. If no tree exists for the current tab,
+    or the file is not under the current root, then initialize a new tree where
+    the root is the directory of the current file.
+
+------------------------------------------------------------------------------
+2.2. Bookmarks                                             *NERDTreeBookmarks*
+
+Bookmarks in the NERD tree are a way to tag files or directories of interest.
+For example, you could use bookmarks to tag all of your project directories.
+
+------------------------------------------------------------------------------
+2.2.1. The Bookmark Table                              *NERDTreeBookmarkTable*
+
+If the bookmark table is active (see |NERDTree-B| and
+|'NERDTreeShowBookmarks'|), it will be rendered above the tree. You can double
+click bookmarks or use the |NERDTree-o| mapping to activate them. See also,
+|NERDTree-t| and |NERDTree-T|
+
+------------------------------------------------------------------------------
+2.2.2. Bookmark commands                            *NERDTreeBookmarkCommands*
+
+Note that the following commands are only available in the NERD tree buffer.
+
+:Bookmark <name>
+    Bookmark the current node as <name>. If there is already a <name>
+    bookmark, it is overwritten. <name> must not contain spaces.
+
+:BookmarkToRoot <bookmark>
+    Make the directory corresponding to <bookmark> the new root. If a treenode
+    corresponding to <bookmark> is already cached somewhere in the tree then
+    the current tree will be used, otherwise a fresh tree will be opened.
+    Note that if <bookmark> points to a file then its parent will be used
+    instead.
+
+:RevealBookmark <bookmark>
+    If the node is cached under the current root then it will be revealed
+    (i.e. directory nodes above it will be opened) and the cursor will be
+    placed on it.
+
+:OpenBookmark <bookmark>
+    <bookmark> must point to a file. The file is opened as though |NERDTree-o|
+    was applied. If the node is cached under the current root then it will be
+    revealed and the cursor will be placed on it.
+
+:ClearBookmarks [<bookmarks>]
+    Remove all the given bookmarks. If no bookmarks are given then remove all
+    bookmarks on the current node.
+
+:ClearAllBookmarks
+    Remove all bookmarks.
+
+:ReadBookmarks
+    Re-read the bookmarks in the |'NERDTreeBookmarksFile'|.
+
+See also |:NERDTree| and |:NERDTreeFromBookmark|.
+
+------------------------------------------------------------------------------
+2.2.3. Invalid Bookmarks                            *NERDTreeInvalidBookmarks*
+
+If invalid bookmarks are detected, the script will issue an error message and
+the invalid bookmarks will become unavailable for use.
+
+These bookmarks will still be stored in the bookmarks file (see
+|'NERDTreeBookmarksFile'|), down the bottom. There will always be a blank line
+after the valid bookmarks but before the invalid ones.
+
+Each line in the bookmarks file represents one bookmark. The proper format is:
+<bookmark name><space><full path to the bookmark location>
+
+After you have corrected any invalid bookmarks, either restart vim, or go
+:ReadBookmarks from the NERD tree window.
+
+------------------------------------------------------------------------------
+2.3. NERD tree Mappings                                     *NERDTreeMappings*
+
+Default  Description~                                             help-tag~
+Key~
+
+o.......Open files, directories and bookmarks....................|NERDTree-o|
+go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
+t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
+T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
+i.......Open selected file in a split window.....................|NERDTree-i|
+gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
+s.......Open selected file in a new vsplit.......................|NERDTree-s|
+gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
+O.......Recursively open the selected directory..................|NERDTree-O|
+x.......Close the current nodes parent...........................|NERDTree-x|
+X.......Recursively close all children of the current node.......|NERDTree-X|
+e.......Edit the current dif.....................................|NERDTree-e|
+
+<CR>...............same as |NERDTree-o|.
+double-click.......same as the |NERDTree-o| map.
+middle-click.......same as |NERDTree-i| for files, same as
+                   |NERDTree-e| for dirs.
+
+D.......Delete the current bookmark .............................|NERDTree-D|
+
+P.......Jump to the root node....................................|NERDTree-P|
+p.......Jump to current nodes parent.............................|NERDTree-p|
+K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
+J.......Jump down inside directories at the current tree depth...|NERDTree-J|
+<C-J>...Jump down to the next sibling of the current directory...|NERDTree-C-J|
+<C-K>...Jump up to the previous sibling of the current directory.|NERDTree-C-K|
+
+C.......Change the tree root to the selected dir.................|NERDTree-C|
+u.......Move the tree root up one directory......................|NERDTree-u|
+U.......Same as 'u' except the old root node is left open........|NERDTree-U|
+r.......Recursively refresh the current directory................|NERDTree-r|
+R.......Recursively refresh the current root.....................|NERDTree-R|
+m.......Display the NERD tree menu...............................|NERDTree-m|
+cd......Change the CWD to the dir of the selected node...........|NERDTree-cd|
+
+I.......Toggle whether hidden files displayed....................|NERDTree-I|
+f.......Toggle whether the file filters are used.................|NERDTree-f|
+F.......Toggle whether files are displayed.......................|NERDTree-F|
+B.......Toggle whether the bookmark table is displayed...........|NERDTree-B|
+
+q.......Close the NERDTree window................................|NERDTree-q|
+A.......Zoom (maximize/minimize) the NERDTree window.............|NERDTree-A|
+?.......Toggle the display of the quick help.....................|NERDTree-?|
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-o*
+Default key: o
+Map option: NERDTreeMapActivateNode
+Applies to: files and directories.
+
+If a file node is selected, it is opened in the previous window.
+
+If a directory is selected it is opened or closed depending on its current
+state.
+
+If a bookmark that links to a directory is selected then that directory
+becomes the new root.
+
+If a bookmark that links to a file is selected then that file is opened in the
+previous window.
+
+------------------------------------------------------------------------------
+                                                                 *NERDTree-go*
+Default key: go
+Map option: None
+Applies to: files.
+
+If a file node is selected, it is opened in the previous window, but the
+cursor does not move.
+
+The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see
+|NERDTree-o|).
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-t*
+Default key: t
+Map option: NERDTreeMapOpenInTab
+Applies to: files and directories.
+
+Opens the selected file in a new tab. If a directory is selected, a fresh
+NERD Tree for that directory is opened in a new tab.
+
+If a bookmark which points to a directory is selected, open a NERD tree for
+that directory in a new tab. If the bookmark points to a file, open that file
+in a new tab.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-T*
+Default key: T
+Map option: NERDTreeMapOpenInTabSilent
+Applies to: files and directories.
+
+The same as |NERDTree-t| except that the focus is kept in the current tab.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-i*
+Default key: i
+Map option: NERDTreeMapOpenSplit
+Applies to: files.
+
+Opens the selected file in a new split window and puts the cursor in the new
+window.
+
+------------------------------------------------------------------------------
+                                                                 *NERDTree-gi*
+Default key: gi
+Map option: None
+Applies to: files.
+
+The same as |NERDTree-i| except that the cursor is not moved.
+
+The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see
+|NERDTree-i|).
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-s*
+Default key: s
+Map option: NERDTreeMapOpenVSplit
+Applies to: files.
+
+Opens the selected file in a new vertically split window and puts the cursor in
+the new window.
+
+------------------------------------------------------------------------------
+                                                                 *NERDTree-gs*
+Default key: gs
+Map option: None
+Applies to: files.
+
+The same as |NERDTree-s| except that the cursor is not moved.
+
+The key combo for this mapping is always "g" + NERDTreeMapOpenVSplit (see
+|NERDTree-s|).
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-O*
+Default key: O
+Map option: NERDTreeMapOpenRecursively
+Applies to: directories.
+
+Recursively opens the selelected directory.
+
+All files and directories are cached, but if a directory would not be
+displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the
+hidden file filter (see |'NERDTreeShowHidden'|) then its contents are not
+cached. This is handy, especially if you have .svn directories.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-x*
+Default key: x
+Map option: NERDTreeMapCloseDir
+Applies to: files and directories.
+
+Closes the parent of the selected node.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-X*
+Default key: X
+Map option: NERDTreeMapCloseChildren
+Applies to: directories.
+
+Recursively closes all children of the selected directory.
+
+Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-e*
+Default key: e
+Map option: NERDTreeMapOpenExpl
+Applies to: files and directories.
+
+|:edit|s the selected directory, or the selected file's directory. This could
+result in a NERD tree or a netrw being opened, depending on
+|'NERDTreeHijackNetrw'|.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-D*
+Default key: D
+Map option: NERDTreeMapDeleteBookmark
+Applies to: lines in the bookmarks table
+
+Deletes the currently selected bookmark.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-P*
+Default key: P
+Map option: NERDTreeMapJumpRoot
+Applies to: no restrictions.
+
+Jump to the tree root.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-p*
+Default key: p
+Map option: NERDTreeMapJumpParent
+Applies to: files and directories.
+
+Jump to the parent node of the selected node.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-K*
+Default key: K
+Map option: NERDTreeMapJumpFirstChild
+Applies to: files and directories.
+
+Jump to the first child of the current nodes parent.
+
+If the cursor is already on the first node then do the following:
+    * loop back thru the siblings of the current nodes parent until we find an
+      open dir with children
+    * go to the first child of that node
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-J*
+Default key: J
+Map option: NERDTreeMapJumpLastChild
+Applies to: files and directories.
+
+Jump to the last child of the current nodes parent.
+
+If the cursor is already on the last node then do the following:
+    * loop forward thru the siblings of the current nodes parent until we find
+      an open dir with children
+    * go to the last child of that node
+
+------------------------------------------------------------------------------
+                                                                *NERDTree-C-J*
+Default key: <C-J>
+Map option: NERDTreeMapJumpNextSibling
+Applies to: files and directories.
+
+Jump to the next sibling of the selected node.
+
+------------------------------------------------------------------------------
+                                                                *NERDTree-C-K*
+Default key: <C-K>
+Map option: NERDTreeMapJumpPrevSibling
+Applies to: files and directories.
+
+Jump to the previous sibling of the selected node.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-C*
+Default key: C
+Map option: NERDTreeMapChdir
+Applies to: directories.
+
+Make the selected directory node the new tree root. If a file is selected, its
+parent is used.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-u*
+Default key: u
+Map option: NERDTreeMapUpdir
+Applies to: no restrictions.
+
+Move the tree root up a dir (like doing a "cd ..").
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-U*
+Default key: U
+Map option: NERDTreeMapUpdirKeepOpen
+Applies to: no restrictions.
+
+Like |NERDTree-u| except that the old tree root is kept open.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-r*
+Default key: r
+Map option: NERDTreeMapRefresh
+Applies to: files and directories.
+
+If a dir is selected, recursively refresh that dir, i.e. scan the filesystem
+for changes and represent them in the tree.
+
+If a file node is selected then the above is done on it's parent.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-R*
+Default key: R
+Map option: NERDTreeMapRefreshRoot
+Applies to: no restrictions.
+
+Recursively refresh the tree root.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-m*
+Default key: m
+Map option: NERDTreeMapMenu
+Applies to: files and directories.
+
+Display the NERD tree menu. See |NERDTreeMenu| for details.
+
+------------------------------------------------------------------------------
+                                                                 *NERDTree-cd*
+Default key: cd
+Map option: NERDTreeMapChdir
+Applies to: files and directories.
+
+Change vims current working directory to that of the selected node.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-I*
+Default key: I
+Map option: NERDTreeMapToggleHidden
+Applies to: no restrictions.
+
+Toggles whether hidden files (i.e. "dot files") are displayed.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-f*
+Default key: f
+Map option: NERDTreeMapToggleFilters
+Applies to: no restrictions.
+
+Toggles whether file filters are used. See |'NERDTreeIgnore'| for details.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-F*
+Default key: F
+Map option: NERDTreeMapToggleFiles
+Applies to: no restrictions.
+
+Toggles whether file nodes are displayed.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-B*
+Default key: B
+Map option: NERDTreeMapToggleBookmarks
+Applies to: no restrictions.
+
+Toggles whether the bookmarks table is displayed.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-q*
+Default key: q
+Map option: NERDTreeMapQuit
+Applies to: no restrictions.
+
+Closes the NERDtree window.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-A*
+Default key: A
+Map option: NERDTreeMapToggleZoom
+Applies to: no restrictions.
+
+Maximize (zoom) and minimize the NERDtree window.
+
+------------------------------------------------------------------------------
+                                                                  *NERDTree-?*
+Default key: ?
+Map option: NERDTreeMapHelp
+Applies to: no restrictions.
+
+Toggles whether the quickhelp is displayed.
+
+------------------------------------------------------------------------------
+2.3. The NERD tree menu                                         *NERDTreeMenu*
+
+The NERD tree has a menu that can be programmed via the an API (see
+|NERDTreeMenuAPI|). The idea is to simulate the "right click" menus that most
+file explorers have.
+
+The script comes with two default menu plugins: exec_menuitem.vim and
+fs_menu.vim. fs_menu.vim adds some basic filesystem operations to the menu for
+creating/deleting/moving/copying files and dirs. exec_menuitem.vim provides a
+menu item to execute executable files.
+
+Related tags: |NERDTree-m| |NERDTreeApi|
+
+==============================================================================
+3. Customisation                                             *NERDTreeOptions*
+
+
+------------------------------------------------------------------------------
+3.1. Customisation summary                             *NERDTreeOptionSummary*
+
+The script provides the following options that can customise the behaviour the
+NERD tree. These options should be set in your vimrc.
+
+|'loaded_nerd_tree'|            Turns off the script.
+
+|'NERDChristmasTree'|           Tells the NERD tree to make itself colourful
+                                and pretty.
+
+|'NERDTreeAutoCenter'|          Controls whether the NERD tree window centers
+                                when the cursor moves within a specified
+                                distance to the top/bottom of the window.
+|'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering.
+
+|'NERDTreeCaseSensitiveSort'|   Tells the NERD tree whether to be case
+                                sensitive or not when sorting nodes.
+
+|'NERDTreeChDirMode'|           Tells the NERD tree if/when it should change
+                                vim's current working directory.
+
+|'NERDTreeHighlightCursorline'| Tell the NERD tree whether to highlight the
+                                current cursor line.
+
+|'NERDTreeHijackNetrw'|         Tell the NERD tree whether to replace the netrw
+                                autocommands for exploring local directories.
+
+|'NERDTreeIgnore'|              Tells the NERD tree which files to ignore.
+
+|'NERDTreeBookmarksFile'|       Where the bookmarks are stored.
+
+|'NERDTreeMouseMode'|           Tells the NERD tree how to handle mouse
+                                clicks.
+
+|'NERDTreeQuitOnOpen'|          Closes the tree window after opening a file.
+
+|'NERDTreeShowBookmarks'|       Tells the NERD tree whether to display the
+                                bookmarks table on startup.
+
+|'NERDTreeShowFiles'|           Tells the NERD tree whether to display files
+                                in the tree on startup.
+
+|'NERDTreeShowHidden'|          Tells the NERD tree whether to display hidden
+                                files on startup.
+
+|'NERDTreeShowLineNumbers'|     Tells the NERD tree whether to display line
+                                numbers in the tree window.
+
+|'NERDTreeSortOrder'|           Tell the NERD tree how to sort the nodes in
+                                the tree.
+
+|'NERDTreeStatusline'|          Set a statusline for NERD tree windows.
+
+|'NERDTreeWinPos'|              Tells the script where to put the NERD tree
+                                window.
+
+|'NERDTreeWinSize'|             Sets the window size when the NERD tree is
+                                opened.
+
+------------------------------------------------------------------------------
+3.2. Customisation details                             *NERDTreeOptionDetails*
+
+To enable any of the below options you should put the given line in your
+~/.vimrc
+
+                                                          *'loaded_nerd_tree'*
+If this plugin is making you feel homicidal, it may be a good idea to turn it
+off with this line in your vimrc: >
+    let loaded_nerd_tree=1
+<
+------------------------------------------------------------------------------
+                                                         *'NERDChristmasTree'*
+Values: 0 or 1.
+Default: 1.
+
+If this option is set to 1 then some extra syntax highlighting elements are
+added to the nerd tree to make it more colourful.
+
+Set it to 0 for a more vanilla looking tree.
+
+------------------------------------------------------------------------------
+                                                        *'NERDTreeAutoCenter'*
+Values: 0 or 1.
+Default: 1
+
+If set to 1, the NERD tree window will center around the cursor if it moves to
+within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window.
+
+This is ONLY done in response to tree navigation mappings,
+i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-C-K| |NERDTree-p|
+|NERDTree-P|
+
+The centering is done with a |zz| operation.
+
+------------------------------------------------------------------------------
+                                               *'NERDTreeAutoCenterThreshold'*
+Values: Any natural number.
+Default: 3
+
+This option controls the "sensitivity" of the NERD tree auto centering. See
+|'NERDTreeAutoCenter'| for details.
+
+------------------------------------------------------------------------------
+                                                 *'NERDTreeCaseSensitiveSort'*
+Values: 0 or 1.
+Default: 0.
+
+By default the NERD tree does not sort nodes case sensitively, i.e. nodes
+could appear like this: >
+    bar.c
+    Baz.c
+    blarg.c
+    boner.c
+    Foo.c
+<
+But, if you set this option to 1 then the case of the nodes will be taken into
+account. The above nodes would then be sorted like this: >
+    Baz.c
+    Foo.c
+    bar.c
+    blarg.c
+    boner.c
+<
+------------------------------------------------------------------------------
+                                                         *'NERDTreeChDirMode'*
+
+Values: 0, 1 or 2.
+Default: 0.
+
+Use this option to tell the script when (if at all) to change the current
+working directory (CWD) for vim.
+
+If it is set to 0 then the CWD is never changed by the NERD tree.
+
+If set to 1 then the CWD is changed when the NERD tree is first loaded to the
+directory it is initialized in. For example, if you start the NERD tree with >
+    :NERDTree /home/marty/foobar
+<
+then the CWD will be changed to /home/marty/foobar and will not be changed
+again unless you init another NERD tree with a similar command.
+
+If the option is set to 2 then it behaves the same as if set to 1 except that
+the CWD is changed whenever the tree root is changed. For example, if the CWD
+is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new
+root then the CWD will become /home/marty/foobar/baz.
+
+------------------------------------------------------------------------------
+                                               *'NERDTreeHighlightCursorline'*
+Values: 0 or 1.
+Default: 1.
+
+If set to 1, the current cursor line in the NERD tree buffer will be
+highlighted. This is done using the |'cursorline'| option.
+
+------------------------------------------------------------------------------
+                                                       *'NERDTreeHijackNetrw'*
+Values: 0 or 1.
+Default: 1.
+
+If set to 1, doing a >
+    :edit <some directory>
+<
+will open up a "secondary" NERD tree instead of a netrw in the target window.
+
+Secondary NERD trees behaves slighly different from a regular trees in the
+following respects:
+    1. 'o' will open the selected file in the same window as the tree,
+       replacing it.
+    2. you can have as many secondary tree as you want in the same tab.
+
+------------------------------------------------------------------------------
+                                                            *'NERDTreeIgnore'*
+Values: a list of regular expressions.
+Default: ['\~$'].
+
+This option is used to specify which files the NERD tree should ignore.  It
+must be a list of regular expressions. When the NERD tree is rendered, any
+files/dirs that match any of the regex's in 'NERDTreeIgnore' wont be
+displayed.
+
+For example if you put the following line in your vimrc: >
+    let NERDTreeIgnore=['\.vim$', '\~$']
+<
+then all files ending in .vim or ~ will be ignored.
+
+Note: to tell the NERD tree not to ignore any files you must use the following
+line: >
+    let NERDTreeIgnore=[]
+<
+
+The file filters can be turned on and off dynamically with the |NERDTree-f|
+mapping.
+
+------------------------------------------------------------------------------
+                                                     *'NERDTreeBookmarksFile'*
+Values: a path
+Default: $HOME/.NERDTreeBookmarks
+
+This is where bookmarks are saved. See |NERDTreeBookmarkCommands|.
+
+------------------------------------------------------------------------------
+                                                       *'NERDTreeMouseMode'*
+Values: 1, 2 or 3.
+Default: 1.
+
+If set to 1 then a double click on a node is required to open it.
+If set to 2 then a single click will open directory nodes, while a double
+click will still be required for file nodes.
+If set to 3 then a single click will open any node.
+
+Note: a double click anywhere on a line that a tree node is on will
+activate it, but all single-click activations must be done on name of the node
+itself. For example, if you have the following node: >
+    | | |-application.rb
+<
+then (to single click activate it) you must click somewhere in
+'application.rb'.
+
+------------------------------------------------------------------------------
+                                                        *'NERDTreeQuitOnOpen'*
+
+Values: 0 or 1.
+Default: 0
+
+If set to 1, the NERD tree window will close after opening a file with the
+|NERDTree-o|, |NERDTree-i|, |NERDTree-t| and |NERDTree-T| mappings.
+
+------------------------------------------------------------------------------
+                                                     *'NERDTreeShowBookmarks'*
+Values: 0 or 1.
+Default: 0.
+
+If this option is set to 1 then the bookmarks table will be displayed.
+
+This option can be toggled dynamically, per tree, with the |NERDTree-B|
+mapping.
+
+------------------------------------------------------------------------------
+                                                         *'NERDTreeShowFiles'*
+Values: 0 or 1.
+Default: 1.
+
+If this option is set to 1 then files are displayed in the NERD tree. If it is
+set to 0 then only directories are displayed.
+
+This option can be toggled dynamically, per tree, with the |NERDTree-F|
+mapping and is useful for drastically shrinking the tree when you are
+navigating to a different part of the tree.
+
+------------------------------------------------------------------------------
+                                                        *'NERDTreeShowHidden'*
+Values: 0 or 1.
+Default: 0.
+
+This option tells vim whether to display hidden files by default. This option
+can be dynamically toggled, per tree, with the |NERDTree-I| mapping.  Use one
+of the follow lines to set this option: >
+    let NERDTreeShowHidden=0
+    let NERDTreeShowHidden=1
+<
+
+------------------------------------------------------------------------------
+                                                   *'NERDTreeShowLineNumbers'*
+Values: 0 or 1.
+Default: 0.
+
+This option tells vim whether to display line numbers for the NERD tree
+window.  Use one of the follow lines to set this option: >
+    let NERDTreeShowLineNumbers=0
+    let NERDTreeShowLineNumbers=1
+<
+
+------------------------------------------------------------------------------
+                                                         *'NERDTreeSortOrder'*
+Values: a list of regular expressions.
+Default: ['\/$', '*', '\.swp$',  '\.bak$', '\~$']
+
+This option is set to a list of regular expressions which are used to
+specify the order of nodes under their parent.
+
+For example, if the option is set to: >
+    ['\.vim$', '\.c$', '\.h$', '*', 'foobar']
+<
+then all .vim files will be placed at the top, followed by all .c files then
+all .h files. All files containing the string 'foobar' will be placed at the
+end.  The star is a special flag: it tells the script that every node that
+doesnt match any of the other regexps should be placed here.
+
+If no star is present in 'NERDTreeSortOrder' then one is automatically
+appended to the array.
+
+The regex '\/$' should be used to match directory nodes.
+
+After this sorting is done, the files in each group are sorted alphabetically.
+
+Other examples: >
+    (1) ['*', '\/$']
+    (2) []
+    (3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$',  '\.bak$', '\~$']
+<
+1. Directories will appear last, everything else will appear above.
+2. Everything will simply appear in alphabetical order.
+3. Dirs will appear first, then ruby and php. Swap files, bak files and vim
+   backup files will appear last with everything else preceding them.
+
+------------------------------------------------------------------------------
+                                                        *'NERDTreeStatusline'*
+Values: Any valid statusline setting.
+Default: %{b:NERDTreeRoot.path.strForOS(0)}
+
+Tells the script what to use as the |'statusline'| setting for NERD tree
+windows.
+
+Note that the statusline is set using |:let-&| not |:set| so escaping spaces
+isn't necessary.
+
+Setting this option to -1 will will deactivate it so that your global
+statusline setting is used instead.
+
+------------------------------------------------------------------------------
+                                                            *'NERDTreeWinPos'*
+Values: "left" or "right"
+Default: "left".
+
+This option is used to determine where NERD tree window is placed on the
+screen.
+
+This option makes it possible to use two different explorer plugins
+simultaneously. For example, you could have the taglist plugin on the left of
+the window and the NERD tree on the right.
+
+------------------------------------------------------------------------------
+                                                           *'NERDTreeWinSize'*
+Values: a positive integer.
+Default: 31.
+
+This option is used to change the size of the NERD tree when it is loaded.
+
+==============================================================================
+4. The NERD tree API                                             *NERDTreeAPI*
+
+The NERD tree script allows you to add custom key mappings and menu items via
+a set of API calls. Any scripts that use this API should be placed in
+~/.vim/nerdtree_plugin/ (*nix) or ~/vimfiles/nerdtree_plugin (windows).
+
+The script exposes some prototype objects that can be used to manipulate the
+tree and/or get information from it: >
+    g:NERDTreePath
+    g:NERDTreeDirNode
+    g:NERDTreeFileNode
+    g:NERDTreeBookmark
+<
+See the code/comments in NERD_tree.vim to find how to use these objects. The
+following code conventions are used:
+    * class members start with a capital letter
+    * instance members start with a lower case letter
+    * private members start with an underscore
+
+See this blog post for more details:
+ http://got-ravings.blogspot.com/2008/09/vim-pr0n-prototype-based-objects.html
+
+------------------------------------------------------------------------------
+4.1. Key map API                                           *NERDTreeKeymapAPI*
+
+NERDTreeAddKeyMap({options})                             *NERDTreeAddKeyMap()*
+    Adds a new keymapping for all NERD tree buffers.
+    {options} must be a dictionary, and must contain the following keys:
+    "key" - the trigger key for the new mapping
+    "callback" - the function the new mapping will be bound to
+    "quickhelpText" - the text that will appear in the quickhelp (see
+    |NERDTree-?|)
+
+    Example: >
+        call NERDTreeAddKeyMap({
+               \ 'key': 'b',
+               \ 'callback': 'NERDTreeEchoCurrentNode',
+               \ 'quickhelpText': 'echo full path of current node' })
+
+        function! NERDTreeEchoCurrentNode()
+            let n = g:NERDTreeFileNode.GetSelected()
+            if n != {}
+                echomsg 'Current node: ' . n.path.str()
+            endif
+        endfunction
+<
+    This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim.
+    It adds a (rather useless) mapping on 'b' which echos the full path to the
+    current node.
+
+------------------------------------------------------------------------------
+4.2. Menu API                                                *NERDTreeMenuAPI*
+
+NERDTreeAddSubmenu({options})                           *NERDTreeAddSubmenu()*
+    Creates and returns a new submenu.
+
+    {options} must be a dictionary and must contain the following keys:
+    "text" - the text of the submenu that the user will see
+    "shortcut" - a shortcut key for the submenu (need not be unique)
+
+    The following keys are optional:
+    "isActiveCallback" - a function that will be called to determine whether
+    this submenu item will be displayed or not. The callback function must return
+    0 or 1.
+    "parent" - the parent submenu of the new submenu (returned from a previous
+    invocation of NERDTreeAddSubmenu()). If this key is left out then the new
+    submenu will sit under the top level menu.
+
+    See below for an example.
+
+NERDTreeAddMenuItem({options})                         *NERDTreeAddMenuItem()*
+    Adds a new menu item to the NERD tree menu (see |NERDTreeMenu|).
+
+    {options} must be a dictionary and must contain the
+    following keys:
+    "text" - the text of the menu item which the user will see
+    "shortcut" - a shortcut key for the menu item (need not be unique)
+    "callback" - the function that will be called when the user activates the
+    menu item.
+
+    The following keys are optional:
+    "isActiveCallback" - a function that will be called to determine whether
+    this menu item will be displayed or not. The callback function must return
+    0 or 1.
+    "parent" - if the menu item belongs under a submenu then this key must be
+    specified. This value for this key will be the object that
+    was returned when the submenu was created with |NERDTreeAddSubmenu()|.
+
+    See below for an example.
+
+NERDTreeAddMenuSeparator([{options}])             *NERDTreeAddMenuSeparator()*
+    Adds a menu separator (a row of dashes).
+
+    {options} is an optional dictionary that may contain the following keys:
+    "isActiveCallback" - see description in |NERDTreeAddMenuItem()|.
+
+Below is an example of the menu API in action. >
+    call NERDTreeAddMenuSeparator()
+
+    call NERDTreeAddMenuItem({
+                \ 'text': 'a (t)op level menu item',
+                \ 'shortcut': 't',
+                \ 'callback': 'SomeFunction' })
+
+    let submenu = NERDTreeAddSubmenu({
+                \ 'text': 'a (s)ub menu',
+                \ 'shortcut': 's' })
+
+    call NERDTreeAddMenuItem({
+                \ 'text': '(n)ested item 1',
+                \ 'shortcut': 'n',
+                \ 'callback': 'SomeFunction',
+                \ 'parent': submenu })
+
+    call NERDTreeAddMenuItem({
+                \ 'text': '(n)ested item 2',
+                \ 'shortcut': 'n',
+                \ 'callback': 'SomeFunction',
+                \ 'parent': submenu })
+<
+This will create the following menu: >
+  --------------------
+  a (t)op level menu item
+  a (s)ub menu
+<
+Where selecting "a (s)ub menu" will lead to a second menu: >
+  (n)ested item 1
+  (n)ested item 2
+<
+When any of the 3 concrete menu items are selected the function "SomeFunction"
+will be called.
+
+------------------------------------------------------------------------------
+NERDTreeRender()                                            *NERDTreeRender()*
+    Re-renders the NERD tree buffer. Useful if you change the state of the
+    tree and you want to it to be reflected in the UI.
+
+==============================================================================
+5. About                                                       *NERDTreeAbout*
+
+The author of the NERD tree is a terrible terrible monster called Martyzilla
+who gobbles up small children with milk and sugar for breakfast.
+
+He can be reached at martin.grenfell at gmail dot com. He would love to hear
+from you, so feel free to send him suggestions and/or comments about this
+plugin.  Don't be shy --- the worst he can do is slaughter you and stuff you in
+the fridge for later ;)
+
+The latest stable versions can be found at
+    http://www.vim.org/scripts/script.php?script_id=1658
+
+The latest dev versions are on github
+    http://github.com/scrooloose/nerdtree
+
+
+==============================================================================
+6. Changelog                                               *NERDTreeChangelog*
+
+4.x.x
+    - Fix a bug with :NERDTreeFind and symlinks. Thanks to Vitaly Bogdanov.
+
+4.1.0
+    features:
+    - NERDTreeFind to reveal the node for the current buffer in the tree,
+      see |NERDTreeFind|. This effectively merges the FindInNERDTree plugin (by
+      Doug McInnes) into the script.
+    - make NERDTreeQuitOnOpen apply to the t/T keymaps too. Thanks to Stefan
+      Ritter and Rรฉmi Prรฉvost.
+    - truncate the root node if wider than the tree window. Thanks to Victor
+      Gonzalez.
+
+    bugfixes:
+    - really fix window state restoring
+    - fix some win32 path escaping issues. Thanks to Stephan Baumeister, Ricky,
+      jfilip1024, and Chris Chambers
+
+4.0.0
+    - add a new programmable menu system (see :help NERDTreeMenu).
+    - add new APIs to add menus/menu-items to the menu system as well as
+      custom key mappings to the NERD tree buffer (see :help NERDTreeAPI).
+    - removed the old API functions
+    - added a mapping to maximize/restore the size of nerd tree window, thanks
+      to Guillaume Duranceau for the patch. See :help NERDTree-A for details.
+
+    - fix a bug where secondary nerd trees (netrw hijacked trees) and
+      NERDTreeQuitOnOpen didnt play nicely, thanks to Curtis Harvey.
+    - fix a bug where the script ignored directories whose name ended in a dot,
+      thanks to Aggelos Orfanakos for the patch.
+    - fix a bug when using the x mapping on the tree root, thanks to Bryan
+      Venteicher for the patch.
+    - fix a bug where the cursor position/window size of the nerd tree buffer
+      wasnt being stored on closing the window, thanks to Richard Hart.
+    - fix a bug where NERDTreeMirror would mirror the wrong tree
+
+3.1.1
+    - fix a bug where a non-listed no-name buffer was getting created every
+      time the tree windows was created, thanks to Derek Wyatt and owen1
+    - make <CR> behave the same as the 'o' mapping
+    - some helptag fixes in the doc, thanks strull
+    - fix a bug when using :set nohidden and opening a file where the previous
+      buf was modified. Thanks iElectric
+    - other minor fixes
+
+3.1.0
+    New features:
+    - add mappings to open files in a vsplit, see :help NERDTree-s and :help
+      NERDTree-gs
+    - make the statusline for the nerd tree window default to something
+      hopefully more useful. See :help 'NERDTreeStatusline'
+    Bugfixes:
+    - make the hijack netrw functionality work when vim is started with "vim
+      <some dir>" (thanks to Alf Mikula for the patch).
+    - fix a bug where the CWD wasnt being changed for some operations even when
+      NERDTreeChDirMode==2 (thanks to Lucas S. Buchala)
+    - add -bar to all the nerd tree :commands so they can chain with other
+      :commands (thanks to tpope)
+    - fix bugs when ignorecase was set (thanks to nach)
+    - fix a bug with the relative path code (thanks to nach)
+    - fix a bug where doing a :cd would cause :NERDTreeToggle to fail (thanks nach)
+
+
+3.0.1
+    Bugfixes:
+    - fix bugs with :NERDTreeToggle and :NERDTreeMirror when 'hidden
+      was not set
+    - fix a bug where :NERDTree <path> would fail if <path> was relative and
+      didnt start with a ./ or ../  Thanks to James Kanze.
+    - make the q mapping work with secondary (:e <dir>  style) trees,
+      thanks to jamessan
+    - fix a bunch of small bugs with secondary trees
+
+    More insane refactoring.
+
+3.0.0
+    - hijack netrw so that doing an :edit <directory>  will put a NERD tree in
+      the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw'
+    - allow sharing of trees across tabs, see :help :NERDTreeMirror
+    - remove "top" and "bottom" as valid settings for NERDTreeWinPos
+    - change the '<tab>' mapping to 'i'
+    - change the 'H' mapping to 'I'
+    - lots of refactoring
+
+==============================================================================
+7. Credits                                                   *NERDTreeCredits*
+
+Thanks to the following people for testing, bug reports, ideas etc. Without
+you I probably would have got bored of the hacking the NERD tree and
+just downloaded pr0n instead.
+
+    Tim Carey-Smith (halorgium)
+    Vigil
+    Nick Brettell
+    Thomas Scott Urban
+    Terrance Cohen
+    Yegappan Lakshmanan
+    Jason Mills
+    Michael Geddes (frogonwheels)
+    Yu Jun
+    Michael Madsen
+    AOYAMA Shotaro
+    Zhang Weiwu
+    Niels Aan de Brugh
+    Olivier Yiptong
+    Zhang Shuhan
+    Cory Echols
+    Piotr Czachur
+    Yuan Jiang
+    Matan Nassau
+    Maxim Kim
+    Charlton Wang
+    Matt Wozniski (godlygeek)
+    knekk
+    Sean Chou
+    Ryan Penn
+    Simon Peter Nicholls
+    Michael Foobar
+    Tomasz Chomiuk
+    Denis Pokataev
+    Tim Pope (tpope)
+    James Kanze
+    James Vega (jamessan)
+    Frederic Chanal (nach)
+    Alf Mikula
+    Lucas S. Buchala
+    Curtis Harvey
+    Guillaume Duranceau
+    Richard Hart (hates)
+    Doug McInnes
+    Stefan Ritter
+    Rรฉmi Prรฉvost
+    Victor Gonzalez
+    Stephan Baumeister
+    Ricky
+    jfilip1024
+    Chris Chambers
+    Vitaly Bogdanov
+
+==============================================================================
+8. License                                                   *NERDTreeLicense*
+
+The NERD tree is released under the wtfpl.
+See http://sam.zoy.org/wtfpl/COPYING.
diff --git a/vim/doc/ZoomWin.txt b/vim/doc/ZoomWin.txt
new file mode 100644 (file)
index 0000000..a691a60
--- /dev/null
@@ -0,0 +1,121 @@
+*ZoomWin.txt*  Zoom into/out-of a window               Jan 26, 2009
+Authors: Charles E. Campbell, Jr.                      *zoomwin*
+         Ron Aaron
+Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.   *zoomwin-copyright*
+           The VIM LICENSE applies to ZoomWin.vim and ZoomWin.txt
+           (see |copyright|) except use "ZoomWin" instead of "Vim"
+          No warranty, express or implied.  Use At-Your-Own-Risk.
+
+==============================================================================
+1. Usage                                               *zoomwin-usage*
+
+   :call ZoomWin()
+   :ZoomWin
+   <c-w>o
+
+   Either of the two commands or the normal mode <c-w>o will toggle between
+       * selecting the current window for display as the only window or
+       * to restore the original multiple-window view.
+
+==============================================================================
+2. Setup                                               *zoomwin-setup*
+
+   Simply put ZoomWin.vim into your .vim/plugin directory (you may need to
+   make such a directory first).  Under Windows that should be
+   vimfiles\plugin.  ZoomWin now uses the HelpExtractor method to
+   automatically extract help and to make it known to vim by running helptags
+   on it.
+
+==============================================================================
+3. History                                             *zoomwin-history*
+
+       v23 Apr 24, 2008 : * when |'scrollbind'| was activated: when ZoomWin
+                            attempted to restore multiple-windows, the cursor
+                            position was incorrect.  Fixed.
+           Jan 02, 2009   * included some more things in the session file
+                          * broke ZoomWin into an plugin + autoload pair
+                          * (Ingo Karkat) contributed a patch to retain the
+                            the search pattern before zooming
+                          * (Ingo Karkat) contributed a patch to detect the
+                            vim 7.2 name for the command line window
+       v22 Apr 10, 2006 : * "only" was occasionally issuing an "Already one
+                            window" message, which is now prevented
+                          * SavePosn() issued error message when handling an
+                            empty buffer
+                          * saves yank registers and restores them on each
+                            zoom/unzoom
+       v21 Oct 12, 2004 : * v14 fixed a bug when wmw and/or wmv equal to 0;
+                            v21 will invoke the patch only if the version <= 603.
+                            For vim version 6.3 users, this fix allows more files
+                            to be handled by ZoomWin.
+           May 10, 2005   * When :version shows -mksession, and the vim version
+                            is at least 6.3, ZoomWin will now do a partial zoom
+       v20 Jul 26, 2004 : * bugfix - ZoomWin didn't always retain the
+                            position in the former zoomed-in window after
+                            the window layout was restored.  It was restoring
+                            the position when the zoom-in occurred.
+       v19 May 26, 2004 : * bugfix - winmanager has events firing that,
+                            amongst other things, reset the bufhidden
+                            option to delete for some windows while
+                            ZoomWin worked.  ZoomWin now works
+                            successfully with winmanager.
+       v18 May 20, 2004 : * bugfix - didn't adversely affect anything, but
+                            ZoomWin was deleting its session file twice.
+                          * bugfix -- a multi-source file + minibufexplorer
+                            + Taglist interaction bug -- minibufexplorer's
+                            autocmd events were firing, generating a new
+                            window while ZoomWin was attempting to restore
+                            the display.  ZoomWin didn't have restoration
+                            information for the new window and so reported
+                            an error.  Events are now temporarily disabled
+                            while ZoomWin is restoring the layout.
+       v17 Mar 26, 2004 : * ZoomWin command installed.  Works nicely with
+                            taglist:  vim +Tlist +ZoomWin filename
+       v16 Dec 22, 2003 : * handles bufhidden and nobl windows (TagList support).
+                          * Now also works with quickfix window (:copen) but
+                            still not with |cmdline-window| (q:)
+       v15 Dec 19, 2003 : * SavePosn()/RestorePosn() needed to be preceded
+                            by s: to prevent clashes
+       v14 Dec 18, 2003 : * works around a restoration-bug with mksession
+                            when either wmw or wmh settings are zero
+                          * Bwipes internal temporary buffers
+                          * Known bugs: will not work with command-line
+                          * Editing window (|cmdline-window|) nor the
+                            quickfix window (|copen|).
+       v13 Dec 18, 2003 : Uses eventignore to prevent events/autocmds from
+                           firing while changing the mksession results.
+       v12 Dec 12, 2003 : uses hidden and a minimalist mksession save
+       v11 Oct 14, 2003 : bug fix: apparently RestorePosn()'s variables,
+                           which were b:, weren't always defined, so s:
+                           ones are now used.
+       v10 Sep 22, 2003 : Bug fix: when a single window is showing, the user
+                           moves the cursor, then <c-w>o used to restore
+                           screen, the current cursor position wasn't retained
+                          Restores v:this_session.
+                          Bug fix: change a window, use <c-w>o, then write.
+                          Was saving file only to temporary file instead of
+                           actual file, but when the actual file was brought back,
+                           the changes were lost.
+       v9 Aug 15, 2003 :  v8 managed to trash syntax highlighting on
+                          reload, this one removes the eventignore
+                          handling.  Will need more pondering...
+       v8 Aug 14, 2003 :  now handles not-modified but not filereadable
+                          buffers, nowrite buffers uses eventignore to
+                          bypass autocmd firing
+       v7 May 23, 2003 :  bugfix - GotoWinNum() didn't always get the
+                          cursor into the correct window
+       v6 Mar 25, 2003 :  more cleanup included
+       v5 Mar 14, 2003 :  includes support for handling scratch buffers,
+                          no-name buffer windows, and modified-buffer
+                          windows.  All windows' contents will be saved to
+                          temporary buffers
+       v4 Dec 12, 2002 :  Zak Beck contributed code to clean up temporary
+                          session files if one leaves vim while zoomed-in
+       v3 Dec 11, 2002 :  plugin-ized
+       v2 Nov 08, 2002 :  A guaranteed-to-be-unique to this
+                          session file is used for session information.
+                          Modified but not yet saved files are made hidden
+                          during zoom in.
+       v1 the epoch    :  Ron Aaron's original
+
+vim:tw=78:ts=8:ft=help
diff --git a/vim/doc/ack.txt b/vim/doc/ack.txt
new file mode 100644 (file)
index 0000000..bbe4299
--- /dev/null
@@ -0,0 +1,51 @@
+*ack.txt*   Plugin that integrates ack with Vim
+
+==============================================================================
+Author:  Antoine Imbert <antoine.imbert+ackvim@gmail.com>         *ack-author*
+License: Same terms as Vim itself (see |license|)
+
+==============================================================================
+INTRODUCTION                                                             *ack*
+
+This plugin is a front for the Perl module App::Ack.  Ack can be used as a
+replacement for grep.  This plugin will allow you to run ack from vim, and
+shows the results in a split window.
+
+:Ack[!] [options] {pattern} [{directory}]                               *:Ack*
+
+    Search recursively in {directory} (which defaults to the current
+    directory) for the {pattern}.  Behaves just like the |:grep| command, but
+    will open the |Quickfix| window for you. If [!] is not given the first
+    error is jumped to.
+
+:AckAdd [options] {pattern} [{directory}]                            *:AckAdd*
+
+    Just like |:Ack|, but instead of making a new list, the matches are
+    appended to the current |quickfix| list.
+
+:AckFromSearch [{directory}]                                  *:AckFromSearch*
+
+    Just like |:Ack| but the pattern is from previous search.
+
+:LAck [options] {pattern} [{directory}]                                *:LAck*
+
+    Just like |:Ack| but instead of the |quickfix| list, matches are placed in
+    the current |location-list|.
+
+:LAckAdd [options] {pattern} [{directory}]                          *:LAckAdd*
+
+    Just like |:AckAdd| but instead of the |quickfix| list, matches are added
+    to the current |location-list|
+
+:AckFile [options] {pattern} [{directory}]                          *:AckFile*
+
+    Search recursively in {directory} (which defaults to the current
+    directory) for filenames matching the {pattern}.  Behaves just like the
+    |:grep| command, but will open the |Quickfix| window for you.
+
+Files containing the search term will be listed in the split window, along
+with the line number of the occurrence, once for each occurrence.  <Enter> on
+a line in this window will open the file, and place the cursor on the matching
+line.
+
+See http://betterthangrep.com/ for more information.
diff --git a/vim/doc/coffee-script.txt b/vim/doc/coffee-script.txt
new file mode 100644 (file)
index 0000000..792ffff
--- /dev/null
@@ -0,0 +1,114 @@
+*coffee-script.txt*    Plugin for editing, compiling and running CoffeeScript
+
+=============================================================================
+Author:  Mick Koch <kchmck@gmail.com>          *coffee-script-author*
+License: WTFPL (see |coffee-script-license|)
+
+=============================================================================
+
+CONTENTS                                       *coffee-script-contents*
+
+|coffee-script-introduction|           Introduction and Feature Summary
+|coffee-script-commands|               Commands
+|coffee-script-settings|               Settings
+
+{Vi does not have any of this}
+
+=============================================================================
+
+INTRODUCTION                                   *coffee-script*
+                                               *coffee-script-introduction*
+
+This plugin provides facilities for editing CoffeeScript, including syntax
+highlighting, indenting and compilation.  Also included is syntax support for
+Eco templates, and handling of {text/coffeescript} in HTML.
+
+
+COMMANDS                                       *coffee-script-commands*
+
+                                               *:CoffeeMake*
+:CoffeeMake {opts}     Calls |:make!|, with 'makeprg' being "coffee -c" plus
+                       any additional {opts} given.  Opens the |quickfix|
+                       window if there are any errors and jumps to the first
+                       error.  You may set |g:coffee_make_options| to specify
+                       default command-line options that will always be
+                       passed.  By default, all compiler output is shown --
+                       running with |:silent| will hide this.
+
+                                               *:CoffeeMake!*
+:CoffeeMake! {opts}    As with :CoffeeMake, but will not jump to the first
+                       error.
+
+                                               *:CoffeeCompile*
+:[range]CoffeeCompile [vertical] [{win-size}]
+                       Shows how the current file or [range] will be compiled
+                       to JavaScript.  [vertical] (or vert) splits the
+                       compile buffer vertically instead of horizontally, and
+                       {win-size} sets the initial size of the buffer. It can
+                       be closed quickly with the "q" key.
+
+:CoffeeCompile {watch} [vertical] [{win-size}]
+                       The watch mode of :CoffeeCompile emulates the "Try
+                       CoffeeScript" live preview on the CoffeeScript web
+                       site -- after making changes to the source file,
+                       exiting insert mode will cause the preview buffer to
+                       update automatically.  {watch} should be given as
+                       "watch" or "unwatch," where the latter will of course
+                       stop the automatic updating. [vertical] is
+                       recommended, and 'scrollbind' is useful.
+
+                                               *:CoffeeRun*
+:[range]CoffeeRun      Compiles the file or [range] and runs the resulting
+                       JavaScript, displaying the output.
+
+
+SETTINGS                                       *coffee-script-settings*
+
+You can configure plugin behavior by setting global variables or syntax
+highlighting directives in your |vimrc|.
+
+Global Settings~
+
+You may set these in your |vimrc| as illustrated below.
+
+                                               *g:coffee_make_options*  >
+       let g:coffee_make_options='--bare'
+Always include the specified options when compiling with |:CoffeeCompile|.
+
+Syntax Highlighting~
+                                               *ft-coffee-script-syntax*
+Trailing whitespace is highlighted as an error by default. This can be
+disabled with:
+>
+       hi link coffeeSpaceError NONE
+
+Trailing semicolons are also considered an error (for help transitioning from
+JavaScript.) This can be disabled with:
+>
+       hi link coffeeSemicolonError NONE
+
+Reserved words like {function} and {var} are highlighted as an error in
+contexts disallowed by CoffeeScript. This can be disabled with:
+>
+       hi link coffeeReservedError NONE
+
+
+=============================================================================
+
+LICENSE                                                        *coffee-script-license*
+
+               DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                       Version 2, December 2004
+
+     Copyright (C) 2010 to 2011 Mick Koch <kchmck@gmail.com>
+
+     Everyone is permitted to copy and distribute verbatim or modified
+     copies of this license document, and changing it is allowed as long
+     as the name is changed.
+
+               DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+       TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+      0. You just DO WHAT THE FUCK YOU WANT TO.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/command-t.txt b/vim/doc/command-t.txt
new file mode 100644 (file)
index 0000000..d7e8c41
--- /dev/null
@@ -0,0 +1,817 @@
+*command-t.txt* Command-T plug-in for Vim         *command-t*
+
+CONTENTS                                        *command-t-contents*
+
+ 1. Introduction            |command-t-intro|
+ 2. Requirements            |command-t-requirements|
+ 3. Installation            |command-t-installation|
+ 3. Managing using Pathogen |command-t-pathogen|
+ 4. Trouble-shooting        |command-t-trouble-shooting|
+ 5. Usage                   |command-t-usage|
+ 6. Commands                |command-t-commands|
+ 7. Mappings                |command-t-mappings|
+ 8. Options                 |command-t-options|
+ 9. Authors                 |command-t-authors|
+10. Website                 |command-t-website|
+11. Donations               |command-t-donations|
+12. License                 |command-t-license|
+13. History                 |command-t-history|
+
+
+INTRODUCTION                                    *command-t-intro*
+
+The Command-T plug-in provides an extremely fast, intuitive mechanism for
+opening files and buffers with a minimal number of keystrokes. It's named
+"Command-T" because it is inspired by the "Go to File" window bound to
+Command-T in TextMate.
+
+Files are selected by typing characters that appear in their paths, and are
+ordered by an algorithm which knows that characters that appear in certain
+locations (for example, immediately after a path separator) should be given
+more weight.
+
+To search efficiently, especially in large projects, you should adopt a
+"path-centric" rather than a "filename-centric" mentality. That is you should
+think more about where the desired file is found rather than what it is
+called. This means narrowing your search down by including some characters
+from the upper path components rather than just entering characters from the
+filename itself.
+
+Screencasts demonstrating the plug-in can be viewed at:
+
+  https://wincent.com/products/command-t
+
+
+REQUIREMENTS                                    *command-t-requirements*
+
+The plug-in requires Vim compiled with Ruby support, a compatible Ruby
+installation at the operating system level, and a C compiler to build
+the Ruby extension.
+
+
+1. Vim compiled with Ruby support
+
+You can check for Ruby support by launching Vim with the --version switch:
+
+  vim --version
+
+If "+ruby" appears in the version information then your version of Vim has
+Ruby support.
+
+Another way to check is to simply try using the :ruby command from within Vim
+itself:
+
+  :ruby 1
+
+If your Vim lacks support you'll see an error message like this:
+
+  E319: Sorry, the command is not available in this version
+
+The version of Vim distributed with Mac OS X does not include Ruby support,
+while MacVim does; it is available from:
+
+  http://github.com/b4winckler/macvim/downloads
+
+For Windows users, the Vim 7.2 executable available from www.vim.org does
+include Ruby support, and is recommended over version 7.3 (which links against
+Ruby 1.9, but apparently has some bugs that need to be resolved).
+
+
+2. Ruby
+
+In addition to having Ruby support in Vim, your system itself must have a
+compatible Ruby install. "Compatible" means the same version as Vim itself
+links against. If you use a different version then Command-T is unlikely
+to work (see TROUBLE-SHOOTING below).
+
+On Mac OS X Snow Leopard, the system comes with Ruby 1.8.7 and all recent
+versions of MacVim (the 7.2 snapshots and 7.3) are linked against it.
+
+On Linux and similar platforms, the linked version of Ruby will depend on
+your distribution. You can usually find this out by examining the
+compilation and linking flags displayed by the |:version| command in Vim, and
+by looking at the output of:
+
+  :ruby puts RUBY_VERSION
+
+A suitable Ruby environment for Windows can be installed using the Ruby
+1.8.7-p299 RubyInstaller available at:
+
+  http://rubyinstaller.org/downloads/archives
+
+If using RubyInstaller be sure to download the installer executable, not the
+7-zip archive. When installing mark the checkbox "Add Ruby executables to your
+PATH" so that Vim can find them.
+
+
+3. C compiler
+
+Part of Command-T is implemented in C as a Ruby extension for speed, allowing
+it to work responsively even on directory hierarchies containing enormous
+numbers of files. As such, a C compiler is required in order to build the
+extension and complete the installation.
+
+On Mac OS X, this can be obtained by installing the Xcode Tools that come on
+the Mac OS X install disc.
+
+On Windows, the RubyInstaller Development Kit can be used to conveniently
+install the necessary tool chain:
+
+  http://rubyinstaller.org/downloads/archives
+
+At the time of writing, the appropriate development kit for use with Ruby
+1.8.7 is DevKit-3.4.5r3-20091110.
+
+To use the Development Kit extract the archive contents to your C:\Ruby
+folder.
+
+
+INSTALLATION                                    *command-t-installation*
+
+Command-T is distributed as a "vimball" which means that it can be installed
+by opening it in Vim and then sourcing it:
+
+  :e command-t.vba
+  :so %
+
+The files will be installed in your |'runtimepath'|. To check where this is
+you can issue:
+
+  :echo &rtp
+
+The C extension must then be built, which can be done from the shell. If you
+use a typical |'runtimepath'| then the files were installed inside ~/.vim and
+you can build the extension with:
+
+  cd ~/.vim/ruby/command-t
+  ruby extconf.rb
+  make
+
+Note: If you are an RVM user, you must perform the build using the same
+version of Ruby that Vim itself is linked against. This will often be the
+system Ruby, which can be selected before issuing the "make" command with:
+
+  rvm use system
+
+
+MANAGING USING PATHOGEN                         *command-t-pathogen*
+
+Pathogen is a plugin that allows you to maintain plugin installations in
+separate, isolated subdirectories under the "bundle" directory in your
+|'runtimepath'|. The following examples assume that you already have
+Pathogen installed and configured, and that you are installing into
+~/.vim/bundle. For more information about Pathogen, see:
+
+  http://www.vim.org/scripts/script.php?script_id=2332
+
+If you manage your entire ~/.vim folder using Git then you can add the
+Command-T repository as a submodule:
+
+  cd ~/.vim
+  git submodule add git://git.wincent.com/command-t.git bundle/command-t
+  git submodule init
+
+Or if you just wish to do a simple clone instead of using submodules:
+
+  cd ~/.vim
+  git clone git://git.wincent.com/command-t.git bundle/command-t
+
+Once you have a local copy of the repository you can update it at any time
+with:
+
+  cd ~/.vim/bundle/command-t
+  git pull
+
+Or you can switch to a specific release with:
+
+  cd ~/.vim/bundle/command-t
+  git checkout 0.8b
+
+After installing or updating you must build the extension:
+
+  cd ~/.vim/bundle/command-t
+  rake make
+
+While the Vimball installation automatically generates the help tags, under
+Pathogen it is necessary to do so explicitly from inside Vim:
+
+  :call pathogen#helptags()
+
+
+TROUBLE-SHOOTING                                *command-t-trouble-shooting*
+
+Most installation problems are caused by a mismatch between the version of
+Ruby on the host operating system, and the version of Ruby that Vim itself
+linked against at compile time. For example, if one is 32-bit and the other is
+64-bit, or one is from the Ruby 1.9 series and the other is from the 1.8
+series, then the plug-in is not likely to work.
+
+As such, on Mac OS X, I recommend using the standard Ruby that comes with the
+system (currently 1.8.7) along with the latest version of MacVim (currently
+version 7.3). If you wish to use custom builds of Ruby or of MacVim (not
+recommmended) then you will have to take extra care to ensure that the exact
+same Ruby environment is in effect when building Ruby, Vim and the Command-T
+extension.
+
+For Windows, the following combination is known to work:
+
+  - Vim 7.2 from http://www.vim.org/download.php:
+      ftp://ftp.vim.org/pub/vim/pc/gvim72.exe
+  - Ruby 1.8.7-p299 from http://rubyinstaller.org/downloads/archives:
+      http://rubyforge.org/frs/download.php/71492/rubyinstaller-1.8.7-p299.exe
+  - DevKit 3.4.5r3-20091110 from http://rubyinstaller.org/downloads/archives:
+      http://rubyforge.org/frs/download.php/66888/devkit-3.4.5r3-20091110.7z
+
+If a problem occurs the first thing you should do is inspect the output of:
+
+  ruby extconf.rb
+  make
+
+During the installation, and:
+
+  vim --version
+
+And compare the compilation and linker flags that were passed to the
+extension and to Vim itself when they were built. If the Ruby-related
+flags or architecture flags are different then it is likely that something
+has changed in your Ruby environment and the extension may not work until
+you eliminate the discrepancy.
+
+
+USAGE                                           *command-t-usage*
+
+Bring up the Command-T file window by typing:
+
+  <Leader>t
+
+This mapping is set up automatically for you, provided you do not already have
+a mapping for <Leader>t or |:CommandT|. You can also bring up the file window
+by issuing the command:
+
+  :CommandT
+
+A prompt will appear at the bottom of the screen along with a file window
+showing all of the files in the current directory (as returned by the
+|:pwd| command).
+
+For the most efficient file navigation within a project it's recommended that
+you |:cd| into the root directory of your project when starting to work on it.
+If you wish to open a file from outside of the project folder you can pass in
+an optional path argument (relative or absolute) to |:CommandT|:
+
+  :CommandT ../path/to/other/files
+
+Type letters in the prompt to narrow down the selection, showing only the
+files whose paths contain those letters in the specified order. Letters do not
+need to appear consecutively in a path in order for it to be classified as a
+match.
+
+Once the desired file has been selected it can be opened by pressing <CR>.
+(By default files are opened in the current window, but there are other
+mappings that you can use to open in a vertical or horizontal split, or in
+a new tab.) Note that if you have |'nohidden'| set and there are unsaved
+changes in the current window when you press <CR> then opening in the current
+window would fail; in this case Command-T will open the file in a new split.
+
+The following mappings are active when the prompt has focus:
+
+    <BS>        delete the character to the left of the cursor
+    <Del>       delete the character at the cursor
+    <Left>      move the cursor one character to the left
+    <C-h>       move the cursor one character to the left
+    <Right>     move the cursor one character to the right
+    <C-l>       move the cursor one character to the right
+    <C-a>       move the cursor to the start (left)
+    <C-e>       move the cursor to the end (right)
+    <C-u>       clear the contents of the prompt
+    <Tab>       change focus to the file listing
+
+The following mappings are active when the file listing has focus:
+
+    <Tab>       change focus to the prompt
+
+The following mappings are active when either the prompt or the file listing
+has focus:
+
+    <CR>        open the selected file
+    <C-CR>      open the selected file in a new split window
+    <C-s>       open the selected file in a new split window
+    <C-v>       open the selected file in a new vertical split window
+    <C-t>       open the selected file in a new tab
+    <C-j>       select next file in the file listing
+    <C-n>       select next file in the file listing
+    <Down>      select next file in the file listing
+    <C-k>       select previous file in the file listing
+    <C-p>       select previous file in the file listing
+    <Up>        select previous file in the file listing
+    <C-c>       cancel (dismisses file listing)
+
+The following is also available on terminals which support it:
+
+    <Esc>       cancel (dismisses file listing)
+
+Note that the default mappings can be overriden by setting options in your
+~/.vimrc file (see the OPTIONS section for a full list of available options).
+
+In addition, when the file listing has focus, typing a character will cause
+the selection to jump to the first path which begins with that character.
+Typing multiple characters consecutively can be used to distinguish between
+paths which begin with the same prefix.
+
+
+COMMANDS                                        *command-t-commands*
+
+                                                *:CommandT*
+|:CommandT|     Brings up the Command-T file window, starting in the
+                current working directory as returned by the|:pwd|
+                command.
+
+                                                *:CommandTBuffer*
+|:CommandTBuffer|Brings up the Command-T buffer window.
+                This works exactly like the standard file window,
+                except that the selection is limited to files that
+                you already have open in buffers.
+
+                                                *:CommandTJumps*
+|:CommandTJump| Brings up the Command-T jumplist window.
+                This works exactly like the standard file window,
+                except that the selection is limited to files that
+                you already have in the jumplist. Note that jumps
+                can persist across Vim sessions (see Vim's |jumplist|
+                documentation for more info).
+
+                                                *:CommandTFlush*
+|:CommandTFlush|Instructs the plug-in to flush its path cache, causing
+                the directory to be rescanned for new or deleted paths
+                the next time the file window is shown. In addition, all
+                configuration settings are re-evaluated, causing any
+                changes made to settings via the |:let| command to be picked
+                up.
+
+
+MAPPINGS                                        *command-t-mappings*
+
+By default Command-T comes with only two mappings:
+
+  <Leader>t     bring up the Command-T file window
+  <Leader>b     bring up the Command-T buffer window
+
+However, Command-T won't overwrite a pre-existing mapping so if you prefer
+to define different mappings use lines like these in your ~/.vimrc:
+
+  nnoremap <silent> <Leader>t :CommandT<CR>
+  nnoremap <silent> <Leader>b :CommandTBuffer<CR>
+
+Replacing "<Leader>t" or "<Leader>b" with your mapping of choice.
+
+Note that in the case of MacVim you actually can map to Command-T (written
+as <D-t> in Vim) in your ~/.gvimrc file if you first unmap the existing menu
+binding of Command-T to "New Tab":
+
+  if has("gui_macvim")
+    macmenu &File.New\ Tab key=<nop>
+    map <D-t> :CommandT<CR>
+  endif
+
+When the Command-T window is active a number of other additional mappings
+become available for doing things like moving between and selecting matches.
+These are fully described above in the USAGE section, and settings for
+overriding the mappings are listed below under OPTIONS.
+
+
+OPTIONS                                         *command-t-options*
+
+A number of options may be set in your ~/.vimrc to influence the behaviour of
+the plug-in. To set an option, you include a line like this in your ~/.vimrc:
+
+    let g:CommandTMaxFiles=20000
+
+To have Command-T pick up new settings immediately (that is, without having
+to restart Vim) you can issue the |:CommandTFlush| command after making
+changes via |:let|.
+
+Following is a list of all available options:
+
+                                               *g:CommandTMaxFiles*
+  |g:CommandTMaxFiles|                           number (default 10000)
+
+      The maximum number of files that will be considered when scanning the
+      current directory. Upon reaching this number scanning stops. This
+      limit applies only to file listings and is ignored for buffer
+      listings.
+
+                                               *g:CommandTMaxDepth*
+  |g:CommandTMaxDepth|                           number (default 15)
+
+      The maximum depth (levels of recursion) to be explored when scanning the
+      current directory. Any directories at levels beyond this depth will be
+      skipped.
+
+                                               *g:CommandTMaxCachedDirectories*
+  |g:CommandTMaxCachedDirectories|                           number (default 1)
+
+      The maximum number of directories whose contents should be cached when
+      recursively scanning. With the default value of 1, each time you change
+      directories the cache will be emptied and Command-T will have to
+      rescan. Higher values will make Command-T hold more directories in the
+      cache, bringing performance at the cost of memory usage. If set to 0,
+      there is no limit on the number of cached directories.
+
+                                               *g:CommandTMaxHeight*
+  |g:CommandTMaxHeight|                          number (default: 0)
+
+      The maximum height in lines the match window is allowed to expand to.
+      If set to 0, the window will occupy as much of the available space as
+      needed to show matching entries.
+
+                                               *g:CommandTAlwaysShowDotFiles*
+  |g:CommandTAlwaysShowDotFiles|                 boolean (default: 0)
+
+      When showing the file listing Command-T will by default show dot-files
+      only if the entered search string contains a dot that could cause a
+      dot-file to match. When set to a non-zero value, this setting instructs
+      Command-T to always include matching dot-files in the match list
+      regardless of whether the search string contains a dot. See also
+      |g:CommandTNeverShowDotFiles|. Note that this setting only influences
+      the file listing; the buffer listing treats dot-files like any other
+      file.
+
+                                               *g:CommandTNeverShowDotFiles*
+  |g:CommandTNeverShowDotFiles|                  boolean (default: 0)
+
+      In the file listing, Command-T will by default show dot-files if the
+      entered search string contains a dot that could cause a dot-file to
+      match. When set to a non-zero value, this setting instructs Command-T to
+      never show dot-files under any circumstances. Note that it is
+      contradictory to set both this setting and
+      |g:CommandTAlwaysShowDotFiles| to true, and if you do so Vim will suffer
+      from headaches, nervous twitches, and sudden mood swings. This setting
+      has no effect in buffer listings, where dot files are treated like any
+      other file.
+
+                                               *g:CommandTScanDotDirectories*
+  |g:CommandTScanDotDirectories|                 boolean (default: 0)
+
+      Normally Command-T will not recurse into "dot-directories" (directories
+      whose names begin with a dot) while performing its initial scan. Set
+      this setting to a non-zero value to override this behavior and recurse.
+      Note that this setting is completely independent of the
+      |g:CommandTAlwaysShowDotFiles| and |g:CommandTNeverShowDotFiles|
+      settings; those apply only to the selection and display of matches
+      (after scanning has been performed), whereas
+      |g:CommandTScanDotDirectories| affects the behaviour at scan-time.
+
+      Note also that even with this setting off you can still use Command-T to
+      open files inside a "dot-directory" such as ~/.vim, but you have to use
+      the |:cd| command to change into that directory first. For example:
+
+        :cd ~/.vim
+        :CommandT
+
+                                               *g:CommandTMatchWindowAtTop*
+  |g:CommandTMatchWindowAtTop|                   boolean (default: 0)
+
+      When this setting is off (the default) the match window will appear at
+      the bottom so as to keep it near to the prompt. Turning it on causes the
+      match window to appear at the top instead. This may be preferable if you
+      want the best match (usually the first one) to appear in a fixed location
+      on the screen rather than moving as the number of matches changes during
+      typing.
+
+                                                *g:CommandTMatchWindowReverse*
+  |g:CommandTMatchWindowReverse|                  boolean (default: 0)
+
+      When this setting is off (the default) the matches will appear from
+      top to bottom with the topmost being selected. Turning it on causes the
+      matches to be reversed so the best match is at the bottom and the
+      initially selected match is the bottom most. This may be preferable if
+      you want the best match to appear in a fixed location on the screen
+      but still be near the prompt at the bottom.
+
+As well as the basic options listed above, there are a number of settings that
+can be used to override the default key mappings used by Command-T. For
+example, to set <C-x> as the mapping for cancelling (dismissing) the Command-T
+window, you would add the following to your ~/.vimrc:
+
+  let g:CommandTCancelMap='<C-x>'
+
+Multiple, alternative mappings may be specified using list syntax:
+
+  let g:CommandTCancelMap=['<C-x>', '<C-c>']
+
+Following is a list of all map settings and their defaults:
+
+                              Setting   Default mapping(s)
+
+                                      *g:CommandTBackspaceMap*
+              |g:CommandTBackspaceMap|  <BS>
+
+                                      *g:CommandTDeleteMap*
+                 |g:CommandTDeleteMap|  <Del>
+
+                                      *g:CommandTAcceptSelectionMap*
+        |g:CommandTAcceptSelectionMap|  <CR>
+
+                                      *g:CommandTAcceptSelectionSplitMap*
+   |g:CommandTAcceptSelectionSplitMap|  <C-CR>
+                                      <C-s>
+
+                                      *g:CommandTAcceptSelectionTabMap*
+     |g:CommandTAcceptSelectionTabMap|  <C-t>
+
+                                      *g:CommandTAcceptSelectionVSplitMap*
+  |g:CommandTAcceptSelectionVSplitMap|  <C-v>
+
+                                      *g:CommandTToggleFocusMap*
+            |g:CommandTToggleFocusMap|  <Tab>
+
+                                      *g:CommandTCancelMap*
+                 |g:CommandTCancelMap|  <C-c>
+                                      <Esc> (not on all terminals)
+
+                                      *g:CommandTSelectNextMap*
+             |g:CommandTSelectNextMap|  <C-n>
+                                      <C-j>
+                                      <Down>
+
+                                      *g:CommandTSelectPrevMap*
+             |g:CommandTSelectPrevMap|  <C-p>
+                                      <C-k>
+                                      <Up>
+
+                                      *g:CommandTClearMap*
+                  |g:CommandTClearMap|  <C-u>
+
+                                      *g:CommandTCursorLeftMap*
+             |g:CommandTCursorLeftMap|  <Left>
+                                      <C-h>
+
+                                      *g:CommandTCursorRightMap*
+            |g:CommandTCursorRightMap|  <Right>
+                                      <C-l>
+
+                                      *g:CommandTCursorEndMap*
+              |g:CommandTCursorEndMap|  <C-e>
+
+                                      *g:CommandTCursorStartMap*
+            |g:CommandTCursorStartMap|  <C-a>
+
+In addition to the options provided by Command-T itself, some of Vim's own
+settings can be used to control behavior:
+
+                                               *command-t-wildignore*
+  |'wildignore'|                                 string (default: '')
+
+      Vim's |'wildignore'| setting is used to determine which files should be
+      excluded from listings. This is a comma-separated list of glob patterns.
+      It defaults to the empty string, but common settings include "*.o,*.obj"
+      (to exclude object files) or ".git,.svn" (to exclude SCM metadata
+      directories). For example:
+
+        :set wildignore+=*.o,*.obj,.git
+
+      A pattern such as "vendor/rails/**" would exclude all files and
+      subdirectories inside the "vendor/rails" directory (relative to
+      directory Command-T starts in).
+
+      See the |'wildignore'| documentation for more information.
+
+
+AUTHORS                                         *command-t-authors*
+
+Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
+Other contributors that have submitted patches include (in alphabetical
+order):
+
+  Anthony Panozzo
+  Daniel Hahler
+  Lucas de Vries
+  Marian Schubert
+  Matthew Todd
+  Mike Lundy
+  Scott Bronson
+  Steven Moazami
+  Sung Pae
+  Victor Hugo Borja
+  Woody Peterson
+  Zak Johnson
+
+As this was the first Vim plug-in I had ever written I was heavily influenced
+by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
+is one of the largest Ruby-based Vim plug-ins to date.
+
+While the Command-T codebase doesn't contain any code directly copied from
+LustyExplorer, I did use it as a reference for answers to basic questions (like
+"How do you do 'X' in a Ruby-based Vim plug-in?"), and also copied some basic
+architectural decisions (like the division of the code into Prompt, Settings
+and MatchWindow classes).
+
+LustyExplorer is available from:
+
+  http://www.vim.org/scripts/script.php?script_id=1890
+
+
+WEBSITE                                         *command-t-website*
+
+The official website for Command-T is:
+
+  https://wincent.com/products/command-t
+
+The latest release will always be available from there.
+
+Development in progress can be inspected via the project's Git repository
+browser at:
+
+  https://wincent.com/repos/command-t
+
+A copy of each release is also available from the official Vim scripts site
+at:
+
+  http://www.vim.org/scripts/script.php?script_id=3025
+
+Bug reports should be submitted to the issue tracker at:
+
+  https://wincent.com/issues
+
+
+DONATIONS                                       *command-t-donations*
+
+Command-T itself is free software released under the terms of the BSD license.
+If you would like to support further development you can make a donation via
+PayPal to win@wincent.com:
+
+  https://wincent.com/products/command-t/donations
+
+
+LICENSE                                         *command-t-license*
+
+Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+HISTORY                                         *command-t-history*
+
+1.3.1 (18 December 2011)
+
+- fix jumplist navigation under Ruby 1.9.x (patch from Woody Peterson)
+
+1.3 (27 November 2011)
+
+- added the option to maintain multiple caches when changing among
+  directories; see the accompanying |g:CommandTMaxCachedDirectories| setting
+- added the ability to navigate using the Vim jumplist (patch from Marian
+  Schubert)
+
+1.2.1 (30 April 2011)
+
+- Remove duplicate copy of the documentation that was causing "Duplicate tag"
+  errors
+- Mitigate issue with distracting blinking cursor in non-GUI versions of Vim
+  (patch from Steven Moazami)
+
+1.2 (30 April 2011)
+
+- added |g:CommandTMatchWindowReverse| option, to reverse the order of items
+  in the match listing (patch from Steven Moazami)
+
+1.1b2 (26 March 2011)
+
+- fix a glitch in the release process; the plugin itself is unchanged since
+  1.1b
+
+1.1b (26 March 2011)
+
+- add |:CommandTBuffer| command for quickly selecting among open buffers
+
+1.0.1 (5 January 2011)
+
+- work around bug when mapping |:CommandTFlush|, wherein the default mapping
+  for |:CommandT| would not be set up
+- clean up when leaving the Command-T buffer via unexpected means (such as
+  with <C-W k> or similar)
+
+1.0 (26 November 2010)
+
+- make relative path simplification work on Windows
+
+1.0b (5 November 2010)
+
+- work around platform-specific Vim 7.3 bug seen by some users (wherein
+  Vim always falsely reports to Ruby that the buffer numbers is 0)
+- re-use the buffer that is used to show the match listing, rather than
+  throwing it away and recreating it each time Command-T is shown; this
+  stops the buffer numbers from creeping up needlessly
+
+0.9 (8 October 2010)
+
+- use relative paths when opening files inside the current working directory
+  in order to keep buffer listings as brief as possible (patch from Matthew
+  Todd)
+
+0.8.1 (14 September 2010)
+
+- fix mapping issues for users who have set |'notimeout'| (patch from Sung
+  Pae)
+
+0.8 (19 August 2010)
+
+- overrides for the default mappings can now be lists of strings, allowing
+  multiple mappings to be defined for any given action
+- <Leader>t mapping only set up if no other map for |:CommandT| exists
+  (patch from Scott Bronson)
+- prevent folds from appearing in the match listing
+- tweaks to avoid the likelihood of "Not enough room" errors when trying to
+  open files
+- watch out for "nil" windows when restoring window dimensions
+- optimizations (avoid some repeated downcasing)
+- move all Ruby files under the "command-t" subdirectory and avoid polluting
+  the "Vim" module namespace
+
+0.8b (11 July 2010)
+
+- large overhaul of the scoring algorithm to make the ordering of returned
+  results more intuitive; given the scope of the changes and room for
+  optimization of the new algorithm, this release is labelled as "beta"
+
+0.7 (10 June 2010)
+
+- handle more |'wildignore'| patterns by delegating to Vim's own |expand()|
+  function; with this change it is now viable to exclude patterns such as
+  'vendor/rails/**' in addition to filename-only patterns like '*.o' and
+  '.git' (patch from Mike Lundy)
+- always sort results alphabetically for empty search strings; this eliminates
+  filesystem-specific variations (patch from Mike Lundy)
+
+0.6 (28 April 2010)
+
+- |:CommandT| now accepts an optional parameter to specify the starting
+  directory, temporarily overriding the usual default of Vim's |:pwd|
+- fix truncated paths when operating from root directory
+
+0.5.1 (11 April 2010)
+
+- fix for Ruby 1.9 compatibility regression introduced in 0.5
+- documentation enhancements, specifically targetted at Windows users
+
+0.5 (3 April 2010)
+
+- |:CommandTFlush| now re-evaluates settings, allowing changes made via |let|
+  to be picked up without having to restart Vim
+- fix premature abort when scanning very deep directory hierarchies
+- remove broken |<Esc>| key mapping on vt100 and xterm terminals
+- provide settings for overriding default mappings
+- minor performance optimization
+
+0.4 (27 March 2010)
+
+- add |g:CommandTMatchWindowAtTop| setting (patch from Zak Johnson)
+- documentation fixes and enhancements
+- internal refactoring and simplification
+
+0.3 (24 March 2010)
+
+- add |g:CommandTMaxHeight| setting for controlling the maximum height of the
+  match window (patch from Lucas de Vries)
+- fix bug where |'list'| setting might be inappropriately set after dismissing
+  Command-T
+- compatibility fix for different behaviour of "autoload" under Ruby 1.9.1
+- avoid "highlight group not found" warning when run under a version of Vim
+  that does not have syntax highlighting support
+- open in split when opening normally would fail due to |'hidden'| and
+  |'modified'| values
+
+0.2 (23 March 2010)
+
+- compatibility fixes for compilation under Ruby 1.9 series
+- compatibility fixes for compilation under Ruby 1.8.5
+- compatibility fixes for Windows and other non-UNIX platforms
+- suppress "mapping already exists" message if <Leader>t mapping is already
+  defined when plug-in is loaded
+- exclude paths based on |'wildignore'| setting rather than a hardcoded
+  regular expression
+
+0.1 (22 March 2010)
+
+- initial public release
+
+------------------------------------------------------------------------------
+vim:tw=78:ft=help:
diff --git a/vim/doc/conque_term.txt b/vim/doc/conque_term.txt
new file mode 100644 (file)
index 0000000..ff8ca54
--- /dev/null
@@ -0,0 +1,156 @@
+*ConqueTerm* Plugin to run a shell in a buffer
+
+The ConqueTerm plugin will convert a buffer into a terminal emulator, allowing
+you to run a shell or shell application in the buffer.
+
+                                                           *conque_term-usage*
+
+Type :ConqueTerm <command> to launch an application in the current buffer. E.g.
+
+  :ConqueTerm bash
+  :ConqueTerm mysql -h localhost -u joe_lunchbox Menu
+  :ConqueTerm man top
+
+Use :ConqueTermSplit or :ConqueTermVSplit to open Conque in a new horizontal
+or vertical buffer.
+
+Keys pressed in insert mode will be sent to the shell, along with output from
+the 'p' command in normal mode.
+
+Press the <Esc> key twice to send a single <Esc> to the shell. Pressing this 
+key once will leave insert mode like normal.
+
+Press <F9> in any buffer to send a visual selection to the shell.
+
+
+                                                         *conque_term-settings*
+
+Set the following in your .vimrc (default values shown)
+
+" Enable colors. Setting this to 0 will make your terminal faster.
+let g:ConqueTerm_Color = 1
+
+" Set your terminal type. I strong recommend leaving this as vt100, 
+" however more features may be enabled with xterm.
+let g:ConqueTerm_TERM = 'vt100'
+
+" Set buffer syntax. Conque has highlighting for MySQL, but not much else.
+let g:ConqueTerm_Syntax = 'conque'
+
+" Continue updating shell when it's not the current, focused buffer
+let g:ConqueTerm_ReadUnfocused = 1
+
+
+                                                     *conque_term-requirements*
+
+The following minimum requirements are needed to run Conque. Conque will not 
+run on Windows without a Cygwin-like environment.
+
+ - Vim 7.1
+ - Python 2.3
+ - Supported operating systems: *nix, Mac, or Cygwin
+
+Tested on:
+ - Vim 7.2 / Python 2.6 / Ubuntu 9.10 (Gnome & GTK)
+ - Vim 7.2 / Python 2.6 / FreeBSD 8.0 (GTK)
+ - Vim 7.1 / Python 2.6 / FreeBSD 8.0 (GTK)
+ x Vim 7.0 / Python 2.6 / FreeBSD 8.0 (GTK)
+    * feedkeys() doesn't restart updatetime
+ - Vim 7.2 / Python 2.4 / OpenSolaris 2009.06 (Gnome)
+ - Vim 7.2 / Python 2.4 / CentOS 5.3 (no GUI)
+ - Vim 7.1 / Python 2.3 / RHEL 4 (no GUI)
+ - Vim 7.2 / Python 2.5 / Cygwin (Windows Vista 64b)
+ - MacVim 7.2 / Python 2.3 / OS X 10.6.2
+
+                                                             *conque_term-bugs*
+
+The following are known limitations:
+
+ - Font/color highlighting is imperfect and slow. If you don't care about
+   color in your shell, set g:ConqueTerm_Color = 0 in your .vimrc
+ - Conque only supports the extended ASCII character set for input, not utf-8.
+ - VT100 escape sequence support is not complete.
+ - Alt/Meta key support in Vim isn't great in general, and conque is no 
+   exception. Pressing <Esc><Esc>x or <Esc><M-x> instead of <M-x> works in 
+   most cases.
+
+                                                             *conque_term-todo*
+
+ - Fix pasting from named registers
+ - Polling unfucused conque buffers (Top explodes when window resizes)
+ - Enable graphics character set
+ - Consider supporting xterm escapes
+ - Improve color logic
+ - Find a solution to UTF-8 input (See InsertCharPre in Vim todo.txt)
+ - Find an alternative to updatetime polling (See Vim todo.txt)
+ - Find a graceful solution to Meta key input
+ - Windows support 
+   (See PyConsole http://www.vim.org/scripts/script.php?script_id=1974)
+ - Always: look for performance improvements
+
+
+                                                       *conque_term-contribute*
+
+The two contributions most in need are improvements to Vim itself. I currently 
+use hacks to simulate a key press event and repeating CursorHold event. The 
+Vim todo.txt document lists proposed improvements to give users this behavior 
+without hacks. Having a key press event should allow Conque to work with multi-
+byte input. If you are a Vim developer, please consider prioritizing these two 
+items: 
+
+ - todo.txt (Autocommands, line ~3137)
+     8   Add an event like CursorHold that is triggered repeatedly, not just 
+         once after typing something.
+
+ - todo.txt (Autocommands, proposed event list, line ~3189)
+     InsertCharPre   - user typed character Insert mode, before inserting the
+     char.  Pattern is matched with text before the cursor. Set v:char to the 
+     character, can be changed. (not triggered when 'paste' is set).
+
+Bugs, suggestions and patches are all welcome.
+
+For more information visit http://conque.googlecode.com
+
+Check out the latest from svn at http://conque.googlecode.com/svn/trunk/
+
+                                                       *conque_term-changelog*
+
+ - 1.0 / 2010-02-
+    * Complete python rewrite
+    * Add support for ncurses based applications
+    * Add continuous polling, instead of using <Tab>
+    * Improve speed
+    * Improve syntax highlighting
+
+ - 0.6 / 2009-12-18
+    * Fix GVim errors with non-english locale
+    * No functional changes
+
+ - 0.5 / 2009-12-02
+    * Various performance enhancements and bugfixes. 
+    * Rewritten escape sequence processing
+
+ - 0.4 / 2009-10-30
+    * Improved history and tab completion
+    * Fix escape sequence formatting and improve highlighting
+    * Send selected text to shell from any buffer
+    * Add special handling of "vi" and "man" commands
+    * Improve error handling
+    * Add key mappings for <C-p> <C-n> <C-l> <C-j>
+    * Various bugfixes
+
+ - 0.3 / 2009-10-13
+    * Apply escape sequence coloring to output, e.g. ls --color
+    * Clean up syntax files for portability
+    * Fix several Vim 7.1 bugs
+    * Bugfixes for multiple shell buffers
+    * Add experimental shell folding option
+
+ - 0.2 / 2009-10-01
+    * Rewritten subprocess management module in python instead of c
+    * Added support for OS X, partial support for Windows
+    * Improved tab completion
+
+ - 0.1 / 2009-09-03
+    * Initial release
+
diff --git a/vim/doc/delimitMate.txt b/vim/doc/delimitMate.txt
new file mode 100644 (file)
index 0000000..8067cf2
--- /dev/null
@@ -0,0 +1,818 @@
+*delimitMate.txt*   Trying to keep those beasts at bay! v2.6     *delimitMate*
+
+
+
+  MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
+  MMMM  MMMMMMMMM  MMMMMMMMMMMMMMMMMMMMMMMMMM  MMMMM  MMMMMMMMMMMMMMMMMMMMM  ~
+  MMMM  MMMMMMMMM  MMMMMMMMMMMMMMMMMMMMMMMMMM   MMM   MMMMMMMMMMMMMMMMMMMMM
+  MMMM  MMMMMMMMM  MMMMMMMMMMMMMMMMMMMMM  MMM  M   M  MMMMMMMMMM  MMMMMMMMM  ~
+  MMMM  MMM   MMM  MM  MM  M  M MMM  MM    MM  MM MM  MMM   MMM    MMM   MM
+  MM    MM  M  MM  MMMMMM        MMMMMMM  MMM  MMMMM  MM  M  MMM  MMM  M  M  ~
+  M  M  MM     MM  MM  MM  M  M  MM  MMM  MMM  MMMMM  MMMMM  MMM  MMM     M
+  M  M  MM  MMMMM  MM  MM  M  M  MM  MMM  MMM  MMMMM  MMM    MMM  MMM  MMMM  ~
+  M  M  MM  M  MM  MM  MM  M  M  MM  MMM  MMM  MMMMM  MM  M  MMM  MMM  M  M
+  MM    MMM   MMM  MM  MM  M  M  MM  MMM   MM  MMMMM  MMM    MMM   MMM   MM  ~
+  MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
+
+
+
+==============================================================================
+ 0.- CONTENTS                                           *delimitMate-contents*
+
+    1. Introduction____________________________|delimitMateIntro|
+    2. Customization___________________________|delimitMateOptions|
+        2.1 Options summary____________________|delimitMateOptionSummary|
+        2.2 Options details____________________|delimitMateOptionDetails|
+    3. Functionality___________________________|delimitMateFunctionality|
+        3.1 Automatic closing & exiting________|delimitMateAutoClose|
+        3.2 Expansion of space and CR__________|delimitMateExpansion|
+        3.3 Backspace__________________________|delimitMateBackspace|
+        3.4 Smart Quotes_______________________|delimitMateSmartQuotes|
+        3.5 Balancing matching pairs___________|delimitMateBalance|
+        3.6 FileType based configuration_______|delimitMateFileType|
+        3.7 Syntax awareness___________________|delimitMateSyntax|
+    4. Commands________________________________|delimitMateCommands|
+    5. Mappings________________________________|delimitMateMappings|
+    6. Functions_______________________________|delimitMateFunctions|
+    7. TODO list_______________________________|delimitMateTodo|
+    8. Maintainer______________________________|delimitMateMaintainer|
+    9. Credits_________________________________|delimitMateCredits|
+   10. History_________________________________|delimitMateHistory|
+
+==============================================================================
+ 1.- INTRODUCTION                                           *delimitMateIntro*
+
+This plug-in provides automatic closing of quotes, parenthesis, brackets,
+etc.; besides some other related features that should make your time in insert
+mode a little bit easier.
+
+Most of the features can be modified or disabled permanently, using global
+variables, or on a FileType basis, using autocommands. With a couple of
+exceptions and limitations, this features don't brake undo, redo or history.
+
+NOTE 1: If you have any trouble with this plugin, please run |:DelimitMateTest|
+in a new buffer to see what is not working.
+
+NOTE 2: |'timeout'| needs to be set when working in the terminal, otherwise you
+might find weird behaviour with mappings including <Esc> or arrow keys.
+
+NOTE 3: Abbreiations set with |:iabbrev| will not be expanded by delimiters
+used on delimitMate, you should use <C-]> (read |i_CTRL-]|) to expand them on
+the go.
+
+==============================================================================
+ 2. CUSTOMIZATION                                         *delimitMateOptions*
+
+You can create your own mappings for some features using the global functions.
+Read |DelimitMateFunctions| for more info.
+
+------------------------------------------------------------------------------
+   2.1 OPTIONS SUMMARY                              *delimitMateOptionSummary*
+
+The behaviour of this script can be customized setting the following options
+in your vimrc file. You can use local options to set the configuration for
+specific file types, see |delimitMateOptionDetails| for examples.
+
+|'loaded_delimitMate'|            Turns off the script.
+
+|'delimitMate_autoclose'|         Tells delimitMate whether to automagically
+                                insert the closing delimiter.
+
+|'delimitMate_matchpairs'|        Tells delimitMate which characters are
+                                matching pairs.
+
+|'delimitMate_quotes'|            Tells delimitMate which quotes should be
+                                used.
+
+|'delimitMate_nesting_quotes'|    Tells delimitMate which quotes should be
+                                allowed to be nested.
+
+|'delimitMate_expand_cr'|         Turns on/off the expansion of <CR>.
+
+|'delimitMate_expand_space'|      Turns on/off the expansion of <Space>.
+
+|'delimitMate_smart_quotes'|      Turns on/off the "smart quotes" feature.
+
+|'delimitMate_smart_matchpairs'|  Turns on/off the "smart matchpairs" feature.
+
+|'delimitMate_balance_matchpairs'|Turns on/off the "balance matching pairs"
+                                feature.
+
+|'delimitMate_excluded_regions'|  Turns off the script for the given regions or
+                                syntax group names.
+
+|'delimitMate_excluded_ft'|       Turns off the script for the given file types.
+
+|'delimitMate_apostrophes'|       Tells delimitMate how it should "fix"
+                                balancing of single quotes when used as
+                                apostrophes. NOTE: Not needed any more, kept
+                                for compatibility with older versions.
+
+------------------------------------------------------------------------------
+   2.2 OPTIONS DETAILS                              *delimitMateOptionDetails*
+
+Add the shown lines to your vimrc file in order to set the below options.
+Buffer variables take precedence over global ones and can be used along with
+autocmd to modify delimitMate's behavior for specific file types, read more in
+|delimitMateFileType|.
+
+Note: Use buffer variables only to set options for specific file types using
+:autocmd, use global variables to set options for every buffer. Read more in
+|g:var| and |b:var|.
+
+------------------------------------------------------------------------------
+                                                        *'loaded_delimitMate'*
+                                                      *'b:loaded_delimitMate'*
+This option prevents delimitMate from loading.
+e.g.: >
+        let loaded_delimitMate = 1
+        au FileType mail let b:loaded_delimitMate = 1
+<
+------------------------------------------------------------------------------
+                                                     *'delimitMate_autoclose'*
+                                                   *'b:delimitMate_autoclose'*
+Values: 0 or 1.                                                              ~
+Default: 1                                                                   ~
+
+If this option is set to 0, delimitMate will not add a closing delimiter
+automagically. See |delimitMateAutoClose| for details.
+e.g.: >
+        let delimitMate_autoclose = 0
+        au FileType mail let b:delimitMate_autoclose = 0
+<
+------------------------------------------------------------------------------
+                                                    *'delimitMate_matchpairs'*
+                                                  *'b:delimitMate_matchpairs'*
+Values: A string with |'matchpairs'| syntax, plus support for multi-byte~
+        characters.~
+Default: &matchpairs                                                         ~
+
+Use this option to tell delimitMate which characters should be considered
+matching pairs. Read |delimitMateAutoClose| for details.
+e.g: >
+        let delimitMate_matchpairs = "(:),[:],{:},<:>"
+        au FileType vim,html let b:delimitMate_matchpairs = "(:),[:],{:},<:>"
+<
+------------------------------------------------------------------------------
+                                                        *'delimitMate_quotes'*
+                                                      *'b:delimitMate_quotes'*
+Values: A string of characters separated by spaces.                          ~
+Default: "\" ' `"                                                            ~
+
+Use this option to tell delimitMate which characters should be considered as
+quotes. Read |delimitMateAutoClose| for details.
+e.g.: >
+        let delimitMate_quotes = "\" ' ` *"
+        au FileType html let b:delimitMate_quotes = "\" '"
+<
+------------------------------------------------------------------------------
+                                                *'delimitMate_nesting_quotes'*
+                                              *'b:delimitMate_nesting_quotes'*
+Values: A list of quotes.                                                    ~
+Default: []                                                                  ~
+
+Quotes listed here will not be able to jump out of the empty pair, thus
+allowing the autoclosed quotes to be nested.
+e.g.: >
+        let delimitMate_nesting_quotes = ['"','`']
+        au FileType python let b:delimitMate_nesting_quotes = ['"']
+<
+------------------------------------------------------------------------------
+                                                     *'delimitMate_expand_cr'*
+                                                   *'b:delimitMate_expand_cr'*
+Values: 1 or 0                                                               ~
+Default: 0                                                                   ~
+
+This option turns on/off the expansion of <CR>. Read |delimitMateExpansion|
+for details. NOTE This feature requires that 'backspace' is either set to 2 or
+has "eol" and "start" as part of its value.
+e.g.: >
+        let delimitMate_expand_cr = 1
+        au FileType mail let b:delimitMate_expand_cr = 1
+<
+------------------------------------------------------------------------------
+                                                  *'delimitMate_expand_space'*
+                                                *'b:delimitMate_expand_space'*
+Values: 1 or 0                                                               ~
+Default: 0                                                                   ~
+This option turns on/off the expansion of <Space>. Read |delimitMateExpansion|
+for details.
+e.g.: >
+        let delimitMate_expand_space = 1
+        au FileType tcl let b:delimitMate_expand_space = 1
+<
+------------------------------------------------------------------------------
+                                                  *'delimitMate_smart_quotes'*
+                                                *'b:delimitMate_smart_quotes'*
+Values: 1 or 0                                                               ~
+Default: 1                              ~
+
+This option turns on/off the smart quotes feature. Read
+|delimitMateSmartQuotes| for details.
+e.g.: >
+        let delimitMate_smart_quotes = 0
+        au FileType tcl let b:delimitMate_smart_quotes = 1
+<
+------------------------------------------------------------------------------
+                                              *'delimitMate_smart_matchpairs'*
+                                            *'b:delimitMate_smart_matchpairs'*
+Values: Regexp                                                               ~
+Default: '^\%(\w\|\!\|ยฃ\|\$\|_\|["'']\s*\S\)'                                ~
+
+This regex is matched against the text to the right of cursor, if it's not
+empty and there is a match delimitMate will not autoclose the pair. At the
+moment to match the text, an escaped bang (\!) in the regex will be replaced
+by the character being inserted, while an escaped number symbol (\#) will be
+replaced by the closing pair.
+e.g.: >
+        let delimitMate_smart_matchpairs = ''
+        au FileType tcl let b:delimitMate_smart_matchpairs = '^\%(\w\|\$\)'
+<
+------------------------------------------------------------------------------
+                                            *'delimitMate_balance_matchpairs'*
+                                          *'b:delimitMate_balance_matchpairs'*
+Values: 1 or 0                                                               ~
+Default: 0                                                                   ~
+
+This option turns on/off the balancing of matching pairs. Read
+|delimitMateBalance| for details.
+e.g.: >
+        let delimitMate_balance_matchpairs = 1
+        au FileType tcl let b:delimitMate_balance_matchpairs = 1
+<
+------------------------------------------------------------------------------
+                                              *'delimitMate_excluded_regions'*
+Values: A string of syntax group names names separated by single commas.     ~
+Default: Comment                                                             ~
+
+This options turns delimitMate off for the listed regions, read |group-name|
+for more info about what is a region.
+e.g.: >
+        let delimitMate_excluded_regions = "Comments,String"
+<
+------------------------------------------------------------------------------
+                                                   *'delimitMate_excluded_ft'*
+Values: A string of file type names separated by single commas.              ~
+Default: Empty.                                                              ~
+
+This options turns delimitMate off for the listed file types, use this option
+only if you don't want any of the features it provides on those file types.
+e.g.: >
+        let delimitMate_excluded_ft = "mail,txt"
+<
+------------------------------------------------------------------------------
+                                                   *'delimitMate_apostrophes'*
+Values: Strings separated by ":".                                            ~
+Default: No longer used.                                                     ~
+
+NOTE: This feature is turned off by default, it's been kept for compatibility
+with older version, read |delimitMateSmartQuotes| for details.
+If auto-close is enabled, this option tells delimitMate how to try to fix the
+balancing of single quotes when used as apostrophes. The values of this option
+are strings of text where a single quote would be used as an apostrophe (e.g.:
+the "n't" of wouldn't or can't) separated by ":". Set it to an empty string to
+disable this feature.
+e.g.: >
+        let delimitMate_apostrophes = ""
+        au FileType tcl let delimitMate_apostrophes = ""
+<
+==============================================================================
+ 3. FUNCTIONALITY                                   *delimitMateFunctionality*
+
+------------------------------------------------------------------------------
+   3.1 AUTOMATIC CLOSING AND EXITING                    *delimitMateAutoClose*
+
+With automatic closing enabled, if an opening delimiter is inserted the plugin
+inserts the closing delimiter and places the cursor between the pair. With
+automatic closing disabled, no closing delimiters is inserted by delimitMate,
+but when a pair of delimiters is typed, the cursor is placed in the middle.
+
+When the cursor is inside an empty pair or located next to the left of a
+closing delimiter, the cursor is placed outside the pair to the right of the
+closing delimiter.
+
+When |'delimitMate_smart_matchpairs'| is not empty and it matches the text to
+the right of the cursor, delimitMate will not automatically insert the closing
+pair.
+
+Unless |'delimitMate_matchpairs'| or |'delimitMate_quotes'| are set, this
+script uses the values in '&matchpairs' to identify the pairs, and ", ' and `
+for quotes respectively.
+
+<S-Tab> will jump over a single closing delimiter or quote, <C-G>g will jump
+over contiguous delimiters and/or quotes.
+
+The following table shows the behaviour, this applies to quotes too (the final
+position of the cursor is represented by a "|"):
+
+With auto-close: >
+                          Type     |  You get
+                        =======================
+                           (       |    (|)
+                        โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“|โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“
+                           ()      |    ()|
+                        โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“|โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“
+                        (<S-Tab>   |    ()|
+                        โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“|โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“
+                        {("<C-G>g  |  {("")}|
+<
+Without auto-close: >
+
+                          Type        |  You get
+                        =========================
+                           ()         |    (|)
+                        โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“-----|โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“
+                           ())        |    ()|
+                        โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“-----|โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“
+                        ()<S-Tab>     |    ()|
+                        โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“|โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“
+                        {}()""<C-G>g  |  {("")}|
+<
+NOTE: Abbreviations will not be expanded by delimiters used on delimitMate,
+you should use <C-]> (read |i_CTRL-]|) to expand them on the go.
+
+------------------------------------------------------------------------------
+   3.2 EXPANSION OF SPACE AND CAR RETURN                *delimitMateExpansion*
+
+When the cursor is inside an empty pair of delimiters, <Space> and <CR> can be
+expanded, see |'delimitMate_expand_space'| and
+|'delimitMate_expand_cr'|:
+
+Expand <Space> to: >
+
+                    <Space><Space><Left>  |  You get
+                  ====================================
+                              (|)         |    ( | )
+<
+Expand <CR> to: >
+
+                      <CR><CR><Up>  |  You get
+                    ============================
+                           (|)      |    (
+                                    |    |
+                                    |    )
+<
+
+NOTE that the expansion of <CR> will brake the redo command.
+
+Since <Space> and <CR> are used everywhere, I have made the functions involved
+in expansions global, so they can be used to make custom mappings. Read
+|delimitMateFunctions| for more details.
+
+------------------------------------------------------------------------------
+   3.3 BACKSPACE                                        *delimitMateBackspace*
+
+If you press backspace inside an empty pair, both delimiters are deleted. When
+expansions are enabled, <BS> will also delete the expansions. NOTE that
+deleting <CR> expansions will brake the redo command.
+
+If you type <S-BS> (shift + backspace) instead, only the closing delimiter
+will be deleted. NOTE that this will not usually work when using Vim from the
+terminal, see 'delimitMate#JumpAny()' below to see how to fix it.
+
+e.g. typing at the "|": >
+
+                  What  |      Before       |      After
+               ==============================================
+                  <BS>  |  call expand(|)   |  call expand|
+               ---------|-------------------|-----------------
+                  <BS>  |  call expand( | ) |  call expand(|)
+               ---------|-------------------|-----------------
+                  <BS>  |  call expand(     |  call expand(|)
+                        |  |                |
+                        |  )                |
+               ---------|-------------------|-----------------
+                 <S-BS> |  call expand(|)   |  call expand(|
+<
+
+------------------------------------------------------------------------------
+   3.4 SMART QUOTES                                   *delimitMateSmartQuotes*
+
+Only one quote will be inserted following a quote, a "\" or, following or
+preceding a keyword character. This should cover closing quotes after a
+string, opening quotes before a string, escaped quotes and apostrophes. Except
+for apostrophes, this feature can be disabled setting the option
+|'delimitMate_smart_quotes'| to 0.
+
+e.g. typing at the "|": >
+
+                     What |    Before    |     After
+                  =======================================
+                      "   |  Text |      |  Text "|"
+                      "   |  "String|    |  "String"|
+                      "   |  let i = "|  |  let i = "|"
+                      'm  |  I|          |  I'm|
+<
+------------------------------------------------------------------------------
+   3.4 SMART MATCHPAIRS                           *delimitMateSmartMatchpairs*
+
+This is similar to "smart quotes", but applied to the characters in
+|'delimitMate_matchpairs'|. The difference is that delimitMate will not
+auto-close the pair when the regex matches the text on the right of the
+cursor. See |'delimitMate_smart_matchpairs'| for more details.
+
+
+e.g. typing at the "|": >
+
+                     What |    Before    |     After
+                  =======================================
+                      (   |  function|   |  function(|)
+                      (   |  |var        |  (|var
+<
+------------------------------------------------------------------------------
+   3.5 BALANCING MATCHING PAIRS                           *delimitMateBalance*
+
+When inserting an opening paren and |'delimitMate_balance_matchpairs'| is
+enabled, delimitMate will try to balance the closing pairs in the current
+line.
+
+e.g. typing at the "|": >
+
+                     What |    Before    |     After
+                  =======================================
+                      (   |      |       |     (|)
+                      (   |      |)      |     (|)
+                      ((  |      |)      |    ((|))
+<
+------------------------------------------------------------------------------
+   3.6 FILE TYPE BASED CONFIGURATION                     *delimitMateFileType*
+
+delimitMate options can be set globally for all buffers using global
+("regular") variables in your |vimrc| file. But |:autocmd| can be used to set
+options for specific file types (see |'filetype'|) using buffer variables in
+the following way: >
+
+   au FileType mail,text let b:delimitMate_autoclose = 0
+         ^       ^           ^            ^            ^
+         |       |           |            |            |
+         |       |           |            |            - Option value.
+         |       |           |            - Option name.
+         |       |           - Buffer variable.
+         |       - File types for which the option will be set.
+         - Don't forget to put this event.
+<
+NOTE that you should use buffer variables (|b:var|) only to set options with
+|:autocmd|, for global options use regular variables (|g:var|) in your vimrc.
+
+------------------------------------------------------------------------------
+   3.7 SYNTAX AWARENESS                                    *delimitMateSyntax*
+
+The features of this plug-in might not be always helpful, comments and strings
+usualy don't need auto-completion. delimitMate monitors which region is being
+edited and if it detects that the cursor is in a comment it'll turn itself off
+until the cursor leaves the comment. The excluded regions can be set using the
+option |'delimitMate_excluded_regions'|. Read |group-name| for a list of
+regions or syntax group names.
+
+NOTE that this feature relies on a proper syntax file for the current file
+type, if the appropiate syntax file doesn't define a region, delimitMate won't
+know about it.
+
+==============================================================================
+ 4. COMMANDS                                             *delimitMateCommands*
+
+------------------------------------------------------------------------------
+:DelimitMateReload                                        *:DelimitMateReload*
+
+Re-sets all the mappings used for this script, use it if any option has been
+changed or if the filetype option hasn't been set yet.
+
+------------------------------------------------------------------------------
+:DelimitMateSwitch                                        *:DelimitMateSwitch*
+
+Switches the plug-in on and off.
+
+------------------------------------------------------------------------------
+:DelimitMateTest                                            *:DelimitMateTest*
+
+This command tests every mapping set-up for this script, useful for testing
+custom configurations.
+
+The following output corresponds to the default values, it will be different
+depending on your configuration. "Open & close:" represents the final result
+when the closing delimiter has been inserted, either manually or
+automatically, see |delimitMateExpansion|. "Delete:" typing backspace in an
+empty pair, see |delimitMateBackspace|. "Exit:" typing a closing delimiter
+inside a pair of delimiters, see |delimitMateAutoclose|. "Space:" the
+expansion, if any, of space, see |delimitMateExpansion|. "Visual-L",
+"Visual-R" and "Visual" shows visual wrapping, see
+|delimitMateVisualWrapping|. "Car return:" the expansion of car return, see
+|delimitMateExpansion|. The cursor's position at the end of every test is
+represented by an "|": >
+
+            * AUTOCLOSE:
+            Open & close: (|)
+            Delete: |
+            Exit: ()|
+            Space: ( |)
+            Visual-L: (v)
+            Visual-R: (v)
+            Car return: (
+            |)
+
+            Open & close: {|}
+            Delete: |
+            Exit: {}|
+            Space: { |}
+            Visual-L: {v}
+            Visual-R: {v}
+            Car return: {
+            |}
+
+            Open & close: [|]
+            Delete: |
+            Exit: []|
+            Space: [ |]
+            Visual-L: [v]
+            Visual-R: [v]
+            Car return: [
+            |]
+
+            Open & close: "|"
+            Delete: |
+            Exit: ""|
+            Space: " |"
+            Visual: "v"
+            Car return: "
+            |"
+
+            Open & close: '|'
+            Delete: |
+            Exit: ''|
+            Space: ' |'
+            Visual: 'v'
+            Car return: '
+            |'
+
+            Open & close: `|`
+            Delete: |
+            Exit: ``|
+            Space: ` |`
+            Visual: `v`
+            Car return: `
+            |`
+<
+
+==============================================================================
+ 5. MAPPINGS                                             *delimitMateMappings*
+
+delimitMate doesn't override any existing map, so you may encounter that it
+doesn't work as expected because a mapping is missing. In that case, the
+conflicting mappings should be resolved by either disabling the conflicting
+mapping or creating a custom mappings.
+
+In order to make custom mappings easier and prevent overwritting existing
+ones, delimitMate uses the |<Plug>| + |hasmapto()| (|usr_41.txt|) construct
+for its mappings.
+
+These are the default mappings:
+
+<BS>         is mapped to <Plug>delimitMateBS
+<S-BS>       is mapped to <Plug>delimitMateS-BS
+<S-Tab>      is mapped to <Plug>delimitMateS-Tab
+<C-G>g       is mapped to <Plug>delimitMateJumpMany
+<Del>        is mapped to <Plug>delimitMateDel
+<Esc>        is mapped to <Plug>delimitMateEsc
+<Left>       is mapped to <Plug>delimitMateLeft
+<Right>      is mapped to <Plug>delimitMateRight
+<Home>       is mapped to <Plug>delimitMateHome
+<End>        is mapped to <Plug>delimitMateEnd
+<Up>         is mapped to <Plug>delimitMateUp
+<Down>       is mapped to <Plug>delimitMateDown
+<PageUp>     is mapped to <Plug>delimitMatePageUp
+<PageDown>   is mapped to <Plug>delimitMatePageDown
+<S-Down>     is mapped to <Plug>delimitMateS-Down
+<S-Up>       is mapped to <Plug>delimitMateS-Up
+<LeftMouse>  is mapped to <Plug>delimitMateMLeftMouse
+<RightMouse> is mapped to <Plug>delimitMateMRightMouse
+
+The rest of the mappings correspond to parens, quotes, CR, Space, etc. and they
+depend on the values of the delimitMate options, they have the following form:
+
+<Plug>delimitMate + char
+
+e.g.: for "(":
+
+( is mapped to <Plug>delimitMate(
+
+e.g.: If you have <CR> expansion enabled, you might want to skip it on pop-up
+menus:
+
+    imap <expr> <CR> pumvisible() ?
+                     \"\<c-y>" :
+                     \ "<Plug>delimitMateCR"
+
+
+==============================================================================
+ 6. FUNCTIONS                                           *delimitMateFunctions*
+
+------------------------------------------------------------------------------
+delimitMate#WithinEmptyPair()                  *delimitMate#WithinEmptyPair()*
+
+Returns 1 if the cursor is inside an empty pair, 0 otherwise.
+e.g.: >
+
+    inoremap <expr> <CR> delimitMate#WithinEmptyPair() ?
+             \ "\<C-R>=delimitMate#ExpandReturn()\<CR>" :
+             \ "external_mapping"
+<
+
+------------------------------------------------------------------------------
+delimitMate#ShouldJump()                            *delimitMate#ShouldJump()*
+
+Returns 1 if there is a closing delimiter or a quote to the right of the
+cursor, 0 otherwise.
+
+------------------------------------------------------------------------------
+delimitMate#JumpAny(key)                               *delimitMate#JumpAny()*
+
+This function returns a mapping that will make the cursor jump to the right
+when delimitMate#ShouldJump() returns 1, returns the argument "key" otherwise.
+e.g.: You can use this to create your own mapping to jump over any delimiter.
+>
+   inoremap <C-Tab> <C-R>=delimitMate#JumpAny("\<C-Tab>")<CR>
+<
+
+==============================================================================
+ 7. TODO LIST                                                *delimitMateTodo*
+
+- Automatic set-up by file type.
+- Make block-wise visual wrapping work on un-even regions.
+
+==============================================================================
+ 8. MAINTAINER                                         *delimitMateMaintainer*
+
+Hi there! My name is Israel Chauca F. and I can be reached at:
+    mailto:israelchauca@gmail.com
+
+Feel free to send me any suggestions and/or comments about this plugin, I'll
+be very pleased to read them.
+
+==============================================================================
+ 9. CREDITS                                               *delimitMateCredits*
+
+Contributors: ~
+
+  - Kim Silkebรฆkken                                                         ~
+    Fixed mappings being echoed in the terminal.
+
+  - Eric Van Dewoestine                                                     ~
+    Implemented smart matchpairs.
+
+Some of the code that makes this script was modified or just shamelessly
+copied from the following sources:
+
+  - Ian McCracken                                                          ~
+    Post titled: Vim, Part II: Matching Pairs:
+    http://concisionandconcinnity.blogspot.com/
+
+  - Aristotle Pagaltzis                                                    ~
+    From the comments on the previous blog post and from:
+    http://gist.github.com/144619
+
+  - Karl Guertin                                                           ~
+    AutoClose:
+    http://www.vim.org/scripts/script.php?script_id=1849
+
+  - Thiago Alves                                                           ~
+    AutoClose:
+    http://www.vim.org/scripts/script.php?script_id=2009
+
+  - Edoardo Vacchi                                                         ~
+    ClosePairs:
+    http://www.vim.org/scripts/script.php?script_id=2373
+
+This script was inspired by the auto-completion of delimiters on TextMate.
+
+==============================================================================
+ 10. HISTORY                                               *delimitMateHistory*
+
+  Version      Date      Release notes                                       ~
+|---------|------------|-----------------------------------------------------|
+    2.6     2011-01-14 * Current release:
+                         - Add smart_matchpairs feature.
+                         - Add mapping to jump over contiguous delimiters.
+                         - Fix behaviour of b:loaded_delimitMate.
+|---------|------------|-----------------------------------------------------|
+    2.5.1   2010-09-30 * - Remove visual wrapping. Surround.vim offers a much
+                           better implementation.
+                         - Minor mods to DelimitMateTest.
+|---------|------------|-----------------------------------------------------|
+    2.5     2010-09-22 * - Better handling of mappings.
+                         - Add report for mappings in |:DelimitMateTest|.
+                         - Allow the use of "|" and multi-byte characters in
+                           |'delimitMate_quotes'| and |'delimitMate_matchpairs'|.
+                         - Allow commands to be concatenated using |.
+|---------|------------|-----------------------------------------------------|
+    2.4.1   2010-07-31 * - Fix problem with <Home> and <End>.
+                         - Add missing doc on |'delimitMate_smart_quotes'|,
+                           |delimitMateBalance| and
+                           |'delimitMate_balance_matchpairs'|.
+|---------|------------|-----------------------------------------------------|
+    2.4     2010-07-29 * - Unbalanced parens: see :help delimitMateBalance.
+                         - Visual wrapping now works on block-wise visual
+                           with some limitations.
+                         - Arrow keys didn't work on terminal.
+                         - Added option to allow nested quotes.
+                         - Expand Smart Quotes to look for a string on the
+                           right of the cursor.
+
+|---------|------------|-----------------------------------------------------|
+    2.3.1   2010-06-06 * - Fix: an extra <Space> is inserted after <Space>
+                           expansion.
+
+|---------|------------|-----------------------------------------------------|
+    2.3     2010-06-06 * - Syntax aware: Will turn off when editing comments
+                           or other regions, customizable.
+                         - Changed format of most mappings.
+                         - Fix: <CR> expansion doesn't brake automatic
+                           indentation adjustments anymore.
+                         - Fix: Arrow keys would insert A, B, C or D instead
+                           of moving the cursor when using Vim on a terminal.
+
+|---------|------------|-----------------------------------------------------|
+    2.2     2010-05-16 * - Added command to switch the plug-in on and off.
+                         - Fix: some problems with <Left>, <Right> and <CR>.
+                         - Fix: A small problem when inserting a delimiter at
+                           the beginning of the line.
+
+|---------|------------|-----------------------------------------------------|
+    2.1     2010-05-10 * - Most of the functions have been moved to an
+                           autoload script to avoid loading unnecessary ones.
+                         - Fixed a problem with the redo command.
+                         - Many small fixes.
+
+|---------|------------|-----------------------------------------------------|
+    2.0     2010-04-01 * New features:
+                         - All features are redo/undo-wise safe.
+                         - A single quote typed after an alphanumeric
+                           character is considered an apostrophe and one
+                           single quote is inserted.
+                         - A quote typed after another quote inserts a single
+                           quote and the cursor jumps to the middle.
+                         - <S-Tab> jumps out of any empty pair.
+                         - <CR> and <Space> expansions are fixed, but the
+                           functions used for it are global and can be used in
+                           custom mappings. The previous system is still
+                           active if you have any of the expansion options
+                           set.
+                         - <S-Backspace> deletes the closing delimiter.
+                         * Fixed bug:
+                         - s:vars were being used to store buffer options.
+
+|---------|------------|-----------------------------------------------------|
+    1.6     2009-10-10 * Now delimitMate tries to fix the balancing of single
+                         quotes when used as apostrophes. You can read
+                         |delimitMate_apostrophes| for details.
+                         Fixed an error when |b:delimitMate_expand_space|
+                         wasn't set but |delimitMate_expand_space| wasn't.
+
+|---------|------------|-----------------------------------------------------|
+    1.5     2009-10-05 * Fix: delimitMate should work correctly for files
+                         passed as arguments to Vim. Thanks to Ben Beuchler
+                         for helping to nail this bug.
+
+|---------|------------|-----------------------------------------------------|
+    1.4     2009-09-27 * Fix: delimitMate is now enabled on new buffers even
+                         if they don't have set the file type option or were
+                         opened directly from the terminal.
+
+|---------|------------|-----------------------------------------------------|
+    1.3     2009-09-24 * Now local options can be used along with autocmd
+                         for specific file type configurations.
+                         Fixes:
+                         - Unnamed register content is not lost on visual
+                         mode.
+                         - Use noremap where appropiate.
+                         - Wrapping a single empty line works as expected.
+
+|---------|------------|-----------------------------------------------------|
+    1.2     2009-09-07 * Fixes:
+                         - When inside nested empty pairs, deleting the
+                         innermost left delimiter would delete all right
+                         contiguous delimiters.
+                         - When inside an empty pair, inserting a left
+                         delimiter wouldn't insert the right one, instead
+                         the cursor would jump to the right.
+                         - New buffer inside the current window wouldn't
+                         have the mappings set.
+
+|---------|------------|-----------------------------------------------------|
+    1.1     2009-08-25 * Fixed an error that ocurred when mapleader wasn't
+                         set and added support for GetLatestScripts
+                         auto-detection.
+
+|---------|------------|-----------------------------------------------------|
+    1.0     2009-08-23 * Initial upload.
+
+|---------|------------|-----------------------------------------------------|
+
+
+  `\|||/ยด         MMM           \|/            www            __^__          ~
+   (o o)         (o o)          @ @           (O-O)          /(o o)\\        ~
+ooO_(_)_Ooo__ ooO_(_)_Ooo___oOO_(_)_OOo___oOO__(_)__OOo___oOO__(_)__OOo_____ ~
+_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|____ ~
+__|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_ ~
+_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|____ ~
+
+vim:tw=78:et:ts=2:sw=2:ft=help:norl:formatoptions+=tcroqn:autoindent:
diff --git a/vim/doc/easymotion.txt b/vim/doc/easymotion.txt
new file mode 100755 (executable)
index 0000000..c91a959
--- /dev/null
@@ -0,0 +1,319 @@
+*easymotion.txt*       Version 1.3.  Last change: 2011 Nov 7
+
+
+            ______                  __  ___       __  _
+           / ____/____ ________  __/  |/  /____  / /_(_)____  ____
+          / __/  / __ `/ ___/ / / / /|_/ // __ \/ __/ // __ \/ __ \
+         / /___ / /_/ (__  ) /_/ / /  / // /_/ / /_/ // /_/ / / / /
+        /_____/ \__,_/____/\__, /_/  /_/ \____/\__/_/ \____/_/ /_/
+                          /____/
+                                  - Vim motions on speed!
+
+
+==============================================================================
+CONTENTS                                                 *easymotion-contents*
+
+    1. Introduction ....................... |easymotion-introduction|
+    2. Usage .............................. |easymotion-usage|
+       2.1 Default mappings ............... |easymotion-default-mappings|
+    3. Requirements ....................... |easymotion-requirements|
+    4. Configuration ...................... |easymotion-configuration|
+       4.1 EasyMotion_keys ................ |EasyMotion_keys|
+       4.2 EasyMotion_do_shade ............ |EasyMotion_do_shade|
+       4.3 EasyMotion_do_mapping .......... |EasyMotion_do_mapping|
+       4.4 EasyMotion_grouping ............ |EasyMotion_grouping|
+       4.5 Custom highlighting ............ |easymotion-custom-hl|
+       4.6 Custom mappings ................ |easymotion-custom-mappings|
+           4.6.1 Leader key ............... |easymotion-leader-key|
+           4.6.2 Custom keys .............. |easymotion-custom-keys|
+    5. License ............................ |easymotion-license|
+    6. Known bugs ......................... |easymotion-known-bugs|
+    7. Contributing ....................... |easymotion-contributing|
+    8. Credits ............................ |easymotion-credits|
+
+==============================================================================
+1. Introduction                         *easymotion* *easymotion-introduction*
+
+EasyMotion provides a much simpler way to use some motions in vim. It takes
+the <number> out of <number>w or <number>f{char} by highlighting all possible
+choices and allowing you to press one key to jump directly to the target.
+
+When one of the available motions is triggered, all visible text preceding or
+following the cursor is faded, and motion targets are highlighted.
+
+==============================================================================
+2. Usage                                                    *easymotion-usage*
+
+EasyMotion is triggered by one of the provided mappings (see
+|easymotion-default-mappings| for details).
+
+Example: >
+
+    <cursor>Lorem ipsum dolor sit amet.
+
+Type <Leader><Leader>w to trigger the word motion |w|. See
+|easymotion-leader-key| for details about the leader key. When the
+motion is triggered, the text is updated (no braces are actually added,
+the text is highlighted in red by default): >
+
+    <cursor>Lorem {a}psum {b}olor {c}it {d}met.
+
+Press "c" to jump to the beginning of the word "sit": >
+
+    Lorem ipsum dolor <cursor>sit amet.
+
+Similarly, if you're looking for an "o", you can use the |f| motion.
+Type <Leader><Leader>fo, and all "o" characters are highlighted: >
+
+    <cursor>L{a}rem ipsum d{b}l{c}r sit amet.
+
+Press "b" to jump to the second "o": >
+
+    Lorem ipsum d<cursor>olor sit amet.
+
+And that's it!
+
+------------------------------------------------------------------------------
+2.1 Default mappings                             *easymotion-default-mappings*
+
+The default configuration defines the following mappings in normal,
+visual and operator-pending mode:
+
+    Mapping           | Details
+    ------------------|----------------------------------------------
+    <Leader>f{char}   | Find {char} to the right. See |f|.
+    <Leader>F{char}   | Find {char} to the left. See |F|.
+    <Leader>t{char}   | Till before the {char} to the right. See |t|.
+    <Leader>T{char}   | Till after the {char} to the left. See |T|.
+    <Leader>w         | Beginning of word forward. See |w|.
+    <Leader>W         | Beginning of WORD forward. See |W|.
+    <Leader>b         | Beginning of word backward. See |b|.
+    <Leader>B         | Beginning of WORD backward. See |B|.
+    <Leader>e         | End of word forward. See |e|.
+    <Leader>E         | End of WORD forward. See |E|.
+    <Leader>ge        | End of word backward. See |ge|.
+    <Leader>gE        | End of WORD backward. See |gE|.
+    <Leader>j         | Line downward. See |j|.
+    <Leader>k         | Line upward. See |k|.
+    <Leader>n         | Jump to latest "/" or "?" forward. See |n|.
+    <Leader>N         | Jump to latest "/" or "?" backward. See |N|.
+
+See |easymotion-leader-key| and |mapleader| for details about the leader key.
+See |easymotion-custom-mappings| for customizing the default mappings.
+
+==============================================================================
+3. Requirements                                      *easymotion-requirements*
+
+EasyMotion has been developed and tested in vim 7.3, but it should run without
+any problems in vim 7.2.
+
+Vi-compatible mode must be disabled.
+
+==============================================================================
+4. Configuration                                    *easymotion-configuration*
+
+EasyMotion will work fine without any configuration, but you can override the
+default behavior by setting configuration variables globally in your |vimrc|
+file.
+
+Example (this will change the target keys and disable shading): >
+
+    let g:EasyMotion_keys = '1234567890'
+    let g:EasyMotion_do_shade = 0
+
+------------------------------------------------------------------------------
+4.1 EasyMotion_keys                                          *EasyMotion_keys*
+
+Set the keys which will be used for motion targets. Add as many keys as you
+want. There's a lower chance that the motion targets will be grouped if many
+keys are available.
+
+Default: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+
+------------------------------------------------------------------------------
+4.2 EasyMotion_do_shade                                  *EasyMotion_do_shade*
+
+The default behavior is to shade the text following the cursor (forward
+motions) or preceding the cursor (backward motions) to make the motion targets
+more visible. Set this option to 0 if you want to disable text shading.
+
+Default: 1
+
+------------------------------------------------------------------------------
+4.3 EasyMotion_do_mapping                              *EasyMotion_do_mapping*
+
+Set this option to 0 if you want to disable the default mappings. See
+|easymotion-default-mappings| for details about the default mappings.
+
+Note: If you disable this option, you'll have to map the motions yourself. See
+the plugin source code for mapping details. You usually shouldn't need to do
+this, see |easymotion-custom-mappings| for customizing the default mappings.
+
+Default: 1
+
+------------------------------------------------------------------------------
+4.4 EasyMotion_grouping                                  *EasyMotion_grouping*
+
+When there are too many possible targets on the screen, the results have to be
+grouped. This configuration option lets you change which grouping algorithm
+you want to use. There are two grouping algorithms available:
+
+    *  Single-key priority (value: 1)
+       -------------------
+
+       This algorithm prioritizes single-key jumps for the targets closest to
+       the cursor and only groups the last jump targets to maximize the amount
+       of single-key jumps.
+
+       This algorithm works recursively and will work with as few keys as two.
+
+       Example (with |EasyMotion_keys| = "abcdef"): >
+
+       x x x x x x x x x
+<
+       The |w| motion is triggered: >
+
+       a b c d e f f f f
+       ^ ^ ^ ^ ^           Direct jump to target
+                 ^ ^ ^ ^   Enter group "f"
+<
+    *  Original (value: 2)
+       --------
+
+       This is the original algorithm which always groups all targets if there
+       are too many possible motion targets.
+
+       Example (with |EasyMotion_keys| = "abcdef"): >
+
+       x x x x x x x x x
+<
+       The |w| motion is triggered: >
+
+       a a a a a a b b b
+       ^ ^ ^ ^ ^ ^         Enter group "a"
+                   ^ ^ ^   Enter group "b"
+
+Default: 1
+
+------------------------------------------------------------------------------
+4.5 Custom highlighting                                 *easymotion-custom-hl*
+
+The default EasyMotion configuration uses two highlighting groups that link
+to groups with default values. The highlighting groups are:
+
+    * EasyMotionTarget
+
+      Highlights motion targets, the default value is bold red
+
+    * EasyMotionShade
+
+      Highlights shaded text, the default value is dark gray
+
+There are two ways to override the default colors:
+
+   1) Set the highlighting in your color scheme
+
+      This will only affect a single color scheme. The default red/gray colors
+      will be used if you change the color scheme to one that doesn't assign
+      any EasyMotion colors.
+
+      Example: >
+
+          hi EasyMotionTarget ctermbg=none ctermfg=green
+          hi EasyMotionShade  ctermbg=none ctermfg=blue
+<
+   2) Set the highlighting in your vimrc
+
+      This is ideal if you want to link the colors to highlighting groups that
+      are available in almost every color scheme, e.g. |ErrorMsg| (usually
+      bright red) and Comment (usually faded). You can be sure that the
+      color scheme's colors will be used instead of the default red/gray
+      if you choose this option.
+
+      Example: >
+
+          hi link EasyMotionTarget ErrorMsg
+          hi link EasyMotionShade  Comment
+<
+------------------------------------------------------------------------------
+4.6 Custom mappings                               *easymotion-custom-mappings*
+
+EasyMotion allows you to customize all default mappings to avoid conflicts
+with existing mappings. It is possible to change the default leader key
+of all mappings to another key or sequence. It is also possible to fine
+tune the plugin to your need by changing every single sequence.
+
+4.6.1 Leader key               *EasyMotion_leader_key* *easymotion-leader-key*
+
+The default leader key can be changed with the configuration option
+|EasyMotion_leader_key|.
+
+Set this option to the key sequence to use as the prefix of the mappings
+described in |easymotion-default-mappings|.
+
+Note: The default leader key has been changed to '<Leader><Leader>' to 
+avoid conflicts with other plugins. You can revert to the original 
+leader by setting this option in your vimrc: >
+
+    let g:EasyMotion_leader_key = '<Leader>'
+<
+Default: '<Leader><Leader>'
+
+4.6.2 Custom Keys                                     *easymotion-custom-keys*
+
+All custom mappings follow the same variable format: >
+
+    EasyMotion_mapping_{motion} = {mapping}
+<
+Example: >
+
+    let g:EasyMotion_mapping_f = '_f'
+    let g:EasyMotion_mapping_T = '<C-T>'
+<
+See |easymotion-default-mappings| for a table of motions that can be mapped
+and their default values.
+
+Note: The leader key defined by |EasyMotion_leader_key| is not prepended to
+your customized mappings! You have to provide full key sequences when setting
+these options.
+
+==============================================================================
+5. License                                                *easymotion-license*
+
+Creative Commons Attribution-ShareAlike 3.0 Unported
+
+http://creativecommons.org/licenses/by-sa/3.0/
+
+==============================================================================
+6. Known bugs                                          *easymotion-known-bugs*
+
+None.
+
+==============================================================================
+7. Contributing                                      *easymotion-contributing*
+
+If you experience any bugs or have feature requests, please open an issue on
+GitHub. Fork the source repository on GitHub and send a pull request if you
+have any code improvements.
+
+Author: Kim Silkebรฆkken <kim.silkebaekken+vim@gmail.com>
+Source repository: https://github.com/Lokaltog/vim-easymotion
+
+==============================================================================
+8. Credits                                                *easymotion-credits*
+
+- Ben Boeckel: ge and WORD motions
+- Drew Neil: operator-pending mappings
+- Rob O'Dwyer: customizable mappings without giving up all defaults
+- Michel D'Hooge: customizable leader
+- Maxime Bourget: search motion, improved JK motion behavior
+- Kearn Holliday: fix jumplist issues
+- Shougo Matsushita: fix CSApprox issue
+
+EasyMotion is based on Bartlomiej Podolak's great PreciseJump script, which
+can be downloaded here:
+
+http://www.vim.org/scripts/script.php?script_id=3437
+
+==============================================================================
+vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/vim/doc/ft-gitcommit-plugin.txt b/vim/doc/ft-gitcommit-plugin.txt
new file mode 100644 (file)
index 0000000..0d89ae1
--- /dev/null
@@ -0,0 +1,5 @@
+GIT COMMIT                                              *ft-gitcommit-plugin*
+
+One command, :DiffGitCached, is provided to show a diff of the current commit
+in the preview window.  It is equivalent to calling "git diff --cached" plus
+any arguments given to the command.
diff --git a/vim/doc/fugitive.txt b/vim/doc/fugitive.txt
new file mode 100644 (file)
index 0000000..e2ae323
--- /dev/null
@@ -0,0 +1,269 @@
+*fugitive.txt*  A Git wrapper so awesome, it should be illegal
+
+Author:  Tim Pope <http://tpo.pe/>
+License: Same terms as Vim itself (see |license|)
+
+This plugin is only available if 'compatible' is not set.
+
+INTRODUCTION                                    *fugitive*
+
+Whenever you edit a file from a Git repository, a set of commands is defined
+that serve as a gateway to Git.
+
+COMMANDS                                        *fugitive-commands*
+
+These commands are local to the buffers in which they work (generally, buffers
+that are part of Git repositories).
+
+                                                *fugitive-:Git*
+:Git [args]             Run an arbitrary git command. Similar to :!git [args]
+                        but chdir to the repository tree first.
+
+                                                *fugitive-:Git!*
+:Git! [args]            Like |:Git|, but capture the output into a temp file,
+                        and edit that temp file.
+
+                                                *fugitive-:Gcd*
+:Gcd [directory]        |:cd| relative to the repository.
+
+                                                *fugitive-:Glcd*
+:Glcd [directory]       |:lcd| relative to the repository.
+
+                                                *fugitive-:Gstatus*
+:Gstatus                Bring up the output of git-status in the preview
+                        window.  The following maps, which work on the cursor
+                        line file where sensible, are provided:
+
+                        <C-N> next file
+                        <C-P> previous file
+                        <CR>  |:Gedit|
+                        -     |:Git| add
+                        -     |:Git| reset (staged files)
+                        C     |:Gcommit|
+                        cA    |Gcommit| --amend --reuse-message=HEAD
+                        ca    |Gcommit| --amend
+                        D     |:Gdiff|
+                        ds    |:Gsdiff|
+                        dp    |:Git!| diff (p for patch; use :Gw to apply)
+                        dp    |:Git| add --intent-to-add (untracked files)
+                        dv    |:Gvdiff|
+                        O     |:Gtabedit|
+                        o     |:Gsplit|
+                        p     |:Git| add --patch
+                        p     |:Git| reset --patch (staged files)
+                        q     close status
+                        R     reload status
+
+                                                *fugitive-:Gcommit*
+:Gcommit [args]         A wrapper around git-commit.  If there is nothing
+                        to commit, |:Gstatus| is called instead.  Unless the
+                        arguments given would skip the invocation of an editor
+                        (e.g., -m), a split window will be used to obtain a
+                        commit message.  Write and close that window (:wq or
+                        |:Gwrite|) to finish the commit.  Unlike when running
+                        the actual git-commit command, it is possible (but
+                        unadvisable) to muck with the index with commands like
+                        git-add and git-reset while a commit message is
+                        pending.
+
+                                                *fugitive-:Ggrep*
+:Ggrep [args]           |:grep| with git-grep as 'grepprg'.
+
+                                                *fugitive-:Glog*
+:Glog [args]            Load all previous revisions of the current file into
+                        the quickfix list.  Additional git-log arguments can
+                        be given (for example, --reverse).  If "--" appears as
+                        an argument, no file specific filtering is done, and
+                        commits are loaded into the quickfix list.
+
+                                        *fugitive-:Gedit* *fugitive-:Ge*
+:Gedit [revision]       |:edit| a |fugitive-revision|.
+
+                                                *fugitive-:Gsplit*
+:Gsplit [revision]      |:split| a |fugitive-revision|.
+
+                                                *fugitive-:Gvsplit*
+:Gvsplit [revision]     |:vsplit| a |fugitive-revision|.
+
+                                                *fugitive-:Gtabedit*
+:Gtabedit [revision]    |:tabedit| a |fugitive-revision|.
+
+                                                *fugitive-:Gpedit*
+:Gpedit [revision]      |:pedit| a |fugitive-revision|.
+
+:Gsplit! [args]                 *fugitive-:Gsplit!* *fugitive-:Gvsplit!*
+:Gvsplit! [args]                *fugitive-:Gtabedit!* *fugitive-:Gpedit!*
+:Gtabedit! [args]       Like |:Git!|, but open the resulting temp file in a
+:Gpedit! [args]         split, tab, or preview window.
+
+                                                *fugitive-:Gread*
+:Gread [revision]       Empty the buffer and |:read| a |fugitive-revision|.
+                        When the argument is omitted, this is similar to
+                        git-checkout on a work tree file or git-add on a stage
+                        file, but without writing anything to disk.
+
+:{range}Gread [revision]
+                        |:read| in a |fugitive-revision| after {range}.
+
+                                                *fugitive-:Gread!*
+:Gread! [args]          Empty the buffer and |:read| the output of a Git
+                        command.  For example, :Gread! show HEAD:%.
+
+:{range}Gread! [args]  |:read| the output of a Git command after {range}.
+
+                                                *fugitive-:Gwrite*
+:Gwrite                 Write to the current file's path and stage the results.
+                        When run in a work tree file, it is effectively git
+                        add.  Elsewhere, it is effectively git-checkout.  A
+                        great deal of effort is expended to behave sensibly
+                        when the work tree or index version of the file is
+                        open in another buffer.
+
+:Gwrite {path}          You can give |:Gwrite| an explicit path of where in
+                        the work tree to write.  You can also give a path like
+                        :0:foo.txt or even :0 to write to just that stage in
+                        the index.
+
+                                                *fugitive-:Gwq*
+:Gwq [path]             Like |:Gwrite| followed by |:quit| if the write
+                        succeeded.
+
+:Gwq! [path]            Like |:Gwrite|! followed by |:quit|! if the write
+                        succeeded.
+
+                                                *fugitive-:Gdiff*
+:Gdiff [revision]       Perform a |vimdiff| against the current file in the
+                        given revision.  With no argument, the version in the
+                        index is used (which means a three-way diff during a
+                        merge conflict, making it a git-mergetool
+                        alternative).  The newer of the two files is placed
+                        to the right.  Use |do| and |dp| and write to the
+                        index file to simulate "git add --patch".
+
+                                                *fugitive-:Gsdiff*
+:Gsdiff [revision]      Like |:Gdiff|, but split horizontally.
+
+                                                *fugitive-:Gvdiff*
+:Gvdiff [revision]      Identical to |:Gdiff|.  For symmetry with |:Gsdiff|.
+
+                                                *fugitive-:Gmove*
+:Gmove {destination}    Wrapper around git-mv that renames the buffer
+                        afterward.  The destination is relative to the current
+                        directory except when started with a /, in which case
+                        it is relative to the work tree.  Add a ! to pass -f.
+
+                                                *fugitive-:Gremove*
+:Gremove                Wrapper around git-rm that deletes the buffer
+                        afterward.  When invoked in an index file, --cached is
+                        passed.  Add a ! to pass -f and forcefully discard the
+                        buffer.
+
+                                                *fugitive-:Gblame*
+:Gblame [flags]         Run git-blame on the file and open the results in a
+                        scroll bound vertical split.  Press enter on a line to
+                        reblame the file as it was in that commit.  You can
+                        give any of ltwfsMC as flags and they will be passed
+                        along to git-blame.
+
+                        In a blame buffer on any line, one can press <CR> to
+                        reblame at that commit, ~ to reblame at that commit's
+                        [count]th first grandparent (like HEAD~[count]), or P
+                        to reblame at that commit's [count]th parent (like
+                        HEAD^[count]).  Press o or O to open up that commit
+                        in a horizontal of vertical split.  Pressing q will
+                        close the blame buffer.
+
+:[range]Gblame [flags]  Run git-blame on the given range.
+
+                                                *fugitive-:Gbrowse*
+:[range]Gbrowse         If the remote for the current branch is on GitHub,
+                        open the current file, blob, tree, commit, or tag
+                        (with git-web--browse) on GitHub.  Otherwise, open the
+                        current file, blob, tree, commit, or tag in
+                        git-instaweb (if you have issues, verify you can run
+                        "git instaweb" from a terminal).  If a range is given,
+                        it is appropriately appended to the URL as an anchor.
+
+:[range]Gbrowse!        Like :Gbrowse, but put the URL on the clipboard rather
+                        than opening it.
+
+:[range]Gbrowse {revision}
+                        Like :Gbrowse, but for a given |fugitive-revision|.  A
+                        useful value here is -, which ties the URL to the
+                        latest commit rather than a volatile branch.
+
+:[range]Gbrowse [...]@{remote}
+                        Force using the given remote rather than the remote
+                        for the current branch.  The remote is used to
+                        determine which GitHub repository to link to.
+
+MAPPINGS                                        *fugitive-mappings*
+
+These maps are available in Git objects.
+
+                                                *fugitive-<CR>*
+<CR>                    Jump to the revision under the cursor.
+
+                                                *fugitive-o*
+o                       Jump to the revision under the cursor in a new split.
+
+                                                *fugitive-O*
+O                       Jump to the revision under the cursor in a new tab.
+
+                                                *fugitive-~*
+~                       Go to the current file in the [count]th first
+                        ancestor.
+
+                                                *fugitive-P*
+P                       Go to the current file in the [count]th parent.
+
+                                                *fugitive-C*
+C                       Go to the commit containing the current file.
+
+                                                *fugitive-a*
+a                       Show the current tag, commit, or tree in an alternate
+                        format.
+
+SPECIFYING REVISIONS                            *fugitive-revision*
+
+Fugitive revisions are similar to Git revisions as defined in the "SPECIFYING
+REVISIONS" section in the git-rev-parse man page.  For commands that accept an
+optional revision, the default is the file in the index for work tree files
+and the work tree file for everything else.  Example revisions follow.
+
+Revision        Meaning ~
+HEAD            .git/HEAD
+master          .git/refs/heads/master
+HEAD^{}         The commit referenced by HEAD
+HEAD^           The parent of the commit referenced by HEAD
+HEAD:           The tree referenced by HEAD
+/HEAD           The file named HEAD in the work tree
+Makefile        The file named Makefile in the work tree
+HEAD^:Makefile  The file named Makefile in the parent of HEAD
+:Makefile       The file named Makefile in the index (writable)
+-               The current file in HEAD
+^               The current file in the previous commit
+~3              The current file 3 commits ago
+:               .git/index (Same as |:Gstatus|)
+:0              The current file in the index
+:1              The current file's common ancestor during a conflict
+:2              The current file in the target branch during a conflict
+:3              The current file in the merged branch during a conflict
+:/foo           The most recent commit with "foo" in the message
+
+STATUSLINE                                      *fugitive-statusline*
+
+                                                *fugitive#statusline()*
+Add %{fugitive#statusline()} to your statusline to get an indicator including
+the current branch and the currently edited file's commit.  If you don't have
+a statusline, this one matches the default when 'ruler' is set:
+>
+    set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
+<
+ABOUT                                           *fugitive-about*
+
+Grab the latest version or report a bug on GitHub:
+
+http://github.com/tpope/vim-fugitive
+
+ vim:tw=78:et:ft=help:norl:
diff --git a/vim/doc/gist-vim.txt b/vim/doc/gist-vim.txt
new file mode 100644 (file)
index 0000000..36ef71c
--- /dev/null
@@ -0,0 +1,182 @@
+*Gist.vim* Vimscript for creating gists (http://gist.github.com)
+
+Usage                                          |gist-vim-usage| 
+Tips                                           |gist-vim-tips| 
+Requirements                                   |gist-vim-requirements| 
+License                                        |gist-vim-license| 
+Install                                        |gist-vim-install| 
+
+This is a vimscript for creating gists (http://gist.github.com) 
+
+For the latest version please see https://github.com/mattn/gist-vim.
+
+==============================================================================
+USAGE                                                 *:Gist* *gist-vim-usage* 
+
+- Post current buffer to gist, using default privacy option. >
+
+    :Gist
+<
+- Post selected text to gist, using defualt privacy option.
+  This applies to all permutations listed below (except multi). >
+
+    :'<,'>Gist
+<
+- Create a private gist. >
+
+    :Gist -p
+<
+- Create a public gist.
+  (Only relevant if you've set gists to be private by default.) >
+
+    :Gist -P
+<
+- Post whole text to gist as public.
+  This is only relevant if you've set gists to be private by default;
+  if you get an empty gist list, try ":Gist --abandon". >
+
+    :Gist -P
+<
+- Post whole text to gist as public.
+  This is only relevant if you've set gists to be private by default.
+  If you get an empty gist list, try ":Gist --abandon". >
+
+    :Gist -P
+<
+- Create a gist anonymously. >
+
+    :Gist -a
+<
+- Create a gist with all open buffers. >
+
+    :Gist -m
+<
+- Edit the gist (you need to have opened the gist buffer first).
+  You can update the gist with the {:w} command within the gist buffer. >
+
+    :Gist -e
+<
+- Edit the gist with name "foo.js" (you need to have opened the gist buffer
+  first). >
+
+    :Gist -e foo.js
+<
+- Delete the gist (you need to have opened the gist buffer first).
+  Password authentication is needed. >
+
+    :Gist -d
+<
+- Fork the gist (you need to have opened the gist buffer first).
+  Password authentication is needed. >
+
+    :Gist -f
+< 
+- Get gist XXXXX. >
+
+    :Gist XXXXX
+<
+- Get gist XXXXX and add to clipboard. >
+
+    :Gist -c XXXXX
+<
+- List your public gists. >
+
+    :Gist -l
+<
+- List gists from user "mattn". >
+
+    :Gist -l mattn
+<
+- List all (public and private) of your gists. >
+
+    :Gist -la
+<
+
+==============================================================================
+TIPS                                                           *gist-vim-tips*
+
+If you set "g:gist_clip_command", gist.vim will copy the gist code with option
+"-c".
+
+  - Mac: >
+    let g:gist_clip_command = 'pbcopy'
+<
+  - Linux: >
+    let g:gist_clip_command = 'xclip -selection clipboard'
+<
+  - Others (cygwin?): >
+    let g:gist_clip_command = 'putclip'
+<
+If you want to detect filetype from the filename: >
+
+    let g:gist_detect_filetype = 1
+<
+If you want to open the browser after the post: >
+
+    let g:gist_open_browser_after_post = 1
+<
+If you want to change the browser: >
+
+    let g:gist_browser_command = 'w3m %URL%'
+<
+or: >
+
+    let g:gist_browser_command = 'opera %URL% &'
+<
+On windows, this should work with your user settings.
+
+If you want to show your private gists with ":Gist -l": >
+
+    let g:gist_show_privates = 1
+<
+If you get problems when creating gists try: >
+
+    :Gist --abandon
+<
+
+==============================================================================
+REQUIREMENTS                                           *gist-vim-requirements*
+
+  - Curl command (http://curl.haxx.se/)
+  - and, if you want to use your git profile, the git command-line client.
+
+==============================================================================
+LICENSE                                                     *gist-vim-license*
+
+
+  Copyright 2010 by Yasuhiro Matsumoto
+  modification, are permitted provided that the following conditions are met:
+  
+  1. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+  REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+  OF THE POSSIBILITY OF SUCH DAMAGE.
+
+==============================================================================
+INSTALL                                                     *gist-vim-install*
+
+Copy gist.vim to your plugin directory.
+
+gist.vim will create a curl cookie-jar file in your runtimepath.
+
+rtp:
+  - plugin/gist.vim
+  - cookies/github
+
+If you want to uninstall gist.vim, remember to also remove "cookies/github".
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/indent-object.txt b/vim/doc/indent-object.txt
new file mode 100644 (file)
index 0000000..5b58102
--- /dev/null
@@ -0,0 +1,120 @@
+*indent-object.txt*         Text objects based on indent levels.\r
+\r
+           Copyright (c) 2010 Michael Smith\r
+\r
+Indent Text Objects\r
+\r
+INTRODUCTION                      |idntobj-introduction|\r
+TEXT OBJECTS                      |idntobj-objects|\r
+BLANK LINES                       |idntobj-blanklines|\r
+ABOUT                             |idntobj-about|\r
+\r
+\r
+==============================================================================\r
+INTRODUCTION                                            *idntobj-introduction*\r
+\r
+Vim text objects provide a convenient way to select and operate on various\r
+types of objects. These objects include regions surrounded by various types of\r
+brackets and various parts of language (ie sentences, paragraphs, etc).\r
+\r
+This plugin defines a new text object, based on indentation levels. This is\r
+very useful in languages such as Python, in which the syntax defines scope in\r
+terms of indentation. Using the objects defined in this plugin, an entire if\r
+structure can be quickly selected, for example.\r
+\r
+\r
+==============================================================================\r
+TEXT OBJECTS                          *ai* *ii* *aI* *iI*     *idntobj-objects*\r
+\r
+This plugin defines two new text objects. These are very similar - they differ\r
+only in whether they include the line below the block or not.\r
+\r
+        Key Mapping       Description     ~\r
+>\r
+        <count>ai         (A)n (I)ndentation level and line above.\r
+        <count>ii         (I)nner (I)ndentation level (no line above).\r
+        <count>aI         (A)n (I)ndentation level and lines above/below.\r
+        <count>iI         (I)nner (I)ndentation level (no lines above/below).\r
+<\r
+\r
+Note that the iI mapping is mostly included simply for completeness, it is\r
+effectively a synonym for ii.\r
+\r
+Just like regular text objects, these mappings can be used either with\r
+operators expecting a motion, such as 'd' or 'c', as well as in visual mode.\r
+In visual mode the mapping can be repeated, which has the effect of\r
+iteratively increasing the scope of indentation block selected. Specifying a\r
+count can be used to achieve the same effect.\r
+\r
+The difference between |ai| and |aI| is that |ai| includes the line\r
+immediately above the indentation block, whereas aI includes not only that,\r
+but also the line below. Which of these is most useful largely depends on the\r
+structure of the language being edited.\r
+\r
+For example, when editing the Python code, |ai| is generally more useful, as\r
+the line above the indentation block is usually related to it. For example, in\r
+the following code (* is used to indicate the cursor position):\r
+>\r
+      if foo > 3:\r
+         log("foo is big") *\r
+         foo = 3\r
+      do_something_else()\r
+<\r
+the if clause is logically related to the code block, whereas the function\r
+call below is not. It is unlikely we would want to select the line below when\r
+we are interested in the if block.\r
+\r
+However, in other languages, such as Vim scripts, control structures are\r
+usually terminated with something like 'endif'. Therefore, in this example:\r
+>\r
+      if foo > 3\r
+         echo "foo is big" *\r
+         let foo = 3\r
+      endif\r
+      call do_something_else()\r
+<\r
+we would more likely want to include the endif when we select the if\r
+structure.\r
+\r
+\r
+==============================================================================\r
+BLANK LINES                                               *idntobj-blanklines*\r
+\r
+When scanning code blocks, the plugin usually ignores blank lines. There is an\r
+exception to this, however, when the block being selected is not indented. In\r
+this case if blank lines are ignored, then the entire file would be selected.\r
+Instead when code at the top level is being indented blank lines are\r
+considered to delimit the block.\r
+\r
+\r
+==============================================================================\r
+ABOUT                                                          *idntobj-about*\r
+\r
+vim-indent-object was written by Michael Smith <msmith@msmith.id.au>. The\r
+project repository is kept at:\r
+\r
+http://github.com/michaeljsmith/vim-indent-object\r
+\r
+Any feedback or criticism is welcome, and can be mailed to the author at the\r
+above email address. Alternatively issues can be raised on the project\r
+website.\r
+\r
+Licence:\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy\r
+of this software and associated documentation files (the "Software"), to\r
+deal in the Software without restriction, including without limitation the\r
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\r
+sell copies of the Software, and to permit persons to whom the Software is\r
+furnished to do so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in\r
+all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\r
+IN THE SOFTWARE.\r
diff --git a/vim/doc/rails.txt b/vim/doc/rails.txt
new file mode 100644 (file)
index 0000000..6dbbb1e
--- /dev/null
@@ -0,0 +1,1020 @@
+*rails.txt*    Plugin for working with Ruby on Rails applications
+
+Author:  Tim Pope <http://tpo.pe/>
+
+|rails-introduction|           Introduction and Feature Summary
+|rails-commands|               General Commands
+|rails-navigation|             Navigation
+|rails-gf|                         File Under Cursor - gf
+|rails-alternate-related|          Alternate and Related Files
+|rails-type-navigation|                    File Type Commands
+|rails-custom-navigation|          Custom Navigation Commands
+|rails-rake|                   Rake
+|rails-scripts|                        Script Wrappers
+|rails-refactoring|            Refactoring Helpers
+|rails-partials|                   Partial Extraction
+|rails-migrations|                 Migration Inversion
+|rails-integration|            Integration
+|rails-vim-integration|                    Integration with the Vim Universe
+|rails-rails-integration|          Integration with the Rails Universe
+|rails-abbreviations|          Abbreviations
+|rails-syntax|                 Syntax Highlighting
+|rails-options|                        Managed Vim Options
+|rails-configuration|          Configuration
+|rails-global-settings|        Global Settings
+|rails-about|                  About rails.vim
+|rails-license|                            License
+
+This plugin is only available if 'compatible' is not set.
+
+{Vi does not have any of this}
+
+INTRODUCTION                                   *rails-introduction* *rails*
+
+Whenever you edit a file in a Rails application, this plugin will be
+automatically activated.  This sets various options and defines a few
+buffer-specific commands.
+
+If you are in a hurry to get started, with a minimal amount of reading, you
+are encouraged to at least skim through the headings and command names in this
+file, to get a better idea of what is offered.  If you only read one thing,
+make sure it is the navigation section: |rails-navigation|.
+
+GENERAL COMMANDS                               *rails-commands*
+
+All commands are buffer local, unless otherwise stated.  This means you must
+actually edit a file from a Rails application.
+
+                                               *rails-:Rails*
+:Rails new {directory} The only global command.  Creates a new Rails
+                       application in {directory}, and loads the README.
+
+:Rails!                        Show the version of rails.vim installed.  If rails.vim
+                       is active for the current buffer, also show the type
+                       of Rails file detected.
+
+                                               *rails-:Rcd*
+:Rcd [{directory}]     |:cd| to /path/to/railsapp/{directory}.
+
+                                               *rails-:Rlcd*
+:Rlcd [{directory}]    |:lcd| to /path/to/railsapp/{directory}.
+
+                                               *rails-:Rdoc*
+:Rdoc                  Browse to the Rails API, either in doc/api in the
+                       current Rails application, gem_server if it is
+                       running, or http://api.rubyonrails.org/ .  Requires
+                       :OpenURL to be defined (see |rails-:OpenURL|).
+
+                                               *rails-:Rdoc!*
+:Rdoc!                 Make the appropriate |:helptags| call and invoke
+                       |:help| rails.
+
+                                               *rails-:Redit*
+:Redit {file}          Deprecated in favor of |:R|.
+
+                                               *rails-:Rfind*
+:Rfind [{file}]                Deprecated in favor of |:R| or |:find|.
+
+                                               *rails-:Rlog*
+:Rlog [{logfile}]      Split window and open {logfile} ($RAILS_ENV or
+                       development by default).  The control characters used
+                       for highlighting are removed.  If you have a :Tail
+                       command (provided by |tailminusf|.vim), that is used;
+                       otherwise, the file does NOT reload upon change.
+                       Use |:checktime| to tell Vim to check for changes.
+                       |G| has been mapped to do just that prior to jumping
+                       to the end of the file, and q is mapped to close the
+                       window.  If the delay in loading is too long, you
+                       might like :Rake log:clear.
+
+                                               *rails-:Rpreview*
+:Rpreview [{path}]     Creates a URL from http://localhost:3000/ and the
+                       {path} given.  The not too useful default is to then
+                       edit this URL using Vim itself, allowing |netrw| to
+                       download it.  More useful is to define a :OpenURL
+                       command, which will be used instead (see
+                       |rails-:OpenURL|).  If {path} is omitted, a sensible
+                       default is used (considers the current
+                       controller/template, but does not take routing into
+                       account).  The default is overridden by comments like
+                       the following that are either before the current
+                       method call or at the top of the file: >
+               # GET /users
+               # PUT /users/1
+<
+                                               *rails-:Rpreview!*
+:Rpreview! [{path}]    As with :Rpreview, except :OpenURL is never used.
+
+                                               *rails-:Rtags*
+:Rtags                 Calls ctags -R on the current application root and
+                       writes the result to tmp/tags.  Exuberant ctags must
+                       be installed.  Additional arguments can be passed to
+                       ctags with |g:rails_ctags_arguments|.
+
+                                               *rails-:Rrefresh*
+:Rrefresh              Refreshes certain cached settings.  Most noticeably,
+                       this clears the cached list of classes that are syntax
+                       highlighted as railsUserClass.
+
+                                               *rails-:Rrefresh!*
+:Rrefresh!             As above, and also reloads rails.vim.
+
+                                               *rails-:OpenURL*
+:OpenURL {url}         This is not a command provided by the plugin, but
+                       rather provided by user and utilized by other plugin
+                       features.  This command should be defined to open the
+                       provided {url} in a web browser.  An example command
+                       on a Mac might be: >
+               :command -bar -nargs=1 OpenURL :!open <args>
+<                      The following appears to work on Windows: >
+               :command -bar -nargs=1 OpenURL :!start cmd /cstart /b <args>
+<                      On Debian compatible distributions, the following is
+                       the preferred method: >
+               :command -bar -nargs=1 OpenURL :!sensible-browser <args>
+<                      If exists("$SECURITYSESSIONID"), has("gui_win32"), or
+                       executable("sensible-browser") is true, the
+                       corresponding command above will be automatically
+                       defined.  Otherwise, you must provide your own (which
+                       is recommended, regardless).
+
+NAVIGATION                                     *rails-navigation*
+
+Navigation is where the real power of this plugin lies.  Efficient use of the
+following features will greatly ease navigating the Rails file structure.
+
+The 'path' has been modified to include all the best places to be.
+>
+       :find application_controller.rb
+<
+File Under Cursor - gf ~
+                                               *rails-gf*
+The |gf| command, which normally edits the current file under the cursor, has
+been remapped to take context into account. |CTRL-W_f| (open in new window)
+and |CTRL-W_gf| (open in new tab) are also remapped.
+
+Example uses of |gf|, and where they might lead.
+(* indicates cursor position)
+>
+       Pos*t.first
+<      app/models/post.rb ~
+>
+       has_many :c*omments
+<      app/models/comment.rb ~
+>
+       link_to 'Home', :controller => 'bl*og'
+<      app/controllers/blog_controller.rb ~
+>
+       <%= render 'sh*ared/sidebar' %>
+<      app/views/shared/_sidebar.html.erb ~
+>
+       <%= stylesheet_link_tag 'scaf*fold' %>
+<      public/stylesheets/scaffold.css ~
+>
+       class BlogController < Applica*tionController
+<      app/controllers/application_controller.rb ~
+>
+       class ApplicationController < ActionCont*roller::Base
+<      .../action_controller/base.rb ~
+>
+       fixtures :pos*ts
+<      test/fixtures/posts.yml ~
+>
+       layout :pri*nt
+<      app/views/layouts/print.html.erb ~
+>
+       <%= link_to "New", new_comme*nt_path %>
+<      app/controllers/comments_controller.rb (jumps to def new) ~
+
+In the last example, the controller and action for the named route are
+determined by evaluating routes.rb as Ruby and doing some introspection.  This
+means code from the application is executed.  Keep this in mind when
+navigating unfamiliar applications.
+
+Alternate and Related Files ~
+                                               *rails-alternate-related*
+Two commands, :A and :R, are used quickly jump to an "alternate" and a
+"related" file, defined below.
+
+       *rails-:A* *rails-:AE* *rails-:AS* *rails-:AV* *rails-:AT* *rails-:AD*
+:A                     These commands were picked to mimic Michael Sharpe's
+:AE                    a.vim.  Briefly, they edit the "alternate" file, in
+:AS                    either the same window (:A and :AE), a new split
+:AV                    window (:AS), a new vertically split window (:AV), a
+:AT                    new tab (:AT), or read it into the current buffer
+:AD                    (:AD).
+
+       *rails-:R* *rails-:RE* *rails-:RS* *rails-:RV* *rails-:RT* *rails-:RD*
+:R                     These are similar |rails-:A| and friends above, only
+:RE                    they jump to the "related" file rather than the
+:RS                    "alternate."  With a file name argument, they edit
+:RV                    a file relative to the application root (:R Rakefile),
+:RT                    and with a count and a file name argument, they find a
+:RD                    file in 'path' (e.g., :1R PostsController.)  You can
+                       also append a line number (post.rb:42) or a method
+                       (PostsController#32) to both forms.
+
+                                       *rails-alternate* *rails-related*
+The alternate file is most frequently the test file, though there are
+exceptions.  The related file varies, and is sometimes dependent on current
+location in the file.  For example, when editing a controller, the related
+file is template for the method currently being edited.
+
+The easiest way to learn these commands is to experiment.  A few examples of
+alternate and related files for a Test::Unit application follow:
+
+Current file           Alternate file          Related file ~
+model                  unit test               schema definition
+controller (in method) functional test         template (view)
+template (view)                functional test         controller (jump to method)
+migration              previous migration      next migration
+config/database.yml    config/routes.rb        config/environments/*.rb
+
+Suggestions for further contexts to consider for the alternate file, related
+file, and file under the cursor are welcome.  They are subtly tweaked from
+release to release.
+
+File Type Navigation Commands ~
+                                               *rails-type-navigation*
+For the less common cases, a more deliberate set of commands are provided.
+Each of the upcoming commands takes an optional argument (with tab completion)
+but defaults to a reasonable guess.  Commands that default to the current
+model or controller generally behave like you'd expect in other file types.
+For example, in app/helpers/posts_helper.rb, the current controller is
+"posts", and in test/fixtures/comments.yml, the current model is "comment".
+In model related files, the current controller is the pluralized model name,
+and in controller related files, the current model is the singularized
+controller name.
+
+Each of the following commands has variants for splitting, vertical splitting,
+opening in a new tab, and reading the file into the current buffer.  For
+:Rmodel, those variants would be :RSmodel, :RVmodel, :RTmodel, and :RDmodel.
+There is also :REmodel which is a synonym for :Rmodel (future versions might
+allow customization of the behavior of :Rmodel).  They also allow for jumping
+to methods or line numbers using the same syntax as |:R|, and file creation
+can be forced by adding a ! after the filename (not after the command
+itself!).
+
+:Rcontroller                                   |rails-:Rcontroller|
+:Renvironment                                  |rails-:Renvironment|
+:Rfixtures                                     |rails-:Rfixtures|
+:Rfunctionaltest                               |rails-:Rfunctionaltest|
+:Rhelper                                       |rails-:Rhelper|
+:Rinitializer                                  |rails-:Rinitializer|
+:Rintegrationtest                              |rails-:Rintegrationtest|
+:Rjavascript                                   |rails-:Rjavascript|
+:Rlayout                                       |rails-:Rlayout|
+:Rlib                                          |rails-:Rlib|
+:Rlocale                                       |rails-:Rlocale|
+:Rmailer                                       |rails-:Rmailer|
+:Rmetal                                                |rails-:Rmetal|
+:Rmigration                                    |rails-:Rmigration|
+:Rmodel                                                |rails-:Rmodel|
+:Robserver                                     |rails-:Robserver|
+:Rplugin                                       |rails-:Rplugin|
+:Rspec                                         |rails-:Rspec|
+:Rstylesheet                                   |rails-:Rstylesheet|
+:Rtask                                         |rails-:Rtask|
+:Runittest                                     |rails-:Runittest|
+:Rview                                         |rails-:Rview|
+
+                                               *rails-:Rcontroller*
+:Rcontroller [{name}]  Edit the specified or current controller.
+
+                                               *rails-:Renvironment*
+:Renvironment [{name}]  Edit the config/environments file specified.  With no
+                       argument, defaults to editing config/application.rb
+                       or config/environment.rb.
+
+                                               *rails-:Rfixtures*
+:Rfixtures [{name}]    Edit the fixtures for the given or current model.  If
+                       an argument is given, it must be pluralized, like the
+                       final filename (this may change in the future).  If
+                       omitted, the current model is pluralized.  An optional
+                       extension can be given, to distinguish between YAML
+                       and CSV fixtures.
+
+                                               *rails-:Rfunctionaltest*
+:Rfunctionaltest [{name}]
+                       Edit the functional test or controller spec for the
+                       specified or current controller.
+
+                                               *rails-:Rhelper*
+:Rhelper [{name}]      Edit the helper for the specified name or current
+                       controller.
+
+                                               *rails-:Rinitializer*
+:Rinitializer [{name}]  Edit the config/initializers file specified.  With no
+                       argument, defaults to editing config/routes.rb.
+
+                                               *rails-:Rintegrationtest*
+:Rintegrationtest [{name}]
+                       Edit the integration test, integration spec, or
+                       cucumber feature specified.  With no argument,
+                       defaults to editing test/test_helper.rb.
+
+                                               *rails-:Rjavascript*
+:Rjavascript [{name}]  Edit the JavaScript for the specified name or current
+                       controller.  Also supports CoffeeScript in
+                       app/scripts/.
+
+                                               *rails-:Rlayout*
+:Rlayout [{name}]      Edit the specified layout.  Defaults to the layout for
+                       the current controller, or the application layout if
+                       that cannot be found.  A new layout will be created if
+                       an extension is given.
+
+                                               *rails-:Rlib*
+:Rlib [{name}]         Edit the library from the lib directory for the
+                       specified name.  If the current file is part of a
+                       plugin, the libraries from that plugin can be
+                       specified as well.  With no argument, defaults to
+                       editing db/seeds.rb.
+
+                                               *rails-:Rlocale*
+:Rlocale [{name}]      Edit the config/locale file specified, optionally
+                       adding a yml or rb extension if none is given.  With
+                       no argument, checks config/environment.rb for the
+                       default locale.
+
+                                               *rails-:Rmailer*
+:Rmailer [{name}]      Edit the mailer specified.  This looks in both
+                       app/mailers for Rails 3 and app/models for older
+                       versions of Rails but only tab completes the former.
+
+                                               *rails-:Rmetal*
+:Rmetal [{name}]       Edit the app/metal file specified.  With no argument,
+                       defaults to editing config/boot.rb.
+
+                                               *rails-:Rmigration*
+:Rmigration [{pattern}]        If {pattern} is a number, find the migration for that
+                       particular set of digits, zero-padding if necessary.
+                       Otherwise, find the newest migration containing the
+                       given pattern.  Omitting the pattern selects the
+                       latest migration.  Give a numeric argument of 0 to edit
+                       db/schema.rb.
+
+                                               *rails-:Rmodel*
+:Rmodel [{name}]       Edit the specified or current model.
+
+                                               *rails-:Robserver*
+:Robserver [{name}]    Find the observer with a name like
+                       {model}_observer.rb.  When in an observer, most
+                       commands (like :Rmodel) will seek based on the
+                       observed model ({model}) and not the actual observer
+                       ({model}_observer).  However, for the command
+                       :Runittest, a file of the form
+                       {model}_observer_test.rb will be found.
+
+                                               *rails-:Rplugin*
+:Rplugin [{plugin}[/{path}]]
+                       Edits a file within a plugin.  If the path to the file
+                       is omitted, it defaults to init.rb.  If no argument is
+                       given, it defaults to editing the application Gemfile.
+
+                                               *rails-:Rspec*
+:Rspec [{name}]                Edit the given spec.  With no argument, defaults to
+                       editing spec/spec_helper.rb (If you want to jump to
+                       the spec for the given file, use |:A| instead).  This
+                       command is only defined if there is a spec folder in
+                       the root of the application.
+
+                                               *rails-:Rstylesheet*
+:Rstylesheet [{name}]  Edit the stylesheet for the specified name or current
+                       controller.  Also supports Sass and SCSS.
+
+                                               *rails-:Rtask*
+:Rtask [{name}]                Edit the .rake file from lib/tasks for the specified
+                       name.  If the current file is part of a plugin, the
+                       tasks for that plugin can be specified as well.  If no
+                       argument is given, either the current plugin's
+                       Rakefile or the application Rakefile will be edited.
+
+                                               *rails-:Runittest*
+:Runittest [{name}]    Edit the unit test or model spec for the specified
+                       name or current model.
+
+                                               *rails-:Rview*
+:Rview [[{controller}/]{view}]
+                       Edit the specified view.  The controller will default
+                       sensibly, and the view name can be omitted when
+                       editing a method of a controller.  If a view name is
+                       given with an extension, a new file will be created.
+                       This is a quick way to create a new view.
+
+Custom Navigation Commands  ~
+                                               *rails-custom-navigation*
+
+It is also possible to create custom navigation commands.  This is best done
+in an initialization routine of some sort (e.g., an autocommand); see
+|rails-configuration| for details.
+
+                                               *rails-:Rnavcommand*
+:Rnavcommand [options] {name} [{path} ...]
+                       Create a navigation command with the supplied
+                       name, looking in the supplied paths, using the
+                       supplied options.  The -suffix option specifies what
+                       suffix to filter on, and strip from the filename, and
+                       defaults to -suffix=.rb .  The -glob option specifies
+                       a file glob to use to find files, _excluding_ the
+                       suffix.  Useful values include -glob=* and -glob=**/*.
+                       The -default option specifies a default argument (not
+                       a full path).  If it is specified as -default=model(),
+                       -default=controller(), or -default=both(), the current
+                       model, controller, or both (as with :Rintegrationtest)
+                       is used as a default.
+
+                                               *rails-:Rcommand*
+:Rcommand              Obsolete alias for |:Rnavcommand|.
+
+Examples: >
+       Rnavcommand api      app/apis -glob=**/* -suffix=_api.rb
+       Rnavcommand config   config   -glob=*.*  -suffix= -default=routes.rb
+       Rnavcommand concern  app/concerns -glob=**/*
+       Rnavcommand exemplar test/exemplars spec/exemplars -glob=**/*
+                       \ -default=model() -suffix=_exemplar.rb
+
+Finally, one Vim feature that proves helpful in conjunction with all of the
+above is |CTRL-^|.  This keystroke edits the previous file, and is helpful to
+back out of any of the above commands.
+
+RAKE                                           *rails-rake*
+
+Rake integration happens through the :Rake command.
+
+                                               *rails-:Rake*
+:[range]Rake {targets} Calls |:make!| {targets} (with 'makeprg' being rake,
+                       or `bundle exec rake` if bundler.vim is active) and
+                       opens the quickfix window if there were any errors.
+                       An argument of "-" reruns the last task.  If {targets}
+                       are omitted, :Rake defaults to something sensible as
+                       described below.  Giving a line number argument may
+                       affect that default.
+
+                                               *rails-:Rake!*
+:[range]Rake! {targets}        Called with a bang, :Rake will forgo opening the
+                       quickfix window.
+
+                                               *rails-rake-defaults*
+
+Generally, the default task is one that runs the test you'd expect.  For
+example, if you're in a view in an RSpec application, the view spec is run,
+but if it's a Test::Unit application, the functional test for the
+corresponding controller is run.  The following table lists the most
+interesting mappings:
+
+File                   Task ~
+unit test              test:units TEST=...
+functional test                test:functionals TEST=...
+integration test       test:integration TEST=...
+spec                   spec SPEC=...
+feature                        cucumber FEATURE=...
+model                  test:units TEST=...             spec SPEC=...
+controller             test:functionals TEST=...       spec SPEC=...
+helper                 test:functionals TEST=...       spec SPEC=...
+view                   test:functionals TEST=...       spec SPEC=...
+fixtures               db:fixtures:load FIXTURES=...
+migration              db:migrate VERSION=...
+config/routes.rb       routes
+db/seeds.rb            db:seed
+
+Additionally, when :Rake is given a line number (e.g., :.Rake), the following
+additional tasks can be invoked:
+
+File                   Task ~
+unit test              test:units TEST=... TESTOPTS=-n...
+functional test                test:functionals TEST=... TESTOPTS=-n...
+integration test       test:integration TEST=... TESTOPTS=-n...
+spec                   spec SPEC=...:...
+feature                        cucumber FEATURE=...:...
+controller             routes CONTROLLER=...
+fixtures               db:fixtures:identify LABEL=...
+migration in self.up   db:migrate:up VERSION=...
+migration in self.down db:migrate:down VERSION=...
+migration elsewhere    db:migrate:redo VERSION=...
+task                   ... (try to guess currently edited declaration)
+
+Finally, you can override the default task with a comment like "# rake ..."
+before the method pointed to by [range] or at the top of the file.
+
+SCRIPT WRAPPERS                                        *rails-scripts*
+
+The following commands are wrappers around the scripts in the script directory
+of the Rails application.  Most have extra features beyond calling the script.
+A limited amount of completion with <Tab> is supported.
+
+                                               *rails-:Rscript*
+:Rscript {script} {options}
+                       Call ruby script/{script} {options}.  Defaults to
+                       calling script/console.
+
+                                               *rails-:Rconsole*
+:Rconsole {options}    Obsolete. Call |:Rscript| instead.
+
+                                               *rails-:Rrunner*
+:[range]Rrunner {code} Executes {code} with script/runner.  Differs from
+                       :Rscript runner {code} in that the code is passed as
+                       one argument.  Also, |system()| is used instead of
+                       |:!|.  This is to help eliminate annoying "Press
+                       ENTER" prompts.  If a line number is given in the
+                       range slot, the output is pasted into the buffer after
+                       that line.
+
+                                               *rails-:Rp*
+:[range]Rp {code}      Like :Rrunner, but call the Ruby p method on the
+                       result. Literally "p begin {code} end".
+
+                                               *rails-:Rpp* *rails-:Ry*
+:[range]Rpp {code}     Like :Rp, but with pp (pretty print) or y (YAML
+:[range]Ry  {code}     output).
+
+                                               *rails-:Rgenerate*
+:Rgenerate {options}   Calls script/generate {options}, and then edits the
+                       first file generated.
+
+                                               *rails-:Rdestroy*
+:Rdestroy {options}    Calls script/destroy {options}.
+
+                                               *rails-:Rserver*
+:Rserver {options}     Launches script/server {options} in the background.
+                       On win32, this means |!start|.  On other systems, this
+                       uses the --daemon option.
+
+                                               *rails-:Rserver!*
+:Rserver! {options}    Same as |:Rserver|, only first attempts to kill any
+                       other server using the same port.  On non-Windows
+                       systems, lsof must be installed for this to work.
+
+REFACTORING HELPERS                            *rails-refactoring*
+
+A few features are dedicated to helping you refactor your code.
+
+Partial Extraction ~
+                                               *rails-partials*
+
+The :Rextract command can be used to extract a partial to a new file.
+
+                                               *rails-:Rextract*
+:[range]Rextract [{controller}/]{name} 
+                       Create a {name} partial from [range] lines (default:
+                       current line).
+
+                                               *rails-:Rpartial*
+:[range]Rpartial [{controller}/]{name} 
+                       Obsolete alias for :Rextract.
+
+If this is your file, in app/views/blog/show.html.erb: >
+
+  1    <div>
+  2      <h2><%= @post.title %></h2>
+  3      <p><%= @post.body %></p>
+  4    </div>
+
+And you issue this command: >
+
+       :2,3Rextract post
+
+Your file will change to this: >
+
+  1    <div>
+  2      <%= render :partial => 'post' %>
+  3    </div>
+
+And app/views/blog/_post.html.erb will now contain: >
+
+  1    <h2><%= post.title %></h2>
+  2    <p><%= post.body %></p>
+
+As a special case, if the file had looked like this: >
+
+  1     <% for object in @posts -%>
+  2      <h2><%= object.title %></h2>
+  3      <p><%= object.body %></p>
+  4    <% end -%>
+<
+The end result would have been this: >
+
+  1     <%= render :partial => 'post', :collection => @posts %>
+<
+The easiest way to choose what to extract is to use |linewise-visual| mode.
+Then, a simple >
+       :'<,'>Rextract blog/post
+will suffice. (Note the use of a controller name in this example.)
+
+Migration Inversion ~
+                                       *rails-migrations* *rails-:Rinvert*
+:Rinvert               In a migration, rewrite the self.up method into a
+                       self.down method.  If self.up is empty, the process is
+                       reversed.  This chokes on more complicated
+                       instructions, but works reasonably well for simple
+                       calls to create_table, add_column, and the like.
+
+INTEGRATION                                    *rails-integration*
+
+Having one foot in Rails and one in Vim, rails.vim has two worlds with which
+to interact.
+
+Integration with the Vim Universe ~
+                                               *rails-vim-integration*
+
+A handful of Vim plugins are enhanced by rails.vim.  All plugins mentioned can
+be found at http://www.vim.org/.  Cream and GUI menus (for lack of a better
+place) are also covered in this section.
+
+                                               *rails-:Rtree*
+:Rtree [{arg}]         If |NERDTree| is installed, open a tree for the
+                       application root or the given subdirectory.
+
+                                               *rails-:Rdbext* *rails-dbext*
+:Rdbext [{environment}] This command is only provided when the |dbext| plugin
+                       is installed.  Loads the {environment} configuration
+                       (defaults to $RAILS_ENV or development) from
+                       config/database.yml and uses it to configure dbext.
+                       The configuration is cached on a per application
+                       basis.  With dbext version 8.00 and newer, this
+                       command is called automatically when needed.  When
+                       dbext is configured, you can execute SQL directly from
+                       Vim: >
+                               :Select * from posts order by id desc
+                               :Update comments set author_id = 1
+<
+                                               *rails-surround*
+The |surround| plugin available from vim.org enables adding and removing
+"surroundings" like parentheses, quotes, and HTML tags.  Even by itself, it is
+quite useful for Rails development, particularly eRuby editing.  When coupled
+with this plugin, a few additional replacement surroundings are available in
+eRuby files.  See the |surround| documentation for details on how to use them.
+The table below uses ^ to represent the position of the surrounded text.
+
+Key    Surrounding ~
+=      <%= ^ %>
+-      <% ^ -%>
+#      <%# ^ %>
+<C-E>  <% ^ -%>\n<% end -%>
+
+The last surrounding is particularly useful in insert mode with the following
+map in one's vimrc.  Use Alt+o to open a new line below the current one.  This
+works nicely even in a terminal (where most alt/meta maps will fail) because
+most terminals send <M-o> as <Esc>o anyways.
+>
+       imap <M-o> <Esc>o
+<
+One can also use the <C-E> surrounding in a plain Ruby file to append a bare
+"end" on the following line.
+
+                                               *rails-abolish*
+Among the many features of |abolish| on vim.org is the ability to change the
+inflection of the word under the cursor.  For example, one can hit crs to
+change from MixedCase to snake_case.  This plugin adds two additional
+inflections: crl for alternating between the singular and plural, and crt for
+altering between tableize and classify.  The latter is useful in changing
+constructs like BlogPost.all to current_user.blog_posts.all and vice versa.
+
+                                               *rails-cream*
+This plugin provides a few additional key bindings if it is running under
+Cream, the user friendly editor which uses Vim as a back-end.  Ctrl+Enter
+finds the file under the cursor (as in |rails-gf|), and Alt+[ and Alt+] find
+the alternate (|rails-alternate|) and related (|rails-related|) files.
+
+                                               *rails-menu*
+If the GUI is running, a menu for several commonly used features is provided.
+Also on this menu is a list of recently accessed projects.  This list of
+projects can persist across restarts if a 'viminfo' flag is set to enable
+retaining certain global variables.  If this interests you, add something like
+the following to your vimrc: >
+       set viminfo^=!
+<
+Integration with the Rails Universe ~
+                                               *rails-rails-integration*
+The general policy of rails.vim is to focus exclusively on the Ruby on Rails
+core.  Supporting plugins and other add-ons to Rails has the potential to
+rapidly get out of hand.  However, a few pragmatic exceptions have been made.
+
+                                               *rails-template-types*
+Commands like :Rview use a hardwired list of extensions (erb, rjs, etc.)
+when searching for files.  In order to facilitate working with non-standard
+template types, several popular extensions are featured in this list,
+including haml, liquid, and mab (markaby).  These extensions will disappear
+once a related configuration option is added to rails.vim.
+
+                                               *rails-rspec*
+The presence of a spec directory causes several additional behaviors to
+activate.  :A knows about specs and will jump to them (but Test::Unit files
+still get priority).  The associated controller or model of a spec is
+detected, so all navigation commands should work as expected inside a spec
+file.  :Rake in a spec runs just that spec, and in a model, controller, or
+helper, runs the associated spec.
+
+|:Runittest| and |:Rfunctionaltest| lead double lives, handling model and
+controller specs respectively.  For helper and view specs, you can use
+|:Rspec| or define your own navigation commands:
+>
+       Rnavcommand spechelper     spec/helpers     -glob=**/*
+               \ -suffix=_helper_spec.rb        -default=controller()
+       Rnavcommand specview spec/views -glob=**/* -suffix=_spec.rb
+<
+ABBREVIATIONS                          *rails-abbreviations* *rails-snippets*
+
+Abbreviations are "snippets lite".  They may later be extracted into a
+separate plugin, or removed entirely.
+
+                                               *rails-:Rabbrev*
+:Rabbrev               List all Rails abbreviations.
+
+:Rabbrev {abbr} {expn} [{extra}]
+                       Define a new Rails abbreviation. {extra} is permitted
+                       if and only if {expn} ends with "(".
+
+                                               *rails-:Rabbrev!*
+:Rabbrev! {abbr}       Remove an abbreviation.
+
+Rails abbreviations differ from regular abbreviations in that they only expand
+after a <C-]> (see |i_CTRL-]|) or a <Tab> (if <Tab> does not work, it is
+likely mapped by another plugin).  If the abbreviation ends in certain
+punctuation marks, additional expansions are possible.  A few examples will
+hopefully clear this up (all of the following are enabled by default in
+appropriate file types).
+
+Command                                Sequence typed          Resulting text ~
+Rabbrev rp( render :partial\ =>        rp(                     render(:partial =>
+Rabbrev rp( render :partial\ =>        rp<Tab>                 render :partial =>
+Rabbrev vs( validates_size_of  vs(                     validates_size_of(
+Rabbrev pa[ params             pa[:id]                 params[:id]
+Rabbrev pa[ params             pa<C-]>                 params
+Rabbrev pa[ params             pa.inspect              params.inspect
+Rabbrev AR:: ActionRecord      AR::Base                ActiveRecord::Base
+Rabbrev :a :action\ =>\                render :a<Tab>          render :action => 
+
+In short, ( expands on (, :: expands on . and :, and [ expands on . and [.
+These trailing punctuation marks are NOT part of the final abbreviation, and
+you cannot have two mappings that differ only by punctuation.
+
+You must escape spaces in your expansion, either as "\ " or as "<Space>".  For
+an abbreviation ending with "(", you may define where to insert the
+parenthesis by splitting the expansion into two parts (divided by an unescaped
+space).
+
+Many abbreviations are provided by default: use :Rabbrev to list them.  They
+vary depending on the type of file (models have different abbreviations than
+controllers).  There is one "smart" abbreviation, :c, which expands to
+":controller => ", ":collection => ", or ":conditions => " depending on
+context.
+
+SYNTAX HIGHLIGHTING                            *rails-syntax*
+
+Syntax highlighting is by and large a transparent process.  For the full
+effect, however, you need a colorscheme which accentuates rails.vim
+extensions.  One such colorscheme is vividchalk, available from vim.org.
+
+The following is a summary of the changes made by rails.vim to the standard
+syntax highlighting.
+
+                                               *rails-syntax-keywords*
+Rails specific keywords are highlighted in a filetype specific manner.  For
+example, in a model, has_many is highlighted, whereas in a controller,
+before_filter is highlighted.  A wide variety of syntax groups are used but
+they all link by default to railsMethod.
+
+If you feel a method has been wrongfully omitted, submit it to the
+|rails-plugin-author|.
+
+                                               *rails-syntax-classes*
+Models, helpers, and controllers are given special highlighting.  Depending on
+the version of Vim installed, you may need a rails.vim aware colorscheme in
+order to see this.  Said colorscheme needs to provide highlighting for the
+railsUserClass syntax group.
+
+The class names are determined by camelizing filenames from certain
+directories of your application.  If app/models/line_item.rb exists, the class
+"LineItem" will be highlighted.
+
+The list of classes is refreshed automatically after certain commands like
+|:Rgenerate|.  Use |:Rrefresh| to trigger the process manually.
+
+                                               *rails-syntax-assertions*
+If you define custom assertions in test_helper.rb, these will be highlighted
+in your tests.  These are found by scanning test_helper.rb for lines of the
+form "  def assert_..." and extracting the method name.  The railsUserMethod
+syntax group is used.  The list of assertions can be refreshed with
+|:Rrefresh|.
+
+                                               *rails-syntax-strings*
+In the following line of code, the "?" in the conditions clause and the "ASC"
+in the order clause will be highlighted: >
+  Post.find(:all, :conditions => ["body like ?","%e%"], :order => "title ASC")
+<
+A string literal using %Q<> or %<> delimiters will have its contents
+highlighted as HTML.  This is sometimes useful when writing helpers. >
+  link = %<<a href="http://www.vim.org">Vim</a>>
+<
+                                               *rails-syntax-yaml*
+YAML syntax highlighting has been extended to highlight eRuby, which can be
+used in most Rails YAML files (including database.yml and fixtures).
+
+MANAGED VIM OPTIONS                    *rails-options*
+
+The following options are set local to buffers where the plugin is active.
+
+                                       *rails-'shiftwidth'*    *rails-'sw'*
+                                       *rails-'softtabstop'*   *rails-'sts'*
+                                       *rails-'expandtab'*     *rails-'et'*
+A value of 2 is used for 'shiftwidth' (and 'softtabstop'), and 'expandtab' is
+enabled.  This is a strong convention in Rails, so the conventional wisdom
+that this is a user preference has been ignored.
+
+                                       *rails-'path'*          *rails-'pa'*
+All the relevant directories from your application are added to your 'path'.
+This makes it easy to access a buried file: >
+       :find blog_controller.rb
+<
+                                       *rails-'suffixesadd'*   *rails-'sua'*
+This is filetype dependent, but typically includes .rb, .rake, and several
+others.  This allows shortening the above example: >
+       :find blog_controller
+<
+                                       *rails-'includeexpr'*   *rails-'inex'*
+The 'includeexpr' option is set to enable the magic described in |rails-gf|.
+
+                                       *rails-'filetype'*      *rails-'ft'*
+The 'filetype' is sometimes adjusted for Rails files.  Most notably, *.rxml
+and *.rjs are treated as Ruby files, and files that have been falsely
+identified as Mason sources are changed back to eRuby files (but only when
+they are part of a Rails application).
+
+                                       *rails-'completefunc'*  *rails-'cfu'*
+A 'completefunc' is provided (if not already set).  It is very simple, as it
+uses syntax highlighting to make its guess.  See |i_CTRL-X_CTRL-U|.
+
+CONFIGURATION                                  *rails-configuration*
+
+Very little configuration is actually required; this plugin automatically
+detects your Rails application and adjusts Vim sensibly.
+
+                                       *rails-:autocmd* *rails-autocommands*
+If you would like to set your own custom Vim settings whenever a Rails file is
+loaded, you can use an autocommand like the following in your vimrc: >
+       autocmd User Rails              silent! Rlcd
+       autocmd User Rails              map <buffer> <F9> :Rake<CR>
+You can also have autocommands that only apply to certain types of files.
+These are based off the information shown when running the |:Rails!|
+command, with hyphens changed to periods. A few examples: >
+       autocmd User Rails.controller*  iabbr <buffer> wsn wsdl_service_name
+       autocmd User Rails.model.arb*   iabbr <buffer> vfo validates_format_of
+       autocmd User Rails.view.erb*    imap  <buffer> <C-Z> <%=  %><C-O>3h
+End all such Rails autocommands with asterisks, even if you have an exact
+specification, to allow for more specific subtypes to be added in the future.
+There is also a filename matching syntax: >
+       autocmd User Rails/config/environment.rb Rabbrev c config
+       autocmd User Rails/**/foo_bar.rb         Rabbrev FB:: FooBar
+Use the filetype based syntax whenever possible, reserving the filename based
+syntax for more advanced cases.
+
+                                               *macros/rails.vim*
+If you have several commands to run on initialization for all file types, they
+can be placed in a "macros/rails.vim" file in the 'runtimepath' (for example,
+"~/.vim/macros/rails.vim").  This file is sourced by rails.vim each time a
+Rails file is loaded.
+
+                                               *config/rails.vim*
+If you have settings particular to a specific project, they can be put in a
+config/rails.vim file in the root directory of the application.  The file is
+sourced in the |sandbox| for security reasons.
+
+                                               *rails-:Rset*
+:Rset {option}[={value}]
+                       Query or set a local option.  This command may be
+                       called directly, from an autocommand, or from
+                       config/rails.vim.
+
+Options may be set in one of four scopes, which may be indicated by an
+optional prefix.  These scopes determine how broadly an option will apply.
+Generally, the default scope is sufficient.
+
+Scope  Description ~
+a:     All files in one Rails application
+b:     Buffer (file) specific
+g:     Global to all applications
+l:     Local to method (same as b: in non-Ruby files)
+
+Options are shown below with their default scope, which should be omitted.
+While you may override the scope with a prefix, this is rarely necessary and
+oftentimes useless.  (For example, setting g:task is useless because the
+default rake task will apply before considering this option.)
+
+Option          Meaning ~
+b:alternate     Custom alternate file for :A, relative to the Rails root
+b:controller    Default controller for certain commands (e.g., :Rhelper)
+b:model                 Default model for certain commands (e.g., :Rfixtures)
+l:related       Custom related file for :R, relative to the Rails root
+a:root_url      Root URL for commands like :Rpreview
+
+Examples: >
+       :Rset root_url=http://localhost:12345
+       :Rset related=app/views/blog/edit.html.erb
+<
+                                               *rails-modelines*
+If |g:rails_modelines| is enabled, these options can also be set from
+modelines near the beginning or end of the file.  These modelines will always
+set buffer-local options; scope should never be specified.  Examples: >
+       # Rset task=db:schema:load
+       <%# Rset alternate=app/views/layouts/application.html.erb %>
+Modelines can also be local to a method.  Example: >
+       def test_comment
+         # rset alternate=app/models/comment.rb
+These two forms differ only in case.
+
+Modelines are deprecated.
+
+GLOBAL SETTINGS                                        *rails-global-settings*
+
+A few global variables control the behavior of this plugin.  In general, they
+can be enabled by setting them to 1 in your vimrc, and disabled by setting
+them to 0. >
+       let g:rails_some_option=1
+       let g:rails_some_option=0
+Most of these seldom need to be used.  So seldom, in fact, that you should
+notify the |rails-plugin-author| if you find any of them useful, as nearly all
+are being considered for removal.
+
+                                               *g:loaded_rails*  >
+       let g:loaded_rails=1
+Set this include guard to prevent the plugin from being loaded.
+
+                                               *g:rails_abbreviations*
+Enable Rails abbreviations.  See |rails-abbreviations|.  Enabled by default.
+
+                                               *g:rails_ctags_arguments*  >
+       let g:rails_ctags_arguments='--languages=-javascript'
+Additional arguments to pass to ctags from |:Rtags|.  Defaults to ignoring
+JavaScript files, since ctags has a tendency to choke on those.
+
+                                               *g:rails_default_file*  >
+       let g:rails_default_file='config/database.yml'
+File to load when a new Rails application is created.  Defaults to the README.
+
+                                       *rails-screen* *g:rails_gnu_screen*  >
+       let g:rails_gnu_screen=1
+Use GNU Screen or Tmux (if it is running) to launch |:Rscript| console and
+|:Rserver| in the background.  Enabled by default.
+
+                                               *g:rails_history_size*  >
+       let g:rails_history_size=5
+Number of projects to remember.  Set to 0 to disable.  See |rails-menu| for
+information on retaining these projects across a restart.
+
+                                               *g:rails_mappings*  >
+       let g:rails_mappings=1
+Enables a few mappings (mostly for |rails-navigation|). Enabled by default.
+
+                                               *g:rails_modelines*  >
+       let g:rails_modelines=1
+Enable modelines like the following: >
+       # Rset task=db:schema:load
+Modelines set buffer-local options using the :Rset command.
+Also enables method specific modelines (note the case difference): >
+         def show
+           # rset preview=blog/show/1
+Modelines are deprecated and disabled by default.
+
+                                               *g:rails_menu*  >
+       let g:rails_menu=1
+When 2, a Rails menu is created.  When 1, this menu is a submenu under the
+Plugin menu.  The default is 0, as the menu is slated for removal from future
+versions of rails.vim.
+
+                                               *g:rails_url*  >
+       let g:rails_url='http://localhost:3000/'
+Used for the |:Rpreview| command.  Default is as shown above.  Overridden by
+b:rails_url.
+
+                                               *g:rails_syntax*  >
+       let g:rails_syntax=1
+When enabled, this tweaks the syntax highlighting to be more Rails friendly.
+Enabled by default.  See |rails-syntax|.
+
+                                       *rails-tabs* *g:rails_tabstop*  >
+       let g:rails_tabstop=4
+This option now requires the plugin railstab.vim from vim.org:
+       http://www.vim.org/scripts/script.php?script_id=2253
+
+If your goal is simply just override this plugin's settings and use your own
+custom 'shiftwidth', adjust things manually in an autocommand: >
+       autocmd User Rails set sw=4 sts=4 noet
+This is highly discouraged: don't fight Rails.
+
+ABOUT                                  *rails-about* *rails-plugin-author*
+
+This plugin was written by Tim Pope.  Email all comments, complaints, and compliments to him at vim at tpope. org.
+
+The latest stable version can be found at
+    http://www.vim.org/scripts/script.php?script_id=1567
+
+Bugs can be reported and the very latest development version can be retrieved
+from GitHub:
+    https://github.com/tpope/vim-rails
+    git clone git://github.com/tpope/vim-rails.git
+
+                                               *rails-license*
+Copyright (c) Tim Pope.  Distributed under the same terms as Vim itself.
+See |license|.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/showmarks.txt b/vim/doc/showmarks.txt
new file mode 100644 (file)
index 0000000..96dc1e1
--- /dev/null
@@ -0,0 +1,264 @@
+*showmarks.txt* Visually show the location of marks
+
+               By Anthony Kruize <trandor@labyrinth.net.au>
+                  Michael Geddes <michaelrgeddes@optushome.com.au>
+
+
+ShowMarks provides a visual representation of |marks| local to a buffer.
+Marks are useful for jumping back and forth between interesting points in a
+buffer, but can be hard to keep track of without any way to see where you have
+placed them.
+
+ShowMarks hopefully makes life easier by placing a |sign| in the
+leftmost column of the buffer.  The sign indicates the label of the mark and
+its location.
+
+ShowMarks is activated by the |CursorHold| |autocommand| which is triggered
+every |updatetime| milliseconds.  This is set to 4000(4 seconds) by default.
+If this is too slow, setting it to a lower value will make it more responsive.
+
+Note: This plugin requires Vim 6.x compiled with the |+signs| feature.
+
+===============================================================================
+1. Contents                                    *showmarks* *showmarks-contents*
+
+    1. Contents                     |showmarks-contents|
+    2. Configuration         |showmarks-configuration|
+    3. Highlighting          |showmarks-highlighting|
+    4. Key mappings          |showmarks-mappings|
+    5. Commands              |showmarks-commands|
+    6. ChangeLog             |showmarks-changelog|
+
+    Appendix
+    A. Using marks           |marks|
+    B. Using signs           |sign|
+    C. Defining updatetime   |updatetime|
+    D. Defining a mapleader  |mapleader|
+    E. Defining highlighting |highlight|
+
+===============================================================================
+2. Configuration                                      *showmarks-configuration*
+
+ShowMarks can be configured to suit your needs.
+The following options can be added to your |vimrc| to change how ShowMarks
+behaves:
+
+                                                           *'showmarks_enable'*
+'showmarks_enable'      boolean (default: 1)
+                        global
+   This option enables or disables ShowMarks on startup. Normally ShowMarks
+   will be enabled when Vim starts, setting this to 0 will disable ShowMarks
+   by default.
+   ShowMarks can be turned back on using the |ShowMarksToggle| command.
+
+                                                          *'showmarks_include'*
+'showmarks_include'     string  (default:
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.'`^<>[]{}()\"")
+                        global or local to buffer
+   This option specifies which marks will be shown and in which order if
+   placed on the same line. Marks earlier in the list take precedence over
+   marks later in the list.
+   This option can also be specified as a buffer option which will override
+   the global version.
+
+   NOTE: When including the " mark, it must be escaped with a \.
+
+   For example to only include marks 'abcdefzxABHJio', in that order:
+>
+     let g:showmarks_include="abcdefzxABJio"
+<
+   To override this for a particular buffer with 'ABCDhj.'^':
+>
+     let b:showmarks_include="abcdefzxABJio"
+<
+                                                      *'showmarks_ignore_type'*
+'showmarks_ignore_type' string  (default: "hq")
+                        global
+   This option defines which types of buffers should be ignored.
+   Each type is represented by a letter. This option is not case-sensitive.
+   Valid buffer types are:
+   - h : Help
+   - m : Non-modifiable
+   - p : Preview
+   - q : Quickfix
+   - r : Readonly
+
+   For example to ignore help, preview and readonly files:
+>
+     let g:showmarks_ignore_type="hpr"
+<
+                                                      *'showmarks_ignore_name'*
+'showmarks_textlower'   string  (default: ">" )
+                        global
+   This option defines how the marks a-z will be displayed.
+   A maximum of two characters can be defined.
+   To include the mark in the text use a tab(\t) character. A single
+   character will display as the mark with the character suffixed (same as
+   "\t<character>"). Specifying two characters will simply display those two
+   characters.
+
+   Some examples:
+     To display the mark with a > suffixed: >
+       let g:showmarks_textlower="\t>"
+<         or >
+       let g:showmarks_textlower=">"
+<
+     To display the mark with a ( prefixed: >
+       let g:showmarks_textlower="(\t"
+<
+     To display two > characters: >
+       let g:showmarks_textlower=">>"
+<
+                                                        *'showmarks_textupper'*
+'showmarks_textupper'   string  (default: ">")
+                        global
+   This option defines how the marks A-Z will be displayed. It behaves the same
+   as the |'showmarks_textlower'| option.
+
+                                                        *'showmarks_textother'*
+'showmarks_textother'   string  (default: ">")
+                        global
+   This option defines how all other marks will be displayed. It behaves the
+   same as the |'showmarks_textlower'| option.
+
+'showmarks_hlline_lower' boolean (default: 0)        *'showmarks_hlline_lower'*
+                        global
+   This option defines whether the entire line a lowercase mark is on will
+   be highlighted.
+
+'showmarks_hlline_upper' boolean (default: 0)        *'showmarks_hlline_upper'*
+                        global
+   This option defines whether the entire line an uppercase mark is on will
+   be highlighted.
+
+'showmarks_hlline_other' boolean (default: 0)        *'showmarks_hlline_other'*
+                        global
+   This option defines whether the entire line other marks are on will be
+   highlighted.
+
+===============================================================================
+3. Highlighting                                        *showmarks-highlighting*
+
+Four highlighting groups are used by ShowMarks to define the colours used to
+highlight each of the marks.
+
+  - ShowMarksHLl : This group is used to highlight all the lowercase marks.
+  - ShowMarksHLu : This group is used to highlight all the uppercase marks.
+  - ShowMarksHLo : This group is used to highlight all other marks.
+  - ShowMarksHLm : This group is used when multiple marks are on the same line.
+
+You can define your own highlighting by overriding these groups in your |vimrc|.
+For example: >
+
+  highlight ShowMarksHLl guifg=red guibg=green
+<
+Will set all lowercase marks to be red on green when running in GVim.
+See |highlight| for more information.
+
+===============================================================================
+4. Mappings                                                *showmarks-mappings*
+
+The following mappings are setup by default:
+
+  <Leader>mt   - Toggles ShowMarks on and off.
+  <Leader>mo   - Forces ShowMarks on.
+  <Leader>mh   - Clears the mark at the current line.
+  <Leader>ma   - Clears all marks in the current buffer.
+  <Leader>mm   - Places the next available mark on the current line.
+
+(see |mapleader| for how to setup the mapleader variable.)
+
+===============================================================================
+5. Commands                                                *showmarks-commands*
+
+                                                              *ShowMarksToggle*
+:ShowMarksToggle
+   This command will toggle the display of marks on or off.
+
+
+:ShowMarksOn                                                      *ShowMarksOn*
+   This command will force the display of marks on.
+
+                                                           *ShowMarksClearMark*
+:ShowMarksClearMark
+   This command will clear the mark on the current line.
+   It doesn't actually remove the mark, it simply moves it to line 1 and
+   removes the sign.
+
+                                                            *ShowMarksClearAll*
+:ShowMarksClearAll
+   This command will clear all marks in the current buffer.
+   It doesn't actually remove the marks, it simply moves them to line 1 and
+   removes the signs.
+
+                                                           *ShowMarksPlaceMark*
+:ShowMarksPlaceMark
+   This command will place the next available mark on the current line. This
+   effectively automates mark placement so you don't have to remember which
+   marks are placed or not. Hidden marks are considered to be available.
+   NOTE: Only marks a-z are supported by this function.
+
+===============================================================================
+6. ChangeLog                                              *showmarks-changelog*
+
+2.2 - 2004-08-17
+   Fixed highlighting of the A-Z marks when ignorecase is on. (Mike Kelly)
+   Fixed the delay with ShowMarks triggering when entering a buffer for the
+     first time. (Mikolaj Machowski)
+   Added support for highlighting the entire line where a mark is placed.
+   Now uses HelpExtractor by Charles E. Campbell to install the help file.
+
+2.1 - 2004-03-04
+   Added ShowMarksOn. It forces ShowMarks to be enabled whether it's on or not.
+     (Gary Holloway)
+   Marks now have a definable order of precedence for when mulitple alpha marks
+     have been placed on the same line. A new highlight group, ShowMarksHLm is
+     used to identify this situation. (Gary Holloway)
+       - showmarks_include has changed accordingly.
+       - ShowMarksHL is now ShowMarksHLl.
+   ShowMarksPlaceMark now places marks in the order specified by
+     showmarks_include. (Gary Holloway)
+   showmarks_include can now be specified per buffer. (Gary Holloway)
+
+2.0 - 2003-08-11
+   Added ability to ignore buffers by type.
+   Fixed toggling ShowMarks off when switching buffers.
+   ShowMarksHideMark and ShowMarksHideAll have been renamed to
+     ShowMarksClearMark and ShowMarksClearAll.
+   Marks a-z, A-Z and others now have different highlighting from each other.
+   Added support for all other marks. (Gary Holloway)
+   Enhanced customization of how marks are displayed by allowing a prefix to
+     be specified.(Gary Holloway & Anthony Kruize)
+   Fixed CursorHold autocmd triggering even when ShowMarks is disabled.
+     (Charles E. Campbell)
+
+1.5 - 2002-07-16
+   Added ability to customize how the marks are displayed.
+
+1.4 - 2002-05-29
+   Added support for placing the next available mark.
+     (Thanks to Shishir Ramam for the idea)
+   Added support for hiding all marks.
+   Marks on line 1 are no longer shown. This stops hidden marks from
+     reappearing when the file is opened again.
+   Added a help file.
+
+1.3 - 2002-05-20
+   Fixed toggling ShowMarks not responding immediately.
+   Added user commands for toggling/hiding marks.
+   Added ability to disable ShowMarks by default.
+
+1.2 - 2002-03-06
+   Added a check that Vim was compiled with +signs support.
+   Added the ability to define which marks are shown.
+   Removed debugging code that was accidently left in.
+
+1.1 - 2002-02-05
+   Added support for the A-Z marks.
+   Fixed sign staying placed if the line it was on is deleted.
+   Clear autocommands before making new ones.
+
+1.0 - 2001-11-20
+   First release.
+
+vim:tw=78:ts=8:ft=help
diff --git a/vim/doc/snipMate.txt b/vim/doc/snipMate.txt
new file mode 100644 (file)
index 0000000..521235d
--- /dev/null
@@ -0,0 +1,322 @@
+*snipMate.txt*  Plugin for using TextMate-style snippets in Vim.
+
+snipMate                                       *snippet* *snippets* *snipMate*
+Last Change: December 27, 2009
+
+|snipMate-description|   Description
+|snipMate-syntax|        Snippet syntax
+|snipMate-usage|         Usage
+|snipMate-settings|      Settings
+|snipMate-features|      Features
+|snipMate-disadvantages| Disadvantages to TextMate
+|snipMate-contact|       Contact
+|snipMate-license|       License
+
+For Vim version 7.0 or later.
+This plugin only works if 'compatible' is not set.
+{Vi does not have any of these features.}
+
+==============================================================================
+DESCRIPTION                                             *snipMate-description*
+
+snipMate.vim implements some of TextMate's snippets features in Vim. A
+snippet is a piece of often-typed text that you can insert into your
+document using a trigger word followed by a <tab>.
+
+For instance, in a C file using the default installation of snipMate.vim, if
+you type "for<tab>" in insert mode, it will expand a typical for loop in C: >
+
+ for (i = 0; i < count; i++) {
+
+ }
+
+
+To go to the next item in the loop, simply <tab> over to it; if there is
+repeated code, such as the "i" variable in this example, you can simply
+start typing once it's highlighted and all the matches specified in the
+snippet will be updated. To go in reverse, use <shift-tab>.
+
+==============================================================================
+SYNTAX                                                        *snippet-syntax*
+
+Snippets can be defined in two ways. They can be in their own file, named
+after their trigger in 'snippets/<filetype>/<trigger>.snippet', or they can be
+defined together in a 'snippets/<filetype>.snippets' file. Note that dotted
+'filetype' syntax is supported -- e.g., you can use >
+
+       :set ft=html.eruby
+
+to activate snippets for both HTML and eRuby for the current file.
+
+The syntax for snippets in *.snippets files is the following: >
+
+ snippet trigger
+       expanded text
+       more expanded text
+
+Note that the first hard tab after the snippet trigger is required, and not
+expanded in the actual snippet. The syntax for *.snippet files is the same,
+only without the trigger declaration and starting indentation.
+
+Also note that snippets must be defined using hard tabs. They can be expanded
+to spaces later if desired (see |snipMate-indenting|).
+
+"#" is used as a line-comment character in *.snippets files; however, they can
+only be used outside of a snippet declaration. E.g.: >
+
+ # this is a correct comment
+ snippet trigger
+       expanded text
+ snippet another_trigger
+       # this isn't a comment!
+       expanded text
+<
+This should hopefully be obvious with the included syntax highlighting.
+
+                                                               *snipMate-${#}*
+Tab stops ~
+
+By default, the cursor is placed at the end of a snippet. To specify where the
+cursor is to be placed next, use "${#}", where the # is the number of the tab
+stop. E.g., to place the cursor first on the id of a <div> tag, and then allow
+the user to press <tab> to go to the middle of it:
+ >
+ snippet div
+       <div id="${1}">
+               ${2}
+       </div>
+<
+                        *snipMate-placeholders* *snipMate-${#:}* *snipMate-$#*
+Placeholders ~
+
+Placeholder text can be supplied using "${#:text}", where # is the number of
+the tab stop. This text then can be copied throughout the snippet using "$#",
+given # is the same number as used before. So, to make a C for loop: >
+
+ snippet for
+       for (${2:i}; $2 < ${1:count}; $1++) {
+               ${4}
+       }
+
+This will cause "count" to first be selected and change if the user starts
+typing. When <tab> is pressed, the "i" in ${2}'s position will be selected;
+all $2 variables will default to "i" and automatically be updated if the user
+starts typing.
+NOTE: "$#" syntax is used only for variables, not for tab stops as in TextMate.
+
+Variables within variables are also possible. For instance: >
+
+ snippet opt
+       <option value="${1:option}">${2:$1}</option>
+
+Will, as usual, cause "option" to first be selected and update all the $1
+variables if the user starts typing. Since one of these variables is inside of
+${2}, this text will then be used as a placeholder for the next tab stop,
+allowing the user to change it if he wishes.
+
+To copy a value throughout a snippet without supplying default text, simply
+use the "${#:}" construct without the text; e.g.: >
+
+ snippet foo
+       ${1:}bar$1
+<                                                          *snipMate-commands*
+Interpolated Vim Script ~
+
+Snippets can also contain Vim script commands that are executed (via |eval()|)
+when the snippet is inserted. Commands are given inside backticks (`...`); for
+TextMates's functionality, use the |system()| function. E.g.: >
+
+ snippet date
+       `system("date +%Y-%m-%d")`
+
+will insert the current date, assuming you are on a Unix system. Note that you
+can also (and should) use |strftime()| for this example.
+
+Filename([{expr}] [, {defaultText}])             *snipMate-filename* *Filename()*
+
+Since the current filename is used often in snippets, a default function
+has been defined for it in snipMate.vim, appropriately called Filename().
+
+With no arguments, the default filename without an extension is returned;
+the first argument specifies what to place before or after the filename,
+and the second argument supplies the default text to be used if the file
+has not been named. "$1" in the first argument is replaced with the filename;
+if you only want the filename to be returned, the first argument can be left
+blank. Examples: >
+
+ snippet filename
+       `Filename()`
+ snippet filename_with_default
+       `Filename('', 'name')`
+ snippet filename_foo
+       `filename('$1_foo')`
+
+The first example returns the filename if it the file has been named, and an
+empty string if it hasn't. The second returns the filename if it's been named,
+and "name" if it hasn't. The third returns the filename followed by "_foo" if
+it has been named, and an empty string if it hasn't.
+
+                                                                   *multi_snip*
+To specify that a snippet can have multiple matches in a *.snippets file, use
+this syntax: >
+
+ snippet trigger A description of snippet #1
+       expand this text
+ snippet trigger A description of snippet #2
+       expand THIS text!
+
+In this example, when "trigger<tab>" is typed, a numbered menu containing all
+of the descriptions of the "trigger" will be shown; when the user presses the
+corresponding number, that snippet will then be expanded.
+
+To create a snippet with multiple matches using *.snippet files,
+simply place all the snippets in a subdirectory with the trigger name:
+'snippets/<filetype>/<trigger>/<name>.snippet'.
+
+==============================================================================
+USAGE                                                         *snipMate-usage*
+
+                                                 *'snippets'* *g:snippets_dir*
+Snippets are by default looked for any 'snippets' directory in your
+'runtimepath'. Typically, it is located at '~/.vim/snippets/' on *nix or
+'$HOME\vimfiles\snippets\' on Windows. To change that location or add another
+one, change the g:snippets_dir variable in your |.vimrc| to your preferred
+directory, or use the |ExtractSnips()|function. This will be used by the
+|globpath()| function, and so accepts the same syntax as it (e.g.,
+comma-separated paths).
+
+ExtractSnipsFile({directory}, {filetype})     *ExtractSnipsFile()* *.snippets*
+
+ExtractSnipsFile() extracts the specified *.snippets file for the given
+filetype. A .snippets file contains multiple snippet declarations for the
+filetype. It is further explained above, in |snippet-syntax|.
+
+ExtractSnips({directory}, {filetype})             *ExtractSnips()* *.snippet*
+
+ExtractSnips() extracts *.snippet files from the specified directory and
+defines them as snippets for the given filetype. The directory tree should
+look like this: 'snippets/<filetype>/<trigger>.snippet'. If the snippet has
+multiple matches, it should look like this:
+'snippets/<filetype>/<trigger>/<name>.snippet' (see |multi_snip|).
+
+ResetAllSnippets()                                       *ResetAllSnippets()*
+ResetAllSnippets() removes all snippets from memory. This is useful to put at
+the top of a snippet setup file for if you would like to |:source| it multiple
+times.
+
+ResetSnippets({filetype})                                   *ResetSnippets()*
+ResetSnippets() removes all snippets from memory for the given filetype.
+
+ReloadAllSnippets()                                     *ReloadAllSnippets()*
+ReloadAllSnippets() reloads all snippets for all filetypes. This is useful for
+testing and debugging.
+
+ReloadSnippets({filetype})                                 *ReloadSnippets()*
+ReloadSnippets() reloads all snippets for the given filetype.
+
+                                             *list-snippets* *i_CTRL-R_<Tab>*
+If you would like to see what snippets are available, simply type <c-r><tab>
+in the current buffer to show a list via |popupmenu-completion|.
+
+==============================================================================
+SETTINGS                                  *snipMate-settings* *g:snips_author*
+
+The g:snips_author string (similar to $TM_FULLNAME in TextMate) should be set
+to your name; it can then be used in snippets to automatically add it. E.g.: >
+
+ let g:snips_author = 'Hubert Farnsworth'
+ snippet name
+       `g:snips_author`
+<
+                                     *snipMate-expandtab* *snipMate-indenting*
+If you would like your snippets to be expanded using spaces instead of tabs,
+just enable 'expandtab' and set 'softtabstop' to your preferred amount of
+spaces. If 'softtabstop' is not set, 'shiftwidth' is used instead.
+
+                                                              *snipMate-remap*
+snipMate does not come with a setting to customize the trigger key, but you
+can remap it easily in the two lines it's defined in the 'after' directory
+under 'plugin/snipMate.vim'. For instance, to change the trigger key
+to CTRL-J, just change this: >
+
+ ino <tab> <c-r>=TriggerSnippet()<cr>
+ snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
+
+to this: >
+ ino <c-j> <c-r>=TriggerSnippet()<cr>
+ snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>
+
+==============================================================================
+FEATURES                                                   *snipMate-features*
+
+snipMate.vim has the following features among others:
+  - The syntax of snippets is very similar to TextMate's, allowing
+    easy conversion.
+  - The position of the snippet is kept transparently (i.e. it does not use
+    markers/placeholders written to the buffer), which allows you to escape
+    out of an incomplete snippet, something particularly useful in Vim.
+  - Variables in snippets are updated as-you-type.
+  - Snippets can have multiple matches.
+  - Snippets can be out of order. For instance, in a do...while loop, the
+    condition can be added before the code.
+  - [New] File-based snippets are supported.
+  - [New] Triggers after non-word delimiters are expanded, e.g. "foo"
+    in "bar.foo".
+  - [New] <shift-tab> can now be used to jump tab stops in reverse order.
+
+==============================================================================
+DISADVANTAGES                                         *snipMate-disadvantages*
+
+snipMate.vim currently has the following disadvantages to TextMate's snippets:
+    - There is no $0; the order of tab stops must be explicitly stated.
+    - Placeholders within placeholders are not possible. E.g.: >
+
+      '<div${1: id="${2:some_id}}">${3}</div>'
+<
+      In TextMate this would first highlight ' id="some_id"', and if
+      you hit delete it would automatically skip ${2} and go to ${3}
+      on the next <tab>, but if you didn't delete it it would highlight
+      "some_id" first. You cannot do this in snipMate.vim.
+    - Regex cannot be performed on variables, such as "${1/.*/\U&}"
+    - Placeholders cannot span multiple lines.
+    - Activating snippets in different scopes of the same file is
+      not possible.
+
+Perhaps some of these features will be added in a later release.
+
+==============================================================================
+CONTACT                                   *snipMate-contact* *snipMate-author*
+
+To contact the author (Michael Sanders), please email:
+ msanders42+snipmate <at> gmail <dot> com
+
+I greatly appreciate any suggestions or improvements offered for the script.
+
+==============================================================================
+LICENSE                                                     *snipMate-license*
+
+snipMate is released under the MIT license:
+
+Copyright 2009-2010 Michael Sanders. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The software is provided "as is", without warranty of any kind, express or
+implied, including but not limited to the warranties of merchantability,
+fitness for a particular purpose and noninfringement. In no event shall the
+authors or copyright holders be liable for any claim, damages or other
+liability, whether in an action of contract, tort or otherwise, arising from,
+out of or in connection with the software or the use or other dealings in the
+software.
+
+==============================================================================
+
+vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/solarized.txt b/vim/doc/solarized.txt
new file mode 100644 (file)
index 0000000..93ebd68
--- /dev/null
@@ -0,0 +1,254 @@
+*solarized.vim* for Vim version 7.3 or newer. Modified: 2011 May 05
+
+
+               Solarized Vim Colorscheme by Ethan Schoonover ~
+
+Solarized Colorscheme                                     *solarized*
+                                                          *solarized-help*
+                                                          *solarized-colors*
+                                                          *solarized-colorscheme*
+                                                          *vim-colors-solarized*
+
+Solarized is a carefully designed selective contrast colorscheme with dual
+light and dark modes that runs in both GUI, 256 and 16 color modes.
+
+See the homepage at http://ethanschoonover.com/solarized for screenshots and 
+details.
+
+0. Install                             |solarized-install|
+1. Solarized Menu                      |solarized-menu|
+2. Options                             |solarized-options|
+3. Toggle Background                   |solarized-togglebg|
+4. Terminal Issues                     |solarized-term|
+
+==============================================================================
+0. Install                                             *solarized-install*
+
+Note: I recommend using Tim Pope's pathogen plugin to install this 
+colorscheme. See https://github.com/tpope/vim-pathogen . If you've installed 
+pathogen properly you can install Solarized with the following commands, 
+followed by the .vimrc configuration below.
+
+       $ cd ~/.vim/bundle
+       $ git clone https://github.com/altercation/vim-colors-solarized.git
+
+If you aren't using pathogen, you can use the following three steps to install 
+Solarized:
+
+1.  Download the solarized distribution (available on the homepage above)
+    and unarchive the file.
+
+2.  Move `solarized.vim` to your `.vim/colors` directory.
+
+3.  Move each of the files in each subdirectories to the corresponding .vim
+    subdirectory (e.g. autoload/togglebg.vim goes into your .vim/autoload
+    directory as .vim/autoload/togglebg.vim).
+
+
+After installation, place the following lines in your .vimrc:
+
+       syntax enable
+       set background=dark
+       colorscheme solarized
+
+or, for the light background mode of Solarized:
+
+       syntax enable
+       set background=light
+       colorscheme solarized
+
+==============================================================================
+1. Solarized Menu                                      *solarized-menu*
+
+Solarized makes available a menu when used in Vim GUI mode (gvim, macvim).  
+This menu includes many of the options detailed below so that you can test out 
+different values quickly without modifying your .vimrc file. If you wish to 
+turn off this menu permanently, simply place the following line in your .vimrc 
+above the "colorscheme solarized" line.
+
+       let g:solarized_menu=0
+
+==============================================================================
+2. Toggle Background                                   *solarized-togglebg*
+                                                       *toggle-bg* *togglebg*
+                                                       *toggle-background*
+
+Solarized comes with Toggle Background, a simple plugin to switch between 
+light and dark background modes and reset the colorscheme. This is most useful 
+for colorschemes that support both light and dark modes and in terminals or 
+gui vim windows where the background will be properly set.
+
+Toggle Background can be accessed by:
+
+    * the Solarized menu (in Vim gui mode)
+    * the Window menu (in Vim gui mode, even if the Solarized menu is off)
+    * the "yin/yang" toolbar button (in Vim gui mode)
+    * the default mapping of <F5>
+    * custom key mapping you set in your .vimrc (see below)
+    * command line via ":ToggleBG" (no quotes)
+
+Toggle Background starts with a default mapping to function key <F5>. If you 
+are already using this in a mapping, Toggle Background will not map itself to 
+a default and you will have to map it manually in your .vimrc file, or 
+remove/change your existing <F5> mapping to another value. To customize the 
+keyboard mapping in your .vimrc file, use the following line, changing the 
+"<F5>" value to the key or key combination you wish to use:
+
+       call togglebg#map("<F5>")
+
+Note that you'll want to use a single function key or equivalent if you want 
+the plugin to work in all modes (normal, insert, visual).
+
+When using the plugin during normal, visual, or insert mode, there should be 
+no interruption in workflow. However, if you activate the plugin during 
+REPLACE mode, you will switch to standard insert mode (you will leave the 
+overwrite replace mode).
+
+==============================================================================
+3. Solarized Terminal Issues                           *solarized-term*
+
+If you are going to use Solarized in Terminal mode (i.e. not in a GUI version 
+like gvim or macvim), **please please please** consider setting your terminal 
+emulator's colorscheme to used the Solarized palette. I've included palettes 
+for some popular terminal emulator as well as Xdefaults in the official 
+Solarized download available from the Solarized homepage listed at the top of 
+this help document. If you use Solarized *without* these colors, Solarized 
+will need to be told to degrade its colorscheme to a set compatible with the 
+limited 256 terminal palette (whereas by using the terminal's 16 ansi color 
+values, you can set the correct, specific values for the Solarized palette).
+
+If you do use the custom terminal colors, solarized.vim should work out of 
+the box for you. If you are using a terminal emulator that supports 256 
+colors and don't want to use the custom Solarized terminal colors, you will 
+need to use the degraded 256 colorscheme. To do so, simply add the following 
+line *before* the `colorschem solarized` line:
+
+    let g:solarized_termcolors=256
+
+Again, I recommend just changing your terminal colors to Solarized values 
+either manually or via one of the many terminal schemes available for import.
+
+==============================================================================
+4. Solarized Options                                   *solarized-options*
+
+
+AUTOGENERATE OPTIONS
+
+You can easily modify and experiment with Solarized display options using the 
+Solarized menu when using Vim in gui mode. Once you have things set to your 
+liking, you can autogenerate the current option list in a format ready for 
+insertion into your .vimrc file using the Solarized menu "Autogenerate 
+Options" command or at the command line with:
+
+    :SolarizedOptions
+
+
+OPTION LIST
+
+Set these in your vimrc file prior to calling the colorscheme.
+
+option name               default     optional
+------------------------------------------------
+g:solarized_termcolors=   16      |   256
+g:solarized_termtrans =   0       |   1
+g:solarized_degrade   =   0       |   1
+g:solarized_bold      =   1       |   0
+g:solarized_underline =   1       |   0
+g:solarized_italic    =   1       |   0
+g:solarized_contrast  =   "normal"|   "high" or "low"
+g:solarized_visibility=   "normal"|   "high" or "low"
+g:solarized_hitrail   =   0       |   1
+g:solarized_menu      =   1       |   0
+------------------------------------------------
+
+
+OPTION DETAILS
+
+------------------------------------------------
+g:solarized_termcolors=   256     |   16               *'solarized_termcolors'*
+------------------------------------------------
+The most important option if you are using vim in terminal (non gui) mode!
+This tells Solarized to use the 256 degraded color mode if running in a 256
+color capable terminal.  Otherwise, if set to `16` it will use the terminal
+emulators colorscheme (best option as long as you've set the emulators colors
+to the Solarized palette).
+
+If you are going to use Solarized in Terminal mode (i.e. not in a GUI
+version like gvim or macvim), **please please please** consider setting your
+terminal emulator's colorscheme to used the Solarized palette. I've included
+palettes for some popular terminal emulator as well as Xdefaults in the
+official Solarized download available from:
+http://ethanschoonover.com/solarized . If you use Solarized without these
+colors, Solarized will by default use an approximate set of 256 colors.  It
+isn't bad looking and has been extensively tweaked, but it's still not quite
+the real thing.
+
+------------------------------------------------
+g:solarized_termtrans =   0       |   1                        *'solarized_termtrans'*
+------------------------------------------------
+If you use a terminal emulator with a transparent background and Solarized
+isn't displaying the background color transparently, set this to 1 and
+Solarized will use the default (transparent) background of the terminal
+emulator. *urxvt* required this in my testing; iTerm2 did not.
+
+Note that on Mac OS X Terminal.app, solarized_termtrans is set to 1 by 
+default as this is almost always the best option. The only exception to this 
+is if the working terminfo file supports 256 colors (xterm-256color).
+
+------------------------------------------------
+g:solarized_degrade   =   0       |   1                        *'solarized_degrade'*
+------------------------------------------------
+For test purposes only; forces Solarized to use the 256 degraded color mode
+to test the approximate color values for accuracy.
+
+------------------------------------------------
+g:solarized_bold      =   1       |   0                        *'solarized_bold'*
+------------------------------------------------
+------------------------------------------------
+g:solarized_underline =   1       |   0                        *'solarized_underline'*
+------------------------------------------------
+------------------------------------------------
+g:solarized_italic    =   1       |   0                        *'solarized_italic'*
+------------------------------------------------
+If you wish to stop Solarized from displaying bold, underlined or
+italicized typefaces, simply assign a zero value to the appropriate
+variable, for example: `let g:solarized_italic=0`
+
+------------------------------------------------
+g:solarized_contrast  =   "normal"|   "high" or "low"  *'solarized_contrast'*
+------------------------------------------------
+Stick with normal! It's been carefully tested. Setting this option to high
+or low does use the same Solarized palette but simply shifts some values up
+or down in order to expand or compress the tonal range displayed.
+
+------------------------------------------------
+g:solarized_visibility =  "normal"|   "high" or "low" *'solarized_visibility'*
+------------------------------------------------
+Special characters such as trailing whitespace, tabs, newlines, when 
+displayed using ":set list" can be set to one of three levels depending on 
+your needs.
+
+------------------------------------------------
+g:solarized_hitrail   =   0       |   1                        *'solarized_hitrail'*
+------------------------------------------------
+Visibility can make listchar entities more visible, but if one has set 
+cursorline on, these same listchar values standout somewhat less due to the 
+background color of the cursorline. g:solarized_hitrail enables highlighting 
+of trailing spaces (only one of the listchar types, but a particularly 
+important one) while in the cursoline in a different manner in order to make 
+them more visible. This may not work consistently as Solarized is using 
+a pattern match than can be overridden by a more encompassing syntax-native 
+match such as a comment line.
+
+
+------------------------------------------------
+g:solarized_menu       =  1       |   0                        *'solarized_menu'*
+------------------------------------------------
+Solarized includes a menu providing access to several of the above
+display related options, including contrast and visibility. This allows
+for an easy method of testing different values quickly before settling
+on a final assignment for your .vimrc. If you wish to turn off this menu,
+assign g:solarized_menu a value of 0.
+
+
+ vim:tw=78:noet:ts=8:ft=help:norl:
diff --git a/vim/doc/supertab.txt b/vim/doc/supertab.txt
new file mode 100644 (file)
index 0000000..038bcb5
--- /dev/null
@@ -0,0 +1,307 @@
+*supertab.txt*
+
+Authors:
+  Original: Gergely Kontra <kgergely@mcl.hu>
+  Current:  Eric Van Dewoestine <ervandew@gmail.com> (as of version 0.4)
+
+Contributors:
+  Christophe-Marie Duquesne <chm.duquesne@gmail.com> (documentation)
+
+Please direct all correspondence to Eric.
+
+This plugin is licensed under the terms of the BSD License.  Please see
+supertab.vim for the license in its entirety.
+
+==============================================================================
+Supertab                                    *supertab*
+
+1. Introduction                             |supertab-intro|
+2. Supertab Usage                           |supertab-usage|
+3. Supertab Options                         |supertab-options|
+    Default completion type                 |supertab-defaultcompletion|
+    Secondary default completion type       |supertab-contextdefault|
+    Completion contexts                     |supertab-completioncontexts|
+        Context text                        |supertab-contexttext|
+        Context Discover                    |supertab-contextdiscover|
+        Example                             |supertab-contextexample|
+    Completion Duration                     |supertab-duration|
+    Preventing Completion After/Before...   |supertab-preventcomplete|
+    Changing default mapping                |supertab-forwardbackward|
+    Inserting true tabs                     |supertab-mappingtabliteral|
+    Enhanced longest match support          |supertab-longestenhanced|
+    Preselecting the first entry            |supertab-longesthighlight|
+
+==============================================================================
+1. Introduction                             *supertab-intro*
+
+Supertab is a plugin which allows you to perform all your insert completion
+(|ins-completion|) using the tab key.
+
+Supertab requires Vim version 7.0 or above.
+
+==============================================================================
+2. Supertab usage                           *supertab-usage*
+
+Using Supertab is as easy as hitting <Tab> or <S-Tab> (shift+tab) while in
+insert mode, with at least one non whitespace character before the cursor, to
+start the completion and then <Tab> or <S-Tab> again to cycle forwards or
+backwards through the available completions.
+
+Example ('|' denotes the cursor location):
+
+bar
+baz
+b|<Tab>    Hitting <Tab> here will start the completion, allowing you to
+           then cycle through the suggested words ('bar' and 'baz').
+
+==============================================================================
+3. Supertab Options                         *supertab-options*
+
+Supertab is configured via several global variables that you can set in your
+|vimrc| file according to your needs. Below is a comprehensive list of
+the variables available.
+
+
+Default Completion Type             *supertab-defaultcompletion*
+                                    *g:SuperTabDefaultCompletionType*
+
+g:SuperTabDefaultCompletionType (default value: "<c-p>")
+
+Used to set the default completion type. There is no need to escape this
+value as that will be done for you when the type is set.
+
+  Example: setting the default completion to 'user' completion:
+
+    let g:SuperTabDefaultCompletionType = "<c-x><c-u>"
+
+Note: a special value of 'context' is supported which will result in
+super tab attempting to use the text preceding the cursor to decide which
+type of completion to attempt.  Currently super tab can recognize method
+calls or attribute references via '.', '::' or '->', and file path
+references containing '/'.
+
+    let g:SuperTabDefaultCompletionType = "context"
+
+    /usr/l<tab>     # will use filename completion
+    myvar.t<tab>    # will use user completion if completefunc set,
+                    # or omni completion if omnifunc set.
+    myvar-><tab>    # same as above
+
+When using context completion, super tab will fall back to a secondary default
+completion type set by |g:SuperTabContextDefaultCompletionType|.
+
+Note: once the buffer has been initialized, changing the value of this setting
+will not change the default complete type used.  If you want to change the
+default completion type for the current buffer after it has been set, perhaps
+in an ftplugin, you'll need to call SuperTabSetDefaultCompletionType like so,
+supplying the completion type you wish to switch to:
+
+    call SuperTabSetDefaultCompletionType("<c-x><c-u>")
+
+
+Secondary default completion type   *supertab-contextdefault*
+                                    *g:SuperTabContextDefaultCompletionType*
+
+g:SuperTabContextDefaultCompletionType (default value: "<c-p>")
+
+Sets the default completion type used when g:SuperTabDefaultCompletionType is
+set to 'context' and no completion type is returned by any of the configured
+contexts.
+
+
+Completion contexts                 *supertab-completioncontexts*
+                                    *g:SuperTabCompletionContexts*
+
+g:SuperTabCompletionContexts (default value: ['s:ContextText'])
+
+Sets the list of contexts used for context completion.  This value should
+be a list of function names which provide the context implementation.
+
+When supertab starts the default completion, each of these contexts will be
+consulted, in the order they were supplied, to determine the completion type
+to use.  If a context returns a completion type, that type will be used,
+otherwise the next context in the list will be consulted.  If after executing
+all the context functions, no completion type has been determined, then the
+value of g:SuperTabContextDefaultCompletionType will be used.
+
+Built in completion contexts:
+
+  s:ContextText                     *supertab-contexttext*
+
+  The text context will examine the text near the cursor to decide which type
+  of completion to attempt.  Currently the text context can recognize method
+  calls or attribute references via '.', '::' or '->', and file path
+  references containing '/'.
+
+      /usr/l<tab>  # will use filename completion
+      myvar.t<tab> # will use user completion if completefunc set, or
+                   # omni completion if omnifunc set.
+      myvar-><tab> # same as above
+
+  Supported configuration attributes:
+
+    g:SuperTabContextTextFileTypeExclusions
+    List of file types for which the text context will be skipped.
+
+    g:SuperTabContextTextOmniPrecedence
+    List of omni completion option names in the order of precedence that they
+    should be used if available. By default, user completion will be given
+    precedence over omni completion, but you can use this variable to give
+    omni completion higher precedence by placing it first in the list.
+
+  s:ContextDiscover                 *supertab-contextdiscover*
+
+  This context will use the 'g:SuperTabContextDiscoverDiscovery' variable to
+  determine the completion type to use.  It will evaluate each value, in the
+  order they were defined, until a variable evaluates to a non-zero or
+  non-empty value, then the associated completion type is used.
+
+  Supported configuration properties:
+
+    g:SuperTabContextDiscoverDiscovery
+    List of variable:completionType mappings.
+
+  Example context configuration:    *supertab-contextexample*
+
+    let g:SuperTabCompletionContexts = ['s:ContextText', 's:ContextDiscover']
+    let g:SuperTabContextTextOmniPrecedence = ['&omnifunc', '&completefunc']
+    let g:SuperTabContextDiscoverDiscovery =
+        \ ["&completefunc:<c-x><c-u>", "&omnifunc:<c-x><c-o>"]
+
+  In addition to the default completion contexts, you can plug in your own
+  implementation by creating a globally accessible function that returns
+  the completion type to use (eg. "\<c-x>\<c-u>").
+
+    function MyTagContext()
+      if filereadable(expand('%:p:h') . '/tags')
+        return "\<c-x>\<c-]>"
+      endif
+      " no return will result in the evaluation of the next
+      " configured context
+    endfunction
+    let g:SuperTabCompletionContexts =
+        \ ['MyTagContext', 's:ContextText', 's:ContextDiscover']
+
+  Note: supertab also supports the b:SuperTabCompletionContexts variable
+  allowing you to set the list of contexts separately for the current buffer,
+  like from an ftplugin for example.
+
+
+Completion Duration                 *supertab-duration*
+                                    *g:SuperTabRetainCompletionDuration*
+
+g:SuperTabRetainCompletionDuration (default value: 'insert')
+
+Determines if, and for how long, the current completion type is retained.
+The possible values include:
+'completion' - The current completion type is only retained for the
+               current completion.  Once you have chosen a completion
+               result or exited the completion mode, the default
+               completion type is restored.
+'insert'     - The current completion type is saved until you exit insert
+               mode (via ESC).  Once you exit insert mode the default
+               completion type is restored. (supertab default)
+'session'    - The current completion type is saved for the duration of
+               your vim session or until you enter a different completion
+               mode.
+
+
+Preventing completion after...      *supertab-preventcomplete*
+                                    *g:SuperTabNoCompleteBefore*
+                                    *g:SuperTabNoCompleteAfter*
+
+g:SuperTabNoCompleteBefore (default value: [])
+g:SuperTabNoCompleteAfter (default value: ['\s'])
+
+These two variables are used to control when supertab will attempt completion
+or instead fall back to inserting a literal <tab>, by specifying a list of
+patterns which are tested against the text before and after the current cursor
+position that when matched, prevent completion. So if you don't want supertab
+to start completion after a comma or space, you can set
+g:SuperTabNoCompleteAfter to [',', '\s'].
+
+Note: That a buffer local version of these variables
+(b:SuperTabNoCompleteBefore, b:SuperTabNoCompleteAfter) is also supported
+should you wish to have different values depending on the file type for
+instance.
+
+Changing the default mapping        *supertab-forwardbackward*
+                                    *g:SuperTabMappingForward*
+                                    *g:SuperTabMappingBackward*
+
+g:SuperTabMappingForward  (default value: '<tab>')
+g:SuperTabMappingBackward (default value: '<s-tab>')
+
+These two variables allow you to set the keys used to kick off the current
+completion.  By default this is <tab> and <s-tab>.  To change to something
+like <c-space> and <s-c-space>, you can add the following to your |vimrc|.
+
+        let g:SuperTabMappingForward = '<c-space>'
+        let g:SuperTabMappingBackward = '<s-c-space>'
+
+Note: if the above does not have the desired effect (which may happen in
+console version of vim), you can try the following mappings.  Although the
+backwards mapping still doesn't seem to work in the console for me, your
+milage may vary.
+
+        let g:SuperTabMappingForward = '<nul>'
+        let g:SuperTabMappingBackward = '<s-nul>'
+
+
+Inserting true tabs                 *supertab-mappingtabliteral*
+                                    *g:SuperTabMappingTabLiteral*
+
+g:SuperTabMappingTabLiteral (default value: '<c-tab>')
+
+Sets the key mapping used to insert a literal tab where supertab would
+otherwise attempt to kick off insert completion. The default is '<c-tab>'
+(ctrl-tab) which unfortunately might not work at the console. So if you are
+using a console vim and want this functionality, you may have to change it to
+something that is supported.  Alternatively, you can escape the <tab> with
+<c-v> (see |i_CTRL-V| for more infos).
+
+
+Enhanced longest match support      *supertab-longestenhanced*
+                                    *g:SuperTabLongestEnhanced*
+
+g:SuperTabLongestEnhanced (default value: 0)
+
+When enabled and 'longest' is in your |completeopt| setting, supertab will
+provide an enhanced longest match support where typing one or more letters and
+hitting tab again while in a completion mode will complete the longest common
+match using the new text in the buffer.
+
+For example, say you have a buffer with the following contents:
+  FooBarFoo
+  FooBar
+  Foo
+  FooBarBaz
+And you then type F<tab>.  Vim's builtin longest support will complete the
+longest common text 'Foo' and offer 'FooBarFoo', 'FooBar', 'Foo', and
+'FooBarBaz' as possible completions.  With supertab's longest match
+enhancement disabled, typing B<tab> while still in the completion mode will
+end up completing 'FooBarBaz' or 'FooBarFoo' depending your settings, instead
+of the next longest common match of 'FooBar'.  With supertab's enhanced
+longest match feature enabled, the typing of B<tab> will result in the next
+longest text being completed.
+
+
+Preselecting the first entry        *supertab-longesthighlight*
+                                    *g:SuperTabLongestHighlight*
+
+g:SuperTabLongestHighlight (default value: 0)
+
+Sets whether or not to pre-highlight the first match when completeopt has the
+popup menu enabled and the 'longest' option as well. When enabled, <tab> will
+kick off completion and pre-select the first entry in the popup menu, allowing
+you to simply hit <enter> to use it.
+
+
+Mapping <cr> to end completion      *supertab-crmapping*
+                                    *g:SuperTabCrMapping*
+
+g:SuperTabCrMapping (default value: 1)
+
+When enabled, <cr> will cancel completion mode preserving the current text.
+
+vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/surround.txt b/vim/doc/surround.txt
new file mode 100644 (file)
index 0000000..4387fa2
--- /dev/null
@@ -0,0 +1,222 @@
+*surround.txt*  Plugin for deleting, changing, and adding "surroundings"
+
+Author:  Tim Pope <vimNOSPAM@tpope.info>        *surround-author*
+License: Same terms as Vim itself (see |license|)
+
+This plugin is only available if 'compatible' is not set.
+
+INTRODUCTION                                    *surround*
+
+This plugin is a tool for dealing with pairs of "surroundings."  Examples
+of surroundings include parentheses, quotes, and HTML tags.  They are
+closely related to what Vim refers to as |text-objects|.  Provided
+are mappings to allow for removing, changing, and adding surroundings.
+
+Details follow on the exact semantics, but first, consider the following
+examples.  An asterisk (*) is used to denote the cursor position.
+
+  Old text                  Command     New text ~
+  "Hello *world!"           ds"         Hello world!
+  [123+4*56]/2              cs])        (123+456)/2
+  "Look ma, I'm *HTML!"     cs"<q>      <q>Look ma, I'm HTML!</q>
+  if *x>3 {                 ysW(        if ( x>3 ) {
+  my $str = *whee!;         vlllls'     my $str = 'whee!';
+
+While a few features of this plugin will work in older versions of Vim,
+Vim 7 is recommended for full functionality.
+
+MAPPINGS                                        *surround-mappings*
+
+Delete surroundings is *ds* .  The next character given determines the target
+to delete.  The exact nature of the target is explained in |surround-targets|
+but essentially it is the last character of a |text-object|.  This mapping
+deletes the difference between the "i"nner object and "a"n object.  This is
+easiest to understand with some examples:
+
+  Old text                  Command     New text ~
+  "Hello *world!"           ds"         Hello world!
+  (123+4*56)/2              ds)         123+456/2
+  <div>Yo!*</div>           dst         Yo!
+
+Change surroundings is *cs* .  It takes two arguments, a target like with
+|ds|, and a replacement.  Details about the second argument can be found
+below in |surround-replacements|.  Once again, examples are in order.
+
+  Old text                  Command     New text ~
+  "Hello *world!"           cs"'        'Hello world!'
+  "Hello *world!"           cs"<q>      <q>Hello world!</q>
+  (123+4*56)/2              cs)]        [123+456]/2
+  (123+4*56)/2              cs)[        [ 123+456 ]/2
+  <div>Yo!*</div>           cst<p>      <p>Yo!</p>
+
+*ys* takes a valid Vim motion or text object as the first object, and wraps
+it using the second argument as with |cs|.  (Unfortunately there's no good
+mnemonic for "ys".)
+
+  Old text                  Command     New text ~
+  Hello w*orld!             ysiw)       Hello (world)!
+
+As a special case, *yss* operates on the current line, ignoring leading
+whitespace.
+
+  Old text                  Command     New text ~
+      Hello w*orld!         yssB            {Hello world!}
+
+There is also *yS* and *ySS* which indent the surrounded text and place it
+on a line of its own.
+
+In visual mode, a simple "s" with an argument wraps the selection.  This is
+referred to as the *vS* mapping, although ordinarily there will be
+additional keystrokes between the v and s.  In linewise visual mode, the
+surroundings are placed on separate lines and indented.  In blockwise visual
+mode, each line is surrounded.
+
+A "gS" in visual mode, known as *vgS* , behaves similarly.  In linewise visual
+mode, the automatic indenting is surpressed.  In blockwise visual mode, this
+enables surrounding past the end of the like with 'virtualedit' set (there
+seems to be no way in Vim Script to differentiate between a jagged end of line
+selection and a virtual block selected past the end of the line, so two maps
+were needed).
+
+Additionally, there is a legacy "s" or *vs* mapping which is basically the
+same as |vS|.  Due to popular demand of wanting to use "s" as Vim does to mean
+replacing the selection (also available as "c"), this mapping is going away.
+If you were one of these people and would like to disable "s" with the current
+release, indicate this to surround.vim by assigning the "s" mapping to
+something else.
+>
+  xmap <Leader>s <Plug>Vsurround
+<
+                                                *i_CTRL-G_s* *i_CTRL-G_S*
+Finally, there is an experimental insert mode mapping on <C-G>s and <C-S>.
+Beware that the latter won't work on terminals with flow control (if you
+accidentally freeze your terminal, use <C-Q> to unfreeze it).  The mapping
+inserts the specified surroundings and puts the cursor between them.  If,
+immediately after the mapping and before the replacement, a second <C-S> or
+carriage return is pressed, the prefix, cursor, and suffix will be placed on
+three separate lines.  <C-G>S (not <C-G>s) also exhibits this behavior.
+
+TARGETS                                         *surround-targets*
+
+The |ds| and |cs| commands both take a target as their first argument.  The
+possible targets are based closely on the |text-objects| provided by Vim.
+In order for a target to work, the corresponding text object must be
+supported in the version of Vim used (Vim 7 adds several text objects, and
+thus is highly recommended).  All targets are currently just one character.
+
+Eight punctuation marks, (, ), {, }, [, ], <, and >, represent themselves
+and their counterparts.  If the opening mark is used, contained whitespace is
+also trimmed.  The targets b, B, r, and a are aliases for ), }, ], and >
+(the first two mirror Vim; the second two are completely arbitrary and
+subject to change).
+
+Three quote marks, ', ", `, represent themselves, in pairs.  They are only
+searched for on the current line.
+
+A t is a pair of HTML or XML tags.  See |tag-blocks| for details.  Remember
+that you can specify a numerical argument if you want to get to a tag other
+than the innermost one.
+
+The letters w, W, and s correspond to a |word|, a |WORD|, and a |sentence|,
+respectively.  These are special in that they have nothing to delete, and
+used with |ds| they are a no-op.  With |cs|, one could consider them a
+slight shortcut for ysi (cswb == ysiwb, more or less).
+
+A p represents a |paragraph|.  This behaves similarly to w, W, and s above;
+however, newlines are sometimes added and/or removed.
+
+REPLACEMENTS                                    *surround-replacements*
+
+A replacement argument is a single character, and is required by |cs|, |ys|,
+and |vs|.  Undefined replacement characters (with the exception of alphabetic
+characters) default to placing themselves at the beginning and end of the
+destination, which can be useful for characters like / and |.
+
+If either ), }, ], or > is used, the text is wrapped in the appropriate pair
+of characters.  Similar behavior can be found with (, {, and [ (but not <),
+which append an additional space to the inside.  Like with the targets above,
+b, B, r, and a are aliases for ), }, ], and >.  To fulfill the common need for
+code blocks in C-style languages, <C-}> (which is really <C-]>) adds braces on
+lines separate from the content.
+
+If t or < is used, Vim prompts for an HTML/XML tag to insert.  You may specify
+attributes here and they will be stripped from the closing tag.  End your
+input by pressing <CR> or >.  If <C-T> is used, the tags will appear on lines
+by themselves.
+
+A deprecated replacement of a LaTeX environment is provided on \ and l.  The
+name of the environment and any arguments will be input from a prompt.  This
+will be removed once a more fully functional customization system is
+implemented.  The following shows the resulting environment from
+csp\tabular}{lc<CR>
+>
+  \begin{tabular}{lc}
+  \end{tabular}
+<
+CUSTOMIZING                                     *surround-customizing*
+
+The following adds a potential replacement on "-" (ASCII 45) in PHP files.
+(To determine the ASCII code to use, :echo char2nr("-")).  The carriage
+return will be replaced by the original text.
+>
+  autocmd FileType php let b:surround_45 = "<?php \r ?>"
+<
+This can be used in a PHP file as in the following example.
+
+  Old text                  Command     New text ~
+  print "Hello *world!"     yss-        <?php print "Hello world!" ?>
+
+Additionally, one can use a global variable for globally available
+replacements.
+>
+  let g:surround_45 = "<% \r %>"
+  let g:surround_61 = "<%= \r %>"
+<
+Advanced, experimental, and subject to change:  One can also prompt for
+replacement text.  The syntax for this is to surround the replacement in pairs
+of low numbered control characters.  If this sounds confusing, that's because
+it is (but it makes the parsing easy).  Consider the following example for a
+LaTeX environment on the "l" replacement.
+>
+  let g:surround_108 = "\\begin{\1environment: \1}\r\\end{\1\1}"
+<
+When this replacement is used,  the user is prompted with an "environment: "
+prompt for input.  This input is inserted between each set of \1's.
+Additional inputs up to \7 can be used.
+
+Furthermore, one can specify a regular expression substitution to apply.
+>
+  let g:surround_108 = "\\begin{\1environment: \1}\r\\end{\1\r}.*\r\1}"
+<
+This will remove anything after the first } in the input when the text is
+placed within the \end{} slot.  The first \r marks where the pattern begins,
+and the second where the replacement text begins.
+
+Here's a second example for creating an HTML <div>.  The substitution cleverly
+prompts for an id, but only adds id="" if it is non-blank.  You may have to
+read this one a few times slowly before you understand it.
+>
+  let g:surround_{char2nr("d")} = "<div\1id: \r..*\r id=\"&\"\1>\r</div>"
+<
+Inputting text replacements is a proof of concept at this point. The ugly,
+unintuitive interface and the brevity of the documentation reflect this.
+
+Finally, It is possible to always append a string to surroundings in insert
+mode (and only insert mode).  This is useful with certain plugins and mappings
+that allow you to jump to such markings.
+>
+  let g:surround_insert_tail = "<++>"
+<
+ISSUES                                          *surround-issues*
+
+Vim could potentially get confused when deleting/changing occurs at the very
+end of the line.  Please report any repeatable instances of this.
+
+Do we need to use |inputsave()|/|inputrestore()| with the tag replacement?
+
+Indenting is handled haphazardly.  Need to decide the most appropriate
+behavior and implement it.  Right now one can do :let b:surround_indent = 1
+(or the global equivalent) to enable automatic re-indenting by Vim via |=|;
+should this be the default?
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/syntastic.txt b/vim/doc/syntastic.txt
new file mode 100644 (file)
index 0000000..f0cede3
--- /dev/null
@@ -0,0 +1,574 @@
+*syntastic.txt*   Syntax checking on the fly has never been so pimp.
+*syntastic*
+
+
+                    It's a bird! It's a plane! ZOMG It's ... ~
+
+                   _____             __             __  _      ~
+                  / ___/__  ______  / /_____ ______/ /_(_)____ ~
+                  \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ ~
+                 ___/ / /_/ / / / / /_/ /_/ (__  ) /_/ / /__   ~
+                /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/   ~
+                     /____/                                    ~
+
+
+
+                              Reference Manual~
+
+
+==============================================================================
+CONTENTS                                                  *syntastic-contents*
+
+    1.Intro...................................|syntastic-intro|
+    2.Functionality provided..................|syntastic-functionality|
+        2.1.The statusline flag...............|syntastic-statusline-flag|
+        2.2.Error signs.......................|syntastic-error-signs|
+        2.3.Error window......................|syntastic-error-window|
+    3.Commands................................|syntastic-commands|
+    4.Options.................................|syntastic-options|
+    5.Writing syntax checkers.................|syntastic-syntax-checkers|
+    6.About...................................|syntastic-about|
+    7.Changelog...............................|syntastic-changelog|
+    8.Credits.................................|syntastic-credits|
+    9.License.................................|syntastic-license|
+
+
+==============================================================================
+1. Intro                                                     *syntastic-intro*
+
+Syntastic is a syntax checking plugin that runs files through external syntax
+checkers. This can be done on demand, or automatically as files are saved and
+opened.  If syntax errors are detected, the user is notified and is happy
+because they didn't have to compile their code or execute their script to find
+them.
+
+Syntastic comes in two parts: the syntax checker plugins, and the core script
+(i.e. syntastic.vim). The syntax checker plugins are defined on a per-filetype
+basis where each one wraps up an external syntax checking program. The core
+script delegates off to these plugins and uses their output to provide the
+syntastic functionality. At the time of this writing, syntax checking plugins
+exist for c, coffee, cpp, css, cucumber, cuda, docbk, erlang, eruby, fortran,
+go, haml, haskell, html, javascript, less, lua, matlab, perl, php, puppet,
+python, ruby, sass/scss, sh, tcl, tex, vala, xhtml, xml, xslt, zpt
+
+Take a look in the syntax_checkers directory for the most up to date list.
+
+If your language is not supported then see |syntastic-syntax-checkers| for
+details on how to implement a syntax checking plugin, and be sure to send me a
+patch ;-)
+
+This plugin is currently only recommended for *nix users. It is functional on
+Windows, but since the syntax checking plugins shell out, the command window
+briefly appears whenever one is executed.
+
+
+==============================================================================
+2. Functionality provided                            *syntastic-functionality*
+
+Syntax checking can be done automatically or on demand (see
+|'syntastic_mode_map'| for configuring this).
+
+When syntax checking is done, the features below can be used to notify the
+user of errors. See |syntastic-options| for how to configure and
+activate/deactivate these features.
+
+    * A configurable statusline flag
+    * Lines with errors can have |signs| placed beside them - where a different
+      sign is used for errors and warnings.
+    * A |location-list| can be displayed with error messages for erroneous
+      buffers.
+    * Offending parts of lines can be highlighted (this functionality is only
+      provided by some syntax checkers).
+    * Balloons (if compiled in) can be used to display error messages for
+      erroneous lines when hovering the mouse over them.
+
+
+Note: This functionality is only available if a syntax checker plugin is
+present for the filetype of the buffer in question. See
+|syntastic-syntax-checkers| for details.
+
+------------------------------------------------------------------------------
+2.1. The statusline flag                           *syntastic-statusline-flag*
+
+To use the statusline flag, this must appear in your |'statusline'| setting >
+    %{SyntasticStatuslineFlag()}
+<
+Something like this could be more useful: >
+    set statusline+=%#warningmsg#
+    set statusline+=%{SyntasticStatuslineFlag()}
+    set statusline+=%*
+<
+When syntax errors are detected a flag will be shown. The content of the flag
+is derived from the |syntastic_stl_format| option
+------------------------------------------------------------------------------
+2.2. Error signs                                       *syntastic-error-signs*
+
+Syntastic uses the |:sign| commands to mark lines with errors and warnings in
+the sign column. To enable this feature, use the |'syntastic_enable_signs'|
+option.
+
+------------------------------------------------------------------------------
+2.3. The error window                       *:Errors* *syntastic-error-window*
+
+You can use the :Errors command to display the errors for the current buffer
+in the |location-list|.
+
+Note that when you use :Errors, the current location list is overwritten with
+Syntastic's own location list.
+
+
+==============================================================================
+3. Commands                                               *syntastic-commands*
+
+:Errors                                                     *:SyntasticErrors*
+
+When errors have been detected, use this command to pop up the |location-list|
+and display the error messages.
+
+
+:SyntasticToggleMode                                    *:SyntasticToggleMode*
+
+Toggles syntastic between active and passive mode. See |'syntastic_mode_map'|
+for more info.
+
+
+:SyntasticCheck                                              *:SyntasticCheck*
+
+Manually cause a syntax check to be done. Useful in passive mode, or if the
+current filetype is set to passive. See |'syntastic_mode_map'| for more info.
+
+
+==============================================================================
+4. Options                                                 *syntastic-options*
+
+
+                                                   *'syntastic_check_on_open'*
+Default: 0
+If enabled, syntastic will do syntax checks when buffers are first loaded as
+well as on saving >
+    let g:syntastic_check_on_open=1
+<
+
+                                              *'syntastic_echo_current_error'*
+Default: 1
+If enabled, syntastic will error message associated with the current line to
+the command window. If multiple errors are found, the first will be used. >
+    let g:syntastic_echo_current_error=1
+<
+
+                                                    *'syntastic_enable_signs'*
+Default: 1
+Use this option to tell syntastic whether to use the |:sign| interface to mark
+syntax errors: >
+    let g:syntastic_enable_signs=1
+<
+
+                                                 *'syntastic_enable_balloons'*
+Default: 1
+Use this option to tell syntastic whether to display error messages in balloons
+when the mouse is hovered over erroneous lines: >
+    let g:syntastic_enable_balloons = 1
+<
+Note that vim must be compiled with |+balloon_eval|.
+
+                                            *'syntastic_enable_highlighting'*
+Default: 1
+Use this option to tell syntastic whether to use syntax highlighting to mark
+errors (where possible). Highlighting can be turned off with the following >
+    let g:syntastic_enable_highlighting = 0
+<
+
+                                                       *'syntastic_auto_jump'*
+Default: 0
+Enable this option if you want the cursor to jump to the first detected error
+when saving or opening a file: >
+    let g:syntastic_auto_jump=1
+<
+
+                                                   *'syntastic_auto_loc_list'*
+Default: 2
+Use this option to tell syntastic to automatically open and/or close the
+|location-list| (see |syntastic-error-window|).
+
+When set to 0 the error window will not be opened or closed automatically. >
+    let g:syntastic_auto_loc_list=0
+<
+
+When set to 1 the error window will be automatically opened when errors are
+detected, and closed when none are detected. >
+    let g:syntastic_auto_loc_list=1
+<
+When set to 2 the error window will be automatically closed when no errors are
+detected, but not opened automatically. >
+    let g:syntastic_auto_loc_list=2
+<
+
+                                                 *'syntastic_loc_list_height'*
+Default: 10
+Use this option to specify the height of the location lists that syntastic
+opens. >
+    let g:syntastic_loc_list_height=5
+<
+
+
+                                                        *'syntastic_mode_map'*
+Default: { "mode": "active",
+           "active_filetypes": [],
+           "passive_filetypes": [] }
+
+Use this option to fine tune when automatic syntax checking is done (or not
+done).
+
+The option should be set to something like: >
+
+    let g:syntastic_mode_map = { 'mode': 'active',
+                               \ 'active_filetypes': ['ruby', 'php'],
+                               \ 'passive_filetypes': ['puppet'] }
+<
+
+"mode" can be mapped to one of two values - "active" or "passive". When set to
+active, syntastic does automatic checking whenever a buffer is saved or
+initially opened.  When set to "passive" syntastic only checks when the user
+calls :SyntasticCheck.
+
+The exceptions to these rules are defined with "active_filetypes" and
+"passive_filetypes". In passive mode, automatic checks are still done
+for all filetypes in the "active_filetypes" array. In active mode,
+automatic checks are not done for any filetypes in the
+"passive_filetypes" array.
+
+At runtime, the |:SyntasticToggleMode| command can be used to switch between
+active and passive mode.
+
+If any of "mode", "active_filetypes", or "passive_filetypes" are not specified
+then they will default to their default value as above.
+
+                                                  *'syntastic_quiet_warnings'*
+
+Use this option if you only care about syntax errors, not warnings. When set,
+this option has the following effects:
+    * no |signs| appear unless there is at least one error, whereupon both
+      errors and warnings are displayed
+    * the |'syntastic_auto_loc_list'| option only pops up the error window if
+      there's at least one error, whereupon both errors and warnings are
+      displayed
+>
+    let g:syntastic_quiet_warnings=1
+<
+
+                                                      *'syntastic_stl_format'*
+
+Default: [Syntax: line:%F (%t)]
+Use this option to control what the syntastic statusline text contains. Several
+magic flags are availble to insert information:
+    %e - number of errors
+    %w - number of warnings
+    %t - total number of warnings and errors
+    %fe - line number of first error
+    %fw - line number of first warning
+    %F - line number of first warning or error
+
+Several additional flags are available to hide text under certain conditions:
+    %E{...} - hide the text in the brackets unless there are errors
+    %W{...} - hide the text in the brackets unless there are warnings
+    %B{...} - hide the text in the brackets unless there are both warnings AND
+              errors
+These flags cant be nested.
+
+Example: >
+    let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]'
+<
+If this format is used and the current buffer has 5 errors and 1 warning
+starting on lines 20 and 10 respectively then this would appear on the
+statusline: >
+    [Err: 20 #5, Warn: 10 #1]
+<
+If the buffer had 2 warnings, starting on line 5 then this would appear: >
+    [Warn: 5 #2]
+<
+
+
+==============================================================================
+5. Writing syntax checkers                         *syntastic-syntax-checkers*
+
+
+A syntax checker plugin is really nothing more than a single function.  You
+should define them in ~/.vim/syntax_checkers/<filetype>.vim, but this is
+purely for convenience; Syntastic doesn't actually care where these functions
+are defined.
+
+A syntax checker plugin must define a function of the form:
+>
+    SyntaxCheckers_<filetype>_GetLocList()
+<
+The output of this function must be of the same format as that returned by
+the |getloclist()| function. See |getloclist()| and |getqflist()| for
+details.
+
+To achieve this, the function should call |SyntasticMake()| or shell out to a
+syntax checker, parse the output and munge it into the format.
+
+There are several syntax checker plugins provided with this plugin. The ruby
+one is a good example of |SyntasticMake()|, while the haml one is a good
+example of how to create the data structure manually.
+
+
+SyntasticMake({options})                                     *SyntasticMake()*
+    {options} must be a dictionary. It can contain "makeprg" and "errorformat"
+    as keys (both optional).
+
+    SyntasticMake will run |:lmake| with the given |'makeprg'| and
+    |'errorformat'| (using the current settings if none are supplied). It will
+    store the resulting error list and use it to provide all of the
+    |syntastic-functionality|. The previous makeprg and errorformat settings
+    will then be restored, as well as the location list for the window.  From
+    the user's perspective, it will be as though |:lmake| was never run.
+
+    Note that the given "makeprg" and "errorformat" will be set using |:let-&|,
+    so you should not escape spaces.
+
+
+==============================================================================
+6. About                                                     *syntastic-about*
+
+The author of syntastic is a mighty wild stallion, hear him roar! >
+     _   _ _____ _____ ___ ___ ___ ____ _   _ _
+    | \ | | ____| ____|_ _|_ _|_ _/ ___| | | | |
+    |  \| |  _| |  _|  | | | | | | |  _| |_| | |
+    | |\  | |___| |___ | | | | | | |_| |  _  |_|
+    |_| \_|_____|_____|___|___|___\____|_| |_(_)
+
+<
+He likes to trot around in the back yard reading his emails and sipping a
+scolding hot cup of Earl Grey. Email him at martin.grenfell at gmail dot com.
+He can also be found trolling the #vim channel on the freenode IRC network as
+scrooloose.
+
+Bug reports, feedback, suggestions etc are welcomed.
+
+
+The latest official releases will be on vim.org at some point.
+
+The latest dev versions are on github
+    http://github.com/scrooloose/syntastic
+
+==============================================================================
+7. Changelog                                             *syntastic-changelog*
+
+2.3.0
+    - Add syntastic_loc_list_height option
+    - Allow errors to have a "subtype" that is signed differently to standard
+      errors. Currently geared towards differentiating style errors from
+      syntax errors. Currently implemented for phpcs (technosophos).
+    - New checkers for:
+        - yaml
+        - haxe (davidB)
+        - ocaml (edwintorok)
+        - pylint (parantapa)
+        - rust (cjab)
+
+    - Updates to existing checkers:
+        - jslint
+        - jshint (gillesruppert)
+        - fortran (bmattern)
+        - sass
+        - html (darcyparker)
+        - coffee (darcyparker)
+        - docbk (darcyparker)
+        - xml
+        - xslt
+        - less (irrationalfab)
+        - php (AD7six, technosophos)
+        - cuda
+        - python (mitchellh, pneff)
+        - perl (Anthony Carapetis)
+        - c (naoina, zsprackett)
+        - puppet (frimik)
+
+2.2.0
+    - only do syntax checks when files are saved (not when first opened) - add
+      g:syntastic_check_on_open option to get the old behavior back
+    - bug fix with echoing error messages; fixes incompatability with cmd-t (datanoise)
+    - dont allow warnings to mask errors when signing/echoing errors (ashikase)
+    - auto close location list when leaving buffer. (millermedeiros)
+    - update errors appropriately when :SyntasticToggleMode is called
+    - updates/fixes to existing checkers:
+        - javascript/jshint (millermedeiros)
+        - javascript/jslint
+        - c (kongo2002)
+    - Support for new filetypes:
+        - JSON (millermedeiros, tocer)
+        - rst (reStructuredText files) (JNRowe)
+        - gentoo-metadata (JNRowe)
+
+
+2.1.0
+    - when the cursor is on a line containing an error, echo the
+      error msg (kevinw)
+    - various bug fixes and refactoring
+    - updates/fixes to existing checkers:
+        - html (millermedeiros)
+        - erlang
+        - coffeescript
+        - javascript
+        - sh
+        - php (add support for phpcs - technosophos)
+    - add an applescript checker (Zhai Cai)
+    - add support for hyphenated filetypes (JNRowe)
+
+2.0.0
+    - Add support for highlighting the erroneous parts of lines (kstep)
+    - Add support for displaying errors via balloons (kstep)
+    - Add syntastic_mode_map option to give more control over when checking
+      should be done.
+    - Add :SyntasticCheck command to force a syntax check -  useful in passive
+      mode (justone).
+    - Add the option to automatically close the location list, but not
+      automatically open it (milkypostman)
+    - Add syntastic_auto_jump option to automatically jump to the first
+      error (milkypostman)
+    - Only source syntax checkers as needed - instead of loading all of them
+      when vim starts
+
+    - Support for new filetypes:
+        - less (julienXX)
+        - docbook (tpope)
+        - matlab (jasongraham)
+        - go (dtjm)
+        - puppet (uggedal, roman, zsprackett)
+        - haskell (baldo, roman)
+        - tcl (et)
+        - vala (kstep)
+        - cuda (temporaer)
+        - css (oryband, sitedyno)
+        - fortran (Karl Yngve Lervรฅg)
+        - xml (kusnier)
+        - xslt (kusnier)
+        - erlang (kTT)
+        - zpt (claytron)
+
+    - updates to existing checkers:
+        - javascript (mogren, bryanforbes, cjab, ajduncan)
+        - sass/scss (tmm1, atourino, dlee, epeli)
+        - ruby (changa)
+        - perl (harleypig)
+        - haml (bmihelac)
+        - php (kstep, docteurklein)
+        - python (kstep, soli)
+        - lua (kstep)
+        - html (kstep)
+        - xhtml (kstep)
+        - c (kongo2002, brandonw)
+        - cpp (kongo2002)
+        - coffee (industrial)
+        - eruby (sergevm)
+
+1.2.0
+    - New syntax checkers from github:kongo2002
+      - c (thanks also to github:jperras)
+      - cpp
+      - lua
+      - sh (thanks also to github:jmcantrell)
+    - add coffee syntax checked by github:lstoll
+    - add tex syntax checker
+    - make html checker play nicer with html5, thanks to github:enaeseth
+    - escape filenames properly when invoking syntax checkers, thanks to
+      github:jmcantrell
+    - adjust the ruby syntax checker to avoid some common annoying warnings,
+      thanks to github:robertwahler
+
+1.1.0 [codenamed: tpimp]
+    - Dont load rubygems for ruby/eruby syntax checkers. Thanks tpope.
+    - Improve the javascript syntax checker to catch some warnings that were
+      getting missed. Thanks tpope.
+    - Dont automatically focus the error window. Thanks tpope.
+    - Add support for cucumber [tpope], haskell & perl [Anthony Carapetis],
+      and xhtml
+    - Add commands to enable/disable syntax checking at runtime. See :help
+      syntastic-commands.
+    - Add an option to specifiy syntax checkers that should be disabled by
+      default. See :help syntastic_disabled_filetypes.
+    - Dont use :signs if vim wasnt compiled with support for them.
+)
+
+==============================================================================
+8. Credits                                                 *syntastic-credits*
+
+Thanks to the following people for testing, bug reports, patches etc. They own,
+hard.
+
+    Mikael Fridh (frimik)
+    Patrice Neff (pneff )
+    Gilles Ruppert (gillesruppert)
+    Naoya INADA (naoina)
+    Mitchell Hashimoto (mitchellh)
+    irrationalfab
+    Andy Dawson (AD7six)
+    Parantapa Bhattacharya (parantapa)
+    edwintorok
+    Darcy Parker (darcyparker)
+    bmattern
+    David Bernard (davidB)
+    Aleksey V. Zapparov (ixti)
+    Benji Fisher (benjifisher)
+    Lance Fetters (ashikase)
+    datanoise
+    Giuseppe Rota (grota)
+    tocer
+    James Rowe (JNRowe)
+    Zhai Cai
+    Matt Butcher (technosophos)
+    Kevin Watters (kevinw)
+    Miller Medeiros (millermedeiros)
+    Pawel Salata (kTT)
+    Fjรถlnir รsgeirsson (aptiva)
+    Clayton Parker (claytron)
+    S. Zachariah Sprackett (zsprackett)
+    Sylvain Soliman (soli)
+    Ricardo Catalinas Jimรฉnez (jimenezrick)
+    kusnier
+    Klein Florian (docteurklein)
+    sitedyno
+    Matthew Batema (mlb-)
+    Nate Jones (justone)
+    sergevm
+    Karl Yngve Lervรฅg
+    Pavel Argentov (argent-smith)
+    Andy Duncan (ajduncan)
+    Antonio Touriรฑo (atourino)
+    Chad Jablonski (cjab)
+    Roman Gonzalez (roman)
+    Tom Wieland (industrial)
+    Ory Band (oryband)
+    Esa-Matti Suuronen (epeli)
+    Brandon Waskiewicz (brandonw)
+    dlee
+    temporaer
+    Jason Graham (jasongraham)
+    Sam Nguyen (dtjm)
+    Claes Mogren (mogren)
+    Eivind Uggedal (uggedal)
+    kstep
+    Andreas Baldeau (baldo)
+    Eric Thomas (et)
+    Brian Donovan (eventualbuddha)
+    Bryan Forbes (bryanforbes)
+    Aman Gupta (tmm1)
+    Donald Ephraim Curtis (milkypostman)
+    Dominique Rose-Rosette (changa)
+    Harley Pig (harleypig)
+    bmihelac
+    Julien Blanchard (julienXX)
+    Gregor Uhlenheuer (kongo2002)
+    Lincoln Stoll
+    Tim Carey-Smith (halorgium)
+    Tim Pope (tpope)
+    Travis Jeffery
+    Anthony Carapetis
+
+
+==============================================================================
+9. License                                                 *syntastic-license*
+
+Syntastic is released under the wtfpl.
+See http://sam.zoy.org/wtfpl/COPYING.
diff --git a/vim/doc/tagbar.txt b/vim/doc/tagbar.txt
new file mode 100644 (file)
index 0000000..cb9a3e3
--- /dev/null
@@ -0,0 +1,1016 @@
+*tagbar.txt*   Display tags of a file in their correct scope
+
+Author:                Jan Larres <jan@majutsushi.net>
+Licence:       Vim licence, see |license|
+Homepage:      http://majutsushi.github.com/tagbar/
+Version:       2.3
+
+==============================================================================
+Contents                                       *tagbar* *tagbar-contents*
+
+        1. Intro ........................... |tagbar-intro|
+             Pseudo-tags ................... |tagbar-pseudotags|
+             Supported features ............ |tagbar-features|
+             Other ctags-compatible programs |tagbar-other|
+        2. Requirements .................... |tagbar-requirements|
+        3. Installation .................... |tagbar-installation|
+        4. Usage ........................... |tagbar-usage|
+             Commands ...................... |tagbar-commands|
+             Key mappings .................. |tagbar-keys|
+        5. Configuration ................... |tagbar-configuration|
+             Highlight colours ............. |tagbar-highlight|
+             Automatically opening Tagbar .. |tagbar-autoopen|
+        6. Extending Tagbar ................ |tagbar-extend|
+        7. Troubleshooting & Known issues .. |tagbar-issues|
+        8. History ......................... |tagbar-history|
+        9. Todo ............................ |tagbar-todo|
+       10. Credits ......................... |tagbar-credits|
+
+==============================================================================
+1. Intro                                               *tagbar-intro*
+
+Tagbar is a plugin for browsing the tags of source code files. It provides a
+sidebar that displays the ctags-generated tags of the current file, ordered by
+their scope. This means that for example methods in C++ are displayed under
+the class they are defined in.
+
+Let's say we have the following code inside of a C++ file:
+>
+    namespace {
+        char a;
+
+        class Foo
+        {
+        public:
+            Foo();
+            ~Foo();
+        private:
+            int var;
+        };
+    };
+<
+Then Tagbar would display the tag information like so:
+>
+    __anon1* : namespace
+      Foo : class
+       +Foo()
+       +~Foo()
+       -var
+      a
+<
+This example shows several important points. First, the tags are listed
+indented below the scope they are defined in. Second, the type of a scope is
+listed after its name and a colon. Third, tags for which the access/visibility
+information is known are prefixed with a symbol indicating that.
+
+------------------------------------------------------------------------------
+PSEUDO-TAGS                                            *tagbar-pseudotags*
+
+The example also introduces the concept of "pseudo-tags". Pseudo-tags are tags
+that are not explicitly defined in the file but have children in it. In this
+example the namespace doesn't have a name and thus ctags doesn't generate a
+tag for it, but since it has children it still needs to be displayed using an
+auto-generated name.
+
+Another case where pseudo-tags appear is in C++ implementation files. Since
+classes are usually defined in a header file but the member methods and
+variables in the implementation file the class itself won't generate a tag
+in that file.
+
+Since pseudo-tags don't really exist they cannot be jumped to from the Tagbar
+window.
+
+Pseudo-tags are denoted with an asterisk ('*') at the end of their name.
+
+------------------------------------------------------------------------------
+SUPPORTED FEATURES                                     *tagbar-features*
+
+The following features are supported by Tagbar:
+
+  - Display tags under their correct scope.
+  - Automatically update the tags when switching between buffers and editing
+    files.
+  - Display visibility information of tags if available.
+  - Highlight the tag near the cursor while editing files.
+  - Jump to a tag from the Tagbar window.
+  - Display the complete prototype of a tag.
+  - Tags can be sorted either by name or order of appearance in the file.
+  - Scopes can be folded to hide uninteresting information.
+  - Supports all of the languages that ctags does, i.e. Ant, Assembler, ASP,
+    Awk, Basic, BETA, C, C++, C#, COBOL, DosBatch, Eiffel, Erlang, Flex,
+    Fortran, HTML, Java, JavaScript, Lisp, Lua, Make, MatLab, OCaml, Pascal,
+    Perl, PHP, Python, REXX, Ruby, Scheme, Shell script, SLang, SML, SQL, Tcl,
+    Tex, Vera, Verilog, VHDL, Vim and YACC.
+  - Can be extended to support arbitrary new types.
+
+------------------------------------------------------------------------------
+OTHER CTAGS-COMPATIBLE PROGRAMS                                *tagbar-other*
+
+Tagbar theoretically also supports filetype-specific programs that can output
+tag information that is compatible with ctags. However due to potential
+incompatibilities this may not always completely work. Tagbar has been tested
+with doctorjs/jsctags and will use that if present, other programs require
+some configuration (see |tagbar-extend|). If a program does not work even with
+correct configuration please contact me.
+
+Note: Please check |tagbar-issues| for some possible issues with jsctags.
+
+==============================================================================
+2. Requirements                                                *tagbar-requirements*
+
+The following requirements have to be met in order to be able to use tagbar:
+
+  - Vim 7.0 or higher. Older versions will not work since Tagbar uses data
+    structures that were only introduced in Vim 7.
+  - Exuberant ctags 5.5 or higher. Ctags is the program that generates the
+    tag information that Tagbar uses. It is shipped with most Linux
+    distributions, otherwise it can be downloaded from the following
+    website:
+
+        http://ctags.sourceforge.net/
+
+    Tagbar will work on any platform that ctags runs on -- this includes
+    UNIX derivatives, Mac OS X and Windows. Note that other versions like
+    GNU ctags will not work.
+    Tagbar generates the tag information by itself and doesn't need (or use)
+    already existing tag files.
+  - File type detection must be turned on in vim. This can be done with the
+    following command in your vimrc:
+>
+        filetype on
+<
+    See |filetype| for more information.
+  - Tagbar will not work in |restricted-mode| or with 'compatible' set.
+
+==============================================================================
+3. Installation                                                *tagbar-installation*
+
+Use the normal Vimball install method for installing tagbar.vba:
+>
+       vim tagbar.vba
+       :so %
+       :q
+<
+Alternatively you can clone the git repository and then add the path to
+'runtimepath' or use the pathogen plugin. Don't forget to run |:helptags| if
+you're not using pathogen.
+
+If the ctags executable is not installed in one of the directories in your
+$PATH environment variable you have to set the g:tagbar_ctags_bin variable,
+see |g:tagbar_ctags_bin|.
+
+==============================================================================
+4. Usage                                               *tagbar-usage*
+
+There are essentially two ways to use Tagbar:
+
+  1. Have it running all the time in a window on the side of the screen. In
+     this case Tagbar will update its contents whenever the source file is
+     changed and highlight the tag the cursor is currently on in the file. If
+     a tag is selected in Tagbar the file window will jump to the tag and the
+     Tagbar window will stay open. |g:tagbar_autoclose| has to be unset for
+     this mode.
+  2. Only open Tagbar when you want to jump to a specific tag and have it
+     close automatically once you have selected one. This can be useful for
+     example for small screens where a permanent window would take up too much
+     space. You have to set the option |g:tagbar_autoclose| in this case. The
+     cursor will also automatically jump to the Tagbar window when opening it.
+
+Opening and closing the Tagbar window~
+Use |:TagbarOpen| or |:TagbarToggle| to open the Tagbar window if it is
+closed. By default the window is opened on the right side, set the option
+|g:tagbar_left| to open it on the left instead. If the window is already open,
+|:TagbarOpen| will jump to it and |:TagbarToggle| will close it again.
+|:TagbarClose| will simply close the window if it is open.
+
+It is probably a good idea to assign a key to these commands. For example, put
+this in your |vimrc|:
+>
+       nnoremap <silent> <F9> :TagbarToggle<CR>
+<
+You can then open and close Tagbar by simply pressing the <F9> key.
+
+You can also use |:TagbarOpenAutoClose| to open the Tagbar window, jump to it
+and have it close automatically on tag selection regardless of the
+|g:tagbar_autoclose| setting.
+
+Jumping to tags~
+When you're inside the Tagbar window you can jump to the definition of a tag
+by moving the cursor to a tag and pressing <Enter> or double-clicking on it
+with the mouse. The source file will then move to the definition and put the
+cursor in the corresponding line. This won't work for pseudo-tags.
+
+Sorting~
+You can sort the tags in the Tagbar window in two ways: by name or by file
+order. Sorting them by name simply displays the tags in their alphabetical
+order under their corresponding scope. Sorting by file order means that the
+tags keep the order they have in the source file, but are still associated
+with the correct scope. You can change the sort order by pressing the "s" key
+in the Tagbar window. The current sort order is displayed in the statusbar of
+the Tagbar window.
+
+Folding~
+The displayed scopes (and unscoped types) can be folded to hide uninteresting
+information. Mappings similar to Vim's built-in ones are provided. Folds can
+also be opened and closed by clicking on the fold icon with the mouse.
+
+Displaying the prototype of a tag~
+Tagbar can display the prototype of a tag. More precisely it can display the
+line in which the tag is defined. This can be done by either pressing <Space>
+when on a tag or hovering over a tag with the mouse. In the former case the
+prototype will be displayed in the command line |Command-line|, in the latter
+case it will be displayed in a pop-up window. The prototype will also be
+displayed when the cursor stays on a tag for 'updatetime' milliseconds.
+
+------------------------------------------------------------------------------
+COMMANDS                                               *tagbar-commands*
+
+:TagbarOpen [{flags}]
+    Open the Tagbar window if it is closed.
+
+    Additional behaviour can be specified with the optional {flags} argument.
+    It is a string which can contain these character flags:
+    'f'   Jump to Tagbar window when opening (just as if |g:tagbar_autofocus|
+          were set to 1)
+    'j'   Jump to Tagbar window if already open
+    'c'   Close Tagbar on tag selection (just as if |g:tagbar_autoclose| were
+          set to 1, but doesn't imply 'f')
+
+    For example, the following command would always jump to the Tagbar window,
+    opening it first if necessary, but keep it open after selecting a tag
+    (unless |g:tagbar_autoclose| is set): >
+        :TagbarOpen fj
+<
+:TagbarClose
+    Close the Tagbar window if it is open.
+
+:TagbarToggle
+    Open the Tagbar window if it is closed or close it if it is open.
+
+:TagbarOpenAutoClose
+    Open the Tagbar window, jump to it and close it on tag selection. This is
+    an alias for ":TagbarOpen fc".
+
+:TagbarSetFoldlevel {number}
+    Set the foldlevel of the tags of the current file to {number}. The
+    foldlevel of tags in other files remains unaffected. Works in the same way
+    as 'foldlevel'.
+
+:TagbarShowTag
+    Open the parent folds of the current tag in the file window as much as
+    needed for the tag to be visible in the Tagbar window.
+
+:TagbarDebug [logfile]
+    Start debug mode. This will write debug messages to file [logfile] while
+    using Tagbar. If no argument is given "tagbardebug.log" in the current
+    directory is used. Note: an existing file will be overwritten!
+
+:TagbarDebugEnd
+    End debug mode, debug messages will no longer be written to the logfile.
+
+------------------------------------------------------------------------------
+KEY MAPPINGS                                           *tagbar-keys*
+
+The following mappings are valid in the Tagbar window:
+
+<F1>          Display key mapping help.
+<CR>/<Enter>  Jump to the tag under the cursor. Doesn't work for pseudo-tags
+              or generic headers.
+p             Jump to the tag under the cursor, but stay in the Tagbar window.
+<LeftMouse>   When on a fold icon, open or close the fold depending on the
+              current state.
+<2-LeftMouse> Same as <CR>. See |g:tagbar_singleclick| if you want to use a
+              single- instead of a double-click.
+<Space>       Display the prototype of the current tag (i.e. the line defining
+              it) in the command line.
++/zo          Open the fold under the cursor.
+-/zc          Close the fold under the cursor or the current one if there is
+              no fold under the cursor.
+o/za          Toggle the fold under the cursor or the current one if there is
+              no fold under the cursor.
+*/zR          Open all folds by setting foldlevel to 99.
+=/zM          Close all folds by setting foldlevel to 0.
+<C-N>         Go to the next top-level tag.
+<C-P>         Go to the previous top-level tag.
+s             Toggle sort order between name and file order.
+x             Toggle zooming the window.
+q             Close the Tagbar window.
+
+==============================================================================
+5. Configuration                                       *tagbar-configuration*
+
+                                                       *g:tagbar_ctags_bin*
+g:tagbar_ctags_bin~
+Default: empty
+
+Use this option to specify the location of your ctags executable. Only needed
+if it is not in one of the directories in your $PATH environment variable.
+
+Example:
+>
+       let g:tagbar_ctags_bin = 'C:\Ctags5.8\ctags.exe'
+<
+
+                                                       *g:tagbar_left*
+g:tagbar_left~
+Default: 0
+
+By default the Tagbar window will be opened on the right-hand side of vim. Set
+this option to open it on the left instead.
+
+Example:
+>
+       let g:tagbar_left = 1
+<
+
+                                                       *g:tagbar_width*
+g:tagbar_width~
+Default: 40
+
+Width of the Tagbar window in characters.
+
+Example:
+>
+       let g:tagbar_width = 30
+<
+
+                                                       *g:tagbar_autoclose*
+g:tagbar_autoclose~
+Default: 0
+
+If you set this option the Tagbar window will automatically close when you
+jump to a tag. This implies |g:tagbar_autofocus|.
+
+Example:
+>
+       let g:tagbar_autoclose = 1
+<
+
+                                                       *g:tagbar_autofocus*
+g:tagbar_autofocus~
+Default: 0
+
+If you set this option the cursor will move to the Tagbar window when it is
+opened.
+
+Example:
+>
+       let g:tagbar_autofocus = 1
+<
+
+                                                       *g:tagbar_sort*
+g:tagbar_sort~
+Default: 1
+
+If this option is set the tags are sorted according to their name. If it is
+unset they are sorted according to their order in the source file. Note that
+in the second case Pseudo-tags are always sorted before normal tags of the
+same kind since they don't have a real position in the file.
+
+Example:
+>
+       let g:tagbar_sort = 0
+<
+
+                                                       *g:tagbar_compact*
+g:tagbar_compact~
+Default: 0
+
+Setting this option will result in Tagbar omitting the short help at the
+top of the window and the blank lines in between top-level scopes in order to
+save screen real estate.
+
+Example:
+>
+       let g:tagbar_compact = 1
+<
+
+                                                       *g:tagbar_expand*
+g:tagbar_expand~
+Default: 0
+
+If this option is set the Vim window will be expanded by the width of the
+Tagbar window if using a GUI version of Vim.
+
+Example:
+>
+       let g:tagbar_expand = 1
+<
+
+                                                       *g:tagbar_singleclick*
+g:tagbar_singleclick~
+Default: 0
+
+If this option is set then a single- instead of a double-click is used to jump
+to the tag definition.
+
+Example:
+>
+       let g:tagbar_singleclick = 1
+<
+
+                                                       *g:tagbar_foldlevel*
+g:tagbar_foldlevel~
+Default: 99
+
+The initial foldlevel for folds in the Tagbar window. Fold with a level higher
+than this number will be closed.
+
+Example:
+>
+       let g:tagbar_foldlevel = 2
+<
+
+                                                       *g:tagbar_iconchars*
+g:tagbar_iconchars~
+
+Since the display of the icons used to indicate open or closed folds depends
+on the actual font used, different characters may be optimal for different
+fonts. With this variable you can set the icons to characters of your liking.
+The first character in the list specifies the icon to use for a closed fold,
+and the second one for an open fold.
+
+Examples (don't worry if some the characters aren't displayed correctly, just
+choose other characters in that case):
+>
+       let g:tagbar_iconchars = ['โ–ถ', 'โ–ผ']  (default on Linux and Mac OS X)
+       let g:tagbar_iconchars = ['โ–พ', 'โ–ธ']
+       let g:tagbar_iconchars = ['โ–ท', 'โ—ข']
+       let g:tagbar_iconchars = ['+', '-']  (default on Windows)
+<
+
+                                                       *g:tagbar_autoshowtag*
+g:tagbar_autoshowtag~
+Default: 0
+
+If this variable is set and the current tag is inside of a closed fold then
+the folds will be opened as much as needed for the tag to be visible so it can
+be highlighted. If it is not set then the folds won't be opened and the parent
+tag will be highlighted instead. You can use the TagbarShowTag command to open
+the folds manually.
+
+Example:
+>
+       let g:tagbar_autoshowtag = 1
+<
+
+                                               *g:tagbar_updateonsave_maxlines*
+g:tagbar_updateonsave_maxlines~
+Default: 5000
+
+If the current file has fewer lines than the value of this variable, Tagbar
+will update immediately after saving the file. If it is longer then the update
+will only happen on the |CursorHold| event and when switching buffers (or
+windows). This is to prevent the time it takes to save a large file from
+becoming annoying in case you have a slow computer. If you have a fast
+computer you can set it to a higher value.
+
+Example:
+>
+       let g:tagbar_updateonsave_maxlines = 10000
+<
+
+                                                       *g:tagbar_systemenc*
+g:tagbar_systemenc~
+Default: value of 'encoding'
+
+This variable is for cases where the character encoding of your operating
+system is different from the one set in Vim, i.e. the 'encoding' option. For
+example, if you use a Simplified Chinese Windows version that has a system
+encoding of "cp936", and you have set 'encoding' to "utf-8", then you would
+have to set this variable to "cp936".
+
+Example:
+>
+       let g:tagbar_systemenc = 'cp936'
+<
+
+------------------------------------------------------------------------------
+HIGHLIGHT COLOURS                                      *tagbar-highlight*
+
+All of the colours used by Tagbar can be customized. Here is a list of the
+highlight groups that are defined by Tagbar:
+
+TagbarComment
+    The help at the top of the buffer.
+
+TagbarKind
+    The header of generic "kinds" like "functions" and "variables".
+
+TagbarNestedKind
+    The "kind" headers in square brackets inside of scopes.
+
+TagbarScope
+    Tags that define a scope like classes, structs etc.
+
+TagbarType
+    The type of a tag or scope if available.
+
+TagbarSignature
+    Function signatures.
+
+TagbarPseudoID
+    The asterisk (*) that signifies a pseudo-tag.
+
+TagbarFoldIcon
+    The fold icon on the left of foldable tags.
+
+TagbarHighlight
+    The colour that is used for automatically highlighting the current tag.
+
+TagbarAccessPublic
+    The "public" visibility/access symbol.
+
+TagbarAccessProtected
+    The "protected" visibility/access symbol.
+
+TagbarAccessPrivate
+    The "private" visibility/access symbol.
+
+If you want to change any of those colours put a line like the following in
+your vimrc:
+>
+       highlight TagbarScope guifg=Green ctermfg=Green
+<
+See |:highlight| for more information.
+
+------------------------------------------------------------------------------
+AUTOMATICALLY OPENING TAGBAR                           *tagbar-autoopen*
+
+Since there are several different situations in which you might want to open
+Tagbar automatically there is no single option to enable automatic opening.
+Instead, autocommands can be used together with a convenience function that
+opens Tagbar only if a supported file is open(ed).
+
+If you want to open Tagbar automatically on Vim startup no matter what put
+this into your vimrc:
+>
+    autocmd VimEnter * nested :TagbarOpen
+<
+If you want to open it only if you're opening Vim with a supported file/files
+use this instead:
+>
+    autocmd VimEnter * nested :call tagbar#autoopen()
+<
+For opening Tagbar also if you open a supported file in an already running
+Vim:
+>
+    autocmd FileType * nested :call tagbar#autoopen()
+<
+And if you only want to open Tagbar only for specific filetypes, not for all
+of the supported ones:
+>
+    autocmd FileType c,cpp nested :TagbarOpen
+<
+Check out |autocmd.txt| if you want it to open automatically in more
+complicated cases.
+
+==============================================================================
+6. Extending Tagbar                                    *tagbar-extend*
+
+Tagbar has a flexible mechanism for extending the existing file type (i.e.
+language) definitions. This can be used both to change the settings of the
+existing types and to add completely new types. A complete configuration
+consists of a type definition for Tagbar in your |vimrc| and optionally a
+language definition for ctags in case you want to add a new language.
+
+Before writing your own extension have a look at the wiki
+(https://github.com/majutsushi/tagbar/wiki/Support-for-additional-filetypes)
+or try googling for existing ones. If you do end up creating your own
+extension please consider adding it to the wiki so that others will be able to
+use it, too.
+
+Every type definition in Tagbar is a dictionary with the following keys:
+
+ctagstype:  The name of the language as recognized by ctags. Use the command >
+                ctags --list-languages
+<           to get a list of the languages ctags supports. The case doesn't
+            matter.
+kinds:      A list of the "language kinds" that should be listed in Tagbar,
+            ordered by the order they should appear in in the Tagbar window.
+            Use the command >
+                ctags --list-kinds={language name}
+<           to get a list of the kinds ctags supports for a given language. An
+            entry in this list is a string with two or three parts separated
+            by a colon: the first part is the one-character abbreviation that
+            ctags uses, and the second part is an arbitrary string that will
+            be used in Tagbar as the header for the tags of this kind that are
+            not listed under a specific scope. The optional third part
+            determines whether tags of this kind should be folded by default,
+            with 1 meaning they should be folded and 0 they should not. If
+            this part is omitted the tags will not be folded by default. For
+            example, the string >
+                "f:functions:1"
+<           would list all the function definitions in a file under the header
+            "functions" and fold them.
+sro:        The scope resolution operator. For example, in C++ it is "::" and
+            in Java it is ".". If in doubt run ctags as shown below and check
+            the output.
+kind2scope: A dictionary describing the mapping of tag kinds (in their
+            one-character representation) to the scopes their children will
+            appear in, for example classes, structs etc.
+            Unfortunately there is no ctags option to list the scopes, you
+            have to look at the tags ctags generates manually. For example,
+            let's say we have a C++ file "test.cpp" with the following
+            contents: >
+                class Foo
+                {
+                public:
+                    Foo();
+                    ~Foo();
+                private:
+                    int var;
+                };
+<           We then run ctags in the following way: >
+                ctags -f - --format=2 --excmd=pattern --extra= --fields=nksaSmt test.cpp
+<           Then the output for the variable "var" would look like this: >
+                var    tmp.cpp /^    int var;$/;"      kind:m  line:11 class:Foo       access:private
+<           This shows that the scope name for an entry in a C++ class is
+            simply "class". So this would be the word that the "kind"
+            character of a class has to be mapped to.
+scope2kind: The opposite of the above, mapping scopes to the kinds of their
+            parents. Most of the time it is the exact inverse of the above,
+            but in some cases it can be different, for example when more than
+            one kind maps to the same scope. If it is the exact inverse for
+            your language you only need to specify one of the two keys.
+replace:    If you set this entry to 1 your definition will completely replace
+{optional}  an existing default definition. This is useful if you want to
+            disable scopes for a file type for some reason. Note that in this
+            case you have to provide all the needed entries yourself!
+sort:       This entry can be used to override the global sort setting for
+{optional}  this specific file type. The meaning of the value is the same as
+            with the global setting, that is if you want to sort tags by name
+            set it to 1 and if you want to sort them according to their order
+            in the file set it to 0.
+deffile:    The path to a file with additional ctags definitions (see the
+{optional}  section below on adding a new definition for what exactly that
+            means). This is especially useful for ftplugins since they can
+            provide a complete type definition with ctags and Tagbar
+            configurations without requiring user intervention.
+            Let's say you have an ftplugin that adds support for the language
+            "mylang", and your directory structure looks like this: >
+                ctags/mylang.cnf
+                ftplugin/mylang.vim
+<           Then the "deffile" entry would look like this to allow for the
+            plugin to be installed in an arbitray location (for example
+            with pathogen): >
+
+                'deffile' : expand('<sfile>:p:h:h') . '/ctags/mylang.cnf'
+<
+ctagsbin:  The path to a filetype-specific ctags-compatible program like
+{optional} jsctags. Set it in the same way as |g:tagbar_ctags_bin|. jsctags is
+           used automatically if found in your $PATH and does not have to be
+           set in that case. If it is not in your path you have to set this
+           key, the rest of the configuration should not be necessary (unless
+           you want to change something, of course).
+ctagsargs: The arguments to be passed to the filetype-specific ctags program
+{optional} (without the filename). Make sure you set an option that makes the
+           program output its data on stdout. Not used for the normal ctags
+           program.
+
+
+You then have to assign this dictionary to a variable in your vimrc with the
+name
+>
+       g:tagbar_type_{vim filetype}
+<
+For example, for C++ the name would be "g:tagbar_type_cpp". If you don't know
+the vim file type then run the following command:
+>
+       :set filetype?
+<
+and vim will display the file type of the current buffer.
+
+Example: C++~
+Here is a complete example that shows the default configuration for C++ as
+used in Tagbar. This is just for illustration purposes since user
+configurations will usually be less complicated.
+>
+       let g:tagbar_type_cpp = {
+           \ 'ctagstype' : 'c++',
+           \ 'kinds'     : [
+               \ 'd:macros:1',
+               \ 'p:prototypes:1',
+               \ 'g:enums',
+               \ 'e:enumerators',
+               \ 't:typedefs',
+               \ 'n:namespaces',
+               \ 'c:classes',
+               \ 's:structs',
+               \ 'u:unions',
+               \ 'f:functions',
+               \ 'm:members',
+               \ 'v:variables'
+           \ ],
+           \ 'sro'        : '::',
+           \ 'kind2scope' : {
+               \ 'g' : 'enum',
+               \ 'n' : 'namespace',
+               \ 'c' : 'class',
+               \ 's' : 'struct',
+               \ 'u' : 'union'
+           \ },
+           \ 'scope2kind' : {
+               \ 'enum'      : 'g',
+               \ 'namespace' : 'n',
+               \ 'class'     : 'c',
+               \ 'struct'    : 's',
+               \ 'union'     : 'u'
+           \ }
+       \ }
+<
+
+Which of the keys you have to specify depends on what you want to do.
+
+Changing an existing definition~
+If you want to change an existing definition you only need to specify the
+parts that you want to change. It probably only makes sense to change "kinds"
+and/or "scopes", which would be the case if you wanted to exclude certain
+kinds from appearing in Tagbar or if you want to change their order. As an
+example, if you didn't want Tagbar to show prototypes for C++ files and switch
+the order of enums and typedefs, you would do it like this:
+>
+       let g:tagbar_type_cpp = {
+           \ 'kinds' : [
+               \ 'd:macros:1',
+               \ 'g:enums',
+               \ 't:typedefs',
+               \ 'e:enumerators',
+               \ 'n:namespaces',
+               \ 'c:classes',
+               \ 's:structs',
+               \ 'u:unions',
+               \ 'f:functions',
+               \ 'm:members',
+               \ 'v:variables'
+           \ ]
+       \ }
+<
+Compare with the complete example above to see the difference.
+
+Adding a definition for a new language/file type~
+In order to be able to add a new language to Tagbar you first have to create a
+configuration for ctags that it can use to parse the files. This can be done
+in two ways:
+
+  1. Use the --regex argument for specifying regular expressions that are used
+     to parse the files. An example of this is given below. A disadvantage of
+     this approach is that you can't specify scopes.
+  2. Write a parser plugin in C for ctags. This approach is much more powerful
+     than the regex approach since you can make use of all of ctags'
+     functionality but it also requires much more work. Read the ctags
+     documentation for more information about how to do this.
+
+For the first approach the only keys that are needed in the Tagbar definition
+are "ctagstype" and "kinds". A definition that supports scopes has to define
+those two and in addition "scopes", "sro" and at least one of "kind2scope" and
+"scope2kind".
+
+Let's assume we want to add support for LaTeX to Tagbar using the regex
+approach. First we put the following text into ~/.ctags or a file pointed to
+by the "deffile" definition entry:
+>
+       --langdef=latex
+       --langmap=latex:.tex
+       --regex-latex=/^\\tableofcontents/TABLE OF CONTENTS/s,toc/
+       --regex-latex=/^\\frontmatter/FRONTMATTER/s,frontmatter/
+       --regex-latex=/^\\mainmatter/MAINMATTER/s,mainmatter/
+       --regex-latex=/^\\backmatter/BACKMATTER/s,backmatter/
+       --regex-latex=/^\\bibliography\{/BIBLIOGRAPHY/s,bibliography/
+       --regex-latex=/^\\part[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/PART \2/s,part/
+       --regex-latex=/^\\part[[:space:]]*\*[[:space:]]*\{([^}]+)\}/PART \1/s,part/
+       --regex-latex=/^\\chapter[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/CHAP \2/s,chapter/
+       --regex-latex=/^\\chapter[[:space:]]*\*[[:space:]]*\{([^}]+)\}/CHAP \1/s,chapter/
+       --regex-latex=/^\\section[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\. \2/s,section/
+       --regex-latex=/^\\section[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\. \1/s,section/
+       --regex-latex=/^\\subsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\. \2/s,subsection/
+       --regex-latex=/^\\subsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\. \1/s,subsection/
+       --regex-latex=/^\\subsubsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\.\. \2/s,subsubsection/
+       --regex-latex=/^\\subsubsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\.\. \1/s,subsubsection/
+       --regex-latex=/^\\includegraphics[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/g,graphic+listing/
+       --regex-latex=/^\\lstinputlisting[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/g,graphic+listing/
+       --regex-latex=/\\label[[:space:]]*\{([^}]+)\}/\1/l,label/
+       --regex-latex=/\\ref[[:space:]]*\{([^}]+)\}/\1/r,ref/
+       --regex-latex=/\\pageref[[:space:]]*\{([^}]+)\}/\1/p,pageref/
+<
+This will create a new language definition with the name "latex" and associate
+it with files with the extension ".tex". It will also define the kinds "s" for
+sections, chapters and the like, "g" for included graphics, "l" for labels,
+"r" for references and "p" for page references. See the ctags documentation
+for more information about the exact syntax.
+
+Now we have to create the Tagbar language definition in our vimrc:
+>
+       let g:tagbar_type_tex = {
+           \ 'ctagstype' : 'latex',
+           \ 'kinds'     : [
+               \ 's:sections',
+               \ 'g:graphics',
+               \ 'l:labels',
+               \ 'r:refs:1',
+               \ 'p:pagerefs:1'
+           \ ],
+           \ 'sort'    : 0,
+           \ 'deffile' : expand('<sfile>:p:h:h') . '/ctags/latex.cnf'
+       \ }
+<
+The "deffile" field is of course only needed if the ctags definition actually
+is in that file and not in ~/.ctags.
+
+Sort has been disabled for LaTeX so that the sections appear in their correct
+order. They unfortunately can't be shown nested with their correct scopes
+since as already mentioned the regular expression approach doesn't support
+that.
+
+Tagbar should now be able to show the sections and other tags from LaTeX
+files.
+
+==============================================================================
+7. Troubleshooting & Known issues                      *tagbar-issues*
+
+As a general rule, if the tag information displayed by Tagbar is wrong (for
+example, a method doesn't show up or is in the wrong place) you should first
+try running ctags manually to see whether ctags reports the wrong information
+or whether that information is correct and Tagbar does something wrong. To run
+ctags manually execute the following command in a terminal:
+>
+       ctags -f - --format=2 --excmd=pattern --extra= --fields=nksaSmt myfile
+<
+If you set the |g:tagbar_ctags_bin| variable you probably have to use the same
+value here instead of simply "ctags".
+
+If Tagbar doesn't seem to work at all, but you don't get any error messages,
+you can use Tagbar's debug mode to try to find the source of the problem (see
+|tagbar-commands| on how to invoke it). In that case you should especially pay
+attention to the reported file type and the ctags command line in the log
+file.
+
+
+  - jsctags has to be newer than 2011-01-06 since it needs the "-f" option to
+    work. Also, the output of jsctags seems to be a bit unreliable at the
+    moment (especially regarding line numbers), so if you notice some strange
+    behaviour with it please run it manually in a terminal to check whether
+    the bug is in jsctags or Tagbar.
+
+  - Nested pseudo-tags cannot be properly parsed since only the direct parent
+    scope of a tag gets assigned a type, the type of the grandparents is not
+    reported by ctags (assuming the grandparents don't have direct, real
+    children).
+
+    For example, if we have a C++ file with the following content:
+>
+        foo::Bar::init()
+        {
+            // ...
+        }
+        foo::Baz::method()
+        {
+            // ...
+        }
+<
+    In this case the type of "foo" is not known. Is it a namespace? A class?
+    For this reason the methods are displayed in Tagbar like this:
+>
+        foo::Bar* : class
+          init()
+        foo::Baz* : class
+          method()
+<
+  - Scope-defining tags at the top level that have the same name but a
+    different kind/scope type can lead to an incorrect display. For example,
+    the following Python code will incorrectly insert a pseudo-tag "Inner2"
+    into the "test" class:
+>
+        class test:
+            class Inner:
+                def foo(self):
+                    pass
+
+        def test():
+            class Inner2:
+                def bar(self):
+                    pass
+<
+    I haven't found a clean way around this yet, but it shouldn't be much of a
+    problem in practice anyway. Tags with the same name at any other level are
+    no problem, though.
+
+==============================================================================
+8. History                                             *tagbar-history*
+
+2.3 (2011-12-24)
+    - Add a convenience function that allows more flexible ways to
+      automatically open Tagbar.
+    - Replace option tagbar_usearrows with tagbar_iconchars to allow custom
+      characters to be specified. This helps with fonts that don't display the
+      default characters properly.
+    - Remove the need to provide the complete jsctags configuration if jsctags
+      is not found in $PATH, now only the concrete path has to be specified.
+    - Add debugging functionality.
+
+2.2 (2011-11-26)
+    - Small incompatible change: TagbarOpen now doesn't jump to the Tagbar
+      window anymore if it is already open. Use "TagbarOpen j" instead or see
+      its documentation for more options.
+    - Tags inside of scopes now have a header displaying their "kind".
+    - The Tagbar contents are now immediately updated on save for files
+      smaller than a configurable size.
+    - Tagbar can now be configured to jump to a tag with only a single-click
+      instead of a double-click.
+    - Most of the script has been moved to the |autoload| directory, so Vim
+      startup should be faster (thanks to Kien N).
+    - Jumping to tags should work most of the time even if the file has been
+      modified and not saved.
+    - If Ctags has been installed into the default location using Homebrew or
+      MacPorts it should now be found automatically.
+    - Several bugfixes.
+
+2.1 (2011-05-29)
+    - Make Tagbar work in (hopefully) all cases under Windows
+    - Handle cases where 'encoding' is different from system encoding, for
+      example on a Chinese Windows with 'encoding' set to "utf-8" (see manual
+      for details in case it doesn't work out-of-the-box)
+    - Fixed a bug with the handling of subtypes like "python.django"
+    - If a session got saved with Tagbar open it now gets restored properly
+    - Locally reset foldmethod/foldexpr in case foldexpr got set to something
+      expensive globally
+    - Tagbar now tries hard to go to the correct window when jumping to a tag
+    - Explain some possible issues with the current jsctags version in the
+      manual
+    - Explicitly check for some possible configuration problems to be able to
+      give better feedback
+    - A few other small fixes
+
+2.0.1 (2011-04-26)
+    - Fix sorting bug when 'ignorecase' is set
+
+2.0 (2011-04-26)
+    - Folding now works correctly. Folds will be preserved when leaving the
+      Tagbar window and when switching between files. Also tag types can be
+      configured to be folded by default, which is useful for things like
+      includes and imports.
+    - DoctorJS/jsctags and other compatible programs are now supported.
+    - All of the highlight groups can now be overridden.
+    - Added keybinding to quickly jump to next/previous top-level tag.
+    - Added Taglist's "p" keybinding for jumping to a tag without leaving the
+      Tagbar window.
+    - Several bugfixes and other small improvements.
+
+1.5 (2011-03-06)
+    - Type definitions can now include a path to a file with the ctags
+      definition. This is especially useful for ftplugins that can now ship
+      with a complete ctags and Tagbar configuration without requiring user
+      intervention. Thanks to Jan Christoph Ebersbach for the suggestion.
+    - Added autofocus setting by Taybin Rutkin. This will put the cursor in
+      the Tagbar window when it is opened.
+    - The "scopes" field is no longer needed in type definitions, the
+      information is already there in "scope2kind". Existing definitions will
+      be ignored.
+    - Some fixes and improvements related to redrawing and window switching.
+
+1.2 (2011-02-28)
+    - Fix typo in Ruby definition
+
+1.1 (2011-02-26)
+    - Don't lose syntax highlighting when ':syntax enable' is called
+    - Allow expanding the Vim window when Tagbar is opened
+
+1.0 (2011-02-23)
+    - Initial release
+
+==============================================================================
+9. Todo                                                        *tagbar-todo*
+
+  - Allow filtering the Tagbar content by some criteria like tag name,
+    visibility, kind ...
+  - Integrate Tagbar with the FSwitch plugin to provide header file
+    information in C/C++.
+  - Allow jumping to a tag in the preview window, a split window or a new tab.
+
+==============================================================================
+10. Credits                                            *tagbar-credits*
+
+Tagbar was written by Jan Larres and is released under the Vim licence, see
+|license|. It was heavily inspired by the Taglist plugin by Yegappan
+Lakshmanan and uses a small amount of code from it.
+
+Original taglist copyright notice:
+Permission is hereby granted to use and distribute this code, with or without
+modifications, provided that this copyright notice is copied with it. Like
+anything else that's free, taglist.vim is provided *as is* and comes with no
+warranty of any kind, either expressed or implied. In no event will the
+copyright holder be liable for any damamges resulting from the use of this
+software.
+
+The folding technique was inspired by NERDTree by Martin Grenfell.
+
+Thanks to the following people for code contributions, feature suggestions etc:
+Jan Christoph Ebersbach
+Leandro Freitas
+Seth Milliken
+Kien N
+pielgrzym
+Taybin Rutkin
+
+==============================================================================
+ vim: tw=78 ts=8 sw=8 sts=8 noet ft=help
diff --git a/vim/doc/taglist.txt b/vim/doc/taglist.txt
new file mode 100644 (file)
index 0000000..6a62b39
--- /dev/null
@@ -0,0 +1,1501 @@
+*taglist.txt*  Plugin for browsing source code
+
+Author: Yegappan Lakshmanan  (yegappan AT yahoo DOT com)
+For Vim version 6.0 and above
+Last change: 2007 May 24
+
+1. Overview                                    |taglist-intro|
+2. Taglist on the internet                     |taglist-internet|
+3. Requirements                                        |taglist-requirements|
+4. Installation                                |taglist-install|
+5. Usage                                       |taglist-using|
+6. Options                                     |taglist-options|
+7. Commands                                    |taglist-commands|
+8. Global functions                            |taglist-functions|
+9. Extending                                   |taglist-extend|
+10. FAQ                                        |taglist-faq|
+11. License                                    |taglist-license|
+12. Todo                                       |taglist-todo|
+
+==============================================================================
+                                               *taglist-intro*
+1. Overview~
+
+The "Tag List" plugin is a source code browser plugin for Vim. This plugin
+allows you to efficiently browse through source code files for different
+programming languages. The "Tag List" plugin provides the following features:
+
+    * Displays the tags (functions, classes, structures, variables, etc.) 
+      defined in a file in a vertically or horizontally split Vim window.
+    * In GUI Vim, optionally displays the tags in the Tags drop-down menu and
+      in the popup menu.
+    * Automatically updates the taglist window as you switch between
+      files/buffers. As you open new files, the tags defined in the new files
+      are added to the existing file list and the tags defined in all the
+      files are displayed grouped by the filename.
+    * When a tag name is selected from the taglist window, positions the
+      cursor at the definition of the tag in the source file.
+    * Automatically highlights the current tag name.
+    * Groups the tags by their type and displays them in a foldable tree.
+    * Can display the prototype and scope of a tag.
+    * Can optionally display the tag prototype instead of the tag name in the
+      taglist window.
+    * The tag list can be sorted either by name or by chronological order.
+    * Supports the following language files: Assembly, ASP, Awk, Beta, C,
+      C++, C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp,
+      Lua, Make, Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang,
+      SML, Sql, TCL, Verilog, Vim and Yacc.
+    * Can be easily extended to support new languages. Support for
+      existing languages can be modified easily.
+    * Provides functions to display the current tag name in the Vim status
+      line or the window title bar.
+    * The list of tags and files in the taglist can be saved and
+      restored across Vim sessions.
+    * Provides commands to get the name and prototype of the current tag.
+    * Runs in both console/terminal and GUI versions of Vim.
+    * Works with the winmanager plugin. Using the winmanager plugin, you
+      can use Vim plugins like the file explorer, buffer explorer and the
+      taglist plugin at the same time like an IDE.
+    * Can be used in both Unix and MS-Windows systems.
+
+==============================================================================
+                                               *taglist-internet*
+2. Taglist on the internet~
+
+The home page of the taglist plugin is at:
+>
+       http://vim-taglist.sourceforge.net/
+<
+You can subscribe to the taglist mailing list to post your questions or
+suggestions for improvement or to send bug reports. Visit the following page
+for subscribing to the mailing list:
+>
+       http://groups.yahoo.com/group/taglist
+<
+==============================================================================
+                                               *taglist-requirements*
+3. Requirements~
+
+The taglist plugin requires the following:
+
+    * Vim version 6.0 and above
+    * Exuberant ctags 5.0 and above
+
+The taglist plugin will work on all the platforms where the exuberant ctags
+utility and Vim are supported (this includes MS-Windows and Unix based
+systems).
+
+The taglist plugin relies on the exuberant ctags utility to dynamically
+generate the tag listing.  The exuberant ctags utility must be installed in
+your system to use this plugin.  The exuberant ctags utility is shipped with
+most of the Linux distributions.  You can download the exuberant ctags utility
+from
+>
+       http://ctags.sourceforge.net
+<
+The taglist plugin doesn't use or create a tags file and there is no need to
+create a tags file to use this plugin. The taglist plugin will not work with
+the GNU ctags or the Unix ctags utility.
+
+This plugin relies on the Vim "filetype" detection mechanism to determine the
+type of the current file. You have to turn on the Vim filetype detection by
+adding the following line to your .vimrc file:
+>
+       filetype on
+<
+The taglist plugin will not work if you run Vim in the restricted mode (using
+the -Z command-line argument).
+
+The taglist plugin uses the Vim system() function to invoke the exuberant
+ctags utility. If Vim is compiled without the system() function then you
+cannot use the taglist plugin. Some of the Linux distributions (Suse) compile
+Vim without the system() function for security reasons.
+
+==============================================================================
+                                               *taglist-install*
+4. Installation~
+
+1. Download the taglist.zip file and unzip the files to the $HOME/.vim or the
+   $HOME/vimfiles or the $VIM/vimfiles directory. After this step, you should
+   have the following two files (the directory structure should be preserved):
+
+       plugin/taglist.vim - main taglist plugin file
+       doc/taglist.txt    - documentation (help) file
+
+   Refer to the |add-plugin|and |'runtimepath'| Vim help pages for more
+   details about installing Vim plugins.
+2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or $VIM/vimfiles/doc
+   directory, start Vim and run the ":helptags ." command to process the
+   taglist help file. Without this step, you cannot jump to the taglist help
+   topics.
+3. If the exuberant ctags utility is not present in one of the directories in
+   the PATH environment variable, then set the 'Tlist_Ctags_Cmd' variable to
+   point to the location of the exuberant ctags utility (not to the directory)
+   in the .vimrc file.
+4. If you are running a terminal/console version of Vim and the terminal
+   doesn't support changing the window width then set the
+   'Tlist_Inc_Winwidth' variable to 0 in the .vimrc file.
+5. Restart Vim.
+6. You can now use the ":TlistToggle" command to open/close the taglist
+   window. You can use the ":help taglist" command to get more information
+   about using the taglist plugin.
+
+To uninstall the taglist plugin, remove the plugin/taglist.vim and
+doc/taglist.txt files from the $HOME/.vim or $HOME/vimfiles directory.
+
+==============================================================================
+                                               *taglist-using*
+5. Usage~
+
+The taglist plugin can be used in several different ways.
+
+1. You can keep the taglist window open during the entire editing session. On
+   opening the taglist window, the tags defined in all the files in the Vim
+   buffer list will be displayed in the taglist window. As you edit files, the
+   tags defined in them will be added to the taglist window. You can select a
+   tag from the taglist window and jump to it. The current tag will be
+   highlighted in the taglist window. You can close the taglist window when
+   you no longer need the window.
+2. You can configure the taglist plugin to process the tags defined in all the
+   edited files always. In this configuration, even if the taglist window is
+   closed and the taglist menu is not displayed, the taglist plugin will
+   processes the tags defined in newly edited files. You can then open the
+   taglist window only when you need to select a tag and then automatically
+   close the taglist window after selecting the tag.
+3. You can configure the taglist plugin to display only the tags defined in
+   the current file in the taglist window. By default, the taglist plugin
+   displays the tags defined in all the files in the Vim buffer list. As you
+   switch between files, the taglist window will be refreshed to display only
+   the tags defined in the current file.
+4. In GUI Vim, you can use the Tags pull-down and popup menu created by the
+   taglist plugin to display the tags defined in the current file and select a
+   tag to jump to it. You can use the menu without opening the taglist window.
+   By default, the Tags menu is disabled.
+5. You can configure the taglist plugin to display the name of the current tag
+   in the Vim window status line or in the Vim window title bar. For this to
+   work without the taglist window or menu, you need to configure the taglist
+   plugin to process the tags defined in a file always.
+6. You can save the tags defined in multiple files to a taglist session file
+   and load it when needed. You can also configure the taglist plugin to not
+   update the taglist window when editing new files. You can then manually add
+   files to the taglist window.
+
+Opening the taglist window~
+You can open the taglist window using the ":TlistOpen" or the ":TlistToggle"
+commands. The ":TlistOpen" command opens the taglist window and jumps to it.
+The ":TlistToggle" command opens or closes (toggle) the taglist window and the
+cursor remains in the current window. If the 'Tlist_GainFocus_On_ToggleOpen'
+variable is set to 1, then the ":TlistToggle" command opens the taglist window
+and moves the cursor to the taglist window.
+
+You can map a key to invoke these commands. For example, the following command
+creates a normal mode mapping for the <F8> key to toggle the taglist window.
+>
+       nnoremap <silent> <F8> :TlistToggle<CR>
+<
+Add the above mapping to your ~/.vimrc or $HOME/_vimrc file.
+
+To automatically open the taglist window on Vim startup, set the
+'Tlist_Auto_Open' variable to 1.
+
+You can also open the taglist window on startup using the following command
+line:
+>
+       $ vim +TlistOpen
+<
+Closing the taglist window~
+You can close the taglist window from the taglist window by pressing 'q' or
+using the Vim ":q" command. You can also use any of the Vim window commands to
+close the taglist window. Invoking the ":TlistToggle" command when the taglist
+window is opened, closes the taglist window. You can also use the
+":TlistClose" command to close the taglist window.
+
+To automatically close the taglist window when a tag or file is selected, you
+can set the 'Tlist_Close_On_Select' variable to 1.  To exit Vim when only the
+taglist window is present, set the 'Tlist_Exit_OnlyWindow' variable to 1.
+
+Jumping to a tag or a file~
+You can select a tag in the taglist window either by pressing the <Enter> key
+or by double clicking the tag name using the mouse. To jump to a tag on a
+single mouse click set the 'Tlist_Use_SingleClick' variable to 1.
+
+If the selected file is already opened in a window, then the cursor is moved
+to that window. If the file is not currently opened in a window then the file
+is opened in the window used by the taglist plugin to show the previously
+selected file. If there are no usable windows, then the file is opened in a
+new window.  The file is not opened in special windows like the quickfix
+window, preview window and windows containing buffer with the 'buftype' option
+set.
+
+To jump to the tag in a new window, press the 'o' key. To open the file in the
+previous window (Ctrl-W_p) use the 'P' key. You can press the 'p' key to jump
+to the tag but still keep the cursor in the taglist window (preview).
+
+To open the selected file in a tab, use the 't' key.  If the file is already
+present in a tab then the cursor is moved to that tab otherwise the file is
+opened in a new tab. To jump to a tag in a new tab press Ctrl-t.  The taglist
+window is automatically opened in the newly created tab.
+
+Instead of jumping to a tag, you can open a file by pressing the <Enter> key
+or by double clicking the file name using the mouse.
+
+In the taglist window, you can use the [[ or <Backspace> key to jump to the
+beginning of the previous file. You can use the ]] or <Tab> key to jump to the
+beginning of the next file. When you reach the first or last file, the search
+wraps around and the jumps to the next/previous file.
+
+Highlighting the current tag~
+The taglist plugin automatically highlights the name of the current tag in the
+taglist window. The Vim |CursorHold| autocmd event is used for this. If the
+current tag name is not visible in the taglist window, then the taglist window
+contents are scrolled to make that tag name visible. You can also use the
+":TlistHighlightTag" command to force the highlighting of the current tag.
+
+The tag name is highlighted if no activity is performed for |'updatetime'|
+milliseconds. The default value for this Vim option is 4 seconds. To avoid
+unexpected problems, you should not set the |'updatetime'| option to a very
+low value.
+
+To disable the automatic highlighting of the current tag name in the taglist
+window, set the 'Tlist_Auto_Highlight_Tag' variable to zero.
+
+When entering a Vim buffer/window, the taglist plugin automatically highlights
+the current tag in that buffer/window.  If you like to disable the automatic
+highlighting of the current tag when entering a buffer, set the
+'Tlist_Highlight_Tag_On_BufEnter' variable to zero.
+
+Adding files to the taglist~
+When the taglist window is opened, all the files in the Vim buffer list are
+processed and the supported files are added to the taglist.  When you edit a
+file in Vim, the taglist plugin automatically processes this file and adds it
+to the taglist. If you close the taglist window, the tag information in the
+taglist is retained.
+
+To process files even when the taglist window is not open, set the
+'Tlist_Process_File_Always' variable to 1.
+
+You can manually add multiple files to the taglist without opening them using
+the ":TlistAddFiles" and the ":TlistAddFilesRecursive" commands.
+
+For example, to add all the C files in the /my/project/dir directory to the
+taglist, you can use the following command:
+>
+       :TlistAddFiles /my/project/dir/*.c
+<
+Note that when adding several files with a large number of tags or a large
+number of files, it will take several seconds to several minutes for the
+taglist plugin to process all the files. You should not interrupt the taglist
+plugin by pressing <CTRL-C>.
+
+You can recursively add multiple files from a directory tree using the
+":TlistAddFilesRecursive" command:
+>
+       :TlistAddFilesRecursive /my/project/dir *.c
+<
+This command takes two arguments. The first argument specifies the directory
+from which to recursively add the files. The second optional argument
+specifies the wildcard matching pattern for selecting the files to add. The
+default pattern is * and all the files are added.
+
+Displaying tags for only one file~
+The taglist window displays the tags for all the files in the Vim buffer list
+and all the manually added files. To display the tags for only the current
+active buffer, set the 'Tlist_Show_One_File' variable to 1.
+
+Removing files from the taglist~
+You can remove a file from the taglist window, by pressing the 'd' key when the
+cursor is on one of the tags listed for the file in the taglist window. The
+removed file will no longer be displayed in the taglist window in the current
+Vim session. To again display the tags for the file, open the file in a Vim
+window and then use the ":TlistUpdate" command or use ":TlistAddFiles" command
+to add the file to the taglist.
+
+When a buffer is removed from the Vim buffer list using the ":bdelete" or the
+":bwipeout" command, the taglist is updated to remove the stored information
+for this buffer.
+
+Updating the tags displayed for a file~
+The taglist plugin keeps track of the modification time of a file. When the
+modification time changes (the file is modified), the taglist plugin
+automatically updates the tags listed for that file. The modification time of
+a file is checked when you enter a window containing that file or when you
+load that file.
+
+You can also update or refresh the tags displayed for a file by pressing the
+"u" key in the taglist window. If an existing file is modified, after the file
+is saved, the taglist plugin automatically updates the tags displayed for the
+file.
+
+You can also use the ":TlistUpdate" command to update the tags for the current
+buffer after you made some changes to it. You should save the modified buffer
+before you update the taglist window. Otherwise the listed tags will not
+include the new tags created in the buffer. 
+
+If you have deleted the tags displayed for a file in the taglist window using
+the 'd' key, you can again display the tags for that file using the
+":TlistUpdate" command.
+
+Controlling the taglist updates~
+To disable the automatic processing of new files or modified files, you can
+set the 'Tlist_Auto_Update' variable to zero. When this variable is set to
+zero, the taglist is updated only when you use the ":TlistUpdate" command or
+the ":TlistAddFiles" or the ":TlistAddFilesRecursive" commands. You can use
+this option to control which files are added to the taglist.
+
+You can use the ":TlistLock" command to lock the taglist contents. After this
+command is executed, new files are not automatically added to the taglist.
+When the taglist is locked, you can use the ":TlistUpdate" command to add the
+current file or the ":TlistAddFiles" or ":TlistAddFilesRecursive" commands to
+add new files to the taglist.  To unlock the taglist, use the ":TlistUnlock"
+command.
+
+Displaying the tag prototype~
+To display the prototype of the tag under the cursor in the taglist window,
+press the space bar. If you place the cursor on a tag name in the taglist
+window, then the tag prototype is displayed at the Vim status line after
+|'updatetime'| milliseconds. The default value for the |'updatetime'| Vim
+option is 4 seconds.
+
+You can get the name and prototype of a tag without opening the taglist window
+and the taglist menu using the ":TlistShowTag" and the ":TlistShowPrototype"
+commands. These commands will work only if the current file is already present
+in the taglist. To use these commands without opening the taglist window, set
+the 'Tlist_Process_File_Always' variable to 1.
+
+You can use the ":TlistShowTag" command to display the name of the tag at or
+before the specified line number in the specified file.  If the file name and
+line number are not supplied, then this command will display the name of the
+current tag. For example,
+>
+       :TlistShowTag
+       :TlistShowTag myfile.java 100
+<
+You can use the ":TlistShowPrototype" command to display the prototype of the
+tag at or before the specified line number in the specified file.  If the file
+name and the line number are not supplied, then this command will display the
+prototype of the current tag.  For example,
+>
+       :TlistShowPrototype
+       :TlistShowPrototype myfile.c 50
+<
+In the taglist window, when the mouse is moved over a tag name, the tag
+prototype is displayed in a balloon. This works only in GUI versions where
+balloon evaluation is supported.
+
+Taglist window contents~
+The taglist window contains the tags defined in various files in the taglist
+grouped by the filename and by the tag type (variable, function, class, etc.).
+For tags with scope information (like class members, structures inside
+structures, etc.), the scope information is displayed in square brackets "[]"
+after the tag name.
+
+The contents of the taglist buffer/window are managed by the taglist plugin.
+The |'filetype'| for the taglist buffer is set to 'taglist'.  The Vim
+|'modifiable'| option is turned off for the taglist buffer. You should not
+manually edit the taglist buffer, by setting the |'modifiable'| flag. If you
+manually edit the taglist buffer contents, then the taglist plugin will be out
+of sync with the taglist buffer contents and the plugin will no longer work
+correctly. To redisplay the taglist buffer contents again, close the taglist
+window and reopen it.
+
+Opening and closing the tag and file tree~
+In the taglist window, the tag names are displayed as a foldable tree using
+the Vim folding support. You can collapse the tree using the '-' key or using
+the Vim |zc| fold command. You can open the tree using the '+' key or using
+the Vim |zo| fold command. You can open all the folds using the '*' key or
+using the Vim |zR| fold command. You can also use the mouse to open/close the
+folds. You can close all the folds using the '=' key. You should not manually
+create or delete the folds in the taglist window.
+
+To automatically close the fold for the inactive files/buffers and open only
+the fold for the current buffer in the taglist window, set the
+'Tlist_File_Fold_Auto_Close' variable to 1.
+
+Sorting the tags for a file~
+The tags displayed in the taglist window can be sorted either by their name or
+by their chronological order. The default sorting method is by the order in
+which the tags appear in a file. You can change the default sort method by
+setting the 'Tlist_Sort_Type' variable to either "name" or "order". You can
+sort the tags by their name by pressing the "s" key in the taglist window. You
+can again sort the tags by their chronological order using the "s" key. Each
+file in the taglist window can be sorted using different order.
+
+Zooming in and out of the taglist window~
+You can press the 'x' key in the taglist window to maximize the taglist
+window width/height. The window will be maximized to the maximum possible
+width/height without closing the other existing windows. You can again press
+'x' to restore the taglist window to the default width/height.
+
+                                               *taglist-session*
+Taglist Session~
+A taglist session refers to the group of files and their tags stored in the
+taglist in a Vim session.
+
+You can save and restore a taglist session (and all the displayed tags) using
+the ":TlistSessionSave" and ":TlistSessionLoad" commands.
+
+To save the information about the tags and files in the taglist to a file, use
+the ":TlistSessionSave" command and specify the filename:
+>
+       :TlistSessionSave <file name>
+<
+To load a saved taglist session, use the ":TlistSessionLoad" command: >
+
+       :TlistSessionLoad <file name>
+<
+When you load a taglist session file, the tags stored in the file will be
+added to the tags already stored in the taglist.
+
+The taglist session feature can be used to save the tags for large files or a
+group of frequently used files (like a project). By using the taglist session
+file, you can minimize the amount to time it takes to load/refresh the taglist
+for multiple files.
+
+You can create more than one taglist session file for multiple groups of
+files.
+
+Displaying the tag name in the Vim status line or the window title bar~
+You can use the Tlist_Get_Tagname_By_Line() function provided by the taglist
+plugin to display the current tag name in the Vim status line or the window
+title bar. Similarly, you can use the Tlist_Get_Tag_Prototype_By_Line()
+function to display the current tag prototype in the Vim status line or the
+window title bar.
+
+For example, the following command can be used to display the current tag name
+in the status line:
+>
+       :set statusline=%<%f%=%([%{Tlist_Get_Tagname_By_Line()}]%)
+<
+The following command can be used to display the current tag name in the
+window title bar:
+>
+       :set title titlestring=%<%f\ %([%{Tlist_Get_Tagname_By_Line()}]%)
+<
+Note that the current tag name can be displayed only after the file is
+processed by the taglist plugin. For this, you have to either set the
+'Tlist_Process_File_Always' variable to 1 or open the taglist window or use
+the taglist menu. For more information about configuring the Vim status line,
+refer to the documentation for the Vim |'statusline'| option.
+
+Changing the taglist window highlighting~
+The following Vim highlight groups are defined and used to highlight the
+various entities in the taglist window:
+
+    TagListTagName  - Used for tag names
+    TagListTagScope - Used for tag scope
+    TagListTitle    - Used for tag titles
+    TagListComment  - Used for comments
+    TagListFileName - Used for filenames
+
+By default, these highlight groups are linked to the standard Vim highlight
+groups. If you want to change the colors used for these highlight groups,
+prefix the highlight group name with 'My' and define it in your .vimrc or
+.gvimrc file: MyTagListTagName, MyTagListTagScope, MyTagListTitle,
+MyTagListComment and MyTagListFileName.  For example, to change the colors
+used for tag names, you can use the following command:
+>
+    :highlight MyTagListTagName guifg=blue ctermfg=blue
+<
+Controlling the taglist window~
+To use a horizontally split taglist window, instead of a vertically split
+window, set the 'Tlist_Use_Horiz_Window' variable to 1.
+
+To use a vertically split taglist window on the rightmost side of the Vim
+window, set the 'Tlist_Use_Right_Window' variable to 1.
+
+You can specify the width of the vertically split taglist window, by setting
+the 'Tlist_WinWidth' variable.  You can specify the height of the horizontally
+split taglist window, by setting the 'Tlist_WinHeight' variable.
+
+When opening a vertically split taglist window, the Vim window width is
+increased to accommodate the new taglist window. When the taglist window is
+closed, the Vim window is reduced. To disable this, set the
+'Tlist_Inc_Winwidth' variable to zero.
+
+To reduce the number of empty lines in the taglist window, set the
+'Tlist_Compact_Format' variable to 1.
+
+To not display the Vim fold column in the taglist window, set the
+'Tlist_Enable_Fold_Column' variable to zero.
+
+To display the tag prototypes instead of the tag names in the taglist window,
+set the 'Tlist_Display_Prototype' variable to 1.
+
+To not display the scope of the tags next to the tag names, set the
+'Tlist_Display_Tag_Scope' variable to zero.
+
+                                               *taglist-keys*
+Taglist window key list~
+The following table lists the description of the keys that can be used
+in the taglist window.
+
+  Key           Description~
+
+  <CR>          Jump to the location where the tag under cursor is
+                defined.
+  o             Jump to the location where the tag under cursor is
+                defined in a new window.
+  P             Jump to the tag in the previous (Ctrl-W_p) window.
+  p             Display the tag definition in the file window and
+                keep the cursor in the taglist window itself.
+  t             Jump to the tag in a new tab. If the file is already
+                opened in a tab, move to that tab.
+  Ctrl-t       Jump to the tag in a new tab.
+  <Space>       Display the prototype of the tag under the cursor.
+               For file names, display the full path to the file,
+               file type and the number of tags. For tag types, display the
+               tag type and the number of tags.
+  u             Update the tags listed in the taglist window
+  s             Change the sort order of the tags (by name or by order)
+  d             Remove the tags for the file under the cursor
+  x             Zoom-in or Zoom-out the taglist window
+  +             Open a fold
+  -             Close a fold
+  *             Open all folds
+  =             Close all folds
+  [[           Jump to the beginning of the previous file
+  <Backspace>  Jump to the beginning of the previous file
+  ]]           Jump to the beginning of the next file
+  <Tab>                Jump to the beginning of the next file
+  q             Close the taglist window
+  <F1>          Display help
+
+The above keys will work in both the normal mode and the insert mode.
+
+                                               *taglist-menu*
+Taglist menu~
+When using GUI Vim, the taglist plugin can display the tags defined in the
+current file in the drop-down menu and the popup menu. By default, this
+feature is turned off. To turn on this feature, set the 'Tlist_Show_Menu'
+variable to 1.
+
+You can jump to a tag by selecting the tag name from the menu. You can use the
+taglist menu independent of the taglist window i.e. you don't need to open the
+taglist window to get the taglist menu.
+
+When you switch between files/buffers, the taglist menu is automatically
+updated to display the tags defined in the current file/buffer.
+
+The tags are grouped by their type (variables, functions, classes, methods,
+etc.) and displayed as a separate sub-menu for each type. If all the tags
+defined in a file are of the same type (e.g. functions), then the sub-menu is
+not used.
+
+If the number of items in a tag type submenu exceeds the value specified by
+the 'Tlist_Max_Submenu_Items' variable, then the submenu will be split into
+multiple submenus. The default setting for 'Tlist_Max_Submenu_Items' is 25.
+The first and last tag names in the submenu are used to form the submenu name.
+The menu items are prefixed by alpha-numeric characters for easy selection by
+keyboard.
+
+If the popup menu support is enabled (the |'mousemodel'| option contains
+"popup"), then the tags menu is added to the popup menu. You can access
+the popup menu by right clicking on the GUI window.
+
+You can regenerate the tags menu by selecting the 'Tags->Refresh menu' entry.
+You can sort the tags listed in the menu either by name or by order by
+selecting the 'Tags->Sort menu by->Name/Order' menu entry.
+
+You can tear-off the Tags menu and keep it on the side of the Vim window
+for quickly locating the tags.
+
+Using the taglist plugin with the winmanager plugin~
+You can use the taglist plugin with the winmanager plugin. This will allow you
+to use the file explorer, buffer explorer and the taglist plugin at the same
+time in different windows. To use the taglist plugin with the winmanager
+plugin, set 'TagList' in the 'winManagerWindowLayout' variable. For example,
+to use the file explorer plugin and the taglist plugin at the same time, use
+the following setting: >
+
+       let winManagerWindowLayout = 'FileExplorer|TagList'
+<
+Getting help~
+If you have installed the taglist help file (this file), then you can use the
+Vim ":help taglist-<keyword>" command to get help on the various taglist
+topics.
+
+You can press the <F1> key in the taglist window to display the help
+information about using the taglist window. If you again press the <F1> key,
+the help information is removed from the taglist window.
+
+                                               *taglist-debug*
+Debugging the taglist plugin~
+You can use the ":TlistDebug" command to enable logging of the debug messages
+from the taglist plugin. To display the logged debug messages, you can use the
+":TlistMessages" command. To disable the logging of the debug messages, use
+the ":TlistUndebug" command.
+
+You can specify a file name to the ":TlistDebug" command to log the debug
+messages to a file. Otherwise, the debug messages are stored in a script-local
+variable. In the later case, to minimize memory usage, only the last 3000
+characters from the debug messages are stored.
+
+==============================================================================
+                                               *taglist-options*
+6. Options~
+
+A number of Vim variables control the behavior of the taglist plugin. These
+variables are initialized to a default value. By changing these variables you
+can change the behavior of the taglist plugin. You need to change these
+settings only if you want to change the behavior of the taglist plugin. You
+should use the |:let| command in your .vimrc file to change the setting of any
+of these variables. 
+
+The configurable taglist variables are listed below. For a detailed
+description of these variables refer to the text below this table.
+
+|'Tlist_Auto_Highlight_Tag'|   Automatically highlight the current tag in the
+                               taglist.
+|'Tlist_Auto_Open'|            Open the taglist window when Vim starts.
+|'Tlist_Auto_Update'|          Automatically update the taglist to include
+                               newly edited files.
+|'Tlist_Close_On_Select'|      Close the taglist window when a file or tag is
+                               selected.
+|'Tlist_Compact_Format'|       Remove extra information and blank lines from
+                                       the taglist window.
+|'Tlist_Ctags_Cmd'|            Specifies the path to the ctags utility.
+|'Tlist_Display_Prototype'|    Show prototypes and not tags in the taglist
+                               window.
+|'Tlist_Display_Tag_Scope'|    Show tag scope next to the tag name.
+|'Tlist_Enable_Fold_Column'|   Show the fold indicator column in the taglist
+                               window.
+|'Tlist_Exit_OnlyWindow'|      Close Vim if the taglist is the only window.
+|'Tlist_File_Fold_Auto_Close'| Close tag folds for inactive buffers.
+|'Tlist_GainFocus_On_ToggleOpen'|
+                               Jump to taglist window on open.
+|'Tlist_Highlight_Tag_On_BufEnter'|
+                               On entering a buffer, automatically highlight
+                               the current tag.
+|'Tlist_Inc_Winwidth'|         Increase the Vim window width to accommodate
+                               the taglist window.
+|'Tlist_Max_Submenu_Items'|    Maximum number of items in a tags sub-menu.
+|'Tlist_Max_Tag_Length'|       Maximum tag length used in a tag menu entry.
+|'Tlist_Process_File_Always'|  Process files even when the taglist window is
+                               closed.
+|'Tlist_Show_Menu'|            Display the tags menu.
+|'Tlist_Show_One_File'|                Show tags for the current buffer only.
+|'Tlist_Sort_Type'|            Sort method used for arranging the tags.
+|'Tlist_Use_Horiz_Window'|     Use a horizontally split window for the
+                               taglist window.
+|'Tlist_Use_Right_Window'|     Place the taglist window on the right side.
+|'Tlist_Use_SingleClick'|      Single click on a tag jumps to it.
+|'Tlist_WinHeight'|            Horizontally split taglist window height.
+|'Tlist_WinWidth'|             Vertically split taglist window width.
+
+                                               *'Tlist_Auto_Highlight_Tag'*
+Tlist_Auto_Highlight_Tag~
+The taglist plugin will automatically highlight the current tag in the taglist
+window. If you want to disable this, then you can set the
+'Tlist_Auto_Highlight_Tag' variable to zero. Note that even though the current
+tag highlighting is disabled, the tags for a new file will still be added to
+the taglist window.
+>
+       let Tlist_Auto_Highlight_Tag = 0
+<
+With the above variable set to 1, you can use the ":TlistHighlightTag" command
+to highlight the current tag.
+
+                                               *'Tlist_Auto_Open'*
+Tlist_Auto_Open~
+To automatically open the taglist window, when you start Vim, you can set the
+'Tlist_Auto_Open' variable to 1. By default, this variable is set to zero and
+the taglist window will not be opened automatically on Vim startup.
+>
+       let Tlist_Auto_Open = 1
+<
+The taglist window is opened only when a supported type of file is opened on
+Vim startup. For example, if you open text files, then the taglist window will
+not be opened.
+
+                                               *'Tlist_Auto_Update'*
+Tlist_Auto_Update~
+When a new file is edited, the tags defined in the file are automatically
+processed and added to the taglist. To stop adding new files to the taglist,
+set the 'Tlist_Auto_Update' variable to zero. By default, this variable is set
+to 1.
+>
+       let Tlist_Auto_Update = 0
+<
+With the above variable set to 1, you can use the ":TlistUpdate" command to
+add the tags defined in the current file to the taglist.
+
+                                               *'Tlist_Close_On_Select'*
+Tlist_Close_On_Select~
+If you want to close the taglist window when a file or tag is selected, then
+set the 'Tlist_Close_On_Select' variable to 1. By default, this variable is
+set zero and when you select a tag or file from the taglist window, the window
+is not closed.
+>
+       let Tlist_Close_On_Select = 1
+<
+                                               *'Tlist_Compact_Format'*
+Tlist_Compact_Format~
+By default, empty lines are used to separate different tag types displayed for
+a file and the tags displayed for different files in the taglist window. If
+you want to display as many tags as possible in the taglist window, you can
+set the 'Tlist_Compact_Format' variable to 1 to get a compact display.
+>
+       let Tlist_Compact_Format = 1
+<
+                                               *'Tlist_Ctags_Cmd'*
+Tlist_Ctags_Cmd~
+The 'Tlist_Ctags_Cmd' variable specifies the location (path) of the exuberant
+ctags utility. If exuberant ctags is present in any one of the directories in
+the PATH environment variable, then there is no need to set this variable.
+
+The exuberant ctags tool can be installed under different names.  When the
+taglist plugin starts up, if the 'Tlist_Ctags_Cmd' variable is not set, it
+checks for the names exuberant-ctags, exctags, ctags, ctags.exe and tags in
+the PATH environment variable.  If any one of the named executable is found,
+then the Tlist_Ctags_Cmd variable is set to that name.
+
+If exuberant ctags is not present in one of the directories specified in the
+PATH environment variable, then set this variable to point to the location of
+the ctags utility in your system. Note that this variable should point to the
+fully qualified exuberant ctags location and NOT to the directory in which
+exuberant ctags is installed. If the exuberant ctags tool is not found in
+either PATH or in the specified location, then the taglist plugin will not be
+loaded. Examples:
+>
+       let Tlist_Ctags_Cmd = 'd:\tools\ctags.exe'
+       let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
+<
+                                               *'Tlist_Display_Prototype'*
+Tlist_Display_Prototype~
+By default, only the tag name will be displayed in the taglist window. If you
+like to see tag prototypes instead of names, set the 'Tlist_Display_Prototype'
+variable to 1. By default, this variable is set to zero and only tag names
+will be displayed.
+>
+       let Tlist_Display_Prototype = 1
+<
+                                               *'Tlist_Display_Tag_Scope'*
+Tlist_Display_Tag_Scope~
+By default, the scope of a tag (like a C++ class) will be displayed in
+square brackets next to the tag name. If you don't want the tag scopes
+to be displayed, then set the 'Tlist_Display_Tag_Scope' to zero. By default,
+this variable is set to 1 and the tag scopes will be displayed.
+>
+       let Tlist_Display_Tag_Scope = 0
+<
+                                               *'Tlist_Enable_Fold_Column'*
+Tlist_Enable_Fold_Column~
+By default, the Vim fold column is enabled and displayed in the taglist
+window. If you wish to disable this (for example, when you are working with a
+narrow Vim window or terminal), you can set the 'Tlist_Enable_Fold_Column'
+variable to zero.
+>
+       let Tlist_Enable_Fold_Column = 1
+<
+                                               *'Tlist_Exit_OnlyWindow'*
+Tlist_Exit_OnlyWindow~
+If you want to exit Vim if only the taglist window is currently opened, then
+set the 'Tlist_Exit_OnlyWindow' variable to 1. By default, this variable is
+set to zero and the Vim instance will not be closed if only the taglist window
+is present.
+>
+       let Tlist_Exit_OnlyWindow = 1
+<
+                                               *'Tlist_File_Fold_Auto_Close'*
+Tlist_File_Fold_Auto_Close~
+By default, the tags tree displayed in the taglist window for all the files is
+opened. You can close/fold the tags tree for the files manually. To
+automatically close the tags tree for inactive files, you can set the
+'Tlist_File_Fold_Auto_Close' variable to 1. When this variable is set to 1,
+the tags tree for the current buffer is automatically opened and for all the
+other buffers is closed.
+>
+       let Tlist_File_Fold_Auto_Close = 1
+<
+                                           *'Tlist_GainFocus_On_ToggleOpen'*
+Tlist_GainFocus_On_ToggleOpen~
+When the taglist window is opened using the ':TlistToggle' command, this
+option controls whether the cursor is moved to the taglist window or remains
+in the current window. By default, this option is set to 0 and the cursor
+remains in the current window. When this variable is set to 1, the cursor
+moves to the taglist window after opening the taglist window.
+>
+       let Tlist_GainFocus_On_ToggleOpen = 1
+<
+                                           *'Tlist_Highlight_Tag_On_BufEnter'*
+Tlist_Highlight_Tag_On_BufEnter~
+When you enter a Vim buffer/window, the current tag in that buffer/window is
+automatically highlighted in the taglist window. If the current tag name is
+not visible in the taglist window, then the taglist window contents are
+scrolled to make that tag name visible. If you like to disable the automatic
+highlighting of the current tag when entering a buffer, you can set the
+'Tlist_Highlight_Tag_On_BufEnter' variable to zero. The default setting for
+this variable is 1.
+>
+       let Tlist_Highlight_Tag_On_BufEnter = 0
+<
+                                               *'Tlist_Inc_Winwidth'*
+Tlist_Inc_Winwidth~
+By default, when the width of the window is less than 100 and a new taglist
+window is opened vertically, then the window width is increased by the value
+set in the 'Tlist_WinWidth' variable to accommodate the new window. The value
+of this variable is used only if you are using a vertically split taglist
+window.
+
+If your terminal doesn't support changing the window width from Vim (older
+version of xterm running in a Unix system) or if you see any weird problems in
+the screen due to the change in the window width or if you prefer not to
+adjust the window width then set the 'Tlist_Inc_Winwidth' variable to zero.
+CAUTION: If you are using the MS-Windows version of Vim in a MS-DOS command
+window then you must set this variable to zero, otherwise the system may hang
+due to a Vim limitation (explained in :help win32-problems)
+>
+       let Tlist_Inc_Winwidth = 0
+<
+                                               *'Tlist_Max_Submenu_Items'*
+Tlist_Max_Submenu_Items~
+If a file contains too many tags of a particular type (function, variable,
+class, etc.), greater than that specified by the 'Tlist_Max_Submenu_Items'
+variable, then the menu for that tag type will be split into multiple
+sub-menus. The default setting for the 'Tlist_Max_Submenu_Items' variable is
+25.  This can be changed by setting the 'Tlist_Max_Submenu_Items' variable:
+>
+       let Tlist_Max_Submenu_Items = 20
+<
+The name of the submenu is formed using the names of the first and the last
+tag entries in that submenu.
+
+                                               *'Tlist_Max_Tag_Length'*
+Tlist_Max_Tag_Length~
+Only the first 'Tlist_Max_Tag_Length' characters from the tag names will be
+used to form the tag type submenu name. The default value for this variable is
+10.  Change the 'Tlist_Max_Tag_Length' setting if you want to include more or
+less characters:
+>
+       let Tlist_Max_Tag_Length = 10
+<
+                                               *'Tlist_Process_File_Always'*
+Tlist_Process_File_Always~
+By default, the taglist plugin will generate and process the tags defined in
+the newly opened files only when the taglist window is opened or when the
+taglist menu is enabled. When the taglist window is closed, the taglist plugin
+will stop processing the tags for newly opened files.
+
+You can set the 'Tlist_Process_File_Always' variable to 1 to generate the list
+of tags for new files even when the taglist window is closed and the taglist
+menu is disabled.
+>
+       let Tlist_Process_File_Always = 1
+<
+To use the ":TlistShowTag" and the ":TlistShowPrototype" commands without the
+taglist window and the taglist menu, you should set this variable to 1.
+
+                                               *'Tlist_Show_Menu'*
+Tlist_Show_Menu~
+When using GUI Vim, you can display the tags defined in the current file in a
+menu named "Tags". By default, this feature is turned off. To turn on this
+feature, set the 'Tlist_Show_Menu' variable to 1:
+>
+       let Tlist_Show_Menu = 1
+<
+                                               *'Tlist_Show_One_File'*
+Tlist_Show_One_File~
+By default, the taglist plugin will display the tags defined in all the loaded
+buffers in the taglist window. If you prefer to display the tags defined only
+in the current buffer, then you can set the 'Tlist_Show_One_File' to 1. When
+this variable is set to 1, as you switch between buffers, the taglist window
+will be refreshed to display the tags for the current buffer and the tags for
+the previous buffer will be removed.
+>
+       let Tlist_Show_One_File = 1
+<
+                                               *'Tlist_Sort_Type'*
+Tlist_Sort_Type~
+The 'Tlist_Sort_Type' variable specifies the sort order for the tags in the
+taglist window. The tags can be sorted either alphabetically by their name or
+by the order of their appearance in the file (chronological order). By
+default, the tag names will be listed by the order in which they are defined
+in the file. You can change the sort type (from name to order or from order to
+name) by pressing the "s" key in the taglist window. You can also change the
+default sort order by setting 'Tlist_Sort_Type' to "name" or "order":
+>
+       let Tlist_Sort_Type = "name"
+<
+                                               *'Tlist_Use_Horiz_Window'*
+Tlist_Use_Horiz_Window~
+Be default, the tag names are displayed in a vertically split window. If you
+prefer a horizontally split window, then set the 'Tlist_Use_Horiz_Window'
+variable to 1. If you are running MS-Windows version of Vim in a MS-DOS
+command window, then you should use a horizontally split window instead of a
+vertically split window. Also, if you are using an older version of xterm in a
+Unix system that doesn't support changing the xterm window width, you should
+use a horizontally split window.
+>
+       let Tlist_Use_Horiz_Window = 1
+<
+                                               *'Tlist_Use_Right_Window'*
+Tlist_Use_Right_Window~
+By default, the vertically split taglist window will appear on the left hand
+side. If you prefer to open the window on the right hand side, you can set the
+'Tlist_Use_Right_Window' variable to 1:
+>
+       let Tlist_Use_Right_Window = 1
+<
+                                               *'Tlist_Use_SingleClick'*
+Tlist_Use_SingleClick~
+By default, when you double click on the tag name using the left mouse 
+button, the cursor will be positioned at the definition of the tag. You 
+can set the 'Tlist_Use_SingleClick' variable to 1 to jump to a tag when
+you single click on the tag name using the mouse. By default this variable
+is set to zero.
+>
+       let Tlist_Use_SingleClick = 1
+<
+Due to a bug in Vim, if you set 'Tlist_Use_SingleClick' to 1 and try to resize
+the taglist window using the mouse, then Vim will crash. This problem is fixed
+in Vim 6.3 and above. In the meantime, instead of resizing the taglist window
+using the mouse, you can use normal Vim window resizing commands to resize the
+taglist window.
+
+                                               *'Tlist_WinHeight'*
+Tlist_WinHeight~
+The default height of the horizontally split taglist window is 10. This can be
+changed by modifying the 'Tlist_WinHeight' variable:
+>
+       let Tlist_WinHeight = 20
+<
+The |'winfixheight'| option is set for the taglist window, to maintain the
+height of the taglist window, when new Vim windows are opened and existing
+windows are closed.
+
+                                               *'Tlist_WinWidth'*
+Tlist_WinWidth~
+The default width of the vertically split taglist window is 30. This can be
+changed by modifying the 'Tlist_WinWidth' variable:
+>
+       let Tlist_WinWidth = 20
+<
+Note that the value of the |'winwidth'| option setting determines the minimum
+width of the current window. If you set the 'Tlist_WinWidth' variable to a
+value less than that of the |'winwidth'| option setting, then Vim will use the
+value of the |'winwidth'| option.
+
+When new Vim windows are opened and existing windows are closed, the taglist
+plugin will try to maintain the width of the taglist window to the size
+specified by the 'Tlist_WinWidth' variable.
+
+==============================================================================
+                                               *taglist-commands*
+7. Commands~
+
+The taglist plugin provides the following ex-mode commands:
+
+|:TlistAddFiles|       Add multiple files to the taglist.
+|:TlistAddFilesRecursive|
+                       Add files recursively to the taglist.
+|:TlistClose|          Close the taglist window.
+|:TlistDebug|          Start logging of taglist debug messages.
+|:TlistLock|           Stop adding new files to the taglist.
+|:TlistMessages|       Display the logged taglist plugin debug messages.
+|:TlistOpen|           Open and jump to the taglist window.
+|:TlistSessionSave|    Save the information about files and tags in the
+                       taglist to a session file.
+|:TlistSessionLoad|    Load the information about files and tags stored
+                       in a session file to taglist.
+|:TlistShowPrototype|  Display the prototype of the tag at or before the
+                       specified line number.
+|:TlistShowTag|                Display the name of the tag defined at or before the
+                       specified line number.
+|:TlistHighlightTag|   Highlight the current tag in the taglist window.
+|:TlistToggle|         Open or close (toggle) the taglist window.
+|:TlistUndebug|                Stop logging of taglist debug messages.
+|:TlistUnlock|         Start adding new files to the taglist.
+|:TlistUpdate|         Update the tags for the current buffer.
+
+                                               *:TlistAddFiles*
+:TlistAddFiles {file(s)} [file(s) ...]
+               Add one or more specified files to the taglist. You can
+               specify multiple filenames using wildcards. To specify a
+               file name with space character, you should escape the space
+               character with a backslash.
+               Examples:
+>
+                   :TlistAddFiles *.c *.cpp
+                   :TlistAddFiles file1.html file2.html
+<
+               If you specify a large number of files, then it will take some
+               time for the taglist plugin to process all of them. The
+               specified files will not be edited in a Vim window and will
+               not be added to the Vim buffer list.
+
+                                               *:TlistAddFilesRecursive*
+:TlistAddFilesRecursive {directory} [ {pattern} ]
+               Add files matching {pattern} recursively from the specified
+               {directory} to the taglist. If {pattern} is not specified,
+               then '*' is assumed. To specify the current directory, use "."
+               for {directory}. To specify a directory name with space
+               character, you should escape the space character with a
+               backslash.
+               Examples:
+>
+                   :TlistAddFilesRecursive myproject *.java
+                   :TlistAddFilesRecursive smallproject
+<
+               If large number of files are present in the specified
+               directory tree, then it will take some time for the taglist
+               plugin to process all of them.
+
+                                               *:TlistClose*
+:TlistClose    Close the taglist window. This command can be used from any
+               one of the Vim windows.
+
+                                               *:TlistDebug*
+:TlistDebug [filename]
+               Start logging of debug messages from the taglist plugin.
+               If {filename} is specified, then the debug messages are stored
+               in the specified file. Otherwise, the debug messages are
+               stored in a script local variable. If the file {filename} is
+               already present, then it is overwritten.
+
+                                               *:TlistLock*
+:TlistLock
+               Lock the taglist and don't process new files. After this
+               command is executed, newly edited files will not be added to
+               the taglist.
+
+                                               *:TlistMessages*
+:TlistMessages
+               Display the logged debug messages from the taglist plugin
+               in a window.  This command works only when logging to a
+               script-local variable.
+
+                                               *:TlistOpen*
+:TlistOpen     Open and jump to the taglist window. Creates the taglist
+               window, if the window is not opened currently. After executing
+               this command, the cursor is moved to the taglist window.  When
+               the taglist window is opened for the first time, all the files
+               in the buffer list are processed and the tags defined in them
+               are displayed in the taglist window.
+
+                                               *:TlistSessionSave*
+:TlistSessionSave {filename}
+               Saves the information about files and tags in the taglist to
+               the specified file. This command can be used to save and
+               restore the taglist contents across Vim sessions.
+
+                                               *:TlistSessionLoad*
+:TlistSessionLoad {filename}
+               Load the information about files and tags stored in the
+               specified session file to the taglist.
+
+                                               *:TlistShowPrototype*
+:TlistShowPrototype [filename] [linenumber]
+               Display the prototype of the tag at or before the specified
+               line number. If the file name and the line number are not
+               specified, then the current file name and line number are
+               used. A tag spans multiple lines starting from the line where
+               it is defined to the line before the next tag. This command
+               displays the prototype for the tag for any line number in this
+               range. 
+
+                                               *:TlistShowTag*
+:TlistShowTag [filename] [linenumber]
+               Display the name of the tag defined at or before the specified
+               line number. If the file name and the line number are not
+               specified, then the current file name and line number are
+               used. A tag spans multiple lines starting from the line where
+               it is defined to the line before the next tag. This command
+               displays the tag name for any line number in this range. 
+
+                                               *:TlistHighlightTag*
+:TlistHighlightTag
+               Highlight the current tag in the taglist window. By default,
+               the taglist plugin periodically updates the taglist window to
+               highlight the current tag. This command can be used to force
+               the taglist plugin to highlight the current tag.
+
+                                               *:TlistToggle*
+:TlistToggle   Open or close (toggle) the taglist window. Opens the taglist
+               window, if the window is not opened currently. Closes the
+               taglist window, if the taglist window is already opened. When
+               the taglist window is opened for the first time, all the files
+               in the buffer list are processed and the tags are displayed in
+               the taglist window. After executing this command, the cursor
+               is not moved from the current window to the taglist window.
+
+                                               *:TlistUndebug*
+:TlistUndebug
+               Stop logging of debug messages from the taglist plugin.
+
+                                               *:TlistUnlock*
+:TlistUnlock
+               Unlock the taglist and start processing newly edited files.
+
+                                               *:TlistUpdate*
+:TlistUpdate   Update the tags information for the current buffer. This
+               command can be used to re-process the current file/buffer and
+               get the tags information. As the taglist plugin uses the file
+               saved in the disk (instead of the file displayed in a Vim
+               buffer), you should save a modified buffer before you update
+               the taglist. Otherwise the listed tags will not include the
+               new tags created in the buffer. You can use this command even
+               when the taglist window is not opened.
+
+==============================================================================
+                                               *taglist-functions*
+8. Global functions~
+
+The taglist plugin provides several global functions that can be used from
+other Vim plugins to interact with the taglist plugin. These functions are
+described below.
+
+|Tlist_Update_File_Tags()|             Update the tags for the specified file
+|Tlist_Get_Tag_Prototype_By_Line()|    Return the prototype of the tag at or
+                                       before the specified line number in the
+                                       specified file.
+|Tlist_Get_Tagname_By_Line()|          Return the name of the tag at or
+                                       before the specified line number in
+                                       the specified file.
+|Tlist_Set_App()|                      Set the name of the application
+                                       controlling the taglist window.
+
+                                           *Tlist_Update_File_Tags()*
+Tlist_Update_File_Tags({filename}, {filetype})
+               Update the tags for the file {filename}. The second argument
+               specifies the Vim filetype for the file. If the taglist plugin
+               has not processed the file previously, then the exuberant
+               ctags tool is invoked to generate the tags for the file.
+
+                                           *Tlist_Get_Tag_Prototype_By_Line()*
+Tlist_Get_Tag_Prototype_By_Line([{filename}, {linenumber}])
+               Return the prototype of the tag at or before the specified
+               line number in the specified file. If the filename and line
+               number are not specified, then the current buffer name and the
+               current line number are used.
+
+                                           *Tlist_Get_Tagname_By_Line()*
+Tlist_Get_Tagname_By_Line([{filename}, {linenumber}])
+               Return the name of the tag at or before the specified line
+               number in the specified file. If the filename and line number
+               are not specified, then the current buffer name and the
+               current line number are used.
+
+                                           *Tlist_Set_App()*
+Tlist_Set_App({appname})
+               Set the name of the plugin that controls the taglist plugin
+               window and buffer. This can be used to integrate the taglist
+               plugin with other Vim plugins.
+               
+               For example, the winmanager plugin and the Cream package use
+               this function and specify the appname as "winmanager" and
+               "cream" respectively.
+               
+               By default, the taglist plugin is a stand-alone plugin and
+               controls the taglist window and buffer. If the taglist window
+               is controlled by an external plugin, then the appname should
+               be set appropriately.
+
+==============================================================================
+                                               *taglist-extend*
+9. Extending~
+
+The taglist plugin supports all the languages supported by the exuberant ctags
+tool, which includes the following languages: Assembly, ASP, Awk, Beta, C,
+C++, C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp, Lua,
+Make, Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang, SML, Sql,
+TCL, Verilog, Vim and Yacc.
+
+You can extend the taglist plugin to add support for new languages and also
+modify the support for the above listed languages.
+
+You should NOT make modifications to the taglist plugin script file to add
+support for new languages. You will lose these changes when you upgrade to the
+next version of the taglist plugin. Instead you should follow the below
+described instructions to extend the taglist plugin.
+
+You can extend the taglist plugin by setting variables in the .vimrc or _vimrc
+file. The name of these variables depends on the language name and is
+described below.
+
+Modifying support for an existing language~
+To modify the support for an already supported language, you have to set the
+tlist_xxx_settings variable in the ~/.vimrc or $HOME/_vimrc file. Replace xxx
+with the Vim filetype name for the language file.  For example, to modify the
+support for the perl language files, you have to set the tlist_perl_settings
+variable. To modify the support for java files, you have to set the
+tlist_java_settings variable.
+
+To determine the filetype name used by Vim for a file, use the following
+command in the buffer containing the file:
+
+       :set filetype
+
+The above command will display the Vim filetype for the current buffer.
+
+The format of the value set in the tlist_xxx_settings variable is
+
+    <language_name>;flag1:name1;flag2:name2;flag3:name3
+
+The different fields in the value are separated by the ';' character.
+
+The first field 'language_name' is the name used by exuberant ctags to refer
+to this language file. This name can be different from the file type name used
+by Vim. For example, for C++, the language name used by ctags is 'c++' but the
+filetype name used by Vim is 'cpp'. To get the list of language names
+supported by exuberant ctags, use the following command:
+
+       $ ctags --list-maps=all
+
+The remaining fields follow the format "flag:name". The sub-field 'flag' is
+the language specific flag used by exuberant ctags to generate the
+corresponding tags. For example, for the C language, to list only the
+functions, the 'f' flag is used. To get the list of flags supported by
+exuberant ctags for the various languages use the following command:
+
+       $ ctags --list-kinds=all
+
+The sub-field 'name' specifies the title text to use for displaying the tags
+of a particular type. For example, 'name' can be set to 'functions'. This
+field can be set to any text string name.
+
+For example, to list only the classes and functions defined in a C++ language
+file, add the following line to your .vimrc file:
+
+       let tlist_cpp_settings = 'c++;c:class;f:function'
+
+In the above setting, 'cpp' is the Vim filetype name and 'c++' is the name
+used by the exuberant ctags tool. 'c' and 'f' are the flags passed to
+exuberant ctags to list C++ classes and functions and 'class' is the title
+used for the class tags and 'function' is the title used for the function tags
+in the taglist window.
+
+For example, to display only functions defined in a C file and to use "My
+Functions" as the title for the function tags, use
+
+       let tlist_c_settings = 'c;f:My Functions'
+
+When you set the tlist_xxx_settings variable, you will override the default
+setting used by the taglist plugin for the 'xxx' language. You cannot add to
+the default options used by the taglist plugin for a particular file type. To
+add to the options used by the taglist plugin for a language, copy the option
+values from the taglist plugin file to your .vimrc file and modify it.
+
+Adding support for a new language~
+If you want to add support for a new language to the taglist plugin, you need
+to first extend the exuberant ctags tool. For more information about extending
+exuberant ctags, visit the following page:
+
+    http://ctags.sourceforge.net/EXTENDING.html
+
+To add support for a new language, set the tlist_xxx_settings variable in the
+~/.vimrc file appropriately as described above. Replace 'xxx' in the variable
+name with the Vim filetype name for the new language.
+
+For example, to extend the taglist plugin to support the latex language, you
+can use the following line (assuming, you have already extended exuberant
+ctags to support the latex language):
+
+       let tlist_tex_settings='latex;b:bibitem;c:command;l:label'
+
+With the above line, when you edit files of filetype "tex" in Vim, the taglist
+plugin will invoke the exuberant ctags tool passing the "latex" filetype and
+the flags b, c and l to generate the tags. The text heading 'bibitem',
+'command' and 'label' will be used in the taglist window for the tags which
+are generated for the flags b, c and l respectively.
+
+==============================================================================
+                                               *taglist-faq*
+10. Frequently Asked Questions~
+
+Q. The taglist plugin doesn't work. The taglist window is empty and the tags
+   defined in a file are not displayed. 
+A. Are you using Vim version 6.0 and above? The taglist plugin relies on the
+   features supported by Vim version 6.0 and above. You can use the following
+   command to get the Vim version:
+>
+       $ vim --version
+<
+   Are you using exuberant ctags version 5.0 and above? The taglist plugin
+   relies on the features supported by exuberant ctags and will not work with
+   GNU ctags or the Unix ctags utility. You can use the following command to
+   determine whether the ctags installed in your system is exuberant ctags:
+>
+       $ ctags --version
+<
+   Is exuberant ctags present in one of the directories in your PATH? If not,
+   you need to set the Tlist_Ctags_Cmd variable to point to the location of
+   exuberant ctags. Use the following Vim command to verify that this is setup
+   correctly:
+>
+       :echo system(Tlist_Ctags_Cmd . ' --version')
+<
+   The above command should display the version information for exuberant
+   ctags.
+
+   Did you turn on the Vim filetype detection? The taglist plugin relies on
+   the filetype detected by Vim and passes the filetype to the exuberant ctags
+   utility to parse the tags. Check the output of the following Vim command:
+>
+       :filetype
+<
+   The output of the above command should contain "filetype detection:ON".
+   To turn on the filetype detection, add the following line to the .vimrc or
+   _vimrc file:
+>
+       filetype on
+<
+   Is your version of Vim compiled with the support for the system() function?
+   The following Vim command should display 1:
+>
+       :echo exists('*system')
+<
+   In some Linux distributions (particularly Suse Linux), the default Vim
+   installation is built without the support for the system() function. The
+   taglist plugin uses the system() function to invoke the exuberant ctags
+   utility. You need to rebuild Vim after enabling the support for the
+   system() function. If you use the default build options, the system()
+   function will be supported. 
+
+   Do you have the |'shellslash'| option set? You can try disabling the
+   |'shellslash'| option. When the taglist plugin invokes the exuberant ctags
+   utility with the path to the file, if the incorrect slashes are used, then
+   you will see errors.
+   
+   Check the shell related Vim options values using the following command:
+>
+       :set shell? shellcmdflag? shellpipe?
+       :set shellquote? shellredir? shellxquote?
+<
+   If these options are set in your .vimrc or _vimrc file, try removing those
+   lines.
+
+   Are you using a Unix shell in a MS-Windows environment? For example,
+   the Unix shell from the MKS-toolkit. Do you have the SHELL environment
+   set to point to this shell? You can try resetting the SHELL environment
+   variable.
+
+   If you are using a Unix shell on MS-Windows, you should try to use
+   exuberant ctags that is compiled for Unix-like environments so that
+   exuberant ctags will understand path names with forward slash characters.
+
+   Is your filetype supported by the exuberant ctags utility? The file types
+   supported by the exuberant ctags utility are listed in the ctags help. If a
+   file type is not supported, you have to extend exuberant ctags. You can use
+   the following command to list the filetypes supported by exuberant ctags:
+>
+       ctags --list-languages
+<
+   Run the following command from the shell prompt and check whether the tags
+   defined in your file are listed in the output from exuberant ctags:
+>
+       ctags -f - --format=2 --excmd=pattern --fields=nks <filename>
+<
+   If you see your tags in the output from the above command, then the
+   exuberant ctags utility is properly parsing your file.
+
+   Do you have the .ctags or _ctags or the ctags.cnf file in your home
+   directory for specifying default options or for extending exuberant ctags?
+   If you do have this file, check the options in this file and make sure
+   these options are not interfering with the operation of the taglist plugin.
+
+   If you are using MS-Windows, check the value of the TEMP and TMP
+   environment variables. If these environment variables are set to a path
+   with space characters in the name, then try using the DOS 8.3 short name
+   for the path or set them to a path without the space characters in the
+   name. For example, if the temporary directory name is "C:\Documents and
+   Settings\xyz\Local Settings\Temp", then try setting the TEMP variable to
+   the following:
+>
+       set TEMP=C:\DOCUMEN~1\xyz\LOCALS~1\Temp
+<
+   If exuberant ctags is installed in a directory with space characters in the
+   name, then try adding the directory to the PATH environment variable or try
+   setting the 'Tlist_Ctags_Cmd' variable to the shortest path name to ctags
+   or try copying the exuberant ctags to a path without space characters in
+   the name. For example, if exuberant ctags is installed in the directory
+   "C:\Program Files\Ctags", then try setting the 'Tlist_Ctags_Cmd' variable
+   as below:
+>
+       let Tlist_Ctags_Cmd='C:\Progra~1\Ctags\ctags.exe'
+<
+   If you are using a cygwin compiled version of exuberant ctags on MS-Windows,
+   make sure that either you have the cygwin compiled sort utility installed
+   and available in your PATH or compile exuberant ctags with internal sort
+   support. Otherwise, when exuberant ctags sorts the tags output by invoking
+   the sort utility, it may end up invoking the MS-Windows version of
+   sort.exe, thereby resulting in failure.
+
+Q. When I try to open the taglist window, I am seeing the following error
+   message. How do I fix this problem?
+
+   Taglist: Failed to generate tags for /my/path/to/file
+   ctags: illegal option -- -^@usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
+
+A. The taglist plugin will work only with the exuberant ctags tool. You
+   cannot use the GNU ctags or the Unix ctags program with the taglist plugin.
+   You will see an error message similar to the one shown above, if you try
+   use a non-exuberant ctags program with Vim. To fix this problem, either add
+   the exuberant ctags tool location to the PATH environment variable or set
+   the 'Tlist_Ctags_Cmd' variable.
+
+Q. A file has more than one tag with the same name. When I select a tag name
+   from the taglist window, the cursor is positioned at the incorrect tag
+   location. 
+A. The taglist plugin uses the search pattern generated by the exuberant ctags
+   utility to position the cursor at the location of a tag definition. If a
+   file has more than one tag with the same name and same prototype, then the
+   search pattern will be the same. In this case, when searching for the tag
+   pattern, the cursor may be positioned at the incorrect location. 
+
+Q. I have made some modifications to my file and introduced new
+   functions/classes/variables. I have not yet saved my file. The taglist
+   plugin is not displaying the new tags when I update the taglist window.
+A. The exuberant ctags utility will process only files that are present in the
+   disk. To list the tags defined in a file, you have to save the file and
+   then update the taglist window. 
+
+Q. I have created a ctags file using the exuberant ctags utility for my source
+   tree. How do I configure the taglist plugin to use this tags file? 
+A. The taglist plugin doesn't use a tags file stored in disk. For every opened
+   file, the taglist plugin invokes the exuberant ctags utility to get the
+   list of tags dynamically. The Vim system() function is used to invoke
+   exuberant ctags and get the ctags output. This function internally uses a
+   temporary file to store the output. This file is deleted after the output
+   from the command is read. So you will never see the file that contains the
+   output of exuberant ctags.
+
+Q. When I set the |'updatetime'| option to a low value (less than 1000) and if
+   I keep pressing a key with the taglist window open, the current buffer
+   contents are changed. Why is this?
+A. The taglist plugin uses the |CursorHold| autocmd to highlight the current
+   tag. The CursorHold autocmd triggers for every |'updatetime'| milliseconds.
+   If the |'updatetime'| option is set to a low value, then the CursorHold
+   autocmd will be triggered frequently. As the taglist plugin changes
+   the focus to the taglist window to highlight the current tag, this could
+   interfere with the key movement resulting in changing the contents of
+   the current buffer. The workaround for this problem is to not set the
+   |'updatetime'| option to a low value.
+
+==============================================================================
+                                               *taglist-license*
+11. License~
+Permission is hereby granted to use and distribute the taglist plugin, with or
+without modifications, provided that this copyright notice is copied with it.
+Like anything else that's free, taglist.vim is provided *as is* and comes with
+no warranty of any kind, either expressed or implied. In no event will the
+copyright holder be liable for any damamges resulting from the use of this
+software.
+
+==============================================================================
+                                               *taglist-todo*
+12. Todo~
+
+1. Group tags according to the scope and display them. For example,
+   group all the tags belonging to a C++/Java class 
+2. Support for displaying tags in a modified (not-yet-saved) file. 
+3. Automatically open the taglist window only for selected filetypes.
+   For other filetypes, close the taglist window. 
+4. When using the shell from the MKS toolkit, the taglist plugin 
+   doesn't work.
+5. The taglist plugin doesn't work with files edited remotely using the
+   netrw plugin. The exuberant ctags utility cannot process files over
+   scp/rcp/ftp, etc.
+
+==============================================================================
+
+vim:tw=78:ts=8:noet:ft=help:
diff --git a/vim/doc/tags b/vim/doc/tags
new file mode 100644 (file)
index 0000000..7c855b7
--- /dev/null
@@ -0,0 +1,892 @@
+'NERDAllowAnyVisualDelims'     NERD_commenter.txt      /*'NERDAllowAnyVisualDelims'*
+'NERDBlockComIgnoreEmpty'      NERD_commenter.txt      /*'NERDBlockComIgnoreEmpty'*
+'NERDChristmasTree'    NERD_tree.txt   /*'NERDChristmasTree'*
+'NERDCommentWholeLinesInVMode' NERD_commenter.txt      /*'NERDCommentWholeLinesInVMode'*
+'NERDCompactSexyComs'  NERD_commenter.txt      /*'NERDCompactSexyComs'*
+'NERDCreateDefaultMappings'    NERD_commenter.txt      /*'NERDCreateDefaultMappings'*
+'NERDDefaultNesting'   NERD_commenter.txt      /*'NERDDefaultNesting'*
+'NERDLPlace'   NERD_commenter.txt      /*'NERDLPlace'*
+'NERDMenuMode' NERD_commenter.txt      /*'NERDMenuMode'*
+'NERDRPlace'   NERD_commenter.txt      /*'NERDRPlace'*
+'NERDRemoveAltComs'    NERD_commenter.txt      /*'NERDRemoveAltComs'*
+'NERDRemoveExtraSpaces'        NERD_commenter.txt      /*'NERDRemoveExtraSpaces'*
+'NERDSpaceDelims'      NERD_commenter.txt      /*'NERDSpaceDelims'*
+'NERDTreeAutoCenter'   NERD_tree.txt   /*'NERDTreeAutoCenter'*
+'NERDTreeAutoCenterThreshold'  NERD_tree.txt   /*'NERDTreeAutoCenterThreshold'*
+'NERDTreeBookmarksFile'        NERD_tree.txt   /*'NERDTreeBookmarksFile'*
+'NERDTreeCaseSensitiveSort'    NERD_tree.txt   /*'NERDTreeCaseSensitiveSort'*
+'NERDTreeChDirMode'    NERD_tree.txt   /*'NERDTreeChDirMode'*
+'NERDTreeHighlightCursorline'  NERD_tree.txt   /*'NERDTreeHighlightCursorline'*
+'NERDTreeHijackNetrw'  NERD_tree.txt   /*'NERDTreeHijackNetrw'*
+'NERDTreeIgnore'       NERD_tree.txt   /*'NERDTreeIgnore'*
+'NERDTreeMouseMode'    NERD_tree.txt   /*'NERDTreeMouseMode'*
+'NERDTreeQuitOnOpen'   NERD_tree.txt   /*'NERDTreeQuitOnOpen'*
+'NERDTreeShowBookmarks'        NERD_tree.txt   /*'NERDTreeShowBookmarks'*
+'NERDTreeShowFiles'    NERD_tree.txt   /*'NERDTreeShowFiles'*
+'NERDTreeShowHidden'   NERD_tree.txt   /*'NERDTreeShowHidden'*
+'NERDTreeShowLineNumbers'      NERD_tree.txt   /*'NERDTreeShowLineNumbers'*
+'NERDTreeSortOrder'    NERD_tree.txt   /*'NERDTreeSortOrder'*
+'NERDTreeStatusline'   NERD_tree.txt   /*'NERDTreeStatusline'*
+'NERDTreeWinPos'       NERD_tree.txt   /*'NERDTreeWinPos'*
+'NERDTreeWinSize'      NERD_tree.txt   /*'NERDTreeWinSize'*
+'NERDUsePlaceHolders'  NERD_commenter.txt      /*'NERDUsePlaceHolders'*
+'Tlist_Auto_Highlight_Tag'     taglist.txt     /*'Tlist_Auto_Highlight_Tag'*
+'Tlist_Auto_Open'      taglist.txt     /*'Tlist_Auto_Open'*
+'Tlist_Auto_Update'    taglist.txt     /*'Tlist_Auto_Update'*
+'Tlist_Close_On_Select'        taglist.txt     /*'Tlist_Close_On_Select'*
+'Tlist_Compact_Format' taglist.txt     /*'Tlist_Compact_Format'*
+'Tlist_Ctags_Cmd'      taglist.txt     /*'Tlist_Ctags_Cmd'*
+'Tlist_Display_Prototype'      taglist.txt     /*'Tlist_Display_Prototype'*
+'Tlist_Display_Tag_Scope'      taglist.txt     /*'Tlist_Display_Tag_Scope'*
+'Tlist_Enable_Fold_Column'     taglist.txt     /*'Tlist_Enable_Fold_Column'*
+'Tlist_Exit_OnlyWindow'        taglist.txt     /*'Tlist_Exit_OnlyWindow'*
+'Tlist_File_Fold_Auto_Close'   taglist.txt     /*'Tlist_File_Fold_Auto_Close'*
+'Tlist_GainFocus_On_ToggleOpen'        taglist.txt     /*'Tlist_GainFocus_On_ToggleOpen'*
+'Tlist_Highlight_Tag_On_BufEnter'      taglist.txt     /*'Tlist_Highlight_Tag_On_BufEnter'*
+'Tlist_Inc_Winwidth'   taglist.txt     /*'Tlist_Inc_Winwidth'*
+'Tlist_Max_Submenu_Items'      taglist.txt     /*'Tlist_Max_Submenu_Items'*
+'Tlist_Max_Tag_Length' taglist.txt     /*'Tlist_Max_Tag_Length'*
+'Tlist_Process_File_Always'    taglist.txt     /*'Tlist_Process_File_Always'*
+'Tlist_Show_Menu'      taglist.txt     /*'Tlist_Show_Menu'*
+'Tlist_Show_One_File'  taglist.txt     /*'Tlist_Show_One_File'*
+'Tlist_Sort_Type'      taglist.txt     /*'Tlist_Sort_Type'*
+'Tlist_Use_Horiz_Window'       taglist.txt     /*'Tlist_Use_Horiz_Window'*
+'Tlist_Use_Right_Window'       taglist.txt     /*'Tlist_Use_Right_Window'*
+'Tlist_Use_SingleClick'        taglist.txt     /*'Tlist_Use_SingleClick'*
+'Tlist_WinHeight'      taglist.txt     /*'Tlist_WinHeight'*
+'Tlist_WinWidth'       taglist.txt     /*'Tlist_WinWidth'*
+'b:delimitMate_autoclose'      delimitMate.txt /*'b:delimitMate_autoclose'*
+'b:delimitMate_balance_matchpairs'     delimitMate.txt /*'b:delimitMate_balance_matchpairs'*
+'b:delimitMate_expand_cr'      delimitMate.txt /*'b:delimitMate_expand_cr'*
+'b:delimitMate_expand_space'   delimitMate.txt /*'b:delimitMate_expand_space'*
+'b:delimitMate_matchpairs'     delimitMate.txt /*'b:delimitMate_matchpairs'*
+'b:delimitMate_nesting_quotes' delimitMate.txt /*'b:delimitMate_nesting_quotes'*
+'b:delimitMate_quotes' delimitMate.txt /*'b:delimitMate_quotes'*
+'b:delimitMate_smart_matchpairs'       delimitMate.txt /*'b:delimitMate_smart_matchpairs'*
+'b:delimitMate_smart_quotes'   delimitMate.txt /*'b:delimitMate_smart_quotes'*
+'b:loaded_delimitMate' delimitMate.txt /*'b:loaded_delimitMate'*
+'delimitMate_apostrophes'      delimitMate.txt /*'delimitMate_apostrophes'*
+'delimitMate_autoclose'        delimitMate.txt /*'delimitMate_autoclose'*
+'delimitMate_balance_matchpairs'       delimitMate.txt /*'delimitMate_balance_matchpairs'*
+'delimitMate_excluded_ft'      delimitMate.txt /*'delimitMate_excluded_ft'*
+'delimitMate_excluded_regions' delimitMate.txt /*'delimitMate_excluded_regions'*
+'delimitMate_expand_cr'        delimitMate.txt /*'delimitMate_expand_cr'*
+'delimitMate_expand_space'     delimitMate.txt /*'delimitMate_expand_space'*
+'delimitMate_matchpairs'       delimitMate.txt /*'delimitMate_matchpairs'*
+'delimitMate_nesting_quotes'   delimitMate.txt /*'delimitMate_nesting_quotes'*
+'delimitMate_quotes'   delimitMate.txt /*'delimitMate_quotes'*
+'delimitMate_smart_matchpairs' delimitMate.txt /*'delimitMate_smart_matchpairs'*
+'delimitMate_smart_quotes'     delimitMate.txt /*'delimitMate_smart_quotes'*
+'loaded_delimitMate'   delimitMate.txt /*'loaded_delimitMate'*
+'loaded_nerd_comments' NERD_commenter.txt      /*'loaded_nerd_comments'*
+'loaded_nerd_tree'     NERD_tree.txt   /*'loaded_nerd_tree'*
+'showmarks_enable'     showmarks.txt   /*'showmarks_enable'*
+'showmarks_hlline_lower'       showmarks.txt   /*'showmarks_hlline_lower'*
+'showmarks_hlline_other'       showmarks.txt   /*'showmarks_hlline_other'*
+'showmarks_hlline_upper'       showmarks.txt   /*'showmarks_hlline_upper'*
+'showmarks_ignore_name'        showmarks.txt   /*'showmarks_ignore_name'*
+'showmarks_ignore_type'        showmarks.txt   /*'showmarks_ignore_type'*
+'showmarks_include'    showmarks.txt   /*'showmarks_include'*
+'showmarks_textother'  showmarks.txt   /*'showmarks_textother'*
+'showmarks_textupper'  showmarks.txt   /*'showmarks_textupper'*
+'snippets'     snipMate.txt    /*'snippets'*
+'solarized_bold'       solarized.txt   /*'solarized_bold'*
+'solarized_contrast'   solarized.txt   /*'solarized_contrast'*
+'solarized_degrade'    solarized.txt   /*'solarized_degrade'*
+'solarized_hitrail'    solarized.txt   /*'solarized_hitrail'*
+'solarized_italic'     solarized.txt   /*'solarized_italic'*
+'solarized_menu'       solarized.txt   /*'solarized_menu'*
+'solarized_termcolors' solarized.txt   /*'solarized_termcolors'*
+'solarized_termtrans'  solarized.txt   /*'solarized_termtrans'*
+'solarized_underline'  solarized.txt   /*'solarized_underline'*
+'solarized_visibility' solarized.txt   /*'solarized_visibility'*
+'syntastic_auto_jump'  syntastic.txt   /*'syntastic_auto_jump'*
+'syntastic_auto_loc_list'      syntastic.txt   /*'syntastic_auto_loc_list'*
+'syntastic_check_on_open'      syntastic.txt   /*'syntastic_check_on_open'*
+'syntastic_echo_current_error' syntastic.txt   /*'syntastic_echo_current_error'*
+'syntastic_enable_balloons'    syntastic.txt   /*'syntastic_enable_balloons'*
+'syntastic_enable_highlighting'        syntastic.txt   /*'syntastic_enable_highlighting'*
+'syntastic_enable_signs'       syntastic.txt   /*'syntastic_enable_signs'*
+'syntastic_loc_list_height'    syntastic.txt   /*'syntastic_loc_list_height'*
+'syntastic_mode_map'   syntastic.txt   /*'syntastic_mode_map'*
+'syntastic_quiet_warnings'     syntastic.txt   /*'syntastic_quiet_warnings'*
+'syntastic_stl_format' syntastic.txt   /*'syntastic_stl_format'*
+.snippet       snipMate.txt    /*.snippet*
+.snippets      snipMate.txt    /*.snippets*
+:Ack   ack.txt /*:Ack*
+:AckAdd        ack.txt /*:AckAdd*
+:AckFile       ack.txt /*:AckFile*
+:AckFromSearch ack.txt /*:AckFromSearch*
+:CoffeeCompile coffee-script.txt       /*:CoffeeCompile*
+:CoffeeMake    coffee-script.txt       /*:CoffeeMake*
+:CoffeeMake!   coffee-script.txt       /*:CoffeeMake!*
+:CoffeeRun     coffee-script.txt       /*:CoffeeRun*
+:CommandT      command-t.txt   /*:CommandT*
+:CommandTBuffer        command-t.txt   /*:CommandTBuffer*
+:CommandTFlush command-t.txt   /*:CommandTFlush*
+:CommandTJumps command-t.txt   /*:CommandTJumps*
+:DelimitMateReload     delimitMate.txt /*:DelimitMateReload*
+:DelimitMateSwitch     delimitMate.txt /*:DelimitMateSwitch*
+:DelimitMateTest       delimitMate.txt /*:DelimitMateTest*
+:Errors        syntastic.txt   /*:Errors*
+:Gist  gist-vim.txt    /*:Gist*
+:LAck  ack.txt /*:LAck*
+:LAckAdd       ack.txt /*:LAckAdd*
+:LuaInspect    luainspect.txt  /*:LuaInspect*
+:LuaInspectToggle      luainspect.txt  /*:LuaInspectToggle*
+:NERDTree      NERD_tree.txt   /*:NERDTree*
+:NERDTreeClose NERD_tree.txt   /*:NERDTreeClose*
+:NERDTreeFind  NERD_tree.txt   /*:NERDTreeFind*
+:NERDTreeFromBookmark  NERD_tree.txt   /*:NERDTreeFromBookmark*
+:NERDTreeMirror        NERD_tree.txt   /*:NERDTreeMirror*
+:NERDTreeToggle        NERD_tree.txt   /*:NERDTreeToggle*
+:SyntasticCheck        syntastic.txt   /*:SyntasticCheck*
+:SyntasticErrors       syntastic.txt   /*:SyntasticErrors*
+:SyntasticToggleMode   syntastic.txt   /*:SyntasticToggleMode*
+:TlistAddFiles taglist.txt     /*:TlistAddFiles*
+:TlistAddFilesRecursive        taglist.txt     /*:TlistAddFilesRecursive*
+:TlistClose    taglist.txt     /*:TlistClose*
+:TlistDebug    taglist.txt     /*:TlistDebug*
+:TlistHighlightTag     taglist.txt     /*:TlistHighlightTag*
+:TlistLock     taglist.txt     /*:TlistLock*
+:TlistMessages taglist.txt     /*:TlistMessages*
+:TlistOpen     taglist.txt     /*:TlistOpen*
+:TlistSessionLoad      taglist.txt     /*:TlistSessionLoad*
+:TlistSessionSave      taglist.txt     /*:TlistSessionSave*
+:TlistShowPrototype    taglist.txt     /*:TlistShowPrototype*
+:TlistShowTag  taglist.txt     /*:TlistShowTag*
+:TlistToggle   taglist.txt     /*:TlistToggle*
+:TlistUndebug  taglist.txt     /*:TlistUndebug*
+:TlistUnlock   taglist.txt     /*:TlistUnlock*
+:TlistUpdate   taglist.txt     /*:TlistUpdate*
+Align-copyright        Align.txt       /*Align-copyright*
+ConqueTerm     conque_term.txt /*ConqueTerm*
+ExtractSnips() snipMate.txt    /*ExtractSnips()*
+ExtractSnipsFile()     snipMate.txt    /*ExtractSnipsFile()*
+Filename()     snipMate.txt    /*Filename()*
+Gist.vim       gist-vim.txt    /*Gist.vim*
+NERDComAbout   NERD_commenter.txt      /*NERDComAbout*
+NERDComAlignedComment  NERD_commenter.txt      /*NERDComAlignedComment*
+NERDComAltDelim        NERD_commenter.txt      /*NERDComAltDelim*
+NERDComAppendComment   NERD_commenter.txt      /*NERDComAppendComment*
+NERDComChangelog       NERD_commenter.txt      /*NERDComChangelog*
+NERDComComment NERD_commenter.txt      /*NERDComComment*
+NERDComCredits NERD_commenter.txt      /*NERDComCredits*
+NERDComDefaultDelims   NERD_commenter.txt      /*NERDComDefaultDelims*
+NERDComEOLComment      NERD_commenter.txt      /*NERDComEOLComment*
+NERDComFunctionality   NERD_commenter.txt      /*NERDComFunctionality*
+NERDComFunctionalityDetails    NERD_commenter.txt      /*NERDComFunctionalityDetails*
+NERDComFunctionalitySummary    NERD_commenter.txt      /*NERDComFunctionalitySummary*
+NERDComHeuristics      NERD_commenter.txt      /*NERDComHeuristics*
+NERDComInsertComment   NERD_commenter.txt      /*NERDComInsertComment*
+NERDComInstallation    NERD_commenter.txt      /*NERDComInstallation*
+NERDComInvertComment   NERD_commenter.txt      /*NERDComInvertComment*
+NERDComIssues  NERD_commenter.txt      /*NERDComIssues*
+NERDComLicense NERD_commenter.txt      /*NERDComLicense*
+NERDComMappings        NERD_commenter.txt      /*NERDComMappings*
+NERDComMinimalComment  NERD_commenter.txt      /*NERDComMinimalComment*
+NERDComNERDComment     NERD_commenter.txt      /*NERDComNERDComment*
+NERDComNestedComment   NERD_commenter.txt      /*NERDComNestedComment*
+NERDComNesting NERD_commenter.txt      /*NERDComNesting*
+NERDComOptions NERD_commenter.txt      /*NERDComOptions*
+NERDComOptionsDetails  NERD_commenter.txt      /*NERDComOptionsDetails*
+NERDComOptionsSummary  NERD_commenter.txt      /*NERDComOptionsSummary*
+NERDComSexyComment     NERD_commenter.txt      /*NERDComSexyComment*
+NERDComSexyComments    NERD_commenter.txt      /*NERDComSexyComments*
+NERDComToggleComment   NERD_commenter.txt      /*NERDComToggleComment*
+NERDComUncommentLine   NERD_commenter.txt      /*NERDComUncommentLine*
+NERDComYankComment     NERD_commenter.txt      /*NERDComYankComment*
+NERDCommenter  NERD_commenter.txt      /*NERDCommenter*
+NERDCommenterContents  NERD_commenter.txt      /*NERDCommenterContents*
+NERDTree       NERD_tree.txt   /*NERDTree*
+NERDTree-?     NERD_tree.txt   /*NERDTree-?*
+NERDTree-A     NERD_tree.txt   /*NERDTree-A*
+NERDTree-B     NERD_tree.txt   /*NERDTree-B*
+NERDTree-C     NERD_tree.txt   /*NERDTree-C*
+NERDTree-C-J   NERD_tree.txt   /*NERDTree-C-J*
+NERDTree-C-K   NERD_tree.txt   /*NERDTree-C-K*
+NERDTree-D     NERD_tree.txt   /*NERDTree-D*
+NERDTree-F     NERD_tree.txt   /*NERDTree-F*
+NERDTree-I     NERD_tree.txt   /*NERDTree-I*
+NERDTree-J     NERD_tree.txt   /*NERDTree-J*
+NERDTree-K     NERD_tree.txt   /*NERDTree-K*
+NERDTree-O     NERD_tree.txt   /*NERDTree-O*
+NERDTree-P     NERD_tree.txt   /*NERDTree-P*
+NERDTree-R     NERD_tree.txt   /*NERDTree-R*
+NERDTree-T     NERD_tree.txt   /*NERDTree-T*
+NERDTree-U     NERD_tree.txt   /*NERDTree-U*
+NERDTree-X     NERD_tree.txt   /*NERDTree-X*
+NERDTree-cd    NERD_tree.txt   /*NERDTree-cd*
+NERDTree-contents      NERD_tree.txt   /*NERDTree-contents*
+NERDTree-e     NERD_tree.txt   /*NERDTree-e*
+NERDTree-f     NERD_tree.txt   /*NERDTree-f*
+NERDTree-gi    NERD_tree.txt   /*NERDTree-gi*
+NERDTree-go    NERD_tree.txt   /*NERDTree-go*
+NERDTree-gs    NERD_tree.txt   /*NERDTree-gs*
+NERDTree-i     NERD_tree.txt   /*NERDTree-i*
+NERDTree-m     NERD_tree.txt   /*NERDTree-m*
+NERDTree-o     NERD_tree.txt   /*NERDTree-o*
+NERDTree-p     NERD_tree.txt   /*NERDTree-p*
+NERDTree-q     NERD_tree.txt   /*NERDTree-q*
+NERDTree-r     NERD_tree.txt   /*NERDTree-r*
+NERDTree-s     NERD_tree.txt   /*NERDTree-s*
+NERDTree-t     NERD_tree.txt   /*NERDTree-t*
+NERDTree-u     NERD_tree.txt   /*NERDTree-u*
+NERDTree-x     NERD_tree.txt   /*NERDTree-x*
+NERDTreeAPI    NERD_tree.txt   /*NERDTreeAPI*
+NERDTreeAbout  NERD_tree.txt   /*NERDTreeAbout*
+NERDTreeAddKeyMap()    NERD_tree.txt   /*NERDTreeAddKeyMap()*
+NERDTreeAddMenuItem()  NERD_tree.txt   /*NERDTreeAddMenuItem()*
+NERDTreeAddMenuSeparator()     NERD_tree.txt   /*NERDTreeAddMenuSeparator()*
+NERDTreeAddSubmenu()   NERD_tree.txt   /*NERDTreeAddSubmenu()*
+NERDTreeBookmarkCommands       NERD_tree.txt   /*NERDTreeBookmarkCommands*
+NERDTreeBookmarkTable  NERD_tree.txt   /*NERDTreeBookmarkTable*
+NERDTreeBookmarks      NERD_tree.txt   /*NERDTreeBookmarks*
+NERDTreeChangelog      NERD_tree.txt   /*NERDTreeChangelog*
+NERDTreeCredits        NERD_tree.txt   /*NERDTreeCredits*
+NERDTreeFunctionality  NERD_tree.txt   /*NERDTreeFunctionality*
+NERDTreeGlobalCommands NERD_tree.txt   /*NERDTreeGlobalCommands*
+NERDTreeInvalidBookmarks       NERD_tree.txt   /*NERDTreeInvalidBookmarks*
+NERDTreeKeymapAPI      NERD_tree.txt   /*NERDTreeKeymapAPI*
+NERDTreeLicense        NERD_tree.txt   /*NERDTreeLicense*
+NERDTreeMappings       NERD_tree.txt   /*NERDTreeMappings*
+NERDTreeMenu   NERD_tree.txt   /*NERDTreeMenu*
+NERDTreeMenuAPI        NERD_tree.txt   /*NERDTreeMenuAPI*
+NERDTreeOptionDetails  NERD_tree.txt   /*NERDTreeOptionDetails*
+NERDTreeOptionSummary  NERD_tree.txt   /*NERDTreeOptionSummary*
+NERDTreeOptions        NERD_tree.txt   /*NERDTreeOptions*
+NERDTreeRender()       NERD_tree.txt   /*NERDTreeRender()*
+NERD_commenter.txt     NERD_commenter.txt      /*NERD_commenter.txt*
+NERD_tree.txt  NERD_tree.txt   /*NERD_tree.txt*
+ReloadAllSnippets()    snipMate.txt    /*ReloadAllSnippets()*
+ReloadSnippets()       snipMate.txt    /*ReloadSnippets()*
+ResetAllSnippets()     snipMate.txt    /*ResetAllSnippets()*
+ResetSnippets()        snipMate.txt    /*ResetSnippets()*
+ShowMarksClearAll      showmarks.txt   /*ShowMarksClearAll*
+ShowMarksClearMark     showmarks.txt   /*ShowMarksClearMark*
+ShowMarksOn    showmarks.txt   /*ShowMarksOn*
+ShowMarksPlaceMark     showmarks.txt   /*ShowMarksPlaceMark*
+ShowMarksToggle        showmarks.txt   /*ShowMarksToggle*
+SyntasticMake()        syntastic.txt   /*SyntasticMake()*
+Tlist_Get_Tag_Prototype_By_Line()      taglist.txt     /*Tlist_Get_Tag_Prototype_By_Line()*
+Tlist_Get_Tagname_By_Line()    taglist.txt     /*Tlist_Get_Tagname_By_Line()*
+Tlist_Set_App()        taglist.txt     /*Tlist_Set_App()*
+Tlist_Update_File_Tags()       taglist.txt     /*Tlist_Update_File_Tags()*
+ZoomWin.txt    ZoomWin.txt     /*ZoomWin.txt*
+[<Space>       unimpaired.txt  /*[<Space>*
+[A     unimpaired.txt  /*[A*
+[B     unimpaired.txt  /*[B*
+[L     unimpaired.txt  /*[L*
+[Q     unimpaired.txt  /*[Q*
+[T     unimpaired.txt  /*[T*
+[a     unimpaired.txt  /*[a*
+[b     unimpaired.txt  /*[b*
+[e     unimpaired.txt  /*[e*
+[l     unimpaired.txt  /*[l*
+[o     unimpaired.txt  /*[o*
+[q     unimpaired.txt  /*[q*
+[t     unimpaired.txt  /*[t*
+[u     unimpaired.txt  /*[u*
+[uu    unimpaired.txt  /*[uu*
+[x     unimpaired.txt  /*[x*
+[xx    unimpaired.txt  /*[xx*
+[y     unimpaired.txt  /*[y*
+[yy    unimpaired.txt  /*[yy*
+]<Space>       unimpaired.txt  /*]<Space>*
+]A     unimpaired.txt  /*]A*
+]B     unimpaired.txt  /*]B*
+]L     unimpaired.txt  /*]L*
+]Q     unimpaired.txt  /*]Q*
+]T     unimpaired.txt  /*]T*
+]a     unimpaired.txt  /*]a*
+]b     unimpaired.txt  /*]b*
+]e     unimpaired.txt  /*]e*
+]l     unimpaired.txt  /*]l*
+]o     unimpaired.txt  /*]o*
+]q     unimpaired.txt  /*]q*
+]t     unimpaired.txt  /*]t*
+]u     unimpaired.txt  /*]u*
+]uu    unimpaired.txt  /*]uu*
+]x     unimpaired.txt  /*]x*
+]xx    unimpaired.txt  /*]xx*
+]y     unimpaired.txt  /*]y*
+]yy    unimpaired.txt  /*]yy*
+aI     indent-object.txt       /*aI*
+ack    ack.txt /*ack*
+ack-author     ack.txt /*ack-author*
+ack.txt        ack.txt /*ack.txt*
+ai     indent-object.txt       /*ai*
+align  Align.txt       /*align*
+align-align    Align.txt       /*align-align*
+align-codepoint        Align.txt       /*align-codepoint*
+align-command  Align.txt       /*align-command*
+align-commands Align.txt       /*align-commands*
+align-concept  Align.txt       /*align-concept*
+align-concepts Align.txt       /*align-concepts*
+align-contents Align.txt       /*align-contents*
+align-control  Align.txt       /*align-control*
+align-history  Align.txt       /*align-history*
+align-manual   Align.txt       /*align-manual*
+align-maps     Align.txt       /*align-maps*
+align-multibyte        Align.txt       /*align-multibyte*
+align-option   Align.txt       /*align-option*
+align-options  Align.txt       /*align-options*
+align-strlen   Align.txt       /*align-strlen*
+align-usage    Align.txt       /*align-usage*
+align-userguide        Align.txt       /*align-userguide*
+align-utf      Align.txt       /*align-utf*
+align-utf8     Align.txt       /*align-utf8*
+align.txt      Align.txt       /*align.txt*
+alignctrl      Align.txt       /*alignctrl*
+alignctrl-     Align.txt       /*alignctrl-*
+alignctrl-+    Align.txt       /*alignctrl-+*
+alignctrl--    Align.txt       /*alignctrl--*
+alignctrl-:    Align.txt       /*alignctrl-:*
+alignctrl-<    Align.txt       /*alignctrl-<*
+alignctrl-=    Align.txt       /*alignctrl-=*
+alignctrl->    Align.txt       /*alignctrl->*
+alignctrl-C    Align.txt       /*alignctrl-C*
+alignctrl-I    Align.txt       /*alignctrl-I*
+alignctrl-P    Align.txt       /*alignctrl-P*
+alignctrl-W    Align.txt       /*alignctrl-W*
+alignctrl-c    Align.txt       /*alignctrl-c*
+alignctrl-g    Align.txt       /*alignctrl-g*
+alignctrl-l    Align.txt       /*alignctrl-l*
+alignctrl-m    Align.txt       /*alignctrl-m*
+alignctrl-no-option    Align.txt       /*alignctrl-no-option*
+alignctrl-p    Align.txt       /*alignctrl-p*
+alignctrl-r    Align.txt       /*alignctrl-r*
+alignctrl-separators   Align.txt       /*alignctrl-separators*
+alignctrl-settings     Align.txt       /*alignctrl-settings*
+alignctrl-v    Align.txt       /*alignctrl-v*
+alignctrl-w    Align.txt       /*alignctrl-w*
+alignman       Align.txt       /*alignman*
+alignmanual    Align.txt       /*alignmanual*
+alignmap-Htd   Align.txt       /*alignmap-Htd*
+alignmap-T=    Align.txt       /*alignmap-T=*
+alignmap-Tsp   Align.txt       /*alignmap-Tsp*
+alignmap-a(    Align.txt       /*alignmap-a(*
+alignmap-a,    Align.txt       /*alignmap-a,*
+alignmap-a<    Align.txt       /*alignmap-a<*
+alignmap-a=    Align.txt       /*alignmap-a=*
+alignmap-a?    Align.txt       /*alignmap-a?*
+alignmap-abox  Align.txt       /*alignmap-abox*
+alignmap-acom  Align.txt       /*alignmap-acom*
+alignmap-adcom Align.txt       /*alignmap-adcom*
+alignmap-adec  Align.txt       /*alignmap-adec*
+alignmap-adef  Align.txt       /*alignmap-adef*
+alignmap-afnc  Align.txt       /*alignmap-afnc*
+alignmap-anum  Align.txt       /*alignmap-anum*
+alignmap-aocom Align.txt       /*alignmap-aocom*
+alignmap-ascom Align.txt       /*alignmap-ascom*
+alignmap-history       Align.txt       /*alignmap-history*
+alignmap-m=    Align.txt       /*alignmap-m=*
+alignmap-t#    Align.txt       /*alignmap-t#*
+alignmap-t,    Align.txt       /*alignmap-t,*
+alignmap-t:    Align.txt       /*alignmap-t:*
+alignmap-t;    Align.txt       /*alignmap-t;*
+alignmap-t<    Align.txt       /*alignmap-t<*
+alignmap-t=    Align.txt       /*alignmap-t=*
+alignmap-t?    Align.txt       /*alignmap-t?*
+alignmap-tab   Align.txt       /*alignmap-tab*
+alignmap-tml   Align.txt       /*alignmap-tml*
+alignmap-ts,   Align.txt       /*alignmap-ts,*
+alignmap-ts:   Align.txt       /*alignmap-ts:*
+alignmap-ts<   Align.txt       /*alignmap-ts<*
+alignmap-ts=   Align.txt       /*alignmap-ts=*
+alignmap-tsp   Align.txt       /*alignmap-tsp*
+alignmap-tsq   Align.txt       /*alignmap-tsq*
+alignmap-tt    Align.txt       /*alignmap-tt*
+alignmap-t~    Align.txt       /*alignmap-t~*
+alignmaps      Align.txt       /*alignmaps*
+alignusage     Align.txt       /*alignusage*
+before solarized.txt   /*before*
+coffee-script  coffee-script.txt       /*coffee-script*
+coffee-script-author   coffee-script.txt       /*coffee-script-author*
+coffee-script-commands coffee-script.txt       /*coffee-script-commands*
+coffee-script-contents coffee-script.txt       /*coffee-script-contents*
+coffee-script-introduction     coffee-script.txt       /*coffee-script-introduction*
+coffee-script-license  coffee-script.txt       /*coffee-script-license*
+coffee-script-settings coffee-script.txt       /*coffee-script-settings*
+coffee-script.txt      coffee-script.txt       /*coffee-script.txt*
+command-t      command-t.txt   /*command-t*
+command-t-authors      command-t.txt   /*command-t-authors*
+command-t-commands     command-t.txt   /*command-t-commands*
+command-t-contents     command-t.txt   /*command-t-contents*
+command-t-donations    command-t.txt   /*command-t-donations*
+command-t-history      command-t.txt   /*command-t-history*
+command-t-installation command-t.txt   /*command-t-installation*
+command-t-intro        command-t.txt   /*command-t-intro*
+command-t-license      command-t.txt   /*command-t-license*
+command-t-mappings     command-t.txt   /*command-t-mappings*
+command-t-options      command-t.txt   /*command-t-options*
+command-t-pathogen     command-t.txt   /*command-t-pathogen*
+command-t-requirements command-t.txt   /*command-t-requirements*
+command-t-trouble-shooting     command-t.txt   /*command-t-trouble-shooting*
+command-t-usage        command-t.txt   /*command-t-usage*
+command-t-website      command-t.txt   /*command-t-website*
+command-t-wildignore   command-t.txt   /*command-t-wildignore*
+command-t.txt  command-t.txt   /*command-t.txt*
+config/rails.vim       rails.txt       /*config\/rails.vim*
+conque_term-bugs       conque_term.txt /*conque_term-bugs*
+conque_term-changelog  conque_term.txt /*conque_term-changelog*
+conque_term-contribute conque_term.txt /*conque_term-contribute*
+conque_term-requirements       conque_term.txt /*conque_term-requirements*
+conque_term-settings   conque_term.txt /*conque_term-settings*
+conque_term-todo       conque_term.txt /*conque_term-todo*
+conque_term-usage      conque_term.txt /*conque_term-usage*
+cs     surround.txt    /*cs*
+delimitMate    delimitMate.txt /*delimitMate*
+delimitMate#JumpAny()  delimitMate.txt /*delimitMate#JumpAny()*
+delimitMate#ShouldJump()       delimitMate.txt /*delimitMate#ShouldJump()*
+delimitMate#WithinEmptyPair()  delimitMate.txt /*delimitMate#WithinEmptyPair()*
+delimitMate-contents   delimitMate.txt /*delimitMate-contents*
+delimitMate.txt        delimitMate.txt /*delimitMate.txt*
+delimitMateAutoClose   delimitMate.txt /*delimitMateAutoClose*
+delimitMateBackspace   delimitMate.txt /*delimitMateBackspace*
+delimitMateBalance     delimitMate.txt /*delimitMateBalance*
+delimitMateCommands    delimitMate.txt /*delimitMateCommands*
+delimitMateCredits     delimitMate.txt /*delimitMateCredits*
+delimitMateExpansion   delimitMate.txt /*delimitMateExpansion*
+delimitMateFileType    delimitMate.txt /*delimitMateFileType*
+delimitMateFunctionality       delimitMate.txt /*delimitMateFunctionality*
+delimitMateFunctions   delimitMate.txt /*delimitMateFunctions*
+delimitMateHistory     delimitMate.txt /*delimitMateHistory*
+delimitMateIntro       delimitMate.txt /*delimitMateIntro*
+delimitMateMaintainer  delimitMate.txt /*delimitMateMaintainer*
+delimitMateMappings    delimitMate.txt /*delimitMateMappings*
+delimitMateOptionDetails       delimitMate.txt /*delimitMateOptionDetails*
+delimitMateOptionSummary       delimitMate.txt /*delimitMateOptionSummary*
+delimitMateOptions     delimitMate.txt /*delimitMateOptions*
+delimitMateSmartMatchpairs     delimitMate.txt /*delimitMateSmartMatchpairs*
+delimitMateSmartQuotes delimitMate.txt /*delimitMateSmartQuotes*
+delimitMateSyntax      delimitMate.txt /*delimitMateSyntax*
+delimitMateTodo        delimitMate.txt /*delimitMateTodo*
+ds     surround.txt    /*ds*
+ft-coffee-script-syntax        coffee-script.txt       /*ft-coffee-script-syntax*
+ft-gitcommit-plugin    ft-gitcommit-plugin.txt /*ft-gitcommit-plugin*
+fugitive       fugitive.txt    /*fugitive*
+fugitive#statusline()  fugitive.txt    /*fugitive#statusline()*
+fugitive-:Gblame       fugitive.txt    /*fugitive-:Gblame*
+fugitive-:Gbrowse      fugitive.txt    /*fugitive-:Gbrowse*
+fugitive-:Gcd  fugitive.txt    /*fugitive-:Gcd*
+fugitive-:Gcommit      fugitive.txt    /*fugitive-:Gcommit*
+fugitive-:Gdiff        fugitive.txt    /*fugitive-:Gdiff*
+fugitive-:Ge   fugitive.txt    /*fugitive-:Ge*
+fugitive-:Gedit        fugitive.txt    /*fugitive-:Gedit*
+fugitive-:Ggrep        fugitive.txt    /*fugitive-:Ggrep*
+fugitive-:Git  fugitive.txt    /*fugitive-:Git*
+fugitive-:Git! fugitive.txt    /*fugitive-:Git!*
+fugitive-:Glcd fugitive.txt    /*fugitive-:Glcd*
+fugitive-:Glog fugitive.txt    /*fugitive-:Glog*
+fugitive-:Gmove        fugitive.txt    /*fugitive-:Gmove*
+fugitive-:Gpedit       fugitive.txt    /*fugitive-:Gpedit*
+fugitive-:Gpedit!      fugitive.txt    /*fugitive-:Gpedit!*
+fugitive-:Gread        fugitive.txt    /*fugitive-:Gread*
+fugitive-:Gread!       fugitive.txt    /*fugitive-:Gread!*
+fugitive-:Gremove      fugitive.txt    /*fugitive-:Gremove*
+fugitive-:Gsdiff       fugitive.txt    /*fugitive-:Gsdiff*
+fugitive-:Gsplit       fugitive.txt    /*fugitive-:Gsplit*
+fugitive-:Gsplit!      fugitive.txt    /*fugitive-:Gsplit!*
+fugitive-:Gstatus      fugitive.txt    /*fugitive-:Gstatus*
+fugitive-:Gtabedit     fugitive.txt    /*fugitive-:Gtabedit*
+fugitive-:Gtabedit!    fugitive.txt    /*fugitive-:Gtabedit!*
+fugitive-:Gvdiff       fugitive.txt    /*fugitive-:Gvdiff*
+fugitive-:Gvsplit      fugitive.txt    /*fugitive-:Gvsplit*
+fugitive-:Gvsplit!     fugitive.txt    /*fugitive-:Gvsplit!*
+fugitive-:Gwq  fugitive.txt    /*fugitive-:Gwq*
+fugitive-:Gwrite       fugitive.txt    /*fugitive-:Gwrite*
+fugitive-<CR>  fugitive.txt    /*fugitive-<CR>*
+fugitive-C     fugitive.txt    /*fugitive-C*
+fugitive-O     fugitive.txt    /*fugitive-O*
+fugitive-P     fugitive.txt    /*fugitive-P*
+fugitive-a     fugitive.txt    /*fugitive-a*
+fugitive-about fugitive.txt    /*fugitive-about*
+fugitive-commands      fugitive.txt    /*fugitive-commands*
+fugitive-mappings      fugitive.txt    /*fugitive-mappings*
+fugitive-o     fugitive.txt    /*fugitive-o*
+fugitive-revision      fugitive.txt    /*fugitive-revision*
+fugitive-statusline    fugitive.txt    /*fugitive-statusline*
+fugitive-~     fugitive.txt    /*fugitive-~*
+fugitive.txt   fugitive.txt    /*fugitive.txt*
+g:CommandTAcceptSelectionMap   command-t.txt   /*g:CommandTAcceptSelectionMap*
+g:CommandTAcceptSelectionSplitMap      command-t.txt   /*g:CommandTAcceptSelectionSplitMap*
+g:CommandTAcceptSelectionTabMap        command-t.txt   /*g:CommandTAcceptSelectionTabMap*
+g:CommandTAcceptSelectionVSplitMap     command-t.txt   /*g:CommandTAcceptSelectionVSplitMap*
+g:CommandTAlwaysShowDotFiles   command-t.txt   /*g:CommandTAlwaysShowDotFiles*
+g:CommandTBackspaceMap command-t.txt   /*g:CommandTBackspaceMap*
+g:CommandTCancelMap    command-t.txt   /*g:CommandTCancelMap*
+g:CommandTClearMap     command-t.txt   /*g:CommandTClearMap*
+g:CommandTCursorEndMap command-t.txt   /*g:CommandTCursorEndMap*
+g:CommandTCursorLeftMap        command-t.txt   /*g:CommandTCursorLeftMap*
+g:CommandTCursorRightMap       command-t.txt   /*g:CommandTCursorRightMap*
+g:CommandTCursorStartMap       command-t.txt   /*g:CommandTCursorStartMap*
+g:CommandTDeleteMap    command-t.txt   /*g:CommandTDeleteMap*
+g:CommandTMatchWindowAtTop     command-t.txt   /*g:CommandTMatchWindowAtTop*
+g:CommandTMatchWindowReverse   command-t.txt   /*g:CommandTMatchWindowReverse*
+g:CommandTMaxCachedDirectories command-t.txt   /*g:CommandTMaxCachedDirectories*
+g:CommandTMaxDepth     command-t.txt   /*g:CommandTMaxDepth*
+g:CommandTMaxFiles     command-t.txt   /*g:CommandTMaxFiles*
+g:CommandTMaxHeight    command-t.txt   /*g:CommandTMaxHeight*
+g:CommandTNeverShowDotFiles    command-t.txt   /*g:CommandTNeverShowDotFiles*
+g:CommandTScanDotDirectories   command-t.txt   /*g:CommandTScanDotDirectories*
+g:CommandTSelectNextMap        command-t.txt   /*g:CommandTSelectNextMap*
+g:CommandTSelectPrevMap        command-t.txt   /*g:CommandTSelectPrevMap*
+g:CommandTToggleFocusMap       command-t.txt   /*g:CommandTToggleFocusMap*
+g:SuperTabCompletionContexts   supertab.txt    /*g:SuperTabCompletionContexts*
+g:SuperTabContextDefaultCompletionType supertab.txt    /*g:SuperTabContextDefaultCompletionType*
+g:SuperTabCrMapping    supertab.txt    /*g:SuperTabCrMapping*
+g:SuperTabDefaultCompletionType        supertab.txt    /*g:SuperTabDefaultCompletionType*
+g:SuperTabLongestEnhanced      supertab.txt    /*g:SuperTabLongestEnhanced*
+g:SuperTabLongestHighlight     supertab.txt    /*g:SuperTabLongestHighlight*
+g:SuperTabMappingBackward      supertab.txt    /*g:SuperTabMappingBackward*
+g:SuperTabMappingForward       supertab.txt    /*g:SuperTabMappingForward*
+g:SuperTabMappingTabLiteral    supertab.txt    /*g:SuperTabMappingTabLiteral*
+g:SuperTabNoCompleteAfter      supertab.txt    /*g:SuperTabNoCompleteAfter*
+g:SuperTabNoCompleteBefore     supertab.txt    /*g:SuperTabNoCompleteBefore*
+g:SuperTabRetainCompletionDuration     supertab.txt    /*g:SuperTabRetainCompletionDuration*
+g:coffee_make_options  coffee-script.txt       /*g:coffee_make_options*
+g:loaded_luainspect    luainspect.txt  /*g:loaded_luainspect*
+g:loaded_rails rails.txt       /*g:loaded_rails*
+g:lua_inspect_events   luainspect.txt  /*g:lua_inspect_events*
+g:lua_inspect_internal luainspect.txt  /*g:lua_inspect_internal*
+g:lua_inspect_warnings luainspect.txt  /*g:lua_inspect_warnings*
+g:rails_abbreviations  rails.txt       /*g:rails_abbreviations*
+g:rails_ctags_arguments        rails.txt       /*g:rails_ctags_arguments*
+g:rails_default_file   rails.txt       /*g:rails_default_file*
+g:rails_gnu_screen     rails.txt       /*g:rails_gnu_screen*
+g:rails_history_size   rails.txt       /*g:rails_history_size*
+g:rails_mappings       rails.txt       /*g:rails_mappings*
+g:rails_menu   rails.txt       /*g:rails_menu*
+g:rails_modelines      rails.txt       /*g:rails_modelines*
+g:rails_syntax rails.txt       /*g:rails_syntax*
+g:rails_tabstop        rails.txt       /*g:rails_tabstop*
+g:rails_url    rails.txt       /*g:rails_url*
+g:snippets_dir snipMate.txt    /*g:snippets_dir*
+g:snips_author snipMate.txt    /*g:snips_author*
+g:tagbar_autoclose     tagbar.txt      /*g:tagbar_autoclose*
+g:tagbar_autofocus     tagbar.txt      /*g:tagbar_autofocus*
+g:tagbar_autoshowtag   tagbar.txt      /*g:tagbar_autoshowtag*
+g:tagbar_compact       tagbar.txt      /*g:tagbar_compact*
+g:tagbar_ctags_bin     tagbar.txt      /*g:tagbar_ctags_bin*
+g:tagbar_expand        tagbar.txt      /*g:tagbar_expand*
+g:tagbar_foldlevel     tagbar.txt      /*g:tagbar_foldlevel*
+g:tagbar_iconchars     tagbar.txt      /*g:tagbar_iconchars*
+g:tagbar_left  tagbar.txt      /*g:tagbar_left*
+g:tagbar_singleclick   tagbar.txt      /*g:tagbar_singleclick*
+g:tagbar_sort  tagbar.txt      /*g:tagbar_sort*
+g:tagbar_systemenc     tagbar.txt      /*g:tagbar_systemenc*
+g:tagbar_updateonsave_maxlines tagbar.txt      /*g:tagbar_updateonsave_maxlines*
+g:tagbar_width tagbar.txt      /*g:tagbar_width*
+gist-vim-install       gist-vim.txt    /*gist-vim-install*
+gist-vim-license       gist-vim.txt    /*gist-vim-license*
+gist-vim-requirements  gist-vim.txt    /*gist-vim-requirements*
+gist-vim-tips  gist-vim.txt    /*gist-vim-tips*
+gist-vim-usage gist-vim.txt    /*gist-vim-usage*
+iI     indent-object.txt       /*iI*
+i_CTRL-G_S     surround.txt    /*i_CTRL-G_S*
+i_CTRL-G_s     surround.txt    /*i_CTRL-G_s*
+i_CTRL-R_<Tab> snipMate.txt    /*i_CTRL-R_<Tab>*
+idntobj-about  indent-object.txt       /*idntobj-about*
+idntobj-blanklines     indent-object.txt       /*idntobj-blanklines*
+idntobj-introduction   indent-object.txt       /*idntobj-introduction*
+idntobj-objects        indent-object.txt       /*idntobj-objects*
+ii     indent-object.txt       /*ii*
+indent-object.txt      indent-object.txt       /*indent-object.txt*
+list-snippets  snipMate.txt    /*list-snippets*
+luainspect-contact     luainspect.txt  /*luainspect-contact*
+luainspect-installation        luainspect.txt  /*luainspect-installation*
+luainspect-license     luainspect.txt  /*luainspect-license*
+luainspect-references  luainspect.txt  /*luainspect-references*
+luainspect-usage       luainspect.txt  /*luainspect-usage*
+luainspect.txt luainspect.txt  /*luainspect.txt*
+macros/rails.vim       rails.txt       /*macros\/rails.vim*
+multi_snip     snipMate.txt    /*multi_snip*
+rails  rails.txt       /*rails*
+rails-'cfu'    rails.txt       /*rails-'cfu'*
+rails-'completefunc'   rails.txt       /*rails-'completefunc'*
+rails-'et'     rails.txt       /*rails-'et'*
+rails-'expandtab'      rails.txt       /*rails-'expandtab'*
+rails-'filetype'       rails.txt       /*rails-'filetype'*
+rails-'ft'     rails.txt       /*rails-'ft'*
+rails-'includeexpr'    rails.txt       /*rails-'includeexpr'*
+rails-'inex'   rails.txt       /*rails-'inex'*
+rails-'pa'     rails.txt       /*rails-'pa'*
+rails-'path'   rails.txt       /*rails-'path'*
+rails-'shiftwidth'     rails.txt       /*rails-'shiftwidth'*
+rails-'softtabstop'    rails.txt       /*rails-'softtabstop'*
+rails-'sts'    rails.txt       /*rails-'sts'*
+rails-'sua'    rails.txt       /*rails-'sua'*
+rails-'suffixesadd'    rails.txt       /*rails-'suffixesadd'*
+rails-'sw'     rails.txt       /*rails-'sw'*
+rails-:A       rails.txt       /*rails-:A*
+rails-:AD      rails.txt       /*rails-:AD*
+rails-:AE      rails.txt       /*rails-:AE*
+rails-:AS      rails.txt       /*rails-:AS*
+rails-:AT      rails.txt       /*rails-:AT*
+rails-:AV      rails.txt       /*rails-:AV*
+rails-:OpenURL rails.txt       /*rails-:OpenURL*
+rails-:R       rails.txt       /*rails-:R*
+rails-:RD      rails.txt       /*rails-:RD*
+rails-:RE      rails.txt       /*rails-:RE*
+rails-:RS      rails.txt       /*rails-:RS*
+rails-:RT      rails.txt       /*rails-:RT*
+rails-:RV      rails.txt       /*rails-:RV*
+rails-:Rabbrev rails.txt       /*rails-:Rabbrev*
+rails-:Rabbrev!        rails.txt       /*rails-:Rabbrev!*
+rails-:Rails   rails.txt       /*rails-:Rails*
+rails-:Rake    rails.txt       /*rails-:Rake*
+rails-:Rake!   rails.txt       /*rails-:Rake!*
+rails-:Rcd     rails.txt       /*rails-:Rcd*
+rails-:Rcommand        rails.txt       /*rails-:Rcommand*
+rails-:Rconsole        rails.txt       /*rails-:Rconsole*
+rails-:Rcontroller     rails.txt       /*rails-:Rcontroller*
+rails-:Rdbext  rails.txt       /*rails-:Rdbext*
+rails-:Rdestroy        rails.txt       /*rails-:Rdestroy*
+rails-:Rdoc    rails.txt       /*rails-:Rdoc*
+rails-:Rdoc!   rails.txt       /*rails-:Rdoc!*
+rails-:Redit   rails.txt       /*rails-:Redit*
+rails-:Renvironment    rails.txt       /*rails-:Renvironment*
+rails-:Rextract        rails.txt       /*rails-:Rextract*
+rails-:Rfind   rails.txt       /*rails-:Rfind*
+rails-:Rfixtures       rails.txt       /*rails-:Rfixtures*
+rails-:Rfunctionaltest rails.txt       /*rails-:Rfunctionaltest*
+rails-:Rgenerate       rails.txt       /*rails-:Rgenerate*
+rails-:Rhelper rails.txt       /*rails-:Rhelper*
+rails-:Rinitializer    rails.txt       /*rails-:Rinitializer*
+rails-:Rintegrationtest        rails.txt       /*rails-:Rintegrationtest*
+rails-:Rinvert rails.txt       /*rails-:Rinvert*
+rails-:Rjavascript     rails.txt       /*rails-:Rjavascript*
+rails-:Rlayout rails.txt       /*rails-:Rlayout*
+rails-:Rlcd    rails.txt       /*rails-:Rlcd*
+rails-:Rlib    rails.txt       /*rails-:Rlib*
+rails-:Rlocale rails.txt       /*rails-:Rlocale*
+rails-:Rlog    rails.txt       /*rails-:Rlog*
+rails-:Rmailer rails.txt       /*rails-:Rmailer*
+rails-:Rmetal  rails.txt       /*rails-:Rmetal*
+rails-:Rmigration      rails.txt       /*rails-:Rmigration*
+rails-:Rmodel  rails.txt       /*rails-:Rmodel*
+rails-:Rnavcommand     rails.txt       /*rails-:Rnavcommand*
+rails-:Robserver       rails.txt       /*rails-:Robserver*
+rails-:Rp      rails.txt       /*rails-:Rp*
+rails-:Rpartial        rails.txt       /*rails-:Rpartial*
+rails-:Rplugin rails.txt       /*rails-:Rplugin*
+rails-:Rpp     rails.txt       /*rails-:Rpp*
+rails-:Rpreview        rails.txt       /*rails-:Rpreview*
+rails-:Rpreview!       rails.txt       /*rails-:Rpreview!*
+rails-:Rrefresh        rails.txt       /*rails-:Rrefresh*
+rails-:Rrefresh!       rails.txt       /*rails-:Rrefresh!*
+rails-:Rrunner rails.txt       /*rails-:Rrunner*
+rails-:Rscript rails.txt       /*rails-:Rscript*
+rails-:Rserver rails.txt       /*rails-:Rserver*
+rails-:Rserver!        rails.txt       /*rails-:Rserver!*
+rails-:Rset    rails.txt       /*rails-:Rset*
+rails-:Rspec   rails.txt       /*rails-:Rspec*
+rails-:Rstylesheet     rails.txt       /*rails-:Rstylesheet*
+rails-:Rtags   rails.txt       /*rails-:Rtags*
+rails-:Rtask   rails.txt       /*rails-:Rtask*
+rails-:Rtree   rails.txt       /*rails-:Rtree*
+rails-:Runittest       rails.txt       /*rails-:Runittest*
+rails-:Rview   rails.txt       /*rails-:Rview*
+rails-:Ry      rails.txt       /*rails-:Ry*
+rails-:autocmd rails.txt       /*rails-:autocmd*
+rails-abbreviations    rails.txt       /*rails-abbreviations*
+rails-abolish  rails.txt       /*rails-abolish*
+rails-about    rails.txt       /*rails-about*
+rails-alternate        rails.txt       /*rails-alternate*
+rails-alternate-related        rails.txt       /*rails-alternate-related*
+rails-autocommands     rails.txt       /*rails-autocommands*
+rails-commands rails.txt       /*rails-commands*
+rails-configuration    rails.txt       /*rails-configuration*
+rails-cream    rails.txt       /*rails-cream*
+rails-custom-navigation        rails.txt       /*rails-custom-navigation*
+rails-dbext    rails.txt       /*rails-dbext*
+rails-gf       rails.txt       /*rails-gf*
+rails-global-settings  rails.txt       /*rails-global-settings*
+rails-integration      rails.txt       /*rails-integration*
+rails-introduction     rails.txt       /*rails-introduction*
+rails-license  rails.txt       /*rails-license*
+rails-menu     rails.txt       /*rails-menu*
+rails-migrations       rails.txt       /*rails-migrations*
+rails-modelines        rails.txt       /*rails-modelines*
+rails-navigation       rails.txt       /*rails-navigation*
+rails-options  rails.txt       /*rails-options*
+rails-partials rails.txt       /*rails-partials*
+rails-plugin-author    rails.txt       /*rails-plugin-author*
+rails-rails-integration        rails.txt       /*rails-rails-integration*
+rails-rake     rails.txt       /*rails-rake*
+rails-rake-defaults    rails.txt       /*rails-rake-defaults*
+rails-refactoring      rails.txt       /*rails-refactoring*
+rails-related  rails.txt       /*rails-related*
+rails-rspec    rails.txt       /*rails-rspec*
+rails-screen   rails.txt       /*rails-screen*
+rails-scripts  rails.txt       /*rails-scripts*
+rails-snippets rails.txt       /*rails-snippets*
+rails-surround rails.txt       /*rails-surround*
+rails-syntax   rails.txt       /*rails-syntax*
+rails-syntax-assertions        rails.txt       /*rails-syntax-assertions*
+rails-syntax-classes   rails.txt       /*rails-syntax-classes*
+rails-syntax-keywords  rails.txt       /*rails-syntax-keywords*
+rails-syntax-strings   rails.txt       /*rails-syntax-strings*
+rails-syntax-yaml      rails.txt       /*rails-syntax-yaml*
+rails-tabs     rails.txt       /*rails-tabs*
+rails-template-types   rails.txt       /*rails-template-types*
+rails-type-navigation  rails.txt       /*rails-type-navigation*
+rails-vim-integration  rails.txt       /*rails-vim-integration*
+rails.txt      rails.txt       /*rails.txt*
+showmarks      showmarks.txt   /*showmarks*
+showmarks-changelog    showmarks.txt   /*showmarks-changelog*
+showmarks-commands     showmarks.txt   /*showmarks-commands*
+showmarks-configuration        showmarks.txt   /*showmarks-configuration*
+showmarks-contents     showmarks.txt   /*showmarks-contents*
+showmarks-highlighting showmarks.txt   /*showmarks-highlighting*
+showmarks-mappings     showmarks.txt   /*showmarks-mappings*
+showmarks.txt  showmarks.txt   /*showmarks.txt*
+snipMate       snipMate.txt    /*snipMate*
+snipMate-$#    snipMate.txt    /*snipMate-$#*
+snipMate-${#:} snipMate.txt    /*snipMate-${#:}*
+snipMate-${#}  snipMate.txt    /*snipMate-${#}*
+snipMate-author        snipMate.txt    /*snipMate-author*
+snipMate-commands      snipMate.txt    /*snipMate-commands*
+snipMate-contact       snipMate.txt    /*snipMate-contact*
+snipMate-description   snipMate.txt    /*snipMate-description*
+snipMate-disadvantages snipMate.txt    /*snipMate-disadvantages*
+snipMate-expandtab     snipMate.txt    /*snipMate-expandtab*
+snipMate-features      snipMate.txt    /*snipMate-features*
+snipMate-filename      snipMate.txt    /*snipMate-filename*
+snipMate-indenting     snipMate.txt    /*snipMate-indenting*
+snipMate-license       snipMate.txt    /*snipMate-license*
+snipMate-placeholders  snipMate.txt    /*snipMate-placeholders*
+snipMate-remap snipMate.txt    /*snipMate-remap*
+snipMate-settings      snipMate.txt    /*snipMate-settings*
+snipMate-usage snipMate.txt    /*snipMate-usage*
+snipMate.txt   snipMate.txt    /*snipMate.txt*
+snippet        snipMate.txt    /*snippet*
+snippet-syntax snipMate.txt    /*snippet-syntax*
+snippets       snipMate.txt    /*snippets*
+solarized      solarized.txt   /*solarized*
+solarized-colors       solarized.txt   /*solarized-colors*
+solarized-colorscheme  solarized.txt   /*solarized-colorscheme*
+solarized-help solarized.txt   /*solarized-help*
+solarized-install      solarized.txt   /*solarized-install*
+solarized-menu solarized.txt   /*solarized-menu*
+solarized-options      solarized.txt   /*solarized-options*
+solarized-term solarized.txt   /*solarized-term*
+solarized-togglebg     solarized.txt   /*solarized-togglebg*
+solarized.vim  solarized.txt   /*solarized.vim*
+supertab       supertab.txt    /*supertab*
+supertab-completioncontexts    supertab.txt    /*supertab-completioncontexts*
+supertab-contextdefault        supertab.txt    /*supertab-contextdefault*
+supertab-contextdiscover       supertab.txt    /*supertab-contextdiscover*
+supertab-contextexample        supertab.txt    /*supertab-contextexample*
+supertab-contexttext   supertab.txt    /*supertab-contexttext*
+supertab-crmapping     supertab.txt    /*supertab-crmapping*
+supertab-defaultcompletion     supertab.txt    /*supertab-defaultcompletion*
+supertab-duration      supertab.txt    /*supertab-duration*
+supertab-forwardbackward       supertab.txt    /*supertab-forwardbackward*
+supertab-intro supertab.txt    /*supertab-intro*
+supertab-longestenhanced       supertab.txt    /*supertab-longestenhanced*
+supertab-longesthighlight      supertab.txt    /*supertab-longesthighlight*
+supertab-mappingtabliteral     supertab.txt    /*supertab-mappingtabliteral*
+supertab-options       supertab.txt    /*supertab-options*
+supertab-preventcomplete       supertab.txt    /*supertab-preventcomplete*
+supertab-usage supertab.txt    /*supertab-usage*
+supertab.txt   supertab.txt    /*supertab.txt*
+surround       surround.txt    /*surround*
+surround-author        surround.txt    /*surround-author*
+surround-customizing   surround.txt    /*surround-customizing*
+surround-issues        surround.txt    /*surround-issues*
+surround-mappings      surround.txt    /*surround-mappings*
+surround-replacements  surround.txt    /*surround-replacements*
+surround-targets       surround.txt    /*surround-targets*
+surround.txt   surround.txt    /*surround.txt*
+syntastic      syntastic.txt   /*syntastic*
+syntastic-about        syntastic.txt   /*syntastic-about*
+syntastic-changelog    syntastic.txt   /*syntastic-changelog*
+syntastic-commands     syntastic.txt   /*syntastic-commands*
+syntastic-contents     syntastic.txt   /*syntastic-contents*
+syntastic-credits      syntastic.txt   /*syntastic-credits*
+syntastic-error-signs  syntastic.txt   /*syntastic-error-signs*
+syntastic-error-window syntastic.txt   /*syntastic-error-window*
+syntastic-functionality        syntastic.txt   /*syntastic-functionality*
+syntastic-intro        syntastic.txt   /*syntastic-intro*
+syntastic-license      syntastic.txt   /*syntastic-license*
+syntastic-options      syntastic.txt   /*syntastic-options*
+syntastic-statusline-flag      syntastic.txt   /*syntastic-statusline-flag*
+syntastic-syntax-checkers      syntastic.txt   /*syntastic-syntax-checkers*
+syntastic.txt  syntastic.txt   /*syntastic.txt*
+tagbar tagbar.txt      /*tagbar*
+tagbar-autoopen        tagbar.txt      /*tagbar-autoopen*
+tagbar-commands        tagbar.txt      /*tagbar-commands*
+tagbar-configuration   tagbar.txt      /*tagbar-configuration*
+tagbar-contents        tagbar.txt      /*tagbar-contents*
+tagbar-credits tagbar.txt      /*tagbar-credits*
+tagbar-extend  tagbar.txt      /*tagbar-extend*
+tagbar-features        tagbar.txt      /*tagbar-features*
+tagbar-highlight       tagbar.txt      /*tagbar-highlight*
+tagbar-history tagbar.txt      /*tagbar-history*
+tagbar-installation    tagbar.txt      /*tagbar-installation*
+tagbar-intro   tagbar.txt      /*tagbar-intro*
+tagbar-issues  tagbar.txt      /*tagbar-issues*
+tagbar-keys    tagbar.txt      /*tagbar-keys*
+tagbar-other   tagbar.txt      /*tagbar-other*
+tagbar-pseudotags      tagbar.txt      /*tagbar-pseudotags*
+tagbar-requirements    tagbar.txt      /*tagbar-requirements*
+tagbar-todo    tagbar.txt      /*tagbar-todo*
+tagbar-usage   tagbar.txt      /*tagbar-usage*
+tagbar.txt     tagbar.txt      /*tagbar.txt*
+taglist-commands       taglist.txt     /*taglist-commands*
+taglist-debug  taglist.txt     /*taglist-debug*
+taglist-extend taglist.txt     /*taglist-extend*
+taglist-faq    taglist.txt     /*taglist-faq*
+taglist-functions      taglist.txt     /*taglist-functions*
+taglist-install        taglist.txt     /*taglist-install*
+taglist-internet       taglist.txt     /*taglist-internet*
+taglist-intro  taglist.txt     /*taglist-intro*
+taglist-keys   taglist.txt     /*taglist-keys*
+taglist-license        taglist.txt     /*taglist-license*
+taglist-menu   taglist.txt     /*taglist-menu*
+taglist-options        taglist.txt     /*taglist-options*
+taglist-requirements   taglist.txt     /*taglist-requirements*
+taglist-session        taglist.txt     /*taglist-session*
+taglist-todo   taglist.txt     /*taglist-todo*
+taglist-using  taglist.txt     /*taglist-using*
+taglist.txt    taglist.txt     /*taglist.txt*
+textile-changelog      textile.txt     /*textile-changelog*
+textile-commands       textile.txt     /*textile-commands*
+textile-config textile.txt     /*textile-config*
+textile-credits        textile.txt     /*textile-credits*
+textile-requirements   textile.txt     /*textile-requirements*
+textile.txt    textile.txt     /*textile.txt*
+toggle-background      solarized.txt   /*toggle-background*
+toggle-bg      solarized.txt   /*toggle-bg*
+togglebg       solarized.txt   /*togglebg*
+unimpaired     unimpaired.txt  /*unimpaired*
+unimpaired-encoding    unimpaired.txt  /*unimpaired-encoding*
+unimpaired-lines       unimpaired.txt  /*unimpaired-lines*
+unimpaired-next        unimpaired.txt  /*unimpaired-next*
+unimpaired-todo        unimpaired.txt  /*unimpaired-todo*
+unimpaired.txt unimpaired.txt  /*unimpaired.txt*
+urxvt  solarized.txt   /*urxvt*
+vS     surround.txt    /*vS*
+v_[e   unimpaired.txt  /*v_[e*
+v_[u   unimpaired.txt  /*v_[u*
+v_[x   unimpaired.txt  /*v_[x*
+v_[y   unimpaired.txt  /*v_[y*
+v_]e   unimpaired.txt  /*v_]e*
+v_]u   unimpaired.txt  /*v_]u*
+v_]x   unimpaired.txt  /*v_]x*
+v_]y   unimpaired.txt  /*v_]y*
+vgS    surround.txt    /*vgS*
+vim-colors-solarized   solarized.txt   /*vim-colors-solarized*
+vs     surround.txt    /*vs*
+without        solarized.txt   /*without*
+yS     surround.txt    /*yS*
+ySS    surround.txt    /*ySS*
+ys     surround.txt    /*ys*
+yss    surround.txt    /*yss*
+zoomwin        ZoomWin.txt     /*zoomwin*
+zoomwin-copyright      ZoomWin.txt     /*zoomwin-copyright*
+zoomwin-history        ZoomWin.txt     /*zoomwin-history*
+zoomwin-setup  ZoomWin.txt     /*zoomwin-setup*
+zoomwin-usage  ZoomWin.txt     /*zoomwin-usage*
diff --git a/vim/doc/textile.txt b/vim/doc/textile.txt
new file mode 100644 (file)
index 0000000..fe96b7f
--- /dev/null
@@ -0,0 +1,66 @@
+*textile.txt*              Textile for Vim       Last Change: November 3, 2008
+
+==============================================================================
+REQUIREMENTS                                             *textile-requirements*
+
+- ruby - http://ruby-lang.org/ (seperate executable, not compiled in)
+- RedCloth - http://redcloth.org/
+
+Files with the extension *.textile will auto-detected.  If editing a new file,
+or otherwise, run ":setf textile" to enable textile commands.
+
+
+==============================================================================
+CHANGELOG                                                  *textile-changelog*
+
+0.3     - Fixed keymappings in the documentation
+0.2     - Added multiple colors for headers, and alternating colors for list
+          items
+        - Fixed error in the vim script for TextileRenderBufferToFile
+        - Changed shortcut keys from \tp to \rp (render preview instead of
+          textile preview, since it's file-type specific anyways)
+0.1     - Initial Release
+
+==============================================================================
+COMMANDS                                                    *textile-commands*
+
+:TextilePreview     - Render the current buffer to a temp file, and open it in
+                      your web browser (OSX only)
+
+                      <Leader>rp
+
+:TextileRenderTab   - ... to a new tab
+
+                      <Leader>rt
+
+:TextileRenderFile  - ... to a file
+
+                      <Leader>rf
+
+<Leader> is \ by default, so <Leader>rp == \rp
+
+==============================================================================
+CONFIG                                                        *textile-config*
+
+MAC OS X:
+
+  Optional:
+    set g:TextileBrowser="Google Chrome"   - Open preview in "Google Chrome"
+                                             rather than Safari (optional)
+
+Other:
+
+  Mandatory:
+    set g:TextileOS="Linux"
+    set g:TextileBrowser="/path/to/browser_bin"
+
+
+==============================================================================
+CREDITS                                                      *textile-credits* 
+
+- "Dominic Mitchell":http://happygiraffe.net/: initial syntax highlighting
+- "Aaron Bieber":http://blog.aaronbieber.com/: improved syntax highlighting 
+- "Tim Harper":http://tim.theenchanter.com/  : improved syntax highlighting,
+                                                plugin
+
+vim:tw=78:noet:wrap:ts=2:expandtab:ft=help:norl:
diff --git a/vim/doc/unimpaired.txt b/vim/doc/unimpaired.txt
new file mode 100644 (file)
index 0000000..82d61a9
--- /dev/null
@@ -0,0 +1,103 @@
+*unimpaired.txt*  Pairs of handy bracket mappings
+
+Author:  Tim Pope <http://tpo.pe/>
+License: Same terms as Vim itself (see |license|)
+
+This plugin is only available if 'compatible' is not set.
+
+INTRODUCTION                                    *unimpaired*
+
+This plugin provides several pairs of bracket maps.
+
+NEXT AND PREVIOUS                               *unimpaired-next*
+
+The following maps all correspond to normal mode commands.  If a count is
+given, it becomes an argument to the command.  A mnemonic for the "a" commands
+is "args" and for the "q" commands is "quickfix".
+
+*[a* |:previous|
+*]a* |:next|
+*[A* |:first|
+*]A* |:last|
+*[b* |:bprevious|
+*]b* |:bnext|
+*[B* |:bfirst|
+*]B* |:blast|
+*[l* |:lprevious|
+*]l* |:lnext|
+*[L* |:lfirst|
+*]L* |:llast|
+*[q* |:cprevious|
+*]q* |:cnext|
+*[Q* |:cfirst|
+*]Q* |:clast|
+*[t* |:tprevious|
+*]t* |:tnext|
+*[T* |:tfirst|
+*]T* |:tlast|
+
+                                                *[o*
+[o                      Go to the file preceding the current one
+                        alphabetically in the current file's directory.
+
+                                                *]o*
+]o                      Go to the file succeeding the current one
+                        alphabetically in the current file's directory.
+
+LINE OPERATIONS                                 *unimpaired-lines*
+
+                                                *[<Space>*
+[<Space>                Add [count] blank lines above the cursor.
+
+                                                *]<Space>*
+]<Space>                Add [count] blank lines below the cursor.
+
+                                                *[e* *v_[e*
+[e                      Exchange the current line with [count] lines above it.
+
+                                                *]e* *v_]e*
+]e                      Exchange the current line with [count] lines below it.
+
+ENCODING AND DECODING                           *unimpaired-encoding*
+
+Each of these operations has a map that takes a motion, a map that
+targets [count] lines, and a visual mode map.  The linewise variant integrates
+with repeat.vim.
+
+Mnenomic: encoding always comes before decoding; "[" always comes before "]".
+
+                                                *[x* *[xx* *v_[x*
+[x{motion}              XML encode.
+[xx                     <foo bar="baz"> => &lt;foo bar=&quot;baz&quot&gt;
+{Visual}[x
+
+                                                *]x* *]xx* *v_]x*
+]x{motion}              XML decode.  HTML entities are handled as well.
+]xx
+{Visual}]x
+
+                                                *[u* *[uu* *v_[u*
+[u{motion}              URL encode.
+[uu                     foo bar => foo%20bar
+{Visual}[u
+
+                                                *]u* *]uu* *v_]u*
+]u{motion}              URL decode.
+]uu
+{Visual}]u
+
+                                                *[y* *[yy* *v_[y*
+[y{motion}              C String encode.  Backslash escape control
+[yy                     characters, quotation marks, and backslashes.
+{Visual}[y
+
+                                                *]y* *]yy* *v_]y*
+]y{motion}              C String decode.
+]yy
+{Visual}]y
+
+TODO                                            *unimpaired-todo*
+
+Avoid munging null characters when encoding and decoding.
+
+ vim:tw=78:et:ft=help:norl:
diff --git a/vim/ftdetect/arduino.vim b/vim/ftdetect/arduino.vim
new file mode 100644 (file)
index 0000000..61fa0d3
--- /dev/null
@@ -0,0 +1 @@
+au BufNewFile,BufRead *.pde             setf arduino
\ No newline at end of file
diff --git a/vim/ftdetect/coffee.vim b/vim/ftdetect/coffee.vim
new file mode 100644 (file)
index 0000000..e1c1314
--- /dev/null
@@ -0,0 +1,7 @@
+" Language:    CoffeeScript
+" Maintainer:  Mick Koch <kchmck@gmail.com>
+" URL:         http://github.com/kchmck/vim-coffee-script
+" License:     WTFPL
+
+autocmd BufNewFile,BufRead *.coffee set filetype=coffee
+autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
diff --git a/vim/ftdetect/cucumber.vim b/vim/ftdetect/cucumber.vim
new file mode 100644 (file)
index 0000000..f00f9e2
--- /dev/null
@@ -0,0 +1,2 @@
+" Cucumber
+autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
diff --git a/vim/ftdetect/eco.vim b/vim/ftdetect/eco.vim
new file mode 100644 (file)
index 0000000..b420649
--- /dev/null
@@ -0,0 +1 @@
+autocmd BufNewFile,BufRead *.eco set filetype=eco
diff --git a/vim/ftdetect/git.vim b/vim/ftdetect/git.vim
new file mode 100644 (file)
index 0000000..727bf0c
--- /dev/null
@@ -0,0 +1,18 @@
+" Git
+autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG                set ft=gitcommit
+autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
+autocmd BufNewFile,BufRead git-rebase-todo                     set ft=gitrebase
+autocmd BufNewFile,BufRead .msg.[0-9]*
+      \ if getline(1) =~ '^From.*# This line is ignored.$' |
+      \   set ft=gitsendemail |
+      \ endif
+autocmd BufNewFile,BufRead *.git/**
+      \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
+      \   set ft=git |
+      \ endif
+
+" This logic really belongs in scripts.vim
+autocmd BufNewFile,BufRead,StdinReadPost *
+      \ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
+      \   set ft=git |
+      \ endif
diff --git a/vim/ftdetect/haml.vim b/vim/ftdetect/haml.vim
new file mode 100644 (file)
index 0000000..25ea073
--- /dev/null
@@ -0,0 +1,3 @@
+autocmd BufNewFile,BufRead *.haml setf haml
+autocmd BufNewFile,BufRead *.sass setf sass
+autocmd BufNewFile,BufRead *.scss setf scss
diff --git a/vim/ftdetect/markdown.vim b/vim/ftdetect/markdown.vim
new file mode 100644 (file)
index 0000000..1c5a36a
--- /dev/null
@@ -0,0 +1,6 @@
+autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn
+      \ if &ft =~# '^\%(conf\|modula2\)$' |
+      \   set ft=markdown |
+      \ else |
+      \   setf markdown |
+      \ endif
diff --git a/vim/ftdetect/mustache.vim b/vim/ftdetect/mustache.vim
new file mode 100644 (file)
index 0000000..2ddc2ca
--- /dev/null
@@ -0,0 +1 @@
+au BufNewFile,BufRead *.mustache        setf mustache
\ No newline at end of file
diff --git a/vim/ftdetect/puppet.vim b/vim/ftdetect/puppet.vim
new file mode 100644 (file)
index 0000000..c9d15ea
--- /dev/null
@@ -0,0 +1,2 @@
+" detect puppet filetype
+au BufRead,BufNewFile *.pp              set filetype=puppet
diff --git a/vim/ftdetect/scala.vim b/vim/ftdetect/scala.vim
new file mode 100644 (file)
index 0000000..660f1a2
--- /dev/null
@@ -0,0 +1,2 @@
+
+au BufRead,BufNewFile *.scala set filetype=scala
diff --git a/vim/ftdetect/textile.vim b/vim/ftdetect/textile.vim
new file mode 100644 (file)
index 0000000..d02f942
--- /dev/null
@@ -0,0 +1,8 @@
+" textile.vim
+"
+" Tim Harper (tim.theenchanter.com)
+
+" Force filetype to be textile even if already set
+" This will override the system ftplugin/changelog 
+" set on some distros
+au BufRead,BufNewFile *.textile set filetype=textile
diff --git a/vim/ftplugin/coffee.vim b/vim/ftplugin/coffee.vim
new file mode 100644 (file)
index 0000000..6af1496
--- /dev/null
@@ -0,0 +1,233 @@
+" Language:    CoffeeScript
+" Maintainer:  Mick Koch <kchmck@gmail.com>
+" URL:         http://github.com/kchmck/vim-coffee-script
+" License:     WTFPL
+
+if exists("b:did_ftplugin")
+  finish
+endif
+
+let b:did_ftplugin = 1
+
+setlocal formatoptions-=t formatoptions+=croql
+setlocal comments=:#
+setlocal commentstring=#\ %s
+
+setlocal errorformat=Error:\ In\ %f\\,\ %m\ on\ line\ %l,
+                    \Error:\ In\ %f\\,\ Parse\ error\ on\ line\ %l:\ %m,
+                    \SyntaxError:\ In\ %f\\,\ %m,
+                    \%-G%.%#
+
+" Extra options passed to CoffeeMake
+if !exists("coffee_make_options")
+  let coffee_make_options = ""
+endif
+
+" Update `makeprg` for the current filename. This is needed to support filenames
+" with spaces and quotes while also supporting generic `make`.
+function! s:SetMakePrg()
+  let &l:makeprg = "coffee -c " . g:coffee_make_options . ' $* '
+  \              . fnameescape(expand('%'))
+endfunction
+
+" Set `makeprg` initially.
+call s:SetMakePrg()
+" Set `makeprg` on rename.
+autocmd BufFilePost,BufWritePost,FileWritePost <buffer> call s:SetMakePrg()
+
+" Reset the global variables used by CoffeeCompile.
+function! s:CoffeeCompileResetVars()
+  " Position in the source buffer
+  let s:coffee_compile_src_buf = -1
+  let s:coffee_compile_src_pos = []
+
+  " Position in the CoffeeCompile buffer
+  let s:coffee_compile_buf = -1
+  let s:coffee_compile_win = -1
+  let s:coffee_compile_pos = []
+
+  " If CoffeeCompile is watching a buffer
+  let s:coffee_compile_watch = 0
+endfunction
+
+" Save the cursor position when moving to and from the CoffeeCompile buffer.
+function! s:CoffeeCompileSavePos()
+  let buf = bufnr('%')
+  let pos = getpos('.')
+
+  if buf == s:coffee_compile_buf
+    let s:coffee_compile_pos = pos
+  else
+    let s:coffee_compile_src_buf = buf
+    let s:coffee_compile_src_pos = pos
+  endif
+endfunction
+
+" Restore the cursor to the source buffer.
+function! s:CoffeeCompileRestorePos()
+  let win = bufwinnr(s:coffee_compile_src_buf)
+
+  if win != -1
+    exec win 'wincmd w'
+    call setpos('.', s:coffee_compile_src_pos)
+  endif
+endfunction
+
+" Close the CoffeeCompile buffer and clean things up.
+function! s:CoffeeCompileClose()
+  silent! autocmd! CoffeeCompileAuPos
+  silent! autocmd! CoffeeCompileAuWatch
+
+  call s:CoffeeCompileRestorePos()
+  call s:CoffeeCompileResetVars()
+endfunction
+
+" Update the CoffeeCompile buffer given some input lines.
+function! s:CoffeeCompileUpdate(startline, endline)
+  let input = join(getline(a:startline, a:endline), "\n")
+
+  " Coffee doesn't like empty input.
+  if !len(input)
+    return
+  endif
+
+  " Compile input.
+  let output = system('coffee -scb 2>&1', input)
+
+  " Move to the CoffeeCompile buffer.
+  exec s:coffee_compile_win 'wincmd w'
+
+  " Replace buffer contents with new output and delete the last empty line.
+  setlocal modifiable
+    exec '% delete _'
+    put! =output
+    exec '$ delete _'
+  setlocal nomodifiable
+
+  " Highlight as JavaScript if there is no compile error.
+  if v:shell_error
+    setlocal filetype=
+  else
+    setlocal filetype=javascript
+  endif
+
+  " Restore the cursor in the compiled output.
+  call setpos('.', s:coffee_compile_pos)
+endfunction
+
+" Update the CoffeeCompile buffer with the whole source buffer and restore the
+" cursor.
+function! s:CoffeeCompileWatchUpdate()
+  call s:CoffeeCompileSavePos()
+  call s:CoffeeCompileUpdate(1, '$')
+  call s:CoffeeCompileRestorePos()
+endfunction
+
+" Peek at compiled CoffeeScript in a scratch buffer. We handle ranges like this
+" to prevent the cursor from being moved (and its position saved) before the
+" function is called.
+function! s:CoffeeCompile(startline, endline, args)
+  " Don't compile the CoffeeCompile buffer.
+  if bufnr('%') == s:coffee_compile_buf
+    return
+  endif
+
+  " Parse arguments.
+  let watch = a:args =~ '\<watch\>'
+  let unwatch = a:args =~ '\<unwatch\>'
+  let vert = a:args =~ '\<vert\%[ical]\>'
+  let size = str2nr(matchstr(a:args, '\<\d\+\>'))
+
+  " Remove any watch listeners.
+  silent! autocmd! CoffeeCompileAuWatch
+
+  " If just unwatching, don't compile.
+  if unwatch
+    let s:coffee_compile_watch = 0
+    return
+  endif
+
+  if watch
+    let s:coffee_compile_watch = 1
+  endif
+
+  call s:CoffeeCompileSavePos()
+
+  " Build the CoffeeCompile buffer if it doesn't exist.
+  if s:coffee_compile_buf == -1
+    let src_win = bufwinnr(s:coffee_compile_src_buf)
+
+    " Create the new window and resize it.
+    if vert
+      let width = size ? size : winwidth(src_win) / 2
+
+      vertical new
+      exec 'vertical resize' width
+    else
+      " Try to guess the compiled output's height.
+      let height = size ? size : min([winheight(src_win) / 2,
+      \                               a:endline - a:startline + 2])
+
+      botright new
+      exec 'resize' height
+    endif
+
+    " Set up scratch buffer.
+    setlocal bufhidden=wipe buftype=nofile
+    setlocal nobuflisted nomodifiable noswapfile nowrap
+
+    autocmd BufWipeout <buffer> call s:CoffeeCompileClose()
+    nnoremap <buffer> <silent> q :hide<CR>
+
+    " Save the cursor position on each buffer switch.
+    augroup CoffeeCompileAuPos
+      autocmd BufEnter,BufLeave * call s:CoffeeCompileSavePos()
+    augroup END
+
+    let s:coffee_compile_buf = bufnr('%')
+    let s:coffee_compile_win = bufwinnr(s:coffee_compile_buf)
+  endif
+
+  " Go back to the source buffer and do the initial compile.
+  call s:CoffeeCompileRestorePos()
+
+  if s:coffee_compile_watch
+    call s:CoffeeCompileWatchUpdate()
+
+    augroup CoffeeCompileAuWatch
+      autocmd InsertLeave <buffer> call s:CoffeeCompileWatchUpdate()
+    augroup END
+  else
+    call s:CoffeeCompileUpdate(a:startline, a:endline)
+  endif
+endfunction
+
+" Complete arguments for the CoffeeCompile command.
+function! s:CoffeeCompileComplete(arg, cmdline, cursor)
+  let args = ['unwatch', 'vertical', 'watch']
+
+  if !len(a:arg)
+    return args
+  endif
+
+  let match = '^' . a:arg
+
+  for arg in args
+    if arg =~ match
+      return [arg]
+    endif
+  endfor
+endfunction
+
+" Don't let new windows overwrite the CoffeeCompile variables.
+if !exists("s:coffee_compile_buf")
+  call s:CoffeeCompileResetVars()
+endif
+
+" Peek at compiled CoffeeScript.
+command! -range=% -bar -nargs=* -complete=customlist,s:CoffeeCompileComplete
+\        CoffeeCompile call s:CoffeeCompile(<line1>, <line2>, <q-args>)
+" Compile the current file.
+command! -bang -bar -nargs=* CoffeeMake make<bang> <args>
+" Run some CoffeeScript.
+command! -range=% -bar CoffeeRun <line1>,<line2>:w !coffee -s
diff --git a/vim/ftplugin/cucumber.vim b/vim/ftplugin/cucumber.vim
new file mode 100644 (file)
index 0000000..ac1d6c9
--- /dev/null
@@ -0,0 +1,132 @@
+" Vim filetype plugin
+" Language:    Cucumber
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2010 Aug 09
+
+" Only do this when not done yet for this buffer
+if (exists("b:did_ftplugin"))
+  finish
+endif
+let b:did_ftplugin = 1
+
+setlocal formatoptions-=t formatoptions+=croql
+setlocal comments=:# commentstring=#\ %s
+setlocal omnifunc=CucumberComplete
+
+let b:undo_ftplugin = "setl fo< com< cms< ofu<"
+
+let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
+
+if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
+  nmap <silent><buffer> <C-]>       :<C-U>exe <SID>jump('edit',v:count)<CR>
+  nmap <silent><buffer> <C-W>]      :<C-U>exe <SID>jump('split',v:count)<CR>
+  nmap <silent><buffer> <C-W><C-]>  :<C-U>exe <SID>jump('split',v:count)<CR>
+  nmap <silent><buffer> <C-W>}      :<C-U>exe <SID>jump('pedit',v:count)<CR>
+  let b:undo_ftplugin .= "| sil! nunmap <buffer> <C-]>| sil! nunmap <buffer> <C-W>]| sil! nunmap <buffer> <C-W><C-]>| sil! nunmap <buffer> <C-W>}"
+endif
+
+function! s:jump(command,count)
+  let steps = s:steps('.')
+  if len(steps) == 0 || len(steps) < a:count
+    return 'echoerr "No matching step found"'
+  elseif len(steps) > 1 && !a:count
+    return 'echoerr "Multiple matching steps found"'
+  else
+    let c = a:count ? a:count-1 : 0
+    return a:command.' +'.steps[c][1].' '.escape(steps[c][0],' %#')
+  endif
+endfunction
+
+function! s:allsteps()
+  let step_pattern = '\C^\s*\K\k*\>\s*\zs\S.\{-\}\ze\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
+  let steps = []
+  for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n")
+    let lines = readfile(file)
+    let num = 0
+    for line in lines
+      let num += 1
+      if line =~ step_pattern
+        let type = matchstr(line,'\w\+')
+        let steps += [[file,num,type,matchstr(line,step_pattern)]]
+      endif
+    endfor
+  endfor
+  return steps
+endfunction
+
+function! s:steps(lnum)
+  let c = indent(a:lnum) + 1
+  while synIDattr(synID(a:lnum,c,1),'name') !~# '^$\|Region$'
+    let c = c + 1
+  endwhile
+  let step = matchstr(getline(a:lnum)[c-1 : -1],'^\s*\zs.\{-\}\ze\s*$')
+  return filter(s:allsteps(),'s:stepmatch(v:val[3],step)')
+endfunction
+
+function! s:stepmatch(receiver,target)
+  if a:receiver =~ '^[''"].*[''"]$'
+    let pattern = '^'.escape(substitute(a:receiver[1:-2],'$\w\+','(.*)','g'),'/').'$'
+  elseif a:receiver =~ '^/.*/$'
+    let pattern = a:receiver[1:-2]
+  elseif a:receiver =~ '^%r..*.$'
+    let pattern = escape(a:receiver[3:-2],'/')
+  else
+    return 0
+  endif
+  try
+    let vimpattern = substitute(substitute(pattern,'\\\@<!(?:','%(','g'),'\\\@<!\*?','{-}','g')
+    if a:target =~# '\v'.vimpattern
+      return 1
+    endif
+  catch
+  endtry
+  if has("ruby") && pattern !~ '\\\@<!#{'
+    ruby VIM.command("return #{if (begin; Kernel.eval('/'+VIM.evaluate('pattern')+'/'); rescue SyntaxError; end) === VIM.evaluate('a:target') then 1 else 0 end}")
+  else
+    return 0
+  endif
+endfunction
+
+function! s:bsub(target,pattern,replacement)
+  return  substitute(a:target,'\C\\\@<!'.a:pattern,a:replacement,'g')
+endfunction
+
+function! CucumberComplete(findstart,base) abort
+  let indent = indent('.')
+  let group = synIDattr(synID(line('.'),indent+1,1),'name')
+  let type = matchstr(group,'\Ccucumber\zs\%(Given\|When\|Then\)')
+  let e = matchend(getline('.'),'^\s*\S\+\s')
+  if type == '' || col('.') < col('$') || e < 0
+    return -1
+  endif
+  if a:findstart
+    return e
+  endif
+  let steps = []
+  for step in s:allsteps()
+    if step[2] ==# type
+      if step[3] =~ '^[''"]'
+        let steps += [step[3][1:-2]]
+      elseif step[3] =~ '^/\^.*\$/$'
+        let pattern = step[3][2:-3]
+        let pattern = substitute(pattern,'\C^(?:|I )','I ','')
+        let pattern = s:bsub(pattern,'\\[Sw]','w')
+        let pattern = s:bsub(pattern,'\\d','1')
+        let pattern = s:bsub(pattern,'\\[sWD]',' ')
+        let pattern = s:bsub(pattern,'\[\^\\\="\]','_')
+        let pattern = s:bsub(pattern,'[[:alnum:]. _-][?*]?\=','')
+        let pattern = s:bsub(pattern,'\[\([^^]\).\{-\}\]','\1')
+        let pattern = s:bsub(pattern,'+?\=','')
+        let pattern = s:bsub(pattern,'(\([[:alnum:]. -]\{-\}\))','\1')
+        let pattern = s:bsub(pattern,'\\\([[:punct:]]\)','\1')
+        if pattern !~ '[\\()*?]'
+          let steps += [pattern]
+        endif
+      endif
+    endif
+  endfor
+  call filter(steps,'strpart(v:val,0,strlen(a:base)) ==# a:base')
+  return sort(steps)
+endfunction
+
+" vim:set sts=2 sw=2:
diff --git a/vim/ftplugin/git.vim b/vim/ftplugin/git.vim
new file mode 100644 (file)
index 0000000..3412251
--- /dev/null
@@ -0,0 +1,36 @@
+" Vim filetype plugin
+" Language:    generic git output
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+
+" Only do this when not done yet for this buffer
+if (exists("b:did_ftplugin"))
+  finish
+endif
+let b:did_ftplugin = 1
+
+if !exists('b:git_dir')
+  if expand('%:p') =~# '\.git\>'
+    let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
+  elseif $GIT_DIR != ''
+    let b:git_dir = $GIT_DIR
+  endif
+  if (has('win32') || has('win64')) && exists('b:git_dir')
+    let b:git_dir = substitute(b:git_dir,'\\','/','g')
+  endif
+endif
+
+if exists('*shellescape') && exists('b:git_dir') && b:git_dir != ''
+  if b:git_dir =~# '/\.git$' " Not a bare repository
+    let &l:path = escape(fnamemodify(b:git_dir,':h'),'\, ').','.&l:path
+  endif
+  let &l:path = escape(b:git_dir,'\, ').','.&l:path
+  let &l:keywordprg = 'git --git-dir='.shellescape(b:git_dir).' show'
+else
+  setlocal keywordprg=git\ show
+endif
+if has('gui_running')
+  let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','')
+endif
+
+setlocal includeexpr=substitute(v:fname,'^[^/]\\+/','','')
+let b:undo_ftplugin = "setl keywordprg< path< includeexpr<"
diff --git a/vim/ftplugin/gitcommit.vim b/vim/ftplugin/gitcommit.vim
new file mode 100644 (file)
index 0000000..16eeb67
--- /dev/null
@@ -0,0 +1,68 @@
+" Vim filetype plugin
+" Language:    git commit file
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+
+" Only do this when not done yet for this buffer
+if (exists("b:did_ftplugin"))
+  finish
+endif
+
+runtime! ftplugin/git.vim
+let b:did_ftplugin = 1
+
+set nomodeline
+
+let b:undo_ftplugin = 'setl modeline<'
+
+if &textwidth == 0
+  " make sure that log messages play nice with git-log on standard terminals
+  setlocal textwidth=72
+  let b:undo_ftplugin .= "|setl tw<"
+endif
+
+if exists("g:no_gitcommit_commands") || v:version < 700
+  finish
+endif
+
+if !exists("b:git_dir")
+  let b:git_dir = expand("%:p:h")
+endif
+
+" Automatically diffing can be done with:
+"   autocmd BufRead *.git/COMMIT_EDITMSG DiffGitCached | wincmd p
+command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
+
+function! s:diffcomplete(A,L,P)
+  let args = ""
+  if a:P <= match(a:L." -- "," -- ")+3
+    let args = args . "-p\n--stat\n--shortstat\n--summary\n--patch-with-stat\n--no-renames\n-B\n-M\n-C\n"
+  end
+  if exists("b:git_dir") && a:A !~ '^-'
+    let tree = fnamemodify(b:git_dir,':h')
+    if strpart(getcwd(),0,strlen(tree)) == tree
+      let args = args."\n".system("git diff --cached --name-only")
+    endif
+  endif
+  return args
+endfunction
+
+function! s:gitdiffcached(bang,gitdir,...)
+  let tree = fnamemodify(a:gitdir,':h')
+  let name = tempname()
+  let git = "git"
+  if strpart(getcwd(),0,strlen(tree)) != tree
+    let git .= " --git-dir=".(exists("*shellescape") ? shellescape(a:gitdir) : '"'.a:gitdir.'"')
+  endif
+  if a:0
+    let extra = join(map(copy(a:000),exists("*shellescape") ? 'shellescape(v:val)' : "'\"'.v:val.'\"'"))
+  else
+    let extra = "-p --stat=".&columns
+  endif
+  call system(git." diff --cached --no-color ".extra." > ".(exists("*shellescape") ? shellescape(name) : name))
+  exe "pedit ".(exists("*fnameescape") ? fnameescape(name) : name)
+  wincmd P
+  let b:git_dir = a:gitdir
+  command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
+  nnoremap <silent> q :q<CR>
+  setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git
+endfunction
diff --git a/vim/ftplugin/gitconfig.vim b/vim/ftplugin/gitconfig.vim
new file mode 100644 (file)
index 0000000..2869fc9
--- /dev/null
@@ -0,0 +1,14 @@
+" Vim filetype plugin
+" Language:    git config file
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+
+" Only do this when not done yet for this buffer
+if (exists("b:did_ftplugin"))
+  finish
+endif
+let b:did_ftplugin = 1
+
+setlocal formatoptions-=t formatoptions+=croql
+setlocal comments=:#,:; commentstring=;\ %s
+
+let b:undo_ftplugin = "setl fo< com< cms<"
diff --git a/vim/ftplugin/gitrebase.vim b/vim/ftplugin/gitrebase.vim
new file mode 100644 (file)
index 0000000..5d111dd
--- /dev/null
@@ -0,0 +1,42 @@
+" Vim filetype plugin
+" Language:    git rebase --interactive
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+
+" Only do this when not done yet for this buffer
+if (exists("b:did_ftplugin"))
+  finish
+endif
+
+runtime! ftplugin/git.vim
+let b:did_ftplugin = 1
+
+setlocal comments=:# commentstring=#\ %s formatoptions-=t
+if !exists("b:undo_ftplugin")
+  let b:undo_ftplugin = ""
+endif
+let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo<"
+
+function! s:choose(word)
+  s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e
+endfunction
+
+function! s:cycle()
+  call s:choose(get({'s':'edit','p':'squash','e':'reword','r':'fixup'},getline('.')[0],'pick'))
+endfunction
+
+command! -buffer -bar Pick   :call s:choose('pick')
+command! -buffer -bar Squash :call s:choose('squash')
+command! -buffer -bar Edit   :call s:choose('edit')
+command! -buffer -bar Reword :call s:choose('reword')
+command! -buffer -bar Fixup  :call s:choose('fixup')
+command! -buffer -bar Cycle  :call s:cycle()
+" The above are more useful when they are mapped; for example:
+"nnoremap <buffer> <silent> S :Cycle<CR>
+
+if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps")
+  finish
+endif
+
+nnoremap <buffer> <expr> K col('.') < 7 && expand('<Lt>cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K'
+
+let b:undo_ftplugin = b:undo_ftplugin . "|nunmap <buffer> K"
diff --git a/vim/ftplugin/gitsendemail.vim b/vim/ftplugin/gitsendemail.vim
new file mode 100644 (file)
index 0000000..d97cbda
--- /dev/null
@@ -0,0 +1,5 @@
+" Vim filetype plugin
+" Language:    git send-email message
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+
+runtime! ftplugin/mail.vim
diff --git a/vim/ftplugin/haml.vim b/vim/ftplugin/haml.vim
new file mode 100644 (file)
index 0000000..df818f4
--- /dev/null
@@ -0,0 +1,67 @@
+" Vim filetype plugin
+" Language:    Haml
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2010 May 21
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+  finish
+endif
+
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "All Files (*.*)\t*.*\n"
+let s:match_words = ""
+
+runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+unlet! b:did_ftplugin
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+  let s:undo_ftplugin = b:undo_ftplugin
+  unlet b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+  let s:browsefilter = b:browsefilter
+  unlet b:browsefilter
+endif
+if exists("b:match_words")
+  let s:match_words = b:match_words
+  unlet b:match_words
+endif
+
+runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
+let b:did_ftplugin = 1
+
+" Combine the new set of values with those previously included.
+if exists("b:undo_ftplugin")
+  let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
+endif
+if exists ("b:browsefilter")
+  let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
+endif
+if exists("b:match_words")
+  let s:match_words = b:match_words . ',' . s:match_words
+endif
+
+" Change the browse dialog on Win32 to show mainly Haml-related files
+if has("gui_win32")
+  let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter
+endif
+
+" Load the combined list of match_words for matchit.vim
+if exists("loaded_matchit")
+  let b:match_words = s:match_words
+endif
+
+setlocal comments= commentstring=-#\ %s
+
+let b:undo_ftplugin = "setl cms< com< "
+      \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
+
+let &cpo = s:save_cpo
+
+" vim:set sw=2:
diff --git a/vim/ftplugin/html_snip_helper.vim b/vim/ftplugin/html_snip_helper.vim
new file mode 100644 (file)
index 0000000..2e54570
--- /dev/null
@@ -0,0 +1,10 @@
+" Helper function for (x)html snippets
+if exists('s:did_snip_helper') || &cp || !exists('loaded_snips')
+       finish
+endif
+let s:did_snip_helper = 1
+
+" Automatically closes tag if in xhtml
+fun! Close()
+       return stridx(&ft, 'xhtml') == -1 ? '' : ' /'
+endf
diff --git a/vim/ftplugin/markdown.vim b/vim/ftplugin/markdown.vim
new file mode 100644 (file)
index 0000000..28cac11
--- /dev/null
@@ -0,0 +1,18 @@
+" Vim filetype plugin
+" Language:            Markdown
+" Maintainer:          Tim Pope <vimNOSPAM@tpope.org>
+
+if exists("b:did_ftplugin")
+  finish
+endif
+
+runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+unlet! b:did_ftplugin
+
+setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
+setlocal formatoptions+=tcqln
+setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+
+
+let b:undo_ftplugin .= "|setl cms< com< fo<"
+
+" vim:set sw=2:
diff --git a/vim/ftplugin/puppet.vim b/vim/ftplugin/puppet.vim
new file mode 100644 (file)
index 0000000..1b00868
--- /dev/null
@@ -0,0 +1,137 @@
+" Vim filetype plugin
+" Language:     Puppet
+" Maintainer:   Todd Zullinger <tmz@pobox.com>
+" Last Change:  2009 Aug 19
+" vim: set sw=4 sts=4:
+
+if exists("b:did_ftplugin")
+    finish
+endif
+let b:did_ftplugin = 1
+
+if !exists("no_plugin_maps") && !exists("no_puppet_maps")
+    if !hasmapto("<Plug>AlignRange")
+        map <buffer> <LocalLeader>= <Plug>AlignRange
+    endif
+endif
+
+noremap <buffer> <unique> <script> <Plug>AlignArrows :call <SID>AlignArrows()<CR>
+noremap <buffer> <unique> <script> <Plug>AlignRange :call <SID>AlignRange()<CR>
+
+iabbrev => =><C-R>=<SID>AlignArrows('=>')<CR>
+iabbrev +> +><C-R>=<SID>AlignArrows('+>')<CR>
+
+if exists('*s:AlignArrows')
+    finish
+endif
+
+let s:arrow_re = '[=+]>'
+let s:selector_re = '[=+]>\s*\$.*\s*?\s*{\s*$'
+
+" set keywordprg to 'pi' (alias for puppet describe)
+" this lets K invoke pi for word under cursor
+setlocal keywordprg=puppet\ describe
+
+function! s:AlignArrows(op)
+    let cursor_pos = getpos('.')
+    let lnum = line('.')
+    let line = getline(lnum)
+    if line !~ s:arrow_re
+        return
+    endif
+    let pos = stridx(line, a:op)
+    let start = lnum
+    let end = lnum
+    let pnum = lnum - 1
+    while 1
+        let pline = getline(pnum)
+        if pline !~ s:arrow_re || pline =~ s:selector_re
+            break
+        endif
+        let start = pnum
+        let pnum -= 1
+    endwhile
+    let cnum = end
+    while 1
+        let cline = getline(cnum)
+        if cline !~ s:arrow_re ||
+                \ (indent(cnum) != indent(cnum+1) && getline(cnum+1) !~ '\s*}')
+            break
+        endif
+        let end = cnum
+        let cnum += 1
+    endwhile
+    call s:AlignSection(start, end)
+    let cursor_pos[2] = stridx(getline('.'), a:op) + strlen(a:op) + 1
+    call setpos('.', cursor_pos)
+    return ''
+endfunction
+
+function! s:AlignRange() range
+    call s:AlignSection(a:firstline, a:lastline)
+endfunction
+
+" AlignSection and AlignLine are from the vim wiki:
+" http://vim.wikia.com/wiki/Regex-based_text_alignment
+function! s:AlignSection(start, end)
+    let extra = 1
+    let sep = s:arrow_re
+    let maxpos = 0
+    let section = getline(a:start, a:end)
+    for line in section
+        let pos = match(line, ' *'.sep)
+        if maxpos < pos
+            let maxpos = pos
+        endif
+    endfor
+    call map(section, 's:AlignLine(v:val, sep, maxpos, extra)')
+    call setline(a:start, section)
+endfunction
+
+function! s:AlignLine(line, sep, maxpos, extra)
+    let m = matchlist(a:line, '\(.\{-}\) \{-}\('.a:sep.'.*\)')
+    if empty(m)
+        return a:line
+    endif
+    let spaces = repeat(' ', a:maxpos - strlen(m[1]) + a:extra)
+    return m[1] . spaces . m[2]
+endfunction
+
+" detect if we are in a module and set variables for classpath (autoloader),
+" modulename, modulepath, and classname
+" useful to use in templates
+function! s:SetModuleVars()
+
+  " set these to any dirs you want to stop searching on
+  " useful to stop vim from spinning disk looking all over for init.pp
+  " probably only a macosx problem with /tmp since it's really /private/tmp
+  " but it's here if you find vim spinning on new files in certain places
+  if !exists("g:puppet_stop_dirs")
+    let g:puppet_stop_dirs = '/tmp;/private/tmp'
+  endif
+
+  " search path for init.pp
+  let b:search_path = './**'
+  let b:search_path = b:search_path . ';' . getcwd() . ';' . g:puppet_stop_dirs
+  
+  " find what we assume to be our module dir
+  let b:initpp = findfile("init.pp", b:search_path) " find an init.pp up or down
+  let b:module_path = fnamemodify(b:initpp, ":p:h:h") " full path to module name
+  let b:module_name = fnamemodify(b:module_path, ":t") " just the module name
+
+  " sub out the full path to the module with the name and replace slashes with ::
+  let b:classpath = fnamemodify(expand("%:p:r"), ':s#' . b:module_path . '/manifests#' . b:module_name . '#'. ":gs?/?::?")
+  let b:classname = expand("%:t:r")
+
+  " if we don't start with a word we didn't replace the module_path 
+  " probably b/c we couldn't find an init.pp / not a module
+  " so we assume that root of the filename is the class (sane for throwaway
+  " manifests
+  if b:classpath =~ '^::'
+    let b:classpath = b:classname
+  endif
+endfunction
+
+if exists("g:puppet_module_detect")
+  call s:SetModuleVars()
+endif
diff --git a/vim/ftplugin/sass.vim b/vim/ftplugin/sass.vim
new file mode 100644 (file)
index 0000000..64232a0
--- /dev/null
@@ -0,0 +1,22 @@
+" Vim filetype plugin
+" Language:    Sass
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2010 Jul 26
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
+
+setlocal commentstring=//\ %s
+setlocal define=^\\s*\\%(@mixin\\\|=\\)
+setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
+setlocal omnifunc=csscomplete#CompleteCSS
+setlocal suffixesadd=.sass,.scss,.css
+
+let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
+
+" vim:set sw=2:
diff --git a/vim/ftplugin/scss.vim b/vim/ftplugin/scss.vim
new file mode 100644 (file)
index 0000000..981fb1b
--- /dev/null
@@ -0,0 +1,12 @@
+" Vim filetype plugin
+" Language:    SCSS
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2010 Jul 26
+
+if exists("b:did_ftplugin")
+  finish
+endif
+
+runtime! ftplugin/sass.vim
+
+" vim:set sw=2:
diff --git a/vim/ftplugin/textile.vim b/vim/ftplugin/textile.vim
new file mode 100644 (file)
index 0000000..fa84c49
--- /dev/null
@@ -0,0 +1,59 @@
+" textile.vim
+"
+" Tim Harper (tim.theenchanter.com)
+
+command! -nargs=0 TextileRenderFile call TextileRenderBufferToFile()
+command! -nargs=0 TextileRenderTab call TextileRenderBufferToTab()
+command! -nargs=0 TextilePreview call TextileRenderBufferToPreview()
+noremap <buffer> <Leader>rp :TextilePreview<CR>
+noremap <buffer> <Leader>rf :TextileRenderFile<CR>
+noremap <buffer> <Leader>rt :TextileRenderTab<CR>
+setlocal ignorecase
+setlocal wrap
+setlocal lbr
+
+function! TextileRender(lines)
+  if (system('which ruby') == "")
+    throw "Could not find ruby!"
+  end
+
+  let text = join(a:lines, "\n")
+  let html = system("ruby -e \"def e(msg); puts msg; exit 1; end; begin; require 'rubygems'; rescue LoadError; e('rubygems not found'); end; begin; require 'redcloth'; rescue LoadError; e('RedCloth gem not installed.  Run this from the terminal: sudo gem install RedCloth'); end; puts(RedCloth.new(\\$stdin.read).to_html(:textile))\"", text)
+  return html
+endfunction
+
+function! TextileRenderFile(lines, filename)
+  let html = TextileRender(getbufline(bufname("%"), 1, '$'))
+  let html = "<html><head><title>" . bufname("%") . "</title><body>\n" . html . "\n</body></html>"
+  return writefile(split(html, "\n"), a:filename)
+endfunction
+
+function! TextileRenderBufferToPreview()
+  let filename = "/tmp/textile-preview.html"
+  call TextileRenderFile(getbufline(bufname("%"), 1, '$'), filename)
+  " Verify if browser was set
+  if !exists("g:TextileBrowser")
+    let g:TextileBrowser='Safari'
+  endif
+  " call configured browser according OS
+  if !exists("g:TextileOS") || g:TextileOS == 'mac'
+    call system("open -a \"".g:TextileBrowser."\" ".filename)
+  else
+    echo g:TextileBrowser." ".filename
+    call system(g:TextileBrowser." ".filename)
+  endif
+endfunction
+
+function! TextileRenderBufferToFile()
+  let filename = input("Filename:", substitute(bufname("%"), "textile$", "html", ""), "file")
+  call TextileRenderFile(getbufline(bufname("%"), 1, '$'), filename)
+  echo "Rendered to '" . filename . "'"
+endfunction
+
+function! TextileRenderBufferToTab()
+  let html = TextileRender(getbufline(bufname("%"), 1, '$'))
+  tabnew
+  call append("^", split(html, "\n"))
+  set syntax=html
+endfunction
+
diff --git a/vim/gvimrc b/vim/gvimrc
new file mode 100644 (file)
index 0000000..af0fe2c
--- /dev/null
@@ -0,0 +1,234 @@
+if has("gui_macvim")
+  " Fullscreen takes up entire screen
+  set fuoptions=maxhorz,maxvert
+
+  " Command-T for CommandT
+  macmenu &File.New\ Tab key=<D-T>
+  map <D-t> :CommandT<CR>
+  imap <D-t> <Esc>:CommandT<CR>
+
+  " Command-Return for fullscreen
+  macmenu Window.Toggle\ Full\ Screen\ Mode key=<D-CR>
+
+  " Command-Shift-F for Ack
+  map <D-F> :Ack<space>
+
+  " Command-e for ConqueTerm
+  map <D-e> :call StartTerm()<CR>
+
+  " Command-/ to toggle comments
+  map <D-/> <plug>NERDCommenterToggle<CR>
+  imap <D-/> <Esc><plug>NERDCommenterToggle<CR>i
+
+
+  " Command-][ to increase/decrease indentation
+  vmap <D-]> >gv
+  vmap <D-[> <gv
+
+  " Map Command-# to switch tabs
+  map  <D-0> 0gt
+  imap <D-0> <Esc>0gt
+  map  <D-1> 1gt
+  imap <D-1> <Esc>1gt
+  map  <D-2> 2gt
+  imap <D-2> <Esc>2gt
+  map  <D-3> 3gt
+  imap <D-3> <Esc>3gt
+  map  <D-4> 4gt
+  imap <D-4> <Esc>4gt
+  map  <D-5> 5gt
+  imap <D-5> <Esc>5gt
+  map  <D-6> 6gt
+  imap <D-6> <Esc>6gt
+  map  <D-7> 7gt
+  imap <D-7> <Esc>7gt
+  map  <D-8> 8gt
+  imap <D-8> <Esc>8gt
+  map  <D-9> 9gt
+  imap <D-9> <Esc>9gt
+
+  " Command-Option-ArrowKey to switch viewports
+  map <D-M-Up> <C-w>k
+  imap <D-M-Up> <Esc> <C-w>k
+  map <D-M-Down> <C-w>j
+  imap <D-M-Down> <Esc> <C-w>j
+  map <D-M-Right> <C-w>l
+  imap <D-M-Right> <Esc> <C-w>l
+  map <D-M-Left> <C-w>h
+  imap <D-M-Left> <C-w>h
+
+  " Adjust viewports to the same size
+  map <Leader>= <C-w>=
+  imap <Leader>= <Esc> <C-w>=
+endif
+
+" Don't beep
+set visualbell
+
+" Start without the toolbar
+set guioptions-=T
+
+" Default gui color scheme
+color ir_black
+
+" ConqueTerm wrapper
+function StartTerm()
+  execute 'ConqueTerm ' . $SHELL . ' --login'
+  setlocal listchars=tab:\ \ 
+endfunction
+
+" Project Tree
+if exists("loaded_nerd_tree")
+  autocmd VimEnter * call s:CdIfDirectory(expand("<amatch>"))
+  autocmd FocusGained * call s:UpdateNERDTree()
+  autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
+endif
+
+" Close all open buffers on entering a window if the only
+" buffer that's left is the NERDTree buffer
+function s:CloseIfOnlyNerdTreeLeft()
+  if exists("t:NERDTreeBufName")
+    if bufwinnr(t:NERDTreeBufName) != -1
+      if winnr("$") == 1
+        q
+      endif
+    endif
+  endif
+endfunction
+
+" If the parameter is a directory, cd into it
+function s:CdIfDirectory(directory)
+  let explicitDirectory = isdirectory(a:directory)
+  let directory = explicitDirectory || empty(a:directory)
+
+  if explicitDirectory
+    exe "cd " . fnameescape(a:directory)
+  endif
+
+  " Allows reading from stdin
+  " ex: git diff | mvim -R -
+  if strlen(a:directory) == 0 
+    return
+  endif
+
+  if directory
+    NERDTree
+    wincmd p
+    bd
+  endif
+
+  if explicitDirectory
+    wincmd p
+  endif
+endfunction
+
+" NERDTree utility function
+function s:UpdateNERDTree(...)
+  let stay = 0
+
+  if(exists("a:1"))
+    let stay = a:1
+  end
+
+  if exists("t:NERDTreeBufName")
+    let nr = bufwinnr(t:NERDTreeBufName)
+    if nr != -1
+      exe nr . "wincmd w"
+      exe substitute(mapcheck("R"), "<CR>", "", "")
+      if !stay
+        wincmd p
+      end
+    endif
+  endif
+
+  if exists(":CommandTFlush") == 2
+    CommandTFlush
+  endif
+endfunction
+
+" Utility functions to create file commands
+function s:CommandCabbr(abbreviation, expansion)
+  execute 'cabbrev ' . a:abbreviation . ' <c-r>=getcmdpos() == 1 && getcmdtype() == ":" ? "' . a:expansion . '" : "' . a:abbreviation . '"<CR>'
+endfunction
+
+function s:FileCommand(name, ...)
+  if exists("a:1")
+    let funcname = a:1
+  else
+    let funcname = a:name
+  endif
+
+  execute 'command -nargs=1 -complete=file ' . a:name . ' :call ' . funcname . '(<f-args>)'
+endfunction
+
+function s:DefineCommand(name, destination)
+  call s:FileCommand(a:destination)
+  call s:CommandCabbr(a:name, a:destination)
+endfunction
+
+" Public NERDTree-aware versions of builtin functions
+function ChangeDirectory(dir, ...)
+  execute "cd " . fnameescape(a:dir)
+  let stay = exists("a:1") ? a:1 : 1
+
+  NERDTree
+
+  if !stay
+    wincmd p
+  endif
+endfunction
+
+function Touch(file)
+  execute "!touch " . shellescape(a:file, 1)
+  call s:UpdateNERDTree()
+endfunction
+
+function Remove(file)
+  let current_path = expand("%")
+  let removed_path = fnamemodify(a:file, ":p")
+
+  if (current_path == removed_path) && (getbufvar("%", "&modified"))
+    echo "You are trying to remove the file you are editing. Please close the buffer first."
+  else
+    execute "!rm " . shellescape(a:file, 1)
+  endif
+
+  call s:UpdateNERDTree()
+endfunction
+
+function Mkdir(file)
+  execute "!mkdir " . shellescape(a:file, 1)
+  call s:UpdateNERDTree()
+endfunction
+
+function Edit(file)
+  if exists("b:NERDTreeRoot")
+    wincmd p
+  endif
+
+  execute "e " . fnameescape(a:file)
+
+ruby << RUBY
+  destination = File.expand_path(VIM.evaluate(%{system("dirname " . shellescape(a:file, 1))}))
+  pwd         = File.expand_path(Dir.pwd)
+  home        = pwd == File.expand_path("~")
+
+  if home || Regexp.new("^" + Regexp.escape(pwd)) !~ destination
+    VIM.command(%{call ChangeDirectory(fnamemodify(a:file, ":h"), 0)})
+  end
+RUBY
+endfunction
+
+" Define the NERDTree-aware aliases
+if exists("loaded_nerd_tree")
+  call s:DefineCommand("cd", "ChangeDirectory")
+  call s:DefineCommand("touch", "Touch")
+  call s:DefineCommand("rm", "Remove")
+  call s:DefineCommand("e", "Edit")
+  call s:DefineCommand("mkdir", "Mkdir")
+endif
+
+" Include user's local vim config
+if filereadable(expand("~/.gvimrc.local"))
+  source ~/.gvimrc.local
+endif
diff --git a/vim/indent/coffee.vim b/vim/indent/coffee.vim
new file mode 100644 (file)
index 0000000..f60cfdd
--- /dev/null
@@ -0,0 +1,322 @@
+" Language:    CoffeeScript
+" Maintainer:  Mick Koch <kchmck@gmail.com>
+" URL:         http://github.com/kchmck/vim-coffee-script
+" License:     WTFPL
+
+if exists("b:did_indent")
+  finish
+endif
+
+let b:did_indent = 1
+
+setlocal autoindent
+setlocal indentexpr=GetCoffeeIndent(v:lnum)
+" Make sure GetCoffeeIndent is run when these are typed so they can be
+" indented or outdented.
+setlocal indentkeys+=0],0),0.,=else,=when,=catch,=finally
+
+" Only define the function once.
+if exists("*GetCoffeeIndent")
+  finish
+endif
+
+" Keywords to indent after
+let s:INDENT_AFTER_KEYWORD = '^\%(if\|unless\|else\|for\|while\|until\|'
+\                          . 'loop\|switch\|when\|try\|catch\|finally\|'
+\                          . 'class\)\>'
+
+" Operators to indent after
+let s:INDENT_AFTER_OPERATOR = '\%([([{:=]\|[-=]>\)$'
+
+" Keywords and operators that continue a line
+let s:CONTINUATION = '\<\%(is\|isnt\|and\|or\)\>$'
+\                  . '\|'
+\                  . '\%(-\@<!-\|+\@<!+\|<\|[-=]\@<!>\|\*\|/\@<!/\|%\||\|'
+\                  . '&\|,\|\.\@<!\.\)$'
+
+" Operators that block continuation indenting
+let s:CONTINUATION_BLOCK = '[([{:=]$'
+
+" A continuation dot access
+let s:DOT_ACCESS = '^\.'
+
+" Keywords to outdent after
+let s:OUTDENT_AFTER = '^\%(return\|break\|continue\|throw\)\>'
+
+" A compound assignment like `... = if ...`
+let s:COMPOUND_ASSIGNMENT = '[:=]\s*\%(if\|unless\|for\|while\|until\|'
+\                         . 'switch\|try\|class\)\>'
+
+" A postfix condition like `return ... if ...`.
+let s:POSTFIX_CONDITION = '\S\s\+\zs\<\%(if\|unless\)\>'
+
+" A single-line else statement like `else ...` but not `else if ...
+let s:SINGLE_LINE_ELSE = '^else\s\+\%(\<\%(if\|unless\)\>\)\@!'
+
+" Max lines to look back for a match
+let s:MAX_LOOKBACK = 50
+
+" Syntax names for strings
+let s:SYNTAX_STRING = 'coffee\%(String\|AssignString\|Embed\|Regex\|Heregex\|'
+\                   . 'Heredoc\)'
+
+" Syntax names for comments
+let s:SYNTAX_COMMENT = 'coffee\%(Comment\|BlockComment\|HeregexComment\)'
+
+" Syntax names for strings and comments
+let s:SYNTAX_STRING_COMMENT = s:SYNTAX_STRING . '\|' . s:SYNTAX_COMMENT
+
+" Get the linked syntax name of a character.
+function! s:SyntaxName(linenum, col)
+  return synIDattr(synID(a:linenum, a:col, 1), 'name')
+endfunction
+
+" Check if a character is in a comment.
+function! s:IsComment(linenum, col)
+  return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_COMMENT
+endfunction
+
+" Check if a character is in a string.
+function! s:IsString(linenum, col)
+  return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING
+endfunction
+
+" Check if a character is in a comment or string.
+function! s:IsCommentOrString(linenum, col)
+  return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING_COMMENT
+endfunction
+
+" Check if a whole line is a comment.
+function! s:IsCommentLine(linenum)
+  " Check the first non-whitespace character.
+  return s:IsComment(a:linenum, indent(a:linenum) + 1)
+endfunction
+
+" Repeatedly search a line for a regex until one is found outside a string or
+" comment.
+function! s:SmartSearch(linenum, regex)
+  " Start at the first column.
+  let col = 0
+
+  " Search until there are no more matches, unless a good match is found.
+  while 1
+    call cursor(a:linenum, col + 1)
+    let [_, col] = searchpos(a:regex, 'cn', a:linenum)
+
+    " No more matches.
+    if !col
+      break
+    endif
+
+    if !s:IsCommentOrString(a:linenum, col)
+      return 1
+    endif
+  endwhile
+
+  " No good match found.
+  return 0
+endfunction
+
+" Skip a match if it's in a comment or string, is a single-line statement that
+" isn't adjacent, or is a postfix condition.
+function! s:ShouldSkip(startlinenum, linenum, col)
+  if s:IsCommentOrString(a:linenum, a:col)
+    return 1
+  endif
+
+  " Check for a single-line statement that isn't adjacent.
+  if s:SmartSearch(a:linenum, '\<then\>') && a:startlinenum - a:linenum > 1
+    return 1
+  endif
+
+  if s:SmartSearch(a:linenum, s:POSTFIX_CONDITION) &&
+  \ !s:SmartSearch(a:linenum, s:COMPOUND_ASSIGNMENT)
+    return 1
+  endif
+
+  return 0
+endfunction
+
+" Find the farthest line to look back to, capped to line 1 (zero and negative
+" numbers cause bad things).
+function! s:MaxLookback(startlinenum)
+  return max([1, a:startlinenum - s:MAX_LOOKBACK])
+endfunction
+
+" Get the skip expression for searchpair().
+function! s:SkipExpr(startlinenum)
+  return "s:ShouldSkip(" . a:startlinenum . ", line('.'), col('.'))"
+endfunction
+
+" Search for pairs of text.
+function! s:SearchPair(start, end)
+  " The cursor must be in the first column for regexes to match.
+  call cursor(0, 1)
+
+  let startlinenum = line('.')
+
+  " Don't need the W flag since MaxLookback caps the search to line 1.
+  return searchpair(a:start, '', a:end, 'bcn',
+  \                 s:SkipExpr(startlinenum),
+  \                 s:MaxLookback(startlinenum))
+endfunction
+
+" Try to find a previous matching line.
+function! s:GetMatch(curline)
+  let firstchar = a:curline[0]
+
+  if firstchar == '}'
+    return s:SearchPair('{', '}')
+  elseif firstchar == ')'
+    return s:SearchPair('(', ')')
+  elseif firstchar == ']'
+    return s:SearchPair('\[', '\]')
+  elseif a:curline =~ '^else\>'
+    return s:SearchPair('\<\%(if\|unless\|when\)\>', '\<else\>')
+  elseif a:curline =~ '^catch\>'
+    return s:SearchPair('\<try\>', '\<catch\>')
+  elseif a:curline =~ '^finally\>'
+    return s:SearchPair('\<try\>', '\<finally\>')
+  endif
+
+  return 0
+endfunction
+
+" Get the nearest previous line that isn't a comment.
+function! s:GetPrevNormalLine(startlinenum)
+  let curlinenum = a:startlinenum
+
+  while curlinenum > 0
+    let curlinenum = prevnonblank(curlinenum - 1)
+
+    if !s:IsCommentLine(curlinenum)
+      return curlinenum
+    endif
+  endwhile
+
+  return 0
+endfunction
+
+" Try to find a comment in a line.
+function! s:FindComment(linenum)
+  let col = 0
+
+  while 1
+    call cursor(a:linenum, col + 1)
+    let [_, col] = searchpos('#', 'cn', a:linenum)
+
+    if !col
+      break
+    endif
+
+    if s:IsComment(a:linenum, col)
+      return col
+    endif
+  endwhile
+
+  return 0
+endfunction
+
+" Get a line without comments or surrounding whitespace.
+function! s:GetTrimmedLine(linenum)
+  let comment = s:FindComment(a:linenum)
+  let line = getline(a:linenum)
+
+  if comment
+    " Subtract 1 to get to the column before the comment and another 1 for
+    " zero-based indexing.
+    let line = line[:comment - 2]
+  endif
+
+  return substitute(substitute(line, '^\s\+', '', ''),
+  \                                  '\s\+$', '', '')
+endfunction
+
+function! s:GetCoffeeIndent(curlinenum)
+  let prevlinenum = s:GetPrevNormalLine(a:curlinenum)
+
+  " Don't do anything if there's no previous line.
+  if !prevlinenum
+    return -1
+  endif
+
+  let curline = s:GetTrimmedLine(a:curlinenum)
+
+  " Try to find a previous matching statement. This handles outdenting.
+  let matchlinenum = s:GetMatch(curline)
+
+  if matchlinenum
+    return indent(matchlinenum)
+  endif
+
+  " Try to find a matching `when`.
+  if curline =~ '^when\>' && !s:SmartSearch(prevlinenum, '\<switch\>')
+    let linenum = a:curlinenum
+
+    while linenum > 0
+      let linenum = s:GetPrevNormalLine(linenum)
+
+      if getline(linenum) =~ '^\s*when\>'
+        return indent(linenum)
+      endif
+    endwhile
+
+    return -1
+  endif
+
+  let prevline = s:GetTrimmedLine(prevlinenum)
+  let previndent = indent(prevlinenum)
+
+  " Always indent after these operators.
+  if prevline =~ s:INDENT_AFTER_OPERATOR
+    return previndent + &shiftwidth
+  endif
+
+  " Indent after a continuation if it's the first.
+  if prevline =~ s:CONTINUATION
+    let prevprevlinenum = s:GetPrevNormalLine(prevlinenum)
+    let prevprevline = s:GetTrimmedLine(prevprevlinenum)
+
+    if prevprevline !~ s:CONTINUATION && prevprevline !~ s:CONTINUATION_BLOCK
+      return previndent + &shiftwidth
+    endif
+
+    return -1
+  endif
+
+  " Indent after these keywords and compound assignments if they aren't a
+  " single-line statement.
+  if prevline =~ s:INDENT_AFTER_KEYWORD || prevline =~ s:COMPOUND_ASSIGNMENT
+    if !s:SmartSearch(prevlinenum, '\<then\>') && prevline !~ s:SINGLE_LINE_ELSE
+      return previndent + &shiftwidth
+    endif
+
+    return -1
+  endif
+
+  " Indent a dot access if it's the first.
+  if curline =~ s:DOT_ACCESS && prevline !~ s:DOT_ACCESS
+    return previndent + &shiftwidth
+  endif
+
+  " Outdent after these keywords if they don't have a postfix condition or are
+  " a single-line statement.
+  if prevline =~ s:OUTDENT_AFTER
+    if !s:SmartSearch(prevlinenum, s:POSTFIX_CONDITION) ||
+    \   s:SmartSearch(prevlinenum, '\<then\>')
+      return previndent - &shiftwidth
+    endif
+  endif
+
+  " No indenting or outdenting is needed.
+  return -1
+endfunction
+
+" Wrap s:GetCoffeeIndent to keep the cursor position.
+function! GetCoffeeIndent(curlinenum)
+  let oldcursor = getpos('.')
+  let indent = s:GetCoffeeIndent(a:curlinenum)
+  call setpos('.', oldcursor)
+
+  return indent
+endfunction
diff --git a/vim/indent/cucumber.vim b/vim/indent/cucumber.vim
new file mode 100644 (file)
index 0000000..802d224
--- /dev/null
@@ -0,0 +1,74 @@
+" Vim indent file
+" Language:    Cucumber
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2010 May 21
+
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal autoindent
+setlocal indentexpr=GetCucumberIndent()
+setlocal indentkeys=o,O,*<Return>,<:>,0<Bar>,0#,=,!^F
+
+let b:undo_indent = 'setl ai< inde< indk<'
+
+" Only define the function once.
+if exists("*GetCucumberIndent")
+  finish
+endif
+
+function! s:syn(lnum)
+  return synIDattr(synID(a:lnum,1+indent(a:lnum),1),'name')
+endfunction
+
+function! GetCucumberIndent()
+  let line  = getline(prevnonblank(v:lnum-1))
+  let cline = getline(v:lnum)
+  let nline = getline(nextnonblank(v:lnum+1))
+  let syn = s:syn(prevnonblank(v:lnum-1))
+  let csyn = s:syn(v:lnum)
+  let nsyn = s:syn(nextnonblank(v:lnum+1))
+  if csyn ==# 'cucumberFeature' || cline =~# '^\s*Feature:'
+    " feature heading
+    return 0
+  elseif csyn ==# 'cucumberExamples' || cline =~# '^\s*\%(Examples\|Scenarios\):'
+    " examples heading
+    return 2 * &sw
+  elseif csyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || cline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
+    " background, scenario or outline heading
+    return &sw
+  elseif syn ==# 'cucumberFeature' || line =~# '^\s*Feature:'
+    " line after feature heading
+    return &sw
+  elseif syn ==# 'cucumberExamples' || line =~# '^\s*\%(Examples\|Scenarios\):'
+    " line after examples heading
+    return 3 * &sw
+  elseif syn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
+    " line after background, scenario or outline heading
+    return 2 * &sw
+  elseif cline =~# '^\s*[@#]' && (nsyn == 'cucumberFeature' || nline =~# '^\s*Feature:' || indent(prevnonblank(v:lnum-1)) <= 0)
+    " tag or comment before a feature heading
+    return 0
+  elseif cline =~# '^\s*@'
+    " other tags
+    return &sw
+  elseif cline =~# '^\s*[#|]' && line =~# '^\s*|'
+    " mid-table
+    " preserve indent
+    return indent(prevnonblank(v:lnum-1))
+  elseif cline =~# '^\s*|' && line =~# '^\s*[^|]'
+    " first line of a table, relative indent
+    return indent(prevnonblank(v:lnum-1)) + &sw
+  elseif cline =~# '^\s*[^|]' && line =~# '^\s*|'
+    " line after a table, relative unindent
+    return indent(prevnonblank(v:lnum-1)) - &sw
+  elseif cline =~# '^\s*#' && getline(v:lnum-1) =~ '^\s*$' && (nsyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || nline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):')
+    " comments on scenarios
+    return &sw
+  endif
+  return indent(prevnonblank(v:lnum-1))
+endfunction
+
+" vim:set sts=2 sw=2:
diff --git a/vim/indent/gitconfig.vim b/vim/indent/gitconfig.vim
new file mode 100644 (file)
index 0000000..e190fc3
--- /dev/null
@@ -0,0 +1,36 @@
+" Vim indent file
+" Language:    git config file
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal autoindent
+setlocal indentexpr=GetGitconfigIndent()
+setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F
+
+let b:undo_indent = 'setl ai< inde< indk<'
+
+" Only define the function once.
+if exists("*GetGitconfigIndent")
+  finish
+endif
+
+function! GetGitconfigIndent()
+  let line  = getline(prevnonblank(v:lnum-1))
+  let cline = getline(v:lnum)
+  if line =~  '\\\@<!\%(\\\\\)*\\$'
+    " odd number of slashes, in a line continuation
+    return 2 * &sw
+  elseif cline =~ '^\s*\['
+    return 0
+  elseif cline =~ '^\s*\a'
+    return &sw
+  elseif cline == ''       && line =~ '^\['
+    return &sw
+  else
+    return -1
+  endif
+endfunction
diff --git a/vim/indent/haml.vim b/vim/indent/haml.vim
new file mode 100644 (file)
index 0000000..58c0307
--- /dev/null
@@ -0,0 +1,73 @@
+" Vim indent file
+" Language:    Haml
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2010 May 21
+
+if exists("b:did_indent")
+  finish
+endif
+runtime! indent/ruby.vim
+unlet! b:did_indent
+let b:did_indent = 1
+
+setlocal autoindent sw=2 et
+setlocal indentexpr=GetHamlIndent()
+setlocal indentkeys=o,O,*<Return>,},],0),!^F,=end,=else,=elsif,=rescue,=ensure,=when
+
+" Only define the function once.
+if exists("*GetHamlIndent")
+  finish
+endif
+
+let s:attributes = '\%({.\{-\}}\|\[.\{-\}\]\)'
+let s:tag = '\%([%.#][[:alnum:]_-]\+\|'.s:attributes.'\)*[<>]*'
+
+if !exists('g:haml_self_closing_tags')
+  let g:haml_self_closing_tags = 'meta|link|img|hr|br'
+endif
+
+function! GetHamlIndent()
+  let lnum = prevnonblank(v:lnum-1)
+  if lnum == 0
+    return 0
+  endif
+  let line = substitute(getline(lnum),'\s\+$','','')
+  let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
+  let lastcol = strlen(line)
+  let line = substitute(line,'^\s\+','','')
+  let indent = indent(lnum)
+  let cindent = indent(v:lnum)
+  if cline =~# '\v^-\s*%(elsif|else|when)>'
+    let indent = cindent < indent ? cindent : indent - &sw
+  endif
+  let increase = indent + &sw
+  if indent == indent(lnum)
+    let indent = cindent <= indent ? -1 : increase
+  endif
+
+  let group = synIDattr(synID(lnum,lastcol,1),'name')
+
+  if line =~ '^!!!'
+    return indent
+  elseif line =~ '^/\%(\[[^]]*\]\)\=$'
+    return increase
+  elseif group == 'hamlFilter'
+    return increase
+  elseif line =~ '^'.s:tag.'[&!]\=[=~-]\s*\%(\%(if\|else\|elsif\|unless\|case\|when\|while\|until\|for\|begin\|module\|class\|def\)\>\%(.*\<end\>\)\@!\|.*do\%(\s*|[^|]*|\)\=\s*$\)'
+    return increase
+  elseif line =~ '^'.s:tag.'[&!]\=[=~-].*,\s*$'
+    return increase
+  elseif line == '-#'
+    return increase
+  elseif group =~? '\v^(hamlSelfCloser)$' || line =~? '^%\v%('.g:haml_self_closing_tags.')>'
+    return indent
+  elseif group =~? '\v^%(hamlTag|hamlAttributesDelimiter|hamlObjectDelimiter|hamlClass|hamlId|htmlTagName|htmlSpecialTagName)$'
+    return increase
+  elseif synIDattr(synID(v:lnum,1,1),'name') ==? 'hamlRubyFilter'
+    return GetRubyIndent()
+  else
+    return indent
+  endif
+endfunction
+
+" vim:set sw=2:
diff --git a/vim/indent/javascript.vim b/vim/indent/javascript.vim
new file mode 100644 (file)
index 0000000..b34deee
--- /dev/null
@@ -0,0 +1,328 @@
+" Vim indent file
+" Language:            Javascript
+" Maintainer:          Darrick Wiebe <darrick at innatesoftware.com>
+" URL:                 http://github.com/pangloss/vim-javascript
+" Version:              1.0.0
+" Last Change:          August 31, 2009
+" Acknowledgement:      Based off of vim-ruby maintained by Nikolai Weibull http://vim-ruby.rubyforge.org
+
+" 0. Initialization {{{1
+" =================
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal nosmartindent
+
+" Now, set up our indentation expression and keys that trigger it.
+setlocal indentexpr=GetJavascriptIndent()
+setlocal indentkeys=0{,0},0),0],!^F,o,O,e
+
+" Only define the function once.
+if exists("*GetJavascriptIndent")
+  finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" 1. Variables {{{1
+" ============
+
+" Regex of syntax group names that are or delimit string or are comments.
+let s:syng_strcom = 'javaScript\%(String\|RegexpString\|CommentTodo\|LineComment\|Comment\|DocComment\)'
+
+" Regex of syntax group names that are strings.
+let s:syng_string = 'javaScript\%(RegexpString\)'
+
+" Regex of syntax group names that are strings or documentation.
+let s:syng_stringdoc = 'javaScriptDocComment\|javaScriptComment'
+
+" Expression used to check whether we should skip a match with searchpair().
+let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
+
+let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
+
+" Regex that defines continuation lines, not including (, {, or [.
+let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term
+
+" Regex that defines continuation lines.
+" TODO: this needs to deal with if ...: and so on
+let s:msl_regex = '\%([\\*+/.:([]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term
+
+let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
+
+" Regex that defines blocks.
+let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
+
+" 2. Auxiliary Functions {{{1
+" ======================
+
+" Check if the character at lnum:col is inside a string, comment, or is ascii.
+function s:IsInStringOrComment(lnum, col)
+  return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom
+endfunction
+
+" Check if the character at lnum:col is inside a string.
+function s:IsInString(lnum, col)
+  return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_string
+endfunction
+
+" Check if the character at lnum:col is inside a string or documentation.
+function s:IsInStringOrDocumentation(lnum, col)
+  return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_stringdoc
+endfunction
+
+" Find line above 'lnum' that isn't empty, in a comment, or in a string.
+function s:PrevNonBlankNonString(lnum)
+  let in_block = 0
+  let lnum = prevnonblank(a:lnum)
+  while lnum > 0
+    " Go in and out of blocks comments as necessary.
+    " If the line isn't empty (with opt. comment) or in a string, end search.
+    let line = getline(lnum)
+    if line =~ '/\*'
+      if in_block
+        let in_block = 0
+      else
+        break
+      endif
+    elseif !in_block && line =~ '\*/'
+      let in_block = 1
+    elseif !in_block && line !~ '^\s*\%(//\).*$' && !(s:IsInStringOrComment(lnum, 1) && s:IsInStringOrComment(lnum, strlen(line)))
+      break
+    endif
+    let lnum = prevnonblank(lnum - 1)
+  endwhile
+  return lnum
+endfunction
+
+" Find line above 'lnum' that started the continuation 'lnum' may be part of.
+function s:GetMSL(lnum, in_one_line_scope)
+  " Start on the line we're at and use its indent.
+  let msl = a:lnum
+  let lnum = s:PrevNonBlankNonString(a:lnum - 1)
+  while lnum > 0
+    " If we have a continuation line, or we're in a string, use line as MSL.
+    " Otherwise, terminate search as we have found our MSL already.
+    let line = getline(lnum)
+    let col = match(line, s:msl_regex) + 1
+    if (col > 0 && !s:IsInStringOrComment(lnum, col)) || s:IsInString(lnum, strlen(line))
+      let msl = lnum
+    else
+      " Don't use lines that are part of a one line scope as msl unless the
+      " flag in_one_line_scope is set to 1
+      "
+      if a:in_one_line_scope 
+       break
+      end
+      let msl_one_line = s:Match(lnum, s:one_line_scope_regex)
+      if msl_one_line == 0
+       break
+      endif
+    endif
+    let lnum = s:PrevNonBlankNonString(lnum - 1)
+  endwhile
+  return msl
+endfunction
+
+" Check if line 'lnum' has more opening brackets than closing ones.
+function s:LineHasOpeningBrackets(lnum)
+  let open_0 = 0
+  let open_2 = 0
+  let open_4 = 0
+  let line = getline(a:lnum)
+  let pos = match(line, '[][(){}]', 0)
+  while pos != -1
+    if !s:IsInStringOrComment(a:lnum, pos + 1)
+      let idx = stridx('(){}[]', line[pos])
+      if idx % 2 == 0
+        let open_{idx} = open_{idx} + 1
+      else
+        let open_{idx - 1} = open_{idx - 1} - 1
+      endif
+    endif
+    let pos = match(line, '[][(){}]', pos + 1)
+  endwhile
+  return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
+endfunction
+
+function s:Match(lnum, regex)
+  let col = match(getline(a:lnum), a:regex) + 1
+  return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0
+endfunction
+
+function s:IndentWithContinuation(lnum, ind, width)
+  " Set up variables to use and search for MSL to the previous line.
+  let p_lnum = a:lnum
+  let lnum = s:GetMSL(a:lnum, 1)
+  let line = getline(line)
+
+  " If the previous line wasn't a MSL and is continuation return its indent.
+  " TODO: the || s:IsInString() thing worries me a bit.
+  if p_lnum != lnum
+    if s:Match(p_lnum,s:continuation_regex)||s:IsInString(p_lnum,strlen(line))
+      return a:ind
+    endif
+  endif
+
+  " Set up more variables now that we know we aren't continuation bound.
+  let msl_ind = indent(lnum)
+
+  " If the previous line ended with [*+/.-=], start a continuation that
+  " indents an extra level.
+  if s:Match(lnum, s:continuation_regex)
+    if lnum == p_lnum
+      return msl_ind + a:width
+    else
+      return msl_ind
+    endif
+  endif
+
+  return a:ind
+endfunction
+
+function s:InOneLineScope(lnum)
+  let msl = s:GetMSL(a:lnum, 1)
+  if msl > 0 && s:Match(msl, s:one_line_scope_regex)
+    return msl
+  endif
+  return 0
+endfunction
+
+function s:ExitingOneLineScope(lnum)
+  let msl = s:GetMSL(a:lnum, 1)
+  if msl > 0
+    " if the current line is in a one line scope ..
+    if s:Match(msl, s:one_line_scope_regex)
+      return 0
+    else
+      let prev_msl = s:GetMSL(msl - 1, 1)
+      if s:Match(prev_msl, s:one_line_scope_regex)
+       return prev_msl
+      endif
+    endif
+  endif
+  return 0
+endfunction
+
+" 3. GetJavascriptIndent Function {{{1
+" =========================
+
+function GetJavascriptIndent()
+  " 3.1. Setup {{{2
+  " ----------
+
+  " Set up variables for restoring position in file.  Could use v:lnum here.
+  let vcol = col('.')
+
+  " 3.2. Work on the current line {{{2
+  " -----------------------------
+
+  " Get the current line.
+  let line = getline(v:lnum)
+  let ind = -1
+
+
+  " If we got a closing bracket on an empty line, find its match and indent
+  " according to it.  For parentheses we indent to its column - 1, for the
+  " others we indent to the containing line's MSL's level.  Return -1 if fail.
+  let col = matchend(line, '^\s*[]})]')
+  if col > 0 && !s:IsInStringOrComment(v:lnum, col)
+    call cursor(v:lnum, col)
+    let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
+    if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
+      if line[col-1]==')' && col('.') != col('$') - 1
+        let ind = virtcol('.')-1
+      else
+        let ind = indent(s:GetMSL(line('.'), 0))
+      endif
+    endif
+    return ind
+  endif
+
+  " If we have a /* or */ set indent to first column.
+  if match(line, '^\s*\%(/\*\|\*/\)$') != -1
+    return 0
+  endif
+
+  " If we are in a multi-line string or line-comment, don't do anything to it.
+  if s:IsInStringOrDocumentation(v:lnum, matchend(line, '^\s*') + 1)
+    return indent('.')
+  endif
+
+  " 3.3. Work on the previous line. {{{2
+  " -------------------------------
+
+  " Find a non-blank, non-multi-line string line above the current line.
+  let lnum = s:PrevNonBlankNonString(v:lnum - 1)
+
+  " If the line is empty and inside a string, use the previous line.
+  if line =~ '^\s*$' && lnum != prevnonblank(v:lnum - 1)
+    return indent(prevnonblank(v:lnum))
+  endif
+
+  " At the start of the file use zero indent.
+  if lnum == 0
+    return 0
+  endif
+
+  " Set up variables for current line.
+  let line = getline(lnum)
+  let ind = indent(lnum)
+
+  " If the previous line ended with a block opening, add a level of indent.
+  if s:Match(lnum, s:block_regex)
+    return indent(s:GetMSL(lnum, 0)) + &sw
+  endif
+
+  " If the previous line contained an opening bracket, and we are still in it,
+  " add indent depending on the bracket type.
+  if line =~ '[[({]'
+    let counts = s:LineHasOpeningBrackets(lnum)
+    if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
+      if col('.') + 1 == col('$')
+        return ind + &sw
+      else
+        return virtcol('.')
+      endif
+    elseif counts[1] == '1' || counts[2] == '1'
+      return ind + &sw
+    else
+      call cursor(v:lnum, vcol)
+    end
+  endif
+
+  " 3.4. Work on the MSL line. {{{2
+  " --------------------------
+
+  let ind_con = ind
+  let ind = s:IndentWithContinuation(lnum, ind_con, &sw)
+
+  " }}}2
+  "
+  "
+  let ols = s:InOneLineScope(lnum)
+  if ols > 0
+    let ind = ind + &sw
+  else
+    let ols = s:ExitingOneLineScope(lnum)
+    while ols > 0 && ind > 0
+      let ind = ind - &sw
+      let ols = s:InOneLineScope(ols - 1)
+    endwhile
+  endif
+
+  return ind
+endfunction
+
+" }}}1
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim:set sw=2 sts=2 ts=8 noet:
+
diff --git a/vim/indent/puppet.vim b/vim/indent/puppet.vim
new file mode 100644 (file)
index 0000000..689e068
--- /dev/null
@@ -0,0 +1,76 @@
+" Vim indent file
+" Language:    Puppet
+" Maintainer:  Todd Zullinger <tmz@pobox.com>
+" Last Change: 2009 Aug 19
+" vim: set sw=4 sts=4:
+
+if exists("b:did_indent")
+    finish
+endif
+let b:did_indent = 1
+
+setlocal autoindent smartindent
+setlocal indentexpr=GetPuppetIndent()
+setlocal indentkeys+=0],0)
+
+if exists("*GetPuppetIndent")
+    finish
+endif
+
+" Check if a line is part of an include 'block', e.g.:
+"   include foo,
+"       bar,
+"       baz
+function! s:PartOfInclude(lnum)
+    let lnum = a:lnum
+    while lnum
+        let lnum = lnum - 1
+        let line = getline(lnum)
+        if line !~ ',$'
+            break
+        endif
+        if line =~ '^\s*include\s\+[^,]\+,$'
+            return 1
+        endif
+    endwhile
+    return 0
+endfunction
+
+function! s:OpenBrace(lnum)
+    call cursor(a:lnum, 1)
+    return searchpair('{\|\[\|(', '', '}\|\]\|)', 'nbW')
+endfunction
+
+function! GetPuppetIndent()
+    let pnum = prevnonblank(v:lnum - 1)
+    if pnum == 0
+       return 0
+    endif
+
+    let line = getline(v:lnum)
+    let pline = getline(pnum)
+    let ind = indent(pnum)
+
+    if pline =~ '^\s*#'
+        return ind
+    endif
+
+    if pline =~ '\({\|\[\|(\|:\)$'
+        let ind += &sw
+    elseif pline =~ ';$' && pline !~ '[^:]\+:.*[=+]>.*'
+        let ind -= &sw
+    elseif pline =~ '^\s*include\s\+.*,$'
+        let ind += &sw
+    endif
+
+    if pline !~ ',$' && s:PartOfInclude(pnum)
+        let ind -= &sw
+    endif
+
+    " Match } }, }; ] ]: )
+    if line =~ '^\s*\(}\(,\|;\)\?$\|]:\?$\|)\)'
+        let ind = indent(s:OpenBrace(v:lnum))
+    endif
+
+    return ind
+endfunction
diff --git a/vim/indent/sass.vim b/vim/indent/sass.vim
new file mode 100644 (file)
index 0000000..1da8319
--- /dev/null
@@ -0,0 +1,40 @@
+" Vim indent file
+" Language:    Sass
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2010 May 21
+
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal autoindent sw=2 et
+setlocal indentexpr=GetSassIndent()
+setlocal indentkeys=o,O,*<Return>,<:>,!^F
+
+" Only define the function once.
+if exists("*GetSassIndent")
+  finish
+endif
+
+let s:property = '^\s*:\|^\s*[[:alnum:]#{}-]\+\%(:\|\s*=\)'
+let s:extend = '^\s*\%(@extend\|@include\|+\)'
+
+function! GetSassIndent()
+  let lnum = prevnonblank(v:lnum-1)
+  let line = substitute(getline(lnum),'\s\+$','','')
+  let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
+  let lastcol = strlen(line)
+  let line = substitute(line,'^\s\+','','')
+  let indent = indent(lnum)
+  let cindent = indent(v:lnum)
+  if line !~ s:property && line !~ s:extend && cline =~ s:property
+    return indent + &sw
+  "elseif line =~ s:property && cline !~ s:property
+    "return indent - &sw
+  else
+    return -1
+  endif
+endfunction
+
+" vim:set sw=2:
diff --git a/vim/indent/scala.vim b/vim/indent/scala.vim
new file mode 100644 (file)
index 0000000..45266a0
--- /dev/null
@@ -0,0 +1,83 @@
+" Vim indent file
+" Language   : Scala (http://scala-lang.org/)
+" Maintainer : Stefan Matthias Aust
+" Last Change: 2006 Apr 13
+
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetScalaIndent()
+
+setlocal indentkeys=0{,0},0),!^F,<>>,<CR>
+
+setlocal autoindent sw=2 et
+
+if exists("*GetScalaIndent")
+  finish
+endif
+
+function! CountParens(line)
+  let line = substitute(a:line, '"\(.\|\\"\)*"', '', 'g')
+  let open = substitute(line, '[^(]', '', 'g')
+  let close = substitute(line, '[^)]', '', 'g')
+  return strlen(open) - strlen(close)
+endfunction
+
+function! GetScalaIndent()
+  " Find a non-blank line above the current line.
+  let lnum = prevnonblank(v:lnum - 1)
+
+  " Hit the start of the file, use zero indent.
+  if lnum == 0
+    return 0
+  endif
+
+  let ind = indent(lnum)
+  let prevline = getline(lnum)
+
+  "Indent html literals
+  if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$'
+    return ind + &shiftwidth
+  endif
+
+  " Add a 'shiftwidth' after lines that start a block
+  " If if, for or while end with ), this is a one-line block
+  " If val, var, def end with =, this is a one-line block
+  if prevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\|va[lr]\|def\)\>.*[)=]\s*$'
+        \ || prevline =~ '^\s*\<else\>\s*$'
+        \ || prevline =~ '{\s*$'
+    let ind = ind + &shiftwidth
+  endif
+
+  " If parenthesis are unbalanced, indent or dedent
+  let c = CountParens(prevline)
+  echo c
+  if c > 0
+    let ind = ind + &shiftwidth
+  elseif c < 0
+    let ind = ind - &shiftwidth
+  endif
+  
+  " Dedent after if, for, while and val, var, def without block
+  let pprevline = getline(prevnonblank(lnum - 1))
+  if pprevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\|va[lr]\|def\)\>.*[)=]\s*$'
+        \ || pprevline =~ '^\s*\<else\>\s*$'
+    let ind = ind - &shiftwidth
+  endif
+
+  " Align 'for' clauses nicely
+  if prevline =~ '^\s*\<for\> (.*;\s*$'
+    let ind = ind - &shiftwidth + 5
+  endif
+
+  " Subtract a 'shiftwidth' on '}' or html
+  let thisline = getline(v:lnum)
+  if thisline =~ '^\s*[})]' 
+        \ || thisline =~ '^\s*</[a-zA-Z][^>]*>'
+    let ind = ind - &shiftwidth
+  endif
+
+  return ind
+endfunction
diff --git a/vim/indent/scss.vim b/vim/indent/scss.vim
new file mode 100644 (file)
index 0000000..82bba49
--- /dev/null
@@ -0,0 +1,12 @@
+" Vim indent file
+" Language:    SCSS
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2010 Jul 26
+
+if exists("b:did_indent")
+  finish
+endif
+
+runtime! indent/css.vim
+
+" vim:set sw=2:
diff --git a/vim/nerdtree_plugin/exec_menuitem.vim b/vim/nerdtree_plugin/exec_menuitem.vim
new file mode 100644 (file)
index 0000000..e7a7c53
--- /dev/null
@@ -0,0 +1,41 @@
+" ============================================================================
+" File:        exec_menuitem.vim
+" Description: plugin for NERD Tree that provides an execute file menu item
+" Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+" Last Change: 22 July, 2009
+" License:     This program is free software. It comes without any warranty,
+"              to the extent permitted by applicable law. You can redistribute
+"              it and/or modify it under the terms of the Do What The Fuck You
+"              Want To Public License, Version 2, as published by Sam Hocevar.
+"              See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" ============================================================================
+if exists("g:loaded_nerdtree_exec_menuitem")
+    finish
+endif
+let g:loaded_nerdtree_exec_menuitem = 1
+
+call NERDTreeAddMenuItem({
+            \ 'text': '(!)Execute file',
+            \ 'shortcut': '!',
+            \ 'callback': 'NERDTreeExecFile',
+            \ 'isActiveCallback': 'NERDTreeExecFileActive' })
+
+function! NERDTreeExecFileActive()
+    let node = g:NERDTreeFileNode.GetSelected()
+    return !node.path.isDirectory && node.path.isExecutable
+endfunction
+
+function! NERDTreeExecFile()
+    let treenode = g:NERDTreeFileNode.GetSelected()
+    echo "==========================================================\n"
+    echo "Complete the command to execute (add arguments etc):\n"
+    let cmd = treenode.path.str({'escape': 1})
+    let cmd = input(':!', cmd . ' ')
+
+    if cmd != ''
+        exec ':!' . cmd
+    else
+        echo "Aborted"
+    endif
+endfunction
diff --git a/vim/nerdtree_plugin/fs_menu.vim b/vim/nerdtree_plugin/fs_menu.vim
new file mode 100644 (file)
index 0000000..e25b38c
--- /dev/null
@@ -0,0 +1,194 @@
+" ============================================================================
+" File:        fs_menu.vim
+" Description: plugin for the NERD Tree that provides a file system menu
+" Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+" Last Change: 17 July, 2009
+" License:     This program is free software. It comes without any warranty,
+"              to the extent permitted by applicable law. You can redistribute
+"              it and/or modify it under the terms of the Do What The Fuck You
+"              Want To Public License, Version 2, as published by Sam Hocevar.
+"              See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" ============================================================================
+if exists("g:loaded_nerdtree_fs_menu")
+    finish
+endif
+let g:loaded_nerdtree_fs_menu = 1
+
+call NERDTreeAddMenuItem({'text': '(a)dd a childnode', 'shortcut': 'a', 'callback': 'NERDTreeAddNode'})
+call NERDTreeAddMenuItem({'text': '(m)ove the curent node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})
+call NERDTreeAddMenuItem({'text': '(d)elete the curent node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'})
+if g:NERDTreePath.CopyingSupported()
+    call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
+endif
+
+"FUNCTION: s:echo(msg){{{1
+function! s:echo(msg)
+    redraw
+    echomsg "NERDTree: " . a:msg
+endfunction
+
+"FUNCTION: s:echoWarning(msg){{{1
+function! s:echoWarning(msg)
+    echohl warningmsg
+    call s:echo(a:msg)
+    echohl normal
+endfunction
+
+"FUNCTION: s:promptToDelBuffer(bufnum, msg){{{1
+"prints out the given msg and, if the user responds by pushing 'y' then the
+"buffer with the given bufnum is deleted
+"
+"Args:
+"bufnum: the buffer that may be deleted
+"msg: a message that will be echoed to the user asking them if they wish to
+"     del the buffer
+function! s:promptToDelBuffer(bufnum, msg)
+    echo a:msg
+    if nr2char(getchar()) ==# 'y'
+        exec "silent bdelete! " . a:bufnum
+    endif
+endfunction
+
+"FUNCTION: NERDTreeAddNode(){{{1
+function! NERDTreeAddNode()
+    let curDirNode = g:NERDTreeDirNode.GetSelected()
+
+    let newNodeName = input("Add a childnode\n".
+                          \ "==========================================================\n".
+                          \ "Enter the dir/file name to be created. Dirs end with a '/'\n" .
+                          \ "", curDirNode.path.str({'format': 'Glob'}) . g:NERDTreePath.Slash())
+
+    if newNodeName ==# ''
+        call s:echo("Node Creation Aborted.")
+        return
+    endif
+
+    try
+        let newPath = g:NERDTreePath.Create(newNodeName)
+        let parentNode = b:NERDTreeRoot.findNode(newPath.getParent())
+
+        let newTreeNode = g:NERDTreeFileNode.New(newPath)
+        if parentNode.isOpen || !empty(parentNode.children)
+            call parentNode.addChild(newTreeNode, 1)
+            call NERDTreeRender()
+            call newTreeNode.putCursorHere(1, 0)
+        endif
+    catch /^NERDTree/
+        call s:echoWarning("Node Not Created.")
+    endtry
+endfunction
+
+"FUNCTION: NERDTreeMoveNode(){{{1
+function! NERDTreeMoveNode()
+    let curNode = g:NERDTreeFileNode.GetSelected()
+    let newNodePath = input("Rename the current node\n" .
+                          \ "==========================================================\n" .
+                          \ "Enter the new path for the node:                          \n" .
+                          \ "", curNode.path.str())
+
+    if newNodePath ==# ''
+        call s:echo("Node Renaming Aborted.")
+        return
+    endif
+
+    try
+        let bufnum = bufnr(curNode.path.str())
+
+        call curNode.rename(newNodePath)
+        call NERDTreeRender()
+
+        "if the node is open in a buffer, ask the user if they want to
+        "close that buffer
+        if bufnum != -1
+            let prompt = "\nNode renamed.\n\nThe old file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
+            call s:promptToDelBuffer(bufnum, prompt)
+        endif
+
+        call curNode.putCursorHere(1, 0)
+
+        redraw
+    catch /^NERDTree/
+        call s:echoWarning("Node Not Renamed.")
+    endtry
+endfunction
+
+" FUNCTION: NERDTreeDeleteNode() {{{1
+function! NERDTreeDeleteNode()
+    let currentNode = g:NERDTreeFileNode.GetSelected()
+    let confirmed = 0
+
+    if currentNode.path.isDirectory
+        let choice =input("Delete the current node\n" .
+                         \ "==========================================================\n" .
+                         \ "STOP! To delete this entire directory, type 'yes'\n" .
+                         \ "" . currentNode.path.str() . ": ")
+        let confirmed = choice ==# 'yes'
+    else
+        echo "Delete the current node\n" .
+           \ "==========================================================\n".
+           \ "Are you sure you wish to delete the node:\n" .
+           \ "" . currentNode.path.str() . " (yN):"
+        let choice = nr2char(getchar())
+        let confirmed = choice ==# 'y'
+    endif
+
+
+    if confirmed
+        try
+            call currentNode.delete()
+            call NERDTreeRender()
+
+            "if the node is open in a buffer, ask the user if they want to
+            "close that buffer
+            let bufnum = bufnr(currentNode.path.str())
+            if buflisted(bufnum)
+                let prompt = "\nNode deleted.\n\nThe file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
+                call s:promptToDelBuffer(bufnum, prompt)
+            endif
+
+            redraw
+        catch /^NERDTree/
+            call s:echoWarning("Could not remove node")
+        endtry
+    else
+        call s:echo("delete aborted")
+    endif
+
+endfunction
+
+" FUNCTION: NERDTreeCopyNode() {{{1
+function! NERDTreeCopyNode()
+    let currentNode = g:NERDTreeFileNode.GetSelected()
+    let newNodePath = input("Copy the current node\n" .
+                          \ "==========================================================\n" .
+                          \ "Enter the new path to copy the node to:                   \n" .
+                          \ "", currentNode.path.str())
+
+    if newNodePath != ""
+        "strip trailing slash
+        let newNodePath = substitute(newNodePath, '\/$', '', '')
+
+        let confirmed = 1
+        if currentNode.path.copyingWillOverwrite(newNodePath)
+            call s:echo("Warning: copying may overwrite files! Continue? (yN)")
+            let choice = nr2char(getchar())
+            let confirmed = choice ==# 'y'
+        endif
+
+        if confirmed
+            try
+                let newNode = currentNode.copy(newNodePath)
+                call NERDTreeRender()
+                call newNode.putCursorHere(0, 0)
+            catch /^NERDTree/
+                call s:echoWarning("Could not copy node")
+            endtry
+        endif
+    else
+        call s:echo("Copy aborted.")
+    endif
+    redraw
+endfunction
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/plugin/.DS_Store b/vim/plugin/.DS_Store
new file mode 100644 (file)
index 0000000..5008ddf
Binary files /dev/null and b/vim/plugin/.DS_Store differ
diff --git a/vim/plugin/31-create-scala.vim b/vim/plugin/31-create-scala.vim
new file mode 100644 (file)
index 0000000..e4ecb44
--- /dev/null
@@ -0,0 +1,55 @@
+" Vim plugin that generates new Scala source file when you type
+"    vim nonexistent.scala.
+" Scripts tries to detect package name from the directory path, e. g.
+" .../src/main/scala/com/mycompany/myapp/app.scala gets header
+" package com.mycompany.myapp
+"
+" Author     :   Stepan Koltsov <yozh@mx1.ru>
+
+function! MakeScalaFile()
+    if exists("b:template_used") && b:template_used
+        return
+    endif
+    
+    let b:template_used = 1
+    
+    let filename = expand("<afile>:p")
+    let x = substitute(filename, "\.scala$", "", "")
+    
+    let p = substitute(x, "/[^/]*$", "", "")
+    let p = substitute(p, "/", ".", "g")
+    let p = substitute(p, ".*\.src$", "@", "") " unnamed package
+    let p = substitute(p, ".*\.src\.", "!", "")
+    let p = substitute(p, "^!main\.scala\.", "!", "") "
+    let p = substitute(p, "^!.*\.ru\.", "!ru.", "")
+    let p = substitute(p, "^!.*\.org\.", "!org.", "")
+    let p = substitute(p, "^!.*\.com\.", "!com.", "")
+    
+    " ! marks that we found package name.
+    if match(p, "^!") == 0
+        let p = substitute(p, "^!", "", "")
+    else
+        " Don't know package name.
+        let p = "@"
+    endif
+    
+    let class = substitute(x, ".*/", "", "")
+    
+    if p != "@"
+        call append("0", "package " . p)
+    endif
+    
+    "norm G
+    "call append(".", "class " . class . " {")
+    
+    "norm G
+    "call append(".", "} /// end of " . class)
+    
+    call append(".", "// vim: set ts=4 sw=4 et:")
+    call append(".", "")
+    
+endfunction
+
+au BufNewFile *.scala call MakeScalaFile()
+
+" vim: set ts=4 sw=4 et:
diff --git a/vim/plugin/AlignMapsPlugin.vim b/vim/plugin/AlignMapsPlugin.vim
new file mode 100644 (file)
index 0000000..eed0293
--- /dev/null
@@ -0,0 +1,242 @@
+" AlignMapsPlugin:   Alignment maps based upon <Align.vim> and <AlignMaps.vim>
+" Maintainer:        Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Date:              Mar 03, 2009
+"
+" NOTE: the code herein needs vim 6.0 or later
+"                       needs <Align.vim> v6 or later
+"                       needs <cecutil.vim> v5 or later
+" Copyright:    Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1
+"               Permission is hereby granted to use and distribute this code,
+"               with or without modifications, provided that this copyright
+"               notice is copied with it. Like anything else that's free,
+"               AlignMaps.vim is provided *as is* and comes with no warranty
+"               of any kind, either expressed or implied. By using this
+"               plugin, you agree that in no event will the copyright
+"               holder be liable for any damages resulting from the use
+"               of this software.
+"
+" Usage: {{{1
+" Use 'a to mark beginning of to-be-aligned region,   Alternative:  use V
+" move cursor to end of region, and execute map.      (linewise visual mode) to
+" The maps also set up marks 'y and 'z, and retain    mark region, execute same
+" 'a at the beginning of region.                      map.  Uses 'a, 'y, and 'z.
+"
+" The start/end wrappers save and restore marks 'y and 'z.
+"
+" Although the comments indicate the maps use a leading backslash,
+" actually they use <Leader> (:he mapleader), so the user can
+" specify that the maps start how he or she prefers.
+"
+" Note: these maps all use <Align.vim>.
+"
+" Romans 1:20 For the invisible things of Him since the creation of the {{{1
+" world are clearly seen, being perceived through the things that are
+" made, even His everlasting power and divinity; that they may be
+" without excuse.
+
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if &cp || exists("g:loaded_AlignMapsPlugin")
+ finish
+endif
+let s:keepcpo                = &cpo
+let g:loaded_AlignMapsPlugin = "v41"
+set cpo&vim
+
+" =====================================================================
+"  Maps: {{{1
+
+" ---------------------------------------------------------------------
+" WS: wrapper start map (internal)  {{{2
+" Produces a blank line above and below, marks with 'y and 'z
+if !hasmapto('<Plug>WrapperStart')
+ map <unique> <SID>WS  <Plug>AlignMapsWrapperStart
+endif
+nmap <silent> <script> <Plug>AlignMapsWrapperStart     :set lz<CR>:call AlignMaps#WrapperStart(0)<CR>
+vmap <silent> <script> <Plug>AlignMapsWrapperStart     :<c-u>set lz<CR>:call AlignMaps#WrapperStart(1)<CR>
+
+" ---------------------------------------------------------------------
+" WE: wrapper end (internal)   {{{2
+" Removes guard lines, restores marks y and z, and restores search pattern
+if !hasmapto('<Plug>WrapperEnd')
+ nmap <unique> <SID>WE <Plug>AlignMapsWrapperEnd
+endif
+nmap <silent> <script> <Plug>AlignMapsWrapperEnd       :call AlignMaps#WrapperEnd()<CR>:set nolz<CR>
+
+" ---------------------------------------------------------------------
+" Complex C-code alignment maps: {{{2
+if !hasmapto('<Plug>AM_a?')   |map <unique> <Leader>a?         <Plug>AM_a?|endif
+if !hasmapto('<Plug>AM_a,')   |map <unique> <Leader>a,         <Plug>AM_a,|endif
+if !hasmapto('<Plug>AM_a<')   |map <unique> <Leader>a<         <Plug>AM_a<|endif
+if !hasmapto('<Plug>AM_a=')   |map <unique> <Leader>a=         <Plug>AM_a=|endif
+if !hasmapto('<Plug>AM_a(')   |map <unique> <Leader>a(         <Plug>AM_a(|endif
+if !hasmapto('<Plug>AM_abox') |map <unique> <Leader>abox       <Plug>AM_abox|endif
+if !hasmapto('<Plug>AM_acom') |map <unique> <Leader>acom       <Plug>AM_acom|endif
+if !hasmapto('<Plug>AM_adcom')|map <unique> <Leader>adcom      <Plug>AM_adcom|endif
+if !hasmapto('<Plug>AM_aocom')|map <unique> <Leader>aocom      <Plug>AM_aocom|endif
+if !hasmapto('<Plug>AM_ascom')|map <unique> <Leader>ascom      <Plug>AM_ascom|endif
+if !hasmapto('<Plug>AM_adec') |map <unique> <Leader>adec       <Plug>AM_adec|endif
+if !hasmapto('<Plug>AM_adef') |map <unique> <Leader>adef       <Plug>AM_adef|endif
+if !hasmapto('<Plug>AM_afnc') |map <unique> <Leader>afnc       <Plug>AM_afnc|endif
+if !hasmapto('<Plug>AM_afnc') |map <unique> <Leader>afnc       <Plug>AM_afnc|endif
+if !hasmapto('<Plug>AM_aunum')|map <unique> <Leader>aunum      <Plug>AM_aenum|endif
+if !hasmapto('<Plug>AM_aenum')|map <unique> <Leader>aenum      <Plug>AM_aunum|endif
+if exists("g:alignmaps_euronumber") && !exists("g:alignmaps_usanumber")
+ if !hasmapto('<Plug>AM_anum')|map <unique> <Leader>anum       <Plug>AM_aenum|endif
+else
+ if !hasmapto('<Plug>AM_anum')|map <unique> <Leader>anum       <Plug>AM_aunum|endif
+endif
+
+map <silent> <script> <Plug>AM_a?              <SID>WS:AlignCtrl mIp1P1lC ? : : : : <CR>:'a,.Align<CR>:'a,'z-1s/\(\s\+\)? /?\1/e<CR><SID>WE
+map <silent> <script> <Plug>AM_a,              <SID>WS:'y,'zs/\(\S\)\s\+/\1 /ge<CR>'yjma'zk:call AlignMaps#CharJoiner(",")<cr>:silent 'y,'zg/,/call AlignMaps#FixMultiDec()<CR>'z:exe "norm \<Plug>AM_adec"<cr><SID>WE
+map <silent> <script> <Plug>AM_a<              <SID>WS:AlignCtrl mIp1P1=l << >><CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_a(       <SID>WS:AlignCtrl mIp0P1=l<CR>:'a,.Align [(,]<CR>:sil 'y+1,'z-1s/\(\s\+\),/,\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_a=              <SID>WS:AlignCtrl mIp1P1=l<CR>:AlignCtrl g :=<CR>:'a,'zAlign :\==<CR><SID>WE
+map <silent> <script> <Plug>AM_abox            <SID>WS:let g:alignmaps_iws=substitute(getline("'a"),'^\(\s*\).*$','\1','e')<CR>:'a,'z-1s/^\s\+//e<CR>:'a,'z-1s/^.*$/@&@/<CR>:AlignCtrl m=p01P0w @<CR>:'a,.Align<CR>:'a,'z-1s/@/ * /<CR>:'a,'z-1s/@$/*/<CR>'aYP:s/./*/g<CR>0r/'zkYp:s/./*/g<CR>0r A/<Esc>:exe "'a-1,'z-1s/^/".g:alignmaps_iws."/e"<CR><SID>WE
+map <silent> <script> <Plug>AM_acom            <SID>WS:'a,.s/\/[*/]\/\=/@&@/e<CR>:'a,.s/\*\//@&/e<CR>:'y,'zs/^\( *\) @/\1@/e<CR>'zk:call AlignMaps#StdAlign(2)<CR>:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_adcom   <SID>WS:'a,.v/^\s*\/[/*]/s/\/[*/]\*\=/@&@/e<CR>:'a,.v/^\s*\/[/*]/s/\*\//@&/e<CR>:'y,'zv/^\s*\/[/*]/s/^\( *\) @/\1@/e<CR>'zk:call AlignMaps#StdAlign(3)<cr>:'y,'zv/^\s*\/[/*]/s/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_aocom   <SID>WS:AlignPush<CR>:AlignCtrl g /[*/]<CR>:exe "norm \<Plug>AM_acom"<cr>:AlignPop<CR><SID>WE
+map <silent> <script> <Plug>AM_ascom   <SID>WS:'a,.s/\/[*/]/@&@/e<CR>:'a,.s/\*\//@&/e<CR>:silent! 'a,.g/^\s*@\/[*/]/s/@//ge<CR>:AlignCtrl v ^\s*\/[*/]<CR>:AlignCtrl g \/[*/]<CR>'zk:call AlignMaps#StdAlign(2)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_adec            <SID>WS:'a,'zs/\([^ \t/(]\)\([*&]\)/\1 \2/e<CR>:'y,'zv/^\//s/\([^ \t]\)\s\+/\1 /ge<CR>:'y,'zv/^\s*[*/]/s/\([^/][*&]\)\s\+/\1/ge<CR>:'y,'zv/^\s*[*/]/s/^\(\s*\%(\K\k*\s\+\%([a-zA-Z_*(&]\)\@=\)\+\)\([*(&]*\)\s*\([a-zA-Z0-9_()]\+\)\s*\(\(\[.\{-}]\)*\)\s*\(=\)\=\s*\(.\{-}\)\=\s*;/\1@\2#@\3\4@\6@\7;@/e<CR>:'y,'zv/^\s*[*/]/s/\*\/\s*$/@*\//e<CR>:'y,'zv/^\s*[*/]/s/^\s\+\*/@@@@@* /e<CR>:'y,'zv/^\s*[*/]/s/^@@@@@\*\(.*[^*/]\)$/&@*/e<CR>'yjma'zk:AlignCtrl v ^\s*[*/#]<CR>:call AlignMaps#StdAlign(1)<cr>:'y,'zv/^\s*[*/]/s/@ //ge<CR>:'y,'zv/^\s*[*/]/s/\(\s*\);/;\1/e<CR>:'y,'zv/^#/s/# //e<CR>:'y,'zv/^\s\+[*/#]/s/\([^/*]\)\(\*\+\)\( \+\)/\1\3\2/e<CR>:'y,'zv/^\s\+[*/#]/s/\((\+\)\( \+\)\*/\2\1*/e<CR>:'y,'zv/^\s\+[*/#]/s/^\(\s\+\) \*/\1*/e<CR>:'y,'zv/^\s\+[*/#]/s/[ \t@]*$//e<CR>:'y,'zs/^[*]/ */e<CR><SID>WE
+map <silent> <script> <Plug>AM_adef            <SID>WS:AlignPush<CR>:AlignCtrl v ^\s*\(\/\*\<bar>\/\/\)<CR>:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/^\(\s*\)#\(\s\)*define\s*\(\I[a-zA-Z_0-9(),]*\)\s*\(.\{-}\)\($\<Bar>\/\*\)/#\1\2define @\3@\4@\5/e<CR>:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/\($\<Bar>\*\/\)/@&/e<CR>'zk:call AlignMaps#StdAlign(1)<cr>'yjma'zk:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/ @//g<CR><SID>WE
+map <silent> <script> <Plug>AM_afnc            :<c-u>set lz<CR>:silent call AlignMaps#Afnc()<CR>:set nolz<CR>
+map <silent> <script> <Plug>AM_aunum   <SID>WS:'a,'zs/\%([0-9.]\)\s\+\zs\([-+.]\=\d\)/@\1/ge<CR>:'a,'zs/\(\(^\|\s\)\d\+\)\(\s\+\)@/\1@\3@/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl wmp0P0r<CR>:'a,'zAlign [.@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(\.\)\(\s\+\)\([0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_aenum   <SID>WS:'a,'zs/\%([0-9.]\)\s\+\([-+]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl wmp0P0r<CR>:'a,'zAlign [,@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(,\)\(\s\+\)\([-0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
+
+" ---------------------------------------------------------------------
+" html table alignment {{{2
+if !hasmapto('<Plug>AM_Htd')|map <unique> <Leader>Htd  <Plug>AM_Htd|endif
+map <silent> <script> <Plug>AM_Htd <SID>WS:'y,'zs%<[tT][rR]><[tT][dD][^>]\{-}>\<Bar></[tT][dD]><[tT][dD][^>]\{-}>\<Bar></[tT][dD]></[tT][rR]>%@&@%g<CR>'yjma'zk:AlignCtrl m=Ilp1P0 @<CR>:'a,.Align<CR>:'y,'zs/ @/@/<CR>:'y,'zs/@ <[tT][rR]>/<[tT][rR]>/ge<CR>:'y,'zs/@//ge<CR><SID>WE
+
+" ---------------------------------------------------------------------
+" character-based right-justified alignment maps {{{2
+if !hasmapto('<Plug>AM_T\16|')|map <unique> <Leader>T\16|          <Plug>AM_T\16||endif
+if !hasmapto('<Plug>AM_T#')     |map <unique> <Leader>T#               <Plug>AM_T#|endif
+if !hasmapto('<Plug>AM_T,')     |map <unique> <Leader>T,               <Plug>AM_T,o|endif
+if !hasmapto('<Plug>AM_Ts,') |map <unique> <Leader>Ts,         <Plug>AM_Ts,|endif
+if !hasmapto('<Plug>AM_T:')     |map <unique> <Leader>T:               <Plug>AM_T:|endif
+if !hasmapto('<Plug>AM_T;')     |map <unique> <Leader>T;               <Plug>AM_T;|endif
+if !hasmapto('<Plug>AM_T<')     |map <unique> <Leader>T<               <Plug>AM_T<|endif
+if !hasmapto('<Plug>AM_T=')     |map <unique> <Leader>T=               <Plug>AM_T=|endif
+if !hasmapto('<Plug>AM_T?')     |map <unique> <Leader>T?               <Plug>AM_T?|endif
+if !hasmapto('<Plug>AM_T@')     |map <unique> <Leader>T@               <Plug>AM_T@|endif
+if !hasmapto('<Plug>AM_Tab') |map <unique> <Leader>Tab         <Plug>AM_Tab|endif
+if !hasmapto('<Plug>AM_Tsp') |map <unique> <Leader>Tsp         <Plug>AM_Tsp|endif
+if !hasmapto('<Plug>AM_T~')     |map <unique> <Leader>T~               <Plug>AM_T~|endif
+
+map <silent> <script> <Plug>AM_T\16| <SID>WS:AlignCtrl mIp0P0=r <Bar><CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T#   <SID>WS:AlignCtrl mIp0P0=r #<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T,   <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_Ts,  <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<CR>:'a,.s/\(\s*\),/,\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_T:   <SID>WS:AlignCtrl mIp1P1=r :<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T;   <SID>WS:AlignCtrl mIp0P0=r ;<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T<   <SID>WS:AlignCtrl mIp0P0=r <<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T=   <SID>WS:'a,'z-1s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'z-1s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'z-1s/; */;@/e<CR>:'a,'z-1s/==/\="\<Char-0x0f>\<Char-0x0f>"/ge<CR>:'a,'z-1s/!=/\x="!\<Char-0x0f>"/ge<CR>:AlignCtrl mIp1P1=r = @<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s/; *@/;/e<CR>:'a,'z-1s/; *$/;/e<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-1s/\xff/=/ge<CR><SID>WE:exe "norm <Plug>acom"
+map <silent> <script> <Plug>AM_T?   <SID>WS:AlignCtrl mIp0P0=r ?<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_T@   <SID>WS:AlignCtrl mIp0P0=r @<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_Tab  <SID>WS:'a,.s/^\(\t*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\t','@','g'),'\')/<CR>:AlignCtrl mI=r @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
+map <silent> <script> <Plug>AM_Tsp  <SID>WS:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\s\+','@','g'),'\')/<CR>:AlignCtrl mI=r @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
+map <silent> <script> <Plug>AM_T~   <SID>WS:AlignCtrl mIp0P0=r ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
+
+" ---------------------------------------------------------------------
+" character-based left-justified alignment maps {{{2
+if !hasmapto('<Plug>AM_t\16|')   |map <unique> <Leader>t\16|       <Plug>AM_t\16||endif
+if !hasmapto('<Plug>AM_t#')            |map <unique> <Leader>t#        <Plug>AM_t#|endif
+if !hasmapto('<Plug>AM_t,')            |map <unique> <Leader>t,        <Plug>AM_t,|endif
+if !hasmapto('<Plug>AM_t:')            |map <unique> <Leader>t:        <Plug>AM_t:|endif
+if !hasmapto('<Plug>AM_t;')            |map <unique> <Leader>t;        <Plug>AM_t;|endif
+if !hasmapto('<Plug>AM_t<')            |map <unique> <Leader>t<        <Plug>AM_t<|endif
+if !hasmapto('<Plug>AM_t=')            |map <unique> <Leader>t=        <Plug>AM_t=|endif
+if !hasmapto('<Plug>AM_ts,')   |map <unique> <Leader>ts,       <Plug>AM_ts,|endif
+if !hasmapto('<Plug>AM_ts:')   |map <unique> <Leader>ts:       <Plug>AM_ts:|endif
+if !hasmapto('<Plug>AM_ts;')   |map <unique> <Leader>ts;       <Plug>AM_ts;|endif
+if !hasmapto('<Plug>AM_ts<')   |map <unique> <Leader>ts<       <Plug>AM_ts<|endif
+if !hasmapto('<Plug>AM_ts=')   |map <unique> <Leader>ts=       <Plug>AM_ts=|endif
+if !hasmapto('<Plug>AM_w=')            |map <unique> <Leader>w=        <Plug>AM_w=|endif
+if !hasmapto('<Plug>AM_t?')            |map <unique> <Leader>t?        <Plug>AM_t?|endif
+if !hasmapto('<Plug>AM_t~')            |map <unique> <Leader>t~        <Plug>AM_t~|endif
+if !hasmapto('<Plug>AM_t@')            |map <unique> <Leader>t@        <Plug>AM_t@|endif
+if !hasmapto('<Plug>AM_m=')            |map <unique> <Leader>m=        <Plug>AM_m=|endif
+if !hasmapto('<Plug>AM_tab')   |map <unique> <Leader>tab       <Plug>AM_tab|endif
+if !hasmapto('<Plug>AM_tml')   |map <unique> <Leader>tml       <Plug>AM_tml|endif
+if !hasmapto('<Plug>AM_tsp')   |map <unique> <Leader>tsp       <Plug>AM_tsp|endif
+if !hasmapto('<Plug>AM_tsq')   |map <unique> <Leader>tsq       <Plug>AM_tsq|endif
+if !hasmapto('<Plug>AM_tt')            |map <unique> <Leader>tt        <Plug>AM_tt|endif
+
+map <silent> <script> <Plug>AM_t\16|             <SID>WS:AlignCtrl mIp0P0=l <Bar><CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t#              <SID>WS:AlignCtrl mIp0P0=l #<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t,              <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t:              <SID>WS:AlignCtrl mIp1P1=l :<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t;              <SID>WS:AlignCtrl mIp0P1=l ;<CR>:'a,.Align<CR>:sil 'y,'zs/\( *\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_t<              <SID>WS:AlignCtrl mIp0P0=l <<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t=              <SID>WS:call AlignMaps#Equals()<CR><SID>WE
+map <silent> <script> <Plug>AM_ts,             <SID>WS:AlignCtrl mIp0P1=l #<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\)#/,\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_ts,             <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\),/,\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_ts:             <SID>WS:AlignCtrl mIp1P1=l :<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\):/:\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_ts;             <SID>WS:AlignCtrl mIp1P1=l ;<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_ts<             <SID>WS:AlignCtrl mIp1P1=l <<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\)</<\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_ts=             <SID>WS:AlignCtrl mIp1P1=l =<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\)=/=\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_w=              <SID>WS:'a,'zg/=/s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zg/=/s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zg/=/s/==/\="\<Char-0x0f>\<Char-0x0f>"/ge<CR>:'a,'zg/=/s/!=/\="!\<Char-0x0f>"/ge<CR>'zk:AlignCtrl mWp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1g/=/Align<CR>:'a,'z-1g/=/s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1g/=/s/\( \+\);/;\1/ge<CR>:'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e<CR>:'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e<CR>'zk:call AlignMaps#StdAlign(1)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1g/=/s/\xff/=/ge<CR>:'y,'zg/=/s/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_t?              <SID>WS:AlignCtrl mIp0P0=l ?<CR>:'a,.Align<CR>:.,'zs/ \( *\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_t~              <SID>WS:AlignCtrl mIp0P0=l ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_t@              <SID>WS::call AlignMaps#StdAlign(1)<cr>:<SID>WE
+map <silent> <script> <Plug>AM_m=              <SID>WS:'a,'zs/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zs@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zs/==/\="\<Char-0x0f>\<Char-0x0f>"/ge<CR>:'a,'zs/!=/\="!\<Char-0x0f>"/ge<CR>'zk:AlignCtrl mIp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-s/%\ze[^=]/ @%@ /e<CR>'zk:call AlignMaps#StdAlign(1)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1s/\xff/=/ge<CR>:'y,'zs/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_tab             <SID>WS:'a,.s/^\(\t*\)\(.*\)$/\=submatch(1).escape(substitute(submatch(2),'\t',"\<Char-0x0f>",'g'),'\')/<CR>:if &ts == 1<bar>exe "AlignCtrl mI=lp0P0 \<Char-0x0f>"<bar>else<bar>exe "AlignCtrl mI=l \<Char-0x0f>"<bar>endif<CR>:'a,.Align<CR>:exe "'y+1,'z-1s/\<Char-0x0f>/".((&ts == 1)? '\t' : ' ')."/g"<CR><SID>WE
+map <silent> <script> <Plug>AM_tml             <SID>WS:AlignCtrl mWp1P0=l \\\@<!\\\s*$<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_tsp             <SID>WS:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\s\+','@','g'),'\')/<CR>:AlignCtrl mI=lp0P0 @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
+map <silent> <script> <Plug>AM_tsq             <SID>WS:'a,.AlignReplaceQuotedSpaces<CR>:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).substitute(submatch(2),'\s\+','@','g')/<CR>:AlignCtrl mIp0P0=l @<CR>:'a,.Align<CR>:'y+1,'z-1s/[%@]/ /g<CR><SID>WE
+map <silent> <script> <Plug>AM_tt              <SID>WS:AlignCtrl mIp1P1=l \\\@<!& \\\\<CR>:'a,.Align<CR><SID>WE
+
+" =====================================================================
+" Menu Support: {{{1
+"   ma ..move.. use menu
+"   v V or ctrl-v ..move.. use menu
+if has("menu") && has("gui_running") && &go =~ 'm' && !exists("s:firstmenu")
+ let s:firstmenu= 1
+ if !exists("g:DrChipTopLvlMenu")
+  let g:DrChipTopLvlMenu= "DrChip."
+ endif
+ if g:DrChipTopLvlMenu != ""
+  let s:mapleader = exists("g:mapleader")? g:mapleader : '\'
+  let s:emapleader= escape(s:mapleader,'\ ')
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.<<\ and\ >><tab>'.s:emapleader.'a< '.s:mapleader.'a<'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Assignment\ =<tab>'.s:emapleader.'t=       '.s:mapleader.'t='
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Assignment\ :=<tab>'.s:emapleader.'a=      '.s:mapleader.'a='
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Backslashes<tab>'.s:emapleader.'tml        '.s:mapleader.'tml'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Breakup\ Comma\ Declarations<tab>'.s:emapleader.'a,        '.s:mapleader.'a,'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.C\ Comment\ Box<tab>'.s:emapleader.'abox   '.s:mapleader.'abox'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas<tab>'.s:emapleader.'t,      '.s:mapleader.'t,'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas<tab>'.s:emapleader.'ts,     '.s:mapleader.'ts,'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas\ With\ Strings<tab>'.s:emapleader.'tsq      '.s:mapleader.'tsq'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Comments<tab>'.s:emapleader.'acom  '.s:mapleader.'acom'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Comments\ Only<tab>'.s:emapleader.'aocom   '.s:mapleader.'aocom'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Declaration\ Comments<tab>'.s:emapleader.'adcom    '.s:mapleader.'adcom'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Declarations<tab>'.s:emapleader.'adec      '.s:mapleader.'adec'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Definitions<tab>'.s:emapleader.'adef       '.s:mapleader.'adef'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Function\ Header<tab>'.s:emapleader.'afnc  '.s:mapleader.'afnc'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Html\ Tables<tab>'.s:emapleader.'Htd       '.s:mapleader.'Htd'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.(\.\.\.)?\.\.\.\ :\ \.\.\.<tab>'.s:emapleader.'a?  '.s:mapleader.'a?'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers<tab>'.s:emapleader.'anum   '.s:mapleader.'anum'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers\ (American-Style)<tab>'.s:emapleader.'aunum        <Leader>aunum   '.s:mapleader.'aunum    <Leader>aunum'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers\ (Euro-Style)<tab>'.s:emapleader.'aenum    '.s:mapleader.'aenum'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Spaces\ (Left\ Justified)<tab>'.s:emapleader.'tsp  '.s:mapleader.'tsp'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Spaces\ (Right\ Justified)<tab>'.s:emapleader.'Tsp '.s:mapleader.'Tsp'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Statements\ With\ Percent\ Style\ Comments<tab>'.s:emapleader.'m=  '.s:mapleader.'m='
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ <<tab>'.s:emapleader.'t<   '.s:mapleader.'t<'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ \|<tab>'.s:emapleader.'t\| '.s:mapleader.'t|'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ @<tab>'.s:emapleader.'t@   '.s:mapleader.'t@'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ #<tab>'.s:emapleader.'t#   '.s:mapleader.'t#'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Tabs<tab>'.s:emapleader.'tab       '.s:mapleader.'tab'
+  unlet s:mapleader
+  unlet s:emapleader
+ endif
+endif
+
+" =====================================================================
+"  Restore: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+
+" ==============================================================================
+"  Modelines: {{{1
+" vim: ts=4 nowrap fdm=marker
diff --git a/vim/plugin/AlignPlugin.vim b/vim/plugin/AlignPlugin.vim
new file mode 100644 (file)
index 0000000..727fe7e
--- /dev/null
@@ -0,0 +1,41 @@
+" AlignPlugin: tool to align multiple fields based on one or more separators
+"   Author:     Charles E. Campbell, Jr.
+"   Date:    Nov 02, 2008
+" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
+" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
+" Copyright:    Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
+"               Permission is hereby granted to use and distribute this code,
+"               with or without modifications, provided that this copyright
+"               notice is copied with it. Like anything else that's free,
+"               Align.vim is provided *as is* and comes with no warranty
+"               of any kind, either expressed or implied. By using this
+"               plugin, you agree that in no event will the copyright
+"               holder be liable for any damages resulting from the use
+"               of this software.
+"
+" Romans 1:16,17a : For I am not ashamed of the gospel of Christ, for it is {{{1
+" the power of God for salvation for everyone who believes; for the Jew first,
+" and also for the Greek.  For in it is revealed God's righteousness from
+" faith to faith.
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if &cp || exists("g:loaded_AlignPlugin")
+ finish
+endif
+let g:loaded_AlignPlugin = "v35"
+let s:keepcpo            = &cpo
+set cpo&vim
+
+" ---------------------------------------------------------------------
+" Public Interface: {{{1
+com! -bang -range -nargs=* Align <line1>,<line2>call Align#Align(<bang>0,<q-args>)
+com!       -range -nargs=0 AlignReplaceQuotedSpaces <line1>,<line2>call Align#AlignReplaceQuotedSpaces()
+com!              -nargs=* AlignCtrl call Align#AlignCtrl(<q-args>)
+com!              -nargs=0 AlignPush call Align#AlignPush()
+com!              -nargs=0 AlignPop  call Align#AlignPop()
+
+" ---------------------------------------------------------------------
+"  Restore: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+" vim: ts=4 fdm=marker
diff --git a/vim/plugin/EasyMotion.vim b/vim/plugin/EasyMotion.vim
new file mode 100755 (executable)
index 0000000..fff29dc
--- /dev/null
@@ -0,0 +1,73 @@
+" EasyMotion - Vim motions on speed!
+"
+" Author: Kim Silkebรฆkken <kim.silkebaekken+vim@gmail.com>
+" Source repository: https://github.com/Lokaltog/vim-easymotion
+
+" Script initialization {{{
+       if exists('g:EasyMotion_loaded') || &compatible || version < 702
+               finish
+       endif
+
+       let g:EasyMotion_loaded = 1
+" }}}
+" Default configuration {{{
+       " Default options {{{
+               call EasyMotion#InitOptions({
+               \   'leader_key'      : '<Leader><Leader>'
+               \ , 'keys'            : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+               \ , 'do_shade'        : 1
+               \ , 'do_mapping'      : 1
+               \ , 'grouping'        : 1
+               \
+               \ , 'hl_group_target' : 'EasyMotionTarget'
+               \ , 'hl_group_shade'  : 'EasyMotionShade'
+               \ })
+       " }}}
+       " Default highlighting {{{
+               let s:target_hl_defaults = {
+               \   'gui'     : ['NONE', '#ff0000' , 'bold']
+               \ , 'cterm256': ['NONE', '196'     , 'bold']
+               \ , 'cterm'   : ['NONE', 'red'     , 'bold']
+               \ }
+
+               let s:shade_hl_defaults = {
+               \   'gui'     : ['NONE', '#777777' , 'NONE']
+               \ , 'cterm256': ['NONE', '242'     , 'NONE']
+               \ , 'cterm'   : ['NONE', 'grey'    , 'NONE']
+               \ }
+
+               call EasyMotion#InitHL(g:EasyMotion_hl_group_target, s:target_hl_defaults)
+               call EasyMotion#InitHL(g:EasyMotion_hl_group_shade,  s:shade_hl_defaults)
+
+               " Reset highlighting after loading a new color scheme {{{
+                       augroup EasyMotionInitHL
+                               autocmd!
+
+                               autocmd ColorScheme * call EasyMotion#InitHL(g:EasyMotion_hl_group_target, s:target_hl_defaults)
+                               autocmd ColorScheme * call EasyMotion#InitHL(g:EasyMotion_hl_group_shade,  s:shade_hl_defaults)
+                       augroup end
+               " }}}
+       " }}}
+       " Default key mapping {{{
+               call EasyMotion#InitMappings({
+               \   'f' : { 'name': 'F'  , 'dir': 0 }
+               \ , 'F' : { 'name': 'F'  , 'dir': 1 }
+               \ , 't' : { 'name': 'T'  , 'dir': 0 }
+               \ , 'T' : { 'name': 'T'  , 'dir': 1 }
+               \ , 'w' : { 'name': 'WB' , 'dir': 0 }
+               \ , 'W' : { 'name': 'WBW', 'dir': 0 }
+               \ , 'b' : { 'name': 'WB' , 'dir': 1 }
+               \ , 'B' : { 'name': 'WBW', 'dir': 1 }
+               \ , 'e' : { 'name': 'E'  , 'dir': 0 }
+               \ , 'E' : { 'name': 'EW' , 'dir': 0 }
+               \ , 'ge': { 'name': 'E'  , 'dir': 1 }
+               \ , 'gE': { 'name': 'EW' , 'dir': 1 }
+               \ , 'j' : { 'name': 'JK' , 'dir': 0 }
+               \ , 'k' : { 'name': 'JK' , 'dir': 1 }
+               \ , 'n' : { 'name': 'Search' , 'dir': 0 }
+               \ , 'N' : { 'name': 'Search' , 'dir': 1 }
+               \ })
+       " }}}
+" }}}
+
+" vim: fdm=marker:noet:ts=4:sw=4:sts=4
diff --git a/vim/plugin/NERD_commenter.vim b/vim/plugin/NERD_commenter.vim
new file mode 100644 (file)
index 0000000..ef88dd4
--- /dev/null
@@ -0,0 +1,2790 @@
+" ============================================================================
+" File:        NERD_commenter.vim
+" Description: vim global plugin that provides easy code commenting
+" Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+" Version:     2.3.0
+" Last Change: 08th December, 2010
+" License:     This program is free software. It comes without any warranty,
+"              to the extent permitted by applicable law. You can redistribute
+"              it and/or modify it under the terms of the Do What The Fuck You
+"              Want To Public License, Version 2, as published by Sam Hocevar.
+"              See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" ============================================================================
+
+" Section: script init stuff {{{1
+if exists("loaded_nerd_comments")
+    finish
+endif
+if v:version < 700
+    echoerr "NERDCommenter: this plugin requires vim >= 7. DOWNLOAD IT! You'll thank me later!"
+    finish
+endif
+let loaded_nerd_comments = 1
+
+" Function: s:InitVariable() function {{{2
+" This function is used to initialise a given variable to a given value. The
+" variable is only initialised if it does not exist prior
+"
+" Args:
+"   -var: the name of the var to be initialised
+"   -value: the value to initialise var to
+"
+" Returns:
+"   1 if the var is set, 0 otherwise
+function s:InitVariable(var, value)
+    if !exists(a:var)
+        exec 'let ' . a:var . ' = ' . "'" . a:value . "'"
+        return 1
+    endif
+    return 0
+endfunction
+
+" Section: space string init{{{2
+" When putting spaces after the left delim and before the right we use
+" s:spaceStr for the space char. This way we can make it add anything after
+" the left and before the right by modifying this variable
+let s:spaceStr = ' '
+let s:lenSpaceStr = strlen(s:spaceStr)
+
+" Section: variable init calls {{{2
+call s:InitVariable("g:NERDAllowAnyVisualDelims", 1)
+call s:InitVariable("g:NERDBlockComIgnoreEmpty", 0)
+call s:InitVariable("g:NERDCommentWholeLinesInVMode", 0)
+call s:InitVariable("g:NERDCompactSexyComs", 0)
+call s:InitVariable("g:NERDCreateDefaultMappings", 1)
+call s:InitVariable("g:NERDDefaultNesting", 1)
+call s:InitVariable("g:NERDMenuMode", 3)
+call s:InitVariable("g:NERDLPlace", "[>")
+call s:InitVariable("g:NERDUsePlaceHolders", 1)
+call s:InitVariable("g:NERDRemoveAltComs", 1)
+call s:InitVariable("g:NERDRemoveExtraSpaces", 1)
+call s:InitVariable("g:NERDRPlace", "<]")
+call s:InitVariable("g:NERDSpaceDelims", 0)
+call s:InitVariable("g:NERDDelimiterRequests", 1)
+
+let s:NERDFileNameEscape="[]#*$%'\" ?`!&();<>\\"
+"vf ;;dA:\ehcs"'A {\ej^f(lyi(k$p0f{a \eA }\e0f{a 'left':\ejdd^
+
+let s:delimiterMap = {
+    \ 'aap': { 'left': '#' },
+    \ 'abc': { 'left': '%' },
+    \ 'acedb': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'actionscript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'ada': { 'left': '--', 'leftAlt': '--  ' },
+    \ 'ahdl': { 'left': '--' },
+    \ 'ahk': { 'left': ';', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'amiga': { 'left': ';' },
+    \ 'aml': { 'left': '/*' },
+    \ 'ampl': { 'left': '#' },
+    \ 'apache': { 'left': '#' },
+    \ 'apachestyle': { 'left': '#' },
+    \ 'asciidoc': { 'left': '//' },
+    \ 'applescript': { 'left': '--', 'leftAlt': '(*', 'rightAlt': '*)' },
+    \ 'asm68k': { 'left': ';' },
+    \ 'asm': { 'left': ';', 'leftAlt': '#' },
+    \ 'asn': { 'left': '--' },
+    \ 'aspvbs': { 'left': '''' },
+    \ 'asterisk': { 'left': ';' },
+    \ 'asy': { 'left': '//' },
+    \ 'atlas': { 'left': 'C', 'right': '$' },
+    \ 'autohotkey': { 'left': ';' },
+    \ 'autoit': { 'left': ';' },
+    \ 'ave': { 'left': "'" },
+    \ 'awk': { 'left': '#' },
+    \ 'basic': { 'left': "'", 'leftAlt': 'REM ' },
+    \ 'bbx': { 'left': '%' },
+    \ 'bc': { 'left': '#' },
+    \ 'bib': { 'left': '%' },
+    \ 'bindzone': { 'left': ';' },
+    \ 'bst': { 'left': '%' },
+    \ 'btm': { 'left': '::' },
+    \ 'caos': { 'left': '*' },
+    \ 'calibre': { 'left': '//' },
+    \ 'catalog': { 'left': '--', 'right': '--' },
+    \ 'c': { 'left': '/*','right': '*/', 'leftAlt': '//' },
+    \ 'cfg': { 'left': '#' },
+    \ 'cg': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'ch': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'cl': { 'left': '#' },
+    \ 'clean': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'clipper': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'clojure': { 'left': ';' },
+    \ 'cmake': { 'left': '#' },
+    \ 'conkyrc': { 'left': '#' },
+    \ 'cpp': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'crontab': { 'left': '#' },
+    \ 'cs': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'csp': { 'left': '--' },
+    \ 'cterm': { 'left': '*' },
+    \ 'cucumber': { 'left': '#' },
+    \ 'cvs': { 'left': 'CVS:' },
+    \ 'd': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'dcl': { 'left': '$!' },
+    \ 'dakota': { 'left': '#' },
+    \ 'debcontrol': { 'left': '#' },
+    \ 'debsources': { 'left': '#' },
+    \ 'def': { 'left': ';' },
+    \ 'desktop': { 'left': '#' },
+    \ 'dhcpd': { 'left': '#' },
+    \ 'diff': { 'left': '#' },
+    \ 'django': { 'left': '<!--','right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' },
+    \ 'docbk': { 'left': '<!--', 'right': '-->' },
+    \ 'dns': { 'left': ';' },
+    \ 'dosbatch': { 'left': 'REM ', 'leftAlt': '::' },
+    \ 'dosini': { 'left': ';' },
+    \ 'dot': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'dracula': { 'left': ';' },
+    \ 'dsl': { 'left': ';' },
+    \ 'dtml': { 'left': '<dtml-comment>', 'right': '</dtml-comment>' },
+    \ 'dylan': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'ebuild': { 'left': '#' },
+    \ 'ecd': { 'left': '#' },
+    \ 'eclass': { 'left': '#' },
+    \ 'eiffel': { 'left': '--' },
+    \ 'elf': { 'left': "'" },
+    \ 'elmfilt': { 'left': '#' },
+    \ 'erlang': { 'left': '%' },
+    \ 'eruby': { 'left': '<%#', 'right': '%>', 'leftAlt': '<!--', 'rightAlt': '-->' },
+    \ 'expect': { 'left': '#' },
+    \ 'exports': { 'left': '#' },
+    \ 'factor': { 'left': '! ', 'leftAlt': '!# ' },
+    \ 'fgl': { 'left': '#' },
+    \ 'focexec': { 'left': '-*' },
+    \ 'form': { 'left': '*' },
+    \ 'foxpro': { 'left': '*' },
+    \ 'fstab': { 'left': '#' },
+    \ 'fvwm': { 'left': '#' },
+    \ 'fx': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'gams': { 'left': '*' },
+    \ 'gdb': { 'left': '#' },
+    \ 'gdmo': { 'left': '--' },
+    \ 'geek': { 'left': 'GEEK_COMMENT:' },
+    \ 'genshi': { 'left': '<!--','right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' },
+    \ 'gentoo-conf-d': { 'left': '#' },
+    \ 'gentoo-env-d': { 'left': '#' },
+    \ 'gentoo-init-d': { 'left': '#' },
+    \ 'gentoo-make-conf': { 'left': '#' },
+    \ 'gentoo-package-keywords': { 'left': '#' },
+    \ 'gentoo-package-mask': { 'left': '#' },
+    \ 'gentoo-package-use': { 'left': '#' },
+    \ 'gitcommit': { 'left': '#' },
+    \ 'gitconfig': { 'left': ';' },
+    \ 'gitrebase': { 'left': '#' },
+    \ 'gnuplot': { 'left': '#' },
+    \ 'groovy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'gsp': { 'left': '<%--', 'right': '--%>' },
+    \ 'gtkrc': { 'left': '#' },
+    \ 'haskell': { 'left': '{-','right': '-}', 'leftAlt': '--' },
+    \ 'hb': { 'left': '#' },
+    \ 'h': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'haml': { 'left': '-#', 'leftAlt': '/' },
+    \ 'hercules': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'hog': { 'left': '#' },
+    \ 'hostsaccess': { 'left': '#' },
+    \ 'htmlcheetah': { 'left': '##' },
+    \ 'htmldjango': { 'left': '<!--','right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' },
+    \ 'htmlos': { 'left': '#', 'right': '/#' },
+    \ 'ia64': { 'left': '#' },
+    \ 'icon': { 'left': '#' },
+    \ 'idlang': { 'left': ';' },
+    \ 'idl': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'inform': { 'left': '!' },
+    \ 'inittab': { 'left': '#' },
+    \ 'ishd': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'iss': { 'left': ';' },
+    \ 'ist': { 'left': '%' },
+    \ 'java': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'javacc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'javascript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'javascript.jquery': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'jess': { 'left': ';' },
+    \ 'jgraph': { 'left': '(*', 'right': '*)' },
+    \ 'jproperties': { 'left': '#' },
+    \ 'jsp': { 'left': '<%--', 'right': '--%>' },
+    \ 'kix': { 'left': ';' },
+    \ 'kscript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'lace': { 'left': '--' },
+    \ 'ldif': { 'left': '#' },
+    \ 'lilo': { 'left': '#' },
+    \ 'lilypond': { 'left': '%' },
+    \ 'liquid': { 'left': '{%', 'right': '%}' },
+    \ 'lisp': { 'left': ';', 'leftAlt': '#|', 'rightAlt': '|#' },
+    \ 'llvm': { 'left': ';' },
+    \ 'lotos': { 'left': '(*', 'right': '*)' },
+    \ 'lout': { 'left': '#' },
+    \ 'lprolog': { 'left': '%' },
+    \ 'lscript': { 'left': "'" },
+    \ 'lss': { 'left': '#' },
+    \ 'lua': { 'left': '--', 'leftAlt': '--[[', 'rightAlt': ']]' },
+    \ 'lynx': { 'left': '#' },
+    \ 'lytex': { 'left': '%' },
+    \ 'mail': { 'left': '> ' },
+    \ 'mako': { 'left': '##' },
+    \ 'man': { 'left': '."' },
+    \ 'map': { 'left': '%' },
+    \ 'maple': { 'left': '#' },
+    \ 'markdown': { 'left': '<!--', 'right': '-->' },
+    \ 'masm': { 'left': ';' },
+    \ 'mason': { 'left': '<% #', 'right': '%>' },
+    \ 'master': { 'left': '$' },
+    \ 'matlab': { 'left': '%' },
+    \ 'mel': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'mib': { 'left': '--' },
+    \ 'mkd': { 'left': '>' },
+    \ 'mma': { 'left': '(*', 'right': '*)' },
+    \ 'model': { 'left': '$', 'right': '$' },
+    \ 'moduala.': { 'left': '(*', 'right': '*)' },
+    \ 'modula2': { 'left': '(*', 'right': '*)' },
+    \ 'modula3': { 'left': '(*', 'right': '*)' },
+    \ 'monk': { 'left': ';' },
+    \ 'mush': { 'left': '#' },
+    \ 'named': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'nasm': { 'left': ';' },
+    \ 'nastran': { 'left': '$' },
+    \ 'natural': { 'left': '/*' },
+    \ 'ncf': { 'left': ';' },
+    \ 'newlisp': { 'left': ';' },
+    \ 'nroff': { 'left': '\"' },
+    \ 'nsis': { 'left': '#' },
+    \ 'ntp': { 'left': '#' },
+    \ 'objc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'objcpp': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'objj': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'ocaml': { 'left': '(*', 'right': '*)' },
+    \ 'occam': { 'left': '--' },
+    \ 'omlet': { 'left': '(*', 'right': '*)' },
+    \ 'omnimark': { 'left': ';' },
+    \ 'openroad': { 'left': '//' },
+    \ 'opl': { 'left': "REM" },
+    \ 'ora': { 'left': '#' },
+    \ 'ox': { 'left': '//' },
+    \ 'pascal': { 'left': '{','right': '}', 'leftAlt': '(*', 'rightAlt': '*)' },
+    \ 'patran': { 'left': '$', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'pcap': { 'left': '#' },
+    \ 'pccts': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'pdf': { 'left': '%' },
+    \ 'pfmain': { 'left': '//' },
+    \ 'php': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'pic': { 'left': ';' },
+    \ 'pike': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'pilrc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'pine': { 'left': '#' },
+    \ 'plm': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'plsql': { 'left': '--', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'po': { 'left': '#' },
+    \ 'postscr': { 'left': '%' },
+    \ 'pov': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'povini': { 'left': ';' },
+    \ 'ppd': { 'left': '%' },
+    \ 'ppwiz': { 'left': ';;' },
+    \ 'processing': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'prolog': { 'left': '%', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'ps1': { 'left': '#' },
+    \ 'psf': { 'left': '#' },
+    \ 'ptcap': { 'left': '#' },
+    \ 'python': { 'left': '#' },
+    \ 'radiance': { 'left': '#' },
+    \ 'ratpoison': { 'left': '#' },
+    \ 'r': { 'left': '#' },
+    \ 'rc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'rebol': { 'left': ';' },
+    \ 'registry': { 'left': ';' },
+    \ 'remind': { 'left': '#' },
+    \ 'resolv': { 'left': '#' },
+    \ 'rgb': { 'left': '!' },
+    \ 'rib': { 'left': '#' },
+    \ 'robots': { 'left': '#' },
+    \ 'sa': { 'left': '--' },
+    \ 'samba': { 'left': ';', 'leftAlt': '#' },
+    \ 'sass': { 'left': '//', 'leftAlt': '/*' },
+    \ 'sather': { 'left': '--' },
+    \ 'scala': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'scilab': { 'left': '//' },
+    \ 'scsh': { 'left': ';' },
+    \ 'sed': { 'left': '#' },
+    \ 'sgmldecl': { 'left': '--', 'right': '--' },
+    \ 'sgmllnx': { 'left': '<!--', 'right': '-->' },
+    \ 'sicad': { 'left': '*' },
+    \ 'simula': { 'left': '%', 'leftAlt': '--' },
+    \ 'sinda': { 'left': '$' },
+    \ 'skill': { 'left': ';' },
+    \ 'slang': { 'left': '%' },
+    \ 'slice': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'slrnrc': { 'left': '%' },
+    \ 'sm': { 'left': '#' },
+    \ 'smarty': { 'left': '{*', 'right': '*}' },
+    \ 'smil': { 'left': '<!', 'right': '>' },
+    \ 'smith': { 'left': ';' },
+    \ 'sml': { 'left': '(*', 'right': '*)' },
+    \ 'snnsnet': { 'left': '#' },
+    \ 'snnspat': { 'left': '#' },
+    \ 'snnsres': { 'left': '#' },
+    \ 'snobol4': { 'left': '*' },
+    \ 'spec': { 'left': '#' },
+    \ 'specman': { 'left': '//' },
+    \ 'spectre': { 'left': '//', 'leftAlt': '*' },
+    \ 'spice': { 'left': '$' },
+    \ 'sql': { 'left': '--' },
+    \ 'sqlforms': { 'left': '--' },
+    \ 'sqlj': { 'left': '--' },
+    \ 'sqr': { 'left': '!' },
+    \ 'squid': { 'left': '#' },
+    \ 'st': { 'left': '"' },
+    \ 'stp': { 'left': '--' },
+    \ 'systemverilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'tads': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'tags': { 'left': ';' },
+    \ 'tak': { 'left': '$' },
+    \ 'tasm': { 'left': ';' },
+    \ 'tcl': { 'left': '#' },
+    \ 'texinfo': { 'left': "@c " },
+    \ 'texmf': { 'left': '%' },
+    \ 'tf': { 'left': ';' },
+    \ 'tidy': { 'left': '#' },
+    \ 'tli': { 'left': '#' },
+    \ 'tmux': { 'left': '#' },
+    \ 'trasys': { 'left': "$" },
+    \ 'tsalt': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'tsscl': { 'left': '#' },
+    \ 'tssgm': { 'left': "comment = '", 'right': "'" },
+    \ 'txt2tags': { 'left': '%' },
+    \ 'uc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'uil': { 'left': '!' },
+    \ 'vb': { 'left': "'" },
+    \ 'velocity': { 'left': "##", 'right': "", 'leftAlt': '#*', 'rightAlt': '*#' },
+    \ 'vera': { 'left': '/*','right': '*/', 'leftAlt': '//' },
+    \ 'verilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'verilog_systemverilog': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
+    \ 'vgrindefs': { 'left': '#' },
+    \ 'vhdl': { 'left': '--' },
+    \ 'vimperator': { 'left': '"' },
+    \ 'virata': { 'left': '%' },
+    \ 'vrml': { 'left': '#' },
+    \ 'vsejcl': { 'left': '/*' },
+    \ 'webmacro': { 'left': '##' },
+    \ 'wget': { 'left': '#' },
+    \ 'Wikipedia': { 'left': '<!--', 'right': '-->' },
+    \ 'winbatch': { 'left': ';' },
+    \ 'wml': { 'left': '#' },
+    \ 'wvdial': { 'left': ';' },
+    \ 'xdefaults': { 'left': '!' },
+    \ 'xkb': { 'left': '//' },
+    \ 'xmath': { 'left': '#' },
+    \ 'xpm2': { 'left': '!' },
+    \ 'xquery': { 'left': '(:', 'right': ':)' },
+    \ 'z8a': { 'left': ';' }
+    \ }
+
+" Section: Comment mapping functions, autocommands and commands {{{1
+" ============================================================================
+" Section: Comment enabler autocommands {{{2
+" ============================================================================
+
+augroup commentEnablers
+
+    "if the user enters a buffer or reads a buffer then we gotta set up
+    "the comment delimiters for that new filetype
+    autocmd BufEnter,BufRead * :call s:SetUpForNewFiletype(&filetype, 0)
+
+    "if the filetype of a buffer changes, force the script to reset the
+    "delims for the buffer
+    autocmd Filetype * :call s:SetUpForNewFiletype(&filetype, 1)
+augroup END
+
+
+" Function: s:SetUpForNewFiletype(filetype) function {{{2
+" This function is responsible for setting up buffer scoped variables for the
+" given filetype.
+"
+" Args:
+"   -filetype: the filetype to set delimiters for
+"   -forceReset: 1 if the delimiters should be reset if they have already be
+"    set for this buffer.
+"
+function s:SetUpForNewFiletype(filetype, forceReset)
+    let b:NERDSexyComMarker = ''
+
+    if has_key(s:delimiterMap, a:filetype)
+        let b:NERDCommenterDelims = s:delimiterMap[a:filetype]
+        for i in ['left', 'leftAlt', 'right', 'rightAlt']
+            if !has_key(b:NERDCommenterDelims, i)
+                let b:NERDCommenterDelims[i] = ''
+            endif
+        endfor
+    else
+        let b:NERDCommenterDelims = s:CreateDelimMapFromCms()
+    endif
+
+endfunction
+
+function s:CreateDelimMapFromCms()
+    return {
+        \ 'left': substitute(&commentstring, '\([^ \t]*\)\s*%s.*', '\1', ''),
+        \ 'right': substitute(&commentstring, '.*%s\s*\(.*\)', '\1', 'g'),
+        \ 'leftAlt': '',
+        \ 'rightAlt': '' }
+endfunction
+
+" Function: s:SwitchToAlternativeDelimiters(printMsgs) function {{{2
+" This function is used to swap the delimiters that are being used to the
+" alternative delimiters for that filetype. For example, if a c++ file is
+" being edited and // comments are being used, after this function is called
+" /**/ comments will be used.
+"
+" Args:
+"   -printMsgs: if this is 1 then a message is echoed to the user telling them
+"    if this function changed the delimiters or not
+function s:SwitchToAlternativeDelimiters(printMsgs)
+    "if both of the alternative delimiters are empty then there is no
+    "alternative comment style so bail out
+    if b:NERDCommenterDelims['leftAlt'] == '' && b:NERDCommenterDelims['rightAlt'] == ''
+        if a:printMsgs
+            call s:NerdEcho("Cannot use alternative delimiters, none are specified", 0)
+        endif
+        return 0
+    endif
+
+    "save the current delimiters
+    let tempLeft = s:Left()
+    let tempRight = s:Right()
+
+    "swap current delimiters for alternative
+    let b:NERDCommenterDelims['left'] = b:NERDCommenterDelims['leftAlt']
+    let b:NERDCommenterDelims['right'] = b:NERDCommenterDelims['rightAlt']
+
+    "set the previously current delimiters to be the new alternative ones
+    let b:NERDCommenterDelims['leftAlt'] = tempLeft
+    let b:NERDCommenterDelims['rightAlt'] = tempRight
+
+    "tell the user what comment delimiters they are now using
+    if a:printMsgs
+        call s:NerdEcho("Now using " . s:Left() . " " . s:Right() . " to delimit comments", 1)
+    endif
+
+    return 1
+endfunction
+
+" Section: Comment delimiter add/removal functions {{{1
+" ============================================================================
+" Function: s:AppendCommentToLine(){{{2
+" This function appends comment delimiters at the EOL and places the cursor in
+" position to start typing the comment
+function s:AppendCommentToLine()
+    let left = s:Left({'space': 1})
+    let right = s:Right({'space': 1})
+
+    " get the len of the right delim
+    let lenRight = strlen(right)
+
+    let isLineEmpty = strlen(getline(".")) == 0
+    let insOrApp = (isLineEmpty==1 ? 'i' : 'A')
+
+    "stick the delimiters down at the end of the line. We have to format the
+    "comment with spaces as appropriate
+    execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . right . " "
+
+    " if there is a right delimiter then we gotta move the cursor left
+    " by the len of the right delimiter so we insert between the delimiters
+    if lenRight > 0
+        let leftMoveAmount = lenRight
+        execute ":normal! " . leftMoveAmount . "h"
+    endif
+    startinsert
+endfunction
+
+" Function: s:CommentBlock(top, bottom, lSide, rSide, forceNested ) {{{2
+" This function is used to comment out a region of code. This region is
+" specified as a bounding box by arguments to the function.
+"
+" Args:
+"   -top: the line number for the top line of code in the region
+"   -bottom: the line number for the bottom line of code in the region
+"   -lSide: the column number for the left most column in the region
+"   -rSide: the column number for the right most column in the region
+"   -forceNested: a flag indicating whether comments should be nested
+function s:CommentBlock(top, bottom, lSide, rSide, forceNested )
+    " we need to create local copies of these arguments so we can modify them
+    let top = a:top
+    let bottom = a:bottom
+    let lSide = a:lSide
+    let rSide = a:rSide
+
+    "if the top or bottom line starts with tabs we have to adjust the left and
+    "right boundaries so that they are set as though the tabs were spaces
+    let topline = getline(top)
+    let bottomline = getline(bottom)
+    if s:HasLeadingTabs(topline, bottomline)
+
+        "find out how many tabs are in the top line and adjust the left
+        "boundary accordingly
+        let numTabs = s:NumberOfLeadingTabs(topline)
+        if lSide < numTabs
+            let lSide = &ts * lSide
+        else
+            let lSide = (lSide - numTabs) + (&ts * numTabs)
+        endif
+
+        "find out how many tabs are in the bottom line and adjust the right
+        "boundary accordingly
+        let numTabs = s:NumberOfLeadingTabs(bottomline)
+        let rSide = (rSide - numTabs) + (&ts * numTabs)
+    endif
+
+    "we must check that bottom IS actually below top, if it is not then we
+    "swap top and bottom. Similarly for left and right.
+    if bottom < top
+        let temp = top
+        let top = bottom
+        let bottom = top
+    endif
+    if rSide < lSide
+        let temp = lSide
+        let lSide = rSide
+        let rSide = temp
+    endif
+
+    "if the current delimiters arent multipart then we will switch to the
+    "alternative delims (if THEY are) as the comment will be better and more
+    "accurate with multipart delims
+    let switchedDelims = 0
+    if !s:Multipart() && g:NERDAllowAnyVisualDelims && s:AltMultipart()
+        let switchedDelims = 1
+        call s:SwitchToAlternativeDelimiters(0)
+    endif
+
+    "start the commenting from the top and keep commenting till we reach the
+    "bottom
+    let currentLine=top
+    while currentLine <= bottom
+
+        "check if we are allowed to comment this line
+        if s:CanCommentLine(a:forceNested, currentLine)
+
+            "convert the leading tabs into spaces
+            let theLine = getline(currentLine)
+            let lineHasLeadTabs = s:HasLeadingTabs(theLine)
+            if lineHasLeadTabs
+                let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+            endif
+
+            "dont comment lines that begin after the right boundary of the
+            "block unless the user has specified to do so
+            if theLine !~ '^ \{' . rSide . '\}' || !g:NERDBlockComIgnoreEmpty
+
+                "attempt to place the cursor in on the left of the boundary box,
+                "then check if we were successful, if not then we cant comment this
+                "line
+                call setline(currentLine, theLine)
+                if s:CanPlaceCursor(currentLine, lSide)
+
+                    let leftSpaced = s:Left({'space': 1})
+                    let rightSpaced = s:Right({'space': 1})
+
+                    "stick the left delimiter down
+                    let theLine = strpart(theLine, 0, lSide-1) . leftSpaced . strpart(theLine, lSide-1)
+
+                    if s:Multipart()
+                        "stick the right delimiter down
+                        let theLine = strpart(theLine, 0, rSide+strlen(leftSpaced)) . rightSpaced . strpart(theLine, rSide+strlen(leftSpaced))
+
+                        let firstLeftDelim = s:FindDelimiterIndex(s:Left(), theLine)
+                        let lastRightDelim = s:LastIndexOfDelim(s:Right(), theLine)
+
+                        if firstLeftDelim != -1 && lastRightDelim != -1
+                            let searchStr = strpart(theLine, 0, lastRightDelim)
+                            let searchStr = strpart(searchStr, firstLeftDelim+strlen(s:Left()))
+
+                            "replace the outter most delims in searchStr with
+                            "place-holders
+                            let theLineWithPlaceHolders = s:ReplaceDelims(s:Left(), s:Right(), g:NERDLPlace, g:NERDRPlace, searchStr)
+
+                            "add the right delimiter onto the line
+                            let theLine = strpart(theLine, 0, firstLeftDelim+strlen(s:Left())) . theLineWithPlaceHolders . strpart(theLine, lastRightDelim)
+                        endif
+                    endif
+                endif
+            endif
+
+            "restore tabs if needed
+            if lineHasLeadTabs
+                let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+            endif
+
+            call setline(currentLine, theLine)
+        endif
+
+        let currentLine = currentLine + 1
+    endwhile
+
+    "if we switched delims then we gotta go back to what they were before
+    if switchedDelims == 1
+        call s:SwitchToAlternativeDelimiters(0)
+    endif
+endfunction
+
+" Function: s:CommentLines(forceNested, alignLeft, alignRight, firstLine, lastLine) {{{2
+" This function comments a range of lines.
+"
+" Args:
+"   -forceNested: a flag indicating whether the called is requesting the comment
+"    to be nested if need be
+"   -align: should be "left" or "both" or "none"
+"   -firstLine/lastLine: the top and bottom lines to comment
+function s:CommentLines(forceNested, align, firstLine, lastLine)
+    " we need to get the left and right indexes of the leftmost char in the
+    " block of of lines and the right most char so that we can do alignment of
+    " the delimiters if the user has specified
+    let leftAlignIndx = s:LeftMostIndx(a:forceNested, 0, a:firstLine, a:lastLine)
+    let rightAlignIndx = s:RightMostIndx(a:forceNested, 0, a:firstLine, a:lastLine)
+
+    " gotta add the length of the left delimiter onto the rightAlignIndx cos
+    " we'll be adding a left delim to the line
+    let rightAlignIndx = rightAlignIndx + strlen(s:Left({'space': 1}))
+
+    " now we actually comment the lines. Do it line by line
+    let currentLine = a:firstLine
+    while currentLine <= a:lastLine
+
+        " get the next line, check commentability and convert spaces to tabs
+        let theLine = getline(currentLine)
+        let lineHasLeadingTabs = s:HasLeadingTabs(theLine)
+        let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+        if s:CanCommentLine(a:forceNested, currentLine)
+            "if the user has specified forceNesting then we check to see if we
+            "need to switch delimiters for place-holders
+            if a:forceNested && g:NERDUsePlaceHolders
+                let theLine = s:SwapOutterMultiPartDelimsForPlaceHolders(theLine)
+            endif
+
+            " find out if the line is commented using normal delims and/or
+            " alternate ones
+            let isCommented = s:IsCommented(s:Left(), s:Right(), theLine) || s:IsCommented(s:Left({'alt': 1}), s:Right({'alt': 1}), theLine)
+
+            " check if we can comment this line
+            if !isCommented || g:NERDUsePlaceHolders || s:Multipart()
+                if a:align == "left" || a:align == "both"
+                    let theLine = s:AddLeftDelimAligned(s:Left({'space': 1}), theLine, leftAlignIndx)
+                else
+                    let theLine = s:AddLeftDelim(s:Left({'space': 1}), theLine)
+                endif
+                if a:align == "both"
+                    let theLine = s:AddRightDelimAligned(s:Right({'space': 1}), theLine, rightAlignIndx)
+                else
+                    let theLine = s:AddRightDelim(s:Right({'space': 1}), theLine)
+                endif
+            endif
+        endif
+
+        " restore leading tabs if appropriate
+        if lineHasLeadingTabs
+            let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+        endif
+
+        " we are done with this line
+        call setline(currentLine, theLine)
+        let currentLine = currentLine + 1
+    endwhile
+
+endfunction
+
+" Function: s:CommentLinesMinimal(firstLine, lastLine) {{{2
+" This function comments a range of lines in a minimal style. I
+"
+" Args:
+"   -firstLine/lastLine: the top and bottom lines to comment
+function s:CommentLinesMinimal(firstLine, lastLine)
+    "check that minimal comments can be done on this filetype
+    if !s:HasMultipartDelims()
+        throw 'NERDCommenter.Delimiters exception: Minimal comments can only be used for filetypes that have multipart delimiters'
+    endif
+
+    "if we need to use place holders for the comment, make sure they are
+    "enabled for this filetype
+    if !g:NERDUsePlaceHolders && s:DoesBlockHaveMultipartDelim(a:firstLine, a:lastLine)
+        throw 'NERDCommenter.Settings exception: Place holders are required but disabled.'
+    endif
+
+    "get the left and right delims to smack on
+    let left = s:GetSexyComLeft(g:NERDSpaceDelims,0)
+    let right = s:GetSexyComRight(g:NERDSpaceDelims,0)
+
+    "make sure all multipart delims on the lines are replaced with
+    "placeholders to prevent illegal syntax
+    let currentLine = a:firstLine
+    while(currentLine <= a:lastLine)
+        let theLine = getline(currentLine)
+        let theLine = s:ReplaceDelims(left, right, g:NERDLPlace, g:NERDRPlace, theLine)
+        call setline(currentLine, theLine)
+        let currentLine = currentLine + 1
+    endwhile
+
+    "add the delim to the top line
+    let theLine = getline(a:firstLine)
+    let lineHasLeadingTabs = s:HasLeadingTabs(theLine)
+    let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+    let theLine = s:AddLeftDelim(left, theLine)
+    if lineHasLeadingTabs
+        let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+    endif
+    call setline(a:firstLine, theLine)
+
+    "add the delim to the bottom line
+    let theLine = getline(a:lastLine)
+    let lineHasLeadingTabs = s:HasLeadingTabs(theLine)
+    let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+    let theLine = s:AddRightDelim(right, theLine)
+    if lineHasLeadingTabs
+        let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+    endif
+    call setline(a:lastLine, theLine)
+endfunction
+
+" Function: s:CommentLinesSexy(topline, bottomline) function {{{2
+" This function is used to comment lines in the 'Sexy' style. eg in c:
+" /*
+"  * This is a sexy comment
+"  */
+" Args:
+"   -topline: the line num of the top line in the sexy comment
+"   -bottomline: the line num of the bottom line in the sexy comment
+function s:CommentLinesSexy(topline, bottomline)
+    let left = s:GetSexyComLeft(0, 0)
+    let right = s:GetSexyComRight(0, 0)
+
+    "check if we can do a sexy comment with the available delimiters
+    if left == -1 || right == -1
+        throw 'NERDCommenter.Delimiters exception: cannot perform sexy comments with available delimiters.'
+    endif
+
+    "make sure the lines arent already commented sexually
+    if !s:CanSexyCommentLines(a:topline, a:bottomline)
+        throw 'NERDCommenter.Nesting exception: cannot nest sexy comments'
+    endif
+
+
+    let sexyComMarker = s:GetSexyComMarker(0,0)
+    let sexyComMarkerSpaced = s:GetSexyComMarker(1,0)
+
+
+    " we jam the comment as far to the right as possible
+    let leftAlignIndx = s:LeftMostIndx(1, 1, a:topline, a:bottomline)
+
+    "check if we should use the compact style i.e that the left/right
+    "delimiters should appear on the first and last lines of the code and not
+    "on separate lines above/below the first/last lines of code
+    if g:NERDCompactSexyComs
+        let spaceString = (g:NERDSpaceDelims ? s:spaceStr : '')
+
+        "comment the top line
+        let theLine = getline(a:topline)
+        let lineHasTabs = s:HasLeadingTabs(theLine)
+        if lineHasTabs
+            let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+        endif
+        let theLine = s:SwapOutterMultiPartDelimsForPlaceHolders(theLine)
+        let theLine = s:AddLeftDelimAligned(left . spaceString, theLine, leftAlignIndx)
+        if lineHasTabs
+            let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+        endif
+        call setline(a:topline, theLine)
+
+        "comment the bottom line
+        if a:bottomline != a:topline
+            let theLine = getline(a:bottomline)
+            let lineHasTabs = s:HasLeadingTabs(theLine)
+            if lineHasTabs
+                let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+            endif
+            let theLine = s:SwapOutterMultiPartDelimsForPlaceHolders(theLine)
+        endif
+        let theLine = s:AddRightDelim(spaceString . right, theLine)
+        if lineHasTabs
+            let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+        endif
+        call setline(a:bottomline, theLine)
+    else
+
+        " add the left delimiter one line above the lines that are to be commented
+        call cursor(a:topline, 1)
+        execute 'normal! O'
+        let theLine = repeat(' ', leftAlignIndx) . left
+
+        " Make sure tabs are respected
+        if !&expandtab
+           let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+        endif
+        call setline(a:topline, theLine)
+
+        " add the right delimiter after bottom line (we have to add 1 cos we moved
+        " the lines down when we added the left delim
+        call cursor(a:bottomline+1, 1)
+        execute 'normal! o'
+        let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . right
+
+        " Make sure tabs are respected
+        if !&expandtab
+           let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+        endif
+        call setline(a:bottomline+2, theLine)
+
+    endif
+
+    " go thru each line adding the sexyComMarker marker to the start of each
+    " line in the appropriate place to align them with the comment delims
+    let currentLine = a:topline+1
+    while currentLine <= a:bottomline + !g:NERDCompactSexyComs
+        " get the line and convert the tabs to spaces
+        let theLine = getline(currentLine)
+        let lineHasTabs = s:HasLeadingTabs(theLine)
+        if lineHasTabs
+            let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+        endif
+
+        let theLine = s:SwapOutterMultiPartDelimsForPlaceHolders(theLine)
+
+        " add the sexyComMarker
+        let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . sexyComMarkerSpaced . strpart(theLine, leftAlignIndx)
+
+        if lineHasTabs
+            let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+        endif
+
+
+        " set the line and move onto the next one
+        call setline(currentLine, theLine)
+        let currentLine = currentLine + 1
+    endwhile
+
+endfunction
+
+" Function: s:CommentLinesToggle(forceNested, firstLine, lastLine) {{{2
+" Applies "toggle" commenting to the given range of lines
+"
+" Args:
+"   -forceNested: a flag indicating whether the called is requesting the comment
+"    to be nested if need be
+"   -firstLine/lastLine: the top and bottom lines to comment
+function s:CommentLinesToggle(forceNested, firstLine, lastLine)
+    let currentLine = a:firstLine
+    while currentLine <= a:lastLine
+
+        " get the next line, check commentability and convert spaces to tabs
+        let theLine = getline(currentLine)
+        let lineHasLeadingTabs = s:HasLeadingTabs(theLine)
+        let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+        if s:CanToggleCommentLine(a:forceNested, currentLine)
+
+            "if the user has specified forceNesting then we check to see if we
+            "need to switch delimiters for place-holders
+            if g:NERDUsePlaceHolders
+                let theLine = s:SwapOutterMultiPartDelimsForPlaceHolders(theLine)
+            endif
+
+            let theLine = s:AddLeftDelim(s:Left({'space': 1}), theLine)
+            let theLine = s:AddRightDelim(s:Right({'space': 1}), theLine)
+        endif
+
+        " restore leading tabs if appropriate
+        if lineHasLeadingTabs
+            let theLine = s:ConvertLeadingSpacesToTabs(theLine)
+        endif
+
+        " we are done with this line
+        call setline(currentLine, theLine)
+        let currentLine = currentLine + 1
+    endwhile
+
+endfunction
+
+" Function: s:CommentRegion(topline, topCol, bottomLine, bottomCol) function {{{2
+" This function comments chunks of text selected in visual mode.
+" It will comment exactly the text that they have selected.
+" Args:
+"   -topLine: the line num of the top line in the sexy comment
+"   -topCol: top left col for this comment
+"   -bottomline: the line num of the bottom line in the sexy comment
+"   -bottomCol: the bottom right col for this comment
+"   -forceNested: whether the caller wants comments to be nested if the
+"    line(s) are already commented
+function s:CommentRegion(topLine, topCol, bottomLine, bottomCol, forceNested)
+
+    "switch delims (if we can) if the current set isnt multipart
+    let switchedDelims = 0
+    if !s:Multipart() && s:AltMultipart() && !g:NERDAllowAnyVisualDelims
+        let switchedDelims = 1
+        call s:SwitchToAlternativeDelimiters(0)
+    endif
+
+    "if there is only one line in the comment then just do it
+    if a:topLine == a:bottomLine
+        call s:CommentBlock(a:topLine, a:bottomLine, a:topCol, a:bottomCol, a:forceNested)
+
+    "there are multiple lines in the comment
+    else
+        "comment the top line
+        call s:CommentBlock(a:topLine, a:topLine, a:topCol, strlen(getline(a:topLine)), a:forceNested)
+
+        "comment out all the lines in the middle of the comment
+        let topOfRange = a:topLine+1
+        let bottomOfRange = a:bottomLine-1
+        if topOfRange <= bottomOfRange
+            call s:CommentLines(a:forceNested, "none", topOfRange, bottomOfRange)
+        endif
+
+        "comment the bottom line
+        let bottom = getline(a:bottomLine)
+        let numLeadingSpacesTabs = strlen(substitute(bottom, '^\([ \t]*\).*$', '\1', ''))
+        call s:CommentBlock(a:bottomLine, a:bottomLine, numLeadingSpacesTabs+1, a:bottomCol, a:forceNested)
+
+    endif
+
+    "stick the cursor back on the char it was on before the comment
+    call cursor(a:topLine, a:topCol + strlen(s:Left()) + g:NERDSpaceDelims)
+
+    "if we switched delims then we gotta go back to what they were before
+    if switchedDelims == 1
+        call s:SwitchToAlternativeDelimiters(0)
+    endif
+
+endfunction
+
+" Function: s:InvertComment(firstLine, lastLine) function {{{2
+" Inverts the comments on the lines between and including the given line
+" numbers i.e all commented lines are uncommented and vice versa
+" Args:
+"   -firstLine: the top of the range of lines to be inverted
+"   -lastLine: the bottom of the range of lines to be inverted
+function s:InvertComment(firstLine, lastLine)
+
+    " go thru all lines in the given range
+    let currentLine = a:firstLine
+    while currentLine <= a:lastLine
+        let theLine = getline(currentLine)
+
+        let sexyComBounds = s:FindBoundingLinesOfSexyCom(currentLine)
+
+        " if the line is commented normally, uncomment it
+        if s:IsCommentedFromStartOfLine(s:Left(), theLine) || s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
+            call s:UncommentLines(currentLine, currentLine)
+            let currentLine = currentLine + 1
+
+        " check if the line is commented sexually
+        elseif !empty(sexyComBounds)
+            let numLinesBeforeSexyComRemoved = s:NumLinesInBuf()
+            call s:UncommentLinesSexy(sexyComBounds[0], sexyComBounds[1])
+
+            "move to the line after last line of the sexy comment
+            let numLinesAfterSexyComRemoved = s:NumLinesInBuf()
+            let currentLine = sexyComBounds[1] - (numLinesBeforeSexyComRemoved - numLinesAfterSexyComRemoved) + 1
+
+        " the line isnt commented
+        else
+            call s:CommentLinesToggle(1, currentLine, currentLine)
+            let currentLine = currentLine + 1
+        endif
+
+    endwhile
+endfunction
+
+" Function: NERDComment(isVisual, type) function {{{2
+" This function is a Wrapper for the main commenting functions
+"
+" Args:
+"   -isVisual: a flag indicating whether the comment is requested in visual
+"    mode or not
+"   -type: the type of commenting requested. Can be 'sexy', 'invert',
+"    'minimal', 'toggle', 'alignLeft', 'alignBoth', 'norm',
+"    'nested', 'toEOL', 'append', 'insert', 'uncomment', 'yank'
+function! NERDComment(isVisual, type) range
+    " we want case sensitivity when commenting
+    let oldIgnoreCase = &ignorecase
+    set noignorecase
+
+    if !exists("g:did_load_ftplugin") || g:did_load_ftplugin != 1
+        call s:NerdEcho("filetype plugins should be enabled. See :help NERDComInstallation and :help :filetype-plugin-on", 0)
+    endif
+
+    if a:isVisual
+        let firstLine = line("'<")
+        let lastLine = line("'>")
+        let firstCol = col("'<")
+        let lastCol = col("'>") - (&selection == 'exclusive' ? 1 : 0)
+    else
+        let firstLine = a:firstline
+        let lastLine = a:lastline
+    endif
+
+    let countWasGiven = (a:isVisual == 0 && firstLine != lastLine)
+
+    let forceNested = (a:type == 'nested' || g:NERDDefaultNesting)
+
+    if a:type == 'norm' || a:type == 'nested'
+        if a:isVisual && visualmode() == "\16"
+            call s:CommentBlock(firstLine, lastLine, firstCol, lastCol, forceNested)
+        elseif a:isVisual && visualmode() == "v" && (g:NERDCommentWholeLinesInVMode==0 || (g:NERDCommentWholeLinesInVMode==2 && s:HasMultipartDelims()))
+            call s:CommentRegion(firstLine, firstCol, lastLine, lastCol, forceNested)
+        else
+            call s:CommentLines(forceNested, "none", firstLine, lastLine)
+        endif
+
+    elseif a:type == 'alignLeft' || a:type == 'alignBoth'
+        let align = "none"
+        if a:type == "alignLeft"
+            let align = "left"
+        elseif a:type == "alignBoth"
+            let align = "both"
+        endif
+        call s:CommentLines(forceNested, align, firstLine, lastLine)
+
+    elseif a:type == 'invert'
+        call s:InvertComment(firstLine, lastLine)
+
+    elseif a:type == 'sexy'
+        try
+            call s:CommentLinesSexy(firstLine, lastLine)
+        catch /NERDCommenter.Delimiters/
+            call s:CommentLines(forceNested, "none", firstLine, lastLine)
+        catch /NERDCommenter.Nesting/
+            call s:NerdEcho("Sexy comment aborted. Nested sexy cannot be nested", 0)
+        endtry
+
+    elseif a:type == 'toggle'
+        let theLine = getline(firstLine)
+
+        if s:IsInSexyComment(firstLine) || s:IsCommentedFromStartOfLine(s:Left(), theLine) || s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
+            call s:UncommentLines(firstLine, lastLine)
+        else
+            call s:CommentLinesToggle(forceNested, firstLine, lastLine)
+        endif
+
+    elseif a:type == 'minimal'
+        try
+            call s:CommentLinesMinimal(firstLine, lastLine)
+        catch /NERDCommenter.Delimiters/
+            call s:NerdEcho("Minimal comments can only be used for filetypes that have multipart delimiters.", 0)
+        catch /NERDCommenter.Settings/
+            call s:NerdEcho("Place holders are required but disabled.", 0)
+        endtry
+
+    elseif a:type == 'toEOL'
+        call s:SaveScreenState()
+        call s:CommentBlock(firstLine, firstLine, col("."), col("$")-1, 1)
+        call s:RestoreScreenState()
+
+    elseif a:type == 'append'
+        call s:AppendCommentToLine()
+
+    elseif a:type == 'insert'
+        call s:PlaceDelimitersAndInsBetween()
+
+    elseif a:type == 'uncomment'
+        call s:UncommentLines(firstLine, lastLine)
+
+    elseif a:type == 'yank'
+        if a:isVisual
+            normal! gvy
+        elseif countWasGiven
+            execute firstLine .','. lastLine .'yank'
+        else
+            normal! yy
+        endif
+        execute firstLine .','. lastLine .'call NERDComment('. a:isVisual .', "norm")'
+    endif
+
+    let &ignorecase = oldIgnoreCase
+endfunction
+
+" Function: s:PlaceDelimitersAndInsBetween() function {{{2
+" This is function is called to place comment delimiters down and place the
+" cursor between them
+function s:PlaceDelimitersAndInsBetween()
+    " get the left and right delimiters without any escape chars in them
+    let left = s:Left({'space': 1})
+    let right = s:Right({'space': 1})
+
+    let theLine = getline(".")
+    let lineHasLeadTabs = s:HasLeadingTabs(theLine) || (theLine =~ '^ *$' && !&expandtab)
+
+    "convert tabs to spaces and adjust the cursors column to take this into
+    "account
+    let untabbedCol = s:UntabbedCol(theLine, col("."))
+    call setline(line("."), s:ConvertLeadingTabsToSpaces(theLine))
+    call cursor(line("."), untabbedCol)
+
+    " get the len of the right delim
+    let lenRight = strlen(right)
+
+    let isDelimOnEOL = col(".") >= strlen(getline("."))
+
+    " if the cursor is in the first col then we gotta insert rather than
+    " append the comment delimiters here
+    let insOrApp = (col(".")==1 ? 'i' : 'a')
+
+    " place the delimiters down. We do it differently depending on whether
+    " there is a left AND right delimiter
+    if lenRight > 0
+        execute ":normal! " . insOrApp . left . right
+        execute ":normal! " . lenRight . "h"
+    else
+        execute ":normal! " . insOrApp . left
+
+        " if we are tacking the delim on the EOL then we gotta add a space
+        " after it cos when we go out of insert mode the cursor will move back
+        " one and the user wont be in position to type the comment.
+        if isDelimOnEOL
+            execute 'normal! a '
+        endif
+    endif
+    normal! l
+
+    "if needed convert spaces back to tabs and adjust the cursors col
+    "accordingly
+    if lineHasLeadTabs
+        let tabbedCol = s:TabbedCol(getline("."), col("."))
+        call setline(line("."), s:ConvertLeadingSpacesToTabs(getline(".")))
+        call cursor(line("."), tabbedCol)
+    endif
+
+    startinsert
+endfunction
+
+" Function: s:RemoveDelimiters(left, right, line) {{{2
+" this function is called to remove the first left comment delimiter and the
+" last right delimiter of the given line.
+"
+" The args left and right must be strings. If there is no right delimiter (as
+" is the case for e.g vim file comments) them the arg right should be ""
+"
+" Args:
+"   -left: the left comment delimiter
+"   -right: the right comment delimiter
+"   -line: the line to remove the delimiters from
+function s:RemoveDelimiters(left, right, line)
+
+    let l:left = a:left
+    let l:right = a:right
+    let lenLeft = strlen(left)
+    let lenRight = strlen(right)
+
+    let delimsSpaced = (g:NERDSpaceDelims || g:NERDRemoveExtraSpaces)
+
+    let line = a:line
+
+    "look for the left delimiter, if we find it, remove it.
+    let leftIndx = s:FindDelimiterIndex(a:left, line)
+    if leftIndx != -1
+        let line = strpart(line, 0, leftIndx) . strpart(line, leftIndx+lenLeft)
+
+        "if the user has specified that there is a space after the left delim
+        "then check for the space and remove it if it is there
+        if delimsSpaced && strpart(line, leftIndx, s:lenSpaceStr) == s:spaceStr
+            let line = strpart(line, 0, leftIndx) . strpart(line, leftIndx+s:lenSpaceStr)
+        endif
+    endif
+
+    "look for the right delimiter, if we find it, remove it
+    let rightIndx = s:FindDelimiterIndex(a:right, line)
+    if rightIndx != -1
+        let line = strpart(line, 0, rightIndx) . strpart(line, rightIndx+lenRight)
+
+        "if the user has specified that there is a space before the right delim
+        "then check for the space and remove it if it is there
+        if delimsSpaced && strpart(line, rightIndx-s:lenSpaceStr, s:lenSpaceStr) == s:spaceStr && s:Multipart()
+            let line = strpart(line, 0, rightIndx-s:lenSpaceStr) . strpart(line, rightIndx)
+        endif
+    endif
+
+    return line
+endfunction
+
+" Function: s:UncommentLines(topLine, bottomLine) {{{2
+" This function uncomments the given lines
+"
+" Args:
+" topLine: the top line of the visual selection to uncomment
+" bottomLine: the bottom line of the visual selection to uncomment
+function s:UncommentLines(topLine, bottomLine)
+    "make local copies of a:firstline and a:lastline and, if need be, swap
+    "them around if the top line is below the bottom
+    let l:firstline = a:topLine
+    let l:lastline = a:bottomLine
+    if firstline > lastline
+        let firstline = lastline
+        let lastline = a:topLine
+    endif
+
+    "go thru each line uncommenting each line removing sexy comments
+    let currentLine = firstline
+    while currentLine <= lastline
+
+        "check the current line to see if it is part of a sexy comment
+        let sexyComBounds = s:FindBoundingLinesOfSexyCom(currentLine)
+        if !empty(sexyComBounds)
+
+            "we need to store the num lines in the buf before the comment is
+            "removed so we know how many lines were removed when the sexy com
+            "was removed
+            let numLinesBeforeSexyComRemoved = s:NumLinesInBuf()
+
+            call s:UncommentLinesSexy(sexyComBounds[0], sexyComBounds[1])
+
+            "move to the line after last line of the sexy comment
+            let numLinesAfterSexyComRemoved = s:NumLinesInBuf()
+            let numLinesRemoved = numLinesBeforeSexyComRemoved - numLinesAfterSexyComRemoved
+            let currentLine = sexyComBounds[1] - numLinesRemoved + 1
+            let lastline = lastline - numLinesRemoved
+
+        "no sexy com was detected so uncomment the line as normal
+        else
+            call s:UncommentLinesNormal(currentLine, currentLine)
+            let currentLine = currentLine + 1
+        endif
+    endwhile
+
+endfunction
+
+" Function: s:UncommentLinesSexy(topline, bottomline) {{{2
+" This function removes all the comment characters associated with the sexy
+" comment spanning the given lines
+" Args:
+"   -topline/bottomline: the top/bottom lines of the sexy comment
+function s:UncommentLinesSexy(topline, bottomline)
+    let left = s:GetSexyComLeft(0,1)
+    let right = s:GetSexyComRight(0,1)
+
+
+    "check if it is even possible for sexy comments to exist with the
+    "available delimiters
+    if left == -1 || right == -1
+        throw 'NERDCommenter.Delimiters exception: cannot uncomment sexy comments with available delimiters.'
+    endif
+
+    let leftUnEsc = s:GetSexyComLeft(0,0)
+    let rightUnEsc = s:GetSexyComRight(0,0)
+
+    let sexyComMarker = s:GetSexyComMarker(0, 1)
+    let sexyComMarkerUnEsc = s:GetSexyComMarker(0, 0)
+
+    "the markerOffset is how far right we need to move the sexyComMarker to
+    "line it up with the end of the left delim
+    let markerOffset = strlen(leftUnEsc)-strlen(sexyComMarkerUnEsc)
+
+    " go thru the intermediate lines of the sexy comment and remove the
+    " sexy comment markers (eg the '*'s on the start of line in a c sexy
+    " comment)
+    let currentLine = a:topline+1
+    while currentLine < a:bottomline
+        let theLine = getline(currentLine)
+
+        " remove the sexy comment marker from the line. We also remove the
+        " space after it if there is one and if appropriate options are set
+        let sexyComMarkerIndx = stridx(theLine, sexyComMarkerUnEsc)
+        if strpart(theLine, sexyComMarkerIndx+strlen(sexyComMarkerUnEsc), s:lenSpaceStr) == s:spaceStr  && g:NERDSpaceDelims
+            let theLine = strpart(theLine, 0, sexyComMarkerIndx - markerOffset) . strpart(theLine, sexyComMarkerIndx+strlen(sexyComMarkerUnEsc)+s:lenSpaceStr)
+        else
+            let theLine = strpart(theLine, 0, sexyComMarkerIndx - markerOffset) . strpart(theLine, sexyComMarkerIndx+strlen(sexyComMarkerUnEsc))
+        endif
+
+        let theLine = s:SwapOutterPlaceHoldersForMultiPartDelims(theLine)
+
+        let theLine = s:ConvertLeadingWhiteSpace(theLine)
+
+        " move onto the next line
+        call setline(currentLine, theLine)
+        let currentLine = currentLine + 1
+    endwhile
+
+    " gotta make a copy of a:bottomline cos we modify the position of the
+    " last line  it if we remove the topline
+    let bottomline = a:bottomline
+
+    " get the first line so we can remove the left delim from it
+    let theLine = getline(a:topline)
+
+    " if the first line contains only the left delim then just delete it
+    if theLine =~ '^[ \t]*' . left . '[ \t]*$' && !g:NERDCompactSexyComs
+        call cursor(a:topline, 1)
+        normal! dd
+        let bottomline = bottomline - 1
+
+    " topline contains more than just the left delim
+    else
+
+        " remove the delim. If there is a space after it
+        " then remove this too if appropriate
+        let delimIndx = stridx(theLine, leftUnEsc)
+        if strpart(theLine, delimIndx+strlen(leftUnEsc), s:lenSpaceStr) == s:spaceStr && g:NERDSpaceDelims
+            let theLine = strpart(theLine, 0, delimIndx) . strpart(theLine, delimIndx+strlen(leftUnEsc)+s:lenSpaceStr)
+        else
+            let theLine = strpart(theLine, 0, delimIndx) . strpart(theLine, delimIndx+strlen(leftUnEsc))
+        endif
+        let theLine = s:SwapOutterPlaceHoldersForMultiPartDelims(theLine)
+        call setline(a:topline, theLine)
+    endif
+
+    " get the last line so we can remove the right delim
+    let theLine = getline(bottomline)
+
+    " if the bottomline contains only the right delim then just delete it
+    if theLine =~ '^[ \t]*' . right . '[ \t]*$'
+        call cursor(bottomline, 1)
+        normal! dd
+
+    " the last line contains more than the right delim
+    else
+        " remove the right delim. If there is a space after it and
+        " if the appropriate options are set then remove this too.
+        let delimIndx = s:LastIndexOfDelim(rightUnEsc, theLine)
+        if strpart(theLine, delimIndx+strlen(leftUnEsc), s:lenSpaceStr) == s:spaceStr  && g:NERDSpaceDelims
+            let theLine = strpart(theLine, 0, delimIndx) . strpart(theLine, delimIndx+strlen(rightUnEsc)+s:lenSpaceStr)
+        else
+            let theLine = strpart(theLine, 0, delimIndx) . strpart(theLine, delimIndx+strlen(rightUnEsc))
+        endif
+
+        " if the last line also starts with a sexy comment marker then we
+        " remove this as well
+        if theLine =~ '^[ \t]*' . sexyComMarker
+
+            " remove the sexyComMarker. If there is a space after it then
+            " remove that too
+            let sexyComMarkerIndx = stridx(theLine, sexyComMarkerUnEsc)
+            if strpart(theLine, sexyComMarkerIndx+strlen(sexyComMarkerUnEsc), s:lenSpaceStr) == s:spaceStr  && g:NERDSpaceDelims
+                let theLine = strpart(theLine, 0, sexyComMarkerIndx - markerOffset ) . strpart(theLine, sexyComMarkerIndx+strlen(sexyComMarkerUnEsc)+s:lenSpaceStr)
+            else
+                let theLine = strpart(theLine, 0, sexyComMarkerIndx - markerOffset ) . strpart(theLine, sexyComMarkerIndx+strlen(sexyComMarkerUnEsc))
+            endif
+        endif
+
+        let theLine = s:SwapOutterPlaceHoldersForMultiPartDelims(theLine)
+        call setline(bottomline, theLine)
+    endif
+endfunction
+
+" Function: s:UncommentLineNormal(line) {{{2
+" uncomments the given line and returns the result
+" Args:
+"   -line: the line to uncomment
+function s:UncommentLineNormal(line)
+    let line = a:line
+
+    "get the comment status on the line so we know how it is commented
+    let lineCommentStatus =  s:IsCommentedOuttermost(s:Left(), s:Right(), s:Left({'alt': 1}), s:Right({'alt': 1}), line)
+
+    "it is commented with s:Left() and s:Right() so remove these delims
+    if lineCommentStatus == 1
+        let line = s:RemoveDelimiters(s:Left(), s:Right(), line)
+
+    "it is commented with s:Left({'alt': 1}) and s:Right({'alt': 1}) so remove these delims
+    elseif lineCommentStatus == 2 && g:NERDRemoveAltComs
+        let line = s:RemoveDelimiters(s:Left({'alt': 1}), s:Right({'alt': 1}), line)
+
+    "it is not properly commented with any delims so we check if it has
+    "any random left or right delims on it and remove the outtermost ones
+    else
+        "get the positions of all delim types on the line
+        let indxLeft = s:FindDelimiterIndex(s:Left(), line)
+        let indxLeftAlt = s:FindDelimiterIndex(s:Left({'alt': 1}), line)
+        let indxRight = s:FindDelimiterIndex(s:Right(), line)
+        let indxRightAlt = s:FindDelimiterIndex(s:Right({'alt': 1}), line)
+
+        "remove the outter most left comment delim
+        if indxLeft != -1 && (indxLeft < indxLeftAlt || indxLeftAlt == -1)
+            let line = s:RemoveDelimiters(s:Left(), '', line)
+        elseif indxLeftAlt != -1
+            let line = s:RemoveDelimiters(s:Left({'alt': 1}), '', line)
+        endif
+
+        "remove the outter most right comment delim
+        if indxRight != -1 && (indxRight < indxRightAlt || indxRightAlt == -1)
+            let line = s:RemoveDelimiters('', s:Right(), line)
+        elseif indxRightAlt != -1
+            let line = s:RemoveDelimiters('', s:Right({'alt': 1}), line)
+        endif
+    endif
+
+
+    let indxLeft = s:FindDelimiterIndex(s:Left(), line)
+    let indxLeftAlt = s:FindDelimiterIndex(s:Left({'alt': 1}), line)
+    let indxLeftPlace = s:FindDelimiterIndex(g:NERDLPlace, line)
+
+    let indxRightPlace = s:FindDelimiterIndex(g:NERDRPlace, line)
+    let indxRightAlt = s:FindDelimiterIndex(s:Right({'alt': 1}), line)
+    let indxRightPlace = s:FindDelimiterIndex(g:NERDRPlace, line)
+
+    let right = s:Right()
+    let left = s:Left()
+    if !s:Multipart()
+        let right = s:Right({'alt': 1})
+        let left = s:Left({'alt': 1})
+    endif
+
+
+    "if there are place-holders on the line then we check to see if they are
+    "the outtermost delimiters on the line. If so then we replace them with
+    "real delimiters
+    if indxLeftPlace != -1
+        if (indxLeftPlace < indxLeft || indxLeft==-1) && (indxLeftPlace < indxLeftAlt || indxLeftAlt==-1)
+            let line = s:ReplaceDelims(g:NERDLPlace, g:NERDRPlace, left, right, line)
+        endif
+    elseif indxRightPlace != -1
+        if (indxRightPlace < indxLeft || indxLeft==-1) && (indxLeftPlace < indxLeftAlt || indxLeftAlt==-1)
+            let line = s:ReplaceDelims(g:NERDLPlace, g:NERDRPlace, left, right, line)
+        endif
+
+    endif
+
+    let line = s:ConvertLeadingWhiteSpace(line)
+
+    return line
+endfunction
+
+" Function: s:UncommentLinesNormal(topline, bottomline) {{{2
+" This function is called to uncomment lines that arent a sexy comment
+" Args:
+"   -topline/bottomline: the top/bottom line numbers of the comment
+function s:UncommentLinesNormal(topline, bottomline)
+    let currentLine = a:topline
+    while currentLine <= a:bottomline
+        let line = getline(currentLine)
+        call setline(currentLine, s:UncommentLineNormal(line))
+        let currentLine = currentLine + 1
+    endwhile
+endfunction
+
+
+" Section: Other helper functions {{{1
+" ============================================================================
+
+" Function: s:AddLeftDelim(delim, theLine) {{{2
+" Args:
+function s:AddLeftDelim(delim, theLine)
+    return substitute(a:theLine, '^\([ \t]*\)', '\1' . a:delim, '')
+endfunction
+
+" Function: s:AddLeftDelimAligned(delim, theLine) {{{2
+" Args:
+function s:AddLeftDelimAligned(delim, theLine, alignIndx)
+
+    "if the line is not long enough then bung some extra spaces on the front
+    "so we can align the delim properly
+    let theLine = a:theLine
+    if strlen(theLine) < a:alignIndx
+        let theLine = repeat(' ', a:alignIndx - strlen(theLine))
+    endif
+
+    return strpart(theLine, 0, a:alignIndx) . a:delim . strpart(theLine, a:alignIndx)
+endfunction
+
+" Function: s:AddRightDelim(delim, theLine) {{{2
+" Args:
+function s:AddRightDelim(delim, theLine)
+    if a:delim == ''
+        return a:theLine
+    else
+        return substitute(a:theLine, '$', a:delim, '')
+    endif
+endfunction
+
+" Function: s:AddRightDelimAligned(delim, theLine, alignIndx) {{{2
+" Args:
+function s:AddRightDelimAligned(delim, theLine, alignIndx)
+    if a:delim == ""
+        return a:theLine
+    else
+
+        " when we align the right delim we are just adding spaces
+        " so we get a string containing the needed spaces (it
+        " could be empty)
+        let extraSpaces = ''
+        let extraSpaces = repeat(' ', a:alignIndx-strlen(a:theLine))
+
+        " add the right delim
+        return substitute(a:theLine, '$', extraSpaces . a:delim, '')
+    endif
+endfunction
+
+" Function: s:AltMultipart() {{{2
+" returns 1 if the alternative delims are multipart
+function s:AltMultipart()
+    return b:NERDCommenterDelims['rightAlt'] != ''
+endfunction
+
+" Function: s:CanCommentLine(forceNested, line) {{{2
+"This function is used to determine whether the given line can be commented.
+"It returns 1 if it can be and 0 otherwise
+"
+" Args:
+"   -forceNested: a flag indicating whether the caller wants comments to be nested
+"    if the current line is already commented
+"   -lineNum: the line num of the line to check for commentability
+function s:CanCommentLine(forceNested, lineNum)
+    let theLine = getline(a:lineNum)
+
+    " make sure we don't comment lines that are just spaces or tabs or empty.
+    if theLine =~ "^[ \t]*$"
+        return 0
+    endif
+
+    "if the line is part of a sexy comment then just flag it...
+    if s:IsInSexyComment(a:lineNum)
+        return 0
+    endif
+
+    let isCommented = s:IsCommentedNormOrSexy(a:lineNum)
+
+    "if the line isnt commented return true
+    if !isCommented
+        return 1
+    endif
+
+    "if the line is commented but nesting is allowed then return true
+    if a:forceNested && (!s:Multipart() || g:NERDUsePlaceHolders)
+        return 1
+    endif
+
+    return 0
+endfunction
+
+" Function: s:CanPlaceCursor(line, col) {{{2
+" returns 1 if the cursor can be placed exactly in the given position
+function s:CanPlaceCursor(line, col)
+    let c = col(".")
+    let l = line(".")
+    call cursor(a:line, a:col)
+    let success = (line(".") == a:line && col(".") == a:col)
+    call cursor(l,c)
+    return success
+endfunction
+
+" Function: s:CanSexyCommentLines(topline, bottomline) {{{2
+" Return: 1 if the given lines can be commented sexually, 0 otherwise
+function s:CanSexyCommentLines(topline, bottomline)
+    " see if the selected regions have any sexy comments
+    let currentLine = a:topline
+    while(currentLine <= a:bottomline)
+        if s:IsInSexyComment(currentLine)
+            return 0
+        endif
+        let currentLine = currentLine + 1
+    endwhile
+    return 1
+endfunction
+" Function: s:CanToggleCommentLine(forceNested, line) {{{2
+"This function is used to determine whether the given line can be toggle commented.
+"It returns 1 if it can be and 0 otherwise
+"
+" Args:
+"   -lineNum: the line num of the line to check for commentability
+function s:CanToggleCommentLine(forceNested, lineNum)
+    let theLine = getline(a:lineNum)
+    if (s:IsCommentedFromStartOfLine(s:Left(), theLine) || s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)) && !a:forceNested
+        return 0
+    endif
+
+    " make sure we don't comment lines that are just spaces or tabs or empty.
+    if theLine =~ "^[ \t]*$"
+        return 0
+    endif
+
+    "if the line is part of a sexy comment then just flag it...
+    if s:IsInSexyComment(a:lineNum)
+        return 0
+    endif
+
+    return 1
+endfunction
+
+" Function: s:ConvertLeadingSpacesToTabs(line) {{{2
+" This function takes a line and converts all leading tabs on that line into
+" spaces
+"
+" Args:
+"   -line: the line whose leading tabs will be converted
+function s:ConvertLeadingSpacesToTabs(line)
+    let toReturn  = a:line
+    while toReturn =~ '^\t*' . s:TabSpace() . '\(.*\)$'
+        let toReturn = substitute(toReturn, '^\(\t*\)' . s:TabSpace() . '\(.*\)$'  ,  '\1\t\2' , "")
+    endwhile
+
+    return toReturn
+endfunction
+
+
+" Function: s:ConvertLeadingTabsToSpaces(line) {{{2
+" This function takes a line and converts all leading spaces on that line into
+" tabs
+"
+" Args:
+"   -line: the line whose leading spaces will be converted
+function s:ConvertLeadingTabsToSpaces(line)
+    let toReturn  = a:line
+    while toReturn =~ '^\( *\)\t'
+        let toReturn = substitute(toReturn, '^\( *\)\t',  '\1' . s:TabSpace() , "")
+    endwhile
+
+    return toReturn
+endfunction
+
+" Function: s:ConvertLeadingWhiteSpace(line) {{{2
+" Converts the leading white space to tabs/spaces depending on &ts
+"
+" Args:
+"   -line: the line to convert
+function s:ConvertLeadingWhiteSpace(line)
+    let toReturn = a:line
+    while toReturn =~ '^ *\t'
+        let toReturn = substitute(toReturn, '^ *\zs\t\ze', s:TabSpace(), "g")
+    endwhile
+
+    if !&expandtab
+        let toReturn = s:ConvertLeadingSpacesToTabs(toReturn)
+    endif
+
+    return toReturn
+endfunction
+
+
+" Function: s:CountNonESCedOccurances(str, searchstr, escChar) {{{2
+" This function counts the number of substrings contained in another string.
+" These substrings are only counted if they are not escaped with escChar
+" Args:
+"   -str: the string to look for searchstr in
+"   -searchstr: the substring to search for in str
+"   -escChar: the escape character which, when preceding an instance of
+"    searchstr, will cause it not to be counted
+function s:CountNonESCedOccurances(str, searchstr, escChar)
+    "get the index of the first occurrence of searchstr
+    let indx = stridx(a:str, a:searchstr)
+
+    "if there is an instance of searchstr in str process it
+    if indx != -1
+        "get the remainder of str after this instance of searchstr is removed
+        let lensearchstr = strlen(a:searchstr)
+        let strLeft = strpart(a:str, indx+lensearchstr)
+
+        "if this instance of searchstr is not escaped, add one to the count
+        "and recurse. If it is escaped, just recurse
+        if !s:IsEscaped(a:str, indx, a:escChar)
+            return 1 + s:CountNonESCedOccurances(strLeft, a:searchstr, a:escChar)
+        else
+            return s:CountNonESCedOccurances(strLeft, a:searchstr, a:escChar)
+        endif
+    endif
+endfunction
+" Function: s:DoesBlockHaveDelim(delim, top, bottom) {{{2
+" Returns 1 if the given block of lines has a delimiter (a:delim) in it
+" Args:
+"   -delim: the comment delimiter to check the block for
+"   -top: the top line number of the block
+"   -bottom: the bottom line number of the block
+function s:DoesBlockHaveDelim(delim, top, bottom)
+    let currentLine = a:top
+    while currentLine < a:bottom
+        let theline = getline(currentLine)
+        if s:FindDelimiterIndex(a:delim, theline) != -1
+            return 1
+        endif
+        let currentLine = currentLine + 1
+    endwhile
+    return 0
+endfunction
+
+" Function: s:DoesBlockHaveMultipartDelim(top, bottom) {{{2
+" Returns 1 if the given block has a >= 1 multipart delimiter in it
+" Args:
+"   -top: the top line number of the block
+"   -bottom: the bottom line number of the block
+function s:DoesBlockHaveMultipartDelim(top, bottom)
+    if s:HasMultipartDelims()
+        if s:Multipart()
+            return s:DoesBlockHaveDelim(s:Left(), a:top, a:bottom) || s:DoesBlockHaveDelim(s:Right(), a:top, a:bottom)
+        else
+            return s:DoesBlockHaveDelim(s:Left({'alt': 1}), a:top, a:bottom) || s:DoesBlockHaveDelim(s:Right({'alt': 1}), a:top, a:bottom)
+        endif
+    endif
+    return 0
+endfunction
+
+
+" Function: s:Esc(str) {{{2
+" Escapes all the tricky chars in the given string
+function s:Esc(str)
+    let charsToEsc = '*/\."&$+'
+    return escape(a:str, charsToEsc)
+endfunction
+
+" Function: s:FindDelimiterIndex(delimiter, line) {{{2
+" This function is used to get the string index of the input comment delimiter
+" on the input line. If no valid comment delimiter is found in the line then
+" -1 is returned
+" Args:
+"   -delimiter: the delimiter we are looking to find the index of
+"   -line: the line we are looking for delimiter on
+function s:FindDelimiterIndex(delimiter, line)
+
+    "make sure the delimiter isnt empty otherwise we go into an infinite loop.
+    if a:delimiter == ""
+        return -1
+    endif
+
+
+    let l:delimiter = a:delimiter
+    let lenDel = strlen(l:delimiter)
+
+    "get the index of the first occurrence of the delimiter
+    let delIndx = stridx(a:line, l:delimiter)
+
+    "keep looping thru the line till we either find a real comment delimiter
+    "or run off the EOL
+    while delIndx != -1
+
+        "if we are not off the EOL get the str before the possible delimiter
+        "in question and check if it really is a delimiter. If it is, return
+        "its position
+        if delIndx != -1
+            if s:IsDelimValid(l:delimiter, delIndx, a:line)
+                return delIndx
+            endif
+        endif
+
+        "we have not yet found a real comment delimiter so move past the
+        "current one we are lookin at
+        let restOfLine = strpart(a:line, delIndx + lenDel)
+        let distToNextDelim = stridx(restOfLine , l:delimiter)
+
+        "if distToNextDelim is -1 then there is no more potential delimiters
+        "on the line so set delIndx to -1. Otherwise, move along the line by
+        "distToNextDelim
+        if distToNextDelim == -1
+            let delIndx = -1
+        else
+            let delIndx = delIndx + lenDel + distToNextDelim
+        endif
+    endwhile
+
+    "there is no comment delimiter on this line
+    return -1
+endfunction
+
+" Function: s:FindBoundingLinesOfSexyCom(lineNum) {{{2
+" This function takes in a line number and tests whether this line number is
+" the top/bottom/middle line of a sexy comment. If it is then the top/bottom
+" lines of the sexy comment are returned
+" Args:
+"   -lineNum: the line number that is to be tested whether it is the
+"    top/bottom/middle line of a sexy com
+" Returns:
+"   A string that has the top/bottom lines of the sexy comment encoded in it.
+"   The format is 'topline,bottomline'. If a:lineNum turns out not to be the
+"   top/bottom/middle of a sexy comment then -1 is returned
+function s:FindBoundingLinesOfSexyCom(lineNum)
+
+    "find which delimiters to look for as the start/end delims of the comment
+    let left = ''
+    let right = ''
+    if s:Multipart()
+        let left = s:Left({'esc': 1})
+        let right = s:Right({'esc': 1})
+    elseif s:AltMultipart()
+        let left = s:Left({'alt': 1, 'esc': 1})
+        let right = s:Right({'alt': 1, 'esc': 1})
+    else
+        return []
+    endif
+
+    let sexyComMarker = s:GetSexyComMarker(0, 1)
+
+    "initialise the top/bottom line numbers of the sexy comment to -1
+    let top = -1
+    let bottom = -1
+
+    let currentLine = a:lineNum
+    while top == -1 || bottom == -1
+        let theLine = getline(currentLine)
+
+        "check if the current line is the top of the sexy comment
+        if currentLine <= a:lineNum && theLine =~ '^[ \t]*' . left && theLine !~ '.*' . right && currentLine < s:NumLinesInBuf()
+            let top = currentLine
+            let currentLine = a:lineNum
+
+        "check if the current line is the bottom of the sexy comment
+        elseif theLine =~ '^[ \t]*' . right && theLine !~ '.*' . left && currentLine > 1
+            let bottom = currentLine
+
+        "the right delimiter is on the same line as the last sexyComMarker
+        elseif theLine =~ '^[ \t]*' . sexyComMarker . '.*' . right
+            let bottom = currentLine
+
+        "we have not found the top or bottom line so we assume currentLine is an
+        "intermediate line and look to prove otherwise
+        else
+
+            "if the line doesnt start with a sexyComMarker then it is not a sexy
+            "comment
+            if theLine !~ '^[ \t]*' . sexyComMarker
+                return []
+            endif
+
+        endif
+
+        "if top is -1 then we havent found the top yet so keep looking up
+        if top == -1
+            let currentLine = currentLine - 1
+        "if we have found the top line then go down looking for the bottom
+        else
+            let currentLine = currentLine + 1
+        endif
+
+    endwhile
+
+    return [top, bottom]
+endfunction
+
+
+" Function: s:GetSexyComMarker() {{{2
+" Returns the sexy comment marker for the current filetype.
+"
+" C style sexy comments are assumed if possible. If not then the sexy comment
+" marker is the last char of the delimiter pair that has both left and right
+" delims and has the longest left delim
+"
+" Args:
+"   -space: specifies whether the marker is to have a space string after it
+"    (the space string will only be added if NERDSpaceDelims is set)
+"   -esc: specifies whether the tricky chars in the marker are to be ESCed
+function s:GetSexyComMarker(space, esc)
+    let sexyComMarker = b:NERDSexyComMarker
+
+    "if there is no hardcoded marker then we find one
+    if sexyComMarker == ''
+
+        "if the filetype has c style comments then use standard c sexy
+        "comments
+        if s:HasCStyleComments()
+            let sexyComMarker = '*'
+        else
+            "find a comment marker by getting the longest available left delim
+            "(that has a corresponding right delim) and taking the last char
+            let lenLeft = strlen(s:Left())
+            let lenLeftAlt = strlen(s:Left({'alt': 1}))
+            let left = ''
+            let right = ''
+            if s:Multipart() && lenLeft >= lenLeftAlt
+                let left = s:Left()
+            elseif s:AltMultipart()
+                let left = s:Left({'alt': 1})
+            else
+                return -1
+            endif
+
+            "get the last char of left
+            let sexyComMarker = strpart(left, strlen(left)-1)
+        endif
+    endif
+
+    if a:space && g:NERDSpaceDelims
+        let sexyComMarker = sexyComMarker . s:spaceStr
+    endif
+
+    if a:esc
+        let sexyComMarker = s:Esc(sexyComMarker)
+    endif
+
+    return sexyComMarker
+endfunction
+
+" Function: s:GetSexyComLeft(space, esc) {{{2
+" Returns the left delimiter for sexy comments for this filetype or -1 if
+" there is none. C style sexy comments are used if possible
+" Args:
+"   -space: specifies if the delim has a space string on the end
+"   (the space string will only be added if NERDSpaceDelims is set)
+"   -esc: specifies whether the tricky chars in the string are ESCed
+function s:GetSexyComLeft(space, esc)
+    let lenLeft = strlen(s:Left())
+    let lenLeftAlt = strlen(s:Left({'alt': 1}))
+    let left = ''
+
+    "assume c style sexy comments if possible
+    if s:HasCStyleComments()
+        let left = '/*'
+    else
+        "grab the longest left delim that has a right
+        if s:Multipart() && lenLeft >= lenLeftAlt
+            let left = s:Left()
+        elseif s:AltMultipart()
+            let left = s:Left({'alt': 1})
+        else
+            return -1
+        endif
+    endif
+
+    if a:space && g:NERDSpaceDelims
+        let left = left . s:spaceStr
+    endif
+
+    if a:esc
+        let left = s:Esc(left)
+    endif
+
+    return left
+endfunction
+
+" Function: s:GetSexyComRight(space, esc) {{{2
+" Returns the right delimiter for sexy comments for this filetype or -1 if
+" there is none. C style sexy comments are used if possible.
+" Args:
+"   -space: specifies if the delim has a space string on the start
+"   (the space string will only be added if NERDSpaceDelims
+"   is specified for the current filetype)
+"   -esc: specifies whether the tricky chars in the string are ESCed
+function s:GetSexyComRight(space, esc)
+    let lenLeft = strlen(s:Left())
+    let lenLeftAlt = strlen(s:Left({'alt': 1}))
+    let right = ''
+
+    "assume c style sexy comments if possible
+    if s:HasCStyleComments()
+        let right = '*/'
+    else
+        "grab the right delim that pairs with the longest left delim
+        if s:Multipart() && lenLeft >= lenLeftAlt
+            let right = s:Right()
+        elseif s:AltMultipart()
+            let right = s:Right({'alt': 1})
+        else
+            return -1
+        endif
+    endif
+
+    if a:space && g:NERDSpaceDelims
+        let right = s:spaceStr . right
+    endif
+
+    if a:esc
+        let right = s:Esc(right)
+    endif
+
+    return right
+endfunction
+
+" Function: s:HasMultipartDelims() {{{2
+" Returns 1 iff the current filetype has at least one set of multipart delims
+function s:HasMultipartDelims()
+    return s:Multipart() || s:AltMultipart()
+endfunction
+
+" Function: s:HasLeadingTabs(...) {{{2
+" Returns 1 if any of the given strings have leading tabs
+function s:HasLeadingTabs(...)
+    for s in a:000
+        if s =~ '^\t.*'
+            return 1
+        end
+    endfor
+    return 0
+endfunction
+" Function: s:HasCStyleComments() {{{2
+" Returns 1 iff the current filetype has c style comment delimiters
+function s:HasCStyleComments()
+    return (s:Left() == '/*' && s:Right() == '*/') || (s:Left({'alt': 1}) == '/*' && s:Right({'alt': 1}) == '*/')
+endfunction
+
+" Function: s:IsCommentedNormOrSexy(lineNum) {{{2
+"This function is used to determine whether the given line is commented with
+"either set of delimiters or if it is part of a sexy comment
+"
+" Args:
+"   -lineNum: the line number of the line to check
+function s:IsCommentedNormOrSexy(lineNum)
+    let theLine = getline(a:lineNum)
+
+    "if the line is commented normally return 1
+    if s:IsCommented(s:Left(), s:Right(), theLine) || s:IsCommented(s:Left({'alt': 1}), s:Right({'alt': 1}), theLine)
+        return 1
+    endif
+
+    "if the line is part of a sexy comment return 1
+    if s:IsInSexyComment(a:lineNum)
+        return 1
+    endif
+    return 0
+endfunction
+
+" Function: s:IsCommented(left, right, line) {{{2
+"This function is used to determine whether the given line is commented with
+"the given delimiters
+"
+" Args:
+"   -line: the line that to check if commented
+"   -left/right: the left and right delimiters to check for
+function s:IsCommented(left, right, line)
+    "if the line isnt commented return true
+    if s:FindDelimiterIndex(a:left, a:line) != -1 && (s:FindDelimiterIndex(a:right, a:line) != -1 || !s:Multipart())
+        return 1
+    endif
+    return 0
+endfunction
+
+" Function: s:IsCommentedFromStartOfLine(left, line) {{{2
+"This function is used to determine whether the given line is commented with
+"the given delimiters at the start of the line i.e the left delimiter is the
+"first thing on the line (apart from spaces\tabs)
+"
+" Args:
+"   -line: the line that to check if commented
+"   -left: the left delimiter to check for
+function s:IsCommentedFromStartOfLine(left, line)
+    let theLine = s:ConvertLeadingTabsToSpaces(a:line)
+    let numSpaces = strlen(substitute(theLine, '^\( *\).*$', '\1', ''))
+    let delimIndx = s:FindDelimiterIndex(a:left, theLine)
+    return delimIndx == numSpaces
+endfunction
+
+" Function: s:IsCommentedOuttermost(left, right, leftAlt, rightAlt, line) {{{2
+" Finds the type of the outtermost delims on the line
+"
+" Args:
+"   -line: the line that to check if the outtermost comments on it are
+"    left/right
+"   -left/right: the left and right delimiters to check for
+"   -leftAlt/rightAlt: the left and right alternative delimiters to check for
+"
+" Returns:
+"   0 if the line is not commented with either set of delims
+"   1 if the line is commented with the left/right delim set
+"   2 if the line is commented with the leftAlt/rightAlt delim set
+function s:IsCommentedOuttermost(left, right, leftAlt, rightAlt, line)
+    "get the first positions of the left delims and the last positions of the
+    "right delims
+    let indxLeft = s:FindDelimiterIndex(a:left, a:line)
+    let indxLeftAlt = s:FindDelimiterIndex(a:leftAlt, a:line)
+    let indxRight = s:LastIndexOfDelim(a:right, a:line)
+    let indxRightAlt = s:LastIndexOfDelim(a:rightAlt, a:line)
+
+    "check if the line has a left delim before a leftAlt delim
+    if (indxLeft <= indxLeftAlt || indxLeftAlt == -1) && indxLeft != -1
+        "check if the line has a right delim after any rightAlt delim
+        if (indxRight > indxRightAlt && indxRight > indxLeft) || !s:Multipart()
+            return 1
+        endif
+
+        "check if the line has a leftAlt delim before a left delim
+    elseif (indxLeftAlt <= indxLeft || indxLeft == -1) && indxLeftAlt != -1
+        "check if the line has a rightAlt delim after any right delim
+        if (indxRightAlt > indxRight && indxRightAlt > indxLeftAlt) || !s:AltMultipart()
+            return 2
+        endif
+    else
+        return 0
+    endif
+
+    return 0
+
+endfunction
+
+
+" Function: s:IsDelimValid(delimiter, delIndx, line) {{{2
+" This function is responsible for determining whether a given instance of a
+" comment delimiter is a real delimiter or not. For example, in java the
+" // string is a comment delimiter but in the line:
+"               System.out.println("//");
+" it does not count as a comment delimiter. This function is responsible for
+" distinguishing between such cases. It does so by applying a set of
+" heuristics that are not fool proof but should work most of the time.
+"
+" Args:
+"   -delimiter: the delimiter we are validating
+"   -delIndx: the position of delimiter in line
+"   -line: the line that delimiter occurs in
+"
+" Returns:
+" 0 if the given delimiter is not a real delimiter (as far as we can tell) ,
+" 1 otherwise
+function s:IsDelimValid(delimiter, delIndx, line)
+    "get the delimiter without the escchars
+    let l:delimiter = a:delimiter
+
+    "get the strings before and after the delimiter
+    let preComStr = strpart(a:line, 0, a:delIndx)
+    let postComStr = strpart(a:line, a:delIndx+strlen(delimiter))
+
+    "to check if the delimiter is real, make sure it isnt preceded by
+    "an odd number of quotes and followed by the same (which would indicate
+    "that it is part of a string and therefore is not a comment)
+    if !s:IsNumEven(s:CountNonESCedOccurances(preComStr, '"', "\\")) && !s:IsNumEven(s:CountNonESCedOccurances(postComStr, '"', "\\"))
+        return 0
+    endif
+    if !s:IsNumEven(s:CountNonESCedOccurances(preComStr, "'", "\\")) && !s:IsNumEven(s:CountNonESCedOccurances(postComStr, "'", "\\"))
+        return 0
+    endif
+    if !s:IsNumEven(s:CountNonESCedOccurances(preComStr, "`", "\\")) && !s:IsNumEven(s:CountNonESCedOccurances(postComStr, "`", "\\"))
+        return 0
+    endif
+
+
+    "if the comment delimiter is escaped, assume it isnt a real delimiter
+    if s:IsEscaped(a:line, a:delIndx, "\\")
+        return 0
+    endif
+
+    "vim comments are so fuckin stupid!! Why the hell do they have comment
+    "delimiters that are used elsewhere in the syntax?!?! We need to check
+    "some conditions especially for vim
+    if &filetype == "vim"
+        if !s:IsNumEven(s:CountNonESCedOccurances(preComStr, '"', "\\"))
+            return 0
+        endif
+
+        "if the delimiter is on the very first char of the line or is the
+        "first non-tab/space char on the line then it is a valid comment delimiter
+        if a:delIndx == 0 || a:line =~ "^[ \t]\\{" . a:delIndx . "\\}\".*$"
+            return 1
+        endif
+
+        let numLeftParen =s:CountNonESCedOccurances(preComStr, "(", "\\")
+        let numRightParen =s:CountNonESCedOccurances(preComStr, ")", "\\")
+
+        "if the quote is inside brackets then assume it isnt a comment
+        if numLeftParen > numRightParen
+            return 0
+        endif
+
+        "if the line has an even num of unescaped "'s then we can assume that
+        "any given " is not a comment delimiter
+        if s:IsNumEven(s:CountNonESCedOccurances(a:line, "\"", "\\"))
+            return 0
+        endif
+    endif
+
+    return 1
+
+endfunction
+
+" Function: s:IsNumEven(num) {{{2
+" A small function the returns 1 if the input number is even and 0 otherwise
+" Args:
+"   -num: the number to check
+function s:IsNumEven(num)
+    return (a:num % 2) == 0
+endfunction
+
+" Function: s:IsEscaped(str, indx, escChar) {{{2
+" This function takes a string, an index into that string and an esc char and
+" returns 1 if the char at the index is escaped (i.e if it is preceded by an
+" odd number of esc chars)
+" Args:
+"   -str: the string to check
+"   -indx: the index into str that we want to check
+"   -escChar: the escape char the char at indx may be ESCed with
+function s:IsEscaped(str, indx, escChar)
+    "initialise numEscChars to 0 and look at the char before indx
+    let numEscChars = 0
+    let curIndx = a:indx-1
+
+    "keep going back thru str until we either reach the start of the str or
+    "run out of esc chars
+    while curIndx >= 0 && strpart(a:str, curIndx, 1) == a:escChar
+
+        "we have found another esc char so add one to the count and move left
+        "one char
+        let numEscChars  = numEscChars + 1
+        let curIndx = curIndx - 1
+
+    endwhile
+
+    "if there is an odd num of esc chars directly before the char at indx then
+    "the char at indx is escaped
+    return !s:IsNumEven(numEscChars)
+endfunction
+
+" Function: s:IsInSexyComment(line) {{{2
+" returns 1 if the given line number is part of a sexy comment
+function s:IsInSexyComment(line)
+    return !empty(s:FindBoundingLinesOfSexyCom(a:line))
+endfunction
+
+" Function: s:IsSexyComment(topline, bottomline) {{{2
+" This function takes in 2 line numbers and returns 1 if the lines between and
+" including the given line numbers are a sexy comment. It returns 0 otherwise.
+" Args:
+"   -topline: the line that the possible sexy comment starts on
+"   -bottomline: the line that the possible sexy comment stops on
+function s:IsSexyComment(topline, bottomline)
+
+    "get the delim set that would be used for a sexy comment
+    let left = ''
+    let right = ''
+    if s:Multipart()
+        let left = s:Left()
+        let right = s:Right()
+    elseif s:AltMultipart()
+        let left = s:Left({'alt': 1})
+        let right = s:Right({'alt': 1})
+    else
+        return 0
+    endif
+
+    "swap the top and bottom line numbers around if need be
+    let topline = a:topline
+    let bottomline = a:bottomline
+    if bottomline < topline
+        topline = bottomline
+        bottomline = a:topline
+    endif
+
+    "if there is < 2 lines in the comment it cannot be sexy
+    if (bottomline - topline) <= 0
+        return 0
+    endif
+
+    "if the top line doesnt begin with a left delim then the comment isnt sexy
+    if getline(a:topline) !~ '^[ \t]*' . left
+        return 0
+    endif
+
+    "if there is a right delim on the top line then this isnt a sexy comment
+    if s:FindDelimiterIndex(right, getline(a:topline)) != -1
+        return 0
+    endif
+
+    "if there is a left delim on the bottom line then this isnt a sexy comment
+    if s:FindDelimiterIndex(left, getline(a:bottomline)) != -1
+        return 0
+    endif
+
+    "if the bottom line doesnt begin with a right delim then the comment isnt
+    "sexy
+    if getline(a:bottomline) !~ '^.*' . right . '$'
+        return 0
+    endif
+
+    let sexyComMarker = s:GetSexyComMarker(0, 1)
+
+    "check each of the intermediate lines to make sure they start with a
+    "sexyComMarker
+    let currentLine = a:topline+1
+    while currentLine < a:bottomline
+        let theLine = getline(currentLine)
+
+        if theLine !~ '^[ \t]*' . sexyComMarker
+            return 0
+        endif
+
+        "if there is a right delim in an intermediate line then the block isnt
+        "a sexy comment
+        if s:FindDelimiterIndex(right, theLine) != -1
+            return 0
+        endif
+
+        let currentLine = currentLine + 1
+    endwhile
+
+    "we have not found anything to suggest that this isnt a sexy comment so
+    return 1
+
+endfunction
+
+" Function: s:LastIndexOfDelim(delim, str) {{{2
+" This function takes a string and a delimiter and returns the last index of
+" that delimiter in string
+" Args:
+"   -delim: the delimiter to look for
+"   -str: the string to look for delim in
+function s:LastIndexOfDelim(delim, str)
+    let delim = a:delim
+    let lenDelim = strlen(delim)
+
+    "set index to the first occurrence of delim. If there is no occurrence then
+    "bail
+    let indx = s:FindDelimiterIndex(delim, a:str)
+    if indx == -1
+        return -1
+    endif
+
+    "keep moving to the next instance of delim in str till there is none left
+    while 1
+
+        "search for the next delim after the previous one
+        let searchStr = strpart(a:str, indx+lenDelim)
+        let indx2 = s:FindDelimiterIndex(delim, searchStr)
+
+        "if we find a delim update indx to record the position of it, if we
+        "dont find another delim then indx is the last one so break out of
+        "this loop
+        if indx2 != -1
+            let indx = indx + indx2 + lenDelim
+        else
+            break
+        endif
+    endwhile
+
+    return indx
+
+endfunction
+
+" Function: s:Left(...) {{{2
+" returns left delimiter data
+function s:Left(...)
+    let params = a:0 ? a:1 : {}
+
+    let delim = has_key(params, 'alt') ? b:NERDCommenterDelims['leftAlt'] : b:NERDCommenterDelims['left'] 
+
+    if delim == ''
+        return ''
+    endif
+
+    if has_key(params, 'space') && g:NERDSpaceDelims
+        let delim = delim . s:spaceStr
+    endif
+
+    if has_key(params, 'esc')
+        let delim = s:Esc(delim)
+    endif
+
+    return delim
+endfunction
+
+" Function: s:LeftMostIndx(countCommentedLines, countEmptyLines, topline, bottomline) {{{2
+" This function takes in 2 line numbers and returns the index of the left most
+" char (that is not a space or a tab) on all of these lines.
+" Args:
+"   -countCommentedLines: 1 if lines that are commented are to be checked as
+"    well. 0 otherwise
+"   -countEmptyLines: 1 if empty lines are to be counted in the search
+"   -topline: the top line to be checked
+"   -bottomline: the bottom line to be checked
+function s:LeftMostIndx(countCommentedLines, countEmptyLines, topline, bottomline)
+
+    " declare the left most index as an extreme value
+    let leftMostIndx = 1000
+
+    " go thru the block line by line updating leftMostIndx
+    let currentLine = a:topline
+    while currentLine <= a:bottomline
+
+        " get the next line and if it is allowed to be commented, or is not
+        " commented, check it
+        let theLine = getline(currentLine)
+        if a:countEmptyLines || theLine !~ '^[ \t]*$'
+            if a:countCommentedLines || (!s:IsCommented(s:Left(), s:Right(), theLine) && !s:IsCommented(s:Left({'alt': 1}), s:Right({'alt': 1}), theLine))
+                " convert spaces to tabs and get the number of leading spaces for
+                " this line and update leftMostIndx if need be
+                let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+                let leadSpaceOfLine = strlen( substitute(theLine, '\(^[ \t]*\).*$','\1','') )
+                if leadSpaceOfLine < leftMostIndx
+                    let leftMostIndx = leadSpaceOfLine
+                endif
+            endif
+        endif
+
+        " move on to the next line
+        let currentLine = currentLine + 1
+    endwhile
+
+    if leftMostIndx == 1000
+        return 0
+    else
+        return leftMostIndx
+    endif
+endfunction
+
+" Function: s:Multipart() {{{2
+" returns 1 if the current delims are multipart
+function s:Multipart()
+    return s:Right() != ''
+endfunction
+
+" Function: s:NerdEcho(msg, typeOfMsg) {{{2
+" Args:
+"   -msg: the message to echo
+"   -typeOfMsg: 0 = warning message
+"               1 = normal message
+function s:NerdEcho(msg, typeOfMsg)
+    if a:typeOfMsg == 0
+        echohl WarningMsg
+        echom 'NERDCommenter:' . a:msg
+        echohl None
+    elseif a:typeOfMsg == 1
+        echom 'NERDCommenter:' . a:msg
+    endif
+endfunction
+
+" Function: s:NumberOfLeadingTabs(s) {{{2
+" returns the number of leading tabs in the given string
+function s:NumberOfLeadingTabs(s)
+    return strlen(substitute(a:s, '^\(\t*\).*$', '\1', ""))
+endfunction
+
+" Function: s:NumLinesInBuf() {{{2
+" Returns the number of lines in the current buffer
+function s:NumLinesInBuf()
+    return line('$')
+endfunction
+
+" Function: s:ReplaceDelims(toReplace1, toReplace2, replacor1, replacor2, str) {{{2
+" This function takes in a string, 2 delimiters in that string and 2 strings
+" to replace these delimiters with.
+"
+" Args:
+"   -toReplace1: the first delimiter to replace
+"   -toReplace2: the second delimiter to replace
+"   -replacor1: the string to replace toReplace1 with
+"   -replacor2: the string to replace toReplace2 with
+"   -str: the string that the delimiters to be replaced are in
+function s:ReplaceDelims(toReplace1, toReplace2, replacor1, replacor2, str)
+    let line = s:ReplaceLeftMostDelim(a:toReplace1, a:replacor1, a:str)
+    let line = s:ReplaceRightMostDelim(a:toReplace2, a:replacor2, line)
+    return line
+endfunction
+
+" Function: s:ReplaceLeftMostDelim(toReplace, replacor, str) {{{2
+" This function takes a string and a delimiter and replaces the left most
+" occurrence of this delimiter in the string with a given string
+"
+" Args:
+"   -toReplace: the delimiter in str that is to be replaced
+"   -replacor: the string to replace toReplace with
+"   -str: the string that contains toReplace
+function s:ReplaceLeftMostDelim(toReplace, replacor, str)
+    let toReplace = a:toReplace
+    let replacor = a:replacor
+    "get the left most occurrence of toReplace
+    let indxToReplace = s:FindDelimiterIndex(toReplace, a:str)
+
+    "if there IS an occurrence of toReplace in str then replace it and return
+    "the resulting string
+    if indxToReplace != -1
+        let line = strpart(a:str, 0, indxToReplace) . replacor . strpart(a:str, indxToReplace+strlen(toReplace))
+        return line
+    endif
+
+    return a:str
+endfunction
+
+" Function: s:ReplaceRightMostDelim(toReplace, replacor, str) {{{2
+" This function takes a string and a delimiter and replaces the right most
+" occurrence of this delimiter in the string with a given string
+"
+" Args:
+"   -toReplace: the delimiter in str that is to be replaced
+"   -replacor: the string to replace toReplace with
+"   -str: the string that contains toReplace
+"
+function s:ReplaceRightMostDelim(toReplace, replacor, str)
+    let toReplace = a:toReplace
+    let replacor = a:replacor
+    let lenToReplace = strlen(toReplace)
+
+    "get the index of the last delim in str
+    let indxToReplace = s:LastIndexOfDelim(toReplace, a:str)
+
+    "if there IS a delimiter in str, replace it and return the result
+    let line = a:str
+    if indxToReplace != -1
+        let line = strpart(a:str, 0, indxToReplace) . replacor . strpart(a:str, indxToReplace+strlen(toReplace))
+    endif
+    return line
+endfunction
+
+"FUNCTION: s:RestoreScreenState() {{{2
+"
+"Sets the screen state back to what it was when s:SaveScreenState was last
+"called.
+"
+function s:RestoreScreenState()
+    if !exists("t:NERDComOldTopLine") || !exists("t:NERDComOldPos")
+        throw 'NERDCommenter exception: cannot restore screen'
+    endif
+
+    call cursor(t:NERDComOldTopLine, 0)
+    normal! zt
+    call setpos(".", t:NERDComOldPos)
+endfunction
+
+" Function: s:Right(...) {{{2
+" returns right delimiter data
+function s:Right(...)
+    let params = a:0 ? a:1 : {}
+
+    let delim = has_key(params, 'alt') ? b:NERDCommenterDelims['rightAlt'] : b:NERDCommenterDelims['right'] 
+
+    if delim == ''
+        return ''
+    endif
+
+    if has_key(params, 'space') && g:NERDSpaceDelims
+        let delim = s:spaceStr . delim
+    endif
+
+    if has_key(params, 'esc')
+        let delim = s:Esc(delim)
+    endif
+
+    return delim
+endfunction
+
+" Function: s:RightMostIndx(countCommentedLines, countEmptyLines, topline, bottomline) {{{2
+" This function takes in 2 line numbers and returns the index of the right most
+" char on all of these lines.
+" Args:
+"   -countCommentedLines: 1 if lines that are commented are to be checked as
+"    well. 0 otherwise
+"   -countEmptyLines: 1 if empty lines are to be counted in the search
+"   -topline: the top line to be checked
+"   -bottomline: the bottom line to be checked
+function s:RightMostIndx(countCommentedLines, countEmptyLines, topline, bottomline)
+    let rightMostIndx = -1
+
+    " go thru the block line by line updating rightMostIndx
+    let currentLine = a:topline
+    while currentLine <= a:bottomline
+
+        " get the next line and see if it is commentable, otherwise it doesnt
+        " count
+        let theLine = getline(currentLine)
+        if a:countEmptyLines || theLine !~ '^[ \t]*$'
+
+            if a:countCommentedLines || (!s:IsCommented(s:Left(), s:Right(), theLine) && !s:IsCommented(s:Left({'alt': 1}), s:Right({'alt': 1}), theLine))
+
+                " update rightMostIndx if need be
+                let theLine = s:ConvertLeadingTabsToSpaces(theLine)
+                let lineLen = strlen(theLine)
+                if lineLen > rightMostIndx
+                    let rightMostIndx = lineLen
+                endif
+            endif
+        endif
+
+        " move on to the next line
+        let currentLine = currentLine + 1
+    endwhile
+
+    return rightMostIndx
+endfunction
+
+"FUNCTION: s:SaveScreenState() {{{2
+"Saves the current cursor position in the current buffer and the window
+"scroll position
+function s:SaveScreenState()
+    let t:NERDComOldPos = getpos(".")
+    let t:NERDComOldTopLine = line("w0")
+endfunction
+
+" Function: s:SwapOutterMultiPartDelimsForPlaceHolders(line) {{{2
+" This function takes a line and swaps the outter most multi-part delims for
+" place holders
+" Args:
+"   -line: the line to swap the delims in
+"
+function s:SwapOutterMultiPartDelimsForPlaceHolders(line)
+    " find out if the line is commented using normal delims and/or
+    " alternate ones
+    let isCommented = s:IsCommented(s:Left(), s:Right(), a:line)
+    let isCommentedAlt = s:IsCommented(s:Left({'alt': 1}), s:Right({'alt': 1}), a:line)
+
+    let line2 = a:line
+
+    "if the line is commented and there is a right delimiter, replace
+    "the delims with place-holders
+    if isCommented && s:Multipart()
+        let line2 = s:ReplaceDelims(s:Left(), s:Right(), g:NERDLPlace, g:NERDRPlace, a:line)
+
+    "similarly if the line is commented with the alternative
+    "delimiters
+    elseif isCommentedAlt && s:AltMultipart()
+        let line2 = s:ReplaceDelims(s:Left({'alt': 1}), s:Right({'alt': 1}), g:NERDLPlace, g:NERDRPlace, a:line)
+    endif
+
+    return line2
+endfunction
+
+" Function: s:SwapOutterPlaceHoldersForMultiPartDelims(line) {{{2
+" This function takes a line and swaps the outtermost place holders for
+" multi-part delims
+" Args:
+"   -line: the line to swap the delims in
+"
+function s:SwapOutterPlaceHoldersForMultiPartDelims(line)
+    let left = ''
+    let right = ''
+    if s:Multipart()
+        let left = s:Left()
+        let right = s:Right()
+    elseif s:AltMultipart()
+        let left = s:Left({'alt': 1})
+        let right = s:Right({'alt': 1})
+    endif
+
+    let line = s:ReplaceDelims(g:NERDLPlace, g:NERDRPlace, left, right, a:line)
+    return line
+endfunction
+" Function: s:TabbedCol(line, col) {{{2
+" Gets the col number for given line and existing col number. The new col
+" number is the col number when all leading spaces are converted to tabs
+" Args:
+"   -line:the line to get the rel col for
+"   -col: the abs col
+function s:TabbedCol(line, col)
+    let lineTruncated = strpart(a:line, 0, a:col)
+    let lineSpacesToTabs = substitute(lineTruncated, s:TabSpace(), '\t', 'g')
+    return strlen(lineSpacesToTabs)
+endfunction
+"FUNCTION: s:TabSpace() {{{2
+"returns a string of spaces equal in length to &tabstop
+function s:TabSpace()
+    let tabSpace = ""
+    let spacesPerTab = &tabstop
+    while spacesPerTab > 0
+        let tabSpace = tabSpace . " "
+        let spacesPerTab = spacesPerTab - 1
+    endwhile
+    return tabSpace
+endfunction
+
+" Function: s:UnEsc(str, escChar) {{{2
+" This function removes all the escape chars from a string
+" Args:
+"   -str: the string to remove esc chars from
+"   -escChar: the escape char to be removed
+function s:UnEsc(str, escChar)
+    return substitute(a:str, a:escChar, "", "g")
+endfunction
+
+" Function: s:UntabbedCol(line, col) {{{2
+" Takes a line and a col and returns the absolute column of col taking into
+" account that a tab is worth 3 or 4 (or whatever) spaces.
+" Args:
+"   -line:the line to get the abs col for
+"   -col: the col that doesnt take into account tabs
+function s:UntabbedCol(line, col)
+    let lineTruncated = strpart(a:line, 0, a:col)
+    let lineTabsToSpaces = substitute(lineTruncated, '\t', s:TabSpace(), 'g')
+    return strlen(lineTabsToSpaces)
+endfunction
+" Section: Comment mapping setup {{{1
+" ===========================================================================
+
+" switch to/from alternative delimiters
+nnoremap <plug>NERDCommenterAltDelims :call <SID>SwitchToAlternativeDelimiters(1)<cr>
+
+" comment out lines
+nnoremap <silent> <plug>NERDCommenterComment :call NERDComment(0, "norm")<cr>
+vnoremap <silent> <plug>NERDCommenterComment <ESC>:call NERDComment(1, "norm")<cr>
+
+" toggle comments
+nnoremap <silent> <plug>NERDCommenterToggle :call NERDComment(0, "toggle")<cr>
+vnoremap <silent> <plug>NERDCommenterToggle <ESC>:call NERDComment(1, "toggle")<cr>
+
+" minimal comments
+nnoremap <silent> <plug>NERDCommenterMinimal :call NERDComment(0, "minimal")<cr>
+vnoremap <silent> <plug>NERDCommenterMinimal <ESC>:call NERDComment(1, "minimal")<cr>
+
+" sexy comments
+nnoremap <silent> <plug>NERDCommenterSexy :call NERDComment(0, "sexy")<CR>
+vnoremap <silent> <plug>NERDCommenterSexy <ESC>:call NERDComment(1, "sexy")<CR>
+
+" invert comments
+nnoremap <silent> <plug>NERDCommenterInvert :call NERDComment(0, "invert")<CR>
+vnoremap <silent> <plug>NERDCommenterInvert <ESC>:call NERDComment(1, "invert")<CR>
+
+" yank then comment
+nmap <silent> <plug>NERDCommenterYank :call NERDComment(0, "yank")<CR>
+vmap <silent> <plug>NERDCommenterYank <ESC>:call NERDComment(1, "yank")<CR>
+
+" left aligned comments
+nnoremap <silent> <plug>NERDCommenterAlignLeft :call NERDComment(0, "alignLeft")<cr>
+vnoremap <silent> <plug>NERDCommenterAlignLeft <ESC>:call NERDComment(1, "alignLeft")<cr>
+
+" left and right aligned comments
+nnoremap <silent> <plug>NERDCommenterAlignBoth :call NERDComment(0, "alignBoth")<cr>
+vnoremap <silent> <plug>NERDCommenterAlignBoth <ESC>:call NERDComment(1, "alignBoth")<cr>
+
+" nested comments
+nnoremap <silent> <plug>NERDCommenterNest :call NERDComment(0, "nested")<cr>
+vnoremap <silent> <plug>NERDCommenterNest <ESC>:call NERDComment(1, "nested")<cr>
+
+" uncomment
+nnoremap <silent> <plug>NERDCommenterUncomment :call NERDComment(0, "uncomment")<cr>
+vnoremap <silent> <plug>NERDCommenterUncomment :call NERDComment(1, "uncomment")<cr>
+
+" comment till the end of the line
+nnoremap <silent> <plug>NERDCommenterToEOL :call NERDComment(0, "toEOL")<cr>
+
+" append comments
+nmap <silent> <plug>NERDCommenterAppend :call NERDComment(0, "append")<cr>
+
+" insert comments
+inoremap <silent> <plug>NERDCommenterInInsert <SPACE><BS><ESC>:call NERDComment(0, "insert")<CR>
+
+
+function! s:CreateMaps(target, combo)
+    if !hasmapto(a:target, 'n')
+        exec 'nmap ' . a:combo . ' ' . a:target
+    endif
+
+    if !hasmapto(a:target, 'v')
+        exec 'vmap ' . a:combo . ' ' . a:target
+    endif
+endfunction
+
+if g:NERDCreateDefaultMappings
+    call s:CreateMaps('<plug>NERDCommenterComment',    '<leader>cc')
+    call s:CreateMaps('<plug>NERDCommenterToggle',     '<leader>c<space>')
+    call s:CreateMaps('<plug>NERDCommenterMinimal',    '<leader>cm')
+    call s:CreateMaps('<plug>NERDCommenterSexy',       '<leader>cs')
+    call s:CreateMaps('<plug>NERDCommenterInvert',     '<leader>ci')
+    call s:CreateMaps('<plug>NERDCommenterYank',       '<leader>cy')
+    call s:CreateMaps('<plug>NERDCommenterAlignLeft',  '<leader>cl')
+    call s:CreateMaps('<plug>NERDCommenterAlignBoth',  '<leader>cb')
+    call s:CreateMaps('<plug>NERDCommenterNest',       '<leader>cn')
+    call s:CreateMaps('<plug>NERDCommenterUncomment',  '<leader>cu')
+    call s:CreateMaps('<plug>NERDCommenterToEOL',      '<leader>c$')
+    call s:CreateMaps('<plug>NERDCommenterAppend',     '<leader>cA')
+
+    if !hasmapto('<plug>NERDCommenterAltDelims', 'n')
+        nmap <leader>ca <plug>NERDCommenterAltDelims
+    endif
+endif
+
+
+
+" Section: Menu item setup {{{1
+" ===========================================================================
+"check if the user wants the menu to be displayed
+if g:NERDMenuMode != 0
+
+    let menuRoot = ""
+    if g:NERDMenuMode == 1
+        let menuRoot = 'comment'
+    elseif g:NERDMenuMode == 2
+        let menuRoot = '&comment'
+    elseif g:NERDMenuMode == 3
+        let menuRoot = '&Plugin.&comment'
+    endif
+
+    function! s:CreateMenuItems(target, desc, root)
+        exec 'nmenu <silent> ' . a:root . '.' . a:desc . ' ' . a:target
+        exec 'vmenu <silent> ' . a:root . '.' . a:desc . ' ' . a:target
+    endfunction
+    call s:CreateMenuItems("<plug>NERDCommenterComment",    'Comment', menuRoot)
+    call s:CreateMenuItems("<plug>NERDCommenterToggle",     'Toggle', menuRoot)
+    call s:CreateMenuItems('<plug>NERDCommenterMinimal',    'Minimal', menuRoot)
+    call s:CreateMenuItems('<plug>NERDCommenterNest',       'Nested', menuRoot)
+    exec 'nmenu <silent> '. menuRoot .'.To\ EOL <plug>NERDCommenterToEOL'
+    call s:CreateMenuItems('<plug>NERDCommenterInvert',     'Invert', menuRoot)
+    call s:CreateMenuItems('<plug>NERDCommenterSexy',       'Sexy', menuRoot)
+    call s:CreateMenuItems('<plug>NERDCommenterYank',       'Yank\ then\ comment', menuRoot)
+    exec 'nmenu <silent> '. menuRoot .'.Append <plug>NERDCommenterAppend'
+    exec 'menu <silent> '. menuRoot .'.-Sep-    :'
+    call s:CreateMenuItems('<plug>NERDCommenterAlignLeft',  'Left\ aligned', menuRoot)
+    call s:CreateMenuItems('<plug>NERDCommenterAlignBoth',  'Left\ and\ right\ aligned', menuRoot)
+    exec 'menu <silent> '. menuRoot .'.-Sep2-    :'
+    call s:CreateMenuItems('<plug>NERDCommenterUncomment',  'Uncomment', menuRoot)
+    exec 'nmenu <silent> '. menuRoot .'.Switch\ Delimiters <plug>NERDCommenterAltDelims'
+    exec 'imenu <silent> '. menuRoot .'.Insert\ Comment\ Here <plug>NERDCommenterInInsert'
+    exec 'menu <silent> '. menuRoot .'.-Sep3-    :'
+    exec 'menu <silent>'. menuRoot .'.Help :help NERDCommenterContents<CR>'
+endif
+" vim: set foldmethod=marker :
diff --git a/vim/plugin/NERD_tree.vim b/vim/plugin/NERD_tree.vim
new file mode 100644 (file)
index 0000000..669fd6c
--- /dev/null
@@ -0,0 +1,4049 @@
+" ============================================================================
+" File:        NERD_tree.vim
+" Description: vim global plugin that provides a nice tree explorer
+" Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+" Last Change: 1 December, 2009
+" License:     This program is free software. It comes without any warranty,
+"              to the extent permitted by applicable law. You can redistribute
+"              it and/or modify it under the terms of the Do What The Fuck You
+"              Want To Public License, Version 2, as published by Sam Hocevar.
+"              See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" ============================================================================
+let s:NERD_tree_version = '4.1.0'
+
+" SECTION: Script init stuff {{{1
+"============================================================
+if exists("loaded_nerd_tree")
+    finish
+endif
+if v:version < 700
+    echoerr "NERDTree: this plugin requires vim >= 7. DOWNLOAD IT! You'll thank me later!"
+    finish
+endif
+let loaded_nerd_tree = 1
+
+"for line continuation - i.e dont want C in &cpo
+let s:old_cpo = &cpo
+set cpo&vim
+
+"Function: s:initVariable() function {{{2
+"This function is used to initialise a given variable to a given value. The
+"variable is only initialised if it does not exist prior
+"
+"Args:
+"var: the name of the var to be initialised
+"value: the value to initialise var to
+"
+"Returns:
+"1 if the var is set, 0 otherwise
+function! s:initVariable(var, value)
+    if !exists(a:var)
+        exec 'let ' . a:var . ' = ' . "'" . substitute(a:value, "'", "''", "g") . "'"
+        return 1
+    endif
+    return 0
+endfunction
+
+"SECTION: Init variable calls and other random constants {{{2
+call s:initVariable("g:NERDChristmasTree", 1)
+call s:initVariable("g:NERDTreeAutoCenter", 1)
+call s:initVariable("g:NERDTreeAutoCenterThreshold", 3)
+call s:initVariable("g:NERDTreeCaseSensitiveSort", 0)
+call s:initVariable("g:NERDTreeChDirMode", 0)
+if !exists("g:NERDTreeIgnore")
+    let g:NERDTreeIgnore = ['\~$']
+endif
+call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBookmarks')
+call s:initVariable("g:NERDTreeHighlightCursorline", 1)
+call s:initVariable("g:NERDTreeHijackNetrw", 1)
+call s:initVariable("g:NERDTreeMouseMode", 1)
+call s:initVariable("g:NERDTreeNotificationThreshold", 100)
+call s:initVariable("g:NERDTreeQuitOnOpen", 0)
+call s:initVariable("g:NERDTreeShowBookmarks", 0)
+call s:initVariable("g:NERDTreeShowFiles", 1)
+call s:initVariable("g:NERDTreeShowHidden", 0)
+call s:initVariable("g:NERDTreeShowLineNumbers", 0)
+call s:initVariable("g:NERDTreeSortDirs", 1)
+
+if !exists("g:NERDTreeSortOrder")
+    let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$',  '\.bak$', '\~$']
+else
+    "if there isnt a * in the sort sequence then add one
+    if count(g:NERDTreeSortOrder, '*') < 1
+        call add(g:NERDTreeSortOrder, '*')
+    endif
+endif
+
+"we need to use this number many times for sorting... so we calculate it only
+"once here
+let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*')
+
+if !exists('g:NERDTreeStatusline')
+
+    "the exists() crap here is a hack to stop vim spazzing out when
+    "loading a session that was created with an open nerd tree. It spazzes
+    "because it doesnt store b:NERDTreeRoot (its a b: var, and its a hash)
+    let g:NERDTreeStatusline = "%{exists('b:NERDTreeRoot')?b:NERDTreeRoot.path.str():''}"
+
+endif
+call s:initVariable("g:NERDTreeWinPos", "left")
+call s:initVariable("g:NERDTreeWinSize", 31)
+
+let s:running_windows = has("win16") || has("win32") || has("win64")
+
+"init the shell commands that will be used to copy nodes, and remove dir trees
+"
+"Note: the space after the command is important
+if s:running_windows
+    call s:initVariable("g:NERDTreeRemoveDirCmd", 'rmdir /s /q ')
+else
+    call s:initVariable("g:NERDTreeRemoveDirCmd", 'rm -rf ')
+    call s:initVariable("g:NERDTreeCopyCmd", 'cp -r ')
+endif
+
+
+"SECTION: Init variable calls for key mappings {{{2
+call s:initVariable("g:NERDTreeMapActivateNode", "o")
+call s:initVariable("g:NERDTreeMapChangeRoot", "C")
+call s:initVariable("g:NERDTreeMapChdir", "cd")
+call s:initVariable("g:NERDTreeMapCloseChildren", "X")
+call s:initVariable("g:NERDTreeMapCloseDir", "x")
+call s:initVariable("g:NERDTreeMapDeleteBookmark", "D")
+call s:initVariable("g:NERDTreeMapMenu", "m")
+call s:initVariable("g:NERDTreeMapHelp", "?")
+call s:initVariable("g:NERDTreeMapJumpFirstChild", "K")
+call s:initVariable("g:NERDTreeMapJumpLastChild", "J")
+call s:initVariable("g:NERDTreeMapJumpNextSibling", "<C-j>")
+call s:initVariable("g:NERDTreeMapJumpParent", "p")
+call s:initVariable("g:NERDTreeMapJumpPrevSibling", "<C-k>")
+call s:initVariable("g:NERDTreeMapJumpRoot", "P")
+call s:initVariable("g:NERDTreeMapOpenExpl", "e")
+call s:initVariable("g:NERDTreeMapOpenInTab", "t")
+call s:initVariable("g:NERDTreeMapOpenInTabSilent", "T")
+call s:initVariable("g:NERDTreeMapOpenRecursively", "O")
+call s:initVariable("g:NERDTreeMapOpenSplit", "i")
+call s:initVariable("g:NERDTreeMapOpenVSplit", "s")
+call s:initVariable("g:NERDTreeMapPreview", "g" . NERDTreeMapActivateNode)
+call s:initVariable("g:NERDTreeMapPreviewSplit", "g" . NERDTreeMapOpenSplit)
+call s:initVariable("g:NERDTreeMapPreviewVSplit", "g" . NERDTreeMapOpenVSplit)
+call s:initVariable("g:NERDTreeMapQuit", "q")
+call s:initVariable("g:NERDTreeMapRefresh", "r")
+call s:initVariable("g:NERDTreeMapRefreshRoot", "R")
+call s:initVariable("g:NERDTreeMapToggleBookmarks", "B")
+call s:initVariable("g:NERDTreeMapToggleFiles", "F")
+call s:initVariable("g:NERDTreeMapToggleFilters", "f")
+call s:initVariable("g:NERDTreeMapToggleHidden", "I")
+call s:initVariable("g:NERDTreeMapToggleZoom", "A")
+call s:initVariable("g:NERDTreeMapUpdir", "u")
+call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
+
+"SECTION: Script level variable declaration{{{2
+if s:running_windows
+    let s:escape_chars =  " `\|\"#%&,?()\*^<>"
+else
+    let s:escape_chars =  " \\`\|\"#%&,?()\*^<>"
+endif
+let s:NERDTreeBufName = 'NERD_tree_'
+
+let s:tree_wid = 2
+let s:tree_markup_reg = '^[ `|โ–ผโ–ถ]*[\-+~ ]*'
+let s:tree_up_dir_line = '.. (up a dir)'
+
+"the number to add to the nerd tree buffer name to make the buf name unique
+let s:next_buffer_number = 1
+
+" SECTION: Commands {{{1
+"============================================================
+"init the command that users start the nerd tree with
+command! -n=? -complete=dir -bar NERDTree :call s:initNerdTree('<args>')
+command! -n=? -complete=dir -bar NERDTreeToggle :call s:toggle('<args>')
+command! -n=0 -bar NERDTreeClose :call s:closeTreeIfOpen()
+command! -n=1 -complete=customlist,s:completeBookmarks -bar NERDTreeFromBookmark call s:initNerdTree('<args>')
+command! -n=0 -bar NERDTreeMirror call s:initNerdTreeMirror()
+command! -n=0 -bar NERDTreeFind call s:findAndRevealPath()
+" SECTION: Auto commands {{{1
+"============================================================
+augroup NERDTree
+    "Save the cursor position whenever we close the nerd tree
+    exec "autocmd BufWinLeave ". s:NERDTreeBufName ."* call <SID>saveScreenState()"
+
+    "disallow insert mode in the NERDTree
+    exec "autocmd BufEnter ". s:NERDTreeBufName ."* stopinsert"
+    "cache bookmarks when vim loads
+    autocmd VimEnter * call s:Bookmark.CacheBookmarks(0)
+
+    "load all nerdtree plugins after vim starts
+    autocmd VimEnter * runtime! nerdtree_plugin/**/*.vim
+augroup END
+
+if g:NERDTreeHijackNetrw
+    augroup NERDTreeHijackNetrw
+        autocmd VimEnter * silent! autocmd! FileExplorer
+        au BufEnter,VimEnter * call s:checkForBrowse(expand("<amatch>"))
+    augroup END
+endif
+
+"SECTION: Classes {{{1
+"============================================================
+"CLASS: Bookmark {{{2
+"============================================================
+let s:Bookmark = {}
+" FUNCTION: Bookmark.activate() {{{3
+function! s:Bookmark.activate()
+    if self.path.isDirectory
+        call self.toRoot()
+    else
+        if self.validate()
+            let n = s:TreeFileNode.New(self.path)
+            call n.open()
+            call s:closeTreeIfQuitOnOpen()
+        endif
+    endif
+endfunction
+" FUNCTION: Bookmark.AddBookmark(name, path) {{{3
+" Class method to add a new bookmark to the list, if a previous bookmark exists
+" with the same name, just update the path for that bookmark
+function! s:Bookmark.AddBookmark(name, path)
+    for i in s:Bookmark.Bookmarks()
+        if i.name ==# a:name
+            let i.path = a:path
+            return
+        endif
+    endfor
+    call add(s:Bookmark.Bookmarks(), s:Bookmark.New(a:name, a:path))
+    call s:Bookmark.Sort()
+endfunction
+" Function: Bookmark.Bookmarks()   {{{3
+" Class method to get all bookmarks. Lazily initializes the bookmarks global
+" variable
+function! s:Bookmark.Bookmarks()
+    if !exists("g:NERDTreeBookmarks")
+        let g:NERDTreeBookmarks = []
+    endif
+    return g:NERDTreeBookmarks
+endfunction
+" Function: Bookmark.BookmarkExistsFor(name)   {{{3
+" class method that returns 1 if a bookmark with the given name is found, 0
+" otherwise
+function! s:Bookmark.BookmarkExistsFor(name)
+    try
+        call s:Bookmark.BookmarkFor(a:name)
+        return 1
+    catch /^NERDTree.BookmarkNotFoundError/
+        return 0
+    endtry
+endfunction
+" Function: Bookmark.BookmarkFor(name)   {{{3
+" Class method to get the bookmark that has the given name. {} is return if no
+" bookmark is found
+function! s:Bookmark.BookmarkFor(name)
+    for i in s:Bookmark.Bookmarks()
+        if i.name ==# a:name
+            return i
+        endif
+    endfor
+    throw "NERDTree.BookmarkNotFoundError: no bookmark found for name: \"". a:name  .'"'
+endfunction
+" Function: Bookmark.BookmarkNames()   {{{3
+" Class method to return an array of all bookmark names
+function! s:Bookmark.BookmarkNames()
+    let names = []
+    for i in s:Bookmark.Bookmarks()
+        call add(names, i.name)
+    endfor
+    return names
+endfunction
+" FUNCTION: Bookmark.CacheBookmarks(silent) {{{3
+" Class method to read all bookmarks from the bookmarks file intialize
+" bookmark objects for each one.
+"
+" Args:
+" silent - dont echo an error msg if invalid bookmarks are found
+function! s:Bookmark.CacheBookmarks(silent)
+    if filereadable(g:NERDTreeBookmarksFile)
+        let g:NERDTreeBookmarks = []
+        let g:NERDTreeInvalidBookmarks = []
+        let bookmarkStrings = readfile(g:NERDTreeBookmarksFile)
+        let invalidBookmarksFound = 0
+        for i in bookmarkStrings
+
+            "ignore blank lines
+            if i != ''
+
+                let name = substitute(i, '^\(.\{-}\) .*$', '\1', '')
+                let path = substitute(i, '^.\{-} \(.*\)$', '\1', '')
+
+                try
+                    let bookmark = s:Bookmark.New(name, s:Path.New(path))
+                    call add(g:NERDTreeBookmarks, bookmark)
+                catch /^NERDTree.InvalidArgumentsError/
+                    call add(g:NERDTreeInvalidBookmarks, i)
+                    let invalidBookmarksFound += 1
+                endtry
+            endif
+        endfor
+        if invalidBookmarksFound
+            call s:Bookmark.Write()
+            if !a:silent
+                call s:echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.")
+            endif
+        endif
+        call s:Bookmark.Sort()
+    endif
+endfunction
+" FUNCTION: Bookmark.compareTo(otherbookmark) {{{3
+" Compare these two bookmarks for sorting purposes
+function! s:Bookmark.compareTo(otherbookmark)
+    return a:otherbookmark.name < self.name
+endfunction
+" FUNCTION: Bookmark.ClearAll() {{{3
+" Class method to delete all bookmarks.
+function! s:Bookmark.ClearAll()
+    for i in s:Bookmark.Bookmarks()
+        call i.delete()
+    endfor
+    call s:Bookmark.Write()
+endfunction
+" FUNCTION: Bookmark.delete() {{{3
+" Delete this bookmark. If the node for this bookmark is under the current
+" root, then recache bookmarks for its Path object
+function! s:Bookmark.delete()
+    let node = {}
+    try
+        let node = self.getNode(1)
+    catch /^NERDTree.BookmarkedNodeNotFoundError/
+    endtry
+    call remove(s:Bookmark.Bookmarks(), index(s:Bookmark.Bookmarks(), self))
+    if !empty(node)
+        call node.path.cacheDisplayString()
+    endif
+    call s:Bookmark.Write()
+endfunction
+" FUNCTION: Bookmark.getNode(searchFromAbsoluteRoot) {{{3
+" Gets the treenode for this bookmark
+"
+" Args:
+" searchFromAbsoluteRoot: specifies whether we should search from the current
+" tree root, or the highest cached node
+function! s:Bookmark.getNode(searchFromAbsoluteRoot)
+    let searchRoot = a:searchFromAbsoluteRoot ? s:TreeDirNode.AbsoluteTreeRoot() : b:NERDTreeRoot
+    let targetNode = searchRoot.findNode(self.path)
+    if empty(targetNode)
+        throw "NERDTree.BookmarkedNodeNotFoundError: no node was found for bookmark: " . self.name
+    endif
+    return targetNode
+endfunction
+" FUNCTION: Bookmark.GetNodeForName(name, searchFromAbsoluteRoot) {{{3
+" Class method that finds the bookmark with the given name and returns the
+" treenode for it.
+function! s:Bookmark.GetNodeForName(name, searchFromAbsoluteRoot)
+    let bookmark = s:Bookmark.BookmarkFor(a:name)
+    return bookmark.getNode(a:searchFromAbsoluteRoot)
+endfunction
+" FUNCTION: Bookmark.GetSelected() {{{3
+" returns the Bookmark the cursor is over, or {}
+function! s:Bookmark.GetSelected()
+    let line = getline(".")
+    let name = substitute(line, '^>\(.\{-}\) .\+$', '\1', '')
+    if name != line
+        try
+            return s:Bookmark.BookmarkFor(name)
+        catch /^NERDTree.BookmarkNotFoundError/
+            return {}
+        endtry
+    endif
+    return {}
+endfunction
+
+" Function: Bookmark.InvalidBookmarks()   {{{3
+" Class method to get all invalid bookmark strings read from the bookmarks
+" file
+function! s:Bookmark.InvalidBookmarks()
+    if !exists("g:NERDTreeInvalidBookmarks")
+        let g:NERDTreeInvalidBookmarks = []
+    endif
+    return g:NERDTreeInvalidBookmarks
+endfunction
+" FUNCTION: Bookmark.mustExist() {{{3
+function! s:Bookmark.mustExist()
+    if !self.path.exists()
+        call s:Bookmark.CacheBookmarks(1)
+        throw "NERDTree.BookmarkPointsToInvalidLocationError: the bookmark \"".
+            \ self.name ."\" points to a non existing location: \"". self.path.str()
+    endif
+endfunction
+" FUNCTION: Bookmark.New(name, path) {{{3
+" Create a new bookmark object with the given name and path object
+function! s:Bookmark.New(name, path)
+    if a:name =~ ' '
+        throw "NERDTree.IllegalBookmarkNameError: illegal name:" . a:name
+    endif
+
+    let newBookmark = copy(self)
+    let newBookmark.name = a:name
+    let newBookmark.path = a:path
+    return newBookmark
+endfunction
+" FUNCTION: Bookmark.openInNewTab(options) {{{3
+" Create a new bookmark object with the given name and path object
+function! s:Bookmark.openInNewTab(options)
+    let currentTab = tabpagenr()
+    if self.path.isDirectory
+        tabnew
+        call s:initNerdTree(self.name)
+    else
+        exec "tabedit " . bookmark.path.str({'format': 'Edit'})
+    endif
+
+    if has_key(a:options, 'stayInCurrentTab')
+        exec "tabnext " . currentTab
+    endif
+endfunction
+" Function: Bookmark.setPath(path)   {{{3
+" makes this bookmark point to the given path
+function! s:Bookmark.setPath(path)
+    let self.path = a:path
+endfunction
+" Function: Bookmark.Sort()   {{{3
+" Class method that sorts all bookmarks
+function! s:Bookmark.Sort()
+    let CompareFunc = function("s:compareBookmarks")
+    call sort(s:Bookmark.Bookmarks(), CompareFunc)
+endfunction
+" Function: Bookmark.str()   {{{3
+" Get the string that should be rendered in the view for this bookmark
+function! s:Bookmark.str()
+    let pathStrMaxLen = winwidth(s:getTreeWinNum()) - 4 - len(self.name)
+    if &nu
+        let pathStrMaxLen = pathStrMaxLen - &numberwidth
+    endif
+
+    let pathStr = self.path.str({'format': 'UI'})
+    if len(pathStr) > pathStrMaxLen
+        let pathStr = '<' . strpart(pathStr, len(pathStr) - pathStrMaxLen)
+    endif
+    return '>' . self.name . ' ' . pathStr
+endfunction
+" FUNCTION: Bookmark.toRoot() {{{3
+" Make the node for this bookmark the new tree root
+function! s:Bookmark.toRoot()
+    if self.validate()
+        try
+            let targetNode = self.getNode(1)
+        catch /^NERDTree.BookmarkedNodeNotFoundError/
+            let targetNode = s:TreeFileNode.New(s:Bookmark.BookmarkFor(self.name).path)
+        endtry
+        call targetNode.makeRoot()
+        call s:renderView()
+        call targetNode.putCursorHere(0, 0)
+    endif
+endfunction
+" FUNCTION: Bookmark.ToRoot(name) {{{3
+" Make the node for this bookmark the new tree root
+function! s:Bookmark.ToRoot(name)
+    let bookmark = s:Bookmark.BookmarkFor(a:name)
+    call bookmark.toRoot()
+endfunction
+
+
+"FUNCTION: Bookmark.validate() {{{3
+function! s:Bookmark.validate()
+    if self.path.exists()
+        return 1
+    else
+        call s:Bookmark.CacheBookmarks(1)
+        call s:renderView()
+        call s:echo(self.name . "now points to an invalid location. See :help NERDTreeInvalidBookmarks for info.")
+        return 0
+    endif
+endfunction
+
+" Function: Bookmark.Write()   {{{3
+" Class method to write all bookmarks to the bookmarks file
+function! s:Bookmark.Write()
+    let bookmarkStrings = []
+    for i in s:Bookmark.Bookmarks()
+        call add(bookmarkStrings, i.name . ' ' . i.path.str())
+    endfor
+
+    "add a blank line before the invalid ones
+    call add(bookmarkStrings, "")
+
+    for j in s:Bookmark.InvalidBookmarks()
+        call add(bookmarkStrings, j)
+    endfor
+    call writefile(bookmarkStrings, g:NERDTreeBookmarksFile)
+endfunction
+"CLASS: KeyMap {{{2
+"============================================================
+let s:KeyMap = {}
+"FUNCTION: KeyMap.All() {{{3
+function! s:KeyMap.All()
+    if !exists("s:keyMaps")
+        let s:keyMaps = []
+    endif
+    return s:keyMaps
+endfunction
+
+"FUNCTION: KeyMap.BindAll() {{{3
+function! s:KeyMap.BindAll()
+    for i in s:KeyMap.All()
+        call i.bind()
+    endfor
+endfunction
+
+"FUNCTION: KeyMap.bind() {{{3
+function! s:KeyMap.bind()
+    exec "nnoremap <silent> <buffer> ". self.key ." :call ". self.callback ."()<cr>"
+endfunction
+
+"FUNCTION: KeyMap.Create(options) {{{3
+function! s:KeyMap.Create(options)
+    let newKeyMap = copy(self)
+    let newKeyMap.key = a:options['key']
+    let newKeyMap.quickhelpText = a:options['quickhelpText']
+    let newKeyMap.callback = a:options['callback']
+    call add(s:KeyMap.All(), newKeyMap)
+endfunction
+"CLASS: MenuController {{{2
+"============================================================
+let s:MenuController = {}
+"FUNCTION: MenuController.New(menuItems) {{{3
+"create a new menu controller that operates on the given menu items
+function! s:MenuController.New(menuItems)
+    let newMenuController =  copy(self)
+    if a:menuItems[0].isSeparator()
+        let newMenuController.menuItems = a:menuItems[1:-1]
+    else
+        let newMenuController.menuItems = a:menuItems
+    endif
+    return newMenuController
+endfunction
+
+"FUNCTION: MenuController.showMenu() {{{3
+"start the main loop of the menu and get the user to choose/execute a menu
+"item
+function! s:MenuController.showMenu()
+    call self._saveOptions()
+
+    try
+        let self.selection = 0
+
+        let done = 0
+        while !done
+            redraw!
+            call self._echoPrompt()
+            let key = nr2char(getchar())
+            let done = self._handleKeypress(key)
+        endwhile
+    finally
+        call self._restoreOptions()
+    endtry
+
+    if self.selection != -1
+        let m = self._current()
+        call m.execute()
+    endif
+endfunction
+
+"FUNCTION: MenuController._echoPrompt() {{{3
+function! s:MenuController._echoPrompt()
+    echo "NERDTree Menu. Use j/k/enter and the shortcuts indicated"
+    echo "=========================================================="
+
+    for i in range(0, len(self.menuItems)-1)
+        if self.selection == i
+            echo "> " . self.menuItems[i].text
+        else
+            echo "  " . self.menuItems[i].text
+        endif
+    endfor
+endfunction
+
+"FUNCTION: MenuController._current(key) {{{3
+"get the MenuItem that is curently selected
+function! s:MenuController._current()
+    return self.menuItems[self.selection]
+endfunction
+
+"FUNCTION: MenuController._handleKeypress(key) {{{3
+"change the selection (if appropriate) and return 1 if the user has made
+"their choice, 0 otherwise
+function! s:MenuController._handleKeypress(key)
+    if a:key == 'j'
+        call self._cursorDown()
+    elseif a:key == 'k'
+        call self._cursorUp()
+    elseif a:key == nr2char(27) "escape
+        let self.selection = -1
+        return 1
+    elseif a:key == "\r" || a:key == "\n" "enter and ctrl-j
+        return 1
+    else
+        let index = self._nextIndexFor(a:key)
+        if index != -1
+            let self.selection = index
+            if len(self._allIndexesFor(a:key)) == 1
+                return 1
+            endif
+        endif
+    endif
+
+    return 0
+endfunction
+
+"FUNCTION: MenuController._allIndexesFor(shortcut) {{{3
+"get indexes to all menu items with the given shortcut
+function! s:MenuController._allIndexesFor(shortcut)
+    let toReturn = []
+
+    for i in range(0, len(self.menuItems)-1)
+        if self.menuItems[i].shortcut == a:shortcut
+            call add(toReturn, i)
+        endif
+    endfor
+
+    return toReturn
+endfunction
+
+"FUNCTION: MenuController._nextIndexFor(shortcut) {{{3
+"get the index to the next menu item with the given shortcut, starts from the
+"current cursor location and wraps around to the top again if need be
+function! s:MenuController._nextIndexFor(shortcut)
+    for i in range(self.selection+1, len(self.menuItems)-1)
+        if self.menuItems[i].shortcut == a:shortcut
+            return i
+        endif
+    endfor
+
+    for i in range(0, self.selection)
+        if self.menuItems[i].shortcut == a:shortcut
+            return i
+        endif
+    endfor
+
+    return -1
+endfunction
+
+"FUNCTION: MenuController._setCmdheight() {{{3
+"sets &cmdheight to whatever is needed to display the menu
+function! s:MenuController._setCmdheight()
+    let &cmdheight = len(self.menuItems) + 3
+endfunction
+
+"FUNCTION: MenuController._saveOptions() {{{3
+"set any vim options that are required to make the menu work (saving their old
+"values)
+function! s:MenuController._saveOptions()
+    let self._oldLazyredraw = &lazyredraw
+    let self._oldCmdheight = &cmdheight
+    set nolazyredraw
+    call self._setCmdheight()
+endfunction
+
+"FUNCTION: MenuController._restoreOptions() {{{3
+"restore the options we saved in _saveOptions()
+function! s:MenuController._restoreOptions()
+    let &cmdheight = self._oldCmdheight
+    let &lazyredraw = self._oldLazyredraw
+endfunction
+
+"FUNCTION: MenuController._cursorDown() {{{3
+"move the cursor to the next menu item, skipping separators
+function! s:MenuController._cursorDown()
+    let done = 0
+    while !done
+        if self.selection < len(self.menuItems)-1
+            let self.selection += 1
+        else
+            let self.selection = 0
+        endif
+
+        if !self._current().isSeparator()
+            let done = 1
+        endif
+    endwhile
+endfunction
+
+"FUNCTION: MenuController._cursorUp() {{{3
+"move the cursor to the previous menu item, skipping separators
+function! s:MenuController._cursorUp()
+    let done = 0
+    while !done
+        if self.selection > 0
+            let self.selection -= 1
+        else
+            let self.selection = len(self.menuItems)-1
+        endif
+
+        if !self._current().isSeparator()
+            let done = 1
+        endif
+    endwhile
+endfunction
+
+"CLASS: MenuItem {{{2
+"============================================================
+let s:MenuItem = {}
+"FUNCTION: MenuItem.All() {{{3
+"get all top level menu items
+function! s:MenuItem.All()
+    if !exists("s:menuItems")
+        let s:menuItems = []
+    endif
+    return s:menuItems
+endfunction
+
+"FUNCTION: MenuItem.AllEnabled() {{{3
+"get all top level menu items that are currently enabled
+function! s:MenuItem.AllEnabled()
+    let toReturn = []
+    for i in s:MenuItem.All()
+        if i.enabled()
+            call add(toReturn, i)
+        endif
+    endfor
+    return toReturn
+endfunction
+
+"FUNCTION: MenuItem.Create(options) {{{3
+"make a new menu item and add it to the global list
+function! s:MenuItem.Create(options)
+    let newMenuItem = copy(self)
+
+    let newMenuItem.text = a:options['text']
+    let newMenuItem.shortcut = a:options['shortcut']
+    let newMenuItem.children = []
+
+    let newMenuItem.isActiveCallback = -1
+    if has_key(a:options, 'isActiveCallback')
+        let newMenuItem.isActiveCallback = a:options['isActiveCallback']
+    endif
+
+    let newMenuItem.callback = -1
+    if has_key(a:options, 'callback')
+        let newMenuItem.callback = a:options['callback']
+    endif
+
+    if has_key(a:options, 'parent')
+        call add(a:options['parent'].children, newMenuItem)
+    else
+        call add(s:MenuItem.All(), newMenuItem)
+    endif
+
+    return newMenuItem
+endfunction
+
+"FUNCTION: MenuItem.CreateSeparator(options) {{{3
+"make a new separator menu item and add it to the global list
+function! s:MenuItem.CreateSeparator(options)
+    let standard_options = { 'text': '--------------------',
+                \ 'shortcut': -1,
+                \ 'callback': -1 }
+    let options = extend(a:options, standard_options, "force")
+
+    return s:MenuItem.Create(options)
+endfunction
+
+"FUNCTION: MenuItem.CreateSubmenu(options) {{{3
+"make a new submenu and add it to global list
+function! s:MenuItem.CreateSubmenu(options)
+    let standard_options = { 'callback': -1 }
+    let options = extend(a:options, standard_options, "force")
+
+    return s:MenuItem.Create(options)
+endfunction
+
+"FUNCTION: MenuItem.enabled() {{{3
+"return 1 if this menu item should be displayed
+"
+"delegates off to the isActiveCallback, and defaults to 1 if no callback was
+"specified
+function! s:MenuItem.enabled()
+    if self.isActiveCallback != -1
+        return {self.isActiveCallback}()
+    endif
+    return 1
+endfunction
+
+"FUNCTION: MenuItem.execute() {{{3
+"perform the action behind this menu item, if this menuitem has children then
+"display a new menu for them, otherwise deletegate off to the menuitem's
+"callback
+function! s:MenuItem.execute()
+    if len(self.children)
+        let mc = s:MenuController.New(self.children)
+        call mc.showMenu()
+    else
+        if self.callback != -1
+            call {self.callback}()
+        endif
+    endif
+endfunction
+
+"FUNCTION: MenuItem.isSeparator() {{{3
+"return 1 if this menuitem is a separator
+function! s:MenuItem.isSeparator()
+    return self.callback == -1 && self.children == []
+endfunction
+
+"FUNCTION: MenuItem.isSubmenu() {{{3
+"return 1 if this menuitem is a submenu
+function! s:MenuItem.isSubmenu()
+    return self.callback == -1 && !empty(self.children)
+endfunction
+
+"CLASS: TreeFileNode {{{2
+"This class is the parent of the TreeDirNode class and constitures the
+"'Component' part of the composite design pattern between the treenode
+"classes.
+"============================================================
+let s:TreeFileNode = {}
+"FUNCTION: TreeFileNode.activate(forceKeepWinOpen) {{{3
+function! s:TreeFileNode.activate(forceKeepWinOpen)
+    call self.open()
+    if !a:forceKeepWinOpen
+        call s:closeTreeIfQuitOnOpen()
+    end
+endfunction
+"FUNCTION: TreeFileNode.bookmark(name) {{{3
+"bookmark this node with a:name
+function! s:TreeFileNode.bookmark(name)
+
+    "if a bookmark exists with the same name and the node is cached then save
+    "it so we can update its display string
+    let oldMarkedNode = {}
+    try
+        let oldMarkedNode = s:Bookmark.GetNodeForName(a:name, 1)
+    catch /^NERDTree.BookmarkNotFoundError/
+    catch /^NERDTree.BookmarkedNodeNotFoundError/
+    endtry
+
+    call s:Bookmark.AddBookmark(a:name, self.path)
+    call self.path.cacheDisplayString()
+    call s:Bookmark.Write()
+
+    if !empty(oldMarkedNode)
+        call oldMarkedNode.path.cacheDisplayString()
+    endif
+endfunction
+"FUNCTION: TreeFileNode.cacheParent() {{{3
+"initializes self.parent if it isnt already
+function! s:TreeFileNode.cacheParent()
+    if empty(self.parent)
+        let parentPath = self.path.getParent()
+        if parentPath.equals(self.path)
+            throw "NERDTree.CannotCacheParentError: already at root"
+        endif
+        let self.parent = s:TreeFileNode.New(parentPath)
+    endif
+endfunction
+"FUNCTION: TreeFileNode.compareNodes {{{3
+"This is supposed to be a class level method but i cant figure out how to
+"get func refs to work from a dict..
+"
+"A class level method that compares two nodes
+"
+"Args:
+"n1, n2: the 2 nodes to compare
+function! s:compareNodes(n1, n2)
+    return a:n1.path.compareTo(a:n2.path)
+endfunction
+
+"FUNCTION: TreeFileNode.clearBoomarks() {{{3
+function! s:TreeFileNode.clearBoomarks()
+    for i in s:Bookmark.Bookmarks()
+        if i.path.equals(self.path)
+            call i.delete()
+        end
+    endfor
+    call self.path.cacheDisplayString()
+endfunction
+"FUNCTION: TreeFileNode.copy(dest) {{{3
+function! s:TreeFileNode.copy(dest)
+    call self.path.copy(a:dest)
+    let newPath = s:Path.New(a:dest)
+    let parent = b:NERDTreeRoot.findNode(newPath.getParent())
+    if !empty(parent)
+        call parent.refresh()
+    endif
+    return parent.findNode(newPath)
+endfunction
+
+"FUNCTION: TreeFileNode.delete {{{3
+"Removes this node from the tree and calls the Delete method for its path obj
+function! s:TreeFileNode.delete()
+    call self.path.delete()
+    call self.parent.removeChild(self)
+endfunction
+
+"FUNCTION: TreeFileNode.displayString() {{{3
+"
+"Returns a string that specifies how the node should be represented as a
+"string
+"
+"Return:
+"a string that can be used in the view to represent this node
+function! s:TreeFileNode.displayString()
+    return self.path.displayString()
+endfunction
+
+"FUNCTION: TreeFileNode.equals(treenode) {{{3
+"
+"Compares this treenode to the input treenode and returns 1 if they are the
+"same node.
+"
+"Use this method instead of ==  because sometimes when the treenodes contain
+"many children, vim seg faults when doing ==
+"
+"Args:
+"treenode: the other treenode to compare to
+function! s:TreeFileNode.equals(treenode)
+    return self.path.str() ==# a:treenode.path.str()
+endfunction
+
+"FUNCTION: TreeFileNode.findNode(path) {{{3
+"Returns self if this node.path.Equals the given path.
+"Returns {} if not equal.
+"
+"Args:
+"path: the path object to compare against
+function! s:TreeFileNode.findNode(path)
+    if a:path.equals(self.path)
+        return self
+    endif
+    return {}
+endfunction
+"FUNCTION: TreeFileNode.findOpenDirSiblingWithVisibleChildren(direction) {{{3
+"
+"Finds the next sibling for this node in the indicated direction. This sibling
+"must be a directory and may/may not have children as specified.
+"
+"Args:
+"direction: 0 if you want to find the previous sibling, 1 for the next sibling
+"
+"Return:
+"a treenode object or {} if no appropriate sibling could be found
+function! s:TreeFileNode.findOpenDirSiblingWithVisibleChildren(direction)
+    "if we have no parent then we can have no siblings
+    if self.parent != {}
+        let nextSibling = self.findSibling(a:direction)
+
+        while nextSibling != {}
+            if nextSibling.path.isDirectory && nextSibling.hasVisibleChildren() && nextSibling.isOpen
+                return nextSibling
+            endif
+            let nextSibling = nextSibling.findSibling(a:direction)
+        endwhile
+    endif
+
+    return {}
+endfunction
+"FUNCTION: TreeFileNode.findSibling(direction) {{{3
+"
+"Finds the next sibling for this node in the indicated direction
+"
+"Args:
+"direction: 0 if you want to find the previous sibling, 1 for the next sibling
+"
+"Return:
+"a treenode object or {} if no sibling could be found
+function! s:TreeFileNode.findSibling(direction)
+    "if we have no parent then we can have no siblings
+    if self.parent != {}
+
+        "get the index of this node in its parents children
+        let siblingIndx = self.parent.getChildIndex(self.path)
+
+        if siblingIndx != -1
+            "move a long to the next potential sibling node
+            let siblingIndx = a:direction ==# 1 ? siblingIndx+1 : siblingIndx-1
+
+            "keep moving along to the next sibling till we find one that is valid
+            let numSiblings = self.parent.getChildCount()
+            while siblingIndx >= 0 && siblingIndx < numSiblings
+
+                "if the next node is not an ignored node (i.e. wont show up in the
+                "view) then return it
+                if self.parent.children[siblingIndx].path.ignore() ==# 0
+                    return self.parent.children[siblingIndx]
+                endif
+
+                "go to next node
+                let siblingIndx = a:direction ==# 1 ? siblingIndx+1 : siblingIndx-1
+            endwhile
+        endif
+    endif
+
+    return {}
+endfunction
+
+"FUNCTION: TreeFileNode.getLineNum(){{{3
+"returns the line number this node is rendered on, or -1 if it isnt rendered
+function! s:TreeFileNode.getLineNum()
+    "if the node is the root then return the root line no.
+    if self.isRoot()
+        return s:TreeFileNode.GetRootLineNum()
+    endif
+
+    let totalLines = line("$")
+
+    "the path components we have matched so far
+    let pathcomponents = [substitute(b:NERDTreeRoot.path.str({'format': 'UI'}), '/ *$', '', '')]
+    "the index of the component we are searching for
+    let curPathComponent = 1
+
+    let fullpath = self.path.str({'format': 'UI'})
+
+
+    let lnum = s:TreeFileNode.GetRootLineNum()
+    while lnum > 0
+        let lnum = lnum + 1
+        "have we reached the bottom of the tree?
+        if lnum ==# totalLines+1
+            return -1
+        endif
+
+        let curLine = getline(lnum)
+
+        let indent = s:indentLevelFor(curLine)
+        if indent ==# curPathComponent
+            let curLine = s:stripMarkupFromLine(curLine, 1)
+
+            let curPath =  join(pathcomponents, '/') . '/' . curLine
+            if stridx(fullpath, curPath, 0) ==# 0
+                if fullpath ==# curPath || strpart(fullpath, len(curPath)-1,1) ==# '/'
+                    let curLine = substitute(curLine, '/ *$', '', '')
+                    call add(pathcomponents, curLine)
+                    let curPathComponent = curPathComponent + 1
+
+                    if fullpath ==# curPath
+                        return lnum
+                    endif
+                endif
+            endif
+        endif
+    endwhile
+    return -1
+endfunction
+
+"FUNCTION: TreeFileNode.GetRootForTab(){{{3
+"get the root node for this tab
+function! s:TreeFileNode.GetRootForTab()
+    if s:treeExistsForTab()
+        return getbufvar(t:NERDTreeBufName, 'NERDTreeRoot')
+    end
+    return {}
+endfunction
+"FUNCTION: TreeFileNode.GetRootLineNum(){{{3
+"gets the line number of the root node
+function! s:TreeFileNode.GetRootLineNum()
+    let rootLine = 1
+    while getline(rootLine) !~ '^\(/\|<\)'
+        let rootLine = rootLine + 1
+    endwhile
+    return rootLine
+endfunction
+
+"FUNCTION: TreeFileNode.GetSelected() {{{3
+"gets the treenode that the cursor is currently over
+function! s:TreeFileNode.GetSelected()
+    try
+        let path = s:getPath(line("."))
+        if path ==# {}
+            return {}
+        endif
+        return b:NERDTreeRoot.findNode(path)
+    catch /NERDTree/
+        return {}
+    endtry
+endfunction
+"FUNCTION: TreeFileNode.isVisible() {{{3
+"returns 1 if this node should be visible according to the tree filters and
+"hidden file filters (and their on/off status)
+function! s:TreeFileNode.isVisible()
+    return !self.path.ignore()
+endfunction
+"FUNCTION: TreeFileNode.isRoot() {{{3
+"returns 1 if this node is b:NERDTreeRoot
+function! s:TreeFileNode.isRoot()
+    if !s:treeExistsForBuf()
+        throw "NERDTree.NoTreeError: No tree exists for the current buffer"
+    endif
+
+    return self.equals(b:NERDTreeRoot)
+endfunction
+
+"FUNCTION: TreeFileNode.makeRoot() {{{3
+"Make this node the root of the tree
+function! s:TreeFileNode.makeRoot()
+    if self.path.isDirectory
+        let b:NERDTreeRoot = self
+    else
+        call self.cacheParent()
+        let b:NERDTreeRoot = self.parent
+    endif
+
+    call b:NERDTreeRoot.open()
+
+    "change dir to the dir of the new root if instructed to
+    if g:NERDTreeChDirMode ==# 2
+        exec "cd " . b:NERDTreeRoot.path.str({'format': 'Edit'})
+    endif
+endfunction
+"FUNCTION: TreeFileNode.New(path) {{{3
+"Returns a new TreeNode object with the given path and parent
+"
+"Args:
+"path: a path object representing the full filesystem path to the file/dir that the node represents
+function! s:TreeFileNode.New(path)
+    if a:path.isDirectory
+        return s:TreeDirNode.New(a:path)
+    else
+        let newTreeNode = copy(self)
+        let newTreeNode.path = a:path
+        let newTreeNode.parent = {}
+        return newTreeNode
+    endif
+endfunction
+
+"FUNCTION: TreeFileNode.open() {{{3
+"Open the file represented by the given node in the current window, splitting
+"the window if needed
+"
+"ARGS:
+"treenode: file node to open
+function! s:TreeFileNode.open()
+    if b:NERDTreeType ==# "secondary"
+        exec 'edit ' . self.path.str({'format': 'Edit'})
+        return
+    endif
+
+    "if the file is already open in this tab then just stick the cursor in it
+    let winnr = bufwinnr('^' . self.path.str() . '$')
+    if winnr != -1
+        call s:exec(winnr . "wincmd w")
+
+    else
+        if !s:isWindowUsable(winnr("#")) && s:firstUsableWindow() ==# -1
+            call self.openSplit()
+        else
+            try
+                if !s:isWindowUsable(winnr("#"))
+                    call s:exec(s:firstUsableWindow() . "wincmd w")
+                else
+                    call s:exec('wincmd p')
+                endif
+                exec ("edit " . self.path.str({'format': 'Edit'}))
+            catch /^Vim\%((\a\+)\)\=:E37/
+                call s:putCursorInTreeWin()
+                throw "NERDTree.FileAlreadyOpenAndModifiedError: ". self.path.str() ." is already open and modified."
+            catch /^Vim\%((\a\+)\)\=:/
+                echo v:exception
+            endtry
+        endif
+    endif
+endfunction
+"FUNCTION: TreeFileNode.openSplit() {{{3
+"Open this node in a new window
+function! s:TreeFileNode.openSplit()
+
+    if b:NERDTreeType ==# "secondary"
+        exec "split " . self.path.str({'format': 'Edit'})
+        return
+    endif
+
+    " Save the user's settings for splitbelow and splitright
+    let savesplitbelow=&splitbelow
+    let savesplitright=&splitright
+
+    " 'there' will be set to a command to move from the split window
+    " back to the explorer window
+    "
+    " 'back' will be set to a command to move from the explorer window
+    " back to the newly split window
+    "
+    " 'right' and 'below' will be set to the settings needed for
+    " splitbelow and splitright IF the explorer is the only window.
+    "
+    let there= g:NERDTreeWinPos ==# "left" ? "wincmd h" : "wincmd l"
+    let back = g:NERDTreeWinPos ==# "left" ? "wincmd l" : "wincmd h"
+    let right= g:NERDTreeWinPos ==# "left"
+    let below=0
+
+    " Attempt to go to adjacent window
+    call s:exec(back)
+
+    let onlyOneWin = (winnr("$") ==# 1)
+
+    " If no adjacent window, set splitright and splitbelow appropriately
+    if onlyOneWin
+        let &splitright=right
+        let &splitbelow=below
+    else
+        " found adjacent window - invert split direction
+        let &splitright=!right
+        let &splitbelow=!below
+    endif
+
+    let splitMode = onlyOneWin ? "vertical" : ""
+
+    " Open the new window
+    try
+        exec(splitMode." sp " . self.path.str({'format': 'Edit'}))
+    catch /^Vim\%((\a\+)\)\=:E37/
+        call s:putCursorInTreeWin()
+        throw "NERDTree.FileAlreadyOpenAndModifiedError: ". self.path.str() ." is already open and modified."
+    catch /^Vim\%((\a\+)\)\=:/
+        "do nothing
+    endtry
+
+    "resize the tree window if no other window was open before
+    if onlyOneWin
+        let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
+        call s:exec(there)
+        exec("silent ". splitMode ." resize ". size)
+        call s:exec('wincmd p')
+    endif
+
+    " Restore splitmode settings
+    let &splitbelow=savesplitbelow
+    let &splitright=savesplitright
+endfunction
+"FUNCTION: TreeFileNode.openVSplit() {{{3
+"Open this node in a new vertical window
+function! s:TreeFileNode.openVSplit()
+    if b:NERDTreeType ==# "secondary"
+        exec "vnew " . self.path.str({'format': 'Edit'})
+        return
+    endif
+
+    let winwidth = winwidth(".")
+    if winnr("$")==#1
+        let winwidth = g:NERDTreeWinSize
+    endif
+
+    call s:exec("wincmd p")
+    exec "vnew " . self.path.str({'format': 'Edit'})
+
+    "resize the nerd tree back to the original size
+    call s:putCursorInTreeWin()
+    exec("silent vertical resize ". winwidth)
+    call s:exec('wincmd p')
+endfunction
+"FUNCTION: TreeFileNode.openInNewTab(options) {{{3
+function! s:TreeFileNode.openInNewTab(options)
+    let currentTab = tabpagenr()
+
+    if !has_key(a:options, 'keepTreeOpen')
+        call s:closeTreeIfQuitOnOpen()
+    endif
+
+    exec "tabedit " . self.path.str({'format': 'Edit'})
+
+    if has_key(a:options, 'stayInCurrentTab') && a:options['stayInCurrentTab']
+        exec "tabnext " . currentTab
+    endif
+
+endfunction
+"FUNCTION: TreeFileNode.putCursorHere(isJump, recurseUpward){{{3
+"Places the cursor on the line number this node is rendered on
+"
+"Args:
+"isJump: 1 if this cursor movement should be counted as a jump by vim
+"recurseUpward: try to put the cursor on the parent if the this node isnt
+"visible
+function! s:TreeFileNode.putCursorHere(isJump, recurseUpward)
+    let ln = self.getLineNum()
+    if ln != -1
+        if a:isJump
+            mark '
+        endif
+        call cursor(ln, col("."))
+    else
+        if a:recurseUpward
+            let node = self
+            while node != {} && node.getLineNum() ==# -1
+                let node = node.parent
+                call node.open()
+            endwhile
+            call s:renderView()
+            call node.putCursorHere(a:isJump, 0)
+        endif
+    endif
+endfunction
+
+"FUNCTION: TreeFileNode.refresh() {{{3
+function! s:TreeFileNode.refresh()
+    call self.path.refresh()
+endfunction
+"FUNCTION: TreeFileNode.rename() {{{3
+"Calls the rename method for this nodes path obj
+function! s:TreeFileNode.rename(newName)
+    let newName = substitute(a:newName, '\(\\\|\/\)$', '', '')
+    call self.path.rename(newName)
+    call self.parent.removeChild(self)
+
+    let parentPath = self.path.getParent()
+    let newParent = b:NERDTreeRoot.findNode(parentPath)
+
+    if newParent != {}
+        call newParent.createChild(self.path, 1)
+        call newParent.refresh()
+    endif
+endfunction
+"FUNCTION: TreeFileNode.renderToString {{{3
+"returns a string representation for this tree to be rendered in the view
+function! s:TreeFileNode.renderToString()
+    return self._renderToString(0, 0, [], self.getChildCount() ==# 1)
+endfunction
+
+
+"Args:
+"depth: the current depth in the tree for this call
+"drawText: 1 if we should actually draw the line for this node (if 0 then the
+"child nodes are rendered only)
+"vertMap: a binary array that indicates whether a vertical bar should be draw
+"for each depth in the tree
+"isLastChild:true if this curNode is the last child of its parent
+function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
+    let output = ""
+    if a:drawText ==# 1
+
+        let treeParts = ''
+
+        "get all the leading spaces and vertical tree parts for this line
+        if a:depth > 1
+            for j in a:vertMap[0:-2]
+                let treeParts = treeParts . '  '
+            endfor
+        endif
+
+        if self.path.isDirectory
+            if self.isOpen
+                let treeParts = treeParts . 'โ–ผ '
+            else
+                let treeParts = treeParts . 'โ–ถ '
+            endif
+        else
+            let treeParts = treeParts . ''
+        endif
+
+        let line = treeParts . self.displayString()
+
+        let output = output . line . "\n"
+    endif
+
+    "if the node is an open dir, draw its children
+    if self.path.isDirectory ==# 1 && self.isOpen ==# 1
+
+        let childNodesToDraw = self.getVisibleChildren()
+        if len(childNodesToDraw) > 0
+
+            "draw all the nodes children except the last
+            let lastIndx = len(childNodesToDraw)-1
+            if lastIndx > 0
+                for i in childNodesToDraw[0:lastIndx-1]
+                    let output = output . i._renderToString(a:depth + 1, 1, add(copy(a:vertMap), 1), 0)
+                endfor
+            endif
+
+            "draw the last child, indicating that it IS the last
+            let output = output . childNodesToDraw[lastIndx]._renderToString(a:depth + 1, 1, add(copy(a:vertMap), 0), 1)
+        endif
+    endif
+
+    return output
+endfunction
+"CLASS: TreeDirNode {{{2
+"This class is a child of the TreeFileNode class and constitutes the
+"'Composite' part of the composite design pattern between the treenode
+"classes.
+"============================================================
+let s:TreeDirNode = copy(s:TreeFileNode)
+"FUNCTION: TreeDirNode.AbsoluteTreeRoot(){{{3
+"class method that returns the highest cached ancestor of the current root
+function! s:TreeDirNode.AbsoluteTreeRoot()
+    let currentNode = b:NERDTreeRoot
+    while currentNode.parent != {}
+        let currentNode = currentNode.parent
+    endwhile
+    return currentNode
+endfunction
+"FUNCTION: TreeDirNode.activate(forceKeepWinOpen) {{{3
+unlet s:TreeDirNode.activate
+function! s:TreeDirNode.activate(forceKeepWinOpen)
+    call self.toggleOpen()
+    call s:renderView()
+    call self.putCursorHere(0, 0)
+endfunction
+"FUNCTION: TreeDirNode.addChild(treenode, inOrder) {{{3
+"Adds the given treenode to the list of children for this node
+"
+"Args:
+"-treenode: the node to add
+"-inOrder: 1 if the new node should be inserted in sorted order
+function! s:TreeDirNode.addChild(treenode, inOrder)
+    call add(self.children, a:treenode)
+    let a:treenode.parent = self
+
+    if a:inOrder
+        call self.sortChildren()
+    endif
+endfunction
+
+"FUNCTION: TreeDirNode.close() {{{3
+"Closes this directory
+function! s:TreeDirNode.close()
+    let self.isOpen = 0
+endfunction
+
+"FUNCTION: TreeDirNode.closeChildren() {{{3
+"Closes all the child dir nodes of this node
+function! s:TreeDirNode.closeChildren()
+    for i in self.children
+        if i.path.isDirectory
+            call i.close()
+            call i.closeChildren()
+        endif
+    endfor
+endfunction
+
+"FUNCTION: TreeDirNode.createChild(path, inOrder) {{{3
+"Instantiates a new child node for this node with the given path. The new
+"nodes parent is set to this node.
+"
+"Args:
+"path: a Path object that this node will represent/contain
+"inOrder: 1 if the new node should be inserted in sorted order
+"
+"Returns:
+"the newly created node
+function! s:TreeDirNode.createChild(path, inOrder)
+    let newTreeNode = s:TreeFileNode.New(a:path)
+    call self.addChild(newTreeNode, a:inOrder)
+    return newTreeNode
+endfunction
+
+"FUNCTION: TreeDirNode.findNode(path) {{{3
+"Will find one of the children (recursively) that has the given path
+"
+"Args:
+"path: a path object
+unlet s:TreeDirNode.findNode
+function! s:TreeDirNode.findNode(path)
+    if a:path.equals(self.path)
+        return self
+    endif
+    if stridx(a:path.str(), self.path.str(), 0) ==# -1
+        return {}
+    endif
+
+    if self.path.isDirectory
+        for i in self.children
+            let retVal = i.findNode(a:path)
+            if retVal != {}
+                return retVal
+            endif
+        endfor
+    endif
+    return {}
+endfunction
+"FUNCTION: TreeDirNode.getChildCount() {{{3
+"Returns the number of children this node has
+function! s:TreeDirNode.getChildCount()
+    return len(self.children)
+endfunction
+
+"FUNCTION: TreeDirNode.getChild(path) {{{3
+"Returns child node of this node that has the given path or {} if no such node
+"exists.
+"
+"This function doesnt not recurse into child dir nodes
+"
+"Args:
+"path: a path object
+function! s:TreeDirNode.getChild(path)
+    if stridx(a:path.str(), self.path.str(), 0) ==# -1
+        return {}
+    endif
+
+    let index = self.getChildIndex(a:path)
+    if index ==# -1
+        return {}
+    else
+        return self.children[index]
+    endif
+
+endfunction
+
+"FUNCTION: TreeDirNode.getChildByIndex(indx, visible) {{{3
+"returns the child at the given index
+"Args:
+"indx: the index to get the child from
+"visible: 1 if only the visible children array should be used, 0 if all the
+"children should be searched.
+function! s:TreeDirNode.getChildByIndex(indx, visible)
+    let array_to_search = a:visible? self.getVisibleChildren() : self.children
+    if a:indx > len(array_to_search)
+        throw "NERDTree.InvalidArgumentsError: Index is out of bounds."
+    endif
+    return array_to_search[a:indx]
+endfunction
+
+"FUNCTION: TreeDirNode.getChildIndex(path) {{{3
+"Returns the index of the child node of this node that has the given path or
+"-1 if no such node exists.
+"
+"This function doesnt not recurse into child dir nodes
+"
+"Args:
+"path: a path object
+function! s:TreeDirNode.getChildIndex(path)
+    if stridx(a:path.str(), self.path.str(), 0) ==# -1
+        return -1
+    endif
+
+    "do a binary search for the child
+    let a = 0
+    let z = self.getChildCount()
+    while a < z
+        let mid = (a+z)/2
+        let diff = a:path.compareTo(self.children[mid].path)
+
+        if diff ==# -1
+            let z = mid
+        elseif diff ==# 1
+            let a = mid+1
+        else
+            return mid
+        endif
+    endwhile
+    return -1
+endfunction
+
+"FUNCTION: TreeDirNode.GetSelected() {{{3
+"Returns the current node if it is a dir node, or else returns the current
+"nodes parent
+unlet s:TreeDirNode.GetSelected
+function! s:TreeDirNode.GetSelected()
+    let currentDir = s:TreeFileNode.GetSelected()
+    if currentDir != {} && !currentDir.isRoot()
+        if currentDir.path.isDirectory ==# 0
+            let currentDir = currentDir.parent
+        endif
+    endif
+    return currentDir
+endfunction
+"FUNCTION: TreeDirNode.getVisibleChildCount() {{{3
+"Returns the number of visible children this node has
+function! s:TreeDirNode.getVisibleChildCount()
+    return len(self.getVisibleChildren())
+endfunction
+
+"FUNCTION: TreeDirNode.getVisibleChildren() {{{3
+"Returns a list of children to display for this node, in the correct order
+"
+"Return:
+"an array of treenodes
+function! s:TreeDirNode.getVisibleChildren()
+    let toReturn = []
+    for i in self.children
+        if i.path.ignore() ==# 0
+            call add(toReturn, i)
+        endif
+    endfor
+    return toReturn
+endfunction
+
+"FUNCTION: TreeDirNode.hasVisibleChildren() {{{3
+"returns 1 if this node has any childre, 0 otherwise..
+function! s:TreeDirNode.hasVisibleChildren()
+    return self.getVisibleChildCount() != 0
+endfunction
+
+"FUNCTION: TreeDirNode._initChildren() {{{3
+"Removes all childen from this node and re-reads them
+"
+"Args:
+"silent: 1 if the function should not echo any "please wait" messages for
+"large directories
+"
+"Return: the number of child nodes read
+function! s:TreeDirNode._initChildren(silent)
+    "remove all the current child nodes
+    let self.children = []
+
+    "get an array of all the files in the nodes dir
+    let dir = self.path
+    let globDir = dir.str({'format': 'Glob'})
+    let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*')
+    let files = split(filesStr, "\n")
+
+    if !a:silent && len(files) > g:NERDTreeNotificationThreshold
+        call s:echo("Please wait, caching a large dir ...")
+    endif
+
+    let invalidFilesFound = 0
+    for i in files
+
+        "filter out the .. and . directories
+        "Note: we must match .. AND ../ cos sometimes the globpath returns
+        "../ for path with strange chars (eg $)
+        if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
+
+            "put the next file in a new node and attach it
+            try
+                let path = s:Path.New(i)
+                call self.createChild(path, 0)
+            catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
+                let invalidFilesFound += 1
+            endtry
+        endif
+    endfor
+
+    call self.sortChildren()
+
+    if !a:silent && len(files) > g:NERDTreeNotificationThreshold
+        call s:echo("Please wait, caching a large dir ... DONE (". self.getChildCount() ." nodes cached).")
+    endif
+
+    if invalidFilesFound
+        call s:echoWarning(invalidFilesFound . " file(s) could not be loaded into the NERD tree")
+    endif
+    return self.getChildCount()
+endfunction
+"FUNCTION: TreeDirNode.New(path) {{{3
+"Returns a new TreeNode object with the given path and parent
+"
+"Args:
+"path: a path object representing the full filesystem path to the file/dir that the node represents
+unlet s:TreeDirNode.New
+function! s:TreeDirNode.New(path)
+    if a:path.isDirectory != 1
+        throw "NERDTree.InvalidArgumentsError: A TreeDirNode object must be instantiated with a directory Path object."
+    endif
+
+    let newTreeNode = copy(self)
+    let newTreeNode.path = a:path
+
+    let newTreeNode.isOpen = 0
+    let newTreeNode.children = []
+
+    let newTreeNode.parent = {}
+
+    return newTreeNode
+endfunction
+"FUNCTION: TreeDirNode.open() {{{3
+"Reads in all this nodes children
+"
+"Return: the number of child nodes read
+unlet s:TreeDirNode.open
+function! s:TreeDirNode.open()
+    let self.isOpen = 1
+    if self.children ==# []
+        return self._initChildren(0)
+    else
+        return 0
+    endif
+endfunction
+
+" FUNCTION: TreeDirNode.openExplorer() {{{3
+" opens an explorer window for this node in the previous window (could be a
+" nerd tree or a netrw)
+function! s:TreeDirNode.openExplorer()
+    let oldwin = winnr()
+    call s:exec('wincmd p')
+    if oldwin ==# winnr() || (&modified && s:bufInWindows(winbufnr(winnr())) < 2)
+        call s:exec('wincmd p')
+        call self.openSplit()
+    else
+        exec ("silent edit " . self.path.str({'format': 'Edit'}))
+    endif
+endfunction
+"FUNCTION: TreeDirNode.openInNewTab(options) {{{3
+unlet s:TreeDirNode.openInNewTab
+function! s:TreeDirNode.openInNewTab(options)
+    let currentTab = tabpagenr()
+
+    if !has_key(a:options, 'keepTreeOpen') || !a:options['keepTreeOpen']
+        call s:closeTreeIfQuitOnOpen()
+    endif
+
+    tabnew
+    call s:initNerdTree(self.path.str())
+
+    if has_key(a:options, 'stayInCurrentTab') && a:options['stayInCurrentTab']
+        exec "tabnext " . currentTab
+    endif
+endfunction
+"FUNCTION: TreeDirNode.openRecursively() {{{3
+"Opens this treenode and all of its children whose paths arent 'ignored'
+"because of the file filters.
+"
+"This method is actually a wrapper for the OpenRecursively2 method which does
+"the work.
+function! s:TreeDirNode.openRecursively()
+    call self._openRecursively2(1)
+endfunction
+
+"FUNCTION: TreeDirNode._openRecursively2() {{{3
+"Opens this all children of this treenode recursively if either:
+"   *they arent filtered by file filters
+"   *a:forceOpen is 1
+"
+"Args:
+"forceOpen: 1 if this node should be opened regardless of file filters
+function! s:TreeDirNode._openRecursively2(forceOpen)
+    if self.path.ignore() ==# 0 || a:forceOpen
+        let self.isOpen = 1
+        if self.children ==# []
+            call self._initChildren(1)
+        endif
+
+        for i in self.children
+            if i.path.isDirectory ==# 1
+                call i._openRecursively2(0)
+            endif
+        endfor
+    endif
+endfunction
+
+"FUNCTION: TreeDirNode.refresh() {{{3
+unlet s:TreeDirNode.refresh
+function! s:TreeDirNode.refresh()
+    call self.path.refresh()
+
+    "if this node was ever opened, refresh its children
+    if self.isOpen || !empty(self.children)
+        "go thru all the files/dirs under this node
+        let newChildNodes = []
+        let invalidFilesFound = 0
+        let dir = self.path
+        let globDir = dir.str({'format': 'Glob'})
+        let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*')
+        let files = split(filesStr, "\n")
+        for i in files
+            "filter out the .. and . directories
+            "Note: we must match .. AND ../ cos sometimes the globpath returns
+            "../ for path with strange chars (eg $)
+            if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
+
+                try
+                    "create a new path and see if it exists in this nodes children
+                    let path = s:Path.New(i)
+                    let newNode = self.getChild(path)
+                    if newNode != {}
+                        call newNode.refresh()
+                        call add(newChildNodes, newNode)
+
+                    "the node doesnt exist so create it
+                    else
+                        let newNode = s:TreeFileNode.New(path)
+                        let newNode.parent = self
+                        call add(newChildNodes, newNode)
+                    endif
+
+
+                catch /^NERDTree.InvalidArgumentsError/
+                    let invalidFilesFound = 1
+                endtry
+            endif
+        endfor
+
+        "swap this nodes children out for the children we just read/refreshed
+        let self.children = newChildNodes
+        call self.sortChildren()
+
+        if invalidFilesFound
+            call s:echoWarning("some files could not be loaded into the NERD tree")
+        endif
+    endif
+endfunction
+
+"FUNCTION: TreeDirNode.reveal(path) {{{3
+"reveal the given path, i.e. cache and open all treenodes needed to display it
+"in the UI
+function! s:TreeDirNode.reveal(path)
+    if !a:path.isUnder(self.path)
+        throw "NERDTree.InvalidArgumentsError: " . a:path.str() . " should be under " . self.path.str()
+    endif
+
+    call self.open()
+
+    if self.path.equals(a:path.getParent())
+        let n = self.findNode(a:path)
+        call s:renderView()
+        call n.putCursorHere(1,0)
+        return
+    endif
+
+    let p = a:path
+    while !p.getParent().equals(self.path)
+        let p = p.getParent()
+    endwhile
+
+    let n = self.findNode(p)
+    call n.reveal(a:path)
+endfunction
+"FUNCTION: TreeDirNode.removeChild(treenode) {{{3
+"
+"Removes the given treenode from this nodes set of children
+"
+"Args:
+"treenode: the node to remove
+"
+"Throws a NERDTree.ChildNotFoundError if the given treenode is not found
+function! s:TreeDirNode.removeChild(treenode)
+    for i in range(0, self.getChildCount()-1)
+        if self.children[i].equals(a:treenode)
+            call remove(self.children, i)
+            return
+        endif
+    endfor
+
+    throw "NERDTree.ChildNotFoundError: child node was not found"
+endfunction
+
+"FUNCTION: TreeDirNode.sortChildren() {{{3
+"
+"Sorts the children of this node according to alphabetical order and the
+"directory priority.
+"
+function! s:TreeDirNode.sortChildren()
+    let CompareFunc = function("s:compareNodes")
+    call sort(self.children, CompareFunc)
+endfunction
+
+"FUNCTION: TreeDirNode.toggleOpen() {{{3
+"Opens this directory if it is closed and vice versa
+function! s:TreeDirNode.toggleOpen()
+    if self.isOpen ==# 1
+        call self.close()
+    else
+        call self.open()
+    endif
+endfunction
+
+"FUNCTION: TreeDirNode.transplantChild(newNode) {{{3
+"Replaces the child of this with the given node (where the child node's full
+"path matches a:newNode's fullpath). The search for the matching node is
+"non-recursive
+"
+"Arg:
+"newNode: the node to graft into the tree
+function! s:TreeDirNode.transplantChild(newNode)
+    for i in range(0, self.getChildCount()-1)
+        if self.children[i].equals(a:newNode)
+            let self.children[i] = a:newNode
+            let a:newNode.parent = self
+            break
+        endif
+    endfor
+endfunction
+"============================================================
+"CLASS: Path {{{2
+"============================================================
+let s:Path = {}
+"FUNCTION: Path.AbsolutePathFor(str) {{{3
+function! s:Path.AbsolutePathFor(str)
+    let prependCWD = 0
+    if s:running_windows
+        let prependCWD = a:str !~ '^.:\(\\\|\/\)'
+    else
+        let prependCWD = a:str !~ '^/'
+    endif
+
+    let toReturn = a:str
+    if prependCWD
+        let toReturn = getcwd() . s:Path.Slash() . a:str
+    endif
+
+    return toReturn
+endfunction
+"FUNCTION: Path.bookmarkNames() {{{3
+function! s:Path.bookmarkNames()
+    if !exists("self._bookmarkNames")
+        call self.cacheDisplayString()
+    endif
+    return self._bookmarkNames
+endfunction
+"FUNCTION: Path.cacheDisplayString() {{{3
+function! s:Path.cacheDisplayString()
+    let self.cachedDisplayString = self.getLastPathComponent(1)
+
+    if self.isExecutable
+        let self.cachedDisplayString = self.cachedDisplayString . '*'
+    endif
+
+    let self._bookmarkNames = []
+    for i in s:Bookmark.Bookmarks()
+        if i.path.equals(self)
+            call add(self._bookmarkNames, i.name)
+        endif
+    endfor
+    if !empty(self._bookmarkNames)
+        let self.cachedDisplayString .= ' {' . join(self._bookmarkNames) . '}'
+    endif
+
+    if self.isSymLink
+        let self.cachedDisplayString .=  ' -> ' . self.symLinkDest
+    endif
+
+    if self.isReadOnly
+        let self.cachedDisplayString .=  ' [RO]'
+    endif
+endfunction
+"FUNCTION: Path.changeToDir() {{{3
+function! s:Path.changeToDir()
+    let dir = self.str({'format': 'Cd'})
+    if self.isDirectory ==# 0
+        let dir = self.getParent().str({'format': 'Cd'})
+    endif
+
+    try
+        execute "cd " . dir
+        call s:echo("CWD is now: " . getcwd())
+    catch
+        throw "NERDTree.PathChangeError: cannot change CWD to " . dir
+    endtry
+endfunction
+
+"FUNCTION: Path.compareTo() {{{3
+"
+"Compares this Path to the given path and returns 0 if they are equal, -1 if
+"this Path is "less than" the given path, or 1 if it is "greater".
+"
+"Args:
+"path: the path object to compare this to
+"
+"Return:
+"1, -1 or 0
+function! s:Path.compareTo(path)
+    let thisPath = self.getLastPathComponent(1)
+    let thatPath = a:path.getLastPathComponent(1)
+
+    "if the paths are the same then clearly we return 0
+    if thisPath ==# thatPath
+        return 0
+    endif
+
+    let thisSS = self.getSortOrderIndex()
+    let thatSS = a:path.getSortOrderIndex()
+
+    "compare the sort sequences, if they are different then the return
+    "value is easy
+    if thisSS < thatSS
+        return -1
+    elseif thisSS > thatSS
+        return 1
+    else
+        "if the sort sequences are the same then compare the paths
+        "alphabetically
+        let pathCompare = g:NERDTreeCaseSensitiveSort ? thisPath <# thatPath : thisPath <? thatPath
+        if pathCompare
+            return -1
+        else
+            return 1
+        endif
+    endif
+endfunction
+
+"FUNCTION: Path.Create(fullpath) {{{3
+"
+"Factory method.
+"
+"Creates a path object with the given path. The path is also created on the
+"filesystem. If the path already exists, a NERDTree.Path.Exists exception is
+"thrown. If any other errors occur, a NERDTree.Path exception is thrown.
+"
+"Args:
+"fullpath: the full filesystem path to the file/dir to create
+function! s:Path.Create(fullpath)
+    "bail if the a:fullpath already exists
+    if isdirectory(a:fullpath) || filereadable(a:fullpath)
+        throw "NERDTree.CreatePathError: Directory Exists: '" . a:fullpath . "'"
+    endif
+
+    try
+
+        "if it ends with a slash, assume its a dir create it
+        if a:fullpath =~ '\(\\\|\/\)$'
+            "whack the trailing slash off the end if it exists
+            let fullpath = substitute(a:fullpath, '\(\\\|\/\)$', '', '')
+
+            call mkdir(fullpath, 'p')
+
+        "assume its a file and create
+        else
+            call writefile([], a:fullpath)
+        endif
+    catch
+        throw "NERDTree.CreatePathError: Could not create path: '" . a:fullpath . "'"
+    endtry
+
+    return s:Path.New(a:fullpath)
+endfunction
+
+"FUNCTION: Path.copy(dest) {{{3
+"
+"Copies the file/dir represented by this Path to the given location
+"
+"Args:
+"dest: the location to copy this dir/file to
+function! s:Path.copy(dest)
+    if !s:Path.CopyingSupported()
+        throw "NERDTree.CopyingNotSupportedError: Copying is not supported on this OS"
+    endif
+
+    let dest = s:Path.WinToUnixPath(a:dest)
+
+    let cmd = g:NERDTreeCopyCmd . " " . self.str() . " " . dest
+    let success = system(cmd)
+    if success != 0
+        throw "NERDTree.CopyError: Could not copy ''". self.str() ."'' to: '" . a:dest . "'"
+    endif
+endfunction
+
+"FUNCTION: Path.CopyingSupported() {{{3
+"
+"returns 1 if copying is supported for this OS
+function! s:Path.CopyingSupported()
+    return exists('g:NERDTreeCopyCmd')
+endfunction
+
+
+"FUNCTION: Path.copyingWillOverwrite(dest) {{{3
+"
+"returns 1 if copy this path to the given location will cause files to
+"overwritten
+"
+"Args:
+"dest: the location this path will be copied to
+function! s:Path.copyingWillOverwrite(dest)
+    if filereadable(a:dest)
+        return 1
+    endif
+
+    if isdirectory(a:dest)
+        let path = s:Path.JoinPathStrings(a:dest, self.getLastPathComponent(0))
+        if filereadable(path)
+            return 1
+        endif
+    endif
+endfunction
+
+"FUNCTION: Path.delete() {{{3
+"
+"Deletes the file represented by this path.
+"Deletion of directories is not supported
+"
+"Throws NERDTree.Path.Deletion exceptions
+function! s:Path.delete()
+    if self.isDirectory
+
+        let cmd = g:NERDTreeRemoveDirCmd . self.str({'escape': 1})
+        let success = system(cmd)
+
+        if v:shell_error != 0
+            throw "NERDTree.PathDeletionError: Could not delete directory: '" . self.str() . "'"
+        endif
+    else
+        let success = delete(self.str())
+        if success != 0
+            throw "NERDTree.PathDeletionError: Could not delete file: '" . self.str() . "'"
+        endif
+    endif
+
+    "delete all bookmarks for this path
+    for i in self.bookmarkNames()
+        let bookmark = s:Bookmark.BookmarkFor(i)
+        call bookmark.delete()
+    endfor
+endfunction
+
+"FUNCTION: Path.displayString() {{{3
+"
+"Returns a string that specifies how the path should be represented as a
+"string
+function! s:Path.displayString()
+    if self.cachedDisplayString ==# ""
+        call self.cacheDisplayString()
+    endif
+
+    return self.cachedDisplayString
+endfunction
+"FUNCTION: Path.extractDriveLetter(fullpath) {{{3
+"
+"If running windows, cache the drive letter for this path
+function! s:Path.extractDriveLetter(fullpath)
+    if s:running_windows
+        let self.drive = substitute(a:fullpath, '\(^[a-zA-Z]:\).*', '\1', '')
+    else
+        let self.drive = ''
+    endif
+
+endfunction
+"FUNCTION: Path.exists() {{{3
+"return 1 if this path points to a location that is readable or is a directory
+function! s:Path.exists()
+    let p = self.str()
+    return filereadable(p) || isdirectory(p)
+endfunction
+"FUNCTION: Path.getDir() {{{3
+"
+"Returns this path if it is a directory, else this paths parent.
+"
+"Return:
+"a Path object
+function! s:Path.getDir()
+    if self.isDirectory
+        return self
+    else
+        return self.getParent()
+    endif
+endfunction
+"FUNCTION: Path.getParent() {{{3
+"
+"Returns a new path object for this paths parent
+"
+"Return:
+"a new Path object
+function! s:Path.getParent()
+    if s:running_windows
+        let path = self.drive . '\' . join(self.pathSegments[0:-2], '\')
+    else
+        let path = '/'. join(self.pathSegments[0:-2], '/')
+    endif
+
+    return s:Path.New(path)
+endfunction
+"FUNCTION: Path.getLastPathComponent(dirSlash) {{{3
+"
+"Gets the last part of this path.
+"
+"Args:
+"dirSlash: if 1 then a trailing slash will be added to the returned value for
+"directory nodes.
+function! s:Path.getLastPathComponent(dirSlash)
+    if empty(self.pathSegments)
+        return ''
+    endif
+    let toReturn = self.pathSegments[-1]
+    if a:dirSlash && self.isDirectory
+        let toReturn = toReturn . '/'
+    endif
+    return toReturn
+endfunction
+
+"FUNCTION: Path.getSortOrderIndex() {{{3
+"returns the index of the pattern in g:NERDTreeSortOrder that this path matches
+function! s:Path.getSortOrderIndex()
+    let i = 0
+    while i < len(g:NERDTreeSortOrder)
+        if  self.getLastPathComponent(1) =~ g:NERDTreeSortOrder[i]
+            return i
+        endif
+        let i = i + 1
+    endwhile
+    return s:NERDTreeSortStarIndex
+endfunction
+
+"FUNCTION: Path.ignore() {{{3
+"returns true if this path should be ignored
+function! s:Path.ignore()
+    let lastPathComponent = self.getLastPathComponent(0)
+
+    "filter out the user specified paths to ignore
+    if b:NERDTreeIgnoreEnabled
+        for i in g:NERDTreeIgnore
+            if lastPathComponent =~ i
+                return 1
+            endif
+        endfor
+    endif
+
+    "dont show hidden files unless instructed to
+    if b:NERDTreeShowHidden ==# 0 && lastPathComponent =~ '^\.'
+        return 1
+    endif
+
+    if b:NERDTreeShowFiles ==# 0 && self.isDirectory ==# 0
+        return 1
+    endif
+
+    return 0
+endfunction
+
+"FUNCTION: Path.isUnder(path) {{{3
+"return 1 if this path is somewhere under the given path in the filesystem.
+"
+"a:path should be a dir
+function! s:Path.isUnder(path)
+    if a:path.isDirectory == 0
+        return 0
+    endif
+
+    let this = self.str()
+    let that = a:path.str()
+    return stridx(this, that . s:Path.Slash()) == 0
+endfunction
+
+"FUNCTION: Path.JoinPathStrings(...) {{{3
+function! s:Path.JoinPathStrings(...)
+    let components = []
+    for i in a:000
+        let components = extend(components, split(i, '/'))
+    endfor
+    return '/' . join(components, '/')
+endfunction
+
+"FUNCTION: Path.equals() {{{3
+"
+"Determines whether 2 path objects are "equal".
+"They are equal if the paths they represent are the same
+"
+"Args:
+"path: the other path obj to compare this with
+function! s:Path.equals(path)
+    return self.str() ==# a:path.str()
+endfunction
+
+"FUNCTION: Path.New() {{{3
+"The Constructor for the Path object
+function! s:Path.New(path)
+    let newPath = copy(self)
+
+    call newPath.readInfoFromDisk(s:Path.AbsolutePathFor(a:path))
+
+    let newPath.cachedDisplayString = ""
+
+    return newPath
+endfunction
+
+"FUNCTION: Path.Slash() {{{3
+"return the slash to use for the current OS
+function! s:Path.Slash()
+    return s:running_windows ? '\' : '/'
+endfunction
+
+"FUNCTION: Path.readInfoFromDisk(fullpath) {{{3
+"
+"
+"Throws NERDTree.Path.InvalidArguments exception.
+function! s:Path.readInfoFromDisk(fullpath)
+    call self.extractDriveLetter(a:fullpath)
+
+    let fullpath = s:Path.WinToUnixPath(a:fullpath)
+
+    if getftype(fullpath) ==# "fifo"
+        throw "NERDTree.InvalidFiletypeError: Cant handle FIFO files: " . a:fullpath
+    endif
+
+    let self.pathSegments = split(fullpath, '/')
+
+    let self.isReadOnly = 0
+    if isdirectory(a:fullpath)
+        let self.isDirectory = 1
+    elseif filereadable(a:fullpath)
+        let self.isDirectory = 0
+        let self.isReadOnly = filewritable(a:fullpath) ==# 0
+    else
+        throw "NERDTree.InvalidArgumentsError: Invalid path = " . a:fullpath
+    endif
+
+    let self.isExecutable = 0
+    if !self.isDirectory
+        let self.isExecutable = getfperm(a:fullpath) =~ 'x'
+    endif
+
+    "grab the last part of the path (minus the trailing slash)
+    let lastPathComponent = self.getLastPathComponent(0)
+
+    "get the path to the new node with the parent dir fully resolved
+    let hardPath = resolve(self.strTrunk()) . '/' . lastPathComponent
+
+    "if  the last part of the path is a symlink then flag it as such
+    let self.isSymLink = (resolve(hardPath) != hardPath)
+    if self.isSymLink
+        let self.symLinkDest = resolve(fullpath)
+
+        "if the link is a dir then slap a / on the end of its dest
+        if isdirectory(self.symLinkDest)
+
+            "we always wanna treat MS windows shortcuts as files for
+            "simplicity
+            if hardPath !~ '\.lnk$'
+
+                let self.symLinkDest = self.symLinkDest . '/'
+            endif
+        endif
+    endif
+endfunction
+
+"FUNCTION: Path.refresh() {{{3
+function! s:Path.refresh()
+    call self.readInfoFromDisk(self.str())
+    call self.cacheDisplayString()
+endfunction
+
+"FUNCTION: Path.rename() {{{3
+"
+"Renames this node on the filesystem
+function! s:Path.rename(newPath)
+    if a:newPath ==# ''
+        throw "NERDTree.InvalidArgumentsError: Invalid newPath for renaming = ". a:newPath
+    endif
+
+    let success =  rename(self.str(), a:newPath)
+    if success != 0
+        throw "NERDTree.PathRenameError: Could not rename: '" . self.str() . "'" . 'to:' . a:newPath
+    endif
+    call self.readInfoFromDisk(a:newPath)
+
+    for i in self.bookmarkNames()
+        let b = s:Bookmark.BookmarkFor(i)
+        call b.setPath(copy(self))
+    endfor
+    call s:Bookmark.Write()
+endfunction
+
+"FUNCTION: Path.str() {{{3
+"
+"Returns a string representation of this Path
+"
+"Takes an optional dictionary param to specify how the output should be
+"formatted.
+"
+"The dict may have the following keys:
+"  'format'
+"  'escape'
+"  'truncateTo'
+"
+"The 'format' key may have a value of:
+"  'Cd' - a string to be used with the :cd command
+"  'Edit' - a string to be used with :e :sp :new :tabedit etc
+"  'UI' - a string used in the NERD tree UI
+"
+"The 'escape' key, if specified will cause the output to be escaped with
+"shellescape()
+"
+"The 'truncateTo' key causes the resulting string to be truncated to the value
+"'truncateTo' maps to. A '<' char will be prepended.
+function! s:Path.str(...)
+    let options = a:0 ? a:1 : {}
+    let toReturn = ""
+
+    if has_key(options, 'format')
+        let format = options['format']
+        if has_key(self, '_strFor' . format)
+            exec 'let toReturn = self._strFor' . format . '()'
+        else
+            raise 'NERDTree.UnknownFormatError: unknown format "'. format .'"'
+        endif
+    else
+        let toReturn = self._str()
+    endif
+
+    if has_key(options, 'escape') && options['escape']
+        let toReturn = shellescape(toReturn)
+    endif
+
+    if has_key(options, 'truncateTo')
+        let limit = options['truncateTo']
+        if len(toReturn) > limit
+            let toReturn = "<" . strpart(toReturn, len(toReturn) - limit + 1)
+        endif
+    endif
+
+    return toReturn
+endfunction
+
+"FUNCTION: Path._strForUI() {{{3
+function! s:Path._strForUI()
+    let toReturn = '/' . join(self.pathSegments, '/')
+    if self.isDirectory && toReturn != '/'
+        let toReturn  = toReturn . '/'
+    endif
+    return toReturn
+endfunction
+
+"FUNCTION: Path._strForCd() {{{3
+"
+" returns a string that can be used with :cd
+function! s:Path._strForCd()
+    return escape(self.str(), s:escape_chars)
+endfunction
+"FUNCTION: Path._strForEdit() {{{3
+"
+"Return: the string for this path that is suitable to be used with the :edit
+"command
+function! s:Path._strForEdit()
+    let p = self.str({'format': 'UI'})
+    let cwd = getcwd()
+
+    if s:running_windows
+        let p = tolower(self.str())
+        let cwd = tolower(getcwd())
+    endif
+
+    let p = escape(p, s:escape_chars)
+
+    let cwd = cwd . s:Path.Slash()
+
+    "return a relative path if we can
+    if stridx(p, cwd) ==# 0
+        let p = strpart(p, strlen(cwd))
+    endif
+
+    if p ==# ''
+        let p = '.'
+    endif
+
+    return p
+
+endfunction
+"FUNCTION: Path._strForGlob() {{{3
+function! s:Path._strForGlob()
+    let lead = s:Path.Slash()
+
+    "if we are running windows then slap a drive letter on the front
+    if s:running_windows
+        let lead = self.drive . '\'
+    endif
+
+    let toReturn = lead . join(self.pathSegments, s:Path.Slash())
+
+    if !s:running_windows
+        let toReturn = escape(toReturn, s:escape_chars)
+    endif
+    return toReturn
+endfunction
+"FUNCTION: Path._str() {{{3
+"
+"Gets the string path for this path object that is appropriate for the OS.
+"EG, in windows c:\foo\bar
+"    in *nix  /foo/bar
+function! s:Path._str()
+    let lead = s:Path.Slash()
+
+    "if we are running windows then slap a drive letter on the front
+    if s:running_windows
+        let lead = self.drive . '\'
+    endif
+
+    return lead . join(self.pathSegments, s:Path.Slash())
+endfunction
+
+"FUNCTION: Path.strTrunk() {{{3
+"Gets the path without the last segment on the end.
+function! s:Path.strTrunk()
+    return self.drive . '/' . join(self.pathSegments[0:-2], '/')
+endfunction
+
+"FUNCTION: Path.WinToUnixPath(pathstr){{{3
+"Takes in a windows path and returns the unix equiv
+"
+"A class level method
+"
+"Args:
+"pathstr: the windows path to convert
+function! s:Path.WinToUnixPath(pathstr)
+    if !s:running_windows
+        return a:pathstr
+    endif
+
+    let toReturn = a:pathstr
+
+    "remove the x:\ of the front
+    let toReturn = substitute(toReturn, '^.*:\(\\\|/\)\?', '/', "")
+
+    "convert all \ chars to /
+    let toReturn = substitute(toReturn, '\', '/', "g")
+
+    return toReturn
+endfunction
+
+" SECTION: General Functions {{{1
+"============================================================
+"FUNCTION: s:bufInWindows(bnum){{{2
+"[[STOLEN FROM VTREEEXPLORER.VIM]]
+"Determine the number of windows open to this buffer number.
+"Care of Yegappan Lakshman.  Thanks!
+"
+"Args:
+"bnum: the subject buffers buffer number
+function! s:bufInWindows(bnum)
+    let cnt = 0
+    let winnum = 1
+    while 1
+        let bufnum = winbufnr(winnum)
+        if bufnum < 0
+            break
+        endif
+        if bufnum ==# a:bnum
+            let cnt = cnt + 1
+        endif
+        let winnum = winnum + 1
+    endwhile
+
+    return cnt
+endfunction " >>>
+"FUNCTION: s:checkForBrowse(dir) {{{2
+"inits a secondary nerd tree in the current buffer if appropriate
+function! s:checkForBrowse(dir)
+    if a:dir != '' && isdirectory(a:dir)
+        call s:initNerdTreeInPlace(a:dir)
+    endif
+endfunction
+"FUNCTION: s:compareBookmarks(first, second) {{{2
+"Compares two bookmarks
+function! s:compareBookmarks(first, second)
+    return a:first.compareTo(a:second)
+endfunction
+
+" FUNCTION: s:completeBookmarks(A,L,P) {{{2
+" completion function for the bookmark commands
+function! s:completeBookmarks(A,L,P)
+    return filter(s:Bookmark.BookmarkNames(), 'v:val =~ "^' . a:A . '"')
+endfunction
+" FUNCTION: s:exec(cmd) {{{2
+" same as :exec cmd  but eventignore=all is set for the duration
+function! s:exec(cmd)
+    let old_ei = &ei
+    set ei=all
+    exec a:cmd
+    let &ei = old_ei
+endfunction
+" FUNCTION: s:findAndRevealPath() {{{2
+function! s:findAndRevealPath()
+    try
+        let p = s:Path.New(expand("%:p"))
+    catch /^NERDTree.InvalidArgumentsError/
+        call s:echo("no file for the current buffer")
+        return
+    endtry
+
+    if !s:treeExistsForTab()
+        call s:initNerdTree(p.getParent().str())
+    else
+        if !p.isUnder(s:TreeFileNode.GetRootForTab().path)
+            call s:initNerdTree(p.getParent().str())
+        else
+            if !s:isTreeOpen()
+                call s:toggle("")
+            endif
+        endif
+    endif
+    call s:putCursorInTreeWin()
+    call b:NERDTreeRoot.reveal(p)
+endfunction
+"FUNCTION: s:initNerdTree(name) {{{2
+"Initialise the nerd tree for this tab. The tree will start in either the
+"given directory, or the directory associated with the given bookmark
+"
+"Args:
+"name: the name of a bookmark or a directory
+function! s:initNerdTree(name)
+    let path = {}
+    if s:Bookmark.BookmarkExistsFor(a:name)
+        let path = s:Bookmark.BookmarkFor(a:name).path
+    else
+        let dir = a:name ==# '' ? getcwd() : a:name
+
+        "hack to get an absolute path if a relative path is given
+        if dir =~ '^\.'
+            let dir = getcwd() . s:Path.Slash() . dir
+        endif
+        let dir = resolve(dir)
+
+        try
+            let path = s:Path.New(dir)
+        catch /^NERDTree.InvalidArgumentsError/
+            call s:echo("No bookmark or directory found for: " . a:name)
+            return
+        endtry
+    endif
+    if !path.isDirectory
+        let path = path.getParent()
+    endif
+
+    "if instructed to, then change the vim CWD to the dir the NERDTree is
+    "inited in
+    if g:NERDTreeChDirMode != 0
+        call path.changeToDir()
+    endif
+
+    if s:treeExistsForTab()
+        if s:isTreeOpen()
+            call s:closeTree()
+        endif
+        unlet t:NERDTreeBufName
+    endif
+
+    let newRoot = s:TreeDirNode.New(path)
+    call newRoot.open()
+
+    call s:createTreeWin()
+    let b:treeShowHelp = 0
+    let b:NERDTreeIgnoreEnabled = 1
+    let b:NERDTreeShowFiles = g:NERDTreeShowFiles
+    let b:NERDTreeShowHidden = g:NERDTreeShowHidden
+    let b:NERDTreeShowBookmarks = g:NERDTreeShowBookmarks
+    let b:NERDTreeRoot = newRoot
+
+    let b:NERDTreeType = "primary"
+
+    call s:renderView()
+    call b:NERDTreeRoot.putCursorHere(0, 0)
+endfunction
+
+"FUNCTION: s:initNerdTreeInPlace(dir) {{{2
+function! s:initNerdTreeInPlace(dir)
+    try
+        let path = s:Path.New(a:dir)
+    catch /^NERDTree.InvalidArgumentsError/
+        call s:echo("Invalid directory name:" . a:name)
+        return
+    endtry
+
+    "we want the directory buffer to disappear when we do the :edit below
+    setlocal bufhidden=wipe
+
+    let previousBuf = expand("#")
+
+    "we need a unique name for each secondary tree buffer to ensure they are
+    "all independent
+    exec "silent edit " . s:nextBufferName()
+
+    let b:NERDTreePreviousBuf = bufnr(previousBuf)
+
+    let b:NERDTreeRoot = s:TreeDirNode.New(path)
+    call b:NERDTreeRoot.open()
+
+    "throwaway buffer options
+    setlocal noswapfile
+    setlocal buftype=nofile
+    setlocal bufhidden=hide
+    setlocal nowrap
+    setlocal foldcolumn=0
+    setlocal nobuflisted
+    setlocal nospell
+    if g:NERDTreeShowLineNumbers
+        setlocal nu
+    else
+        setlocal nonu
+    endif
+
+    iabc <buffer>
+
+    if g:NERDTreeHighlightCursorline
+        setlocal cursorline
+    endif
+
+    call s:setupStatusline()
+
+    let b:treeShowHelp = 0
+    let b:NERDTreeIgnoreEnabled = 1
+    let b:NERDTreeShowFiles = g:NERDTreeShowFiles
+    let b:NERDTreeShowHidden = g:NERDTreeShowHidden
+    let b:NERDTreeShowBookmarks = g:NERDTreeShowBookmarks
+
+    let b:NERDTreeType = "secondary"
+
+    call s:bindMappings()
+    setfiletype nerdtree
+    " syntax highlighting
+    if has("syntax") && exists("g:syntax_on")
+        call s:setupSyntaxHighlighting()
+    endif
+
+    call s:renderView()
+endfunction
+" FUNCTION: s:initNerdTreeMirror() {{{2
+function! s:initNerdTreeMirror()
+
+    "get the names off all the nerd tree buffers
+    let treeBufNames = []
+    for i in range(1, tabpagenr("$"))
+        let nextName = s:tabpagevar(i, 'NERDTreeBufName')
+        if nextName != -1 && (!exists("t:NERDTreeBufName") || nextName != t:NERDTreeBufName)
+            call add(treeBufNames, nextName)
+        endif
+    endfor
+    let treeBufNames = s:unique(treeBufNames)
+
+    "map the option names (that the user will be prompted with) to the nerd
+    "tree buffer names
+    let options = {}
+    let i = 0
+    while i < len(treeBufNames)
+        let bufName = treeBufNames[i]
+        let treeRoot = getbufvar(bufName, "NERDTreeRoot")
+        let options[i+1 . '. ' . treeRoot.path.str() . '  (buf name: ' . bufName . ')'] = bufName
+        let i = i + 1
+    endwhile
+
+    "work out which tree to mirror, if there is more than 1 then ask the user
+    let bufferName = ''
+    if len(keys(options)) > 1
+        let choices = ["Choose a tree to mirror"]
+        let choices = extend(choices, sort(keys(options)))
+        let choice = inputlist(choices)
+        if choice < 1 || choice > len(options) || choice ==# ''
+            return
+        endif
+
+        let bufferName = options[sort(keys(options))[choice-1]]
+    elseif len(keys(options)) ==# 1
+        let bufferName = values(options)[0]
+    else
+        call s:echo("No trees to mirror")
+        return
+    endif
+
+    if s:treeExistsForTab() && s:isTreeOpen()
+        call s:closeTree()
+    endif
+
+    let t:NERDTreeBufName = bufferName
+    call s:createTreeWin()
+    exec 'buffer ' .  bufferName
+    if !&hidden
+        call s:renderView()
+    endif
+endfunction
+" FUNCTION: s:nextBufferName() {{{2
+" returns the buffer name for the next nerd tree
+function! s:nextBufferName()
+    let name = s:NERDTreeBufName . s:next_buffer_number
+    let s:next_buffer_number += 1
+    return name
+endfunction
+" FUNCTION: s:tabpagevar(tabnr, var) {{{2
+function! s:tabpagevar(tabnr, var)
+    let currentTab = tabpagenr()
+    let old_ei = &ei
+    set ei=all
+
+    exec "tabnext " . a:tabnr
+    let v = -1
+    if exists('t:' . a:var)
+        exec 'let v = t:' . a:var
+    endif
+    exec "tabnext " . currentTab
+
+    let &ei = old_ei
+
+    return v
+endfunction
+" Function: s:treeExistsForBuffer()   {{{2
+" Returns 1 if a nerd tree root exists in the current buffer
+function! s:treeExistsForBuf()
+    return exists("b:NERDTreeRoot")
+endfunction
+" Function: s:treeExistsForTab()   {{{2
+" Returns 1 if a nerd tree root exists in the current tab
+function! s:treeExistsForTab()
+    return exists("t:NERDTreeBufName")
+endfunction
+" Function: s:unique(list)   {{{2
+" returns a:list without duplicates
+function! s:unique(list)
+  let uniqlist = []
+  for elem in a:list
+    if index(uniqlist, elem) ==# -1
+      let uniqlist += [elem]
+    endif
+  endfor
+  return uniqlist
+endfunction
+" SECTION: Public API {{{1
+"============================================================
+let g:NERDTreePath = s:Path
+let g:NERDTreeDirNode = s:TreeDirNode
+let g:NERDTreeFileNode = s:TreeFileNode
+let g:NERDTreeBookmark = s:Bookmark
+
+function! NERDTreeAddMenuItem(options)
+    call s:MenuItem.Create(a:options)
+endfunction
+
+function! NERDTreeAddMenuSeparator(...)
+    let opts = a:0 ? a:1 : {}
+    call s:MenuItem.CreateSeparator(opts)
+endfunction
+
+function! NERDTreeAddSubmenu(options)
+    return s:MenuItem.Create(a:options)
+endfunction
+
+function! NERDTreeAddKeyMap(options)
+    call s:KeyMap.Create(a:options)
+endfunction
+
+function! NERDTreeRender()
+    call s:renderView()
+endfunction
+
+" SECTION: View Functions {{{1
+"============================================================
+"FUNCTION: s:centerView() {{{2
+"centers the nerd tree window around the cursor (provided the nerd tree
+"options permit)
+function! s:centerView()
+    if g:NERDTreeAutoCenter
+        let current_line = winline()
+        let lines_to_top = current_line
+        let lines_to_bottom = winheight(s:getTreeWinNum()) - current_line
+        if lines_to_top < g:NERDTreeAutoCenterThreshold || lines_to_bottom < g:NERDTreeAutoCenterThreshold
+            normal! zz
+        endif
+    endif
+endfunction
+"FUNCTION: s:closeTree() {{{2
+"Closes the primary NERD tree window for this tab
+function! s:closeTree()
+    if !s:isTreeOpen()
+        throw "NERDTree.NoTreeFoundError: no NERDTree is open"
+    endif
+
+    if winnr("$") != 1
+        if winnr() == s:getTreeWinNum()
+            wincmd p
+            let bufnr = bufnr("")
+            wincmd p
+        else
+            let bufnr = bufnr("")
+        endif
+
+        call s:exec(s:getTreeWinNum() . " wincmd w")
+        close
+        call s:exec(bufwinnr(bufnr) . " wincmd w")
+    else
+        close
+    endif
+endfunction
+
+"FUNCTION: s:closeTreeIfOpen() {{{2
+"Closes the NERD tree window if it is open
+function! s:closeTreeIfOpen()
+   if s:isTreeOpen()
+      call s:closeTree()
+   endif
+endfunction
+"FUNCTION: s:closeTreeIfQuitOnOpen() {{{2
+"Closes the NERD tree window if the close on open option is set
+function! s:closeTreeIfQuitOnOpen()
+    if g:NERDTreeQuitOnOpen && s:isTreeOpen()
+        call s:closeTree()
+    endif
+endfunction
+"FUNCTION: s:createTreeWin() {{{2
+"Inits the NERD tree window. ie. opens it, sizes it, sets all the local
+"options etc
+function! s:createTreeWin()
+    "create the nerd tree window
+    let splitLocation = g:NERDTreeWinPos ==# "left" ? "topleft " : "botright "
+    let splitSize = g:NERDTreeWinSize
+
+    if !exists('t:NERDTreeBufName')
+        let t:NERDTreeBufName = s:nextBufferName()
+        silent! exec splitLocation . 'vertical ' . splitSize . ' new'
+        silent! exec "edit " . t:NERDTreeBufName
+    else
+        silent! exec splitLocation . 'vertical ' . splitSize . ' split'
+        silent! exec "buffer " . t:NERDTreeBufName
+    endif
+
+    setlocal winfixwidth
+
+    "throwaway buffer options
+    setlocal noswapfile
+    setlocal buftype=nofile
+    setlocal nowrap
+    setlocal foldcolumn=0
+    setlocal nobuflisted
+    setlocal nospell
+    if g:NERDTreeShowLineNumbers
+        setlocal nu
+    else
+        setlocal nonu
+    endif
+
+    iabc <buffer>
+
+    if g:NERDTreeHighlightCursorline
+        setlocal cursorline
+    endif
+
+    call s:setupStatusline()
+
+    call s:bindMappings()
+    setfiletype nerdtree
+    " syntax highlighting
+    if has("syntax") && exists("g:syntax_on")
+        call s:setupSyntaxHighlighting()
+    endif
+endfunction
+
+"FUNCTION: s:dumpHelp  {{{2
+"prints out the quick help
+function! s:dumpHelp()
+    let old_h = @h
+    if b:treeShowHelp ==# 1
+        let @h=   "\" NERD tree (" . s:NERD_tree_version . ") quickhelp~\n"
+        let @h=@h."\" ============================\n"
+        let @h=@h."\" File node mappings~\n"
+        let @h=@h."\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
+        let @h=@h."\" <CR>,\n"
+        if b:NERDTreeType ==# "primary"
+            let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in prev window\n"
+        else
+            let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in current window\n"
+        endif
+        if b:NERDTreeType ==# "primary"
+            let @h=@h."\" ". g:NERDTreeMapPreview .": preview\n"
+        endif
+        let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
+        let @h=@h."\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n"
+        let @h=@h."\" middle-click,\n"
+        let @h=@h."\" ". g:NERDTreeMapOpenSplit .": open split\n"
+        let @h=@h."\" ". g:NERDTreeMapPreviewSplit .": preview split\n"
+        let @h=@h."\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n"
+        let @h=@h."\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n"
+
+        let @h=@h."\"\n\" ----------------------------\n"
+        let @h=@h."\" Directory node mappings~\n"
+        let @h=@h."\" ". (g:NERDTreeMouseMode ==# 1 ? "double" : "single") ."-click,\n"
+        let @h=@h."\" ". g:NERDTreeMapActivateNode .": open & close node\n"
+        let @h=@h."\" ". g:NERDTreeMapOpenRecursively .": recursively open node\n"
+        let @h=@h."\" ". g:NERDTreeMapCloseDir .": close parent of node\n"
+        let @h=@h."\" ". g:NERDTreeMapCloseChildren .": close all child nodes of\n"
+        let @h=@h."\"    current node recursively\n"
+        let @h=@h."\" middle-click,\n"
+        let @h=@h."\" ". g:NERDTreeMapOpenExpl.": explore selected dir\n"
+
+        let @h=@h."\"\n\" ----------------------------\n"
+        let @h=@h."\" Bookmark table mappings~\n"
+        let @h=@h."\" double-click,\n"
+        let @h=@h."\" ". g:NERDTreeMapActivateNode .": open bookmark\n"
+        let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
+        let @h=@h."\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n"
+        let @h=@h."\" ". g:NERDTreeMapDeleteBookmark .": delete bookmark\n"
+
+        let @h=@h."\"\n\" ----------------------------\n"
+        let @h=@h."\" Tree navigation mappings~\n"
+        let @h=@h."\" ". g:NERDTreeMapJumpRoot .": go to root\n"
+        let @h=@h."\" ". g:NERDTreeMapJumpParent .": go to parent\n"
+        let @h=@h."\" ". g:NERDTreeMapJumpFirstChild  .": go to first child\n"
+        let @h=@h."\" ". g:NERDTreeMapJumpLastChild   .": go to last child\n"
+        let @h=@h."\" ". g:NERDTreeMapJumpNextSibling .": go to next sibling\n"
+        let @h=@h."\" ". g:NERDTreeMapJumpPrevSibling .": go to prev sibling\n"
+
+        let @h=@h."\"\n\" ----------------------------\n"
+        let @h=@h."\" Filesystem mappings~\n"
+        let @h=@h."\" ". g:NERDTreeMapChangeRoot .": change tree root to the\n"
+        let @h=@h."\"    selected dir\n"
+        let @h=@h."\" ". g:NERDTreeMapUpdir .": move tree root up a dir\n"
+        let @h=@h."\" ". g:NERDTreeMapUpdirKeepOpen .": move tree root up a dir\n"
+        let @h=@h."\"    but leave old root open\n"
+        let @h=@h."\" ". g:NERDTreeMapRefresh .": refresh cursor dir\n"
+        let @h=@h."\" ". g:NERDTreeMapRefreshRoot .": refresh current root\n"
+        let @h=@h."\" ". g:NERDTreeMapMenu .": Show menu\n"
+        let @h=@h."\" ". g:NERDTreeMapChdir .":change the CWD to the\n"
+        let @h=@h."\"    selected dir\n"
+
+        let @h=@h."\"\n\" ----------------------------\n"
+        let @h=@h."\" Tree filtering mappings~\n"
+        let @h=@h."\" ". g:NERDTreeMapToggleHidden .": hidden files (" . (b:NERDTreeShowHidden ? "on" : "off") . ")\n"
+        let @h=@h."\" ". g:NERDTreeMapToggleFilters .": file filters (" . (b:NERDTreeIgnoreEnabled ? "on" : "off") . ")\n"
+        let @h=@h."\" ". g:NERDTreeMapToggleFiles .": files (" . (b:NERDTreeShowFiles ? "on" : "off") . ")\n"
+        let @h=@h."\" ". g:NERDTreeMapToggleBookmarks .": bookmarks (" . (b:NERDTreeShowBookmarks ? "on" : "off") . ")\n"
+
+        "add quickhelp entries for each custom key map
+        if len(s:KeyMap.All())
+            let @h=@h."\"\n\" ----------------------------\n"
+            let @h=@h."\" Custom mappings~\n"
+            for i in s:KeyMap.All()
+                let @h=@h."\" ". i.key .": ". i.quickhelpText ."\n"
+            endfor
+        endif
+
+        let @h=@h."\"\n\" ----------------------------\n"
+        let @h=@h."\" Other mappings~\n"
+        let @h=@h."\" ". g:NERDTreeMapQuit .": Close the NERDTree window\n"
+        let @h=@h."\" ". g:NERDTreeMapToggleZoom .": Zoom (maximize-minimize)\n"
+        let @h=@h."\"    the NERDTree window\n"
+        let @h=@h."\" ". g:NERDTreeMapHelp .": toggle help\n"
+        let @h=@h."\"\n\" ----------------------------\n"
+        let @h=@h."\" Bookmark commands~\n"
+        let @h=@h."\" :Bookmark <name>\n"
+        let @h=@h."\" :BookmarkToRoot <name>\n"
+        let @h=@h."\" :RevealBookmark <name>\n"
+        let @h=@h."\" :OpenBookmark <name>\n"
+        let @h=@h."\" :ClearBookmarks [<names>]\n"
+        let @h=@h."\" :ClearAllBookmarks\n"
+    else
+        let @h="\" Press ". g:NERDTreeMapHelp ." for help\n"
+    endif
+
+    silent! put h
+
+    let @h = old_h
+endfunction
+"FUNCTION: s:echo  {{{2
+"A wrapper for :echo. Appends 'NERDTree:' on the front of all messages
+"
+"Args:
+"msg: the message to echo
+function! s:echo(msg)
+    redraw
+    echomsg "NERDTree: " . a:msg
+endfunction
+"FUNCTION: s:echoWarning {{{2
+"Wrapper for s:echo, sets the message type to warningmsg for this message
+"Args:
+"msg: the message to echo
+function! s:echoWarning(msg)
+    echohl warningmsg
+    call s:echo(a:msg)
+    echohl normal
+endfunction
+"FUNCTION: s:echoError {{{2
+"Wrapper for s:echo, sets the message type to errormsg for this message
+"Args:
+"msg: the message to echo
+function! s:echoError(msg)
+    echohl errormsg
+    call s:echo(a:msg)
+    echohl normal
+endfunction
+"FUNCTION: s:firstUsableWindow(){{{2
+"find the window number of the first normal window
+function! s:firstUsableWindow()
+    let i = 1
+    while i <= winnr("$")
+        let bnum = winbufnr(i)
+        if bnum != -1 && getbufvar(bnum, '&buftype') ==# ''
+                    \ && !getwinvar(i, '&previewwindow')
+                    \ && (!getbufvar(bnum, '&modified') || &hidden)
+            return i
+        endif
+
+        let i += 1
+    endwhile
+    return -1
+endfunction
+"FUNCTION: s:getPath(ln) {{{2
+"Gets the full path to the node that is rendered on the given line number
+"
+"Args:
+"ln: the line number to get the path for
+"
+"Return:
+"A path if a node was selected, {} if nothing is selected.
+"If the 'up a dir' line was selected then the path to the parent of the
+"current root is returned
+function! s:getPath(ln)
+    let line = getline(a:ln)
+
+    let rootLine = s:TreeFileNode.GetRootLineNum()
+
+    "check to see if we have the root node
+    if a:ln == rootLine
+        return b:NERDTreeRoot.path
+    endif
+
+    " in case called from outside the tree
+    "if line !~ '^ *[|`โ–ถโ–ผ ]' || line =~ '^$'
+        "return {}
+    "endif
+
+    if line ==# s:tree_up_dir_line
+        return b:NERDTreeRoot.path.getParent()
+    endif
+
+    let indent = s:indentLevelFor(line)
+
+    "remove the tree parts and the leading space
+    let curFile = s:stripMarkupFromLine(line, 0)
+
+    let wasdir = 0
+    if curFile =~ '/$'
+        let wasdir = 1
+        let curFile = substitute(curFile, '/\?$', '/', "")
+    endif
+
+    let dir = ""
+    let lnum = a:ln
+    while lnum > 0
+        let lnum = lnum - 1
+        let curLine = getline(lnum)
+        let curLineStripped = s:stripMarkupFromLine(curLine, 1)
+
+        "have we reached the top of the tree?
+        if lnum == rootLine
+            let dir = b:NERDTreeRoot.path.str({'format': 'UI'}) . dir
+            break
+        endif
+        if curLineStripped =~ '/$'
+            let lpindent = s:indentLevelFor(curLine)
+            if lpindent < indent
+                let indent = indent - 1
+
+                let dir = substitute (curLineStripped,'^\\', "", "") . dir
+                continue
+            endif
+        endif
+    endwhile
+    let curFile = b:NERDTreeRoot.path.drive . dir . curFile
+    let toReturn = s:Path.New(curFile)
+    return toReturn
+endfunction
+
+"FUNCTION: s:getTreeWinNum() {{{2
+"gets the nerd tree window number for this tab
+function! s:getTreeWinNum()
+    if exists("t:NERDTreeBufName")
+        return bufwinnr(t:NERDTreeBufName)
+    else
+        return -1
+    endif
+endfunction
+"FUNCTION: s:indentLevelFor(line) {{{2
+function! s:indentLevelFor(line)
+    return match(a:line, '[^ \-+~`|]') / s:tree_wid
+endfunction
+"FUNCTION: s:isTreeOpen() {{{2
+function! s:isTreeOpen()
+    return s:getTreeWinNum() != -1
+endfunction
+"FUNCTION: s:isWindowUsable(winnumber) {{{2
+"Returns 0 if opening a file from the tree in the given window requires it to
+"be split, 1 otherwise
+"
+"Args:
+"winnumber: the number of the window in question
+function! s:isWindowUsable(winnumber)
+    "gotta split if theres only one window (i.e. the NERD tree)
+    if winnr("$") ==# 1
+        return 0
+    endif
+
+    let oldwinnr = winnr()
+    call s:exec(a:winnumber . "wincmd p")
+    let specialWindow = getbufvar("%", '&buftype') != '' || getwinvar('%', '&previewwindow')
+    let modified = &modified
+    call s:exec(oldwinnr . "wincmd p")
+
+    "if its a special window e.g. quickfix or another explorer plugin then we
+    "have to split
+    if specialWindow
+        return 0
+    endif
+
+    if &hidden
+        return 1
+    endif
+
+    return !modified || s:bufInWindows(winbufnr(a:winnumber)) >= 2
+endfunction
+
+" FUNCTION: s:jumpToChild(direction) {{{2
+" Args:
+" direction: 0 if going to first child, 1 if going to last
+function! s:jumpToChild(direction)
+    let currentNode = s:TreeFileNode.GetSelected()
+    if currentNode ==# {} || currentNode.isRoot()
+        call s:echo("cannot jump to " . (a:direction ? "last" : "first") .  " child")
+        return
+    end
+    let dirNode = currentNode.parent
+    let childNodes = dirNode.getVisibleChildren()
+
+    let targetNode = childNodes[0]
+    if a:direction
+        let targetNode = childNodes[len(childNodes) - 1]
+    endif
+
+    if targetNode.equals(currentNode)
+        let siblingDir = currentNode.parent.findOpenDirSiblingWithVisibleChildren(a:direction)
+        if siblingDir != {}
+            let indx = a:direction ? siblingDir.getVisibleChildCount()-1 : 0
+            let targetNode = siblingDir.getChildByIndex(indx, 1)
+        endif
+    endif
+
+    call targetNode.putCursorHere(1, 0)
+
+    call s:centerView()
+endfunction
+
+
+"FUNCTION: s:promptToDelBuffer(bufnum, msg){{{2
+"prints out the given msg and, if the user responds by pushing 'y' then the
+"buffer with the given bufnum is deleted
+"
+"Args:
+"bufnum: the buffer that may be deleted
+"msg: a message that will be echoed to the user asking them if they wish to
+"     del the buffer
+function! s:promptToDelBuffer(bufnum, msg)
+    echo a:msg
+    if nr2char(getchar()) ==# 'y'
+        exec "silent bdelete! " . a:bufnum
+    endif
+endfunction
+
+"FUNCTION: s:putCursorOnBookmarkTable(){{{2
+"Places the cursor at the top of the bookmarks table
+function! s:putCursorOnBookmarkTable()
+    if !b:NERDTreeShowBookmarks
+        throw "NERDTree.IllegalOperationError: cant find bookmark table, bookmarks arent active"
+    endif
+
+    let rootNodeLine = s:TreeFileNode.GetRootLineNum()
+
+    let line = 1
+    while getline(line) !~ '^>-\+Bookmarks-\+$'
+        let line = line + 1
+        if line >= rootNodeLine
+            throw "NERDTree.BookmarkTableNotFoundError: didnt find the bookmarks table"
+        endif
+    endwhile
+    call cursor(line, 0)
+endfunction
+
+"FUNCTION: s:putCursorInTreeWin(){{{2
+"Places the cursor in the nerd tree window
+function! s:putCursorInTreeWin()
+    if !s:isTreeOpen()
+        throw "NERDTree.InvalidOperationError: cant put cursor in NERD tree window, no window exists"
+    endif
+
+    call s:exec(s:getTreeWinNum() . "wincmd w")
+endfunction
+
+"FUNCTION: s:renderBookmarks {{{2
+function! s:renderBookmarks()
+
+    call setline(line(".")+1, ">----------Bookmarks----------")
+    call cursor(line(".")+1, col("."))
+
+    for i in s:Bookmark.Bookmarks()
+        call setline(line(".")+1, i.str())
+        call cursor(line(".")+1, col("."))
+    endfor
+
+    call setline(line(".")+1, '')
+    call cursor(line(".")+1, col("."))
+endfunction
+"FUNCTION: s:renderView {{{2
+"The entry function for rendering the tree
+function! s:renderView()
+    setlocal modifiable
+
+    "remember the top line of the buffer and the current line so we can
+    "restore the view exactly how it was
+    let curLine = line(".")
+    let curCol = col(".")
+    let topLine = line("w0")
+
+    "delete all lines in the buffer (being careful not to clobber a register)
+    silent 1,$delete _
+
+    call s:dumpHelp()
+
+    "delete the blank line before the help and add one after it
+    call setline(line(".")+1, "")
+    call cursor(line(".")+1, col("."))
+
+    if b:NERDTreeShowBookmarks
+        call s:renderBookmarks()
+    endif
+
+    "add the 'up a dir' line
+    call setline(line(".")+1, s:tree_up_dir_line)
+    call cursor(line(".")+1, col("."))
+
+    "draw the header line
+    let header = b:NERDTreeRoot.path.str({'format': 'UI', 'truncateTo': winwidth(0)})
+    call setline(line(".")+1, header)
+    call cursor(line(".")+1, col("."))
+
+    "draw the tree
+    let old_o = @o
+    let @o = b:NERDTreeRoot.renderToString()
+    silent put o
+    let @o = old_o
+
+    "delete the blank line at the top of the buffer
+    silent 1,1delete _
+
+    "restore the view
+    let old_scrolloff=&scrolloff
+    let &scrolloff=0
+    call cursor(topLine, 1)
+    normal! zt
+    call cursor(curLine, curCol)
+    let &scrolloff = old_scrolloff
+
+    setlocal nomodifiable
+endfunction
+
+"FUNCTION: s:renderViewSavingPosition {{{2
+"Renders the tree and ensures the cursor stays on the current node or the
+"current nodes parent if it is no longer available upon re-rendering
+function! s:renderViewSavingPosition()
+    let currentNode = s:TreeFileNode.GetSelected()
+
+    "go up the tree till we find a node that will be visible or till we run
+    "out of nodes
+    while currentNode != {} && !currentNode.isVisible() && !currentNode.isRoot()
+        let currentNode = currentNode.parent
+    endwhile
+
+    call s:renderView()
+
+    if currentNode != {}
+        call currentNode.putCursorHere(0, 0)
+    endif
+endfunction
+"FUNCTION: s:restoreScreenState() {{{2
+"
+"Sets the screen state back to what it was when s:saveScreenState was last
+"called.
+"
+"Assumes the cursor is in the NERDTree window
+function! s:restoreScreenState()
+    if !exists("b:NERDTreeOldTopLine") || !exists("b:NERDTreeOldPos") || !exists("b:NERDTreeOldWindowSize")
+        return
+    endif
+    exec("silent vertical resize ".b:NERDTreeOldWindowSize)
+
+    let old_scrolloff=&scrolloff
+    let &scrolloff=0
+    call cursor(b:NERDTreeOldTopLine, 0)
+    normal! zt
+    call setpos(".", b:NERDTreeOldPos)
+    let &scrolloff=old_scrolloff
+endfunction
+
+"FUNCTION: s:saveScreenState() {{{2
+"Saves the current cursor position in the current buffer and the window
+"scroll position
+function! s:saveScreenState()
+    let win = winnr()
+    try
+        call s:putCursorInTreeWin()
+        let b:NERDTreeOldPos = getpos(".")
+        let b:NERDTreeOldTopLine = line("w0")
+        let b:NERDTreeOldWindowSize = winwidth("")
+        call s:exec(win . "wincmd w")
+    catch /^NERDTree.InvalidOperationError/
+    endtry
+endfunction
+
+"FUNCTION: s:setupStatusline() {{{2
+function! s:setupStatusline()
+    if g:NERDTreeStatusline != -1
+        let &l:statusline = g:NERDTreeStatusline
+    endif
+endfunction
+"FUNCTION: s:setupSyntaxHighlighting() {{{2
+function! s:setupSyntaxHighlighting()
+    "treeFlags are syntax items that should be invisible, but give clues as to
+    "how things should be highlighted
+    syn match treeFlag #\~#
+    syn match treeFlag #\[RO\]#
+
+    "highlighting for the .. (up dir) line at the top of the tree
+    execute "syn match treeUp #". s:tree_up_dir_line ."#"
+
+    "highlighting for the ~/+ symbols for the directory nodes
+    syn match treeClosable #\~\<#
+    syn match treeClosable #\~\.#
+    syn match treeOpenable #+\<#
+    syn match treeOpenable #+\.#he=e-1
+
+    "highlighting for the tree structural parts
+    syn match treePart #|#
+    syn match treePart #`#
+    syn match treePartFile #[|`]-#hs=s+1 contains=treePart
+
+    "quickhelp syntax elements
+    syn match treeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1
+    syn match treeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1
+    syn match treeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=treeFlag
+    syn match treeToggleOn #".*(on)#hs=e-2,he=e-1 contains=treeHelpKey
+    syn match treeToggleOff #".*(off)#hs=e-3,he=e-1 contains=treeHelpKey
+    syn match treeHelpCommand #" :.\{-}\>#hs=s+3
+    syn match treeHelp  #^".*# contains=treeHelpKey,treeHelpTitle,treeFlag,treeToggleOff,treeToggleOn,treeHelpCommand
+
+    "highlighting for readonly files
+    syn match treeRO #.*\[RO\]#hs=s+2 contains=treeFlag,treeBookmark,treePart,treePartFile
+
+    "highlighting for sym links
+    syn match treeLink #[^-| `].* -> # contains=treeBookmark,treeOpenable,treeClosable,treeDirSlash
+
+    "highlighing for directory nodes and file nodes
+    syn match treeDirSlash #/#
+    syn match treeDir #[^-| `].*/# contains=treeLink,treeDirSlash,treeOpenable,treeClosable
+    syn match treeExecFile  #[|`]-.*\*\($\| \)# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark
+    syn match treeFile  #|-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile
+    syn match treeFile  #`-.*# contains=treeLink,treePart,treeRO,treePartFile,treeBookmark,treeExecFile
+    syn match treeCWD #^/.*$#
+
+    "highlighting for bookmarks
+    syn match treeBookmark # {.*}#hs=s+1
+
+    "highlighting for the bookmarks table
+    syn match treeBookmarksLeader #^>#
+    syn match treeBookmarksHeader #^>-\+Bookmarks-\+$# contains=treeBookmarksLeader
+    syn match treeBookmarkName #^>.\{-} #he=e-1 contains=treeBookmarksLeader
+    syn match treeBookmark #^>.*$# contains=treeBookmarksLeader,treeBookmarkName,treeBookmarksHeader
+
+    if g:NERDChristmasTree
+        hi def link treePart Special
+        hi def link treePartFile Type
+        hi def link treeFile Normal
+        hi def link treeExecFile Title
+        hi def link treeDirSlash Identifier
+        hi def link treeClosable Type
+    else
+        hi def link treePart Normal
+        hi def link treePartFile Normal
+        hi def link treeFile Normal
+        hi def link treeClosable Title
+    endif
+
+    hi def link treeBookmarksHeader statement
+    hi def link treeBookmarksLeader ignore
+    hi def link treeBookmarkName Identifier
+    hi def link treeBookmark normal
+
+    hi def link treeHelp String
+    hi def link treeHelpKey Identifier
+    hi def link treeHelpCommand Identifier
+    hi def link treeHelpTitle Macro
+    hi def link treeToggleOn Question
+    hi def link treeToggleOff WarningMsg
+
+    hi def link treeDir Directory
+    hi def link treeUp Directory
+    hi def link treeCWD Statement
+    hi def link treeLink Macro
+    hi def link treeOpenable Title
+    hi def link treeFlag ignore
+    hi def link treeRO WarningMsg
+    hi def link treeBookmark Statement
+
+    hi def link NERDTreeCurrentNode Search
+endfunction
+
+"FUNCTION: s:stripMarkupFromLine(line, removeLeadingSpaces){{{2
+"returns the given line with all the tree parts stripped off
+"
+"Args:
+"line: the subject line
+"removeLeadingSpaces: 1 if leading spaces are to be removed (leading spaces =
+"any spaces before the actual text of the node)
+function! s:stripMarkupFromLine(line, removeLeadingSpaces)
+    let line = a:line
+    "remove the tree parts and the leading space
+    let line = substitute (line, s:tree_markup_reg,"","")
+
+    "strip off any read only flag
+    let line = substitute (line, ' \[RO\]', "","")
+
+    "strip off any bookmark flags
+    let line = substitute (line, ' {[^}]*}', "","")
+
+    "strip off any executable flags
+    let line = substitute (line, '*\ze\($\| \)', "","")
+
+    let wasdir = 0
+    if line =~ '/$'
+        let wasdir = 1
+    endif
+    let line = substitute (line,' -> .*',"","") " remove link to
+    if wasdir ==# 1
+        let line = substitute (line, '/\?$', '/', "")
+    endif
+
+    if a:removeLeadingSpaces
+        let line = substitute (line, '^ *', '', '')
+    endif
+
+    return line
+endfunction
+
+"FUNCTION: s:toggle(dir) {{{2
+"Toggles the NERD tree. I.e the NERD tree is open, it is closed, if it is
+"closed it is restored or initialized (if it doesnt exist)
+"
+"Args:
+"dir: the full path for the root node (is only used if the NERD tree is being
+"initialized.
+function! s:toggle(dir)
+    if s:treeExistsForTab()
+        if !s:isTreeOpen()
+            call s:createTreeWin()
+            if !&hidden
+                call s:renderView()
+            endif
+            call s:restoreScreenState()
+        else
+            call s:closeTree()
+        endif
+    else
+        call s:initNerdTree(a:dir)
+    endif
+endfunction
+"SECTION: Interface bindings {{{1
+"============================================================
+"FUNCTION: s:activateNode(forceKeepWindowOpen) {{{2
+"If the current node is a file, open it in the previous window (or a new one
+"if the previous is modified). If it is a directory then it is opened.
+"
+"args:
+"forceKeepWindowOpen - dont close the window even if NERDTreeQuitOnOpen is set
+function! s:activateNode(forceKeepWindowOpen)
+    if getline(".") ==# s:tree_up_dir_line
+        return s:upDir(0)
+    endif
+
+    let treenode = s:TreeFileNode.GetSelected()
+    if treenode != {}
+        call treenode.activate(a:forceKeepWindowOpen)
+    else
+        let bookmark = s:Bookmark.GetSelected()
+        if !empty(bookmark)
+            call bookmark.activate()
+        endif
+    endif
+endfunction
+
+"FUNCTION: s:bindMappings() {{{2
+function! s:bindMappings()
+    " set up mappings and commands for this buffer
+    nnoremap <silent> <buffer> <middlerelease> :call <SID>handleMiddleMouse()<cr>
+    nnoremap <silent> <buffer> <leftrelease> <leftrelease>:call <SID>checkForActivate()<cr>
+    nnoremap <silent> <buffer> <2-leftmouse> :call <SID>activateNode(0)<cr>
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapActivateNode . " :call <SID>activateNode(0)<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenSplit ." :call <SID>openEntrySplit(0,0)<cr>"
+    exec "nnoremap <silent> <buffer> <cr> :call <SID>activateNode(0)<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreview ." :call <SID>previewNode(0)<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreviewSplit ." :call <SID>previewNode(1)<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenVSplit ." :call <SID>openEntrySplit(1,0)<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreviewVSplit ." :call <SID>previewNode(2)<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenRecursively ." :call <SID>openNodeRecursively()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapUpdirKeepOpen ." :call <SID>upDir(1)<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapUpdir ." :call <SID>upDir(0)<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapChangeRoot ." :call <SID>chRoot()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapChdir ." :call <SID>chCwd()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapQuit ." :call <SID>closeTreeWindow()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapRefreshRoot ." :call <SID>refreshRoot()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapRefresh ." :call <SID>refreshCurrent()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapHelp ." :call <SID>displayHelp()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleZoom ." :call <SID>toggleZoom()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleHidden ." :call <SID>toggleShowHidden()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleFilters ." :call <SID>toggleIgnoreFilter()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleFiles ." :call <SID>toggleShowFiles()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapToggleBookmarks ." :call <SID>toggleShowBookmarks()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapCloseDir ." :call <SID>closeCurrentDir()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapCloseChildren ." :call <SID>closeChildren()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapMenu ." :call <SID>showMenu()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpParent ." :call <SID>jumpToParent()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpNextSibling ." :call <SID>jumpToSibling(1)<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpPrevSibling ." :call <SID>jumpToSibling(0)<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpFirstChild ." :call <SID>jumpToFirstChild()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpLastChild ." :call <SID>jumpToLastChild()<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapJumpRoot ." :call <SID>jumpToRoot()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenInTab ." :call <SID>openInNewTab(0)<cr>"
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenInTabSilent ." :call <SID>openInNewTab(1)<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenExpl ." :call <SID>openExplorer()<cr>"
+
+    exec "nnoremap <silent> <buffer> ". g:NERDTreeMapDeleteBookmark ." :call <SID>deleteBookmark()<cr>"
+
+    "bind all the user custom maps
+    call s:KeyMap.BindAll()
+
+    command! -buffer -nargs=1 Bookmark :call <SID>bookmarkNode('<args>')
+    command! -buffer -complete=customlist,s:completeBookmarks -nargs=1 RevealBookmark :call <SID>revealBookmark('<args>')
+    command! -buffer -complete=customlist,s:completeBookmarks -nargs=1 OpenBookmark :call <SID>openBookmark('<args>')
+    command! -buffer -complete=customlist,s:completeBookmarks -nargs=* ClearBookmarks call <SID>clearBookmarks('<args>')
+    command! -buffer -complete=customlist,s:completeBookmarks -nargs=+ BookmarkToRoot call s:Bookmark.ToRoot('<args>')
+    command! -buffer -nargs=0 ClearAllBookmarks call s:Bookmark.ClearAll() <bar> call <SID>renderView()
+    command! -buffer -nargs=0 ReadBookmarks call s:Bookmark.CacheBookmarks(0) <bar> call <SID>renderView()
+    command! -buffer -nargs=0 WriteBookmarks call s:Bookmark.Write()
+endfunction
+
+" FUNCTION: s:bookmarkNode(name) {{{2
+" Associate the current node with the given name
+function! s:bookmarkNode(name)
+    let currentNode = s:TreeFileNode.GetSelected()
+    if currentNode != {}
+        try
+            call currentNode.bookmark(a:name)
+            call s:renderView()
+        catch /^NERDTree.IllegalBookmarkNameError/
+            call s:echo("bookmark names must not contain spaces")
+        endtry
+    else
+        call s:echo("select a node first")
+    endif
+endfunction
+"FUNCTION: s:checkForActivate() {{{2
+"Checks if the click should open the current node, if so then activate() is
+"called (directories are automatically opened if the symbol beside them is
+"clicked)
+function! s:checkForActivate()
+    let currentNode = s:TreeFileNode.GetSelected()
+    if currentNode != {}
+        call s:activateNode(0)
+        return
+    endif
+endfunction
+
+" FUNCTION: s:chCwd() {{{2
+function! s:chCwd()
+    let treenode = s:TreeFileNode.GetSelected()
+    if treenode ==# {}
+        call s:echo("Select a node first")
+        return
+    endif
+
+    try
+        call treenode.path.changeToDir()
+    catch /^NERDTree.PathChangeError/
+        call s:echoWarning("could not change cwd")
+    endtry
+endfunction
+
+" FUNCTION: s:chRoot() {{{2
+" changes the current root to the selected one
+function! s:chRoot()
+    let treenode = s:TreeFileNode.GetSelected()
+    if treenode ==# {}
+        call s:echo("Select a node first")
+        return
+    endif
+
+    call treenode.makeRoot()
+    call s:renderView()
+    call b:NERDTreeRoot.putCursorHere(0, 0)
+endfunction
+
+" FUNCTION: s:clearBookmarks(bookmarks) {{{2
+function! s:clearBookmarks(bookmarks)
+    if a:bookmarks ==# ''
+        let currentNode = s:TreeFileNode.GetSelected()
+        if currentNode != {}
+            call currentNode.clearBoomarks()
+        endif
+    else
+        for name in split(a:bookmarks, ' ')
+            let bookmark = s:Bookmark.BookmarkFor(name)
+            call bookmark.delete()
+        endfor
+    endif
+    call s:renderView()
+endfunction
+" FUNCTION: s:closeChildren() {{{2
+" closes all childnodes of the current node
+function! s:closeChildren()
+    let currentNode = s:TreeDirNode.GetSelected()
+    if currentNode ==# {}
+        call s:echo("Select a node first")
+        return
+    endif
+
+    call currentNode.closeChildren()
+    call s:renderView()
+    call currentNode.putCursorHere(0, 0)
+endfunction
+" FUNCTION: s:closeCurrentDir() {{{2
+" closes the parent dir of the current node
+function! s:closeCurrentDir()
+    let treenode = s:TreeFileNode.GetSelected()
+    if treenode ==# {}
+        call s:echo("Select a node first")
+        return
+    endif
+
+    let parent = treenode.parent
+    if parent ==# {} || parent.isRoot()
+        call s:echo("cannot close tree root")
+    else
+        call treenode.parent.close()
+        call s:renderView()
+        call treenode.parent.putCursorHere(0, 0)
+    endif
+endfunction
+" FUNCTION: s:closeTreeWindow() {{{2
+" close the tree window
+function! s:closeTreeWindow()
+    if b:NERDTreeType ==# "secondary" && b:NERDTreePreviousBuf != -1
+        exec "buffer " . b:NERDTreePreviousBuf
+    else
+        if winnr("$") > 1
+            call s:closeTree()
+        else
+            call s:echo("Cannot close last window")
+        endif
+    endif
+endfunction
+" FUNCTION: s:deleteBookmark() {{{2
+" if the cursor is on a bookmark, prompt to delete
+function! s:deleteBookmark()
+    let bookmark = s:Bookmark.GetSelected()
+    if bookmark ==# {}
+        call s:echo("Put the cursor on a bookmark")
+        return
+    endif
+
+    echo  "Are you sure you wish to delete the bookmark:\n\"" . bookmark.name . "\" (yN):"
+
+    if  nr2char(getchar()) ==# 'y'
+        try
+            call bookmark.delete()
+            call s:renderView()
+            redraw
+        catch /^NERDTree/
+            call s:echoWarning("Could not remove bookmark")
+        endtry
+    else
+        call s:echo("delete aborted" )
+    endif
+
+endfunction
+
+" FUNCTION: s:displayHelp() {{{2
+" toggles the help display
+function! s:displayHelp()
+    let b:treeShowHelp = b:treeShowHelp ? 0 : 1
+    call s:renderView()
+    call s:centerView()
+endfunction
+
+" FUNCTION: s:handleMiddleMouse() {{{2
+function! s:handleMiddleMouse()
+    let curNode = s:TreeFileNode.GetSelected()
+    if curNode ==# {}
+        call s:echo("Put the cursor on a node first" )
+        return
+    endif
+
+    if curNode.path.isDirectory
+        call s:openExplorer()
+    else
+        call s:openEntrySplit(0,0)
+    endif
+endfunction
+
+
+" FUNCTION: s:jumpToFirstChild() {{{2
+" wrapper for the jump to child method
+function! s:jumpToFirstChild()
+    call s:jumpToChild(0)
+endfunction
+
+" FUNCTION: s:jumpToLastChild() {{{2
+" wrapper for the jump to child method
+function! s:jumpToLastChild()
+    call s:jumpToChild(1)
+endfunction
+
+" FUNCTION: s:jumpToParent() {{{2
+" moves the cursor to the parent of the current node
+function! s:jumpToParent()
+    let currentNode = s:TreeFileNode.GetSelected()
+    if !empty(currentNode)
+        if !empty(currentNode.parent)
+            call currentNode.parent.putCursorHere(1, 0)
+            call s:centerView()
+        else
+            call s:echo("cannot jump to parent")
+        endif
+    else
+        call s:echo("put the cursor on a node first")
+    endif
+endfunction
+
+" FUNCTION: s:jumpToRoot() {{{2
+" moves the cursor to the root node
+function! s:jumpToRoot()
+    call b:NERDTreeRoot.putCursorHere(1, 0)
+    call s:centerView()
+endfunction
+
+" FUNCTION: s:jumpToSibling() {{{2
+" moves the cursor to the sibling of the current node in the given direction
+"
+" Args:
+" forward: 1 if the cursor should move to the next sibling, 0 if it should
+" move back to the previous sibling
+function! s:jumpToSibling(forward)
+    let currentNode = s:TreeFileNode.GetSelected()
+    if !empty(currentNode)
+        let sibling = currentNode.findSibling(a:forward)
+
+        if !empty(sibling)
+            call sibling.putCursorHere(1, 0)
+            call s:centerView()
+        endif
+    else
+        call s:echo("put the cursor on a node first")
+    endif
+endfunction
+
+" FUNCTION: s:openBookmark(name) {{{2
+" put the cursor on the given bookmark and, if its a file, open it
+function! s:openBookmark(name)
+    try
+        let targetNode = s:Bookmark.GetNodeForName(a:name, 0)
+        call targetNode.putCursorHere(0, 1)
+        redraw!
+    catch /^NERDTree.BookmarkedNodeNotFoundError/
+        call s:echo("note - target node is not cached")
+        let bookmark = s:Bookmark.BookmarkFor(a:name)
+        let targetNode = s:TreeFileNode.New(bookmark.path)
+    endtry
+    if targetNode.path.isDirectory
+        call targetNode.openExplorer()
+    else
+        call targetNode.open()
+    endif
+endfunction
+" FUNCTION: s:openEntrySplit(vertical, forceKeepWindowOpen) {{{2
+"Opens the currently selected file from the explorer in a
+"new window
+"
+"args:
+"forceKeepWindowOpen - dont close the window even if NERDTreeQuitOnOpen is set
+function! s:openEntrySplit(vertical, forceKeepWindowOpen)
+    let treenode = s:TreeFileNode.GetSelected()
+    if treenode != {}
+        if a:vertical
+            call treenode.openVSplit()
+        else
+            call treenode.openSplit()
+        endif
+        if !a:forceKeepWindowOpen
+            call s:closeTreeIfQuitOnOpen()
+        endif
+    else
+        call s:echo("select a node first")
+    endif
+endfunction
+
+" FUNCTION: s:openExplorer() {{{2
+function! s:openExplorer()
+    let treenode = s:TreeDirNode.GetSelected()
+    if treenode != {}
+        call treenode.openExplorer()
+    else
+        call s:echo("select a node first")
+    endif
+endfunction
+
+" FUNCTION: s:openInNewTab(stayCurrentTab) {{{2
+" Opens the selected node or bookmark in a new tab
+" Args:
+" stayCurrentTab: if 1 then vim will stay in the current tab, if 0 then vim
+" will go to the tab where the new file is opened
+function! s:openInNewTab(stayCurrentTab)
+    let target = s:TreeFileNode.GetSelected()
+    if target == {}
+        let target = s:Bookmark.GetSelected()
+    endif
+
+    if target != {}
+        call target.openInNewTab({'stayInCurrentTab': a:stayCurrentTab})
+    endif
+endfunction
+
+" FUNCTION: s:openNodeRecursively() {{{2
+function! s:openNodeRecursively()
+    let treenode = s:TreeFileNode.GetSelected()
+    if treenode ==# {} || treenode.path.isDirectory ==# 0
+        call s:echo("Select a directory node first" )
+    else
+        call s:echo("Recursively opening node. Please wait...")
+        call treenode.openRecursively()
+        call s:renderView()
+        redraw
+        call s:echo("Recursively opening node. Please wait... DONE")
+    endif
+
+endfunction
+
+"FUNCTION: s:previewNode() {{{2
+"Args:
+"   openNewWin: if 0, use the previous window, if 1 open in new split, if 2
+"               open in a vsplit
+function! s:previewNode(openNewWin)
+    let currentBuf = bufnr("")
+    if a:openNewWin > 0
+        call s:openEntrySplit(a:openNewWin ==# 2,1)
+    else
+        call s:activateNode(1)
+    end
+    call s:exec(bufwinnr(currentBuf) . "wincmd w")
+endfunction
+
+" FUNCTION: s:revealBookmark(name) {{{2
+" put the cursor on the node associate with the given name
+function! s:revealBookmark(name)
+    try
+        let targetNode = s:Bookmark.GetNodeForName(a:name, 0)
+        call targetNode.putCursorHere(0, 1)
+    catch /^NERDTree.BookmarkNotFoundError/
+        call s:echo("Bookmark isnt cached under the current root")
+    endtry
+endfunction
+" FUNCTION: s:refreshRoot() {{{2
+" Reloads the current root. All nodes below this will be lost and the root dir
+" will be reloaded.
+function! s:refreshRoot()
+    call s:echo("Refreshing the root node. This could take a while...")
+    call b:NERDTreeRoot.refresh()
+    call s:renderView()
+    redraw
+    call s:echo("Refreshing the root node. This could take a while... DONE")
+endfunction
+
+" FUNCTION: s:refreshCurrent() {{{2
+" refreshes the root for the current node
+function! s:refreshCurrent()
+    let treenode = s:TreeDirNode.GetSelected()
+    if treenode ==# {}
+        call s:echo("Refresh failed. Select a node first")
+        return
+    endif
+
+    call s:echo("Refreshing node. This could take a while...")
+    call treenode.refresh()
+    call s:renderView()
+    redraw
+    call s:echo("Refreshing node. This could take a while... DONE")
+endfunction
+" FUNCTION: s:showMenu() {{{2
+function! s:showMenu()
+    let curNode = s:TreeFileNode.GetSelected()
+    if curNode ==# {}
+        call s:echo("Put the cursor on a node first" )
+        return
+    endif
+
+    let mc = s:MenuController.New(s:MenuItem.AllEnabled())
+    call mc.showMenu()
+endfunction
+
+" FUNCTION: s:toggleIgnoreFilter() {{{2
+" toggles the use of the NERDTreeIgnore option
+function! s:toggleIgnoreFilter()
+    let b:NERDTreeIgnoreEnabled = !b:NERDTreeIgnoreEnabled
+    call s:renderViewSavingPosition()
+    call s:centerView()
+endfunction
+
+" FUNCTION: s:toggleShowBookmarks() {{{2
+" toggles the display of bookmarks
+function! s:toggleShowBookmarks()
+    let b:NERDTreeShowBookmarks = !b:NERDTreeShowBookmarks
+    if b:NERDTreeShowBookmarks
+        call s:renderView()
+        call s:putCursorOnBookmarkTable()
+    else
+        call s:renderViewSavingPosition()
+    endif
+    call s:centerView()
+endfunction
+" FUNCTION: s:toggleShowFiles() {{{2
+" toggles the display of hidden files
+function! s:toggleShowFiles()
+    let b:NERDTreeShowFiles = !b:NERDTreeShowFiles
+    call s:renderViewSavingPosition()
+    call s:centerView()
+endfunction
+
+" FUNCTION: s:toggleShowHidden() {{{2
+" toggles the display of hidden files
+function! s:toggleShowHidden()
+    let b:NERDTreeShowHidden = !b:NERDTreeShowHidden
+    call s:renderViewSavingPosition()
+    call s:centerView()
+endfunction
+
+" FUNCTION: s:toggleZoom() {{2
+" zoom (maximize/minimize) the NERDTree window
+function! s:toggleZoom()
+    if exists("b:NERDTreeZoomed") && b:NERDTreeZoomed
+        let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
+        exec "silent vertical resize ". size
+        let b:NERDTreeZoomed = 0
+    else
+        exec "vertical resize"
+        let b:NERDTreeZoomed = 1
+    endif
+endfunction
+
+"FUNCTION: s:upDir(keepState) {{{2
+"moves the tree up a level
+"
+"Args:
+"keepState: 1 if the current root should be left open when the tree is
+"re-rendered
+function! s:upDir(keepState)
+    let cwd = b:NERDTreeRoot.path.str({'format': 'UI'})
+    if cwd ==# "/" || cwd =~ '^[^/]..$'
+        call s:echo("already at top dir")
+    else
+        if !a:keepState
+            call b:NERDTreeRoot.close()
+        endif
+
+        let oldRoot = b:NERDTreeRoot
+
+        if empty(b:NERDTreeRoot.parent)
+            let path = b:NERDTreeRoot.path.getParent()
+            let newRoot = s:TreeDirNode.New(path)
+            call newRoot.open()
+            call newRoot.transplantChild(b:NERDTreeRoot)
+            let b:NERDTreeRoot = newRoot
+        else
+            let b:NERDTreeRoot = b:NERDTreeRoot.parent
+        endif
+
+        if g:NERDTreeChDirMode ==# 2
+            call b:NERDTreeRoot.path.changeToDir()
+        endif
+
+        call s:renderView()
+        call oldRoot.putCursorHere(0, 0)
+    endif
+endfunction
+
+
+"reset &cpo back to users setting
+let &cpo = s:old_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/plugin/SearchComplete.vim b/vim/plugin/SearchComplete.vim
new file mode 100644 (file)
index 0000000..8e950c6
--- /dev/null
@@ -0,0 +1,100 @@
+" SearchComplete.vim
+" Author: Chris Russell
+" Version: 1.1
+" License: GPL v2.0 
+" 
+" Description:
+" This script defineds functions and key mappings for Tab completion in 
+" searches.
+" 
+" Help:
+" This script catches the <Tab> character when using the '/' search 
+" command.  Pressing Tab will expand the current partial word to the 
+" next matching word starting with the partial word.
+" 
+" If you want to match a tab, use the '\t' pattern.
+"
+" Installation:
+" Simply drop this file into your $HOME/.vim/plugin directory.
+" 
+" Changelog:
+" 2002-11-08 v1.1
+"      Convert to unix eol
+" 2002-11-05 v1.0
+"      Initial release
+" 
+" TODO:
+" 
+
+
+"--------------------------------------------------
+" Avoid multiple sourcing
+"-------------------------------------------------- 
+if exists( "loaded_search_complete" )
+    finish
+endif
+let loaded_search_complete = 1
+
+
+"--------------------------------------------------
+" Key mappings
+"-------------------------------------------------- 
+noremap / :call SearchCompleteStart()<CR>/
+
+
+"--------------------------------------------------
+" Set mappings for search complete
+"-------------------------------------------------- 
+function! SearchCompleteStart()
+       cnoremap <Tab> <C-C>:call SearchComplete()<CR>/<C-R>s
+       cnoremap <silent> <CR> <CR>:call SearchCompleteStop()<CR>
+       cnoremap <silent> <Esc> <C-C>:call SearchCompleteStop()<CR>
+endfunction
+
+"--------------------------------------------------
+" Tab completion in / search
+"-------------------------------------------------- 
+function! SearchComplete()
+       " get current cursor position
+       let l:loc = col( "." ) - 1
+       " get partial search and delete
+       let l:search = histget( '/', -1 )
+       call histdel( '/', -1 )
+       " check if new search
+       if l:search == @s
+               " get root search string
+               let l:search = b:searchcomplete
+               " increase number of autocompletes
+               let b:searchcompletedepth = b:searchcompletedepth . "\<C-N>"
+       else
+               " one autocomplete
+               let b:searchcompletedepth = "\<C-N>"
+       endif
+       " store origional search parameter
+       let b:searchcomplete = l:search
+       " set paste option to disable indent options
+       let l:paste = &paste
+       setlocal paste
+       " on a temporary line put search string and use autocomplete
+       execute "normal! A\n" . l:search . b:searchcompletedepth
+       " get autocomplete result
+       let @s = getline( line( "." ) )
+       " undo and return to first char
+       execute "normal! u0"
+       " return to cursor position
+       if l:loc > 0
+               execute "normal! ". l:loc . "l"
+       endif
+       " reset paste option
+       let &paste = l:paste
+endfunction
+
+"--------------------------------------------------
+" Remove search complete mappings
+"-------------------------------------------------- 
+function! SearchCompleteStop()
+       cunmap <Tab>
+       cunmap <CR>
+       cunmap <Esc>
+endfunction
+
diff --git a/vim/plugin/ZoomWinPlugin.vim b/vim/plugin/ZoomWinPlugin.vim
new file mode 100644 (file)
index 0000000..3f24a7d
--- /dev/null
@@ -0,0 +1,49 @@
+" ZoomWin:     Brief-like ability to zoom into/out-of a window
+" Author:      Charles Campbell
+"                      original version by Ron Aaron
+" Date:                Jan 16, 2009
+" Version:     23e     ASTRO-ONLY
+" History: see :help zoomwin-history {{{1
+" GetLatestVimScripts: 508 1 :AutoInstall: ZoomWin.vim
+
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if &cp || exists("g:loaded_ZoomWinPlugin")
+ finish
+endif
+if v:version < 702
+ echohl WarningMsg
+ echo "***warning*** this version of ZoomWin needs vim 7.2"
+ echohl Normal
+ finish
+endif
+let s:keepcpo              = &cpo
+let g:loaded_ZoomWinPlugin = "v23"
+set cpo&vim
+"DechoTabOn
+
+" ---------------------------------------------------------------------
+"  Public Interface: {{{1
+if !hasmapto("<Plug>ZoomWin")
+ nmap <unique> <c-w>o  <Plug>ZoomWin
+endif
+nnoremap <silent> <script> <Plug>ZoomWin :set lz<CR>:silent call ZoomWin#ZoomWin()<CR>:set nolz<CR>
+com! ZoomWin :set lz|silent call ZoomWin#ZoomWin()|set nolz
+
+au VimLeave * call ZoomWin#CleanupSessionFile()
+
+" ---------------------------------------------------------------------
+" ZoomWin: toggles between a single-window and a multi-window layout {{{1
+"          The original version was by Ron Aaron.
+"          This function provides compatibility with previous versions.
+fun! ZoomWin()
+  call ZoomWin#ZoomWin()
+endfun
+
+" ---------------------------------------------------------------------
+"  Restore: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+" ---------------------------------------------------------------------
+"  Modelines: {{{1
+" vim: ts=4 fdm=marker
diff --git a/vim/plugin/ack.vim b/vim/plugin/ack.vim
new file mode 100644 (file)
index 0000000..8cc0d45
--- /dev/null
@@ -0,0 +1,79 @@
+" NOTE: You must, of course, install the ack script
+"       in your path.
+" On Debian / Ubuntu:
+"   sudo apt-get install ack-grep
+" On your vimrc:
+"   let g:ackprg="ack-grep -H --nocolor --nogroup --column"
+"
+" With MacPorts:
+"   sudo port install p5-app-ack
+
+" Location of the ack utility
+if !exists("g:ackprg")
+       let g:ackprg="ack -H --nocolor --nogroup --column"
+endif
+
+function! s:Ack(cmd, args)
+    redraw
+    echo "Searching ..."
+
+    " If no pattern is provided, search for the word under the cursor
+    if empty(a:args)
+        let l:grepargs = expand("<cword>")
+    else
+        let l:grepargs = a:args
+    end
+
+    " Format, used to manage column jump
+    if a:cmd =~# '-g$'
+        let g:ackformat="%f"
+    else
+        let g:ackformat="%f:%l:%c:%m"
+    end
+
+    let grepprg_bak=&grepprg
+    let grepformat_bak=&grepformat
+    try
+        let &grepprg=g:ackprg
+        let &grepformat=g:ackformat
+        silent execute a:cmd . " " . l:grepargs
+    finally
+        let &grepprg=grepprg_bak
+        let &grepformat=grepformat_bak
+    endtry
+
+    if a:cmd =~# '^l'
+        botright lopen
+    else
+        botright copen
+    endif
+
+    " TODO: Document this!
+    exec "nnoremap <silent> <buffer> q :ccl<CR>"
+    exec "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
+    exec "nnoremap <silent> <buffer> T <C-W><CR><C-W>TgT<C-W><C-W>"
+    exec "nnoremap <silent> <buffer> o <CR>"
+    exec "nnoremap <silent> <buffer> go <CR><C-W><C-W>"
+
+    " If highlighting is on, highlight the search keyword.
+    if exists("g:ackhighlight")
+        let @/=a:args
+        set hlsearch
+    end
+
+    redraw!
+endfunction
+
+function! s:AckFromSearch(cmd, args)
+    let search =  getreg('/')
+    " translate vim regular expression to perl regular expression.
+    let search = substitute(search,'\(\\<\|\\>\)','\\b','g')
+    call s:Ack(a:cmd, '"' .  search .'" '. a:args)
+endfunction
+
+command! -bang -nargs=* -complete=file Ack call s:Ack('grep<bang>',<q-args>)
+command! -bang -nargs=* -complete=file AckAdd call s:Ack('grepadd<bang>', <q-args>)
+command! -bang -nargs=* -complete=file AckFromSearch call s:AckFromSearch('grep<bang>', <q-args>)
+command! -bang -nargs=* -complete=file LAck call s:Ack('lgrep<bang>', <q-args>)
+command! -bang -nargs=* -complete=file LAckAdd call s:Ack('lgrepadd<bang>', <q-args>)
+command! -bang -nargs=* -complete=file AckFile call s:Ack('grep<bang> -g', <q-args>)
diff --git a/vim/plugin/cecutil.vim b/vim/plugin/cecutil.vim
new file mode 100644 (file)
index 0000000..0bf3434
--- /dev/null
@@ -0,0 +1,510 @@
+" cecutil.vim : save/restore window position
+"               save/restore mark position
+"               save/restore selected user maps
+"  Author:     Charles E. Campbell, Jr.
+"  Version:    18b     ASTRO-ONLY
+"  Date:       Aug 27, 2008
+"
+"  Saving Restoring Destroying Marks: {{{1
+"       call SaveMark(markname)       let savemark= SaveMark(markname)
+"       call RestoreMark(markname)    call RestoreMark(savemark)
+"       call DestroyMark(markname)
+"       commands: SM RM DM
+"
+"  Saving Restoring Destroying Window Position: {{{1
+"       call SaveWinPosn()        let winposn= SaveWinPosn()
+"       call RestoreWinPosn()     call RestoreWinPosn(winposn)
+"              \swp : save current window/buffer's position
+"              \rwp : restore current window/buffer's previous position
+"       commands: SWP RWP
+"
+"  Saving And Restoring User Maps: {{{1
+"       call SaveUserMaps(mapmode,maplead,mapchx,suffix)
+"       call RestoreUserMaps(suffix)
+"
+" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
+"
+" You believe that God is one. You do well. The demons also {{{1
+" believe, and shudder. But do you want to know, vain man, that
+" faith apart from works is dead?  (James 2:19,20 WEB)
+
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if &cp || exists("g:loaded_cecutil")
+ finish
+endif
+let g:loaded_cecutil = "v18b"
+let s:keepcpo        = &cpo
+set cpo&vim
+"DechoTabOn
+
+" =======================
+"  Public Interface: {{{1
+" =======================
+
+" ---------------------------------------------------------------------
+"  Map Interface: {{{2
+if !hasmapto('<Plug>SaveWinPosn')
+ map <unique> <Leader>swp <Plug>SaveWinPosn
+endif
+if !hasmapto('<Plug>RestoreWinPosn')
+ map <unique> <Leader>rwp <Plug>RestoreWinPosn
+endif
+nmap <silent> <Plug>SaveWinPosn                :call SaveWinPosn()<CR>
+nmap <silent> <Plug>RestoreWinPosn     :call RestoreWinPosn()<CR>
+
+" ---------------------------------------------------------------------
+" Command Interface: {{{2
+com! -bar -nargs=0 SWP call SaveWinPosn()
+com! -bar -nargs=0 RWP call RestoreWinPosn()
+com! -bar -nargs=1 SM  call SaveMark(<q-args>)
+com! -bar -nargs=1 RM  call RestoreMark(<q-args>)
+com! -bar -nargs=1 DM  call DestroyMark(<q-args>)
+
+if v:version < 630
+ let s:modifier= "sil "
+else
+ let s:modifier= "sil keepj "
+endif
+
+" ===============
+" Functions: {{{1
+" ===============
+
+" ---------------------------------------------------------------------
+" SaveWinPosn: {{{2
+"    let winposn= SaveWinPosn()  will save window position in winposn variable
+"    call SaveWinPosn()          will save window position in b:cecutil_winposn{b:cecutil_iwinposn}
+"    let winposn= SaveWinPosn(0) will *only* save window position in winposn variable (no stacking done)
+fun! SaveWinPosn(...)
+"  call Dfunc("SaveWinPosn() a:0=".a:0)
+  if line(".") == 1 && getline(1) == ""
+"   call Dfunc("SaveWinPosn : empty buffer")
+   return ""
+  endif
+  let so_keep   = &l:so
+  let siso_keep = &siso
+  let ss_keep   = &l:ss
+  setlocal so=0 siso=0 ss=0
+
+  let swline    = line(".")
+  let swcol     = col(".")
+  let swwline   = winline() - 1
+  let swwcol    = virtcol(".") - wincol()
+  let savedposn = "call GoWinbufnr(".winbufnr(0).")|silent ".swline
+  let savedposn = savedposn."|".s:modifier."norm! 0z\<cr>"
+  if swwline > 0
+   let savedposn= savedposn.":".s:modifier."norm! ".swwline."\<c-y>\<cr>"
+  endif
+  if swwcol > 0
+   let savedposn= savedposn.":".s:modifier."norm! 0".swwcol."zl\<cr>"
+  endif
+  let savedposn = savedposn.":".s:modifier."call cursor(".swline.",".swcol.")\<cr>"
+
+  " save window position in
+  " b:cecutil_winposn_{iwinposn} (stack)
+  " only when SaveWinPosn() is used
+  if a:0 == 0
+   if !exists("b:cecutil_iwinposn")
+       let b:cecutil_iwinposn= 1
+   else
+       let b:cecutil_iwinposn= b:cecutil_iwinposn + 1
+   endif
+"   call Decho("saving posn to SWP stack")
+   let b:cecutil_winposn{b:cecutil_iwinposn}= savedposn
+  endif
+
+  let &l:so = so_keep
+  let &siso = siso_keep
+  let &l:ss = ss_keep
+
+"  if exists("b:cecutil_iwinposn")      " Decho
+"   call Decho("b:cecutil_winpos{".b:cecutil_iwinposn."}[".b:cecutil_winposn{b:cecutil_iwinposn}."]")
+"  else                      " Decho
+"   call Decho("b:cecutil_iwinposn doesn't exist")
+"  endif                     " Decho
+"  call Dret("SaveWinPosn [".savedposn."]")
+  return savedposn
+endfun
+
+" ---------------------------------------------------------------------
+" RestoreWinPosn: {{{2
+"      call RestoreWinPosn()
+"      call RestoreWinPosn(winposn)
+fun! RestoreWinPosn(...)
+"  call Dfunc("RestoreWinPosn() a:0=".a:0)
+"  call Decho("getline(1)<".getline(1).">")
+"  call Decho("line(.)=".line("."))
+  if line(".") == 1 && getline(1) == ""
+"   call Dfunc("RestoreWinPosn : empty buffer")
+   return ""
+  endif
+  let so_keep   = &l:so
+  let siso_keep = &l:siso
+  let ss_keep   = &l:ss
+  setlocal so=0 siso=0 ss=0
+
+  if a:0 == 0 || a:1 == ""
+   " use saved window position in b:cecutil_winposn{b:cecutil_iwinposn} if it exists
+   if exists("b:cecutil_iwinposn") && exists("b:cecutil_winposn{b:cecutil_iwinposn}")
+"      call Decho("using stack b:cecutil_winposn{".b:cecutil_iwinposn."}<".b:cecutil_winposn{b:cecutil_iwinposn}.">")
+       try
+     exe "silent! ".b:cecutil_winposn{b:cecutil_iwinposn}
+       catch /^Vim\%((\a\+)\)\=:E749/
+        " ignore empty buffer error messages
+       endtry
+    " normally drop top-of-stack by one
+    " but while new top-of-stack doesn't exist
+    " drop top-of-stack index by one again
+       if b:cecutil_iwinposn >= 1
+        unlet b:cecutil_winposn{b:cecutil_iwinposn}
+        let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
+        while b:cecutil_iwinposn >= 1 && !exists("b:cecutil_winposn{b:cecutil_iwinposn}")
+         let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
+        endwhile
+        if b:cecutil_iwinposn < 1
+         unlet b:cecutil_iwinposn
+        endif
+       endif
+   else
+       echohl WarningMsg
+       echomsg "***warning*** need to SaveWinPosn first!"
+       echohl None
+   endif
+
+  else  " handle input argument
+"   call Decho("using input a:1<".a:1.">")
+   " use window position passed to this function
+   exe "silent ".a:1
+   " remove a:1 pattern from b:cecutil_winposn{b:cecutil_iwinposn} stack
+   if exists("b:cecutil_iwinposn")
+    let jwinposn= b:cecutil_iwinposn
+    while jwinposn >= 1                     " search for a:1 in iwinposn..1
+        if exists("b:cecutil_winposn{jwinposn}")    " if it exists
+         if a:1 == b:cecutil_winposn{jwinposn}      " and the pattern matches
+       unlet b:cecutil_winposn{jwinposn}            " unlet it
+       if jwinposn == b:cecutil_iwinposn            " if at top-of-stack
+        let b:cecutil_iwinposn= b:cecutil_iwinposn - 1      " drop stacktop by one
+       endif
+      endif
+     endif
+     let jwinposn= jwinposn - 1
+    endwhile
+   endif
+  endif
+
+  " Seems to be something odd: vertical motions after RWP
+  " cause jump to first column.  The following fixes that.
+  " Note: was using wincol()>1, but with signs, a cursor
+  " at column 1 yields wincol()==3.  Beeping ensued.
+  if virtcol('.') > 1
+   silent norm! hl
+  elseif virtcol(".") < virtcol("$")
+   silent norm! lh
+  endif
+
+  let &l:so   = so_keep
+  let &l:siso = siso_keep
+  let &l:ss   = ss_keep
+
+"  call Dret("RestoreWinPosn")
+endfun
+
+" ---------------------------------------------------------------------
+" GoWinbufnr: go to window holding given buffer (by number) {{{2
+"   Prefers current window; if its buffer number doesn't match,
+"   then will try from topleft to bottom right
+fun! GoWinbufnr(bufnum)
+"  call Dfunc("GoWinbufnr(".a:bufnum.")")
+  if winbufnr(0) == a:bufnum
+"   call Dret("GoWinbufnr : winbufnr(0)==a:bufnum")
+   return
+  endif
+  winc t
+  let first=1
+  while winbufnr(0) != a:bufnum && (first || winnr() != 1)
+       winc w
+       let first= 0
+   endwhile
+"  call Dret("GoWinbufnr")
+endfun
+
+" ---------------------------------------------------------------------
+" SaveMark: sets up a string saving a mark position. {{{2
+"           For example, SaveMark("a")
+"           Also sets up a global variable, g:savemark_{markname}
+fun! SaveMark(markname)
+"  call Dfunc("SaveMark(markname<".a:markname.">)")
+  let markname= a:markname
+  if strpart(markname,0,1) !~ '\a'
+   let markname= strpart(markname,1,1)
+  endif
+"  call Decho("markname=".markname)
+
+  let lzkeep  = &lz
+  set lz
+
+  if 1 <= line("'".markname) && line("'".markname) <= line("$")
+   let winposn               = SaveWinPosn(0)
+   exe s:modifier."norm! `".markname
+   let savemark              = SaveWinPosn(0)
+   let g:savemark_{markname} = savemark
+   let savemark              = markname.savemark
+   call RestoreWinPosn(winposn)
+  else
+   let g:savemark_{markname} = ""
+   let savemark              = ""
+  endif
+
+  let &lz= lzkeep
+
+"  call Dret("SaveMark : savemark<".savemark.">")
+  return savemark
+endfun
+
+" ---------------------------------------------------------------------
+" RestoreMark: {{{2
+"   call RestoreMark("a")  -or- call RestoreMark(savemark)
+fun! RestoreMark(markname)
+"  call Dfunc("RestoreMark(markname<".a:markname.">)")
+
+  if strlen(a:markname) <= 0
+"   call Dret("RestoreMark : no such mark")
+   return
+  endif
+  let markname= strpart(a:markname,0,1)
+  if markname !~ '\a'
+   " handles 'a -> a styles
+   let markname= strpart(a:markname,1,1)
+  endif
+"  call Decho("markname=".markname." strlen(a:markname)=".strlen(a:markname))
+
+  let lzkeep  = &lz
+  set lz
+  let winposn = SaveWinPosn(0)
+
+  if strlen(a:markname) <= 2
+   if exists("g:savemark_{markname}") && strlen(g:savemark_{markname}) != 0
+       " use global variable g:savemark_{markname}
+"      call Decho("use savemark list")
+       call RestoreWinPosn(g:savemark_{markname})
+       exe "norm! m".markname
+   endif
+  else
+   " markname is a savemark command (string)
+"      call Decho("use savemark command")
+   let markcmd= strpart(a:markname,1)
+   call RestoreWinPosn(markcmd)
+   exe "norm! m".markname
+  endif
+
+  call RestoreWinPosn(winposn)
+  let &lz       = lzkeep
+
+"  call Dret("RestoreMark")
+endfun
+
+" ---------------------------------------------------------------------
+" DestroyMark: {{{2
+"   call DestroyMark("a")  -- destroys mark
+fun! DestroyMark(markname)
+"  call Dfunc("DestroyMark(markname<".a:markname.">)")
+
+  " save options and set to standard values
+  let reportkeep= &report
+  let lzkeep    = &lz
+  set lz report=10000
+
+  let markname= strpart(a:markname,0,1)
+  if markname !~ '\a'
+   " handles 'a -> a styles
+   let markname= strpart(a:markname,1,1)
+  endif
+"  call Decho("markname=".markname)
+
+  let curmod  = &mod
+  let winposn = SaveWinPosn(0)
+  1
+  let lineone = getline(".")
+  exe "k".markname
+  d
+  put! =lineone
+  let &mod    = curmod
+  call RestoreWinPosn(winposn)
+
+  " restore options to user settings
+  let &report = reportkeep
+  let &lz     = lzkeep
+
+"  call Dret("DestroyMark")
+endfun
+
+" ---------------------------------------------------------------------
+" QArgSplitter: to avoid \ processing by <f-args>, <q-args> is needed. {{{2
+" However, <q-args> doesn't split at all, so this one returns a list
+" with splits at all whitespace (only!), plus a leading length-of-list.
+" The resulting list:  qarglist[0] corresponds to a:0
+"                      qarglist[i] corresponds to a:{i}
+fun! QArgSplitter(qarg)
+"  call Dfunc("QArgSplitter(qarg<".a:qarg.">)")
+  let qarglist    = split(a:qarg)
+  let qarglistlen = len(qarglist)
+  let qarglist    = insert(qarglist,qarglistlen)
+"  call Dret("QArgSplitter ".string(qarglist))
+  return qarglist
+endfun
+
+" ---------------------------------------------------------------------
+" ListWinPosn: {{{2
+"fun! ListWinPosn()                                                        " Decho 
+"  if !exists("b:cecutil_iwinposn") || b:cecutil_iwinposn == 0             " Decho 
+"   call Decho("nothing on SWP stack")                                     " Decho
+"  else                                                                    " Decho
+"   let jwinposn= b:cecutil_iwinposn                                       " Decho 
+"   while jwinposn >= 1                                                    " Decho 
+"    if exists("b:cecutil_winposn{jwinposn}")                              " Decho 
+"     call Decho("winposn{".jwinposn."}<".b:cecutil_winposn{jwinposn}.">") " Decho 
+"    else                                                                  " Decho 
+"     call Decho("winposn{".jwinposn."} -- doesn't exist")                 " Decho 
+"    endif                                                                 " Decho 
+"    let jwinposn= jwinposn - 1                                            " Decho 
+"   endwhile                                                               " Decho 
+"  endif                                                                   " Decho
+"endfun                                                                    " Decho 
+"com! -nargs=0 LWP     call ListWinPosn()                                    " Decho 
+
+" ---------------------------------------------------------------------
+" SaveUserMaps: this function sets up a script-variable (s:restoremap) {{{2
+"          which can be used to restore user maps later with
+"          call RestoreUserMaps()
+"
+"          mapmode - see :help maparg for details (n v o i c l "")
+"                    ex. "n" = Normal
+"                    The letters "b" and "u" are optional prefixes;
+"                    The "u" means that the map will also be unmapped
+"                    The "b" means that the map has a <buffer> qualifier
+"                    ex. "un"  = Normal + unmapping
+"                    ex. "bn"  = Normal + <buffer>
+"                    ex. "bun" = Normal + <buffer> + unmapping
+"                    ex. "ubn" = Normal + <buffer> + unmapping
+"          maplead - see mapchx
+"          mapchx  - "<something>" handled as a single map item.
+"                    ex. "<left>"
+"                  - "string" a string of single letters which are actually
+"                    multiple two-letter maps (using the maplead:
+"                    maplead . each_character_in_string)
+"                    ex. maplead="\" and mapchx="abc" saves user mappings for
+"                        \a, \b, and \c
+"                    Of course, if maplead is "", then for mapchx="abc",
+"                    mappings for a, b, and c are saved.
+"                  - :something  handled as a single map item, w/o the ":"
+"                    ex.  mapchx= ":abc" will save a mapping for "abc"
+"          suffix  - a string unique to your plugin
+"                    ex.  suffix= "DrawIt"
+fun! SaveUserMaps(mapmode,maplead,mapchx,suffix)
+"  call Dfunc("SaveUserMaps(mapmode<".a:mapmode."> maplead<".a:maplead."> mapchx<".a:mapchx."> suffix<".a:suffix.">)")
+
+  if !exists("s:restoremap_{a:suffix}")
+   " initialize restoremap_suffix to null string
+   let s:restoremap_{a:suffix}= ""
+  endif
+
+  " set up dounmap: if 1, then save and unmap  (a:mapmode leads with a "u")
+  "                 if 0, save only
+  let mapmode  = a:mapmode
+  let dounmap  = 0
+  let dobuffer = ""
+  while mapmode =~ '^[bu]'
+   if     mapmode =~ '^u'
+    let dounmap= 1
+    let mapmode= strpart(a:mapmode,1)
+   elseif mapmode =~ '^b'
+    let dobuffer= "<buffer> "
+    let mapmode= strpart(a:mapmode,1)
+   endif
+  endwhile
+"  call Decho("dounmap=".dounmap."  dobuffer<".dobuffer.">")
+  " save single map :...something...
+  if strpart(a:mapchx,0,1) == ':'
+"   call Decho("save single map :...something...")
+   let amap= strpart(a:mapchx,1)
+   if amap == "|" || amap == "\<c-v>"
+    let amap= "\<c-v>".amap
+   endif
+   let amap                    = a:maplead.amap
+   let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:silent! ".mapmode."unmap ".dobuffer.amap
+   if maparg(amap,mapmode) != ""
+    let maprhs                  = substitute(maparg(amap,mapmode),'|','<bar>','ge')
+       let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:".mapmode."map ".dobuffer.amap." ".maprhs
+   endif
+   if dounmap
+       exe "silent! ".mapmode."unmap ".dobuffer.amap
+   endif
+  " save single map <something>
+  elseif strpart(a:mapchx,0,1) == '<'
+"   call Decho("save single map <something>")
+   let amap       = a:mapchx
+   if amap == "|" || amap == "\<c-v>"
+    let amap= "\<c-v>".amap
+"      call Decho("amap[[".amap."]]")
+   endif
+   let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".dobuffer.amap
+   if maparg(a:mapchx,mapmode) != ""
+    let maprhs                  = substitute(maparg(amap,mapmode),'|','<bar>','ge')
+       let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".dobuffer.maprhs
+   endif
+   if dounmap
+       exe "silent! ".mapmode."unmap ".dobuffer.amap
+   endif
+  " save multiple maps
+  else
+"   call Decho("save multiple maps")
+   let i= 1
+   while i <= strlen(a:mapchx)
+    let amap= a:maplead.strpart(a:mapchx,i-1,1)
+       if amap == "|" || amap == "\<c-v>"
+        let amap= "\<c-v>".amap
+       endif
+       let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".dobuffer.amap
+    if maparg(amap,mapmode) != ""
+     let maprhs                  = substitute(maparg(amap,mapmode),'|','<bar>','ge')
+        let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".dobuffer.maprhs
+    endif
+       if dounmap
+        exe "silent! ".mapmode."unmap ".dobuffer.amap
+       endif
+    let i= i + 1
+   endwhile
+  endif
+"  call Dret("SaveUserMaps : restoremap_".a:suffix.": ".s:restoremap_{a:suffix})
+endfun
+
+" ---------------------------------------------------------------------
+" RestoreUserMaps: {{{2
+"   Used to restore user maps saved by SaveUserMaps()
+fun! RestoreUserMaps(suffix)
+"  call Dfunc("RestoreUserMaps(suffix<".a:suffix.">)")
+  if exists("s:restoremap_{a:suffix}")
+   let s:restoremap_{a:suffix}= substitute(s:restoremap_{a:suffix},'|\s*$','','e')
+   if s:restoremap_{a:suffix} != ""
+"      call Decho("exe ".s:restoremap_{a:suffix})
+    exe "silent! ".s:restoremap_{a:suffix}
+   endif
+   unlet s:restoremap_{a:suffix}
+  endif
+"  call Dret("RestoreUserMaps")
+endfun
+
+" ==============
+"  Restore: {{{1
+" ==============
+let &cpo= s:keepcpo
+unlet s:keepcpo
+
+" ================
+"  Modelines: {{{1
+" ================
+" vim: ts=4 fdm=marker
diff --git a/vim/plugin/color_sample_pack.vim b/vim/plugin/color_sample_pack.vim
new file mode 100644 (file)
index 0000000..00e8af2
--- /dev/null
@@ -0,0 +1,164 @@
+" Maintainer: Robert Melton ( iam -at- robertmelton -dot- com)
+" Last Change: 2010 Jan 20th
+
+" default schemes
+amenu T&hemes.D&efault.Blue :colo blue<CR>
+amenu T&hemes.D&efault.DarkBlue :colo darkblue<CR>
+amenu T&hemes.D&efault.Default :colo default<CR>
+amenu T&hemes.D&efault.Delek :colo delek<CR>
+amenu T&hemes.D&efault.Desert :colo desert<CR>
+amenu T&hemes.D&efault.ElfLord :colo elflord<CR>
+amenu T&hemes.D&efault.Evening :colo evening<CR>
+amenu T&hemes.D&efault.Koehler :colo koehler<CR>
+amenu T&hemes.D&efault.Morning :colo morning<CR>
+amenu T&hemes.D&efault.Murphy :colo murphy<CR>
+amenu T&hemes.D&efault.Pablo :colo pablo<CR>
+amenu T&hemes.D&efault.PeachPuff :colo peachpuff<CR>
+amenu T&hemes.D&efault.Ron :colo ron<CR>
+amenu T&hemes.D&efault.Shine :colo shine<CR>
+amenu T&hemes.D&efault.Torte :colo torte<CR>
+amenu T&hemes.-s1- :
+
+" 37 new themes
+amenu T&hemes.&New.&Dark.Adaryn :colo adaryn<CR>
+amenu T&hemes.&New.&Dark.Adrian :colo adrian<CR>
+amenu T&hemes.&New.&Dark.Anotherdark :colo anotherdark<CR>
+amenu T&hemes.&New.&Dark.BlackSea :colo blacksea<CR>
+amenu T&hemes.&New.&Dark.Colorer :colo colorer<CR>
+amenu T&hemes.&New.&Dark.Darkbone :colo darkbone<CR>
+amenu T&hemes.&New.&Dark.DarkZ :colo darkz<CR>
+amenu T&hemes.&New.&Dark.Herald :colo herald<CR>
+amenu T&hemes.&New.&Dark.Jammy :colo jammy<CR>
+amenu T&hemes.&New.&Dark.Kellys :colo kellys<CR>
+amenu T&hemes.&New.&Dark.Lettuce :colo lettuce<CR>
+amenu T&hemes.&New.&Dark.Maroloccio :colo maroloccio<CR>
+amenu T&hemes.&New.&Dark.Molokai :colo molokai<CR>
+amenu T&hemes.&New.&Dark.Mustang :colo mustang<CR>
+amenu T&hemes.&New.&Dark.TIRBlack :colo tir_black<CR>
+amenu T&hemes.&New.&Dark.Twilight :colo twilight<CR>
+amenu T&hemes.&New.&Dark.Two2Tango :colo two2tango<CR>
+amenu T&hemes.&New.&Dark.Wuye :colo wuye<CR>
+amenu T&hemes.&New.&Dark.Zmrok :colo zmrok<CR>
+amenu T&hemes.&New.&Light.BClear :colo bclear<CR>
+amenu T&hemes.&New.&Light.Satori :colo satori<CR>
+amenu T&hemes.&New.&Light.Silent :colo silent<CR>
+amenu T&hemes.&New.&Light.SoSo :colo soso<CR>
+amenu T&hemes.&New.&Light.SummerFruit256 :colo summerfruit256<CR>
+amenu T&hemes.&New.&Light.TAqua :colo taqua<CR>
+amenu T&hemes.&New.&Light.TCSoft :colo tcsoft<CR>
+amenu T&hemes.&New.&Light.VYLight :colo vylight<CR>
+amenu T&hemes.&New.&Other.Aqua :colo aqua<CR>
+amenu T&hemes.&New.&Other.Clarity :colo clarity<CR>
+amenu T&hemes.&New.&Other.CleanPHP :colo cleanphp<CR>
+amenu T&hemes.&New.&Other.Denim :colo denim<CR>
+amenu T&hemes.&New.&Other.Guardian :colo guardian<CR>
+amenu T&hemes.&New.&Other.Moss :colo moss<CR>
+amenu T&hemes.&New.&Other.Nightshimmer :colo nightshimmer<CR>
+amenu T&hemes.&New.&Other.NoQuarter :colo no_quarter<CR>
+amenu T&hemes.&New.&Other.RobinHood :colo robinhood<CR>
+amenu T&hemes.&New.&Other.SoftBlue :colo softblue<CR>
+amenu T&hemes.&New.&Other.Wood :colo wood<CR>
+
+" 30 removed themes
+amenu T&hemes.De&precated.&Dark.DwBlue :colo dw_blue<CR>
+amenu T&hemes.De&precated.&Dark.DwCyan :colo dw_cyan<CR>
+amenu T&hemes.De&precated.&Dark.DwGreen :colo dw_green<CR>
+amenu T&hemes.De&precated.&Dark.DwOrange :colo dw_orange<CR>
+amenu T&hemes.De&precated.&Dark.DwPurple :colo dw_purple<CR>
+amenu T&hemes.De&precated.&Dark.DwRed :colo dw_red<CR>
+amenu T&hemes.De&precated.&Dark.DwYellow :colo dw_yellow<CR>
+amenu T&hemes.De&precated.&Dark.Fruity :colo fruity<CR>
+amenu T&hemes.De&precated.&Dark.Leo :colo leo<CR>
+amenu T&hemes.De&precated.&Dark.Matrix :colo matrix<CR>
+amenu T&hemes.De&precated.&Dark.Metacosm :colo metacosm<CR>
+amenu T&hemes.De&precated.&Dark.Northland :colo northland<CR>
+amenu T&hemes.De&precated.&Dark.Railscasts2 :colo railscasts2<CR>
+amenu T&hemes.De&precated.&Dark.Synic :colo synic<CR>
+amenu T&hemes.De&precated.&Dark.Wombat256 :colo wombat256<CR>
+amenu T&hemes.De&precated.&Dark.Xoria256 :colo xoria256<CR>
+amenu T&hemes.De&precated.&Light.Autumn2 :colo autumn2<CR>
+amenu T&hemes.De&precated.&Light.Buttercream :colo buttercream<CR>
+amenu T&hemes.De&precated.&Light.Fine_blue :colo fine_blue<CR>
+amenu T&hemes.De&precated.&Light.Impact :colo impact<CR>
+amenu T&hemes.De&precated.&Light.Oceanlight :colo oceanlight<CR>
+amenu T&hemes.De&precated.&Light.Print_bw :colo print_bw<CR>
+amenu T&hemes.De&precated.&Light.Pyte :colo pyte<CR>
+amenu T&hemes.De&precated.&Light.Spring :colo spring<CR>
+amenu T&hemes.De&precated.&Light.Winter :colo winter<CR>
+amenu T&hemes.De&precated.&Other.Astronaut :colo astronaut<CR>
+amenu T&hemes.De&precated.&Other.Bluegreen :colo bluegreen<CR>
+amenu T&hemes.De&precated.&Other.Navajo :colo navajo<CR>
+amenu T&hemes.De&precated.&Other.Olive :colo olive<CR>
+amenu T&hemes.De&precated.&Other.Tabula :colo tabula<CR>
+amenu T&hemes.De&precated.&Other.Xemacs :colo xemacs<CR>
+
+" Themepack Themes
+amenu T&hemes.&Dark.Asu1dark :colo asu1dark<CR>
+amenu T&hemes.&Dark.Brookstream :colo brookstream<CR>
+amenu T&hemes.&Dark.Calmar256-dark :colo calmar256-dark<CR>
+amenu T&hemes.&Dark.Camo :colo camo<CR>
+amenu T&hemes.&Dark.Candy :colo candy<CR>
+amenu T&hemes.&Dark.Candycode :colo candycode<CR>
+amenu T&hemes.&Dark.Dante :colo dante<CR>
+amenu T&hemes.&Dark.Darkspectrum :colo darkspectrum<CR>
+amenu T&hemes.&Dark.Desert256 :colo desert256<CR>
+amenu T&hemes.&Dark.DesertEx :colo desertEx<CR>
+amenu T&hemes.&Dark.Dusk :colo dusk<CR>
+amenu T&hemes.&Dark.Earendel :colo earendel<CR>
+amenu T&hemes.&Dark.Ekvoli :colo ekvoli<CR>
+amenu T&hemes.&Dark.Fnaqevan :colo fnaqevan<CR>
+amenu T&hemes.&Dark.Freya :colo freya<CR>
+amenu T&hemes.&Dark.Golden :colo golden<CR>
+amenu T&hemes.&Dark.Inkpot :colo inkpot<CR>
+amenu T&hemes.&Dark.Jellybeans :colo jellybeans<CR>
+amenu T&hemes.&Dark.Lucius :colo lucius<CR>
+amenu T&hemes.&Dark.Manxome :colo manxome<CR>
+amenu T&hemes.&Dark.Moria :colo moria<CR>
+amenu T&hemes.&Dark.Motus :colo motus<CR>
+amenu T&hemes.&Dark.Neon :colo neon<CR>
+amenu T&hemes.&Dark.Neverness :colo neverness<CR>
+amenu T&hemes.&Dark.Oceanblack :colo oceanblack<CR>
+amenu T&hemes.&Dark.Railscasts :colo railscasts<CR>
+amenu T&hemes.&Dark.Rdark :colo rdark<CR>
+amenu T&hemes.&Dark.Relaxedgreen :colo relaxedgreen<CR>
+amenu T&hemes.&Dark.Rootwater :colo rootwater<CR>
+amenu T&hemes.&Dark.Tango :colo tango<CR>
+amenu T&hemes.&Dark.Tango2 :colo tango2<CR>
+amenu T&hemes.&Dark.Vibrantink :colo vibrantink<CR>
+amenu T&hemes.&Dark.Vividchalk :colo vividchalk<CR>
+amenu T&hemes.&Dark.Wombat :colo wombat<CR>
+amenu T&hemes.&Dark.Zenburn :colo zenburn<CR>
+
+amenu T&hemes.&Light.Autumn :colo autumn<CR>
+amenu T&hemes.&Light.Autumnleaf :colo autumnleaf<CR>
+amenu T&hemes.&Light.Baycomb :colo baycomb<CR>
+amenu T&hemes.&Light.Biogoo :colo biogoo<CR>
+amenu T&hemes.&Light.Calmar256-light :colo calmar256-light<CR>
+amenu T&hemes.&Light.Chela_light :colo chela_light<CR>
+amenu T&hemes.&Light.Dawn :colo dawn<CR>
+amenu T&hemes.&Light.Eclipse :colo eclipse<CR>
+amenu T&hemes.&Light.Fog :colo fog<CR>
+amenu T&hemes.&Light.Fruit :colo fruit<CR>
+amenu T&hemes.&Light.Habilight :colo habilight<CR>
+amenu T&hemes.&Light.Ironman :colo ironman<CR>
+amenu T&hemes.&Light.Martin_krischik :colo martin_krischik<CR>
+amenu T&hemes.&Light.Nuvola :colo nuvola<CR>
+amenu T&hemes.&Light.PapayaWhip :colo PapayaWhip<CR>
+amenu T&hemes.&Light.Sienna :colo sienna<CR>
+amenu T&hemes.&Light.Simpleandfriendly :colo simpleandfriendly<CR>
+amenu T&hemes.&Light.Tolerable :colo tolerable<CR>
+amenu T&hemes.&Light.Vc :colo vc<CR>
+
+amenu T&hemes.&Other.Aiseered :colo aiseered<CR>
+amenu T&hemes.&Other.Borland :colo borland<CR>
+amenu T&hemes.&Other.Breeze :colo breeze<CR>
+amenu T&hemes.&Other.Chocolateliquor :colo chocolateliquor<CR>
+amenu T&hemes.&Other.Darkblue2 :colo darkblue2<CR>
+amenu T&hemes.&Other.Darkslategray :colo darkslategray<CR>
+amenu T&hemes.&Other.Marklar :colo marklar<CR>
+amenu T&hemes.&Other.Navajo-night :colo navajo-night<CR>
+amenu T&hemes.&Other.Night :colo night<CR>
+amenu T&hemes.&Other.Oceandeep :colo oceandeep<CR>
+amenu T&hemes.&Other.Peaksea :colo peaksea<CR>
+amenu T&hemes.&Other.Sea :colo sea<CR>
+amenu T&hemes.&Other.Settlemyer :colo settlemyer<CR>
diff --git a/vim/plugin/conque_term.vim b/vim/plugin/conque_term.vim
new file mode 100644 (file)
index 0000000..07f96e0
--- /dev/null
@@ -0,0 +1,93 @@
+" FILE:     plugin/conque_term.vim {{{
+" AUTHOR:   Nico Raffo <nicoraffo@gmail.com>
+" MODIFIED: 2010-05-27
+" VERSION:  1.1, for Vim 7.0
+" LICENSE:
+" Conque - pty interaction in Vim
+" Copyright (C) 2009-2010 Nico Raffo 
+"
+" MIT License
+" 
+" Permission is hereby granted, free of charge, to any person obtaining a copy
+" of this software and associated documentation files (the "Software"), to deal
+" in the Software without restriction, including without limitation the rights
+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+" copies of the Software, and to permit persons to whom the Software is
+" furnished to do so, subject to the following conditions:
+" 
+" The above copyright notice and this permission notice shall be included in
+" all copies or substantial portions of the Software.
+" 
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+" THE SOFTWARE.
+" }}}
+
+" See docs/conque_term.txt for help or type :help conque_term
+
+if exists('g:ConqueTerm_Loaded') || v:version < 700
+    finish
+endif
+
+" **********************************************************************************************************
+" **** CONFIG **********************************************************************************************
+" **********************************************************************************************************
+
+" Choose key mapping to leave insert mode {{{
+" If you choose something other than '<Esc>', then <Esc> will be sent to terminal
+" Using a different key will usually fix Alt/Meta key issues
+if !exists('g:ConqueTerm_EscKey')
+    let g:ConqueTerm_EscKey = '<Esc>'
+endif " }}}
+
+" Enable color. {{{
+" If your apps use a lot of color it will slow down the shell.
+if !exists('g:ConqueTerm_Color')
+    let g:ConqueTerm_Color = 1
+endif " }}}
+
+" TERM environment setting {{{
+if !exists('g:ConqueTerm_TERM')
+    let g:ConqueTerm_TERM =  'vt100'
+endif " }}}
+
+" Syntax for your buffer {{{
+if !exists('g:ConqueTerm_Syntax')
+    let g:ConqueTerm_Syntax = 'conque_term'
+endif " }}}
+
+" Keep on updating the shell window after you've switched to another buffer {{{
+if !exists('g:ConqueTerm_ReadUnfocused')
+    let g:ConqueTerm_ReadUnfocused = 0
+endif " }}}
+
+" Use this regular expression to highlight prompt {{{
+if !exists('g:ConqueTerm_PromptRegex')
+    let g:ConqueTerm_PromptRegex = '^\w\+@[0-9A-Za-z_.-]\+:[0-9A-Za-z_./\~,:-]\+\$'
+endif " }}}
+
+" Allow user to use <C-w> keys to switch window in insert mode. {{{
+if !exists('g:ConqueTerm_CWInsert')
+    let g:ConqueTerm_CWInsert = 0
+endif " }}}
+
+" **********************************************************************************************************
+" **** Startup *********************************************************************************************
+" **********************************************************************************************************
+
+" Startup {{{
+
+let g:ConqueTerm_Loaded = 1
+let g:ConqueTerm_Idx = 1
+
+command! -nargs=+ -complete=shellcmd ConqueTerm call conque_term#open(<q-args>)
+command! -nargs=+ -complete=shellcmd ConqueTermSplit call conque_term#open(<q-args>, ['belowright split'])
+command! -nargs=+ -complete=shellcmd ConqueTermVSplit call conque_term#open(<q-args>, ['belowright vsplit'])
+command! -nargs=+ -complete=shellcmd ConqueTermTab call conque_term#open(<q-args>, ['tabnew'])
+
+" }}}
+
diff --git a/vim/plugin/delimitMate.vim b/vim/plugin/delimitMate.vim
new file mode 100644 (file)
index 0000000..95ebf19
--- /dev/null
@@ -0,0 +1,434 @@
+" File:        plugin/delimitMate.vim
+" Version:     2.6
+" Modified:    2011-01-14
+" Description: This plugin provides auto-completion for quotes, parens, etc.
+" Maintainer:  Israel Chauca F. <israelchauca@gmail.com>
+" Manual:      Read ":help delimitMate".
+" ============================================================================
+
+" Initialization: {{{
+
+if exists("g:loaded_delimitMate") || &cp
+       " User doesn't want this plugin or compatible is set, let's get out!
+       finish
+endif
+let g:loaded_delimitMate = 1
+
+if exists("s:loaded_delimitMate") && !exists("g:delimitMate_testing")
+       " Don't define the functions if they already exist: just do the work
+       " (unless we are testing):
+       call s:DelimitMateDo()
+       finish
+endif
+
+if v:version < 700
+       echoerr "delimitMate: this plugin requires vim >= 7!"
+       finish
+endif
+
+let s:loaded_delimitMate = 1
+let delimitMate_version = "2.6"
+
+function! s:option_init(name, default) "{{{
+       let b = exists("b:delimitMate_" . a:name)
+       let g = exists("g:delimitMate_" . a:name)
+       let prefix = "_l_delimitMate_"
+
+       if !b && !g
+               let sufix = a:default
+       elseif !b && g
+               exec "let sufix = g:delimitMate_" . a:name
+       else
+               exec "let sufix = b:delimitMate_" . a:name
+       endif
+       if exists("b:" . prefix . a:name)
+               exec "unlockvar! b:" . prefix . a:name
+       endif
+       exec "let b:" . prefix . a:name . " = " . string(sufix)
+       exec "lockvar! b:" . prefix . a:name
+endfunction "}}}
+
+function! s:init() "{{{
+" Initialize variables:
+
+       " autoclose
+       call s:option_init("autoclose", 1)
+
+       " matchpairs
+       call s:option_init("matchpairs", string(&matchpairs)[1:-2])
+       call s:option_init("matchpairs_list", split(b:_l_delimitMate_matchpairs, ','))
+       call s:option_init("left_delims", split(b:_l_delimitMate_matchpairs, ':.,\='))
+       call s:option_init("right_delims", split(b:_l_delimitMate_matchpairs, ',\=.:'))
+
+       " quotes
+       call s:option_init("quotes", "\" ' `")
+       call s:option_init("quotes_list", split(b:_l_delimitMate_quotes))
+
+       " nesting_quotes
+       call s:option_init("nesting_quotes", [])
+
+       " excluded_regions
+       call s:option_init("excluded_regions", "Comment")
+       call s:option_init("excluded_regions_list", split(b:_l_delimitMate_excluded_regions, ',\s*'))
+       let enabled = len(b:_l_delimitMate_excluded_regions_list) > 0
+       call s:option_init("excluded_regions_enabled", enabled)
+
+       " excluded filetypes
+       call s:option_init("excluded_ft", "")
+
+       " expand_space
+       if exists("b:delimitMate_expand_space") && type(b:delimitMate_expand_space) == type("")
+               echom "b:delimitMate_expand_space is '".b:delimitMate_expand_space."' but it must be either 1 or 0!"
+               echom "Read :help 'delimitMate_expand_space' for more details."
+               unlet b:delimitMate_expand_space
+               let b:delimitMate_expand_space = 1
+       endif
+       if exists("g:delimitMate_expand_space") && type(g:delimitMate_expand_space) == type("")
+               echom "delimitMate_expand_space is '".g:delimitMate_expand_space."' but it must be either 1 or 0!"
+               echom "Read :help 'delimitMate_expand_space' for more details."
+               unlet g:delimitMate_expand_space
+               let g:delimitMate_expand_space = 1
+       endif
+       call s:option_init("expand_space", 0)
+
+       " expand_cr
+       if exists("b:delimitMate_expand_cr") && type(b:delimitMate_expand_cr) == type("")
+               echom "b:delimitMate_expand_cr is '".b:delimitMate_expand_cr."' but it must be either 1 or 0!"
+               echom "Read :help 'delimitMate_expand_cr' for more details."
+               unlet b:delimitMate_expand_cr
+               let b:delimitMate_expand_cr = 1
+       endif
+       if exists("g:delimitMate_expand_cr") && type(g:delimitMate_expand_cr) == type("")
+               echom "delimitMate_expand_cr is '".g:delimitMate_expand_cr."' but it must be either 1 or 0!"
+               echom "Read :help 'delimitMate_expand_cr' for more details."
+               unlet g:delimitMate_expand_cr
+               let g:delimitMate_expand_cr = 1
+       endif
+       if ((&backspace !~ 'eol' || &backspace !~ 'start') && &backspace != 2) &&
+                               \ ((exists('b:delimitMate_expand_cr') && b:delimitMate_expand_cr == 1) ||
+                               \ (exists('g:delimitMate_expand_cr') && g:delimitMate_expand_cr == 1))
+               echom "delimitMate: There seems to be some incompatibility with your settings that may interfer with the expansion of <CR>. See :help 'delimitMate_expand_cr' for details."
+       endif
+       call s:option_init("expand_cr", 0)
+
+       " smart_matchpairs
+       call s:option_init("smart_matchpairs", '^\%(\w\|\!\|ยฃ\|\$\|_\|["'']\s*\S\)')
+
+       " smart_quotes
+       call s:option_init("smart_quotes", 1)
+
+       " apostrophes
+       call s:option_init("apostrophes", "")
+       call s:option_init("apostrophes_list", split(b:_l_delimitMate_apostrophes, ":\s*"))
+
+       " tab2exit
+       call s:option_init("tab2exit", 1)
+
+       " balance_matchpairs
+       call s:option_init("balance_matchpairs", 0)
+
+       let b:_l_delimitMate_buffer = []
+
+endfunction "}}} Init()
+
+"}}}
+
+" Functions: {{{
+
+function! s:Map() "{{{
+       " Set mappings:
+       try
+               let save_cpo = &cpo
+               let save_keymap = &keymap
+               let save_iminsert = &iminsert
+               let save_imsearch = &imsearch
+               set keymap=
+               set cpo&vim
+               if b:_l_delimitMate_autoclose
+                       call s:AutoClose()
+               else
+                       call s:NoAutoClose()
+               endif
+               call s:ExtraMappings()
+       finally
+               let &cpo = save_cpo
+               let &keymap = save_keymap
+               let &iminsert = save_iminsert
+               let &imsearch = save_imsearch
+       endtry
+
+       let b:delimitMate_enabled = 1
+
+endfunction "}}} Map()
+
+function! s:Unmap() " {{{
+       let imaps =
+                               \ b:_l_delimitMate_right_delims +
+                               \ b:_l_delimitMate_left_delims +
+                               \ b:_l_delimitMate_quotes_list +
+                               \ b:_l_delimitMate_apostrophes_list +
+                               \ ['<BS>', '<S-BS>', '<Del>', '<CR>', '<Space>', '<S-Tab>', '<Esc>'] +
+                               \ ['<Up>', '<Down>', '<Left>', '<Right>', '<LeftMouse>', '<RightMouse>'] +
+                               \ ['<Home>', '<End>', '<PageUp>', '<PageDown>', '<S-Down>', '<S-Up>', '<C-G>g']
+
+       for map in imaps
+               if maparg(map, "i") =~? 'delimitMate'
+                       if map == '|'
+                               let map = '<Bar>'
+                       endif
+                       exec 'silent! iunmap <buffer> ' . map
+               endif
+       endfor
+
+       if !has('gui_running')
+               silent! iunmap <C-[>OC
+       endif
+
+       let b:delimitMate_enabled = 0
+endfunction " }}} s:Unmap()
+
+function! s:TestMappingsDo() "{{{
+       %d
+       if !exists("g:delimitMate_testing")
+               silent call delimitMate#TestMappings()
+       else
+               let temp_varsDM = [b:_l_delimitMate_expand_space, b:_l_delimitMate_expand_cr, b:_l_delimitMate_autoclose]
+               for i in [0,1]
+                       let b:delimitMate_expand_space = i
+                       let b:delimitMate_expand_cr = i
+                       for a in [0,1]
+                               let b:delimitMate_autoclose = a
+                               call s:init()
+                               call s:Unmap()
+                               call s:Map()
+                               call delimitMate#TestMappings()
+                               call append(line('$'),'')
+                       endfor
+               endfor
+               let b:delimitMate_expand_space = temp_varsDM[0]
+               let b:delimitMate_expand_cr = temp_varsDM[1]
+               let b:delimitMate_autoclose = temp_varsDM[2]
+               unlet temp_varsDM
+       endif
+       normal gg
+       g/\%^$/d
+endfunction "}}}
+
+function! s:DelimitMateDo(...) "{{{
+
+       " First, remove all magic, if needed:
+       if exists("b:delimitMate_enabled") && b:delimitMate_enabled == 1
+               call s:Unmap()
+       endif
+
+       " Check if this file type is excluded:
+       if exists("g:delimitMate_excluded_ft") &&
+                               \ index(split(g:delimitMate_excluded_ft, ','), &filetype, 0, 1) >= 0
+
+               " Finish here:
+               return 1
+       endif
+
+       " Check if user tried to disable using b:loaded_delimitMate
+       if exists("b:loaded_delimitMate")
+               return 1
+       endif
+
+       " Initialize settings:
+       call s:init()
+
+       " Now, add magic:
+       call s:Map()
+
+       if a:0 > 0
+               echo "delimitMate has been reset."
+       endif
+endfunction "}}}
+
+function! s:DelimitMateSwitch() "{{{
+       if exists("b:delimitMate_enabled") && b:delimitMate_enabled
+               call s:Unmap()
+               echo "delimitMate has been disabled."
+       else
+               call s:Unmap()
+               call s:init()
+               call s:Map()
+               echo "delimitMate has been enabled."
+       endif
+endfunction "}}}
+
+function! s:Finish() " {{{
+       if exists('g:delimitMate_loaded')
+               return delimitMate#Finish(1)
+       endif
+       return ''
+endfunction " }}}
+
+function! s:FlushBuffer() " {{{
+       if exists('g:delimitMate_loaded')
+               return delimitMate#FlushBuffer()
+       endif
+       return ''
+endfunction " }}}
+
+"}}}
+
+" Mappers: {{{
+function! s:NoAutoClose() "{{{
+       " inoremap <buffer> ) <C-R>=delimitMate#SkipDelim('\)')<CR>
+       for delim in b:_l_delimitMate_right_delims + b:_l_delimitMate_quotes_list
+               if delim == '|'
+                       let delim = '<Bar>'
+               endif
+               exec 'inoremap <silent> <Plug>delimitMate' . delim . ' <C-R>=delimitMate#SkipDelim("' . escape(delim,'"') . '")<CR>'
+               exec 'silent! imap <unique> <buffer> '.delim.' <Plug>delimitMate'.delim
+       endfor
+endfunction "}}}
+
+function! s:AutoClose() "{{{
+       " Add matching pair and jump to the midle:
+       " inoremap <silent> <buffer> ( ()<Left>
+       let i = 0
+       while i < len(b:_l_delimitMate_matchpairs_list)
+               let ld = b:_l_delimitMate_left_delims[i] == '|' ? '<bar>' : b:_l_delimitMate_left_delims[i]
+               let rd = b:_l_delimitMate_right_delims[i] == '|' ? '<bar>' : b:_l_delimitMate_right_delims[i]
+               exec 'inoremap <silent> <Plug>delimitMate' . ld . ' ' . ld . '<C-R>=delimitMate#ParenDelim("' . escape(rd, '|') . '")<CR>'
+               exec 'silent! imap <unique> <buffer> '.ld.' <Plug>delimitMate'.ld
+               let i += 1
+       endwhile
+
+       " Exit from inside the matching pair:
+       for delim in b:_l_delimitMate_right_delims
+               exec 'inoremap <silent> <Plug>delimitMate' . delim . ' <C-R>=delimitMate#JumpOut("\' . delim . '")<CR>'
+               exec 'silent! imap <unique> <buffer> ' . delim . ' <Plug>delimitMate'. delim
+       endfor
+
+       " Add matching quote and jump to the midle, or exit if inside a pair of matching quotes:
+       " inoremap <silent> <buffer> " <C-R>=delimitMate#QuoteDelim("\"")<CR>
+       for delim in b:_l_delimitMate_quotes_list
+               if delim == '|'
+                       let delim = '<Bar>'
+               endif
+               exec 'inoremap <silent> <Plug>delimitMate' . delim . ' <C-R>=delimitMate#QuoteDelim("\' . delim . '")<CR>'
+               exec 'silent! imap <unique> <buffer> ' . delim . ' <Plug>delimitMate' . delim
+       endfor
+
+       " Try to fix the use of apostrophes (kept for backward compatibility):
+       " inoremap <silent> <buffer> n't n't
+       for map in b:_l_delimitMate_apostrophes_list
+               exec "inoremap <silent> " . map . " " . map
+               exec 'silent! imap <unique> <buffer> ' . map . ' <Plug>delimitMate' . map
+       endfor
+endfunction "}}}
+
+function! s:ExtraMappings() "{{{
+       " If pair is empty, delete both delimiters:
+       inoremap <silent> <Plug>delimitMateBS <C-R>=delimitMate#BS()<CR>
+       if !hasmapto('<Plug>delimitMateBS','i')
+               silent! imap <unique> <buffer> <BS> <Plug>delimitMateBS
+       endif
+       " If pair is empty, delete closing delimiter:
+       inoremap <silent> <expr> <Plug>delimitMateS-BS delimitMate#WithinEmptyPair() ? "\<C-R>=delimitMate#Del()\<CR>" : "\<S-BS>"
+       if !hasmapto('<Plug>delimitMateS-BS','i')
+               silent! imap <unique> <buffer> <S-BS> <Plug>delimitMateS-BS
+       endif
+       " Expand return if inside an empty pair:
+       inoremap <silent> <Plug>delimitMateCR <C-R>=delimitMate#ExpandReturn()<CR>
+       if b:_l_delimitMate_expand_cr != 0 && !hasmapto('<Plug>delimitMateCR', 'i')
+               silent! imap <unique> <buffer> <CR> <Plug>delimitMateCR
+       endif
+       " Expand space if inside an empty pair:
+       inoremap <silent> <Plug>delimitMateSpace <C-R>=delimitMate#ExpandSpace()<CR>
+       if b:_l_delimitMate_expand_space != 0 && !hasmapto('<Plug>delimitMateSpace', 'i')
+               silent! imap <unique> <buffer> <Space> <Plug>delimitMateSpace
+       endif
+       " Jump over any delimiter:
+       inoremap <silent> <Plug>delimitMateS-Tab <C-R>=delimitMate#JumpAny("\<S-Tab>")<CR>
+       if b:_l_delimitMate_tab2exit && !hasmapto('<Plug>delimitMateS-Tab', 'i')
+               silent! imap <unique> <buffer> <S-Tab> <Plug>delimitMateS-Tab
+       endif
+       " Change char buffer on Del:
+       inoremap <silent> <Plug>delimitMateDel <C-R>=delimitMate#Del()<CR>
+       if !hasmapto('<Plug>delimitMateDel', 'i')
+               silent! imap <unique> <buffer> <Del> <Plug>delimitMateDel
+       endif
+       " Flush the char buffer on movement keystrokes or when leaving insert mode:
+       for map in ['Esc', 'Left', 'Right', 'Home', 'End']
+               exec 'inoremap <silent> <Plug>delimitMate'.map.' <C-R>=<SID>Finish()<CR><'.map.'>'
+               if !hasmapto('<Plug>delimitMate'.map, 'i')
+                       exec 'silent! imap <unique> <buffer> <'.map.'> <Plug>delimitMate'.map
+               endif
+       endfor
+       " Except when pop-up menu is active:
+       for map in ['Up', 'Down', 'PageUp', 'PageDown', 'S-Down', 'S-Up']
+               exec 'inoremap <silent> <expr> <Plug>delimitMate'.map.' pumvisible() ? "\<'.map.'>" : "\<C-R>=\<SID>Finish()\<CR>\<'.map.'>"'
+               if !hasmapto('<Plug>delimitMate'.map, 'i')
+                       exec 'silent! imap <unique> <buffer> <'.map.'> <Plug>delimitMate'.map
+               endif
+       endfor
+       " Avoid ambiguous mappings:
+       for map in ['LeftMouse', 'RightMouse']
+               exec 'inoremap <silent> <Plug>delimitMateM'.map.' <C-R>=delimitMate#Finish(1)<CR><'.map.'>'
+               if !hasmapto('<Plug>delimitMate'.map, 'i')
+                       exec 'silent! imap <unique> <buffer> <'.map.'> <Plug>delimitMateM'.map
+               endif
+       endfor
+
+       " Jump over next delimiters
+       inoremap <buffer> <Plug>delimitMateJumpMany <C-R>=len(b:_l_delimitMate_buffer) ? delimitMate#Finish(0) : delimitMate#JumpMany()<CR>
+       if !hasmapto('<Plug>delimitMateJumpMany')
+               imap <silent> <buffer> <C-G>g <Plug>delimitMateJumpMany
+       endif
+
+       " The following simply creates an ambiguous mapping so vim fully processes
+       " the escape sequence for terminal keys, see 'ttimeout' for a rough
+       " explanation, this just forces it to work
+       if !has('gui_running')
+               imap <silent> <C-[>OC <RIGHT>
+       endif
+endfunction "}}}
+
+"}}}
+
+" Commands: {{{
+
+call s:DelimitMateDo()
+
+" Let me refresh without re-loading the buffer:
+command! -bar DelimitMateReload call s:DelimitMateDo(1)
+
+" Quick test:
+command! -bar DelimitMateTest silent call s:TestMappingsDo()
+
+" Switch On/Off:
+command! -bar DelimitMateSwitch call s:DelimitMateSwitch()
+"}}}
+
+" Autocommands: {{{
+
+augroup delimitMate
+       au!
+       " Run on file type change.
+       "autocmd VimEnter * autocmd FileType * call <SID>DelimitMateDo()
+       autocmd FileType * call <SID>DelimitMateDo()
+
+       " Run on new buffers.
+       autocmd BufNewFile,BufRead,BufEnter *
+                               \ if !exists('b:delimitMate_was_here') |
+                               \   call <SID>DelimitMateDo() |
+                               \   let b:delimitMate_was_here = 1 |
+                               \ endif
+
+       " Flush the char buffer:
+       autocmd InsertEnter * call <SID>FlushBuffer()
+       autocmd BufEnter *
+                               \ if mode() == 'i' |
+                               \   call <SID>FlushBuffer() |
+                               \ endif
+
+augroup END
+
+"}}}
+
+" GetLatestVimScripts: 2754 1 :AutoInstall: delimitMate.vim
+" vim:foldmethod=marker:foldcolumn=4
diff --git a/vim/plugin/endwise.vim b/vim/plugin/endwise.vim
new file mode 100644 (file)
index 0000000..dca90ff
--- /dev/null
@@ -0,0 +1,134 @@
+" endwise.vim - EndWise
+" Author:       Tim Pope <http://tpo.pe/>
+" Version:      1.0
+" License:      Same as Vim itself.  See :help license
+" GetLatestVimScripts: 2386 1 :AutoInstall: endwise.vim
+
+if exists("g:loaded_endwise") || &cp
+  finish
+endif
+let g:loaded_endwise = 1
+
+augroup endwise " {{{1
+  autocmd!
+  autocmd FileType lua
+        \ let b:endwise_addition = '\=submatch(0)=="{" ? "}" : "end"' |
+        \ let b:endwise_words = 'function,do,then' |
+        \ let b:endwise_pattern = '^\s*\zs\%(function\|do\|then\)\>\%(.*[^.:@$]\<end\>\)\@!\|\<then\|do\ze\%(\s*|.*|\)\=\s*$' |
+        \ let b:endwise_syngroups = 'luaFunction,luaStatement,luaCond'
+  autocmd FileType ruby
+        \ let b:endwise_addition = '\=submatch(0)=="{" ? "}" : "end"' |
+        \ let b:endwise_words = 'module,class,def,if,unless,case,while,until,begin,do' |
+        \ let b:endwise_pattern = '^\s*\zs\%(module\|class\|def\|if\|unless\|case\|while\|until\|for\|\|begin\)\>\%(.*[^.:@$]\<end\>\)\@!\|\<do\ze\%(\s*|.*|\)\=\s*$' |
+          \ let b:endwise_syngroups = 'rubyModule,rubyClass,rubyDefine,rubyControl,rubyConditional,rubyRepeat'
+  autocmd FileType sh,zsh
+        \ let b:endwise_addition = '\=submatch(0)=="if" ? "fi" : submatch(0)=="case" ? "esac" : "done"' |
+        \ let b:endwise_words = 'if,until,case,do' |
+        \ let b:endwise_pattern = '\%(^\s*\zs\%(if\|case\)\>\ze\|\zs\<do\ze$\|^\s*\zsdo\s*\ze$\)' |
+        \ let b:endwise_syngroups = 'shConditional,shLoop,shIf,shFor,shRepeat,shCaseEsac,zshConditional,zshRepeat,zshDelimiter'
+  autocmd FileType vb,vbnet,aspvbs
+        \ let b:endwise_addition = 'End &' |
+        \ let b:endwise_words = 'Function,Sub,Class,Module,Enum,Namespace' |
+        \ let b:endwise_pattern = '\%(\<End\>.*\)\@<!\<&\>' |
+        \ let b:endwise_syngroups = 'vbStatement,vbnetStorage,vbnetProcedure,vbnet.*Words,AspVBSStatement'
+  autocmd FileType vim
+        \ let b:endwise_addition = 'end&' |
+        \ let b:endwise_words = 'fu\%[nction],wh\%[ile],if,for,try' |
+        \ let b:endwise_syngroups = 'vimFuncKey,vimNotFunc,vimCommand'
+augroup END " }}}1
+
+" Maps {{{1
+
+if maparg("<Plug>DiscretionaryEnd") == ""
+  inoremap <silent> <SID>DiscretionaryEnd <C-R>=<SID>crend(0)<CR>
+  inoremap <silent> <SID>AlwaysEnd        <C-R>=<SID>crend(1)<CR>
+  imap    <script> <Plug>DiscretionaryEnd <SID>DiscretionaryEnd
+  imap    <script> <Plug>AlwaysEnd        <SID>AlwaysEnd
+endif
+if maparg('<CR>','i') =~# '<C-R>=.*crend(.)<CR>\|<\%(Plug\|SID\)>.*End'
+  " Already mapped
+elseif maparg('<CR>','i') =~ '<CR>'
+  exe "imap <script> <C-X><CR> ".maparg('<CR>','i')."<SID>AlwaysEnd"
+  exe "imap <script> <CR>      ".maparg('<CR>','i')."<SID>DiscretionaryEnd"
+elseif maparg('<CR>','i') =~ '<Plug>delimitMateCR'
+  exe "imap <C-X><CR> ".maparg('<CR>', 'i')."<Plug>AlwaysEnd"
+  exe "imap <CR> ".maparg('<CR>', 'i')."<Plug>DiscretionaryEnd"
+else
+  imap <C-X><CR> <CR><Plug>AlwaysEnd
+  imap <CR>      <CR><Plug>DiscretionaryEnd
+endif
+
+if maparg('<M-o>','i') == ''
+  inoremap <M-o> <C-O>o
+endif
+
+" }}}1
+
+" Code {{{1
+
+function! s:mysearchpair(beginpat,endpat,synpat)
+  let g:endwise_syntaxes = ""
+  let s:lastline = line('.')
+  call s:synname()
+  let line = searchpair(a:beginpat,'',a:endpat,'Wn','<SID>synname() !~# "^'.substitute(a:synpat,'\\','\\\\','g').'$"',line('.')+50)
+  return line
+endfunction
+
+function! s:crend(always)
+  let n = ""
+  if !exists("b:endwise_addition") || !exists("b:endwise_words") || !exists("b:endwise_syngroups")
+    return n
+  end
+  let synpat  = '\%('.substitute(b:endwise_syngroups,',','\\|','g').'\)'
+  let wordchoice = '\%('.substitute(b:endwise_words,',','\\|','g').'\)'
+  if exists("b:endwise_pattern")
+    let beginpat = substitute(b:endwise_pattern,'&',substitute(wordchoice,'\\','\\&','g'),'g')
+  else
+    let beginpat = '\<'.wordchoice.'\>'
+  endif
+  let lnum = line('.') - 1
+  let space = matchstr(getline(lnum),'^\s*')
+  let col  = match(getline(lnum),beginpat) + 1
+  let word  = matchstr(getline(lnum),beginpat)
+  let endword = substitute(word,'.*',b:endwise_addition,'')
+  let y = n.endword."\<C-O>O"
+  let endpat = '\<'.endword.'\>'
+  if a:always
+    return y
+  elseif col <= 0 || synIDattr(synID(lnum,col,1),'name') !~ '^'.synpat.'$'
+    return n
+  elseif getline('.') !~ '^\s*#\=$'
+    return n
+  endif
+  let line = s:mysearchpair(beginpat,endpat,synpat)
+  " even is false if no end was found, or if the end found was less
+  " indented than the current line
+  let even = strlen(matchstr(getline(line),'^\s*')) >= strlen(space)
+  if line == 0
+    let even = 0
+  endif
+  if !even && line == line('.') + 1
+    return y
+  endif
+  if even
+    return n
+  endif
+  return y
+endfunction
+
+function! s:synname()
+  " Checking this helps to force things to stay in sync
+  while s:lastline < line('.')
+    let s = synIDattr(synID(s:lastline,indent(s:lastline)+1,1),'name')
+    let s:lastline = nextnonblank(s:lastline + 1)
+  endwhile
+
+  let s = synIDattr(synID(line('.'),col('.'),1),'name')
+  let g:endwise_syntaxes = g:endwise_syntaxes . line('.').','.col('.')."=".s."\n"
+  let s:lastline = line('.')
+  return s
+endfunction
+
+" }}}1
+
+" vim:set sw=2 sts=2:
diff --git a/vim/plugin/fugitive.vim b/vim/plugin/fugitive.vim
new file mode 100644 (file)
index 0000000..17d52fc
--- /dev/null
@@ -0,0 +1,2220 @@
+" fugitive.vim - A Git wrapper so awesome, it should be illegal
+" Maintainer:   Tim Pope <http://tpo.pe/>
+" Version:      1.2
+" GetLatestVimScripts: 2975 1 :AutoInstall: fugitive.vim
+
+if exists('g:loaded_fugitive') || &cp
+  finish
+endif
+let g:loaded_fugitive = 1
+
+if !exists('g:fugitive_git_executable')
+  let g:fugitive_git_executable = 'git'
+endif
+
+" Utility {{{1
+
+function! s:function(name) abort
+  return function(substitute(a:name,'^s:',matchstr(expand('<sfile>'), '<SNR>\d\+_'),''))
+endfunction
+
+function! s:sub(str,pat,rep) abort
+  return substitute(a:str,'\v\C'.a:pat,a:rep,'')
+endfunction
+
+function! s:gsub(str,pat,rep) abort
+  return substitute(a:str,'\v\C'.a:pat,a:rep,'g')
+endfunction
+
+function! s:shellesc(arg) abort
+  if a:arg =~ '^[A-Za-z0-9_/.-]\+$'
+    return a:arg
+  elseif &shell =~# 'cmd' && a:arg !~# '"'
+    return '"'.a:arg.'"'
+  else
+    return shellescape(a:arg)
+  endif
+endfunction
+
+function! s:fnameescape(file) abort
+  if exists('*fnameescape')
+    return fnameescape(a:file)
+  else
+    return escape(a:file," \t\n*?[{`$\\%#'\"|!<")
+  endif
+endfunction
+
+function! s:throw(string) abort
+  let v:errmsg = 'fugitive: '.a:string
+  throw v:errmsg
+endfunction
+
+function! s:warn(str)
+  echohl WarningMsg
+  echomsg a:str
+  echohl None
+  let v:warningmsg = a:str
+endfunction
+
+function! s:shellslash(path)
+  if exists('+shellslash') && !&shellslash
+    return s:gsub(a:path,'\\','/')
+  else
+    return a:path
+  endif
+endfunction
+
+function! s:recall()
+  let rev = s:buffer().rev()
+  if rev ==# ':'
+    return matchstr(getline('.'),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (new commits)\)\=$\|^\d\{6} \x\{40\} \d\t\zs.*')
+  endif
+  return rev
+endfunction
+
+function! s:add_methods(namespace, method_names) abort
+  for name in a:method_names
+    let s:{a:namespace}_prototype[name] = s:function('s:'.a:namespace.'_'.name)
+  endfor
+endfunction
+
+let s:commands = []
+function! s:command(definition) abort
+  let s:commands += [a:definition]
+endfunction
+
+function! s:define_commands()
+  for command in s:commands
+    exe 'command! -buffer '.command
+  endfor
+endfunction
+
+function! s:compatibility_check()
+  if exists('b:git_dir') && exists('*GitBranchInfoCheckGitDir') && !exists('g:fugitive_did_compatibility_warning')
+    let g:fugitive_did_compatibility_warning = 1
+    call s:warn("See http://github.com/tpope/vim-fugitive/issues#issue/1 for why you should remove git-branch-info.vim")
+  endif
+endfunction
+
+augroup fugitive_utility
+  autocmd!
+  autocmd User Fugitive call s:define_commands()
+  autocmd VimEnter * call s:compatibility_check()
+augroup END
+
+let s:abstract_prototype = {}
+
+" }}}1
+" Initialization {{{1
+
+function! s:ExtractGitDir(path) abort
+  let path = s:shellslash(a:path)
+  if path =~? '^fugitive://.*//'
+    return matchstr(path,'fugitive://\zs.\{-\}\ze//')
+  endif
+  let fn = fnamemodify(path,':s?[\/]$??')
+  let ofn = ""
+  let nfn = fn
+  while fn != ofn
+    if filereadable(fn . '/.git/HEAD')
+      return s:sub(simplify(fnamemodify(fn . '/.git',':p')),'\W$','')
+    elseif fn =~ '\.git$' && filereadable(fn . '/HEAD')
+      return s:sub(simplify(fnamemodify(fn,':p')),'\W$','')
+    endif
+    let ofn = fn
+    let fn = fnamemodify(ofn,':h')
+  endwhile
+  return ''
+endfunction
+
+function! s:Detect(path)
+  if exists('b:git_dir') && b:git_dir ==# ''
+    unlet b:git_dir
+  endif
+  if !exists('b:git_dir')
+    let dir = s:ExtractGitDir(a:path)
+    if dir != ''
+      let b:git_dir = dir
+    endif
+  endif
+  if exists('b:git_dir')
+    silent doautocmd User Fugitive
+    cnoremap <expr> <buffer> <C-R><C-G> <SID>recall()
+    let buffer = fugitive#buffer()
+    if expand('%:p') =~# '//'
+      call buffer.setvar('&path',s:sub(buffer.getvar('&path'),'^\.%(,|$)',''))
+    endif
+    if stridx(buffer.getvar('&tags'),escape(b:git_dir.'/tags',', ')) == -1
+      call buffer.setvar('&tags',escape(b:git_dir.'/tags',', ').','.buffer.getvar('&tags'))
+      if &filetype != ''
+        call buffer.setvar('&tags',escape(b:git_dir.'/'.&filetype.'.tags',', ').','.buffer.getvar('&tags'))
+      endif
+    endif
+  endif
+endfunction
+
+augroup fugitive
+  autocmd!
+  autocmd BufNewFile,BufReadPost * call s:Detect(expand('<amatch>:p'))
+  autocmd FileType           netrw call s:Detect(expand('<afile>:p'))
+  autocmd VimEnter * if expand('<amatch>')==''|call s:Detect(getcwd())|endif
+  autocmd BufWinLeave * execute getwinvar(+winnr(), 'fugitive_leave')
+augroup END
+
+" }}}1
+" Repository {{{1
+
+let s:repo_prototype = {}
+let s:repos = {}
+
+function! s:repo(...) abort
+  let dir = a:0 ? a:1 : (exists('b:git_dir') && b:git_dir !=# '' ? b:git_dir : s:ExtractGitDir(expand('%:p')))
+  if dir !=# ''
+    if has_key(s:repos,dir)
+      let repo = get(s:repos,dir)
+    else
+      let repo = {'git_dir': dir}
+      let s:repos[dir] = repo
+    endif
+    return extend(extend(repo,s:repo_prototype,'keep'),s:abstract_prototype,'keep')
+  endif
+  call s:throw('not a git repository: '.expand('%:p'))
+endfunction
+
+function! s:repo_dir(...) dict abort
+  return join([self.git_dir]+a:000,'/')
+endfunction
+
+function! s:repo_tree(...) dict abort
+  if !self.bare()
+    let dir = fnamemodify(self.git_dir,':h')
+    return join([dir]+a:000,'/')
+  endif
+  call s:throw('no work tree')
+endfunction
+
+function! s:repo_bare() dict abort
+  return self.dir() !~# '/\.git$'
+endfunction
+
+function! s:repo_translate(spec) dict abort
+  if a:spec ==# '.' || a:spec ==# '/.'
+    return self.bare() ? self.dir() : self.tree()
+  elseif a:spec =~# '^/'
+    return fnamemodify(self.dir(),':h').a:spec
+  elseif a:spec =~# '^:[0-3]:'
+    return 'fugitive://'.self.dir().'//'.a:spec[1].'/'.a:spec[3:-1]
+  elseif a:spec ==# ':'
+    if $GIT_INDEX_FILE =~# '/[^/]*index[^/]*\.lock$' && fnamemodify($GIT_INDEX_FILE,':p')[0:strlen(s:repo().dir())] ==# s:repo().dir('') && filereadable($GIT_INDEX_FILE)
+      return fnamemodify($GIT_INDEX_FILE,':p')
+    else
+      return self.dir('index')
+    endif
+  elseif a:spec =~# '^:/'
+    let ref = self.rev_parse(matchstr(a:spec,'.[^:]*'))
+    return 'fugitive://'.self.dir().'//'.ref
+  elseif a:spec =~# '^:'
+    return 'fugitive://'.self.dir().'//0/'.a:spec[1:-1]
+  elseif a:spec =~# 'HEAD\|^refs/' && a:spec !~ ':' && filereadable(self.dir(a:spec))
+    return self.dir(a:spec)
+  elseif filereadable(s:repo().dir('refs/'.a:spec))
+    return self.dir('refs/'.a:spec)
+  elseif filereadable(s:repo().dir('refs/tags/'.a:spec))
+    return self.dir('refs/tags/'.a:spec)
+  elseif filereadable(s:repo().dir('refs/heads/'.a:spec))
+    return self.dir('refs/heads/'.a:spec)
+  elseif filereadable(s:repo().dir('refs/remotes/'.a:spec))
+    return self.dir('refs/remotes/'.a:spec)
+  elseif filereadable(s:repo().dir('refs/remotes/'.a:spec.'/HEAD'))
+    return self.dir('refs/remotes/'.a:spec,'/HEAD')
+  else
+    try
+      let ref = self.rev_parse(matchstr(a:spec,'[^:]*'))
+      let path = s:sub(matchstr(a:spec,':.*'),'^:','/')
+      return 'fugitive://'.self.dir().'//'.ref.path
+    catch /^fugitive:/
+      return self.tree(a:spec)
+    endtry
+  endif
+endfunction
+
+call s:add_methods('repo',['dir','tree','bare','translate'])
+
+function! s:repo_git_command(...) dict abort
+  let git = g:fugitive_git_executable . ' --git-dir='.s:shellesc(self.git_dir)
+  return git.join(map(copy(a:000),'" ".s:shellesc(v:val)'),'')
+endfunction
+
+function! s:repo_git_chomp(...) dict abort
+  return s:sub(system(call(self.git_command,a:000,self)),'\n$','')
+endfunction
+
+function! s:repo_git_chomp_in_tree(...) dict abort
+  let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+  let dir = getcwd()
+  try
+    execute cd.'`=s:repo().tree()`'
+    return call(s:repo().git_chomp, a:000, s:repo())
+  finally
+    execute cd.'`=dir`'
+  endtry
+endfunction
+
+function! s:repo_rev_parse(rev) dict abort
+  let hash = self.git_chomp('rev-parse','--verify',a:rev)
+  if hash =~ '\<\x\{40\}$'
+    return matchstr(hash,'\<\x\{40\}$')
+  endif
+  call s:throw('rev-parse '.a:rev.': '.hash)
+endfunction
+
+call s:add_methods('repo',['git_command','git_chomp','git_chomp_in_tree','rev_parse'])
+
+function! s:repo_dirglob(base) dict abort
+  let base = s:sub(a:base,'^/','')
+  let matches = split(glob(self.tree(s:gsub(base,'/','*&').'*/')),"\n")
+  call map(matches,'v:val[ strlen(self.tree())+(a:base !~ "^/") : -1 ]')
+  return matches
+endfunction
+
+function! s:repo_superglob(base) dict abort
+  if a:base =~# '^/' || a:base !~# ':'
+    let results = []
+    if a:base !~# '^/'
+      let heads = ["HEAD","ORIG_HEAD","FETCH_HEAD","MERGE_HEAD"]
+      let heads += sort(split(s:repo().git_chomp("rev-parse","--symbolic","--branches","--tags","--remotes"),"\n"))
+      call filter(heads,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base')
+      let results += heads
+    endif
+    if !self.bare()
+      let base = s:sub(a:base,'^/','')
+      let matches = split(glob(self.tree(s:gsub(base,'/','*&').'*')),"\n")
+      call map(matches,'s:shellslash(v:val)')
+      call map(matches,'v:val !~ "/$" && isdirectory(v:val) ? v:val."/" : v:val')
+      call map(matches,'v:val[ strlen(self.tree())+(a:base !~ "^/") : -1 ]')
+      let results += matches
+    endif
+    return results
+
+  elseif a:base =~# '^:'
+    let entries = split(self.git_chomp('ls-files','--stage'),"\n")
+    call map(entries,'s:sub(v:val,".*(\\d)\\t(.*)",":\\1:\\2")')
+    if a:base !~# '^:[0-3]\%(:\|$\)'
+      call filter(entries,'v:val[1] == "0"')
+      call map(entries,'v:val[2:-1]')
+    endif
+    call filter(entries,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base')
+    return entries
+
+  else
+    let tree = matchstr(a:base,'.*[:/]')
+    let entries = split(self.git_chomp('ls-tree',tree),"\n")
+    call map(entries,'s:sub(v:val,"^04.*\\zs$","/")')
+    call map(entries,'tree.s:sub(v:val,".*\t","")')
+    return filter(entries,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base')
+  endif
+endfunction
+
+call s:add_methods('repo',['dirglob','superglob'])
+
+function! s:repo_config(conf) dict abort
+  return matchstr(system(s:repo().git_command('config').' '.a:conf),"[^\r\n]*")
+endfun
+
+function! s:repo_user() dict abort
+  let username = s:repo().config('user.name')
+  let useremail = s:repo().config('user.email')
+  return username.' <'.useremail.'>'
+endfun
+
+function! s:repo_aliases() dict abort
+  if !has_key(self,'_aliases')
+    let self._aliases = {}
+    for line in split(self.git_chomp('config','--get-regexp','^alias[.]'),"\n")
+      let self._aliases[matchstr(line,'\.\zs\S\+')] = matchstr(line,' \zs.*')
+    endfor
+  endif
+  return self._aliases
+endfunction
+
+call s:add_methods('repo',['config', 'user', 'aliases'])
+
+function! s:repo_keywordprg() dict abort
+  let args = ' --git-dir='.escape(self.dir(),"\\\"' ").' show'
+  if has('gui_running') && !has('win32')
+    return g:fugitive_git_executable . ' --no-pager' . args
+  else
+    return g:fugitive_git_executable . args
+  endif
+endfunction
+
+call s:add_methods('repo',['keywordprg'])
+
+" }}}1
+" Buffer {{{1
+
+let s:buffer_prototype = {}
+
+function! s:buffer(...) abort
+  let buffer = {'#': bufnr(a:0 ? a:1 : '%')}
+  call extend(extend(buffer,s:buffer_prototype,'keep'),s:abstract_prototype,'keep')
+  if buffer.getvar('git_dir') !=# ''
+    return buffer
+  endif
+  call s:throw('not a git repository: '.expand('%:p'))
+endfunction
+
+function! fugitive#buffer(...) abort
+  return s:buffer(a:0 ? a:1 : '%')
+endfunction
+
+function! s:buffer_getvar(var) dict abort
+  return getbufvar(self['#'],a:var)
+endfunction
+
+function! s:buffer_setvar(var,value) dict abort
+  return setbufvar(self['#'],a:var,a:value)
+endfunction
+
+function! s:buffer_getline(lnum) dict abort
+  return getbufline(self['#'],a:lnum)[0]
+endfunction
+
+function! s:buffer_repo() dict abort
+  return s:repo(self.getvar('git_dir'))
+endfunction
+
+function! s:buffer_type(...) dict abort
+  if self.getvar('fugitive_type') != ''
+    let type = self.getvar('fugitive_type')
+  elseif fnamemodify(self.spec(),':p') =~# '.\git/refs/\|\.git/\w*HEAD$'
+    let type = 'head'
+  elseif self.getline(1) =~ '^tree \x\{40\}$' && self.getline(2) == ''
+    let type = 'tree'
+  elseif self.getline(1) =~ '^\d\{6\} \w\{4\} \x\{40\}\>\t'
+    let type = 'tree'
+  elseif self.getline(1) =~ '^\d\{6\} \x\{40\}\> \d\t'
+    let type = 'index'
+  elseif isdirectory(self.spec())
+    let type = 'directory'
+  elseif self.spec() == ''
+    let type = 'null'
+  else
+    let type = 'file'
+  endif
+  if a:0
+    return !empty(filter(copy(a:000),'v:val ==# type'))
+  else
+    return type
+  endif
+endfunction
+
+if has('win32')
+
+  function! s:buffer_spec() dict abort
+    let bufname = bufname(self['#'])
+    let retval = ''
+    for i in split(bufname,'[^:]\zs\\')
+      let retval = fnamemodify((retval==''?'':retval.'\').i,':.')
+    endfor
+    return s:shellslash(fnamemodify(retval,':p'))
+  endfunction
+
+else
+
+  function! s:buffer_spec() dict abort
+    let bufname = bufname(self['#'])
+    return s:shellslash(bufname == '' ? '' : fnamemodify(bufname,':p'))
+  endfunction
+
+endif
+
+function! s:buffer_name() dict abort
+  return self.spec()
+endfunction
+
+function! s:buffer_commit() dict abort
+  return matchstr(self.spec(),'^fugitive://.\{-\}//\zs\w*')
+endfunction
+
+function! s:buffer_path(...) dict abort
+  let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*')
+  if rev != ''
+    let rev = s:sub(rev,'\w*','')
+  else
+    let rev = self.spec()[strlen(self.repo().tree()) : -1]
+  endif
+  return s:sub(s:sub(rev,'.\zs/$',''),'^/',a:0 ? a:1 : '')
+endfunction
+
+function! s:buffer_rev() dict abort
+  let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*')
+  if rev =~ '^\x/'
+    return ':'.rev[0].':'.rev[2:-1]
+  elseif rev =~ '.'
+    return s:sub(rev,'/',':')
+  elseif self.spec() =~ '\.git/index$'
+    return ':'
+  elseif self.spec() =~ '\.git/refs/\|\.git/.*HEAD$'
+    return self.spec()[strlen(self.repo().dir())+1 : -1]
+  else
+    return self.path()
+  endif
+endfunction
+
+function! s:buffer_sha1() dict abort
+  if self.spec() =~ '^fugitive://' || self.spec() =~ '\.git/refs/\|\.git/.*HEAD$'
+    return self.repo().rev_parse(self.rev())
+  else
+    return ''
+  endif
+endfunction
+
+function! s:buffer_expand(rev) dict abort
+  if a:rev =~# '^:[0-3]$'
+    let file = a:rev.self.path(':')
+  elseif a:rev =~# '^[-:]/$'
+    let file = '/'.self.path()
+  elseif a:rev =~# '^-'
+    let file = 'HEAD^{}'.a:rev[1:-1].self.path(':')
+  elseif a:rev =~# '^@{'
+    let file = 'HEAD'.a:rev.self.path(':')
+  elseif a:rev =~# '^[~^]'
+    let commit = s:sub(self.commit(),'^\d=$','HEAD')
+    let file = commit.a:rev.self.path(':')
+  else
+    let file = a:rev
+  endif
+  return s:sub(s:sub(file,'\%$',self.path()),'\.\@<=/$','')
+endfunction
+
+function! s:buffer_containing_commit() dict abort
+  if self.commit() =~# '^\d$'
+    return ':'
+  elseif self.commit() =~# '.'
+    return self.commit()
+  else
+    return 'HEAD'
+  endif
+endfunction
+
+call s:add_methods('buffer',['getvar','setvar','getline','repo','type','spec','name','commit','path','rev','sha1','expand','containing_commit'])
+
+" }}}1
+" Git {{{1
+
+call s:command("-bang -nargs=? -complete=customlist,s:GitComplete Git :execute s:Git(<bang>0,<q-args>)")
+
+function! s:ExecuteInTree(cmd) abort
+  let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+  let dir = getcwd()
+  try
+    execute cd.'`=s:repo().tree()`'
+    execute a:cmd
+  finally
+    execute cd.'`=dir`'
+  endtry
+endfunction
+
+function! s:Git(bang,cmd) abort
+  if a:bang
+    return s:Edit('edit',1,a:cmd)
+  endif
+  let git = s:repo().git_command()
+  if has('gui_running') && !has('win32')
+    let git .= ' --no-pager'
+  endif
+  let cmd = matchstr(a:cmd,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=')
+  call s:ExecuteInTree('!'.git.' '.cmd)
+  call fugitive#reload_status()
+  return matchstr(a:cmd,'\v\C\\@<!%(\\\\)*\|\zs.*')
+endfunction
+
+function! s:GitComplete(A,L,P) abort
+  if !exists('s:exec_path')
+    let s:exec_path = s:sub(system(g:fugitive_git_executable.' --exec-path'),'\n$','')
+  endif
+  let cmds = map(split(glob(s:exec_path.'/git-*'),"\n"),'s:sub(v:val[strlen(s:exec_path)+5 : -1],"\\.exe$","")')
+  if a:L =~ ' [[:alnum:]-]\+ '
+    return s:repo().superglob(a:A)
+  elseif a:A == ''
+    return sort(cmds+keys(s:repo().aliases()))
+  else
+    return filter(sort(cmds+keys(s:repo().aliases())),'v:val[0:strlen(a:A)-1] ==# a:A')
+  endif
+endfunction
+
+" }}}1
+" Gcd, Glcd {{{1
+
+function! s:DirComplete(A,L,P) abort
+  let matches = s:repo().dirglob(a:A)
+  return matches
+endfunction
+
+call s:command("-bar -bang -nargs=? -complete=customlist,s:DirComplete Gcd  :cd<bang>  `=s:repo().bare() ? s:repo().dir(<q-args>) : s:repo().tree(<q-args>)`")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:DirComplete Glcd :lcd<bang> `=s:repo().bare() ? s:repo().dir(<q-args>) : s:repo().tree(<q-args>)`")
+
+" }}}1
+" Gstatus {{{1
+
+call s:command("-bar Gstatus :execute s:Status()")
+
+function! s:Status() abort
+  try
+    Gpedit :
+    wincmd P
+    nnoremap <buffer> <silent> q    :<C-U>bdelete<CR>
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+  return ''
+endfunction
+
+function! fugitive#reload_status() abort
+  let mytab = tabpagenr()
+  for tab in [mytab] + range(1,tabpagenr('$'))
+    for winnr in range(1,tabpagewinnr(tab,'$'))
+      if getbufvar(tabpagebuflist(tab)[winnr-1],'fugitive_type') ==# 'index'
+        execute 'tabnext '.tab
+        if winnr != winnr()
+          execute winnr.'wincmd w'
+          let restorewinnr = 1
+        endif
+        try
+          if !&modified
+            call s:BufReadIndex()
+          endif
+        finally
+          if exists('restorewinnr')
+            wincmd p
+          endif
+          execute 'tabnext '.mytab
+        endtry
+      endif
+    endfor
+  endfor
+endfunction
+
+function! s:StageReloadSeek(target,lnum1,lnum2)
+  let jump = a:target
+  let f = matchstr(getline(a:lnum1-1),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.*')
+  if f !=# '' | let jump = f | endif
+  let f = matchstr(getline(a:lnum2+1),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.*')
+  if f !=# '' | let jump = f | endif
+  silent! edit!
+  1
+  redraw
+  call search('^#\t\%([[:alpha:] ]\+: *\)\=\V'.jump.'\%( (new commits)\)\=\$','W')
+endfunction
+
+function! s:StageDiff(diff) abort
+  let section = getline(search('^# .*:$','bcnW'))
+  let line = getline('.')
+  let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (new commits)\)\=$')
+  if filename ==# '' && section ==# '# Changes to be committed:'
+    return 'Git diff --cached'
+  elseif filename ==# ''
+    return 'Git diff'
+  elseif line =~# '^#\trenamed:' && filename =~# ' -> '
+    let [old, new] = split(filename,' -> ')
+    execute 'Gedit '.s:fnameescape(':0:'.new)
+    return a:diff.' HEAD:'.s:fnameescape(old)
+  elseif section ==# '# Changes to be committed:'
+    execute 'Gedit '.s:fnameescape(':0:'.filename)
+    return a:diff.' -'
+  else
+    execute 'Gedit '.s:fnameescape('/'.filename)
+    return a:diff
+  endif
+endfunction
+
+function! s:StageDiffEdit() abort
+  let section = getline(search('^# .*:$','bcnW'))
+  let line = getline('.')
+  let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (new commits)\)\=$')
+  let arg = (filename ==# '' ? '.' : filename)
+  if section ==# '# Changes to be committed:'
+    return 'Git! diff --cached '.s:shellesc(arg)
+  elseif section ==# '# Untracked files:'
+    let repo = s:repo()
+    call repo.git_chomp_in_tree('add','--intent-to-add',arg)
+    if arg ==# '.'
+      silent! edit!
+      1
+      if !search('^# Change\%(d but not updated\|s not staged for commit\):$','W')
+        call search('^# Change','W')
+      endif
+    else
+      call s:StageReloadSeek(arg,line('.'),line('.'))
+    endif
+    return ''
+  else
+    return 'Git! diff '.s:shellesc(arg)
+  endif
+endfunction
+
+function! s:StageToggle(lnum1,lnum2) abort
+  try
+    let output = ''
+    for lnum in range(a:lnum1,a:lnum2)
+      let line = getline(lnum)
+      let repo = s:repo()
+      if line ==# '# Changes to be committed:'
+        call repo.git_chomp_in_tree('reset','-q')
+        silent! edit!
+        1
+        if !search('^# Untracked files:$','W')
+          call search('^# Change','W')
+        endif
+        return ''
+      elseif line =~# '^# Change\%(d but not updated\|s not staged for commit\):$'
+        call repo.git_chomp_in_tree('add','-u')
+        silent! edit!
+        1
+        if !search('^# Untracked files:$','W')
+          call search('^# Change','W')
+        endif
+        return ''
+      elseif line ==# '# Untracked files:'
+        call repo.git_chomp_in_tree('add','.')
+        silent! edit!
+        1
+        call search('^# Change','W')
+        return ''
+      endif
+      let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (\a\+ [[:alpha:], ]\+)\)\=$')
+      if filename ==# ''
+        continue
+      endif
+      if !exists('first_filename')
+        let first_filename = filename
+      endif
+      execute lnum
+      let section = getline(search('^# .*:$','bnW'))
+      if line =~# '^#\trenamed:' && filename =~ ' -> '
+        let cmd = ['mv','--'] + reverse(split(filename,' -> '))
+        let filename = cmd[-1]
+      elseif section =~? ' to be '
+        let cmd = ['reset','-q','--',filename]
+      elseif line =~# '^#\tdeleted:'
+        let cmd = ['rm','--',filename]
+      else
+        let cmd = ['add','--',filename]
+      endif
+      let output .= call(repo.git_chomp_in_tree,cmd,s:repo())."\n"
+    endfor
+    if exists('first_filename')
+      call s:StageReloadSeek(first_filename,a:lnum1,a:lnum2)
+    endif
+    echo s:sub(s:gsub(output,'\n+','\n'),'\n$','')
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+  return 'checktime'
+endfunction
+
+function! s:StagePatch(lnum1,lnum2) abort
+  let add = []
+  let reset = []
+
+  for lnum in range(a:lnum1,a:lnum2)
+    let line = getline(lnum)
+    if line ==# '# Changes to be committed:'
+      return 'Git reset --patch'
+    elseif line =~# '^# Change\%(d but not updated\|s not staged for commit\):$'
+      return 'Git add --patch'
+    endif
+    let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (new commits)\)\=$')
+    if filename ==# ''
+      continue
+    endif
+    if !exists('first_filename')
+      let first_filename = filename
+    endif
+    execute lnum
+    let section = getline(search('^# .*:$','bnW'))
+    if line =~# '^#\trenamed:' && filename =~ ' -> '
+      let reset += [split(filename,' -> ')[1]]
+    elseif section =~? ' to be '
+      let reset += [filename]
+    elseif line !~# '^#\tdeleted:'
+      let add += [filename]
+    endif
+  endfor
+  try
+    if !empty(add)
+      execute "Git add --patch -- ".join(map(add,'s:shellesc(v:val)'))
+    endif
+    if !empty(reset)
+      execute "Git reset --patch -- ".join(map(add,'s:shellesc(v:val)'))
+    endif
+    if exists('first_filename')
+      silent! edit!
+      1
+      redraw
+      call search('^#\t\%([[:alpha:] ]\+: *\)\=\V'.first_filename.'\%( (new commits)\)\=\$','W')
+    endif
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+  return 'checktime'
+endfunction
+
+" }}}1
+" Gcommit {{{1
+
+call s:command("-nargs=? -complete=customlist,s:CommitComplete Gcommit :execute s:Commit(<q-args>)")
+
+function! s:Commit(args) abort
+  let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+  let dir = getcwd()
+  let msgfile = s:repo().dir('COMMIT_EDITMSG')
+  let outfile = tempname()
+  let errorfile = tempname()
+  try
+    execute cd.'`=s:repo().tree()`'
+    if &shell =~# 'cmd'
+      let command = ''
+      let old_editor = $GIT_EDITOR
+      let $GIT_EDITOR = 'false'
+    else
+      let command = 'env GIT_EDITOR=false '
+    endif
+    let command .= s:repo().git_command('commit').' '.a:args
+    if &shell =~# 'csh'
+      silent execute '!('.command.' > '.outfile.') >& '.errorfile
+    elseif a:args =~# '\%(^\| \)--interactive\>'
+      execute '!'.command.' 2> '.errorfile
+    else
+      silent execute '!'.command.' > '.outfile.' 2> '.errorfile
+    endif
+    if !has('gui_running')
+      redraw!
+    endif
+    if !v:shell_error
+      if filereadable(outfile)
+        for line in readfile(outfile)
+          echo line
+        endfor
+      endif
+      return ''
+    else
+      let errors = readfile(errorfile)
+      let error = get(errors,-2,get(errors,-1,'!'))
+      if error =~# '\<false''\=\.$'
+        let args = a:args
+        let args = s:gsub(args,'%(%(^| )-- )@<!%(^| )@<=%(-[se]|--edit|--interactive)%($| )','')
+        let args = s:gsub(args,'%(%(^| )-- )@<!%(^| )@<=%(-F|--file|-m|--message)%(\s+|\=)%(''[^'']*''|"%(\\.|[^"])*"|\\.|\S)*','')
+        let args = s:gsub(args,'%(^| )@<=[%#]%(:\w)*','\=expand(submatch(0))')
+        let args = '-F '.s:shellesc(msgfile).' '.args
+        if args !~# '\%(^\| \)--cleanup\>'
+          let args = '--cleanup=strip '.args
+        endif
+        if bufname('%') == '' && line('$') == 1 && getline(1) == '' && !&mod
+          keepalt edit `=msgfile`
+        elseif s:buffer().type() ==# 'index'
+          keepalt edit `=msgfile`
+          execute (search('^#','n')+1).'wincmd+'
+          setlocal nopreviewwindow
+        else
+          keepalt split `=msgfile`
+        endif
+        let b:fugitive_commit_arguments = args
+        setlocal bufhidden=delete filetype=gitcommit
+        return '1'
+      elseif error ==# '!'
+        return s:Status()
+      else
+        call s:throw(error)
+      endif
+    endif
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  finally
+    if exists('old_editor')
+      let $GIT_EDITOR = old_editor
+    endif
+    call delete(outfile)
+    call delete(errorfile)
+    execute cd.'`=dir`'
+    call fugitive#reload_status()
+  endtry
+endfunction
+
+function! s:CommitComplete(A,L,P) abort
+  if a:A =~ '^-' || type(a:A) == type(0) " a:A is 0 on :Gcommit -<Tab>
+    let args = ['-C', '-F', '-a', '-c', '-e', '-i', '-m', '-n', '-o', '-q', '-s', '-t', '-u', '-v', '--all', '--allow-empty', '--amend', '--author=', '--cleanup=', '--dry-run', '--edit', '--file=', '--include', '--interactive', '--message=', '--no-verify', '--only', '--quiet', '--reedit-message=', '--reuse-message=', '--signoff', '--template=', '--untracked-files', '--verbose']
+    return filter(args,'v:val[0 : strlen(a:A)-1] ==# a:A')
+  else
+    return s:repo().superglob(a:A)
+  endif
+endfunction
+
+function! s:FinishCommit()
+  let args = getbufvar(+expand('<abuf>'),'fugitive_commit_arguments')
+  if !empty(args)
+    call setbufvar(+expand('<abuf>'),'fugitive_commit_arguments','')
+    return s:Commit(args)
+  endif
+  return ''
+endfunction
+
+augroup fugitive_commit
+  autocmd!
+  autocmd VimLeavePre,BufDelete *.git/COMMIT_EDITMSG execute s:sub(s:FinishCommit(), '^echoerr (.*)', 'echohl ErrorMsg|echo \1|echohl NONE')
+augroup END
+
+" }}}1
+" Ggrep, Glog {{{1
+
+if !exists('g:fugitive_summary_format')
+  let g:fugitive_summary_format = '%s'
+endif
+
+call s:command("-bang -nargs=? -complete=customlist,s:EditComplete Ggrep :execute s:Grep(<bang>0,<q-args>)")
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Glog :execute s:Log('grep<bang>',<f-args>)")
+
+function! s:Grep(bang,arg) abort
+  let grepprg = &grepprg
+  let grepformat = &grepformat
+  let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+  let dir = getcwd()
+  try
+    execute cd.'`=s:repo().tree()`'
+    let &grepprg = s:repo().git_command('--no-pager', 'grep', '-n')
+    let &grepformat = '%f:%l:%m'
+    exe 'grep! '.escape(matchstr(a:arg,'\v\C.{-}%($|[''" ]\@=\|)@='),'|')
+    let list = getqflist()
+    for entry in list
+      if bufname(entry.bufnr) =~ ':'
+        let entry.filename = s:repo().translate(bufname(entry.bufnr))
+        unlet! entry.bufnr
+      elseif a:arg =~# '\%(^\| \)--cached\>'
+        let entry.filename = s:repo().translate(':0:'.bufname(entry.bufnr))
+        unlet! entry.bufnr
+      endif
+    endfor
+    call setqflist(list,'r')
+    if !a:bang && !empty(list)
+      return 'cfirst'.matchstr(a:arg,'\v\C[''" ]\zs\|.*')
+    else
+      return matchstr(a:arg,'\v\C[''" ]\|\zs.*')
+    endif
+  finally
+    let &grepprg = grepprg
+    let &grepformat = grepformat
+    execute cd.'`=dir`'
+  endtry
+endfunction
+
+function! s:Log(cmd,...)
+  let path = s:buffer().path('/')
+  if path =~# '^/\.git\%(/\|$\)' || index(a:000,'--') != -1
+    let path = ''
+  endif
+  let cmd = ['--no-pager', 'log', '--no-color']
+  let cmd += [escape('--pretty=format:fugitive://'.s:repo().dir().'//%H'.path.'::'.g:fugitive_summary_format,'%')]
+  if empty(filter(a:000[0 : index(a:000,'--')],'v:val !~# "^-"'))
+    if s:buffer().commit() =~# '\x\{40\}'
+      let cmd += [s:buffer().commit()]
+    elseif s:buffer().path() =~# '^\.git/refs/\|^\.git/.*HEAD$'
+      let cmd += [s:buffer().path()[5:-1]]
+    endif
+  end
+  let cmd += map(copy(a:000),'s:sub(v:val,"^\\%(%(:\\w)*)","\\=fnamemodify(s:buffer().path(),submatch(1))")')
+  if path =~# '/.'
+    let cmd += ['--',path[1:-1]]
+  endif
+  let grepformat = &grepformat
+  let grepprg = &grepprg
+  let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+  let dir = getcwd()
+  try
+    execute cd.'`=s:repo().tree()`'
+    let &grepprg = call(s:repo().git_command,cmd,s:repo())
+    let &grepformat = '%f::%m'
+    exe a:cmd
+  finally
+    let &grepformat = grepformat
+    let &grepprg = grepprg
+    execute cd.'`=dir`'
+  endtry
+endfunction
+
+" }}}1
+" Gedit, Gpedit, Gsplit, Gvsplit, Gtabedit, Gread {{{1
+
+function! s:Edit(cmd,bang,...) abort
+  if a:cmd !~# 'read'
+    if &previewwindow && getbufvar('','fugitive_type') ==# 'index'
+      wincmd p
+      if &diff
+        let mywinnr = winnr()
+        for winnr in range(winnr('$'),1,-1)
+          if winnr != mywinnr && getwinvar(winnr,'&diff')
+            execute winnr.'wincmd w'
+            close
+            wincmd p
+          endif
+        endfor
+      endif
+    endif
+  endif
+
+  if a:bang
+    let args = s:gsub(a:0 ? a:1 : '', '\\@<!%(\\\\)*\zs[%#]', '\=s:buffer().expand(submatch(0))')
+    if a:cmd =~# 'read'
+      let git = s:repo().git_command()
+      let last = line('$')
+      silent call s:ExecuteInTree((a:cmd ==# 'read' ? '$read' : a:cmd).'!'.git.' --no-pager '.args)
+      if a:cmd ==# 'read'
+        silent execute '1,'.last.'delete_'
+      endif
+      call fugitive#reload_status()
+      diffupdate
+      return 'redraw|echo '.string(':!'.git.' '.args)
+    else
+      let temp = tempname()
+      let s:temp_files[temp] = s:repo().dir()
+      silent execute a:cmd.' '.temp
+      if a:cmd =~# 'pedit'
+        wincmd P
+      endif
+      let echo = s:Edit('read',1,args)
+      silent write!
+      setlocal buftype=nowrite nomodified filetype=git foldmarker=<<<<<<<,>>>>>>>
+      if getline(1) !~# '^diff '
+        setlocal readonly nomodifiable
+      endif
+      if a:cmd =~# 'pedit'
+        wincmd p
+      endif
+      return echo
+    endif
+    return ''
+  endif
+
+  if a:0 && a:1 == ''
+    return ''
+  elseif a:0
+    let file = s:buffer().expand(a:1)
+  elseif expand('%') ==# ''
+    let file = ':'
+  elseif s:buffer().commit() ==# '' && s:buffer().path('/') !~# '^/.git\>'
+    let file = s:buffer().path(':')
+  else
+    let file = s:buffer().path('/')
+  endif
+  try
+    let file = s:repo().translate(file)
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+  if a:cmd ==# 'read'
+    return 'silent %delete_|read '.s:fnameescape(file).'|silent 1delete_|diffupdate|'.line('.')
+  else
+    return a:cmd.' '.s:fnameescape(file)
+  endif
+endfunction
+
+function! s:EditComplete(A,L,P) abort
+  return s:repo().superglob(a:A)
+endfunction
+
+function! s:EditRunComplete(A,L,P) abort
+  if a:L =~# '^\w\+!'
+    return s:GitComplete(a:A,a:L,a:P)
+  else
+    return s:repo().superglob(a:A)
+  endif
+endfunction
+
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Ge       :execute s:Edit('edit<bang>',0,<f-args>)")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gedit    :execute s:Edit('edit<bang>',0,<f-args>)")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditRunComplete Gpedit   :execute s:Edit('pedit',<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditRunComplete Gsplit   :execute s:Edit('split',<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditRunComplete Gvsplit  :execute s:Edit('vsplit',<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditRunComplete Gtabedit :execute s:Edit('tabedit',<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=? -count -complete=customlist,s:EditRunComplete Gread :execute s:Edit((!<count> && <line1> ? '' : <count>).'read',<bang>0,<f-args>)")
+
+" }}}1
+" Gwrite, Gwq {{{1
+
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gwrite :execute s:Write(<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gw :execute s:Write(<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:EditComplete Gwq :execute s:Wq(<bang>0,<f-args>)")
+
+function! s:Write(force,...) abort
+  if exists('b:fugitive_commit_arguments')
+    return 'write|bdelete'
+  elseif expand('%:t') == 'COMMIT_EDITMSG' && $GIT_INDEX_FILE != ''
+    return 'wq'
+  elseif s:buffer().type() == 'index'
+    return 'Gcommit'
+  elseif s:buffer().path() ==# '' && getline(4) =~# '^+++ '
+    let filename = getline(4)[6:-1]
+    setlocal buftype=
+    silent write
+    setlocal buftype=nowrite
+    if matchstr(getline(2),'index [[:xdigit:]]\+\.\.\zs[[:xdigit:]]\{7\}') ==# s:repo().rev_parse(':0:'.filename)[0:6]
+      let err = s:repo().git_chomp('apply','--cached','--reverse',s:buffer().spec())
+    else
+      let err = s:repo().git_chomp('apply','--cached',s:buffer().spec())
+    endif
+    if err !=# ''
+      let v:errmsg = split(err,"\n")[0]
+      return 'echoerr v:errmsg'
+    elseif a:force
+      return 'bdelete'
+    else
+      return 'Gedit '.fnameescape(filename)
+    endif
+  endif
+  let mytab = tabpagenr()
+  let mybufnr = bufnr('')
+  let path = a:0 ? a:1 : s:buffer().path()
+  if path =~# '^:\d\>'
+    return 'write'.(a:force ? '! ' : ' ').s:fnameescape(s:repo().translate(s:buffer().expand(path)))
+  endif
+  let always_permitted = (s:buffer().path() ==# path && s:buffer().commit() =~# '^0\=$')
+  if !always_permitted && !a:force && s:repo().git_chomp_in_tree('diff','--name-status','HEAD','--',path) . s:repo().git_chomp_in_tree('ls-files','--others','--',path) !=# ''
+    let v:errmsg = 'fugitive: file has uncommitted changes (use ! to override)'
+    return 'echoerr v:errmsg'
+  endif
+  let file = s:repo().translate(path)
+  let treebufnr = 0
+  for nr in range(1,bufnr('$'))
+    if fnamemodify(bufname(nr),':p') ==# file
+      let treebufnr = nr
+    endif
+  endfor
+
+  if treebufnr > 0 && treebufnr != bufnr('')
+    let temp = tempname()
+    silent execute '%write '.temp
+    for tab in [mytab] + range(1,tabpagenr('$'))
+      for winnr in range(1,tabpagewinnr(tab,'$'))
+        if tabpagebuflist(tab)[winnr-1] == treebufnr
+          execute 'tabnext '.tab
+          if winnr != winnr()
+            execute winnr.'wincmd w'
+            let restorewinnr = 1
+          endif
+          try
+            let lnum = line('.')
+            let last = line('$')
+            silent execute '$read '.temp
+            silent execute '1,'.last.'delete_'
+            silent write!
+            silent execute lnum
+            let did = 1
+          finally
+            if exists('restorewinnr')
+              wincmd p
+            endif
+            execute 'tabnext '.mytab
+          endtry
+        endif
+      endfor
+    endfor
+    if !exists('did')
+      call writefile(readfile(temp,'b'),file,'b')
+    endif
+  else
+    execute 'write! '.s:fnameescape(s:repo().translate(path))
+  endif
+
+  if a:force
+    let error = s:repo().git_chomp_in_tree('add', '--force', file)
+  else
+    let error = s:repo().git_chomp_in_tree('add', file)
+  endif
+  if v:shell_error
+    let v:errmsg = 'fugitive: '.error
+    return 'echoerr v:errmsg'
+  endif
+  if s:buffer().path() ==# path && s:buffer().commit() =~# '^\d$'
+    set nomodified
+  endif
+
+  let one = s:repo().translate(':1:'.path)
+  let two = s:repo().translate(':2:'.path)
+  let three = s:repo().translate(':3:'.path)
+  for nr in range(1,bufnr('$'))
+    if bufloaded(nr) && !getbufvar(nr,'&modified') && (bufname(nr) == one || bufname(nr) == two || bufname(nr) == three)
+      execute nr.'bdelete'
+    endif
+  endfor
+
+  unlet! restorewinnr
+  let zero = s:repo().translate(':0:'.path)
+  for tab in range(1,tabpagenr('$'))
+    for winnr in range(1,tabpagewinnr(tab,'$'))
+      let bufnr = tabpagebuflist(tab)[winnr-1]
+      let bufname = bufname(bufnr)
+      if bufname ==# zero && bufnr != mybufnr
+        execute 'tabnext '.tab
+        if winnr != winnr()
+          execute winnr.'wincmd w'
+          let restorewinnr = 1
+        endif
+        try
+          let lnum = line('.')
+          let last = line('$')
+          silent $read `=file`
+          silent execute '1,'.last.'delete_'
+          silent execute lnum
+          set nomodified
+          diffupdate
+        finally
+          if exists('restorewinnr')
+            wincmd p
+          endif
+          execute 'tabnext '.mytab
+        endtry
+        break
+      endif
+    endfor
+  endfor
+  call fugitive#reload_status()
+  return 'checktime'
+endfunction
+
+function! s:Wq(force,...) abort
+  let bang = a:force ? '!' : ''
+  if exists('b:fugitive_commit_arguments')
+    return 'wq'.bang
+  endif
+  let result = call(s:function('s:Write'),[a:force]+a:000)
+  if result =~# '^\%(write\|wq\|echoerr\)'
+    return s:sub(result,'^write','wq')
+  else
+    return result.'|quit'.bang
+  endif
+endfunction
+
+" }}}1
+" Gdiff {{{1
+
+call s:command("-bang -bar -nargs=? -complete=customlist,s:EditComplete Gdiff :execute s:Diff(<bang>0,<f-args>)")
+call s:command("-bar -nargs=? -complete=customlist,s:EditComplete Gvdiff :execute s:Diff(0,<f-args>)")
+call s:command("-bar -nargs=? -complete=customlist,s:EditComplete Gsdiff :execute s:Diff(1,<f-args>)")
+
+augroup fugitive_diff
+  autocmd!
+  autocmd BufWinLeave * if s:diff_window_count() == 2 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | call s:diffoff_all(getbufvar(+expand('<abuf>'), 'git_dir')) | endif
+  autocmd BufWinEnter * if s:diff_window_count() == 1 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | call s:diffoff() | endif
+augroup END
+
+function! s:diff_window_count()
+  let c = 0
+  for nr in range(1,winnr('$'))
+    let c += getwinvar(nr,'&diff')
+  endfor
+  return c
+endfunction
+
+function! s:diffthis()
+  if !&diff
+    let w:fugitive_diff_restore = 'setlocal nodiff noscrollbind'
+    let w:fugitive_diff_restore .= ' scrollopt=' . &l:scrollopt
+    let w:fugitive_diff_restore .= &l:wrap ? ' wrap' : ' nowrap'
+    let w:fugitive_diff_restore .= ' foldmethod=' . &l:foldmethod
+    let w:fugitive_diff_restore .= ' foldcolumn=' . &l:foldcolumn
+    diffthis
+  endif
+endfunction
+
+function! s:diffoff()
+  if exists('w:fugitive_diff_restore')
+    execute w:fugitive_diff_restore
+    unlet w:fugitive_diff_restore
+  else
+    diffoff
+  endif
+endfunction
+
+function! s:diffoff_all(dir)
+  for nr in range(1,winnr('$'))
+    if getwinvar(nr,'&diff')
+      if nr != winnr()
+        execute nr.'wincmd w'
+        let restorewinnr = 1
+      endif
+      if exists('b:git_dir') && b:git_dir ==# a:dir
+        call s:diffoff()
+      endif
+      if exists('restorewinnr')
+        wincmd p
+      endif
+    endif
+  endfor
+endfunction
+
+function! s:buffer_compare_age(commit) dict abort
+  let scores = {':0': 1, ':1': 2, ':2': 3, ':': 4, ':3': 5}
+  let my_score    = get(scores,':'.self.commit(),0)
+  let their_score = get(scores,':'.a:commit,0)
+  if my_score || their_score
+    return my_score < their_score ? -1 : my_score != their_score
+  elseif self.commit() ==# a:commit
+    return 0
+  endif
+  let base = self.repo().git_chomp('merge-base',self.commit(),a:commit)
+  if base ==# self.commit()
+    return -1
+  elseif base ==# a:commit
+    return 1
+  endif
+  let my_time    = +self.repo().git_chomp('log','--max-count=1','--pretty=format:%at',self.commit())
+  let their_time = +self.repo().git_chomp('log','--max-count=1','--pretty=format:%at',a:commit)
+  return my_time < their_time ? -1 : my_time != their_time
+endfunction
+
+call s:add_methods('buffer',['compare_age'])
+
+function! s:Diff(bang,...) abort
+  let split = a:bang ? 'split' : 'vsplit'
+  if exists(':DiffGitCached')
+    return 'DiffGitCached'
+  elseif (!a:0 || a:1 == ':') && s:buffer().commit() =~# '^[0-1]\=$' && s:repo().git_chomp_in_tree('ls-files', '--unmerged', '--', s:buffer().path()) !=# ''
+    let nr = bufnr('')
+    execute 'leftabove '.split.' `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`'
+    execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
+    call s:diffthis()
+    wincmd p
+    execute 'rightbelow '.split.' `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`'
+    execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
+    call s:diffthis()
+    wincmd p
+    call s:diffthis()
+    return ''
+  elseif a:0
+    if a:1 ==# ''
+      return ''
+    elseif a:1 ==# '/'
+      let file = s:buffer().path('/')
+    elseif a:1 ==# ':'
+      let file = s:buffer().path(':0:')
+    elseif a:1 =~# '^:/.'
+      try
+        let file = s:repo().rev_parse(a:1).s:buffer().path(':')
+      catch /^fugitive:/
+        return 'echoerr v:errmsg'
+      endtry
+    else
+      let file = s:buffer().expand(a:1)
+    endif
+    if file !~# ':' && file !~# '^/' && s:repo().git_chomp('cat-file','-t',file) =~# '^\%(tag\|commit\)$'
+      let file = file.s:buffer().path(':')
+    endif
+  else
+    let file = s:buffer().path(s:buffer().commit() == '' ? ':0:' : '/')
+  endif
+  try
+    let spec = s:repo().translate(file)
+    let commit = matchstr(spec,'\C[^:/]//\zs\x\+')
+    if s:buffer().compare_age(commit) < 0
+      execute 'rightbelow '.split.' `=spec`'
+    else
+      execute 'leftabove '.split.' `=spec`'
+    endif
+    call s:diffthis()
+    wincmd p
+    call s:diffthis()
+    return ''
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+endfunction
+
+" }}}1
+" Gmove, Gremove {{{1
+
+function! s:Move(force,destination)
+  if a:destination =~# '^/'
+    let destination = a:destination[1:-1]
+  else
+    let destination = fnamemodify(s:sub(a:destination,'[%#]%(:\w)*','\=expand(submatch(0))'),':p')
+    if destination[0:strlen(s:repo().tree())] ==# s:repo().tree('')
+      let destination = destination[strlen(s:repo().tree('')):-1]
+    endif
+  endif
+  if isdirectory(s:buffer().name())
+    " Work around Vim parser idiosyncrasy
+    let discarded = s:buffer().setvar('&swapfile',0)
+  endif
+  let message = call(s:repo().git_chomp_in_tree,['mv']+(a:force ? ['-f'] : [])+['--', s:buffer().path(), destination], s:repo())
+  if v:shell_error
+    let v:errmsg = 'fugitive: '.message
+    return 'echoerr v:errmsg'
+  endif
+  let destination = s:repo().tree(destination)
+  if isdirectory(destination)
+    let destination = fnamemodify(s:sub(destination,'/$','').'/'.expand('%:t'),':.')
+  endif
+  call fugitive#reload_status()
+  if s:buffer().commit() == ''
+    if isdirectory(destination)
+      return 'edit '.s:fnameescape(destination)
+    else
+      return 'saveas! '.s:fnameescape(destination)
+    endif
+  else
+    return 'file '.s:fnameescape(s:repo().translate(':0:'.destination)
+  endif
+endfunction
+
+function! s:MoveComplete(A,L,P)
+  if a:A =~ '^/'
+    return s:repo().superglob(a:A)
+  else
+    let matches = split(glob(a:A.'*'),"\n")
+    call map(matches,'v:val !~ "/$" && isdirectory(v:val) ? v:val."/" : v:val')
+    return matches
+  endif
+endfunction
+
+function! s:Remove(force)
+  if s:buffer().commit() ==# ''
+    let cmd = ['rm']
+  elseif s:buffer().commit() ==# '0'
+    let cmd = ['rm','--cached']
+  else
+    let v:errmsg = 'fugitive: rm not supported here'
+    return 'echoerr v:errmsg'
+  endif
+  if a:force
+    let cmd += ['--force']
+  endif
+  let message = call(s:repo().git_chomp_in_tree,cmd+['--',s:buffer().path()],s:repo())
+  if v:shell_error
+    let v:errmsg = 'fugitive: '.s:sub(message,'error:.*\zs\n\(.*-f.*',' (add ! to force)')
+    return 'echoerr '.string(v:errmsg)
+  else
+    call fugitive#reload_status()
+    return 'bdelete'.(a:force ? '!' : '')
+  endif
+endfunction
+
+augroup fugitive_remove
+  autocmd!
+  autocmd User Fugitive if s:buffer().commit() =~# '^0\=$' |
+        \ exe "command! -buffer -bar -bang -nargs=1 -complete=customlist,s:MoveComplete Gmove :execute s:Move(<bang>0,<q-args>)" |
+        \ exe "command! -buffer -bar -bang Gremove :execute s:Remove(<bang>0)" |
+        \ endif
+augroup END
+
+" }}}1
+" Gblame {{{1
+
+augroup fugitive_blame
+  autocmd!
+  autocmd BufReadPost *.fugitiveblame setfiletype fugitiveblame
+  autocmd FileType fugitiveblame setlocal nomodeline | if exists('b:git_dir') | let &l:keywordprg = s:repo().keywordprg() | endif
+  autocmd Syntax fugitiveblame call s:BlameSyntax()
+  autocmd User Fugitive if s:buffer().type('file', 'blob') | exe "command! -buffer -bar -bang -range=0 -nargs=* Gblame :execute s:Blame(<bang>0,<line1>,<line2>,<count>,[<f-args>])" | endif
+augroup END
+
+function! s:Blame(bang,line1,line2,count,args) abort
+  try
+    if s:buffer().path() == ''
+      call s:throw('file or blob required')
+    endif
+    if filter(copy(a:args),'v:val !~# "^\\%(--root\|--show-name\\|-\\=\\%([ltwfs]\\|[MC]\\d*\\)\\+\\)$"') != []
+      call s:throw('unsupported option')
+    endif
+    call map(a:args,'s:sub(v:val,"^\\ze[^-]","-")')
+    let cmd = ['--no-pager', 'blame', '--show-number'] + a:args
+    if s:buffer().commit() =~# '\D\|..'
+      let cmd += [s:buffer().commit()]
+    else
+      let cmd += ['--contents', '-']
+    endif
+    let basecmd = escape(call(s:repo().git_command,cmd+['--',s:buffer().path()],s:repo()),'!')
+    try
+      let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+      if !s:repo().bare()
+        let dir = getcwd()
+        execute cd.'`=s:repo().tree()`'
+      endif
+      if a:count
+        execute 'write !'.substitute(basecmd,' blame ',' blame -L '.a:line1.','.a:line2.' ','g')
+      else
+        let error = tempname()
+        let temp = error.'.fugitiveblame'
+        if &shell =~# 'csh'
+          silent! execute '%write !('.basecmd.' > '.temp.') >& '.error
+        else
+          silent! execute '%write !'.basecmd.' > '.temp.' 2> '.error
+        endif
+        if exists('l:dir')
+          execute cd.'`=dir`'
+          unlet dir
+        endif
+        if v:shell_error
+          call s:throw(join(readfile(error),"\n"))
+        endif
+        let bufnr = bufnr('')
+        let restore = 'call setwinvar(bufwinnr('.bufnr.'),"&scrollbind",0)'
+        if &l:wrap
+          let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&wrap",1)'
+        endif
+        if &l:foldenable
+          let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&foldenable",1)'
+        endif
+        let winnr = winnr()
+        windo set noscrollbind
+        exe winnr.'wincmd w'
+        setlocal scrollbind nowrap nofoldenable
+        let top = line('w0') + &scrolloff
+        let current = line('.')
+        let s:temp_files[temp] = s:repo().dir()
+        exe 'leftabove vsplit '.temp
+        let b:fugitive_blamed_bufnr = bufnr
+        let w:fugitive_leave = restore
+        let b:fugitive_blame_arguments = join(a:args,' ')
+        execute top
+        normal! zt
+        execute current
+        execute "vertical resize ".(match(getline('.'),'\s\+\d\+)')+1)
+        setlocal nomodified nomodifiable nonumber scrollbind nowrap foldcolumn=0 nofoldenable filetype=fugitiveblame
+        if exists('+relativenumber')
+          setlocal norelativenumber
+        endif
+        nnoremap <buffer> <silent> <CR> :<C-U>exe <SID>BlameJump('')<CR>
+        nnoremap <buffer> <silent> P    :<C-U>exe <SID>BlameJump('^'.v:count1)<CR>
+        nnoremap <buffer> <silent> ~    :<C-U>exe <SID>BlameJump('~'.v:count1)<CR>
+        nnoremap <buffer> <silent> o    :<C-U>exe <SID>Edit((&splitbelow ? "botright" : "topleft")." split", 0, matchstr(getline('.'),'\x\+'))<CR>
+        nnoremap <buffer> <silent> O    :<C-U>exe <SID>Edit("tabedit", 0, matchstr(getline('.'),'\x\+'))<CR>
+        syncbind
+      endif
+    finally
+      if exists('l:dir')
+        execute cd.'`=dir`'
+      endif
+    endtry
+    return ''
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+endfunction
+
+function! s:BlameJump(suffix) abort
+  let commit = matchstr(getline('.'),'^\^\=\zs\x\+')
+  if commit =~# '^0\+$'
+    let commit = ':0'
+  endif
+  let lnum = matchstr(getline('.'),'\d\+\ze\s\+[([:digit:]]')
+  let path = matchstr(getline('.'),'^\^\=\zs\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
+  if path ==# ''
+    let path = s:buffer(b:fugitive_blamed_bufnr).path()
+  endif
+  let args = b:fugitive_blame_arguments
+  let offset = line('.') - line('w0')
+  let bufnr = bufnr('%')
+  let winnr = bufwinnr(b:fugitive_blamed_bufnr)
+  if winnr > 0
+    exe winnr.'wincmd w'
+  endif
+  execute s:Edit('edit', 0, commit.a:suffix.':'.path)
+  if winnr > 0
+    exe bufnr.'bdelete'
+  endif
+  execute 'Gblame '.args
+  execute lnum
+  let delta = line('.') - line('w0') - offset
+  if delta > 0
+    execute 'norm! 'delta."\<C-E>"
+  elseif delta < 0
+    execute 'norm! '(-delta)."\<C-Y>"
+  endif
+  syncbind
+  return ''
+endfunction
+
+function! s:BlameSyntax() abort
+  let b:current_syntax = 'fugitiveblame'
+  syn match FugitiveblameBoundary "^\^"
+  syn match FugitiveblameBlank                      "^\s\+\s\@=" nextgroup=FugitiveblameAnnotation,fugitiveblameOriginalFile,FugitiveblameOriginalLineNumber skipwhite
+  syn match FugitiveblameHash       "\%(^\^\=\)\@<=\x\{7,40\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite
+  syn match FugitiveblameUncommitted "\%(^\^\=\)\@<=0\{7,40\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite
+  syn region FugitiveblameAnnotation matchgroup=FugitiveblameDelimiter start="(" end="\%( \d\+\)\@<=)" contained keepend oneline
+  syn match FugitiveblameTime "[0-9:/+-][0-9:/+ -]*[0-9:/+-]\%( \+\d\+)\)\@=" contained containedin=FugitiveblameAnnotation
+  syn match FugitiveblameLineNumber         " \@<=\d\+)\@=" contained containedin=FugitiveblameAnnotation
+  syn match FugitiveblameOriginalFile       " \%(\f\+\D\@<=\|\D\@=\f\+\)\%(\%(\s\+\d\+\)\=\s\%((\|\s*\d\+)\)\)\@=" contained nextgroup=FugitiveblameOriginalLineNumber,FugitiveblameAnnotation skipwhite
+  syn match FugitiveblameOriginalLineNumber " \@<=\d\+\%(\s(\)\@=" contained nextgroup=FugitiveblameAnnotation skipwhite
+  syn match FugitiveblameOriginalLineNumber " \@<=\d\+\%(\s\+\d\+)\)\@=" contained nextgroup=FugitiveblameShort skipwhite
+  syn match FugitiveblameShort              "\d\+)" contained contains=FugitiveblameLineNumber
+  syn match FugitiveblameNotCommittedYet "(\@<=Not Committed Yet\>" contained containedin=FugitiveblameAnnotation
+  hi def link FugitiveblameBoundary           Keyword
+  hi def link FugitiveblameHash               Identifier
+  hi def link FugitiveblameUncommitted        Function
+  hi def link FugitiveblameTime               PreProc
+  hi def link FugitiveblameLineNumber         Number
+  hi def link FugitiveblameOriginalFile       String
+  hi def link FugitiveblameOriginalLineNumber Float
+  hi def link FugitiveblameShort              FugitiveblameDelimiter
+  hi def link FugitiveblameDelimiter          Delimiter
+  hi def link FugitiveblameNotCommittedYet    Comment
+endfunction
+
+" }}}1
+" Gbrowse {{{1
+
+call s:command("-bar -bang -count=0 -nargs=? -complete=customlist,s:EditComplete Gbrowse :execute s:Browse(<bang>0,<line1>,<count>,<f-args>)")
+
+function! s:Browse(bang,line1,count,...) abort
+  try
+    let rev = a:0 ? substitute(a:1,'@[[:alnum:]_-]*\%(://.\{-\}\)\=$','','') : ''
+    if rev ==# ''
+      let expanded = s:buffer().rev()
+    elseif rev ==# ':'
+      let expanded = s:buffer().path('/')
+    else
+      let expanded = s:buffer().expand(rev)
+    endif
+    let full = s:repo().translate(expanded)
+    let commit = ''
+    if full =~# '^fugitive://'
+      let commit = matchstr(full,'://.*//\zs\w\+')
+      let path = matchstr(full,'://.*//\w\+\zs/.*')
+      if commit =~ '..'
+        let type = s:repo().git_chomp('cat-file','-t',commit.s:sub(path,'^/',':'))
+      else
+        let type = 'blob'
+      endif
+      let path = path[1:-1]
+    elseif s:repo().bare()
+      let path = '.git/' . full[strlen(s:repo().dir())+1:-1]
+      let type = ''
+    else
+      let path = full[strlen(s:repo().tree())+1:-1]
+      if path =~# '^\.git/'
+        let type = ''
+      elseif isdirectory(full)
+        let type = 'tree'
+      else
+        let type = 'blob'
+      endif
+    endif
+    if path =~# '^\.git/.*HEAD' && filereadable(s:repo().dir(path[5:-1]))
+      let body = readfile(s:repo().dir(path[5:-1]))[0]
+      if body =~# '^\x\{40\}$'
+        let commit = body
+        let type = 'commit'
+        let path = ''
+      elseif body =~# '^ref: refs/'
+        let path = '.git/' . matchstr(body,'ref: \zs.*')
+      endif
+    endif
+
+    if a:0 && a:1 =~# '@[[:alnum:]_-]*\%(://.\{-\}\)\=$'
+      let remote = matchstr(a:1,'@\zs[[:alnum:]_-]\+\%(://.\{-\}\)\=$')
+    elseif path =~# '^\.git/refs/remotes/.'
+      let remote = matchstr(path,'^\.git/refs/remotes/\zs[^/]\+')
+    else
+      let remote = 'origin'
+      let branch = matchstr(rev,'^[[:alnum:]/._-]\+\ze[:^~@]')
+      if branch ==# '' && path =~# '^\.git/refs/\w\+/'
+        let branch = s:sub(path,'^\.git/refs/\w+/','')
+      endif
+      if filereadable(s:repo().dir('refs/remotes/'.branch))
+        let remote = matchstr(branch,'[^/]\+')
+        let rev = rev[strlen(remote)+1:-1]
+      else
+        if branch ==# ''
+          let branch = matchstr(s:repo().head_ref(),'\<refs/heads/\zs.*')
+        endif
+        if branch != ''
+          let remote = s:repo().git_chomp('config','branch.'.branch.'.remote')
+          if remote =~# '^\.\=$'
+            let remote = 'origin'
+          elseif rev[0:strlen(branch)-1] ==# branch && rev[strlen(branch)] =~# '[:^~@]'
+            let rev = s:repo().git_chomp('config','branch.'.branch.'.merge')[11:-1] . rev[strlen(branch):-1]
+          endif
+        endif
+      endif
+    endif
+
+    let raw = s:repo().git_chomp('config','remote.'.remote.'.url')
+    if raw ==# ''
+      let raw = remote
+    endif
+
+    let url = s:github_url(s:repo(),raw,rev,commit,path,type,a:line1,a:count)
+    if url == ''
+      let url = s:instaweb_url(s:repo(),rev,commit,path,type,a:count ? a:line1 : 0)
+    endif
+
+    if url == ''
+      call s:throw("Instaweb failed to start and '".remote."' is not a GitHub remote")
+    endif
+
+    if a:bang
+      let @* = url
+      return 'echomsg '.string(url)
+    else
+      return 'echomsg '.string(url).'|call fugitive#buffer().repo().git_chomp("web--browse",'.string(url).')'
+    endif
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+endfunction
+
+function! s:github_url(repo,url,rev,commit,path,type,line1,line2) abort
+  let path = a:path
+  let repo_path = matchstr(a:url,'^\%(https\=://\|git://\|git@\)github\.com[/:]\zs.\{-\}\ze\%(\.git\)\=$')
+  if repo_path ==# ''
+    return ''
+  endif
+  let root = 'https://github.com/' . repo_path
+  if path =~# '^\.git/refs/heads/'
+    let branch = a:repo.git_chomp('config','branch.'.path[16:-1].'.merge')[11:-1]
+    if branch ==# ''
+      return root . '/commits/' . path[16:-1]
+    else
+      return root . '/commits/' . branch
+    endif
+  elseif path =~# '^\.git/refs/.'
+    return root . '/commits/' . matchstr(path,'[^/]\+$')
+  elseif path =~# '.git/\%(config$\|hooks\>\)'
+    return root . '/admin'
+  elseif path =~# '^\.git\>'
+    return root
+  endif
+  if a:rev =~# '^[[:alnum:]._-]\+:'
+    let commit = matchstr(a:rev,'^[^:]*')
+  elseif a:commit =~# '^\d\=$'
+    let local = matchstr(a:repo.head_ref(),'\<refs/heads/\zs.*')
+    let commit = a:repo.git_chomp('config','branch.'.local.'.merge')[11:-1]
+    if commit ==# ''
+      let commit = local
+    endif
+  else
+    let commit = a:commit
+  endif
+  if a:type == 'tree'
+    let url = s:sub(root . '/tree/' . commit . '/' . path,'/$','')
+  elseif a:type == 'blob'
+    let url = root . '/blob/' . commit . '/' . path
+    if a:line2 && a:line1 == a:line2
+      let url .= '#L' . a:line1
+    elseif a:line2
+      let url .= '#L' . a:line1 . '-' . a:line2
+    endif
+  elseif a:type == 'tag'
+    let commit = matchstr(getline(3),'^tag \zs.*')
+    let url = root . '/tree/' . commit
+  else
+    let url = root . '/commit/' . commit
+  endif
+  return url
+endfunction
+
+function! s:instaweb_url(repo,rev,commit,path,type,...) abort
+  let output = a:repo.git_chomp('instaweb','-b','unknown')
+  if output =~# 'http://'
+    let root = matchstr(output,'http://.*').'/?p='.fnamemodify(a:repo.dir(),':t')
+  else
+    return ''
+  endif
+  if a:path =~# '^\.git/refs/.'
+    return root . ';a=shortlog;h=' . matchstr(a:path,'^\.git/\zs.*')
+  elseif a:path =~# '^\.git\>'
+    return root
+  endif
+  let url = root
+  if a:commit =~# '^\x\{40\}$'
+    if a:type ==# 'commit'
+      let url .= ';a=commit'
+    endif
+    let url .= ';h=' . a:repo.rev_parse(a:commit . (a:path == '' ? '' : ':' . a:path))
+  else
+    if a:type ==# 'blob'
+      let tmp = tempname()
+      silent execute 'write !'.a:repo.git_command('hash-object','-w','--stdin').' > '.tmp
+      let url .= ';h=' . readfile(tmp)[0]
+    else
+      try
+        let url .= ';h=' . a:repo.rev_parse((a:commit == '' ? 'HEAD' : ':' . a:commit) . ':' . a:path)
+      catch /^fugitive:/
+        call s:throw('fugitive: cannot browse uncommitted file')
+      endtry
+    endif
+    let root .= ';hb=' . matchstr(a:repo.head_ref(),'[^ ]\+$')
+  endif
+  if a:path !=# ''
+    let url .= ';f=' . a:path
+  endif
+  if a:0 && a:1
+    let url .= '#l' . a:1
+  endif
+  return url
+endfunction
+
+" }}}1
+" File access {{{1
+
+function! s:ReplaceCmd(cmd,...) abort
+  let fn = bufname('')
+  let tmp = tempname()
+  let prefix = ''
+  try
+    if a:0 && a:1 != ''
+      if &shell =~# 'cmd'
+        let old_index = $GIT_INDEX_FILE
+        let $GIT_INDEX_FILE = a:1
+      else
+        let prefix = 'env GIT_INDEX_FILE='.s:shellesc(a:1).' '
+      endif
+    endif
+    if &shell =~# 'cmd'
+      call system('cmd /c "'.prefix.a:cmd.' > '.tmp.'"')
+    else
+      call system(' ('.prefix.a:cmd.' > '.tmp.') ')
+    endif
+  finally
+    if exists('old_index')
+      let $GIT_INDEX_FILE = old_index
+    endif
+  endtry
+  silent exe 'keepalt file '.tmp
+  silent edit!
+  silent exe 'keepalt file '.s:fnameescape(fn)
+  call delete(tmp)
+  if bufname('$') == tmp
+    silent execute 'bwipeout '.bufnr('$')
+  endif
+  silent exe 'doau BufReadPost '.s:fnameescape(fn)
+endfunction
+
+function! s:BufReadIndex()
+  if !exists('b:fugitive_display_format')
+    let b:fugitive_display_format = filereadable(expand('%').'.lock')
+  endif
+  let b:fugitive_display_format = b:fugitive_display_format % 2
+  let b:fugitive_type = 'index'
+  try
+    let b:git_dir = s:repo().dir()
+    setlocal noro ma
+    if fnamemodify($GIT_INDEX_FILE !=# '' ? $GIT_INDEX_FILE : b:git_dir . '/index', ':p') ==# expand('%:p')
+      let index = ''
+    else
+      let index = expand('%:p')
+    endif
+    if b:fugitive_display_format
+      call s:ReplaceCmd(s:repo().git_command('ls-files','--stage'),index)
+      set ft=git nospell
+    else
+      let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+      let dir = getcwd()
+      try
+        execute cd.'`=s:repo().tree()`'
+        call s:ReplaceCmd(s:repo().git_command('status'),index)
+      finally
+        execute cd.'`=dir`'
+      endtry
+      set ft=gitcommit
+    endif
+    setlocal ro noma nomod nomodeline bufhidden=wipe
+    call s:JumpInit()
+    nunmap   <buffer>          P
+    nunmap   <buffer>          ~
+    nnoremap <buffer> <silent> <C-N> :call search('^#\t.*','W')<Bar>.<CR>
+    nnoremap <buffer> <silent> <C-P> :call search('^#\t.*','Wbe')<Bar>.<CR>
+    nnoremap <buffer> <silent> - :<C-U>execute <SID>StageToggle(line('.'),line('.')+v:count1-1)<CR>
+    xnoremap <buffer> <silent> - :<C-U>execute <SID>StageToggle(line("'<"),line("'>"))<CR>
+    nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += 1<Bar>exe <SID>BufReadIndex()<CR>
+    nnoremap <buffer> <silent> i :<C-U>let b:fugitive_display_format -= 1<Bar>exe <SID>BufReadIndex()<CR>
+    nnoremap <buffer> <silent> C :<C-U>Gcommit<CR>
+    nnoremap <buffer> <silent> cA :<C-U>Gcommit --amend --reuse-message=HEAD<CR>
+    nnoremap <buffer> <silent> ca :<C-U>Gcommit --amend<CR>
+    nnoremap <buffer> <silent> cc :<C-U>Gcommit<CR>
+    nnoremap <buffer> <silent> D :<C-U>execute <SID>StageDiff('Gvdiff')<CR>
+    nnoremap <buffer> <silent> dd :<C-U>execute <SID>StageDiff('Gvdiff')<CR>
+    nnoremap <buffer> <silent> dh :<C-U>execute <SID>StageDiff('Gsdiff')<CR>
+    nnoremap <buffer> <silent> ds :<C-U>execute <SID>StageDiff('Gsdiff')<CR>
+    nnoremap <buffer> <silent> dp :<C-U>execute <SID>StageDiffEdit()<CR>
+    nnoremap <buffer> <silent> dv :<C-U>execute <SID>StageDiff('Gvdiff')<CR>
+    nnoremap <buffer> <silent> p :<C-U>execute <SID>StagePatch(line('.'),line('.')+v:count1-1)<CR>
+    xnoremap <buffer> <silent> p :<C-U>execute <SID>StagePatch(line("'<"),line("'>"))<CR>
+    nnoremap <buffer> <silent> q :<C-U>if bufnr('$') == 1<Bar>quit<Bar>else<Bar>bdelete<Bar>endif<CR>
+    nnoremap <buffer> <silent> R :<C-U>edit<CR>
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+endfunction
+
+function! s:FileRead()
+  try
+    let repo = s:repo(s:ExtractGitDir(expand('<amatch>')))
+    let path = s:sub(s:sub(matchstr(expand('<amatch>'),'fugitive://.\{-\}//\zs.*'),'/',':'),'^\d:',':&')
+    let hash = repo.rev_parse(path)
+    if path =~ '^:'
+      let type = 'blob'
+    else
+      let type = repo.git_chomp('cat-file','-t',hash)
+    endif
+    " TODO: use count, if possible
+    return "read !".escape(repo.git_command('cat-file',type,hash),'%#\')
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+endfunction
+
+function! s:BufReadIndexFile()
+  try
+    let b:fugitive_type = 'blob'
+    let b:git_dir = s:repo().dir()
+    call s:ReplaceCmd(s:repo().git_command('cat-file','blob',s:buffer().sha1()))
+    if &bufhidden ==# ''
+      setlocal bufhidden=delete
+    endif
+    return ''
+  catch /^fugitive: rev-parse/
+    silent exe 'doau BufNewFile '.s:fnameescape(bufname(''))
+    return ''
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+endfunction
+
+function! s:BufWriteIndexFile()
+  let tmp = tempname()
+  try
+    let path = matchstr(expand('<amatch>'),'//\d/\zs.*')
+    let stage = matchstr(expand('<amatch>'),'//\zs\d')
+    silent execute 'write !'.s:repo().git_command('hash-object','-w','--stdin').' > '.tmp
+    let sha1 = readfile(tmp)[0]
+    let old_mode = matchstr(s:repo().git_chomp('ls-files','--stage',path),'^\d\+')
+    if old_mode == ''
+      let old_mode = executable(s:repo().tree(path)) ? '100755' : '100644'
+    endif
+    let info = old_mode.' '.sha1.' '.stage."\t".path
+    call writefile([info],tmp)
+    if has('win32')
+      let error = system('type '.tmp.'|'.s:repo().git_command('update-index','--index-info'))
+    else
+      let error = system(s:repo().git_command('update-index','--index-info').' < '.tmp)
+    endif
+    if v:shell_error == 0
+      setlocal nomodified
+      silent execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p'))
+      call fugitive#reload_status()
+      return ''
+    else
+      return 'echoerr '.string('fugitive: '.error)
+    endif
+  finally
+    call delete(tmp)
+  endtry
+endfunction
+
+function! s:BufReadObject()
+  try
+    setlocal noro ma
+    let b:git_dir = s:repo().dir()
+    let hash = s:buffer().sha1()
+    if !exists("b:fugitive_type")
+      let b:fugitive_type = s:repo().git_chomp('cat-file','-t',hash)
+    endif
+    if b:fugitive_type !~# '^\%(tag\|commit\|tree\|blob\)$'
+      return "echoerr 'fugitive: unrecognized git type'"
+    endif
+    let firstline = getline('.')
+    if !exists('b:fugitive_display_format') && b:fugitive_type != 'blob'
+      let b:fugitive_display_format = +getbufvar('#','fugitive_display_format')
+    endif
+
+    let pos = getpos('.')
+    silent %delete
+    setlocal endofline
+
+    if b:fugitive_type == 'tree'
+      let b:fugitive_display_format = b:fugitive_display_format % 2
+      if b:fugitive_display_format
+        call s:ReplaceCmd(s:repo().git_command('ls-tree',hash))
+      else
+        call s:ReplaceCmd(s:repo().git_command('show','--no-color',hash))
+      endif
+    elseif b:fugitive_type == 'tag'
+      let b:fugitive_display_format = b:fugitive_display_format % 2
+      if b:fugitive_display_format
+        call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash))
+      else
+        call s:ReplaceCmd(s:repo().git_command('cat-file','-p',hash))
+      endif
+    elseif b:fugitive_type == 'commit'
+      let b:fugitive_display_format = b:fugitive_display_format % 2
+      if b:fugitive_display_format
+        call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash))
+      else
+        call s:ReplaceCmd(s:repo().git_command('show','--no-color','--pretty=format:tree %T%nparent %P%nauthor %an <%ae> %ad%ncommitter %cn <%ce> %cd%nencoding %e%n%n%s%n%n%b',hash))
+        call search('^parent ')
+        if getline('.') ==# 'parent '
+          silent delete_
+        else
+          silent s/\%(^parent\)\@<! /\rparent /ge
+        endif
+        if search('^encoding \%(<unknown>\)\=$','W',line('.')+3)
+          silent delete_
+        end
+        1
+      endif
+    elseif b:fugitive_type ==# 'blob'
+      call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash))
+    endif
+    call setpos('.',pos)
+    setlocal ro noma nomod nomodeline
+    if &bufhidden ==# ''
+      setlocal bufhidden=delete
+    endif
+    if b:fugitive_type !=# 'blob'
+      set filetype=git
+      nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += v:count1<Bar>exe <SID>BufReadObject()<CR>
+      nnoremap <buffer> <silent> i :<C-U>let b:fugitive_display_format -= v:count1<Bar>exe <SID>BufReadObject()<CR>
+    else
+      call s:JumpInit()
+    endif
+
+    return ''
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+endfunction
+
+augroup fugitive_files
+  autocmd!
+  autocmd BufReadCmd  *.git/index                      exe s:BufReadIndex()
+  autocmd BufReadCmd  *.git/*index*.lock               exe s:BufReadIndex()
+  autocmd FileReadCmd fugitive://**//[0-3]/**          exe s:FileRead()
+  autocmd BufReadCmd  fugitive://**//[0-3]/**          exe s:BufReadIndexFile()
+  autocmd BufWriteCmd fugitive://**//[0-3]/**          exe s:BufWriteIndexFile()
+  autocmd BufReadCmd  fugitive://**//[0-9a-f][0-9a-f]* exe s:BufReadObject()
+  autocmd FileReadCmd fugitive://**//[0-9a-f][0-9a-f]* exe s:FileRead()
+  autocmd FileType git       call s:JumpInit()
+augroup END
+
+" }}}1
+" Temp files {{{1
+
+let s:temp_files = {}
+
+augroup fugitive_temp
+  autocmd!
+  autocmd BufNewFile,BufReadPost *
+        \ if has_key(s:temp_files,expand('<amatch>:p')) |
+        \   let b:git_dir = s:temp_files[expand('<amatch>:p')] |
+        \   let b:git_type = 'temp' |
+        \   call s:Detect(expand('<amatch>:p')) |
+        \   setlocal bufhidden=delete |
+        \   nnoremap <buffer> <silent> q    :<C-U>bdelete<CR> |
+        \ endif
+augroup END
+
+" }}}1
+" Go to file {{{1
+
+function! s:JumpInit() abort
+  nnoremap <buffer> <silent> <CR>    :<C-U>exe <SID>GF("edit")<CR>
+  if !&modifiable
+    nnoremap <buffer> <silent> o     :<C-U>exe <SID>GF("split")<CR>
+    nnoremap <buffer> <silent> O     :<C-U>exe <SID>GF("tabedit")<CR>
+    nnoremap <buffer> <silent> P     :<C-U>exe <SID>Edit('edit',0,<SID>buffer().commit().'^'.v:count1.<SID>buffer().path(':'))<CR>
+    nnoremap <buffer> <silent> ~     :<C-U>exe <SID>Edit('edit',0,<SID>buffer().commit().'~'.v:count1.<SID>buffer().path(':'))<CR>
+    nnoremap <buffer> <silent> C     :<C-U>exe <SID>Edit('edit',0,<SID>buffer().containing_commit())<CR>
+    nnoremap <buffer> <silent> cc    :<C-U>exe <SID>Edit('edit',0,<SID>buffer().containing_commit())<CR>
+    nnoremap <buffer> <silent> co    :<C-U>exe <SID>Edit('split',0,<SID>buffer().containing_commit())<CR>
+    nnoremap <buffer> <silent> cO    :<C-U>exe <SID>Edit('tabedit',0,<SID>buffer().containing_commit())<CR>
+    nnoremap <buffer> <silent> cp    :<C-U>exe <SID>Edit('pedit',0,<SID>buffer().containing_commit())<CR>
+  endif
+endfunction
+
+function! s:GF(mode) abort
+  try
+    let buffer = s:buffer()
+    let myhash = buffer.sha1()
+    if myhash ==# '' && getline(1) =~# '^\%(commit\|tag\) \w'
+      let myhash = matchstr(getline(1),'^\w\+ \zs\S\+')
+    endif
+
+    if buffer.type('tree')
+      let showtree = (getline(1) =~# '^tree ' && getline(2) == "")
+      if showtree && line('.') == 1
+        return ""
+      elseif showtree && line('.') > 2
+        return s:Edit(a:mode,0,buffer.commit().':'.s:buffer().path().(buffer.path() =~# '^$\|/$' ? '' : '/').s:sub(getline('.'),'/$',''))
+      elseif getline('.') =~# '^\d\{6\} \l\{3,8\} \x\{40\}\t'
+        return s:Edit(a:mode,0,buffer.commit().':'.s:buffer().path().(buffer.path() =~# '^$\|/$' ? '' : '/').s:sub(matchstr(getline('.'),'\t\zs.*'),'/$',''))
+      endif
+
+    elseif buffer.type('blob')
+      let ref = expand("<cfile>")
+      try
+        let sha1 = buffer.repo().rev_parse(ref)
+      catch /^fugitive:/
+      endtry
+      if exists('sha1')
+        return s:Edit(a:mode,0,ref)
+      endif
+
+    else
+
+      " Index
+      if getline('.') =~# '^\d\{6\} \x\{40\} \d\t'
+        let ref = matchstr(getline('.'),'\x\{40\}')
+        let file = ':'.s:sub(matchstr(getline('.'),'\d\t.*'),'\t',':')
+        return s:Edit(a:mode,0,file)
+
+      elseif getline('.') =~# '^#\trenamed:.* -> '
+        let file = '/'.matchstr(getline('.'),' -> \zs.*')
+        return s:Edit(a:mode,0,file)
+      elseif getline('.') =~# '^#\t[[:alpha:] ]\+: *.'
+        let file = '/'.matchstr(getline('.'),': *\zs.\{-\}\ze\%( (new commits)\)\=$')
+        return s:Edit(a:mode,0,file)
+      elseif getline('.') =~# '^#\t.'
+        let file = '/'.matchstr(getline('.'),'#\t\zs.*')
+        return s:Edit(a:mode,0,file)
+      elseif getline('.') =~# ': needs merge$'
+        let file = '/'.matchstr(getline('.'),'.*\ze: needs merge$')
+        return s:Edit(a:mode,0,file).'|Gdiff'
+
+      elseif getline('.') ==# '# Not currently on any branch.'
+        return s:Edit(a:mode,0,'HEAD')
+      elseif getline('.') =~# '^# On branch '
+        let file = 'refs/heads/'.getline('.')[12:]
+        return s:Edit(a:mode,0,file)
+      elseif getline('.') =~# "^# Your branch .*'"
+        let file = matchstr(getline('.'),"'\\zs\\S\\+\\ze'")
+        return s:Edit(a:mode,0,file)
+      endif
+
+      let showtree = (getline(1) =~# '^tree ' && getline(2) == "")
+
+      if getline('.') =~# '^ref: '
+        let ref = strpart(getline('.'),5)
+
+      elseif getline('.') =~# '^commit \x\{40\}\>'
+        let ref = matchstr(getline('.'),'\x\{40\}')
+        return s:Edit(a:mode,0,ref)
+
+      elseif getline('.') =~# '^parent \x\{40\}\>'
+        let ref = matchstr(getline('.'),'\x\{40\}')
+        let line = line('.')
+        let parent = 0
+        while getline(line) =~# '^parent '
+          let parent += 1
+          let line -= 1
+        endwhile
+        return s:Edit(a:mode,0,ref)
+
+      elseif getline('.') =~ '^tree \x\{40\}$'
+        let ref = matchstr(getline('.'),'\x\{40\}')
+        if s:repo().rev_parse(myhash.':') == ref
+          let ref = myhash.':'
+        endif
+        return s:Edit(a:mode,0,ref)
+
+      elseif getline('.') =~# '^object \x\{40\}$' && getline(line('.')+1) =~ '^type \%(commit\|tree\|blob\)$'
+        let ref = matchstr(getline('.'),'\x\{40\}')
+        let type = matchstr(getline(line('.')+1),'type \zs.*')
+
+      elseif getline('.') =~# '^\l\{3,8\} '.myhash.'$'
+        return ''
+
+      elseif getline('.') =~# '^\l\{3,8\} \x\{40\}\>'
+        let ref = matchstr(getline('.'),'\x\{40\}')
+        echoerr "warning: unknown context ".matchstr(getline('.'),'^\l*')
+
+      elseif getline('.') =~# '^[+-]\{3\} [ab/]'
+        let ref = getline('.')[4:]
+
+      elseif getline('.') =~# '^rename from '
+        let ref = 'a/'.getline('.')[12:]
+      elseif getline('.') =~# '^rename to '
+        let ref = 'b/'.getline('.')[10:]
+
+      elseif getline('.') =~# '^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)'
+        let dref = matchstr(getline('.'),'\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)')
+        let ref = matchstr(getline('.'),'\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)')
+        let dcmd = 'Gdiff'
+
+      elseif getline('.') =~# '^index ' && getline(line('.')-1) =~# '^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)'
+        let line = getline(line('.')-1)
+        let dref = matchstr(line,'\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)')
+        let ref = matchstr(line,'\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)')
+        let dcmd = 'Gdiff!'
+
+      elseif line('$') == 1 && getline('.') =~ '^\x\{40\}$'
+        let ref = getline('.')
+      else
+        let ref = ''
+      endif
+
+      if myhash ==# ''
+        let ref = s:sub(ref,'^a/','HEAD:')
+        let ref = s:sub(ref,'^b/',':0:')
+        if exists('dref')
+          let dref = s:sub(dref,'^a/','HEAD:')
+        endif
+      else
+        let ref = s:sub(ref,'^a/',myhash.'^:')
+        let ref = s:sub(ref,'^b/',myhash.':')
+        if exists('dref')
+          let dref = s:sub(dref,'^a/',myhash.'^:')
+        endif
+      endif
+
+      if ref ==# '/dev/null'
+        " Empty blob
+        let ref = 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
+      endif
+
+      if exists('dref')
+        return s:Edit(a:mode,0,ref) . '|'.dcmd.' '.s:fnameescape(dref)
+      elseif ref != ""
+        return s:Edit(a:mode,0,ref)
+      endif
+
+    endif
+    return ''
+  catch /^fugitive:/
+    return 'echoerr v:errmsg'
+  endtry
+endfunction
+
+" }}}1
+" Statusline {{{1
+
+function! s:repo_head_ref() dict abort
+  return readfile(s:repo().dir('HEAD'))[0]
+endfunction
+
+call s:add_methods('repo',['head_ref'])
+
+function! fugitive#statusline(...)
+  if !exists('b:git_dir')
+    return ''
+  endif
+  let status = ''
+  if s:buffer().commit() != ''
+    let status .= ':' . s:buffer().commit()[0:7]
+  endif
+  let head = s:repo().head_ref()
+  if head =~# '^ref: '
+    let status .= s:sub(head,'^ref: %(refs/%(heads/|remotes/|tags/)=)=','(').')'
+  elseif head =~# '^\x\{40\}$'
+    let status .= '('.head[0:7].')'
+  endif
+  if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]'
+    return ',GIT'.status
+  else
+    return '[Git'.status.']'
+  endif
+endfunction
+
+" }}}1
+
+" vim:set ft=vim ts=8 sw=2 sts=2:
diff --git a/vim/plugin/gist.vim b/vim/plugin/gist.vim
new file mode 100644 (file)
index 0000000..9081d00
--- /dev/null
@@ -0,0 +1,826 @@
+"=============================================================================
+" File: gist.vim
+" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
+" Last Change: 20-Aug-2011.
+" Version: 5.0
+" WebPage: http://github.com/mattn/gist-vim
+" License: BSD
+" Usage:
+"
+"   :Gist
+"     post current buffer to gist, using default privicy option
+"     (see g:gist_private)
+"
+"   :'<,'>Gist
+"     post selected text to gist., using default privicy option
+"     This applies to all permutations listed below (except multi)
+"     (see g:gist_private)
+"
+"   :Gist -p
+"     create a private gist
+"
+"   :Gist -P
+"     create a public gist
+"     (only relevant if you've set gists to be private by default)
+"
+"   :Gist -P
+"     post whole text to gist as public
+"     This is only relevant if you've set gists to be private by default
+"   :Gist -a
+"     create a gist anonymously
+"
+"   :Gist -m
+"     create a gist with all open buffers
+"
+"   :Gist -e
+"     edit the gist. (you need to have opend the gist buffer first)
+"     you can update the gist with :w command on gist buffer
+"
+"   :Gist -d
+"     delete the gist. (you need to have opend the gist buffer first)
+"     password authentication is needed
+"
+"   :Gist -f
+"     fork the gist. (you need to have opend the gist buffer first)
+"     password authentication is needed
+"
+"   :Gist -e foo.js
+"     edit the gist with name 'foo.js'. (you need to have opend the gist buffer first)
+"
+"   :Gist XXXXX
+"     get gist XXXXX
+"
+"   :Gist -c XXXXX
+"     get gist XXXXX and add to clipboard
+"
+"   :Gist -l
+"     list your public gists
+"
+"   :Gist -l mattn
+"     list gists from mattn
+"
+"   :Gist -la
+"     list all your (public and private) gists
+"
+" Tips:
+"   * if set g:gist_clip_command, gist.vim will copy the gist code
+"       with option '-c'.
+"
+"     # mac
+"     let g:gist_clip_command = 'pbcopy'
+"
+"     # linux
+"     let g:gist_clip_command = 'xclip -selection clipboard'
+"
+"     # others(cygwin?)
+"     let g:gist_clip_command = 'putclip'
+"
+"   * if you want to detect filetype from gist's filename...
+"
+"     # detect filetype if vim failed auto-detection.
+"     let g:gist_detect_filetype = 1
+"
+"     # detect filetype always.
+"     let g:gist_detect_filetype = 2
+"
+"   * if you want to open browser after the post...
+"
+"     let g:gist_open_browser_after_post = 1
+"
+"   * if you want to change the browser...
+"
+"     let g:gist_browser_command = 'w3m %URL%'
+"
+"       or
+"
+"     let g:gist_browser_command = 'opera %URL% &'
+"
+"     on windows, should work with original setting.
+"
+"   * if you want to show your private gists with ':Gist -l'
+"
+"     let g:gist_show_privates = 1
+"
+"   * if don't you want to copy URL of the post...
+"
+"     let g:gist_put_url_to_clipboard_after_post = 0
+"
+"     or if you want to copy URL and add linefeed at the last of URL,
+"
+"     let g:gist_put_url_to_clipboard_after_post = 2
+"
+"     default value is 1.
+"
+" Thanks:
+"   MATSUU Takuto:
+"     removed carriage return
+"     gist_browser_command enhancement
+"     edit support
+"
+" GetLatestVimScripts: 2423 1 :AutoInstall: gist.vim
+" script type: plugin
+
+if &cp || (exists('g:loaded_gist_vim') && g:loaded_gist_vim)
+  finish
+endif
+let g:loaded_gist_vim = 1
+
+if (!exists('g:github_user') || !exists('g:github_token')) && !executable('git')
+  echohl ErrorMsg | echomsg "Gist: require 'git' command" | echohl None
+  finish
+endif
+
+if !executable('curl')
+  echohl ErrorMsg | echomsg "Gist: require 'curl' command" | echohl None
+  finish
+endif
+
+if !exists('g:gist_open_browser_after_post')
+  let g:gist_open_browser_after_post = 0
+endif
+
+if !exists('g:gist_put_url_to_clipboard_after_post')
+  let g:gist_put_url_to_clipboard_after_post = 1
+endif
+
+if !exists('g:gist_curl_options')
+  let g:gist_curl_options = ""
+endif
+
+if !exists('g:gist_browser_command')
+  if has('win32') || has('win64')
+    let g:gist_browser_command = "!start rundll32 url.dll,FileProtocolHandler %URL%"
+  elseif has('mac')
+    let g:gist_browser_command = "open %URL%"
+  elseif executable('xdg-open')
+    let g:gist_browser_command = "xdg-open %URL%"
+  else
+    let g:gist_browser_command = "firefox %URL% &"
+  endif
+endif
+
+if !exists('g:gist_detect_filetype')
+  let g:gist_detect_filetype = 0
+endif
+
+if !exists('g:gist_private')
+  let g:gist_private = 0
+endif
+
+if !exists('g:gist_show_privates')
+  let g:gist_show_privates = 0
+endif
+
+if !exists('g:gist_cookie_dir')
+  let g:gist_cookie_dir = substitute(expand('<sfile>:p:h'), '[/\\]plugin$', '', '').'/cookies'
+endif
+
+function! s:nr2hex(nr)
+  let n = a:nr
+  let r = ""
+  while n
+    let r = '0123456789ABCDEF'[n % 16] . r
+    let n = n / 16
+  endwhile
+  return r
+endfunction
+
+function! s:encodeURIComponent(instr)
+  let instr = iconv(a:instr, &enc, "utf-8")
+  let len = strlen(instr)
+  let i = 0
+  let outstr = ''
+  while i < len
+    let ch = instr[i]
+    if ch =~# '[0-9A-Za-z-._~!''()*]'
+      let outstr = outstr . ch
+    elseif ch == ' '
+      let outstr = outstr . '+'
+    else
+      let outstr = outstr . '%' . substitute('0' . s:nr2hex(char2nr(ch)), '^.*\(..\)$', '\1', '')
+    endif
+    let i = i + 1
+  endwhile
+  return outstr
+endfunction
+
+" Note: A colon in the file name has side effects on Windows due to NTFS Alternate Data Streams; avoid it. 
+let s:bufprefix = 'gist' . (has('unix') ? ':' : '_')
+function! s:GistList(user, token, gistls, page)
+  if a:gistls == '-all'
+    let url = 'https://gist.github.com/gists'
+  elseif g:gist_show_privates && a:gistls == a:user
+    let url = 'https://gist.github.com/mine'
+  else
+    let url = 'https://gist.github.com/'.a:gistls
+  endif
+  let winnum = bufwinnr(bufnr(s:bufprefix.a:gistls))
+  if winnum != -1
+    if winnum != bufwinnr('%')
+      exe winnum 'wincmd w'
+    endif
+    setlocal modifiable
+  else
+    exec 'silent split' s:bufprefix.a:gistls
+  endif
+  if a:page > 1
+    let oldlines = getline(0, line('$'))
+    let url = url . '?page=' . a:page
+  endif
+
+  setlocal foldmethod=manual
+  let oldlines = []
+  if g:gist_show_privates
+    echon 'Login to gist... '
+    silent %d _
+    let res = s:GistGetPage(url, a:user, '', '-L')
+    silent put =res.content
+  else
+    silent %d _
+    exec 'silent r! curl -s' g:gist_curl_options url
+  endif
+
+  1delete _
+  silent! %s/>/>\r/g
+  silent! %s/</\r</g
+  silent! %g/<pre/,/<\/pre/join!
+  silent! %g/<span class="date"/,/<\/span/join
+  silent! %g/^<span class="date"/s/> */>/g
+  silent! %v/^\(gist:\|<pre>\|<span class="date">\)/d _
+  silent! %s/<div[^>]*>/\r  /g
+  silent! %s/<\/pre>/\r/g
+  silent! %g/^gist:/,/<span class="date"/join
+  silent! %s/<[^>]\+>//g
+  silent! %s/\r//g
+  silent! %s/&nbsp;/ /g
+  silent! %s/&quot;/"/g
+  silent! %s/&amp;/\&/g
+  silent! %s/&gt;/>/g
+  silent! %s/&lt;/</g
+  silent! %s/&#\(\d\d\);/\=nr2char(submatch(1))/g
+  silent! %g/^gist: /s/ //g
+
+  call append(0, oldlines)
+  $put='more...'
+
+  let b:user = a:user
+  let b:token = a:token
+  let b:gistls = a:gistls
+  let b:page = a:page
+  setlocal buftype=nofile bufhidden=hide noswapfile
+  setlocal nomodified
+  syntax match SpecialKey /^gist:/he=e-1
+  nnoremap <silent> <buffer> <cr> :call <SID>GistListAction()<cr>
+
+  cal cursor(1+len(oldlines),1)
+  setlocal foldmethod=expr
+  setlocal foldexpr=getline(v:lnum)=~'^\\(gist:\\\|more\\)'?'>1':'='
+  setlocal foldtext=getline(v:foldstart)
+endfunction
+
+function! s:GistGetFileName(gistid)
+  let url = 'https://gist.github.com/'.a:gistid
+  let res = system('curl -s '.g:gist_curl_options.' '.url)
+  let res = substitute(res, '^.*<a href="/raw/[^"]\+/\([^"]\+\)".*$', '\1', '')
+  if res =~ '/'
+    return ''
+  else
+    return res
+  endif
+endfunction
+
+function! s:GistDetectFiletype(gistid)
+  let url = 'https://gist.github.com/'.a:gistid
+  let mx = '^.*<div class=".\{-}type-\([^"]\+\)">.*$'
+  let res = system('curl -s '.g:gist_curl_options.' '.url)
+  let res = substitute(matchstr(res, mx), mx, '\1', '')
+  let res = substitute(res, '.*\(\.[^\.]\+\)$', '\1', '')
+  let res = substitute(res, '-', '', 'g')
+  " TODO: more filetype detection that is specified in html.
+  if res == 'bat' | let res = 'dosbatch' | endif
+  if res == 'as' | let res = 'actionscript' | endif
+  if res == 'bash' | let res = 'sh' | endif
+  if res == 'cl' | let res = 'lisp' | endif
+  if res == 'rb' | let res = 'ruby' | endif
+  if res == 'viml' | let res = 'vim' | endif
+  if res == 'plain' || res == 'text' | let res = '' | endif
+
+  if res =~ '^\.'
+    silent! exec "doau BufRead *".res
+  else
+    silent! exec "setlocal ft=".tolower(res)
+  endif
+endfunction
+
+function! s:GistWrite(fname)
+  if substitute(a:fname, '\\', '/', 'g') == expand("%:p:gs@\\@/@")
+    Gist -e
+  else
+    exe "w".(v:cmdbang ? "!" : "") fnameescape(v:cmdarg) fnameescape(a:fname)
+    silent! exe "file" fnameescape(a:fname)
+    silent! au! BufWriteCmd <buffer>
+  endif
+endfunction
+
+function! s:GistGet(user, token, gistid, clipboard)
+  let url = 'https://raw.github.com/gist/'.a:gistid
+  let winnum = bufwinnr(bufnr(s:bufprefix.a:gistid))
+  if winnum != -1
+    if winnum != bufwinnr('%')
+      exe winnum 'wincmd w'
+    endif
+    setlocal modifiable
+  else
+    exec 'silent split' s:bufprefix.a:gistid
+  endif
+  filetype detect
+  silent %d _
+  exec 'silent 0r! curl -s' g:gist_curl_options url
+  $delete _
+  setlocal buftype=acwrite bufhidden=delete noswapfile
+  setlocal nomodified
+  doau StdinReadPost <buffer>
+  if (&ft == '' && g:gist_detect_filetype == 1) || g:gist_detect_filetype == 2
+    call s:GistDetectFiletype(a:gistid)
+  endif
+  if a:clipboard
+    if exists('g:gist_clip_command')
+      exec 'silent w !'.g:gist_clip_command
+    else
+      %yank +
+    endif
+  endif
+  1
+  au! BufWriteCmd <buffer> call s:GistWrite(expand("<amatch>"))
+endfunction
+
+function! s:GistListAction()
+  let line = getline('.')
+  let mx = '^gist:\(\w\+\).*'
+  if line =~# mx
+    let gistid = substitute(line, mx, '\1', '')
+    call s:GistGet(g:github_user, g:github_token, gistid, 0)
+    return
+  endif
+  if line =~# '^more\.\.\.$'
+    delete
+    call s:GistList(b:user, b:token, b:gistls, b:page+1)
+    return
+  endif
+endfunction
+
+function! s:GistUpdate(user, token, content, gistid, gistnm)
+  if len(a:gistnm) == 0
+    let name = s:GistGetFileName(a:gistid)
+  else
+    let name = a:gistnm
+  endif
+  let namemx = '^[^.]\+\(.\+\)$'
+  let ext = ''
+  if name =~ namemx
+    let ext = substitute(name, namemx, '\1', '')
+  endif
+  let query = [
+    \ '_method=put',
+    \ 'file_ext[gistfile1%s]=%s',
+    \ 'file_name[gistfile1%s]=%s',
+    \ 'file_contents[gistfile1%s]=%s',
+    \ 'login=%s',
+    \ 'token=%s',
+    \ ]
+  let squery = printf(join(query, '&'),
+    \ s:encodeURIComponent(ext), s:encodeURIComponent(ext),
+    \ s:encodeURIComponent(ext), s:encodeURIComponent(name),
+    \ s:encodeURIComponent(ext), s:encodeURIComponent(a:content),
+    \ s:encodeURIComponent(a:user),
+    \ s:encodeURIComponent(a:token))
+  unlet query
+
+  let file = tempname()
+  call writefile([squery], file)
+  echon 'Updating it to gist... '
+  let quote = &shellxquote == '"' ?  "'" : '"'
+  let url = 'https://gist.github.com/gists/'.a:gistid
+  let res = system('curl -i '.g:gist_curl_options.' -d @'.quote.file.quote.' '.url)
+  call delete(file)
+  let headers = split(res, '\(\r\?\n\|\r\n\?\)')
+  let location = matchstr(headers, '^Location: ')
+  let location = substitute(location, '^[^:]\+: ', '', '')
+  if len(location) > 0 && location =~ '^\(http\|https\):\/\/gist\.github\.com\/'
+    setlocal nomodified
+    redraw
+    echo 'Done: '.location
+  else
+    let message = matchstr(headers, '^Status: ')
+    let message = substitute(message, '^[^:]\+: [0-9]\+ ', '', '')
+    echohl ErrorMsg | echomsg 'Edit failed: '.message | echohl None
+  endif
+  return location
+endfunction
+
+function! s:GistGetPage(url, user, param, opt)
+  if !isdirectory(g:gist_cookie_dir)
+    call mkdir(g:gist_cookie_dir, 'p')
+  endif
+  let cookie_file = g:gist_cookie_dir.'/github'
+
+  if len(a:url) == 0
+    call delete(cookie_file)
+    return
+  endif
+
+  let quote = &shellxquote == '"' ?  "'" : '"'
+  if !filereadable(cookie_file)
+    let password = inputsecret('Password:')
+    if len(password) == 0
+      echo 'Canceled'
+      return
+    endif
+    let url = 'https://gist.github.com/login?return_to=gist'
+    let res = system('curl -L -s '.g:gist_curl_options.' -c '.quote.cookie_file.quote.' '.quote.url.quote)
+    let token = substitute(res, '^.* name="authenticity_token" type="hidden" value="\([^"]\+\)".*$', '\1', '')
+
+    let query = [
+      \ 'authenticity_token=%s',
+      \ 'login=%s',
+      \ 'password=%s',
+      \ 'return_to=gist',
+      \ 'commit=Log+in',
+      \ ]
+    let squery = printf(join(query, '&'),
+      \ s:encodeURIComponent(token),
+      \ s:encodeURIComponent(a:user),
+      \ s:encodeURIComponent(password))
+    unlet query
+
+    let file = tempname()
+    let command = 'curl -s '.g:gist_curl_options.' -i'
+    let command .= ' -b '.quote.cookie_file.quote
+    let command .= ' -c '.quote.cookie_file.quote
+    let command .= ' '.quote.'https://gist.github.com/session'.quote
+    let command .= ' -d @' . quote.file.quote
+    call writefile([squery], file)
+    let res = system(command)
+    call delete(file)
+    let res = matchstr(split(res, '\(\r\?\n\|\r\n\?\)'), '^Location: ')
+    let res = substitute(res, '^[^:]\+: ', '', '')
+    if len(res) == 0
+      call delete(cookie_file)
+      return ''
+    endif
+  endif
+  let command = 'curl -s '.g:gist_curl_options.' -i '.a:opt
+  if len(a:param)
+    let command .= ' -d '.quote.a:param.quote
+  endif
+  let command .= ' -b '.quote.cookie_file.quote
+  let command .= ' '.quote.a:url.quote
+  let res = iconv(system(command), "utf-8", &encoding)
+  let pos = stridx(res, "\r\n\r\n")
+  if pos != -1
+    let content = res[pos+4:]
+  else
+    let pos = stridx(res, "\n\n")
+    let content = res[pos+2:]
+  endif
+  return {
+  \ "header" : split(res[0:pos], '\r\?\n'),
+  \ "content" : content
+  \}
+endfunction
+
+function! s:GistDelete(user, token, gistid)
+  echon 'Deleting gist... '
+  let res = s:GistGetPage('https://gist.github.com/'.a:gistid, a:user, '', '')
+  if (!len(res)) 
+      echohl ErrorMsg | echomsg 'Wrong password? no response received from github trying to delete ' . a:gistid | echohl None
+      return
+  endif
+  let mx = '^.* name="authenticity_token" type="hidden" value="\([^"]\+\)".*$'
+  let token = substitute(matchstr(res.content, mx), mx, '\1', '')
+  if len(token) > 0
+    let res = s:GistGetPage('https://gist.github.com/delete/'.a:gistid, a:user, '_method=delete&authenticity_token='.token, '')
+    if len(res.content) > 0
+      redraw
+      echo 'Done: '
+    else
+      let message = matchstr(res.header, '^Status: ')
+      let message = substitute(message, '^[^:]\+: [0-9]\+ ', '', '')
+      echohl ErrorMsg | echomsg 'Delete failed: '.message | echohl None
+    endif
+  else
+    echohl ErrorMsg | echomsg 'Delete failed' | echohl None
+  endif
+endfunction
+
+
+" GistPost function:
+"   Post new gist to github
+"
+"   if there is an embedded gist url or gist id in your file,
+"   it will just update it.
+"                                                   -- by c9s
+"
+"   embedded gist url format:
+"
+"       Gist: https://gist.github.com/123123
+"
+"   embedded gist id format:
+"
+"       GistID: 123123
+"
+function! s:GistPost(user, token, content, private)
+
+  " find GistID: in content, then we should just update
+  for l in split(a:content, "\n")
+    if l =~ '\<GistID:'
+      let gistid = matchstr(l, 'GistID:\s*[0-9a-z]\+')
+
+      if strlen(gistid) == 0
+        echohl WarningMsg | echo "GistID error" | echohl None
+        return
+      endif
+      echo "Found GistID: " . gistid
+
+      cal s:GistUpdate(a:user, a:token,  a:content, gistid, '')
+      return
+    elseif l =~ '\<Gist:'
+      let gistid = matchstr(l, 'Gist:\s*https://gist.github.com/[0-9a-z]\+')
+
+      if strlen(gistid) == 0
+        echohl WarningMsg | echo "GistID error" | echohl None
+        return
+      endif
+      echo "Found GistID: " . gistid
+
+      cal s:GistUpdate(a:user, a:token,  a:content, gistid, '')
+      return
+    endif
+  endfor
+
+  let ext = expand('%:e')
+  let ext = len(ext) ? '.'.ext : ''
+  let name = expand('%:t')
+
+  let query = [
+    \ 'file_ext[gistfile1]=%s',
+    \ 'file_name[gistfile1]=%s',
+    \ 'file_contents[gistfile1]=%s',
+    \ ]
+
+  if len(a:user) > 0 && len(a:token) > 0
+    call add(query, 'login=%s')
+    call add(query, 'token=%s')
+  else
+    call add(query, '%.0s%.0s')
+  endif
+
+  if a:private
+    call add(query, 'action_button=private')
+  endif
+  let squery = printf(join(query, '&'),
+    \ s:encodeURIComponent(ext),
+    \ s:encodeURIComponent(name),
+    \ s:encodeURIComponent(a:content),
+    \ s:encodeURIComponent(a:user),
+    \ s:encodeURIComponent(a:token))
+  unlet query
+
+  let file = tempname()
+  call writefile([squery], file)
+  echon 'Posting it to gist... '
+  let quote = &shellxquote == '"' ?  "'" : '"'
+  let url = 'https://gist.github.com/gists'
+  let res = system('curl -i '.g:gist_curl_options.' -d @'.quote.file.quote.' '.url)
+  call delete(file)
+  let headers = split(res, '\(\r\?\n\|\r\n\?\)')
+  let location = matchstr(headers, '^Location: ')
+  let location = substitute(location, '^[^:]\+: ', '', '')
+  if len(location) > 0 && location =~ '^\(http\|https\):\/\/gist\.github\.com\/'
+    redraw
+    echo 'Done: '.location
+  else
+    let message = matchstr(headers, '^Status: ')
+    let message = substitute(message, '^[^:]\+: [0-9]\+ ', '', '')
+    echohl ErrorMsg | echomsg 'Post failed: '.message | echohl None
+  endif
+  return location
+endfunction
+
+function! s:GistPostBuffers(user, token, private)
+  let bufnrs = range(1, bufnr("$"))
+  let bn = bufnr('%')
+  let query = []
+  if len(a:user) > 0 && len(a:token) > 0
+    call add(query, 'login=%s')
+    call add(query, 'token=%s')
+  else
+    call add(query, '%.0s%.0s')
+  endif
+  if a:private
+    call add(query, 'action_button=private')
+  endif
+  let squery = printf(join(query, "&"),
+    \ s:encodeURIComponent(a:user),
+    \ s:encodeURIComponent(a:token)) . '&'
+
+  let query = [
+    \ 'file_ext[gistfile]=%s',
+    \ 'file_name[gistfile]=%s',
+    \ 'file_contents[gistfile]=%s',
+    \ ]
+  let format = join(query, "&") . '&'
+
+  let index = 1
+  for bufnr in bufnrs
+    if !bufexists(bufnr) || buflisted(bufnr) == 0
+      continue
+    endif
+    echo "Creating gist content".index."... "
+    silent! exec "buffer!" bufnr
+    let content = join(getline(1, line('$')), "\n")
+    let ext = expand('%:e')
+    let ext = len(ext) ? '.'.ext : ''
+    let name = expand('%:t')
+    let squery .= printf(substitute(format, 'gistfile', 'gistfile'.index, 'g'),
+      \ s:encodeURIComponent(ext),
+      \ s:encodeURIComponent(name),
+      \ s:encodeURIComponent(content))
+    let index = index + 1
+  endfor
+  silent! exec "buffer!" bn
+
+  let file = tempname()
+  call writefile([squery], file)
+  echo "Posting it to gist... "
+  let quote = &shellxquote == '"' ?  "'" : '"'
+  let url = 'https://gist.github.com/gists'
+  let res = system('curl -i '.g:gist_curl_options.' -d @'.quote.file.quote.' '.url)
+  call delete(file)
+  let res = matchstr(split(res, '\(\r\?\n\|\r\n\?\)'), '^Location: ')
+  let res = substitute(res, '^.*: ', '', '')
+  if len(res) > 0 && res =~ '^\(http\|https\):\/\/gist\.github\.com\/'
+    redraw
+    echo 'Done: '.res
+  else
+    echohl ErrorMsg | echomsg 'Post failed' | echohl None
+  endif
+  return res
+endfunction
+
+function! Gist(line1, line2, ...)
+  if !exists('g:github_user')
+    let g:github_user = substitute(system('git config --global github.user'), "\n", '', '')
+    if strlen(g:github_user) == 0
+      let g:github_user = $GITHUB_USER
+    end
+  endif
+  if !exists('g:github_token')
+    let g:github_token = substitute(system('git config --global github.token'), "\n", '', '')
+    if strlen(g:github_token) == 0
+      let g:github_token = $GITHUB_TOKEN
+    end
+  endif
+  if strlen(g:github_user) == 0 || strlen(g:github_token) == 0
+    echohl ErrorMsg
+    echomsg "You have no setting for github."
+    echohl WarningMsg
+    echo "git config --global github.user  your-name"
+    echo "git config --global github.token your-token"
+    echo "or set g:github_user and g:github_token in your vimrc"
+    echo "or set shell env vars GITHUB_USER and GITHUB_TOKEN"
+    echohl None
+    return 0
+  end
+
+  let bufname = bufname("%")
+  let user = g:github_user
+  let token = g:github_token
+  let gistid = ''
+  let gistls = ''
+  let gistnm = ''
+  let private = g:gist_private
+  let multibuffer = 0
+  let clipboard = 0
+  let deletepost = 0
+  let editpost = 0
+  let listmx = '^\(-l\|--list\)\s*\([^\s]\+\)\?$'
+  let bufnamemx = '^' . s:bufprefix .'\([0-9a-f]\+\)$'
+
+  let args = (a:0 > 0) ? split(a:1, ' ') : []
+  for arg in args
+    if arg =~ '^\(-la\|--listall\)$\C'
+      let gistls = '-all'
+    elseif arg =~ '^\(-l\|--list\)$\C'
+      if g:gist_show_privates
+        let gistls = 'mine'
+      else
+        let gistls = g:github_user
+      endif
+    elseif arg == '--abandon\C'
+      call s:GistGetPage('', '', '', '')
+      return
+    elseif arg =~ '^\(-m\|--multibuffer\)$\C'
+      let multibuffer = 1
+    elseif arg =~ '^\(-p\|--private\)$\C'
+      let private = 1
+    elseif arg =~ '^\(-P\|--public\)$\C'
+      let private = 0
+    elseif arg =~ '^\(-a\|--anonymous\)$\C'
+      let user = ''
+      let token = ''
+    elseif arg =~ '^\(-c\|--clipboard\)$\C'
+      let clipboard = 1
+    elseif arg =~ '^\(-d\|--delete\)$\C' && bufname =~ bufnamemx
+      let deletepost = 1
+      let gistid = substitute(bufname, bufnamemx, '\1', '')
+    elseif arg =~ '^\(-e\|--edit\)$\C' && bufname =~ bufnamemx
+      let editpost = 1
+      let gistid = substitute(bufname, bufnamemx, '\1', '')
+    elseif arg =~ '^\(-f\|--fork\)$\C' && bufname =~ bufnamemx
+      let gistid = substitute(bufname, bufnamemx, '\1', '')
+      let res = s:GistGetPage("https://gist.github.com/fork/".gistid, g:github_user, '', '')
+      let loc = filter(res.header, 'v:val =~ "^Location:"')[0]
+      let loc = substitute(loc, '^[^:]\+: ', '', '')
+      let mx = '^https://gist.github.com/\([0-9a-z]\+\)$'
+      if loc =~ mx
+        let gistid = substitute(loc, mx, '\1', '')
+      else
+        echohl ErrorMsg | echomsg 'Fork failed' | echohl None
+        return
+      endif
+    elseif arg !~ '^-' && len(gistnm) == 0
+      if editpost == 1 || deletepost == 1
+        let gistnm = arg
+      elseif len(gistls) > 0 && arg != '^\w\+$\C'
+        let gistls = arg
+      elseif arg =~ '^[0-9a-z]\+$\C'
+        let gistid = arg
+      else
+        echohl ErrorMsg | echomsg 'Invalid arguments' | echohl None
+        unlet args
+        return 0
+      endif
+    elseif len(arg) > 0
+      echohl ErrorMsg | echomsg 'Invalid arguments' | echohl None
+      unlet args
+      return 0
+    endif
+  endfor
+  unlet args
+  "echo "gistid=".gistid
+  "echo "gistls=".gistls
+  "echo "gistnm=".gistnm
+  "echo "private=".private
+  "echo "clipboard=".clipboard
+  "echo "editpost=".editpost
+  "echo "deletepost=".deletepost
+
+  if len(gistls) > 0
+    call s:GistList(user, token, gistls, 1)
+  elseif len(gistid) > 0 && editpost == 0 && deletepost == 0
+    call s:GistGet(user, token, gistid, clipboard)
+  else
+    let url = ''
+    if multibuffer == 1
+      let url = s:GistPostBuffers(user, token, private)
+    else
+      let content = join(getline(a:line1, a:line2), "\n")
+      if editpost == 1
+        let url = s:GistUpdate(user, token, content, gistid, gistnm)
+      elseif deletepost == 1
+        call s:GistDelete(user, token, gistid)
+      else
+        let url = s:GistPost(user, token, content, private)
+      endif
+    endif
+    if len(url) > 0
+      if g:gist_open_browser_after_post
+        let cmd = substitute(g:gist_browser_command, '%URL%', url, 'g')
+        if cmd =~ '^!'
+          silent! exec cmd
+        elseif cmd =~ '^:[A-Z]'
+          exec cmd
+        else
+          call system(cmd)
+        endif
+      endif
+      if g:gist_put_url_to_clipboard_after_post > 0
+        if g:gist_put_url_to_clipboard_after_post == 2
+          let url = url . "\n"
+        endif
+        if exists('g:gist_clip_command')
+          call system(g:gist_clip_command, url)
+        elseif has('unix') && !has('xterm_clipboard')
+          let @" = url
+        else
+          let @+ = url
+        endif
+      endif
+    endif
+  endif
+  return 1
+endfunction
+
+command! -nargs=? -range=% Gist :call Gist(<line1>, <line2>, <f-args>)
+" vim:set et:
diff --git a/vim/plugin/indent-object.vim b/vim/plugin/indent-object.vim
new file mode 100644 (file)
index 0000000..afb8edd
--- /dev/null
@@ -0,0 +1,224 @@
+"--------------------------------------------------------------------------------
+"
+"  Copyright (c) 2010 Michael Smith <msmith@msmith.id.au>
+"
+"  http://github.com/michaeljsmith/vim-indent-object
+"
+"  Permission is hereby granted, free of charge, to any person obtaining a copy
+"  of this software and associated documentation files (the "Software"), to
+"  deal in the Software without restriction, including without limitation the
+"  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+"  sell copies of the Software, and to permit persons to whom the Software is
+"  furnished to do so, subject to the following conditions:
+"  
+"  The above copyright notice and this permission notice shall be included in
+"  all copies or substantial portions of the Software.
+"  
+"  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+"  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+"  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+"  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+"  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+"  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+"  IN THE SOFTWARE.
+"
+"--------------------------------------------------------------------------------
+
+" Mappings excluding line below.
+onoremap <silent>ai :<C-u>cal <Sid>HandleTextObjectMapping(0, 0, 0, [line("."), line("."), col("."), col(".")])<CR>
+onoremap <silent>ii :<C-u>cal <Sid>HandleTextObjectMapping(1, 0, 0, [line("."), line("."), col("."), col(".")])<CR>
+vnoremap <silent>ai :<C-u>cal <Sid>HandleTextObjectMapping(0, 0, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
+vnoremap <silent>ii :<C-u>cal <Sid>HandleTextObjectMapping(1, 0, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
+
+" Mappings including line below.
+onoremap <silent>aI :<C-u>cal <Sid>HandleTextObjectMapping(0, 1, 0, [line("."), line("."), col("."), col(".")])<CR>
+onoremap <silent>iI :<C-u>cal <Sid>HandleTextObjectMapping(1, 1, 0, [line("."), line("."), col("."), col(".")])<CR>
+vnoremap <silent>aI :<C-u>cal <Sid>HandleTextObjectMapping(0, 1, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
+vnoremap <silent>iI :<C-u>cal <Sid>HandleTextObjectMapping(1, 1, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
+
+let s:l0 = -1
+let s:l1 = -1
+let s:c0 = -1
+let s:c1 = -1
+
+function! <Sid>TextObject(inner, incbelow, vis, range, count)
+
+       " Record the current state of the visual region.
+       let vismode = "V"
+
+       " Detect if this is a completely new visual selction session.
+       let new_vis = 0
+       let new_vis = new_vis || s:l0 != a:range[0]
+       let new_vis = new_vis || s:l1 != a:range[1]
+       let new_vis = new_vis || s:c0 != a:range[2]
+       let new_vis = new_vis || s:c1 != a:range[3]
+
+       let s:l0 = a:range[0]
+       let s:l1 = a:range[1]
+       let s:c0 = a:range[2]
+       let s:c1 = a:range[3]
+
+       " Repeatedly increase the scope of the selection.
+       let itr_cnt = 0
+       let cnt = a:count
+       while cnt > 0
+
+               " Look for the minimum indentation in the current visual region.
+               let l = s:l0
+               let idnt_invalid = 1000
+               let idnt = idnt_invalid
+               while l <= s:l1
+                       if !(getline(l) =~ "^\\s*$")
+                               let idnt = min([idnt, indent(l)])
+                       endif
+                       let l += 1
+               endwhile
+
+               " Keep track of where the range should be expanded to.
+               let l_1 = s:l0
+               let l_1o = l_1
+               let l2 = s:l1
+               let l2o = l2
+
+               " If we are highlighting only blank lines, we may not have found a
+               " valid indent. In this case we need to look for the next and previous
+               " non blank lines and check which of those has the largest indent.
+               if idnt == idnt_invalid
+                       let idnt = 0
+                       let pnb = prevnonblank(s:l0)
+                       if pnb
+                               let idnt = max([idnt, indent(pnb)])
+                               let l_1 = pnb
+                       endif
+                       let nnb = nextnonblank(s:l0)
+                       if nnb
+                               let idnt = max([idnt, indent(nnb)])
+                       endif
+
+                       " If we are in whitespace at the beginning of a block, skip over
+                       " it when we are selecting the range. Similarly, if we are in
+                       " whitespace at the end, ignore it.
+                       if idnt > indent(pnb)
+                               let l_1 = nnb
+                       endif
+                       if idnt > indent(nnb)
+                               let l2 = pnb
+                       endif
+               endif
+
+               " Search backward for the first line with less indent than the target
+               " indent (skipping blank lines).
+               let blnk = getline(l_1) =~ "^\\s*$"
+               while l_1 > 0 && ((idnt == 0 && !blnk) || (idnt != 0 && (blnk || indent(l_1) >= idnt)))
+                       if !blnk || !a:inner
+                               let l_1o = l_1
+                       endif
+                       let l_1 -= 1
+                       let blnk = getline(l_1) =~ "^\\s*$"
+               endwhile
+
+               " Search forward for the first line with more indent than the target
+               " indent (skipping blank lines).
+               let line_cnt = line("$")
+               let blnk = getline(l2) =~ "^\\s*$"
+               while l2 <= line_cnt && ((idnt == 0 && !blnk) || (idnt != 0 && (blnk || indent(l2) >= idnt)))
+                       if !blnk || !a:inner
+                               let l2o = l2
+                       endif
+                       let l2 += 1
+                       let blnk = getline(l2) =~ "^\\s*$"
+               endwhile
+
+               " Determine which of these extensions to include. Include neither if
+               " we are selecting an 'inner' object. Exclude the bottom unless are
+               " told to include it.
+               let idnt2 = max([indent(l_1), indent(l2)])
+               if indent(l_1) < idnt2 || a:inner
+                       let l_1 = l_1o
+               endif
+               if indent(l2) < idnt2 || a:inner || !a:incbelow
+                       let l2 = l2o
+               endif
+               let l_1 = max([l_1, 1])
+               let l2 = min([l2, line("$")])
+
+               " Extend the columns to the start and end.
+               " If inner is selected, set the final cursor pos to the start
+               " of the text in the line.
+               let c_1 = 1
+               if a:inner
+                       let c_1 = match(getline(l_1), "\\c\\S") + 1
+               endif
+               let c2 = len(getline(l2))
+               if !a:inner
+                       let c2 += 1
+               endif
+
+               " Make sure there's no change if we haven't really made a
+               " significant change in linewise mode - this makes sure that
+               " we can iteratively increase selection in linewise mode.
+               if itr_cnt == 0 && vismode ==# 'V' && s:l0 == l_1 && s:l1 == l2
+                       let c_1 = s:c0
+                       let c2 = s:c1
+               endif
+
+               " Check whether the visual region has changed.
+               let chg = 0
+               let chg = chg || s:l0 != l_1
+               let chg = chg || s:l1 != l2
+               let chg = chg || s:c0 != c_1
+               let chg = chg || s:c1 != c2
+
+               if vismode ==# 'V' && new_vis
+                       let chg = 1
+               endif
+
+               " Update the vars.
+               let s:l0 = l_1
+               let s:l1 = l2
+               let s:c0 = c_1
+               let s:c1 = c2
+
+               " If there was no change, then don't decrement the count (it didn't
+               " count because it didn't do anything).
+               if chg
+                       let cnt = cnt - 1
+               else
+                       " Since this didn't work, push the selection back one char. This
+                       " will have the effect of getting the enclosing block. Do it at
+                       " the beginning rather than the end - the beginning is very likely
+                       " to be only one indentation level different.
+                       if s:l0 == 0
+                               return
+                       endif
+                       let s:l0 -= 1
+                       let s:c0 = len(getline(s:l0))
+               endif
+
+               let itr_cnt += 1
+
+       endwhile
+
+       " Apply the range we have found. Make sure to use the current visual mode.
+       call cursor(s:l0, s:c0)
+       exe "normal! " . vismode
+       call cursor(s:l1, s:c1)
+       normal! o
+
+       " Update these static variables - we need to keep these up-to-date between
+       " invocations because it's the only way we can detect whether it's a new
+       " visual mode. We need to know if it's a new visual mode because otherwise
+       " if there's a single line block in visual line mode and we select it with
+       " "V", we can't tell whether it's already been selected using Vii.
+       exe "normal! \<Esc>"
+       let s:l0 = line("'<")
+       let s:l1 = line("'>")
+       let s:c0 = col("'<")
+       let s:c1 = col("'>")
+       normal gv
+
+endfunction
+
+function! <Sid>HandleTextObjectMapping(inner, incbelow, vis, range)
+       call <Sid>TextObject(a:inner, a:incbelow, a:vis, a:range, v:count1)
+endfunction
diff --git a/vim/plugin/rails.vim b/vim/plugin/rails.vim
new file mode 100644 (file)
index 0000000..2dd17f7
--- /dev/null
@@ -0,0 +1,339 @@
+" rails.vim - Detect a rails application
+" Author:       Tim Pope <http://tpo.pe/>
+" GetLatestVimScripts: 1567 1 :AutoInstall: rails.vim
+
+" Install this file as plugin/rails.vim.  See doc/rails.txt for details. (Grab
+" it from the URL above if you don't have it.)  To access it from Vim, see
+" :help add-local-help (hint: :helptags ~/.vim/doc) Afterwards, you should be
+" able to do :help rails
+
+if exists('g:loaded_rails') || &cp || v:version < 700
+  finish
+endif
+let g:loaded_rails = 1
+
+" Utility Functions {{{1
+
+function! s:error(str)
+  echohl ErrorMsg
+  echomsg a:str
+  echohl None
+  let v:errmsg = a:str
+endfunction
+
+function! s:autoload(...)
+  if !exists("g:autoloaded_rails") && v:version >= 700
+    runtime! autoload/rails.vim
+  endif
+  if exists("g:autoloaded_rails")
+    if a:0
+      exe a:1
+    endif
+    return 1
+  endif
+  if !exists("g:rails_no_autoload_warning")
+    let g:rails_no_autoload_warning = 1
+    if v:version >= 700
+      call s:error("Disabling rails.vim: autoload/rails.vim is missing")
+    else
+      call s:error("Disabling rails.vim: Vim version 7 or higher required")
+    endif
+  endif
+  return ""
+endfunction
+
+" }}}1
+" Configuration {{{
+
+function! s:SetOptDefault(opt,val)
+  if !exists("g:".a:opt)
+    let g:{a:opt} = a:val
+  endif
+endfunction
+
+call s:SetOptDefault("rails_statusline",1)
+call s:SetOptDefault("rails_syntax",1)
+call s:SetOptDefault("rails_mappings",1)
+call s:SetOptDefault("rails_abbreviations",1)
+call s:SetOptDefault("rails_ctags_arguments","--languages=-javascript")
+call s:SetOptDefault("rails_default_file","README")
+call s:SetOptDefault("rails_root_url",'http://localhost:3000/')
+call s:SetOptDefault("rails_modelines",0)
+call s:SetOptDefault("rails_menu",0)
+call s:SetOptDefault("rails_gnu_screen",1)
+call s:SetOptDefault("rails_history_size",5)
+call s:SetOptDefault("rails_generators","controller\ngenerator\nhelper\nintegration_test\nmailer\nmetal\nmigration\nmodel\nobserver\nperformance_test\nplugin\nresource\nscaffold\nscaffold_controller\nsession_migration\nstylesheets")
+if exists("g:loaded_dbext") && executable("sqlite3") && ! executable("sqlite")
+  " Since dbext can't find it by itself
+  call s:SetOptDefault("dbext_default_SQLITE_bin","sqlite3")
+endif
+
+" }}}1
+" Detection {{{1
+
+function! s:escvar(r)
+  let r = fnamemodify(a:r,':~')
+  let r = substitute(r,'\W','\="_".char2nr(submatch(0))."_"','g')
+  let r = substitute(r,'^\d','_&','')
+  return r
+endfunction
+
+function! s:Detect(filename)
+  let fn = substitute(fnamemodify(a:filename,":p"),'\c^file://','','')
+  let sep = matchstr(fn,'^[^\\/]\{3,\}\zs[\\/]')
+  if sep != ""
+    let fn = getcwd().sep.fn
+  endif
+  if fn =~ '[\/]config[\/]environment\.rb$'
+    return s:BufInit(strpart(fn,0,strlen(fn)-22))
+  endif
+  if isdirectory(fn)
+    let fn = fnamemodify(fn,':s?[\/]$??')
+  else
+    let fn = fnamemodify(fn,':s?\(.*\)[\/][^\/]*$?\1?')
+  endif
+  let ofn = ""
+  let nfn = fn
+  while nfn != ofn && nfn != ""
+    if exists("s:_".s:escvar(nfn))
+      return s:BufInit(nfn)
+    endif
+    let ofn = nfn
+    let nfn = fnamemodify(nfn,':h')
+  endwhile
+  let ofn = ""
+  while fn != ofn
+    if filereadable(fn . "/config/environment.rb")
+      return s:BufInit(fn)
+    endif
+    let ofn = fn
+    let fn = fnamemodify(ofn,':s?\(.*\)[\/]\(app\|config\|db\|doc\|features\|lib\|log\|public\|script\|spec\|stories\|test\|tmp\|vendor\)\($\|[\/].*$\)?\1?')
+  endwhile
+  return 0
+endfunction
+
+function! s:BufInit(path)
+  let s:_{s:escvar(a:path)} = 1
+  if s:autoload()
+    return RailsBufInit(a:path)
+  endif
+endfunction
+
+" }}}1
+" Initialization {{{1
+
+augroup railsPluginDetect
+  autocmd!
+  autocmd BufNewFile,BufRead * call s:Detect(expand("<afile>:p"))
+  autocmd VimEnter * if expand("<amatch>") == "" && !exists("b:rails_root") | call s:Detect(getcwd()) | endif | if exists("b:rails_root") | silent doau User BufEnterRails | endif
+  autocmd FileType netrw if !exists("b:rails_root") | call s:Detect(expand("<afile>:p")) | endif | if exists("b:rails_root") | silent doau User BufEnterRails | endif
+  autocmd BufEnter * if exists("b:rails_root")|silent doau User BufEnterRails|endif
+  autocmd BufLeave * if exists("b:rails_root")|silent doau User BufLeaveRails|endif
+  autocmd Syntax railslog if s:autoload()|call rails#log_syntax()|endif
+augroup END
+
+command! -bar -bang -nargs=* -complete=dir Rails :if s:autoload()|call rails#new_app_command(<bang>0,<f-args>)|endif
+
+" }}}1
+" abolish.vim support {{{1
+
+function! s:function(name)
+    return function(substitute(a:name,'^s:',matchstr(expand('<sfile>'), '<SNR>\d\+_'),''))
+endfunction
+
+augroup railsPluginAbolish
+  autocmd!
+  autocmd VimEnter * call s:abolish_setup()
+augroup END
+
+function! s:abolish_setup()
+  if exists('g:Abolish') && has_key(g:Abolish,'Coercions')
+    if !has_key(g:Abolish.Coercions,'l')
+      let g:Abolish.Coercions.l = s:function('s:abolish_l')
+    endif
+    if !has_key(g:Abolish.Coercions,'t')
+      let g:Abolish.Coercions.t = s:function('s:abolish_t')
+    endif
+  endif
+endfunction
+
+function! s:abolish_l(word)
+  let singular = rails#singularize(a:word)
+  return a:word ==? singular ? rails#pluralize(a:word) : singular
+endfunction
+
+function! s:abolish_t(word)
+  if a:word =~# '\u'
+    return rails#pluralize(rails#underscore(a:word))
+  else
+    return rails#singularize(rails#camelize(a:word))
+  endif
+endfunction
+
+" }}}1
+" Menus {{{1
+
+if !(g:rails_menu && has("menu"))
+  finish
+endif
+
+function! s:sub(str,pat,rep)
+  return substitute(a:str,'\v\C'.a:pat,a:rep,'')
+endfunction
+
+function! s:gsub(str,pat,rep)
+  return substitute(a:str,'\v\C'.a:pat,a:rep,'g')
+endfunction
+
+function! s:menucmd(priority)
+  return 'anoremenu <script> '.(exists("$CREAM") ? 87 : '').s:gsub(g:rails_installed_menu,'[^.]','').'.'.a:priority.' '
+endfunction
+
+function! s:CreateMenus() abort
+  if exists("g:rails_installed_menu") && g:rails_installed_menu != ""
+    exe "aunmenu ".s:gsub(g:rails_installed_menu,'\&','')
+    unlet g:rails_installed_menu
+  endif
+  if has("menu") && (exists("g:did_install_default_menus") || exists("$CREAM")) && g:rails_menu
+    if g:rails_menu > 1
+      let g:rails_installed_menu = '&Rails'
+    else
+      let g:rails_installed_menu = '&Plugin.&Rails'
+    endif
+    let dots = s:gsub(g:rails_installed_menu,'[^.]','')
+    let menucmd = s:menucmd(200)
+    if exists("$CREAM")
+      exe menucmd.g:rails_installed_menu.'.-PSep- :'
+      exe menucmd.g:rails_installed_menu.'.&Related\ file\     :R\ /\ Alt+] :R<CR>'
+      exe menucmd.g:rails_installed_menu.'.&Alternate\ file\   :A\ /\ Alt+[ :A<CR>'
+      exe menucmd.g:rails_installed_menu.'.&File\ under\ cursor\       Ctrl+Enter :Rfind<CR>'
+    else
+      exe menucmd.g:rails_installed_menu.'.-PSep- :'
+      exe menucmd.g:rails_installed_menu.'.&Related\ file\     :R\ /\ ]f :R<CR>'
+      exe menucmd.g:rails_installed_menu.'.&Alternate\ file\   :A\ /\ [f :A<CR>'
+      exe menucmd.g:rails_installed_menu.'.&File\ under\ cursor\       gf :Rfind<CR>'
+    endif
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Controller :Rcontroller application<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Helper :Rhelper application<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Javascript :Rjavascript application<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Layout :Rlayout application<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &README :R doc/README_FOR_APP<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.&Environment :Renvironment<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.&Database\ Configuration :R config/database.yml<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.Database\ &Schema :Rmigration 0<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.R&outes :Rinitializer<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Other\ files.&Test\ Helper :Rintegrationtest<CR>'
+    exe menucmd.g:rails_installed_menu.'.-FSep- :'
+    exe menucmd.g:rails_installed_menu.'.Ra&ke\        :Rake :Rake<CR>'
+    let menucmd = substitute(menucmd,'200 $','500 ','')
+    exe menucmd.g:rails_installed_menu.'.&Server\      :Rserver.&Start\        :Rserver :Rserver<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Server\      :Rserver.&Force\ start\ :Rserver! :Rserver!<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Server\      :Rserver.&Kill\ :Rserver!\ - :Rserver! -<CR>'
+    exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.&Evaluate\ Ruby\.\.\.\  :Rp :call <SID>menuprompt("Rp","Code to execute and output: ")<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Console\     :Rscript :Rscript console<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Preview\     :Rpreview :Rpreview<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Log\ file\   :Rlog :Rlog<CR>'
+    exe substitute(s:sub(menucmd,'anoremenu','vnoremenu'),'<script>','<script> <silent>','').g:rails_installed_menu.'.E&xtract\ as\ partial\   :Rextract :call <SID>menuprompt("'."'".'<,'."'".'>Rextract","Partial name (e.g., template or /controller/template): ")<CR>'
+    exe menucmd.g:rails_installed_menu.'.&Migration\ writer\   :Rinvert :Rinvert<CR>'
+    exe menucmd.'         '.g:rails_installed_menu.'.-HSep- :'
+    exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.&Help\  :help\ rails :if <SID>autoload()<Bar>exe RailsHelpCommand("")<Bar>endif<CR>'
+    exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.Abo&ut\  :if <SID>autoload()<Bar>exe RailsHelpCommand("about")<Bar>endif<CR>'
+    let g:rails_did_menus = 1
+    call s:ProjectMenu()
+    call s:menuBufLeave()
+    if exists("b:rails_root")
+      call s:menuBufEnter()
+    endif
+  endif
+endfunction
+
+function! s:ProjectMenu()
+  if exists("g:rails_did_menus") && g:rails_history_size > 0
+    if !exists("g:RAILS_HISTORY")
+      let g:RAILS_HISTORY = ""
+    endif
+    let history = g:RAILS_HISTORY
+    let menu = s:gsub(g:rails_installed_menu,'\&','')
+    silent! exe "aunmenu <script> ".menu.".Projects"
+    let dots = s:gsub(menu,'[^.]','')
+    exe 'anoremenu <script> <silent> '.(exists("$CREAM") ? '87' : '').dots.'.100 '.menu.'.Pro&jects.&New\.\.\.\        :Rails :call <SID>menuprompt("Rails","New application path and additional arguments: ")<CR>'
+    exe 'anoremenu <script> '.menu.'.Pro&jects.-FSep- :'
+    while history =~ '\n'
+      let proj = matchstr(history,'^.\{-\}\ze\n')
+      let history = s:sub(history,'^.{-}\n','')
+      exe 'anoremenu <script> '.menu.'.Pro&jects.'.s:gsub(proj,'[.\\ ]','\\&').' :e '.s:gsub(proj."/".g:rails_default_file,'[ !%#]','\\&')."<CR>"
+    endwhile
+  endif
+endfunction
+
+function! s:menuBufEnter()
+  if exists("g:rails_installed_menu") && g:rails_installed_menu != ""
+    let menu = s:gsub(g:rails_installed_menu,'\&','')
+    exe 'amenu enable '.menu.'.*'
+    if RailsFileType() !~ '^view\>'
+      exe 'vmenu disable '.menu.'.Extract\ as\ partial'
+    endif
+    if RailsFileType() !~ '^\%(db-\)\=migration$' || RailsFilePath() =~ '\<db/schema\.rb$'
+      exe 'amenu disable '.menu.'.Migration\ writer'
+    endif
+    call s:ProjectMenu()
+    silent! exe 'aunmenu       '.menu.'.Rake\ tasks'
+    silent! exe 'aunmenu       '.menu.'.Generate'
+    silent! exe 'aunmenu       '.menu.'.Destroy'
+    if rails#app().cache.needs('rake_tasks') || empty(rails#app().rake_tasks())
+      exe substitute(s:menucmd(300),'<script>','<script> <silent>','').g:rails_installed_menu.'.Rake\ &tasks\  :Rake.Fill\ this\ menu :call rails#app().rake_tasks()<Bar>call <SID>menuBufLeave()<Bar>call <SID>menuBufEnter()<CR>'
+    else
+      let i = 0
+      while i < len(rails#app().rake_tasks())
+        let task = rails#app().rake_tasks()[i]
+        exe s:menucmd(300).g:rails_installed_menu.'.Rake\ &tasks\      :Rake.'.s:sub(task,':',':.').' :Rake '.task.'<CR>'
+        let i += 1
+      endwhile
+    endif
+    let i = 0
+    let menucmd = substitute(s:menucmd(400),'<script>','<script> <silent>','').g:rails_installed_menu
+    while i < len(rails#app().generators())
+      let generator = rails#app().generators()[i]
+      exe menucmd.'.&Generate\ :Rgen.'.s:gsub(generator,'_','\\ ').' :call <SID>menuprompt("Rgenerate '.generator.'","Arguments for script/generate '.generator.': ")<CR>'
+      exe menucmd.'.&Destroy\  :Rdestroy.'.s:gsub(generator,'_','\\ ').' :call <SID>menuprompt("Rdestroy '.generator.'","Arguments for script/destroy '.generator.': ")<CR>'
+      let i += 1
+    endwhile
+  endif
+endfunction
+
+function! s:menuBufLeave()
+  if exists("g:rails_installed_menu") && g:rails_installed_menu != ""
+    let menu = s:gsub(g:rails_installed_menu,'\&','')
+    exe 'amenu disable '.menu.'.*'
+    exe 'amenu enable  '.menu.'.Help\  '
+    exe 'amenu enable  '.menu.'.About\ '
+    exe 'amenu enable  '.menu.'.Projects'
+    silent! exe 'aunmenu       '.menu.'.Rake\ tasks'
+    silent! exe 'aunmenu       '.menu.'.Generate'
+    silent! exe 'aunmenu       '.menu.'.Destroy'
+    exe s:menucmd(300).g:rails_installed_menu.'.Rake\ tasks\   :Rake.-TSep- :'
+    exe s:menucmd(400).g:rails_installed_menu.'.&Generate\     :Rgen.-GSep- :'
+    exe s:menucmd(400).g:rails_installed_menu.'.&Destroy\      :Rdestroy.-DSep- :'
+  endif
+endfunction
+
+function! s:menuprompt(vimcmd,prompt)
+  let res = inputdialog(a:prompt,'','!!!')
+  if res == '!!!'
+    return ""
+  endif
+  exe a:vimcmd." ".res
+endfunction
+
+call s:CreateMenus()
+
+augroup railsPluginMenu
+  autocmd!
+  autocmd User BufEnterRails call s:menuBufEnter()
+  autocmd User BufLeaveRails call s:menuBufLeave()
+  " g:RAILS_HISTORY hasn't been set when s:InitPlugin() is called.
+  autocmd VimEnter *         call s:ProjectMenu()
+augroup END
+
+" }}}1
+" vim:set sw=2 sts=2:
diff --git a/vim/plugin/searchfold_0.9.vim b/vim/plugin/searchfold_0.9.vim
new file mode 100644 (file)
index 0000000..1fb9ba8
--- /dev/null
@@ -0,0 +1,319 @@
+" Vim global plugin -- create folds based on last search pattern
+" General: {{{1
+" File:                searchfold.vim
+" Created:     2008 Jan 19
+" Last Change: 2011 May 24
+" Rev Days:     18
+" Author:      Andy Wokula <anwoku@yahoo.de>
+" Credits:     Antonio Colombo's f.vim (Vimscript #318, 2005 May 10)
+" Vim Version: Vim 7.0
+" Version:     0.9
+
+" Description:
+"   Provide mappings to fold away lines not matching the last search pattern
+"   and to restore old fold settings afterwards.  Uses manual fold method,
+"   which allows for nested folds to hide or show more context.  Doesn't
+"   preserve the user's manual folds.
+
+" Usage:
+"   <Leader>z  fold away lines not matching the last search pattern.
+"
+"              With [count], change the initial foldlevel to ([count] minus
+"              one).  The setting will be stored in g:searchfold_foldlevel
+"              and will be reused when [count] is omitted.
+"
+"   <Leader>iz fold away lines that do match the last search pattern
+"              (inverse folding), also with [count].
+"
+"   <Leader>Z  restore the previous fold settings.
+"
+"              Minor Extra: If already in restored state, show a dialog to
+"              revert all involved local fold options to the global
+"              defaults.  The "(s)how" just prints info.
+
+" Customization:
+"   :let g:searchfold_maxdepth = 7
+"              (number)
+"              maximum fold depth
+"
+"   :let g:searchfold_usestep = 1
+"              (boolean)
+"              Controls how folds are organized: If 1 (default), each "zr"
+"              (after "\z") unfolds the same amount of lines above and
+"              below a match.  If 0, only one more line is unfolded above a
+"              match.  This applies for next "\z" or "\iz".
+"
+"   :let g:searchfold_postZ_do_zv = 1
+"              (boolean)
+"              If 1, execute "zv" (view cursor line) after <Leader>Z.
+"
+"   :let g:searchfold_foldlevel = 0
+"              (number)
+"              Initial 'foldlevel' to set for <Leader>z and <Leader>iz.
+"
+"   :let g:searchfold_do_maps = 1
+"              (boolean)
+"              Whether to map the default keys or not.
+"
+" Hint: For boolean options, 1 actually means any non-zero number.
+
+" Related:  Vimscript #158 (foldutil.vim) ... still to be checked out
+"          http://www.noah.org/wiki/Vim#Folding
+"          Vimscript #2302 (foldsearch.vim)
+"          Vimscript #578 (allfold.tar.gz)
+"
+" Changes:
+"   v0.9    redraw removed, plug map renamed, comments (usestep ...)
+"   v0.8    added inverse folding (<Leader>iz), g:searchfold_foldlevel,
+"          count for <Leader>z, <Plug> mappings, disabled F(), (fixes)
+"   v0.7    b:searchfold fallback, s:foldtext check
+"   v0.6    (after v0.4) added customization vars (usestep, maxdepth, Zpost)
+"          reverting global fold settings adds to cmd-history
+"   v0.4    decreasing fold step always 1
+"          maxdepth 7 (before: 6)
+"   v0.3    (after v0.1) added a modified F() from f.vim
+"          functions now with return values
+"   v0.2    (skipped)
+
+" Init Folklore: {{{1
+if exists("loaded_searchfold")
+    finish
+endif
+let loaded_searchfold = 1
+
+if v:version<700
+    echo "Searchfold: you need at least Vim 7.0"
+    finish
+endif
+
+" Customization: {{{1
+if !exists("g:searchfold_maxdepth")
+    let g:searchfold_maxdepth = 7
+endif
+if !exists("g:searchfold_usestep")
+    let g:searchfold_usestep = 1
+endif
+if !exists("g:searchfold_postZ_do_zv")
+    let g:searchfold_postZ_do_zv = 1
+endif
+if !exists("g:searchfold_foldlevel")
+    let g:searchfold_foldlevel = 0
+endif
+if !exists("g:searchfold_do_maps")
+    let g:searchfold_do_maps = 1
+endif
+
+" s:variables {{{1
+let s:foldtext = "(v:folddashes.'').((v:foldend)-(v:foldstart)+(1))"
+" use unique notation of 'foldtext' to identify active searchfold in a
+" window
+
+func! s:FoldNested(from, to) " {{{1
+    " create one fold from line a:from to line a:to, with more nested folds
+    " return 1 if folds were created
+    " return 0 if from > to
+    let nlines = a:to - a:from
+    if nlines < 0
+       return 0
+    elseif nlines < 3
+       " range of 1 line possible
+       exec a:from.",".a:to. "fold"
+       return 1
+    endif
+
+    " calc folds, start with most outer fold
+    " - range of inner folds at least 2 lines (from<to)
+    " - limit nesting (depth)
+    " - snap folds at start and end of file
+    " - at greater "depth" (here depth->0), don't create folds with few
+    "   lines only (check to-from>step)
+    if g:searchfold_maxdepth < 1 || g:searchfold_maxdepth > 12
+       let g:searchfold_maxdepth = 7
+    endif
+    let depth = g:searchfold_maxdepth
+    let step = 1    " decstep:''
+    let step1 = 1   " (const) decstep:'1'
+    let from = a:from
+    let to = a:to
+    " let decstep = exists("g:searchfold_usestep") && g:searchfold_usestep ? "" : "1"
+    let decstep = g:searchfold_usestep ? "" : "1"
+    let foldranges = []
+    let lined = line("$")
+    while depth>0 && from<to && to-from>step
+       call insert(foldranges, from.",".to)
+       let from += from>1 ? step : 0
+       " let to -= to<lined ? 1 : 0
+       let to -= to<lined ? step{decstep} : 0
+       let step += step    " arbitrary
+       let depth -= 1
+    endwhile
+
+    " create folds, start with most inner fold
+    for range in foldranges
+       exec range. "fold"
+    endfor
+
+    return 1
+endfunc
+
+func! s:CreateFolds(inverse) " {{{1
+    " create search folds for the whole buffer based on last search pattern
+    let sav_cur = getpos(".")
+
+    let matches = []   " list of lnums
+    if !a:inverse
+       global//call add(matches, line("."))
+    else
+       vglobal//call add(matches, line("."))
+    endif
+
+    let nmatches = len(matches)
+    if nmatches > 0
+       call s:FoldNested(1, matches[0]-1)
+       let imax = nmatches - 1
+       let i = 0
+       while i < imax
+           if matches[i]+1 < matches[i+1]
+               call s:FoldNested(matches[i]+1, matches[i+1]-1)
+           endif
+           let i += 1
+       endwhile
+       call s:FoldNested(matches[imax]+1, line("$"))
+    endif
+
+    let &l:foldlevel = g:searchfold_foldlevel
+    call cursor(sav_cur[1:])
+
+    return nmatches
+endfunc
+
+func! <sid>SearchFoldEnable(inverse) "{{{1
+    " return number of matches
+    if !search("", "n")
+       " last search pattern not found, do nothing
+       return 0
+    endif
+    if (!exists("w:searchfold") || w:searchfold.bufnr != bufnr(""))
+       \ && &fdt != s:foldtext
+       " remember settings
+       let w:searchfold = { "bufnr": bufnr(""),
+           \ "fdm": &fdm,
+           \ "fdl": &fdl,
+           \ "fdt": &fdt,
+           \ "fen": &fen,
+           \ "fml": &fml }
+       " else: do not remember settings if already enabled
+    endif
+    setlocal foldmethod=manual
+    setlocal foldlevel=0
+    let &l:foldtext=s:foldtext
+    setlocal foldenable
+    setlocal foldminlines=0
+    normal! zE
+    if exists("w:searchfold")
+       let b:searchfold = w:searchfold
+    endif
+    return s:CreateFolds(a:inverse)
+endfunc
+func! SearchFoldRestore() "{{{1
+    " turn off
+    if exists("w:searchfold") && w:searchfold.bufnr == bufnr("")
+       " restore settings; var has the right settings if exists, but
+       " doesn't survive window split or win close/restore
+       let &l:fdm = w:searchfold.fdm
+       let &l:fdl = w:searchfold.fdl
+       let &l:fdt = w:searchfold.fdt
+       let &l:fen = w:searchfold.fen
+       let &l:fml = w:searchfold.fml
+       if &fdm == "manual"
+           " remove all search folds (old folds are lost anyway):
+           normal! zE
+       endif
+       unlet w:searchfold
+    elseif exists("b:searchfold") && &fdt == s:foldtext
+       " fallback only, may have wrong settings if overwritten
+       let &l:fdm = b:searchfold.fdm
+       let &l:fdl = b:searchfold.fdl
+       let &l:fdt = b:searchfold.fdt
+       let &l:fen = b:searchfold.fen
+       let &l:fml = b:searchfold.fml
+       if &fdm == "manual"
+           normal! zE
+       endif
+    else
+       let choice = input("Revert to global fold settings? (y/[n]/(s)how):")[0]
+       let setargs = 'fdm< fdl< fdt< fen< fml<'
+       if choice == "y"
+           let cmd = 'setlocal '. setargs
+           echo ':'. cmd
+           exec cmd
+           " call histadd(':', cmd)
+       elseif choice == "s"
+           let setargs = tr(setargs, "<","?")
+           let cmd = 'setglobal '. setargs
+           echo ':'. cmd
+           exec cmd
+           let cmd = 'setlocal '. setargs
+           echo ':'. cmd
+           exec cmd
+       endif
+       return
+    endif
+    if g:searchfold_postZ_do_zv
+       normal! zv
+    endif
+endfunc
+
+"" func! F() range "{{{1
+"     " commented out 2010 Jun 01
+"     " range arg: ignore range given by accident
+"     let pat = input("Which regexp? ", @/)
+"     if pat == ""
+"      if exists("w:searchfold")
+"          call SearchFoldRestore()
+"      endif
+"      return
+"     endif
+"     let @/ = pat
+"     call histadd("search", @/)
+"     call SearchFold()
+" endfunc
+
+" :call F()    only for backwards compatibility
+
+func! SearchFold(...) "{{{1
+    let inverse = a:0>=1 && a:1
+    if v:count >= 1
+       let g:searchfold_foldlevel = v:count - 1
+    endif
+    let nmatches = <sid>SearchFoldEnable(inverse)
+    " at most one match per line counted
+    if nmatches == 0
+       echohl ErrorMsg
+       echomsg "Searchfold: Pattern not found:" @/
+       echohl none
+    elseif nmatches == line("$")
+       echomsg "Searchfold: Pattern found in every line:" @/
+    elseif nmatches == 1
+       echo "Searchfold: 1 line found"
+    else
+       echo "Searchfold:" nmatches "lines found"
+    endif
+    " 2011 Feb 06 commented out:
+    " let &hls = &hls
+    " redraw
+endfunc
+
+" Mappings: {{{1
+nn <silent> <Plug>SearchFoldNormal   :<C-U>call SearchFold(0)<CR>
+nn <silent> <Plug>SearchFoldInverse  :<C-U>call SearchFold(1)<CR>
+nn <silent> <Plug>SearchFoldRestore  :<C-U>call SearchFoldRestore()<CR>
+
+if g:searchfold_do_maps
+    nmap <Leader>z   <Plug>SearchFoldNormal
+    nmap <Leader>iz  <Plug>SearchFoldInverse
+    nmap <Leader>Z   <Plug>SearchFoldRestore
+endif
+
+" Modeline: {{{1
+" vim:set fdm=marker ts=8 sts=4 sw=4 noet:
diff --git a/vim/plugin/showmarks.vim b/vim/plugin/showmarks.vim
new file mode 100644 (file)
index 0000000..c6931c2
--- /dev/null
@@ -0,0 +1,507 @@
+" ==============================================================================
+" Name:          ShowMarks
+" Description:   Visually displays the location of marks.
+" Authors:       Anthony Kruize <trandor@labyrinth.net.au>
+"                Michael Geddes <michaelrgeddes@optushome.com.au>
+" Version:       2.2
+" Modified:      17 August 2004
+" License:       Released into the public domain.
+" ChangeLog:     See :help showmarks-changelog
+"
+" Usage:         Copy this file into the plugins directory so it will be
+"                automatically sourced.
+"
+"                Default keymappings are:
+"                  <Leader>mt  - Toggles ShowMarks on and off.
+"                  <Leader>mo  - Turns ShowMarks on, and displays marks.
+"                  <Leader>mh  - Clears a mark.
+"                  <Leader>ma  - Clears all marks.
+"                  <Leader>mm  - Places the next available mark.
+"
+"                Hiding a mark doesn't actually remove it, it simply moves it
+"                to line 1 and hides it visually.
+"
+" Configuration: ***********************************************************
+"                * PLEASE read the included help file(showmarks.txt) for a *
+"                * more thorough explanation of how to use ShowMarks.      *
+"                ***********************************************************
+"                The following options can be used to customize the behavior
+"                of ShowMarks.  Simply include them in your vimrc file with
+"                the desired settings.
+"
+"                showmarks_enable (Default: 1)
+"                   Defines whether ShowMarks is enabled by default.
+"                   Example: let g:showmarks_enable=0
+"                showmarks_include (Default: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.'`^<>[]{}()\"")
+"                   Defines all marks, in precedence order (only the highest
+"                   precence will show on lines having more than one mark).
+"                   Can be buffer-specific (set b:showmarks_include)
+"                showmarks_ignore_type (Default: "hq")
+"                   Defines the buffer types to be ignored.
+"                   Valid types are:
+"                     h - Help            p - preview
+"                     q - quickfix        r - readonly
+"                     m - non-modifiable
+"                showmarks_textlower (Default: ">")
+"                   Defines how the mark is to be displayed.
+"                   A maximum of two characters can be displayed. To include
+"                   the mark in the text use a tab(\t) character. A single
+"                   character will display as the mark with the character
+"                   suffixed (same as "\t<character>")
+"                   Examples:
+"                    To display the mark with a > suffixed:
+"                      let g:showmarks_textlower="\t>"
+"                         or
+"                      let g:showmarks_textlower=">"
+"                    To display the mark with a ( prefixed:
+"                      let g:showmarks_textlower="(\t"
+"                    To display two > characters:
+"                      let g:showmarks_textlower=">>"
+"                showmarks_textupper (Default: ">")
+"                   Same as above but for the marks A-Z.
+"                   Example: let g:showmarks_textupper="**"
+"                showmarks_textother (Default: ">")
+"                   Same as above but for all other marks.
+"                   Example: let g:showmarks_textother="--"
+"                showmarks_hlline_lower (Default: 0)
+"                showmarks_hlline_upper (Default: 0)
+"                showmarks_hlline_other (Default: 0)
+"                   Defines whether the entire line for a particular mark
+"                   should be highlighted.
+"                   Example: let g:showmarks_hlline_lower=1
+"
+"                Setting Highlighting Colours
+"                   ShowMarks uses the following highlighting groups:
+"                     ShowMarksHLl - For marks a-z
+"                     ShowMarksHLu - For marks A-Z
+"                     ShowMarksHLo - For all other marks
+"                     ShowMarksHLm - For multiple marks on the same line.
+"                                    (Highest precendece mark is shown)
+"
+"                   By default they are set to a bold blue on light blue.
+"                   Defining a highlight for each of these groups will
+"                   override the default highlighting.
+"                   See the VIM help for more information about highlighting.
+" ==============================================================================
+
+" Check if we should continue loading
+if exists( "loaded_showmarks" )
+       finish
+endif
+let loaded_showmarks = 1
+
+" Bail if Vim isn't compiled with signs support.
+if has( "signs" ) == 0
+       echohl ErrorMsg
+       echo "ShowMarks requires Vim to have +signs support."
+       echohl None
+       finish
+endif
+
+" Options: Set up some nice defaults
+if !exists('g:showmarks_enable'      ) | let g:showmarks_enable       = 1    | endif
+if !exists('g:showmarks_textlower'   ) | let g:showmarks_textlower    = ">"  | endif
+if !exists('g:showmarks_textupper'   ) | let g:showmarks_textupper    = ">"  | endif
+if !exists('g:showmarks_textother'   ) | let g:showmarks_textother    = ">"  | endif
+if !exists('g:showmarks_ignore_type' ) | let g:showmarks_ignore_type  = "hq" | endif
+if !exists('g:showmarks_ignore_name' ) | let g:showmarks_ignore_name  = ""   | endif
+if !exists('g:showmarks_hlline_lower') | let g:showmarks_hlline_lower = "0"  | endif
+if !exists('g:showmarks_hlline_upper') | let g:showmarks_hlline_upper = "0"  | endif
+if !exists('g:showmarks_hlline_other') | let g:showmarks_hlline_other = "0"  | endif
+
+" This is the default, and used in ShowMarksSetup to set up info for any
+" possible mark (not just those specified in the possibly user-supplied list
+" of marks to show -- it can be changed on-the-fly).
+let s:all_marks = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.'`^<>[]{}()\""
+
+" Commands
+com! -nargs=0 ShowMarksToggle    :call <sid>ShowMarksToggle()
+com! -nargs=0 ShowMarksOn        :call <sid>ShowMarksOn()
+com! -nargs=0 ShowMarksClearMark :call <sid>ShowMarksClearMark()
+com! -nargs=0 ShowMarksClearAll  :call <sid>ShowMarksClearAll()
+com! -nargs=0 ShowMarksPlaceMark :call <sid>ShowMarksPlaceMark()
+
+" Mappings (NOTE: Leave the '|'s immediately following the '<cr>' so the mapping does not contain any trailing spaces!)
+if !hasmapto( '<Plug>ShowmarksShowMarksToggle' ) | map <silent> <unique> <leader>mt :ShowMarksToggle<cr>|    endif
+if !hasmapto( '<Plug>ShowmarksShowMarksOn'     ) | map <silent> <unique> <leader>mo :ShowMarksOn<cr>|        endif
+if !hasmapto( '<Plug>ShowmarksClearMark'       ) | map <silent> <unique> <leader>mh :ShowMarksClearMark<cr>| endif
+if !hasmapto( '<Plug>ShowmarksClearAll'        ) | map <silent> <unique> <leader>ma :ShowMarksClearAll<cr>|  endif
+if !hasmapto( '<Plug>ShowmarksPlaceMark'       ) | map <silent> <unique> <leader>mm :ShowMarksPlaceMark<cr>| endif
+noremap <unique> <script> \sm m
+noremap <silent> m :exe 'norm \sm'.nr2char(getchar())<bar>call <sid>ShowMarks()<CR>
+
+" AutoCommands: Only if ShowMarks is enabled
+if g:showmarks_enable == 1
+       aug ShowMarks
+               au!
+               autocmd CursorHold * call s:ShowMarks()
+       aug END
+endif
+
+" Highlighting: Setup some nice colours to show the mark positions.
+hi default ShowMarksHLl ctermfg=darkblue ctermbg=blue cterm=bold guifg=blue guibg=lightblue gui=bold
+hi default ShowMarksHLu ctermfg=darkblue ctermbg=blue cterm=bold guifg=blue guibg=lightblue gui=bold
+hi default ShowMarksHLo ctermfg=darkblue ctermbg=blue cterm=bold guifg=blue guibg=lightblue gui=bold
+hi default ShowMarksHLm ctermfg=darkblue ctermbg=blue cterm=bold guifg=blue guibg=lightblue gui=bold
+
+" Function: IncludeMarks()
+" Description: This function returns the list of marks (in priority order) to
+" show in this buffer.  Each buffer, if not already set, inherits the global
+" setting; if the global include marks have not been set; that is set to the
+" default value.
+fun! s:IncludeMarks()
+       if exists('b:showmarks_include') && exists('b:showmarks_previous_include') && b:showmarks_include != b:showmarks_previous_include
+               " The user changed the marks to include; hide all marks; change the
+               " included mark list, then show all marks.  Prevent infinite
+               " recursion during this switch.
+               if exists('s:use_previous_include')
+                       " Recursive call from ShowMarksHideAll()
+                       return b:showmarks_previous_include
+               elseif exists('s:use_new_include')
+                       " Recursive call from ShowMarks()
+                       return b:showmarks_include
+               else
+                       let s:use_previous_include = 1
+                       call <sid>ShowMarksHideAll()
+                       unlet s:use_previous_include
+                       let s:use_new_include = 1
+                       call <sid>ShowMarks()
+                       unlet s:use_new_include
+               endif
+       endif
+
+       if !exists('g:showmarks_include')
+               let g:showmarks_include = s:all_marks
+       endif
+       if !exists('b:showmarks_include')
+               let b:showmarks_include = g:showmarks_include
+       endif
+
+       " Save this include setting so we can detect if it was changed.
+       let b:showmarks_previous_include = b:showmarks_include
+
+       return b:showmarks_include
+endf
+
+" Function: NameOfMark()
+" Paramaters: mark - Specifies the mark to find the name of.
+" Description: Convert marks that cannot be used as part of a variable name to
+" something that can be. i.e. We cannot use [ as a variable-name suffix (as
+" in 'placed_['; this function will return something like 63, so the variable
+" will be something like 'placed_63').
+" 10 is added to the mark's index to avoid colliding with the numeric marks
+" 0-9 (since a non-word mark could be listed in showmarks_include in the
+" first 10 characters if the user overrides the default).
+" Returns: The name of the requested mark.
+fun! s:NameOfMark(mark)
+       let name = a:mark
+       if a:mark =~# '\W'
+               let name = stridx(s:all_marks, a:mark) + 10
+       endif
+       return name
+endf
+
+" Function: VerifyText()
+" Paramaters: which - Specifies the variable to verify.
+" Description: Verify the validity of a showmarks_text{upper,lower,other} setup variable.
+" Default to ">" if it is found to be invalid.
+fun! s:VerifyText(which)
+       if strlen(g:showmarks_text{a:which}) == 0 || strlen(g:showmarks_text{a:which}) > 2
+               echohl ErrorMsg
+               echo "ShowMarks: text".a:which." must contain only 1 or 2 characters."
+               echohl None
+               let g:showmarks_text{a:which}=">"
+       endif
+endf
+
+" Function: ShowMarksSetup()
+" Description: This function sets up the sign definitions for each mark.
+" It uses the showmarks_textlower, showmarks_textupper and showmarks_textother
+" variables to determine how to draw the mark.
+fun! s:ShowMarksSetup()
+       " Make sure the textlower, textupper, and textother options are valid.
+       call s:VerifyText('lower')
+       call s:VerifyText('upper')
+       call s:VerifyText('other')
+
+       let n = 0
+       let s:maxmarks = strlen(s:all_marks)
+       while n < s:maxmarks
+               let c = strpart(s:all_marks, n, 1)
+               let nm = s:NameOfMark(c)
+               let text = '>'.c
+               let lhltext = ''
+               if c =~# '[a-z]'
+                       if strlen(g:showmarks_textlower) == 1
+                               let text=c.g:showmarks_textlower
+                       elseif strlen(g:showmarks_textlower) == 2
+                               let t1 = strpart(g:showmarks_textlower,0,1)
+                               let t2 = strpart(g:showmarks_textlower,1,1)
+                               if t1 == "\t"
+                                       let text=c.t2
+                               elseif t2 == "\t"
+                                       let text=t1.c
+                               else
+                                       let text=g:showmarks_textlower
+                               endif
+                       endif
+                       let s:ShowMarksDLink{nm} = 'ShowMarksHLl'
+                       if g:showmarks_hlline_lower == 1
+                               let lhltext = 'linehl='.s:ShowMarksDLink{nm}.nm
+                       endif
+               elseif c =~# '[A-Z]'
+                       if strlen(g:showmarks_textupper) == 1
+                               let text=c.g:showmarks_textupper
+                       elseif strlen(g:showmarks_textupper) == 2
+                               let t1 = strpart(g:showmarks_textupper,0,1)
+                               let t2 = strpart(g:showmarks_textupper,1,1)
+                               if t1 == "\t"
+                                       let text=c.t2
+                               elseif t2 == "\t"
+                                       let text=t1.c
+                               else
+                                       let text=g:showmarks_textupper
+                               endif
+                       endif
+                       let s:ShowMarksDLink{nm} = 'ShowMarksHLu'
+                       if g:showmarks_hlline_upper == 1
+                               let lhltext = 'linehl='.s:ShowMarksDLink{nm}.nm
+                       endif
+               else " Other signs, like ', ., etc.
+                       if strlen(g:showmarks_textother) == 1
+                               let text=c.g:showmarks_textother
+                       elseif strlen(g:showmarks_textother) == 2
+                               let t1 = strpart(g:showmarks_textother,0,1)
+                               let t2 = strpart(g:showmarks_textother,1,1)
+                               if t1 == "\t"
+                                       let text=c.t2
+                               elseif t2 == "\t"
+                                       let text=t1.c
+                               else
+                                       let text=g:showmarks_textother
+                               endif
+                       endif
+                       let s:ShowMarksDLink{nm} = 'ShowMarksHLo'
+                       if g:showmarks_hlline_other == 1
+                               let lhltext = 'linehl='.s:ShowMarksDLink{nm}.nm
+                       endif
+               endif
+
+               " Define the sign with a unique highlight which will be linked when placed.
+               exe 'sign define ShowMark'.nm.' '.lhltext.' text='.text.' texthl='.s:ShowMarksDLink{nm}.nm
+               let b:ShowMarksLink{nm} = ''
+               let n = n + 1
+       endw
+endf
+
+" Set things up
+call s:ShowMarksSetup()
+
+" Function: ShowMarksOn
+" Description: Enable showmarks, and show them now.
+fun! s:ShowMarksOn()
+       if g:showmarks_enable == 0
+               call <sid>ShowMarksToggle()
+       else
+               call <sid>ShowMarks()
+       endif
+endf
+
+" Function: ShowMarksToggle()
+" Description: This function toggles whether marks are displayed or not.
+fun! s:ShowMarksToggle()
+       if g:showmarks_enable == 0
+               let g:showmarks_enable = 1
+               call <sid>ShowMarks()
+               aug ShowMarks
+                       au!
+                       autocmd CursorHold * call s:ShowMarks()
+               aug END
+       else
+               let g:showmarks_enable = 0
+               call <sid>ShowMarksHideAll()
+               aug ShowMarks
+                       au!
+                       autocmd BufEnter * call s:ShowMarksHideAll()
+               aug END
+       endif
+endf
+
+" Function: ShowMarks()
+" Description: This function runs through all the marks and displays or
+" removes signs as appropriate. It is called on the CursorHold autocommand.
+" We use the marked_{ln} variables (containing a timestamp) to track what marks
+" we've shown (placed) in this call to ShowMarks; to only actually place the
+" first mark on any particular line -- this forces only the first mark
+" (according to the order of showmarks_include) to be shown (i.e., letters
+" take precedence over marks like paragraph and sentence.)
+fun! s:ShowMarks()
+       if g:showmarks_enable == 0
+               return
+       endif
+
+       if   ((match(g:showmarks_ignore_type, "[Hh]") > -1) && (&buftype    == "help"    ))
+       \ || ((match(g:showmarks_ignore_type, "[Qq]") > -1) && (&buftype    == "quickfix"))
+       \ || ((match(g:showmarks_ignore_type, "[Pp]") > -1) && (&pvw        == 1         ))
+       \ || ((match(g:showmarks_ignore_type, "[Rr]") > -1) && (&readonly   == 1         ))
+       \ || ((match(g:showmarks_ignore_type, "[Mm]") > -1) && (&modifiable == 0         ))
+               return
+       endif
+
+       let n = 0
+       let s:maxmarks = strlen(s:IncludeMarks())
+       while n < s:maxmarks
+               let c = strpart(s:IncludeMarks(), n, 1)
+               let nm = s:NameOfMark(c)
+               let id = n + (s:maxmarks * winbufnr(0))
+               let ln = line("'".c)
+
+               if ln == 0 && (exists('b:placed_'.nm) && b:placed_{nm} != ln)
+                       exe 'sign unplace '.id.' buffer='.winbufnr(0)
+               elseif ln > 1 || c !~ '[a-zA-Z]'
+                       " Have we already placed a mark here in this call to ShowMarks?
+                       if exists('mark_at'.ln)
+                               " Already placed a mark, set the highlight to multiple
+                               if c =~# '[a-zA-Z]' && b:ShowMarksLink{mark_at{ln}} != 'ShowMarksHLm'
+                                       let b:ShowMarksLink{mark_at{ln}} = 'ShowMarksHLm'
+                                       exe 'hi link '.s:ShowMarksDLink{mark_at{ln}}.mark_at{ln}.' '.b:ShowMarksLink{mark_at{ln}}
+                               endif
+                       else
+                               if !exists('b:ShowMarksLink'.nm) || b:ShowMarksLink{nm} != s:ShowMarksDLink{nm}
+                                       let b:ShowMarksLink{nm} = s:ShowMarksDLink{nm}
+                                       exe 'hi link '.s:ShowMarksDLink{nm}.nm.' '.b:ShowMarksLink{nm}
+                               endif
+                               let mark_at{ln} = nm
+                               if !exists('b:placed_'.nm) || b:placed_{nm} != ln
+                                       exe 'sign unplace '.id.' buffer='.winbufnr(0)
+                                       exe 'sign place '.id.' name=ShowMark'.nm.' line='.ln.' buffer='.winbufnr(0)
+                                       let b:placed_{nm} = ln
+                               endif
+                       endif
+               endif
+               let n = n + 1
+       endw
+endf
+
+" Function: ShowMarksClearMark()
+" Description: This function hides the mark at the current line.
+" It simply moves the mark to line 1 and removes the sign.
+" Only marks a-z and A-Z are supported.
+fun! s:ShowMarksClearMark()
+       let ln = line(".")
+       let n = 0
+       let s:maxmarks = strlen(s:IncludeMarks())
+       while n < s:maxmarks
+               let c = strpart(s:IncludeMarks(), n, 1)
+               if c =~# '[a-zA-Z]' && ln == line("'".c)
+                       let nm = s:NameOfMark(c)
+                       let id = n + (s:maxmarks * winbufnr(0))
+                       exe 'sign unplace '.id.' buffer='.winbufnr(0)
+                       exe '1 mark '.c
+                       let b:placed_{nm} = 1
+               endif
+               let n = n + 1
+       endw
+endf
+
+" Function: ShowMarksClearAll()
+" Description: This function clears all marks in the buffer.
+" It simply moves the marks to line 1 and removes the signs.
+" Only marks a-z and A-Z are supported.
+fun! s:ShowMarksClearAll()
+       let n = 0
+       let s:maxmarks = strlen(s:IncludeMarks())
+       while n < s:maxmarks
+               let c = strpart(s:IncludeMarks(), n, 1)
+               if c =~# '[a-zA-Z]'
+                       let nm = s:NameOfMark(c)
+                       let id = n + (s:maxmarks * winbufnr(0))
+                       exe 'sign unplace '.id.' buffer='.winbufnr(0)
+                       exe '1 mark '.c
+                       let b:placed_{nm} = 1
+               endif
+               let n = n + 1
+       endw
+endf
+
+" Function: ShowMarksHideAll()
+" Description: This function hides all marks in the buffer.
+" It simply removes the signs.
+fun! s:ShowMarksHideAll()
+       let n = 0
+       let s:maxmarks = strlen(s:IncludeMarks())
+       while n < s:maxmarks
+               let c = strpart(s:IncludeMarks(), n, 1)
+               let nm = s:NameOfMark(c)
+               if exists('b:placed_'.nm)
+                       let id = n + (s:maxmarks * winbufnr(0))
+                       exe 'sign unplace '.id.' buffer='.winbufnr(0)
+                       unlet b:placed_{nm}
+               endif
+               let n = n + 1
+       endw
+endf
+
+" Function: ShowMarksPlaceMark()
+" Description: This function will place the next unplaced mark (in priority
+" order) to the current location. The idea here is to automate the placement
+" of marks so the user doesn't have to remember which marks are placed or not.
+" Hidden marks are considered to be unplaced.
+" Only marks a-z are supported.
+fun! s:ShowMarksPlaceMark()
+       " Find the first, next, and last [a-z] mark in showmarks_include (i.e.
+       " priority order), so we know where to "wrap".
+       let first_alpha_mark = -1
+       let last_alpha_mark  = -1
+       let next_mark        = -1
+
+       if !exists('b:previous_auto_mark')
+               let b:previous_auto_mark = -1
+       endif
+
+       " Find the next unused [a-z] mark (in priority order); if they're all
+       " used, find the next one after the previously auto-assigned mark.
+       let n = 0
+       let s:maxmarks = strlen(s:IncludeMarks())
+       while n < s:maxmarks
+               let c = strpart(s:IncludeMarks(), n, 1)
+               if c =~# '[a-z]'
+                       if line("'".c) <= 1
+                               " Found an unused [a-z] mark; we're done.
+                               let next_mark = n
+                               break
+                       endif
+
+                       if first_alpha_mark < 0
+                               let first_alpha_mark = n
+                       endif
+                       let last_alpha_mark = n
+                       if n > b:previous_auto_mark && next_mark == -1
+                               let next_mark = n
+                       endif
+               endif
+               let n = n + 1
+       endw
+
+       if next_mark == -1 && (b:previous_auto_mark == -1 || b:previous_auto_mark == last_alpha_mark)
+               " Didn't find an unused mark, and haven't placed any auto-chosen marks yet,
+               " or the previously placed auto-chosen mark was the last alpha mark --
+               " use the first alpha mark this time.
+               let next_mark = first_alpha_mark
+       endif
+
+       if (next_mark == -1)
+               echohl WarningMsg
+               echo 'No marks in [a-z] included! (No "next mark" to choose from)'
+               echohl None
+               return
+       endif
+
+       let c = strpart(s:IncludeMarks(), next_mark, 1)
+       let b:previous_auto_mark = next_mark
+       exe 'mark '.c
+       call <sid>ShowMarks()
+endf
+
+" -----------------------------------------------------------------------------
+" vim:ts=4:sw=4:noet
diff --git a/vim/plugin/snipMate.vim b/vim/plugin/snipMate.vim
new file mode 100644 (file)
index 0000000..ef03b12
--- /dev/null
@@ -0,0 +1,271 @@
+" File:          snipMate.vim
+" Author:        Michael Sanders
+" Version:       0.84
+" Description:   snipMate.vim implements some of TextMate's snippets features in
+"                Vim. A snippet is a piece of often-typed text that you can
+"                insert into your document using a trigger word followed by a "<tab>".
+"
+"                For more help see snipMate.txt; you can do this by using:
+"                :helptags ~/.vim/doc
+"                :h snipMate.txt
+
+if exists('loaded_snips') || &cp || version < 700
+       finish
+endif
+let loaded_snips = 1
+if !exists('snips_author') | let snips_author = 'Me' | endif
+
+au BufRead,BufNewFile *.snippets\= set ft=snippet
+au FileType snippet setl noet fdm=indent
+
+let s:snippets = {} | let s:multi_snips = {}
+
+if !exists('snippets_dir')
+       let snippets_dir = substitute(globpath(&rtp, 'snippets/'), "\n", ',', 'g')
+endif
+
+fun! MakeSnip(scope, trigger, content, ...)
+       let multisnip = a:0 && a:1 != ''
+       let var = multisnip ? 's:multi_snips' : 's:snippets'
+       if !has_key({var}, a:scope) | let {var}[a:scope] = {} | endif
+       if !has_key({var}[a:scope], a:trigger)
+               let {var}[a:scope][a:trigger] = multisnip ? [[a:1, a:content]] : a:content
+       elseif multisnip | let {var}[a:scope][a:trigger] += [[a:1, a:content]]
+       else
+               echom 'Warning in snipMate.vim: Snippet '.a:trigger.' is already defined.'
+                               \ .' See :h multi_snip for help on snippets with multiple matches.'
+       endif
+endf
+
+fun! ExtractSnips(dir, ft)
+       for path in split(globpath(a:dir, '*'), "\n")
+               if isdirectory(path)
+                       let pathname = fnamemodify(path, ':t')
+                       for snipFile in split(globpath(path, '*.snippet'), "\n")
+                               call s:ProcessFile(snipFile, a:ft, pathname)
+                       endfor
+               elseif fnamemodify(path, ':e') == 'snippet'
+                       call s:ProcessFile(path, a:ft)
+               endif
+       endfor
+endf
+
+" Processes a single-snippet file; optionally add the name of the parent
+" directory for a snippet with multiple matches.
+fun s:ProcessFile(file, ft, ...)
+       let keyword = fnamemodify(a:file, ':t:r')
+       if keyword  == '' | return | endif
+       try
+               let text = join(readfile(a:file), "\n")
+       catch /E484/
+               echom "Error in snipMate.vim: couldn't read file: ".a:file
+       endtry
+       return a:0 ? MakeSnip(a:ft, a:1, text, keyword)
+                       \  : MakeSnip(a:ft, keyword, text)
+endf
+
+fun! ExtractSnipsFile(file, ft)
+       if !filereadable(a:file) | return | endif
+       let text = readfile(a:file)
+       let inSnip = 0
+       for line in text + ["\n"]
+               if inSnip && (line[0] == "\t" || line == '')
+                       let content .= strpart(line, 1)."\n"
+                       continue
+               elseif inSnip
+                       call MakeSnip(a:ft, trigger, content[:-2], name)
+                       let inSnip = 0
+               endif
+
+               if line[:6] == 'snippet'
+                       let inSnip = 1
+                       let trigger = strpart(line, 8)
+                       let name = ''
+                       let space = stridx(trigger, ' ') + 1
+                       if space " Process multi snip
+                               let name = strpart(trigger, space)
+                               let trigger = strpart(trigger, 0, space - 1)
+                       endif
+                       let content = ''
+               endif
+       endfor
+endf
+
+" Reset snippets for filetype.
+fun! ResetSnippets(ft)
+       let ft = a:ft == '' ? '_' : a:ft
+       for dict in [s:snippets, s:multi_snips, g:did_ft]
+               if has_key(dict, ft)
+                       unlet dict[ft]
+               endif
+       endfor
+endf
+
+" Reset snippets for all filetypes.
+fun! ResetAllSnippets()
+       let s:snippets = {} | let s:multi_snips = {} | let g:did_ft = {}
+endf
+
+" Reload snippets for filetype.
+fun! ReloadSnippets(ft)
+       let ft = a:ft == '' ? '_' : a:ft
+       call ResetSnippets(ft)
+       call GetSnippets(g:snippets_dir, ft)
+endf
+
+" Reload snippets for all filetypes.
+fun! ReloadAllSnippets()
+       for ft in keys(g:did_ft)
+               call ReloadSnippets(ft)
+       endfor
+endf
+
+let g:did_ft = {}
+fun! GetSnippets(dir, filetypes)
+       for ft in split(a:filetypes, '\.')
+               if has_key(g:did_ft, ft) | continue | endif
+               call s:DefineSnips(a:dir, ft, ft)
+               if ft == 'objc' || ft == 'cpp' || ft == 'cs'
+                       call s:DefineSnips(a:dir, 'c', ft)
+               elseif ft == 'xhtml'
+                       call s:DefineSnips(a:dir, 'html', 'xhtml')
+               endif
+               let g:did_ft[ft] = 1
+       endfor
+endf
+
+" Define "aliasft" snippets for the filetype "realft".
+fun s:DefineSnips(dir, aliasft, realft)
+       for path in split(globpath(a:dir, a:aliasft.'/')."\n".
+                                       \ globpath(a:dir, a:aliasft.'-*/'), "\n")
+               call ExtractSnips(path, a:realft)
+       endfor
+       for path in split(globpath(a:dir, a:aliasft.'.snippets')."\n".
+                                       \ globpath(a:dir, a:aliasft.'-*.snippets'), "\n")
+               call ExtractSnipsFile(path, a:realft)
+       endfor
+endf
+
+fun! TriggerSnippet()
+       if exists('g:SuperTabMappingForward')
+               if g:SuperTabMappingForward == "<tab>"
+                       let SuperTabKey = "\<c-n>"
+               elseif g:SuperTabMappingBackward == "<tab>"
+                       let SuperTabKey = "\<c-p>"
+               endif
+       endif
+
+       if pumvisible() " Update snippet if completion is used, or deal with supertab
+               if exists('SuperTabKey')
+                       call feedkeys(SuperTabKey) | return ''
+               endif
+               call feedkeys("\<esc>a", 'n') " Close completion menu
+               call feedkeys("\<tab>") | return ''
+       endif
+
+       if exists('g:snipPos') | return snipMate#jumpTabStop(0) | endif
+
+       let word = matchstr(getline('.'), '\S\+\%'.col('.').'c')
+       for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
+               let [trigger, snippet] = s:GetSnippet(word, scope)
+               " If word is a trigger for a snippet, delete the trigger & expand
+               " the snippet.
+               if snippet != ''
+                       let col = col('.') - len(trigger)
+                       sil exe 's/\V'.escape(trigger, '/\.').'\%#//'
+                       return snipMate#expandSnip(snippet, col)
+               endif
+       endfor
+
+       if exists('SuperTabKey')
+               call feedkeys(SuperTabKey)
+               return ''
+       endif
+       return "\<tab>"
+endf
+
+fun! BackwardsSnippet()
+       if exists('g:snipPos') | return snipMate#jumpTabStop(1) | endif
+
+       if exists('g:SuperTabMappingForward')
+               if g:SuperTabMappingBackward == "<s-tab>"
+                       let SuperTabKey = "\<c-p>"
+               elseif g:SuperTabMappingForward == "<s-tab>"
+                       let SuperTabKey = "\<c-n>"
+               endif
+       endif
+       if exists('SuperTabKey')
+               call feedkeys(SuperTabKey)
+               return ''
+       endif
+       return "\<s-tab>"
+endf
+
+" Check if word under cursor is snippet trigger; if it isn't, try checking if
+" the text after non-word characters is (e.g. check for "foo" in "bar.foo")
+fun s:GetSnippet(word, scope)
+       let word = a:word | let snippet = ''
+       while snippet == ''
+               if exists('s:snippets["'.a:scope.'"]["'.escape(word, '\"').'"]')
+                       let snippet = s:snippets[a:scope][word]
+               elseif exists('s:multi_snips["'.a:scope.'"]["'.escape(word, '\"').'"]')
+                       let snippet = s:ChooseSnippet(a:scope, word)
+                       if snippet == '' | break | endif
+               else
+                       if match(word, '\W') == -1 | break | endif
+                       let word = substitute(word, '.\{-}\W', '', '')
+               endif
+       endw
+       if word == '' && a:word != '.' && stridx(a:word, '.') != -1
+               let [word, snippet] = s:GetSnippet('.', a:scope)
+       endif
+       return [word, snippet]
+endf
+
+fun s:ChooseSnippet(scope, trigger)
+       let snippet = []
+       let i = 1
+       for snip in s:multi_snips[a:scope][a:trigger]
+               let snippet += [i.'. '.snip[0]]
+               let i += 1
+       endfor
+       if i == 2 | return s:multi_snips[a:scope][a:trigger][0][1] | endif
+       let num = inputlist(snippet) - 1
+       return num == -1 ? '' : s:multi_snips[a:scope][a:trigger][num][1]
+endf
+
+fun! ShowAvailableSnips()
+       let line  = getline('.')
+       let col   = col('.')
+       let word  = matchstr(getline('.'), '\S\+\%'.col.'c')
+       let words = [word]
+       if stridx(word, '.')
+               let words += split(word, '\.', 1)
+       endif
+       let matchlen = 0
+       let matches = []
+       for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
+               let triggers = has_key(s:snippets, scope) ? keys(s:snippets[scope]) : []
+               if has_key(s:multi_snips, scope)
+                       let triggers += keys(s:multi_snips[scope])
+               endif
+               for trigger in triggers
+                       for word in words
+                               if word == ''
+                                       let matches += [trigger] " Show all matches if word is empty
+                               elseif trigger =~ '^'.word
+                                       let matches += [trigger]
+                                       let len = len(word)
+                                       if len > matchlen | let matchlen = len | endif
+                               endif
+                       endfor
+               endfor
+       endfor
+
+       " This is to avoid a bug with Vim when using complete(col - matchlen, matches)
+       " (Issue#46 on the Google Code snipMate issue tracker).
+       call setline(line('.'), substitute(line, repeat('.', matchlen).'\%'.col.'c', '', ''))
+       call complete(col, matches)
+       return ''
+endf
+" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/plugin/supertab.vim b/vim/plugin/supertab.vim
new file mode 100644 (file)
index 0000000..67f8c5c
--- /dev/null
@@ -0,0 +1,737 @@
+" Author:
+"   Original: Gergely Kontra <kgergely@mcl.hu>
+"   Current:  Eric Van Dewoestine <ervandew@gmail.com> (as of version 0.4)
+"   Please direct all correspondence to Eric.
+" Version: 1.6
+" GetLatestVimScripts: 1643 1 :AutoInstall: supertab.vim
+"
+" Description: {{{
+"   Use your tab key to do all your completion in insert mode!
+"   You can cycle forward and backward with the <Tab> and <S-Tab> keys
+"   Note: you must press <Tab> once to be able to cycle back
+"
+"   http://www.vim.org/scripts/script.php?script_id=1643
+" }}}
+"
+" License: {{{
+"   Copyright (c) 2002 - 2011
+"   All rights reserved.
+"
+"   Redistribution and use of this software in source and binary forms, with
+"   or without modification, are permitted provided that the following
+"   conditions are met:
+"
+"   * Redistributions of source code must retain the above
+"     copyright notice, this list of conditions and the
+"     following disclaimer.
+"
+"   * Redistributions in binary form must reproduce the above
+"     copyright notice, this list of conditions and the
+"     following disclaimer in the documentation and/or other
+"     materials provided with the distribution.
+"
+"   * Neither the name of Gergely Kontra or Eric Van Dewoestine nor the names
+"   of its contributors may be used to endorse or promote products derived
+"   from this software without specific prior written permission of Gergely
+"   Kontra or Eric Van Dewoestine.
+"
+"   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+"   IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+"   THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+"   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+"   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+"   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+"   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+"   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+"   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+"   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+"   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+" }}}
+"
+" Testing Info: {{{
+"   Running vim + supertab with the absolute bar minimum settings:
+"     $ vim -u NONE -U NONE -c "set nocp | runtime plugin/supertab.vim"
+" }}}
+
+if v:version < 700
+  finish
+endif
+
+if exists('complType') " Integration with other completion functions.
+  finish
+endif
+
+let s:save_cpo=&cpo
+set cpo&vim
+
+" Global Variables {{{
+
+  if !exists("g:SuperTabDefaultCompletionType")
+    let g:SuperTabDefaultCompletionType = "<c-p>"
+  endif
+
+  if !exists("g:SuperTabContextDefaultCompletionType")
+    let g:SuperTabContextDefaultCompletionType = "<c-p>"
+  endif
+
+  if !exists("g:SuperTabCompletionContexts")
+    let g:SuperTabCompletionContexts = ['s:ContextText']
+  endif
+
+  if !exists("g:SuperTabRetainCompletionDuration")
+    let g:SuperTabRetainCompletionDuration = 'insert'
+  endif
+
+  if !exists("g:SuperTabNoCompleteBefore")
+    " retain backwards compatability
+    if exists("g:SuperTabMidWordCompletion") && !g:SuperTabMidWordCompletion
+      let g:SuperTabNoCompleteBefore = ['\k']
+    else
+      let g:SuperTabNoCompleteBefore = []
+    endif
+  endif
+
+  if !exists("g:SuperTabNoCompleteAfter")
+    " retain backwards compatability
+    if exists("g:SuperTabLeadingSpaceCompletion") && g:SuperTabLeadingSpaceCompletion
+      let g:SuperTabNoCompleteAfter = []
+    else
+      let g:SuperTabNoCompleteAfter = ['\s']
+    endif
+  endif
+
+  if !exists("g:SuperTabMappingForward")
+    let g:SuperTabMappingForward = '<tab>'
+  endif
+  if !exists("g:SuperTabMappingBackward")
+    let g:SuperTabMappingBackward = '<s-tab>'
+  endif
+
+  if !exists("g:SuperTabMappingTabLiteral")
+    let g:SuperTabMappingTabLiteral = '<c-tab>'
+  endif
+
+  if !exists("g:SuperTabLongestEnhanced")
+    let g:SuperTabLongestEnhanced = 0
+  endif
+
+  if !exists("g:SuperTabLongestHighlight")
+    let g:SuperTabLongestHighlight = 0
+  endif
+
+  if !exists("g:SuperTabCrMapping")
+    let g:SuperTabCrMapping = 1
+  endif
+
+" }}}
+
+" Script Variables {{{
+
+  " construct the help text.
+  let s:tabHelp =
+    \ "Hit <CR> or CTRL-] on the completion type you wish to switch to.\n" .
+    \ "Use :help ins-completion for more information.\n" .
+    \ "\n" .
+    \ "|<c-n>|      - Keywords in 'complete' searching down.\n" .
+    \ "|<c-p>|      - Keywords in 'complete' searching up (SuperTab default).\n" .
+    \ "|<c-x><c-l>| - Whole lines.\n" .
+    \ "|<c-x><c-n>| - Keywords in current file.\n" .
+    \ "|<c-x><c-k>| - Keywords in 'dictionary'.\n" .
+    \ "|<c-x><c-t>| - Keywords in 'thesaurus', thesaurus-style.\n" .
+    \ "|<c-x><c-i>| - Keywords in the current and included files.\n" .
+    \ "|<c-x><c-]>| - Tags.\n" .
+    \ "|<c-x><c-f>| - File names.\n" .
+    \ "|<c-x><c-d>| - Definitions or macros.\n" .
+    \ "|<c-x><c-v>| - Vim command-line.\n" .
+    \ "|<c-x><c-u>| - User defined completion.\n" .
+    \ "|<c-x><c-o>| - Omni completion.\n" .
+    \ "|<c-x>s|     - Spelling suggestions."
+
+  " set the available completion types and modes.
+  let s:types =
+    \ "\<c-e>\<c-y>\<c-l>\<c-n>\<c-k>\<c-t>\<c-i>\<c-]>" .
+    \ "\<c-f>\<c-d>\<c-v>\<c-n>\<c-p>\<c-u>\<c-o>\<c-n>\<c-p>s"
+  let s:modes = '/^E/^Y/^L/^N/^K/^T/^I/^]/^F/^D/^V/^P/^U/^O/s'
+  let s:types = s:types . "np"
+  let s:modes = s:modes . '/n/p'
+
+" }}}
+
+" SuperTabSetDefaultCompletionType(type) {{{
+" Globally available function that users can use to set the default
+" completion type for the current buffer, like in an ftplugin.
+function! SuperTabSetDefaultCompletionType(type)
+  " init hack for <c-x><c-v> workaround.
+  let b:complCommandLine = 0
+
+  let b:SuperTabDefaultCompletionType = a:type
+
+  " set the current completion type to the default
+  call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType)
+endfunction " }}}
+
+" SuperTabSetCompletionType(type) {{{
+" Globally available function that users can use to create mappings to quickly
+" switch completion modes.  Useful when a user wants to restore the default or
+" switch to another mode without having to kick off a completion of that type
+" or use SuperTabHelp.  Note, this function only changes the current
+" completion type, not the default, meaning that the default will still be
+" restored once the configured retension duration has been met (see
+" g:SuperTabRetainCompletionDuration).  To change the default for the current
+" buffer, use SuperTabDefaultCompletionType(type) instead.  Example mapping to
+" restore SuperTab default:
+"   nmap <F6> :call SetSuperTabCompletionType("<c-p>")<cr>
+function! SuperTabSetCompletionType(type)
+  call s:InitBuffer()
+  exec "let b:complType = \"" . escape(a:type, '<') . "\""
+endfunction " }}}
+
+" SuperTabAlternateCompletion(type) {{{
+" Function which can be mapped to a key to kick off an alternate completion
+" other than the default.  For instance, if you have 'context' as the default
+" and want to map ctrl+space to issue keyword completion.
+" Note: due to the way vim expands ctrl characters in mappings, you cannot
+" create the alternate mapping like so:
+"    imap <c-space> <c-r>=SuperTabAlternateCompletion("<c-p>")<cr>
+" instead, you have to use \<lt> to prevent vim from expanding the key
+" when creating the mapping.
+"    gvim:
+"      imap <c-space> <c-r>=SuperTabAlternateCompletion("\<lt>c-p>")<cr>
+"    console:
+"      imap <nul> <c-r>=SuperTabAlternateCompletion("\<lt>c-p>")<cr>
+function! SuperTabAlternateCompletion(type)
+  call SuperTabSetCompletionType(a:type)
+  " end any current completion before attempting to start the new one.
+  " use feedkeys to prevent possible remapping of <c-e> from causing issues.
+  "call feedkeys("\<c-e>", 'n')
+  " ^ since we can't detect completion mode vs regular insert mode, we force
+  " vim into keyword completion mode and end that mode to prevent the regular
+  " insert behavior of <c-e> from occurring.
+  call feedkeys("\<c-x>\<c-p>\<c-e>", 'n')
+  call feedkeys(b:complType, 'n')
+  return ''
+endfunction " }}}
+
+" SuperTabLongestHighlight(dir) {{{
+" When longest highlight is enabled, this function is used to do the actual
+" selection of the completion popup entry.
+function! SuperTabLongestHighlight(dir)
+  if !pumvisible()
+    return ''
+  endif
+  return a:dir == -1 ? "\<up>" : "\<down>"
+endfunction " }}}
+
+" s:Init {{{
+" Global initilization when supertab is loaded.
+function! s:Init()
+  " Setup mechanism to restore original completion type upon leaving insert
+  " mode if configured to do so
+  if g:SuperTabRetainCompletionDuration == 'insert'
+    augroup supertab_retain
+      autocmd!
+      autocmd InsertLeave * call s:SetDefaultCompletionType()
+    augroup END
+  endif
+endfunction " }}}
+
+" s:InitBuffer {{{
+" Per buffer initilization.
+function! s:InitBuffer()
+  if exists('b:SuperTabNoCompleteBefore')
+    return
+  endif
+
+  let b:complReset = 0
+  let b:complTypeManual = !exists('b:complTypeManual') ? '' : b:complTypeManual
+  let b:complTypeContext = ''
+
+  " init hack for <c-x><c-v> workaround.
+  let b:complCommandLine = 0
+
+  if !exists('b:SuperTabNoCompleteBefore')
+    let b:SuperTabNoCompleteBefore = g:SuperTabNoCompleteBefore
+  endif
+  if !exists('b:SuperTabNoCompleteAfter')
+    let b:SuperTabNoCompleteAfter = g:SuperTabNoCompleteAfter
+  endif
+
+  let b:SuperTabDefaultCompletionType = g:SuperTabDefaultCompletionType
+
+  " set the current completion type to the default
+  call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType)
+endfunction " }}}
+
+" s:ManualCompletionEnter() {{{
+" Handles manual entrance into completion mode.
+function! s:ManualCompletionEnter()
+  if &smd
+    echo '' | echohl ModeMsg | echo '-- ^X++ mode (' . s:modes . ')' | echohl None
+  endif
+  let complType = nr2char(getchar())
+  if stridx(s:types, complType) != -1
+    if stridx("\<c-e>\<c-y>", complType) != -1 " no memory, just scroll...
+      return "\<c-x>" . complType
+    elseif stridx('np', complType) != -1
+      let complType = nr2char(char2nr(complType) - 96)
+    else
+      let complType = "\<c-x>" . complType
+    endif
+
+    let b:complTypeManual = complType
+
+    if index(['insert', 'session'], g:SuperTabRetainCompletionDuration) != -1
+      let b:complType = complType
+    endif
+
+    " Hack to workaround bug when invoking command line completion via <c-r>=
+    if complType == "\<c-x>\<c-v>"
+      return s:CommandLineCompletion()
+    endif
+
+    " optionally enable enhanced longest completion
+    if g:SuperTabLongestEnhanced && &completeopt =~ 'longest'
+      call s:EnableLongestEnhancement()
+    endif
+
+    if g:SuperTabLongestHighlight &&
+     \ &completeopt =~ 'longest' &&
+     \ &completeopt =~ 'menu' &&
+     \ !pumvisible()
+      let dir = (complType == "\<c-x>\<c-p>") ? -1 : 1
+      call feedkeys("\<c-r>=SuperTabLongestHighlight(" . dir . ")\<cr>", 'n')
+    endif
+
+    return complType
+  endif
+
+  echohl "Unknown mode"
+  return complType
+endfunction " }}}
+
+" s:SetCompletionType() {{{
+" Sets the completion type based on what the user has chosen from the help
+" buffer.
+function! s:SetCompletionType()
+  let chosen = substitute(getline('.'), '.*|\(.*\)|.*', '\1', '')
+  if chosen != getline('.')
+    let winnr = b:winnr
+    close
+    exec winnr . 'winc w'
+    call SuperTabSetCompletionType(chosen)
+  endif
+endfunction " }}}
+
+" s:SetDefaultCompletionType() {{{
+function! s:SetDefaultCompletionType()
+  if exists('b:SuperTabDefaultCompletionType') &&
+  \ (!exists('b:complCommandLine') || !b:complCommandLine)
+    call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType)
+  endif
+endfunction " }}}
+
+" s:SuperTab(command) {{{
+" Used to perform proper cycle navigation as the user requests the next or
+" previous entry in a completion list, and determines whether or not to simply
+" retain the normal usage of <tab> based on the cursor position.
+function! s:SuperTab(command)
+  if exists('b:SuperTabDisabled') && b:SuperTabDisabled
+    return "\<tab>"
+  endif
+
+  call s:InitBuffer()
+
+  if s:WillComplete()
+    " optionally enable enhanced longest completion
+    if g:SuperTabLongestEnhanced && &completeopt =~ 'longest'
+      call s:EnableLongestEnhancement()
+    endif
+
+    if !pumvisible()
+      let b:complTypeManual = ''
+    endif
+
+    " exception: if in <c-p> mode, then <c-n> should move up the list, and
+    " <c-p> down the list.
+    if a:command == 'p' && !b:complReset &&
+      \ (b:complType == "\<c-p>" ||
+      \   (b:complType == 'context' &&
+      \    b:complTypeManual == '' &&
+      \    b:complTypeContext == "\<c-p>"))
+      return "\<c-n>"
+
+    elseif a:command == 'p' && !b:complReset &&
+      \ (b:complType == "\<c-n>" ||
+      \   (b:complType == 'context' &&
+      \    b:complTypeManual == '' &&
+      \    b:complTypeContext == "\<c-n>"))
+      return "\<c-p>"
+
+    " already in completion mode and not resetting for longest enhancement, so
+    " just scroll to next/previous
+    elseif pumvisible() && !b:complReset
+      let type = b:complType == 'context' ? b:complTypeContext : b:complType
+      if a:command == 'n'
+        return type == "\<c-p>" ? "\<c-p>" : "\<c-n>"
+      endif
+      return type == "\<c-p>" ? "\<c-n>" : "\<c-p>"
+    endif
+
+    " handle 'context' completion.
+    if b:complType == 'context'
+      let complType = s:ContextCompletion()
+      if complType == ''
+        exec "let complType = \"" .
+          \ escape(g:SuperTabContextDefaultCompletionType, '<') . "\""
+      endif
+      let b:complTypeContext = complType
+
+    " Hack to workaround bug when invoking command line completion via <c-r>=
+    elseif b:complType == "\<c-x>\<c-v>"
+      let complType = s:CommandLineCompletion()
+    else
+      let complType = b:complType
+    endif
+
+    " highlight first result if longest enabled
+    if g:SuperTabLongestHighlight &&
+     \ &completeopt =~ 'longest' &&
+     \ &completeopt =~ 'menu' &&
+     \ (!pumvisible() || b:complReset)
+      let dir = (complType == "\<c-p>") ? -1 : 1
+      call feedkeys("\<c-r>=SuperTabLongestHighlight(" . dir . ")\<cr>", 'n')
+    endif
+
+    if b:complReset
+      let b:complReset = 0
+      " not an accurate condition for everyone, but better than sending <c-e>
+      " at the wrong time.
+      if pumvisible()
+        return "\<c-e>" . complType
+      endif
+    endif
+
+    return complType
+  endif
+
+  return "\<tab>"
+endfunction " }}}
+
+" s:SuperTabHelp() {{{
+" Opens a help window where the user can choose a completion type to enter.
+function! s:SuperTabHelp()
+  let winnr = winnr()
+  if bufwinnr("SuperTabHelp") == -1
+    botright split SuperTabHelp
+
+    setlocal noswapfile
+    setlocal buftype=nowrite
+    setlocal bufhidden=delete
+
+    let saved = @"
+    let @" = s:tabHelp
+    silent put
+    call cursor(1, 1)
+    silent 1,delete
+    call cursor(4, 1)
+    let @" = saved
+    exec "resize " . line('$')
+
+    syntax match Special "|.\{-}|"
+
+    setlocal readonly
+    setlocal nomodifiable
+
+    nmap <silent> <buffer> <cr> :call <SID>SetCompletionType()<cr>
+    nmap <silent> <buffer> <c-]> :call <SID>SetCompletionType()<cr>
+  else
+    exec bufwinnr("SuperTabHelp") . "winc w"
+  endif
+  let b:winnr = winnr
+endfunction " }}}
+
+" s:WillComplete() {{{
+" Determines if completion should be kicked off at the current location.
+function! s:WillComplete()
+  if pumvisible()
+    return 1
+  endif
+
+  let line = getline('.')
+  let cnum = col('.')
+
+  " Start of line.
+  if line =~ '^\s*\%' . cnum . 'c'
+    return 0
+  endif
+
+  " honor SuperTabNoCompleteAfter
+  let pre = line[:cnum - 2]
+  for pattern in b:SuperTabNoCompleteAfter
+    if pre =~ pattern . '$'
+      return 0
+    endif
+  endfor
+
+  " honor SuperTabNoCompleteBefore
+  " Within a word, but user does not have mid word completion enabled.
+  let post = line[cnum - 1:]
+  for pattern in b:SuperTabNoCompleteBefore
+    if post =~ '^' . pattern
+      return 0
+    endif
+  endfor
+
+  return 1
+endfunction " }}}
+
+" s:EnableLongestEnhancement() {{{
+function! s:EnableLongestEnhancement()
+  augroup supertab_reset
+    autocmd!
+    autocmd InsertLeave,CursorMovedI <buffer>
+      \ call s:ReleaseKeyPresses() | autocmd! supertab_reset
+  augroup END
+  call s:CaptureKeyPresses()
+endfunction " }}}
+
+" s:CompletionReset(char) {{{
+function! s:CompletionReset(char)
+  let b:complReset = 1
+  return a:char
+endfunction " }}}
+
+" s:CaptureKeyPresses() {{{
+function! s:CaptureKeyPresses()
+  if !exists('b:capturing') || !b:capturing
+    let b:capturing = 1
+    " save any previous mappings
+    " TODO: capture additional info provided by vim 7.3.032 and up.
+    let b:captured = {
+        \ '<bs>': maparg('<bs>', 'i'),
+        \ '<c-h>': maparg('<c-h>', 'i'),
+      \ }
+    " TODO: use &keyword to get an accurate list of chars to map
+    for c in split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_', '.\zs')
+      exec 'imap <buffer> ' . c . ' <c-r>=<SID>CompletionReset("' . c . '")<cr>'
+    endfor
+    imap <buffer> <bs> <c-r>=<SID>CompletionReset("\<lt>bs>")<cr>
+    imap <buffer> <c-h> <c-r>=<SID>CompletionReset("\<lt>c-h>")<cr>
+  endif
+endfunction " }}}
+
+" s:ReleaseKeyPresses() {{{
+function! s:ReleaseKeyPresses()
+  if exists('b:capturing') && b:capturing
+    let b:capturing = 0
+    for c in split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_', '.\zs')
+      exec 'iunmap <buffer> ' . c
+    endfor
+
+    iunmap <buffer> <bs>
+    iunmap <buffer> <c-h>
+
+    " restore any previous mappings
+    for [key, rhs] in items(b:captured)
+      if rhs != ''
+        let args = substitute(rhs, '.*\(".\{-}"\).*', '\1', '')
+        if args != rhs
+          let args = substitute(args, '<', '<lt>', 'g')
+          let expr = substitute(rhs, '\(.*\)".\{-}"\(.*\)', '\1%s\2', '')
+          let rhs = printf(expr, args)
+        endif
+        exec printf("imap <silent> %s %s", key, rhs)
+      endif
+    endfor
+    unlet b:captured
+
+    if mode() == 'i' && &completeopt =~ 'menu'
+      " force full exit from completion mode (don't exit insert mode since
+      " that will break repeating with '.')
+      call feedkeys("\<space>\<bs>", 'n')
+    endif
+  endif
+endfunction " }}}
+
+" s:CommandLineCompletion() {{{
+" Hack needed to account for apparent bug in vim command line mode completion
+" when invoked via <c-r>=
+function! s:CommandLineCompletion()
+  " This hack will trigger InsertLeave which will then invoke
+  " s:SetDefaultCompletionType.  To prevent default completion from being
+  " restored prematurely, set an internal flag for s:SetDefaultCompletionType
+  " to check for.
+  let b:complCommandLine = 1
+  return "\<c-\>\<c-o>:call feedkeys('\<c-x>\<c-v>\<c-v>', 'n') | " .
+    \ "let b:complCommandLine = 0\<cr>"
+endfunction " }}}
+
+" s:ContextCompletion() {{{
+function! s:ContextCompletion()
+  let contexts = exists('b:SuperTabCompletionContexts') ?
+    \ b:SuperTabCompletionContexts : g:SuperTabCompletionContexts
+
+  for context in contexts
+    try
+      let Context = function(context)
+      let complType = Context()
+      unlet Context
+      if type(complType) == 1 && complType != ''
+        return complType
+      endif
+    catch /E700/
+      echohl Error
+      echom 'supertab: no context function "' . context . '" found.'
+      echohl None
+    endtry
+  endfor
+  return ''
+endfunction " }}}
+
+" s:ContextDiscover() {{{
+function! s:ContextDiscover()
+  let discovery = exists('g:SuperTabContextDiscoverDiscovery') ?
+    \ g:SuperTabContextDiscoverDiscovery : []
+
+  " loop through discovery list to find the default
+  if !empty(discovery)
+    for pair in discovery
+      let var = substitute(pair, '\(.*\):.*', '\1', '')
+      let type = substitute(pair, '.*:\(.*\)', '\1', '')
+      exec 'let value = ' . var
+      if value !~ '^\s*$' && value != '0'
+        exec "let complType = \"" . escape(type, '<') . "\""
+        return complType
+      endif
+    endfor
+  endif
+endfunction " }}}
+
+" s:ContextText() {{{
+function! s:ContextText()
+  let exclusions = exists('g:SuperTabContextTextFileTypeExclusions') ?
+    \ g:SuperTabContextTextFileTypeExclusions : []
+
+  if index(exclusions, &ft) == -1
+    let curline = getline('.')
+    let cnum = col('.')
+    let synname = synIDattr(synID(line('.'), cnum - 1, 1), 'name')
+    if curline =~ '.*/\w*\%' . cnum . 'c' ||
+      \ ((has('win32') || has('win64')) && curline =~ '.*\\\w*\%' . cnum . 'c')
+      return "\<c-x>\<c-f>"
+
+    elseif curline =~ '.*\(\w\|[\])]\)\(\.\|::\|->\)\w*\%' . cnum . 'c' &&
+      \ synname !~ '\(String\|Comment\)'
+      let omniPrecedence = exists('g:SuperTabContextTextOmniPrecedence') ?
+        \ g:SuperTabContextTextOmniPrecedence : ['&completefunc', '&omnifunc']
+
+      for omniFunc in omniPrecedence
+        if omniFunc !~ '^&'
+          let omniFunc = '&' . omniFunc
+        endif
+        if getbufvar(bufnr('%'), omniFunc) != ''
+          return omniFunc == '&omnifunc' ? "\<c-x>\<c-o>" : "\<c-x>\<c-u>"
+        endif
+      endfor
+    endif
+  endif
+endfunction " }}}
+
+" s:ExpandMap(map) {{{
+function! s:ExpandMap(map)
+  let map = a:map
+  if map =~ '<Plug>'
+    let plug = substitute(map, '.\{-}\(<Plug>\w\+\).*', '\1', '')
+    let plug_map = maparg(plug, 'i')
+    let map = substitute(map, '.\{-}\(<Plug>\w\+\).*', plug_map, '')
+  endif
+  return map
+endfunction " }}}
+
+" Key Mappings {{{
+  " map a regular tab to ctrl-tab (note: doesn't work in console vim)
+  exec 'inoremap ' . g:SuperTabMappingTabLiteral . ' <tab>'
+
+  imap <c-x> <c-r>=<SID>ManualCompletionEnter()<cr>
+
+  imap <script> <Plug>SuperTabForward <c-r>=<SID>SuperTab('n')<cr>
+  imap <script> <Plug>SuperTabBackward <c-r>=<SID>SuperTab('p')<cr>
+
+  exec 'imap ' . g:SuperTabMappingForward . ' <Plug>SuperTabForward'
+  exec 'imap ' . g:SuperTabMappingBackward . ' <Plug>SuperTabBackward'
+
+  " After hitting <Tab>, hitting it once more will go to next match
+  " (because in XIM mode <c-n> and <c-p> mappings are ignored)
+  " and wont start a brand new completion
+  " The side effect, that in the beginning of line <c-n> and <c-p> inserts a
+  " <Tab>, but I hope it may not be a problem...
+  let ctrl_n = maparg('<c-n>', 'i')
+  if ctrl_n != ''
+    let ctrl_n = substitute(ctrl_n, '<', '<lt>', 'g')
+    exec 'imap <c-n> <c-r>=<SID>ForwardBack("n", "' . ctrl_n . '")<cr>'
+  else
+    imap <c-n> <Plug>SuperTabForward
+  endif
+  let ctrl_p = maparg('<c-p>', 'i')
+  if ctrl_p != ''
+    let ctrl_p = substitute(ctrl_p, '<', '<lt>', 'g')
+    exec 'imap <c-p> <c-r>=<SID>ForwardBack("p", "' . ctrl_p . '")<cr>'
+  else
+    imap <c-p> <Plug>SuperTabBackward
+  endif
+  function! s:ForwardBack(command, map)
+    exec "let map = \"" . escape(a:map, '<') . "\""
+    return pumvisible() ? s:SuperTab(a:command) : map
+  endfunction
+
+  if g:SuperTabCrMapping
+    if maparg('<CR>','i') =~ '<CR>'
+      let map = maparg('<cr>', 'i')
+      let cr = (map =~? '\(^\|[^)]\)<cr>')
+      let map = s:ExpandMap(map)
+      exec "inoremap <script> <cr> <c-r>=<SID>SelectCompletion(" . cr . ")<cr>" . map
+    else
+      inoremap <cr> <c-r>=<SID>SelectCompletion(1)<cr>
+    endif
+    function! s:SelectCompletion(cr)
+      " selecting a completion
+      if pumvisible()
+        " ugly hack to let other <cr> mappings for other plugins cooperate
+        " with supertab
+        let b:supertab_pumwasvisible = 1
+        return "\<c-y>"
+      endif
+
+      " only needed when chained with other mappings and one of them will
+      " issue a <cr>.
+      if exists('b:supertab_pumwasvisible') && !a:cr
+        unlet b:supertab_pumwasvisible
+        return ''
+      endif
+
+      " not so pleasant hack to keep <cr> working for abbreviations
+      let word = substitute(getline('.'), '^.*\s\+\(.*\%' . col('.') . 'c\).*', '\1', '')
+      if maparg(word, 'i', 1) != ''
+        call feedkeys("\<c-]>", 't')
+        call feedkeys("\<cr>", 'n')
+        return ''
+      endif
+
+      " only return a cr if nothing else is mapped to it since we don't want
+      " to duplicate a cr returned by another mapping.
+      return a:cr ? "\<cr>" : ""
+    endfunction
+  endif
+" }}}
+
+" Command Mappings {{{
+  if !exists(":SuperTabHelp")
+    command SuperTabHelp :call <SID>SuperTabHelp()
+  endif
+" }}}
+
+call s:Init()
+
+let &cpo = s:save_cpo
+
+" vim:ft=vim:fdm=marker
diff --git a/vim/plugin/surround.vim b/vim/plugin/surround.vim
new file mode 100644 (file)
index 0000000..ea28c02
--- /dev/null
@@ -0,0 +1,625 @@
+" surround.vim - Surroundings
+" Author:       Tim Pope <vimNOSPAM@tpope.org>
+" Version:      1.90
+" GetLatestVimScripts: 1697 1 :AutoInstall: surround.vim
+"
+" See surround.txt for help.  This can be accessed by doing
+"
+" :helptags ~/.vim/doc
+" :help surround
+"
+" Licensed under the same terms as Vim itself.
+
+" ============================================================================
+
+" Exit quickly when:
+" - this plugin was already loaded or disabled
+" - when 'compatible' is set
+if (exists("g:loaded_surround") && g:loaded_surround) || &cp
+  finish
+endif
+let g:loaded_surround = 1
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Input functions {{{1
+
+function! s:getchar()
+  let c = getchar()
+  if c =~ '^\d\+$'
+    let c = nr2char(c)
+  endif
+  return c
+endfunction
+
+function! s:inputtarget()
+  let c = s:getchar()
+  while c =~ '^\d\+$'
+    let c = c . s:getchar()
+  endwhile
+  if c == " "
+    let c = c . s:getchar()
+  endif
+  if c =~ "\<Esc>\|\<C-C>\|\0"
+    return ""
+  else
+    return c
+  endif
+endfunction
+
+function! s:inputreplacement()
+  "echo '-- SURROUND --'
+  let c = s:getchar()
+  if c == " "
+    let c = c . s:getchar()
+  endif
+  if c =~ "\<Esc>" || c =~ "\<C-C>"
+    return ""
+  else
+    return c
+  endif
+endfunction
+
+function! s:beep()
+  exe "norm! \<Esc>"
+  return ""
+endfunction
+
+function! s:redraw()
+  redraw
+  return ""
+endfunction
+
+" }}}1
+
+" Wrapping functions {{{1
+
+function! s:extractbefore(str)
+  if a:str =~ '\r'
+    return matchstr(a:str,'.*\ze\r')
+  else
+    return matchstr(a:str,'.*\ze\n')
+  endif
+endfunction
+
+function! s:extractafter(str)
+  if a:str =~ '\r'
+    return matchstr(a:str,'\r\zs.*')
+  else
+    return matchstr(a:str,'\n\zs.*')
+  endif
+endfunction
+
+function! s:repeat(str,count)
+  let cnt = a:count
+  let str = ""
+  while cnt > 0
+    let str = str . a:str
+    let cnt = cnt - 1
+  endwhile
+  return str
+endfunction
+
+function! s:fixindent(str,spc)
+  let str = substitute(a:str,'\t',s:repeat(' ',&sw),'g')
+  let spc = substitute(a:spc,'\t',s:repeat(' ',&sw),'g')
+  let str = substitute(str,'\(\n\|\%^\).\@=','\1'.spc,'g')
+  if ! &et
+    let str = substitute(str,'\s\{'.&ts.'\}',"\t",'g')
+  endif
+  return str
+endfunction
+
+function! s:process(string)
+  let i = 0
+  while i < 7
+    let i = i + 1
+    let repl_{i} = ''
+    let m = matchstr(a:string,nr2char(i).'.\{-\}\ze'.nr2char(i))
+    if m != ''
+      let m = substitute(strpart(m,1),'\r.*','','')
+      let repl_{i} = input(substitute(m,':\s*$','','').': ')
+    endif
+  endwhile
+  let s = ""
+  let i = 0
+  while i < strlen(a:string)
+    let char = strpart(a:string,i,1)
+    if char2nr(char) < 8
+      let next = stridx(a:string,char,i+1)
+      if next == -1
+        let s = s . char
+      else
+        let insertion = repl_{char2nr(char)}
+        let subs = strpart(a:string,i+1,next-i-1)
+        let subs = matchstr(subs,'\r.*')
+        while subs =~ '^\r.*\r'
+          let sub = matchstr(subs,"^\r\\zs[^\r]*\r[^\r]*")
+          let subs = strpart(subs,strlen(sub)+1)
+          let r = stridx(sub,"\r")
+          let insertion = substitute(insertion,strpart(sub,0,r),strpart(sub,r+1),'')
+        endwhile
+        let s = s . insertion
+        let i = next
+      endif
+    else
+      let s = s . char
+    endif
+    let i = i + 1
+  endwhile
+  return s
+endfunction
+
+function! s:wrap(string,char,type,...)
+  let keeper = a:string
+  let newchar = a:char
+  let type = a:type
+  let linemode = type ==# 'V' ? 1 : 0
+  let special = a:0 ? a:1 : 0
+  let before = ""
+  let after  = ""
+  if type ==# "V"
+    let initspaces = matchstr(keeper,'\%^\s*')
+  else
+    let initspaces = matchstr(getline('.'),'\%^\s*')
+  endif
+  " Duplicate b's are just placeholders (removed)
+  let pairs = "b()B{}r[]a<>"
+  let extraspace = ""
+  if newchar =~ '^ '
+    let newchar = strpart(newchar,1)
+    let extraspace = ' '
+  endif
+  let idx = stridx(pairs,newchar)
+  if newchar == ' '
+    let before = ''
+    let after  = ''
+  elseif exists("b:surround_".char2nr(newchar))
+    let all    = s:process(b:surround_{char2nr(newchar)})
+    let before = s:extractbefore(all)
+    let after  =  s:extractafter(all)
+  elseif exists("g:surround_".char2nr(newchar))
+    let all    = s:process(g:surround_{char2nr(newchar)})
+    let before = s:extractbefore(all)
+    let after  =  s:extractafter(all)
+  elseif newchar ==# "p"
+    let before = "\n"
+    let after  = "\n\n"
+  elseif newchar =~# "[tT\<C-T><,]"
+    let dounmapp = 0
+    let dounmapb = 0
+    if !maparg(">","c")
+      let dounmapb= 1
+      " Hide from AsNeeded
+      exe "cn"."oremap > <CR>"
+    endif
+    let default = ""
+    if newchar ==# "T"
+      if !exists("s:lastdel")
+        let s:lastdel = ""
+      endif
+      let default = matchstr(s:lastdel,'<\zs.\{-\}\ze>')
+    endif
+    let tag = input("<",default)
+    echo "<".substitute(tag,'>*$','>','')
+    if dounmapb
+      silent! cunmap >
+    endif
+    if tag != ""
+      let tag = substitute(tag,'>*$','','')
+      let before = '<'.tag.'>'
+      if tag =~ '/$'
+        let after = ''
+      else
+        let after  = '</'.substitute(tag,' .*','','').'>'
+      endif
+      if newchar == "\<C-T>" || newchar == ","
+        if type ==# "v" || type ==# "V"
+          let before = before . "\n\t"
+        endif
+        if type ==# "v"
+          let after  = "\n". after
+        endif
+      endif
+    endif
+  elseif newchar ==# 'l' || newchar == '\'
+    " LaTeX
+    let env = input('\begin{')
+    let env = '{' . env
+    let env = env . s:closematch(env)
+    echo '\begin'.env
+    if env != ""
+      let before = '\begin'.env
+      let after  = '\end'.matchstr(env,'[^}]*').'}'
+    endif
+    "if type ==# 'v' || type ==# 'V'
+    "let before = before ."\n\t"
+    "endif
+    "if type ==# 'v'
+    "let after  = "\n".initspaces.after
+    "endif
+  elseif newchar ==# 'f' || newchar ==# 'F'
+    let fnc = input('function: ')
+    if fnc != ""
+      let before = substitute(fnc,'($','','').'('
+      let after  = ')'
+      if newchar ==# 'F'
+        let before = before . ' '
+        let after  = ' ' . after
+      endif
+    endif
+  elseif idx >= 0
+    let spc = (idx % 3) == 1 ? " " : ""
+    let idx = idx / 3 * 3
+    let before = strpart(pairs,idx+1,1) . spc
+    let after  = spc . strpart(pairs,idx+2,1)
+  elseif newchar == "\<C-[>" || newchar == "\<C-]>"
+    let before = "{\n\t"
+    let after  = "\n}"
+  elseif newchar !~ '\a'
+    let before = newchar
+    let after  = newchar
+  else
+    let before = ''
+    let after  = ''
+  endif
+  "let before = substitute(before,'\n','\n'.initspaces,'g')
+  let after  = substitute(after ,'\n','\n'.initspaces,'g')
+  "let after  = substitute(after,"\n\\s*\<C-U>\\s*",'\n','g')
+  if type ==# 'V' || (special && type ==# "v")
+    let before = substitute(before,' \+$','','')
+    let after  = substitute(after ,'^ \+','','')
+    if after !~ '^\n'
+      let after  = initspaces.after
+    endif
+    if keeper !~ '\n$' && after !~ '^\n'
+      let keeper = keeper . "\n"
+    elseif keeper =~ '\n$' && after =~ '^\n'
+      let after = strpart(after,1)
+    endif
+    if before !~ '\n\s*$'
+      let before = before . "\n"
+      if special
+        let before = before . "\t"
+      endif
+    endif
+  endif
+  if type ==# 'V'
+    let before = initspaces.before
+  endif
+  if before =~ '\n\s*\%$'
+    if type ==# 'v'
+      let keeper = initspaces.keeper
+    endif
+    let padding = matchstr(before,'\n\zs\s\+\%$')
+    let before  = substitute(before,'\n\s\+\%$','\n','')
+    let keeper = s:fixindent(keeper,padding)
+  endif
+  if type ==# 'V'
+    let keeper = before.keeper.after
+  elseif type =~ "^\<C-V>"
+    " Really we should be iterating over the buffer
+    let repl = substitute(before,'[\\~]','\\&','g').'\1'.substitute(after,'[\\~]','\\&','g')
+    let repl = substitute(repl,'\n',' ','g')
+    let keeper = substitute(keeper."\n",'\(.\{-\}\)\(\n\)',repl.'\n','g')
+    let keeper = substitute(keeper,'\n\%$','','')
+  else
+    let keeper = before.extraspace.keeper.extraspace.after
+  endif
+  return keeper
+endfunction
+
+function! s:wrapreg(reg,char,...)
+  let orig = getreg(a:reg)
+  let type = substitute(getregtype(a:reg),'\d\+$','','')
+  let special = a:0 ? a:1 : 0
+  let new = s:wrap(orig,a:char,type,special)
+  call setreg(a:reg,new,type)
+endfunction
+" }}}1
+
+function! s:insert(...) " {{{1
+  " Optional argument causes the result to appear on 3 lines, not 1
+  "call inputsave()
+  let linemode = a:0 ? a:1 : 0
+  let char = s:inputreplacement()
+  while char == "\<CR>" || char == "\<C-S>"
+    " TODO: use total count for additional blank lines
+    let linemode = linemode + 1
+    let char = s:inputreplacement()
+  endwhile
+  "call inputrestore()
+  if char == ""
+    return ""
+  endif
+  "call inputsave()
+  let cb_save = &clipboard
+  set clipboard-=unnamed
+  let reg_save = @@
+  call setreg('"',"\r",'v')
+  call s:wrapreg('"',char,linemode)
+  " If line mode is used and the surrounding consists solely of a suffix,
+  " remove the initial newline.  This fits a use case of mine but is a
+  " little inconsistent.  Is there anyone that would prefer the simpler
+  " behavior of just inserting the newline?
+  if linemode && match(getreg('"'),'^\n\s*\zs.*') == 0
+    call setreg('"',matchstr(getreg('"'),'^\n\s*\zs.*'),getregtype('"'))
+  endif
+  " This can be used to append a placeholder to the end
+  if exists("g:surround_insert_tail")
+    call setreg('"',g:surround_insert_tail,"a".getregtype('"'))
+  endif
+  "if linemode
+  "call setreg('"',substitute(getreg('"'),'^\s\+','',''),'c')
+  "endif
+  if col('.') >= col('$')
+    norm! ""p
+  else
+    norm! ""P
+  endif
+  if linemode
+    call s:reindent()
+  endif
+  norm! `]
+  call search('\r','bW')
+  let @@ = reg_save
+  let &clipboard = cb_save
+  return "\<Del>"
+endfunction " }}}1
+
+function! s:reindent() " {{{1
+  if exists("b:surround_indent") ? b:surround_indent : (exists("g:surround_indent") && g:surround_indent)
+    silent norm! '[=']
+  endif
+endfunction " }}}1
+
+function! s:dosurround(...) " {{{1
+  let scount = v:count1
+  let char = (a:0 ? a:1 : s:inputtarget())
+  let spc = ""
+  if char =~ '^\d\+'
+    let scount = scount * matchstr(char,'^\d\+')
+    let char = substitute(char,'^\d\+','','')
+  endif
+  if char =~ '^ '
+    let char = strpart(char,1)
+    let spc = 1
+  endif
+  if char == 'a'
+    let char = '>'
+  endif
+  if char == 'r'
+    let char = ']'
+  endif
+  let newchar = ""
+  if a:0 > 1
+    let newchar = a:2
+    if newchar == "\<Esc>" || newchar == "\<C-C>" || newchar == ""
+      return s:beep()
+    endif
+  endif
+  let cb_save = &clipboard
+  set clipboard-=unnamed
+  let append = ""
+  let original = getreg('"')
+  let otype = getregtype('"')
+  call setreg('"',"")
+  let strcount = (scount == 1 ? "" : scount)
+  if char == '/'
+    exe 'norm! '.strcount.'[/d'.strcount.']/'
+  else
+    exe 'norm! d'.strcount.'i'.char
+  endif
+  let keeper = getreg('"')
+  let okeeper = keeper " for reindent below
+  if keeper == ""
+    call setreg('"',original,otype)
+    let &clipboard = cb_save
+    return ""
+  endif
+  let oldline = getline('.')
+  let oldlnum = line('.')
+  if char ==# "p"
+    call setreg('"','','V')
+  elseif char ==# "s" || char ==# "w" || char ==# "W"
+    " Do nothing
+    call setreg('"','')
+  elseif char =~ "[\"'`]"
+    exe "norm! i \<Esc>d2i".char
+    call setreg('"',substitute(getreg('"'),' ','',''))
+  elseif char == '/'
+    norm! "_x
+    call setreg('"','/**/',"c")
+    let keeper = substitute(substitute(keeper,'^/\*\s\=','',''),'\s\=\*$','','')
+  else
+    " One character backwards
+    call search('.','bW')
+    exe "norm! da".char
+  endif
+  let removed = getreg('"')
+  let rem2 = substitute(removed,'\n.*','','')
+  let oldhead = strpart(oldline,0,strlen(oldline)-strlen(rem2))
+  let oldtail = strpart(oldline,  strlen(oldline)-strlen(rem2))
+  let regtype = getregtype('"')
+  if char =~# '[\[({<T]' || spc
+    let keeper = substitute(keeper,'^\s\+','','')
+    let keeper = substitute(keeper,'\s\+$','','')
+  endif
+  if col("']") == col("$") && col('.') + 1 == col('$')
+    if oldhead =~# '^\s*$' && a:0 < 2
+      let keeper = substitute(keeper,'\%^\n'.oldhead.'\(\s*.\{-\}\)\n\s*\%$','\1','')
+    endif
+    let pcmd = "p"
+  else
+    let pcmd = "P"
+  endif
+  if line('.') < oldlnum && regtype ==# "V"
+    let pcmd = "p"
+  endif
+  call setreg('"',keeper,regtype)
+  if newchar != ""
+    call s:wrapreg('"',newchar)
+  endif
+  silent exe 'norm! ""'.pcmd.'`['
+  if removed =~ '\n' || okeeper =~ '\n' || getreg('"') =~ '\n'
+    call s:reindent()
+  endif
+  if getline('.') =~ '^\s\+$' && keeper =~ '^\s*\n'
+    silent norm! cc
+  endif
+  call setreg('"',removed,regtype)
+  let s:lastdel = removed
+  let &clipboard = cb_save
+  if newchar == ""
+    silent! call repeat#set("\<Plug>Dsurround".char,scount)
+  else
+    silent! call repeat#set("\<Plug>Csurround".char.newchar,scount)
+  endif
+endfunction " }}}1
+
+function! s:changesurround() " {{{1
+  let a = s:inputtarget()
+  if a == ""
+    return s:beep()
+  endif
+  let b = s:inputreplacement()
+  if b == ""
+    return s:beep()
+  endif
+  call s:dosurround(a,b)
+endfunction " }}}1
+
+function! s:opfunc(type,...) " {{{1
+  let char = s:inputreplacement()
+  if char == ""
+    return s:beep()
+  endif
+  let reg = '"'
+  let sel_save = &selection
+  let &selection = "inclusive"
+  let cb_save  = &clipboard
+  set clipboard-=unnamed
+  let reg_save = getreg(reg)
+  let reg_type = getregtype(reg)
+  "call setreg(reg,"\n","c")
+  let type = a:type
+  if a:type == "char"
+    silent exe 'norm! v`[o`]"'.reg.'y'
+    let type = 'v'
+  elseif a:type == "line"
+    silent exe 'norm! `[V`]"'.reg.'y'
+    let type = 'V'
+  elseif a:type ==# "v" || a:type ==# "V" || a:type ==# "\<C-V>"
+    let ve = &virtualedit
+    if !(a:0 && a:1)
+      set virtualedit=
+    endif
+    silent exe 'norm! gv"'.reg.'y'
+    let &virtualedit = ve
+  elseif a:type =~ '^\d\+$'
+    let type = 'v'
+    silent exe 'norm! ^v'.a:type.'$h"'.reg.'y'
+    if mode() ==# 'v'
+      norm! v
+      return s:beep()
+    endif
+  else
+    let &selection = sel_save
+    let &clipboard = cb_save
+    return s:beep()
+  endif
+  let keeper = getreg(reg)
+  if type ==# "v" && a:type !=# "v"
+    let append = matchstr(keeper,'\_s\@<!\s*$')
+    let keeper = substitute(keeper,'\_s\@<!\s*$','','')
+  endif
+  call setreg(reg,keeper,type)
+  call s:wrapreg(reg,char,a:0 && a:1)
+  if type ==# "v" && a:type !=# "v" && append != ""
+    call setreg(reg,append,"ac")
+  endif
+  silent exe 'norm! gv'.(reg == '"' ? '' : '"' . reg).'p`['
+  if type ==# 'V' || (getreg(reg) =~ '\n' && type ==# 'v')
+    call s:reindent()
+  endif
+  call setreg(reg,reg_save,reg_type)
+  let &selection = sel_save
+  let &clipboard = cb_save
+  if a:type =~ '^\d\+$'
+    silent! call repeat#set("\<Plug>Y".(a:0 && a:1 ? "S" : "s")."surround".char,a:type)
+  endif
+endfunction
+
+function! s:opfunc2(arg)
+  call s:opfunc(a:arg,1)
+endfunction " }}}1
+
+function! s:closematch(str) " {{{1
+  " Close an open (, {, [, or < on the command line.
+  let tail = matchstr(a:str,'.[^\[\](){}<>]*$')
+  if tail =~ '^\[.\+'
+    return "]"
+  elseif tail =~ '^(.\+'
+    return ")"
+  elseif tail =~ '^{.\+'
+    return "}"
+  elseif tail =~ '^<.+'
+    return ">"
+  else
+    return ""
+  endif
+endfunction " }}}1
+
+nnoremap <silent> <Plug>Dsurround  :<C-U>call <SID>dosurround(<SID>inputtarget())<CR>
+nnoremap <silent> <Plug>Csurround  :<C-U>call <SID>changesurround()<CR>
+nnoremap <silent> <Plug>Yssurround :<C-U>call <SID>opfunc(v:count1)<CR>
+nnoremap <silent> <Plug>YSsurround :<C-U>call <SID>opfunc2(v:count1)<CR>
+" <C-U> discards the numerical argument but there's not much we can do with it
+nnoremap <silent> <Plug>Ysurround  :<C-U>set opfunc=<SID>opfunc<CR>g@
+nnoremap <silent> <Plug>YSurround  :<C-U>set opfunc=<SID>opfunc2<CR>g@
+vnoremap <silent> <Plug>Vsurround  :<C-U>call <SID>opfunc(visualmode())<CR>
+vnoremap <silent> <Plug>VSurround  :<C-U>call <SID>opfunc(visualmode(),visualmode() ==# 'V' ? 1 : 0)<CR>
+vnoremap <silent> <Plug>VgSurround :<C-U>call <SID>opfunc(visualmode(),visualmode() ==# 'V' ? 0 : 1)<CR>
+inoremap <silent> <Plug>Isurround  <C-R>=<SID>insert()<CR>
+inoremap <silent> <Plug>ISurround  <C-R>=<SID>insert(1)<CR>
+
+if !exists("g:surround_no_mappings") || ! g:surround_no_mappings
+  nmap      ds   <Plug>Dsurround
+  nmap      cs   <Plug>Csurround
+  nmap      ys   <Plug>Ysurround
+  nmap      yS   <Plug>YSurround
+  nmap      yss  <Plug>Yssurround
+  nmap      ySs  <Plug>YSsurround
+  nmap      ySS  <Plug>YSsurround
+  if !hasmapto("<Plug>Vsurround","v") && !hasmapto("<Plug>VSurround","v")
+    if exists(":xmap")
+      xmap  s    <Plug>Vsurround
+    else
+      vmap  s    <Plug>Vsurround
+    endif
+  endif
+  if !hasmapto("<Plug>VSurround","v")
+    if exists(":xmap")
+      xmap  S    <Plug>VSurround
+    else
+      vmap  S    <Plug>VSurround
+    endif
+  endif
+  if exists(":xmap")
+    xmap    gS   <Plug>VgSurround
+  else
+    vmap    gS   <Plug>VgSurround
+  endif
+  if !hasmapto("<Plug>Isurround","i") && "" == mapcheck("<C-S>","i")
+    imap    <C-S> <Plug>Isurround
+  endif
+  imap      <C-G>s <Plug>Isurround
+  imap      <C-G>S <Plug>ISurround
+  "Implemented internally instead
+  "imap      <C-S><C-S> <Plug>ISurround
+endif
+
+let &cpo = s:cpo_save
+
+" vim:set ft=vim sw=2 sts=2 et:
diff --git a/vim/plugin/syntastic.vim b/vim/plugin/syntastic.vim
new file mode 100644 (file)
index 0000000..0eb657a
--- /dev/null
@@ -0,0 +1,614 @@
+"============================================================================
+"File:        syntastic.vim
+"Description: vim plugin for on the fly syntax checking
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"Version:     2.3.0
+"Last Change: 16 Feb, 2012
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists("g:loaded_syntastic_plugin")
+    finish
+endif
+let g:loaded_syntastic_plugin = 1
+
+let s:running_windows = has("win16") || has("win32") || has("win64")
+
+if !s:running_windows
+    let s:uname = system('uname')
+endif
+
+if !exists("g:syntastic_enable_signs")
+    let g:syntastic_enable_signs = 1
+endif
+if !has('signs')
+    let g:syntastic_enable_signs = 0
+endif
+
+if !exists("g:syntastic_enable_balloons")
+    let g:syntastic_enable_balloons = 1
+endif
+if !has('balloon_eval')
+    let g:syntastic_enable_balloons = 0
+endif
+
+if !exists("g:syntastic_enable_highlighting")
+    let g:syntastic_enable_highlighting = 1
+endif
+
+if !exists("g:syntastic_echo_current_error")
+    let g:syntastic_echo_current_error = 1
+endif
+
+if !exists("g:syntastic_auto_loc_list")
+    let g:syntastic_auto_loc_list = 2
+endif
+
+if !exists("g:syntastic_auto_jump")
+    let syntastic_auto_jump=0
+endif
+
+if !exists("g:syntastic_quiet_warnings")
+    let g:syntastic_quiet_warnings = 0
+endif
+
+if !exists("g:syntastic_stl_format")
+    let g:syntastic_stl_format = '[Syntax: line:%F (%t)]'
+endif
+
+if !exists("g:syntastic_mode_map")
+    let g:syntastic_mode_map = {}
+endif
+
+if !has_key(g:syntastic_mode_map, "mode")
+    let g:syntastic_mode_map['mode'] = 'active'
+endif
+
+if !has_key(g:syntastic_mode_map, "active_filetypes")
+    let g:syntastic_mode_map['active_filetypes'] = []
+endif
+
+if !has_key(g:syntastic_mode_map, "passive_filetypes")
+    let g:syntastic_mode_map['passive_filetypes'] = []
+endif
+
+if !exists("g:syntastic_check_on_open")
+    let g:syntastic_check_on_open = 0
+endif
+
+if !exists("g:syntastic_loc_list_height")
+    let g:syntastic_loc_list_height = 10
+endif
+
+command! SyntasticToggleMode call s:ToggleMode()
+command! SyntasticCheck call s:UpdateErrors(0) <bar> redraw!
+command! Errors call s:ShowLocList()
+
+highlight link SyntasticError SpellBad
+highlight link SyntasticWarning SpellCap
+
+augroup syntastic
+    if g:syntastic_echo_current_error
+        autocmd cursormoved * call s:EchoCurrentError()
+    endif
+
+    autocmd BufReadPost * if g:syntastic_check_on_open | call s:UpdateErrors(1) | endif
+    autocmd BufWritePost * call s:UpdateErrors(1)
+
+    autocmd BufWinEnter * if empty(&bt) | call s:AutoToggleLocList() | endif
+    autocmd BufWinLeave * if empty(&bt) | lclose | endif
+augroup END
+
+
+"refresh and redraw all the error info for this buf when saving or reading
+function! s:UpdateErrors(auto_invoked)
+    if !empty(&buftype)
+        return
+    endif
+
+    if !a:auto_invoked || s:ModeMapAllowsAutoChecking()
+        call s:CacheErrors()
+    end
+
+    if s:BufHasErrorsOrWarningsToDisplay()
+        call setloclist(0, s:LocList())
+    endif
+
+    if g:syntastic_enable_balloons
+        call s:RefreshBalloons()
+    endif
+
+    if g:syntastic_enable_signs
+        call s:RefreshSigns()
+    endif
+
+    if g:syntastic_auto_jump && s:BufHasErrorsOrWarningsToDisplay()
+        silent! ll
+    endif
+
+    call s:AutoToggleLocList()
+endfunction
+
+"automatically open/close the location list window depending on the users
+"config and buffer error state
+function! s:AutoToggleLocList()
+    if s:BufHasErrorsOrWarningsToDisplay()
+        if g:syntastic_auto_loc_list == 1
+            call s:ShowLocList()
+        endif
+    else
+        if g:syntastic_auto_loc_list > 0
+
+            "TODO: this will close the loc list window if one was opened by
+            "something other than syntastic
+            lclose
+        endif
+    endif
+endfunction
+
+"lazy init the loc list for the current buffer
+function! s:LocList()
+    if !exists("b:syntastic_loclist")
+        let b:syntastic_loclist = []
+    endif
+    return b:syntastic_loclist
+endfunction
+
+"clear the loc list for the buffer
+function! s:ClearLocList()
+    let b:syntastic_loclist = []
+endfunction
+
+"detect and cache all syntax errors in this buffer
+"
+"depends on a function called SyntaxCheckers_{&ft}_GetLocList() existing
+"elsewhere
+function! s:CacheErrors()
+    call s:ClearLocList()
+
+    if filereadable(expand("%"))
+
+        "sub - for _ in filetypes otherwise we cant name syntax checker
+        "functions legally for filetypes like "gentoo-metadata"
+        let fts = substitute(&ft, '-', '_', 'g')
+        for ft in split(fts, '\.')
+            if s:Checkable(ft)
+                let errors = SyntaxCheckers_{ft}_GetLocList()
+                "make errors have type "E" by default
+                call SyntasticAddToErrors(errors, {'type': 'E'})
+                call extend(s:LocList(), errors)
+            endif
+        endfor
+    endif
+endfunction
+
+"toggle the g:syntastic_mode_map['mode']
+function! s:ToggleMode()
+    if g:syntastic_mode_map['mode'] == "active"
+        let g:syntastic_mode_map['mode'] = "passive"
+    else
+        let g:syntastic_mode_map['mode'] = "active"
+    endif
+
+    call s:ClearLocList()
+    call s:UpdateErrors(1)
+
+    echo "Syntastic: " . g:syntastic_mode_map['mode'] . " mode enabled"
+endfunction
+
+"check the current filetypes against g:syntastic_mode_map to determine whether
+"active mode syntax checking should be done
+function! s:ModeMapAllowsAutoChecking()
+    let fts = split(&ft, '\.')
+
+    if g:syntastic_mode_map['mode'] == 'passive'
+        "check at least one filetype is active
+        let actives = g:syntastic_mode_map["active_filetypes"]
+        return !empty(filter(fts, 'index(actives, v:val) != -1'))
+    else
+        "check no filetypes are passive
+        let passives = g:syntastic_mode_map["passive_filetypes"]
+        return empty(filter(fts, 'index(passives, v:val) != -1'))
+    endif
+endfunction
+
+"return true if there are cached errors/warnings for this buf
+function! s:BufHasErrorsOrWarnings()
+    return !empty(s:LocList())
+endfunction
+
+"return true if there are cached errors for this buf
+function! s:BufHasErrors()
+    return len(s:ErrorsForType('E')) > 0
+endfunction
+
+function! s:BufHasErrorsOrWarningsToDisplay()
+    return s:BufHasErrors() || (!g:syntastic_quiet_warnings && s:BufHasErrorsOrWarnings())
+endfunction
+
+function! s:ErrorsForType(type)
+    return s:FilterLocList({'type': a:type})
+endfunction
+
+function! s:Errors()
+    return s:ErrorsForType("E")
+endfunction
+
+function! s:Warnings()
+    return s:ErrorsForType("W")
+endfunction
+
+"Filter a loc list (defaults to s:LocList()) by a:filters
+"e.g.
+"  s:FilterLocList({'bufnr': 10, 'type': 'e'})
+"
+"would return all errors in s:LocList() for buffer 10.
+"
+"Note that all comparisons are done with ==?
+function! s:FilterLocList(filters, ...)
+    let llist = a:0 ? a:1 : s:LocList()
+
+    let rv = deepcopy(llist)
+    for error in llist
+        for key in keys(a:filters)
+            let rhs = a:filters[key]
+            if type(rhs) == 1 "string
+                let rhs = '"' . rhs . '"'
+            endif
+
+            call filter(rv, "v:val['".key."'] ==? " . rhs)
+        endfor
+    endfor
+    return rv
+endfunction
+
+if g:syntastic_enable_signs
+    "define the signs used to display syntax and style errors/warns
+    sign define SyntasticError text=>> texthl=error
+    sign define SyntasticWarning text=>> texthl=todo
+    sign define SyntasticStyleError text=S> texthl=error
+    sign define SyntasticStyleWarning text=S> texthl=todo
+endif
+
+"start counting sign ids at 5000, start here to hopefully avoid conflicting
+"with any other code that places signs (not sure if this precaution is
+"actually needed)
+let s:first_sign_id = 5000
+let s:next_sign_id = s:first_sign_id
+
+"place signs by all syntax errs in the buffer
+function! s:SignErrors()
+    if s:BufHasErrorsOrWarningsToDisplay()
+
+        let errors = s:FilterLocList({'bufnr': bufnr('')})
+        for i in errors
+            let sign_severity = 'Error'
+            let sign_subtype = ''
+            if has_key(i,'subtype')
+                let sign_subtype = i['subtype']
+            endif
+            if i['type'] ==? 'w'
+                let sign_severity = 'Warning'
+            endif
+            let sign_type = 'Syntastic' . sign_subtype . sign_severity
+
+            if !s:WarningMasksError(i, errors)
+                exec "sign place ". s:next_sign_id ." line=". i['lnum'] ." name=". sign_type ." file=". expand("%:p")
+                call add(s:BufSignIds(), s:next_sign_id)
+                let s:next_sign_id += 1
+            endif
+        endfor
+    endif
+endfunction
+
+"return true if the given error item is a warning that, if signed, would
+"potentially mask an error if displayed at the same time
+function! s:WarningMasksError(error, llist)
+    if a:error['type'] !=? 'w'
+        return 0
+    endif
+
+    return len(s:FilterLocList({ 'type': "E", 'lnum': a:error['lnum'] }, a:llist)) > 0
+endfunction
+
+"remove the signs with the given ids from this buffer
+function! s:RemoveSigns(ids)
+    for i in a:ids
+        exec "sign unplace " . i
+        call remove(s:BufSignIds(), index(s:BufSignIds(), i))
+    endfor
+endfunction
+
+"get all the ids of the SyntaxError signs in the buffer
+function! s:BufSignIds()
+    if !exists("b:syntastic_sign_ids")
+        let b:syntastic_sign_ids = []
+    endif
+    return b:syntastic_sign_ids
+endfunction
+
+"update the error signs
+function! s:RefreshSigns()
+    let old_signs = copy(s:BufSignIds())
+    call s:SignErrors()
+    call s:RemoveSigns(old_signs)
+    let s:first_sign_id = s:next_sign_id
+endfunction
+
+"display the cached errors for this buf in the location list
+function! s:ShowLocList()
+    if !empty(s:LocList())
+        let num = winnr()
+        exec "lopen " . g:syntastic_loc_list_height
+        if num != winnr()
+            wincmd p
+        endif
+    endif
+endfunction
+
+"remove all error highlights from the window
+function! s:ClearErrorHighlights()
+    for match in getmatches()
+        if stridx(match['group'], 'Syntastic') == 0
+            call matchdelete(match['id'])
+        endif
+    endfor
+endfunction
+
+"check if a syntax checker exists for the given filetype - and attempt to
+"load one
+function! s:Checkable(ft)
+    if !exists("g:loaded_" . a:ft . "_syntax_checker")
+        exec "runtime syntax_checkers/" . a:ft . ".vim"
+    endif
+
+    return exists("*SyntaxCheckers_". a:ft ."_GetLocList")
+endfunction
+
+"set up error ballons for the current set of errors
+function! s:RefreshBalloons()
+    let b:syntastic_balloons = {}
+    if s:BufHasErrorsOrWarningsToDisplay()
+        for i in s:LocList()
+            let b:syntastic_balloons[i['lnum']] = i['text']
+        endfor
+        set beval bexpr=SyntasticErrorBalloonExpr()
+    endif
+endfunction
+
+"print as much of a:msg as possible without "Press Enter" prompt appearing
+function! s:WideMsg(msg)
+    let old_ruler = &ruler
+    let old_showcmd = &showcmd
+
+    let msg = strpart(a:msg, 0, winwidth(0)-1)
+
+    "This is here because it is possible for some error messages to begin with
+    "\n which will cause a "press enter" prompt. I have noticed this in the
+    "javascript:jshint checker and have been unable to figure out why it
+    "happens
+    let msg = substitute(msg, "\n", "", "g")
+
+    set noruler noshowcmd
+    redraw
+
+    echo msg
+
+    let &ruler=old_ruler
+    let &showcmd=old_showcmd
+endfunction
+
+"echo out the first error we find for the current line in the cmd window
+function! s:EchoCurrentError()
+    "If we have an error or warning at the current line, show it
+    let errors = s:FilterLocList({'lnum': line("."), "type": 'e'})
+    let warnings = s:FilterLocList({'lnum': line("."), "type": 'w'})
+
+    let b:syntastic_echoing_error = len(errors) || len(warnings)
+    if len(errors)
+        return s:WideMsg(errors[0]['text'])
+    endif
+    if len(warnings)
+        return s:WideMsg(warnings[0]['text'])
+    endif
+
+    "Otherwise, clear the status line
+    if b:syntastic_echoing_error
+        echo
+        let b:syntastic_echoing_error = 0
+    endif
+endfunction
+
+"load the chosen checker for the current filetype - useful for filetypes like
+"javascript that have more than one syntax checker
+function! s:LoadChecker(checker)
+    exec "runtime syntax_checkers/" . &ft . "/" . a:checker . ".vim"
+endfunction
+
+"return a string representing the state of buffer according to
+"g:syntastic_stl_format
+"
+"return '' if no errors are cached for the buffer
+function! SyntasticStatuslineFlag()
+    if s:BufHasErrorsOrWarningsToDisplay()
+        let errors = s:Errors()
+        let warnings = s:Warnings()
+
+        let output = g:syntastic_stl_format
+
+        "hide stuff wrapped in %E(...) unless there are errors
+        let output = substitute(output, '\C%E{\([^}]*\)}', len(errors) ? '\1' : '' , 'g')
+
+        "hide stuff wrapped in %W(...) unless there are warnings
+        let output = substitute(output, '\C%W{\([^}]*\)}', len(warnings) ? '\1' : '' , 'g')
+
+        "hide stuff wrapped in %B(...) unless there are both errors and warnings
+        let output = substitute(output, '\C%B{\([^}]*\)}', (len(warnings) && len(errors)) ? '\1' : '' , 'g')
+
+        "sub in the total errors/warnings/both
+        let output = substitute(output, '\C%w', len(warnings), 'g')
+        let output = substitute(output, '\C%e', len(errors), 'g')
+        let output = substitute(output, '\C%t', len(s:LocList()), 'g')
+
+        "first error/warning line num
+        let output = substitute(output, '\C%F', s:LocList()[0]['lnum'], 'g')
+
+        "first error line num
+        let output = substitute(output, '\C%fe', len(errors) ? errors[0]['lnum'] : '', 'g')
+
+        "first warning line num
+        let output = substitute(output, '\C%fw', len(warnings) ? warnings[0]['lnum'] : '', 'g')
+
+        return output
+    else
+        return ''
+    endif
+endfunction
+
+"A wrapper for the :lmake command. Sets up the make environment according to
+"the options given, runs make, resets the environment, returns the location
+"list
+"
+"a:options can contain the following keys:
+"    'makeprg'
+"    'errorformat'
+"
+"The corresponding options are set for the duration of the function call. They
+"are set with :let, so dont escape spaces.
+"
+"a:options may also contain:
+"   'defaults' - a dict containing default values for the returned errors
+"   'subtype' - all errors will be assigned the given subtype
+function! SyntasticMake(options)
+    let old_loclist = getloclist(0)
+    let old_makeprg = &makeprg
+    let old_shellpipe = &shellpipe
+    let old_shell = &shell
+    let old_errorformat = &errorformat
+
+    if !s:running_windows && (s:uname !~ "FreeBSD")
+        "this is a hack to stop the screen needing to be ':redraw'n when
+        "when :lmake is run. Otherwise the screen flickers annoyingly
+        let &shellpipe='&>'
+        let &shell = '/bin/bash'
+    endif
+
+    if has_key(a:options, 'makeprg')
+        let &makeprg = a:options['makeprg']
+    endif
+
+    if has_key(a:options, 'errorformat')
+        let &errorformat = a:options['errorformat']
+    endif
+
+    silent lmake!
+    let errors = getloclist(0)
+
+    call setloclist(0, old_loclist)
+    let &makeprg = old_makeprg
+    let &errorformat = old_errorformat
+    let &shellpipe=old_shellpipe
+    let &shell=old_shell
+
+    if !s:running_windows && s:uname =~ "FreeBSD"
+        redraw!
+    endif
+
+    if has_key(a:options, 'defaults')
+        call SyntasticAddToErrors(errors, a:options['defaults'])
+    endif
+
+    " Add subtype info if present.
+    if has_key(a:options, 'subtype')
+        call SyntasticAddToErrors(errors, {'subtype': a:options['subtype']})
+    endif
+
+    return errors
+endfunction
+
+"get the error balloon for the current mouse position
+function! SyntasticErrorBalloonExpr()
+    if !exists('b:syntastic_balloons')
+        return ''
+    endif
+    return get(b:syntastic_balloons, v:beval_lnum, '')
+endfunction
+
+"highlight the list of errors (a:errors) using matchadd()
+"
+"a:termfunc is provided to highlight errors that do not have a 'col' key (and
+"hence cant be done automatically). This function must take one arg (an error
+"item) and return a regex to match that item in the buffer.
+"
+"an optional boolean third argument can be provided to force a:termfunc to be
+"used regardless of whether a 'col' key is present for the error
+function! SyntasticHighlightErrors(errors, termfunc, ...)
+    if !g:syntastic_enable_highlighting
+        return
+    endif
+
+    call s:ClearErrorHighlights()
+
+    let force_callback = a:0 && a:1
+    for item in a:errors
+        let group = item['type'] == 'E' ? 'SyntasticError' : 'SyntasticWarning'
+        if item['col'] && !force_callback
+            let lastcol = col([item['lnum'], '$'])
+            let lcol = min([lastcol, item['col']])
+            call matchadd(group, '\%'.item['lnum'].'l\%'.lcol.'c')
+        else
+            let term = a:termfunc(item)
+            if len(term) > 0
+                call matchadd(group, '\%' . item['lnum'] . 'l' . term)
+            endif
+        endif
+    endfor
+endfunction
+
+"take a list of errors and add default values to them from a:options
+function! SyntasticAddToErrors(errors, options)
+    for i in range(0, len(a:errors)-1)
+        for key in keys(a:options)
+            if !has_key(a:errors[i], key) || empty(a:errors[i][key])
+                let a:errors[i][key] = a:options[key]
+            endif
+        endfor
+    endfor
+    return a:errors
+endfunction
+
+"take a list of syntax checkers for the current filetype and load the right
+"one based on the global settings and checker executable availabity
+"
+"a:checkers should be a list of syntax checker names. These names are assumed
+"to be the names of the vim syntax checker files that should be sourced, as
+"well as the names of the actual syntax checker executables. The checkers
+"should be listed in order of default preference.
+"
+"if a option called 'g:syntastic_[filetype]_checker' exists then attempt to
+"load the checker that it points to
+function! SyntasticLoadChecker(checkers)
+    let opt_name = "g:syntastic_" . &ft . "_checker"
+
+    if exists(opt_name)
+        let opt_val = {opt_name}
+        if index(a:checkers, opt_val) != -1 && executable(opt_val)
+            call s:LoadChecker(opt_val)
+        else
+            echoerr &ft . " syntax not supported or not installed."
+        endif
+    else
+        for checker in a:checkers
+            if executable(checker)
+                return s:LoadChecker(checker)
+            endif
+        endfor
+    endif
+endfunction
+
+" vim: set et sts=4 sw=4:
diff --git a/vim/plugin/tagbar.vim b/vim/plugin/tagbar.vim
new file mode 100644 (file)
index 0000000..a078a18
--- /dev/null
@@ -0,0 +1,118 @@
+" ============================================================================
+" File:        tagbar.vim
+" Description: List the current file's tags in a sidebar, ordered by class etc
+" Author:      Jan Larres <jan@majutsushi.net>
+" Licence:     Vim licence
+" Website:     http://majutsushi.github.com/tagbar/
+" Version:     2.3
+" Note:        This plugin was heavily inspired by the 'Taglist' plugin by
+"              Yegappan Lakshmanan and uses a small amount of code from it.
+"
+" Original taglist copyright notice:
+"              Permission is hereby granted to use and distribute this code,
+"              with or without modifications, provided that this copyright
+"              notice is copied with it. Like anything else that's free,
+"              taglist.vim is provided *as is* and comes with no warranty of
+"              any kind, either expressed or implied. In no event will the
+"              copyright holder be liable for any damamges resulting from the
+"              use of this software.
+" ============================================================================
+
+scriptencoding utf-8
+
+if &cp || exists('g:loaded_tagbar')
+    finish
+endif
+
+" Basic init {{{1
+
+if v:version < 700
+    echohl WarningMsg
+    echomsg 'Tagbar: Vim version is too old, Tagbar requires at least 7.0'
+    echohl None
+    finish
+endif
+
+if v:version == 700 && !has('patch167')
+    echohl WarningMsg
+    echomsg 'Tagbar: Vim versions lower than 7.0.167 have a bug'
+          \ 'that prevents this version of Tagbar from working.'
+          \ 'Please use the alternate version posted on the website.'
+    echohl None
+    finish
+endif
+
+if !exists('g:tagbar_left')
+    let g:tagbar_left = 0
+endif
+
+if !exists('g:tagbar_width')
+    let g:tagbar_width = 40
+endif
+
+if !exists('g:tagbar_autoclose')
+    let g:tagbar_autoclose = 0
+endif
+
+if !exists('g:tagbar_autofocus')
+    let g:tagbar_autofocus = 0
+endif
+
+if !exists('g:tagbar_sort')
+    let g:tagbar_sort = 1
+endif
+
+if !exists('g:tagbar_compact')
+    let g:tagbar_compact = 0
+endif
+
+if !exists('g:tagbar_expand')
+    let g:tagbar_expand = 0
+endif
+
+if !exists('g:tagbar_singleclick')
+    let g:tagbar_singleclick = 0
+endif
+
+if !exists('g:tagbar_foldlevel')
+    let g:tagbar_foldlevel = 99
+endif
+
+if !exists('g:tagbar_iconchars')
+    if has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
+     \ (empty(&termencoding) || &termencoding == 'utf-8')
+        let g:tagbar_iconchars = ['โ–ถ', 'โ–ผ']
+    else
+        let g:tagbar_iconchars = ['+', '-']
+    endif
+endif
+
+if !exists('g:tagbar_autoshowtag')
+    let g:tagbar_autoshowtag = 0
+endif
+
+if !exists('g:tagbar_updateonsave_maxlines')
+    let g:tagbar_updateonsave_maxlines = 5000
+endif
+
+if !exists('g:tagbar_systemenc')
+    let g:tagbar_systemenc = &encoding
+endif
+
+augroup TagbarSession
+    autocmd!
+    autocmd SessionLoadPost * nested call tagbar#RestoreSession()
+augroup END
+
+" Commands {{{1
+command! -nargs=0 TagbarToggle        call tagbar#ToggleWindow()
+command! -nargs=? TagbarOpen          call tagbar#OpenWindow(<f-args>)
+command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fc')
+command! -nargs=0 TagbarClose         call tagbar#CloseWindow()
+command! -nargs=1 TagbarSetFoldlevel  call tagbar#SetFoldLevel(<args>)
+command! -nargs=0 TagbarShowTag       call tagbar#OpenParents()
+command! -nargs=? TagbarDebug         call tagbar#StartDebug(<f-args>)
+command! -nargs=0 TagbarDebugEnd      call tagbar#StopDebug()
+
+" Modeline {{{1
+" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
diff --git a/vim/plugin/taglist.vim b/vim/plugin/taglist.vim
new file mode 100644 (file)
index 0000000..59901f6
--- /dev/null
@@ -0,0 +1,4546 @@
+" File: taglist.vim
+" Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
+" Version: 4.5
+" Last Modified: September 21, 2007
+" Copyright: Copyright (C) 2002-2007 Yegappan Lakshmanan
+"            Permission is hereby granted to use and distribute this code,
+"            with or without modifications, provided that this copyright
+"            notice is copied with it. Like anything else that's free,
+"            taglist.vim is provided *as is* and comes with no warranty of any
+"            kind, either expressed or implied. In no event will the copyright
+"            holder be liable for any damamges resulting from the use of this
+"            software.
+"
+" The "Tag List" plugin is a source code browser plugin for Vim and provides
+" an overview of the structure of the programming language files and allows
+" you to efficiently browse through source code files for different
+" programming languages.  You can visit the taglist plugin home page for more
+" information:
+"
+"       http://vim-taglist.sourceforge.net
+"
+" You can subscribe to the taglist mailing list to post your questions
+" or suggestions for improvement or to report bugs. Visit the following
+" page for subscribing to the mailing list:
+"
+"       http://groups.yahoo.com/group/taglist/
+"
+" For more information about using this plugin, after installing the
+" taglist plugin, use the ":help taglist" command.
+"
+" Installation
+" ------------
+" 1. Download the taglist.zip file and unzip the files to the $HOME/.vim
+"    or the $HOME/vimfiles or the $VIM/vimfiles directory. This should
+"    unzip the following two files (the directory structure should be
+"    preserved):
+"
+"       plugin/taglist.vim - main taglist plugin file
+"       doc/taglist.txt    - documentation (help) file
+"
+"    Refer to the 'add-plugin', 'add-global-plugin' and 'runtimepath'
+"    Vim help pages for more details about installing Vim plugins.
+" 2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or
+"    $VIM/vimfiles/doc directory, start Vim and run the ":helptags ."
+"    command to process the taglist help file.
+" 3. If the exuberant ctags utility is not present in your PATH, then set the
+"    Tlist_Ctags_Cmd variable to point to the location of the exuberant ctags
+"    utility (not to the directory) in the .vimrc file.
+" 4. If you are running a terminal/console version of Vim and the
+"    terminal doesn't support changing the window width then set the
+"    'Tlist_Inc_Winwidth' variable to 0 in the .vimrc file.
+" 5. Restart Vim.
+" 6. You can now use the ":TlistToggle" command to open/close the taglist
+"    window. You can use the ":help taglist" command to get more
+"    information about using the taglist plugin.
+"
+" ****************** Do not modify after this line ************************
+
+" Line continuation used here
+let s:cpo_save = &cpo
+set cpo&vim
+
+if !exists('loaded_taglist')
+    " First time loading the taglist plugin
+    "
+    " To speed up the loading of Vim, the taglist plugin uses autoload
+    " mechanism to load the taglist functions.
+    " Only define the configuration variables, user commands and some
+    " auto-commands and finish sourcing the file
+
+    " The taglist plugin requires the built-in Vim system() function. If this
+    " function is not available, then don't load the plugin.
+    if !exists('*system')
+        echomsg 'Taglist: Vim system() built-in function is not available. ' .
+                    \ 'Plugin is not loaded.'
+        let loaded_taglist = 'no'
+        let &cpo = s:cpo_save
+        finish
+    endif
+
+    " Location of the exuberant ctags tool
+    if !exists('Tlist_Ctags_Cmd')
+        if executable('exuberant-ctags')
+            " On Debian Linux, exuberant ctags is installed
+            " as exuberant-ctags
+            let Tlist_Ctags_Cmd = 'exuberant-ctags'
+        elseif executable('exctags')
+            " On Free-BSD, exuberant ctags is installed as exctags
+            let Tlist_Ctags_Cmd = 'exctags'
+        elseif executable('ctags')
+            let Tlist_Ctags_Cmd = 'ctags'
+        elseif executable('ctags.exe')
+            let Tlist_Ctags_Cmd = 'ctags.exe'
+        elseif executable('tags')
+            let Tlist_Ctags_Cmd = 'tags'
+        else
+            echomsg 'Taglist: Exuberant ctags (http://ctags.sf.net) ' .
+                        \ 'not found in PATH. Plugin is not loaded.'
+            " Skip loading the plugin
+            let loaded_taglist = 'no'
+            let &cpo = s:cpo_save
+            finish
+        endif
+    endif
+
+
+    " Automatically open the taglist window on Vim startup
+    if !exists('Tlist_Auto_Open')
+        let Tlist_Auto_Open = 0
+    endif
+
+    " When the taglist window is toggle opened, move the cursor to the
+    " taglist window
+    if !exists('Tlist_GainFocus_On_ToggleOpen')
+        let Tlist_GainFocus_On_ToggleOpen = 0
+    endif
+
+    " Process files even when the taglist window is not open
+    if !exists('Tlist_Process_File_Always')
+        let Tlist_Process_File_Always = 0
+    endif
+
+    if !exists('Tlist_Show_Menu')
+        let Tlist_Show_Menu = 0
+    endif
+
+    " Tag listing sort type - 'name' or 'order'
+    if !exists('Tlist_Sort_Type')
+        let Tlist_Sort_Type = 'order'
+    endif
+
+    " Tag listing window split (horizontal/vertical) control
+    if !exists('Tlist_Use_Horiz_Window')
+        let Tlist_Use_Horiz_Window = 0
+    endif
+
+    " Open the vertically split taglist window on the left or on the right
+    " side.  This setting is relevant only if Tlist_Use_Horiz_Window is set to
+    " zero (i.e.  only for vertically split windows)
+    if !exists('Tlist_Use_Right_Window')
+        let Tlist_Use_Right_Window = 0
+    endif
+
+    " Increase Vim window width to display vertically split taglist window.
+    " For MS-Windows version of Vim running in a MS-DOS window, this must be
+    " set to 0 otherwise the system may hang due to a Vim limitation.
+    if !exists('Tlist_Inc_Winwidth')
+        if (has('win16') || has('win95')) && !has('gui_running')
+            let Tlist_Inc_Winwidth = 0
+        else
+            let Tlist_Inc_Winwidth = 1
+        endif
+    endif
+
+    " Vertically split taglist window width setting
+    if !exists('Tlist_WinWidth')
+        let Tlist_WinWidth = 30
+    endif
+
+    " Horizontally split taglist window height setting
+    if !exists('Tlist_WinHeight')
+        let Tlist_WinHeight = 10
+    endif
+
+    " Display tag prototypes or tag names in the taglist window
+    if !exists('Tlist_Display_Prototype')
+        let Tlist_Display_Prototype = 0
+    endif
+
+    " Display tag scopes in the taglist window
+    if !exists('Tlist_Display_Tag_Scope')
+        let Tlist_Display_Tag_Scope = 1
+    endif
+
+    " Use single left mouse click to jump to a tag. By default this is disabled.
+    " Only double click using the mouse will be processed.
+    if !exists('Tlist_Use_SingleClick')
+        let Tlist_Use_SingleClick = 0
+    endif
+
+    " Control whether additional help is displayed as part of the taglist or
+    " not.  Also, controls whether empty lines are used to separate the tag
+    " tree.
+    if !exists('Tlist_Compact_Format')
+        let Tlist_Compact_Format = 0
+    endif
+
+    " Exit Vim if only the taglist window is currently open. By default, this is
+    " set to zero.
+    if !exists('Tlist_Exit_OnlyWindow')
+        let Tlist_Exit_OnlyWindow = 0
+    endif
+
+    " Automatically close the folds for the non-active files in the taglist
+    " window
+    if !exists('Tlist_File_Fold_Auto_Close')
+        let Tlist_File_Fold_Auto_Close = 0
+    endif
+
+    " Close the taglist window when a tag is selected
+    if !exists('Tlist_Close_On_Select')
+        let Tlist_Close_On_Select = 0
+    endif
+
+    " Automatically update the taglist window to display tags for newly
+    " edited files
+    if !exists('Tlist_Auto_Update')
+        let Tlist_Auto_Update = 1
+    endif
+
+    " Automatically highlight the current tag
+    if !exists('Tlist_Auto_Highlight_Tag')
+        let Tlist_Auto_Highlight_Tag = 1
+    endif
+    
+    " Automatically highlight the current tag on entering a buffer
+    if !exists('Tlist_Highlight_Tag_On_BufEnter')
+        let Tlist_Highlight_Tag_On_BufEnter = 1
+    endif
+
+    " Enable fold column to display the folding for the tag tree
+    if !exists('Tlist_Enable_Fold_Column')
+        let Tlist_Enable_Fold_Column = 1
+    endif
+
+    " Display the tags for only one file in the taglist window
+    if !exists('Tlist_Show_One_File')
+        let Tlist_Show_One_File = 0
+    endif
+
+    if !exists('Tlist_Max_Submenu_Items')
+        let Tlist_Max_Submenu_Items = 20
+    endif
+
+    if !exists('Tlist_Max_Tag_Length')
+        let Tlist_Max_Tag_Length = 10
+    endif
+
+    " Do not change the name of the taglist title variable. The winmanager
+    " plugin relies on this name to determine the title for the taglist
+    " plugin.
+    let TagList_title = "__Tag_List__"
+
+    " Taglist debug messages
+    let s:tlist_msg = ''
+
+    " Define the taglist autocommand to automatically open the taglist window
+    " on Vim startup
+    if g:Tlist_Auto_Open
+        autocmd VimEnter * nested call s:Tlist_Window_Check_Auto_Open()
+    endif
+
+    " Refresh the taglist
+    if g:Tlist_Process_File_Always
+        autocmd BufEnter * call s:Tlist_Refresh()
+    endif
+
+    if g:Tlist_Show_Menu
+        autocmd GUIEnter * call s:Tlist_Menu_Init()
+    endif
+
+    " When the taglist buffer is created when loading a Vim session file,
+    " the taglist buffer needs to be initialized. The BufFilePost event
+    " is used to handle this case.
+    autocmd BufFilePost __Tag_List__ call s:Tlist_Vim_Session_Load()
+
+    " Define the user commands to manage the taglist window
+    command! -nargs=0 -bar TlistToggle call s:Tlist_Window_Toggle()
+    command! -nargs=0 -bar TlistOpen call s:Tlist_Window_Open()
+    " For backwards compatiblity define the Tlist command
+    command! -nargs=0 -bar Tlist TlistToggle
+    command! -nargs=+ -complete=file TlistAddFiles
+                \  call s:Tlist_Add_Files(<f-args>)
+    command! -nargs=+ -complete=dir TlistAddFilesRecursive
+                \ call s:Tlist_Add_Files_Recursive(<f-args>)
+    command! -nargs=0 -bar TlistClose call s:Tlist_Window_Close()
+    command! -nargs=0 -bar TlistUpdate call s:Tlist_Update_Current_File()
+    command! -nargs=0 -bar TlistHighlightTag call s:Tlist_Window_Highlight_Tag(
+                        \ fnamemodify(bufname('%'), ':p'), line('.'), 2, 1)
+    " For backwards compatiblity define the TlistSync command
+    command! -nargs=0 -bar TlistSync TlistHighlightTag
+    command! -nargs=* -complete=buffer TlistShowPrototype
+                \ echo Tlist_Get_Tag_Prototype_By_Line(<f-args>)
+    command! -nargs=* -complete=buffer TlistShowTag
+                \ echo Tlist_Get_Tagname_By_Line(<f-args>)
+    command! -nargs=* -complete=file TlistSessionLoad
+                \ call s:Tlist_Session_Load(<q-args>)
+    command! -nargs=* -complete=file TlistSessionSave
+                \ call s:Tlist_Session_Save(<q-args>)
+    command! -bar TlistLock let Tlist_Auto_Update=0
+    command! -bar TlistUnlock let Tlist_Auto_Update=1
+
+    " Commands for enabling/disabling debug and to display debug messages
+    command! -nargs=? -complete=file -bar TlistDebug
+                \ call s:Tlist_Debug_Enable(<q-args>)
+    command! -nargs=0 -bar TlistUndebug  call s:Tlist_Debug_Disable()
+    command! -nargs=0 -bar TlistMessages call s:Tlist_Debug_Show()
+
+    " Define autocommands to autoload the taglist plugin when needed.
+
+    " Trick to get the current script ID
+    map <SID>xx <SID>xx
+    let s:tlist_sid = substitute(maparg('<SID>xx'), '<SNR>\(\d\+_\)xx$',
+                                \ '\1', '')
+    unmap <SID>xx
+
+    exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_* source ' .
+                \ escape(expand('<sfile>'), ' ')
+    exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_Window_* source ' .
+                \ escape(expand('<sfile>'), ' ')
+    exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_Menu_* source ' .
+                \ escape(expand('<sfile>'), ' ')
+    exe 'autocmd FuncUndefined Tlist_* source ' .
+                \ escape(expand('<sfile>'), ' ')
+    exe 'autocmd FuncUndefined TagList_* source ' .
+                \ escape(expand('<sfile>'), ' ')
+
+    let loaded_taglist = 'fast_load_done'
+
+    if g:Tlist_Show_Menu && has('gui_running')
+        call s:Tlist_Menu_Init()
+    endif
+
+    " restore 'cpo'
+    let &cpo = s:cpo_save
+    finish
+endif
+
+if !exists('s:tlist_sid')
+    " Two or more versions of taglist plugin are installed. Don't
+    " load this version of the plugin.
+    finish
+endif
+
+unlet! s:tlist_sid
+
+if loaded_taglist != 'fast_load_done'
+    " restore 'cpo'
+    let &cpo = s:cpo_save
+    finish
+endif
+
+" Taglist plugin functionality is available
+let loaded_taglist = 'available'
+
+"------------------- end of user configurable options --------------------
+
+" Default language specific settings for supported file types and tag types
+"
+" Variable name format:
+"
+"       s:tlist_def_{vim_ftype}_settings
+" 
+" vim_ftype - Filetype detected by Vim
+"
+" Value format:
+"
+"       <ctags_ftype>;<flag>:<name>;<flag>:<name>;...
+"
+" ctags_ftype - File type supported by exuberant ctags
+" flag        - Flag supported by exuberant ctags to generate a tag type
+" name        - Name of the tag type used in the taglist window to display the
+"               tags of this type
+"
+
+" assembly language
+let s:tlist_def_asm_settings = 'asm;d:define;l:label;m:macro;t:type'
+
+" aspperl language
+let s:tlist_def_aspperl_settings = 'asp;f:function;s:sub;v:variable'
+
+" aspvbs language
+let s:tlist_def_aspvbs_settings = 'asp;f:function;s:sub;v:variable'
+
+" awk language
+let s:tlist_def_awk_settings = 'awk;f:function'
+
+" beta language
+let s:tlist_def_beta_settings = 'beta;f:fragment;s:slot;v:pattern'
+
+" c language
+let s:tlist_def_c_settings = 'c;d:macro;g:enum;s:struct;u:union;t:typedef;' .
+                           \ 'v:variable;f:function'
+
+" c++ language
+let s:tlist_def_cpp_settings = 'c++;n:namespace;v:variable;d:macro;t:typedef;' .
+                             \ 'c:class;g:enum;s:struct;u:union;f:function'
+
+" c# language
+let s:tlist_def_cs_settings = 'c#;d:macro;t:typedef;n:namespace;c:class;' .
+                             \ 'E:event;g:enum;s:struct;i:interface;' .
+                             \ 'p:properties;m:method'
+
+" cobol language
+let s:tlist_def_cobol_settings = 'cobol;d:data;f:file;g:group;p:paragraph;' .
+                               \ 'P:program;s:section'
+
+" eiffel language
+let s:tlist_def_eiffel_settings = 'eiffel;c:class;f:feature'
+
+" erlang language
+let s:tlist_def_erlang_settings = 'erlang;d:macro;r:record;m:module;f:function'
+
+" expect (same as tcl) language
+let s:tlist_def_expect_settings = 'tcl;c:class;f:method;p:procedure'
+
+" fortran language
+let s:tlist_def_fortran_settings = 'fortran;p:program;b:block data;' .
+                    \ 'c:common;e:entry;i:interface;k:type;l:label;m:module;' .
+                    \ 'n:namelist;t:derived;v:variable;f:function;s:subroutine'
+
+" HTML language
+let s:tlist_def_html_settings = 'html;a:anchor;f:javascript function'
+
+" java language
+let s:tlist_def_java_settings = 'java;p:package;c:class;i:interface;' .
+                              \ 'f:field;m:method'
+
+" javascript language
+let s:tlist_def_javascript_settings = 'javascript;f:function'
+
+" lisp language
+let s:tlist_def_lisp_settings = 'lisp;f:function'
+
+" lua language
+let s:tlist_def_lua_settings = 'lua;f:function'
+
+" makefiles
+let s:tlist_def_make_settings = 'make;m:macro'
+
+" pascal language
+let s:tlist_def_pascal_settings = 'pascal;f:function;p:procedure'
+
+" perl language
+let s:tlist_def_perl_settings = 'perl;c:constant;l:label;p:package;s:subroutine'
+
+" php language
+let s:tlist_def_php_settings = 'php;c:class;d:constant;v:variable;f:function'
+
+" python language
+let s:tlist_def_python_settings = 'python;c:class;m:member;f:function'
+
+" rexx language
+let s:tlist_def_rexx_settings = 'rexx;s:subroutine'
+
+" ruby language
+let s:tlist_def_ruby_settings = 'ruby;c:class;f:method;F:function;' .
+                              \ 'm:singleton method'
+
+" scheme language
+let s:tlist_def_scheme_settings = 'scheme;s:set;f:function'
+
+" shell language
+let s:tlist_def_sh_settings = 'sh;f:function'
+
+" C shell language
+let s:tlist_def_csh_settings = 'sh;f:function'
+
+" Z shell language
+let s:tlist_def_zsh_settings = 'sh;f:function'
+
+" slang language
+let s:tlist_def_slang_settings = 'slang;n:namespace;f:function'
+
+" sml language
+let s:tlist_def_sml_settings = 'sml;e:exception;c:functor;s:signature;' .
+                             \ 'r:structure;t:type;v:value;f:function'
+
+" sql language
+let s:tlist_def_sql_settings = 'sql;c:cursor;F:field;P:package;r:record;' .
+            \ 's:subtype;t:table;T:trigger;v:variable;f:function;p:procedure'
+
+" tcl language
+let s:tlist_def_tcl_settings = 'tcl;c:class;f:method;m:method;p:procedure'
+
+" vera language
+let s:tlist_def_vera_settings = 'vera;c:class;d:macro;e:enumerator;' .
+                                \ 'f:function;g:enum;m:member;p:program;' .
+                                \ 'P:prototype;t:task;T:typedef;v:variable;' .
+                                \ 'x:externvar'
+
+"verilog language
+let s:tlist_def_verilog_settings = 'verilog;m:module;c:constant;P:parameter;' .
+            \ 'e:event;r:register;t:task;w:write;p:port;v:variable;f:function'
+
+" vim language
+let s:tlist_def_vim_settings = 'vim;a:autocmds;v:variable;f:function'
+
+" yacc language
+let s:tlist_def_yacc_settings = 'yacc;l:label'
+
+"------------------- end of language specific options --------------------
+
+" Vim window size is changed by the taglist plugin or not
+let s:tlist_winsize_chgd = -1
+" Taglist window is maximized or not
+let s:tlist_win_maximized = 0
+" Name of files in the taglist
+let s:tlist_file_names=''
+" Number of files in the taglist
+let s:tlist_file_count = 0
+" Number of filetypes supported by taglist
+let s:tlist_ftype_count = 0
+" Is taglist part of other plugins like winmanager or cream?
+let s:tlist_app_name = "none"
+" Are we displaying brief help text
+let s:tlist_brief_help = 1
+" List of files removed on user request
+let s:tlist_removed_flist = ""
+" Index of current file displayed in the taglist window
+let s:tlist_cur_file_idx = -1
+" Taglist menu is empty or not
+let s:tlist_menu_empty = 1
+
+" An autocommand is used to refresh the taglist window when entering any
+" buffer. We don't want to refresh the taglist window if we are entering the
+" file window from one of the taglist functions. The 'Tlist_Skip_Refresh'
+" variable is used to skip the refresh of the taglist window and is set
+" and cleared appropriately.
+let s:Tlist_Skip_Refresh = 0
+
+" Tlist_Window_Display_Help()
+function! s:Tlist_Window_Display_Help()
+    if s:tlist_app_name == "winmanager"
+        " To handle a bug in the winmanager plugin, add a space at the
+        " last line
+        call setline('$', ' ')
+    endif
+
+    if s:tlist_brief_help
+        " Add the brief help
+        call append(0, '" Press <F1> to display help text')
+    else
+        " Add the extensive help
+        call append(0, '" <enter> : Jump to tag definition')
+        call append(1, '" o : Jump to tag definition in new window')
+        call append(2, '" p : Preview the tag definition')
+        call append(3, '" <space> : Display tag prototype')
+        call append(4, '" u : Update tag list')
+        call append(5, '" s : Select sort field')
+        call append(6, '" d : Remove file from taglist')
+        call append(7, '" x : Zoom-out/Zoom-in taglist window')
+        call append(8, '" + : Open a fold')
+        call append(9, '" - : Close a fold')
+        call append(10, '" * : Open all folds')
+        call append(11, '" = : Close all folds')
+        call append(12, '" [[ : Move to the start of previous file')
+        call append(13, '" ]] : Move to the start of next file')
+        call append(14, '" q : Close the taglist window')
+        call append(15, '" <F1> : Remove help text')
+    endif
+endfunction
+
+" Tlist_Window_Toggle_Help_Text()
+" Toggle taglist plugin help text between the full version and the brief
+" version
+function! s:Tlist_Window_Toggle_Help_Text()
+    if g:Tlist_Compact_Format
+        " In compact display mode, do not display help
+        return
+    endif
+
+    " Include the empty line displayed after the help text
+    let brief_help_size = 1
+    let full_help_size = 16
+
+    setlocal modifiable
+
+    " Set report option to a huge value to prevent informational messages
+    " while deleting the lines
+    let old_report = &report
+    set report=99999
+
+    " Remove the currently highlighted tag. Otherwise, the help text
+    " might be highlighted by mistake
+    match none
+
+    " Toggle between brief and full help text
+    if s:tlist_brief_help
+        let s:tlist_brief_help = 0
+
+        " Remove the previous help
+        exe '1,' . brief_help_size . ' delete _'
+
+        " Adjust the start/end line numbers for the files
+        call s:Tlist_Window_Update_Line_Offsets(0, 1, full_help_size - brief_help_size)
+    else
+        let s:tlist_brief_help = 1
+
+        " Remove the previous help
+        exe '1,' . full_help_size . ' delete _'
+
+        " Adjust the start/end line numbers for the files
+        call s:Tlist_Window_Update_Line_Offsets(0, 0, full_help_size - brief_help_size)
+    endif
+
+    call s:Tlist_Window_Display_Help()
+
+    " Restore the report option
+    let &report = old_report
+
+    setlocal nomodifiable
+endfunction
+
+" Taglist debug support
+let s:tlist_debug = 0
+
+" File for storing the debug messages
+let s:tlist_debug_file = ''
+
+" Tlist_Debug_Enable
+" Enable logging of taglist debug messages.
+function! s:Tlist_Debug_Enable(...)
+    let s:tlist_debug = 1
+
+    " Check whether a valid file name is supplied.
+    if a:1 != ''
+        let s:tlist_debug_file = fnamemodify(a:1, ':p')
+
+        " Empty the log file
+        exe 'redir! > ' . s:tlist_debug_file
+        redir END
+
+        " Check whether the log file is present/created
+        if !filewritable(s:tlist_debug_file)
+            call s:Tlist_Warning_Msg('Taglist: Unable to create log file '
+                        \ . s:tlist_debug_file)
+            let s:tlist_debug_file = ''
+        endif
+    endif
+endfunction
+
+" Tlist_Debug_Disable
+" Disable logging of taglist debug messages.
+function! s:Tlist_Debug_Disable(...)
+    let s:tlist_debug = 0
+    let s:tlist_debug_file = ''
+endfunction
+
+" Tlist_Debug_Show
+" Display the taglist debug messages in a new window
+function! s:Tlist_Debug_Show()
+    if s:tlist_msg == ''
+        call s:Tlist_Warning_Msg('Taglist: No debug messages')
+        return
+    endif
+
+    " Open a new window to display the taglist debug messages
+    new taglist_debug.txt
+    " Delete all the lines (if the buffer already exists)
+    silent! %delete _
+    " Add the messages
+    silent! put =s:tlist_msg
+    " Move the cursor to the first line
+    normal! gg
+endfunction
+
+" Tlist_Log_Msg
+" Log the supplied debug message along with the time
+function! s:Tlist_Log_Msg(msg)
+    if s:tlist_debug
+        if s:tlist_debug_file != ''
+            exe 'redir >> ' . s:tlist_debug_file
+            silent echon strftime('%H:%M:%S') . ': ' . a:msg . "\n"
+            redir END
+        else
+            " Log the message into a variable
+            " Retain only the last 3000 characters
+            let len = strlen(s:tlist_msg)
+            if len > 3000
+                let s:tlist_msg = strpart(s:tlist_msg, len - 3000)
+            endif
+            let s:tlist_msg = s:tlist_msg . strftime('%H:%M:%S') . ': ' . 
+                        \ a:msg . "\n"
+        endif
+    endif
+endfunction
+
+" Tlist_Warning_Msg()
+" Display a message using WarningMsg highlight group
+function! s:Tlist_Warning_Msg(msg)
+    echohl WarningMsg
+    echomsg a:msg
+    echohl None
+endfunction
+
+" Last returned file index for file name lookup.
+" Used to speed up file lookup
+let s:tlist_file_name_idx_cache = -1
+
+" Tlist_Get_File_Index()
+" Return the index of the specified filename
+function! s:Tlist_Get_File_Index(fname)
+    if s:tlist_file_count == 0 || a:fname == ''
+        return -1
+    endif
+
+    " If the new filename is same as the last accessed filename, then
+    " return that index
+    if s:tlist_file_name_idx_cache != -1 &&
+                \ s:tlist_file_name_idx_cache < s:tlist_file_count
+        if s:tlist_{s:tlist_file_name_idx_cache}_filename == a:fname
+            " Same as the last accessed file
+            return s:tlist_file_name_idx_cache
+        endif
+    endif
+
+    " First, check whether the filename is present
+    let s_fname = a:fname . "\n"
+    let i = stridx(s:tlist_file_names, s_fname)
+    if i == -1
+        let s:tlist_file_name_idx_cache = -1
+        return -1
+    endif
+
+    " Second, compute the file name index
+    let nl_txt = substitute(strpart(s:tlist_file_names, 0, i), "[^\n]", '', 'g')
+    let s:tlist_file_name_idx_cache = strlen(nl_txt)
+    return s:tlist_file_name_idx_cache
+endfunction
+
+" Last returned file index for line number lookup.
+" Used to speed up file lookup
+let s:tlist_file_lnum_idx_cache = -1
+
+" Tlist_Window_Get_File_Index_By_Linenum()
+" Return the index of the filename present in the specified line number
+" Line number refers to the line number in the taglist window
+function! s:Tlist_Window_Get_File_Index_By_Linenum(lnum)
+    call s:Tlist_Log_Msg('Tlist_Window_Get_File_Index_By_Linenum (' . a:lnum . ')')
+
+    " First try to see whether the new line number is within the range
+    " of the last returned file
+    if s:tlist_file_lnum_idx_cache != -1 &&
+                \ s:tlist_file_lnum_idx_cache < s:tlist_file_count
+        if a:lnum >= s:tlist_{s:tlist_file_lnum_idx_cache}_start &&
+                    \ a:lnum <= s:tlist_{s:tlist_file_lnum_idx_cache}_end
+            return s:tlist_file_lnum_idx_cache
+        endif
+    endif
+
+    let fidx = -1
+
+    if g:Tlist_Show_One_File
+        " Displaying only one file in the taglist window. Check whether
+        " the line is within the tags displayed for that file
+        if s:tlist_cur_file_idx != -1
+            if a:lnum >= s:tlist_{s:tlist_cur_file_idx}_start
+                        \ && a:lnum <= s:tlist_{s:tlist_cur_file_idx}_end
+                let fidx = s:tlist_cur_file_idx
+            endif
+
+        endif
+    else
+        " Do a binary search in the taglist
+        let left = 0
+        let right = s:tlist_file_count - 1
+
+        while left < right
+            let mid = (left + right) / 2
+
+            if a:lnum >= s:tlist_{mid}_start && a:lnum <= s:tlist_{mid}_end
+                let s:tlist_file_lnum_idx_cache = mid
+                return mid
+            endif
+
+            if a:lnum < s:tlist_{mid}_start
+                let right = mid - 1
+            else
+                let left = mid + 1
+            endif
+        endwhile
+
+        if left >= 0 && left < s:tlist_file_count
+                    \ && a:lnum >= s:tlist_{left}_start
+                    \ && a:lnum <= s:tlist_{left}_end
+            let fidx = left
+        endif
+    endif
+
+    let s:tlist_file_lnum_idx_cache = fidx
+
+    return fidx
+endfunction
+
+" Tlist_Exe_Cmd_No_Acmds
+" Execute the specified Ex command after disabling autocommands
+function! s:Tlist_Exe_Cmd_No_Acmds(cmd)
+    let old_eventignore = &eventignore
+    set eventignore=all
+    exe a:cmd
+    let &eventignore = old_eventignore
+endfunction
+
+" Tlist_Skip_File()
+" Check whether tag listing is supported for the specified file
+function! s:Tlist_Skip_File(filename, ftype)
+    " Skip buffers with no names and buffers with filetype not set
+    if a:filename == '' || a:ftype == ''
+        return 1
+    endif
+
+    " Skip files which are not supported by exuberant ctags
+    " First check whether default settings for this filetype are available.
+    " If it is not available, then check whether user specified settings are
+    " available. If both are not available, then don't list the tags for this
+    " filetype
+    let var = 's:tlist_def_' . a:ftype . '_settings'
+    if !exists(var)
+        let var = 'g:tlist_' . a:ftype . '_settings'
+        if !exists(var)
+            return 1
+        endif
+    endif
+
+    " Skip files which are not readable or files which are not yet stored
+    " to the disk
+    if !filereadable(a:filename)
+        return 1
+    endif
+
+    return 0
+endfunction
+
+" Tlist_User_Removed_File
+" Returns 1 if a file is removed by a user from the taglist
+function! s:Tlist_User_Removed_File(filename)
+    return stridx(s:tlist_removed_flist, a:filename . "\n") != -1
+endfunction
+
+" Tlist_Update_Remove_List
+" Update the list of user removed files from the taglist
+" add == 1, add the file to the removed list
+" add == 0, delete the file from the removed list
+function! s:Tlist_Update_Remove_List(filename, add)
+    if a:add
+        let s:tlist_removed_flist = s:tlist_removed_flist . a:filename . "\n"
+    else
+        let idx = stridx(s:tlist_removed_flist, a:filename . "\n")
+        let text_before = strpart(s:tlist_removed_flist, 0, idx)
+        let rem_text = strpart(s:tlist_removed_flist, idx)
+        let next_idx = stridx(rem_text, "\n")
+        let text_after = strpart(rem_text, next_idx + 1)
+
+        let s:tlist_removed_flist = text_before . text_after
+    endif
+endfunction
+
+" Tlist_FileType_Init
+" Initialize the ctags arguments and tag variable for the specified
+" file type
+function! s:Tlist_FileType_Init(ftype)
+    call s:Tlist_Log_Msg('Tlist_FileType_Init (' . a:ftype . ')')
+    " If the user didn't specify any settings, then use the default
+    " ctags args. Otherwise, use the settings specified by the user
+    let var = 'g:tlist_' . a:ftype . '_settings'
+    if exists(var)
+        " User specified ctags arguments
+        let settings = {var} . ';'
+    else
+        " Default ctags arguments
+        let var = 's:tlist_def_' . a:ftype . '_settings'
+        if !exists(var)
+            " No default settings for this file type. This filetype is
+            " not supported
+            return 0
+        endif
+        let settings = s:tlist_def_{a:ftype}_settings . ';'
+    endif
+
+    let msg = 'Taglist: Invalid ctags option setting - ' . settings
+
+    " Format of the option that specifies the filetype and ctags arugments:
+    "
+    "       <language_name>;flag1:name1;flag2:name2;flag3:name3
+    "
+
+    " Extract the file type to pass to ctags. This may be different from the
+    " file type detected by Vim
+    let pos = stridx(settings, ';')
+    if pos == -1
+        call s:Tlist_Warning_Msg(msg)
+        return 0
+    endif
+    let ctags_ftype = strpart(settings, 0, pos)
+    if ctags_ftype == ''
+        call s:Tlist_Warning_Msg(msg)
+        return 0
+    endif
+    " Make sure a valid filetype is supplied. If the user didn't specify a
+    " valid filetype, then the ctags option settings may be treated as the
+    " filetype
+    if ctags_ftype =~ ':'
+        call s:Tlist_Warning_Msg(msg)
+        return 0
+    endif
+
+    " Remove the file type from settings
+    let settings = strpart(settings, pos + 1)
+    if settings == ''
+        call s:Tlist_Warning_Msg(msg)
+        return 0
+    endif
+
+    " Process all the specified ctags flags. The format is
+    " flag1:name1;flag2:name2;flag3:name3
+    let ctags_flags = ''
+    let cnt = 0
+    while settings != ''
+        " Extract the flag
+        let pos = stridx(settings, ':')
+        if pos == -1
+            call s:Tlist_Warning_Msg(msg)
+            return 0
+        endif
+        let flag = strpart(settings, 0, pos)
+        if flag == ''
+            call s:Tlist_Warning_Msg(msg)
+            return 0
+        endif
+        " Remove the flag from settings
+        let settings = strpart(settings, pos + 1)
+
+        " Extract the tag type name
+        let pos = stridx(settings, ';')
+        if pos == -1
+            call s:Tlist_Warning_Msg(msg)
+            return 0
+        endif
+        let name = strpart(settings, 0, pos)
+        if name == ''
+            call s:Tlist_Warning_Msg(msg)
+            return 0
+        endif
+        let settings = strpart(settings, pos + 1)
+
+        let cnt = cnt + 1
+
+        let s:tlist_{a:ftype}_{cnt}_name = flag
+        let s:tlist_{a:ftype}_{cnt}_fullname = name
+        let ctags_flags = ctags_flags . flag
+    endwhile
+
+    let s:tlist_{a:ftype}_ctags_args = '--language-force=' . ctags_ftype .
+                            \ ' --' . ctags_ftype . '-types=' . ctags_flags
+    let s:tlist_{a:ftype}_count = cnt
+    let s:tlist_{a:ftype}_ctags_flags = ctags_flags
+
+    " Save the filetype name
+    let s:tlist_ftype_{s:tlist_ftype_count}_name = a:ftype
+    let s:tlist_ftype_count = s:tlist_ftype_count + 1
+
+    return 1
+endfunction
+
+" Tlist_Detect_Filetype
+" Determine the filetype for the specified file using the filetypedetect
+" autocmd.
+function! s:Tlist_Detect_Filetype(fname)
+    " Ignore the filetype autocommands
+    let old_eventignore = &eventignore
+    set eventignore=FileType
+
+    " Save the 'filetype', as this will be changed temporarily
+    let old_filetype = &filetype
+
+    " Run the filetypedetect group of autocommands to determine
+    " the filetype
+    exe 'doautocmd filetypedetect BufRead ' . a:fname
+
+    " Save the detected filetype
+    let ftype = &filetype
+
+    " Restore the previous state
+    let &filetype = old_filetype
+    let &eventignore = old_eventignore
+
+    return ftype
+endfunction
+
+" Tlist_Get_Buffer_Filetype
+" Get the filetype for the specified buffer
+function! s:Tlist_Get_Buffer_Filetype(bnum)
+    let buf_ft = getbufvar(a:bnum, '&filetype')
+
+    if bufloaded(a:bnum)
+        " For loaded buffers, the 'filetype' is already determined
+        return buf_ft
+    endif
+
+    " For unloaded buffers, if the 'filetype' option is set, return it
+    if buf_ft != ''
+        return buf_ft
+    endif
+
+    " Skip non-existent buffers
+    if !bufexists(a:bnum)
+        return ''
+    endif
+
+    " For buffers whose filetype is not yet determined, try to determine
+    " the filetype
+    let bname = bufname(a:bnum)
+
+    return s:Tlist_Detect_Filetype(bname)
+endfunction
+
+" Tlist_Discard_TagInfo
+" Discard the stored tag information for a file
+function! s:Tlist_Discard_TagInfo(fidx)
+    call s:Tlist_Log_Msg('Tlist_Discard_TagInfo (' .
+                \ s:tlist_{a:fidx}_filename . ')')
+    let ftype = s:tlist_{a:fidx}_filetype
+
+    " Discard information about the tags defined in the file
+    let i = 1
+    while i <= s:tlist_{a:fidx}_tag_count
+        let fidx_i = 's:tlist_' . a:fidx . '_' . i
+        unlet! {fidx_i}_tag
+        unlet! {fidx_i}_tag_name
+        unlet! {fidx_i}_tag_type
+        unlet! {fidx_i}_ttype_idx
+        unlet! {fidx_i}_tag_proto
+        unlet! {fidx_i}_tag_searchpat
+        unlet! {fidx_i}_tag_linenum
+        let i = i + 1
+    endwhile
+
+    let s:tlist_{a:fidx}_tag_count = 0
+
+    " Discard information about tag type groups
+    let i = 1
+    while i <= s:tlist_{ftype}_count
+        let ttype = s:tlist_{ftype}_{i}_name
+        if s:tlist_{a:fidx}_{ttype} != ''
+            let fidx_ttype = 's:tlist_' . a:fidx . '_' . ttype
+            let {fidx_ttype} = ''
+            let {fidx_ttype}_offset = 0
+            let cnt = {fidx_ttype}_count
+            let {fidx_ttype}_count = 0
+            let j = 1
+            while j <= cnt
+                unlet! {fidx_ttype}_{j}
+                let j = j + 1
+            endwhile
+        endif
+        let i = i + 1
+    endwhile
+
+    " Discard the stored menu command also
+    let s:tlist_{a:fidx}_menu_cmd = ''
+endfunction
+
+" Tlist_Window_Update_Line_Offsets
+" Update the line offsets for tags for files starting from start_idx
+" and displayed in the taglist window by the specified offset
+function! s:Tlist_Window_Update_Line_Offsets(start_idx, increment, offset)
+    let i = a:start_idx
+
+    while i < s:tlist_file_count
+        if s:tlist_{i}_visible
+            " Update the start/end line number only if the file is visible
+            if a:increment
+                let s:tlist_{i}_start = s:tlist_{i}_start + a:offset
+                let s:tlist_{i}_end = s:tlist_{i}_end + a:offset
+            else
+                let s:tlist_{i}_start = s:tlist_{i}_start - a:offset
+                let s:tlist_{i}_end = s:tlist_{i}_end - a:offset
+            endif
+        endif
+        let i = i + 1
+    endwhile
+endfunction
+
+" Tlist_Discard_FileInfo
+" Discard the stored information for a file
+function! s:Tlist_Discard_FileInfo(fidx)
+    call s:Tlist_Log_Msg('Tlist_Discard_FileInfo (' .
+                \ s:tlist_{a:fidx}_filename . ')')
+    call s:Tlist_Discard_TagInfo(a:fidx)
+
+    let ftype = s:tlist_{a:fidx}_filetype
+
+    let i = 1
+    while i <= s:tlist_{ftype}_count
+        let ttype = s:tlist_{ftype}_{i}_name
+        unlet! s:tlist_{a:fidx}_{ttype}
+        unlet! s:tlist_{a:fidx}_{ttype}_offset
+        unlet! s:tlist_{a:fidx}_{ttype}_count
+        let i = i + 1
+    endwhile
+
+    unlet! s:tlist_{a:fidx}_filename
+    unlet! s:tlist_{a:fidx}_sort_type
+    unlet! s:tlist_{a:fidx}_filetype
+    unlet! s:tlist_{a:fidx}_mtime
+    unlet! s:tlist_{a:fidx}_start
+    unlet! s:tlist_{a:fidx}_end
+    unlet! s:tlist_{a:fidx}_valid
+    unlet! s:tlist_{a:fidx}_visible
+    unlet! s:tlist_{a:fidx}_tag_count
+    unlet! s:tlist_{a:fidx}_menu_cmd
+endfunction
+
+" Tlist_Window_Remove_File_From_Display
+" Remove the specified file from display
+function! s:Tlist_Window_Remove_File_From_Display(fidx)
+    call s:Tlist_Log_Msg('Tlist_Window_Remove_File_From_Display (' .
+                \ s:tlist_{a:fidx}_filename . ')')
+    " If the file is not visible then no need to remove it
+    if !s:tlist_{a:fidx}_visible
+        return
+    endif
+
+    " Remove the tags displayed for the specified file from the window
+    let start = s:tlist_{a:fidx}_start
+    " Include the empty line after the last line also
+    if g:Tlist_Compact_Format
+        let end = s:tlist_{a:fidx}_end
+    else
+        let end = s:tlist_{a:fidx}_end + 1
+    endif
+
+    setlocal modifiable
+    exe 'silent! ' . start . ',' . end . 'delete _'
+    setlocal nomodifiable
+
+    " Correct the start and end line offsets for all the files following
+    " this file, as the tags for this file are removed
+    call s:Tlist_Window_Update_Line_Offsets(a:fidx + 1, 0, end - start + 1)
+endfunction
+
+" Tlist_Remove_File
+" Remove the file under the cursor or the specified file index
+" user_request - User requested to remove the file from taglist
+function! s:Tlist_Remove_File(file_idx, user_request)
+    let fidx = a:file_idx
+
+    if fidx == -1
+        let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.'))
+        if fidx == -1
+            return
+        endif
+    endif
+    call s:Tlist_Log_Msg('Tlist_Remove_File (' .
+                \ s:tlist_{fidx}_filename . ', ' . a:user_request . ')')
+
+    let save_winnr = winnr()
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum != -1
+        " Taglist window is open, remove the file from display
+
+        if save_winnr != winnum
+            let old_eventignore = &eventignore
+            set eventignore=all
+            exe winnum . 'wincmd w'
+        endif
+
+        call s:Tlist_Window_Remove_File_From_Display(fidx)
+
+        if save_winnr != winnum
+            exe save_winnr . 'wincmd w'
+            let &eventignore = old_eventignore
+        endif
+    endif
+
+    let fname = s:tlist_{fidx}_filename
+
+    if a:user_request
+        " As the user requested to remove the file from taglist,
+        " add it to the removed list
+        call s:Tlist_Update_Remove_List(fname, 1)
+    endif
+
+    " Remove the file name from the taglist list of filenames
+    let idx = stridx(s:tlist_file_names, fname . "\n")
+    let text_before = strpart(s:tlist_file_names, 0, idx)
+    let rem_text = strpart(s:tlist_file_names, idx)
+    let next_idx = stridx(rem_text, "\n")
+    let text_after = strpart(rem_text, next_idx + 1)
+    let s:tlist_file_names = text_before . text_after
+
+    call s:Tlist_Discard_FileInfo(fidx)
+
+    " Shift all the file variables by one index
+    let i = fidx + 1
+
+    while i < s:tlist_file_count
+        let j = i - 1
+
+        let s:tlist_{j}_filename = s:tlist_{i}_filename
+        let s:tlist_{j}_sort_type = s:tlist_{i}_sort_type
+        let s:tlist_{j}_filetype = s:tlist_{i}_filetype
+        let s:tlist_{j}_mtime = s:tlist_{i}_mtime
+        let s:tlist_{j}_start = s:tlist_{i}_start
+        let s:tlist_{j}_end = s:tlist_{i}_end
+        let s:tlist_{j}_valid = s:tlist_{i}_valid
+        let s:tlist_{j}_visible = s:tlist_{i}_visible
+        let s:tlist_{j}_tag_count = s:tlist_{i}_tag_count
+        let s:tlist_{j}_menu_cmd = s:tlist_{i}_menu_cmd
+
+        let k = 1
+        while k <= s:tlist_{j}_tag_count
+            let s:tlist_{j}_{k}_tag = s:tlist_{i}_{k}_tag
+            let s:tlist_{j}_{k}_tag_name = s:tlist_{i}_{k}_tag_name
+            let s:tlist_{j}_{k}_tag_type = s:Tlist_Get_Tag_Type_By_Tag(i, k)
+            let s:tlist_{j}_{k}_ttype_idx = s:tlist_{i}_{k}_ttype_idx
+            let s:tlist_{j}_{k}_tag_proto = s:Tlist_Get_Tag_Prototype(i, k)
+            let s:tlist_{j}_{k}_tag_searchpat = s:Tlist_Get_Tag_SearchPat(i, k)
+            let s:tlist_{j}_{k}_tag_linenum = s:Tlist_Get_Tag_Linenum(i, k)
+            let k = k + 1
+        endwhile
+
+        let ftype = s:tlist_{i}_filetype
+
+        let k = 1
+        while k <= s:tlist_{ftype}_count
+            let ttype = s:tlist_{ftype}_{k}_name
+            let s:tlist_{j}_{ttype} = s:tlist_{i}_{ttype}
+            let s:tlist_{j}_{ttype}_offset = s:tlist_{i}_{ttype}_offset
+            let s:tlist_{j}_{ttype}_count = s:tlist_{i}_{ttype}_count
+            if s:tlist_{j}_{ttype} != ''
+                let l = 1
+                while l <= s:tlist_{j}_{ttype}_count
+                    let s:tlist_{j}_{ttype}_{l} = s:tlist_{i}_{ttype}_{l}
+                    let l = l + 1
+                endwhile
+            endif
+            let k = k + 1
+        endwhile
+
+        " As the file and tag information is copied to the new index,
+        " discard the previous information
+        call s:Tlist_Discard_FileInfo(i)
+
+        let i = i + 1
+    endwhile
+
+    " Reduce the number of files displayed
+    let s:tlist_file_count = s:tlist_file_count - 1
+
+    if g:Tlist_Show_One_File
+        " If the tags for only one file is displayed and if we just
+        " now removed that file, then invalidate the current file idx
+        if s:tlist_cur_file_idx == fidx
+            let s:tlist_cur_file_idx = -1
+        endif
+    endif
+endfunction
+
+" Tlist_Window_Goto_Window
+" Goto the taglist window
+function! s:Tlist_Window_Goto_Window()
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum != -1
+        if winnr() != winnum
+            call s:Tlist_Exe_Cmd_No_Acmds(winnum . 'wincmd w')
+        endif
+    endif
+endfunction
+
+" Tlist_Window_Create
+" Create a new taglist window. If it is already open, jump to it
+function! s:Tlist_Window_Create()
+    call s:Tlist_Log_Msg('Tlist_Window_Create()')
+    " If the window is open, jump to it
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum != -1
+        " Jump to the existing window
+        if winnr() != winnum
+            exe winnum . 'wincmd w'
+        endif
+        return
+    endif
+
+    " If used with winmanager don't open windows. Winmanager will handle
+    " the window/buffer management
+    if s:tlist_app_name == "winmanager"
+        return
+    endif
+
+    " Create a new window. If user prefers a horizontal window, then open
+    " a horizontally split window. Otherwise open a vertically split
+    " window
+    if g:Tlist_Use_Horiz_Window
+        " Open a horizontally split window
+        let win_dir = 'botright'
+        " Horizontal window height
+        let win_size = g:Tlist_WinHeight
+    else
+        if s:tlist_winsize_chgd == -1
+            " Open a vertically split window. Increase the window size, if
+            " needed, to accomodate the new window
+            if g:Tlist_Inc_Winwidth &&
+                        \ &columns < (80 + g:Tlist_WinWidth)
+                " Save the original window position
+                let s:tlist_pre_winx = getwinposx()
+                let s:tlist_pre_winy = getwinposy()
+
+                " one extra column is needed to include the vertical split
+                let &columns= &columns + g:Tlist_WinWidth + 1
+
+                let s:tlist_winsize_chgd = 1
+            else
+                let s:tlist_winsize_chgd = 0
+            endif
+        endif
+
+        if g:Tlist_Use_Right_Window
+            " Open the window at the rightmost place
+            let win_dir = 'botright vertical'
+        else
+            " Open the window at the leftmost place
+            let win_dir = 'topleft vertical'
+        endif
+        let win_size = g:Tlist_WinWidth
+    endif
+
+    " If the tag listing temporary buffer already exists, then reuse it.
+    " Otherwise create a new buffer
+    let bufnum = bufnr(g:TagList_title)
+    if bufnum == -1
+        " Create a new buffer
+        let wcmd = g:TagList_title
+    else
+        " Edit the existing buffer
+        let wcmd = '+buffer' . bufnum
+    endif
+
+    " Create the taglist window
+    exe 'silent! ' . win_dir . ' ' . win_size . 'split ' . wcmd
+
+    " Save the new window position
+    let s:tlist_winx = getwinposx()
+    let s:tlist_winy = getwinposy()
+
+    " Initialize the taglist window
+    call s:Tlist_Window_Init()
+endfunction
+
+" Tlist_Window_Zoom
+" Zoom (maximize/minimize) the taglist window
+function! s:Tlist_Window_Zoom()
+    if s:tlist_win_maximized
+        " Restore the window back to the previous size
+        if g:Tlist_Use_Horiz_Window
+            exe 'resize ' . g:Tlist_WinHeight
+        else
+            exe 'vert resize ' . g:Tlist_WinWidth
+        endif
+        let s:tlist_win_maximized = 0
+    else
+        " Set the window size to the maximum possible without closing other
+        " windows
+        if g:Tlist_Use_Horiz_Window
+            resize
+        else
+            vert resize
+        endif
+        let s:tlist_win_maximized = 1
+    endif
+endfunction
+
+" Tlist_Ballon_Expr
+" When the mouse cursor is over a tag in the taglist window, display the
+" tag prototype (balloon)
+function! Tlist_Ballon_Expr()
+    " Get the file index
+    let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(v:beval_lnum)
+    if fidx == -1
+        return ''
+    endif
+
+    " Get the tag output line for the current tag
+    let tidx = s:Tlist_Window_Get_Tag_Index(fidx, v:beval_lnum)
+    if tidx == 0
+        return ''
+    endif
+
+    " Get the tag search pattern and display it
+    return s:Tlist_Get_Tag_Prototype(fidx, tidx)
+endfunction
+
+" Tlist_Window_Check_Width
+" Check the width of the taglist window. For horizontally split windows, the
+" 'winfixheight' option is used to fix the height of the window. For
+" vertically split windows, Vim doesn't support the 'winfixwidth' option. So
+" need to handle window width changes from this function.
+function! s:Tlist_Window_Check_Width()
+    let tlist_winnr = bufwinnr(g:TagList_title)
+    if tlist_winnr == -1
+        return
+    endif
+
+    let width = winwidth(tlist_winnr)
+    if width != g:Tlist_WinWidth
+        call s:Tlist_Log_Msg("Tlist_Window_Check_Width: Changing window " .
+                    \ "width from " . width . " to " . g:Tlist_WinWidth)
+        let save_winnr = winnr()
+        if save_winnr != tlist_winnr
+            call s:Tlist_Exe_Cmd_No_Acmds(tlist_winnr . 'wincmd w')
+        endif
+        exe 'vert resize ' . g:Tlist_WinWidth
+        if save_winnr != tlist_winnr
+            call s:Tlist_Exe_Cmd_No_Acmds('wincmd p')
+        endif
+    endif
+endfunction
+
+" Tlist_Window_Exit_Only_Window
+" If the 'Tlist_Exit_OnlyWindow' option is set, then exit Vim if only the
+" taglist window is present.
+function! s:Tlist_Window_Exit_Only_Window()
+    " Before quitting Vim, delete the taglist buffer so that
+    " the '0 mark is correctly set to the previous buffer.
+    if v:version < 700
+       if winbufnr(2) == -1
+           bdelete
+           quit
+       endif
+    else
+       if winbufnr(2) == -1
+           if tabpagenr('$') == 1
+               " Only one tag page is present
+               bdelete
+               quit
+           else
+               " More than one tab page is present. Close only the current
+               " tab page
+               close
+           endif
+       endif
+    endif
+endfunction
+
+" Tlist_Window_Init
+" Set the default options for the taglist window
+function! s:Tlist_Window_Init()
+    call s:Tlist_Log_Msg('Tlist_Window_Init()')
+
+    " The 'readonly' option should not be set for the taglist buffer.
+    " If Vim is started as "view/gview" or if the ":view" command is
+    " used, then the 'readonly' option is set for all the buffers.
+    " Unset it for the taglist buffer
+    setlocal noreadonly
+
+    " Set the taglist buffer filetype to taglist
+    setlocal filetype=taglist
+
+    " Define taglist window element highlighting
+    syntax match TagListComment '^" .*'
+    syntax match TagListFileName '^[^" ].*$'
+    syntax match TagListTitle '^  \S.*$'
+    syntax match TagListTagScope  '\s\[.\{-\}\]$'
+
+    " Define the highlighting only if colors are supported
+    if has('gui_running') || &t_Co > 2
+        " Colors to highlight various taglist window elements
+        " If user defined highlighting group exists, then use them.
+        " Otherwise, use default highlight groups.
+        if hlexists('MyTagListTagName')
+            highlight link TagListTagName MyTagListTagName
+        else
+            highlight default link TagListTagName Search
+        endif
+        " Colors to highlight comments and titles
+        if hlexists('MyTagListComment')
+            highlight link TagListComment MyTagListComment
+        else
+            highlight clear TagListComment
+            highlight default link TagListComment Comment
+        endif
+        if hlexists('MyTagListTitle')
+            highlight link TagListTitle MyTagListTitle
+        else
+            highlight clear TagListTitle
+            highlight default link TagListTitle Title
+        endif
+        if hlexists('MyTagListFileName')
+            highlight link TagListFileName MyTagListFileName
+        else
+            highlight clear TagListFileName
+            highlight default TagListFileName guibg=Grey ctermbg=darkgray
+                        \ guifg=white ctermfg=white
+        endif
+        if hlexists('MyTagListTagScope')
+            highlight link TagListTagScope MyTagListTagScope
+        else
+            highlight clear TagListTagScope
+            highlight default link TagListTagScope Identifier
+        endif
+    else
+        highlight default TagListTagName term=reverse cterm=reverse
+    endif
+
+    " Folding related settings
+    setlocal foldenable
+    setlocal foldminlines=0
+    setlocal foldmethod=manual
+    setlocal foldlevel=9999
+    if g:Tlist_Enable_Fold_Column
+        setlocal foldcolumn=3
+    else
+        setlocal foldcolumn=0
+    endif
+    setlocal foldtext=v:folddashes.getline(v:foldstart)
+
+    if s:tlist_app_name != "winmanager"
+        " Mark buffer as scratch
+        silent! setlocal buftype=nofile
+        if s:tlist_app_name == "none"
+            silent! setlocal bufhidden=delete
+        endif
+        silent! setlocal noswapfile
+        " Due to a bug in Vim 6.0, the winbufnr() function fails for unlisted
+        " buffers. So if the taglist buffer is unlisted, multiple taglist
+        " windows will be opened. This bug is fixed in Vim 6.1 and above
+        if v:version >= 601
+            silent! setlocal nobuflisted
+        endif
+    endif
+
+    silent! setlocal nowrap
+
+    " If the 'number' option is set in the source window, it will affect the
+    " taglist window. So forcefully disable 'number' option for the taglist
+    " window
+    silent! setlocal nonumber
+
+    " Use fixed height when horizontally split window is used
+    if g:Tlist_Use_Horiz_Window
+        if v:version >= 602
+            set winfixheight
+        endif
+    endif
+    if !g:Tlist_Use_Horiz_Window && v:version >= 700
+        set winfixwidth
+    endif
+
+    " Setup balloon evaluation to display tag prototype
+    if v:version >= 700 && has('balloon_eval')
+        setlocal balloonexpr=Tlist_Ballon_Expr()
+        set ballooneval
+    endif
+
+    " Setup the cpoptions properly for the maps to work
+    let old_cpoptions = &cpoptions
+    set cpoptions&vim
+
+    " Create buffer local mappings for jumping to the tags and sorting the list
+    nnoremap <buffer> <silent> <CR>
+                \ :call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR>
+    nnoremap <buffer> <silent> o
+                \ :call <SID>Tlist_Window_Jump_To_Tag('newwin')<CR>
+    nnoremap <buffer> <silent> p
+                \ :call <SID>Tlist_Window_Jump_To_Tag('preview')<CR>
+    nnoremap <buffer> <silent> P
+                \ :call <SID>Tlist_Window_Jump_To_Tag('prevwin')<CR>
+    if v:version >= 700
+    nnoremap <buffer> <silent> t
+                \ :call <SID>Tlist_Window_Jump_To_Tag('checktab')<CR>
+    nnoremap <buffer> <silent> <C-t>
+                \ :call <SID>Tlist_Window_Jump_To_Tag('newtab')<CR>
+    endif
+    nnoremap <buffer> <silent> <2-LeftMouse>
+                \ :call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR>
+    nnoremap <buffer> <silent> s
+                \ :call <SID>Tlist_Change_Sort('cmd', 'toggle', '')<CR>
+    nnoremap <buffer> <silent> + :silent! foldopen<CR>
+    nnoremap <buffer> <silent> - :silent! foldclose<CR>
+    nnoremap <buffer> <silent> * :silent! %foldopen!<CR>
+    nnoremap <buffer> <silent> = :silent! %foldclose<CR>
+    nnoremap <buffer> <silent> <kPlus> :silent! foldopen<CR>
+    nnoremap <buffer> <silent> <kMinus> :silent! foldclose<CR>
+    nnoremap <buffer> <silent> <kMultiply> :silent! %foldopen!<CR>
+    nnoremap <buffer> <silent> <Space> :call <SID>Tlist_Window_Show_Info()<CR>
+    nnoremap <buffer> <silent> u :call <SID>Tlist_Window_Update_File()<CR>
+    nnoremap <buffer> <silent> d :call <SID>Tlist_Remove_File(-1, 1)<CR>
+    nnoremap <buffer> <silent> x :call <SID>Tlist_Window_Zoom()<CR>
+    nnoremap <buffer> <silent> [[ :call <SID>Tlist_Window_Move_To_File(-1)<CR>
+    nnoremap <buffer> <silent> <BS> :call <SID>Tlist_Window_Move_To_File(-1)<CR>
+    nnoremap <buffer> <silent> ]] :call <SID>Tlist_Window_Move_To_File(1)<CR>
+    nnoremap <buffer> <silent> <Tab> :call <SID>Tlist_Window_Move_To_File(1)<CR>
+    nnoremap <buffer> <silent> <F1> :call <SID>Tlist_Window_Toggle_Help_Text()<CR>
+    nnoremap <buffer> <silent> q :close<CR>
+
+    " Insert mode mappings
+    inoremap <buffer> <silent> <CR>
+                \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR>
+    " Windows needs return
+    inoremap <buffer> <silent> <Return>
+                \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR>
+    inoremap <buffer> <silent> o
+                \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('newwin')<CR>
+    inoremap <buffer> <silent> p
+                \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('preview')<CR>
+    inoremap <buffer> <silent> P
+                \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('prevwin')<CR>
+    if v:version >= 700
+    inoremap <buffer> <silent> t
+                \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('checktab')<CR>
+    inoremap <buffer> <silent> <C-t>
+                \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('newtab')<CR>
+    endif
+    inoremap <buffer> <silent> <2-LeftMouse>
+                \ <C-o>:call <SID>Tlist_Window_Jump_To_Tag('useopen')<CR>
+    inoremap <buffer> <silent> s
+                \ <C-o>:call <SID>Tlist_Change_Sort('cmd', 'toggle', '')<CR>
+    inoremap <buffer> <silent> +             <C-o>:silent! foldopen<CR>
+    inoremap <buffer> <silent> -             <C-o>:silent! foldclose<CR>
+    inoremap <buffer> <silent> *             <C-o>:silent! %foldopen!<CR>
+    inoremap <buffer> <silent> =             <C-o>:silent! %foldclose<CR>
+    inoremap <buffer> <silent> <kPlus>       <C-o>:silent! foldopen<CR>
+    inoremap <buffer> <silent> <kMinus>      <C-o>:silent! foldclose<CR>
+    inoremap <buffer> <silent> <kMultiply>   <C-o>:silent! %foldopen!<CR>
+    inoremap <buffer> <silent> <Space>       <C-o>:call
+                                    \ <SID>Tlist_Window_Show_Info()<CR>
+    inoremap <buffer> <silent> u
+                            \ <C-o>:call <SID>Tlist_Window_Update_File()<CR>
+    inoremap <buffer> <silent> d    <C-o>:call <SID>Tlist_Remove_File(-1, 1)<CR>
+    inoremap <buffer> <silent> x    <C-o>:call <SID>Tlist_Window_Zoom()<CR>
+    inoremap <buffer> <silent> [[   <C-o>:call <SID>Tlist_Window_Move_To_File(-1)<CR>
+    inoremap <buffer> <silent> <BS> <C-o>:call <SID>Tlist_Window_Move_To_File(-1)<CR>
+    inoremap <buffer> <silent> ]]   <C-o>:call <SID>Tlist_Window_Move_To_File(1)<CR>
+    inoremap <buffer> <silent> <Tab> <C-o>:call <SID>Tlist_Window_Move_To_File(1)<CR>
+    inoremap <buffer> <silent> <F1>  <C-o>:call <SID>Tlist_Window_Toggle_Help_Text()<CR>
+    inoremap <buffer> <silent> q    <C-o>:close<CR>
+
+    " Map single left mouse click if the user wants this functionality
+    if g:Tlist_Use_SingleClick == 1
+        " Contributed by Bindu Wavell
+        " attempt to perform single click mapping, it would be much
+        " nicer if we could nnoremap <buffer> ... however vim does
+        " not fire the <buffer> <leftmouse> when you use the mouse
+        " to enter a buffer.
+        let clickmap = ':if bufname("%") =~ "__Tag_List__" <bar> ' .
+                    \ 'call <SID>Tlist_Window_Jump_To_Tag("useopen") ' .
+                    \ '<bar> endif <CR>'
+        if maparg('<leftmouse>', 'n') == ''
+            " no mapping for leftmouse
+            exe ':nnoremap <silent> <leftmouse> <leftmouse>' . clickmap
+        else
+            " we have a mapping
+            let mapcmd = ':nnoremap <silent> <leftmouse> <leftmouse>'
+            let mapcmd = mapcmd . substitute(substitute(
+                        \ maparg('<leftmouse>', 'n'), '|', '<bar>', 'g'),
+                        \ '\c^<leftmouse>', '', '')
+            let mapcmd = mapcmd . clickmap
+            exe mapcmd
+        endif
+    endif
+
+    " Define the taglist autocommands
+    augroup TagListAutoCmds
+        autocmd!
+        " Display the tag prototype for the tag under the cursor.
+        autocmd CursorHold __Tag_List__ call s:Tlist_Window_Show_Info()
+        " Highlight the current tag periodically
+        autocmd CursorHold * silent call s:Tlist_Window_Highlight_Tag(
+                            \ fnamemodify(bufname('%'), ':p'), line('.'), 1, 0)
+
+        " Adjust the Vim window width when taglist window is closed
+        autocmd BufUnload __Tag_List__ call s:Tlist_Post_Close_Cleanup()
+        " Close the fold for this buffer when leaving the buffer
+        if g:Tlist_File_Fold_Auto_Close
+            autocmd BufEnter * silent
+                \ call s:Tlist_Window_Open_File_Fold(expand('<abuf>'))
+        endif
+        " Exit Vim itself if only the taglist window is present (optional)
+        if g:Tlist_Exit_OnlyWindow
+           autocmd BufEnter __Tag_List__ nested
+                       \ call s:Tlist_Window_Exit_Only_Window()
+        endif
+        if s:tlist_app_name != "winmanager" &&
+                    \ !g:Tlist_Process_File_Always &&
+                    \ (!has('gui_running') || !g:Tlist_Show_Menu)
+            " Auto refresh the taglist window
+            autocmd BufEnter * call s:Tlist_Refresh()
+        endif
+
+        if !g:Tlist_Use_Horiz_Window
+            if v:version < 700
+                autocmd WinEnter * call s:Tlist_Window_Check_Width()
+            endif
+        endif
+        if v:version >= 700
+            autocmd TabEnter * silent call s:Tlist_Refresh_Folds()
+        endif
+    augroup end
+
+    " Restore the previous cpoptions settings
+    let &cpoptions = old_cpoptions
+endfunction
+
+" Tlist_Window_Refresh
+" Display the tags for all the files in the taglist window
+function! s:Tlist_Window_Refresh()
+    call s:Tlist_Log_Msg('Tlist_Window_Refresh()')
+    " Set report option to a huge value to prevent informational messages
+    " while deleting the lines
+    let old_report = &report
+    set report=99999
+
+    " Mark the buffer as modifiable
+    setlocal modifiable
+
+    " Delete the contents of the buffer to the black-hole register
+    silent! %delete _
+
+    " As we have cleared the taglist window, mark all the files
+    " as not visible
+    let i = 0
+    while i < s:tlist_file_count
+        let s:tlist_{i}_visible = 0
+        let i = i + 1
+    endwhile
+
+    if g:Tlist_Compact_Format == 0
+        " Display help in non-compact mode
+        call s:Tlist_Window_Display_Help()
+    endif
+
+    " Mark the buffer as not modifiable
+    setlocal nomodifiable
+
+    " Restore the report option
+    let &report = old_report
+
+    " If the tags for only one file should be displayed in the taglist
+    " window, then no need to add the tags here. The bufenter autocommand
+    " will add the tags for that file.
+    if g:Tlist_Show_One_File
+        return
+    endif
+
+    " List all the tags for the previously processed files
+    " Do this only if taglist is configured to display tags for more than
+    " one file. Otherwise, when Tlist_Show_One_File is configured,
+    " tags for the wrong file will be displayed.
+    let i = 0
+    while i < s:tlist_file_count
+        call s:Tlist_Window_Refresh_File(s:tlist_{i}_filename,
+                    \ s:tlist_{i}_filetype)
+        let i = i + 1
+    endwhile
+
+    if g:Tlist_Auto_Update
+        " Add and list the tags for all buffers in the Vim buffer list
+        let i = 1
+        let last_bufnum = bufnr('$')
+        while i <= last_bufnum
+            if buflisted(i)
+                let fname = fnamemodify(bufname(i), ':p')
+                let ftype = s:Tlist_Get_Buffer_Filetype(i)
+                " If the file doesn't support tag listing, skip it
+                if !s:Tlist_Skip_File(fname, ftype)
+                    call s:Tlist_Window_Refresh_File(fname, ftype)
+                endif
+            endif
+            let i = i + 1
+        endwhile
+    endif
+
+    " If Tlist_File_Fold_Auto_Close option is set, then close all the folds
+    if g:Tlist_File_Fold_Auto_Close
+        " Close all the folds
+        silent! %foldclose
+    endif
+
+    " Move the cursor to the top of the taglist window
+    normal! gg
+endfunction
+
+" Tlist_Post_Close_Cleanup()
+" Close the taglist window and adjust the Vim window width
+function! s:Tlist_Post_Close_Cleanup()
+    call s:Tlist_Log_Msg('Tlist_Post_Close_Cleanup()')
+    " Mark all the files as not visible
+    let i = 0
+    while i < s:tlist_file_count
+        let s:tlist_{i}_visible = 0
+        let i = i + 1
+    endwhile
+
+    " Remove the taglist autocommands
+    silent! autocmd! TagListAutoCmds
+
+    " Clear all the highlights
+    match none
+
+    silent! syntax clear TagListTitle
+    silent! syntax clear TagListComment
+    silent! syntax clear TagListTagScope
+
+    " Remove the left mouse click mapping if it was setup initially
+    if g:Tlist_Use_SingleClick
+        if hasmapto('<LeftMouse>')
+            nunmap <LeftMouse>
+        endif
+    endif
+
+    if s:tlist_app_name != "winmanager"
+    if g:Tlist_Use_Horiz_Window || g:Tlist_Inc_Winwidth == 0 ||
+                \ s:tlist_winsize_chgd != 1 ||
+                \ &columns < (80 + g:Tlist_WinWidth)
+        " No need to adjust window width if using horizontally split taglist
+        " window or if columns is less than 101 or if the user chose not to
+        " adjust the window width
+    else
+        " If the user didn't manually move the window, then restore the window
+        " position to the pre-taglist position
+        if s:tlist_pre_winx != -1 && s:tlist_pre_winy != -1 &&
+                    \ getwinposx() == s:tlist_winx &&
+                    \ getwinposy() == s:tlist_winy
+            exe 'winpos ' . s:tlist_pre_winx . ' ' . s:tlist_pre_winy
+        endif
+
+        " Adjust the Vim window width
+        let &columns= &columns - (g:Tlist_WinWidth + 1)
+    endif
+    endif
+
+    let s:tlist_winsize_chgd = -1
+
+    " Reset taglist state variables
+    if s:tlist_app_name == "winmanager"
+        let s:tlist_app_name = "none"
+    endif
+    let s:tlist_window_initialized = 0
+endfunction
+
+" Tlist_Window_Refresh_File()
+" List the tags defined in the specified file in a Vim window
+function! s:Tlist_Window_Refresh_File(filename, ftype)
+    call s:Tlist_Log_Msg('Tlist_Window_Refresh_File (' . a:filename . ')')
+    " First check whether the file already exists
+    let fidx = s:Tlist_Get_File_Index(a:filename)
+    if fidx != -1
+        let file_listed = 1
+    else
+        let file_listed = 0
+    endif
+
+    if !file_listed
+        " Check whether this file is removed based on user request
+        " If it is, then don't display the tags for this file
+        if s:Tlist_User_Removed_File(a:filename)
+            return
+        endif
+    endif
+
+    if file_listed && s:tlist_{fidx}_visible
+        " Check whether the file tags are currently valid
+        if s:tlist_{fidx}_valid
+            " Goto the first line in the file
+            exe s:tlist_{fidx}_start
+
+            " If the line is inside a fold, open the fold
+            if foldclosed('.') != -1
+                exe "silent! " . s:tlist_{fidx}_start . "," .
+                            \ s:tlist_{fidx}_end . "foldopen!"
+            endif
+            return
+        endif
+
+        " Discard and remove the tags for this file from display
+        call s:Tlist_Discard_TagInfo(fidx)
+        call s:Tlist_Window_Remove_File_From_Display(fidx)
+    endif
+
+    " Process and generate a list of tags defined in the file
+    if !file_listed || !s:tlist_{fidx}_valid
+        let ret_fidx = s:Tlist_Process_File(a:filename, a:ftype)
+        if ret_fidx == -1
+            return
+        endif
+        let fidx = ret_fidx
+    endif
+
+    " Set report option to a huge value to prevent informational messages
+    " while adding lines to the taglist window
+    let old_report = &report
+    set report=99999
+
+    if g:Tlist_Show_One_File
+        " Remove the previous file
+        if s:tlist_cur_file_idx != -1
+            call s:Tlist_Window_Remove_File_From_Display(s:tlist_cur_file_idx)
+            let s:tlist_{s:tlist_cur_file_idx}_visible = 0
+            let s:tlist_{s:tlist_cur_file_idx}_start = 0
+            let s:tlist_{s:tlist_cur_file_idx}_end = 0
+        endif
+        let s:tlist_cur_file_idx = fidx
+    endif
+
+    " Mark the buffer as modifiable
+    setlocal modifiable
+
+    " Add new files to the end of the window. For existing files, add them at
+    " the same line where they were previously present. If the file is not
+    " visible, then add it at the end
+    if s:tlist_{fidx}_start == 0 || !s:tlist_{fidx}_visible
+        if g:Tlist_Compact_Format
+            let s:tlist_{fidx}_start = line('$')
+        else
+            let s:tlist_{fidx}_start = line('$') + 1
+        endif
+    endif
+
+    let s:tlist_{fidx}_visible = 1
+
+    " Goto the line where this file should be placed
+    if g:Tlist_Compact_Format
+        exe s:tlist_{fidx}_start
+    else
+        exe s:tlist_{fidx}_start - 1
+    endif
+
+    let txt = fnamemodify(s:tlist_{fidx}_filename, ':t') . ' (' .
+                \ fnamemodify(s:tlist_{fidx}_filename, ':p:h') . ')'
+    if g:Tlist_Compact_Format == 0
+        silent! put =txt
+    else
+        silent! put! =txt
+        " Move to the next line
+        exe line('.') + 1
+    endif
+    let file_start = s:tlist_{fidx}_start
+
+    " Add the tag names grouped by tag type to the buffer with a title
+    let i = 1
+    let ttype_cnt = s:tlist_{a:ftype}_count
+    while i <= ttype_cnt
+        let ttype = s:tlist_{a:ftype}_{i}_name
+        " Add the tag type only if there are tags for that type
+        let fidx_ttype = 's:tlist_' . fidx . '_' . ttype
+        let ttype_txt = {fidx_ttype}
+        if ttype_txt != ''
+            let txt = '  ' . s:tlist_{a:ftype}_{i}_fullname
+            if g:Tlist_Compact_Format == 0
+                let ttype_start_lnum = line('.') + 1
+                silent! put =txt
+            else
+                let ttype_start_lnum = line('.')
+                silent! put! =txt
+            endif
+            silent! put =ttype_txt
+
+            let {fidx_ttype}_offset = ttype_start_lnum - file_start
+
+            " create a fold for this tag type
+            let fold_start = ttype_start_lnum
+            let fold_end = fold_start + {fidx_ttype}_count
+            exe fold_start . ',' . fold_end  . 'fold'
+
+            " Adjust the cursor position
+            if g:Tlist_Compact_Format == 0
+                exe ttype_start_lnum + {fidx_ttype}_count
+            else
+                exe ttype_start_lnum + {fidx_ttype}_count + 1
+            endif
+
+            if g:Tlist_Compact_Format == 0
+                " Separate the tag types by a empty line
+                silent! put =''
+            endif
+        endif
+        let i = i + 1
+    endwhile
+
+    if s:tlist_{fidx}_tag_count == 0
+        if g:Tlist_Compact_Format == 0
+            silent! put =''
+        endif
+    endif
+
+    let s:tlist_{fidx}_end = line('.') - 1
+
+    " Create a fold for the entire file
+    exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'fold'
+    exe 'silent! ' . s:tlist_{fidx}_start . ',' .
+                \ s:tlist_{fidx}_end . 'foldopen!'
+
+    " Goto the starting line for this file,
+    exe s:tlist_{fidx}_start
+
+    if s:tlist_app_name == "winmanager"
+        " To handle a bug in the winmanager plugin, add a space at the
+        " last line
+        call setline('$', ' ')
+    endif
+
+    " Mark the buffer as not modifiable
+    setlocal nomodifiable
+
+    " Restore the report option
+    let &report = old_report
+
+    " Update the start and end line numbers for all the files following this
+    " file
+    let start = s:tlist_{fidx}_start
+    " include the empty line after the last line
+    if g:Tlist_Compact_Format
+        let end = s:tlist_{fidx}_end
+    else
+        let end = s:tlist_{fidx}_end + 1
+    endif
+    call s:Tlist_Window_Update_Line_Offsets(fidx + 1, 1, end - start + 1)
+
+    " Now that we have updated the taglist window, update the tags
+    " menu (if present)
+    if g:Tlist_Show_Menu
+        call s:Tlist_Menu_Update_File(1)
+    endif
+endfunction
+
+" Tlist_Init_File
+" Initialize the variables for a new file
+function! s:Tlist_Init_File(filename, ftype)
+    call s:Tlist_Log_Msg('Tlist_Init_File (' . a:filename . ')')
+    " Add new files at the end of the list
+    let fidx = s:tlist_file_count
+    let s:tlist_file_count = s:tlist_file_count + 1
+    " Add the new file name to the taglist list of file names
+    let s:tlist_file_names = s:tlist_file_names . a:filename . "\n"
+
+    " Initialize the file variables
+    let s:tlist_{fidx}_filename = a:filename
+    let s:tlist_{fidx}_sort_type = g:Tlist_Sort_Type
+    let s:tlist_{fidx}_filetype = a:ftype
+    let s:tlist_{fidx}_mtime = -1
+    let s:tlist_{fidx}_start = 0
+    let s:tlist_{fidx}_end = 0
+    let s:tlist_{fidx}_valid = 0
+    let s:tlist_{fidx}_visible = 0
+    let s:tlist_{fidx}_tag_count = 0
+    let s:tlist_{fidx}_menu_cmd = ''
+
+    " Initialize the tag type variables
+    let i = 1
+    while i <= s:tlist_{a:ftype}_count
+        let ttype = s:tlist_{a:ftype}_{i}_name
+        let s:tlist_{fidx}_{ttype} = ''
+        let s:tlist_{fidx}_{ttype}_offset = 0
+        let s:tlist_{fidx}_{ttype}_count = 0
+        let i = i + 1
+    endwhile
+
+    return fidx
+endfunction
+
+" Tlist_Get_Tag_Type_By_Tag
+" Return the tag type for the specified tag index
+function! s:Tlist_Get_Tag_Type_By_Tag(fidx, tidx)
+    let ttype_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_type'
+
+    " Already parsed and have the tag name
+    if exists(ttype_var)
+        return {ttype_var}
+    endif
+
+    let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag
+    let {ttype_var} = s:Tlist_Extract_Tagtype(tag_line)
+
+    return {ttype_var}
+endfunction
+
+" Tlist_Get_Tag_Prototype
+function! s:Tlist_Get_Tag_Prototype(fidx, tidx)
+    let tproto_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_proto'
+
+    " Already parsed and have the tag prototype
+    if exists(tproto_var)
+        return {tproto_var}
+    endif
+
+    " Parse and extract the tag prototype
+    let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag
+    let start = stridx(tag_line, '/^') + 2
+    let end = stridx(tag_line, '/;"' . "\t")
+    if tag_line[end - 1] == '$'
+        let end = end -1
+    endif
+    let tag_proto = strpart(tag_line, start, end - start)
+    let {tproto_var} = substitute(tag_proto, '\s*', '', '')
+
+    return {tproto_var}
+endfunction
+
+" Tlist_Get_Tag_SearchPat
+function! s:Tlist_Get_Tag_SearchPat(fidx, tidx)
+    let tpat_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_searchpat'
+
+    " Already parsed and have the tag search pattern
+    if exists(tpat_var)
+        return {tpat_var}
+    endif
+
+    " Parse and extract the tag search pattern
+    let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag
+    let start = stridx(tag_line, '/^') + 2
+    let end = stridx(tag_line, '/;"' . "\t")
+    if tag_line[end - 1] == '$'
+        let end = end -1
+    endif
+    let {tpat_var} = '\V\^' . strpart(tag_line, start, end - start) .
+                        \ (tag_line[end] == '$' ? '\$' : '')
+
+    return {tpat_var}
+endfunction
+
+" Tlist_Get_Tag_Linenum
+" Return the tag line number, given the tag index
+function! s:Tlist_Get_Tag_Linenum(fidx, tidx)
+    let tline_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_linenum'
+
+    " Already parsed and have the tag line number
+    if exists(tline_var)
+        return {tline_var}
+    endif
+
+    " Parse and extract the tag line number
+    let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag
+    let start = strridx(tag_line, 'line:') + 5
+    let end = strridx(tag_line, "\t")
+    if end < start
+        let {tline_var} = strpart(tag_line, start) + 0
+    else
+        let {tline_var} = strpart(tag_line, start, end - start) + 0
+    endif
+
+    return {tline_var}
+endfunction
+
+" Tlist_Parse_Tagline
+" Parse a tag line from the ctags output. Separate the tag output based on the
+" tag type and store it in the tag type variable.
+" The format of each line in the ctags output is:
+"
+"     tag_name<TAB>file_name<TAB>ex_cmd;"<TAB>extension_fields
+"
+function! s:Tlist_Parse_Tagline(tag_line)
+    if a:tag_line == ''
+        " Skip empty lines
+        return
+    endif
+
+    " Extract the tag type
+    let ttype = s:Tlist_Extract_Tagtype(a:tag_line)
+
+    " Make sure the tag type is a valid and supported one
+    if ttype == '' || stridx(s:ctags_flags, ttype) == -1
+        " Line is not in proper tags format or Tag type is not supported
+        return
+    endif
+
+    " Update the total tag count
+    let s:tidx = s:tidx + 1
+
+    " The following variables are used to optimize this code.  Vim is slow in
+    " using curly brace names. To reduce the amount of processing needed, the
+    " curly brace variables are pre-processed here
+    let fidx_tidx = 's:tlist_' . s:fidx . '_' . s:tidx
+    let fidx_ttype = 's:tlist_' . s:fidx . '_' . ttype
+
+    " Update the count of this tag type
+    let ttype_idx = {fidx_ttype}_count + 1
+    let {fidx_ttype}_count = ttype_idx
+
+    " Store the ctags output for this tag
+    let {fidx_tidx}_tag = a:tag_line
+
+    " Store the tag index and the tag type index (back pointers)
+    let {fidx_ttype}_{ttype_idx} = s:tidx
+    let {fidx_tidx}_ttype_idx = ttype_idx
+
+    " Extract the tag name
+    let tag_name = strpart(a:tag_line, 0, stridx(a:tag_line, "\t"))
+
+    " Extract the tag scope/prototype
+    if g:Tlist_Display_Prototype
+        let ttxt = '    ' . s:Tlist_Get_Tag_Prototype(s:fidx, s:tidx)
+    else
+        let ttxt = '    ' . tag_name
+
+        " Add the tag scope, if it is available and is configured. Tag
+        " scope is the last field after the 'line:<num>\t' field
+        if g:Tlist_Display_Tag_Scope
+            let tag_scope = s:Tlist_Extract_Tag_Scope(a:tag_line)
+            if tag_scope != ''
+                let ttxt = ttxt . ' [' . tag_scope . ']'
+            endif
+        endif
+    endif
+
+    " Add this tag to the tag type variable
+    let {fidx_ttype} = {fidx_ttype} . ttxt . "\n"
+
+    " Save the tag name
+    let {fidx_tidx}_tag_name = tag_name
+endfunction
+
+" Tlist_Process_File
+" Get the list of tags defined in the specified file and store them
+" in Vim variables. Returns the file index where the tags are stored.
+function! s:Tlist_Process_File(filename, ftype)
+    call s:Tlist_Log_Msg('Tlist_Process_File (' . a:filename . ', ' .
+                \ a:ftype . ')')
+    " Check whether this file is supported
+    if s:Tlist_Skip_File(a:filename, a:ftype)
+        return -1
+    endif
+
+    " If the tag types for this filetype are not yet created, then create
+    " them now
+    let var = 's:tlist_' . a:ftype . '_count'
+    if !exists(var)
+        if s:Tlist_FileType_Init(a:ftype) == 0
+            return -1
+        endif
+    endif
+
+    " If this file is already processed, then use the cached values
+    let fidx = s:Tlist_Get_File_Index(a:filename)
+    if fidx == -1
+        " First time, this file is loaded
+        let fidx = s:Tlist_Init_File(a:filename, a:ftype)
+    else
+        " File was previously processed. Discard the tag information
+        call s:Tlist_Discard_TagInfo(fidx)
+    endif
+
+    let s:tlist_{fidx}_valid = 1
+
+    " Exuberant ctags arguments to generate a tag list
+    let ctags_args = ' -f - --format=2 --excmd=pattern --fields=nks '
+
+    " Form the ctags argument depending on the sort type
+    if s:tlist_{fidx}_sort_type == 'name'
+        let ctags_args = ctags_args . '--sort=yes'
+    else
+        let ctags_args = ctags_args . '--sort=no'
+    endif
+
+    " Add the filetype specific arguments
+    let ctags_args = ctags_args . ' ' . s:tlist_{a:ftype}_ctags_args
+
+    " Ctags command to produce output with regexp for locating the tags
+    let ctags_cmd = g:Tlist_Ctags_Cmd . ctags_args
+    let ctags_cmd = ctags_cmd . ' "' . a:filename . '"'
+
+    if &shellxquote == '"'
+        " Double-quotes within double-quotes will not work in the
+        " command-line.If the 'shellxquote' option is set to double-quotes,
+        " then escape the double-quotes in the ctags command-line.
+        let ctags_cmd = escape(ctags_cmd, '"')
+    endif
+
+    " In Windows 95, if not using cygwin, disable the 'shellslash'
+    " option. Otherwise, this will cause problems when running the
+    " ctags command.
+    if has('win95') && !has('win32unix')
+        let old_shellslash = &shellslash
+        set noshellslash
+    endif
+
+    if has('win32') && !has('win32unix') && !has('win95')
+                \ && (&shell =~ 'cmd.exe')
+        " Windows does not correctly deal with commands that have more than 1
+        " set of double quotes.  It will strip them all resulting in:
+        " 'C:\Program' is not recognized as an internal or external command
+        " operable program or batch file.  To work around this, place the
+        " command inside a batch file and call the batch file.
+        " Do this only on Win2K, WinXP and above.
+        " Contributed by: David Fishburn.
+        let s:taglist_tempfile = fnamemodify(tempname(), ':h') .
+                    \ '\taglist.cmd'
+        exe 'redir! > ' . s:taglist_tempfile
+        silent echo ctags_cmd
+        redir END
+
+        call s:Tlist_Log_Msg('Cmd inside batch file: ' . ctags_cmd)
+        let ctags_cmd = '"' . s:taglist_tempfile . '"'
+    endif
+
+    call s:Tlist_Log_Msg('Cmd: ' . ctags_cmd)
+
+    " Run ctags and get the tag list
+    let cmd_output = system(ctags_cmd)
+
+    " Restore the value of the 'shellslash' option.
+    if has('win95') && !has('win32unix')
+        let &shellslash = old_shellslash
+    endif
+
+    if exists('s:taglist_tempfile')
+        " Delete the temporary cmd file created on MS-Windows
+        call delete(s:taglist_tempfile)
+    endif
+
+    " Handle errors
+    if v:shell_error
+        let msg = "Taglist: Failed to generate tags for " . a:filename
+        call s:Tlist_Warning_Msg(msg)
+        if cmd_output != ''
+            call s:Tlist_Warning_Msg(cmd_output)
+        endif
+        return fidx
+    endif
+
+    " Store the modification time for the file
+    let s:tlist_{fidx}_mtime = getftime(a:filename)
+
+    " No tags for current file
+    if cmd_output == ''
+        call s:Tlist_Log_Msg('No tags defined in ' . a:filename)
+        return fidx
+    endif
+
+    call s:Tlist_Log_Msg('Generated tags information for ' . a:filename)
+
+    if v:version > 601
+        " The following script local variables are used by the
+        " Tlist_Parse_Tagline() function.
+        let s:ctags_flags = s:tlist_{a:ftype}_ctags_flags
+        let s:fidx = fidx
+        let s:tidx = 0
+
+        " Process the ctags output one line at a time.  The substitute()
+        " command is used to parse the tag lines instead of using the
+        " matchstr()/stridx()/strpart() functions for performance reason
+        call substitute(cmd_output, "\\([^\n]\\+\\)\n",
+                    \ '\=s:Tlist_Parse_Tagline(submatch(1))', 'g')
+
+        " Save the number of tags for this file
+        let s:tlist_{fidx}_tag_count = s:tidx
+
+        " The following script local variables are no longer needed
+        unlet! s:ctags_flags
+        unlet! s:tidx
+        unlet! s:fidx
+    else
+        " Due to a bug in Vim earlier than version 6.1,
+        " we cannot use substitute() to parse the ctags output.
+        " Instead the slow str*() functions are used
+        let ctags_flags = s:tlist_{a:ftype}_ctags_flags
+        let tidx = 0
+
+        while cmd_output != ''
+            " Extract one line at a time
+            let idx = stridx(cmd_output, "\n")
+            let one_line = strpart(cmd_output, 0, idx)
+            " Remove the line from the tags output
+            let cmd_output = strpart(cmd_output, idx + 1)
+
+            if one_line == ''
+                " Line is not in proper tags format
+                continue
+            endif
+
+            " Extract the tag type
+            let ttype = s:Tlist_Extract_Tagtype(one_line)
+
+            " Make sure the tag type is a valid and supported one
+            if ttype == '' || stridx(ctags_flags, ttype) == -1
+                " Line is not in proper tags format or Tag type is not
+                " supported
+                continue
+            endif
+
+            " Update the total tag count
+            let tidx = tidx + 1
+
+            " The following variables are used to optimize this code.  Vim is
+            " slow in using curly brace names. To reduce the amount of
+            " processing needed, the curly brace variables are pre-processed
+            " here
+            let fidx_tidx = 's:tlist_' . fidx . '_' . tidx
+            let fidx_ttype = 's:tlist_' . fidx . '_' . ttype
+
+            " Update the count of this tag type
+            let ttype_idx = {fidx_ttype}_count + 1
+            let {fidx_ttype}_count = ttype_idx
+
+            " Store the ctags output for this tag
+            let {fidx_tidx}_tag = one_line
+
+            " Store the tag index and the tag type index (back pointers)
+            let {fidx_ttype}_{ttype_idx} = tidx
+            let {fidx_tidx}_ttype_idx = ttype_idx
+
+            " Extract the tag name
+            let tag_name = strpart(one_line, 0, stridx(one_line, "\t"))
+
+            " Extract the tag scope/prototype
+            if g:Tlist_Display_Prototype
+                let ttxt = '    ' . s:Tlist_Get_Tag_Prototype(fidx, tidx)
+            else
+                let ttxt = '    ' . tag_name
+
+                " Add the tag scope, if it is available and is configured. Tag
+                " scope is the last field after the 'line:<num>\t' field
+                if g:Tlist_Display_Tag_Scope
+                    let tag_scope = s:Tlist_Extract_Tag_Scope(one_line)
+                    if tag_scope != ''
+                        let ttxt = ttxt . ' [' . tag_scope . ']'
+                    endif
+                endif
+            endif
+
+            " Add this tag to the tag type variable
+            let {fidx_ttype} = {fidx_ttype} . ttxt . "\n"
+
+            " Save the tag name
+            let {fidx_tidx}_tag_name = tag_name
+        endwhile
+
+        " Save the number of tags for this file
+        let s:tlist_{fidx}_tag_count = tidx
+    endif
+
+    call s:Tlist_Log_Msg('Processed ' . s:tlist_{fidx}_tag_count . 
+                \ ' tags in ' . a:filename)
+
+    return fidx
+endfunction
+
+" Tlist_Update_File
+" Update the tags for a file (if needed)
+function! Tlist_Update_File(filename, ftype)
+    call s:Tlist_Log_Msg('Tlist_Update_File (' . a:filename . ')')
+    " If the file doesn't support tag listing, skip it
+    if s:Tlist_Skip_File(a:filename, a:ftype)
+        return
+    endif
+
+    " Convert the file name to a full path
+    let fname = fnamemodify(a:filename, ':p')
+
+    " First check whether the file already exists
+    let fidx = s:Tlist_Get_File_Index(fname)
+
+    if fidx != -1 && s:tlist_{fidx}_valid
+        " File exists and the tags are valid
+        " Check whether the file was modified after the last tags update
+        " If it is modified, then update the tags
+        if s:tlist_{fidx}_mtime == getftime(fname)
+            return
+        endif
+    else
+        " If the tags were removed previously based on a user request,
+        " as we are going to update the tags (based on the user request),
+        " remove the filename from the deleted list
+        call s:Tlist_Update_Remove_List(fname, 0)
+    endif
+
+    " If the taglist window is opened, update it
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum == -1
+        " Taglist window is not present. Just update the taglist
+        " and return
+        call s:Tlist_Process_File(fname, a:ftype)
+    else
+        if g:Tlist_Show_One_File && s:tlist_cur_file_idx != -1
+            " If tags for only one file are displayed and we are not
+            " updating the tags for that file, then no need to
+            " refresh the taglist window. Otherwise, the taglist
+            " window should be updated.
+            if s:tlist_{s:tlist_cur_file_idx}_filename != fname
+                call s:Tlist_Process_File(fname, a:ftype)
+                return
+            endif
+        endif
+
+        " Save the current window number
+        let save_winnr = winnr()
+
+        " Goto the taglist window
+        call s:Tlist_Window_Goto_Window()
+
+        " Save the cursor position
+        let save_line = line('.')
+        let save_col = col('.')
+
+        " Update the taglist window
+        call s:Tlist_Window_Refresh_File(fname, a:ftype)
+
+        " Restore the cursor position
+        if v:version >= 601
+            call cursor(save_line, save_col)
+        else
+            exe save_line
+            exe 'normal! ' . save_col . '|'
+        endif
+
+        if winnr() != save_winnr
+            " Go back to the original window
+            call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w')
+        endif
+    endif
+
+    " Update the taglist menu
+    if g:Tlist_Show_Menu
+        call s:Tlist_Menu_Update_File(1)
+    endif
+endfunction
+
+" Tlist_Window_Close
+" Close the taglist window
+function! s:Tlist_Window_Close()
+    call s:Tlist_Log_Msg('Tlist_Window_Close()')
+    " Make sure the taglist window exists
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum == -1
+        call s:Tlist_Warning_Msg('Error: Taglist window is not open')
+        return
+    endif
+
+    if winnr() == winnum
+        " Already in the taglist window. Close it and return
+        if winbufnr(2) != -1
+            " If a window other than the taglist window is open,
+            " then only close the taglist window.
+            close
+        endif
+    else
+        " Goto the taglist window, close it and then come back to the
+        " original window
+        let curbufnr = bufnr('%')
+        exe winnum . 'wincmd w'
+        close
+        " Need to jump back to the original window only if we are not
+        " already in that window
+        let winnum = bufwinnr(curbufnr)
+        if winnr() != winnum
+            exe winnum . 'wincmd w'
+        endif
+    endif
+endfunction
+
+" Tlist_Window_Mark_File_Window
+" Mark the current window as the file window to use when jumping to a tag.
+" Only if the current window is a non-plugin, non-preview and non-taglist
+" window
+function! s:Tlist_Window_Mark_File_Window()
+    if getbufvar('%', '&buftype') == '' && !&previewwindow
+        let w:tlist_file_window = "yes"
+    endif
+endfunction
+
+" Tlist_Window_Open
+" Open and refresh the taglist window
+function! s:Tlist_Window_Open()
+    call s:Tlist_Log_Msg('Tlist_Window_Open()')
+    " If the window is open, jump to it
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum != -1
+        " Jump to the existing window
+        if winnr() != winnum
+            exe winnum . 'wincmd w'
+        endif
+        return
+    endif
+
+    if s:tlist_app_name == "winmanager"
+        " Taglist plugin is no longer part of the winmanager app
+        let s:tlist_app_name = "none"
+    endif
+
+    " Get the filename and filetype for the specified buffer
+    let curbuf_name = fnamemodify(bufname('%'), ':p')
+    let curbuf_ftype = s:Tlist_Get_Buffer_Filetype('%')
+    let cur_lnum = line('.')
+
+    " Mark the current window as the desired window to open a file when a tag
+    " is selected.
+    call s:Tlist_Window_Mark_File_Window()
+
+    " Open the taglist window
+    call s:Tlist_Window_Create()
+
+    call s:Tlist_Window_Refresh()
+
+    if g:Tlist_Show_One_File
+        " Add only the current buffer and file
+        "
+        " If the file doesn't support tag listing, skip it
+        if !s:Tlist_Skip_File(curbuf_name, curbuf_ftype)
+            call s:Tlist_Window_Refresh_File(curbuf_name, curbuf_ftype)
+        endif
+    endif
+
+    if g:Tlist_File_Fold_Auto_Close
+        " Open the fold for the current file, as all the folds in
+        " the taglist window are closed
+        let fidx = s:Tlist_Get_File_Index(curbuf_name)
+        if fidx != -1
+            exe "silent! " . s:tlist_{fidx}_start . "," .
+                        \ s:tlist_{fidx}_end . "foldopen!"
+        endif
+    endif
+
+    " Highlight the current tag
+    call s:Tlist_Window_Highlight_Tag(curbuf_name, cur_lnum, 1, 1)
+endfunction
+
+" Tlist_Window_Toggle()
+" Open or close a taglist window
+function! s:Tlist_Window_Toggle()
+    call s:Tlist_Log_Msg('Tlist_Window_Toggle()')
+    " If taglist window is open then close it.
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum != -1
+        call s:Tlist_Window_Close()
+        return
+    endif
+
+    call s:Tlist_Window_Open()
+
+    " Go back to the original window, if Tlist_GainFocus_On_ToggleOpen is not
+    " set
+    if !g:Tlist_GainFocus_On_ToggleOpen
+        call s:Tlist_Exe_Cmd_No_Acmds('wincmd p')
+    endif
+
+    " Update the taglist menu
+    if g:Tlist_Show_Menu
+        call s:Tlist_Menu_Update_File(0)
+    endif
+endfunction
+
+" Tlist_Process_Filelist
+" Process multiple files. Each filename is separated by "\n"
+" Returns the number of processed files
+function! s:Tlist_Process_Filelist(file_names)
+    let flist = a:file_names
+
+    " Enable lazy screen updates
+    let old_lazyredraw = &lazyredraw
+    set lazyredraw
+
+    " Keep track of the number of processed files
+    let fcnt = 0
+
+    " Process one file at a time
+    while flist != ''
+        let nl_idx = stridx(flist, "\n")
+        let one_file = strpart(flist, 0, nl_idx)
+
+        " Remove the filename from the list
+        let flist = strpart(flist, nl_idx + 1)
+
+        if one_file == ''
+            continue
+        endif
+
+        " Skip directories
+        if isdirectory(one_file)
+            continue
+        endif
+
+        let ftype = s:Tlist_Detect_Filetype(one_file)
+
+        echon "\r                                                              "
+        echon "\rProcessing tags for " . fnamemodify(one_file, ':p:t')
+
+        let fcnt = fcnt + 1
+
+        call Tlist_Update_File(one_file, ftype)
+    endwhile
+
+    " Clear the displayed informational messages
+    echon "\r                                                            "
+
+    " Restore the previous state
+    let &lazyredraw = old_lazyredraw
+
+    return fcnt
+endfunction
+
+" Tlist_Process_Dir
+" Process the files in a directory matching the specified pattern
+function! s:Tlist_Process_Dir(dir_name, pat)
+    let flist = glob(a:dir_name . '/' . a:pat) . "\n"
+
+    let fcnt = s:Tlist_Process_Filelist(flist)
+
+    let len = strlen(a:dir_name)
+    if a:dir_name[len - 1] == '\' || a:dir_name[len - 1] == '/'
+        let glob_expr = a:dir_name . '*'
+    else
+        let glob_expr = a:dir_name . '/*'
+    endif
+    let all_files = glob(glob_expr) . "\n"
+
+    while all_files != ''
+        let nl_idx = stridx(all_files, "\n")
+        let one_file = strpart(all_files, 0, nl_idx)
+
+        let all_files = strpart(all_files, nl_idx + 1)
+        if one_file == ''
+            continue
+        endif
+
+        " Skip non-directory names
+        if !isdirectory(one_file)
+            continue
+        endif
+
+        echon "\r                                                              "
+        echon "\rProcessing files in directory " . fnamemodify(one_file, ':t')
+        let fcnt = fcnt + s:Tlist_Process_Dir(one_file, a:pat)
+    endwhile
+
+    return fcnt
+endfunction
+
+" Tlist_Add_Files_Recursive
+" Add files recursively from a directory
+function! s:Tlist_Add_Files_Recursive(dir, ...)
+    let dir_name = fnamemodify(a:dir, ':p')
+    if !isdirectory(dir_name)
+        call s:Tlist_Warning_Msg('Error: ' . dir_name . ' is not a directory')
+        return
+    endif
+
+    if a:0 == 1
+        " User specified file pattern
+        let pat = a:1
+    else
+        " Default file pattern
+        let pat = '*'
+    endif
+
+    echon "\r                                                              "
+    echon "\rProcessing files in directory " . fnamemodify(dir_name, ':t')
+    let fcnt = s:Tlist_Process_Dir(dir_name, pat)
+
+    echon "\rAdded " . fcnt . " files to the taglist"
+endfunction
+
+" Tlist_Add_Files
+" Add the specified list of files to the taglist
+function! s:Tlist_Add_Files(...)
+    let flist = ''
+    let i = 1
+
+    " Get all the files matching the file patterns supplied as argument
+    while i <= a:0
+        let flist = flist . glob(a:{i}) . "\n"
+        let i = i + 1
+    endwhile
+
+    if flist == ''
+        call s:Tlist_Warning_Msg('Error: No matching files are found')
+        return
+    endif
+
+    let fcnt = s:Tlist_Process_Filelist(flist)
+    echon "\rAdded " . fcnt . " files to the taglist"
+endfunction
+
+" Tlist_Extract_Tagtype
+" Extract the tag type from the tag text
+function! s:Tlist_Extract_Tagtype(tag_line)
+    " The tag type is after the tag prototype field. The prototype field
+    " ends with the /;"\t string. We add 4 at the end to skip the characters
+    " in this special string..
+    let start = strridx(a:tag_line, '/;"' . "\t") + 4
+    let end = strridx(a:tag_line, 'line:') - 1
+    let ttype = strpart(a:tag_line, start, end - start)
+
+    return ttype
+endfunction
+
+" Tlist_Extract_Tag_Scope
+" Extract the tag scope from the tag text
+function! s:Tlist_Extract_Tag_Scope(tag_line)
+    let start = strridx(a:tag_line, 'line:')
+    let end = strridx(a:tag_line, "\t")
+    if end <= start
+        return ''
+    endif
+
+    let tag_scope = strpart(a:tag_line, end + 1)
+    let tag_scope = strpart(tag_scope, stridx(tag_scope, ':') + 1)
+
+    return tag_scope
+endfunction
+
+" Tlist_Refresh()
+" Refresh the taglist
+function! s:Tlist_Refresh()
+    call s:Tlist_Log_Msg('Tlist_Refresh (Skip_Refresh = ' .
+                \ s:Tlist_Skip_Refresh . ', ' . bufname('%') . ')')
+    " If we are entering the buffer from one of the taglist functions, then
+    " no need to refresh the taglist window again.
+    if s:Tlist_Skip_Refresh
+        " We still need to update the taglist menu
+        if g:Tlist_Show_Menu
+            call s:Tlist_Menu_Update_File(0)
+        endif
+        return
+    endif
+
+    " If part of the winmanager plugin and not configured to process
+    " tags always and not configured to display the tags menu, then return
+    if (s:tlist_app_name == 'winmanager') && !g:Tlist_Process_File_Always
+                \ && !g:Tlist_Show_Menu
+        return
+    endif
+
+    " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help
+    if &buftype != ''
+        return
+    endif
+
+    let filename = fnamemodify(bufname('%'), ':p')
+    let ftype = s:Tlist_Get_Buffer_Filetype('%')
+
+    " If the file doesn't support tag listing, skip it
+    if s:Tlist_Skip_File(filename, ftype)
+        return
+    endif
+
+    let tlist_win = bufwinnr(g:TagList_title)
+
+    " If the taglist window is not opened and not configured to process
+    " tags always and not displaying the tags menu, then return
+    if tlist_win == -1 && !g:Tlist_Process_File_Always && !g:Tlist_Show_Menu
+        return
+    endif
+
+    let fidx = s:Tlist_Get_File_Index(filename)
+    if fidx == -1
+        " Check whether this file is removed based on user request
+        " If it is, then don't display the tags for this file
+        if s:Tlist_User_Removed_File(filename)
+            return
+        endif
+
+        " If the taglist should not be auto updated, then return
+        if !g:Tlist_Auto_Update
+            return
+        endif
+    endif
+
+    let cur_lnum = line('.')
+
+    if fidx == -1
+        " Update the tags for the file
+        let fidx = s:Tlist_Process_File(filename, ftype)
+    else
+        let mtime = getftime(filename)
+        if s:tlist_{fidx}_mtime != mtime
+            " Invalidate the tags listed for this file
+            let s:tlist_{fidx}_valid = 0
+
+            " Update the taglist and the window
+            call Tlist_Update_File(filename, ftype)
+
+            " Store the new file modification time
+            let s:tlist_{fidx}_mtime = mtime
+        endif
+    endif
+
+    " Update the taglist window
+    if tlist_win != -1
+        " Disable screen updates
+        let old_lazyredraw = &lazyredraw
+        set nolazyredraw
+
+        " Save the current window number
+        let save_winnr = winnr()
+
+        " Goto the taglist window
+        call s:Tlist_Window_Goto_Window()
+
+        if !g:Tlist_Auto_Highlight_Tag || !g:Tlist_Highlight_Tag_On_BufEnter
+            " Save the cursor position
+            let save_line = line('.')
+            let save_col = col('.')
+        endif
+
+        " Update the taglist window
+        call s:Tlist_Window_Refresh_File(filename, ftype)
+
+        " Open the fold for the file
+        exe "silent! " . s:tlist_{fidx}_start . "," .
+                    \ s:tlist_{fidx}_end . "foldopen!"
+
+        if g:Tlist_Highlight_Tag_On_BufEnter && g:Tlist_Auto_Highlight_Tag
+            if g:Tlist_Show_One_File && s:tlist_cur_file_idx != fidx
+                " If displaying tags for only one file in the taglist
+                " window and about to display the tags for a new file,
+                " then center the current tag line for the new file
+                let center_tag_line = 1
+            else
+                let center_tag_line = 0
+            endif
+
+            " Highlight the current tag
+            call s:Tlist_Window_Highlight_Tag(filename, cur_lnum, 1, center_tag_line)
+        else
+            " Restore the cursor position
+            if v:version >= 601
+                call cursor(save_line, save_col)
+            else
+                exe save_line
+                exe 'normal! ' . save_col . '|'
+            endif
+        endif
+
+        " Jump back to the original window
+        if save_winnr != winnr()
+            call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w')
+        endif
+
+        " Restore screen updates
+        let &lazyredraw = old_lazyredraw
+    endif
+
+    " Update the taglist menu
+    if g:Tlist_Show_Menu
+        call s:Tlist_Menu_Update_File(0)
+    endif
+endfunction
+
+" Tlist_Change_Sort()
+" Change the sort order of the tag listing
+" caller == 'cmd', command used in the taglist window
+" caller == 'menu', taglist menu
+" action == 'toggle', toggle sort from name to order and vice versa
+" action == 'set', set the sort order to sort_type
+function! s:Tlist_Change_Sort(caller, action, sort_type)
+    call s:Tlist_Log_Msg('Tlist_Change_Sort (caller = ' . a:caller .
+            \ ', action = ' . a:action . ', sort_type = ' . a:sort_type . ')')
+    if a:caller == 'cmd'
+        let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.'))
+        if fidx == -1
+            return
+        endif
+
+        " Remove the previous highlighting
+        match none
+    elseif a:caller == 'menu'
+        let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p'))
+        if fidx == -1
+            return
+        endif
+    endif
+
+    if a:action == 'toggle'
+        let sort_type = s:tlist_{fidx}_sort_type
+
+        " Toggle the sort order from 'name' to 'order' and vice versa
+        if sort_type == 'name'
+            let s:tlist_{fidx}_sort_type = 'order'
+        else
+            let s:tlist_{fidx}_sort_type = 'name'
+        endif
+    else
+        let s:tlist_{fidx}_sort_type = a:sort_type
+    endif
+
+    " Invalidate the tags listed for this file
+    let s:tlist_{fidx}_valid = 0
+
+    if a:caller  == 'cmd'
+        " Save the current line for later restoration
+        let curline = '\V\^' . getline('.') . '\$'
+
+        call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename,
+                    \   s:tlist_{fidx}_filetype)
+
+        exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!'
+
+        " Go back to the cursor line before the tag list is sorted
+        call search(curline, 'w')
+
+        call s:Tlist_Menu_Update_File(1)
+    else
+        call s:Tlist_Menu_Remove_File()
+
+        call s:Tlist_Refresh()
+    endif
+endfunction
+
+" Tlist_Update_Current_File()
+" Update taglist for the current buffer by regenerating the tag list
+" Contributed by WEN Guopeng.
+function! s:Tlist_Update_Current_File()
+    call s:Tlist_Log_Msg('Tlist_Update_Current_File()')
+    if winnr() == bufwinnr(g:TagList_title)
+        " In the taglist window. Update the current file
+        call s:Tlist_Window_Update_File()
+    else
+        " Not in the taglist window. Update the current buffer
+        let filename = fnamemodify(bufname('%'), ':p')
+        let fidx = s:Tlist_Get_File_Index(filename)
+        if fidx != -1
+            let s:tlist_{fidx}_valid = 0
+        endif
+        let ft = s:Tlist_Get_Buffer_Filetype('%')
+        call Tlist_Update_File(filename, ft)
+    endif
+endfunction
+
+" Tlist_Window_Update_File()
+" Update the tags displayed in the taglist window
+function! s:Tlist_Window_Update_File()
+    call s:Tlist_Log_Msg('Tlist_Window_Update_File()')
+    let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.'))
+    if fidx == -1
+        return
+    endif
+
+    " Remove the previous highlighting
+    match none
+
+    " Save the current line for later restoration
+    let curline = '\V\^' . getline('.') . '\$'
+
+    let s:tlist_{fidx}_valid = 0
+
+    " Update the taglist window
+    call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename,
+                \ s:tlist_{fidx}_filetype)
+
+    exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!'
+
+    " Go back to the tag line before the list is updated
+    call search(curline, 'w')
+endfunction
+
+" Tlist_Window_Get_Tag_Type_By_Linenum()
+" Return the tag type index for the specified line in the taglist window
+function! s:Tlist_Window_Get_Tag_Type_By_Linenum(fidx, lnum)
+    let ftype = s:tlist_{a:fidx}_filetype
+
+    " Determine to which tag type the current line number belongs to using the
+    " tag type start line number and the number of tags in a tag type
+    let i = 1
+    while i <= s:tlist_{ftype}_count
+        let ttype = s:tlist_{ftype}_{i}_name
+        let start_lnum =
+                    \ s:tlist_{a:fidx}_start + s:tlist_{a:fidx}_{ttype}_offset
+        let end =  start_lnum + s:tlist_{a:fidx}_{ttype}_count
+        if a:lnum >= start_lnum && a:lnum <= end
+            break
+        endif
+        let i = i + 1
+    endwhile
+
+    " Current line doesn't belong to any of the displayed tag types
+    if i > s:tlist_{ftype}_count
+        return ''
+    endif
+
+    return ttype
+endfunction
+
+" Tlist_Window_Get_Tag_Index()
+" Return the tag index for the specified line in the taglist window
+function! s:Tlist_Window_Get_Tag_Index(fidx, lnum)
+    let ttype = s:Tlist_Window_Get_Tag_Type_By_Linenum(a:fidx, a:lnum)
+
+    " Current line doesn't belong to any of the displayed tag types
+    if ttype == ''
+        return 0
+    endif
+
+    " Compute the index into the displayed tags for the tag type
+    let ttype_lnum = s:tlist_{a:fidx}_start + s:tlist_{a:fidx}_{ttype}_offset
+    let tidx = a:lnum - ttype_lnum
+    if tidx == 0
+        return 0
+    endif
+
+    " Get the corresponding tag line and return it
+    return s:tlist_{a:fidx}_{ttype}_{tidx}
+endfunction
+
+" Tlist_Window_Highlight_Line
+" Highlight the current line
+function! s:Tlist_Window_Highlight_Line()
+    " Clear previously selected name
+    match none
+
+    " Highlight the current line
+    if g:Tlist_Display_Prototype == 0
+        let pat = '/\%' . line('.') . 'l\s\+\zs.*/'
+    else
+        let pat = '/\%' . line('.') . 'l.*/'
+    endif
+
+    exe 'match TagListTagName ' . pat
+endfunction
+
+" Tlist_Window_Open_File
+" Open the specified file in either a new window or an existing window
+" and place the cursor at the specified tag pattern
+function! s:Tlist_Window_Open_File(win_ctrl, filename, tagpat)
+    call s:Tlist_Log_Msg('Tlist_Window_Open_File (' . a:filename . ',' .
+                \ a:win_ctrl . ')')
+    let prev_Tlist_Skip_Refresh = s:Tlist_Skip_Refresh
+    let s:Tlist_Skip_Refresh = 1
+
+    if s:tlist_app_name == "winmanager"
+        " Let the winmanager edit the file
+        call WinManagerFileEdit(a:filename, a:win_ctrl == 'newwin')
+    else
+
+    if a:win_ctrl == 'newtab'
+        " Create a new tab
+        exe 'tabnew ' . escape(a:filename, ' ')
+        " Open the taglist window in the new tab
+        call s:Tlist_Window_Open()
+    endif
+
+    if a:win_ctrl == 'checktab'
+        " Check whether the file is present in any of the tabs.
+        " If the file is present in the current tab, then use the
+        " current tab.
+        if bufwinnr(a:filename) != -1
+            let file_present_in_tab = 1
+            let i = tabpagenr()
+        else
+            let i = 1
+            let bnum = bufnr(a:filename)
+            let file_present_in_tab = 0
+            while i <= tabpagenr('$')
+                if index(tabpagebuflist(i), bnum) != -1
+                    let file_present_in_tab = 1
+                    break
+                endif
+                let i += 1
+            endwhile
+        endif
+
+        if file_present_in_tab
+            " Goto the tab containing the file
+            exe 'tabnext ' . i
+        else
+            " Open a new tab
+            exe 'tabnew ' . escape(a:filename, ' ')
+
+            " Open the taglist window
+            call s:Tlist_Window_Open()
+        endif
+    endif
+
+    let winnum = -1
+    if a:win_ctrl == 'prevwin'
+        " Open the file in the previous window, if it is usable
+        let cur_win = winnr()
+        wincmd p
+        if &buftype == '' && !&previewwindow
+            exe "edit " . escape(a:filename, ' ')
+            let winnum = winnr()
+        else
+            " Previous window is not usable
+            exe cur_win . 'wincmd w'
+        endif
+    endif
+
+    " Goto the window containing the file.  If the window is not there, open a
+    " new window
+    if winnum == -1
+        let winnum = bufwinnr(a:filename)
+    endif
+
+    if winnum == -1
+        " Locate the previously used window for opening a file
+        let fwin_num = 0
+        let first_usable_win = 0
+
+        let i = 1
+        let bnum = winbufnr(i)
+        while bnum != -1
+            if getwinvar(i, 'tlist_file_window') == 'yes'
+                let fwin_num = i
+                break
+            endif
+            if first_usable_win == 0 &&
+                        \ getbufvar(bnum, '&buftype') == '' &&
+                        \ !getwinvar(i, '&previewwindow')
+                " First non-taglist, non-plugin and non-preview window
+                let first_usable_win = i
+            endif
+            let i = i + 1
+            let bnum = winbufnr(i)
+        endwhile
+
+        " If a previously used window is not found, then use the first
+        " non-taglist window
+        if fwin_num == 0
+            let fwin_num = first_usable_win
+        endif
+
+        if fwin_num != 0
+            " Jump to the file window
+            exe fwin_num . "wincmd w"
+
+            " If the user asked to jump to the tag in a new window, then split
+            " the existing window into two.
+            if a:win_ctrl == 'newwin'
+                split
+            endif
+            exe "edit " . escape(a:filename, ' ')
+        else
+            " Open a new window
+            if g:Tlist_Use_Horiz_Window
+                exe 'leftabove split ' . escape(a:filename, ' ')
+            else
+                if winbufnr(2) == -1
+                    " Only the taglist window is present
+                    if g:Tlist_Use_Right_Window
+                        exe 'leftabove vertical split ' .
+                                    \ escape(a:filename, ' ')
+                    else
+                        exe 'rightbelow vertical split ' .
+                                    \ escape(a:filename, ' ')
+                    endif
+
+                    " Go to the taglist window to change the window size to
+                    " the user configured value
+                    call s:Tlist_Exe_Cmd_No_Acmds('wincmd p')
+                    if g:Tlist_Use_Horiz_Window
+                        exe 'resize ' . g:Tlist_WinHeight
+                    else
+                        exe 'vertical resize ' . g:Tlist_WinWidth
+                    endif
+                    " Go back to the file window
+                    call s:Tlist_Exe_Cmd_No_Acmds('wincmd p')
+                else
+                    " A plugin or help window is also present
+                    wincmd w
+                    exe 'leftabove split ' . escape(a:filename, ' ')
+                endif
+            endif
+        endif
+        " Mark the window, so that it can be reused.
+        call s:Tlist_Window_Mark_File_Window()
+    else
+        if v:version >= 700
+            " If the file is opened in more than one window, then check
+            " whether the last accessed window has the selected file.
+            " If it does, then use that window.
+            let lastwin_bufnum = winbufnr(winnr('#'))
+            if bufnr(a:filename) == lastwin_bufnum
+                let winnum = winnr('#')
+            endif
+        endif
+        exe winnum . 'wincmd w'
+
+        " If the user asked to jump to the tag in a new window, then split the
+        " existing window into two.
+        if a:win_ctrl == 'newwin'
+            split
+        endif
+    endif
+    endif
+
+    " Jump to the tag
+    if a:tagpat != ''
+        " Add the current cursor position to the jump list, so that user can
+        " jump back using the ' and ` marks.
+        mark '
+        silent call search(a:tagpat, 'w')
+
+        " Bring the line to the middle of the window
+        normal! z.
+
+        " If the line is inside a fold, open the fold
+        if foldclosed('.') != -1
+            .foldopen
+        endif
+    endif
+
+    " If the user selects to preview the tag then jump back to the
+    " taglist window
+    if a:win_ctrl == 'preview'
+        " Go back to the taglist window
+        let winnum = bufwinnr(g:TagList_title)
+        exe winnum . 'wincmd w'
+    else
+        " If the user has selected to close the taglist window, when a
+        " tag is selected, close the taglist  window
+        if g:Tlist_Close_On_Select
+            call s:Tlist_Window_Goto_Window()
+            close
+
+            " Go back to the window displaying the selected file
+            let wnum = bufwinnr(a:filename)
+            if wnum != -1 && wnum != winnr()
+                call s:Tlist_Exe_Cmd_No_Acmds(wnum . 'wincmd w')
+            endif
+        endif
+    endif
+
+    let s:Tlist_Skip_Refresh = prev_Tlist_Skip_Refresh
+endfunction
+
+" Tlist_Window_Jump_To_Tag()
+" Jump to the location of the current tag
+" win_ctrl == useopen - Reuse the existing file window
+" win_ctrl == newwin - Open a new window
+" win_ctrl == preview - Preview the tag
+" win_ctrl == prevwin - Open in previous window
+" win_ctrl == newtab - Open in new tab
+function! s:Tlist_Window_Jump_To_Tag(win_ctrl)
+    call s:Tlist_Log_Msg('Tlist_Window_Jump_To_Tag(' . a:win_ctrl . ')')
+    " Do not process comment lines and empty lines
+    let curline = getline('.')
+    if curline =~ '^\s*$' || curline[0] == '"'
+        return
+    endif
+
+    " If inside a closed fold, then use the first line of the fold
+    " and jump to the file.
+    let lnum = foldclosed('.')
+    if lnum == -1
+        " Jump to the selected tag or file
+        let lnum = line('.')
+    else
+        " Open the closed fold
+        .foldopen!
+    endif
+
+    let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(lnum)
+    if fidx == -1
+        return
+    endif
+
+    " Get the tag output for the current tag
+    let tidx = s:Tlist_Window_Get_Tag_Index(fidx, lnum)
+    if tidx != 0
+        let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, tidx)
+
+        " Highlight the tagline
+        call s:Tlist_Window_Highlight_Line()
+    else
+        " Selected a line which is not a tag name. Just edit the file
+        let tagpat = ''
+    endif
+
+    call s:Tlist_Window_Open_File(a:win_ctrl, s:tlist_{fidx}_filename, tagpat)
+endfunction
+
+" Tlist_Window_Show_Info()
+" Display information about the entry under the cursor
+function! s:Tlist_Window_Show_Info()
+    call s:Tlist_Log_Msg('Tlist_Window_Show_Info()')
+
+    " Clear the previously displayed line
+    echo
+
+    " Do not process comment lines and empty lines
+    let curline = getline('.')
+    if curline =~ '^\s*$' || curline[0] == '"'
+        return
+    endif
+
+    " If inside a fold, then don't display the prototype
+    if foldclosed('.') != -1
+        return
+    endif
+
+    let lnum = line('.')
+
+    " Get the file index
+    let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(lnum)
+    if fidx == -1
+        return
+    endif
+
+    if lnum == s:tlist_{fidx}_start
+        " Cursor is on a file name
+        let fname = s:tlist_{fidx}_filename
+        if strlen(fname) > 50
+            let fname = fnamemodify(fname, ':t')
+        endif
+        echo fname . ', Filetype=' . s:tlist_{fidx}_filetype .
+                    \  ', Tag count=' . s:tlist_{fidx}_tag_count
+        return
+    endif
+
+    " Get the tag output line for the current tag
+    let tidx = s:Tlist_Window_Get_Tag_Index(fidx, lnum)
+    if tidx == 0
+        " Cursor is on a tag type
+        let ttype = s:Tlist_Window_Get_Tag_Type_By_Linenum(fidx, lnum)
+        if ttype == ''
+            return
+        endif
+
+        let ttype_name = ''
+
+        let ftype = s:tlist_{fidx}_filetype
+        let i = 1
+        while i <= s:tlist_{ftype}_count
+            if ttype == s:tlist_{ftype}_{i}_name
+                let ttype_name = s:tlist_{ftype}_{i}_fullname
+                break
+            endif
+            let i = i + 1
+        endwhile
+
+        echo 'Tag type=' . ttype_name .
+                    \ ', Tag count=' . s:tlist_{fidx}_{ttype}_count
+        return
+    endif
+
+    " Get the tag search pattern and display it
+    echo s:Tlist_Get_Tag_Prototype(fidx, tidx)
+endfunction
+
+" Tlist_Find_Nearest_Tag_Idx
+" Find the tag idx nearest to the supplied line number
+" Returns -1, if a tag couldn't be found for the specified line number
+function! s:Tlist_Find_Nearest_Tag_Idx(fidx, linenum)
+    let sort_type = s:tlist_{a:fidx}_sort_type
+
+    let left = 1
+    let right = s:tlist_{a:fidx}_tag_count
+
+    if sort_type == 'order'
+        " Tags sorted by order, use a binary search.
+        " The idea behind this function is taken from the ctags.vim script (by
+        " Alexey Marinichev) available at the Vim online website.
+
+        " If the current line is the less than the first tag, then no need to
+        " search
+        let first_lnum = s:Tlist_Get_Tag_Linenum(a:fidx, 1)
+
+        if a:linenum < first_lnum
+            return -1
+        endif
+
+        while left < right
+            let middle = (right + left + 1) / 2
+            let middle_lnum = s:Tlist_Get_Tag_Linenum(a:fidx, middle)
+
+            if middle_lnum == a:linenum
+                let left = middle
+                break
+            endif
+
+            if middle_lnum > a:linenum
+                let right = middle - 1
+            else
+                let left = middle
+            endif
+        endwhile
+    else
+        " Tags sorted by name, use a linear search. (contributed by Dave
+        " Eggum).
+        " Look for a tag with a line number less than or equal to the supplied
+        " line number. If multiple tags are found, then use the tag with the
+        " line number closest to the supplied line number. IOW, use the tag
+        " with the highest line number.
+        let closest_lnum = 0
+        let final_left = 0
+        while left <= right
+            let lnum = s:Tlist_Get_Tag_Linenum(a:fidx, left)
+
+            if lnum < a:linenum && lnum > closest_lnum
+                let closest_lnum = lnum
+                let final_left = left
+            elseif lnum == a:linenum
+                let closest_lnum = lnum
+                let final_left = left
+                break
+            else
+                let left = left + 1
+            endif
+        endwhile
+        if closest_lnum == 0
+            return -1
+        endif
+        if left >= right
+            let left = final_left
+        endif
+    endif
+
+    return left
+endfunction
+
+" Tlist_Window_Highlight_Tag()
+" Highlight the current tag
+" cntx == 1, Called by the taglist plugin itself
+" cntx == 2, Forced by the user through the TlistHighlightTag command
+" center = 1, move the tag line to the center of the taglist window
+function! s:Tlist_Window_Highlight_Tag(filename, cur_lnum, cntx, center)
+    " Highlight the current tag only if the user configured the
+    " taglist plugin to do so or if the user explictly invoked the
+    " command to highlight the current tag.
+    if !g:Tlist_Auto_Highlight_Tag && a:cntx == 1
+        return
+    endif
+
+    if a:filename == ''
+        return
+    endif
+
+    " Make sure the taglist window is present
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum == -1
+        call s:Tlist_Warning_Msg('Error: Taglist window is not open')
+        return
+    endif
+
+    let fidx = s:Tlist_Get_File_Index(a:filename)
+    if fidx == -1
+        return
+    endif
+
+    " If the file is currently not displayed in the taglist window, then retrn
+    if !s:tlist_{fidx}_visible
+        return
+    endif
+
+    " If there are no tags for this file, then no need to proceed further
+    if s:tlist_{fidx}_tag_count == 0
+        return
+    endif
+
+    " Ignore all autocommands
+    let old_ei = &eventignore
+    set eventignore=all
+
+    " Save the original window number
+    let org_winnr = winnr()
+
+    if org_winnr == winnum
+        let in_taglist_window = 1
+    else
+        let in_taglist_window = 0
+    endif
+
+    " Go to the taglist window
+    if !in_taglist_window
+        exe winnum . 'wincmd w'
+    endif
+
+    " Clear previously selected name
+    match none
+
+    let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, a:cur_lnum)
+    if tidx == -1
+        " Make sure the current tag line is visible in the taglist window.
+        " Calling the winline() function makes the line visible.  Don't know
+        " of a better way to achieve this.
+        let lnum = line('.')
+
+        if lnum < s:tlist_{fidx}_start || lnum > s:tlist_{fidx}_end
+            " Move the cursor to the beginning of the file
+            exe s:tlist_{fidx}_start
+        endif
+
+        if foldclosed('.') != -1
+            .foldopen
+        endif
+
+        call winline()
+
+        if !in_taglist_window
+            exe org_winnr . 'wincmd w'
+        endif
+
+        " Restore the autocommands
+        let &eventignore = old_ei
+        return
+    endif
+
+    " Extract the tag type
+    let ttype = s:Tlist_Get_Tag_Type_By_Tag(fidx, tidx)
+
+    " Compute the line number
+    " Start of file + Start of tag type + offset
+    let lnum = s:tlist_{fidx}_start + s:tlist_{fidx}_{ttype}_offset +
+                \ s:tlist_{fidx}_{tidx}_ttype_idx
+
+    " Goto the line containing the tag
+    exe lnum
+
+    " Open the fold
+    if foldclosed('.') != -1
+        .foldopen
+    endif
+
+    if a:center
+        " Move the tag line to the center of the taglist window
+        normal! z.
+    else
+        " Make sure the current tag line is visible in the taglist window.
+        " Calling the winline() function makes the line visible.  Don't know
+        " of a better way to achieve this.
+        call winline()
+    endif
+
+    " Highlight the tag name
+    call s:Tlist_Window_Highlight_Line()
+
+    " Go back to the original window
+    if !in_taglist_window
+        exe org_winnr . 'wincmd w'
+    endif
+
+    " Restore the autocommands
+    let &eventignore = old_ei
+    return
+endfunction
+
+" Tlist_Get_Tag_Prototype_By_Line
+" Get the prototype for the tag on or before the specified line number in the
+" current buffer
+function! Tlist_Get_Tag_Prototype_By_Line(...)
+    if a:0 == 0
+        " Arguments are not supplied. Use the current buffer name
+        " and line number
+        let filename = bufname('%')
+        let linenr = line('.')
+    elseif a:0 == 2
+        " Filename and line number are specified
+        let filename = a:1
+        let linenr = a:2
+        if linenr !~ '\d\+'
+            " Invalid line number
+            return ""
+        endif
+    else
+        " Sufficient arguments are not supplied
+        let msg =  'Usage: Tlist_Get_Tag_Prototype_By_Line <filename> ' .
+                                \ '<line_number>'
+        call s:Tlist_Warning_Msg(msg)
+        return ""
+    endif
+
+    " Expand the file to a fully qualified name
+    let filename = fnamemodify(filename, ':p')
+    if filename == ''
+        return ""
+    endif
+
+    let fidx = s:Tlist_Get_File_Index(filename)
+    if fidx == -1
+        return ""
+    endif
+
+    " If there are no tags for this file, then no need to proceed further
+    if s:tlist_{fidx}_tag_count == 0
+        return ""
+    endif
+
+    " Get the tag text using the line number
+    let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr)
+    if tidx == -1
+        return ""
+    endif
+
+    return s:Tlist_Get_Tag_Prototype(fidx, tidx)
+endfunction
+
+" Tlist_Get_Tagname_By_Line
+" Get the tag name on or before the specified line number in the
+" current buffer
+function! Tlist_Get_Tagname_By_Line(...)
+    if a:0 == 0
+        " Arguments are not supplied. Use the current buffer name
+        " and line number
+        let filename = bufname('%')
+        let linenr = line('.')
+    elseif a:0 == 2
+        " Filename and line number are specified
+        let filename = a:1
+        let linenr = a:2
+        if linenr !~ '\d\+'
+            " Invalid line number
+            return ""
+        endif
+    else
+        " Sufficient arguments are not supplied
+        let msg =  'Usage: Tlist_Get_Tagname_By_Line <filename> <line_number>'
+        call s:Tlist_Warning_Msg(msg)
+        return ""
+    endif
+
+    " Make sure the current file has a name
+    let filename = fnamemodify(filename, ':p')
+    if filename == ''
+        return ""
+    endif
+
+    let fidx = s:Tlist_Get_File_Index(filename)
+    if fidx == -1
+        return ""
+    endif
+
+    " If there are no tags for this file, then no need to proceed further
+    if s:tlist_{fidx}_tag_count == 0
+        return ""
+    endif
+
+    " Get the tag name using the line number
+    let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr)
+    if tidx == -1
+        return ""
+    endif
+
+    return s:tlist_{fidx}_{tidx}_tag_name
+endfunction
+
+" Tlist_Window_Move_To_File
+" Move the cursor to the beginning of the current file or the next file
+" or the previous file in the taglist window
+" dir == -1, move to start of current or previous function
+" dir == 1, move to start of next function
+function! s:Tlist_Window_Move_To_File(dir)
+    if foldlevel('.') == 0
+        " Cursor is on a non-folded line (it is not in any of the files)
+        " Move it to a folded line
+        if a:dir == -1
+            normal! zk
+        else
+            " While moving down to the start of the next fold,
+            " no need to do go to the start of the next file.
+            normal! zj
+            return
+        endif
+    endif
+
+    let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.'))
+    if fidx == -1
+        return
+    endif
+
+    let cur_lnum = line('.')
+
+    if a:dir == -1
+        if cur_lnum > s:tlist_{fidx}_start
+            " Move to the beginning of the current file
+            exe s:tlist_{fidx}_start
+            return
+        endif
+
+        if fidx != 0
+            " Move to the beginning of the previous file
+            let fidx = fidx - 1
+        else
+            " Cursor is at the first file, wrap around to the last file
+            let fidx = s:tlist_file_count - 1
+        endif
+
+        exe s:tlist_{fidx}_start
+        return
+    else
+        " Move to the beginning of the next file
+        let fidx = fidx + 1
+
+        if fidx >= s:tlist_file_count
+            " Cursor is at the last file, wrap around to the first file
+            let fidx = 0
+        endif
+
+        if s:tlist_{fidx}_start != 0
+            exe s:tlist_{fidx}_start
+        endif
+        return
+    endif
+endfunction
+
+" Tlist_Session_Load
+" Load a taglist session (information about all the displayed files
+" and the tags) from the specified file
+function! s:Tlist_Session_Load(...)
+    if a:0 == 0 || a:1 == ''
+        call s:Tlist_Warning_Msg('Usage: TlistSessionLoad <filename>')
+        return
+    endif
+
+    let sessionfile = a:1
+
+    if !filereadable(sessionfile)
+        let msg = 'Taglist: Error - Unable to open file ' . sessionfile
+        call s:Tlist_Warning_Msg(msg)
+        return
+    endif
+
+    " Mark the current window as the file window
+    call s:Tlist_Window_Mark_File_Window()
+
+    " Source the session file
+    exe 'source ' . sessionfile
+
+    let new_file_count = g:tlist_file_count
+    unlet! g:tlist_file_count
+
+    let i = 0
+    while i < new_file_count
+        let ftype = g:tlist_{i}_filetype
+        unlet! g:tlist_{i}_filetype
+
+        if !exists('s:tlist_' . ftype . '_count')
+            if s:Tlist_FileType_Init(ftype) == 0
+                let i = i + 1
+                continue
+            endif
+        endif
+
+        let fname = g:tlist_{i}_filename
+        unlet! g:tlist_{i}_filename
+
+        let fidx = s:Tlist_Get_File_Index(fname)
+        if fidx != -1
+            let s:tlist_{fidx}_visible = 0
+            let i = i + 1
+            continue
+        else
+            " As we are loading the tags from the session file, if this
+            " file was previously deleted by the user, now we need to
+            " add it back. So remove the file from the deleted list.
+            call s:Tlist_Update_Remove_List(fname, 0)
+        endif
+
+        let fidx = s:Tlist_Init_File(fname, ftype)
+
+        let s:tlist_{fidx}_filename = fname
+
+        let s:tlist_{fidx}_sort_type = g:tlist_{i}_sort_type
+        unlet! g:tlist_{i}_sort_type
+
+        let s:tlist_{fidx}_filetype = ftype
+        let s:tlist_{fidx}_mtime = getftime(fname)
+
+        let s:tlist_{fidx}_start = 0
+        let s:tlist_{fidx}_end = 0
+
+        let s:tlist_{fidx}_valid = 1
+
+        let s:tlist_{fidx}_tag_count = g:tlist_{i}_tag_count
+        unlet! g:tlist_{i}_tag_count
+
+        let j = 1
+        while j <= s:tlist_{fidx}_tag_count
+            let s:tlist_{fidx}_{j}_tag = g:tlist_{i}_{j}_tag
+            let s:tlist_{fidx}_{j}_tag_name = g:tlist_{i}_{j}_tag_name
+            let s:tlist_{fidx}_{j}_ttype_idx = g:tlist_{i}_{j}_ttype_idx
+            unlet! g:tlist_{i}_{j}_tag
+            unlet! g:tlist_{i}_{j}_tag_name
+            unlet! g:tlist_{i}_{j}_ttype_idx
+            let j = j + 1
+        endwhile
+
+        let j = 1
+        while j <= s:tlist_{ftype}_count
+            let ttype = s:tlist_{ftype}_{j}_name
+
+            if exists('g:tlist_' . i . '_' . ttype)
+                let s:tlist_{fidx}_{ttype} = g:tlist_{i}_{ttype}
+                unlet! g:tlist_{i}_{ttype}
+                let s:tlist_{fidx}_{ttype}_offset = 0
+                let s:tlist_{fidx}_{ttype}_count = g:tlist_{i}_{ttype}_count
+                unlet! g:tlist_{i}_{ttype}_count
+
+                let k = 1
+                while k <= s:tlist_{fidx}_{ttype}_count
+                    let s:tlist_{fidx}_{ttype}_{k} = g:tlist_{i}_{ttype}_{k}
+                    unlet! g:tlist_{i}_{ttype}_{k}
+                    let k = k + 1
+                endwhile
+            else
+                let s:tlist_{fidx}_{ttype} = ''
+                let s:tlist_{fidx}_{ttype}_offset = 0
+                let s:tlist_{fidx}_{ttype}_count = 0
+            endif
+
+            let j = j + 1
+        endwhile
+
+        let i = i + 1
+    endwhile
+
+    " If the taglist window is open, then update it
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum != -1
+        let save_winnr = winnr()
+
+        " Goto the taglist window
+        call s:Tlist_Window_Goto_Window()
+
+        " Refresh the taglist window
+        call s:Tlist_Window_Refresh()
+
+        " Go back to the original window
+        if save_winnr != winnr()
+            call s:Tlist_Exe_Cmd_No_Acmds('wincmd p')
+        endif
+    endif
+endfunction
+
+" Tlist_Session_Save
+" Save a taglist session (information about all the displayed files
+" and the tags) into the specified file
+function! s:Tlist_Session_Save(...)
+    if a:0 == 0 || a:1 == ''
+        call s:Tlist_Warning_Msg('Usage: TlistSessionSave <filename>')
+        return
+    endif
+
+    let sessionfile = a:1
+
+    if s:tlist_file_count == 0
+        " There is nothing to save
+        call s:Tlist_Warning_Msg('Warning: Taglist is empty. Nothing to save.')
+        return
+    endif
+
+    if filereadable(sessionfile)
+        let ans = input('Do you want to overwrite ' . sessionfile . ' (Y/N)?')
+        if ans !=? 'y'
+            return
+        endif
+
+        echo "\n"
+    endif
+
+    let old_verbose = &verbose
+    set verbose&vim
+
+    exe 'redir! > ' . sessionfile
+
+    silent! echo '" Taglist session file. This file is auto-generated.'
+    silent! echo '" File information'
+    silent! echo 'let tlist_file_count = ' . s:tlist_file_count
+
+    let i = 0
+
+    while i < s:tlist_file_count
+        " Store information about the file
+        silent! echo 'let tlist_' . i . "_filename = '" .
+                                            \ s:tlist_{i}_filename . "'"
+        silent! echo 'let tlist_' . i . '_sort_type = "' .
+                                                \ s:tlist_{i}_sort_type . '"'
+        silent! echo 'let tlist_' . i . '_filetype = "' .
+                                            \ s:tlist_{i}_filetype . '"'
+        silent! echo 'let tlist_' . i . '_tag_count = ' .
+                                                        \ s:tlist_{i}_tag_count
+        " Store information about all the tags
+        let j = 1
+        while j <= s:tlist_{i}_tag_count
+            let txt = escape(s:tlist_{i}_{j}_tag, '"\\')
+            silent! echo 'let tlist_' . i . '_' . j . '_tag = "' . txt . '"'
+            silent! echo 'let tlist_' . i . '_' . j . '_tag_name = "' .
+                        \ s:tlist_{i}_{j}_tag_name . '"'
+            silent! echo 'let tlist_' . i . '_' . j . '_ttype_idx' . ' = ' .
+                        \ s:tlist_{i}_{j}_ttype_idx
+            let j = j + 1
+        endwhile
+
+        " Store information about all the tags grouped by their type
+        let ftype = s:tlist_{i}_filetype
+        let j = 1
+        while j <= s:tlist_{ftype}_count
+            let ttype = s:tlist_{ftype}_{j}_name
+            if s:tlist_{i}_{ttype}_count != 0
+                let txt = escape(s:tlist_{i}_{ttype}, '"\')
+                let txt = substitute(txt, "\n", "\\\\n", 'g')
+                silent! echo 'let tlist_' . i . '_' . ttype . ' = "' .
+                                                \ txt . '"'
+                silent! echo 'let tlist_' . i . '_' . ttype . '_count = ' .
+                                                     \ s:tlist_{i}_{ttype}_count
+                let k = 1
+                while k <= s:tlist_{i}_{ttype}_count
+                    silent! echo 'let tlist_' . i . '_' . ttype . '_' . k .
+                                \ ' = ' . s:tlist_{i}_{ttype}_{k}
+                    let k = k + 1
+                endwhile
+            endif
+            let j = j + 1
+        endwhile
+
+        silent! echo
+
+        let i = i + 1
+    endwhile
+
+    redir END
+
+    let &verbose = old_verbose
+endfunction
+
+" Tlist_Buffer_Removed
+" A buffer is removed from the Vim buffer list. Remove the tags defined
+" for that file
+function! s:Tlist_Buffer_Removed(filename)
+    call s:Tlist_Log_Msg('Tlist_Buffer_Removed (' . a:filename .  ')')
+
+    " Make sure a valid filename is supplied
+    if a:filename == ''
+        return
+    endif
+
+    " Get tag list index of the specified file
+    let fidx = s:Tlist_Get_File_Index(a:filename)
+    if fidx == -1
+        " File not present in the taglist
+        return
+    endif
+
+    " Remove the file from the list
+    call s:Tlist_Remove_File(fidx, 0)
+endfunction
+
+" When a buffer is deleted, remove the file from the taglist
+autocmd BufDelete * silent call s:Tlist_Buffer_Removed(expand('<afile>:p'))
+
+" Tlist_Window_Open_File_Fold
+" Open the fold for the specified file and close the fold for all the
+" other files
+function! s:Tlist_Window_Open_File_Fold(acmd_bufnr)
+    call s:Tlist_Log_Msg('Tlist_Window_Open_File_Fold (' . a:acmd_bufnr . ')')
+
+    " Make sure the taglist window is present
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum == -1
+        call s:Tlist_Warning_Msg('Taglist: Error - Taglist window is not open')
+        return
+    endif
+
+    " Save the original window number
+    let org_winnr = winnr()
+    if org_winnr == winnum
+        let in_taglist_window = 1
+    else
+        let in_taglist_window = 0
+    endif
+
+    if in_taglist_window
+        " When entering the taglist window, no need to update the folds
+        return
+    endif
+
+    " Go to the taglist window
+    if !in_taglist_window
+        call s:Tlist_Exe_Cmd_No_Acmds(winnum . 'wincmd w')
+    endif
+
+    " Close all the folds
+    silent! %foldclose
+
+    " Get tag list index of the specified file
+    let fname = fnamemodify(bufname(a:acmd_bufnr + 0), ':p')
+    if filereadable(fname)
+        let fidx = s:Tlist_Get_File_Index(fname)
+        if fidx != -1
+            " Open the fold for the file
+            exe "silent! " . s:tlist_{fidx}_start . "," .
+                        \ s:tlist_{fidx}_end . "foldopen"
+        endif
+    endif
+
+    " Go back to the original window
+    if !in_taglist_window
+        call s:Tlist_Exe_Cmd_No_Acmds(org_winnr . 'wincmd w')
+    endif
+endfunction
+
+" Tlist_Window_Check_Auto_Open
+" Open the taglist window automatically on Vim startup.
+" Open the window only when files present in any of the Vim windows support
+" tags.
+function! s:Tlist_Window_Check_Auto_Open()
+    let open_window = 0
+
+    let i = 1
+    let buf_num = winbufnr(i)
+    while buf_num != -1
+        let filename = fnamemodify(bufname(buf_num), ':p')
+        let ft = s:Tlist_Get_Buffer_Filetype(buf_num)
+        if !s:Tlist_Skip_File(filename, ft)
+            let open_window = 1
+            break
+        endif
+        let i = i + 1
+        let buf_num = winbufnr(i)
+    endwhile
+
+    if open_window
+        call s:Tlist_Window_Toggle()
+    endif
+endfunction
+
+" Tlist_Refresh_Folds
+" Remove and create the folds for all the files displayed in the taglist
+" window. Used after entering a tab. If this is not done, then the folds
+" are not properly created for taglist windows displayed in multiple tabs.
+function! s:Tlist_Refresh_Folds()
+    let winnum = bufwinnr(g:TagList_title)
+    if winnum == -1
+        return
+    endif
+
+    let save_wnum = winnr()
+    exe winnum . 'wincmd w'
+
+    " First remove all the existing folds
+    normal! zE
+
+    " Create the folds for each in the tag list
+    let fidx = 0
+    while fidx < s:tlist_file_count
+        let ftype = s:tlist_{fidx}_filetype
+
+        " Create the folds for each tag type in a file
+        let j = 1
+        while j <= s:tlist_{ftype}_count
+            let ttype = s:tlist_{ftype}_{j}_name
+            if s:tlist_{fidx}_{ttype}_count
+                let s = s:tlist_{fidx}_start + s:tlist_{fidx}_{ttype}_offset
+                let e = s + s:tlist_{fidx}_{ttype}_count
+                exe s . ',' . e . 'fold'
+            endif
+            let j = j + 1
+        endwhile
+
+        exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'fold'
+        exe 'silent! ' . s:tlist_{fidx}_start . ',' .
+                    \ s:tlist_{fidx}_end . 'foldopen!'
+        let fidx = fidx + 1
+    endwhile
+
+    exe save_wnum . 'wincmd w'
+endfunction
+
+function! s:Tlist_Menu_Add_Base_Menu()
+    call s:Tlist_Log_Msg('Adding the base menu')
+
+    " Add the menu
+    anoremenu <silent> T&ags.Refresh\ menu :call <SID>Tlist_Menu_Refresh()<CR>
+    anoremenu <silent> T&ags.Sort\ menu\ by.Name
+                    \ :call <SID>Tlist_Change_Sort('menu', 'set', 'name')<CR>
+    anoremenu <silent> T&ags.Sort\ menu\ by.Order
+                    \ :call <SID>Tlist_Change_Sort('menu', 'set', 'order')<CR>
+    anoremenu T&ags.-SEP1-           :
+
+    if &mousemodel =~ 'popup'
+        anoremenu <silent> PopUp.T&ags.Refresh\ menu
+                    \ :call <SID>Tlist_Menu_Refresh()<CR>
+        anoremenu <silent> PopUp.T&ags.Sort\ menu\ by.Name
+                  \ :call <SID>Tlist_Change_Sort('menu', 'set', 'name')<CR>
+        anoremenu <silent> PopUp.T&ags.Sort\ menu\ by.Order
+                  \ :call <SID>Tlist_Change_Sort('menu', 'set', 'order')<CR>
+        anoremenu PopUp.T&ags.-SEP1-           :
+    endif
+endfunction
+
+let s:menu_char_prefix =
+            \ '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+
+" Tlist_Menu_Get_Tag_Type_Cmd
+" Get the menu command for the specified tag type
+" fidx - File type index
+" ftype - File Type
+" add_ttype_name - To add or not to add the tag type name to the menu entries
+" ttype_idx - Tag type index
+function! s:Tlist_Menu_Get_Tag_Type_Cmd(fidx, ftype, add_ttype_name, ttype_idx)
+    " Curly brace variable name optimization
+    let ftype_ttype_idx = a:ftype . '_' . a:ttype_idx
+
+    let ttype = s:tlist_{ftype_ttype_idx}_name
+    if a:add_ttype_name
+        " If the tag type name contains space characters, escape it. This
+        " will be used to create the menu entries.
+        let ttype_fullname = escape(s:tlist_{ftype_ttype_idx}_fullname, ' ')
+    endif
+
+    " Curly brace variable name optimization
+    let fidx_ttype = a:fidx . '_' . ttype
+
+    " Number of tag entries for this tag type
+    let tcnt = s:tlist_{fidx_ttype}_count
+    if tcnt == 0 " No entries for this tag type
+        return ''
+    endif
+
+    let mcmd = ''
+
+    " Create the menu items for the tags.
+    " Depending on the number of tags of this type, split the menu into
+    " multiple sub-menus, if needed.
+    if tcnt > g:Tlist_Max_Submenu_Items
+        let j = 1
+        while j <= tcnt
+            let final_index = j + g:Tlist_Max_Submenu_Items - 1
+            if final_index > tcnt
+                let final_index = tcnt
+            endif
+
+            " Extract the first and last tag name and form the
+            " sub-menu name
+            let tidx = s:tlist_{fidx_ttype}_{j}
+            let first_tag = s:tlist_{a:fidx}_{tidx}_tag_name
+
+            let tidx = s:tlist_{fidx_ttype}_{final_index}
+            let last_tag = s:tlist_{a:fidx}_{tidx}_tag_name
+
+            " Truncate the names, if they are greater than the
+            " max length
+            let first_tag = strpart(first_tag, 0, g:Tlist_Max_Tag_Length)
+            let last_tag = strpart(last_tag, 0, g:Tlist_Max_Tag_Length)
+
+            " Form the menu command prefix
+            let m_prefix = 'anoremenu <silent> T\&ags.'
+            if a:add_ttype_name
+                let m_prefix = m_prefix . ttype_fullname . '.'
+            endif
+            let m_prefix = m_prefix . first_tag . '\.\.\.' . last_tag . '.'
+
+            " Character prefix used to number the menu items (hotkey)
+            let m_prefix_idx = 0
+
+            while j <= final_index
+                let tidx = s:tlist_{fidx_ttype}_{j}
+
+                let tname = s:tlist_{a:fidx}_{tidx}_tag_name
+
+                let mcmd = mcmd . m_prefix . '\&' .
+                            \ s:menu_char_prefix[m_prefix_idx] . '\.' .
+                            \ tname . ' :call <SID>Tlist_Menu_Jump_To_Tag(' .
+                            \ tidx . ')<CR>|'
+
+                let m_prefix_idx = m_prefix_idx + 1
+                let j = j + 1
+            endwhile
+        endwhile
+    else
+        " Character prefix used to number the menu items (hotkey)
+        let m_prefix_idx = 0
+
+        let m_prefix = 'anoremenu <silent> T\&ags.'
+        if a:add_ttype_name
+            let m_prefix = m_prefix . ttype_fullname . '.'
+        endif
+        let j = 1
+        while j <= tcnt
+            let tidx = s:tlist_{fidx_ttype}_{j}
+
+            let tname = s:tlist_{a:fidx}_{tidx}_tag_name
+
+            let mcmd = mcmd . m_prefix . '\&' .
+                        \ s:menu_char_prefix[m_prefix_idx] . '\.' .
+                        \ tname . ' :call <SID>Tlist_Menu_Jump_To_Tag(' . tidx
+                        \ . ')<CR>|'
+
+            let m_prefix_idx = m_prefix_idx + 1
+            let j = j + 1
+        endwhile
+    endif
+
+    return mcmd
+endfunction
+
+" Update the taglist menu with the tags for the specified file
+function! s:Tlist_Menu_File_Refresh(fidx)
+    call s:Tlist_Log_Msg('Refreshing the tag menu for ' . s:tlist_{a:fidx}_filename)
+    " The 'B' flag is needed in the 'cpoptions' option
+    let old_cpoptions = &cpoptions
+    set cpoptions&vim
+
+    exe s:tlist_{a:fidx}_menu_cmd
+
+    " Update the popup menu (if enabled)
+    if &mousemodel =~ 'popup'
+        let cmd = substitute(s:tlist_{a:fidx}_menu_cmd, ' T\\&ags\.',
+                                        \ ' PopUp.T\\\&ags.', "g")
+        exe cmd
+    endif
+
+    " The taglist menu is not empty now
+    let s:tlist_menu_empty = 0
+
+    " Restore the 'cpoptions' settings
+    let &cpoptions = old_cpoptions
+endfunction
+
+" Tlist_Menu_Update_File
+" Add the taglist menu
+function! s:Tlist_Menu_Update_File(clear_menu)
+    if !has('gui_running')
+        " Not running in GUI mode
+        return
+    endif
+
+    call s:Tlist_Log_Msg('Updating the tag menu, clear_menu = ' . a:clear_menu)
+
+    " Remove the tags menu
+    if a:clear_menu
+        call s:Tlist_Menu_Remove_File()
+
+    endif
+
+    " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help
+    if &buftype != ''
+        return
+    endif
+
+    let filename = fnamemodify(bufname('%'), ':p')
+    let ftype = s:Tlist_Get_Buffer_Filetype('%')
+
+    " If the file doesn't support tag listing, skip it
+    if s:Tlist_Skip_File(filename, ftype)
+        return
+    endif
+
+    let fidx = s:Tlist_Get_File_Index(filename)
+    if fidx == -1 || !s:tlist_{fidx}_valid
+        " Check whether this file is removed based on user request
+        " If it is, then don't display the tags for this file
+        if s:Tlist_User_Removed_File(filename)
+            return
+        endif
+
+        " Process the tags for the file
+        let fidx = s:Tlist_Process_File(filename, ftype)
+        if fidx == -1
+            return
+        endif
+    endif
+
+    let fname = escape(fnamemodify(bufname('%'), ':t'), '.')
+    if fname != ''
+        exe 'anoremenu T&ags.' .  fname . ' <Nop>'
+        anoremenu T&ags.-SEP2-           :
+    endif
+
+    if !s:tlist_{fidx}_tag_count
+        return
+    endif
+
+    if s:tlist_{fidx}_menu_cmd != ''
+        " Update the menu with the cached command
+        call s:Tlist_Menu_File_Refresh(fidx)
+
+        return
+    endif
+
+    " We are going to add entries to the tags menu, so the menu won't be
+    " empty
+    let s:tlist_menu_empty = 0
+
+    let cmd = ''
+
+    " Determine whether the tag type name needs to be added to the menu
+    " If more than one tag type is present in the taglisting for a file,
+    " then the tag type name needs to be present
+    let add_ttype_name = -1
+    let i = 1
+    while i <= s:tlist_{ftype}_count && add_ttype_name < 1
+        let ttype = s:tlist_{ftype}_{i}_name
+        if s:tlist_{fidx}_{ttype}_count
+            let add_ttype_name = add_ttype_name + 1
+        endif
+        let i = i + 1
+    endwhile
+
+    " Process the tags by the tag type and get the menu command
+    let i = 1
+    while i <= s:tlist_{ftype}_count
+        let mcmd = s:Tlist_Menu_Get_Tag_Type_Cmd(fidx, ftype, add_ttype_name, i)
+        if mcmd != ''
+            let cmd = cmd . mcmd
+        endif
+
+        let i = i + 1
+    endwhile
+
+    " Cache the menu command for reuse
+    let s:tlist_{fidx}_menu_cmd = cmd
+
+    " Update the menu
+    call s:Tlist_Menu_File_Refresh(fidx)
+endfunction
+
+" Tlist_Menu_Remove_File
+" Remove the tags displayed in the tags menu
+function! s:Tlist_Menu_Remove_File()
+    if !has('gui_running') || s:tlist_menu_empty
+        return
+    endif
+
+    call s:Tlist_Log_Msg('Removing the tags menu for a file')
+
+    " Cleanup the Tags menu
+    silent! unmenu T&ags
+    if &mousemodel =~ 'popup'
+        silent! unmenu PopUp.T&ags
+    endif
+
+    " Add a dummy menu item to retain teared off menu
+    noremenu T&ags.Dummy l
+
+    silent! unmenu! T&ags
+    if &mousemodel =~ 'popup'
+        silent! unmenu! PopUp.T&ags
+    endif
+
+    call s:Tlist_Menu_Add_Base_Menu()
+
+    " Remove the dummy menu item
+    unmenu T&ags.Dummy
+
+    let s:tlist_menu_empty = 1
+endfunction
+
+" Tlist_Menu_Refresh
+" Refresh the taglist menu
+function! s:Tlist_Menu_Refresh()
+    call s:Tlist_Log_Msg('Refreshing the tags menu')
+    let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p'))
+    if fidx != -1
+        " Invalidate the cached menu command
+        let s:tlist_{fidx}_menu_cmd = ''
+    endif
+
+    " Update the taglist, menu and window
+    call s:Tlist_Update_Current_File()
+endfunction
+
+" Tlist_Menu_Jump_To_Tag
+" Jump to the selected tag
+function! s:Tlist_Menu_Jump_To_Tag(tidx)
+    let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p'))
+    if fidx == -1
+        return
+    endif
+
+    let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, a:tidx)
+    if tagpat == ''
+        return
+    endif
+
+    " Add the current cursor position to the jump list, so that user can
+    " jump back using the ' and ` marks.
+    mark '
+
+    silent call search(tagpat, 'w')
+
+    " Bring the line to the middle of the window
+    normal! z.
+
+    " If the line is inside a fold, open the fold
+    if foldclosed('.') != -1
+        .foldopen
+    endif
+endfunction
+
+" Tlist_Menu_Init
+" Initialize the taglist menu
+function! s:Tlist_Menu_Init()
+    call s:Tlist_Menu_Add_Base_Menu()
+
+    " Automatically add the tags defined in the current file to the menu
+    augroup TagListMenuCmds
+        autocmd!
+
+        if !g:Tlist_Process_File_Always
+            autocmd BufEnter * call s:Tlist_Refresh()
+        endif
+        autocmd BufLeave * call s:Tlist_Menu_Remove_File()
+    augroup end
+
+    call s:Tlist_Menu_Update_File(0)
+endfunction
+
+" Tlist_Vim_Session_Load
+" Initialize the taglist window/buffer, which is created when loading
+" a Vim session file.
+function! s:Tlist_Vim_Session_Load()
+    call s:Tlist_Log_Msg('Tlist_Vim_Session_Load')
+
+    " Initialize the taglist window
+    call s:Tlist_Window_Init()
+
+    " Refresh the taglist window
+    call s:Tlist_Window_Refresh()
+endfunction
+
+" Tlist_Set_App
+" Set the name of the external plugin/application to which taglist
+" belongs.
+" Taglist plugin is part of another plugin like cream or winmanager.
+function! Tlist_Set_App(name)
+    if a:name == ""
+        return
+    endif
+
+    let s:tlist_app_name = a:name
+endfunction
+
+" Winmanager integration
+
+" Initialization required for integration with winmanager
+function! TagList_Start()
+    " If current buffer is not taglist buffer, then don't proceed
+    if bufname('%') != '__Tag_List__'
+        return
+    endif
+
+    call Tlist_Set_App('winmanager')
+
+    " Get the current filename from the winmanager plugin
+    let bufnum = WinManagerGetLastEditedFile()
+    if bufnum != -1
+        let filename = fnamemodify(bufname(bufnum), ':p')
+        let ftype = s:Tlist_Get_Buffer_Filetype(bufnum)
+    endif
+
+    " Initialize the taglist window, if it is not already initialized
+    if !exists('s:tlist_window_initialized') || !s:tlist_window_initialized
+        call s:Tlist_Window_Init()
+        call s:Tlist_Window_Refresh()
+        let s:tlist_window_initialized = 1
+    endif
+
+    " Update the taglist window
+    if bufnum != -1
+        if !s:Tlist_Skip_File(filename, ftype) && g:Tlist_Auto_Update
+            call s:Tlist_Window_Refresh_File(filename, ftype)
+        endif
+    endif
+endfunction
+
+function! TagList_IsValid()
+    return 0
+endfunction
+
+function! TagList_WrapUp()
+    return 0
+endfunction
+
+" restore 'cpo'
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
diff --git a/vim/plugin/unimpaired.vim b/vim/plugin/unimpaired.vim
new file mode 100644 (file)
index 0000000..60b6c02
--- /dev/null
@@ -0,0 +1,315 @@
+" unimpaired.vim - Pairs of handy bracket mappings
+" Maintainer:   Tim Pope <http://tpo.pe/>
+" Version:      1.1
+" GetLatestVimScripts: 1590 1 :AutoInstall: unimpaired.vim
+
+if exists("g:loaded_unimpaired") || &cp || v:version < 700
+  finish
+endif
+let g:loaded_unimpaired = 1
+
+" Next and previous {{{1
+
+function! s:MapNextFamily(map,cmd)
+  let map = '<Plug>unimpaired'.toupper(a:map)
+  let end = ' ".(v:count ? v:count : "")<CR>'
+  execute 'nmap <silent> '.map.'Previous :<C-U>exe "'.a:cmd.'previous'.end
+  execute 'nmap <silent> '.map.'Next     :<C-U>exe "'.a:cmd.'next'.end
+  execute 'nmap <silent> '.map.'First    :<C-U>exe "'.a:cmd.'first'.end
+  execute 'nmap <silent> '.map.'Last     :<C-U>exe "'.a:cmd.'last'.end
+  execute 'nmap <silent> ['.        a:map .' '.map.'Previous'
+  execute 'nmap <silent> ]'.        a:map .' '.map.'Next'
+  execute 'nmap <silent> ['.toupper(a:map).' '.map.'First'
+  execute 'nmap <silent> ]'.toupper(a:map).' '.map.'Last'
+endfunction
+
+call s:MapNextFamily('a','')
+call s:MapNextFamily('b','b')
+call s:MapNextFamily('l','l')
+call s:MapNextFamily('q','c')
+call s:MapNextFamily('t','t')
+
+function! s:entries(path)
+  let path = substitute(a:path,'[\\/]$','','')
+  let files = split(glob(path."/.*"),"\n")
+  let files += split(glob(path."/*"),"\n")
+  call map(files,'substitute(v:val,"[\\/]$","","")')
+  call filter(files,'v:val !~# "[\\\\/]\\.\\.\\=$"')
+  call filter(files,'v:val[-4:-1] !=# ".swp" && v:val[-1:-1] !=# "~"')
+  return files
+endfunction
+
+function! s:FileByOffset(num)
+  let file = expand('%:p')
+  let num = a:num
+  while num
+    let files = s:entries(fnamemodify(file,':h'))
+    if a:num < 0
+      call reverse(sort(filter(files,'v:val < file')))
+    else
+      call sort(filter(files,'v:val > file'))
+    endif
+    let temp = get(files,0,'')
+    if temp == ''
+      let file = fnamemodify(file,':h')
+    else
+      let file = temp
+      while isdirectory(file)
+        let files = s:entries(file)
+        if files == []
+          " TODO: walk back up the tree and continue
+          break
+        endif
+        let file = files[num > 0 ? 0 : -1]
+      endwhile
+      let num += num > 0 ? -1 : 1
+    endif
+  endwhile
+  return file
+endfunction
+
+nnoremap <silent> <Plug>unimpairedONext     :<C-U>edit `=<SID>FileByOffset(v:count1)`<CR>
+nnoremap <silent> <Plug>unimpairedOPrevious :<C-U>edit `=<SID>FileByOffset(-v:count1)`<CR>
+
+nmap ]o <Plug>unimpairedONext
+nmap [o <Plug>unimpairedOPrevious
+
+nmap [, :call search('^[<=>]\{7\}','bW')<CR>
+nmap ], :call search('^[<=>]\{7\}','W')<CR>
+omap [, V:call search('^[<=>]\{7\}','bW')<CR>
+omap ], V:call search('^[<=>]\{7\}','W')<CR>
+xmap [, :<C-U>exe 'norm! gv'<Bar>call search('^[<=>]\{7\}','bW')<CR>
+xmap ], :<C-U>exe 'norm! gv'<Bar>call search('^[<=>]\{7\}','W')<CR>
+nmap [< :call search('^<<<<<<<','bW')<CR>
+nmap [= :call search('^=======','bW')<CR>
+nmap [> :call search('^>>>>>>>','bW')<CR>
+nmap ]< :call search('^<<<<<<<','W')<CR>
+nmap ]= :call search('^=======','W')<CR>
+nmap ]> :call search('^>>>>>>>','W')<CR>
+xmap [< :<C-U>exe 'norm! gv'<Bar>call search('^<<<<<<<','bW')<CR>
+xmap [= :<C-U>exe 'norm! gv'<Bar>call search('^=======','bW')<CR>
+xmap [> :<C-U>exe 'norm! gv'<Bar>call search('^>>>>>>>','bW')<CR>
+xmap ]< :<C-U>exe 'norm! gv'<Bar>call search('^<<<<<<<','W')<CR>
+xmap ]= :<C-U>exe 'norm! gv'<Bar>call search('^=======','W')<CR>
+xmap ]> :<C-U>exe 'norm! gv'<Bar>call search('^>>>>>>>','W')<CR>
+omap [< V:call search('^<<<<<<<','bW')<CR>
+omap [= V:call search('^=======','bW')<CR>
+omap [> V:call search('^>>>>>>>','bW')<CR>
+omap ]< V:call search('^<<<<<<<','W')<CR>
+omap ]= V:call search('^=======','W')<CR>
+omap ]> V:call search('^>>>>>>>','W')<CR>
+
+" }}}1
+" Line operations {{{1
+
+function! s:BlankUp(count) abort
+  put!=repeat(nr2char(10), a:count)
+  ']+1
+  silent! call repeat#set("\<Plug>unimpairedBlankUp", a:count)
+endfunction
+
+function! s:BlankDown(count) abort
+  put =repeat(nr2char(10), a:count)
+  '[-1
+  silent! call repeat#set("\<Plug>unimpairedBlankDown", a:count)
+endfunction
+
+nnoremap <silent> <Plug>unimpairedBlankUp   :<C-U>call <SID>BlankUp(v:count1)<CR>
+nnoremap <silent> <Plug>unimpairedBlankDown :<C-U>call <SID>BlankDown(v:count1)<CR>
+
+nmap [<Space> <Plug>unimpairedBlankUp
+nmap ]<Space> <Plug>unimpairedBlankDown
+
+function! s:Move(cmd, count, map) abort
+  normal! m`
+  exe 'move'.a:cmd.a:count
+  norm! ``
+  call repeat#set("\<Plug>unimpairedMove".a:map, a:count)
+endfunction
+
+nnoremap <silent> <Plug>unimpairedMoveUp   :<C-U>call <SID>Move('--',v:count1,'Up')<CR>
+nnoremap <silent> <Plug>unimpairedMoveDown :<C-U>call <SID>Move('+',v:count1,'Down')<CR>
+xnoremap <silent> <Plug>unimpairedMoveUp   :<C-U>exe 'normal! m`'<Bar>exe '''<,''>move--'.v:count1<CR>``
+xnoremap <silent> <Plug>unimpairedMoveDown :<C-U>exe 'normal! m`'<Bar>exe '''<,''>move''>+'.v:count1<CR>``
+
+nmap [e <Plug>unimpairedMoveUp
+nmap ]e <Plug>unimpairedMoveDown
+xmap [e <Plug>unimpairedMoveUp
+xmap ]e <Plug>unimpairedMoveDown
+
+" }}}1
+" Encoding and decoding {{{1
+
+function! s:StringEncode(str)
+  let map = {"\n": 'n', "\r": 'r', "\t": 't', "\b": 'b', "\f": '\f', '"': '"', '\': '\'}
+  return substitute(a:str,"[\001-\033\\\\\"]",'\="\\".get(map,submatch(0),printf("%03o",char2nr(submatch(0))))','g')
+endfunction
+
+function! s:StringDecode(str)
+  let map = {'n': "\n", 'r': "\r", 't': "\t", 'b': "\b", 'f': "\f", 'e': "\e", 'a': "\001", 'v': "\013"}
+  let str = a:str
+  if str =~ '^\s*".\{-\}\\\@<!\%(\\\\\)*"\s*\n\=$'
+    let str = substitute(substitute(str,'^\s*\zs"','',''),'"\ze\s*\n\=$','','')
+  endif
+  let str = substitute(str,'\\n\%(\n$\)\=','\n','g')
+  return substitute(str,'\\\(\o\{1,3\}\|x\x\{1,2\}\|u\x\{1,4\}\|.\)','\=get(map,submatch(1),submatch(1) =~? "^[0-9xu]" ? nr2char("0".substitute(submatch(1),"^[Uu]","x","")) : submatch(1))','g')
+endfunction
+
+function! s:UrlEncode(str)
+  return substitute(a:str,'[^A-Za-z0-9_.~-]','\="%".printf("%02X",char2nr(submatch(0)))','g')
+endfunction
+
+function! s:UrlDecode(str)
+  let str = substitute(substitute(substitute(a:str,'%0[Aa]\n$','%0A',''),'%0[Aa]','\n','g'),'+',' ','g')
+  return substitute(str,'%\(\x\x\)','\=nr2char("0x".submatch(1))','g')
+endfunction
+
+" HTML entities {{{2
+
+let g:unimpaired_html_entities = {
+      \ 'nbsp':     160, 'iexcl':    161, 'cent':     162, 'pound':    163,
+      \ 'curren':   164, 'yen':      165, 'brvbar':   166, 'sect':     167,
+      \ 'uml':      168, 'copy':     169, 'ordf':     170, 'laquo':    171,
+      \ 'not':      172, 'shy':      173, 'reg':      174, 'macr':     175,
+      \ 'deg':      176, 'plusmn':   177, 'sup2':     178, 'sup3':     179,
+      \ 'acute':    180, 'micro':    181, 'para':     182, 'middot':   183,
+      \ 'cedil':    184, 'sup1':     185, 'ordm':     186, 'raquo':    187,
+      \ 'frac14':   188, 'frac12':   189, 'frac34':   190, 'iquest':   191,
+      \ 'Agrave':   192, 'Aacute':   193, 'Acirc':    194, 'Atilde':   195,
+      \ 'Auml':     196, 'Aring':    197, 'AElig':    198, 'Ccedil':   199,
+      \ 'Egrave':   200, 'Eacute':   201, 'Ecirc':    202, 'Euml':     203,
+      \ 'Igrave':   204, 'Iacute':   205, 'Icirc':    206, 'Iuml':     207,
+      \ 'ETH':      208, 'Ntilde':   209, 'Ograve':   210, 'Oacute':   211,
+      \ 'Ocirc':    212, 'Otilde':   213, 'Ouml':     214, 'times':    215,
+      \ 'Oslash':   216, 'Ugrave':   217, 'Uacute':   218, 'Ucirc':    219,
+      \ 'Uuml':     220, 'Yacute':   221, 'THORN':    222, 'szlig':    223,
+      \ 'agrave':   224, 'aacute':   225, 'acirc':    226, 'atilde':   227,
+      \ 'auml':     228, 'aring':    229, 'aelig':    230, 'ccedil':   231,
+      \ 'egrave':   232, 'eacute':   233, 'ecirc':    234, 'euml':     235,
+      \ 'igrave':   236, 'iacute':   237, 'icirc':    238, 'iuml':     239,
+      \ 'eth':      240, 'ntilde':   241, 'ograve':   242, 'oacute':   243,
+      \ 'ocirc':    244, 'otilde':   245, 'ouml':     246, 'divide':   247,
+      \ 'oslash':   248, 'ugrave':   249, 'uacute':   250, 'ucirc':    251,
+      \ 'uuml':     252, 'yacute':   253, 'thorn':    254, 'yuml':     255,
+      \ 'OElig':    338, 'oelig':    339, 'Scaron':   352, 'scaron':   353,
+      \ 'Yuml':     376, 'circ':     710, 'tilde':    732, 'ensp':    8194,
+      \ 'emsp':    8195, 'thinsp':  8201, 'zwnj':    8204, 'zwj':     8205,
+      \ 'lrm':     8206, 'rlm':     8207, 'ndash':   8211, 'mdash':   8212,
+      \ 'lsquo':   8216, 'rsquo':   8217, 'sbquo':   8218, 'ldquo':   8220,
+      \ 'rdquo':   8221, 'bdquo':   8222, 'dagger':  8224, 'Dagger':  8225,
+      \ 'permil':  8240, 'lsaquo':  8249, 'rsaquo':  8250, 'euro':    8364,
+      \ 'fnof':     402, 'Alpha':    913, 'Beta':     914, 'Gamma':    915,
+      \ 'Delta':    916, 'Epsilon':  917, 'Zeta':     918, 'Eta':      919,
+      \ 'Theta':    920, 'Iota':     921, 'Kappa':    922, 'Lambda':   923,
+      \ 'Mu':       924, 'Nu':       925, 'Xi':       926, 'Omicron':  927,
+      \ 'Pi':       928, 'Rho':      929, 'Sigma':    931, 'Tau':      932,
+      \ 'Upsilon':  933, 'Phi':      934, 'Chi':      935, 'Psi':      936,
+      \ 'Omega':    937, 'alpha':    945, 'beta':     946, 'gamma':    947,
+      \ 'delta':    948, 'epsilon':  949, 'zeta':     950, 'eta':      951,
+      \ 'theta':    952, 'iota':     953, 'kappa':    954, 'lambda':   955,
+      \ 'mu':       956, 'nu':       957, 'xi':       958, 'omicron':  959,
+      \ 'pi':       960, 'rho':      961, 'sigmaf':   962, 'sigma':    963,
+      \ 'tau':      964, 'upsilon':  965, 'phi':      966, 'chi':      967,
+      \ 'psi':      968, 'omega':    969, 'thetasym': 977, 'upsih':    978,
+      \ 'piv':      982, 'bull':    8226, 'hellip':  8230, 'prime':   8242,
+      \ 'Prime':   8243, 'oline':   8254, 'frasl':   8260, 'weierp':  8472,
+      \ 'image':   8465, 'real':    8476, 'trade':   8482, 'alefsym': 8501,
+      \ 'larr':    8592, 'uarr':    8593, 'rarr':    8594, 'darr':    8595,
+      \ 'harr':    8596, 'crarr':   8629, 'lArr':    8656, 'uArr':    8657,
+      \ 'rArr':    8658, 'dArr':    8659, 'hArr':    8660, 'forall':  8704,
+      \ 'part':    8706, 'exist':   8707, 'empty':   8709, 'nabla':   8711,
+      \ 'isin':    8712, 'notin':   8713, 'ni':      8715, 'prod':    8719,
+      \ 'sum':     8721, 'minus':   8722, 'lowast':  8727, 'radic':   8730,
+      \ 'prop':    8733, 'infin':   8734, 'ang':     8736, 'and':     8743,
+      \ 'or':      8744, 'cap':     8745, 'cup':     8746, 'int':     8747,
+      \ 'there4':  8756, 'sim':     8764, 'cong':    8773, 'asymp':   8776,
+      \ 'ne':      8800, 'equiv':   8801, 'le':      8804, 'ge':      8805,
+      \ 'sub':     8834, 'sup':     8835, 'nsub':    8836, 'sube':    8838,
+      \ 'supe':    8839, 'oplus':   8853, 'otimes':  8855, 'perp':    8869,
+      \ 'sdot':    8901, 'lceil':   8968, 'rceil':   8969, 'lfloor':  8970,
+      \ 'rfloor':  8971, 'lang':    9001, 'rang':    9002, 'loz':     9674,
+      \ 'spades':  9824, 'clubs':   9827, 'hearts':  9829, 'diams':   9830,
+      \ 'apos':      39}
+
+" }}}2
+
+function! s:XmlEncode(str)
+  let str = a:str
+  let str = substitute(str,'&','\&amp;','g')
+  let str = substitute(str,'<','\&lt;','g')
+  let str = substitute(str,'>','\&gt;','g')
+  let str = substitute(str,'"','\&quot;','g')
+  return str
+endfunction
+
+function! s:XmlEntityDecode(str)
+  let str = substitute(a:str,'\c&#\%(0*38\|x0*26\);','&amp;','g')
+  let str = substitute(str,'\c&#\(\d\+\);','\=nr2char(submatch(1))','g')
+  let str = substitute(str,'\c&#\(x\x\+\);','\=nr2char("0".submatch(1))','g')
+  let str = substitute(str,'\c&apos;',"'",'g')
+  let str = substitute(str,'\c&quot;','"','g')
+  let str = substitute(str,'\c&gt;','>','g')
+  let str = substitute(str,'\c&lt;','<','g')
+  let str = substitute(str,'\C&\(\%(amp;\)\@!\w*\);','\=nr2char(get(g:unimpaired_html_entities,submatch(1),63))','g')
+  return substitute(str,'\c&amp;','\&','g')
+endfunction
+
+function! s:XmlDecode(str)
+  let str = substitute(a:str,'<\%([[:alnum:]-]\+=\%("[^"]*"\|''[^'']*''\)\|.\)\{-\}>','','g')
+  return s:XmlEntityDecode(str)
+endfunction
+
+function! s:Transform(algorithm,type)
+  let sel_save = &selection
+  let cb_save = &clipboard
+  set selection=inclusive clipboard-=unnamed clipboard-=unnamedplus
+  let reg_save = @@
+  if a:type =~ '^\d\+$'
+    silent exe 'norm! ^v'.a:type.'$hy'
+  elseif a:type =~ '^.$'
+    silent exe "normal! `<" . a:type . "`>y"
+  elseif a:type == 'line'
+    silent exe "normal! '[V']y"
+  elseif a:type == 'block'
+    silent exe "normal! `[\<C-V>`]y"
+  else
+    silent exe "normal! `[v`]y"
+  endif
+  let @@ = s:{a:algorithm}(@@)
+  norm! gvp
+  let @@ = reg_save
+  let &selection = sel_save
+  let &clipboard = cb_save
+  if a:type =~ '^\d\+$'
+    silent! call repeat#set("\<Plug>unimpairedLine".a:algorithm,a:type)
+  endif
+endfunction
+
+function! s:TransformOpfunc(type)
+  return s:Transform(s:encode_algorithm, a:type)
+endfunction
+
+function! s:TransformSetup(algorithm)
+  let s:encode_algorithm = a:algorithm
+  let &opfunc = matchstr(expand('<sfile>'), '<SNR>\d\+_').'TransformOpfunc'
+endfunction
+
+function! s:MapTransform(algorithm, key)
+  exe 'nnoremap <silent> <Plug>unimpaired'    .a:algorithm.' :<C-U>call <SID>TransformSetup("'.a:algorithm.'")<CR>g@'
+  exe 'xnoremap <silent> <Plug>unimpaired'    .a:algorithm.' :<C-U>call <SID>Transform("'.a:algorithm.'",visualmode())<CR>'
+  exe 'nnoremap <silent> <Plug>unimpairedLine'.a:algorithm.' :<C-U>call <SID>Transform("'.a:algorithm.'",v:count1)<CR>'
+  exe 'nmap '.a:key.'  <Plug>unimpaired'.a:algorithm
+  exe 'xmap '.a:key.'  <Plug>unimpaired'.a:algorithm
+  exe 'nmap '.a:key.a:key[strlen(a:key)-1].' <Plug>unimpairedLine'.a:algorithm
+endfunction
+
+call s:MapTransform('StringEncode','[y')
+call s:MapTransform('StringDecode',']y')
+call s:MapTransform('UrlEncode','[u')
+call s:MapTransform('UrlDecode',']u')
+call s:MapTransform('XmlEncode','[x')
+call s:MapTransform('XmlDecode',']x')
+
+" }}}1
+
+" vim:set sw=2 sts=2:
diff --git a/vim/plugin/vim-rspec.rb b/vim/plugin/vim-rspec.rb
new file mode 100644 (file)
index 0000000..4d7f4c3
--- /dev/null
@@ -0,0 +1,32 @@
+require "rubygems"
+require "hpricot"
+
+doc            = Hpricot(STDIN.read)
+h1                     = (doc/"h1")
+classes        = {"spec passed"=>"+","spec failed"=>"-","spec not_implemented"=>"#"}
+
+puts "* #{h1.inner_html}"
+
+stats = (doc/"script").select {|script| script.innerHTML =~ /duration|totals/ }.map {|script| script.inner_html.scan(/".*"/).first.gsub(/<\/?strong>/,"") }
+stats.each do |stat|
+       puts "* #{stat.gsub(/\"/,'')}"
+end
+puts "* Parsed with Hpricot (http://wiki.github.com/why/hpricot)"
+puts " "
+
+(doc/"div[@class='example_group']").each do |example|
+       puts "[#{(example/"dl/dt").inner_html}]"
+       (example/"dd").each do |dd|
+               txt = (dd/"span:first").inner_html
+               puts "#{classes[dd[:class]]} #{txt}"
+               next if dd[:class]!="spec failed"
+               failure  = (dd/"div[@class='failure']")
+               msg             = (failure/"div[@class='message']/pre").inner_html
+               back            = (failure/"div[@class='backtrace']/pre").inner_html
+               ruby            = (failure/"pre[@class='ruby']/code").inner_html.scan(/(<span class="linenum">)(\d+)(<\/span>)([^<]+)/).map {|elem| "  "+elem[1]+": "+elem[3].chomp+"\n"}.join
+               puts "  #{msg}"
+               puts "  #{back}"
+               puts ruby
+       end
+       puts " "
+end
diff --git a/vim/plugin/vim-rspec.vim b/vim/plugin/vim-rspec.vim
new file mode 100644 (file)
index 0000000..edc7145
--- /dev/null
@@ -0,0 +1,174 @@
+"
+" Vim Rspec
+" Last change: March 5 2009
+" Version> 0.0.5
+" Maintainer: Eustรกquio 'TaQ' Rangel
+" License: GPL
+" URL: git://github.com/taq/vim-rspec
+"
+" Script to run the spec command inside Vim
+" To install, unpack the files on your ~/.vim directory and source it 
+"
+" The following options can be set/overridden in your .vimrc
+"   * g:RspecXSLPath     :: Path to xsl file
+"   * g:RspecRBFilePath  :: Path to vim-rspec.rb
+"   * g:RspecBin         :: Rspec binary command (in rspec 2 this is 'rspec')
+"   * g:RspecOpts        :: Opts to send to rspec call
+
+let s:xsltproc_cmd     = ""
+let s:grep_cmd                 = ""
+let s:hpricot_cmd              = ""
+let s:xslt                             = 0
+let s:hpricot                  = 0
+let s:helper_dir = expand("<sfile>:h")
+
+function! s:find_xslt()
+       return system("xsltproc --version | head -n1")
+endfunction
+
+function! s:find_grep()
+       return system("grep --version | head -n1")
+endfunction
+
+function! s:find_hpricot()
+       return system("gem search -i hpricot")
+endfunction
+
+function! s:error_msg(msg)
+       echohl ErrorMsg
+       echo a:msg
+       echohl None
+endfunction
+
+function! s:notice_msg(msg)
+       echohl MoreMsg
+       echo a:msg
+       echohl None
+endfunction
+
+function! s:fetch(varname, default)
+  if exists("g:".a:varname)
+    return eval("g:".a:varname)
+  else
+    return a:default
+  endif
+endfunction
+
+function! s:RunSpecMain(type)
+       if len(s:xsltproc_cmd)<1
+               let s:xsltproc_cmd = s:find_xslt()
+               let s:xslt  = match(s:xsltproc_cmd,'\d')>=0
+       end             
+       if len(s:hpricot_cmd)<1
+               let s:hpricot_cmd = s:find_hpricot()
+               let s:hpricot = match(s:hpricot_cmd,'true')>=0
+       end
+       if !s:hpricot && !s:xslt 
+               call s:error_msg("You need the hpricot gem or xsltproc to run this script.")
+               return
+       end
+       if len(s:grep_cmd)<1
+               let s:grep_cmd = s:find_grep()
+               if match(s:grep_cmd,'\d')<0
+                       call s:error_msg("You need grep to run this script.")
+                       return
+               end
+       end             
+       let l:bufn = bufname("%")
+
+   " find the installed rspec command
+   let l:default_cmd = ""
+   if executable("spec")==1
+      let l:default_cmd = "spec"
+   elseif executable("rspec")==1
+      let l:default_cmd = "rspec"
+   end
+
+       " filters
+       let l:xsl   = s:fetch("RspecXSLPath", s:helper_dir."/vim-rspec.xsl")
+       let l:rubys = s:fetch("RspecRBPath", s:helper_dir."/vim-rspec.rb")
+
+       " hpricot gets the priority
+       let l:type              = s:hpricot ? "hpricot" : "xsltproc"
+       let l:filter    = s:hpricot ? "ruby ".l:rubys : "xsltproc --novalid --html ".l:xsl." - "
+
+       " run just the current file
+       if a:type=="file"
+               if match(l:bufn,'_spec.rb')>=0
+                       call s:notice_msg("Running spec on the current file with ".l:type." ...")
+      let l:spec_bin = s:fetch("RspecBin",l:default_cmd)
+      let l:spec_opts = s:fetch("RspecOpts", "")
+      let l:spec = l:spec_bin . " " . l:spec_opts . " -f h " . l:bufn
+               else
+                       call s:error_msg("Seems ".l:bufn." is not a *_spec.rb file")
+                       return
+               end                     
+       else
+               let l:dir = expand("%:p:h")
+               if isdirectory(l:dir."/spec")>0
+                       call s:notice_msg("Running spec on the spec directory with ".l:type." ...")
+               else
+                       " try to find a spec directory on the current path
+                       let l:tokens = split(l:dir,"/")
+                       let l:dir = ""
+                       for l:item in l:tokens
+                               call remove(l:tokens,-1)
+                               let l:path = "/".join(l:tokens,"/")."/spec"
+                               if isdirectory(l:path)
+                                       let l:dir = l:path
+                                       break
+                               end
+                       endfor
+                       if len(l:dir)>0
+                               call s:notice_msg("Running spec with ".l:type." on the spec directory found (".l:dir.") ...")
+                       else
+                               call s:error_msg("No ".l:dir."/spec directory found")
+                               return
+                       end                             
+               end                     
+               if isdirectory(l:dir)<0
+                       call s:error_msg("Could not find the ".l:dir." directory.")
+                       return
+               end
+    let l:spec = s:fetch("RspecBin", "spec") . s:fetch("RspecOpts", "")
+    let l:spec = l:spec . " -f h " . l:dir . " -p **/*_spec.rb"
+       end             
+
+       " run the spec command
+       let s:cmd       = l:spec." | ".l:filter." 2> /dev/null | grep \"^[-\+\[\\#\\* ]\""
+       echo
+
+       " put the result on a new buffer
+       silent exec "new" 
+       setl buftype=nofile
+       silent exec "r! ".s:cmd
+       setl syntax=vim-rspec
+       silent exec "nnoremap <buffer> <cr> :call <SID>TryToOpen()<cr>"
+       silent exec "nnoremap <buffer> q :q<CR>"
+       setl foldmethod=expr
+       setl foldexpr=getline(v:lnum)=~'^\+'
+       setl foldtext=\"+--\ \".string(v:foldend-v:foldstart+1).\"\ passed\ \"
+       call cursor(1,1)        
+endfunction
+
+function! s:TryToOpen()
+       let l:line = getline(".")
+       if match(l:line,'^  [\/\.]')<0
+               call s:error_msg("No file found.")
+               return
+       end
+       let l:tokens = split(l:line,":")
+       silent exec "sp ".substitute(l:tokens[0],'/^\s\+',"","")
+       call cursor(l:tokens[1],1)
+endfunction
+
+function! RunSpec()
+       call s:RunSpecMain("file")
+endfunction
+
+function! RunSpecs()
+       call s:RunSpecMain("dir")
+endfunction
+
+command! RunSpec       call RunSpec()
+command! RunSpecs      call RunSpecs()
diff --git a/vim/plugin/vim-rspec.xsl b/vim/plugin/vim-rspec.xsl
new file mode 100644 (file)
index 0000000..432dc51
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="text"/>
+
+<xsl:template match="/">
+       <xsl:text>* Rspec Results&#10;</xsl:text>
+       <xsl:text>* Parsed with xsltproc (http://www.xmlsoft.org/XSLT/xsltproc2.html)&#10;</xsl:text>
+       <xsl:text> &#10;</xsl:text>
+       <xsl:apply-templates select="html/body/div[@class='rspec-report']/div[@class='results']"/>
+</xsl:template>        
+
+<xsl:template match="div[@class='rspec-report']">
+       <xsl:apply-templates/>
+</xsl:template>        
+
+<xsl:template match="div[@class='example_group']">
+       <xsl:text>[</xsl:text><xsl:value-of select="dl/dt"/><xsl:text>]</xsl:text>
+       <xsl:text>&#10;</xsl:text>
+       <xsl:apply-templates select="dl/dd"/>
+       <xsl:text> </xsl:text>
+</xsl:template>
+
+<xsl:template match="dd[@class='spec passed']">
+       <xsl:text>+ </xsl:text>
+       <xsl:value-of select="span"/>
+       <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="dd[@class='spec failed']">
+       <xsl:text>- </xsl:text>
+       <xsl:value-of select="span"/>
+       <xsl:text>&#10;</xsl:text>
+       <xsl:apply-templates select="div"/>
+</xsl:template>
+
+<xsl:template match="dd[@class='spec not_implemented']">
+       <xsl:text># </xsl:text>
+       <xsl:value-of select="span"/>
+       <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="dd[@class='spec failed']/div[@class='failure']">
+       <xsl:text>  </xsl:text><xsl:value-of select="div[@class='message']/pre"/>
+       <xsl:text>&#10;</xsl:text>
+       <xsl:text>  </xsl:text><xsl:value-of select="div[@class='backtrace']/pre"/>
+       <xsl:text>&#10;</xsl:text>
+       <xsl:apply-templates select="pre[@class='ruby']/code"/>
+</xsl:template>
+
+<xsl:template match="code">
+       <xsl:value-of select="text()"/>
+       <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/vim/ruby/.DS_Store b/vim/ruby/.DS_Store
new file mode 100644 (file)
index 0000000..5008ddf
Binary files /dev/null and b/vim/ruby/.DS_Store differ
diff --git a/vim/snippets/_.snippets b/vim/snippets/_.snippets
new file mode 100644 (file)
index 0000000..d3ee355
--- /dev/null
@@ -0,0 +1,9 @@
+# Global snippets
+
+# (c) holds no legal value ;)
+snippet c)
+       Copyright `&enc[:2] == "utf" ? "ยฉ" : "(c)"` `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.${2}
+snippet date
+       `strftime("%Y-%m-%d")`
+snippet ddate
+       `strftime("%B %d, %Y")`
diff --git a/vim/snippets/autoit.snippets b/vim/snippets/autoit.snippets
new file mode 100644 (file)
index 0000000..690018c
--- /dev/null
@@ -0,0 +1,66 @@
+snippet if
+       If ${1:condition} Then
+               ${2:; True code}
+       EndIf
+snippet el
+       Else
+               ${1}
+snippet elif
+       ElseIf ${1:condition} Then
+               ${2:; True code}
+# If/Else block
+snippet ifel
+       If ${1:condition} Then
+               ${2:; True code}
+       Else
+               ${3:; Else code}
+       EndIf
+# If/ElseIf/Else block
+snippet ifelif
+       If ${1:condition 1} Then
+               ${2:; True code}
+       ElseIf ${3:condition 2} Then
+               ${4:; True code}
+       Else
+               ${5:; Else code}
+       EndIf
+# Switch block
+snippet switch
+       Switch (${1:condition})
+       Case {$2:case1}:
+               {$3:; Case 1 code}
+       Case Else:
+               {$4:; Else code}
+       EndSwitch
+# Select block
+snippet select
+       Select (${1:condition})
+       Case {$2:case1}:
+               {$3:; Case 1 code}
+       Case Else:
+               {$4:; Else code}
+       EndSelect
+# While loop
+snippet while
+       While (${1:condition})
+               ${2:; code...}
+       WEnd
+# For loop
+snippet for
+       For ${1:n} = ${3:1} to ${2:count}
+               ${4:; code...}
+       Next
+# New Function
+snippet func
+       Func ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
+               ${4:Return}
+       EndFunc
+# Message box
+snippet msg
+       MsgBox(${3:MsgType}, ${1:"Title"}, ${2:"Message Text"})
+# Debug Message
+snippet debug
+       MsgBox(0, "Debug", ${1:"Debug Message"})
+# Show Variable Debug Message
+snippet showvar
+       MsgBox(0, "${1:VarName}", $1)
diff --git a/vim/snippets/c.snippets b/vim/snippets/c.snippets
new file mode 100644 (file)
index 0000000..e1c4f05
--- /dev/null
@@ -0,0 +1,113 @@
+# main()
+snippet main
+       int main(int argc, const char *argv[])
+       {
+               ${1}
+               return 0;
+       }
+snippet mainn
+       int main(void)
+       {
+               ${1}
+               return 0;
+       }
+# #include <...>
+snippet inc
+       #include <${1:stdio}.h>${2}
+# #include "..."
+snippet Inc
+       #include "${1:`Filename("$1.h")`}"${2}
+# #ifndef ... #define ... #endif
+snippet Def
+       #ifndef $1
+       #define ${1:SYMBOL} ${2:value}
+       #endif${3}
+snippet def
+       #define
+snippet ifdef
+       #ifdef ${1:FOO}
+               ${2:#define }
+       #endif
+snippet #if
+       #if ${1:FOO}
+               ${2}
+       #endif
+# Header Include-Guard
+snippet once
+       #ifndef ${1:`toupper(Filename('$1_H', 'UNTITLED_H'))`}
+
+       #define $1
+
+       ${2}
+
+       #endif /* end of include guard: $1 */
+# If Condition
+snippet if
+       if (${1:/* condition */}) {
+               ${2:/* code */}
+       }
+snippet el
+       else {
+               ${1}
+       }
+# Ternary conditional
+snippet t
+       ${1:/* condition */} ? ${2:a} : ${3:b}
+# Do While Loop
+snippet do
+       do {
+               ${2:/* code */}
+       } while (${1:/* condition */});
+# While Loop
+snippet wh
+       while (${1:/* condition */}) {
+               ${2:/* code */}
+       }
+# For Loop
+snippet for
+       for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
+               ${4:/* code */}
+       }
+# Custom For Loop
+snippet forr
+       for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
+               ${5:/* code */}
+       }
+# Function
+snippet fun
+       ${1:void} ${2:function_name}(${3})
+       {
+               ${4:/* code */}
+       }
+# Function Declaration
+snippet fund
+       ${1:void} ${2:function_name}(${3});${4}
+# Typedef
+snippet td
+       typedef ${1:int} ${2:MyCustomType};${3}
+# Struct
+snippet st
+       struct ${1:`Filename('$1_t', 'name')`} {
+               ${2:/* data */}
+       }${3: /* optional variable list */};${4}
+# Typedef struct
+snippet tds
+       typedef struct ${2:_$1 }{
+               ${3:/* data */}
+       } ${1:`Filename('$1_t', 'name')`};
+# Typdef enum
+snippet tde
+       typedef enum {
+               ${1:/* data */}
+       } ${2:foo};
+# printf
+# unfortunately version this isn't as nice as TextMates's, given the lack of a
+# dynamic `...`
+snippet pr
+       printf("${1:%s}\n"${2});${3}
+# fprintf (again, this isn't as nice as TextMate's version, but it works)
+snippet fpr
+       fprintf(${1:stderr}, "${2:%s}\n"${3});${4}
+# This is kind of convenient
+snippet .
+       [${1}]${2}
diff --git a/vim/snippets/cpp.snippets b/vim/snippets/cpp.snippets
new file mode 100644 (file)
index 0000000..fdabd63
--- /dev/null
@@ -0,0 +1,34 @@
+# Read File Into Vector
+snippet readfile
+       std::vector<char> v;
+       if (FILE *${2:fp} = fopen(${1:"filename"}, "r")) {
+               char buf[1024];
+               while (size_t len = fread(buf, 1, sizeof(buf), $2))
+                       v.insert(v.end(), buf, buf + len);
+               fclose($2);
+       }${3}
+# std::map
+snippet map
+       std::map<${1:key}, ${2:value}> map${3};
+# std::vector
+snippet vector
+       std::vector<${1:char}> v${2};
+# Namespace
+snippet ns
+       namespace ${1:`Filename('', 'my')`} {
+               ${2}
+       } /* $1 */
+# Class
+snippet cl
+       class ${1:`Filename('$1_t', 'name')`} {
+       public:
+               $1 (${2:arguments});
+               virtual ~$1 ();
+
+       private:
+               ${3:/* data */}
+       };
+snippet fori
+       for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
+               ${4:/* code */}
+       }
diff --git a/vim/snippets/erlang.snippets b/vim/snippets/erlang.snippets
new file mode 100644 (file)
index 0000000..7238149
--- /dev/null
@@ -0,0 +1,39 @@
+# module and export all
+snippet mod
+       -module(${1:`Filename('', 'my')`}).
+       
+       -compile([export_all]).
+       
+       start() ->
+           ${2}
+       
+       stop() ->
+           ok.
+# define directive
+snippet def
+       -define(${1:macro}, ${2:body}).${3}
+# export directive
+snippet exp
+       -export([${1:function}/${2:arity}]).
+# include directive
+snippet inc
+       -include("${1:file}").${2}
+# behavior directive
+snippet beh
+       -behaviour(${1:behaviour}).${2}
+# if expression
+snippet if
+       if
+           ${1:guard} ->
+               ${2:body}
+       end
+# case expression
+snippet case
+       case ${1:expression} of
+           ${2:pattern} ->
+               ${3:body};
+       end
+# record directive
+snippet rec
+       -record(${1:record}, {
+           ${2:field}=${3:value}}).${4}
diff --git a/vim/snippets/html.snippets b/vim/snippets/html.snippets
new file mode 100644 (file)
index 0000000..302cea2
--- /dev/null
@@ -0,0 +1,190 @@
+# Some useful Unicode entities
+# Non-Breaking Space
+snippet nbs
+       &nbsp;
+# โ†
+snippet left
+       &#x2190;
+# โ†’
+snippet right
+       &#x2192;
+# โ†‘
+snippet up
+       &#x2191;
+# โ†“
+snippet down
+       &#x2193;
+# โ†ฉ
+snippet return
+       &#x21A9;
+# โ‡ค
+snippet backtab
+       &#x21E4;
+# โ‡ฅ
+snippet tab
+       &#x21E5;
+# โ‡ง
+snippet shift
+       &#x21E7;
+# โŒƒ
+snippet control
+       &#x2303;
+# โŒ…
+snippet enter
+       &#x2305;
+# โŒ˜
+snippet command
+       &#x2318;
+# โŒฅ
+snippet option
+       &#x2325;
+# โŒฆ
+snippet delete
+       &#x2326;
+# โŒซ
+snippet backspace
+       &#x232B;
+# โŽ‹
+snippet escape
+       &#x238B;
+# Generic Doctype
+snippet doctype HTML 4.01 Strict
+       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+       "http://www.w3.org/TR/html4/strict.dtd">
+snippet doctype HTML 4.01 Transitional
+       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd">
+snippet doctype HTML 5
+       <!DOCTYPE HTML>
+snippet doctype XHTML 1.0 Frameset
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+snippet doctype XHTML 1.0 Strict
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+snippet doctype XHTML 1.0 Transitional
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+snippet doctype XHTML 1.1
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+       "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+# HTML Doctype 4.01 Strict
+snippet docts
+       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+       "http://www.w3.org/TR/html4/strict.dtd">
+# HTML Doctype 4.01 Transitional
+snippet doct
+       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd">
+# HTML Doctype 5
+snippet doct5
+       <!DOCTYPE HTML>
+# XHTML Doctype 1.0 Frameset
+snippet docxf
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+# XHTML Doctype 1.0 Strict
+snippet docxs
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+# XHTML Doctype 1.0 Transitional
+snippet docxt
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+# XHTML Doctype 1.1
+snippet docx
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+       "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+snippet html
+       <html>
+       ${1}
+       </html>
+snippet xhtml
+       <html xmlns="http://www.w3.org/1999/xhtml">
+       ${1}
+       </html>
+snippet body
+       <body>
+               ${1}
+       </body>
+snippet head
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset=utf-8"`Close()`>
+
+               <title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
+               ${2}
+       </head>
+snippet title
+       <title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>${2}
+snippet script
+       <script type="text/javascript" charset="utf-8">
+               ${1}
+       </script>${2}
+snippet scriptsrc
+       <script src="${1}.js" type="text/javascript" charset="utf-8"></script>${2}
+snippet style
+       <style type="text/css" media="${1:screen}">
+               ${2}
+       </style>${3}
+snippet base
+       <base href="${1}" target="${2}"`Close()`>
+snippet r
+       <br`Close()[1:]`>
+snippet div
+       <div id="${1:name}">
+               ${2}
+       </div>
+# Embed QT Movie
+snippet movie
+       <object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
+        codebase="http://www.apple.com/qtactivex/qtplugin.cab">
+               <param name="src" value="$1"`Close()`>
+               <param name="controller" value="$4"`Close()`>
+               <param name="autoplay" value="$5"`Close()`>
+               <embed src="${1:movie.mov}"
+                       width="${2:320}" height="${3:240}"
+                       controller="${4:true}" autoplay="${5:true}"
+                       scale="tofit" cache="true"
+                       pluginspage="http://www.apple.com/quicktime/download/"
+               `Close()[1:]`>
+       </object>${6}
+snippet fieldset
+       <fieldset id="$1">
+               <legend>${1:name}</legend>
+
+               ${3}
+       </fieldset>
+snippet form
+       <form action="${1:`Filename('$1_submit')`}" method="${2:get}" accept-charset="utf-8">
+               ${3}
+
+
+       <p><input type="submit" value="Continue &rarr;"`Close()`></p>
+       </form>
+snippet h1
+       <h1 id="${1:heading}">${2:$1}</h1>
+snippet input
+       <input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="${3}"`Close()`>${4}
+snippet label
+       <label for="${2:$1}">${1:name}</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="${5}" id="${6:$2}"`Close()`>${7}
+snippet link
+       <link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" charset="utf-8"`Close()`>${4}
+snippet mailto
+       <a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a>
+snippet meta
+       <meta name="${1:name}" content="${2:content}"`Close()`>${3}
+snippet opt
+       <option value="${1:option}">${2:$1}</option>${3}
+snippet optt
+       <option>${1:option}</option>${2}
+snippet select
+       <select name="${1:some_name}" id="${2:$1}">
+               <option value="${3:option}">${4:$3}</option>
+       </select>${5}
+snippet table
+       <table border="${1:0}">
+               <tr><th>${2:Header}</th></tr>
+               <tr><th>${3:Data}</th></tr>
+       </table>${4}
+snippet textarea
+       <textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">${4}</textarea>${5}
diff --git a/vim/snippets/java.snippets b/vim/snippets/java.snippets
new file mode 100644 (file)
index 0000000..dd96b79
--- /dev/null
@@ -0,0 +1,95 @@
+snippet main
+       public static void main (String [] args)
+       {
+               ${1:/* code */}
+       }
+snippet pu
+       public
+snippet po
+       protected
+snippet pr
+       private
+snippet st
+       static
+snippet fi
+       final
+snippet ab
+       abstract
+snippet re
+       return
+snippet br
+       break;
+snippet de
+       default:
+               ${1}
+snippet ca
+       catch(${1:Exception} ${2:e}) ${3}
+snippet th
+       throw 
+snippet sy
+       synchronized
+snippet im
+       import
+snippet imp
+       implements
+snippet ext
+       extends 
+snippet j.u
+       java.util
+snippet j.i
+       java.io.
+snippet j.b
+       java.beans.
+snippet j.n
+       java.net.
+snippet j.m
+       java.math.
+snippet if
+       if (${1}) ${2}
+snippet el
+       else 
+snippet elif
+       else if (${1}) ${2}
+snippet wh
+       while (${1}) ${2}
+snippet for
+       for (${1}; ${2}; ${3}) ${4}
+snippet fore
+       for (${1} : ${2}) ${3}
+snippet sw
+       switch (${1}) ${2}
+snippet cs
+       case ${1}:
+               ${2}
+       ${3}
+snippet tc
+       public class ${1:`Filename()`} extends ${2:TestCase}
+snippet t
+       public void test${1:Name}() throws Exception ${2}
+snippet cl
+       class ${1:`Filename("", "untitled")`} ${2}
+snippet in
+       interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3}
+snippet m
+       ${1:void} ${2:method}(${3}) ${4:throws }${5}
+snippet v
+       ${1:String} ${2:var}${3: = null}${4};${5}
+snippet co
+       static public final ${1:String} ${2:var} = ${3};${4}
+snippet cos
+       static public final String ${1:var} = "${2}";${3}
+snippet as
+       assert ${1:test} : "${2:Failure message}";${3}
+snippet try
+       try {
+               ${3}
+       } catch(${1:Exception} ${2:e}) {
+       }
+snippet tryf
+       try {
+               ${3}
+       } catch(${1:Exception} ${2:e}) {
+       } finally {
+       }
+snippet rst
+       ResultSet ${1:rst}${2: = null}${3};${4}
diff --git a/vim/snippets/javascript.snippets b/vim/snippets/javascript.snippets
new file mode 100644 (file)
index 0000000..f869e2f
--- /dev/null
@@ -0,0 +1,74 @@
+# Prototype
+snippet proto
+       ${1:class_name}.prototype.${2:method_name} =
+       function(${3:first_argument}) {
+               ${4:// body...}
+       };
+# Function
+snippet fun
+       function ${1:function_name} (${2:argument}) {
+               ${3:// body...}
+       }
+# Anonymous Function
+snippet f
+       function(${1}) {${2}};
+# if
+snippet if
+       if (${1:true}) {${2}}
+# if ... else
+snippet ife
+       if (${1:true}) {${2}}
+       else{${3}}
+# tertiary conditional
+snippet t
+       ${1:/* condition */} ? ${2:a} : ${3:b}
+# switch
+snippet switch
+       switch(${1:expression}) {
+               case '${3:case}':
+                       ${4:// code}
+                       break;
+               ${5}
+               default:
+                       ${2:// code}
+       }
+# case
+snippet case
+       case '${1:case}':
+               ${2:// code}
+               break;
+       ${3}
+# for (...) {...}
+snippet for
+       for (var ${2:i} = 0; $2 < ${1:Things}.length; $2${3:++}) {
+               ${4:$1[$2]}
+       };
+# for (...) {...} (Improved Native For-Loop)
+snippet forr
+       for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2${3:--}) {
+               ${4:$1[$2]}
+       };
+# while (...) {...}
+snippet wh
+       while (${1:/* condition */}) {
+               ${2:/* code */}
+       }
+# do...while
+snippet do
+       do {
+               ${2:/* code */}
+       } while (${1:/* condition */});
+# Object Method
+snippet :f
+       ${1:method_name}: function(${2:attribute}) {
+               ${4}
+       }${3:,}
+# setTimeout function
+snippet timeout
+       setTimeout(function() {${3}}${2}, ${1:10};
+# Get Elements
+snippet get
+       getElementsBy${1:TagName}('${2}')${3}
+# Get Element
+snippet gett
+       getElementBy${1:Id}('${2}')${3}
diff --git a/vim/snippets/mako.snippets b/vim/snippets/mako.snippets
new file mode 100644 (file)
index 0000000..2a0aef9
--- /dev/null
@@ -0,0 +1,54 @@
+snippet def
+       <%def name="${1:name}">
+               ${2:}
+       </%def>
+snippet call
+       <%call expr="${1:name}">
+               ${2:}
+       </%call>
+snippet doc
+       <%doc>
+               ${1:}
+       </%doc>
+snippet text
+       <%text>
+               ${1:}
+       </%text>
+snippet for
+       % for ${1:i} in ${2:iter}:
+               ${3:}
+       % endfor
+snippet if if
+       % if ${1:condition}:
+               ${2:}
+       % endif
+snippet if if/else
+       % if ${1:condition}:
+               ${2:}
+       % else:
+               ${3:}
+       % endif
+snippet try
+       % try:
+               ${1:}
+       % except${2:}:
+               ${3:pass}
+       % endtry
+snippet wh
+       % while ${1:}:
+               ${2:}
+       % endwhile
+snippet $
+       ${ ${1:} }
+snippet <%
+       <% ${1:} %>
+snippet <!%
+       <!% ${1:} %>
+snippet inherit
+       <%inherit file="${1:filename}" />
+snippet include
+       <%include file="${1:filename}" />
+snippet namespace
+       <%namespace file="${1:name}" />
+snippet page
+       <%page args="${1:}" />
diff --git a/vim/snippets/objc.snippets b/vim/snippets/objc.snippets
new file mode 100644 (file)
index 0000000..85b80d9
--- /dev/null
@@ -0,0 +1,247 @@
+# #import <...>
+snippet Imp
+       #import <${1:Cocoa/Cocoa.h}>${2}
+# #import "..."
+snippet imp
+       #import "${1:`Filename()`.h}"${2}
+# @selector(...)
+snippet sel
+       @selector(${1:method}:)${3}
+# @"..." string
+snippet s
+       @"${1}"${2}
+# Object
+snippet o
+       ${1:NSObject} *${2:foo} = [${3:$1 alloc}]${4};${5}
+# NSLog(...)
+snippet log
+       NSLog(@"${1:%@}"${2});${3}
+# Class
+snippet objc
+       @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject}
+       {
+       }
+       @end
+
+       @implementation $1
+       ${3}
+       @end
+# Class Interface
+snippet int
+       @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject}
+       {${3}
+       }
+       ${4}
+       @end
+snippet @interface
+       @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject}
+       {${3}
+       }
+       ${4}
+       @end
+# Class Implementation
+snippet impl
+       @implementation ${1:`Filename('', 'someClass')`}
+       ${2}
+       @end
+snippet @implementation
+       @implementation ${1:`Filename('', 'someClass')`}
+       ${2}
+       @end
+# Protocol
+snippet pro
+       @protocol ${1:`Filename('$1Delegate', 'MyProtocol')`} ${2:<NSObject>}
+       ${3}
+       @end
+snippet @protocol
+       @protocol ${1:`Filename('$1Delegate', 'MyProtocol')`} ${2:<NSObject>}
+       ${3}
+       @end
+# init Definition
+snippet init
+       - (id)init
+       {
+               if (self = [super init]) {
+                       ${1}
+               }
+               return self;
+       }
+# dealloc Definition
+snippet dealloc
+       - (void) dealloc
+       {
+               ${1:deallocations}
+               [super dealloc];
+       }
+snippet su
+       [super ${1:init}]${2}
+snippet ibo
+       IBOutlet ${1:NSSomeClass} *${2:$1};${3}
+# Category
+snippet cat
+       @interface ${1:NSObject} (${2:MyCategory})
+       @end
+
+       @implementation $1 ($2)
+       ${3}
+       @end
+# Category Interface
+snippet cath
+       @interface ${1:`Filename('$1', 'NSObject')`} (${2:MyCategory})
+       ${3}
+       @end
+# Method
+snippet m
+       - (${1:id})${2:method}
+       {
+               ${3}
+       }
+# Method declaration
+snippet md
+       - (${1:id})${2:method};${3}
+# IBAction declaration
+snippet ibad
+       - (IBAction)${1:method}:(${2:id})sender;${3}
+# IBAction method
+snippet iba
+       - (IBAction)${1:method}:(${2:id})sender
+       {
+               ${3}
+       }
+# awakeFromNib method
+snippet wake
+       - (void)awakeFromNib
+       {
+               ${1}
+       }
+# Class Method
+snippet M
+       + (${1:id})${2:method}
+       {
+               ${3:return nil;}
+       }
+# Sub-method (Call super)
+snippet sm
+       - (${1:id})${2:method}
+       {
+               [super $2];${3}
+               return self;
+       }
+# Accessor Methods For:
+# Object
+snippet objacc
+       - (${1:id})${2:thing}
+       {
+               return $2;
+       }
+
+       - (void)set$2:($1)${3:new$2}
+       {
+               [$3 retain];
+               [$2 release];
+               $2 = $3;
+       }${4}
+# for (object in array)
+snippet forin
+       for (${1:Class} *${2:some$1} in ${3:array}) {
+               ${4}
+       }
+snippet fore
+       for (${1:object} in ${2:array}) {
+               ${3:statements}
+       }
+snippet forarray
+       unsigned int ${1:object}Count = [${2:array} count];
+
+       for (unsigned int index = 0; index < $1Count; index++) {
+               ${3:id} $1 = [$2 $1AtIndex:index];
+               ${4}
+       }
+snippet fora
+       unsigned int ${1:object}Count = [${2:array} count];
+
+       for (unsigned int index = 0; index < $1Count; index++) {
+               ${3:id} $1 = [$2 $1AtIndex:index];
+               ${4}
+       }
+# Try / Catch Block
+snippet        @try
+       @try {
+               ${1:statements}
+       }
+       @catch (NSException * e) {
+               ${2:handler}
+       }
+       @finally {
+               ${3:statements}
+       }
+snippet @catch
+       @catch (${1:exception}) {
+               ${2:handler}
+       }
+snippet @finally
+       @finally {
+               ${1:statements}
+       }
+# IBOutlet
+# @property (Objective-C 2.0)
+snippet prop
+       @property (${1:retain}) ${2:NSSomeClass} ${3:*$2};${4}
+# @synthesize (Objective-C 2.0)
+snippet syn
+       @synthesize ${1:property};${2}
+# [[ alloc] init]
+snippet alloc
+       [[${1:foo} alloc] init${2}];${3}
+snippet a
+       [[${1:foo} alloc] init${2}];${3}
+# retain
+snippet ret
+       [${1:foo} retain];${2}
+# release
+snippet rel
+       [${1:foo} release];
+# autorelease
+snippet arel
+       [${1:foo} autorelease];
+# autorelease pool
+snippet pool
+       NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init];
+       ${2:/* code */}
+       [$1 drain];
+# Throw an exception
+snippet except
+       NSException *${1:badness};
+       $1 = [NSException exceptionWithName:@"${2:$1Name}"
+                                    reason:@"${3}"
+                                  userInfo:nil];
+       [$1 raise];
+snippet prag
+       #pragma mark ${1:-}
+snippet cl
+       @class ${1:Foo};${2}
+snippet color
+       [[NSColor ${1:blackColor}] set];
+# NSArray
+snippet array
+       NSMutableArray *${1:array} = [NSMutable array];${2}
+snippet nsa
+       NSArray ${1}
+snippet nsma
+       NSMutableArray ${1}
+snippet aa
+       NSArray * array;${1}
+snippet ma
+       NSMutableArray * array;${1}
+# NSDictionary
+snippet dict
+       NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2}
+snippet nsd
+       NSDictionary ${1}
+snippet nsmd
+       NSMutableDictionary ${1}
+# NSString
+snippet nss
+       NSString ${1}
+snippet nsms
+       NSMutableString ${1}
diff --git a/vim/snippets/perl.snippets b/vim/snippets/perl.snippets
new file mode 100644 (file)
index 0000000..c85ff11
--- /dev/null
@@ -0,0 +1,97 @@
+# #!/usr/bin/perl
+snippet #!
+       #!/usr/bin/perl
+
+# Hash Pointer
+snippet .
+        =>
+# Function
+snippet sub
+       sub ${1:function_name} {
+               ${2:#body ...}
+       }
+# Conditional
+snippet if
+       if (${1}) {
+               ${2:# body...}
+       }
+# Conditional if..else
+snippet ife
+       if (${1}) {
+               ${2:# body...}
+       }
+       else {
+               ${3:# else...}
+       }
+# Conditional if..elsif..else
+snippet ifee
+       if (${1}) {
+               ${2:# body...}
+       }
+       elsif (${3}) {
+               ${4:# elsif...}
+       }
+       else {
+               ${5:# else...}
+       }
+# Conditional One-line
+snippet xif
+       ${1:expression} if ${2:condition};${3}
+# Unless conditional
+snippet unless
+       unless (${1}) {
+               ${2:# body...}
+       }
+# Unless conditional One-line
+snippet xunless
+       ${1:expression} unless ${2:condition};${3}
+# Try/Except
+snippet eval
+       eval {
+               ${1:# do something risky...}
+       };
+       if ($@) {
+               ${2:# handle failure...}
+       }
+# While Loop
+snippet wh
+       while (${1}) {
+               ${2:# body...}
+       }
+# While Loop One-line
+snippet xwh
+       ${1:expression} while ${2:condition};${3}
+# C-style For Loop
+snippet cfor
+       for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) {
+               ${4:# body...}
+       }
+# For loop one-line
+snippet xfor
+       ${1:expression} for @${2:array};${3}
+# Foreach Loop
+snippet for
+       foreach my $${1:x} (@${2:array}) {
+               ${3:# body...}
+       }
+# Foreach Loop One-line
+snippet fore
+       ${1:expression} foreach @${2:array};${3}
+# Package
+snippet cl
+       package ${1:ClassName};
+
+       use base qw(${2:ParentClass});
+
+       sub new {
+               my $class = shift;
+               $class = ref $class if ref $class;
+               my $self = bless {}, $class;
+               $self;
+       }
+
+       1;${3}
+# Read File
+snippet slurp
+       my $${1:var};
+       { local $/ = undef; local *FILE; open FILE, "<${2:file}"; $$1 = <FILE>; close FILE }${3}
diff --git a/vim/snippets/php.snippets b/vim/snippets/php.snippets
new file mode 100644 (file)
index 0000000..3ce9e26
--- /dev/null
@@ -0,0 +1,216 @@
+snippet php
+       <?php
+       ${1}
+       ?>
+snippet ec
+       echo "${1:string}"${2};
+snippet inc
+       include '${1:file}';${2}
+snippet inc1
+       include_once '${1:file}';${2}
+snippet req
+       require '${1:file}';${2}
+snippet req1
+       require_once '${1:file}';${2}
+# $GLOBALS['...']
+snippet globals
+       $GLOBALS['${1:variable}']${2: = }${3:something}${4:;}${5}
+snippet $_ COOKIE['...']
+       $_COOKIE['${1:variable}']${2}
+snippet $_ ENV['...']
+       $_ENV['${1:variable}']${2}
+snippet $_ FILES['...']
+       $_FILES['${1:variable}']${2}
+snippet $_ Get['...']
+       $_GET['${1:variable}']${2}
+snippet $_ POST['...']
+       $_POST['${1:variable}']${2}
+snippet $_ REQUEST['...']
+       $_REQUEST['${1:variable}']${2}
+snippet $_ SERVER['...']
+       $_SERVER['${1:variable}']${2}
+snippet $_ SESSION['...']
+       $_SESSION['${1:variable}']${2}
+# Start Docblock
+snippet /*
+       /**
+        * ${1}
+        **/
+# Class - post doc
+snippet doc_cp
+       /**
+        * ${1:undocumented class}
+        *
+        * @package ${2:default}
+        * @author ${3:`g:snips_author`}
+       **/${4}
+# Class Variable - post doc
+snippet doc_vp
+       /**
+        * ${1:undocumented class variable}
+        *
+        * @var ${2:string}
+        **/${3}
+# Class Variable
+snippet doc_v
+       /**
+        * ${3:undocumented class variable}
+        *
+        * @var ${4:string}
+        **/
+       ${1:var} $${2};${5}
+# Class
+snippet doc_c
+       /**
+        * ${3:undocumented class}
+        *
+        * @packaged ${4:default}
+        * @author ${5:`g:snips_author`}
+        **/
+       ${1:}class ${2:}
+       {${6}
+       } // END $1class $2
+# Constant Definition - post doc
+snippet doc_dp
+       /**
+        * ${1:undocumented constant}
+        **/${2}
+# Constant Definition
+snippet doc_d
+       /**
+        * ${3:undocumented constant}
+        **/
+       define(${1}, ${2});${4}
+# Function - post doc
+snippet doc_fp
+       /**
+        * ${1:undocumented function}
+        *
+        * @return ${2:void}
+        * @author ${3:`g:snips_author`}
+        **/${4}
+# Function signature
+snippet doc_s
+       /**
+        * ${4:undocumented function}
+        *
+        * @return ${5:void}
+        * @author ${6:`g:snips_author`}
+        **/
+       ${1}function ${2}(${3});${7}
+# Function
+snippet doc_f
+       /**
+        * ${4:undocumented function}
+        *
+        * @return ${5:void}
+        * @author ${6:`g:snips_author`}
+        **/
+       ${1}function ${2}(${3})
+       {${7}
+       }
+# Header
+snippet doc_h
+       /**
+        * ${1}
+        *
+        * @author ${2:`g:snips_author`}
+        * @version ${3:$Id$}
+        * @copyright ${4:$2}, `strftime('%d %B, %Y')`
+        * @package ${5:default}
+        **/
+       
+       /**
+        * Define DocBlock
+        *//
+# Interface
+snippet doc_i
+       /**
+        * ${2:undocumented class}
+        *
+        * @package ${3:default}
+        * @author ${4:`g:snips_author`}
+        **/
+       interface ${1:}
+       {${5}
+       } // END interface $1
+# class ...
+snippet class
+       /**
+        * ${1}
+        **/
+       class ${2:ClassName}
+       {
+               ${3}
+               function ${4:__construct}(${5:argument})
+               {
+                       ${6:// code...}
+               }
+       }
+# define(...)
+snippet def
+       define('${1}'${2});${3}
+# defined(...)
+snippet def?
+       ${1}defined('${2}')${3}
+snippet wh
+       while (${1:/* condition */}) {
+               ${2:// code...}
+       }
+# do ... while
+snippet do
+       do {
+               ${2:// code... }
+       } while (${1:/* condition */});
+snippet if
+       if (${1:/* condition */}) {
+               ${2:// code...}
+       }
+snippet ife
+       if (${1:/* condition */}) {
+               ${2:// code...}
+       } else {
+               ${3:// code...}
+       }
+       ${4}
+snippet else
+       else {
+               ${1:// code...}
+       }
+snippet elseif
+       elseif (${1:/* condition */}) {
+               ${2:// code...}
+       }
+# Tertiary conditional
+snippet t
+       $${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5}
+snippet switch
+       switch ($${1:variable}) {
+               case '${2:value}':
+                       ${3:// code...}
+                       break;
+               ${5}
+               default:
+                       ${4:// code...}
+                       break;
+       }
+snippet case
+       case '${1:value}':
+               ${2:// code...}
+               break;${3}
+snippet for
+       for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
+               ${4: // code...}
+       }
+snippet foreach
+       foreach ($${1:variable} as $${2:key}) {
+               ${3:// code...}
+       }
+snippet fun
+       ${1:public }function ${2:FunctionName}(${3})
+       {
+               ${4:// code...}
+       }
+# $... = array (...)
+snippet array
+       $${1:arrayName} = array('${2}' => ${3});${4}
diff --git a/vim/snippets/puppet.snippets b/vim/snippets/puppet.snippets
new file mode 100644 (file)
index 0000000..1bb62d0
--- /dev/null
@@ -0,0 +1,82 @@
+# vim: nofoldenable foldmethod=manual
+snippet file
+       file {
+         "${1:filename}":
+           ensure => "${3:file}",
+           source => "puppet:///${2:source}",
+           owner  => "${4:root}",
+           group  => "${5:root}",
+           mode   => '${6:0755}';
+       }
+snippet exec
+       exec {
+         "${1:name}":
+           command     => "${2:command}",
+           refreshonly => "${3:true}",
+           onlyif      => "${4:run_if_true}",
+           unless      => "${5:run_if_false}",
+       }
+snippet encap
+       encap {
+         "${1:package_name}":
+           ensure => "${2:package_version}";
+       }
+snippet package
+       package {
+         "${1:package_name}":
+           ensure   => "${2:installed}";
+           provider => "yum",
+       }
+snippet tidy
+       tidy {
+         "${1:directory}":
+           age     => "${2:0}",
+           matches => [ "${3:pattern}" ],
+           recurse => "${4:true}",
+           rmdirs  => "${5:true}";
+       }
+snippet cron
+       cron {
+         "${1:name}":
+           command => "${2:command}",
+           hour    => ${3:hour},
+           minute  => ${4:minute},
+           day     => ${5:day};
+       }
+snippet class
+       # Class:: $1
+       #
+       #
+       class ${1:classname} {
+         ${2:#code...}
+       } # Class:: $1
+snippet def
+       # Define:: $1
+       # Args:: $2
+       #
+       define ${1:defname}(${2:args}) {
+         ${3:#code}
+       } # Define: $1
+snippet inc
+       include "${1}"
+snippet #head
+       # Module:: ${1:modulename}
+       # Manifest:: ${2:init.pp}
+       #
+       # Author:: `system("git config user.name")` (<`system("git config user.email")`>)
+       # Date:: `system("ruby -e 'puts Time.now'")`
+       #
+       ${3}
+snippet #class
+       # Module:: ${1:modulename}
+       # Class: ${2:classname}
+       #
+       # ${3:description}
+       #
+       # Author:: `system("git config user.name")` (<`system("git config user.email")`>)
+       # Date:: `system("ruby -e 'puts Time.now'")`
+       #
+       class $1::$2
+       {
+
+       }
diff --git a/vim/snippets/python.snippets b/vim/snippets/python.snippets
new file mode 100644 (file)
index 0000000..28a2948
--- /dev/null
@@ -0,0 +1,86 @@
+snippet #!
+       #!/usr/bin/env python
+
+snippet imp
+       import ${1:module}
+# Module Docstring
+snippet docs
+       '''
+       File: ${1:`Filename('$1.py', 'foo.py')`}
+       Author: ${2:`g:snips_author`}
+       Description: ${3}
+       '''
+snippet wh
+       while ${1:condition}:
+               ${2:# code...}
+snippet for
+       for ${1:needle} in ${2:haystack}:
+               ${3:# code...}
+# New Class
+snippet cl
+       class ${1:ClassName}(${2:object}):
+               """${3:docstring for $1}"""
+               def __init__(self, ${4:arg}):
+                       ${5:super($1, self).__init__()}
+                       self.$4 = $4
+                       ${6}
+# New Function
+snippet def
+       def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
+               """${3:docstring for $1}"""
+               ${4:pass}
+snippet deff
+       def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
+               ${3}
+# New Method
+snippet defs
+       def ${1:mname}(self, ${2:arg}):
+               ${3:pass}
+# New Property
+snippet property
+       def ${1:foo}():
+               doc = "${2:The $1 property.}"
+               def fget(self):
+                       ${3:return self._$1}
+               def fset(self, value):
+                       ${4:self._$1 = value}
+# Lambda
+snippet ld
+       ${1:var} = lambda ${2:vars} : ${3:action}
+snippet .
+       self.
+snippet try Try/Except
+       try:
+               ${1:pass}
+       except ${2:Exception}, ${3:e}:
+               ${4:raise $3}
+snippet try Try/Except/Else
+       try:
+               ${1:pass}
+       except ${2:Exception}, ${3:e}:
+               ${4:raise $3}
+       else:
+               ${5:pass}
+snippet try Try/Except/Finally
+       try:
+               ${1:pass}
+       except ${2:Exception}, ${3:e}:
+               ${4:raise $3}
+       finally:
+               ${5:pass}
+snippet try Try/Except/Else/Finally
+       try:
+               ${1:pass}
+       except ${2:Exception}, ${3:e}:
+               ${4:raise $3}
+       else:
+               ${5:pass}
+       finally:
+               ${6:pass}
+# if __name__ == '__main__':
+snippet ifmain
+       if __name__ == '__main__':
+               ${1:main()}
+# __magic__
+snippet _
+       __${1:init}__${2}
diff --git a/vim/snippets/ruby.snippets b/vim/snippets/ruby.snippets
new file mode 100644 (file)
index 0000000..50080d9
--- /dev/null
@@ -0,0 +1,504 @@
+# #!/usr/bin/env ruby
+snippet #!
+       #!/usr/bin/env ruby
+
+# New Block
+snippet =b
+       =begin rdoc
+               ${1}
+       =end
+snippet y
+       :yields: ${1:arguments}
+snippet rb
+       #!/usr/bin/env ruby -wKU
+snippet beg
+       begin
+               ${3}
+       rescue ${1:Exception} => ${2:e}
+       end
+
+snippet req
+       require "${1}"${2}
+snippet #
+       # =>
+snippet end
+       __END__
+snippet case
+       case ${1:object}
+       when ${2:condition}
+               ${3}
+       end
+snippet when
+       when ${1:condition}
+               ${2}
+snippet def
+       def ${1:method_name}
+               ${2}
+       end
+snippet deft
+       def test_${1:case_name}
+               ${2}
+       end
+snippet if
+       if ${1:condition}
+               ${2}
+       end
+snippet ife
+       if ${1:condition}
+               ${2}
+       else
+               ${3}
+       end
+snippet elsif
+       elsif ${1:condition}
+               ${2}
+snippet unless
+       unless ${1:condition}
+               ${2}
+       end
+snippet while
+       while ${1:condition}
+               ${2}
+       end
+snippet for
+       for ${1:e} in ${2:c}
+               ${3}
+       end             
+snippet until
+       until ${1:condition}
+               ${2}
+       end
+snippet cla class .. end
+       class ${1:`substitute(Filename(), '^.', '\u&', '')`}
+               ${2}
+       end
+snippet cla class .. initialize .. end
+       class ${1:`substitute(Filename(), '^.', '\u&', '')`}
+               def initialize(${2:args})
+                       ${3}
+               end
+
+
+       end
+snippet cla class .. < ParentClass .. initialize .. end
+       class ${1:`substitute(Filename(), '^.', '\u&', '')`} < ${2:ParentClass}
+               def initialize(${3:args})
+                       ${4}
+               end
+
+
+       end
+snippet cla ClassName = Struct .. do .. end
+       ${1:`substitute(Filename(), '^.', '\u&', '')`} = Struct.new(:${2:attr_names}) do
+               def ${3:method_name}
+                       ${4}
+               end
+
+
+       end
+snippet cla class BlankSlate .. initialize .. end
+       class ${1:BlankSlate}
+               instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ }
+snippet cla class << self .. end
+       class << ${1:self}
+               ${2}
+       end
+# class .. < DelegateClass .. initialize .. end
+snippet cla-
+       class ${1:`substitute(Filename(), '^.', '\u&', '')`} < DelegateClass(${2:ParentClass})
+               def initialize(${3:args})
+                       super(${4:del_obj})
+
+                       ${5}
+               end
+
+
+       end
+snippet mod module .. end
+       module ${1:`substitute(Filename(), '^.', '\u&', '')`}
+               ${2}
+       end
+snippet mod module .. module_function .. end
+       module ${1:`substitute(Filename(), '^.', '\u&', '')`}
+               module_function
+
+               ${2}
+       end
+snippet mod module .. ClassMethods .. end
+       module ${1:`substitute(Filename(), '^.', '\u&', '')`}
+               module ClassMethods
+                       ${2}
+               end
+
+               module InstanceMethods
+
+               end
+
+               def self.included(receiver)
+                       receiver.extend         ClassMethods
+                       receiver.send :include, InstanceMethods
+               end
+       end
+# attr_reader
+snippet r
+       attr_reader :${1:attr_names}
+# attr_writer
+snippet w
+       attr_writer :${1:attr_names}
+# attr_accessor
+snippet rw
+       attr_accessor :${1:attr_names}
+# include Enumerable
+snippet Enum
+       include Enumerable
+
+       def each(&block)
+               ${1}
+       end
+# include Comparable
+snippet Comp
+       include Comparable
+
+       def <=>(other)
+               ${1}
+       end
+# extend Forwardable
+snippet Forw-
+       extend Forwardable
+# def self
+snippet defs
+       def self.${1:class_method_name}
+               ${2}
+       end
+# def method_missing
+snippet defmm
+       def method_missing(meth, *args, &blk)
+               ${1}
+       end
+snippet defd
+       def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name}
+snippet defds
+       def_delegators :${1:@del_obj}, :${2:del_methods}
+snippet am
+       alias_method :${1:new_name}, :${2:old_name}
+snippet app
+       if __FILE__ == $PROGRAM_NAME
+               ${1}
+       end
+# usage_if()
+snippet usai
+       if ARGV.${1}
+               abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3}
+       end
+# usage_unless()
+snippet usau
+       unless ARGV.${1}
+               abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3}
+       end
+snippet array
+       Array.new(${1:10}) { |${2:i}| ${3} }
+snippet hash
+       Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${3} }
+snippet file File.foreach() { |line| .. }
+       File.foreach(${1:"path/to/file"}) { |${2:line}| ${3} }
+snippet file File.read()
+       File.read(${1:"path/to/file"})${2}
+snippet Dir Dir.global() { |file| .. }
+       Dir.glob(${1:"dir/glob/*"}) { |${2:file}| ${3} }
+snippet Dir Dir[".."]
+       Dir[${1:"glob/**/*.rb"}]${2}
+snippet dir
+       Filename.dirname(__FILE__)
+snippet deli
+       delete_if { |${1:e}| ${2} }
+snippet fil
+       fill(${1:range}) { |${2:i}| ${3} }
+# flatten_once()
+snippet flao
+       inject(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2)}${3}
+snippet zip
+       zip(${1:enums}) { |${2:row}| ${3} }
+# downto(0) { |n| .. }
+snippet dow
+       downto(${1:0}) { |${2:n}| ${3} }
+snippet ste
+       step(${1:2}) { |${2:n}| ${3} }
+snippet tim
+       times { |${1:n}| ${2} }
+snippet upt
+       upto(${1:1.0/0.0}) { |${2:n}| ${3} }
+snippet loo
+       loop { ${1} }
+snippet ea
+       each { |${1:e}| ${2} }
+snippet ead
+       each do |${1:e}|
+               ${2}
+       end     
+snippet eab
+       each_byte { |${1:byte}| ${2} }
+snippet eac- each_char { |chr| .. }
+       each_char { |${1:chr}| ${2} }
+snippet eac- each_cons(..) { |group| .. }
+       each_cons(${1:2}) { |${2:group}| ${3} }
+snippet eai
+       each_index { |${1:i}| ${2} }
+snippet eaid
+       each_index do |${1:i}|
+       end
+snippet eak
+       each_key { |${1:key}| ${2} }
+snippet eakd
+       each_key do |${1:key}|
+               ${2}
+       end
+snippet eal
+       each_line { |${1:line}| ${2} }
+snippet eald
+       each_line do |${1:line}|
+               ${2}
+       end             
+snippet eap
+       each_pair { |${1:name}, ${2:val}| ${3} }
+snippet eapd
+       each_pair do |${1:name}, ${2:val}|
+               ${3}
+       end                     
+snippet eas-
+       each_slice(${1:2}) { |${2:group}| ${3} }
+snippet easd-
+       each_slice(${1:2}) do |${2:group}|
+               ${3}
+       end             
+snippet eav
+       each_value { |${1:val}| ${2} }
+snippet eavd
+       each_value do |${1:val}| 
+               ${2}
+       end
+snippet eawi
+       each_with_index { |${1:e}, ${2:i}| ${3} }
+snippet eawid
+       each_with_index do |${1:e},${2:i}|
+               ${3}
+       end
+snippet reve
+       reverse_each { |${1:e}| ${2} }
+snippet reved
+       reverse_each do |${1:e}|
+               ${2}
+       end     
+snippet inj
+       inject(${1:init}) { |${2:mem}, ${3:var}| ${4} }
+snippet injd
+       inject(${1:init}) do |${2:mem}, ${3:var}|
+               ${4}
+       end             
+snippet map
+       map { |${1:e}| ${2} }
+snippet mapd
+       map do |${1:e}| 
+               ${2}
+       end             
+snippet mapwi-
+       enum_with_index.map { |${1:e}, ${2:i}| ${3} }
+snippet sor
+       sort { |a, b| ${1} }
+snippet sorb
+       sort_by { |${1:e}| ${2} }
+snippet ran
+       sort_by { rand }
+snippet all
+       all? { |${1:e}| ${2} }
+snippet any
+       any? { |${1:e}| ${2} }
+snippet cl
+       classify { |${1:e}| ${2} }
+snippet col
+       collect { |${1:e}| ${2} }
+snippet cold
+       collect do |${1:e}|
+               ${2}
+       end
+snippet det
+       detect { |${1:e}| ${2} }
+snippet detd
+       detect do |${1:e}|
+               ${2}
+       end
+snippet fet
+       fetch(${1:name}) { |${2:key}| ${3} }
+snippet fin
+       find { |${1:e}| ${2} }
+snippet find
+       find do |${1:e}|
+               ${2}
+       end             
+snippet fina
+       find_all { |${1:e}| ${2} }
+snippet finad
+       find_all do |${1:e}|
+               ${2}
+       end                     
+snippet gre
+       grep(${1:/pattern/}) { |${2:match}| ${3} }
+snippet sub
+       ${1:g}sub(${2:/pattern/}) { |${3:match}| ${4} }
+snippet sca
+       scan(${1:/pattern/}) { |${2:match}| ${3} }
+snippet scad
+       scan(${1:/pattern/}) do |${2:match}|
+               ${3}
+       end             
+snippet max
+       max { |a, b| ${1} }
+snippet min
+       min { |a, b| ${1} }
+snippet par
+       partition { |${1:e}| ${2} }
+snippet pard
+       partition do |${1:e}|
+               ${2}
+       end             
+snippet rej
+       reject { |${1:e}| ${2} }
+snippet rejd
+       reject do |${1:e}|
+               ${2}
+       end
+snippet sel
+       select { |${1:e}| ${2} }
+snippet seld
+       select do |${1:e}|
+               ${2}
+       end             
+snippet lam
+       lambda { |${1:args}| ${2} }
+snippet do
+       do |${1:variable}|
+               ${2}
+       end
+snippet :
+       :${1:key} => ${2:"value"}${3}
+snippet ope
+       open(${1:"path/or/url/or/pipe"}, "${2:w}") { |${3:io}| ${4} }
+# path_from_here()
+snippet patfh
+       File.join(File.dirname(__FILE__), *%2[${1:rel path here}])${2}
+# unix_filter {}
+snippet unif
+       ARGF.each_line${1} do |${2:line}|
+               ${3}
+       end
+# option_parse {}
+snippet optp
+       require "optparse"
+
+       options = {${1:default => "args"}}
+
+       ARGV.options do |opts|
+               opts.banner = "Usage: #{File.basename($PROGRAM_NAME)}
+snippet opt
+       opts.on( "-${1:o}", "--${2:long-option-name}", ${3:String},
+                "${4:Option description.}") do |${5:opt}|
+               ${6}
+       end
+snippet tc
+       require "test/unit"
+
+       require "${1:library_file_name}"
+
+       class Test${2:$1} < Test::Unit::TestCase
+               def test_${3:case_name}
+                       ${4}
+               end
+       end
+snippet ts
+       require "test/unit"
+
+       require "tc_${1:test_case_file}"
+       require "tc_${2:test_case_file}"${3}
+snippet as
+       assert(${1:test}, "${2:Failure message.}")${3}
+snippet ase
+       assert_equal(${1:expected}, ${2:actual})${3}
+snippet asne
+       assert_not_equal(${1:unexpected}, ${2:actual})${3}
+snippet asid
+       assert_in_delta(${1:expected_float}, ${2:actual_float}, ${3:2 ** -20})${4}
+snippet asio
+       assert_instance_of(${1:ExpectedClass}, ${2:actual_instance})${3}
+snippet asko
+       assert_kind_of(${1:ExpectedKind}, ${2:actual_instance})${3}
+snippet asn
+       assert_nil(${1:instance})${2}
+snippet asnn
+       assert_not_nil(${1:instance})${2}
+snippet asm
+       assert_match(/${1:expected_pattern}/, ${2:actual_string})${3}
+snippet asnm
+       assert_no_match(/${1:unexpected_pattern}/, ${2:actual_string})${3}
+snippet aso
+       assert_operator(${1:left}, :${2:operator}, ${3:right})${4}
+snippet asr
+       assert_raise(${1:Exception}) { ${2} }
+snippet asnr
+       assert_nothing_raised(${1:Exception}) { ${2} }
+snippet asrt
+       assert_respond_to(${1:object}, :${2:method})${3}
+snippet ass assert_same(..)
+       assert_same(${1:expected}, ${2:actual})${3}
+snippet ass assert_send(..)
+       assert_send([${1:object}, :${2:message}, ${3:args}])${4}
+snippet asns
+       assert_not_same(${1:unexpected}, ${2:actual})${3}
+snippet ast
+       assert_throws(:${1:expected}) { ${2} }
+snippet asnt
+       assert_nothing_thrown { ${1} }
+snippet fl
+       flunk("${1:Failure message.}")${2}
+# Benchmark.bmbm do .. end
+snippet bm-
+       TESTS = ${1:10_000}
+       Benchmark.bmbm do |results|
+               ${2}
+       end
+snippet rep
+       results.report("${1:name}:") { TESTS.times { ${2} }}
+# Marshal.dump(.., file)
+snippet Md
+       File.open(${1:"path/to/file.dump"}, "wb") { |${2:file}| Marshal.dump(${3:obj}, $2) }${4}
+# Mashal.load(obj)
+snippet Ml
+       File.open(${1:"path/to/file.dump"}, "rb") { |${2:file}| Marshal.load($2) }${3}
+# deep_copy(..)
+snippet deec
+       Marshal.load(Marshal.dump(${1:obj_to_copy}))${2}
+snippet Pn-
+       PStore.new(${1:"file_name.pstore"})${2}
+snippet tra
+       transaction(${1:true}) { ${2} }
+# xmlread(..)
+snippet xml-
+       REXML::Document.new(File.read(${1:"path/to/file"}))${2}
+# xpath(..) { .. }
+snippet xpa
+       elements.each(${1:"//Xpath"}) do |${2:node}|
+               ${3}
+       end
+# class_from_name()
+snippet clafn
+       split("::").inject(Object) { |par, const| par.const_get(const) }
+# singleton_class()
+snippet sinc
+       class << self; self end
+snippet nam
+       namespace :${1:`Filename()`} do
+               ${2}
+       end
+snippet tas
+       desc "${1:Task description\}"
+       task :${2:task_name => [:dependent, :tasks]} do
+               ${3}
+       end
diff --git a/vim/snippets/sh.snippets b/vim/snippets/sh.snippets
new file mode 100644 (file)
index 0000000..f035126
--- /dev/null
@@ -0,0 +1,28 @@
+# #!/bin/bash
+snippet #!
+       #!/bin/bash
+       
+snippet if
+       if [[ ${1:condition} ]]; then
+               ${2:#statements}
+       fi
+snippet elif
+       elif [[ ${1:condition} ]]; then
+               ${2:#statements}
+snippet for
+       for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do
+               ${3:#statements}
+       done
+snippet wh
+       while [[ ${1:condition} ]]; do
+               ${2:#statements}
+       done
+snippet until
+       until [[ ${1:condition} ]]; do
+               ${2:#statements}
+       done
+snippet case
+       case ${1:word} in
+               ${2:pattern})
+                       ${3};;
+       esac
diff --git a/vim/snippets/snippet.snippets b/vim/snippets/snippet.snippets
new file mode 100644 (file)
index 0000000..854c058
--- /dev/null
@@ -0,0 +1,7 @@
+# snippets for making snippets :)
+snippet snip
+       snippet ${1:trigger}
+               ${2}
+snippet msnip
+       snippet ${1:trigger} ${2:description}
+               ${3}
diff --git a/vim/snippets/tcl.snippets b/vim/snippets/tcl.snippets
new file mode 100644 (file)
index 0000000..1fe1cb9
--- /dev/null
@@ -0,0 +1,92 @@
+# #!/usr/bin/env tclsh
+snippet #!
+       #!/usr/bin/env tclsh
+       
+# Process
+snippet pro
+       proc ${1:function_name} {${2:args}} {
+               ${3:#body ...}
+       }
+#xif
+snippet xif
+       ${1:expr}? ${2:true} : ${3:false}
+# Conditional
+snippet if
+       if {${1}} {
+               ${2:# body...}
+       }
+# Conditional if..else
+snippet ife
+       if {${1}} {
+               ${2:# body...}
+       } else {
+               ${3:# else...}
+       }
+# Conditional if..elsif..else
+snippet ifee
+       if {${1}} {
+               ${2:# body...}
+       } elseif {${3}} {
+               ${4:# elsif...}
+       } else {
+               ${5:# else...}
+       }
+# If catch then
+snippet ifc
+       if { [catch {${1:#do something...}} ${2:err}] } {
+               ${3:# handle failure...}
+       }
+# Catch
+snippet catch
+       catch {${1}} ${2:err} ${3:options}
+# While Loop
+snippet wh
+       while {${1}} {
+               ${2:# body...}
+       }
+# For Loop
+snippet for
+       for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} {
+               ${4:# body...}
+       }
+# Foreach Loop
+snippet fore
+       foreach ${1:x} {${2:#list}} {
+               ${3:# body...}
+       }
+# after ms script...
+snippet af
+       after ${1:ms} ${2:#do something}
+# after cancel id
+snippet afc
+       after cancel ${1:id or script}
+# after idle
+snippet afi
+       after idle ${1:script}
+# after info id
+snippet afin
+       after info ${1:id}
+# Expr
+snippet exp
+       expr {${1:#expression here}}
+# Switch
+snippet sw
+       switch ${1:var} {
+               ${3:pattern 1} {
+                       ${4:#do something}
+               }
+               default {
+                       ${2:#do something}
+               }
+       }
+# Case
+snippet ca
+       ${1:pattern} {
+               ${2:#do something}
+       }${3}
+# Namespace eval
+snippet ns
+       namespace eval ${1:path} {${2:#script...}}
+# Namespace current
+snippet nsc
+       namespace current
diff --git a/vim/snippets/tex.snippets b/vim/snippets/tex.snippets
new file mode 100644 (file)
index 0000000..22f7316
--- /dev/null
@@ -0,0 +1,115 @@
+# \begin{}...\end{}
+snippet begin
+       \begin{${1:env}}
+               ${2}
+       \end{$1}
+# Tabular
+snippet tab
+       \begin{${1:tabular}}{${2:c}}
+       ${3}
+       \end{$1}
+# Align(ed)
+snippet ali
+       \begin{align${1:ed}}
+               ${2}
+       \end{align$1}
+# Gather(ed)
+snippet gat
+       \begin{gather${1:ed}}
+               ${2}
+       \end{gather$1}
+# Equation
+snippet eq
+       \begin{equation}
+               ${1}
+       \end{equation}
+# Unnumbered Equation
+snippet \
+       \\[
+               ${1}
+       \\]
+# Enumerate
+snippet enum
+       \begin{enumerate}
+               \item ${1}
+       \end{enumerate}
+# Itemize
+snippet item
+       \begin{itemize}
+               \item ${1}
+       \end{itemize}
+# Description
+snippet desc
+       \begin{description}
+               \item[${1}] ${2}
+       \end{description}
+# Matrix
+snippet mat
+       \begin{${1:p/b/v/V/B/small}matrix}
+               ${2}
+       \end{$1matrix}
+# Cases
+snippet cas
+       \begin{cases}
+               ${1:equation}, &\text{ if }${2:case}\\
+               ${3}
+       \end{cases}
+# Split
+snippet spl
+       \begin{split}
+               ${1}
+       \end{split}
+# Part
+snippet part
+       \part{${1:part name}} % (fold)
+       \label{prt:${2:$1}}
+       ${3}
+       % part $2 (end)
+# Chapter
+snippet cha
+       \chapter{${1:chapter name}} % (fold)
+       \label{cha:${2:$1}}
+       ${3}
+       % chapter $2 (end)
+# Section
+snippet sec
+       \section{${1:section name}} % (fold)
+       \label{sec:${2:$1}}
+       ${3}
+       % section $2 (end)
+# Sub Section
+snippet sub
+       \subsection{${1:subsection name}} % (fold)
+       \label{sub:${2:$1}}
+       ${3}
+       % subsection $2 (end)
+# Sub Sub Section
+snippet subs
+       \subsubsection{${1:subsubsection name}} % (fold)
+       \label{ssub:${2:$1}}
+       ${3}
+       % subsubsection $2 (end)
+# Paragraph
+snippet par
+       \paragraph{${1:paragraph name}} % (fold)
+       \label{par:${2:$1}}
+       ${3}
+       % paragraph $2 (end)
+# Sub Paragraph
+snippet subp
+       \subparagraph{${1:subparagraph name}} % (fold)
+       \label{subp:${2:$1}}
+       ${3}
+       % subparagraph $2 (end)
+snippet itd
+       \item[${1:description}] ${2:item}
+snippet figure
+       ${1:Figure}~\ref{${2:fig:}}${3}
+snippet table
+       ${1:Table}~\ref{${2:tab:}}${3}
+snippet listing
+       ${1:Listing}~\ref{${2:list}}${3}
+snippet section
+       ${1:Section}~\ref{${2:sec:}}${3}
+snippet page
+       ${1:page}~\pageref{${2}}${3}
diff --git a/vim/snippets/vim.snippets b/vim/snippets/vim.snippets
new file mode 100644 (file)
index 0000000..64e7807
--- /dev/null
@@ -0,0 +1,32 @@
+snippet header
+       " File: ${1:`expand('%:t')`}
+       " Author: ${2:`g:snips_author`}
+       " Description: ${3}
+       ${4:" Last Modified: `strftime("%B %d, %Y")`}
+snippet guard
+       if exists('${1:did_`Filename()`}') || &cp${2: || version < 700}
+               finish
+       endif
+       let $1 = 1${3}
+snippet f
+       fun ${1:function_name}(${2})
+               ${3:" code}
+       endf
+snippet for
+       for ${1:needle} in ${2:haystack}
+               ${3:" code}
+       endfor
+snippet wh
+       while ${1:condition}
+               ${2:" code}
+       endw
+snippet if
+       if ${1:condition}
+               ${2:" code}
+       endif
+snippet ife
+       if ${1:condition}
+               ${2}
+       else
+               ${3}
+       endif
diff --git a/vim/snippets/zsh.snippets b/vim/snippets/zsh.snippets
new file mode 100644 (file)
index 0000000..7aee05b
--- /dev/null
@@ -0,0 +1,58 @@
+# #!/bin/zsh
+snippet #!
+       #!/bin/zsh
+
+snippet if
+       if ${1:condition}; then
+               ${2:# statements}
+       fi
+snippet ife
+       if ${1:condition}; then
+               ${2:# statements}
+       else
+               ${3:# statements}
+       fi
+snippet elif
+       elif ${1:condition} ; then
+               ${2:# statements}
+snippet for
+       for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do
+               ${3:# statements}
+       done
+snippet fore
+       for ${1:item} in ${2:list}; do
+               ${3:# statements}
+       done
+snippet wh
+       while ${1:condition}; do
+               ${2:# statements}
+       done
+snippet until
+       until ${1:condition}; do
+               ${2:# statements}
+       done
+snippet repeat
+       repeat ${1:integer}; do
+               ${2:# statements}
+       done
+snippet case
+       case ${1:word} in
+               ${2:pattern})
+                       ${3};;
+       esac
+snippet select
+       select ${1:answer} in ${2:choices}; do
+               ${3:# statements}
+       done
+snippet (
+       ( ${1:#statements} )
+snippet {
+       { ${1:#statements} }
+snippet [
+       [[ ${1:test} ]]
+snippet always
+       { ${1:try} } always { ${2:always} }
+snippet fun
+       function ${1:name} (${2:args}) {
+               ${3:# body}
+       }
diff --git a/vim/syntax/arduino.vim b/vim/syntax/arduino.vim
new file mode 100644 (file)
index 0000000..fb52283
--- /dev/null
@@ -0,0 +1,57 @@
+" Vim syntax file
+" Language:    Arduino
+" Maintainer:  Johannes Hoff <johannes@johanneshoff.com>
+" Last Change: 06 June 2011
+" License:     VIM license (:help license, replace vim by arduino.vim)
+
+" Syntax highlighting like in the Arduino IDE
+" Automatically generated by the script available at
+"    https://bitbucket.org/johannes/arduino-vim-syntax
+" Using keywords from <arduino>/build/shared/lib/keywords.txt
+" From version: ARDUINO 0022 - 2010.12.24
+
+" Thanks to Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback!
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+" Read the C syntax to start with
+if version < 600
+  so <sfile>:p:h/cpp.vim
+else
+  runtime! syntax/cpp.vim
+endif
+
+syn keyword arduinoConstant  BIN BYTE CHANGE DEC DEFAULT EXTERNAL FALLING HALF_PI
+syn keyword arduinoConstant  HEX HIGH INPUT INTERNAL INTERNAL1V1 INTERNAL2V56
+syn keyword arduinoConstant  LOW LSBFIRST MSBFIRST OCT OUTPUT PI RISING TWO_PI
+
+syn keyword arduinoFunc      analogRead analogReference analogWrite
+syn keyword arduinoFunc      attachInterrupt bit bitClear bitRead bitSet
+syn keyword arduinoFunc      bitWrite delay delayMicroseconds detachInterrupt
+syn keyword arduinoFunc      digitalRead digitalWrite highByte interrupts
+syn keyword arduinoFunc      lowByte micros millis noInterrupts noTone pinMode
+syn keyword arduinoFunc      pulseIn shiftIn shiftOut tone
+
+syn keyword arduinoMethod    available begin end flush loop peek print println
+syn keyword arduinoMethod    read setup
+
+syn keyword arduinoModule    Serial Serial1 Serial2 Serial3
+
+syn keyword arduinoStdFunc   abs acos asin atan atan2 ceil constrain cos degrees
+syn keyword arduinoStdFunc   exp floor log map max min radians random randomSeed
+syn keyword arduinoStdFunc   round sin sq sqrt tan
+
+syn keyword arduinoType      boolean byte null String word
+
+hi def link arduinoType Type
+hi def link arduinoConstant Constant
+hi def link arduinoStdFunc Function
+hi def link arduinoFunc Function
+hi def link arduinoMethod Function
+hi def link arduinoModule Identifier
diff --git a/vim/syntax/coffee.vim b/vim/syntax/coffee.vim
new file mode 100755 (executable)
index 0000000..ff2cd12
--- /dev/null
@@ -0,0 +1,237 @@
+" Language:    CoffeeScript
+" Maintainer:  Mick Koch <kchmck@gmail.com>
+" URL:         http://github.com/kchmck/vim-coffee-script
+" License:     WTFPL
+
+" Bail if our syntax is already loaded.
+if exists('b:current_syntax') && b:current_syntax == 'coffee'
+  finish
+endif
+
+if version < 600
+  syn clear
+endif
+
+" Include JavaScript for coffeeEmbed.
+syn include @coffeeJS syntax/javascript.vim
+
+" Highlight long strings.
+syn sync minlines=100
+
+" CoffeeScript identifiers can have dollar signs.
+setlocal isident+=$
+
+" These are `matches` instead of `keywords` because vim's highlighting
+" priority for keywords is higher than matches. This causes keywords to be
+" highlighted inside matches, even if a match says it shouldn't contain them --
+" like with coffeeAssign and coffeeDot.
+syn match coffeeStatement /\<\%(return\|break\|continue\|throw\)\>/ display
+hi def link coffeeStatement Statement
+
+syn match coffeeRepeat /\<\%(for\|while\|until\|loop\)\>/ display
+hi def link coffeeRepeat Repeat
+
+syn match coffeeConditional /\<\%(if\|else\|unless\|switch\|when\|then\)\>/
+\                           display
+hi def link coffeeConditional Conditional
+
+syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
+hi def link coffeeException Exception
+
+syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|own\|do\)\>/
+\                       display
+hi def link coffeeKeyword Keyword
+
+syn match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ display
+hi def link coffeeOperator Operator
+
+" The first case matches symbol operators only if they have an operand before.
+syn match coffeeExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?.]\+\|--\|++\|::/
+\                          display
+syn match coffeeExtendedOp /\%(and\|or\)=/ display
+hi def link coffeeExtendedOp coffeeOperator
+
+" This is separate from `coffeeExtendedOp` to help differentiate commas from
+" dots.
+syn match coffeeSpecialOp /[,;]/ display
+hi def link coffeeSpecialOp SpecialChar
+
+syn match coffeeBoolean /\<\%(true\|on\|yes\|false\|off\|no\)\>/ display
+hi def link coffeeBoolean Boolean
+
+syn match coffeeGlobal /\<\%(null\|undefined\)\>/ display
+hi def link coffeeGlobal Type
+
+" A special variable
+syn match coffeeSpecialVar /\<\%(this\|prototype\|arguments\)\>/ display
+" An @-variable
+syn match coffeeSpecialVar /@\%(\I\i*\)\?/ display
+hi def link coffeeSpecialVar Special
+
+" A class-like name that starts with a capital letter
+syn match coffeeObject /\<\u\w*\>/ display
+hi def link coffeeObject Structure
+
+" A constant-like name in SCREAMING_CAPS
+syn match coffeeConstant /\<\u[A-Z0-9_]\+\>/ display
+hi def link coffeeConstant Constant
+
+" A variable name
+syn cluster coffeeIdentifier contains=coffeeSpecialVar,coffeeObject,
+\                                     coffeeConstant
+
+" A non-interpolated string
+syn cluster coffeeBasicString contains=@Spell,coffeeEscape
+" An interpolated string
+syn cluster coffeeInterpString contains=@coffeeBasicString,coffeeInterp
+
+" Regular strings
+syn region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/
+\                       contains=@coffeeInterpString
+syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/
+\                       contains=@coffeeBasicString
+hi def link coffeeString String
+
+" A integer, including a leading plus or minus
+syn match coffeeNumber /\i\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ display
+" A hex number
+syn match coffeeNumber /\<0[xX]\x\+\>/ display
+hi def link coffeeNumber Number
+
+" A floating-point number, including a leading plus or minus
+syn match coffeeFloat /\i\@<![-+]\?\d*\.\@<!\.\d\+\%([eE][+-]\?\d\+\)\?/
+\                     display
+hi def link coffeeFloat Float
+
+" An error for reserved keywords
+if !exists("coffee_no_reserved_words_error")
+  syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\)\>/
+  \                             display
+  hi def link coffeeReservedError Error
+endif
+
+" This is separate from `coffeeExtendedOp` since assignments require it.
+syn match coffeeAssignOp /:/ contained display
+hi def link coffeeAssignOp coffeeOperator
+
+" Strings used in string assignments, which can't have interpolations
+syn region coffeeAssignString start=/"/ skip=/\\\\\|\\"/ end=/"/ contained
+\                             contains=@coffeeBasicString
+syn region coffeeAssignString start=/'/ skip=/\\\\\|\\'/ end=/'/ contained
+\                             contains=@coffeeBasicString
+hi def link coffeeAssignString String
+
+" A normal object assignment
+syn match coffeeObjAssign /@\?\I\i*\s*:\@<!::\@!/
+\                         contains=@coffeeIdentifier,coffeeAssignOp
+hi def link coffeeObjAssign Identifier
+
+" An object-string assignment
+syn match coffeeObjStringAssign /\("\|'\)[^\1]*\1\s*;\@<!::\@!'\@!/
+\                               contains=coffeeAssignString,coffeeAssignOp
+" An object-integer assignment
+syn match coffeeObjNumberAssign /\d\+\%(\.\d\+\)\?\s*:\@<!::\@!/
+\                               contains=coffeeNumber,coffeeAssignOp
+
+syn keyword coffeeTodo TODO FIXME XXX contained
+hi def link coffeeTodo Todo
+
+syn match coffeeComment /#.*/ contains=@Spell,coffeeTodo
+hi def link coffeeComment Comment
+
+syn region coffeeBlockComment start=/####\@!/ end=/###/
+\                             contains=@Spell,coffeeTodo
+hi def link coffeeBlockComment coffeeComment
+
+" A comment in a heregex
+syn region coffeeHeregexComment start=/#/ end=/\ze\/\/\/\|$/ contained
+\                               contains=@Spell,coffeeTodo
+hi def link coffeeHeregexComment coffeeComment
+
+" Embedded JavaScript
+syn region coffeeEmbed matchgroup=coffeeEmbedDelim
+\                      start=/`/ skip=/\\\\\|\\`/ end=/`/
+\                      contains=@coffeeJS
+hi def link coffeeEmbedDelim Delimiter
+
+syn region coffeeInterp matchgroup=coffeeInterpDelim start=/#{/ end=/}/ contained
+\                       contains=@coffeeAll
+hi def link coffeeInterpDelim PreProc
+
+" A string escape sequence
+syn match coffeeEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained display
+hi def link coffeeEscape SpecialChar
+
+" A regex -- must not follow a parenthesis, number, or identifier, and must not
+" be followed by a number
+syn region coffeeRegex start=/\%(\%()\|\i\@<!\d\)\s*\|\i\)\@<!\/=\@!\s\@!/
+\                      skip=/\[[^\]]\{-}\/[^\]]\{-}\]/
+\                      end=/\/[gimy]\{,4}\d\@!/
+\                      oneline contains=@coffeeBasicString
+hi def link coffeeRegex String
+
+" A heregex
+syn region coffeeHeregex start=/\/\/\// end=/\/\/\/[gimy]\{,4}/
+\                        contains=@coffeeInterpString,coffeeHeregexComment
+\                        fold
+hi def link coffeeHeregex coffeeRegex
+
+" Heredoc strings
+syn region coffeeHeredoc start=/"""/ end=/"""/ contains=@coffeeInterpString
+\                        fold
+syn region coffeeHeredoc start=/'''/ end=/'''/ contains=@coffeeBasicString
+\                        fold
+hi def link coffeeHeredoc String
+
+" An error for trailing whitespace, as long as the line isn't just whitespace
+if !exists("coffee_no_trailing_space_error")
+  syn match coffeeSpaceError /\S\@<=\s\+$/ display
+  hi def link coffeeSpaceError Error
+endif
+
+" An error for trailing semicolons, for help transitioning from JavaScript
+if !exists("coffee_no_trailing_semicolon_error")
+  syn match coffeeSemicolonError /;$/ display
+  hi def link coffeeSemicolonError Error
+endif
+
+" Ignore reserved words in dot accesses.
+syn match coffeeDotAccess /\.\@<!\.\s*\I\i*/he=s+1 contains=@coffeeIdentifier
+hi def link coffeeDotAccess coffeeExtendedOp
+
+" Ignore reserved words in prototype accesses.
+syn match coffeeProtoAccess /::\s*\I\i*/he=s+2 contains=@coffeeIdentifier
+hi def link coffeeProtoAccess coffeeExtendedOp
+
+" This is required for interpolations to work.
+syn region coffeeCurlies matchgroup=coffeeCurly start=/{/ end=/}/
+\                        contains=@coffeeAll
+syn region coffeeBrackets matchgroup=coffeeBracket start=/\[/ end=/\]/
+\                         contains=@coffeeAll
+syn region coffeeParens matchgroup=coffeeParen start=/(/ end=/)/
+\                       contains=@coffeeAll
+
+" These are highlighted the same as commas since they tend to go together.
+hi def link coffeeBlock coffeeSpecialOp
+hi def link coffeeBracket coffeeBlock
+hi def link coffeeCurly coffeeBlock
+hi def link coffeeParen coffeeBlock
+
+" This is used instead of TOP to keep things coffee-specific for good
+" embedding. `contained` groups aren't included.
+syn cluster coffeeAll contains=coffeeStatement,coffeeRepeat,coffeeConditional,
+\                              coffeeException,coffeeKeyword,coffeeOperator,
+\                              coffeeExtendedOp,coffeeSpecialOp,coffeeBoolean,
+\                              coffeeGlobal,coffeeSpecialVar,coffeeObject,
+\                              coffeeConstant,coffeeString,coffeeNumber,
+\                              coffeeFloat,coffeeReservedError,coffeeObjAssign,
+\                              coffeeObjStringAssign,coffeeObjNumberAssign,
+\                              coffeeComment,coffeeBlockComment,coffeeEmbed,
+\                              coffeeRegex,coffeeHeregex,coffeeHeredoc,
+\                              coffeeSpaceError,coffeeSemicolonError,
+\                              coffeeDotAccess,coffeeProtoAccess,
+\                              coffeeCurlies,coffeeBrackets,coffeeParens
+
+if !exists('b:current_syntax')
+  let b:current_syntax = 'coffee'
+endif
diff --git a/vim/syntax/conque_term.vim b/vim/syntax/conque_term.vim
new file mode 100644 (file)
index 0000000..7607913
--- /dev/null
@@ -0,0 +1,75 @@
+
+" *******************************************************************************************************************
+" MySQL *************************************************************************************************************
+" *******************************************************************************************************************
+
+syn match MySQLTableHead "^ *|.*| *$" nextgroup=MySQLTableDivide contains=MySQLTableBar oneline skipwhite skipnl
+syn match MySQLTableBody "^ *|.*| *$" nextgroup=MySQLTableBody,MySQLTableEnd contains=MySQLTableBar,MySQLNull,MySQLBool,MySQLNumber,MySQLStorageClass oneline skipwhite skipnl
+syn match MySQLTableEnd "^ *+[+=-]\++ *$" oneline 
+syn match MySQLTableDivide "^ *+[+=-]\++ *$" nextgroup=MySQLTableBody oneline skipwhite skipnl
+syn match MySQLTableStart "^ *+[+=-]\++ *$" nextgroup=MySQLTableHead oneline skipwhite skipnl
+syn match MySQLNull " NULL " contained contains=MySQLTableBar
+syn match MySQLStorageClass " PRI " contained
+syn match MySQLStorageClass " MUL " contained
+syn match MySQLStorageClass " UNI " contained
+syn match MySQLStorageClass " CURRENT_TIMESTAMP " contained
+syn match MySQLStorageClass " auto_increment " contained
+syn match MySQLTableBar "|" contained
+syn match MySQLNumber "|\? *\d\+ *|" contained contains=MySQLTableBar
+syn match MySQLQueryStat "^\d\+ rows\? in set.*" oneline
+syn match MySQLPromptLine "^.\?mysql> .*$" contains=MySQLKeyword,MySQLPrompt,MySQLString oneline
+syn match MySQLPromptLine "^    -> .*$" contains=MySQLKeyword,MySQLPrompt,MySQLString oneline
+syn match MySQLPrompt "^.\?mysql>" contained oneline
+syn match MySQLPrompt "^    ->" contained oneline
+syn case ignore
+syn keyword MySQLKeyword select count max sum avg date show table tables status like as from left right outer inner join contained 
+syn keyword MySQLKeyword where group by having limit offset order desc asc show contained
+syn case match
+syn region MySQLString start=+'+ end=+'+ skip=+\\'+ contained oneline
+syn region MySQLString start=+"+ end=+"+ skip=+\\"+ contained oneline
+syn region MySQLString start=+`+ end=+`+ skip=+\\`+ contained oneline
+
+hi def link MySQLPrompt Identifier
+hi def link MySQLTableHead Title
+hi def link MySQLTableBody Normal
+hi def link MySQLBool Boolean
+hi def link MySQLStorageClass StorageClass
+hi def link MySQLNumber Number
+hi def link MySQLKeyword Keyword
+hi def link MySQLString String
+
+" terms which have no reasonable default highlight group to link to
+hi MySQLTableHead term=bold cterm=bold gui=bold
+if &background == 'dark'
+    hi MySQLTableEnd term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLTableDivide term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLTableStart term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLTableBar term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLNull term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLQueryStat term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+elseif &background == 'light'
+    hi MySQLTableEnd term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLTableDivide term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLTableStart term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLTableBar term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLNull term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLQueryStat term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+endif
+
+
+" *******************************************************************************************************************
+" Bash **************************************************************************************************************
+" *******************************************************************************************************************
+
+" Typical Prompt
+silent execute "syn match ConquePromptLine '" . g:ConqueTerm_PromptRegex . ".*$' contains=ConquePrompt,ConqueString oneline"
+silent execute "syn match ConquePrompt '" . g:ConqueTerm_PromptRegex . "' contained oneline"
+hi def link ConquePrompt Identifier
+
+" Strings
+syn region ConqueString start=+'+ end=+'+ skip=+\\'+ contained oneline
+syn region ConqueString start=+"+ end=+"+ skip=+\\"+ contained oneline
+syn region ConqueString start=+`+ end=+`+ skip=+\\`+ contained oneline
+hi def link ConqueString String
+
+" vim: foldmethod=marker
diff --git a/vim/syntax/cucumber.vim b/vim/syntax/cucumber.vim
new file mode 100644 (file)
index 0000000..3693a12
--- /dev/null
@@ -0,0 +1,126 @@
+" Vim syntax file
+" Language:     Cucumber
+" Maintainer:   Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:    *.feature
+" Last Change: 2010 May 21
+
+if exists("b:current_syntax")
+    finish
+endif
+syn case match
+syn sync minlines=20
+
+let g:cucumber_languages = {
+      \"en": {"and": "And\\>", "background": "Background\\>", "but": "But\\>", "examples": "Scenarios\\>\\|Examples\\>", "feature": "Feature\\>", "given": "Given\\>", "scenario": "Scenario\\>", "scenario_outline": "Scenario Outline\\>", "then": "Then\\>", "when": "When\\>"},
+      \"ar": {"and": "\\%u0648\\>", "background": "\\%u0627\\%u0644\\%u062e\\%u0644\\%u0641\\%u064a\\%u0629\\>", "but": "\\%u0644\\%u0643\\%u0646\\>", "examples": "\\%u0627\\%u0645\\%u062b\\%u0644\\%u0629\\>", "feature": "\\%u062e\\%u0627\\%u0635\\%u064a\\%u0629\\>", "given": "\\%u0628\\%u0641\\%u0631\\%u0636\\>", "scenario": "\\%u0633\\%u064a\\%u0646\\%u0627\\%u0631\\%u064a\\%u0648\\>", "scenario_outline": "\\%u0633\\%u064a\\%u0646\\%u0627\\%u0631\\%u064a\\%u0648 \\%u0645\\%u062e\\%u0637\\%u0637\\>", "then": "\\%u0627\\%u0630\\%u0627\\%u064b\\>\\|\\%u062b\\%u0645\\>", "when": "\\%u0639\\%u0646\\%u062f\\%u0645\\%u0627\\>\\|\\%u0645\\%u062a\\%u0649\\>"},
+      \"bg": {"and": "\\%u0418\\>", "background": "\\%u041f\\%u0440\\%u0435\\%u0434\\%u0438\\%u0441\\%u0442\\%u043e\\%u0440\\%u0438\\%u044f\\>", "but": "\\%u041d\\%u043e\\>", "examples": "\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\%u0438\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\%u043d\\%u043e\\%u0441\\%u0442\\>", "given": "\\%u0414\\%u0430\\%u0434\\%u0435\\%u043d\\%u043e\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0420\\%u0430\\%u043c\\%u043a\\%u0430 \\%u043d\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "then": "\\%u0422\\%u043e\\>", "when": "\\%u041a\\%u043e\\%u0433\\%u0430\\%u0442\\%u043e\\>"},
+      \"ca": {"and": "I\\>", "background": "Antecedents\\>\\|Rerefons\\>", "but": "Per\\%u00f2\\>", "examples": "Exemples\\>", "feature": "Caracter\\%u00edstica\\>\\|Funcionalitat\\>", "given": "At\\%u00e8s\\>\\|Donada\\>\\|Donat\\>\\|Atesa\\>", "scenario": "Escenari\\>", "scenario_outline": "Esquema de l'escenari\\>", "then": "Aleshores\\>\\|Cal\\>", "when": "Quan\\>"},
+      \"cs": {"and": "A tak\\%u00e9\\>\\|A\\>", "background": "Pozad\\%u00ed\\>\\|Kontext\\>", "but": "Ale\\>", "examples": "P\\%u0159\\%u00edklady\\>", "feature": "Po\\%u017eadavek\\>", "given": "Pokud\\>", "scenario": "Sc\\%u00e9n\\%u00e1\\%u0159\\>", "scenario_outline": "N\\%u00e1\\%u010drt Sc\\%u00e9n\\%u00e1\\%u0159e\\>\\|Osnova sc\\%u00e9n\\%u00e1\\%u0159e\\>", "then": "Pak\\>", "when": "Kdy\\%u017e\\>"},
+      \"cy-GB": {"and": "A\\>", "background": "Cefndir\\>", "but": "Ond\\>", "examples": "Enghreifftiau\\>", "feature": "Arwedd\\>", "given": "Anrhegedig a\\>", "scenario": "Scenario\\>", "scenario_outline": "Scenario Amlinellol\\>", "then": "Yna\\>", "when": "Pryd\\>"},
+      \"da": {"and": "Og\\>", "background": "Baggrund\\>", "but": "Men\\>", "examples": "Eksempler\\>", "feature": "Egenskab\\>", "given": "Givet\\>", "scenario": "Scenarie\\>", "scenario_outline": "Abstrakt Scenario\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e5r\\>"},
+      \"de": {"and": "Und\\>", "background": "Grundlage\\>", "but": "Aber\\>", "examples": "Beispiele\\>", "feature": "Funktionalit\\%u00e4t\\>", "given": "Gegeben sei\\>\\|Angenommen\\>", "scenario": "Szenario\\>", "scenario_outline": "Szenariogrundriss\\>", "then": "Dann\\>", "when": "Wenn\\>"},
+      \"en-Scouse": {"and": "An\\>", "background": "Dis is what went down\\>", "but": "Buh\\>", "examples": "Examples\\>", "feature": "Feature\\>", "given": "Youse know when youse got\\>\\|Givun\\>", "scenario": "The thing of it is\\>", "scenario_outline": "Wharrimean is\\>", "then": "Den youse gotta\\>\\|Dun\\>", "when": "Youse know like when\\>\\|Wun\\>"},
+      \"en-au": {"and": "N\\>", "background": "Background\\>", "but": "Cept\\>", "examples": "Cobber\\>", "feature": "Crikey\\>", "given": "Ya know how\\>", "scenario": "Mate\\>", "scenario_outline": "Blokes\\>", "then": "Ya gotta\\>", "when": "When\\>"},
+      \"en-lol": {"and": "AN\\>", "background": "B4\\>", "but": "BUT\\>", "examples": "EXAMPLZ\\>", "feature": "OH HAI\\>", "given": "I CAN HAZ\\>", "scenario": "MISHUN\\>", "scenario_outline": "MISHUN SRSLY\\>", "then": "DEN\\>", "when": "WEN\\>"},
+      \"en-tx": {"and": "And y'all\\>", "background": "Background\\>", "but": "But y'all\\>", "examples": "Examples\\>", "feature": "Feature\\>", "given": "Given y'all\\>", "scenario": "Scenario\\>", "scenario_outline": "All y'all\\>", "then": "Then y'all\\>", "when": "When y'all\\>"},
+      \"eo": {"and": "Kaj\\>", "background": "Fono\\>", "but": "Sed\\>", "examples": "Ekzemploj\\>", "feature": "Trajto\\>", "given": "Donita\\%u0135o\\>", "scenario": "Scenaro\\>", "scenario_outline": "Konturo de la scenaro\\>", "then": "Do\\>", "when": "Se\\>"},
+      \"es": {"and": "Y\\>", "background": "Antecedentes\\>", "but": "Pero\\>", "examples": "Ejemplos\\>", "feature": "Caracter\\%u00edstica\\>", "given": "Dado\\>", "scenario": "Escenario\\>", "scenario_outline": "Esquema del escenario\\>", "then": "Entonces\\>", "when": "Cuando\\>"},
+      \"et": {"and": "Ja\\>", "background": "Taust\\>", "but": "Kuid\\>", "examples": "Juhtumid\\>", "feature": "Omadus\\>", "given": "Eeldades\\>", "scenario": "Stsenaarium\\>", "scenario_outline": "Raamstsenaarium\\>", "then": "Siis\\>", "when": "Kui\\>"},
+      \"fi": {"and": "Ja\\>", "background": "Tausta\\>", "but": "Mutta\\>", "examples": "Tapaukset\\>", "feature": "Ominaisuus\\>", "given": "Oletetaan\\>", "scenario": "Tapaus\\>", "scenario_outline": "Tapausaihio\\>", "then": "Niin\\>", "when": "Kun\\>"},
+      \"fr": {"and": "Et\\>", "background": "Contexte\\>", "but": "Mais\\>", "examples": "Exemples\\>", "feature": "Fonctionnalit\\%u00e9\\>", "given": "Etant donn\\%u00e9\\>\\|Soit\\>", "scenario": "Sc\\%u00e9nario\\>", "scenario_outline": "Plan du sc\\%u00e9nario\\>\\|Plan du Sc\\%u00e9nario\\>", "then": "Alors\\>", "when": "Lorsqu'\\|Lorsque\\>\\|Quand\\>"},
+      \"he": {"and": "\\%u05d5\\%u05d2\\%u05dd\\>", "background": "\\%u05e8\\%u05e7\\%u05e2\\>", "but": "\\%u05d0\\%u05d1\\%u05dc\\>", "examples": "\\%u05d3\\%u05d5\\%u05d2\\%u05de\\%u05d0\\%u05d5\\%u05ea\\>", "feature": "\\%u05ea\\%u05db\\%u05d5\\%u05e0\\%u05d4\\>", "given": "\\%u05d1\\%u05d4\\%u05d9\\%u05e0\\%u05ea\\%u05df\\>", "scenario": "\\%u05ea\\%u05e8\\%u05d7\\%u05d9\\%u05e9\\>", "scenario_outline": "\\%u05ea\\%u05d1\\%u05e0\\%u05d9\\%u05ea \\%u05ea\\%u05e8\\%u05d7\\%u05d9\\%u05e9\\>", "then": "\\%u05d0\\%u05d6\\%u05d9\\>\\|\\%u05d0\\%u05d6\\>", "when": "\\%u05db\\%u05d0\\%u05e9\\%u05e8\\>"},
+      \"hr": {"and": "I\\>", "background": "Pozadina\\>", "but": "Ali\\>", "examples": "Scenariji\\>\\|Primjeri\\>", "feature": "Mogu\\%u0107nost\\>\\|Mogucnost\\>\\|Osobina\\>", "given": "Zadano\\>\\|Zadani\\>\\|Zadan\\>", "scenario": "Scenarij\\>", "scenario_outline": "Koncept\\>\\|Skica\\>", "then": "Onda\\>", "when": "Kada\\>\\|Kad\\>"},
+      \"hu": {"and": "\\%u00c9s\\>", "background": "H\\%u00e1tt\\%u00e9r\\>", "but": "De\\>", "examples": "P\\%u00e9ld\\%u00e1k\\>", "feature": "Jellemz\\%u0151\\>", "given": "Ha\\>", "scenario": "Forgat\\%u00f3k\\%u00f6nyv\\>", "scenario_outline": "Forgat\\%u00f3k\\%u00f6nyv v\\%u00e1zlat\\>", "then": "Akkor\\>", "when": "Majd\\>"},
+      \"id": {"and": "Dan\\>", "background": "Dasar\\>", "but": "Tapi\\>", "examples": "Contoh\\>", "feature": "Fitur\\>", "given": "Dengan\\>", "scenario": "Skenario\\>", "scenario_outline": "Skenario konsep\\>", "then": "Maka\\>", "when": "Ketika\\>"},
+      \"it": {"and": "E\\>", "background": "Contesto\\>", "but": "Ma\\>", "examples": "Esempi\\>", "feature": "Funzionalit\\%u00e0\\>", "given": "Dato\\>", "scenario": "Scenario\\>", "scenario_outline": "Schema dello scenario\\>", "then": "Allora\\>", "when": "Quando\\>"},
+      \"ja": {"and": "\\%u304b\\%u3064", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u3057\\%u304b\\%u3057\\|\\%u305f\\%u3060\\%u3057\\|\\%u4f46\\%u3057", "examples": "\\%u30b5\\%u30f3\\%u30d7\\%u30eb\\>\\|\\%u4f8b\\>", "feature": "\\%u30d5\\%u30a3\\%u30fc\\%u30c1\\%u30e3\\>\\|\\%u6a5f\\%u80fd\\>", "given": "\\%u524d\\%u63d0", "scenario": "\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\>", "scenario_outline": "\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30a2\\%u30a6\\%u30c8\\%u30e9\\%u30a4\\%u30f3\\>\\|\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\%u30fc\\%u30c8\\>\\|\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\>\\|\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\>", "then": "\\%u306a\\%u3089\\%u3070", "when": "\\%u3082\\%u3057"},
+      \"ko": {"and": "\\%uadf8\\%ub9ac\\%uace0", "background": "\\%ubc30\\%uacbd\\>", "but": "\\%ud558\\%uc9c0\\%ub9cc\\|\\%ub2e8", "examples": "\\%uc608\\>", "feature": "\\%uae30\\%ub2a5\\>", "given": "\\%uc870\\%uac74\\|\\%uba3c\\%uc800", "scenario": "\\%uc2dc\\%ub098\\%ub9ac\\%uc624\\>", "scenario_outline": "\\%uc2dc\\%ub098\\%ub9ac\\%uc624 \\%uac1c\\%uc694\\>", "then": "\\%uadf8\\%ub7ec\\%uba74", "when": "\\%ub9cc\\%uc77c\\|\\%ub9cc\\%uc57d"},
+      \"lt": {"and": "Ir\\>", "background": "Kontekstas\\>", "but": "Bet\\>", "examples": "Pavyzd\\%u017eiai\\>\\|Scenarijai\\>\\|Variantai\\>", "feature": "Savyb\\%u0117\\>", "given": "Duota\\>", "scenario": "Scenarijus\\>", "scenario_outline": "Scenarijaus \\%u0161ablonas\\>", "then": "Tada\\>", "when": "Kai\\>"},
+      \"lu": {"and": "an\\>\\|a\\>", "background": "Hannergrond\\>", "but": "m\\%u00e4\\>\\|awer\\>", "examples": "Beispiller\\>", "feature": "Funktionalit\\%u00e9it\\>", "given": "ugeholl\\>", "scenario": "Szenario\\>", "scenario_outline": "Plang vum Szenario\\>", "then": "dann\\>", "when": "wann\\>"},
+      \"lv": {"and": "Un\\>", "background": "Situ\\%u0101cija\\>\\|Konteksts\\>", "but": "Bet\\>", "examples": "Piem\\%u0113ri\\>\\|Paraugs\\>", "feature": "Funkcionalit\\%u0101te\\>\\|F\\%u012b\\%u010da\\>", "given": "Kad\\>", "scenario": "Scen\\%u0101rijs\\>", "scenario_outline": "Scen\\%u0101rijs p\\%u0113c parauga\\>", "then": "Tad\\>", "when": "Ja\\>"},
+      \"nl": {"and": "En\\>", "background": "Achtergrond\\>", "but": "Maar\\>", "examples": "Voorbeelden\\>", "feature": "Functionaliteit\\>", "given": "Gegeven\\>\\|Stel\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstract Scenario\\>", "then": "Dan\\>", "when": "Als\\>"},
+      \"no": {"and": "Og\\>", "background": "Bakgrunn\\>", "but": "Men\\>", "examples": "Eksempler\\>", "feature": "Egenskap\\>", "given": "Gitt\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstrakt Scenario\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e5r\\>"},
+      \"pl": {"and": "Oraz\\>", "background": "Za\\%u0142o\\%u017cenia\\>", "but": "Ale\\>", "examples": "Przyk\\%u0142ady\\>", "feature": "W\\%u0142a\\%u015bciwo\\%u015b\\%u0107\\>", "given": "Zak\\%u0142adaj\\%u0105c\\>", "scenario": "Scenariusz\\>", "scenario_outline": "Szablon scenariusza\\>", "then": "Wtedy\\>", "when": "Je\\%u017celi\\>"},
+      \"pt": {"and": "E\\>", "background": "Contexto\\>", "but": "Mas\\>", "examples": "Exemplos\\>", "feature": "Funcionalidade\\>", "given": "Dado\\>", "scenario": "Cen\\%u00e1rio\\>\\|Cenario\\>", "scenario_outline": "Esquema do Cen\\%u00e1rio\\>\\|Esquema do Cenario\\>", "then": "Ent\\%u00e3o\\>\\|Entao\\>", "when": "Quando\\>"},
+      \"ro": {"and": "Si\\>", "background": "Conditii\\>", "but": "Dar\\>", "examples": "Exemplele\\>", "feature": "Functionalitate\\>", "given": "Daca\\>", "scenario": "Scenariu\\>", "scenario_outline": "Scenariul de sablon\\>", "then": "Atunci\\>", "when": "Cand\\>"},
+      \"ro-RO": {"and": "\\%u0218i\\>", "background": "Condi\\%u0163ii\\>", "but": "Dar\\>", "examples": "Exemplele\\>", "feature": "Func\\%u021bionalitate\\>", "given": "Dac\\%u0103\\>", "scenario": "Scenariu\\>", "scenario_outline": "Scenariul de \\%u015fablon\\>", "then": "Atunci\\>", "when": "C\\%u00e2nd\\>"},
+      \"ru": {"and": "\\%u041a \\%u0442\\%u043e\\%u043c\\%u0443 \\%u0436\\%u0435\\>\\|\\%u0418\\>", "background": "\\%u041f\\%u0440\\%u0435\\%u0434\\%u044b\\%u0441\\%u0442\\%u043e\\%u0440\\%u0438\\%u044f\\>", "but": "\\%u041d\\%u043e\\>\\|\\%u0410\\>", "examples": "\\%u0417\\%u043d\\%u0430\\%u0447\\%u0435\\%u043d\\%u0438\\%u044f\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\>\\|\\%u0424\\%u0438\\%u0447\\%u0430\\>", "given": "\\%u0414\\%u043e\\%u043f\\%u0443\\%u0441\\%u0442\\%u0438\\%u043c\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u044f\\>", "then": "\\%u0422\\%u043e\\>", "when": "\\%u0415\\%u0441\\%u043b\\%u0438\\>"},
+      \"sk": {"and": "A\\>", "background": "Pozadie\\>", "but": "Ale\\>", "examples": "Pr\\%u00edklady\\>", "feature": "Po\\%u017eiadavka\\>", "given": "Pokia\\%u013e\\>", "scenario": "Scen\\%u00e1r\\>", "scenario_outline": "N\\%u00e1\\%u010drt Scen\\%u00e1ru\\>", "then": "Tak\\>", "when": "Ke\\%u010f\\>"},
+      \"sr-Cyrl": {"and": "\\%u0418\\>", "background": "\\%u041a\\%u043e\\%u043d\\%u0442\\%u0435\\%u043a\\%u0441\\%u0442\\>\\|\\%u041f\\%u043e\\%u0437\\%u0430\\%u0434\\%u0438\\%u043d\\%u0430\\>\\|\\%u041e\\%u0441\\%u043d\\%u043e\\%u0432\\%u0430\\>", "but": "\\%u0410\\%u043b\\%u0438\\>", "examples": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0458\\%u0438\\>\\|\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\%u0438\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\%u043d\\%u043e\\%u0441\\%u0442\\>\\|\\%u041c\\%u043e\\%u0433\\%u0443\\%u045b\\%u043d\\%u043e\\%u0441\\%u0442\\>\\|\\%u041e\\%u0441\\%u043e\\%u0431\\%u0438\\%u043d\\%u0430\\>", "given": "\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u043e\\>\\|\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u0435\\>\\|\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u0438\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u043e\\>\\|\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\>", "scenario_outline": "\\%u0421\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0458\\%u0430\\>\\|\\%u041a\\%u043e\\%u043d\\%u0446\\%u0435\\%u043f\\%u0442\\>\\|\\%u0421\\%u043a\\%u0438\\%u0446\\%u0430\\>", "then": "\\%u041e\\%u043d\\%u0434\\%u0430\\>", "when": "\\%u041a\\%u0430\\%u0434\\%u0430\\>\\|\\%u041a\\%u0430\\%u0434\\>"},
+      \"sr-Latn": {"and": "I\\>", "background": "Kontekst\\>\\|Pozadina\\>\\|Osnova\\>", "but": "Ali\\>", "examples": "Scenariji\\>\\|Primeri\\>", "feature": "Mogu\\%u0107nost\\>\\|Funkcionalnost\\>\\|Mogucnost\\>\\|Osobina\\>", "given": "Zadato\\>\\|Zadate\\>\\|Zatati\\>", "scenario": "Scenario\\>\\|Primer\\>", "scenario_outline": "Struktura scenarija\\>\\|Koncept\\>\\|Skica\\>", "then": "Onda\\>", "when": "Kada\\>\\|Kad\\>"},
+      \"sv": {"and": "Och\\>", "background": "Bakgrund\\>", "but": "Men\\>", "examples": "Exempel\\>", "feature": "Egenskap\\>", "given": "Givet\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstrakt Scenario\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e4r\\>"},
+      \"tr": {"and": "Ve\\>", "background": "Ge\\%u00e7mi\\%u015f\\>", "but": "Fakat\\>\\|Ama\\>", "examples": "\\%u00d6rnekler\\>", "feature": "\\%u00d6zellik\\>", "given": "Diyelim ki\\>", "scenario": "Senaryo\\>", "scenario_outline": "Senaryo tasla\\%u011f\\%u0131\\>", "then": "O zaman\\>", "when": "E\\%u011fer ki\\>"},
+      \"uk": {"and": "\\%u0406\\>", "background": "\\%u041f\\%u0435\\%u0440\\%u0435\\%u0434\\%u0443\\%u043c\\%u043e\\%u0432\\%u0430\\>", "but": "\\%u0410\\%u043b\\%u0435\\>", "examples": "\\%u041f\\%u0440\\%u0438\\%u043a\\%u043b\\%u0430\\%u0434\\%u0438\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0456\\%u043e\\%u043d\\%u0430\\%u043b\\>", "given": "\\%u041f\\%u0440\\%u0438\\%u043f\\%u0443\\%u0441\\%u0442\\%u0438\\%u043c\\%u043e, \\%u0449\\%u043e\\>\\|\\%u041f\\%u0440\\%u0438\\%u043f\\%u0443\\%u0441\\%u0442\\%u0438\\%u043c\\%u043e\\>\\|\\%u041d\\%u0435\\%u0445\\%u0430\\%u0439\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0456\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0456\\%u044e\\>", "then": "\\%u0422\\%u043e\\>", "when": "\\%u042f\\%u043a\\%u0449\\%u043e\\>"},
+      \"uz": {"and": "\\%u0412\\%u0430\\>", "background": "\\%u0422\\%u0430\\%u0440\\%u0438\\%u0445\\>", "but": "\\%u041b\\%u0435\\%u043a\\%u0438\\%u043d\\>\\|\\%u0411\\%u0438\\%u0440\\%u043e\\%u043a\\>\\|\\%u0410\\%u043c\\%u043c\\%u043e\\>", "examples": "\\%u041c\\%u0438\\%u0441\\%u043e\\%u043b\\%u043b\\%u0430\\%u0440\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\>", "given": "\\%u0410\\%u0433\\%u0430\\%u0440\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439 \\%u0441\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430\\%u0441\\%u0438\\>", "then": "\\%u0423\\%u043d\\%u0434\\%u0430\\>", "when": "\\%u0410\\%u0433\\%u0430\\%u0440\\>"},
+      \"vi": {"and": "V\\%u00e0\\>", "background": "B\\%u1ed1i c\\%u1ea3nh\\>", "but": "Nh\\%u01b0ng\\>", "examples": "D\\%u1eef li\\%u1ec7u\\>", "feature": "T\\%u00ednh n\\%u0103ng\\>", "given": "Bi\\%u1ebft\\>\\|Cho\\>", "scenario": "T\\%u00ecnh hu\\%u1ed1ng\\>\\|K\\%u1ecbch b\\%u1ea3n\\>", "scenario_outline": "Khung t\\%u00ecnh hu\\%u1ed1ng\\>\\|Khung k\\%u1ecbch b\\%u1ea3n\\>", "then": "Th\\%u00ec\\>", "when": "Khi\\>"},
+      \"zh-CN": {"and": "\\%u800c\\%u4e14", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u4f46\\%u662f", "examples": "\\%u4f8b\\%u5b50\\>", "feature": "\\%u529f\\%u80fd\\>", "given": "\\%u5047\\%u5982", "scenario": "\\%u573a\\%u666f\\>", "scenario_outline": "\\%u573a\\%u666f\\%u5927\\%u7eb2\\>", "then": "\\%u90a3\\%u4e48", "when": "\\%u5f53"},
+      \"zh-TW": {"and": "\\%u800c\\%u4e14\\|\\%u4e26\\%u4e14", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u4f46\\%u662f", "examples": "\\%u4f8b\\%u5b50\\>", "feature": "\\%u529f\\%u80fd\\>", "given": "\\%u5047\\%u8a2d", "scenario": "\\%u5834\\%u666f\\>\\|\\%u5287\\%u672c\\>", "scenario_outline": "\\%u5834\\%u666f\\%u5927\\%u7db1\\>\\|\\%u5287\\%u672c\\%u5927\\%u7db1\\>", "then": "\\%u90a3\\%u9ebc", "when": "\\%u7576"}}
+
+function! s:pattern(key)
+  let language = matchstr(getline(1),'#\s*language:\s*\zs\S\+')
+  if &fileencoding == 'latin1' && language == ''
+    let language = 'en'
+  endif
+  if has_key(g:cucumber_languages, language)
+    let languages = [g:cucumber_languages[language]]
+  else
+    let languages = values(g:cucumber_languages)
+  end
+  return '\<\%('.join(map(languages,'get(v:val,a:key,"\\%(a\\&b\\)")'),'\|').'\)'
+endfunction
+
+function! s:Add(name)
+  let next = " skipempty skipwhite nextgroup=".join(map(["Region","AndRegion","ButRegion","Comment","String","Table"],'"cucumber".a:name.v:val'),",")
+  exe "syn region cucumber".a:name.'Region matchgroup=cucumber'.a:name.' start="\%(^\s*\)\@<=\%('.s:pattern(tolower(a:name)).'\)" end="$"'.next
+  exe 'syn region cucumber'.a:name.'AndRegion matchgroup=cucumber'.a:name.'And start="\%(^\s*\)\@<='.s:pattern('and').'" end="$" contained'.next
+  exe 'syn region cucumber'.a:name.'ButRegion matchgroup=cucumber'.a:name.'But start="\%(^\s*\)\@<='.s:pattern('but').'" end="$" contained'.next
+  exe 'syn match cucumber'.a:name.'Comment "\%(^\s*\)\@<=#.*" contained'.next
+  exe 'syn region cucumber'.a:name.'String start=+\%(^\s*\)\@<="""+ end=+"""+ contained'.next
+  exe 'syn match cucumber'.a:name.'Table "\%(^\s*\)\@<=|.*" contained contains=cucumberDelimiter'.next
+  exe 'hi def link cucumber'.a:name.'Comment cucumberComment'
+  exe 'hi def link cucumber'.a:name.'String cucumberString'
+  exe 'hi def link cucumber'.a:name.'But cucumber'.a:name.'And'
+  exe 'hi def link cucumber'.a:name.'And cucumber'.a:name
+  exe 'syn cluster cucumberStepRegions add=cucumber'.a:name.'Region,cucumber'.a:name.'AndRegion,cucumber'.a:name.'ButRegion'
+endfunction
+
+syn match   cucumberComment  "\%(^\s*\)\@<=#.*"
+syn match   cucumberComment  "\%(\%^\s*\)\@<=#.*" contains=cucumberLanguage
+syn match   cucumberLanguage "\%(#\s*\)\@<=language:" contained
+syn match   cucumberUnparsed "\S.*" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberTags,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty contained
+syn match   cucumberUnparsedComment "#.*" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberTags,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty contained
+
+exe 'syn match cucumberFeature "\%(^\s*\)\@<='.s:pattern('feature').':" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty'
+exe 'syn match cucumberBackground "\%(^\s*\)\@<='.s:pattern('background').':"'
+exe 'syn match cucumberScenario "\%(^\s*\)\@<='.s:pattern('scenario').':"'
+exe 'syn match cucumberScenarioOutline "\%(^\s*\)\@<='.s:pattern('scenario_outline').':"'
+exe 'syn match cucumberExamples "\%(^\s*\)\@<='.s:pattern('examples').':" nextgroup=cucumberExampleTable skipempty skipwhite'
+
+syn match   cucumberPlaceholder   "<[^<>]*>" contained containedin=@cucumberStepRegions
+syn match   cucumberExampleTable  "\%(^\s*\)\@<=|.*" contains=cucumberDelimiter
+syn match   cucumberDelimiter     "\\\@<!\%(\\\\\)*\zs|" contained
+syn match   cucumberTags          "\%(^\s*\)\@<=\%(@[^@[:space:]]\+\s\+\)*@[^@[:space:]]\+\s*$" contains=@NoSpell
+
+call s:Add('Then')
+call s:Add('When')
+call s:Add('Given')
+
+hi def link cucumberUnparsedComment   cucumberComment
+hi def link cucumberComment           Comment
+hi def link cucumberLanguage          SpecialComment
+hi def link cucumberFeature           Macro
+hi def link cucumberBackground        Define
+hi def link cucumberScenario          Define
+hi def link cucumberScenarioOutline   Define
+hi def link cucumberExamples          Define
+hi def link cucumberPlaceholder       Constant
+hi def link cucumberDelimiter         Delimiter
+hi def link cucumberTags              Tag
+hi def link cucumberString            String
+hi def link cucumberGiven             Conditional
+hi def link cucumberWhen              Function
+hi def link cucumberThen              Type
+
+let b:current_syntax = "cucumber"
+
+" vim:set sts=2 sw=2:
diff --git a/vim/syntax/eco.vim b/vim/syntax/eco.vim
new file mode 100644 (file)
index 0000000..485b356
--- /dev/null
@@ -0,0 +1,62 @@
+" Vim syntax file
+" Language:            eco
+" Maintainer:          Jay Adkisson
+" Mostly stolen from eruby.vim
+
+if !exists("g:eco_default_subtype")
+  let g:eco_default_subtype = "html"
+endif
+
+if !exists("b:eco_subtype")
+  let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
+  let b:eco_subtype = matchstr(s:lines,'eco_subtype=\zs\w\+')
+  if b:eco_subtype == ''
+    let b:eco_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eco\)\+$','',''),'\.\zs\w\+$')
+  endif
+  if b:eco_subtype == 'rhtml'
+    let b:eco_subtype = 'html'
+  elseif b:eco_subtype == 'jst'
+    let b:eco_subtype = 'html'
+  elseif b:eco_subtype == 'rb'
+    let b:eco_subtype = 'ruby'
+  elseif b:eco_subtype == 'yml'
+    let b:eco_subtype = 'yaml'
+  elseif b:eco_subtype == 'js' || b:eco_subtype == 'json'
+    let b:eco_subtype = 'javascript'
+  elseif b:eco_subtype == 'txt'
+    " Conventional; not a real file type
+    let b:eco_subtype = 'text'
+  elseif b:eco_subtype == ''
+    if exists('b:current_syntax') && b:current_syntax != ''
+      let b:eco_subtype = b:current_syntax
+    else
+      let b:eco_subtype = g:eco_default_subtype
+    endif
+  endif
+endif
+
+if exists("b:eco_subtype") && b:eco_subtype != '' && b:eco_subtype != 'eco'
+  exec "runtime! syntax/".b:eco_subtype.".vim"
+  syn include @coffeeTop syntax/coffee.vim
+endif
+
+syn cluster ecoRegions contains=ecoBlock,ecoExpression,ecoComment
+
+syn region ecoBlock      matchgroup=ecoDelimiter start=/<%/      end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend
+syn region ecoExpression matchgroup=ecoDelimiter start=/<%[=\-]/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend
+syn region ecoComment    matchgroup=ecoComment   start=/<%#/     end=/%>/ contains=@coffeeTodo,@Spell containedin=ALLBUT,@ecoRegions keepend
+
+" eco features not in coffeescript proper
+syn keyword ecoEnd end containedin=@ecoRegions
+syn match ecoIndentColon /\s+\w+:/ containedin=@ecoRegions
+
+" Define the default highlighting.
+
+hi def link ecoDelimiter    Delimiter
+hi def link ecoComment      Comment
+hi def link ecoEnd          coffeeConditional
+hi def link ecoIndentColon  None
+
+let b:current_syntax = 'eco'
+
+" vim: nowrap sw=2 sts=2 ts=8:
diff --git a/vim/syntax/git.vim b/vim/syntax/git.vim
new file mode 100644 (file)
index 0000000..729bf62
--- /dev/null
@@ -0,0 +1,77 @@
+" Vim syntax file
+" Language:    generic git output
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn case match
+syn sync minlines=50
+
+syn include @gitDiff syntax/diff.vim
+
+syn region gitHead start=/\%^/ end=/^$/
+syn region gitHead start=/\%(^commit \x\{40\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/
+
+" For git reflog and git show ...^{tree}, avoid sync issues
+syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/
+syn match gitHead /^\x\{40\} \x\{40}\t.*/
+
+syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold
+syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) \|$\)\@=/ contains=@gitDiff
+
+syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
+syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
+syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
+syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge
+
+syn match  gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite
+syn match  gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite
+syn match  gitKeyword /^Merge:/  contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite
+syn match  gitMode    /^\d\{6\}/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite
+syn match  gitIdentityKeyword /^\%(author\|committer\|tagger\)\>/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
+syn match  gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
+syn match  gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite
+
+syn match  gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite
+syn match  gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite
+syn match  gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity
+
+syn match  gitDate      /\<\u\l\l \u\l\l \d\=\d \d\d:\d\d:\d\d \d\d\d\d [+-]\d\d\d\d/ contained
+syn match  gitDate      /-\=\d\+ [+-]\d\d\d\d\>/               contained
+syn match  gitDate      /\<\d\+ \l\+ ago\>/                    contained
+syn match  gitType      /\<\%(tag\|commit\|tree\|blob\)\>/     contained nextgroup=gitHash skipwhite
+syn match  gitStage     /\<\d\t\@=/                            contained
+syn match  gitReference /\S\+\S\@!/                            contained
+syn match  gitHash      /\<\x\{40\}\>/                         contained nextgroup=gitIdentity,gitStage,gitHash skipwhite
+syn match  gitHash      /^\<\x\{40\}\>/ containedin=gitHead contained nextgroup=gitHash skipwhite
+syn match  gitHashAbbrev /\<\x\{4,40\}\>/           contained nextgroup=gitHashAbbrev skipwhite
+syn match  gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite
+
+syn match  gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite
+syn region gitEmail matchgroup=gitEmailDelimiter start=/</ end=/>/ keepend oneline contained containedin=gitIdentity
+
+syn match  gitNotesHeader /^Notes:\ze\n    /
+
+hi def link gitDateHeader        gitIdentityHeader
+hi def link gitIdentityHeader    gitIdentityKeyword
+hi def link gitIdentityKeyword   Label
+hi def link gitNotesHeader       gitKeyword
+hi def link gitReflogHeader      gitKeyword
+hi def link gitKeyword           Keyword
+hi def link gitIdentity          String
+hi def link gitEmailDelimiter    Delimiter
+hi def link gitEmail             Special
+hi def link gitDate              Number
+hi def link gitMode              Number
+hi def link gitHashAbbrev        gitHash
+hi def link gitHash              Identifier
+hi def link gitReflogMiddle      gitReference
+hi def link gitReference         Function
+hi def link gitStage             gitType
+hi def link gitType              Type
+hi def link gitDiffAdded         diffAdded
+hi def link gitDiffRemoved       diffRemoved
+
+let b:current_syntax = "git"
diff --git a/vim/syntax/gitcommit.vim b/vim/syntax/gitcommit.vim
new file mode 100644 (file)
index 0000000..3c43cdf
--- /dev/null
@@ -0,0 +1,82 @@
+" Vim syntax file
+" Language:    git commit file
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:   *.git/COMMIT_EDITMSG
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn case match
+syn sync minlines=50
+
+if has("spell")
+  syn spell toplevel
+endif
+
+syn include @gitcommitDiff syntax/diff.vim
+syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^$\|^#\@=/ contains=@gitcommitDiff
+
+syn match   gitcommitFirstLine "\%^[^#].*"  nextgroup=gitcommitBlank skipnl
+syn match   gitcommitSummary   "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
+syn match   gitcommitOverflow  ".*" contained contains=@Spell
+syn match   gitcommitBlank     "^[^#].*" contained contains=@Spell
+syn match   gitcommitComment   "^#.*"
+syn match   gitcommitHead      "^\%(#   .*\n\)\+#$" contained transparent
+syn match   gitcommitOnBranch  "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
+syn match   gitcommitOnBranch  "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
+syn match   gitcommitBranch    "[^ \t']\+" contained
+syn match   gitcommitNoBranch  "\%(^# \)\@<=Not currently on any branch." contained containedin=gitcommitComment
+syn match   gitcommitHeader    "\%(^# \)\@<=.*:$"      contained containedin=gitcommitComment
+syn region  gitcommitAuthor    matchgroup=gitCommitHeader start=/\%(^# \)\@<=\%(Author\|Committer\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent
+syn match   gitcommitNoChanges "\%(^# \)\@<=No changes$" contained containedin=gitcommitComment
+
+syn region  gitcommitUntracked start=/^# Untracked files:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUntrackedFile fold
+syn match   gitcommitUntrackedFile  "\t\@<=.*" contained
+
+syn region  gitcommitDiscarded start=/^# Changed but not updated:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold
+syn region  gitcommitSelected  start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold
+syn region  gitcommitUnmerged  start=/^# Unmerged paths:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUnmergedType fold
+
+syn match   gitcommitDiscardedType     "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2       contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite
+syn match   gitcommitSelectedType      "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2       contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite
+syn match   gitcommitUnmergedType      "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2       contained containedin=gitcommitComment nextgroup=gitcommitUnmergedFile skipwhite
+syn match   gitcommitDiscardedFile     ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow
+syn match   gitcommitSelectedFile      ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
+syn match   gitcommitUnmergedFile      ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
+syn match   gitcommitDiscardedArrow    " -> " contained nextgroup=gitcommitDiscardedFile
+syn match   gitcommitSelectedArrow     " -> " contained nextgroup=gitcommitSelectedFile
+syn match   gitcommitUnmergedArrow     " -> " contained nextgroup=gitcommitSelectedFile
+
+syn match   gitcommitWarning           "\%^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl
+syn match   gitcommitWarning           "^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl contained
+syn match   gitcommitWarning           "^\%(no changes added to commit\|nothing \%(added \)\=to commit\)\>.*\%$"
+
+hi def link gitcommitSummary           Keyword
+hi def link gitcommitComment           Comment
+hi def link gitcommitUntracked         gitcommitComment
+hi def link gitcommitDiscarded         gitcommitComment
+hi def link gitcommitSelected          gitcommitComment
+hi def link gitcommitUnmerged          gitcommitComment
+hi def link gitcommitOnBranch          Comment
+hi def link gitcommitBranch            Special
+hi def link gitcommitNoBranch          gitCommitBranch
+hi def link gitcommitDiscardedType     gitcommitType
+hi def link gitcommitSelectedType      gitcommitType
+hi def link gitcommitUnmergedType      gitcommitType
+hi def link gitcommitType              Type
+hi def link gitcommitNoChanges         gitcommitHeader
+hi def link gitcommitHeader            PreProc
+hi def link gitcommitUntrackedFile     gitcommitFile
+hi def link gitcommitDiscardedFile     gitcommitFile
+hi def link gitcommitSelectedFile      gitcommitFile
+hi def link gitcommitUnmergedFile      gitcommitFile
+hi def link gitcommitFile              Constant
+hi def link gitcommitDiscardedArrow    gitcommitArrow
+hi def link gitcommitSelectedArrow     gitcommitArrow
+hi def link gitcommitUnmergedArrow     gitcommitArrow
+hi def link gitcommitArrow             gitcommitComment
+"hi def link gitcommitOverflow         Error
+hi def link gitcommitBlank             Error
+
+let b:current_syntax = "gitcommit"
diff --git a/vim/syntax/gitconfig.vim b/vim/syntax/gitconfig.vim
new file mode 100644 (file)
index 0000000..0e64022
--- /dev/null
@@ -0,0 +1,37 @@
+" Vim syntax file
+" Language:    git config file
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:   gitconfig, .gitconfig, *.git/config
+
+if exists("b:current_syntax")
+  finish
+endif
+
+setlocal iskeyword+=-
+setlocal iskeyword-=_
+syn case ignore
+syn sync minlines=10
+
+syn match   gitconfigComment   "[#;].*"
+syn match   gitconfigSection   "\%(^\s*\)\@<=\[[a-z0-9.-]\+\]"
+syn match   gitconfigSection   '\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]'
+syn match   gitconfigVariable   "\%(^\s*\)\@<=\a\k*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite
+syn region  gitconfigAssignment  matchgroup=gitconfigNone start=+=\s*+ skip=+\\+ end=+\s*$+ contained contains=gitconfigBoolean,gitconfigNumber,gitConfigString,gitConfigEscape,gitConfigError,gitconfigComment keepend
+syn keyword gitconfigBoolean true false yes no contained
+syn match   gitconfigNumber  "\d\+" contained
+syn region  gitconfigString  matchgroup=gitconfigDelim start=+"+ skip=+\\+ end=+"+ matchgroup=gitconfigError end=+[^\\"]\%#\@!$+ contained contains=gitconfigEscape,gitconfigEscapeError
+syn match   gitconfigError  +\\.+       contained
+syn match   gitconfigEscape +\\[\\"ntb]+ contained
+syn match   gitconfigEscape +\\$+       contained
+
+hi def link gitconfigComment           Comment
+hi def link gitconfigSection           Keyword
+hi def link gitconfigVariable          Identifier
+hi def link gitconfigBoolean           Boolean
+hi def link gitconfigNumber            Number
+hi def link gitconfigString            String
+hi def link gitconfigDelim             Delimiter
+hi def link gitconfigEscape            Delimiter
+hi def link gitconfigError             Error
+
+let b:current_syntax = "gitconfig"
diff --git a/vim/syntax/gitrebase.vim b/vim/syntax/gitrebase.vim
new file mode 100644 (file)
index 0000000..5edef89
--- /dev/null
@@ -0,0 +1,34 @@
+" Vim syntax file
+" Language:    git rebase --interactive
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:   git-rebase-todo
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn case match
+
+syn match   gitrebaseHash   "\v<\x{7,40}>"                             contained
+syn match   gitrebaseCommit "\v<\x{7,40}>"  nextgroup=gitrebaseSummary skipwhite
+syn match   gitrebasePick   "\v^p%(ick)=>"   nextgroup=gitrebaseCommit skipwhite
+syn match   gitrebaseReword "\v^r%(eword)=>" nextgroup=gitrebaseCommit skipwhite
+syn match   gitrebaseEdit   "\v^e%(dit)=>"   nextgroup=gitrebaseCommit skipwhite
+syn match   gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite
+syn match   gitrebaseFixup  "\v^f%(ixup)=>"  nextgroup=gitrebaseCommit skipwhite
+syn match   gitrebaseSummary ".*"               contains=gitrebaseHash contained
+syn match   gitrebaseComment "^#.*"             contains=gitrebaseHash
+syn match   gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite
+
+hi def link gitrebaseCommit         gitrebaseHash
+hi def link gitrebaseHash           Identifier
+hi def link gitrebasePick           Statement
+hi def link gitrebaseReword         Number
+hi def link gitrebaseEdit           PreProc
+hi def link gitrebaseSquash         Type
+hi def link gitrebaseFixup          Special
+hi def link gitrebaseSummary        String
+hi def link gitrebaseComment        Comment
+hi def link gitrebaseSquashError    Error
+
+let b:current_syntax = "gitrebase"
diff --git a/vim/syntax/gitsendemail.vim b/vim/syntax/gitsendemail.vim
new file mode 100644 (file)
index 0000000..bb9ae9c
--- /dev/null
@@ -0,0 +1,18 @@
+" Vim syntax file
+" Language:    git send-email message
+" Maintainer:  Tim Pope
+" Filenames:   *.msg.[0-9]* (first line is "From ... # This line is ignored.")
+
+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/mail.vim
+syn case match
+
+syn match   gitsendemailComment "\%^From.*#.*"
+syn match   gitsendemailComment "^GIT:.*"
+
+hi def link gitsendemailComment Comment
+
+let b:current_syntax = "gitsendemail"
diff --git a/vim/syntax/javascript.vim b/vim/syntax/javascript.vim
new file mode 100644 (file)
index 0000000..91d2506
--- /dev/null
@@ -0,0 +1,258 @@
+" Vim syntax file
+" Language:     JavaScript
+" Maintainer:   Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com>
+" Last Change By: Marc Harter
+" Last Change:  February 18, 2011
+" Version:      0.7.9
+" Changes:      Updates JSDoc syntax
+"
+" TODO:
+"  - Add the HTML syntax inside the JSDoc
+
+if !exists("main_syntax")
+  if version < 600
+    syntax clear
+  elseif exists("b:current_syntax")
+    finish
+  endif
+  let main_syntax = 'javascript'
+endif
+
+"" Drop fold if it set but VIM doesn't support it.
+let b:javascript_fold='true'
+if version < 600    " Don't support the old version
+  unlet! b:javascript_fold
+endif
+
+"" dollar sigh is permittd anywhere in an identifier
+setlocal iskeyword+=$
+
+syntax sync fromstart
+
+"" JavaScript comments
+syntax keyword javaScriptCommentTodo    TODO FIXME XXX TBD contained
+syntax region  javaScriptLineComment    start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell
+syntax region  javaScriptEnvComment     start="\%^#!" end="$" display
+syntax region  javaScriptLineComment    start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold
+syntax region  javaScriptCvsTag         start="\$\cid:" end="\$" oneline contained
+syntax region  javaScriptComment        start="/\*"  end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold
+
+"" JSDoc / JSDoc Toolkit
+if !exists("javascript_ignore_javaScriptdoc")
+  syntax case ignore
+
+  "" syntax coloring for javadoc comments (HTML)
+  "syntax include @javaHtml <sfile>:p:h/html.vim
+  "unlet b:current_syntax
+
+  syntax region javaScriptDocComment      matchgroup=javaScriptComment start="/\*\*\s*"  end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold
+
+  " tags containing a param
+  syntax match  javaScriptDocTags         contained "@\(augments\|base\|borrows\|class\|constructs\|default\|exception\|exports\|extends\|file\|member\|memberOf\|module\|name\|namespace\|optional\|requires\|title\|throws\|version\)\>" nextgroup=javaScriptDocParam skipwhite
+  " tags containing type and param
+  syntax match  javaScriptDocTags         contained "@\(argument\|param\|property\)\>" nextgroup=javaScriptDocType skipwhite
+  " tags containing type but no param
+  syntax match  javaScriptDocTags         contained "@\(type\|return\|returns\)\>" nextgroup=javaScriptDocTypeNoParam skipwhite
+  " tags containing references
+  syntax match  javaScriptDocTags         contained "@\(lends\|link\|see\)\>" nextgroup=javaScriptDocSeeTag skipwhite
+  " other tags (no extra syntax)
+  syntax match  javaScriptDocTags         contained "@\(access\|addon\|alias\|author\|beta\|constant\|constructor\|copyright\|deprecated\|description\|event\|example\|exec\|field\|fileOverview\|fileoverview\|function\|global\|ignore\|inner\|license\|overview\|private\|protected\|project\|public\|readonly\|since\|static\)\>"
+
+  syntax region javaScriptDocType         start="{" end="}" oneline contained nextgroup=javaScriptDocParam skipwhite
+  syntax match  javaScriptDocType         contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=javaScriptDocParam skipwhite
+  syntax region javaScriptDocTypeNoParam  start="{" end="}" oneline contained
+  syntax match  javaScriptDocTypeNoParam  contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
+  syntax match  javaScriptDocParam        contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\)\+"
+  syntax region javaScriptDocSeeTag       contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags
+
+  syntax case match
+endif   "" JSDoc end
+
+syntax case match
+
+"" Syntax in the JavaScript code
+syntax match   javaScriptSpecial        "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
+syntax region  javaScriptStringD        start=+"+  skip=+\\\\\|\\$"+  end=+"+  contains=javaScriptSpecial,@htmlPreproc
+syntax region  javaScriptStringS        start=+'+  skip=+\\\\\|\\$'+  end=+'+  contains=javaScriptSpecial,@htmlPreproc
+syntax region  javaScriptRegexpCharClass start=+\[\]\|\[^\]\|\[+ end=+\]+ contained
+syntax region  javaScriptRegexpString   start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,javaScriptRegexpCharClass,@htmlPreproc oneline
+syntax match   javaScriptNumber         /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
+syntax match   javaScriptFloat          /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
+syntax match   javaScriptLabel          /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
+
+"" JavaScript Prototype
+syntax keyword javaScriptPrototype      prototype
+
+"" Programm Keywords
+syntax keyword javaScriptSource         import export
+syntax keyword javaScriptType           const undefined var void yield 
+syntax keyword javaScriptOperator       delete new in instanceof let typeof
+syntax keyword javaScriptBoolean        true false
+syntax keyword javaScriptNull           null
+syntax keyword javaScriptThis           this
+
+"" Statement Keywords
+syntax keyword javaScriptConditional    if else
+syntax keyword javaScriptRepeat         do while for
+syntax keyword javaScriptBranch         break continue switch case default return
+syntax keyword javaScriptStatement      try catch throw with finally
+
+syntax keyword javaScriptGlobalObjects  Array Boolean Date Function Infinity JavaArray JavaClass JavaObject JavaPackage Math Number NaN Object Packages RegExp String Undefined java netscape sun
+
+syntax keyword javaScriptExceptions     Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
+
+syntax keyword javaScriptFutureKeys     abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public
+
+"" DOM/HTML/CSS specified things
+
+  " DOM2 Objects
+  syntax keyword javaScriptGlobalObjects  DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
+  syntax keyword javaScriptExceptions     DOMException
+
+  " DOM2 CONSTANT
+  syntax keyword javaScriptDomErrNo       INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
+  syntax keyword javaScriptDomNodeConsts  ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
+
+  " HTML events and internal variables
+  syntax case ignore
+  syntax keyword javaScriptHtmlEvents     onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
+  syntax case match
+
+" Follow stuff should be highligh within a special context
+" While it can't be handled with context depended with Regex based highlight
+" So, turn it off by default
+if exists("javascript_enable_domhtmlcss")
+
+    " DOM2 things
+    syntax match javaScriptDomElemAttrs     contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
+    syntax match javaScriptDomElemFuncs     contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite
+    " HTML things
+    syntax match javaScriptHtmlElemAttrs    contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/
+    syntax match javaScriptHtmlElemFuncs    contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite
+
+    " CSS Styles in JavaScript
+    syntax keyword javaScriptCssStyles      contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition
+    syntax keyword javaScriptCssStyles      contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition
+    syntax keyword javaScriptCssStyles      contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode
+    syntax keyword javaScriptCssStyles      contained bottom height left position right top width zIndex
+    syntax keyword javaScriptCssStyles      contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout
+    syntax keyword javaScriptCssStyles      contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
+    syntax keyword javaScriptCssStyles      contained listStyle listStyleImage listStylePosition listStyleType
+    syntax keyword javaScriptCssStyles      contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
+    syntax keyword javaScriptCssStyles      contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
+    syntax keyword javaScriptCssStyles      contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
+    syntax keyword javaScriptCssStyles      contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
+
+    " Highlight ways
+    syntax match javaScriptDotNotation      "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs
+    syntax match javaScriptDotNotation      "\.style\." nextgroup=javaScriptCssStyles
+
+endif "DOM/HTML/CSS
+
+"" end DOM/HTML/CSS specified things
+
+
+"" Code blocks
+syntax cluster javaScriptAll       contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptThis,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation
+syntax region  javaScriptBracket   matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc
+syntax region  javaScriptParen     matchgroup=javaScriptParen   transparent start="("  end=")"  contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
+syntax region  javaScriptBlock     matchgroup=javaScriptBlock   transparent start="{"  end="}"  contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc 
+
+"" catch errors caused by wrong parenthesis
+syntax match   javaScriptParensError    ")\|}\|\]"
+syntax match   javaScriptParensErrA     contained "\]"
+syntax match   javaScriptParensErrB     contained ")"
+syntax match   javaScriptParensErrC     contained "}"
+
+if main_syntax == "javascript"
+  syntax sync clear
+  syntax sync ccomment javaScriptComment minlines=200
+  syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/
+endif
+
+"" Fold control
+if exists("b:javascript_fold")
+    syntax match   javaScriptFunction       /\<function\>/ nextgroup=javaScriptFuncName skipwhite
+    syntax match   javaScriptOpAssign       /=\@<!=/ nextgroup=javaScriptFuncBlock skipwhite skipempty
+    syntax region  javaScriptFuncName       contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty
+    syntax region  javaScriptFuncBlock      contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold
+else
+    syntax keyword javaScriptFunction       function
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_javascript_syn_inits")
+  if version < 508
+    let did_javascript_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+  HiLink javaScriptComment              Comment
+  HiLink javaScriptLineComment          Comment
+  HiLink javaScriptEnvComment           PreProc
+  HiLink javaScriptDocComment           Comment
+  HiLink javaScriptCommentTodo          Todo
+  HiLink javaScriptCvsTag               Function
+  HiLink javaScriptDocTags              Special
+  HiLink javaScriptDocSeeTag            Function
+  HiLink javaScriptDocType              Type
+  HiLink javaScriptDocTypeNoParam       Type
+  HiLink javaScriptDocParam             Label
+  HiLink javaScriptStringS              String
+  HiLink javaScriptStringD              String
+  HiLink javaScriptRegexpString         String
+  HiLink javaScriptRegexpCharClass      Character
+  HiLink javaScriptCharacter            Character
+  HiLink javaScriptPrototype            Type
+  HiLink javaScriptConditional          Conditional
+  HiLink javaScriptBranch               Conditional
+  HiLink javaScriptRepeat               Repeat
+  HiLink javaScriptStatement            Statement
+  HiLink javaScriptFunction             Function
+  HiLink javaScriptError                Error
+  HiLink javaScriptParensError          Error
+  HiLink javaScriptParensErrA           Error
+  HiLink javaScriptParensErrB           Error
+  HiLink javaScriptParensErrC           Error
+  HiLink javaScriptOperator             Operator
+  HiLink javaScriptType                 Type
+  HiLink javaScriptThis                 Type
+  HiLink javaScriptNull                 Type
+  HiLink javaScriptNumber               Number
+  HiLink javaScriptFloat                Number
+  HiLink javaScriptBoolean              Boolean
+  HiLink javaScriptLabel                Label
+  HiLink javaScriptSpecial              Special
+  HiLink javaScriptSource               Special
+  HiLink javaScriptGlobalObjects        Special
+  HiLink javaScriptExceptions           Special
+
+  HiLink javaScriptDomErrNo             Constant
+  HiLink javaScriptDomNodeConsts        Constant
+  HiLink javaScriptDomElemAttrs         Label
+  HiLink javaScriptDomElemFuncs         PreProc
+
+  HiLink javaScriptHtmlEvents           Special
+  HiLink javaScriptHtmlElemAttrs        Label
+  HiLink javaScriptHtmlElemFuncs        PreProc
+
+  HiLink javaScriptCssStyles            Label
+
+  delcommand HiLink
+endif
+
+" Define the htmlJavaScript for HTML syntax html.vim
+"syntax clear htmlJavaScript
+"syntax clear javaScriptExpression
+syntax cluster  htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError
+syntax cluster  javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc
+
+let b:current_syntax = "javascript"
+if main_syntax == 'javascript'
+  unlet main_syntax
+endif
+
+" vim: ts=4
diff --git a/vim/syntax/markdown.vim b/vim/syntax/markdown.vim
new file mode 100644 (file)
index 0000000..072865e
--- /dev/null
@@ -0,0 +1,107 @@
+" Vim syntax file
+" Language:     Markdown
+" Maintainer:   Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:    *.markdown
+
+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/html.vim
+unlet! b:current_syntax
+
+syn sync minlines=10
+syn case ignore
+
+syn match markdownValid '[<>]\S\@!'
+syn match markdownValid '&\%(#\=\w*;\)\@!'
+
+syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock
+
+syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule
+syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop
+
+syn match markdownH1 ".\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule
+syn match markdownH2 ".\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule
+
+syn match markdownHeadingRule "^[=-]\+$" contained
+
+syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!"      end="#*\s*$" keepend oneline contains=@markdownInline contained
+syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!"     end="#*\s*$" keepend oneline contains=@markdownInline contained
+syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!"    end="#*\s*$" keepend oneline contains=@markdownInline contained
+syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!"   end="#*\s*$" keepend oneline contains=@markdownInline contained
+syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!"  end="#*\s*$" keepend oneline contains=@markdownInline contained
+syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline contained
+
+syn match markdownBlockquote ">\s" contained nextgroup=@markdownBlock
+
+syn region markdownCodeBlock start="    \|\t" end="$" contained
+
+" TODO: real nesting
+syn match markdownListMarker " \{0,4\}[-*+]\%(\s\+\S\)\@=" contained
+syn match markdownOrderedListMarker " \{0,4}\<\d\+\.\%(\s*\S\)\@=" contained
+
+syn match markdownRule "\* *\* *\*[ *]*$" contained
+syn match markdownRule "- *- *-[ -]*$" contained
+
+syn match markdownLineBreak "\s\{2,\}$"
+
+syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite
+syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained
+syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained
+syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained
+syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
+syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
+
+syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" keepend nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
+syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
+syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
+syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
+
+syn region markdownItalic start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart
+syn region markdownItalic start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart
+syn region markdownBold start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart
+syn region markdownBold start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart
+syn region markdownBoldItalic start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart
+syn region markdownBoldItalic start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart
+syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
+syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
+syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*\zs```\s*\w*\ze\s*$" end="^```\ze\s*$" keepend
+
+syn match markdownEscape "\\[][\\`*_{}()#+.!-]"
+syn match markdownError "\w\@<=_\w\@="
+
+hi def link markdownH1                    htmlH1
+hi def link markdownH2                    htmlH2
+hi def link markdownH3                    htmlH3
+hi def link markdownH4                    htmlH4
+hi def link markdownH5                    htmlH5
+hi def link markdownH6                    htmlH6
+hi def link markdownHeadingRule           markdownRule
+hi def link markdownHeadingDelimiter      Delimiter
+hi def link markdownOrderedListMarker     markdownListMarker
+hi def link markdownListMarker            htmlTagName
+hi def link markdownBlockquote            Comment
+hi def link markdownRule                  PreProc
+
+hi def link markdownLinkText              htmlLink
+hi def link markdownIdDeclaration         Typedef
+hi def link markdownId                    Type
+hi def link markdownAutomaticLink         markdownUrl
+hi def link markdownUrl                   Float
+hi def link markdownUrlTitle              String
+hi def link markdownIdDelimiter           markdownLinkDelimiter
+hi def link markdownUrlDelimiter          htmlTag
+hi def link markdownUrlTitleDelimiter     Delimiter
+
+hi def link markdownItalic                htmlItalic
+hi def link markdownBold                  htmlBold
+hi def link markdownBoldItalic            htmlBoldItalic
+hi def link markdownCodeDelimiter         Delimiter
+
+hi def link markdownEscape                Special
+hi def link markdownError                 Error
+
+let b:current_syntax = "markdown"
+
+" vim:set sw=2:
diff --git a/vim/syntax/mustache.vim b/vim/syntax/mustache.vim
new file mode 100644 (file)
index 0000000..dd5aae8
--- /dev/null
@@ -0,0 +1,69 @@
+" Vim syntax file
+" Language:    Mustache
+" Maintainer:  Juvenn Woo <machese@gmail.com>
+" Screenshot:   http://imgur.com/6F408
+" Version:     1
+" Last Change:  2009 Oct 15
+" Remark:
+"   It lexically hilights embedded mustaches (exclusively) in html file.
+"   While it was written for Ruby-based Mustache template system, it should work for Google's C-based *ctemplate* as well as Erlang-based *et*. All of them are, AFAIK, based on the idea of ctemplate.
+" References:
+"   [Mustache](http://github.com/defunkt/mustache)
+"   [ctemplate](http://code.google.com/p/google-ctemplate/)
+"   [ctemplate doc](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html)
+"   [et](http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html)
+" TODO: Feedback is welcomed.
+
+
+" Read the HTML syntax to start with
+if version < 600
+  so <sfile>:p:h/html.vim
+else
+  runtime! syntax/html.vim
+  unlet b:current_syntax
+endif
+
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+" Standard HiLink will not work with included syntax files
+if version < 508
+  command! -nargs=+ HtmlHiLink hi link <args>
+else
+  command! -nargs=+ HtmlHiLink hi def link <args>
+endif
+
+syntax match mustacheError '}}}\?'
+syntax match mustacheInsideError '{{[{#^<>=!\/]\?' containedin=@mustacheInside
+syntax region mustacheVariable matchgroup=mustacheMarker start=/{{/ end=/}}/ containedin=@htmlMustacheContainer
+syntax region mustacheVariableUnescape matchgroup=mustacheMarker start=/{{{/ end=/}}}/ containedin=@htmlMustacheContainer
+syntax region mustacheSection matchgroup=mustacheMarker start='{{[#^/]' end=/}}/ containedin=@htmlMustacheContainer
+syntax region mustachePartial matchgroup=mustacheMarker start=/{{[<>]/ end=/}}/
+syntax region mustacheMarkerSet matchgroup=mustacheMarker start=/{{=/ end=/=}}/
+syntax region mustacheComment start=/{{!/ end=/}}/ contains=Todo containedin=htmlHead
+
+
+" Clustering
+syntax cluster mustacheInside add=mustacheVariable,mustacheVariableUnescape,mustacheSection,mustachePartial,mustacheMarkerSet
+syntax cluster htmlMustacheContainer add=htmlHead,htmlTitle,htmlString,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6
+
+
+" Hilighting
+" mustacheInside hilighted as Number, which is rarely used in html
+" you might like change it to Function or Identifier
+HtmlHiLink mustacheVariable Number
+HtmlHiLink mustacheVariableUnescape Number
+HtmlHiLink mustachePartial Number
+HtmlHiLink mustacheSection Number
+HtmlHiLink mustacheMarkerSet Number
+
+HtmlHiLink mustacheComment Comment
+HtmlHiLink mustacheMarker Identifier
+HtmlHiLink mustacheError Error
+HtmlHiLink mustacheInsideError Error
+
+let b:current_syntax = "mustache"
+delcommand HtmlHiLink
\ No newline at end of file
diff --git a/vim/syntax/puppet.vim b/vim/syntax/puppet.vim
new file mode 100644 (file)
index 0000000..8cdada1
--- /dev/null
@@ -0,0 +1,117 @@
+" puppet syntax file
+" Filename:     puppet.vim
+" Language:     puppet configuration file
+" Maintainer:   Luke Kanies <luke@madstop.com>
+" URL:
+" Last Change:
+" Version:
+"
+
+" Copied from the cfengine, ruby, and perl syntax files
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+" match class/definition/node declarations
+syn region  puppetDefine        start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe
+syn keyword puppetDefType       class define node inherits contained
+syn region  puppetDefArguments  start="(" end=")" contained contains=puppetArgument,puppetString
+syn match   puppetArgument      "\w\+" contained
+syn match   puppetArgument      "\$\w\+" contained
+syn match   puppetArgument      "'[^']+'" contained
+syn match   puppetArgument      '"[^"]+"' contained
+syn match   puppetDefName       "\w\+" contained
+syn match   puppetNodeRe        "/.*/" contained
+
+" match 'foo' in 'class foo { ...'
+" match 'foo::bar' in 'class foo::bar { ...'
+" match 'Foo::Bar' in 'Foo::Bar["..."]
+"FIXME: "Foo-bar" doesn't get highlighted as expected, although "foo-bar" does.
+syn match   puppetInstance      "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)*\s*{" contains=puppetTypeName,puppetTypeDefault
+syn match   puppetInstance      "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*[[{]" contains=puppetTypeName,puppetTypeDefault
+syn match   puppetInstance      "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*<\?<|" contains=puppetTypeName,puppetTypeDefault
+syn match   puppetTypeName      "[a-z]\w*" contained
+syn match   puppetTypeDefault   "[A-Z]\w*" contained
+
+" match 'foo' in 'foo => "bar"'
+syn match   puppetParam         "\w\+\s*[=+]>" contains=puppetParamName
+syn match   puppetParamName     "\w\+" contained
+
+" match 'present' in 'ensure => present'
+" match '2755' in 'mode => 2755'
+" don't match 'bar' in 'foo => bar'
+syn match   puppetParam         "\w\+\s*[=+]>\s*[a-z0-9]\+" contains=puppetParamString,puppetParamName
+syn match   puppetParamString   "[=+]>\s*\w\+" contains=puppetParamKeyword,puppetParamSpecial,puppetParamDigits contained
+syn keyword puppetParamKeyword  present absent purged latest installed running stopped mounted unmounted role configured file directory link contained
+syn keyword puppetParamSpecial  true false undef contained
+syn match   puppetParamDigits   "[0-9]\+"
+
+" match 'template' in 'content => template("...")'
+syn match   puppetParam         "\w\+\s*[=+]>\s*\w\+\s*(" contains=puppetFunction,puppetParamName
+" statements
+syn region  puppetFunction      start="^\s*\(alert\|crit\|debug\|emerg\|err\|fail\|include\|info\|notice\|realize\|require\|search\|tag\|warning\)\s*(" end=")" contained contains=puppetString
+" rvalues
+syn region  puppetFunction      start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
+
+syn match   puppetVariable      "$[a-zA-Z0-9_:]\+"
+syn match   puppetVariable      "${[a-zA-Z0-9_:]\+}"
+
+" match anything between simple/double quotes.
+" don't match variables if preceded by a backslash.
+syn region  puppetString        start=+'+ skip=+\\\\\|\\'+ end=+'+
+syn region  puppetString        start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable
+syn match   puppetString        "/[^/]*/"
+syn match   puppetNotVariable   "\\$\w\+" contained
+syn match   puppetNotVariable   "\\${\w\+}" contained
+
+syn keyword puppetKeyword       import inherits include
+syn keyword puppetControl       case default if else elsif
+syn keyword puppetSpecial       true false undef
+
+" comments last overriding everything else
+syn match   puppetComment       "\s*#.*$" contains=puppetTodo
+syn region  puppetComment       start="/\*" end="\*/" contains=puppetTodo extend
+syn keyword puppetTodo          TODO NOTE FIXME XXX BUG HACK contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_puppet_syn_inits")
+  if version < 508
+    let did_puppet_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  HiLink puppetVariable             Identifier
+  HiLink puppetType                 Identifier
+  HiLink puppetKeyword              Define
+  HiLink puppetComment              Comment
+  HiLink puppetString               String
+  HiLink puppetParamKeyword         String
+  HiLink puppetParamDigits          String
+  HiLink puppetNotVariable          String
+  HiLink puppetParamSpecial         Special
+  HiLink puppetSpecial              Special
+  HiLink puppetTodo                 Todo
+  HiLink puppetControl              Statement
+  HiLink puppetDefType              Define
+  HiLink puppetDefName              Type
+  HiLink puppetNodeRe               Type
+  HiLink puppetTypeName             Statement
+  HiLink puppetTypeDefault          Type
+  HiLink puppetParamName            Identifier
+  HiLink puppetArgument             Identifier
+  HiLink puppetFunction             Function
+
+  delcommand HiLink
+endif
+
+let b:current_syntax = "puppet"
+set iskeyword=-,:,@,48-57,_,192-255
+
diff --git a/vim/syntax/sass.vim b/vim/syntax/sass.vim
new file mode 100644 (file)
index 0000000..629da26
--- /dev/null
@@ -0,0 +1,90 @@
+" Vim syntax file
+" Language:    Sass
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:   *.sass
+" Last Change: 2010 Aug 09
+
+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/css.vim
+
+syn case ignore
+
+syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
+syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
+
+syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
+
+syn match sassProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition
+syn match sassProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
+syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
+syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction,sassInterpolation
+syn match sassDefault "!default\>" contained
+syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+"
+syn match sassVariable "$[[:alnum:]_-]\+"
+syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite
+syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite
+
+syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained
+syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained
+syn match sassFunction "\<\%(alpha\|opacity\|rgba\|opacify\|fade-in\|transparentize\|fade-out\)\>(\@=" contained
+syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained
+syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained
+syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained
+
+syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ,sassProperty
+
+syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute
+syn match sassMixin  "^="               nextgroup=sassMixinName skipwhite
+syn match sassMixin  "\%([{};]\s*\|^\s*\)\@<=@mixin"   nextgroup=sassMixinName skipwhite
+syn match sassMixing "^\s\+\zs+"        nextgroup=sassMixinName
+syn match sassMixing "\%([{};]\s*\|^\s*\)\@<=@include" nextgroup=sassMixinName skipwhite
+syn match sassExtend "\%([{};]\s*\|^\s*\)\@<=@extend"
+
+syn match sassEscape     "^\s*\zs\\"
+syn match sassIdChar     "#[[:alnum:]_-]\@=" nextgroup=sassId
+syn match sassId         "[[:alnum:]_-]\+" contained
+syn match sassClassChar  "\.[[:alnum:]_-]\@=" nextgroup=sassClass
+syn match sassClass      "[[:alnum:]_-]\+" contained
+syn match sassAmpersand  "&"
+
+" TODO: Attribute namespaces
+" TODO: Arithmetic (including strings and concatenation)
+
+syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssURL,cssUnicodeEscape,cssMediaType
+syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction
+syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction
+syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\|each\)\>" end="[{};]\@=\|$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction
+syn keyword sassFor from to through in contained
+
+syn keyword sassTodo        FIXME NOTE TODO OPTIMIZE XXX contained
+syn region  sassComment     start="^\z(\s*\)//"  end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
+syn region  sassCssComment  start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
+
+hi def link sassCssComment              sassComment
+hi def link sassComment                 Comment
+hi def link sassDefault                 cssImportant
+hi def link sassVariable                Identifier
+hi def link sassFunction                Function
+hi def link sassMixing                  PreProc
+hi def link sassMixin                   PreProc
+hi def link sassExtend                  PreProc
+hi def link sassTodo                    Todo
+hi def link sassInclude                 Include
+hi def link sassDebug                   sassControl
+hi def link sassWarn                    sassControl
+hi def link sassControl                 PreProc
+hi def link sassFor                     PreProc
+hi def link sassEscape                  Special
+hi def link sassIdChar                  Special
+hi def link sassClassChar               Special
+hi def link sassInterpolationDelimiter  Delimiter
+hi def link sassAmpersand               Character
+hi def link sassId                      Identifier
+hi def link sassClass                   Type
+
+let b:current_syntax = "sass"
+
+" vim:set sw=2:
diff --git a/vim/syntax/scala.vim b/vim/syntax/scala.vim
new file mode 100644 (file)
index 0000000..36605ab
--- /dev/null
@@ -0,0 +1,151 @@
+" Vim syntax file
+" Language   : Scala (http://scala-lang.org/)
+" Maintainers: Stefan Matthias Aust, Julien Wetterwald
+" Last Change: 2007 June 13
+
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+syn case match
+syn sync minlines=50
+
+" most Scala keywords
+syn keyword scalaKeyword abstract case catch do else extends final finally for forSome if implicit lazy match new null override private protected requires return sealed super this throw try type while with yield
+syn match scalaKeyword "=>"
+syn match scalaKeyword "<-"
+syn match scalaKeyword "\<_\>"
+
+syn match scalaOperator ":\{2,\}" "this is not a type
+
+" package and import statements
+syn keyword scalaPackage package nextgroup=scalaFqn skipwhite
+syn keyword scalaImport import nextgroup=scalaFqn skipwhite
+syn match scalaFqn "\<[._$a-zA-Z0-9,]*" contained nextgroup=scalaFqnSet
+syn region scalaFqnSet start="{" end="}" contained
+
+" boolean literals
+syn keyword scalaBoolean true false
+
+" definitions
+syn keyword scalaDef def nextgroup=scalaDefName skipwhite
+syn keyword scalaVal val nextgroup=scalaValName skipwhite
+syn keyword scalaVar var nextgroup=scalaVarName skipwhite
+syn keyword scalaClass class nextgroup=scalaClassName skipwhite
+syn keyword scalaObject object nextgroup=scalaClassName skipwhite
+syn keyword scalaTrait trait nextgroup=scalaClassName skipwhite
+syn match scalaDefName "[^ =:;([]\+" contained nextgroup=scalaDefSpecializer skipwhite
+syn match scalaValName "[^ =:;([]\+" contained
+syn match scalaVarName "[^ =:;([]\+" contained 
+syn match scalaClassName "[^ =:;(\[]\+" contained nextgroup=scalaClassSpecializer skipwhite
+syn region scalaDefSpecializer start="\[" end="\]" contained contains=scalaDefSpecializer
+syn region scalaClassSpecializer start="\[" end="\]" contained contains=scalaClassSpecializer
+
+" type constructor (actually anything with an uppercase letter)
+syn match scalaConstructor "\<[A-Z][_$a-zA-Z0-9]*\>" nextgroup=scalaConstructorSpecializer
+syn region scalaConstructorSpecializer start="\[" end="\]" contained contains=scalaConstructorSpecializer
+
+" method call
+syn match scalaRoot "\<[a-zA-Z][_$a-zA-Z0-9]*\."me=e-1
+syn match scalaMethodCall "\.[a-z][_$a-zA-Z0-9]*"ms=s+1
+
+" type declarations in val/var/def
+syn match scalaType ":\s*\(=>\s*\)\?[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)\?\(\s*\(<:\|>:\|#\|=>\)\s*[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)*\)*"ms=s+1
+
+" comments
+syn match scalaTodo "[tT][oO][dD][oO]" contained
+syn match scalaLineComment "//.*" contains=scalaTodo
+syn region scalaComment start="/\*" end="\*/" contains=scalaTodo
+syn case ignore
+syn include @scalaHtml syntax/html.vim
+unlet b:current_syntax
+syn case match
+syn region scalaDocComment start="/\*\*" end="\*/" contains=scalaDocTags,scalaTodo,@scalaHtml keepend
+syn region scalaDocTags start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" contained
+syn match scalaDocTags "@[a-z]\+" contained
+
+syn match scalaEmptyString "\"\""
+
+" multi-line string literals
+syn region scalaMultiLineString start="\"\"\"" end="\"\"\"" contains=scalaUnicode
+syn match scalaUnicode "\\u[0-9a-fA-F]\{4}" contained
+
+" string literals with escapes
+syn region scalaString start="\"[^"]" skip="\\\"" end="\"" contains=scalaStringEscape " TODO end \n or not?
+syn match scalaStringEscape "\\u[0-9a-fA-F]\{4}" contained
+syn match scalaStringEscape "\\[nrfvb\\\"]" contained
+
+" symbol and character literals
+syn match scalaSymbol "'[_a-zA-Z0-9][_a-zA-Z0-9]*\>"
+syn match scalaChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'"
+
+" number literals
+syn match scalaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
+syn match scalaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
+syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
+syn match scalaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
+
+" xml literals
+syn match scalaXmlTag "<[a-zA-Z]\_[^>]*/>" contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString
+syn region scalaXmlString start="\"" end="\"" contained
+syn match scalaXmlStart "<[a-zA-Z]\_[^>]*>" contained contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString
+syn region scalaXml start="<\([a-zA-Z]\_[^>]*\_[^/]\|[a-zA-Z]\)>" matchgroup=scalaXmlStart end="</\_[^>]\+>" contains=scalaXmlEscape,scalaXmlQuote,scalaXml,scalaXmlStart,scalaXmlComment
+syn region scalaXmlEscape matchgroup=scalaXmlEscapeSpecial start="{" matchgroup=scalaXmlEscapeSpecial end="}" contained contains=TOP
+syn match scalaXmlQuote "&[^;]\+;" contained
+syn match scalaXmlComment "<!--\_[^>]*-->" contained
+
+syn sync fromstart
+
+" map Scala groups to standard groups
+hi link scalaKeyword Keyword
+hi link scalaPackage Include
+hi link scalaImport Include
+hi link scalaBoolean Boolean
+hi link scalaOperator Normal
+hi link scalaNumber Number
+hi link scalaEmptyString String
+hi link scalaString String
+hi link scalaChar String
+hi link scalaMultiLineString String
+hi link scalaStringEscape Special
+hi link scalaSymbol Special
+hi link scalaUnicode Special
+hi link scalaComment Comment
+hi link scalaLineComment Comment
+hi link scalaDocComment Comment
+hi link scalaDocTags Special
+hi link scalaTodo Todo
+hi link scalaType Type
+hi link scalaTypeSpecializer scalaType
+hi link scalaXml String
+hi link scalaXmlTag Include
+hi link scalaXmlString String
+hi link scalaXmlStart Include
+hi link scalaXmlEscape Normal
+hi link scalaXmlEscapeSpecial Special
+hi link scalaXmlQuote Special
+hi link scalaXmlComment Comment
+hi link scalaDef Keyword
+hi link scalaVar Keyword
+hi link scalaVal Keyword
+hi link scalaClass Keyword
+hi link scalaObject Keyword
+hi link scalaTrait Keyword
+hi link scalaDefName Function
+hi link scalaDefSpecializer Function
+hi link scalaClassName Special
+hi link scalaClassSpecializer Special
+hi link scalaConstructor Special
+hi link scalaConstructorSpecializer scalaConstructor
+
+let b:current_syntax = "scala"
+
+" you might like to put these lines in your .vimrc
+"
+" customize colors a little bit (should be a different file)
+" hi scalaNew gui=underline
+" hi scalaMethodCall gui=italic
+" hi scalaValName gui=underline
+" hi scalaVarName gui=underline
diff --git a/vim/syntax/scss.vim b/vim/syntax/scss.vim
new file mode 100644 (file)
index 0000000..6fb9691
--- /dev/null
@@ -0,0 +1,20 @@
+" Vim syntax file
+" Language:    SCSS
+" Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:   *.scss
+" Last Change: 2010 Jul 26
+
+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/sass.vim
+
+syn match scssComment "//.*" contains=sassTodo,@Spell
+syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell
+
+hi def link scssComment sassComment
+
+let b:current_syntax = "scss"
+
+" vim:set sw=2:
diff --git a/vim/syntax/snippet.vim b/vim/syntax/snippet.vim
new file mode 100644 (file)
index 0000000..3aa8571
--- /dev/null
@@ -0,0 +1,19 @@
+" Syntax highlighting for snippet files (used for snipMate.vim)
+" Hopefully this should make snippets a bit nicer to write!
+syn match snipComment '^#.*'
+syn match placeHolder '\${\d\+\(:.\{-}\)\=}' contains=snipCommand
+syn match tabStop '\$\d\+'
+syn match snipCommand '[^\\]`.\{-}`'
+syn match snippet '^snippet.*' transparent contains=multiSnipText,snipKeyword
+syn match multiSnipText '\S\+ \zs.*' contained
+syn match snipKeyword '^snippet'me=s+8 contained
+syn match snipError "^[^#s\t].*$"
+
+hi link snipComment   Comment
+hi link multiSnipText String
+hi link snipKeyword   Keyword
+hi link snipComment   Comment
+hi link placeHolder   Special
+hi link tabStop       Special
+hi link snipCommand   String
+hi link snipError     Error
diff --git a/vim/syntax/tagbar.vim b/vim/syntax/tagbar.vim
new file mode 100644 (file)
index 0000000..49b2ddc
--- /dev/null
@@ -0,0 +1,63 @@
+" File:        tagbar.vim
+" Description: Tagbar syntax settings
+" Author:      Jan Larres <jan@majutsushi.net>
+" Licence:     Vim licence
+" Website:     http://majutsushi.github.com/tagbar/
+" Version:     2.3
+
+scriptencoding utf-8
+
+if exists("b:current_syntax")
+  finish
+endif
+
+let s:ic = g:tagbar_iconchars[0]
+if s:ic =~ '[]^\\-]'
+    let s:ic = '\' . s:ic
+endif
+let s:io = g:tagbar_iconchars[1]
+if s:io =~ '[]^\\-]'
+    let s:io = '\' . s:io
+endif
+
+let s:pattern = '\([' . s:ic . s:io . '] \)\@<=[^-+: ]\+[^:]\+$'
+execute "syntax match TagbarKind '" . s:pattern . "'"
+
+let s:pattern = '\([' . s:ic . s:io . '][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
+execute "syntax match TagbarScope '" . s:pattern . "'"
+
+let s:pattern = '[' . s:ic . s:io . ']\([-+# ]\)\@='
+execute "syntax match TagbarFoldIcon '" . s:pattern . "'"
+
+let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=+\([^-+# ]\)\@='
+execute "syntax match TagbarAccessPublic '" . s:pattern . "'"
+let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=#\([^-+# ]\)\@='
+execute "syntax match TagbarAccessProtected '" . s:pattern . "'"
+let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=-\([^-+# ]\)\@='
+execute "syntax match TagbarAccessPrivate '" . s:pattern . "'"
+
+unlet s:pattern
+
+syntax match TagbarNestedKind '^\s\+\[[^]]\+\]$'
+syntax match TagbarComment    '^".*'
+syntax match TagbarType       ' : \zs.*'
+syntax match TagbarSignature  '(.*)'
+syntax match TagbarPseudoID   '\*\ze :'
+
+highlight default link TagbarComment    Comment
+highlight default link TagbarKind       Identifier
+highlight default link TagbarNestedKind TagbarKind
+highlight default link TagbarScope      Title
+highlight default link TagbarType       Type
+highlight default link TagbarSignature  SpecialKey
+highlight default link TagbarPseudoID   NonText
+highlight default link TagbarFoldIcon   Statement
+highlight default link TagbarHighlight  Search
+
+highlight default TagbarAccessPublic    guifg=Green ctermfg=Green
+highlight default TagbarAccessProtected guifg=Blue  ctermfg=Blue
+highlight default TagbarAccessPrivate   guifg=Red   ctermfg=Red
+
+let b:current_syntax = "tagbar"
+
+" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
diff --git a/vim/syntax/textile.vim b/vim/syntax/textile.vim
new file mode 100644 (file)
index 0000000..48a5d65
--- /dev/null
@@ -0,0 +1,87 @@
+"
+"   You will have to restart vim for this to take effect.  In any case
+"   it is a good idea to read ":he new-filetype" so that you know what
+"   is going on, and why the above lines work.
+"
+"   Written originally by Dominic Mitchell, Jan 2006.
+"   happygiraffe.net
+"
+"   Modified by Aaron Bieber, May 2007.
+"   blog.aaronbieber.com
+"
+"   Modified by Tim Harper, July 2008 - current
+"   tim.theenchanter.com
+" @(#) $Id$
+
+if version < 600
+    syntax clear
+elseif exists("b:current_syntax")
+    finish
+endif
+
+" Textile commands like "h1" are case sensitive, AFAIK.
+syn case match
+
+" Textile syntax: <http://textism.com/tools/textile/>
+
+" Inline elements.
+syn match txtEmphasis    /_[^_]\+_/
+syn match txtBold        /\*[^*]\+\*/
+syn match txtCite        /??.\+??/
+syn match txtDeleted     /-[^-]\+-/
+syn match txtInserted    /+[^+]\++/
+syn match txtSuper       /\^[^^]\+\^/
+syn match txtSub         /\~[^~]\+\~/
+syn match txtSpan        /%[^%]\+%/
+syn match txtFootnoteRef /\[[0-9]\+]/
+syn match txtCode        /@[^@]\+@/
+
+" Block elements.
+syn match txtHeader      /^h1\. .\+/
+syn match txtHeader2     /^h2\. .\+/
+syn match txtHeader3     /^h[3-6]\..\+/
+syn match txtBlockquote  /^bq\./
+syn match txtFootnoteDef /^fn[0-9]\+\./
+syn match txtListBullet  /\v^\*+ /
+syn match txtListBullet2  /\v^(\*\*)+ /
+syn match txtListNumber  /\v^#+ /
+syn match txtListNumber2  /\v^(##)+ /
+
+syn cluster txtBlockElement contains=txtHeader,txtBlockElement,txtFootnoteDef,txtListBullet,txtListNumber
+
+
+" Everything after the first colon is from RFC 2396, with extra
+" backslashes to keep vim happy...  Original:
+" ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
+"
+" Revised the pattern to exclude spaces from the URL portion of the
+" pattern. Aaron Bieber, 2007.
+syn match txtLink /"[^"]\+":\(\([^:\/?# ]\+\):\)\?\(\/\/\([^\/?# ]*\)\)\?\([^?# ]*\)\(?\([^# ]*\)\)\?\(#\([^ ]*\)\)\?/
+
+syn cluster txtInlineElement contains=txtEmphasis,txtBold,txtCite,txtDeleted,txtInserted,txtSuper,txtSub,txtSpan
+
+if version >= 508 || !exists("did_txt_syn_inits")
+    if version < 508
+        let did_txt_syn_inits = 1
+        command -nargs=+ HiLink hi link <args>
+    else
+        command -nargs=+ HiLink hi def link <args>
+    endif
+
+    HiLink txtHeader Title
+    HiLink txtHeader2 Question
+    HiLink txtHeader3 Statement
+    HiLink txtBlockquote Comment
+    HiLink txtListBullet Operator
+    HiLink txtListBullet2 Constant
+    HiLink txtListNumber Operator
+    HiLink txtListNumber2 Constant
+    HiLink txtLink String
+    HiLink txtCode Identifier
+    hi def txtEmphasis term=underline cterm=underline gui=italic
+    hi def txtBold term=bold cterm=bold gui=bold
+
+    delcommand HiLink
+endif
+
+" vim: set ai et sw=4 :
diff --git a/vim/syntax/vim-rspec.vim b/vim/syntax/vim-rspec.vim
new file mode 100644 (file)
index 0000000..4f063a2
--- /dev/null
@@ -0,0 +1,17 @@
+syntax match rspecHeader /^*/
+syntax match rspecTitle /^\[.\+/
+syntax match rspecOk /^+.\+/
+syntax match rspecError /^-.\+/
+syntax match rspecErrorDetail /^  \w.\+/
+syntax match rspecErrorURL /^  \/.\+/
+syntax match rspecNotImplemented /^#.\+/
+syntax match rspecCode /^  \d\+:/
+
+highlight link rspecHeader Type 
+highlight link rspecTitle Identifier 
+highlight link rspecOk    Tag
+highlight link rspecError Error
+highlight link rspecErrorDetail Constant
+highlight link rspecErrorURL PreProc
+highlight link rspecNotImplemented Todo
+highlight link rspecCode Type 
diff --git a/vim/syntax_checkers/applescript.vim b/vim/syntax_checkers/applescript.vim
new file mode 100644 (file)
index 0000000..eb7a6f2
--- /dev/null
@@ -0,0 +1,43 @@
+"==============================================================================
+"       FileName: applescript.vim
+"           Desc: Syntax checking plugin for syntastic.vim
+"         Author: Zhao Cai
+"          Email: caizhaoff@gmail.com
+"        Version: 0.2.1
+"   Date Created: Thu 09 Sep 2011 10:30:09 AM EST 
+"  Last Modified: Fri 09 Dec 2011 01:10:24 PM EST 
+"
+"        History: 0.1.0 - working, but it will run the script everytime to check
+"                 syntax. Should use osacompile but strangely it does not give
+"                 errors.
+"
+"                 0.2.0 - switch to osacompile, it gives less errors compared
+"                 with osascript.
+"
+"                 0.2.1 - remove g:syntastic_applescript_tempfile. use
+"                 tempname() instead.
+"
+"        License: This program is free software. It comes without any
+"        warranty, to the extent permitted by applicable law. You can
+"        redistribute it and/or modify it under the terms of the Do What The
+"        Fuck You Want To Public License, Version 2, as published by Sam
+"        Hocevar.  See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists("loaded_applescript_syntax_checker")
+    finish
+endif
+let loaded_applescript_syntax_checker = 1
+
+"bail if the user doesnt have osacompile installed
+if !executable("osacompile")
+    finish
+endif
+
+function! SyntaxCheckers_applescript_GetLocList()
+    let makeprg = 'osacompile -o ' . tempname() . '.scpt '. shellescape(expand('%'))
+    let errorformat = '%f:%l:%m'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/c.vim b/vim/syntax_checkers/c.vim
new file mode 100644 (file)
index 0000000..8bd486b
--- /dev/null
@@ -0,0 +1,156 @@
+"============================================================================
+"File:        c.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+" In order to also check header files add this to your .vimrc:
+" (this usually creates a .gch file in your source directory)
+"
+"   let g:syntastic_c_check_header = 1
+"
+" To disable the search of included header files after special
+" libraries like gtk and glib add this line to your .vimrc:
+"
+"   let g:syntastic_c_no_include_search = 1
+"
+" To enable header files being re-checked on every file write add the
+" following line to your .vimrc. Otherwise the header files are checked only
+" one time on initially loading the file.
+" In order to force syntastic to refresh the header includes simply
+" unlet b:syntastic_c_includes. Then the header files are being re-checked on
+" the next file write.
+"
+"   let g:syntastic_c_auto_refresh_includes = 1
+"
+" Alternatively you can set the buffer local variable b:syntastic_c_cflags.
+" If this variable is set for the current buffer no search for additional
+" libraries is done. I.e. set the variable like this:
+"
+"   let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4'
+"
+" In order to add some custom include directories that should be added to the
+" gcc command line you can add those to the global variable
+" g:syntastic_c_include_dirs. This list can be used like this:
+"
+"   let g:syntastic_c_include_dirs = [ 'includes', 'headers' ]
+"
+" Moreover it is possible to add additional compiler options to the syntax
+" checking execution via the variable 'g:syntastic_c_compiler_options':
+"
+"   let g:syntastic_c_compiler_options = ' -ansi'
+"
+" Using the global variable 'g:syntastic_c_remove_include_errors' you can
+" specify whether errors of files included via the g:syntastic_c_include_dirs'
+" setting are removed from the result set:
+"
+"   let g:syntastic_c_remove_include_errors = 1
+
+if exists('loaded_c_syntax_checker')
+    finish
+endif
+let loaded_c_syntax_checker = 1
+
+if !executable('gcc')
+    finish
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" default include directories
+let s:default_includes = [ '.', '..', 'include', 'includes',
+            \ '../include', '../includes' ]
+
+" uniquify the input list
+function! s:Unique(list)
+    let l = []
+    for elem in a:list
+        if index(l, elem) == -1
+            let l = add(l, elem)
+        endif
+    endfor
+    return l
+endfunction
+
+" get the gcc include directory argument depending on the default
+" includes and the optional user-defined 'g:syntastic_c_include_dirs'
+function! s:GetIncludeDirs()
+    let include_dirs = s:default_includes
+
+    if exists('g:syntastic_c_include_dirs')
+        call extend(include_dirs, g:syntastic_c_include_dirs)
+    endif
+
+    return join(map(s:Unique(include_dirs), '"-I" . v:val'), ' ')
+endfunction
+
+function! SyntaxCheckers_c_GetLocList()
+    let makeprg = 'gcc -fsyntax-only -std=gnu99 '.shellescape(expand('%')).
+               \ ' '.s:GetIncludeDirs()
+    let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
+               \ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '.
+               \ 'each function it appears%.%#,%-GIn file included%.%#,'.
+               \ '%-G %#from %f:%l\,,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %m'
+
+    " determine whether to parse header files as well
+    if expand('%') =~? '.h$'
+        if exists('g:syntastic_c_check_header')
+            let makeprg = 'gcc -c '.shellescape(expand('%')).
+                        \ ' '.s:GetIncludeDirs()
+        else
+            return []
+        endif
+    endif
+
+    " add optional user-defined compiler options
+    if exists('g:syntastic_c_compiler_options')
+        let makeprg .= g:syntastic_c_compiler_options
+    endif
+
+    " check if the user manually set some cflags
+    if !exists('b:syntastic_c_cflags')
+        " check whether to search for include files at all
+        if !exists('g:syntastic_c_no_include_search') ||
+                    \ g:syntastic_c_no_include_search != 1
+            " refresh the include file search if desired
+            if exists('g:syntastic_c_auto_refresh_includes') &&
+                        \ g:syntastic_c_auto_refresh_includes != 0
+                let makeprg .= syntastic#c#SearchHeaders()
+            else
+                " search for header includes if not cached already
+                if !exists('b:syntastic_c_includes')
+                    let b:syntastic_c_includes = syntastic#c#SearchHeaders()
+                endif
+                let makeprg .= b:syntastic_c_includes
+            endif
+        endif
+    else
+        " use the user-defined cflags
+        let makeprg .= b:syntastic_c_cflags
+    endif
+
+    " process makeprg
+    let errors = SyntasticMake({ 'makeprg': makeprg,
+                \ 'errorformat': errorformat })
+
+    " filter the processed errors if desired
+    if exists('g:syntastic_c_remove_include_errors') &&
+                \ g:syntastic_c_remove_include_errors != 0
+        return filter(errors,
+                    \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
+    else
+        return errors
+    endif
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set et sts=4 sw=4:
diff --git a/vim/syntax_checkers/coffee.vim b/vim/syntax_checkers/coffee.vim
new file mode 100644 (file)
index 0000000..59dca75
--- /dev/null
@@ -0,0 +1,27 @@
+"============================================================================
+"File:        coffee.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Lincoln Stoll <l@lds.li>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_coffee_syntax_checker")
+    finish
+endif
+let loaded_coffee_syntax_checker = 1
+
+"bail if the user doesnt have coffee installed
+if !executable("coffee")
+    finish
+endif
+
+function! SyntaxCheckers_coffee_GetLocList()
+    let makeprg = 'coffee -c -l -o /tmp '.shellescape(expand('%'))
+    let errorformat =  'Syntax%trror: In %f\, %m on line %l,%EError: In %f\, Parse error on line %l: %m,%EError: In %f\, %m on line %l,%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G%.%#'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/cpp.vim b/vim/syntax_checkers/cpp.vim
new file mode 100644 (file)
index 0000000..1bacf93
--- /dev/null
@@ -0,0 +1,94 @@
+"============================================================================
+"File:        cpp.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+" in order to also check header files add this to your .vimrc:
+" (this usually creates a .gch file in your source directory)
+"
+"   let g:syntastic_cpp_check_header = 1
+"
+" To disable the search of included header files after special
+" libraries like gtk and glib add this line to your .vimrc:
+"
+"   let g:syntastic_cpp_no_include_search = 1
+"
+" To enable header files being re-checked on every file write add the
+" following line to your .vimrc. Otherwise the header files are checked only
+" one time on initially loading the file.
+" In order to force syntastic to refresh the header includes simply
+" unlet b:syntastic_cpp_includes. Then the header files are being re-checked
+" on the next file write.
+"
+"   let g:syntastic_cpp_auto_refresh_includes = 1
+"
+" Alternatively you can set the buffer local variable b:syntastic_cpp_cflags.
+" If this variable is set for the current buffer no search for additional
+" libraries is done. I.e. set the variable like this:
+"
+"   let b:syntastic_cpp_cflags = ' -I/usr/include/libsoup-2.4'
+"
+" Moreover it is possible to add additional compiler options to the syntax
+" checking execution via the variable 'g:syntastic_cpp_compiler_options':
+"
+"   let g:syntastic_cpp_compiler_options = ' -std=c++0x'
+
+if exists('loaded_cpp_syntax_checker')
+    finish
+endif
+let loaded_cpp_syntax_checker = 1
+
+if !executable('g++')
+    finish
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cpp_GetLocList()
+    let makeprg = 'g++ -fsyntax-only '.shellescape(expand('%'))
+    let errorformat =  '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
+
+    if expand('%') =~? '\%(.h\|.hpp\|.hh\)$'
+        if exists('g:syntastic_cpp_check_header')
+            let makeprg = 'g++ -c '.shellescape(expand('%'))
+        else
+            return []
+        endif
+    endif
+
+    if exists('g:syntastic_cpp_compiler_options')
+        let makeprg .= g:syntastic_cpp_compiler_options
+    endif
+
+    if !exists('b:syntastic_cpp_cflags')
+        if !exists('g:syntastic_cpp_no_include_search') ||
+                    \ g:syntastic_cpp_no_include_search != 1
+            if exists('g:syntastic_cpp_auto_refresh_includes') &&
+                        \ g:syntastic_cpp_auto_refresh_includes != 0
+                let makeprg .= syntastic#c#SearchHeaders()
+            else
+                if !exists('b:syntastic_cpp_includes')
+                    let b:syntastic_cpp_includes = syntastic#c#SearchHeaders()
+                endif
+                let makeprg .= b:syntastic_cpp_includes
+            endif
+        endif
+    else
+        let makeprg .= b:syntastic_cpp_cflags
+    endif
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set et sts=4 sw=4:
diff --git a/vim/syntax_checkers/css.vim b/vim/syntax_checkers/css.vim
new file mode 100644 (file)
index 0000000..99a16b8
--- /dev/null
@@ -0,0 +1,31 @@
+"============================================================================
+"File:        css.vim
+"Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net).
+"Maintainer:  Ory Band <oryband at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+if exists("loaded_css_syntax_checker")
+    finish
+endif
+let loaded_css_syntax_checker = 1
+
+" Bail if the user doesn't have `csslint` installed.
+if !executable("csslint")
+    finish
+endif
+
+function! SyntaxCheckers_css_GetLocList()
+    let makeprg = 'csslint --format=compact '.shellescape(expand('%'))
+
+    " Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
+    let errorformat = '%-G,%-G%f: lint free!,%f: line %l\, col %c\, %trror - %m,%f: line %l\, col %c\, %tarning - %m,%f: line %l\, col %c\, %m,'
+
+    return SyntasticMake({ 'makeprg': makeprg,
+                                \ 'errorformat': errorformat,
+                                \ 'defaults': {'bufnr': bufnr("")} })
+
+endfunction
diff --git a/vim/syntax_checkers/cucumber.vim b/vim/syntax_checkers/cucumber.vim
new file mode 100644 (file)
index 0000000..c9a87e1
--- /dev/null
@@ -0,0 +1,27 @@
+"============================================================================
+"File:        cucumber.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_cucumber_syntax_checker")
+    finish
+endif
+let loaded_cucumber_syntax_checker = 1
+
+"bail if the user doesnt have cucumber installed
+if !executable("cucumber")
+    finish
+endif
+
+function! SyntaxCheckers_cucumber_GetLocList()
+    let makeprg = 'cucumber --dry-run --quiet --strict --format pretty '.shellescape(expand('%'))
+    let errorformat =  '%f:%l:%c:%m,%W      %.%# (%m),%-Z%f:%l:%.%#,%-G%.%#'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/cuda.vim b/vim/syntax_checkers/cuda.vim
new file mode 100644 (file)
index 0000000..816505e
--- /dev/null
@@ -0,0 +1,37 @@
+"============================================================================
+"File:        cuda.vim
+"Description: Syntax checking plugin for syntastic.vim
+"
+"Author:      Hannes Schulz <schulz at ais dot uni-bonn dot de>
+"
+"============================================================================
+
+" in order to also check header files add this to your .vimrc:
+" (this creates an empty .syntastic_dummy.cu file in your source directory)
+"
+"   let g:syntastic_cuda_check_header = 1
+
+if exists('loaded_cuda_syntax_checker')
+    finish
+endif
+let loaded_cuda_syntax_checker = 1
+
+if !executable('nvcc')
+    finish
+endif
+
+function! SyntaxCheckers_cuda_GetLocList()
+    let makeprg = 'nvcc --cuda -O0 -I . -Xcompiler -fsyntax-only '.shellescape(expand('%')).' -o /dev/null'
+    "let errorformat =  '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
+    let errorformat =  '%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f'',%X%*\a[%*\d]: Leaving directory `%f'',%D%*\a: Entering directory `%f'',%X%*\a: Leaving directory `%f'',%DMaking %*\a in %f,%f|%l| %m'
+
+    if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$'
+        if exists('g:syntastic_cuda_check_header')
+            let makeprg = 'echo > .syntastic_dummy.cu ; nvcc --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include '.shellescape(expand('%')).' -o /dev/null'
+        else
+            return []
+        endif
+    endif
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/docbk.vim b/vim/syntax_checkers/docbk.vim
new file mode 100644 (file)
index 0000000..cd360e4
--- /dev/null
@@ -0,0 +1,29 @@
+"============================================================================
+"File:        docbk.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_docbk_syntax_checker")
+    finish
+endif
+let loaded_docbk_syntax_checker = 1
+
+"bail if the user doesnt have tidy or grep installed
+if !executable("xmllint")
+    finish
+endif
+
+function! SyntaxCheckers_docbk_GetLocList()
+
+    let makeprg="xmllint --xinclude --noout --postvalid ".shellescape(expand(%:p))
+    let errorformat='%E%f:%l: parser error : %m,%W%f:%l: parser warning : %m,%E%f:%l:%.%# validity error : %m,%W%f:%l:%.%# validity warning : %m,%-Z%p^,%-C%.%#,%-G%.%#'
+    let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+    return loclist
+endfunction
diff --git a/vim/syntax_checkers/efm_perl.pl b/vim/syntax_checkers/efm_perl.pl
new file mode 100644 (file)
index 0000000..570d6e7
--- /dev/null
@@ -0,0 +1,153 @@
+#!/usr/bin/perl -w
+
+# vimparse.pl - Reformats the error messages of the Perl interpreter for use
+# with the quickfix mode of Vim
+#
+# Copyright (ยฉ) 2001 by Jรถrg Ziefle <joerg.ziefle@gmx.de>
+# You may use and distribute this software under the same terms as Perl itself.
+#
+# Usage: put one of the two configurations below in your ~/.vimrc (without the
+# description and '# ') and enjoy (be sure to adjust the paths to vimparse.pl
+# before):
+#
+# Program is run interactively with 'perl -w':
+#
+# set makeprg=$HOME/bin/vimparse.pl\ %\ $*
+# set errorformat=%f:%l:%m
+#
+# Program is only compiled with 'perl -wc':
+#
+# set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $*
+# set errorformat=%f:%l:%m
+#
+# Usage:
+#      vimparse.pl [-c] [-f <errorfile>] <programfile> [programargs]
+#
+#              -c      compile only, don't run (perl -wc)
+#              -f      write errors to <errorfile>
+#
+# Example usages:
+#      * From the command line:
+#              vimparse.pl program.pl
+#
+#              vimparse.pl -c -f errorfile program.pl
+#              Then run vim -q errorfile to edit the errors with Vim.
+#
+#      * From Vim:
+#              Edit in Vim (and save, if you don't have autowrite on), then
+#              type ':mak' or ':mak args' (args being the program arguments)
+#              to error check.
+#
+# Version history:
+#      0.2 (04/12/2001):
+#              * First public version (sent to Bram)
+#              * -c command line option for compiling only
+#              * grammatical fix: 'There was 1 error.'
+#              * bug fix for multiple arguments
+#              * more error checks
+#              * documentation (top of file, &usage)
+#              * minor code clean ups
+#      0.1 (02/02/2001):
+#              * Initial version
+#              * Basic functionality
+#
+# Todo:
+#      * test on more systems
+#      * use portable way to determine the location of perl ('use Config')
+#      * include option that shows perldiag messages for each error
+#      * allow to pass in program by STDIN
+#      * more intuitive behaviour if no error is found (show message)
+#
+# Tested under SunOS 5.7 with Perl 5.6.0.  Let me know if it's not working for
+# you.
+
+use strict;
+use Getopt::Std;
+
+use vars qw/$opt_c $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars'
+
+use constant VERSION => 0.2;
+
+getopts('cf:h');
+
+&usage if $opt_h; # not necessarily needed, but good for further extension
+
+if (defined $opt_f) {
+
+    open FILE, "> $opt_f" or do {
+       warn "Couldn't open $opt_f: $!.  Using STDOUT instead.\n";
+       undef $opt_f;
+    };
+
+};
+
+my $handle = (defined $opt_f ? \*FILE : \*STDOUT);
+
+(my $file = shift) or &usage; # display usage if no filename is supplied
+my $args = (@ARGV ? ' ' . join ' ', @ARGV : '');
+
+my @lines = `perl @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`;
+
+my $errors = 0;
+foreach my $line (@lines) {
+
+    chomp($line);
+    my ($file, $lineno, $message, $rest);
+
+    if ($line =~ /^(.*)\sat\s(.*)\sline\s(\d+)(\.|,\snear\s\".*\")$/) {
+
+       ($message, $file, $lineno, $rest) = ($1, $2, $3, $4);
+       $errors++;
+       $message .= $rest if ($rest =~ s/^,//);
+       print $handle "$file:$lineno:$message\n";
+
+    } else { next };
+
+}
+
+if (defined $opt_f) {
+
+    my $msg;
+    if ($errors == 1) {
+
+       $msg = "There was 1 error.\n";
+
+    } else {
+
+       $msg = "There were $errors errors.\n";
+
+    };
+
+    print STDOUT $msg;
+    close FILE;
+    unlink $opt_f unless $errors;
+
+};
+
+sub usage {
+
+    (local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program
+    print<<EOT;
+Usage:
+       $0 [-c] [-f <errorfile>] <programfile> [programargs]
+
+               -c      compile only, don't run (executes 'perl -wc')
+               -f      write errors to <errorfile>
+
+Examples:
+       * At the command line:
+               $0 program.pl
+               Displays output on STDOUT.
+
+               $0 -c -f errorfile program.pl
+               Then run 'vim -q errorfile' to edit the errors with Vim.
+
+       * In Vim:
+               Edit in Vim (and save, if you don't have autowrite on), then
+               type ':mak' or ':mak args' (args being the program arguments)
+               to error check.
+EOT
+
+    exit 0;
+
+};
diff --git a/vim/syntax_checkers/erlang.vim b/vim/syntax_checkers/erlang.vim
new file mode 100644 (file)
index 0000000..d7dceae
--- /dev/null
@@ -0,0 +1,42 @@
+"============================================================================
+"File:        erlang.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Pawel Salata <rockplayer.pl at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_erlang_syntax_checker")
+    finish
+endif
+let loaded_erlang_syntax_checker = 1
+
+"bail if the user doesnt have escript installed
+if !executable("escript")
+    finish
+endif
+
+let s:check_file = expand('<sfile>:p:h') . '/erlang_check_file.erl'
+
+function! SyntaxCheckers_erlang_GetLocList()
+    let extension = expand('%:e')
+    if match(extension, 'hrl') >= 0
+        return []
+    endif
+    let shebang = getbufline(bufnr('%'), 1)[0]
+    if len(shebang) > 0
+        if match(shebang, 'escript') >= 0
+            let makeprg = 'escript -s '.shellescape(expand('%:p'))
+        else
+            let makeprg = s:check_file . ' '. shellescape(expand('%:p'))
+        endif
+    else
+        let makeprg =  s:check_file . ' ' . shellescape(expand('%:p'))
+    endif
+    let errorformat = '%f:%l:\ %tarning:\ %m,%E%f:%l:\ %m'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/erlang_check_file.erl b/vim/syntax_checkers/erlang_check_file.erl
new file mode 100755 (executable)
index 0000000..8a85bf6
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env escript
+-export([main/1]).
+
+main([FileName]) ->
+    compile:file(FileName, [warn_obsolete_guard,
+                            warn_unused_import,
+                            warn_shadow_vars,
+                            warn_export_vars,
+                            strong_validation,
+                            report,
+                            {i, filename:dirname(FileName) ++ "/../include"}
+                        ]).
diff --git a/vim/syntax_checkers/eruby.vim b/vim/syntax_checkers/eruby.vim
new file mode 100644 (file)
index 0000000..fcff063
--- /dev/null
@@ -0,0 +1,34 @@
+"============================================================================
+"File:        eruby.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_eruby_syntax_checker")
+    finish
+endif
+let loaded_eruby_syntax_checker = 1
+
+"bail if the user doesnt have ruby or cat installed
+if !executable("ruby") || !executable("cat")
+    finish
+endif
+
+function! SyntaxCheckers_eruby_GetLocList()
+    if has('win32') || has('win64')
+        let makeprg='sed "s/<\%=/<\%/g" '. shellescape(expand("%")) . ' \| ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| ruby -c'
+    else
+        let makeprg='sed "s/<\%=/<\%/g" '. shellescape(expand("%")) . ' \| RUBYOPT= ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| RUBYOPT= ruby -c'
+    endif
+
+    let errorformat='%-GSyntax OK,%E-:%l: syntax error\, %m,%Z%p^,%W-:%l: warning: %m,%Z%p^,%-C%.%#'
+    return SyntasticMake({ 'makeprg': makeprg,
+                         \ 'errorformat': errorformat,
+                         \ 'defaults': {'bufnr': bufnr("")} })
+
+endfunction
diff --git a/vim/syntax_checkers/fortran.vim b/vim/syntax_checkers/fortran.vim
new file mode 100644 (file)
index 0000000..ee176f2
--- /dev/null
@@ -0,0 +1,44 @@
+"============================================================================
+"File:        fortran.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Karl Yngve Lervรฅg <karl.yngve@lervag.net>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"Note:        This syntax checker uses gfortran with the option -fsyntax-only
+"             to check for errors and warnings. Additional flags may be
+"             supplied through both local and global variables,
+"               b:syntastic_fortran_flags,
+"               g:syntastic_fortran_flags.
+"             This is particularly useful when the source requires module files
+"             in order to compile (that is when it needs modules defined in
+"             separate files).
+"
+"============================================================================
+
+if exists("loaded_fortran_syntax_checker")
+    finish
+endif
+let loaded_fortran_syntax_checker = 1
+
+"bail if the user doesnt have fortran installed
+if !executable("gfortran")
+    finish
+endif
+
+if !exists('g:syntastic_fortran_flags')
+    let g:syntastic_fortran_flags = ''
+endif
+
+function! SyntaxCheckers_fortran_GetLocList()
+    let makeprg  = 'gfortran -fsyntax-only'
+    let makeprg .= g:syntastic_fortran_flags
+    if exists('b:syntastic_fortran_flags')
+        let makeprg .= b:syntastic_fortran_flags
+    endif
+    let makeprg .= ' ' . shellescape(expand('%'))
+    let errorformat = '%-C %#,%-C  %#%.%#,%A%f:%l.%c:,%Z%m,%G%.%#'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/gentoo_metadata.vim b/vim/syntax_checkers/gentoo_metadata.vim
new file mode 100644 (file)
index 0000000..d016a88
--- /dev/null
@@ -0,0 +1,37 @@
+"============================================================================
+"File:        gentoo-metadata.vim
+"Description: Syntax checking plugin for Gentoo's metadata.xml files
+"Maintainer:  James Rowe <jnrowe at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+" The DTDs required to validate metadata.xml files are available in
+" $PORTDIR/metadata/dtd, and these local files can be used to significantly
+" speed up validation.  You can create a catalog file with:
+"
+"   xmlcatalog --create --add rewriteURI http://www.gentoo.org/dtd/ \
+"       ${PORTDIR:-/usr/portage}/metadata/dtd/ /etc/xml/gentoo
+"
+" See xmlcatalog(1) and http://www.xmlsoft.org/catalog.html for more
+" information.
+
+if exists("loaded_gentoo_metadata_syntax_checker")
+    finish
+endif
+let loaded_gentoo_metadata_syntax_checker = 1
+
+"bail if the user doesn't have xmllint installed
+if !executable("xmllint")
+    finish
+endif
+
+runtime syntax_checkers/xml.vim
+
+function! SyntaxCheckers_gentoo_metadata_GetLocList()
+    return SyntaxCheckers_xml_GetLocList()
+endfunction
diff --git a/vim/syntax_checkers/go.vim b/vim/syntax_checkers/go.vim
new file mode 100644 (file)
index 0000000..395ae11
--- /dev/null
@@ -0,0 +1,22 @@
+"============================================================================
+"File:        go.vim
+"Description: Loads a go syntax checker from the go directory
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" Use g:syntastic_go_checker option to specify which go executable
+" should be used (see below for a list of supported checkers).
+" If g:syntastic_go_checker is not set, just use the first syntax
+" checker that we find installed.
+"============================================================================
+if exists("loaded_go_syntax_checker")
+    finish
+endif
+let loaded_go_syntax_checker = 1
+
+let s:supported_checkers = ["6g", "gofmt"]
+call SyntasticLoadChecker(s:supported_checkers)
diff --git a/vim/syntax_checkers/go/6g.vim b/vim/syntax_checkers/go/6g.vim
new file mode 100644 (file)
index 0000000..1a4249e
--- /dev/null
@@ -0,0 +1,17 @@
+"============================================================================
+"File:        6g.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Sam Nguyen <samxnguyen@gmail.com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+function! SyntaxCheckers_go_GetLocList()
+    let makeprg = '6g -o /dev/null %'
+    let errorformat = '%E%f:%l: %m'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/go/gofmt.vim b/vim/syntax_checkers/go/gofmt.vim
new file mode 100644 (file)
index 0000000..77abe7e
--- /dev/null
@@ -0,0 +1,16 @@
+"============================================================================
+"File:        gofmt.vim
+"Description: Check go syntax using gofmt
+"Maintainer:  Brandon Thomson <bt@brandonthomson.com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+function! SyntaxCheckers_go_GetLocList()
+    let makeprg = 'gofmt %'
+    let errorformat = '%f:%l:%c: %m,%-G%.%#'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} })
+endfunction
diff --git a/vim/syntax_checkers/haml.vim b/vim/syntax_checkers/haml.vim
new file mode 100644 (file)
index 0000000..b9ad6ad
--- /dev/null
@@ -0,0 +1,26 @@
+"============================================================================
+"File:        haml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_haml_syntax_checker")
+    finish
+endif
+let loaded_haml_syntax_checker = 1
+
+"bail if the user doesnt have the haml binary installed
+if !executable("haml")
+    finish
+endif
+
+function! SyntaxCheckers_haml_GetLocList()
+    let makeprg = "haml -c " . shellescape(expand("%"))
+    let errorformat = 'Haml error on line %l: %m,Syntax error on line %l: %m,%-G%.%#'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/haskell.vim b/vim/syntax_checkers/haskell.vim
new file mode 100644 (file)
index 0000000..07c55e8
--- /dev/null
@@ -0,0 +1,37 @@
+"============================================================================
+"File:        haskell.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Anthony Carapetis <anthony.carapetis at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_haskell_syntax_checker")
+    finish
+endif
+let loaded_haskell_syntax_checker = 1
+
+"bail if the user doesnt have ghc-mod installed
+if !executable("ghc-mod")
+    finish
+endif
+
+function! SyntaxCheckers_haskell_GetLocList()
+    let makeprg =
+          \ "{ ".
+          \ "ghc-mod check ". shellescape(expand('%')) . "; " .
+          \ "ghc-mod lint " . shellescape(expand('%')) . ";" .
+          \ " }"
+    let errorformat = '%-G\\s%#,%f:%l:%c:%trror: %m,%f:%l:%c:%tarning: %m,'.
+                \ '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c:%m,'.
+                \ '%E%f:%l:%c:,%Z%m,'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
+
+function! SyntaxCheckers_lhaskell_GetLocList()
+    return SyntaxCheckers_haskell_GetLocList()
+endfunction
diff --git a/vim/syntax_checkers/haxe.vim b/vim/syntax_checkers/haxe.vim
new file mode 100644 (file)
index 0000000..22183ee
--- /dev/null
@@ -0,0 +1,55 @@
+"============================================================================
+"File:        haxe.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  David Bernard <david.bernard.31 at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_haxe_syntax_checker")
+    finish
+endif
+let loaded_haxe_syntax_checker = 1
+
+"bail if the user doesn't have haxe installed
+if !executable("haxe")
+    finish
+endif
+
+" s:FindInParent
+" find the file argument and returns the path to it.
+" Starting with the current working dir, it walks up the parent folders
+" until it finds the file, or it hits the stop dir.
+" If it doesn't find it, it returns "Nothing"
+function! s:FindInParent(fln,flsrt,flstp)
+    let here = a:flsrt
+    while ( strlen( here) > 0 )
+        let p = split(globpath(here, a:fln), '\n')
+        if len(p) > 0
+            return ['ok', here, fnamemodify(p[0], ':p:t')]
+        endif
+        let fr = match(here, '/[^/]*$')
+        if fr == -1
+            break
+        endif
+        let here = strpart(here, 0, fr)
+        if here == a:flstp
+            break
+        endif
+    endwhile
+    return ['fail', '', '']
+endfunction
+
+function! SyntaxCheckers_haxe_GetLocList()
+    let [success, hxmldir, hxmlname] = s:FindInParent('*.hxml', expand('%:p:h'), '/')
+    if success == 'ok'
+        let makeprg = 'cd ' . hxmldir . '; haxe ' . hxmlname
+        let errorformat = '%E%f:%l: characters %c-%*[0-9] : %m'
+        return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+    else
+        return SyntasticMake({})
+    endif
+endfunction
diff --git a/vim/syntax_checkers/html.vim b/vim/syntax_checkers/html.vim
new file mode 100644 (file)
index 0000000..2c1b8b4
--- /dev/null
@@ -0,0 +1,86 @@
+"============================================================================
+"File:        html.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_html_syntax_checker")
+    finish
+endif
+let loaded_html_syntax_checker = 1
+
+"bail if the user doesnt have tidy or grep installed
+if !executable("tidy") || !executable("grep")
+    finish
+endif
+
+" TODO: join this with xhtml.vim for DRY's sake?
+function! s:TidyEncOptByFenc()
+    let tidy_opts = {
+                \'utf-8'       : '-utf8',
+                \'ascii'       : '-ascii',
+                \'latin1'      : '-latin1',
+                \'iso-2022-jp' : '-iso-2022',
+                \'cp1252'      : '-win1252',
+                \'macroman'    : '-mac',
+                \'utf-16le'    : '-utf16le',
+                \'utf-16'      : '-utf16',
+                \'big5'        : '-big5',
+                \'sjis'        : '-shiftjis',
+                \'cp850'       : '-ibm858',
+                \}
+    return get(tidy_opts, &fileencoding, '-utf8')
+endfunction
+
+let s:ignore_html_errors = [
+                \ "<table> lacks \"summary\" attribute",
+                \ "not approved by W3C",
+                \ "attribute \"placeholder\"",
+                \ "<meta> proprietary attribute \"charset\"",
+                \ "<meta> lacks \"content\" attribute",
+                \ "inserting \"type\" attribute",
+                \ "proprietary attribute \"data-"
+                \]
+
+function! s:ValidateError(text)
+    let valid = 0
+    for i in s:ignore_html_errors
+        if stridx(a:text, i) != -1
+            let valid = 1
+            break
+        endif
+    endfor
+    return valid
+endfunction
+
+
+function! SyntaxCheckers_html_GetLocList()
+
+    let encopt = s:TidyEncOptByFenc()
+    let makeprg="tidy ".encopt." --new-blocklevel-tags ".shellescape('section, article, aside, hgroup, header, footer, nav, figure, figcaption')." --new-inline-tags ".shellescape('video, audio, embed, mark, progress, meter, time, ruby, rt, rp, canvas, command, details, datalist')." --new-empty-tags ".shellescape('wbr, keygen')." -e ".shellescape(expand('%'))." 2>&1"
+    let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#'
+    let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+    " process loclist since we need to add some info and filter out valid HTML5
+    " from the errors
+    let n = len(loclist) - 1
+    let bufnum = bufnr("")
+    while n >= 0
+        let i = loclist[n]
+        " filter out valid HTML5
+        if s:ValidateError(i['text']) == 1
+            unlet loclist[n]
+        else
+            "the file name isnt in the output so stick in the buf num manually
+            let i['bufnr'] = bufnum
+        endif
+        let n -= 1
+    endwhile
+
+    return loclist
+endfunction
diff --git a/vim/syntax_checkers/javascript.vim b/vim/syntax_checkers/javascript.vim
new file mode 100644 (file)
index 0000000..026c737
--- /dev/null
@@ -0,0 +1,23 @@
+"============================================================================
+"File:        javascript.vim
+"Description: Figures out which javascript syntax checker (if any) to load
+"             from the javascript directory.
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" Use g:syntastic_javascript_checker option to specify which jslint executable
+" should be used (see below for a list of supported checkers).
+" If g:syntastic_javascript_checker is not set, just use the first syntax
+" checker that we find installed.
+"============================================================================
+if exists("loaded_javascript_syntax_checker")
+    finish
+endif
+let loaded_javascript_syntax_checker = 1
+
+let s:supported_checkers = ["gjslint", "jslint", "jsl", "jshint"]
+call SyntasticLoadChecker(s:supported_checkers)
diff --git a/vim/syntax_checkers/javascript/gjslint.vim b/vim/syntax_checkers/javascript/gjslint.vim
new file mode 100644 (file)
index 0000000..05e1c0f
--- /dev/null
@@ -0,0 +1,20 @@
+"============================================================================
+"File:        gjslint.vim
+"Description: Javascript syntax checker - using gjslint
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+if !exists("g:syntastic_javascript_gjslint_conf")
+    let g:syntastic_javascript_gjslint_conf = ""
+endif
+
+function! SyntaxCheckers_javascript_GetLocList()
+    let makeprg = "gjslint " . g:syntastic_javascript_gjslint_conf . " --nosummary --unix_mode --nodebug_indentation --nobeep " . shellescape(expand('%'))
+    let errorformat="%f:%l:(New Error -%\\?\%n) %m,%f:%l:(-%\\?%n) %m,%-G1 files checked, no errors found.,%-G%.%#"
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
+
diff --git a/vim/syntax_checkers/javascript/jshint.vim b/vim/syntax_checkers/javascript/jshint.vim
new file mode 100644 (file)
index 0000000..164b7bd
--- /dev/null
@@ -0,0 +1,21 @@
+"============================================================================
+"File:        jshint.vim
+"Description: Javascript syntax checker - using jshint
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+if !exists("g:syntastic_javascript_jshint_conf")
+    let g:syntastic_javascript_jshint_conf = ""
+endif
+
+function! SyntaxCheckers_javascript_GetLocList()
+    " node-jshint uses .jshintrc as config unless --config arg is present
+    let args = !empty(g:syntastic_javascript_jshint_conf) ? ' --config ' . g:syntastic_javascript_jshint_conf : ''
+    let makeprg = 'jshint ' . shellescape(expand("%")) . args
+    let errorformat = '%ELine %l:%c,%Z\\s%#Reason: %m,%C%.%#,%f: line %l\, col %c\, %m,%-G%.%#'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} })
+endfunction
diff --git a/vim/syntax_checkers/javascript/jsl.vim b/vim/syntax_checkers/javascript/jsl.vim
new file mode 100644 (file)
index 0000000..36c7efc
--- /dev/null
@@ -0,0 +1,20 @@
+"============================================================================
+"File:        jsl.vim
+"Description: Javascript syntax checker - using jsl
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+if !exists("g:syntastic_javascript_jsl_conf")
+    let g:syntastic_javascript_jsl_conf = ""
+endif
+
+function! SyntaxCheckers_javascript_GetLocList()
+    let makeprg = "jsl " . g:syntastic_javascript_jsl_conf . " -nologo -nofilelisting -nosummary -nocontext -process ".shellescape(expand('%'))
+    let errorformat='%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
+
diff --git a/vim/syntax_checkers/javascript/jslint.vim b/vim/syntax_checkers/javascript/jslint.vim
new file mode 100644 (file)
index 0000000..94d48f0
--- /dev/null
@@ -0,0 +1,31 @@
+"============================================================================
+"File:        jslint.vim
+"Description: Javascript syntax checker - using jslint
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"Tested with jslint 0.1.4.
+"============================================================================
+if !exists("g:syntastic_javascript_jslint_conf")
+    let g:syntastic_javascript_jslint_conf = "--white --undef --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars"
+endif
+
+function! SyntaxCheckers_javascript_HighlightTerm(error)
+    let unexpected = matchstr(a:error['text'], 'Expected.*and instead saw \'\zs.*\ze\'')
+    if len(unexpected) < 1 | return '' | end
+    return '\V'.split(unexpected, "'")[1]
+endfunction
+
+function! SyntaxCheckers_javascript_GetLocList()
+    let makeprg = "jslint " . g:syntastic_javascript_jslint_conf . " " . shellescape(expand('%'))
+    let errorformat='%E %##%n %m,%-Z%.%#Line %l\, Pos %c,%-G%.%#'
+    let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} })
+    call SyntasticHighlightErrors(errors, function('SyntaxCheckers_javascript_HighlightTerm'))
+
+    return errors
+endfunction
+
diff --git a/vim/syntax_checkers/json.vim b/vim/syntax_checkers/json.vim
new file mode 100644 (file)
index 0000000..2d2652d
--- /dev/null
@@ -0,0 +1,23 @@
+"============================================================================
+"File:        json.vim
+"Description: Figures out which json syntax checker (if any) to load
+"             from the json directory.
+"Maintainer:  Miller Medeiros <contact at millermedeiros dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" Use g:syntastic_json_checker option to specify which jsonlint executable
+" should be used (see below for a list of supported checkers).
+" If g:syntastic_json_checker is not set, just use the first syntax
+" checker that we find installed.
+"============================================================================
+if exists("loaded_json_syntax_checker")
+    finish
+endif
+let loaded_json_syntax_checker = 1
+
+let s:supported_checkers = ["jsonlint", "jsonval"]
+call SyntasticLoadChecker(s:supported_checkers)
diff --git a/vim/syntax_checkers/json/jsonlint.vim b/vim/syntax_checkers/json/jsonlint.vim
new file mode 100644 (file)
index 0000000..6e4a4c0
--- /dev/null
@@ -0,0 +1,16 @@
+"============================================================================
+"File:        jsonlint.vim
+"Description: JSON syntax checker - using jsonlint
+"Maintainer:  Miller Medeiros <contact at millermedeiros dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+function! SyntaxCheckers_json_GetLocList()
+    let makeprg = 'jsonlint ' . shellescape(expand("%")) . ' --compact'
+    let errorformat = '%ELine %l:%c,%Z\\s%#Reason: %m,%C%.%#,%f: line %l\, col %c\, %m,%-G%.%#'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} })
+endfunction
diff --git a/vim/syntax_checkers/json/jsonval.vim b/vim/syntax_checkers/json/jsonval.vim
new file mode 100644 (file)
index 0000000..f288039
--- /dev/null
@@ -0,0 +1,17 @@
+"============================================================================
+"File:        jsonval.vim
+"Description: JSON syntax checker - using jsonval
+"Maintainer:  Miller Medeiros <contact at millermedeiros dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+function! SyntaxCheckers_json_GetLocList()
+    " based on https://gist.github.com/1196345
+    let makeprg = 'jsonval '. shellescape(expand('%'))
+    let errorformat = '%E%f:\ %m\ at\ line\ %l,%-G%.%#'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} })
+endfunction
diff --git a/vim/syntax_checkers/less.vim b/vim/syntax_checkers/less.vim
new file mode 100644 (file)
index 0000000..1338ffd
--- /dev/null
@@ -0,0 +1,38 @@
+"============================================================================
+"File:        less.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Julien Blanchard <julien at sideburns dot eu>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_less_syntax_checker")
+    finish
+endif
+let loaded_less_syntax_checker = 1
+
+"bail if the user doesnt have the lessc binary installed
+if !executable("lessc")
+    finish
+endif
+
+if !exists("g:syntastic_less_options")
+    let g:syntastic_less_options = "--no-color"
+endif
+
+function! SyntaxCheckers_less_GetLocList()
+    let makeprg = 'lessc '. g:syntastic_less_options .' '.  shellescape(expand('%')) . ' /dev/null'
+
+    "lessc >= 1.2
+    let errorformat = '%m in %f:%l:%c'
+    "lessc < 1.2
+    let errorformat .= ', Syntax %trror on line %l in %f,Syntax %trror on line %l,! Syntax %trror: on line %l: %m,%-G%.%#'
+
+    return SyntasticMake({ 'makeprg': makeprg,
+                         \ 'errorformat': errorformat,
+                         \ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} })
+endfunction
+
diff --git a/vim/syntax_checkers/lua.vim b/vim/syntax_checkers/lua.vim
new file mode 100644 (file)
index 0000000..03acb08
--- /dev/null
@@ -0,0 +1,58 @@
+"============================================================================
+"File:        lua.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('loaded_lua_syntax_checker')
+    finish
+endif
+let loaded_lua_syntax_checker = 1
+
+" check if the lua compiler is installed
+if !executable('luac')
+    finish
+endif
+
+function! SyntaxCheckers_lua_Term(pos)
+    let near = matchstr(a:pos['text'], "near '[^']\\+'")
+    let result = ''
+    if len(near) > 0
+        let near = split(near, "'")[1]
+        if near == '<eof>'
+            let p = getpos('$')
+            let a:pos['lnum'] = p[1]
+            let a:pos['col'] = p[2]
+            let result = '\%'.p[2].'c'
+        else
+            let result = '\V'.near
+        endif
+        let open = matchstr(a:pos['text'], "(to close '[^']\\+' at line [0-9]\\+)")
+        if len(open) > 0
+            let oline = split(open, "'")[1:2]
+            let line = 0+strpart(oline[1], 9)
+            call matchadd('SpellCap', '\%'.line.'l\V'.oline[0])
+        endif
+    endif
+    return result
+endfunction
+
+function! SyntaxCheckers_lua_GetLocList()
+    let makeprg = 'luac -p ' . shellescape(expand('%'))
+    let errorformat =  'luac: %#%f:%l: %m'
+
+    let loclist = SyntasticMake({ 'makeprg': makeprg,
+                                \ 'errorformat': errorformat,
+                                \ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } })
+
+    call SyntasticHighlightErrors(loclist, function("SyntaxCheckers_lua_Term"))
+
+    return loclist
+endfunction
+
diff --git a/vim/syntax_checkers/matlab.vim b/vim/syntax_checkers/matlab.vim
new file mode 100644 (file)
index 0000000..595b312
--- /dev/null
@@ -0,0 +1,28 @@
+"============================================================================
+"File:        matlab.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Jason Graham <jason at the-graham dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists("loaded_matlab_syntax_checker")
+    finish
+endif
+let loaded_matlab_syntax_checker = 1
+
+"bail if the user doesn't have mlint installed
+if !executable("mlint")
+    finish
+endif
+
+function! SyntaxCheckers_matlab_GetLocList()
+    let makeprg = 'mlint -id $* '.shellescape(expand('%'))
+    let errorformat = 'L %l (C %c): %*[a-zA-Z0-9]: %m,L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} })
+endfunction
+
diff --git a/vim/syntax_checkers/ocaml.vim b/vim/syntax_checkers/ocaml.vim
new file mode 100644 (file)
index 0000000..6a2470f
--- /dev/null
@@ -0,0 +1,89 @@
+"============================================================================
+"File:        ocaml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Tรถrรถk Edwin <edwintorok at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+" By default the camlp4o preprocessor is used to check the syntax of .ml, and .mli files,
+" ocamllex is used to check .mll files and menhir is used to check .mly files.
+" The output is all redirected to /dev/null, nothing is written to the disk.
+"
+" If your source code needs camlp4r then you can define this in your .vimrc:
+"
+"   let g:syntastic_ocaml_camlp4r = 1
+"
+" If you used some syntax extensions, or you want to also typecheck the source
+" code, then you can define this:
+"
+"   let g:syntastic_ocaml_use_ocamlbuild = 1
+"
+" This will run ocamlbuild <name>.inferred.mli, so it will write to your _build
+" directory (and possibly rebuild your myocamlbuild.ml plugin), only enable this
+" if you are ok with that.
+"
+" If you are using syntax extensions / external libraries and have a properly
+" set up _tags (and myocamlbuild.ml file) then it should just work
+" to enable this flag and get syntax / type checks through syntastic.
+"
+" For best results your current directory should be the project root
+" (same situation if you want useful output from :make).
+
+if exists("loaded_ocaml_syntax_checker")
+    finish
+endif
+let loaded_ocaml_syntax_checker = 1
+
+if exists('g:syntastic_ocaml_camlp4r') &&
+    \ g:syntastic_ocaml_camlp4r != 0
+    let s:ocamlpp="camlp4r"
+else
+    let s:ocamlpp="camlp4o"
+endif
+
+"bail if the user doesnt have the preprocessor
+if !executable(s:ocamlpp)
+    finish
+endif
+
+function! SyntaxCheckers_ocaml_GetLocList()
+    if exists('g:syntastic_ocaml_use_ocamlbuild') &&
+                \ g:syntastic_ocaml_use_ocamlbuild != 0 &&
+                \ executable("ocamlbuild") &&
+                \ isdirectory('_build')
+        let makeprg = "ocamlbuild -quiet -no-log -tag annot,". s:ocamlpp. " -no-links -no-hygiene -no-sanitize ".
+                    \ shellescape(expand('%:r')).".cmi"
+    else
+        let extension = expand('%:e')
+        if match(extension, 'mly') >= 0
+            " ocamlyacc output can't be redirected, so use menhir
+            if !executable("menhir")
+                return []
+            endif
+            let makeprg = "menhir --only-preprocess ".shellescape(expand('%')) . " >/dev/null"
+        elseif match(extension,'mll') >= 0
+            if !executable("ocamllex")
+                return []
+            endif
+            let makeprg = "ocamllex -q -o /dev/null ".shellescape(expand('%'))
+        else
+            let makeprg = "camlp4o -o /dev/null ".shellescape(expand('%'))
+        endif
+    endif
+    let errorformat = '%AFile "%f"\, line %l\, characters %c-%*\d:,'.
+                \ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'.
+                \ '%AFile "%f"\, line %l\, character %c:,'.
+                \ '%AFile "%f"\, line %l\, character %c:%m,'.
+                \ '%-GPreprocessing error %.%#,'.
+                \ '%-GCommand exited %.%#,'.
+                \ '%C%tarning %n: %m,'.
+                \ '%C%m,'.
+                \ '%-G+%.%#'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/perl.vim b/vim/syntax_checkers/perl.vim
new file mode 100644 (file)
index 0000000..e8aa577
--- /dev/null
@@ -0,0 +1,29 @@
+"============================================================================
+"File:        perl.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Anthony Carapetis <anthony.carapetis at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_perl_syntax_checker")
+    finish
+endif
+let loaded_perl_syntax_checker = 1
+
+"bail if the user doesnt have perl installed
+if !executable("perl")
+    finish
+endif
+
+let s:checker = 'perl ' . shellescape(expand('<sfile>:p:h') . '/efm_perl.pl') . ' -c'
+
+function! SyntaxCheckers_perl_GetLocList()
+    let makeprg = s:checker . ' ' . shellescape(expand('%'))
+    let errorformat =  '%f:%l:%m'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/php.vim b/vim/syntax_checkers/php.vim
new file mode 100644 (file)
index 0000000..4f22f91
--- /dev/null
@@ -0,0 +1,58 @@
+"============================================================================
+"File:        php.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_php_syntax_checker")
+    finish
+endif
+let loaded_php_syntax_checker = 1
+
+"bail if the user doesnt have php installed
+if !executable("php")
+    finish
+endif
+
+"Support passing configuration directives to phpcs
+if !exists("g:syntastic_phpcs_conf")
+    let g:syntastic_phpcs_conf = ""
+endif
+
+if !exists("g:syntastic_phpcs_disable")
+    let g:syntastic_phpcs_disable = 0
+endif
+
+function! SyntaxCheckers_php_Term(item)
+    let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'")
+    if len(unexpected) < 1 | return '' | end
+    return '\V'.split(unexpected, "'")[1]
+endfunction
+
+function! SyntaxCheckers_php_GetLocList()
+
+    let errors = []
+
+    let makeprg = "php -l ".shellescape(expand('%'))
+    let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l'
+    let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+    if empty(errors) && !g:syntastic_phpcs_disable && executable("phpcs")
+        let errors = errors + s:GetPHPCSErrors()
+    endif
+
+    call SyntasticHighlightErrors(errors, function('SyntaxCheckers_php_Term'))
+
+    return errors
+endfunction
+
+function! s:GetPHPCSErrors()
+    let makeprg = "phpcs " . g:syntastic_phpcs_conf . " --report=csv ".shellescape(expand('%'))
+    let errorformat = '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype': 'Style' })
+endfunction
diff --git a/vim/syntax_checkers/puppet.vim b/vim/syntax_checkers/puppet.vim
new file mode 100644 (file)
index 0000000..51c898e
--- /dev/null
@@ -0,0 +1,54 @@
+"============================================================================
+"File:        puppet.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Eivind Uggedal <eivind at uggedal dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_puppet_syntax_checker")
+    finish
+endif
+let loaded_puppet_syntax_checker = 1
+
+"bail if the user doesnt have puppet installed
+if !executable("puppet")
+    finish
+endif
+
+function! s:ExtractVersion()
+    let output = system("puppet --version")
+    let output = substitute(output, '\n$', '', '')
+    return split(output, '\.')
+endfunction
+
+let s:puppetVersion = s:ExtractVersion()
+
+function! SyntaxCheckers_puppet_GetLocList()
+    "If puppet is >= version 2.7 then use the new executable
+    if s:puppetVersion[0] >= '2' && s:puppetVersion[1] >= '7'
+        let makeprg = 'puppet parser validate ' .
+                    \ shellescape(expand('%')) .
+                    \ ' --color=false' .
+                    \ ' --storeconfigs'
+
+        "add --ignoreimport for versions < 2.7.10
+        if s:puppetVersion[2] < '10'
+            let makeprg .= ' --ignoreimport'
+        endif
+
+    else
+        let makeprg = 'puppet --color=false --parseonly --ignoreimport '.shellescape(expand('%'))
+    endif
+
+    "some versions of puppet (e.g. 2.7.10) output the message below if there
+    "are any syntax errors
+    let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,'
+
+    let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/python.vim b/vim/syntax_checkers/python.vim
new file mode 100644 (file)
index 0000000..a20539b
--- /dev/null
@@ -0,0 +1,80 @@
+"============================================================================
+"File:        python.vim
+"Description: Syntax checking plugin for syntastic.vim
+"
+"Authors:     Martin Grenfell <martin.grenfell@gmail.com>
+"             kstep <me@kstep.me>
+"             Parantapa Bhattacharya <parantapa@gmail.com>
+"
+"============================================================================
+"
+" For forcing the use of flake8, pyflakes, or pylint set
+"
+"   let g:syntastic_python_checker = 'pyflakes'
+"
+" in your .vimrc. Default is flake8.
+
+if exists("loaded_python_syntax_checker")
+    finish
+endif
+let loaded_python_syntax_checker = 1
+
+"bail if the user doesnt have his favorite checker or flake8 or pyflakes installed
+if !exists('g:syntastic_python_checker') || !executable(g:syntastic_python_checker)
+    if executable("flake8")
+        let g:syntastic_python_checker = 'flake8'
+    elseif executable("pyflakes")
+        let g:syntastic_python_checker = 'pyflakes'
+    elseif executable("pylint")
+        let g:syntastic_python_checker = 'pylint'
+    else
+        finish
+    endif
+endif
+if !exists('g:syntastic_python_checker_args')
+    let g:syntastic_python_checker_args = ''
+endif
+
+function! SyntaxCheckers_python_Term(i)
+    if a:i['type'] ==# 'E'
+        let a:i['text'] = "Syntax error"
+    endif
+    if match(a:i['text'], 'is assigned to but never used') > -1
+                \ || match(a:i['text'], 'imported but unused') > -1
+                \ || match(a:i['text'], 'undefined name') > -1
+                \ || match(a:i['text'], 'redefinition of') > -1
+                \ || match(a:i['text'], 'referenced before assignment') > -1
+                \ || match(a:i['text'], 'duplicate argument') > -1
+                \ || match(a:i['text'], 'after other statements') > -1
+                \ || match(a:i['text'], 'shadowed by loop variable') > -1
+
+        let term = split(a:i['text'], "'", 1)[1]
+        return '\V\<'.term.'\>'
+    endif
+    return ''
+endfunction
+
+if g:syntastic_python_checker == 'pylint'
+    function! SyntaxCheckers_python_GetLocList()
+        let makeprg = 'pylint -f parseable -r n -i y ' .
+            \ shellescape(expand('%')) .
+            \ ' \| sed ''s_: \[[RC]_: \[W_''' .
+            \ ' \| sed ''s_: \[[F]_:\ \[E_'''
+        let errorformat = '%f:%l: [%t%n] %m,%-GNo config%m'
+        let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+        return errors
+    endfunction
+else
+    function! SyntaxCheckers_python_GetLocList()
+        let makeprg = g:syntastic_python_checker.' '.g:syntastic_python_checker_args.' '.shellescape(expand('%'))
+        let errorformat =
+            \ '%E%f:%l: could not compile,%-Z%p^,%W%f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
+
+        let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+        call SyntasticHighlightErrors(errors, function('SyntaxCheckers_python_Term'))
+
+        return errors
+    endfunction
+endif
diff --git a/vim/syntax_checkers/rst.vim b/vim/syntax_checkers/rst.vim
new file mode 100644 (file)
index 0000000..107aafe
--- /dev/null
@@ -0,0 +1,37 @@
+"============================================================================
+"File:        rst.vim
+"Description: Syntax checking plugin for docutil's reStructuredText files
+"Maintainer:  James Rowe <jnrowe at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+" We use rst2pseudoxml.py, as it is ever so marginally faster than the other
+" rst2${x} tools in docutils.
+
+if exists("loaded_rst_syntax_checker")
+    finish
+endif
+let loaded_rst_syntax_checker = 1
+
+"bail if the user doesn't have rst2pseudoxml.py installed
+if !executable("rst2pseudoxml.py")
+    finish
+endif
+
+function! SyntaxCheckers_rst_GetLocList()
+    let makeprg = 'rst2pseudoxml.py --report=1 --exit-status=1 ' .
+      \ shellescape(expand('%')) . ' /dev/null'
+
+    let errorformat = '%f:%l:\ (%tNFO/1)\ %m,
+      \%f:%l:\ (%tARNING/2)\ %m,
+      \%f:%l:\ (%tRROR/3)\ %m,
+      \%f:%l:\ (%tEVERE/4)\ %m,
+      \%-G%.%#'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/ruby.vim b/vim/syntax_checkers/ruby.vim
new file mode 100644 (file)
index 0000000..8c3cd81
--- /dev/null
@@ -0,0 +1,32 @@
+"============================================================================
+"File:        ruby.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_ruby_syntax_checker")
+    finish
+endif
+let loaded_ruby_syntax_checker = 1
+
+"bail if the user doesnt have ruby installed
+if !executable("ruby")
+    finish
+endif
+
+function! SyntaxCheckers_ruby_GetLocList()
+    " we cannot set RUBYOPT on windows like that
+    if has('win32') || has('win64')
+        let makeprg = 'ruby -W1 -T1 -c '.shellescape(expand('%'))
+    else
+        let makeprg = 'RUBYOPT= ruby -W1 -c '.shellescape(expand('%'))
+    endif
+    let errorformat =  '%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/rust.vim b/vim/syntax_checkers/rust.vim
new file mode 100644 (file)
index 0000000..fef48e8
--- /dev/null
@@ -0,0 +1,33 @@
+"============================================================================
+"File:        rust.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Chad Jablonski <chad.jablonski at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_rust_syntax_checker")
+    finish
+endif
+let loaded_rust_syntax_checker = 1
+
+"bail if the user doesnt have rustc installed
+if !executable("rustc")
+    finish
+endif
+
+function! SyntaxCheckers_rust_GetLocList()
+    let makeprg = 'rustc --parse-only '.shellescape(expand('%'))
+
+    let errorformat  = '%E%f:%l:%c: \\d%#:\\d%# %.%\{-}error:%.%\{-} %m,'   .
+                     \ '%W%f:%l:%c: \\d%#:\\d%# %.%\{-}warning:%.%\{-} %m,' .
+                     \ '%C%f:%l %m,' .
+                     \ '%-Z%.%#'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
+
+
diff --git a/vim/syntax_checkers/sass.vim b/vim/syntax_checkers/sass.vim
new file mode 100644 (file)
index 0000000..23bf345
--- /dev/null
@@ -0,0 +1,35 @@
+"============================================================================
+"File:        sass.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_sass_syntax_checker")
+    finish
+endif
+let loaded_sass_syntax_checker = 1
+
+"bail if the user doesnt have the sass binary installed
+if !executable("sass")
+    finish
+endif
+
+"use compass imports if available
+let s:imports = ""
+if executable("compass")
+    let s:imports = "--compass"
+endif
+
+function! SyntaxCheckers_sass_GetLocList()
+    let makeprg='sass '.s:imports.' --check '.shellescape(expand('%'))
+    let errorformat = '%ESyntax %trror:%m,%C        on line %l of %f,%Z%.%#'
+    let errorformat .= ',%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m'
+    let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+    return loclist
+endfunction
diff --git a/vim/syntax_checkers/scss.vim b/vim/syntax_checkers/scss.vim
new file mode 100644 (file)
index 0000000..d3ae5e7
--- /dev/null
@@ -0,0 +1,27 @@
+
+"============================================================================
+"File:        scss.vim
+"Description: scss syntax checking plugin for syntastic
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_scss_syntax_checker")
+    finish
+endif
+let loaded_scss_syntax_checker = 1
+
+"bail if the user doesnt have the sass binary installed
+if !executable("sass")
+    finish
+endif
+
+runtime syntax_checkers/sass.vim
+
+function! SyntaxCheckers_scss_GetLocList()
+    return SyntaxCheckers_sass_GetLocList()
+endfunction
diff --git a/vim/syntax_checkers/sh.vim b/vim/syntax_checkers/sh.vim
new file mode 100644 (file)
index 0000000..5b55172
--- /dev/null
@@ -0,0 +1,52 @@
+"============================================================================
+"File:        sh.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists('loaded_sh_syntax_checker')
+    finish
+endif
+let loaded_sh_syntax_checker = 1
+
+function! s:GetShell()
+    if !exists('b:shell') || b:shell == ""
+        let b:shell = ''
+        let shebang = getbufline(bufnr('%'), 1)[0]
+        if len(shebang) > 0
+            if match(shebang, 'bash') >= 0
+                let b:shell = 'bash'
+            elseif match(shebang, 'zsh') >= 0
+                let b:shell = 'zsh'
+            elseif match(shebang, 'sh') >= 0
+                let b:shell = 'sh'
+            endif
+        endif
+    endif
+    return b:shell
+endfunction
+
+function! SyntaxCheckers_sh_GetLocList()
+    if len(s:GetShell()) == 0 || !executable(s:GetShell())
+        return []
+    endif
+    let output = split(system(s:GetShell().' -n '.shellescape(expand('%'))), '\n')
+    if v:shell_error != 0
+        let result = []
+        for err_line in output
+            let line = substitute(err_line, '^[^:]*:\D\{-}\(\d\+\):.*', '\1', '')
+            let msg = substitute(err_line, '^[^:]*:\D\{-}\d\+: \(.*\)', '\1', '')
+            call add(result, {'lnum' : line,
+                            \ 'text' : msg,
+                            \ 'bufnr': bufnr(''),
+                            \ 'type': 'E' })
+        endfor
+        return result
+    endif
+    return []
+endfunction
diff --git a/vim/syntax_checkers/tcl.vim b/vim/syntax_checkers/tcl.vim
new file mode 100644 (file)
index 0000000..83b5df3
--- /dev/null
@@ -0,0 +1,28 @@
+"============================================================================
+"File: tcl.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Eric Thomas <eric.l.m.thomas at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists("loaded_tcl_syntax_checker")
+    finish
+endif
+let loaded_tcl_syntax_checker = 1
+
+"bail if the user doesnt have tclsh installed
+if !executable("tclsh")
+    finish
+endif
+
+function! SyntaxCheckers_tcl_GetLocList()
+    let makeprg = 'tclsh '.shellescape(expand('%'))
+    let errorformat = '%f:%l:%m'
+
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/tex.vim b/vim/syntax_checkers/tex.vim
new file mode 100644 (file)
index 0000000..4369f4c
--- /dev/null
@@ -0,0 +1,26 @@
+"============================================================================
+"File:        tex.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_tex_syntax_checker")
+    finish
+endif
+let loaded_tex_syntax_checker = 1
+
+"bail if the user doesnt have lacheck installed
+if !executable("lacheck")
+    finish
+endif
+
+function! SyntaxCheckers_tex_GetLocList()
+    let makeprg = 'lacheck '.shellescape(expand('%'))
+    let errorformat =  '%-G** %f:,%E"%f"\, line %l: %m'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/syntax_checkers/vala.vim b/vim/syntax_checkers/vala.vim
new file mode 100644 (file)
index 0000000..f174790
--- /dev/null
@@ -0,0 +1,56 @@
+"============================================================================
+"File:        vala.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Konstantin Stepanov (me@kstep.me)
+"Notes:       Add special comment line into your vala file starting with
+"             "// modules: " and containing space delimited list of vala
+"             modules, used by the file, so this script can build correct
+"             --pkg arguments.
+"             Valac compiler is not the fastest thing in the world, so you
+"             may want to disable this plugin with
+"             let g:syntastic_vala_check_disabled = 1 command in your .vimrc or
+"             command line. Unlet this variable to set it to 0 to reenable
+"             this checker.
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('loaded_vala_syntax_checker')
+    finish
+endif
+let loaded_vala_syntax_checker = 1
+
+if !executable('valac')
+    finish
+endif
+
+if exists('g:syntastic_vala_check_disabled') && g:syntastic_vala_check_disabled
+    finish
+endif
+
+function! SyntaxCheckers_vala_Term(pos)
+    let strlength = strlen(matchstr(a:pos['text'], '\^\+$'))
+    return '\%>'.(a:pos.col-1).'c.*\%<'.(a:pos.col+strlength+1).'c'
+endfunction
+
+function! s:GetValaModules()
+    let modules_line = search('^// modules: ', 'n')
+    let modules_str = getline(modules_line)
+    let modules = split(strpart(modules_str, 12), '\s\+')
+    return modules
+endfunction
+
+function! SyntaxCheckers_vala_GetLocList()
+    let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ')
+    let makeprg = 'valac -C ' . vala_pkg_args . ' ' .shellescape(expand('%'))
+    let errorformat = '%A%f:%l.%c-%\d%\+.%\d%\+: %t%[a-z]%\+: %m,%C%m,%Z%m'
+
+    let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+    call SyntasticHighlightErrors(loclist, function("SyntaxCheckers_vala_Term"), 1)
+    return loclist
+endfunction
+
diff --git a/vim/syntax_checkers/xhtml.vim b/vim/syntax_checkers/xhtml.vim
new file mode 100644 (file)
index 0000000..80d981a
--- /dev/null
@@ -0,0 +1,46 @@
+"============================================================================
+"File:        xhtml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_xhtml_syntax_checker")
+    finish
+endif
+let loaded_xhtml_syntax_checker = 1
+
+"bail if the user doesnt have tidy or grep installed
+if !executable("tidy")
+    finish
+endif
+
+" TODO: join this with html.vim DRY's sake?
+function! s:TidyEncOptByFenc()
+    let tidy_opts = {
+                \'utf-8'       : '-utf8',
+                \'ascii'       : '-ascii',
+                \'latin1'      : '-latin1',
+                \'iso-2022-jp' : '-iso-2022',
+                \'cp1252'      : '-win1252',
+                \'macroman'    : '-mac',
+                \'utf-16le'    : '-utf16le',
+                \'utf-16'      : '-utf16',
+                \'big5'        : '-big5',
+                \'sjis'        : '-shiftjis',
+                \'cp850'       : '-ibm858',
+                \}
+    return get(tidy_opts, &fileencoding, '-utf8')
+endfunction
+
+function! SyntaxCheckers_xhtml_GetLocList()
+
+    let encopt = s:TidyEncOptByFenc()
+    let makeprg="tidy ".encopt." -xml -e ".shellescape(expand('%'))
+    let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} })
+endfunction
diff --git a/vim/syntax_checkers/xml.vim b/vim/syntax_checkers/xml.vim
new file mode 100644 (file)
index 0000000..55c0cdd
--- /dev/null
@@ -0,0 +1,42 @@
+"============================================================================
+"File:        xml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Sebastian Kusnier <sebastian at kusnier dot net>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+" You can use a local installation of DTDs to significantly speed up validation
+" and allow you to validate XML data without network access, see xmlcatalog(1)
+" and http://www.xmlsoft.org/catalog.html for more information.
+
+if exists("loaded_xml_syntax_checker")
+    finish
+endif
+let loaded_xml_syntax_checker = 1
+
+"bail if the user doesnt have tidy or grep installed
+if !executable("xmllint")
+    finish
+endif
+
+function! SyntaxCheckers_xml_GetLocList()
+
+    let makeprg="xmllint --xinclude --noout --postvalid " . shellescape(expand("%:p"))
+    let errorformat='%E%f:%l:\ error\ :\ %m,
+        \%-G%f:%l:\ validity\ error\ :\ Validation\ failed:\ no\ DTD\ found\ %m,
+        \%W%f:%l:\ warning\ :\ %m,
+        \%W%f:%l:\ validity\ warning\ :\ %m,
+        \%E%f:%l:\ validity\ error\ :\ %m,
+        \%E%f:%l:\ parser\ error\ :\ %m,
+        \%E%f:%l:\ %m,
+        \%-Z%p^,
+        \%-G%.%#'
+    let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+    return loclist
+endfunction
diff --git a/vim/syntax_checkers/xslt.vim b/vim/syntax_checkers/xslt.vim
new file mode 100644 (file)
index 0000000..b9b3cac
--- /dev/null
@@ -0,0 +1,38 @@
+"============================================================================
+"File:        xslt.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Sebastian Kusnier <sebastian at kusnier dot net>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+if exists("loaded_xslt_syntax_checker")
+    finish
+endif
+let loaded_xslt_syntax_checker = 1
+
+"bail if the user doesnt have tidy or grep installed
+if !executable("xmllint")
+    finish
+endif
+
+function! SyntaxCheckers_xslt_GetLocList()
+
+    let makeprg="xmllint --xinclude --noout --postvalid " . shellescape(expand("%:p"))
+    let errorformat='%E%f:%l:\ error\ :\ %m,
+        \%-G%f:%l:\ validity\ error\ :\ Validation\ failed:\ no\ DTD\ found\ %m,
+        \%W%f:%l:\ warning\ :\ %m,
+        \%W%f:%l:\ validity\ warning\ :\ %m,
+        \%E%f:%l:\ validity\ error\ :\ %m,
+        \%E%f:%l:\ parser\ error\ :\ %m,
+        \%E%f:%l:\ namespace\ error\ :\ %m,
+        \%E%f:%l:\ %m,
+        \%-Z%p^,
+        \%-G%.%#'
+    let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+    return loclist
+endfunction
diff --git a/vim/syntax_checkers/yaml.vim b/vim/syntax_checkers/yaml.vim
new file mode 100644 (file)
index 0000000..f45d849
--- /dev/null
@@ -0,0 +1,30 @@
+"============================================================================
+"File:        yaml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"
+"Installation: $ npm install -g js-yaml.bin
+"
+"============================================================================
+if exists("loaded_yaml_syntax_checker")
+    finish
+endif
+let loaded_yaml_syntax_checker = 1
+
+if !executable("js-yaml")
+    finish
+endif
+
+function! SyntaxCheckers_yaml_GetLocList()
+    let makeprg='js-yaml --compact ' . shellescape(expand('%'))
+    let errorformat='Error on line %l\, col %c:%m,%-G%.%#'
+    return SyntasticMake({ 'makeprg': makeprg,
+                         \ 'errorformat': errorformat,
+                         \ 'defaults': {'bufnr': bufnr("")} })
+endfunction
diff --git a/vim/syntax_checkers/zpt.vim b/vim/syntax_checkers/zpt.vim
new file mode 100644 (file)
index 0000000..0b0063b
--- /dev/null
@@ -0,0 +1,36 @@
+"============================================================================
+"File:        zpt.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer:  claytron <robots at claytron dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+" In order for this plugin to be useful, you will need to set up the
+" zpt filetype in your vimrc
+"
+"    " set up zope page templates as the zpt filetype
+"    au BufNewFile,BufRead *.pt,*.cpt,*.zpt set filetype=zpt syntax=xml
+"
+" Then install the zptlint program, found on pypi:
+" http://pypi.python.org/pypi/zptlint
+
+if exists("loaded_zpt_syntax_checker")
+    finish
+endif
+let loaded_zpt_syntax_checker = 1
+
+" Bail if the user doesn't have zptlint installed
+if !executable("zptlint")
+    finish
+endif
+
+function! SyntaxCheckers_zpt_GetLocList()
+    let makeprg="zptlint ".shellescape(expand('%'))
+    let errorformat='%-P*** Error in: %f,%Z%*\s\, at line %l\, column %c,%E%*\s%m,%-Q'
+    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
diff --git a/vim/tmp/ack.vim b/vim/tmp/ack.vim
new file mode 160000 (submodule)
index 0000000..a41d5d5
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit a41d5d52c39a31128e969e69acf800b198cb07f9
diff --git a/vim/tmp/align b/vim/tmp/align
new file mode 160000 (submodule)
index 0000000..fa5fdee
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit fa5fdeeea25269c3e83262c03dfa1ccd27dbd3c9
diff --git a/vim/tmp/arduino b/vim/tmp/arduino
new file mode 160000 (submodule)
index 0000000..c97f8ca
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit c97f8ca8941e63c446ecc87eca089b293c7ac01a
diff --git a/vim/tmp/color-sampler b/vim/tmp/color-sampler
new file mode 160000 (submodule)
index 0000000..681ed9e
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 681ed9e94b7d498810be7a3ac0f048bcca8fd46d
diff --git a/vim/tmp/command-t-1.2.1.vba b/vim/tmp/command-t-1.2.1.vba
new file mode 100644 (file)
index 0000000..015f593
--- /dev/null
@@ -0,0 +1,3054 @@
+" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.
+UseVimball
+finish
+ruby/command-t/controller.rb   [[[1
+317
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/finder/buffer_finder'
+require 'command-t/finder/file_finder'
+require 'command-t/match_window'
+require 'command-t/prompt'
+require 'command-t/vim/path_utilities'
+
+module CommandT
+  class Controller
+    include VIM::PathUtilities
+
+    def initialize
+      @prompt = Prompt.new
+      @buffer_finder = CommandT::BufferFinder.new
+      set_up_file_finder
+      set_up_max_height
+    end
+
+    def show_buffer_finder
+      @path          = VIM::pwd
+      @active_finder = @buffer_finder
+      show
+    end
+
+    def show_file_finder
+      # optional parameter will be desired starting directory, or ""
+      @path             = File.expand_path(::VIM::evaluate('a:arg'), VIM::pwd)
+      @file_finder.path = @path
+      @active_finder    = @file_finder
+      show
+    rescue Errno::ENOENT
+      # probably a problem with the optional parameter
+      @match_window.print_no_such_file_or_directory
+    end
+
+    def hide
+      @match_window.close
+      if VIM::Window.select @initial_window
+        if @initial_buffer.number == 0
+          # upstream bug: buffer number misreported as 0
+          # see: https://wincent.com/issues/1617
+          ::VIM::command "silent b #{@initial_buffer.name}"
+        else
+          ::VIM::command "silent b #{@initial_buffer.number}"
+        end
+      end
+    end
+
+    def flush
+      set_up_max_height
+      set_up_file_finder
+    end
+
+    def handle_key
+      key = ::VIM::evaluate('a:arg').to_i.chr
+      if @focus == @prompt
+        @prompt.add! key
+        list_matches
+      else
+        @match_window.find key
+      end
+    end
+
+    def backspace
+      if @focus == @prompt
+        @prompt.backspace!
+        list_matches
+      end
+    end
+
+    def delete
+      if @focus == @prompt
+        @prompt.delete!
+        list_matches
+      end
+    end
+
+    def accept_selection options = {}
+      selection = @match_window.selection
+      hide
+      open_selection(selection, options) unless selection.nil?
+    end
+
+    def toggle_focus
+      @focus.unfocus # old focus
+      @focus = @focus == @prompt ? @match_window : @prompt
+      @focus.focus # new focus
+    end
+
+    def cancel
+      hide
+    end
+
+    def select_next
+      @match_window.select_next
+    end
+
+    def select_prev
+      @match_window.select_prev
+    end
+
+    def clear
+      @prompt.clear!
+      list_matches
+    end
+
+    def cursor_left
+      @prompt.cursor_left if @focus == @prompt
+    end
+
+    def cursor_right
+      @prompt.cursor_right if @focus == @prompt
+    end
+
+    def cursor_end
+      @prompt.cursor_end if @focus == @prompt
+    end
+
+    def cursor_start
+      @prompt.cursor_start if @focus == @prompt
+    end
+
+    def leave
+      @match_window.leave
+    end
+
+    def unload
+      @match_window.unload
+    end
+
+  private
+
+    def show
+      @initial_window   = $curwin
+      @initial_buffer   = $curbuf
+      @match_window     = MatchWindow.new \
+        :prompt               => @prompt,
+        :match_window_at_top  => get_bool('g:CommandTMatchWindowAtTop'),
+        :match_window_reverse => get_bool('g:CommandTMatchWindowReverse')
+      @focus            = @prompt
+      @prompt.focus
+      register_for_key_presses
+      clear # clears prompt and lists matches
+    end
+
+    def set_up_max_height
+      @max_height = get_number('g:CommandTMaxHeight') || 0
+    end
+
+    def set_up_file_finder
+      @file_finder = CommandT::FileFinder.new nil,
+        :max_files              => get_number('g:CommandTMaxFiles'),
+        :max_depth              => get_number('g:CommandTMaxDepth'),
+        :always_show_dot_files  => get_bool('g:CommandTAlwaysShowDotFiles'),
+        :never_show_dot_files   => get_bool('g:CommandTNeverShowDotFiles'),
+        :scan_dot_directories   => get_bool('g:CommandTScanDotDirectories')
+    end
+
+    def exists? name
+      ::VIM::evaluate("exists(\"#{name}\")").to_i != 0
+    end
+
+    def get_number name
+      exists?(name) ? ::VIM::evaluate("#{name}").to_i : nil
+    end
+
+    def get_bool name
+      exists?(name) ? ::VIM::evaluate("#{name}").to_i != 0 : nil
+    end
+
+    def get_string name
+      exists?(name) ? ::VIM::evaluate("#{name}").to_s : nil
+    end
+
+    # expect a string or a list of strings
+    def get_list_or_string name
+      return nil unless exists?(name)
+      list_or_string = ::VIM::evaluate("#{name}")
+      if list_or_string.kind_of?(Array)
+        list_or_string.map { |item| item.to_s }
+      else
+        list_or_string.to_s
+      end
+    end
+
+    # Backslash-escape space, \, |, %, #, "
+    def sanitize_path_string str
+      # for details on escaping command-line mode arguments see: :h :
+      # (that is, help on ":") in the Vim documentation.
+      str.gsub(/[ \\|%#"]/, '\\\\\0')
+    end
+
+    def default_open_command
+      if !get_bool('&hidden') && get_bool('&modified')
+        'sp'
+      else
+        'e'
+      end
+    end
+
+    def ensure_appropriate_window_selection
+      # normally we try to open the selection in the current window, but there
+      # is one exception:
+      #
+      # - we don't touch any "unlisted" buffer with buftype "nofile" (such as
+      #   NERDTree or MiniBufExplorer); this is to avoid things like the "Not
+      #   enough room" error which occurs when trying to open in a split in a
+      #   shallow (potentially 1-line) buffer like MiniBufExplorer is current
+      #
+      # Other "unlisted" buffers, such as those with buftype "help" are treated
+      # normally.
+      initial = $curwin
+      while true do
+        break unless ::VIM::evaluate('&buflisted').to_i == 0 &&
+          ::VIM::evaluate('&buftype').to_s == 'nofile'
+        ::VIM::command 'wincmd w'     # try next window
+        break if $curwin == initial # have already tried all
+      end
+    end
+
+    def open_selection selection, options = {}
+      command = options[:command] || default_open_command
+      selection = File.expand_path selection, @path
+      selection = relative_path_under_working_directory selection
+      selection = sanitize_path_string selection
+      ensure_appropriate_window_selection
+      ::VIM::command "silent #{command} #{selection}"
+    end
+
+    def map key, function, param = nil
+      ::VIM::command "noremap <silent> <buffer> #{key} " \
+        ":call CommandT#{function}(#{param})<CR>"
+    end
+
+    def xterm?
+      !!(::VIM::evaluate('&term') =~ /\Axterm/)
+    end
+
+    def vt100?
+      !!(::VIM::evaluate('&term') =~ /\Avt100/)
+    end
+
+    def register_for_key_presses
+      # "normal" keys (interpreted literally)
+      numbers     = ('0'..'9').to_a.join
+      lowercase   = ('a'..'z').to_a.join
+      uppercase   = lowercase.upcase
+      punctuation = '<>`@#~!"$%&/()=+*-_.,;:?\\\'{}[] ' # and space
+      (numbers + lowercase + uppercase + punctuation).each_byte do |b|
+        map "<Char-#{b}>", 'HandleKey', b
+      end
+
+      # "special" keys (overridable by settings)
+      { 'Backspace'             => '<BS>',
+        'Delete'                => '<Del>',
+        'AcceptSelection'       => '<CR>',
+        'AcceptSelectionSplit'  => ['<C-CR>', '<C-s>'],
+        'AcceptSelectionTab'    => '<C-t>',
+        'AcceptSelectionVSplit' => '<C-v>',
+        'ToggleFocus'           => '<Tab>',
+        'Cancel'                => ['<C-c>', '<Esc>'],
+        'SelectNext'            => ['<C-n>', '<C-j>', '<Down>'],
+        'SelectPrev'            => ['<C-p>', '<C-k>', '<Up>'],
+        'Clear'                 => '<C-u>',
+        'CursorLeft'            => ['<Left>', '<C-h>'],
+        'CursorRight'           => ['<Right>', '<C-l>'],
+        'CursorEnd'             => '<C-e>',
+        'CursorStart'           => '<C-a>' }.each do |key, value|
+        if override = get_list_or_string("g:CommandT#{key}Map")
+          [override].flatten.each do |mapping|
+            map mapping, key
+          end
+        else
+          [value].flatten.each do |mapping|
+            map mapping, key unless mapping == '<Esc>' && (xterm? || vt100?)
+          end
+        end
+      end
+    end
+
+    # Returns the desired maximum number of matches, based on available
+    # vertical space and the g:CommandTMaxHeight option.
+    def match_limit
+      limit = VIM::Screen.lines - 5
+      limit = 1 if limit < 0
+      limit = [limit, @max_height].min if @max_height > 0
+      limit
+    end
+
+    def list_matches
+      matches = @active_finder.sorted_matches_for @prompt.abbrev, :limit => match_limit
+      @match_window.matches = matches
+    end
+  end # class Controller
+end # module commandT
+ruby/command-t/extconf.rb      [[[1
+32
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'mkmf'
+
+def missing item
+  puts "couldn't find #{item} (required)"
+  exit 1
+end
+
+have_header('ruby.h') or missing('ruby.h')
+create_makefile('ext')
+ruby/command-t/finder/buffer_finder.rb [[[1
+35
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/ext' # CommandT::Matcher
+require 'command-t/scanner/buffer_scanner'
+require 'command-t/finder'
+
+module CommandT
+  class BufferFinder < Finder
+    def initialize
+      @scanner = BufferScanner.new
+      @matcher = Matcher.new @scanner, :always_show_dot_files => true
+    end
+  end # class BufferFinder
+end # CommandT
+ruby/command-t/finder/file_finder.rb   [[[1
+35
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/ext' # CommandT::Matcher
+require 'command-t/finder'
+require 'command-t/scanner/file_scanner'
+
+module CommandT
+  class FileFinder < Finder
+    def initialize path = Dir.pwd, options = {}
+      @scanner = FileScanner.new path, options
+      @matcher = Matcher.new @scanner, options
+    end
+  end # class FileFinder
+end # CommandT
+ruby/command-t/finder.rb       [[[1
+52
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/ext' # CommandT::Matcher
+
+module CommandT
+  # Encapsulates a Scanner instance (which builds up a list of available files
+  # in a directory) and a Matcher instance (which selects from that list based
+  # on a search string).
+  #
+  # Specialized subclasses use different kinds of scanners adapted for
+  # different kinds of search (files, buffers).
+  class Finder
+    def initialize path = Dir.pwd, options = {}
+      raise RuntimeError, 'Subclass responsibility'
+    end
+
+    # Options:
+    #   :limit (integer): limit the number of returned matches
+    def sorted_matches_for str, options = {}
+      @matcher.sorted_matches_for str, options
+    end
+
+    def flush
+      @scanner.flush
+    end
+
+    def path= path
+      @scanner.path = path
+    end
+  end # class Finder
+end # CommandT
+ruby/command-t/match_window.rb [[[1
+387
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'ostruct'
+require 'command-t/settings'
+
+module CommandT
+  class MatchWindow
+    @@selection_marker  = '> '
+    @@marker_length     = @@selection_marker.length
+    @@unselected_marker = ' ' * @@marker_length
+    @@buffer            = nil
+
+    def initialize options = {}
+      @prompt = options[:prompt]
+      @reverse_list = options[:match_window_reverse]
+
+      # save existing window dimensions so we can restore them later
+      @windows = []
+      (0..(::VIM::Window.count - 1)).each do |i|
+        window = OpenStruct.new :index => i, :height => ::VIM::Window[i].height
+        @windows << window
+      end
+
+      # global settings (must manually save and restore)
+      @settings = Settings.new
+      ::VIM::set_option 'timeout'         # ensure mappings timeout
+      ::VIM::set_option 'timeoutlen=0'    # respond immediately to mappings
+      ::VIM::set_option 'nohlsearch'      # don't highlight search strings
+      ::VIM::set_option 'noinsertmode'    # don't make Insert mode the default
+      ::VIM::set_option 'noshowcmd'       # don't show command info on last line
+      ::VIM::set_option 'report=9999'     # don't show "X lines changed" reports
+      ::VIM::set_option 'sidescroll=0'    # don't sidescroll in jumps
+      ::VIM::set_option 'sidescrolloff=0' # don't sidescroll automatically
+      ::VIM::set_option 'noequalalways'   # don't auto-balance window sizes
+
+      # show match window
+      split_location = options[:match_window_at_top] ? 'topleft' : 'botright'
+      if @@buffer # still have buffer from last time
+        ::VIM::command "silent! #{split_location} #{@@buffer.number}sbuffer"
+        raise "Can't re-open GoToFile buffer" unless $curbuf.number == @@buffer.number
+        $curwin.height = 1
+      else        # creating match window for first time and set it up
+        split_command = "silent! #{split_location} 1split GoToFile"
+        [
+          split_command,
+          'setlocal bufhidden=unload',  # unload buf when no longer displayed
+          'setlocal buftype=nofile',    # buffer is not related to any file
+          'setlocal nomodifiable',      # prevent manual edits
+          'setlocal noswapfile',        # don't create a swapfile
+          'setlocal nowrap',            # don't soft-wrap
+          'setlocal nonumber',          # don't show line numbers
+          'setlocal nolist',            # don't use List mode (visible tabs etc)
+          'setlocal foldcolumn=0',      # don't show a fold column at side
+          'setlocal foldlevel=99',      # don't fold anything
+          'setlocal nocursorline',      # don't highlight line cursor is on
+          'setlocal nospell',           # spell-checking off
+          'setlocal nobuflisted',       # don't show up in the buffer list
+          'setlocal textwidth=0'        # don't hard-wrap (break long lines)
+        ].each { |command| ::VIM::command command }
+
+        # sanity check: make sure the buffer really was created
+        raise "Can't find GoToFile buffer" unless $curbuf.name.match /GoToFile\z/
+        @@buffer = $curbuf
+      end
+
+      # syntax coloring
+      if VIM::has_syntax?
+        ::VIM::command "syntax match CommandTSelection \"^#{@@selection_marker}.\\+$\""
+        ::VIM::command 'syntax match CommandTNoEntries "^-- NO MATCHES --$"'
+        ::VIM::command 'syntax match CommandTNoEntries "^-- NO SUCH FILE OR DIRECTORY --$"'
+        ::VIM::command 'highlight link CommandTSelection Visual'
+        ::VIM::command 'highlight link CommandTNoEntries Error'
+        ::VIM::evaluate 'clearmatches()'
+
+        # hide cursor
+        @cursor_highlight = get_cursor_highlight
+        hide_cursor
+      end
+
+      # perform cleanup using an autocmd to ensure we don't get caught out
+      # by some unexpected means of dismissing or leaving the Command-T window
+      # (eg. <C-W q>, <C-W k> etc)
+      ::VIM::command 'autocmd! * <buffer>'
+      ::VIM::command 'autocmd BufLeave <buffer> ruby $command_t.leave'
+      ::VIM::command 'autocmd BufUnload <buffer> ruby $command_t.unload'
+
+      @has_focus  = false
+      @selection  = nil
+      @abbrev     = ''
+      @window     = $curwin
+    end
+
+    def close
+      # Workaround for upstream bug in Vim 7.3 on some platforms
+      #
+      # On some platforms, $curbuf.number always returns 0. One workaround is
+      # to build Vim with --disable-largefile, but as this is producing lots of
+      # support requests, implement the following fallback to the buffer name
+      # instead, at least until upstream gets fixed.
+      #
+      # For more details, see: https://wincent.com/issues/1617
+      if $curbuf.number == 0
+        # use bwipeout as bunload fails if passed the name of a hidden buffer
+        ::VIM::command 'bwipeout! GoToFile'
+        @@buffer = nil
+      else
+        ::VIM::command "bunload! #{@@buffer.number}"
+      end
+    end
+
+    def leave
+      close
+      unload
+    end
+
+    def unload
+      restore_window_dimensions
+      @settings.restore
+      @prompt.dispose
+      show_cursor
+    end
+
+    def add! char
+      @abbrev += char
+    end
+
+    def backspace!
+      @abbrev.chop!
+    end
+
+    def select_next
+      if @selection < @matches.length - 1
+        @selection += 1
+        print_match(@selection - 1) # redraw old selection (removes marker)
+        print_match(@selection)     # redraw new selection (adds marker)
+        move_cursor_to_selected_line
+      else
+        # (possibly) loop or scroll
+      end
+    end
+
+    def select_prev
+      if @selection > 0
+        @selection -= 1
+        print_match(@selection + 1) # redraw old selection (removes marker)
+        print_match(@selection)     # redraw new selection (adds marker)
+        move_cursor_to_selected_line
+      else
+        # (possibly) loop or scroll
+      end
+    end
+
+    def matches= matches
+      matches = matches.reverse if @reverse_list
+      if matches != @matches
+        @matches = matches
+        @selection = @reverse_list ? @matches.length - 1 : 0
+        print_matches
+        move_cursor_to_selected_line
+      end
+    end
+
+    def focus
+      unless @has_focus
+        @has_focus = true
+        if VIM::has_syntax?
+          ::VIM::command 'highlight link CommandTSelection Search'
+        end
+      end
+    end
+
+    def unfocus
+      if @has_focus
+        @has_focus = false
+        if VIM::has_syntax?
+          ::VIM::command 'highlight link CommandTSelection Visual'
+        end
+      end
+    end
+
+    def find char
+      # is this a new search or the continuation of a previous one?
+      now = Time.now
+      if @last_key_time.nil? or @last_key_time < (now - 0.5)
+        @find_string = char
+      else
+        @find_string += char
+      end
+      @last_key_time = now
+
+      # see if there's anything up ahead that matches
+      @matches.each_with_index do |match, idx|
+        if match[0, @find_string.length].casecmp(@find_string) == 0
+          old_selection = @selection
+          @selection = idx
+          print_match(old_selection)  # redraw old selection (removes marker)
+          print_match(@selection)     # redraw new selection (adds marker)
+          break
+        end
+      end
+    end
+
+    # Returns the currently selected item as a String.
+    def selection
+      @matches[@selection]
+    end
+
+    def print_no_such_file_or_directory
+      print_error 'NO SUCH FILE OR DIRECTORY'
+    end
+
+  private
+
+    def move_cursor_to_selected_line
+      # on some non-GUI terminals, the cursor doesn't hide properly
+      # so we move the cursor to prevent it from blinking away in the
+      # upper-left corner in a distracting fashion
+      @window.cursor = [@selection + 1, 0]
+    end
+
+    def print_error msg
+      return unless VIM::Window.select(@window)
+      unlock
+      clear
+      @window.height = 1
+      @@buffer[1] = "-- #{msg} --"
+      lock
+    end
+
+    def restore_window_dimensions
+      # sort from tallest to shortest
+      @windows.sort! { |a, b| b.height <=> a.height }
+
+      # starting with the tallest ensures that there are no constraints
+      # preventing windows on the side of vertical splits from regaining
+      # their original full size
+      @windows.each do |w|
+        # beware: window may be nil
+        window = ::VIM::Window[w.index]
+        window.height = w.height if window
+      end
+    end
+
+    def match_text_for_idx idx
+      match = truncated_match @matches[idx]
+      if idx == @selection
+        prefix = @@selection_marker
+        suffix = padding_for_selected_match match
+      else
+        prefix = @@unselected_marker
+        suffix = ''
+      end
+      prefix + match + suffix
+    end
+
+    # Print just the specified match.
+    def print_match idx
+      return unless VIM::Window.select(@window)
+      unlock
+      @@buffer[idx + 1] = match_text_for_idx idx
+      lock
+    end
+
+    # Print all matches.
+    def print_matches
+      match_count = @matches.length
+      if match_count == 0
+        print_error 'NO MATCHES'
+      else
+        return unless VIM::Window.select(@window)
+        unlock
+        clear
+        actual_lines = 1
+        @window_width = @window.width # update cached value
+        max_lines = VIM::Screen.lines - 5
+        max_lines = 1 if max_lines < 0
+        actual_lines = match_count > max_lines ? max_lines : match_count
+        @window.height = actual_lines
+        (1..actual_lines).each do |line|
+          idx = line - 1
+          if @@buffer.count >= line
+            @@buffer[line] = match_text_for_idx idx
+          else
+            @@buffer.append line - 1, match_text_for_idx(idx)
+          end
+        end
+        lock
+      end
+    end
+
+    # Prepare padding for match text (trailing spaces) so that selection
+    # highlighting extends all the way to the right edge of the window.
+    def padding_for_selected_match str
+      len = str.length
+      if len >= @window_width - @@marker_length
+        ''
+      else
+        ' ' * (@window_width - @@marker_length - len)
+      end
+    end
+
+    # Convert "really/long/path" into "really...path" based on available
+    # window width.
+    def truncated_match str
+      len = str.length
+      available_width = @window_width - @@marker_length
+      return str if len <= available_width
+      left = (available_width / 2) - 1
+      right = (available_width / 2) - 2 + (available_width % 2)
+      str[0, left] + '...' + str[-right, right]
+    end
+
+    def clear
+      # range = % (whole buffer)
+      # action = d (delete)
+      # register = _ (black hole register, don't record deleted text)
+      ::VIM::command 'silent %d _'
+    end
+
+    def get_cursor_highlight
+      # as :highlight returns nothing and only prints,
+      # must redirect its output to a variable
+      ::VIM::command 'silent redir => g:command_t_cursor_highlight'
+
+      # force 0 verbosity to ensure origin information isn't printed as well
+      ::VIM::command 'silent! 0verbose highlight Cursor'
+      ::VIM::command 'silent redir END'
+
+      # there are 3 possible formats to check for, each needing to be
+      # transformed in a certain way in order to reapply the highlight:
+      #   Cursor xxx guifg=bg guibg=fg      -> :hi! Cursor guifg=bg guibg=fg
+      #   Cursor xxx links to SomethingElse -> :hi! link Cursor SomethingElse
+      #   Cursor xxx cleared                -> :hi! clear Cursor
+      highlight = ::VIM::evaluate 'g:command_t_cursor_highlight'
+      if highlight =~ /^Cursor\s+xxx\s+links to (\w+)/
+        "link Cursor #{$~[1]}"
+      elsif highlight =~ /^Cursor\s+xxx\s+cleared/
+        'clear Cursor'
+      elsif highlight =~ /Cursor\s+xxx\s+(.+)/
+        "Cursor #{$~[1]}"
+      else # likely cause E411 Cursor highlight group not found
+        nil
+      end
+    end
+
+    def hide_cursor
+      if @cursor_highlight
+        ::VIM::command 'highlight Cursor NONE'
+      end
+    end
+
+    def show_cursor
+      if @cursor_highlight
+        ::VIM::command "highlight #{@cursor_highlight}"
+      end
+    end
+
+    def lock
+      ::VIM::command 'setlocal nomodifiable'
+    end
+
+    def unlock
+      ::VIM::command 'setlocal modifiable'
+    end
+  end
+end
+ruby/command-t/prompt.rb       [[[1
+165
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  # Abuse the status line as a prompt.
+  class Prompt
+    attr_accessor :abbrev
+
+    def initialize
+      @abbrev     = ''  # abbreviation entered so far
+      @col        = 0   # cursor position
+      @has_focus  = false
+    end
+
+    # Erase whatever is displayed in the prompt line,
+    # effectively disposing of the prompt
+    def dispose
+      ::VIM::command 'echo'
+      ::VIM::command 'redraw'
+    end
+
+    # Clear any entered text.
+    def clear!
+      @abbrev = ''
+      @col    = 0
+      redraw
+    end
+
+    # Insert a character at (before) the current cursor position.
+    def add! char
+      left, cursor, right = abbrev_segments
+      @abbrev = left + char + cursor + right
+      @col += 1
+      redraw
+    end
+
+    # Delete a character to the left of the current cursor position.
+    def backspace!
+      if @col > 0
+        left, cursor, right = abbrev_segments
+        @abbrev = left.chop! + cursor + right
+        @col -= 1
+        redraw
+      end
+    end
+
+    # Delete a character at the current cursor position.
+    def delete!
+      if @col < @abbrev.length
+        left, cursor, right = abbrev_segments
+        @abbrev = left + right
+        redraw
+      end
+    end
+
+    def cursor_left
+      if @col > 0
+        @col -= 1
+        redraw
+      end
+    end
+
+    def cursor_right
+      if @col < @abbrev.length
+        @col += 1
+        redraw
+      end
+    end
+
+    def cursor_end
+      if @col < @abbrev.length
+        @col = @abbrev.length
+        redraw
+      end
+    end
+
+    def cursor_start
+      if @col != 0
+        @col = 0
+        redraw
+      end
+    end
+
+    def redraw
+      if @has_focus
+        prompt_highlight = 'Comment'
+        normal_highlight = 'None'
+        cursor_highlight = 'Underlined'
+      else
+        prompt_highlight = 'NonText'
+        normal_highlight = 'NonText'
+        cursor_highlight = 'NonText'
+      end
+      left, cursor, right = abbrev_segments
+      components = [prompt_highlight, '>>', 'None', ' ']
+      components += [normal_highlight, left] unless left.empty?
+      components += [cursor_highlight, cursor] unless cursor.empty?
+      components += [normal_highlight, right] unless right.empty?
+      components += [cursor_highlight, ' '] if cursor.empty?
+      set_status *components
+    end
+
+    def focus
+      unless @has_focus
+        @has_focus = true
+        redraw
+      end
+    end
+
+    def unfocus
+      if @has_focus
+        @has_focus = false
+        redraw
+      end
+    end
+
+  private
+
+    # Returns the @abbrev string divided up into three sections, any of
+    # which may actually be zero width, depending on the location of the
+    # cursor:
+    #   - left segment (to left of cursor)
+    #   - cursor segment (character at cursor)
+    #   - right segment (to right of cursor)
+    def abbrev_segments
+      left    = @abbrev[0, @col]
+      cursor  = @abbrev[@col, 1]
+      right   = @abbrev[(@col + 1)..-1] || ''
+      [left, cursor, right]
+    end
+
+    def set_status *args
+      # see ':help :echo' for why forcing a redraw here helps
+      # prevent the status line from getting inadvertantly cleared
+      # after our echo commands
+      ::VIM::command 'redraw'
+      while (highlight = args.shift) and  (text = args.shift) do
+        text = VIM::escape_for_single_quotes text
+        ::VIM::command "echohl #{highlight}"
+        ::VIM::command "echon '#{text}'"
+      end
+      ::VIM::command 'echohl None'
+    end
+  end # class Prompt
+end # module CommandT
+ruby/command-t/scanner/buffer_scanner.rb       [[[1
+42
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim'
+require 'command-t/vim/path_utilities'
+require 'command-t/scanner'
+
+module CommandT
+  # Returns a list of all open buffers.
+  class BufferScanner < Scanner
+    include VIM::PathUtilities
+
+    def paths
+      (0..(::VIM::Buffer.count - 1)).map do |n|
+        buffer = ::VIM::Buffer[n]
+        if buffer.name # beware, may be nil
+          relative_path_under_working_directory buffer.name
+        end
+      end.compact
+    end
+  end # class BufferScanner
+end # module CommandT
+ruby/command-t/scanner/file_scanner.rb [[[1
+94
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim'
+require 'command-t/scanner'
+
+module CommandT
+  # Reads the current directory recursively for the paths to all regular files.
+  class FileScanner < Scanner
+    class FileLimitExceeded < ::RuntimeError; end
+
+    def initialize path = Dir.pwd, options = {}
+      @path                 = path
+      @max_depth            = options[:max_depth] || 15
+      @max_files            = options[:max_files] || 10_000
+      @scan_dot_directories = options[:scan_dot_directories] || false
+    end
+
+    def paths
+      return @paths unless @paths.nil?
+      begin
+        @paths = []
+        @depth = 0
+        @files = 0
+        @prefix_len = @path.chomp('/').length
+        add_paths_for_directory @path, @paths
+      rescue FileLimitExceeded
+      end
+      @paths
+    end
+
+    def flush
+      @paths = nil
+    end
+
+    def path= str
+      if @path != str
+        @path = str
+        flush
+      end
+    end
+
+  private
+
+    def path_excluded? path
+      # first strip common prefix (@path) from path to match VIM's behavior
+      path = path[(@prefix_len + 1)..-1]
+      path = VIM::escape_for_single_quotes path
+      ::VIM::evaluate("empty(expand(fnameescape('#{path}')))").to_i == 1
+    end
+
+    def add_paths_for_directory dir, accumulator
+      Dir.foreach(dir) do |entry|
+        next if ['.', '..'].include?(entry)
+        path = File.join(dir, entry)
+        unless path_excluded?(path)
+          if File.file?(path)
+            @files += 1
+            raise FileLimitExceeded if @files > @max_files
+            accumulator << path[@prefix_len + 1..-1]
+          elsif File.directory?(path)
+            next if @depth >= @max_depth
+            next if (entry.match(/\A\./) && !@scan_dot_directories)
+            @depth += 1
+            add_paths_for_directory path, accumulator
+            @depth -= 1
+          end
+        end
+      end
+    rescue Errno::EACCES
+      # skip over directories for which we don't have access
+    end
+  end # class FileScanner
+end # module CommandT
+ruby/command-t/scanner.rb      [[[1
+28
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim'
+
+module CommandT
+  class Scanner; end
+end # module CommandT
+ruby/command-t/settings.rb     [[[1
+77
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  # Convenience class for saving and restoring global settings.
+  class Settings
+    def initialize
+      save
+    end
+
+    def save
+      @timeoutlen     = get_number 'timeoutlen'
+      @report         = get_number 'report'
+      @sidescroll     = get_number 'sidescroll'
+      @sidescrolloff  = get_number 'sidescrolloff'
+      @timeout        = get_bool 'timeout'
+      @equalalways    = get_bool 'equalalways'
+      @hlsearch       = get_bool 'hlsearch'
+      @insertmode     = get_bool 'insertmode'
+      @showcmd        = get_bool 'showcmd'
+    end
+
+    def restore
+      set_number 'timeoutlen', @timeoutlen
+      set_number 'report', @report
+      set_number 'sidescroll', @sidescroll
+      set_number 'sidescrolloff', @sidescrolloff
+      set_bool 'timeout', @timeout
+      set_bool 'equalalways', @equalalways
+      set_bool 'hlsearch', @hlsearch
+      set_bool 'insertmode', @insertmode
+      set_bool 'showcmd', @showcmd
+    end
+
+  private
+
+    def get_number setting
+      ::VIM::evaluate("&#{setting}").to_i
+    end
+
+    def get_bool setting
+      ::VIM::evaluate("&#{setting}").to_i == 1
+    end
+
+    def set_number setting, value
+      ::VIM::set_option "#{setting}=#{value}"
+    end
+
+    def set_bool setting, value
+      if value
+        ::VIM::set_option setting
+      else
+        ::VIM::set_option "no#{setting}"
+      end
+    end
+  end # class Settings
+end # module CommandT
+ruby/command-t/stub.rb [[[1
+46
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  class Stub
+    @@load_error = ['command-t.vim could not load the C extension',
+                    'Please see INSTALLATION and TROUBLE-SHOOTING in the help',
+                    'For more information type:    :help command-t']
+
+    def show_file_finder
+      warn *@@load_error
+    end
+
+    def flush
+      warn *@@load_error
+    end
+
+  private
+
+    def warn *msg
+      ::VIM::command 'echohl WarningMsg'
+      msg.each { |m| ::VIM::command "echo '#{m}'" }
+      ::VIM::command 'echohl none'
+    end
+  end # class Stub
+end # module CommandT
+ruby/command-t/vim/path_utilities.rb   [[[1
+40
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim'
+
+module CommandT
+  module VIM
+    module PathUtilities
+
+    private
+
+      def relative_path_under_working_directory path
+        # any path under the working directory will be specified as a relative
+        # path to improve the readability of the buffer list etc
+        pwd = File.expand_path(VIM::pwd) + '/'
+        path.index(pwd) == 0 ? path[pwd.length..-1] : path
+      end
+    end # module PathUtilities
+  end # module VIM
+end # module CommandT
+ruby/command-t/vim/screen.rb   [[[1
+32
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  module VIM
+    module Screen
+      def self.lines
+        ::VIM::evaluate('&lines').to_i
+      end
+    end # module Screen
+  end # module VIM
+end # module CommandT
+ruby/command-t/vim/window.rb   [[[1
+38
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  module VIM
+    class Window
+      def self.select window
+        return true if $curwin == window
+        initial = $curwin
+        while true do
+          ::VIM::command 'wincmd w'           # cycle through windows
+          return true if $curwin == window    # have selected desired window
+          return false if $curwin == initial  # have already looped through all
+        end
+      end
+    end # class Window
+  end # module VIM
+end # module CommandT
+ruby/command-t/vim.rb  [[[1
+43
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim/screen'
+require 'command-t/vim/window'
+
+module CommandT
+  module VIM
+    def self.has_syntax?
+      ::VIM::evaluate('has("syntax")').to_i != 0
+    end
+
+    def self.pwd
+      ::VIM::evaluate 'getcwd()'
+    end
+
+    # Escape a string for safe inclusion in a Vim single-quoted string
+    # (single quotes escaped by doubling, everything else is literal)
+    def self.escape_for_single_quotes str
+      str.gsub "'", "''"
+    end
+  end # module VIM
+end # module CommandT
+ruby/command-t/ext.c   [[[1
+65
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "match.h"
+#include "matcher.h"
+
+VALUE mCommandT         = 0; // module CommandT
+VALUE cCommandTMatch    = 0; // class CommandT::Match
+VALUE cCommandTMatcher  = 0; // class CommandT::Matcher
+
+VALUE CommandT_option_from_hash(const char *option, VALUE hash)
+{
+    if (NIL_P(hash))
+        return Qnil;
+    VALUE key = ID2SYM(rb_intern(option));
+    if (rb_funcall(hash, rb_intern("has_key?"), 1, key) == Qtrue)
+        return rb_hash_aref(hash, key);
+    else
+        return Qnil;
+}
+
+void Init_ext()
+{
+    // module CommandT
+    mCommandT = rb_define_module("CommandT");
+
+    // class CommandT::Match
+    cCommandTMatch = rb_define_class_under(mCommandT, "Match", rb_cObject);
+
+    // methods
+    rb_define_method(cCommandTMatch, "initialize", CommandTMatch_initialize, -1);
+    rb_define_method(cCommandTMatch, "matches?", CommandTMatch_matches, 0);
+    rb_define_method(cCommandTMatch, "to_s", CommandTMatch_to_s, 0);
+
+    // attributes
+    rb_define_attr(cCommandTMatch, "score", Qtrue, Qfalse); // reader: true, writer: false
+
+    // class CommandT::Matcher
+    cCommandTMatcher = rb_define_class_under(mCommandT, "Matcher", rb_cObject);
+
+    // methods
+    rb_define_method(cCommandTMatcher, "initialize", CommandTMatcher_initialize, -1);
+    rb_define_method(cCommandTMatcher, "sorted_matches_for", CommandTMatcher_sorted_matches_for, 2);
+    rb_define_method(cCommandTMatcher, "matches_for", CommandTMatcher_matches_for, 1);
+}
+ruby/command-t/match.c [[[1
+189
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "match.h"
+#include "ext.h"
+#include "ruby_compat.h"
+
+// use a struct to make passing params during recursion easier
+typedef struct
+{
+    char    *str_p;                 // pointer to string to be searched
+    long    str_len;                // length of same
+    char    *abbrev_p;              // pointer to search string (abbreviation)
+    long    abbrev_len;             // length of same
+    double  max_score_per_char;
+    int     dot_file;               // boolean: true if str is a dot-file
+    int     always_show_dot_files;  // boolean
+    int     never_show_dot_files;   // boolean
+} matchinfo_t;
+
+double recursive_match(matchinfo_t *m,  // sharable meta-data
+                       long str_idx,    // where in the path string to start
+                       long abbrev_idx, // where in the search string to start
+                       long last_idx,   // location of last matched character
+                       double score)    // cumulative score so far
+{
+    double seen_score = 0;      // remember best score seen via recursion
+    int dot_file_match = 0;     // true if abbrev matches a dot-file
+    int dot_search = 0;         // true if searching for a dot
+
+    for (long i = abbrev_idx; i < m->abbrev_len; i++)
+    {
+        char c = m->abbrev_p[i];
+        if (c == '.')
+            dot_search = 1;
+        int found = 0;
+        for (long j = str_idx; j < m->str_len; j++, str_idx++)
+        {
+            char d = m->str_p[j];
+            if (d == '.')
+            {
+                if (j == 0 || m->str_p[j - 1] == '/')
+                {
+                    m->dot_file = 1;        // this is a dot-file
+                    if (dot_search)         // and we are searching for a dot
+                        dot_file_match = 1; // so this must be a match
+                }
+            }
+            else if (d >= 'A' && d <= 'Z')
+                d += 'a' - 'A'; // add 32 to downcase
+            if (c == d)
+            {
+                found = 1;
+                dot_search = 0;
+
+                // calculate score
+                double score_for_char = m->max_score_per_char;
+                long distance = j - last_idx;
+                if (distance > 1)
+                {
+                    double factor = 1.0;
+                    char last = m->str_p[j - 1];
+                    char curr = m->str_p[j]; // case matters, so get again
+                    if (last == '/')
+                        factor = 0.9;
+                    else if (last == '-' ||
+                            last == '_' ||
+                            last == ' ' ||
+                            (last >= '0' && last <= '9'))
+                        factor = 0.8;
+                    else if (last >= 'a' && last <= 'z' &&
+                            curr >= 'A' && curr <= 'Z')
+                        factor = 0.8;
+                    else if (last == '.')
+                        factor = 0.7;
+                    else
+                        // if no "special" chars behind char, factor diminishes
+                        // as distance from last matched char increases
+                        factor = (1.0 / distance) * 0.75;
+                    score_for_char *= factor;
+                }
+
+                if (++j < m->str_len)
+                {
+                    // bump cursor one char to the right and
+                    // use recursion to try and find a better match
+                    double sub_score = recursive_match(m, j, i, last_idx, score);
+                    if (sub_score > seen_score)
+                        seen_score = sub_score;
+                }
+
+                score += score_for_char;
+                last_idx = str_idx++;
+                break;
+            }
+        }
+        if (!found)
+            return 0.0;
+    }
+    if (m->dot_file)
+    {
+        if (m->never_show_dot_files ||
+            (!dot_file_match && !m->always_show_dot_files))
+            return 0.0;
+    }
+    return (score > seen_score) ? score : seen_score;
+}
+
+// Match.new abbrev, string, options = {}
+VALUE CommandTMatch_initialize(int argc, VALUE *argv, VALUE self)
+{
+    // process arguments: 2 mandatory, 1 optional
+    VALUE str, abbrev, options;
+    if (rb_scan_args(argc, argv, "21", &str, &abbrev, &options) == 2)
+        options = Qnil;
+    str             = StringValue(str);
+    abbrev          = StringValue(abbrev); // already downcased by caller
+
+    // check optional options hash for overrides
+    VALUE always_show_dot_files = CommandT_option_from_hash("always_show_dot_files", options);
+    VALUE never_show_dot_files = CommandT_option_from_hash("never_show_dot_files", options);
+
+    matchinfo_t m;
+    m.str_p                 = RSTRING_PTR(str);
+    m.str_len               = RSTRING_LEN(str);
+    m.abbrev_p              = RSTRING_PTR(abbrev);
+    m.abbrev_len            = RSTRING_LEN(abbrev);
+    m.max_score_per_char    = (1.0 / m.str_len + 1.0 / m.abbrev_len) / 2;
+    m.dot_file              = 0;
+    m.always_show_dot_files = always_show_dot_files == Qtrue;
+    m.never_show_dot_files  = never_show_dot_files == Qtrue;
+
+    // calculate score
+    double score = 1.0;
+    if (m.abbrev_len == 0) // special case for zero-length search string
+    {
+        // filter out dot files
+        if (!m.always_show_dot_files)
+        {
+            for (long i = 0; i < m.str_len; i++)
+            {
+                char c = m.str_p[i];
+                if (c == '.' && (i == 0 || m.str_p[i - 1] == '/'))
+                {
+                    score = 0.0;
+                    break;
+                }
+            }
+        }
+    }
+    else // normal case
+        score = recursive_match(&m, 0, 0, 0, 0.0);
+
+    // clean-up and final book-keeping
+    rb_iv_set(self, "@score", rb_float_new(score));
+    rb_iv_set(self, "@str", str);
+    return Qnil;
+}
+
+VALUE CommandTMatch_matches(VALUE self)
+{
+    double score = NUM2DBL(rb_iv_get(self, "@score"));
+    return score > 0 ? Qtrue : Qfalse;
+}
+
+VALUE CommandTMatch_to_s(VALUE self)
+{
+    return rb_iv_get(self, "@str");
+}
+ruby/command-t/matcher.c       [[[1
+164
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdlib.h> /* for qsort() */
+#include <string.h> /* for strcmp() */
+#include "matcher.h"
+#include "ext.h"
+#include "ruby_compat.h"
+
+// comparison function for use with qsort
+int comp_alpha(const void *a, const void *b)
+{
+    VALUE a_val = *(VALUE *)a;
+    VALUE b_val = *(VALUE *)b;
+    ID to_s = rb_intern("to_s");
+
+    VALUE a_str = rb_funcall(a_val, to_s, 0);
+    VALUE b_str = rb_funcall(b_val, to_s, 0);
+    char *a_p = RSTRING_PTR(a_str);
+    long a_len = RSTRING_LEN(a_str);
+    char *b_p = RSTRING_PTR(b_str);
+    long b_len = RSTRING_LEN(b_str);
+    int order = 0;
+    if (a_len > b_len)
+    {
+        order = strncmp(a_p, b_p, b_len);
+        if (order == 0)
+            order = 1; // shorter string (b) wins
+    }
+    else if (a_len < b_len)
+    {
+        order = strncmp(a_p, b_p, a_len);
+        if (order == 0)
+            order = -1; // shorter string (a) wins
+    }
+    else
+        order = strncmp(a_p, b_p, a_len);
+    return order;
+}
+
+// comparison function for use with qsort
+int comp_score(const void *a, const void *b)
+{
+    VALUE a_val = *(VALUE *)a;
+    VALUE b_val = *(VALUE *)b;
+    ID score = rb_intern("score");
+    double a_score = RFLOAT_VALUE(rb_funcall(a_val, score, 0));
+    double b_score = RFLOAT_VALUE(rb_funcall(b_val, score, 0));
+    if (a_score > b_score)
+        return -1; // a scores higher, a should appear sooner
+    else if (a_score < b_score)
+        return 1;  // b scores higher, a should appear later
+    else
+        return comp_alpha(a, b);
+}
+
+VALUE CommandTMatcher_initialize(int argc, VALUE *argv, VALUE self)
+{
+    // process arguments: 1 mandatory, 1 optional
+    VALUE scanner, options;
+    if (rb_scan_args(argc, argv, "11", &scanner, &options) == 1)
+        options = Qnil;
+    if (NIL_P(scanner))
+        rb_raise(rb_eArgError, "nil scanner");
+    rb_iv_set(self, "@scanner", scanner);
+
+    // check optional options hash for overrides
+    VALUE always_show_dot_files = CommandT_option_from_hash("always_show_dot_files", options);
+    if (always_show_dot_files != Qtrue)
+        always_show_dot_files = Qfalse;
+    VALUE never_show_dot_files = CommandT_option_from_hash("never_show_dot_files", options);
+    if (never_show_dot_files != Qtrue)
+        never_show_dot_files = Qfalse;
+    rb_iv_set(self, "@always_show_dot_files", always_show_dot_files);
+    rb_iv_set(self, "@never_show_dot_files", never_show_dot_files);
+    return Qnil;
+}
+
+VALUE CommandTMatcher_sorted_matches_for(VALUE self, VALUE abbrev, VALUE options)
+{
+    // process optional options hash
+    VALUE limit_option = CommandT_option_from_hash("limit", options);
+
+    // get unsorted matches
+    VALUE matches = CommandTMatcher_matches_for(self, abbrev);
+
+    abbrev = StringValue(abbrev);
+    if (RSTRING_LEN(abbrev) == 0 ||
+        (RSTRING_LEN(abbrev) == 1 && RSTRING_PTR(abbrev)[0] == '.'))
+        // alphabetic order if search string is only "" or "."
+        qsort(RARRAY_PTR(matches), RARRAY_LEN(matches), sizeof(VALUE), comp_alpha);
+    else
+        // for all other non-empty search strings, sort by score
+        qsort(RARRAY_PTR(matches), RARRAY_LEN(matches), sizeof(VALUE), comp_score);
+
+    // apply optional limit option
+    long limit = NIL_P(limit_option) ? 0 : NUM2LONG(limit_option);
+    if (limit == 0 || RARRAY_LEN(matches) < limit)
+        limit = RARRAY_LEN(matches);
+
+    // will return an array of strings, not an array of Match objects
+    for (long i = 0; i < limit; i++)
+    {
+        VALUE str = rb_funcall(RARRAY_PTR(matches)[i], rb_intern("to_s"), 0);
+        RARRAY_PTR(matches)[i] = str;
+    }
+
+    // trim off any items beyond the limit
+    if (limit < RARRAY_LEN(matches))
+        (void)rb_funcall(matches, rb_intern("slice!"), 2, LONG2NUM(limit),
+            LONG2NUM(RARRAY_LEN(matches) - limit));
+    return matches;
+}
+
+VALUE CommandTMatcher_matches_for(VALUE self, VALUE abbrev)
+{
+    if (NIL_P(abbrev))
+        rb_raise(rb_eArgError, "nil abbrev");
+    VALUE matches = rb_ary_new();
+    VALUE scanner = rb_iv_get(self, "@scanner");
+    VALUE always_show_dot_files = rb_iv_get(self, "@always_show_dot_files");
+    VALUE never_show_dot_files = rb_iv_get(self, "@never_show_dot_files");
+    VALUE options = Qnil;
+    if (always_show_dot_files == Qtrue)
+    {
+        options = rb_hash_new();
+        rb_hash_aset(options, ID2SYM(rb_intern("always_show_dot_files")), always_show_dot_files);
+    }
+    else if (never_show_dot_files == Qtrue)
+    {
+        options = rb_hash_new();
+        rb_hash_aset(options, ID2SYM(rb_intern("never_show_dot_files")), never_show_dot_files);
+    }
+    abbrev = rb_funcall(abbrev, rb_intern("downcase"), 0);
+    VALUE paths = rb_funcall(scanner, rb_intern("paths"), 0);
+    for (long i = 0, max = RARRAY_LEN(paths); i < max; i++)
+    {
+        VALUE path = RARRAY_PTR(paths)[i];
+        VALUE match = rb_funcall(cCommandTMatch, rb_intern("new"), 3, path, abbrev, options);
+        if (rb_funcall(match, rb_intern("matches?"), 0) == Qtrue)
+            rb_funcall(matches, rb_intern("push"), 1, match);
+    }
+    return matches;
+}
+ruby/command-t/ext.h   [[[1
+36
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <ruby.h>
+
+extern VALUE mCommandT;         // module CommandT
+extern VALUE cCommandTMatch;    // class CommandT::Match
+extern VALUE cCommandTMatcher;  // class CommandT::Matcher
+
+// Encapsulates common pattern of checking for an option in an optional
+// options hash. The hash itself may be nil, but an exception will be
+// raised if it is not nil and not a hash.
+VALUE CommandT_option_from_hash(const char *option, VALUE hash);
+
+// Debugging macro.
+#define ruby_inspect(obj) rb_funcall(rb_mKernel, rb_intern("p"), 1, obj)
+ruby/command-t/match.h [[[1
+29
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <ruby.h>
+
+extern VALUE CommandTMatch_initialize(int argc, VALUE *argv, VALUE self);
+extern VALUE CommandTMatch_matches(VALUE self);
+extern VALUE CommandTMatch_score(VALUE self);
+extern VALUE CommandTMatch_to_s(VALUE self);
+ruby/command-t/matcher.h       [[[1
+30
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <ruby.h>
+
+extern VALUE CommandTMatcher_initialize(int argc, VALUE *argv, VALUE self);
+extern VALUE CommandTMatcher_sorted_matches_for(VALUE self, VALUE abbrev, VALUE options);
+
+// most likely the function will be subsumed by the sorted_matcher_for function
+extern VALUE CommandTMatcher_matches_for(VALUE self, VALUE abbrev);
+ruby/command-t/ruby_compat.h   [[[1
+49
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <ruby.h>
+
+// for compatibility with older versions of Ruby which don't declare RSTRING_PTR
+#ifndef RSTRING_PTR
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#endif
+
+// for compatibility with older versions of Ruby which don't declare RSTRING_LEN
+#ifndef RSTRING_LEN
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+
+// for compatibility with older versions of Ruby which don't declare RARRAY_PTR
+#ifndef RARRAY_PTR
+#define RARRAY_PTR(a) (RARRAY(a)->ptr)
+#endif
+
+// for compatibility with older versions of Ruby which don't declare RARRAY_LEN
+#ifndef RARRAY_LEN
+#define RARRAY_LEN(a) (RARRAY(a)->len)
+#endif
+
+// for compatibility with older versions of Ruby which don't declare RFLOAT_VALUE
+#ifndef RFLOAT_VALUE
+#define RFLOAT_VALUE(f) (RFLOAT(f)->value)
+#endif
+ruby/command-t/depend  [[[1
+24
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+CFLAGS += -std=c99 -Wall -Wextra -Wno-unused-parameter
+doc/command-t.txt      [[[1
+786
+*command-t.txt* Command-T plug-in for Vim         *command-t*
+
+CONTENTS                                        *command-t-contents*
+
+ 1. Introduction            |command-t-intro|
+ 2. Requirements            |command-t-requirements|
+ 3. Installation            |command-t-installation|
+ 3. Managing using Pathogen |command-t-pathogen|
+ 4. Trouble-shooting        |command-t-trouble-shooting|
+ 5. Usage                   |command-t-usage|
+ 6. Commands                |command-t-commands|
+ 7. Mappings                |command-t-mappings|
+ 8. Options                 |command-t-options|
+ 9. Authors                 |command-t-authors|
+10. Website                 |command-t-website|
+11. Donations               |command-t-donations|
+12. License                 |command-t-license|
+13. History                 |command-t-history|
+
+
+INTRODUCTION                                    *command-t-intro*
+
+The Command-T plug-in provides an extremely fast, intuitive mechanism for
+opening files and buffers with a minimal number of keystrokes. It's named
+"Command-T" because it is inspired by the "Go to File" window bound to
+Command-T in TextMate.
+
+Files are selected by typing characters that appear in their paths, and are
+ordered by an algorithm which knows that characters that appear in certain
+locations (for example, immediately after a path separator) should be given
+more weight.
+
+To search efficiently, especially in large projects, you should adopt a
+"path-centric" rather than a "filename-centric" mentality. That is you should
+think more about where the desired file is found rather than what it is
+called. This means narrowing your search down by including some characters
+from the upper path components rather than just entering characters from the
+filename itself.
+
+Screencasts demonstrating the plug-in can be viewed at:
+
+  https://wincent.com/products/command-t
+
+
+REQUIREMENTS                                    *command-t-requirements*
+
+The plug-in requires Vim compiled with Ruby support, a compatible Ruby
+installation at the operating system level, and a C compiler to build
+the Ruby extension.
+
+
+1. Vim compiled with Ruby support
+
+You can check for Ruby support by launching Vim with the --version switch:
+
+  vim --version
+
+If "+ruby" appears in the version information then your version of Vim has
+Ruby support.
+
+Another way to check is to simply try using the :ruby command from within Vim
+itself:
+
+  :ruby 1
+
+If your Vim lacks support you'll see an error message like this:
+
+  E319: Sorry, the command is not available in this version
+
+The version of Vim distributed with Mac OS X does not include Ruby support,
+while MacVim does; it is available from:
+
+  http://github.com/b4winckler/macvim/downloads
+
+For Windows users, the Vim 7.2 executable available from www.vim.org does
+include Ruby support, and is recommended over version 7.3 (which links against
+Ruby 1.9, but apparently has some bugs that need to be resolved).
+
+
+2. Ruby
+
+In addition to having Ruby support in Vim, your system itself must have a
+compatible Ruby install. "Compatible" means the same version as Vim itself
+links against. If you use a different version then Command-T is unlikely
+to work (see TROUBLE-SHOOTING below).
+
+On Mac OS X Snow Leopard, the system comes with Ruby 1.8.7 and all recent
+versions of MacVim (the 7.2 snapshots and 7.3) are linked against it.
+
+On Linux and similar platforms, the linked version of Ruby will depend on
+your distribution. You can usually find this out by examining the
+compilation and linking flags displayed by the |:version| command in Vim, and
+by looking at the output of:
+
+  :ruby puts RUBY_VERSION
+
+A suitable Ruby environment for Windows can be installed using the Ruby
+1.8.7-p299 RubyInstaller available at:
+
+  http://rubyinstaller.org/downloads/archives
+
+If using RubyInstaller be sure to download the installer executable, not the
+7-zip archive. When installing mark the checkbox "Add Ruby executables to your
+PATH" so that Vim can find them.
+
+
+3. C compiler
+
+Part of Command-T is implemented in C as a Ruby extension for speed, allowing
+it to work responsively even on directory hierarchies containing enormous
+numbers of files. As such, a C compiler is required in order to build the
+extension and complete the installation.
+
+On Mac OS X, this can be obtained by installing the Xcode Tools that come on
+the Mac OS X install disc.
+
+On Windows, the RubyInstaller Development Kit can be used to conveniently
+install the necessary tool chain:
+
+  http://rubyinstaller.org/downloads/archives
+
+At the time of writing, the appropriate development kit for use with Ruby
+1.8.7 is DevKit-3.4.5r3-20091110.
+
+To use the Development Kit extract the archive contents to your C:\Ruby
+folder.
+
+
+INSTALLATION                                    *command-t-installation*
+
+Command-T is distributed as a "vimball" which means that it can be installed
+by opening it in Vim and then sourcing it:
+
+  :e command-t.vba
+  :so %
+
+The files will be installed in your |'runtimepath'|. To check where this is
+you can issue:
+
+  :echo &rtp
+
+The C extension must then be built, which can be done from the shell. If you
+use a typical |'runtimepath'| then the files were installed inside ~/.vim and
+you can build the extension with:
+
+  cd ~/.vim/ruby/command-t
+  ruby extconf.rb
+  make
+
+Note: If you are an RVM user, you must perform the build using the same
+version of Ruby that Vim itself is linked against. This will often be the
+system Ruby, which can be selected before issuing the "make" command with:
+
+  rvm use system
+
+
+MANAGING USING PATHOGEN                         *command-t-pathogen*
+
+Pathogen is a plugin that allows you to maintain plugin installations in
+separate, isolated subdirectories under the "bundle" directory in your
+|'runtimepath'|. The following examples assume that you already have
+Pathogen installed and configured, and that you are installing into
+~/.vim/bundle. For more information about Pathogen, see:
+
+  http://www.vim.org/scripts/script.php?script_id=2332
+
+If you manage your entire ~/.vim folder using Git then you can add the
+Command-T repository as a submodule:
+
+  cd ~/.vim
+  git submodule add git://git.wincent.com/command-t.git bundle/command-t
+  git submodule init
+
+Or if you just wish to do a simple clone instead of using submodules:
+
+  cd ~/.vim
+  git clone git://git.wincent.com/command-t.git bundle/command-t
+
+Once you have a local copy of the repository you can update it at any time
+with:
+
+  cd ~/.vim/bundle/command-t
+  git pull
+
+Or you can switch to a specific release with:
+
+  cd ~/.vim/bundle/command-t
+  git checkout 0.8b
+
+After installing or updating you must build the extension:
+
+  cd ~/.vim/bundle/command-t
+  rake make
+
+While the Vimball installation automatically generates the help tags, under
+Pathogen it is necessary to do so explicitly from inside Vim:
+
+  :call pathogen#helptags()
+
+
+TROUBLE-SHOOTING                                *command-t-trouble-shooting*
+
+Most installation problems are caused by a mismatch between the version of
+Ruby on the host operating system, and the version of Ruby that Vim itself
+linked against at compile time. For example, if one is 32-bit and the other is
+64-bit, or one is from the Ruby 1.9 series and the other is from the 1.8
+series, then the plug-in is not likely to work.
+
+As such, on Mac OS X, I recommend using the standard Ruby that comes with the
+system (currently 1.8.7) along with the latest version of MacVim (currently
+version 7.3). If you wish to use custom builds of Ruby or of MacVim (not
+recommmended) then you will have to take extra care to ensure that the exact
+same Ruby environment is in effect when building Ruby, Vim and the Command-T
+extension.
+
+For Windows, the following combination is known to work:
+
+  - Vim 7.2 from http://www.vim.org/download.php:
+      ftp://ftp.vim.org/pub/vim/pc/gvim72.exe
+  - Ruby 1.8.7-p299 from http://rubyinstaller.org/downloads/archives:
+      http://rubyforge.org/frs/download.php/71492/rubyinstaller-1.8.7-p299.exe
+  - DevKit 3.4.5r3-20091110 from http://rubyinstaller.org/downloads/archives:
+      http://rubyforge.org/frs/download.php/66888/devkit-3.4.5r3-20091110.7z
+
+If a problem occurs the first thing you should do is inspect the output of:
+
+  ruby extconf.rb
+  make
+
+During the installation, and:
+
+  vim --version
+
+And compare the compilation and linker flags that were passed to the
+extension and to Vim itself when they were built. If the Ruby-related
+flags or architecture flags are different then it is likely that something
+has changed in your Ruby environment and the extension may not work until
+you eliminate the discrepancy.
+
+
+USAGE                                           *command-t-usage*
+
+Bring up the Command-T file window by typing:
+
+  <Leader>t
+
+This mapping is set up automatically for you, provided you do not already have
+a mapping for <Leader>t or |:CommandT|. You can also bring up the file window
+by issuing the command:
+
+  :CommandT
+
+A prompt will appear at the bottom of the screen along with a file window
+showing all of the files in the current directory (as returned by the
+|:pwd| command).
+
+For the most efficient file navigation within a project it's recommended that
+you |:cd| into the root directory of your project when starting to work on it.
+If you wish to open a file from outside of the project folder you can pass in
+an optional path argument (relative or absolute) to |:CommandT|:
+
+  :CommandT ../path/to/other/files
+
+Type letters in the prompt to narrow down the selection, showing only the
+files whose paths contain those letters in the specified order. Letters do not
+need to appear consecutively in a path in order for it to be classified as a
+match.
+
+Once the desired file has been selected it can be opened by pressing <CR>.
+(By default files are opened in the current window, but there are other
+mappings that you can use to open in a vertical or horizontal split, or in
+a new tab.) Note that if you have |'nohidden'| set and there are unsaved
+changes in the current window when you press <CR> then opening in the current
+window would fail; in this case Command-T will open the file in a new split.
+
+The following mappings are active when the prompt has focus:
+
+    <BS>        delete the character to the left of the cursor
+    <Del>       delete the character at the cursor
+    <Left>      move the cursor one character to the left
+    <C-h>       move the cursor one character to the left
+    <Right>     move the cursor one character to the right
+    <C-l>       move the cursor one character to the right
+    <C-a>       move the cursor to the start (left)
+    <C-e>       move the cursor to the end (right)
+    <C-u>       clear the contents of the prompt
+    <Tab>       change focus to the file listing
+
+The following mappings are active when the file listing has focus:
+
+    <Tab>       change focus to the prompt
+
+The following mappings are active when either the prompt or the file listing
+has focus:
+
+    <CR>        open the selected file
+    <C-CR>      open the selected file in a new split window
+    <C-s>       open the selected file in a new split window
+    <C-v>       open the selected file in a new vertical split window
+    <C-t>       open the selected file in a new tab
+    <C-j>       select next file in the file listing
+    <C-n>       select next file in the file listing
+    <Down>      select next file in the file listing
+    <C-k>       select previous file in the file listing
+    <C-p>       select previous file in the file listing
+    <Up>        select previous file in the file listing
+    <C-c>       cancel (dismisses file listing)
+
+The following is also available on terminals which support it:
+
+    <Esc>       cancel (dismisses file listing)
+
+Note that the default mappings can be overriden by setting options in your
+~/.vimrc file (see the OPTIONS section for a full list of available options).
+
+In addition, when the file listing has focus, typing a character will cause
+the selection to jump to the first path which begins with that character.
+Typing multiple characters consecutively can be used to distinguish between
+paths which begin with the same prefix.
+
+
+COMMANDS                                        *command-t-commands*
+
+                                                *:CommandT*
+|:CommandT|     Brings up the Command-T file window, starting in the
+                current working directory as returned by the|:pwd|
+                command.
+
+                                                *:CommandTBuffer*
+|:CommandTBuffer|Brings up the Command-T buffer window.
+                This works exactly like the standard file window,
+                except that the selection is limited to files that
+                you already have open in buffers.
+
+                                                *:CommandTFlush*
+|:CommandTFlush|Instructs the plug-in to flush its path cache, causing
+                the directory to be rescanned for new or deleted paths
+                the next time the file window is shown. In addition, all
+                configuration settings are re-evaluated, causing any
+                changes made to settings via the |:let| command to be picked
+                up.
+
+
+MAPPINGS                                        *command-t-mappings*
+
+By default Command-T comes with only two mappings:
+
+  <Leader>t     bring up the Command-T file window
+  <Leader>b     bring up the Command-T buffer window
+
+However, Command-T won't overwrite a pre-existing mapping so if you prefer
+to define different mappings use lines like these in your ~/.vimrc:
+
+  nmap <silent> <Leader>t :CommandT<CR>
+  nmap <silent> <Leader>b :CommandTBuffer<CR>
+
+Replacing "<Leader>t" or "<Leader>b" with your mapping of choice.
+
+Note that in the case of MacVim you actually can map to Command-T (written
+as <D-t> in Vim) in your ~/.gvimrc file if you first unmap the existing menu
+binding of Command-T to "New Tab":
+
+  if has("gui_macvim")
+    macmenu &File.New\ Tab key=<nop>
+    map <D-t> :CommandT<CR>
+  endif
+
+When the Command-T window is active a number of other additional mappings
+become available for doing things like moving between and selecting matches.
+These are fully described above in the USAGE section, and settings for
+overriding the mappings are listed below under OPTIONS.
+
+
+OPTIONS                                         *command-t-options*
+
+A number of options may be set in your ~/.vimrc to influence the behaviour of
+the plug-in. To set an option, you include a line like this in your ~/.vimrc:
+
+    let g:CommandTMaxFiles=20000
+
+To have Command-T pick up new settings immediately (that is, without having
+to restart Vim) you can issue the |:CommandTFlush| command after making
+changes via |:let|.
+
+Following is a list of all available options:
+
+                                               *g:CommandTMaxFiles*
+  |g:CommandTMaxFiles|                           number (default 10000)
+
+      The maximum number of files that will be considered when scanning the
+      current directory. Upon reaching this number scanning stops. This
+      limit applies only to file listings and is ignored for buffer
+      listings.
+
+                                               *g:CommandTMaxDepth*
+  |g:CommandTMaxDepth|                           number (default 15)
+
+      The maximum depth (levels of recursion) to be explored when scanning the
+      current directory. Any directories at levels beyond this depth will be
+      skipped.
+
+                                               *g:CommandTMaxHeight*
+  |g:CommandTMaxHeight|                          number (default: 0)
+
+      The maximum height in lines the match window is allowed to expand to.
+      If set to 0, the window will occupy as much of the available space as
+      needed to show matching entries.
+
+                                               *g:CommandTAlwaysShowDotFiles*
+  |g:CommandTAlwaysShowDotFiles|                 boolean (default: 0)
+
+      When showing the file listing Command-T will by default show dot-files
+      only if the entered search string contains a dot that could cause a
+      dot-file to match. When set to a non-zero value, this setting instructs
+      Command-T to always include matching dot-files in the match list
+      regardless of whether the search string contains a dot. See also
+      |g:CommandTNeverShowDotFiles|. Note that this setting only influences
+      the file listing; the buffer listing treats dot-files like any other
+      file.
+
+                                               *g:CommandTNeverShowDotFiles*
+  |g:CommandTNeverShowDotFiles|                  boolean (default: 0)
+
+      In the file listing, Command-T will by default show dot-files if the
+      entered search string contains a dot that could cause a dot-file to
+      match. When set to a non-zero value, this setting instructs Command-T to
+      never show dot-files under any circumstances. Note that it is
+      contradictory to set both this setting and
+      |g:CommandTAlwaysShowDotFiles| to true, and if you do so Vim will suffer
+      from headaches, nervous twitches, and sudden mood swings. This setting
+      has no effect in buffer listings, where dot files are treated like any
+      other file.
+
+                                               *g:CommandTScanDotDirectories*
+  |g:CommandTScanDotDirectories|                 boolean (default: 0)
+
+      Normally Command-T will not recurse into "dot-directories" (directories
+      whose names begin with a dot) while performing its initial scan. Set
+      this setting to a non-zero value to override this behavior and recurse.
+      Note that this setting is completely independent of the
+      |g:CommandTAlwaysShowDotFiles| and |g:CommandTNeverShowDotFiles|
+      settings; those apply only to the selection and display of matches
+      (after scanning has been performed), whereas
+      |g:CommandTScanDotDirectories| affects the behaviour at scan-time.
+
+      Note also that even with this setting off you can still use Command-T to
+      open files inside a "dot-directory" such as ~/.vim, but you have to use
+      the |:cd| command to change into that directory first. For example:
+
+        :cd ~/.vim
+        :CommandT
+
+                                               *g:CommandTMatchWindowAtTop*
+  |g:CommandTMatchWindowAtTop|                   boolean (default: 0)
+
+      When this setting is off (the default) the match window will appear at
+      the bottom so as to keep it near to the prompt. Turning it on causes the
+      match window to appear at the top instead. This may be preferable if you
+      want the best match (usually the first one) to appear in a fixed location
+      on the screen rather than moving as the number of matches changes during
+      typing.
+
+                                                *g:CommandTMatchWindowReverse*
+  |g:CommandTMatchWindowReverse|                  boolean (default: 0)
+
+      When this setting is off (the default) the matches will appear from
+      top to bottom with the topmost being selected. Turning it on causes the
+      matches to be reversed so the best match is at the bottom and the
+      initially selected match is the bottom most. This may be preferable if
+      you want the best match to appear in a fixed location on the screen
+      but still be near the prompt at the bottom.
+
+As well as the basic options listed above, there are a number of settings that
+can be used to override the default key mappings used by Command-T. For
+example, to set <C-x> as the mapping for cancelling (dismissing) the Command-T
+window, you would add the following to your ~/.vimrc:
+
+  let g:CommandTCancelMap='<C-x>'
+
+Multiple, alternative mappings may be specified using list syntax:
+
+  let g:CommandTCancelMap=['<C-x>', '<C-c>']
+
+Following is a list of all map settings and their defaults:
+
+                              Setting   Default mapping(s)
+
+                                      *g:CommandTBackspaceMap*
+              |g:CommandTBackspaceMap|  <BS>
+
+                                      *g:CommandTDeleteMap*
+                 |g:CommandTDeleteMap|  <Del>
+
+                                      *g:CommandTAcceptSelectionMap*
+        |g:CommandTAcceptSelectionMap|  <CR>
+
+                                      *g:CommandTAcceptSelectionSplitMap*
+   |g:CommandTAcceptSelectionSplitMap|  <C-CR>
+                                      <C-s>
+
+                                      *g:CommandTAcceptSelectionTabMap*
+     |g:CommandTAcceptSelectionTabMap|  <C-t>
+
+                                      *g:CommandTAcceptSelectionVSplitMap*
+  |g:CommandTAcceptSelectionVSplitMap|  <C-v>
+
+                                      *g:CommandTToggleFocusMap*
+            |g:CommandTToggleFocusMap|  <Tab>
+
+                                      *g:CommandTCancelMap*
+                 |g:CommandTCancelMap|  <C-c>
+                                      <Esc> (not on all terminals)
+
+                                      *g:CommandTSelectNextMap*
+             |g:CommandTSelectNextMap|  <C-n>
+                                      <C-j>
+                                      <Down>
+
+                                      *g:CommandTSelectPrevMap*
+             |g:CommandTSelectPrevMap|  <C-p>
+                                      <C-k>
+                                      <Up>
+
+                                      *g:CommandTClearMap*
+                  |g:CommandTClearMap|  <C-u>
+
+                                      *g:CommandTCursorLeftMap*
+             |g:CommandTCursorLeftMap|  <Left>
+                                      <C-h>
+
+                                      *g:CommandTCursorRightMap*
+            |g:CommandTCursorRightMap|  <Right>
+                                      <C-l>
+
+                                      *g:CommandTCursorEndMap*
+              |g:CommandTCursorEndMap|  <C-e>
+
+                                      *g:CommandTCursorStartMap*
+            |g:CommandTCursorStartMap|  <C-a>
+
+In addition to the options provided by Command-T itself, some of Vim's own
+settings can be used to control behavior:
+
+                                               *command-t-wildignore*
+  |'wildignore'|                                 string (default: '')
+
+      Vim's |'wildignore'| setting is used to determine which files should be
+      excluded from listings. This is a comma-separated list of glob patterns.
+      It defaults to the empty string, but common settings include "*.o,*.obj"
+      (to exclude object files) or ".git,.svn" (to exclude SCM metadata
+      directories). For example:
+
+        :set wildignore+=*.o,*.obj,.git
+
+      A pattern such as "vendor/rails/**" would exclude all files and
+      subdirectories inside the "vendor/rails" directory (relative to
+      directory Command-T starts in).
+
+      See the |'wildignore'| documentation for more information.
+
+
+AUTHORS                                         *command-t-authors*
+
+Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
+Other contributors that have submitted patches include (in alphabetical
+order):
+
+  Daniel Hahler
+  Lucas de Vries
+  Matthew Todd
+  Mike Lundy
+  Scott Bronson
+  Steven Moazami
+  Sung Pae
+  Victor Hugo Borja
+  Zak Johnson
+
+As this was the first Vim plug-in I had ever written I was heavily influenced
+by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
+is one of the largest Ruby-based Vim plug-ins to date.
+
+While the Command-T codebase doesn't contain any code directly copied from
+LustyExplorer, I did use it as a reference for answers to basic questions (like
+"How do you do 'X' in a Ruby-based Vim plug-in?"), and also copied some basic
+architectural decisions (like the division of the code into Prompt, Settings
+and MatchWindow classes).
+
+LustyExplorer is available from:
+
+  http://www.vim.org/scripts/script.php?script_id=1890
+
+
+WEBSITE                                         *command-t-website*
+
+The official website for Command-T is:
+
+  https://wincent.com/products/command-t
+
+The latest release will always be available from there.
+
+Development in progress can be inspected via the project's Git repository
+browser at:
+
+  https://wincent.com/repos/command-t
+
+A copy of each release is also available from the official Vim scripts site
+at:
+
+  http://www.vim.org/scripts/script.php?script_id=3025
+
+Bug reports should be submitted to the issue tracker at:
+
+  https://wincent.com/issues
+
+
+DONATIONS                                       *command-t-donations*
+
+Command-T itself is free software released under the terms of the BSD license.
+If you would like to support further development you can make a donation via
+PayPal to win@wincent.com:
+
+  https://wincent.com/products/command-t/donations
+
+
+LICENSE                                         *command-t-license*
+
+Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+HISTORY                                         *command-t-history*
+
+1.2.1 (30 April 2011)
+
+- Remove duplicate copy of the documentation that was causing "Duplicate tag"
+  errors
+- Mitigate issue with distracting blinking cursor in non-GUI versions of Vim
+  (patch from Steven Moazami)
+
+1.2 (30 April 2011)
+
+- added |g:CommandTMatchWindowReverse| option, to reverse the order of items
+  in the match listing (patch from Steven Moazami)
+
+1.1b2 (26 March 2011)
+
+- fix a glitch in the release process; the plugin itself is unchanged since
+  1.1b
+
+1.1b (26 March 2011)
+
+- add |:CommandTBuffer| command for quickly selecting among open buffers
+
+1.0.1 (5 January 2011)
+
+- work around bug when mapping |:CommandTFlush|, wherein the default mapping
+  for |:CommandT| would not be set up
+- clean up when leaving the Command-T buffer via unexpected means (such as
+  with <C-W k> or similar)
+
+1.0 (26 November 2010)
+
+- make relative path simplification work on Windows
+
+1.0b (5 November 2010)
+
+- work around platform-specific Vim 7.3 bug seen by some users (wherein
+  Vim always falsely reports to Ruby that the buffer numbers is 0)
+- re-use the buffer that is used to show the match listing, rather than
+  throwing it away and recreating it each time Command-T is shown; this
+  stops the buffer numbers from creeping up needlessly
+
+0.9 (8 October 2010)
+
+- use relative paths when opening files inside the current working directory
+  in order to keep buffer listings as brief as possible (patch from Matthew
+  Todd)
+
+0.8.1 (14 September 2010)
+
+- fix mapping issues for users who have set |'notimeout'| (patch from Sung
+  Pae)
+
+0.8 (19 August 2010)
+
+- overrides for the default mappings can now be lists of strings, allowing
+  multiple mappings to be defined for any given action
+- <Leader>t mapping only set up if no other map for |:CommandT| exists
+  (patch from Scott Bronson)
+- prevent folds from appearing in the match listing
+- tweaks to avoid the likelihood of "Not enough room" errors when trying to
+  open files
+- watch out for "nil" windows when restoring window dimensions
+- optimizations (avoid some repeated downcasing)
+- move all Ruby files under the "command-t" subdirectory and avoid polluting
+  the "Vim" module namespace
+
+0.8b (11 July 2010)
+
+- large overhaul of the scoring algorithm to make the ordering of returned
+  results more intuitive; given the scope of the changes and room for
+  optimization of the new algorithm, this release is labelled as "beta"
+
+0.7 (10 June 2010)
+
+- handle more |'wildignore'| patterns by delegating to Vim's own |expand()|
+  function; with this change it is now viable to exclude patterns such as
+  'vendor/rails/**' in addition to filename-only patterns like '*.o' and
+  '.git' (patch from Mike Lundy)
+- always sort results alphabetically for empty search strings; this eliminates
+  filesystem-specific variations (patch from Mike Lundy)
+
+0.6 (28 April 2010)
+
+- |:CommandT| now accepts an optional parameter to specify the starting
+  directory, temporarily overriding the usual default of Vim's |:pwd|
+- fix truncated paths when operating from root directory
+
+0.5.1 (11 April 2010)
+
+- fix for Ruby 1.9 compatibility regression introduced in 0.5
+- documentation enhancements, specifically targetted at Windows users
+
+0.5 (3 April 2010)
+
+- |:CommandTFlush| now re-evaluates settings, allowing changes made via |let|
+  to be picked up without having to restart Vim
+- fix premature abort when scanning very deep directory hierarchies
+- remove broken |<Esc>| key mapping on vt100 and xterm terminals
+- provide settings for overriding default mappings
+- minor performance optimization
+
+0.4 (27 March 2010)
+
+- add |g:CommandTMatchWindowAtTop| setting (patch from Zak Johnson)
+- documentation fixes and enhancements
+- internal refactoring and simplification
+
+0.3 (24 March 2010)
+
+- add |g:CommandTMaxHeight| setting for controlling the maximum height of the
+  match window (patch from Lucas de Vries)
+- fix bug where |'list'| setting might be inappropriately set after dismissing
+  Command-T
+- compatibility fix for different behaviour of "autoload" under Ruby 1.9.1
+- avoid "highlight group not found" warning when run under a version of Vim
+  that does not have syntax highlighting support
+- open in split when opening normally would fail due to |'hidden'| and
+  |'modified'| values
+
+0.2 (23 March 2010)
+
+- compatibility fixes for compilation under Ruby 1.9 series
+- compatibility fixes for compilation under Ruby 1.8.5
+- compatibility fixes for Windows and other non-UNIX platforms
+- suppress "mapping already exists" message if <Leader>t mapping is already
+  defined when plug-in is loaded
+- exclude paths based on |'wildignore'| setting rather than a hardcoded
+  regular expression
+
+0.1 (22 March 2010)
+
+- initial public release
+
+------------------------------------------------------------------------------
+vim:tw=78:ft=help:
+plugin/command-t.vim   [[[1
+164
+" command-t.vim
+" Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+"
+" Redistribution and use in source and binary forms, with or without
+" modification, are permitted provided that the following conditions are met:
+"
+" 1. Redistributions of source code must retain the above copyright notice,
+"    this list of conditions and the following disclaimer.
+" 2. Redistributions in binary form must reproduce the above copyright notice,
+"    this list of conditions and the following disclaimer in the documentation
+"    and/or other materials provided with the distribution.
+"
+" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+" POSSIBILITY OF SUCH DAMAGE.
+
+if exists("g:command_t_loaded")
+  finish
+endif
+let g:command_t_loaded = 1
+
+command CommandTBuffer call <SID>CommandTShowBufferFinder()
+command -nargs=? -complete=dir CommandT call <SID>CommandTShowFileFinder(<q-args>)
+command CommandTFlush call <SID>CommandTFlush()
+
+if !hasmapto(':CommandT<CR>')
+  silent! nmap <unique> <silent> <Leader>t :CommandT<CR>
+endif
+
+if !hasmapto(':CommandTBuffer<CR>')
+  silent! nmap <unique> <silent> <Leader>b :CommandTBuffer<CR>
+endif
+
+function s:CommandTRubyWarning()
+  echohl WarningMsg
+  echo "command-t.vim requires Vim to be compiled with Ruby support"
+  echo "For more information type:  :help command-t"
+  echohl none
+endfunction
+
+function s:CommandTShowBufferFinder()
+  if has('ruby')
+    ruby $command_t.show_buffer_finder
+  else
+    call s:CommandTRubyWarning()
+  endif
+endfunction
+
+function s:CommandTShowFileFinder(arg)
+  if has('ruby')
+    ruby $command_t.show_file_finder
+  else
+    call s:CommandTRubyWarning()
+  endif
+endfunction
+
+function s:CommandTFlush()
+  if has('ruby')
+    ruby $command_t.flush
+  else
+    call s:CommandTRubyWarning()
+  endif
+endfunction
+
+if !has('ruby')
+  finish
+endif
+
+function CommandTHandleKey(arg)
+  ruby $command_t.handle_key
+endfunction
+
+function CommandTBackspace()
+  ruby $command_t.backspace
+endfunction
+
+function CommandTDelete()
+  ruby $command_t.delete
+endfunction
+
+function CommandTAcceptSelection()
+  ruby $command_t.accept_selection
+endfunction
+
+function CommandTAcceptSelectionTab()
+  ruby $command_t.accept_selection :command => 'tabe'
+endfunction
+
+function CommandTAcceptSelectionSplit()
+  ruby $command_t.accept_selection :command => 'sp'
+endfunction
+
+function CommandTAcceptSelectionVSplit()
+  ruby $command_t.accept_selection :command => 'vs'
+endfunction
+
+function CommandTToggleFocus()
+  ruby $command_t.toggle_focus
+endfunction
+
+function CommandTCancel()
+  ruby $command_t.cancel
+endfunction
+
+function CommandTSelectNext()
+  ruby $command_t.select_next
+endfunction
+
+function CommandTSelectPrev()
+  ruby $command_t.select_prev
+endfunction
+
+function CommandTClear()
+  ruby $command_t.clear
+endfunction
+
+function CommandTCursorLeft()
+  ruby $command_t.cursor_left
+endfunction
+
+function CommandTCursorRight()
+  ruby $command_t.cursor_right
+endfunction
+
+function CommandTCursorEnd()
+  ruby $command_t.cursor_end
+endfunction
+
+function CommandTCursorStart()
+  ruby $command_t.cursor_start
+endfunction
+
+ruby << EOF
+  # require Ruby files
+  begin
+    # prepare controller
+    require 'command-t/vim'
+    require 'command-t/controller'
+    $command_t = CommandT::Controller.new
+  rescue LoadError
+    load_path_modified = false
+    ::VIM::evaluate('&runtimepath').to_s.split(',').each do |path|
+      lib = "#{path}/ruby"
+      if !$LOAD_PATH.include?(lib) and File.exist?(lib)
+        $LOAD_PATH << lib
+        load_path_modified = true
+      end
+    end
+    retry if load_path_modified
+
+    # could get here if C extension was not compiled, or was compiled
+    # for the wrong architecture or Ruby version
+    require 'command-t/stub'
+    $command_t = CommandT::Stub.new
+  end
+EOF
diff --git a/vim/tmp/command_t/doc/command-t.txt b/vim/tmp/command_t/doc/command-t.txt
new file mode 100644 (file)
index 0000000..65a64a3
--- /dev/null
@@ -0,0 +1,786 @@
+*command-t.txt* Command-T plug-in for Vim         *command-t*
+
+CONTENTS                                        *command-t-contents*
+
+ 1. Introduction            |command-t-intro|
+ 2. Requirements            |command-t-requirements|
+ 3. Installation            |command-t-installation|
+ 3. Managing using Pathogen |command-t-pathogen|
+ 4. Trouble-shooting        |command-t-trouble-shooting|
+ 5. Usage                   |command-t-usage|
+ 6. Commands                |command-t-commands|
+ 7. Mappings                |command-t-mappings|
+ 8. Options                 |command-t-options|
+ 9. Authors                 |command-t-authors|
+10. Website                 |command-t-website|
+11. Donations               |command-t-donations|
+12. License                 |command-t-license|
+13. History                 |command-t-history|
+
+
+INTRODUCTION                                    *command-t-intro*
+
+The Command-T plug-in provides an extremely fast, intuitive mechanism for
+opening files and buffers with a minimal number of keystrokes. It's named
+"Command-T" because it is inspired by the "Go to File" window bound to
+Command-T in TextMate.
+
+Files are selected by typing characters that appear in their paths, and are
+ordered by an algorithm which knows that characters that appear in certain
+locations (for example, immediately after a path separator) should be given
+more weight.
+
+To search efficiently, especially in large projects, you should adopt a
+"path-centric" rather than a "filename-centric" mentality. That is you should
+think more about where the desired file is found rather than what it is
+called. This means narrowing your search down by including some characters
+from the upper path components rather than just entering characters from the
+filename itself.
+
+Screencasts demonstrating the plug-in can be viewed at:
+
+  https://wincent.com/products/command-t
+
+
+REQUIREMENTS                                    *command-t-requirements*
+
+The plug-in requires Vim compiled with Ruby support, a compatible Ruby
+installation at the operating system level, and a C compiler to build
+the Ruby extension.
+
+
+1. Vim compiled with Ruby support
+
+You can check for Ruby support by launching Vim with the --version switch:
+
+  vim --version
+
+If "+ruby" appears in the version information then your version of Vim has
+Ruby support.
+
+Another way to check is to simply try using the :ruby command from within Vim
+itself:
+
+  :ruby 1
+
+If your Vim lacks support you'll see an error message like this:
+
+  E319: Sorry, the command is not available in this version
+
+The version of Vim distributed with Mac OS X does not include Ruby support,
+while MacVim does; it is available from:
+
+  http://github.com/b4winckler/macvim/downloads
+
+For Windows users, the Vim 7.2 executable available from www.vim.org does
+include Ruby support, and is recommended over version 7.3 (which links against
+Ruby 1.9, but apparently has some bugs that need to be resolved).
+
+
+2. Ruby
+
+In addition to having Ruby support in Vim, your system itself must have a
+compatible Ruby install. "Compatible" means the same version as Vim itself
+links against. If you use a different version then Command-T is unlikely
+to work (see TROUBLE-SHOOTING below).
+
+On Mac OS X Snow Leopard, the system comes with Ruby 1.8.7 and all recent
+versions of MacVim (the 7.2 snapshots and 7.3) are linked against it.
+
+On Linux and similar platforms, the linked version of Ruby will depend on
+your distribution. You can usually find this out by examining the
+compilation and linking flags displayed by the |:version| command in Vim, and
+by looking at the output of:
+
+  :ruby puts RUBY_VERSION
+
+A suitable Ruby environment for Windows can be installed using the Ruby
+1.8.7-p299 RubyInstaller available at:
+
+  http://rubyinstaller.org/downloads/archives
+
+If using RubyInstaller be sure to download the installer executable, not the
+7-zip archive. When installing mark the checkbox "Add Ruby executables to your
+PATH" so that Vim can find them.
+
+
+3. C compiler
+
+Part of Command-T is implemented in C as a Ruby extension for speed, allowing
+it to work responsively even on directory hierarchies containing enormous
+numbers of files. As such, a C compiler is required in order to build the
+extension and complete the installation.
+
+On Mac OS X, this can be obtained by installing the Xcode Tools that come on
+the Mac OS X install disc.
+
+On Windows, the RubyInstaller Development Kit can be used to conveniently
+install the necessary tool chain:
+
+  http://rubyinstaller.org/downloads/archives
+
+At the time of writing, the appropriate development kit for use with Ruby
+1.8.7 is DevKit-3.4.5r3-20091110.
+
+To use the Development Kit extract the archive contents to your C:\Ruby
+folder.
+
+
+INSTALLATION                                    *command-t-installation*
+
+Command-T is distributed as a "vimball" which means that it can be installed
+by opening it in Vim and then sourcing it:
+
+  :e command-t.vba
+  :so %
+
+The files will be installed in your |'runtimepath'|. To check where this is
+you can issue:
+
+  :echo &rtp
+
+The C extension must then be built, which can be done from the shell. If you
+use a typical |'runtimepath'| then the files were installed inside ~/.vim and
+you can build the extension with:
+
+  cd ~/.vim/ruby/command-t
+  ruby extconf.rb
+  make
+
+Note: If you are an RVM user, you must perform the build using the same
+version of Ruby that Vim itself is linked against. This will often be the
+system Ruby, which can be selected before issuing the "make" command with:
+
+  rvm use system
+
+
+MANAGING USING PATHOGEN                         *command-t-pathogen*
+
+Pathogen is a plugin that allows you to maintain plugin installations in
+separate, isolated subdirectories under the "bundle" directory in your
+|'runtimepath'|. The following examples assume that you already have
+Pathogen installed and configured, and that you are installing into
+~/.vim/bundle. For more information about Pathogen, see:
+
+  http://www.vim.org/scripts/script.php?script_id=2332
+
+If you manage your entire ~/.vim folder using Git then you can add the
+Command-T repository as a submodule:
+
+  cd ~/.vim
+  git submodule add git://git.wincent.com/command-t.git bundle/command-t
+  git submodule init
+
+Or if you just wish to do a simple clone instead of using submodules:
+
+  cd ~/.vim
+  git clone git://git.wincent.com/command-t.git bundle/command-t
+
+Once you have a local copy of the repository you can update it at any time
+with:
+
+  cd ~/.vim/bundle/command-t
+  git pull
+
+Or you can switch to a specific release with:
+
+  cd ~/.vim/bundle/command-t
+  git checkout 0.8b
+
+After installing or updating you must build the extension:
+
+  cd ~/.vim/bundle/command-t
+  rake make
+
+While the Vimball installation automatically generates the help tags, under
+Pathogen it is necessary to do so explicitly from inside Vim:
+
+  :call pathogen#helptags()
+
+
+TROUBLE-SHOOTING                                *command-t-trouble-shooting*
+
+Most installation problems are caused by a mismatch between the version of
+Ruby on the host operating system, and the version of Ruby that Vim itself
+linked against at compile time. For example, if one is 32-bit and the other is
+64-bit, or one is from the Ruby 1.9 series and the other is from the 1.8
+series, then the plug-in is not likely to work.
+
+As such, on Mac OS X, I recommend using the standard Ruby that comes with the
+system (currently 1.8.7) along with the latest version of MacVim (currently
+version 7.3). If you wish to use custom builds of Ruby or of MacVim (not
+recommmended) then you will have to take extra care to ensure that the exact
+same Ruby environment is in effect when building Ruby, Vim and the Command-T
+extension.
+
+For Windows, the following combination is known to work:
+
+  - Vim 7.2 from http://www.vim.org/download.php:
+      ftp://ftp.vim.org/pub/vim/pc/gvim72.exe
+  - Ruby 1.8.7-p299 from http://rubyinstaller.org/downloads/archives:
+      http://rubyforge.org/frs/download.php/71492/rubyinstaller-1.8.7-p299.exe
+  - DevKit 3.4.5r3-20091110 from http://rubyinstaller.org/downloads/archives:
+      http://rubyforge.org/frs/download.php/66888/devkit-3.4.5r3-20091110.7z
+
+If a problem occurs the first thing you should do is inspect the output of:
+
+  ruby extconf.rb
+  make
+
+During the installation, and:
+
+  vim --version
+
+And compare the compilation and linker flags that were passed to the
+extension and to Vim itself when they were built. If the Ruby-related
+flags or architecture flags are different then it is likely that something
+has changed in your Ruby environment and the extension may not work until
+you eliminate the discrepancy.
+
+
+USAGE                                           *command-t-usage*
+
+Bring up the Command-T file window by typing:
+
+  <Leader>t
+
+This mapping is set up automatically for you, provided you do not already have
+a mapping for <Leader>t or |:CommandT|. You can also bring up the file window
+by issuing the command:
+
+  :CommandT
+
+A prompt will appear at the bottom of the screen along with a file window
+showing all of the files in the current directory (as returned by the
+|:pwd| command).
+
+For the most efficient file navigation within a project it's recommended that
+you |:cd| into the root directory of your project when starting to work on it.
+If you wish to open a file from outside of the project folder you can pass in
+an optional path argument (relative or absolute) to |:CommandT|:
+
+  :CommandT ../path/to/other/files
+
+Type letters in the prompt to narrow down the selection, showing only the
+files whose paths contain those letters in the specified order. Letters do not
+need to appear consecutively in a path in order for it to be classified as a
+match.
+
+Once the desired file has been selected it can be opened by pressing <CR>.
+(By default files are opened in the current window, but there are other
+mappings that you can use to open in a vertical or horizontal split, or in
+a new tab.) Note that if you have |'nohidden'| set and there are unsaved
+changes in the current window when you press <CR> then opening in the current
+window would fail; in this case Command-T will open the file in a new split.
+
+The following mappings are active when the prompt has focus:
+
+    <BS>        delete the character to the left of the cursor
+    <Del>       delete the character at the cursor
+    <Left>      move the cursor one character to the left
+    <C-h>       move the cursor one character to the left
+    <Right>     move the cursor one character to the right
+    <C-l>       move the cursor one character to the right
+    <C-a>       move the cursor to the start (left)
+    <C-e>       move the cursor to the end (right)
+    <C-u>       clear the contents of the prompt
+    <Tab>       change focus to the file listing
+
+The following mappings are active when the file listing has focus:
+
+    <Tab>       change focus to the prompt
+
+The following mappings are active when either the prompt or the file listing
+has focus:
+
+    <CR>        open the selected file
+    <C-CR>      open the selected file in a new split window
+    <C-s>       open the selected file in a new split window
+    <C-v>       open the selected file in a new vertical split window
+    <C-t>       open the selected file in a new tab
+    <C-j>       select next file in the file listing
+    <C-n>       select next file in the file listing
+    <Down>      select next file in the file listing
+    <C-k>       select previous file in the file listing
+    <C-p>       select previous file in the file listing
+    <Up>        select previous file in the file listing
+    <C-c>       cancel (dismisses file listing)
+
+The following is also available on terminals which support it:
+
+    <Esc>       cancel (dismisses file listing)
+
+Note that the default mappings can be overriden by setting options in your
+~/.vimrc file (see the OPTIONS section for a full list of available options).
+
+In addition, when the file listing has focus, typing a character will cause
+the selection to jump to the first path which begins with that character.
+Typing multiple characters consecutively can be used to distinguish between
+paths which begin with the same prefix.
+
+
+COMMANDS                                        *command-t-commands*
+
+                                                *:CommandT*
+|:CommandT|     Brings up the Command-T file window, starting in the
+                current working directory as returned by the|:pwd|
+                command.
+
+                                                *:CommandTBuffer*
+|:CommandTBuffer|Brings up the Command-T buffer window.
+                This works exactly like the standard file window,
+                except that the selection is limited to files that
+                you already have open in buffers.
+
+                                                *:CommandTFlush*
+|:CommandTFlush|Instructs the plug-in to flush its path cache, causing
+                the directory to be rescanned for new or deleted paths
+                the next time the file window is shown. In addition, all
+                configuration settings are re-evaluated, causing any
+                changes made to settings via the |:let| command to be picked
+                up.
+
+
+MAPPINGS                                        *command-t-mappings*
+
+By default Command-T comes with only two mappings:
+
+  <Leader>t     bring up the Command-T file window
+  <Leader>b     bring up the Command-T buffer window
+
+However, Command-T won't overwrite a pre-existing mapping so if you prefer
+to define different mappings use lines like these in your ~/.vimrc:
+
+  nmap <silent> <Leader>t :CommandT<CR>
+  nmap <silent> <Leader>b :CommandTBuffer<CR>
+
+Replacing "<Leader>t" or "<Leader>b" with your mapping of choice.
+
+Note that in the case of MacVim you actually can map to Command-T (written
+as <D-t> in Vim) in your ~/.gvimrc file if you first unmap the existing menu
+binding of Command-T to "New Tab":
+
+  if has("gui_macvim")
+    macmenu &File.New\ Tab key=<nop>
+    map <D-t> :CommandT<CR>
+  endif
+
+When the Command-T window is active a number of other additional mappings
+become available for doing things like moving between and selecting matches.
+These are fully described above in the USAGE section, and settings for
+overriding the mappings are listed below under OPTIONS.
+
+
+OPTIONS                                         *command-t-options*
+
+A number of options may be set in your ~/.vimrc to influence the behaviour of
+the plug-in. To set an option, you include a line like this in your ~/.vimrc:
+
+    let g:CommandTMaxFiles=20000
+
+To have Command-T pick up new settings immediately (that is, without having
+to restart Vim) you can issue the |:CommandTFlush| command after making
+changes via |:let|.
+
+Following is a list of all available options:
+
+                                               *g:CommandTMaxFiles*
+  |g:CommandTMaxFiles|                           number (default 10000)
+
+      The maximum number of files that will be considered when scanning the
+      current directory. Upon reaching this number scanning stops. This
+      limit applies only to file listings and is ignored for buffer
+      listings.
+
+                                               *g:CommandTMaxDepth*
+  |g:CommandTMaxDepth|                           number (default 15)
+
+      The maximum depth (levels of recursion) to be explored when scanning the
+      current directory. Any directories at levels beyond this depth will be
+      skipped.
+
+                                               *g:CommandTMaxHeight*
+  |g:CommandTMaxHeight|                          number (default: 0)
+
+      The maximum height in lines the match window is allowed to expand to.
+      If set to 0, the window will occupy as much of the available space as
+      needed to show matching entries.
+
+                                               *g:CommandTAlwaysShowDotFiles*
+  |g:CommandTAlwaysShowDotFiles|                 boolean (default: 0)
+
+      When showing the file listing Command-T will by default show dot-files
+      only if the entered search string contains a dot that could cause a
+      dot-file to match. When set to a non-zero value, this setting instructs
+      Command-T to always include matching dot-files in the match list
+      regardless of whether the search string contains a dot. See also
+      |g:CommandTNeverShowDotFiles|. Note that this setting only influences
+      the file listing; the buffer listing treats dot-files like any other
+      file.
+
+                                               *g:CommandTNeverShowDotFiles*
+  |g:CommandTNeverShowDotFiles|                  boolean (default: 0)
+
+      In the file listing, Command-T will by default show dot-files if the
+      entered search string contains a dot that could cause a dot-file to
+      match. When set to a non-zero value, this setting instructs Command-T to
+      never show dot-files under any circumstances. Note that it is
+      contradictory to set both this setting and
+      |g:CommandTAlwaysShowDotFiles| to true, and if you do so Vim will suffer
+      from headaches, nervous twitches, and sudden mood swings. This setting
+      has no effect in buffer listings, where dot files are treated like any
+      other file.
+
+                                               *g:CommandTScanDotDirectories*
+  |g:CommandTScanDotDirectories|                 boolean (default: 0)
+
+      Normally Command-T will not recurse into "dot-directories" (directories
+      whose names begin with a dot) while performing its initial scan. Set
+      this setting to a non-zero value to override this behavior and recurse.
+      Note that this setting is completely independent of the
+      |g:CommandTAlwaysShowDotFiles| and |g:CommandTNeverShowDotFiles|
+      settings; those apply only to the selection and display of matches
+      (after scanning has been performed), whereas
+      |g:CommandTScanDotDirectories| affects the behaviour at scan-time.
+
+      Note also that even with this setting off you can still use Command-T to
+      open files inside a "dot-directory" such as ~/.vim, but you have to use
+      the |:cd| command to change into that directory first. For example:
+
+        :cd ~/.vim
+        :CommandT
+
+                                               *g:CommandTMatchWindowAtTop*
+  |g:CommandTMatchWindowAtTop|                   boolean (default: 0)
+
+      When this setting is off (the default) the match window will appear at
+      the bottom so as to keep it near to the prompt. Turning it on causes the
+      match window to appear at the top instead. This may be preferable if you
+      want the best match (usually the first one) to appear in a fixed location
+      on the screen rather than moving as the number of matches changes during
+      typing.
+
+                                                *g:CommandTMatchWindowReverse*
+  |g:CommandTMatchWindowReverse|                  boolean (default: 0)
+
+      When this setting is off (the default) the matches will appear from
+      top to bottom with the topmost being selected. Turning it on causes the
+      matches to be reversed so the best match is at the bottom and the
+      initially selected match is the bottom most. This may be preferable if
+      you want the best match to appear in a fixed location on the screen
+      but still be near the prompt at the bottom.
+
+As well as the basic options listed above, there are a number of settings that
+can be used to override the default key mappings used by Command-T. For
+example, to set <C-x> as the mapping for cancelling (dismissing) the Command-T
+window, you would add the following to your ~/.vimrc:
+
+  let g:CommandTCancelMap='<C-x>'
+
+Multiple, alternative mappings may be specified using list syntax:
+
+  let g:CommandTCancelMap=['<C-x>', '<C-c>']
+
+Following is a list of all map settings and their defaults:
+
+                              Setting   Default mapping(s)
+
+                                      *g:CommandTBackspaceMap*
+              |g:CommandTBackspaceMap|  <BS>
+
+                                      *g:CommandTDeleteMap*
+                 |g:CommandTDeleteMap|  <Del>
+
+                                      *g:CommandTAcceptSelectionMap*
+        |g:CommandTAcceptSelectionMap|  <CR>
+
+                                      *g:CommandTAcceptSelectionSplitMap*
+   |g:CommandTAcceptSelectionSplitMap|  <C-CR>
+                                      <C-s>
+
+                                      *g:CommandTAcceptSelectionTabMap*
+     |g:CommandTAcceptSelectionTabMap|  <C-t>
+
+                                      *g:CommandTAcceptSelectionVSplitMap*
+  |g:CommandTAcceptSelectionVSplitMap|  <C-v>
+
+                                      *g:CommandTToggleFocusMap*
+            |g:CommandTToggleFocusMap|  <Tab>
+
+                                      *g:CommandTCancelMap*
+                 |g:CommandTCancelMap|  <C-c>
+                                      <Esc> (not on all terminals)
+
+                                      *g:CommandTSelectNextMap*
+             |g:CommandTSelectNextMap|  <C-n>
+                                      <C-j>
+                                      <Down>
+
+                                      *g:CommandTSelectPrevMap*
+             |g:CommandTSelectPrevMap|  <C-p>
+                                      <C-k>
+                                      <Up>
+
+                                      *g:CommandTClearMap*
+                  |g:CommandTClearMap|  <C-u>
+
+                                      *g:CommandTCursorLeftMap*
+             |g:CommandTCursorLeftMap|  <Left>
+                                      <C-h>
+
+                                      *g:CommandTCursorRightMap*
+            |g:CommandTCursorRightMap|  <Right>
+                                      <C-l>
+
+                                      *g:CommandTCursorEndMap*
+              |g:CommandTCursorEndMap|  <C-e>
+
+                                      *g:CommandTCursorStartMap*
+            |g:CommandTCursorStartMap|  <C-a>
+
+In addition to the options provided by Command-T itself, some of Vim's own
+settings can be used to control behavior:
+
+                                               *command-t-wildignore*
+  |'wildignore'|                                 string (default: '')
+
+      Vim's |'wildignore'| setting is used to determine which files should be
+      excluded from listings. This is a comma-separated list of glob patterns.
+      It defaults to the empty string, but common settings include "*.o,*.obj"
+      (to exclude object files) or ".git,.svn" (to exclude SCM metadata
+      directories). For example:
+
+        :set wildignore+=*.o,*.obj,.git
+
+      A pattern such as "vendor/rails/**" would exclude all files and
+      subdirectories inside the "vendor/rails" directory (relative to
+      directory Command-T starts in).
+
+      See the |'wildignore'| documentation for more information.
+
+
+AUTHORS                                         *command-t-authors*
+
+Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
+Other contributors that have submitted patches include (in alphabetical
+order):
+
+  Daniel Hahler
+  Lucas de Vries
+  Matthew Todd
+  Mike Lundy
+  Scott Bronson
+  Steven Moazami
+  Sung Pae
+  Victor Hugo Borja
+  Zak Johnson
+
+As this was the first Vim plug-in I had ever written I was heavily influenced
+by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
+is one of the largest Ruby-based Vim plug-ins to date.
+
+While the Command-T codebase doesn't contain any code directly copied from
+LustyExplorer, I did use it as a reference for answers to basic questions (like
+"How do you do 'X' in a Ruby-based Vim plug-in?"), and also copied some basic
+architectural decisions (like the division of the code into Prompt, Settings
+and MatchWindow classes).
+
+LustyExplorer is available from:
+
+  http://www.vim.org/scripts/script.php?script_id=1890
+
+
+WEBSITE                                         *command-t-website*
+
+The official website for Command-T is:
+
+  https://wincent.com/products/command-t
+
+The latest release will always be available from there.
+
+Development in progress can be inspected via the project's Git repository
+browser at:
+
+  https://wincent.com/repos/command-t
+
+A copy of each release is also available from the official Vim scripts site
+at:
+
+  http://www.vim.org/scripts/script.php?script_id=3025
+
+Bug reports should be submitted to the issue tracker at:
+
+  https://wincent.com/issues
+
+
+DONATIONS                                       *command-t-donations*
+
+Command-T itself is free software released under the terms of the BSD license.
+If you would like to support further development you can make a donation via
+PayPal to win@wincent.com:
+
+  https://wincent.com/products/command-t/donations
+
+
+LICENSE                                         *command-t-license*
+
+Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+HISTORY                                         *command-t-history*
+
+1.2.1 (30 April 2011)
+
+- Remove duplicate copy of the documentation that was causing "Duplicate tag"
+  errors
+- Mitigate issue with distracting blinking cursor in non-GUI versions of Vim
+  (patch from Steven Moazami)
+
+1.2 (30 April 2011)
+
+- added |g:CommandTMatchWindowReverse| option, to reverse the order of items
+  in the match listing (patch from Steven Moazami)
+
+1.1b2 (26 March 2011)
+
+- fix a glitch in the release process; the plugin itself is unchanged since
+  1.1b
+
+1.1b (26 March 2011)
+
+- add |:CommandTBuffer| command for quickly selecting among open buffers
+
+1.0.1 (5 January 2011)
+
+- work around bug when mapping |:CommandTFlush|, wherein the default mapping
+  for |:CommandT| would not be set up
+- clean up when leaving the Command-T buffer via unexpected means (such as
+  with <C-W k> or similar)
+
+1.0 (26 November 2010)
+
+- make relative path simplification work on Windows
+
+1.0b (5 November 2010)
+
+- work around platform-specific Vim 7.3 bug seen by some users (wherein
+  Vim always falsely reports to Ruby that the buffer numbers is 0)
+- re-use the buffer that is used to show the match listing, rather than
+  throwing it away and recreating it each time Command-T is shown; this
+  stops the buffer numbers from creeping up needlessly
+
+0.9 (8 October 2010)
+
+- use relative paths when opening files inside the current working directory
+  in order to keep buffer listings as brief as possible (patch from Matthew
+  Todd)
+
+0.8.1 (14 September 2010)
+
+- fix mapping issues for users who have set |'notimeout'| (patch from Sung
+  Pae)
+
+0.8 (19 August 2010)
+
+- overrides for the default mappings can now be lists of strings, allowing
+  multiple mappings to be defined for any given action
+- <Leader>t mapping only set up if no other map for |:CommandT| exists
+  (patch from Scott Bronson)
+- prevent folds from appearing in the match listing
+- tweaks to avoid the likelihood of "Not enough room" errors when trying to
+  open files
+- watch out for "nil" windows when restoring window dimensions
+- optimizations (avoid some repeated downcasing)
+- move all Ruby files under the "command-t" subdirectory and avoid polluting
+  the "Vim" module namespace
+
+0.8b (11 July 2010)
+
+- large overhaul of the scoring algorithm to make the ordering of returned
+  results more intuitive; given the scope of the changes and room for
+  optimization of the new algorithm, this release is labelled as "beta"
+
+0.7 (10 June 2010)
+
+- handle more |'wildignore'| patterns by delegating to Vim's own |expand()|
+  function; with this change it is now viable to exclude patterns such as
+  'vendor/rails/**' in addition to filename-only patterns like '*.o' and
+  '.git' (patch from Mike Lundy)
+- always sort results alphabetically for empty search strings; this eliminates
+  filesystem-specific variations (patch from Mike Lundy)
+
+0.6 (28 April 2010)
+
+- |:CommandT| now accepts an optional parameter to specify the starting
+  directory, temporarily overriding the usual default of Vim's |:pwd|
+- fix truncated paths when operating from root directory
+
+0.5.1 (11 April 2010)
+
+- fix for Ruby 1.9 compatibility regression introduced in 0.5
+- documentation enhancements, specifically targetted at Windows users
+
+0.5 (3 April 2010)
+
+- |:CommandTFlush| now re-evaluates settings, allowing changes made via |let|
+  to be picked up without having to restart Vim
+- fix premature abort when scanning very deep directory hierarchies
+- remove broken |<Esc>| key mapping on vt100 and xterm terminals
+- provide settings for overriding default mappings
+- minor performance optimization
+
+0.4 (27 March 2010)
+
+- add |g:CommandTMatchWindowAtTop| setting (patch from Zak Johnson)
+- documentation fixes and enhancements
+- internal refactoring and simplification
+
+0.3 (24 March 2010)
+
+- add |g:CommandTMaxHeight| setting for controlling the maximum height of the
+  match window (patch from Lucas de Vries)
+- fix bug where |'list'| setting might be inappropriately set after dismissing
+  Command-T
+- compatibility fix for different behaviour of "autoload" under Ruby 1.9.1
+- avoid "highlight group not found" warning when run under a version of Vim
+  that does not have syntax highlighting support
+- open in split when opening normally would fail due to |'hidden'| and
+  |'modified'| values
+
+0.2 (23 March 2010)
+
+- compatibility fixes for compilation under Ruby 1.9 series
+- compatibility fixes for compilation under Ruby 1.8.5
+- compatibility fixes for Windows and other non-UNIX platforms
+- suppress "mapping already exists" message if <Leader>t mapping is already
+  defined when plug-in is loaded
+- exclude paths based on |'wildignore'| setting rather than a hardcoded
+  regular expression
+
+0.1 (22 March 2010)
+
+- initial public release
+
+------------------------------------------------------------------------------
+vim:tw=78:ft=help:
diff --git a/vim/tmp/command_t/plugin/command-t.vim b/vim/tmp/command_t/plugin/command-t.vim
new file mode 100644 (file)
index 0000000..7ef6bcd
--- /dev/null
@@ -0,0 +1,164 @@
+" command-t.vim
+" Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+"
+" Redistribution and use in source and binary forms, with or without
+" modification, are permitted provided that the following conditions are met:
+"
+" 1. Redistributions of source code must retain the above copyright notice,
+"    this list of conditions and the following disclaimer.
+" 2. Redistributions in binary form must reproduce the above copyright notice,
+"    this list of conditions and the following disclaimer in the documentation
+"    and/or other materials provided with the distribution.
+"
+" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+" POSSIBILITY OF SUCH DAMAGE.
+
+if exists("g:command_t_loaded")
+  finish
+endif
+let g:command_t_loaded = 1
+
+command CommandTBuffer call <SID>CommandTShowBufferFinder()
+command -nargs=? -complete=dir CommandT call <SID>CommandTShowFileFinder(<q-args>)
+command CommandTFlush call <SID>CommandTFlush()
+
+if !hasmapto(':CommandT<CR>')
+  silent! nmap <unique> <silent> <Leader>t :CommandT<CR>
+endif
+
+if !hasmapto(':CommandTBuffer<CR>')
+  silent! nmap <unique> <silent> <Leader>b :CommandTBuffer<CR>
+endif
+
+function s:CommandTRubyWarning()
+  echohl WarningMsg
+  echo "command-t.vim requires Vim to be compiled with Ruby support"
+  echo "For more information type:  :help command-t"
+  echohl none
+endfunction
+
+function s:CommandTShowBufferFinder()
+  if has('ruby')
+    ruby $command_t.show_buffer_finder
+  else
+    call s:CommandTRubyWarning()
+  endif
+endfunction
+
+function s:CommandTShowFileFinder(arg)
+  if has('ruby')
+    ruby $command_t.show_file_finder
+  else
+    call s:CommandTRubyWarning()
+  endif
+endfunction
+
+function s:CommandTFlush()
+  if has('ruby')
+    ruby $command_t.flush
+  else
+    call s:CommandTRubyWarning()
+  endif
+endfunction
+
+if !has('ruby')
+  finish
+endif
+
+function CommandTHandleKey(arg)
+  ruby $command_t.handle_key
+endfunction
+
+function CommandTBackspace()
+  ruby $command_t.backspace
+endfunction
+
+function CommandTDelete()
+  ruby $command_t.delete
+endfunction
+
+function CommandTAcceptSelection()
+  ruby $command_t.accept_selection
+endfunction
+
+function CommandTAcceptSelectionTab()
+  ruby $command_t.accept_selection :command => 'tabe'
+endfunction
+
+function CommandTAcceptSelectionSplit()
+  ruby $command_t.accept_selection :command => 'sp'
+endfunction
+
+function CommandTAcceptSelectionVSplit()
+  ruby $command_t.accept_selection :command => 'vs'
+endfunction
+
+function CommandTToggleFocus()
+  ruby $command_t.toggle_focus
+endfunction
+
+function CommandTCancel()
+  ruby $command_t.cancel
+endfunction
+
+function CommandTSelectNext()
+  ruby $command_t.select_next
+endfunction
+
+function CommandTSelectPrev()
+  ruby $command_t.select_prev
+endfunction
+
+function CommandTClear()
+  ruby $command_t.clear
+endfunction
+
+function CommandTCursorLeft()
+  ruby $command_t.cursor_left
+endfunction
+
+function CommandTCursorRight()
+  ruby $command_t.cursor_right
+endfunction
+
+function CommandTCursorEnd()
+  ruby $command_t.cursor_end
+endfunction
+
+function CommandTCursorStart()
+  ruby $command_t.cursor_start
+endfunction
+
+ruby << EOF
+  # require Ruby files
+  begin
+    # prepare controller
+    require 'command-t/vim'
+    require 'command-t/controller'
+    $command_t = CommandT::Controller.new
+  rescue LoadError
+    load_path_modified = false
+    ::VIM::evaluate('&runtimepath').to_s.split(',').each do |path|
+      lib = "#{path}/ruby"
+      if !$LOAD_PATH.include?(lib) and File.exist?(lib)
+        $LOAD_PATH << lib
+        load_path_modified = true
+      end
+    end
+    retry if load_path_modified
+
+    # could get here if C extension was not compiled, or was compiled
+    # for the wrong architecture or Ruby version
+    require 'command-t/stub'
+    $command_t = CommandT::Stub.new
+  end
+EOF
diff --git a/vim/tmp/command_t/ruby/command-t/controller.rb b/vim/tmp/command_t/ruby/command-t/controller.rb
new file mode 100644 (file)
index 0000000..29e61b6
--- /dev/null
@@ -0,0 +1,317 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/finder/buffer_finder'
+require 'command-t/finder/file_finder'
+require 'command-t/match_window'
+require 'command-t/prompt'
+require 'command-t/vim/path_utilities'
+
+module CommandT
+  class Controller
+    include VIM::PathUtilities
+
+    def initialize
+      @prompt = Prompt.new
+      @buffer_finder = CommandT::BufferFinder.new
+      set_up_file_finder
+      set_up_max_height
+    end
+
+    def show_buffer_finder
+      @path          = VIM::pwd
+      @active_finder = @buffer_finder
+      show
+    end
+
+    def show_file_finder
+      # optional parameter will be desired starting directory, or ""
+      @path             = File.expand_path(::VIM::evaluate('a:arg'), VIM::pwd)
+      @file_finder.path = @path
+      @active_finder    = @file_finder
+      show
+    rescue Errno::ENOENT
+      # probably a problem with the optional parameter
+      @match_window.print_no_such_file_or_directory
+    end
+
+    def hide
+      @match_window.close
+      if VIM::Window.select @initial_window
+        if @initial_buffer.number == 0
+          # upstream bug: buffer number misreported as 0
+          # see: https://wincent.com/issues/1617
+          ::VIM::command "silent b #{@initial_buffer.name}"
+        else
+          ::VIM::command "silent b #{@initial_buffer.number}"
+        end
+      end
+    end
+
+    def flush
+      set_up_max_height
+      set_up_file_finder
+    end
+
+    def handle_key
+      key = ::VIM::evaluate('a:arg').to_i.chr
+      if @focus == @prompt
+        @prompt.add! key
+        list_matches
+      else
+        @match_window.find key
+      end
+    end
+
+    def backspace
+      if @focus == @prompt
+        @prompt.backspace!
+        list_matches
+      end
+    end
+
+    def delete
+      if @focus == @prompt
+        @prompt.delete!
+        list_matches
+      end
+    end
+
+    def accept_selection options = {}
+      selection = @match_window.selection
+      hide
+      open_selection(selection, options) unless selection.nil?
+    end
+
+    def toggle_focus
+      @focus.unfocus # old focus
+      @focus = @focus == @prompt ? @match_window : @prompt
+      @focus.focus # new focus
+    end
+
+    def cancel
+      hide
+    end
+
+    def select_next
+      @match_window.select_next
+    end
+
+    def select_prev
+      @match_window.select_prev
+    end
+
+    def clear
+      @prompt.clear!
+      list_matches
+    end
+
+    def cursor_left
+      @prompt.cursor_left if @focus == @prompt
+    end
+
+    def cursor_right
+      @prompt.cursor_right if @focus == @prompt
+    end
+
+    def cursor_end
+      @prompt.cursor_end if @focus == @prompt
+    end
+
+    def cursor_start
+      @prompt.cursor_start if @focus == @prompt
+    end
+
+    def leave
+      @match_window.leave
+    end
+
+    def unload
+      @match_window.unload
+    end
+
+  private
+
+    def show
+      @initial_window   = $curwin
+      @initial_buffer   = $curbuf
+      @match_window     = MatchWindow.new \
+        :prompt               => @prompt,
+        :match_window_at_top  => get_bool('g:CommandTMatchWindowAtTop'),
+        :match_window_reverse => get_bool('g:CommandTMatchWindowReverse')
+      @focus            = @prompt
+      @prompt.focus
+      register_for_key_presses
+      clear # clears prompt and lists matches
+    end
+
+    def set_up_max_height
+      @max_height = get_number('g:CommandTMaxHeight') || 0
+    end
+
+    def set_up_file_finder
+      @file_finder = CommandT::FileFinder.new nil,
+        :max_files              => get_number('g:CommandTMaxFiles'),
+        :max_depth              => get_number('g:CommandTMaxDepth'),
+        :always_show_dot_files  => get_bool('g:CommandTAlwaysShowDotFiles'),
+        :never_show_dot_files   => get_bool('g:CommandTNeverShowDotFiles'),
+        :scan_dot_directories   => get_bool('g:CommandTScanDotDirectories')
+    end
+
+    def exists? name
+      ::VIM::evaluate("exists(\"#{name}\")").to_i != 0
+    end
+
+    def get_number name
+      exists?(name) ? ::VIM::evaluate("#{name}").to_i : nil
+    end
+
+    def get_bool name
+      exists?(name) ? ::VIM::evaluate("#{name}").to_i != 0 : nil
+    end
+
+    def get_string name
+      exists?(name) ? ::VIM::evaluate("#{name}").to_s : nil
+    end
+
+    # expect a string or a list of strings
+    def get_list_or_string name
+      return nil unless exists?(name)
+      list_or_string = ::VIM::evaluate("#{name}")
+      if list_or_string.kind_of?(Array)
+        list_or_string.map { |item| item.to_s }
+      else
+        list_or_string.to_s
+      end
+    end
+
+    # Backslash-escape space, \, |, %, #, "
+    def sanitize_path_string str
+      # for details on escaping command-line mode arguments see: :h :
+      # (that is, help on ":") in the Vim documentation.
+      str.gsub(/[ \\|%#"]/, '\\\\\0')
+    end
+
+    def default_open_command
+      if !get_bool('&hidden') && get_bool('&modified')
+        'sp'
+      else
+        'e'
+      end
+    end
+
+    def ensure_appropriate_window_selection
+      # normally we try to open the selection in the current window, but there
+      # is one exception:
+      #
+      # - we don't touch any "unlisted" buffer with buftype "nofile" (such as
+      #   NERDTree or MiniBufExplorer); this is to avoid things like the "Not
+      #   enough room" error which occurs when trying to open in a split in a
+      #   shallow (potentially 1-line) buffer like MiniBufExplorer is current
+      #
+      # Other "unlisted" buffers, such as those with buftype "help" are treated
+      # normally.
+      initial = $curwin
+      while true do
+        break unless ::VIM::evaluate('&buflisted').to_i == 0 &&
+          ::VIM::evaluate('&buftype').to_s == 'nofile'
+        ::VIM::command 'wincmd w'     # try next window
+        break if $curwin == initial # have already tried all
+      end
+    end
+
+    def open_selection selection, options = {}
+      command = options[:command] || default_open_command
+      selection = File.expand_path selection, @path
+      selection = relative_path_under_working_directory selection
+      selection = sanitize_path_string selection
+      ensure_appropriate_window_selection
+      ::VIM::command "silent #{command} #{selection}"
+    end
+
+    def map key, function, param = nil
+      ::VIM::command "noremap <silent> <buffer> #{key} " \
+        ":call CommandT#{function}(#{param})<CR>"
+    end
+
+    def xterm?
+      !!(::VIM::evaluate('&term') =~ /\Axterm/)
+    end
+
+    def vt100?
+      !!(::VIM::evaluate('&term') =~ /\Avt100/)
+    end
+
+    def register_for_key_presses
+      # "normal" keys (interpreted literally)
+      numbers     = ('0'..'9').to_a.join
+      lowercase   = ('a'..'z').to_a.join
+      uppercase   = lowercase.upcase
+      punctuation = '<>`@#~!"$%&/()=+*-_.,;:?\\\'{}[] ' # and space
+      (numbers + lowercase + uppercase + punctuation).each_byte do |b|
+        map "<Char-#{b}>", 'HandleKey', b
+      end
+
+      # "special" keys (overridable by settings)
+      { 'Backspace'             => '<BS>',
+        'Delete'                => '<Del>',
+        'AcceptSelection'       => '<CR>',
+        'AcceptSelectionSplit'  => ['<C-CR>', '<C-s>'],
+        'AcceptSelectionTab'    => '<C-t>',
+        'AcceptSelectionVSplit' => '<C-v>',
+        'ToggleFocus'           => '<Tab>',
+        'Cancel'                => ['<C-c>', '<Esc>'],
+        'SelectNext'            => ['<C-n>', '<C-j>', '<Down>'],
+        'SelectPrev'            => ['<C-p>', '<C-k>', '<Up>'],
+        'Clear'                 => '<C-u>',
+        'CursorLeft'            => ['<Left>', '<C-h>'],
+        'CursorRight'           => ['<Right>', '<C-l>'],
+        'CursorEnd'             => '<C-e>',
+        'CursorStart'           => '<C-a>' }.each do |key, value|
+        if override = get_list_or_string("g:CommandT#{key}Map")
+          [override].flatten.each do |mapping|
+            map mapping, key
+          end
+        else
+          [value].flatten.each do |mapping|
+            map mapping, key unless mapping == '<Esc>' && (xterm? || vt100?)
+          end
+        end
+      end
+    end
+
+    # Returns the desired maximum number of matches, based on available
+    # vertical space and the g:CommandTMaxHeight option.
+    def match_limit
+      limit = VIM::Screen.lines - 5
+      limit = 1 if limit < 0
+      limit = [limit, @max_height].min if @max_height > 0
+      limit
+    end
+
+    def list_matches
+      matches = @active_finder.sorted_matches_for @prompt.abbrev, :limit => match_limit
+      @match_window.matches = matches
+    end
+  end # class Controller
+end # module commandT
diff --git a/vim/tmp/command_t/ruby/command-t/depend b/vim/tmp/command_t/ruby/command-t/depend
new file mode 100644 (file)
index 0000000..bfa9552
--- /dev/null
@@ -0,0 +1,24 @@
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+CFLAGS += -std=c99 -Wall -Wextra -Wno-unused-parameter
diff --git a/vim/tmp/command_t/ruby/command-t/ext.c b/vim/tmp/command_t/ruby/command-t/ext.c
new file mode 100644 (file)
index 0000000..c5026cc
--- /dev/null
@@ -0,0 +1,65 @@
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "match.h"
+#include "matcher.h"
+
+VALUE mCommandT         = 0; // module CommandT
+VALUE cCommandTMatch    = 0; // class CommandT::Match
+VALUE cCommandTMatcher  = 0; // class CommandT::Matcher
+
+VALUE CommandT_option_from_hash(const char *option, VALUE hash)
+{
+    if (NIL_P(hash))
+        return Qnil;
+    VALUE key = ID2SYM(rb_intern(option));
+    if (rb_funcall(hash, rb_intern("has_key?"), 1, key) == Qtrue)
+        return rb_hash_aref(hash, key);
+    else
+        return Qnil;
+}
+
+void Init_ext()
+{
+    // module CommandT
+    mCommandT = rb_define_module("CommandT");
+
+    // class CommandT::Match
+    cCommandTMatch = rb_define_class_under(mCommandT, "Match", rb_cObject);
+
+    // methods
+    rb_define_method(cCommandTMatch, "initialize", CommandTMatch_initialize, -1);
+    rb_define_method(cCommandTMatch, "matches?", CommandTMatch_matches, 0);
+    rb_define_method(cCommandTMatch, "to_s", CommandTMatch_to_s, 0);
+
+    // attributes
+    rb_define_attr(cCommandTMatch, "score", Qtrue, Qfalse); // reader: true, writer: false
+
+    // class CommandT::Matcher
+    cCommandTMatcher = rb_define_class_under(mCommandT, "Matcher", rb_cObject);
+
+    // methods
+    rb_define_method(cCommandTMatcher, "initialize", CommandTMatcher_initialize, -1);
+    rb_define_method(cCommandTMatcher, "sorted_matches_for", CommandTMatcher_sorted_matches_for, 2);
+    rb_define_method(cCommandTMatcher, "matches_for", CommandTMatcher_matches_for, 1);
+}
diff --git a/vim/tmp/command_t/ruby/command-t/ext.h b/vim/tmp/command_t/ruby/command-t/ext.h
new file mode 100644 (file)
index 0000000..89ff076
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <ruby.h>
+
+extern VALUE mCommandT;         // module CommandT
+extern VALUE cCommandTMatch;    // class CommandT::Match
+extern VALUE cCommandTMatcher;  // class CommandT::Matcher
+
+// Encapsulates common pattern of checking for an option in an optional
+// options hash. The hash itself may be nil, but an exception will be
+// raised if it is not nil and not a hash.
+VALUE CommandT_option_from_hash(const char *option, VALUE hash);
+
+// Debugging macro.
+#define ruby_inspect(obj) rb_funcall(rb_mKernel, rb_intern("p"), 1, obj)
diff --git a/vim/tmp/command_t/ruby/command-t/extconf.rb b/vim/tmp/command_t/ruby/command-t/extconf.rb
new file mode 100644 (file)
index 0000000..58503b6
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'mkmf'
+
+def missing item
+  puts "couldn't find #{item} (required)"
+  exit 1
+end
+
+have_header('ruby.h') or missing('ruby.h')
+create_makefile('ext')
diff --git a/vim/tmp/command_t/ruby/command-t/finder.rb b/vim/tmp/command_t/ruby/command-t/finder.rb
new file mode 100644 (file)
index 0000000..a3d0b09
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/ext' # CommandT::Matcher
+
+module CommandT
+  # Encapsulates a Scanner instance (which builds up a list of available files
+  # in a directory) and a Matcher instance (which selects from that list based
+  # on a search string).
+  #
+  # Specialized subclasses use different kinds of scanners adapted for
+  # different kinds of search (files, buffers).
+  class Finder
+    def initialize path = Dir.pwd, options = {}
+      raise RuntimeError, 'Subclass responsibility'
+    end
+
+    # Options:
+    #   :limit (integer): limit the number of returned matches
+    def sorted_matches_for str, options = {}
+      @matcher.sorted_matches_for str, options
+    end
+
+    def flush
+      @scanner.flush
+    end
+
+    def path= path
+      @scanner.path = path
+    end
+  end # class Finder
+end # CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/finder/buffer_finder.rb b/vim/tmp/command_t/ruby/command-t/finder/buffer_finder.rb
new file mode 100644 (file)
index 0000000..2319c24
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/ext' # CommandT::Matcher
+require 'command-t/scanner/buffer_scanner'
+require 'command-t/finder'
+
+module CommandT
+  class BufferFinder < Finder
+    def initialize
+      @scanner = BufferScanner.new
+      @matcher = Matcher.new @scanner, :always_show_dot_files => true
+    end
+  end # class BufferFinder
+end # CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/finder/file_finder.rb b/vim/tmp/command_t/ruby/command-t/finder/file_finder.rb
new file mode 100644 (file)
index 0000000..a9ed231
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/ext' # CommandT::Matcher
+require 'command-t/finder'
+require 'command-t/scanner/file_scanner'
+
+module CommandT
+  class FileFinder < Finder
+    def initialize path = Dir.pwd, options = {}
+      @scanner = FileScanner.new path, options
+      @matcher = Matcher.new @scanner, options
+    end
+  end # class FileFinder
+end # CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/match.c b/vim/tmp/command_t/ruby/command-t/match.c
new file mode 100644 (file)
index 0000000..e32fb0b
--- /dev/null
@@ -0,0 +1,189 @@
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "match.h"
+#include "ext.h"
+#include "ruby_compat.h"
+
+// use a struct to make passing params during recursion easier
+typedef struct
+{
+    char    *str_p;                 // pointer to string to be searched
+    long    str_len;                // length of same
+    char    *abbrev_p;              // pointer to search string (abbreviation)
+    long    abbrev_len;             // length of same
+    double  max_score_per_char;
+    int     dot_file;               // boolean: true if str is a dot-file
+    int     always_show_dot_files;  // boolean
+    int     never_show_dot_files;   // boolean
+} matchinfo_t;
+
+double recursive_match(matchinfo_t *m,  // sharable meta-data
+                       long str_idx,    // where in the path string to start
+                       long abbrev_idx, // where in the search string to start
+                       long last_idx,   // location of last matched character
+                       double score)    // cumulative score so far
+{
+    double seen_score = 0;      // remember best score seen via recursion
+    int dot_file_match = 0;     // true if abbrev matches a dot-file
+    int dot_search = 0;         // true if searching for a dot
+
+    for (long i = abbrev_idx; i < m->abbrev_len; i++)
+    {
+        char c = m->abbrev_p[i];
+        if (c == '.')
+            dot_search = 1;
+        int found = 0;
+        for (long j = str_idx; j < m->str_len; j++, str_idx++)
+        {
+            char d = m->str_p[j];
+            if (d == '.')
+            {
+                if (j == 0 || m->str_p[j - 1] == '/')
+                {
+                    m->dot_file = 1;        // this is a dot-file
+                    if (dot_search)         // and we are searching for a dot
+                        dot_file_match = 1; // so this must be a match
+                }
+            }
+            else if (d >= 'A' && d <= 'Z')
+                d += 'a' - 'A'; // add 32 to downcase
+            if (c == d)
+            {
+                found = 1;
+                dot_search = 0;
+
+                // calculate score
+                double score_for_char = m->max_score_per_char;
+                long distance = j - last_idx;
+                if (distance > 1)
+                {
+                    double factor = 1.0;
+                    char last = m->str_p[j - 1];
+                    char curr = m->str_p[j]; // case matters, so get again
+                    if (last == '/')
+                        factor = 0.9;
+                    else if (last == '-' ||
+                            last == '_' ||
+                            last == ' ' ||
+                            (last >= '0' && last <= '9'))
+                        factor = 0.8;
+                    else if (last >= 'a' && last <= 'z' &&
+                            curr >= 'A' && curr <= 'Z')
+                        factor = 0.8;
+                    else if (last == '.')
+                        factor = 0.7;
+                    else
+                        // if no "special" chars behind char, factor diminishes
+                        // as distance from last matched char increases
+                        factor = (1.0 / distance) * 0.75;
+                    score_for_char *= factor;
+                }
+
+                if (++j < m->str_len)
+                {
+                    // bump cursor one char to the right and
+                    // use recursion to try and find a better match
+                    double sub_score = recursive_match(m, j, i, last_idx, score);
+                    if (sub_score > seen_score)
+                        seen_score = sub_score;
+                }
+
+                score += score_for_char;
+                last_idx = str_idx++;
+                break;
+            }
+        }
+        if (!found)
+            return 0.0;
+    }
+    if (m->dot_file)
+    {
+        if (m->never_show_dot_files ||
+            (!dot_file_match && !m->always_show_dot_files))
+            return 0.0;
+    }
+    return (score > seen_score) ? score : seen_score;
+}
+
+// Match.new abbrev, string, options = {}
+VALUE CommandTMatch_initialize(int argc, VALUE *argv, VALUE self)
+{
+    // process arguments: 2 mandatory, 1 optional
+    VALUE str, abbrev, options;
+    if (rb_scan_args(argc, argv, "21", &str, &abbrev, &options) == 2)
+        options = Qnil;
+    str             = StringValue(str);
+    abbrev          = StringValue(abbrev); // already downcased by caller
+
+    // check optional options hash for overrides
+    VALUE always_show_dot_files = CommandT_option_from_hash("always_show_dot_files", options);
+    VALUE never_show_dot_files = CommandT_option_from_hash("never_show_dot_files", options);
+
+    matchinfo_t m;
+    m.str_p                 = RSTRING_PTR(str);
+    m.str_len               = RSTRING_LEN(str);
+    m.abbrev_p              = RSTRING_PTR(abbrev);
+    m.abbrev_len            = RSTRING_LEN(abbrev);
+    m.max_score_per_char    = (1.0 / m.str_len + 1.0 / m.abbrev_len) / 2;
+    m.dot_file              = 0;
+    m.always_show_dot_files = always_show_dot_files == Qtrue;
+    m.never_show_dot_files  = never_show_dot_files == Qtrue;
+
+    // calculate score
+    double score = 1.0;
+    if (m.abbrev_len == 0) // special case for zero-length search string
+    {
+        // filter out dot files
+        if (!m.always_show_dot_files)
+        {
+            for (long i = 0; i < m.str_len; i++)
+            {
+                char c = m.str_p[i];
+                if (c == '.' && (i == 0 || m.str_p[i - 1] == '/'))
+                {
+                    score = 0.0;
+                    break;
+                }
+            }
+        }
+    }
+    else // normal case
+        score = recursive_match(&m, 0, 0, 0, 0.0);
+
+    // clean-up and final book-keeping
+    rb_iv_set(self, "@score", rb_float_new(score));
+    rb_iv_set(self, "@str", str);
+    return Qnil;
+}
+
+VALUE CommandTMatch_matches(VALUE self)
+{
+    double score = NUM2DBL(rb_iv_get(self, "@score"));
+    return score > 0 ? Qtrue : Qfalse;
+}
+
+VALUE CommandTMatch_to_s(VALUE self)
+{
+    return rb_iv_get(self, "@str");
+}
diff --git a/vim/tmp/command_t/ruby/command-t/match.h b/vim/tmp/command_t/ruby/command-t/match.h
new file mode 100644 (file)
index 0000000..c3ce929
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <ruby.h>
+
+extern VALUE CommandTMatch_initialize(int argc, VALUE *argv, VALUE self);
+extern VALUE CommandTMatch_matches(VALUE self);
+extern VALUE CommandTMatch_score(VALUE self);
+extern VALUE CommandTMatch_to_s(VALUE self);
diff --git a/vim/tmp/command_t/ruby/command-t/match_window.rb b/vim/tmp/command_t/ruby/command-t/match_window.rb
new file mode 100644 (file)
index 0000000..f984287
--- /dev/null
@@ -0,0 +1,387 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'ostruct'
+require 'command-t/settings'
+
+module CommandT
+  class MatchWindow
+    @@selection_marker  = '> '
+    @@marker_length     = @@selection_marker.length
+    @@unselected_marker = ' ' * @@marker_length
+    @@buffer            = nil
+
+    def initialize options = {}
+      @prompt = options[:prompt]
+      @reverse_list = options[:match_window_reverse]
+
+      # save existing window dimensions so we can restore them later
+      @windows = []
+      (0..(::VIM::Window.count - 1)).each do |i|
+        window = OpenStruct.new :index => i, :height => ::VIM::Window[i].height
+        @windows << window
+      end
+
+      # global settings (must manually save and restore)
+      @settings = Settings.new
+      ::VIM::set_option 'timeout'         # ensure mappings timeout
+      ::VIM::set_option 'timeoutlen=0'    # respond immediately to mappings
+      ::VIM::set_option 'nohlsearch'      # don't highlight search strings
+      ::VIM::set_option 'noinsertmode'    # don't make Insert mode the default
+      ::VIM::set_option 'noshowcmd'       # don't show command info on last line
+      ::VIM::set_option 'report=9999'     # don't show "X lines changed" reports
+      ::VIM::set_option 'sidescroll=0'    # don't sidescroll in jumps
+      ::VIM::set_option 'sidescrolloff=0' # don't sidescroll automatically
+      ::VIM::set_option 'noequalalways'   # don't auto-balance window sizes
+
+      # show match window
+      split_location = options[:match_window_at_top] ? 'topleft' : 'botright'
+      if @@buffer # still have buffer from last time
+        ::VIM::command "silent! #{split_location} #{@@buffer.number}sbuffer"
+        raise "Can't re-open GoToFile buffer" unless $curbuf.number == @@buffer.number
+        $curwin.height = 1
+      else        # creating match window for first time and set it up
+        split_command = "silent! #{split_location} 1split GoToFile"
+        [
+          split_command,
+          'setlocal bufhidden=unload',  # unload buf when no longer displayed
+          'setlocal buftype=nofile',    # buffer is not related to any file
+          'setlocal nomodifiable',      # prevent manual edits
+          'setlocal noswapfile',        # don't create a swapfile
+          'setlocal nowrap',            # don't soft-wrap
+          'setlocal nonumber',          # don't show line numbers
+          'setlocal nolist',            # don't use List mode (visible tabs etc)
+          'setlocal foldcolumn=0',      # don't show a fold column at side
+          'setlocal foldlevel=99',      # don't fold anything
+          'setlocal nocursorline',      # don't highlight line cursor is on
+          'setlocal nospell',           # spell-checking off
+          'setlocal nobuflisted',       # don't show up in the buffer list
+          'setlocal textwidth=0'        # don't hard-wrap (break long lines)
+        ].each { |command| ::VIM::command command }
+
+        # sanity check: make sure the buffer really was created
+        raise "Can't find GoToFile buffer" unless $curbuf.name.match /GoToFile\z/
+        @@buffer = $curbuf
+      end
+
+      # syntax coloring
+      if VIM::has_syntax?
+        ::VIM::command "syntax match CommandTSelection \"^#{@@selection_marker}.\\+$\""
+        ::VIM::command 'syntax match CommandTNoEntries "^-- NO MATCHES --$"'
+        ::VIM::command 'syntax match CommandTNoEntries "^-- NO SUCH FILE OR DIRECTORY --$"'
+        ::VIM::command 'highlight link CommandTSelection Visual'
+        ::VIM::command 'highlight link CommandTNoEntries Error'
+        ::VIM::evaluate 'clearmatches()'
+
+        # hide cursor
+        @cursor_highlight = get_cursor_highlight
+        hide_cursor
+      end
+
+      # perform cleanup using an autocmd to ensure we don't get caught out
+      # by some unexpected means of dismissing or leaving the Command-T window
+      # (eg. <C-W q>, <C-W k> etc)
+      ::VIM::command 'autocmd! * <buffer>'
+      ::VIM::command 'autocmd BufLeave <buffer> ruby $command_t.leave'
+      ::VIM::command 'autocmd BufUnload <buffer> ruby $command_t.unload'
+
+      @has_focus  = false
+      @selection  = nil
+      @abbrev     = ''
+      @window     = $curwin
+    end
+
+    def close
+      # Workaround for upstream bug in Vim 7.3 on some platforms
+      #
+      # On some platforms, $curbuf.number always returns 0. One workaround is
+      # to build Vim with --disable-largefile, but as this is producing lots of
+      # support requests, implement the following fallback to the buffer name
+      # instead, at least until upstream gets fixed.
+      #
+      # For more details, see: https://wincent.com/issues/1617
+      if $curbuf.number == 0
+        # use bwipeout as bunload fails if passed the name of a hidden buffer
+        ::VIM::command 'bwipeout! GoToFile'
+        @@buffer = nil
+      else
+        ::VIM::command "bunload! #{@@buffer.number}"
+      end
+    end
+
+    def leave
+      close
+      unload
+    end
+
+    def unload
+      restore_window_dimensions
+      @settings.restore
+      @prompt.dispose
+      show_cursor
+    end
+
+    def add! char
+      @abbrev += char
+    end
+
+    def backspace!
+      @abbrev.chop!
+    end
+
+    def select_next
+      if @selection < @matches.length - 1
+        @selection += 1
+        print_match(@selection - 1) # redraw old selection (removes marker)
+        print_match(@selection)     # redraw new selection (adds marker)
+        move_cursor_to_selected_line
+      else
+        # (possibly) loop or scroll
+      end
+    end
+
+    def select_prev
+      if @selection > 0
+        @selection -= 1
+        print_match(@selection + 1) # redraw old selection (removes marker)
+        print_match(@selection)     # redraw new selection (adds marker)
+        move_cursor_to_selected_line
+      else
+        # (possibly) loop or scroll
+      end
+    end
+
+    def matches= matches
+      matches = matches.reverse if @reverse_list
+      if matches != @matches
+        @matches = matches
+        @selection = @reverse_list ? @matches.length - 1 : 0
+        print_matches
+        move_cursor_to_selected_line
+      end
+    end
+
+    def focus
+      unless @has_focus
+        @has_focus = true
+        if VIM::has_syntax?
+          ::VIM::command 'highlight link CommandTSelection Search'
+        end
+      end
+    end
+
+    def unfocus
+      if @has_focus
+        @has_focus = false
+        if VIM::has_syntax?
+          ::VIM::command 'highlight link CommandTSelection Visual'
+        end
+      end
+    end
+
+    def find char
+      # is this a new search or the continuation of a previous one?
+      now = Time.now
+      if @last_key_time.nil? or @last_key_time < (now - 0.5)
+        @find_string = char
+      else
+        @find_string += char
+      end
+      @last_key_time = now
+
+      # see if there's anything up ahead that matches
+      @matches.each_with_index do |match, idx|
+        if match[0, @find_string.length].casecmp(@find_string) == 0
+          old_selection = @selection
+          @selection = idx
+          print_match(old_selection)  # redraw old selection (removes marker)
+          print_match(@selection)     # redraw new selection (adds marker)
+          break
+        end
+      end
+    end
+
+    # Returns the currently selected item as a String.
+    def selection
+      @matches[@selection]
+    end
+
+    def print_no_such_file_or_directory
+      print_error 'NO SUCH FILE OR DIRECTORY'
+    end
+
+  private
+
+    def move_cursor_to_selected_line
+      # on some non-GUI terminals, the cursor doesn't hide properly
+      # so we move the cursor to prevent it from blinking away in the
+      # upper-left corner in a distracting fashion
+      @window.cursor = [@selection + 1, 0]
+    end
+
+    def print_error msg
+      return unless VIM::Window.select(@window)
+      unlock
+      clear
+      @window.height = 1
+      @@buffer[1] = "-- #{msg} --"
+      lock
+    end
+
+    def restore_window_dimensions
+      # sort from tallest to shortest
+      @windows.sort! { |a, b| b.height <=> a.height }
+
+      # starting with the tallest ensures that there are no constraints
+      # preventing windows on the side of vertical splits from regaining
+      # their original full size
+      @windows.each do |w|
+        # beware: window may be nil
+        window = ::VIM::Window[w.index]
+        window.height = w.height if window
+      end
+    end
+
+    def match_text_for_idx idx
+      match = truncated_match @matches[idx]
+      if idx == @selection
+        prefix = @@selection_marker
+        suffix = padding_for_selected_match match
+      else
+        prefix = @@unselected_marker
+        suffix = ''
+      end
+      prefix + match + suffix
+    end
+
+    # Print just the specified match.
+    def print_match idx
+      return unless VIM::Window.select(@window)
+      unlock
+      @@buffer[idx + 1] = match_text_for_idx idx
+      lock
+    end
+
+    # Print all matches.
+    def print_matches
+      match_count = @matches.length
+      if match_count == 0
+        print_error 'NO MATCHES'
+      else
+        return unless VIM::Window.select(@window)
+        unlock
+        clear
+        actual_lines = 1
+        @window_width = @window.width # update cached value
+        max_lines = VIM::Screen.lines - 5
+        max_lines = 1 if max_lines < 0
+        actual_lines = match_count > max_lines ? max_lines : match_count
+        @window.height = actual_lines
+        (1..actual_lines).each do |line|
+          idx = line - 1
+          if @@buffer.count >= line
+            @@buffer[line] = match_text_for_idx idx
+          else
+            @@buffer.append line - 1, match_text_for_idx(idx)
+          end
+        end
+        lock
+      end
+    end
+
+    # Prepare padding for match text (trailing spaces) so that selection
+    # highlighting extends all the way to the right edge of the window.
+    def padding_for_selected_match str
+      len = str.length
+      if len >= @window_width - @@marker_length
+        ''
+      else
+        ' ' * (@window_width - @@marker_length - len)
+      end
+    end
+
+    # Convert "really/long/path" into "really...path" based on available
+    # window width.
+    def truncated_match str
+      len = str.length
+      available_width = @window_width - @@marker_length
+      return str if len <= available_width
+      left = (available_width / 2) - 1
+      right = (available_width / 2) - 2 + (available_width % 2)
+      str[0, left] + '...' + str[-right, right]
+    end
+
+    def clear
+      # range = % (whole buffer)
+      # action = d (delete)
+      # register = _ (black hole register, don't record deleted text)
+      ::VIM::command 'silent %d _'
+    end
+
+    def get_cursor_highlight
+      # as :highlight returns nothing and only prints,
+      # must redirect its output to a variable
+      ::VIM::command 'silent redir => g:command_t_cursor_highlight'
+
+      # force 0 verbosity to ensure origin information isn't printed as well
+      ::VIM::command 'silent! 0verbose highlight Cursor'
+      ::VIM::command 'silent redir END'
+
+      # there are 3 possible formats to check for, each needing to be
+      # transformed in a certain way in order to reapply the highlight:
+      #   Cursor xxx guifg=bg guibg=fg      -> :hi! Cursor guifg=bg guibg=fg
+      #   Cursor xxx links to SomethingElse -> :hi! link Cursor SomethingElse
+      #   Cursor xxx cleared                -> :hi! clear Cursor
+      highlight = ::VIM::evaluate 'g:command_t_cursor_highlight'
+      if highlight =~ /^Cursor\s+xxx\s+links to (\w+)/
+        "link Cursor #{$~[1]}"
+      elsif highlight =~ /^Cursor\s+xxx\s+cleared/
+        'clear Cursor'
+      elsif highlight =~ /Cursor\s+xxx\s+(.+)/
+        "Cursor #{$~[1]}"
+      else # likely cause E411 Cursor highlight group not found
+        nil
+      end
+    end
+
+    def hide_cursor
+      if @cursor_highlight
+        ::VIM::command 'highlight Cursor NONE'
+      end
+    end
+
+    def show_cursor
+      if @cursor_highlight
+        ::VIM::command "highlight #{@cursor_highlight}"
+      end
+    end
+
+    def lock
+      ::VIM::command 'setlocal nomodifiable'
+    end
+
+    def unlock
+      ::VIM::command 'setlocal modifiable'
+    end
+  end
+end
diff --git a/vim/tmp/command_t/ruby/command-t/matcher.c b/vim/tmp/command_t/ruby/command-t/matcher.c
new file mode 100644 (file)
index 0000000..7cd8a3e
--- /dev/null
@@ -0,0 +1,164 @@
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdlib.h> /* for qsort() */
+#include <string.h> /* for strcmp() */
+#include "matcher.h"
+#include "ext.h"
+#include "ruby_compat.h"
+
+// comparison function for use with qsort
+int comp_alpha(const void *a, const void *b)
+{
+    VALUE a_val = *(VALUE *)a;
+    VALUE b_val = *(VALUE *)b;
+    ID to_s = rb_intern("to_s");
+
+    VALUE a_str = rb_funcall(a_val, to_s, 0);
+    VALUE b_str = rb_funcall(b_val, to_s, 0);
+    char *a_p = RSTRING_PTR(a_str);
+    long a_len = RSTRING_LEN(a_str);
+    char *b_p = RSTRING_PTR(b_str);
+    long b_len = RSTRING_LEN(b_str);
+    int order = 0;
+    if (a_len > b_len)
+    {
+        order = strncmp(a_p, b_p, b_len);
+        if (order == 0)
+            order = 1; // shorter string (b) wins
+    }
+    else if (a_len < b_len)
+    {
+        order = strncmp(a_p, b_p, a_len);
+        if (order == 0)
+            order = -1; // shorter string (a) wins
+    }
+    else
+        order = strncmp(a_p, b_p, a_len);
+    return order;
+}
+
+// comparison function for use with qsort
+int comp_score(const void *a, const void *b)
+{
+    VALUE a_val = *(VALUE *)a;
+    VALUE b_val = *(VALUE *)b;
+    ID score = rb_intern("score");
+    double a_score = RFLOAT_VALUE(rb_funcall(a_val, score, 0));
+    double b_score = RFLOAT_VALUE(rb_funcall(b_val, score, 0));
+    if (a_score > b_score)
+        return -1; // a scores higher, a should appear sooner
+    else if (a_score < b_score)
+        return 1;  // b scores higher, a should appear later
+    else
+        return comp_alpha(a, b);
+}
+
+VALUE CommandTMatcher_initialize(int argc, VALUE *argv, VALUE self)
+{
+    // process arguments: 1 mandatory, 1 optional
+    VALUE scanner, options;
+    if (rb_scan_args(argc, argv, "11", &scanner, &options) == 1)
+        options = Qnil;
+    if (NIL_P(scanner))
+        rb_raise(rb_eArgError, "nil scanner");
+    rb_iv_set(self, "@scanner", scanner);
+
+    // check optional options hash for overrides
+    VALUE always_show_dot_files = CommandT_option_from_hash("always_show_dot_files", options);
+    if (always_show_dot_files != Qtrue)
+        always_show_dot_files = Qfalse;
+    VALUE never_show_dot_files = CommandT_option_from_hash("never_show_dot_files", options);
+    if (never_show_dot_files != Qtrue)
+        never_show_dot_files = Qfalse;
+    rb_iv_set(self, "@always_show_dot_files", always_show_dot_files);
+    rb_iv_set(self, "@never_show_dot_files", never_show_dot_files);
+    return Qnil;
+}
+
+VALUE CommandTMatcher_sorted_matches_for(VALUE self, VALUE abbrev, VALUE options)
+{
+    // process optional options hash
+    VALUE limit_option = CommandT_option_from_hash("limit", options);
+
+    // get unsorted matches
+    VALUE matches = CommandTMatcher_matches_for(self, abbrev);
+
+    abbrev = StringValue(abbrev);
+    if (RSTRING_LEN(abbrev) == 0 ||
+        (RSTRING_LEN(abbrev) == 1 && RSTRING_PTR(abbrev)[0] == '.'))
+        // alphabetic order if search string is only "" or "."
+        qsort(RARRAY_PTR(matches), RARRAY_LEN(matches), sizeof(VALUE), comp_alpha);
+    else
+        // for all other non-empty search strings, sort by score
+        qsort(RARRAY_PTR(matches), RARRAY_LEN(matches), sizeof(VALUE), comp_score);
+
+    // apply optional limit option
+    long limit = NIL_P(limit_option) ? 0 : NUM2LONG(limit_option);
+    if (limit == 0 || RARRAY_LEN(matches) < limit)
+        limit = RARRAY_LEN(matches);
+
+    // will return an array of strings, not an array of Match objects
+    for (long i = 0; i < limit; i++)
+    {
+        VALUE str = rb_funcall(RARRAY_PTR(matches)[i], rb_intern("to_s"), 0);
+        RARRAY_PTR(matches)[i] = str;
+    }
+
+    // trim off any items beyond the limit
+    if (limit < RARRAY_LEN(matches))
+        (void)rb_funcall(matches, rb_intern("slice!"), 2, LONG2NUM(limit),
+            LONG2NUM(RARRAY_LEN(matches) - limit));
+    return matches;
+}
+
+VALUE CommandTMatcher_matches_for(VALUE self, VALUE abbrev)
+{
+    if (NIL_P(abbrev))
+        rb_raise(rb_eArgError, "nil abbrev");
+    VALUE matches = rb_ary_new();
+    VALUE scanner = rb_iv_get(self, "@scanner");
+    VALUE always_show_dot_files = rb_iv_get(self, "@always_show_dot_files");
+    VALUE never_show_dot_files = rb_iv_get(self, "@never_show_dot_files");
+    VALUE options = Qnil;
+    if (always_show_dot_files == Qtrue)
+    {
+        options = rb_hash_new();
+        rb_hash_aset(options, ID2SYM(rb_intern("always_show_dot_files")), always_show_dot_files);
+    }
+    else if (never_show_dot_files == Qtrue)
+    {
+        options = rb_hash_new();
+        rb_hash_aset(options, ID2SYM(rb_intern("never_show_dot_files")), never_show_dot_files);
+    }
+    abbrev = rb_funcall(abbrev, rb_intern("downcase"), 0);
+    VALUE paths = rb_funcall(scanner, rb_intern("paths"), 0);
+    for (long i = 0, max = RARRAY_LEN(paths); i < max; i++)
+    {
+        VALUE path = RARRAY_PTR(paths)[i];
+        VALUE match = rb_funcall(cCommandTMatch, rb_intern("new"), 3, path, abbrev, options);
+        if (rb_funcall(match, rb_intern("matches?"), 0) == Qtrue)
+            rb_funcall(matches, rb_intern("push"), 1, match);
+    }
+    return matches;
+}
diff --git a/vim/tmp/command_t/ruby/command-t/matcher.h b/vim/tmp/command_t/ruby/command-t/matcher.h
new file mode 100644 (file)
index 0000000..6207e37
--- /dev/null
@@ -0,0 +1,30 @@
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <ruby.h>
+
+extern VALUE CommandTMatcher_initialize(int argc, VALUE *argv, VALUE self);
+extern VALUE CommandTMatcher_sorted_matches_for(VALUE self, VALUE abbrev, VALUE options);
+
+// most likely the function will be subsumed by the sorted_matcher_for function
+extern VALUE CommandTMatcher_matches_for(VALUE self, VALUE abbrev);
diff --git a/vim/tmp/command_t/ruby/command-t/prompt.rb b/vim/tmp/command_t/ruby/command-t/prompt.rb
new file mode 100644 (file)
index 0000000..743e873
--- /dev/null
@@ -0,0 +1,165 @@
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  # Abuse the status line as a prompt.
+  class Prompt
+    attr_accessor :abbrev
+
+    def initialize
+      @abbrev     = ''  # abbreviation entered so far
+      @col        = 0   # cursor position
+      @has_focus  = false
+    end
+
+    # Erase whatever is displayed in the prompt line,
+    # effectively disposing of the prompt
+    def dispose
+      ::VIM::command 'echo'
+      ::VIM::command 'redraw'
+    end
+
+    # Clear any entered text.
+    def clear!
+      @abbrev = ''
+      @col    = 0
+      redraw
+    end
+
+    # Insert a character at (before) the current cursor position.
+    def add! char
+      left, cursor, right = abbrev_segments
+      @abbrev = left + char + cursor + right
+      @col += 1
+      redraw
+    end
+
+    # Delete a character to the left of the current cursor position.
+    def backspace!
+      if @col > 0
+        left, cursor, right = abbrev_segments
+        @abbrev = left.chop! + cursor + right
+        @col -= 1
+        redraw
+      end
+    end
+
+    # Delete a character at the current cursor position.
+    def delete!
+      if @col < @abbrev.length
+        left, cursor, right = abbrev_segments
+        @abbrev = left + right
+        redraw
+      end
+    end
+
+    def cursor_left
+      if @col > 0
+        @col -= 1
+        redraw
+      end
+    end
+
+    def cursor_right
+      if @col < @abbrev.length
+        @col += 1
+        redraw
+      end
+    end
+
+    def cursor_end
+      if @col < @abbrev.length
+        @col = @abbrev.length
+        redraw
+      end
+    end
+
+    def cursor_start
+      if @col != 0
+        @col = 0
+        redraw
+      end
+    end
+
+    def redraw
+      if @has_focus
+        prompt_highlight = 'Comment'
+        normal_highlight = 'None'
+        cursor_highlight = 'Underlined'
+      else
+        prompt_highlight = 'NonText'
+        normal_highlight = 'NonText'
+        cursor_highlight = 'NonText'
+      end
+      left, cursor, right = abbrev_segments
+      components = [prompt_highlight, '>>', 'None', ' ']
+      components += [normal_highlight, left] unless left.empty?
+      components += [cursor_highlight, cursor] unless cursor.empty?
+      components += [normal_highlight, right] unless right.empty?
+      components += [cursor_highlight, ' '] if cursor.empty?
+      set_status *components
+    end
+
+    def focus
+      unless @has_focus
+        @has_focus = true
+        redraw
+      end
+    end
+
+    def unfocus
+      if @has_focus
+        @has_focus = false
+        redraw
+      end
+    end
+
+  private
+
+    # Returns the @abbrev string divided up into three sections, any of
+    # which may actually be zero width, depending on the location of the
+    # cursor:
+    #   - left segment (to left of cursor)
+    #   - cursor segment (character at cursor)
+    #   - right segment (to right of cursor)
+    def abbrev_segments
+      left    = @abbrev[0, @col]
+      cursor  = @abbrev[@col, 1]
+      right   = @abbrev[(@col + 1)..-1] || ''
+      [left, cursor, right]
+    end
+
+    def set_status *args
+      # see ':help :echo' for why forcing a redraw here helps
+      # prevent the status line from getting inadvertantly cleared
+      # after our echo commands
+      ::VIM::command 'redraw'
+      while (highlight = args.shift) and  (text = args.shift) do
+        text = VIM::escape_for_single_quotes text
+        ::VIM::command "echohl #{highlight}"
+        ::VIM::command "echon '#{text}'"
+      end
+      ::VIM::command 'echohl None'
+    end
+  end # class Prompt
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/ruby_compat.h b/vim/tmp/command_t/ruby/command-t/ruby_compat.h
new file mode 100644 (file)
index 0000000..e7960a2
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright 2010 Wincent Colaiuta. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include <ruby.h>
+
+// for compatibility with older versions of Ruby which don't declare RSTRING_PTR
+#ifndef RSTRING_PTR
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#endif
+
+// for compatibility with older versions of Ruby which don't declare RSTRING_LEN
+#ifndef RSTRING_LEN
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+
+// for compatibility with older versions of Ruby which don't declare RARRAY_PTR
+#ifndef RARRAY_PTR
+#define RARRAY_PTR(a) (RARRAY(a)->ptr)
+#endif
+
+// for compatibility with older versions of Ruby which don't declare RARRAY_LEN
+#ifndef RARRAY_LEN
+#define RARRAY_LEN(a) (RARRAY(a)->len)
+#endif
+
+// for compatibility with older versions of Ruby which don't declare RFLOAT_VALUE
+#ifndef RFLOAT_VALUE
+#define RFLOAT_VALUE(f) (RFLOAT(f)->value)
+#endif
diff --git a/vim/tmp/command_t/ruby/command-t/scanner.rb b/vim/tmp/command_t/ruby/command-t/scanner.rb
new file mode 100644 (file)
index 0000000..5e5e3c9
--- /dev/null
@@ -0,0 +1,28 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim'
+
+module CommandT
+  class Scanner; end
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/scanner/buffer_scanner.rb b/vim/tmp/command_t/ruby/command-t/scanner/buffer_scanner.rb
new file mode 100644 (file)
index 0000000..aa85497
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim'
+require 'command-t/vim/path_utilities'
+require 'command-t/scanner'
+
+module CommandT
+  # Returns a list of all open buffers.
+  class BufferScanner < Scanner
+    include VIM::PathUtilities
+
+    def paths
+      (0..(::VIM::Buffer.count - 1)).map do |n|
+        buffer = ::VIM::Buffer[n]
+        if buffer.name # beware, may be nil
+          relative_path_under_working_directory buffer.name
+        end
+      end.compact
+    end
+  end # class BufferScanner
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/scanner/file_scanner.rb b/vim/tmp/command_t/ruby/command-t/scanner/file_scanner.rb
new file mode 100644 (file)
index 0000000..4ea15c8
--- /dev/null
@@ -0,0 +1,94 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim'
+require 'command-t/scanner'
+
+module CommandT
+  # Reads the current directory recursively for the paths to all regular files.
+  class FileScanner < Scanner
+    class FileLimitExceeded < ::RuntimeError; end
+
+    def initialize path = Dir.pwd, options = {}
+      @path                 = path
+      @max_depth            = options[:max_depth] || 15
+      @max_files            = options[:max_files] || 10_000
+      @scan_dot_directories = options[:scan_dot_directories] || false
+    end
+
+    def paths
+      return @paths unless @paths.nil?
+      begin
+        @paths = []
+        @depth = 0
+        @files = 0
+        @prefix_len = @path.chomp('/').length
+        add_paths_for_directory @path, @paths
+      rescue FileLimitExceeded
+      end
+      @paths
+    end
+
+    def flush
+      @paths = nil
+    end
+
+    def path= str
+      if @path != str
+        @path = str
+        flush
+      end
+    end
+
+  private
+
+    def path_excluded? path
+      # first strip common prefix (@path) from path to match VIM's behavior
+      path = path[(@prefix_len + 1)..-1]
+      path = VIM::escape_for_single_quotes path
+      ::VIM::evaluate("empty(expand(fnameescape('#{path}')))").to_i == 1
+    end
+
+    def add_paths_for_directory dir, accumulator
+      Dir.foreach(dir) do |entry|
+        next if ['.', '..'].include?(entry)
+        path = File.join(dir, entry)
+        unless path_excluded?(path)
+          if File.file?(path)
+            @files += 1
+            raise FileLimitExceeded if @files > @max_files
+            accumulator << path[@prefix_len + 1..-1]
+          elsif File.directory?(path)
+            next if @depth >= @max_depth
+            next if (entry.match(/\A\./) && !@scan_dot_directories)
+            @depth += 1
+            add_paths_for_directory path, accumulator
+            @depth -= 1
+          end
+        end
+      end
+    rescue Errno::EACCES
+      # skip over directories for which we don't have access
+    end
+  end # class FileScanner
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/settings.rb b/vim/tmp/command_t/ruby/command-t/settings.rb
new file mode 100644 (file)
index 0000000..c15016a
--- /dev/null
@@ -0,0 +1,77 @@
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  # Convenience class for saving and restoring global settings.
+  class Settings
+    def initialize
+      save
+    end
+
+    def save
+      @timeoutlen     = get_number 'timeoutlen'
+      @report         = get_number 'report'
+      @sidescroll     = get_number 'sidescroll'
+      @sidescrolloff  = get_number 'sidescrolloff'
+      @timeout        = get_bool 'timeout'
+      @equalalways    = get_bool 'equalalways'
+      @hlsearch       = get_bool 'hlsearch'
+      @insertmode     = get_bool 'insertmode'
+      @showcmd        = get_bool 'showcmd'
+    end
+
+    def restore
+      set_number 'timeoutlen', @timeoutlen
+      set_number 'report', @report
+      set_number 'sidescroll', @sidescroll
+      set_number 'sidescrolloff', @sidescrolloff
+      set_bool 'timeout', @timeout
+      set_bool 'equalalways', @equalalways
+      set_bool 'hlsearch', @hlsearch
+      set_bool 'insertmode', @insertmode
+      set_bool 'showcmd', @showcmd
+    end
+
+  private
+
+    def get_number setting
+      ::VIM::evaluate("&#{setting}").to_i
+    end
+
+    def get_bool setting
+      ::VIM::evaluate("&#{setting}").to_i == 1
+    end
+
+    def set_number setting, value
+      ::VIM::set_option "#{setting}=#{value}"
+    end
+
+    def set_bool setting, value
+      if value
+        ::VIM::set_option setting
+      else
+        ::VIM::set_option "no#{setting}"
+      end
+    end
+  end # class Settings
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/stub.rb b/vim/tmp/command_t/ruby/command-t/stub.rb
new file mode 100644 (file)
index 0000000..6e8b074
--- /dev/null
@@ -0,0 +1,46 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  class Stub
+    @@load_error = ['command-t.vim could not load the C extension',
+                    'Please see INSTALLATION and TROUBLE-SHOOTING in the help',
+                    'For more information type:    :help command-t']
+
+    def show_file_finder
+      warn *@@load_error
+    end
+
+    def flush
+      warn *@@load_error
+    end
+
+  private
+
+    def warn *msg
+      ::VIM::command 'echohl WarningMsg'
+      msg.each { |m| ::VIM::command "echo '#{m}'" }
+      ::VIM::command 'echohl none'
+    end
+  end # class Stub
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/vim.rb b/vim/tmp/command_t/ruby/command-t/vim.rb
new file mode 100644 (file)
index 0000000..b4e40fc
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim/screen'
+require 'command-t/vim/window'
+
+module CommandT
+  module VIM
+    def self.has_syntax?
+      ::VIM::evaluate('has("syntax")').to_i != 0
+    end
+
+    def self.pwd
+      ::VIM::evaluate 'getcwd()'
+    end
+
+    # Escape a string for safe inclusion in a Vim single-quoted string
+    # (single quotes escaped by doubling, everything else is literal)
+    def self.escape_for_single_quotes str
+      str.gsub "'", "''"
+    end
+  end # module VIM
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/vim/path_utilities.rb b/vim/tmp/command_t/ruby/command-t/vim/path_utilities.rb
new file mode 100644 (file)
index 0000000..8564300
--- /dev/null
@@ -0,0 +1,40 @@
+# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+require 'command-t/vim'
+
+module CommandT
+  module VIM
+    module PathUtilities
+
+    private
+
+      def relative_path_under_working_directory path
+        # any path under the working directory will be specified as a relative
+        # path to improve the readability of the buffer list etc
+        pwd = File.expand_path(VIM::pwd) + '/'
+        path.index(pwd) == 0 ? path[pwd.length..-1] : path
+      end
+    end # module PathUtilities
+  end # module VIM
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/vim/screen.rb b/vim/tmp/command_t/ruby/command-t/vim/screen.rb
new file mode 100644 (file)
index 0000000..fb7ba33
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  module VIM
+    module Screen
+      def self.lines
+        ::VIM::evaluate('&lines').to_i
+      end
+    end # module Screen
+  end # module VIM
+end # module CommandT
diff --git a/vim/tmp/command_t/ruby/command-t/vim/window.rb b/vim/tmp/command_t/ruby/command-t/vim/window.rb
new file mode 100644 (file)
index 0000000..1e53d56
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright 2010 Wincent Colaiuta. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+module CommandT
+  module VIM
+    class Window
+      def self.select window
+        return true if $curwin == window
+        initial = $curwin
+        while true do
+          ::VIM::command 'wincmd w'           # cycle through windows
+          return true if $curwin == window    # have selected desired window
+          return false if $curwin == initial  # have already looped through all
+        end
+      end
+    end # class Window
+  end # module VIM
+end # module CommandT
diff --git a/vim/tmp/conque/autoload/conque_term.vim b/vim/tmp/conque/autoload/conque_term.vim
new file mode 100644 (file)
index 0000000..2780c7d
--- /dev/null
@@ -0,0 +1,1590 @@
+" FILE:     plugin/conque_term.vim {{{
+"
+" AUTHOR:   Nico Raffo <nicoraffo@gmail.com>
+" MODIFIED: 2010-05-27
+" VERSION:  1.1, for Vim 7.0
+" LICENSE:
+" Conque - pty interaction in Vim
+" Copyright (C) 2009-2010 Nico Raffo 
+"
+" MIT License
+" 
+" Permission is hereby granted, free of charge, to any person obtaining a copy
+" of this software and associated documentation files (the "Software"), to deal
+" in the Software without restriction, including without limitation the rights
+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+" copies of the Software, and to permit persons to whom the Software is
+" furnished to do so, subject to the following conditions:
+" 
+" The above copyright notice and this permission notice shall be included in
+" all copies or substantial portions of the Software.
+" 
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+" THE SOFTWARE.
+" }}}
+
+
+" **********************************************************************************************************
+" **** VIM FUNCTIONS ***************************************************************************************
+" **********************************************************************************************************
+
+" launch conque
+function! conque_term#open(...) "{{{
+    let command = get(a:000, 0, '')
+    let hooks   = get(a:000, 1, [])
+
+    " bare minimum validation
+    if has('python') != 1
+        echohl WarningMsg | echomsg "Conque requires the Python interface to be installed" | echohl None
+        return 0
+    endif
+    if empty(command)
+        echohl WarningMsg | echomsg "No command found" | echohl None
+        return 0
+    else
+        let l:cargs = split(command, '\s')
+        if !executable(l:cargs[0])
+            echohl WarningMsg | echomsg "Not an executable: " . l:cargs[0] | echohl None
+            return 0
+        endif
+    endif
+
+    " set buffer window options
+    let g:ConqueTerm_BufName = substitute(command, ' ', '\\ ', 'g') . "\\ -\\ " . g:ConqueTerm_Idx
+    call conque_term#set_buffer_settings(command, hooks)
+    let b:ConqueTerm_Var = 'ConqueTerm_' . g:ConqueTerm_Idx
+    let g:ConqueTerm_Var = 'ConqueTerm_' . g:ConqueTerm_Idx
+    let g:ConqueTerm_Idx += 1
+
+    " open command
+    try
+        let l:config = '{"color":' . string(g:ConqueTerm_Color) . ',"TERM":"' . g:ConqueTerm_TERM . '"}'
+        execute 'python ' . b:ConqueTerm_Var . ' = Conque()'
+        execute "python " . b:ConqueTerm_Var . ".open('" . conque_term#python_escape(command) . "', " . l:config . ")"
+    catch 
+        echohl WarningMsg | echomsg "Unable to open command: " . command | echohl None
+        return 0
+    endtry
+
+    " set buffer mappings and auto commands 
+    call conque_term#set_mappings('start')
+
+    startinsert!
+    return 1
+endfunction "}}}
+
+" set buffer options
+function! conque_term#set_buffer_settings(command, pre_hooks) "{{{
+
+    " optional hooks to execute, e.g. 'split'
+    for h in a:pre_hooks
+        sil exe h
+    endfor
+    sil exe "edit " . g:ConqueTerm_BufName
+
+    " buffer settings 
+    setlocal nocompatible      " conque won't work in compatible mode
+    setlocal nopaste           " conque won't work in paste mode
+    setlocal buftype=nofile    " this buffer is not a file, you can't save it
+    setlocal nonumber          " hide line numbers
+    setlocal foldcolumn=0      " reasonable left margin
+    setlocal nowrap            " default to no wrap (esp with MySQL)
+    setlocal noswapfile        " don't bother creating a .swp file
+    setlocal updatetime=50     " trigger cursorhold event after 50ms / XXX - global
+    setlocal scrolloff=0       " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal sidescrolloff=0   " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal sidescroll=1      " don't use buffer lines. it makes the 'clear' command not work as expected
+    setlocal foldmethod=manual " don't fold on {{{}}} and stuff
+    setlocal bufhidden=hide    " when buffer is no longer displayed, don't wipe it out
+    setfiletype conque_term    " useful
+    sil exe "setlocal syntax=" . g:ConqueTerm_Syntax
+
+endfunction " }}}
+
+" set key mappings and auto commands
+function! conque_term#set_mappings(action) "{{{
+
+    " set action
+    if a:action == 'toggle'
+        if exists('b:conque_on') && b:conque_on == 1
+            let l:action = 'stop'
+            echohl WarningMsg | echomsg "Terminal is paused" | echohl None
+        else
+            let l:action = 'start'
+            echohl WarningMsg | echomsg "Terminal is resumed" | echohl None
+        endif
+    else
+        let l:action = a:action
+    endif
+
+    " if mappings are being removed, add 'un'
+    let map_modifier = 'nore'
+    if l:action == 'stop'
+        let map_modifier = 'un'
+    endif
+
+    " remove all auto commands
+    if l:action == 'stop'
+        execute 'autocmd! ' . b:ConqueTerm_Var
+
+    else
+        execute 'augroup ' . b:ConqueTerm_Var
+
+        " handle unexpected closing of shell, passes HUP to parent and all child processes
+        execute 'autocmd ' . b:ConqueTerm_Var . ' BufUnload <buffer> python ' . b:ConqueTerm_Var . '.proc.signal(1)'
+
+        " check for resized/scrolled buffer when entering buffer
+        execute 'autocmd ' . b:ConqueTerm_Var . ' BufEnter <buffer> python ' . b:ConqueTerm_Var . '.update_window_size()'
+        execute 'autocmd ' . b:ConqueTerm_Var . ' VimResized python ' . b:ConqueTerm_Var . '.update_window_size()'
+
+        " set/reset updatetime on entering/exiting buffer
+        autocmd BufEnter <buffer> set updatetime=50
+        autocmd BufLeave <buffer> set updatetime=2000
+
+        " check for resized/scrolled buffer when entering insert mode
+        " XXX - messed up since we enter insert mode at each updatetime
+        "execute 'autocmd InsertEnter <buffer> python ' . b:ConqueTerm_Var . '.screen.align()'
+
+        " read more output when this isn't the current buffer
+        if g:ConqueTerm_ReadUnfocused == 1
+            execute 'autocmd ' . b:ConqueTerm_Var . ' CursorHold * call conque_term#read_all()'
+        endif
+
+        " poll for more output
+        sil execute 'autocmd ' . b:ConqueTerm_Var . ' CursorHoldI <buffer> python ' .  b:ConqueTerm_Var . '.auto_read()'
+    endif
+
+    " use F22 key to get more input
+    if l:action == 'start'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F22> "\<left>\<right>"'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F23> "\<right>\<left>"'
+    else
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F22>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <expr> <F23>'
+    endif
+
+    " map ASCII 1-31
+    for c in range(1, 31)
+        " <Esc>
+        if c == 27
+            continue
+        endif
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <C-' . nr2char(64 + c) . '> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(' . c . '))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <C-' . nr2char(64 + c) . '>'
+        endif
+    endfor
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> <C-c> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(3))<CR>'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> <C-c>'
+    endif
+
+    " leave insert mode
+    if !exists('g:ConqueTerm_EscKey') || g:ConqueTerm_EscKey == '<Esc>'
+        " use <Esc><Esc> to send <Esc> to terminal
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc><Esc> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(27))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc><Esc>'
+        endif
+    else
+        " use <Esc> to send <Esc> to terminal
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> ' . g:ConqueTerm_EscKey . ' <Esc>'
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(27))<CR>'
+        else
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> ' . g:ConqueTerm_EscKey
+            sil exe 'i' . map_modifier . 'map <silent> <buffer> <Esc>'
+        endif
+    endif
+
+    " Map <C-w> in insert mode
+    if exists('g:ConqueTerm_CWInsert') && g:ConqueTerm_CWInsert == 1
+        inoremap <silent> <buffer> <C-w>j <Esc><C-w>j
+        inoremap <silent> <buffer> <C-w>k <Esc><C-w>k
+        inoremap <silent> <buffer> <C-w>h <Esc><C-w>h
+        inoremap <silent> <buffer> <C-w>l <Esc><C-w>l
+        inoremap <silent> <buffer> <C-w>w <Esc><C-w>w
+    endif
+
+    " map ASCII 33-127
+    for i in range(33, 127)
+        " <Bar>
+        if i == 124
+            if l:action == 'start'
+                sil exe "i" . map_modifier . "map <silent> <buffer> <Bar> <C-o>:python " . b:ConqueTerm_Var . ".write(chr(124))<CR>"
+            else
+                sil exe "i" . map_modifier . "map <silent> <buffer> <Bar>"
+            endif
+            continue
+        endif
+        if l:action == 'start'
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i) . " <C-o>:python " . b:ConqueTerm_Var . ".write(chr(" . i . "))<CR>"
+        else
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i)
+        endif
+    endfor
+
+    " map ASCII 128-255
+    for i in range(128, 255)
+        if l:action == 'start'
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i) . " <C-o>:python " . b:ConqueTerm_Var . ".write('" . nr2char(i) . "')<CR>"
+        else
+            sil exe "i" . map_modifier . "map <silent> <buffer> " . nr2char(i)
+        endif
+    endfor
+
+    " Special cases
+    if l:action == 'start'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u0008")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space> <C-o>:python ' . b:ConqueTerm_Var . '.write(" ")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[A")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[B")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[C")<CR>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Left> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[D")<CR>'
+    else
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right>'
+        sil exe 'i' . map_modifier . 'map <silent> <buffer> <Left>'
+    endif
+
+    " send selected text into conque
+    if l:action == 'start'
+        sil exe 'v' . map_modifier . 'map <silent> <F9> :<C-u>call conque_term#send_selected(visualmode())<CR>'
+    else
+        sil exe 'v' . map_modifier . 'map <silent> <F9>'
+    endif
+
+    " remap paste keys
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> P :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> ]p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> [p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> p'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> P'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> ]p'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> [p'
+    endif
+    if has('gui_running')
+        if l:action == 'start'
+            sil exe 'i' . map_modifier . 'map <buffer> <S-Insert> <Esc>:<C-u>python ' . b:ConqueTerm_Var . ".write(vim.eval('@+'))<CR>a"
+        else
+            sil exe 'i' . map_modifier . 'map <buffer> <S-Insert>'
+        endif
+    endif
+
+    " disable other normal mode keys which insert text
+    if l:action == 'start'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> r :echo "Replace mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> R :echo "Replace mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> c :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> C :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> s :echo "Change mode disabled in shell."<CR>'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> S :echo "Change mode disabled in shell."<CR>'
+    else
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> r'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> R'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> c'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> C'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> s'
+        sil exe 'n' . map_modifier . 'map <silent> <buffer> S'
+    endif
+
+    " set conque as on or off
+    if l:action == 'start'
+        let b:conque_on = 1
+    else
+        let b:conque_on = 0
+    endif
+
+    " map command to start stop the shell
+    if a:action == 'start'
+        nnoremap <F5> :<C-u>call conque_term#set_mappings('toggle')<CR>
+    endif
+
+endfunction " }}}
+
+
+" send selected text from another buffer
+function! conque_term#send_selected(type) "{{{
+    let reg_save = @@
+
+    " save user's sb settings
+    let sb_save = &switchbuf
+    set switchbuf=usetab
+
+    " yank current selection
+    sil exe "normal! `<" . a:type . "`>y"
+
+    " format yanked text
+    let @@ = substitute(@@, '^[\r\n]*', '', '')
+    let @@ = substitute(@@, '[\r\n]*$', '', '')
+
+    " execute yanked text
+    sil exe ":sb " . g:ConqueTerm_BufName
+    sil exe 'python ' . g:ConqueTerm_Var . '.paste_selection()'
+
+    " reset original values
+    let @@ = reg_save
+    sil exe 'set switchbuf=' . sb_save
+
+    " scroll buffer left
+    startinsert!
+    normal 0zH
+endfunction "}}}
+
+" read from all known conque buffers
+function! conque_term#read_all() "{{{
+    " don't run this if we're in a conque buffer
+    if exists('b:ConqueTerm_Var')
+        return
+    endif
+
+    try
+        for i in range(1, g:ConqueTerm_Idx - 1)
+            execute 'python ConqueTerm_' . string(i) . '.read(1)'
+        endfor
+    catch
+        " probably a deleted buffer
+    endtry
+
+    " restart updatetime
+    call feedkeys("f\e")
+endfunction "}}}
+
+" util function to add enough \s to pass a string to python
+function! conque_term#python_escape(input) "{{{
+    let l:cleaned = a:input
+    let l:cleaned = substitute(l:cleaned, '\\', '\\\\', 'g')
+    let l:cleaned = substitute(l:cleaned, '\n', '\\n', 'g')
+    let l:cleaned = substitute(l:cleaned, '\r', '\\r', 'g')
+    let l:cleaned = substitute(l:cleaned, "'", "\\\\'", 'g')
+    return l:cleaned
+endfunction "}}}
+
+" **********************************************************************************************************
+" **** PYTHON **********************************************************************************************
+" **********************************************************************************************************
+
+if has('python')
+
+python << EOF
+
+import vim, re, time, math
+
+# CONFIG CONSTANTS  {{{
+
+CONQUE_CTL = {
+     7:'bel', # bell
+     8:'bs',  # backspace
+     9:'tab', # tab
+    10:'nl',  # new line
+    13:'cr'   # carriage return
+}
+#    11 : 'vt',  # vertical tab
+#    12 : 'ff',  # form feed
+#    14 : 'so',  # shift out
+#    15 : 'si'   # shift in
+
+# Escape sequences 
+CONQUE_ESCAPE = { 
+    'm':'font',
+    'J':'clear_screen',
+    'K':'clear_line',
+    '@':'add_spaces',
+    'A':'cursor_up',
+    'B':'cursor_down',
+    'C':'cursor_right',
+    'D':'cursor_left',
+    'G':'cursor_to_column',
+    'H':'cursor',
+    'P':'delete_chars',
+    'f':'cursor',
+    'g':'tab_clear',
+    'r':'set_coords',
+    'h':'set',
+    'l':'reset'
+}
+#    'L':'insert_lines',
+#    'M':'delete_lines',
+#    'd':'cusor_vpos',
+
+# Alternate escape sequences, no [
+CONQUE_ESCAPE_PLAIN = {
+    'D':'scroll_up',
+    'E':'next_line',
+    'H':'set_tab',
+    'M':'scroll_down'
+}
+#    'N':'single_shift_2',
+#    'O':'single_shift_3',
+#    '=':'alternate_keypad',
+#    '>':'numeric_keypad',
+#    '7':'save_cursor',
+#    '8':'restore_cursor',
+
+# Uber alternate escape sequences, with # or ?
+CONQUE_ESCAPE_QUESTION = {
+    '1h':'new_line_mode',
+    '3h':'132_cols',
+    '4h':'smooth_scrolling',
+    '5h':'reverse_video',
+    '6h':'relative_origin',
+    '7h':'set_auto_wrap',
+    '8h':'set_auto_repeat',
+    '9h':'set_interlacing_mode',
+    '1l':'set_cursor_key',
+    '2l':'set_vt52',
+    '3l':'80_cols',
+    '4l':'set_jump_scrolling',
+    '5l':'normal_video',
+    '6l':'absolute_origin',
+    '7l':'reset_auto_wrap',
+    '8l':'reset_auto_repeat',
+    '9l':'reset_interlacing_mode'
+}
+
+CONQUE_ESCAPE_HASH = {
+    '8':'screen_alignment_test'
+} 
+#    '3':'double_height_top',
+#    '4':'double_height_bottom',
+#    '5':'single_height_single_width',
+#    '6':'single_height_double_width',
+
+# Font codes {{{
+CONQUE_FONT = {
+    0: {'description':'Normal (default)', 'attributes': {'cterm':'NONE','ctermfg':'NONE','ctermbg':'NONE','gui':'NONE','guifg':'NONE','guibg':'NONE'}, 'normal':True},
+    1: {'description':'Bold', 'attributes': {'cterm':'BOLD','gui':'BOLD'}, 'normal':False},
+    4: {'description':'Underlined', 'attributes': {'cterm':'UNDERLINE','gui':'UNDERLINE'}, 'normal':False},
+    5: {'description':'Blink (appears as Bold)', 'attributes': {'cterm':'BOLD','gui':'BOLD'}, 'normal':False},
+    7: {'description':'Inverse', 'attributes': {'cterm':'REVERSE','gui':'REVERSE'}, 'normal':False},
+    8: {'description':'Invisible (hidden)', 'attributes': {'ctermfg':'0','ctermbg':'0','guifg':'#000000','guibg':'#000000'}, 'normal':False},
+    22: {'description':'Normal (neither bold nor faint)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    24: {'description':'Not underlined', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    25: {'description':'Steady (not blinking)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    27: {'description':'Positive (not inverse)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
+    28: {'description':'Visible (not hidden)', 'attributes': {'ctermfg':'NONE','ctermbg':'NONE','guifg':'NONE','guibg':'NONE'}, 'normal':True},
+    30: {'description':'Set foreground color to Black', 'attributes': {'ctermfg':'16','guifg':'#000000'}, 'normal':False},
+    31: {'description':'Set foreground color to Red', 'attributes': {'ctermfg':'1','guifg':'#ff0000'}, 'normal':False},
+    32: {'description':'Set foreground color to Green', 'attributes': {'ctermfg':'2','guifg':'#00ff00'}, 'normal':False},
+    33: {'description':'Set foreground color to Yellow', 'attributes': {'ctermfg':'3','guifg':'#ffff00'}, 'normal':False},
+    34: {'description':'Set foreground color to Blue', 'attributes': {'ctermfg':'4','guifg':'#0000ff'}, 'normal':False},
+    35: {'description':'Set foreground color to Magenta', 'attributes': {'ctermfg':'5','guifg':'#990099'}, 'normal':False},
+    36: {'description':'Set foreground color to Cyan', 'attributes': {'ctermfg':'6','guifg':'#009999'}, 'normal':False},
+    37: {'description':'Set foreground color to White', 'attributes': {'ctermfg':'7','guifg':'#ffffff'}, 'normal':False},
+    39: {'description':'Set foreground color to default (original)', 'attributes': {'ctermfg':'NONE','guifg':'NONE'}, 'normal':True},
+    40: {'description':'Set background color to Black', 'attributes': {'ctermbg':'16','guibg':'#000000'}, 'normal':False},
+    41: {'description':'Set background color to Red', 'attributes': {'ctermbg':'1','guibg':'#ff0000'}, 'normal':False},
+    42: {'description':'Set background color to Green', 'attributes': {'ctermbg':'2','guibg':'#00ff00'}, 'normal':False},
+    43: {'description':'Set background color to Yellow', 'attributes': {'ctermbg':'3','guibg':'#ffff00'}, 'normal':False},
+    44: {'description':'Set background color to Blue', 'attributes': {'ctermbg':'4','guibg':'#0000ff'}, 'normal':False},
+    45: {'description':'Set background color to Magenta', 'attributes': {'ctermbg':'5','guibg':'#990099'}, 'normal':False},
+    46: {'description':'Set background color to Cyan', 'attributes': {'ctermbg':'6','guibg':'#009999'}, 'normal':False},
+    47: {'description':'Set background color to White', 'attributes': {'ctermbg':'7','guibg':'#ffffff'}, 'normal':False},
+    49: {'description':'Set background color to default (original).', 'attributes': {'ctermbg':'NONE','guibg':'NONE'}, 'normal':True},
+    90: {'description':'Set foreground color to Black', 'attributes': {'ctermfg':'8','guifg':'#000000'}, 'normal':False},
+    91: {'description':'Set foreground color to Red', 'attributes': {'ctermfg':'9','guifg':'#ff0000'}, 'normal':False},
+    92: {'description':'Set foreground color to Green', 'attributes': {'ctermfg':'10','guifg':'#00ff00'}, 'normal':False},
+    93: {'description':'Set foreground color to Yellow', 'attributes': {'ctermfg':'11','guifg':'#ffff00'}, 'normal':False},
+    94: {'description':'Set foreground color to Blue', 'attributes': {'ctermfg':'12','guifg':'#0000ff'}, 'normal':False},
+    95: {'description':'Set foreground color to Magenta', 'attributes': {'ctermfg':'13','guifg':'#990099'}, 'normal':False},
+    96: {'description':'Set foreground color to Cyan', 'attributes': {'ctermfg':'14','guifg':'#009999'}, 'normal':False},
+    97: {'description':'Set foreground color to White', 'attributes': {'ctermfg':'15','guifg':'#ffffff'}, 'normal':False},
+    100: {'description':'Set background color to Black', 'attributes': {'ctermbg':'8','guibg':'#000000'}, 'normal':False},
+    101: {'description':'Set background color to Red', 'attributes': {'ctermbg':'9','guibg':'#ff0000'}, 'normal':False},
+    102: {'description':'Set background color to Green', 'attributes': {'ctermbg':'10','guibg':'#00ff00'}, 'normal':False},
+    103: {'description':'Set background color to Yellow', 'attributes': {'ctermbg':'11','guibg':'#ffff00'}, 'normal':False},
+    104: {'description':'Set background color to Blue', 'attributes': {'ctermbg':'12','guibg':'#0000ff'}, 'normal':False},
+    105: {'description':'Set background color to Magenta', 'attributes': {'ctermbg':'13','guibg':'#990099'}, 'normal':False},
+    106: {'description':'Set background color to Cyan', 'attributes': {'ctermbg':'14','guibg':'#009999'}, 'normal':False},
+    107: {'description':'Set background color to White', 'attributes': {'ctermbg':'15','guibg':'#ffffff'}, 'normal':False}
+} 
+# }}}
+
+# regular expression matching (almost) all control sequences
+CONQUE_SEQ_REGEX       = re.compile(ur"(\u001b\[?\??#?[0-9;]*[a-zA-Z@]|\u001b\][0-9];.*?\u0007|[\u0007-\u000f])", re.UNICODE)
+CONQUE_SEQ_REGEX_CTL   = re.compile(ur"^[\u0007-\u000f]$", re.UNICODE)
+CONQUE_SEQ_REGEX_CSI   = re.compile(ur"^\u001b\[", re.UNICODE)
+CONQUE_SEQ_REGEX_TITLE = re.compile(ur"^\u001b\]", re.UNICODE)
+CONQUE_SEQ_REGEX_HASH  = re.compile(ur"^\u001b#", re.UNICODE)
+CONQUE_SEQ_REGEX_ESC   = re.compile(ur"^\u001b", re.UNICODE)
+
+# match table output
+CONQUE_TABLE_OUTPUT   = re.compile("^\s*\|\s.*\s\|\s*$|^\s*\+[=+-]+\+\s*$")
+
+# }}}
+
+###################################################################################################
+class Conque:
+
+    # CLASS PROPERTIES {{{ 
+
+    # screen object
+    screen          = None
+
+    # subprocess object
+    proc            = None
+
+    # terminal dimensions and scrolling region
+    columns         = 80 # same as $COLUMNS
+    lines           = 24 # same as $LINES
+    working_columns = 80 # can be changed by CSI ? 3 l/h
+    working_lines   = 24 # can be changed by CSI r
+
+    # top/bottom of the scroll region
+    top             = 1  # relative to top of screen
+    bottom          = 24 # relative to top of screen
+
+    # cursor position
+    l               = 1  # current cursor line
+    c               = 1  # current cursor column
+
+    # autowrap mode
+    autowrap        = True
+
+    # absolute coordinate mode
+    absolute_coords = True
+
+    # tabstop positions
+    tabstops        = []
+
+    # enable colors
+    enable_colors = True
+
+    # color changes
+    color_changes = {}
+
+    # color history
+    color_history = {}
+
+    # don't wrap table output
+    unwrap_tables = True
+
+    # wrap CUF/CUB around line breaks
+    wrap_cursor = False
+
+    # }}}
+
+    # constructor
+    def __init__(self): # {{{
+        self.screen = ConqueScreen()
+        # }}}
+
+    # start program and initialize this instance
+    def open(self, command, options): # {{{
+
+        # int vars
+        self.columns = vim.current.window.width
+        self.lines = vim.current.window.height
+        self.working_columns = vim.current.window.width
+        self.working_lines = vim.current.window.height
+        self.bottom = vim.current.window.height
+
+        # init color
+        self.enable_colors = options['color']
+
+        # init tabstops
+        self.init_tabstops()
+
+        # open command
+        self.proc = ConqueSubprocess()
+        self.proc.open(command, { 'TERM' : options['TERM'], 'CONQUE' : '1', 'LINES' : str(self.lines), 'COLUMNS' : str(self.columns)})
+        # }}}
+
+    # write to pty
+    def write(self, input): # {{{
+
+
+        # check if window size has changed
+        self.update_window_size()
+
+        # write and read
+        self.proc.write(input)
+        self.read(1)
+        # }}}
+
+    # read from pty, and update buffer
+    def read(self, timeout = 1): # {{{
+        # read from subprocess
+        output = self.proc.read(timeout)
+        # and strip null chars
+        output = output.replace(chr(0), '')
+
+        if output == '':
+            return
+
+
+
+
+
+        chunks = CONQUE_SEQ_REGEX.split(output)
+
+
+
+
+
+        # don't go through all the csi regex if length is one (no matches)
+        if len(chunks) == 1:
+
+            self.plain_text(chunks[0])
+
+        else:
+            for s in chunks:
+                if s == '':
+                    continue
+
+
+
+
+
+
+                # Check for control character match {{{
+                if CONQUE_SEQ_REGEX_CTL.match(s[0]):
+
+                    nr = ord(s[0])
+                    if nr in CONQUE_CTL:
+                        getattr(self, 'ctl_' + CONQUE_CTL[nr])()
+                    else:
+
+                        pass
+                    # }}}
+
+                # check for escape sequence match {{{
+                elif CONQUE_SEQ_REGEX_CSI.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE:
+                        csi = self.parse_csi(s[2:])
+
+                        getattr(self, 'csi_' + CONQUE_ESCAPE[s[-1]])(csi)
+                    else:
+
+                        pass
+                    # }}}
+        
+                # check for title match {{{
+                elif CONQUE_SEQ_REGEX_TITLE.match(s):
+
+                    self.change_title(s[2], s[4:-1])
+                    # }}}
+        
+                # check for hash match {{{
+                elif CONQUE_SEQ_REGEX_HASH.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE_HASH:
+                        getattr(self, 'hash_' + CONQUE_ESCAPE_HASH[s[-1]])()
+                    else:
+
+                        pass
+                    # }}}
+                
+                # check for other escape match {{{
+                elif CONQUE_SEQ_REGEX_ESC.match(s):
+
+                    if s[-1] in CONQUE_ESCAPE_PLAIN:
+                        getattr(self, 'esc_' + CONQUE_ESCAPE_PLAIN[s[-1]])()
+                    else:
+
+                        pass
+                    # }}}
+                
+                # else process plain text {{{
+                else:
+                    self.plain_text(s)
+                    # }}}
+
+        # set cursor position
+        self.screen.set_cursor(self.l, self.c)
+
+        vim.command('redraw')
+
+
+    # }}}
+
+    # for polling
+    def auto_read(self): # {{{
+        self.read(1)
+        if self.c == 1:
+            vim.command('call feedkeys("\<F23>", "t")')
+        else:
+            vim.command('call feedkeys("\<F22>", "t")')
+        self.screen.set_cursor(self.l, self.c)
+    # }}}
+
+    ###############################################################################################
+    # Plain text # {{{
+
+    def plain_text(self, input):
+
+        current_line = self.screen[self.l]
+
+        if len(current_line) < self.working_columns:
+            current_line = current_line + ' ' * (self.c - len(current_line))
+
+        # if line is wider than screen
+        if self.c + len(input) - 1 > self.working_columns:
+            # Table formatting hack
+            if self.unwrap_tables and CONQUE_TABLE_OUTPUT.match(input):
+                self.screen[self.l] = current_line[ : self.c - 1] + input + current_line[ self.c + len(input) - 1 : ]
+                self.apply_color(self.c, self.c + len(input))
+                self.c += len(input)
+                return
+
+            diff = self.c + len(input) - self.working_columns - 1
+            # if autowrap is enabled
+            if self.autowrap:
+                self.screen[self.l] = current_line[ : self.c - 1] + input[ : -1 * diff ]
+                self.apply_color(self.c, self.working_columns)
+                self.ctl_nl()
+                self.ctl_cr()
+                remaining = input[ -1 * diff : ]
+
+                self.plain_text(remaining)
+            else:
+                self.screen[self.l] = current_line[ : self.c - 1] + input[ : -1 * diff - 1 ] + input[-1]
+                self.apply_color(self.c, self.working_columns)
+                self.c = self.working_columns
+
+        # no autowrap
+        else:
+            self.screen[self.l] = current_line[ : self.c - 1] + input + current_line[ self.c + len(input) - 1 : ]
+            self.apply_color(self.c, self.c + len(input))
+            self.c += len(input)
+
+    def apply_color(self, start, end):
+
+
+        # stop here if coloration is disabled
+        if not self.enable_colors:
+            return
+
+        real_line = self.screen.get_real_line(self.l)
+
+        # check for previous overlapping coloration
+
+        to_del = []
+        if self.color_history.has_key(real_line):
+            for i in range(len(self.color_history[real_line])):
+                syn = self.color_history[real_line][i]
+
+                if syn['start'] >= start and syn['start'] < end:
+
+                    vim.command('syn clear ' + syn['name'])
+                    to_del.append(i)
+                    # outside
+                    if syn['end'] > end:
+
+                        self.exec_highlight(real_line, end, syn['end'], syn['highlight'])
+                elif syn['end'] > start and syn['end'] <= end:
+
+                    vim.command('syn clear ' + syn['name'])
+                    to_del.append(i)
+                    # outside
+                    if syn['start'] < start:
+
+                        self.exec_highlight(real_line, syn['start'], start, syn['highlight'])
+
+        if len(to_del) > 0:
+            to_del.reverse()
+            for di in to_del:
+                del self.color_history[real_line][di]
+
+        # if there are no new colors
+        if len(self.color_changes) == 0:
+            return
+
+        highlight = ''
+        for attr in self.color_changes.keys():
+            highlight = highlight + ' ' + attr + '=' + self.color_changes[attr]
+
+        # execute the highlight
+        self.exec_highlight(real_line, start, end, highlight)
+
+    def exec_highlight(self, real_line, start, end, highlight):
+        unique_key = str(self.proc.pid)
+
+        syntax_name = 'EscapeSequenceAt_' + unique_key + '_' + str(self.l) + '_' + str(start) + '_' + str(len(self.color_history) + 1)
+        syntax_options = ' contains=ALLBUT,ConqueString,MySQLString,MySQLKeyword oneline'
+        syntax_region = 'syntax match ' + syntax_name + ' /\%' + str(real_line) + 'l\%>' + str(start - 1) + 'c.*\%<' + str(end + 1) + 'c/' + syntax_options
+        syntax_highlight = 'highlight ' + syntax_name + highlight
+
+        vim.command(syntax_region)
+        vim.command(syntax_highlight)
+
+        # add syntax name to history
+        if not self.color_history.has_key(real_line):
+            self.color_history[real_line] = []
+
+        self.color_history[real_line].append({'name':syntax_name, 'start':start, 'end':end, 'highlight':highlight})
+
+    # }}}
+
+    ###############################################################################################
+    # Control functions {{{
+
+    def ctl_nl(self):
+        # if we're in a scrolling region, scroll instead of moving cursor down
+        if self.lines != self.working_lines and self.l == self.bottom:
+            del self.screen[self.top]
+            self.screen.insert(self.bottom, '')
+        elif self.l == self.bottom:
+            self.screen.append('')
+        else:
+            self.l += 1
+
+        self.color_changes = {}
+
+    def ctl_cr(self):
+        self.c = 1
+
+        self.color_changes = {}
+
+    def ctl_bs(self):
+        if self.c > 1:
+            self.c += -1
+
+    def ctl_bel(self):
+        print 'BELL'
+
+    def ctl_tab(self):
+        # default tabstop location
+        ts = self.working_columns
+
+        # check set tabstops
+        for i in range(self.c, len(self.tabstops)):
+            if self.tabstops[i]:
+                ts = i + 1
+                break
+
+
+
+        self.c = ts
+
+    # }}}
+
+    ###############################################################################################
+    # CSI functions {{{
+
+    def csi_font(self, csi): # {{{
+        if not self.enable_colors:
+            return
+        
+        # defaults to 0
+        if len(csi['vals']) == 0:
+            csi['vals'] = [0]
+
+        # 256 xterm color foreground
+        if len(csi['vals']) == 3 and csi['vals'][0] == 38 and csi['vals'][1] == 5:
+            self.color_changes['ctermfg'] = str(csi['vals'][2])
+            self.color_changes['guifg'] = '#' + self.xterm_to_rgb(csi['vals'][2])
+
+        # 256 xterm color background
+        elif len(csi['vals']) == 3 and csi['vals'][0] == 48 and csi['vals'][1] == 5:
+            self.color_changes['ctermbg'] = str(csi['vals'][2])
+            self.color_changes['guibg'] = '#' + self.xterm_to_rgb(csi['vals'][2])
+
+        # 16 colors
+        else:
+            for val in csi['vals']:
+                if CONQUE_FONT.has_key(val):
+
+                    # ignore starting normal colors
+                    if CONQUE_FONT[val]['normal'] and len(self.color_changes) == 0:
+
+                        continue
+                    # clear color changes
+                    elif CONQUE_FONT[val]['normal']:
+
+                        self.color_changes = {}
+                    # save these color attributes for next plain_text() call
+                    else:
+
+                        for attr in CONQUE_FONT[val]['attributes'].keys():
+                            if self.color_changes.has_key(attr) and (attr == 'cterm' or attr == 'gui'):
+                                self.color_changes[attr] += ',' + CONQUE_FONT[val]['attributes'][attr]
+                            else:
+                                self.color_changes[attr] = CONQUE_FONT[val]['attributes'][attr]
+        # }}}
+
+    def csi_clear_line(self, csi): # {{{
+
+
+        # this escape defaults to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+
+
+
+        # 0 means cursor right
+        if csi['val'] == 0:
+            self.screen[self.l] = self.screen[self.l][0 : self.c - 1]
+
+        # 1 means cursor left
+        elif csi['val'] == 1:
+            self.screen[self.l] = ' ' * (self.c) + self.screen[self.l][self.c : ]
+
+        # clear entire line
+        elif csi['val'] == 2:
+            self.screen[self.l] = ''
+
+        # clear colors
+        if csi['val'] == 2 or (csi['val'] == 0 and self.c == 1):
+            real_line = self.screen.get_real_line(self.l)
+            if self.color_history.has_key(real_line):
+                for syn in self.color_history[real_line]:
+                    vim.command('syn clear ' + syn['name'])
+
+
+
+        # }}}
+
+    def csi_cursor_right(self, csi): # {{{
+        # we use 1 even if escape explicitly specifies 0
+        if csi['val'] == 0:
+            csi['val'] = 1
+
+
+
+
+        if self.wrap_cursor and self.c + csi['val'] > self.working_columns:
+            self.l += int(math.floor( (self.c + csi['val']) / self.working_columns ))
+            self.c = (self.c + csi['val']) % self.working_columns
+            return
+
+        self.c = self.bound(self.c + csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_left(self, csi): # {{{
+        # we use 1 even if escape explicitly specifies 0
+        if csi['val'] == 0:
+            csi['val'] = 1
+
+        if self.wrap_cursor and csi['val'] >= self.c:
+            self.l += int(math.floor( (self.c - csi['val']) / self.working_columns ))
+            self.c = self.working_columns - (csi['val'] - self.c) % self.working_columns
+            return
+
+        self.c = self.bound(self.c - csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_to_column(self, csi): # {{{
+        self.c = self.bound(csi['val'], 1, self.working_columns)
+        # }}}
+
+    def csi_cursor_up(self, csi): # {{{
+        self.l = self.bound(self.l - csi['val'], self.top, self.bottom)
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_cursor_down(self, csi): # {{{
+        self.l = self.bound(self.l + csi['val'], self.top, self.bottom)
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_clear_screen(self, csi): # {{{
+        # default to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+        # 2 == clear entire screen
+        if csi['val'] == 2:
+            self.l = 1
+            self.c = 1
+            self.screen.clear()
+
+        # 0 == clear down
+        elif csi['val'] == 0:
+            for l in range(self.bound(self.l + 1, 1, self.lines), self.lines + 1):
+                self.screen[l] = ''
+            
+            # clear end of current line
+            self.csi_clear_line(self.parse_csi('K'))
+
+        # 1 == clear up
+        elif csi['val'] == 1:
+            for l in range(1, self.bound(self.l, 1, self.lines + 1)):
+                self.screen[l] = ''
+
+            # clear beginning of current line
+            self.csi_clear_line(self.parse_csi('1K'))
+
+        # clear coloration
+        if csi['val'] == 2 or csi['val'] == 0:
+            real_line = self.screen.get_real_line(self.l)
+            for line in self.color_history.keys():
+                if line >= real_line:
+                    for syn in self.color_history[line]:
+                        vim.command('syn clear ' + syn['name'])
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_delete_chars(self, csi): # {{{
+        self.screen[self.l] = self.screen[self.l][ : self.c ] + self.screen[self.l][ self.c + csi['val'] : ]
+        # }}}
+
+    def csi_add_spaces(self, csi): # {{{
+        self.screen[self.l] = self.screen[self.l][ : self.c - 1] + ' ' * csi['val'] + self.screen[self.l][self.c : ]
+        # }}}
+
+    def csi_cursor(self, csi): # {{{
+        if len(csi['vals']) == 2:
+            new_line = csi['vals'][0]
+            new_col = csi['vals'][1]
+        else:
+            new_line = 1
+            new_col = 1
+
+        if self.absolute_coords:
+            self.l = self.bound(new_line, 1, self.lines)
+        else:
+            self.l = self.bound(self.top + new_line - 1, self.top, self.bottom)
+
+        self.c = self.bound(new_col, 1, self.working_columns)
+        if self.c > len(self.screen[self.l]):
+            self.screen[self.l] = self.screen[self.l] + ' ' * (self.c - len(self.screen[self.l]))
+
+        # }}}
+
+    def csi_set_coords(self, csi): # {{{
+        if len(csi['vals']) == 2:
+            new_start = csi['vals'][0]
+            new_end = csi['vals'][1]
+        else:
+            new_start = 1
+            new_end = vim.current.window.height
+
+        self.top = new_start
+        self.bottom = new_end
+        self.working_lines = new_end - new_start + 1
+
+        # if cursor is outside scrolling region, reset it
+        if self.l < self.top:
+            self.l = self.top
+        elif self.l > self.bottom:
+            self.l = self.bottom
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_tab_clear(self, csi): # {{{
+        # this escape defaults to 0
+        if len(csi['vals']) == 0:
+            csi['val'] = 0
+
+
+
+        if csi['val'] == 0:
+            self.tabstops[self.c - 1] = False
+        elif csi['val'] == 3:
+            for i in range(0, self.columns + 1):
+                self.tabstops[i] = False
+        # }}}
+
+    def csi_set(self, csi): # {{{
+        # 132 cols
+        if csi['val'] == 3: 
+            self.csi_clear_screen(self.parse_csi('2J'))
+            self.working_columns = 132
+
+        # relative_origin
+        elif csi['val'] == 6: 
+            self.absolute_coords = False
+
+        # set auto wrap
+        elif csi['val'] == 7: 
+            self.autowrap = True
+
+
+        self.color_changes = {}
+        # }}}
+
+    def csi_reset(self, csi): # {{{
+        # 80 cols
+        if csi['val'] == 3: 
+            self.csi_clear_screen(self.parse_csi('2J'))
+            self.working_columns = 80
+
+        # absolute origin
+        elif csi['val'] == 6: 
+            self.absolute_coords = True
+
+        # reset auto wrap
+        elif csi['val'] == 7: 
+            self.autowrap = False
+
+
+        self.color_changes = {}
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # ESC functions {{{
+
+    def esc_scroll_up(self): # {{{
+        self.ctl_nl()
+
+        self.color_changes = {}
+        # }}}
+
+    def esc_next_line(self): # {{{
+        self.ctl_nl()
+        self.c = 1
+        # }}}
+
+    def esc_set_tab(self): # {{{
+
+        if self.c <= len(self.tabstops):
+            self.tabstops[self.c - 1] = True
+        # }}}
+
+    def esc_scroll_down(self): # {{{
+        if self.l == self.top:
+            del self.screen[self.bottom]
+            self.screen.insert(self.top, '')
+        else:
+            self.l += -1
+
+        self.color_changes = {}
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # HASH functions {{{
+
+    def hash_screen_alignment_test(self): # {{{
+        self.csi_clear_screen(self.parse_csi('2J'))
+        self.working_lines = self.lines
+        for l in range(1, self.lines + 1):
+            self.screen[l] = 'E' * self.working_columns
+        # }}}
+
+    # }}}
+
+    ###############################################################################################
+    # Random stuff {{{
+
+    def change_title(self, key, val):
+
+
+        if key == '0' or key == '2':
+
+            vim.command('setlocal statusline=' + re.escape(val))
+
+    def paste(self):
+        self.write(vim.eval('@@'))
+        self.read(50)
+
+    def paste_selection(self):
+        self.write(vim.eval('@@'))
+
+    def update_window_size(self):
+        # resize if needed
+        if vim.current.window.width != self.columns or vim.current.window.height != self.lines:
+
+            # reset all window size attributes to default
+            self.columns = vim.current.window.width
+            self.lines = vim.current.window.height
+            self.working_columns = vim.current.window.width
+            self.working_lines = vim.current.window.height
+            self.bottom = vim.current.window.height
+
+            # reset screen object attributes
+            self.l = self.screen.reset_size(self.l)
+
+            # reset tabstops
+            self.init_tabstops()
+
+
+
+            # signal process that screen size has changed
+            self.proc.window_resize(self.lines, self.columns)
+
+    def init_tabstops(self):
+        for i in range(0, self.columns + 1):
+            if i % 8 == 0:
+                self.tabstops.append(True)
+            else:
+                self.tabstops.append(False)
+
+    # }}}
+
+    ###############################################################################################
+    # Utility {{{
+    
+    def parse_csi(self, s): # {{{
+        attr = { 'key' : s[-1], 'flag' : '', 'val' : 1, 'vals' : [] }
+
+        if len(s) == 1:
+            return attr
+
+        full = s[0:-1]
+
+        if full[0] == '?':
+            full = full[1:]
+            attr['flag'] = '?'
+
+        if full != '':
+            vals = full.split(';')
+            for val in vals:
+
+                val = re.sub("\D", "", val)
+
+                if val != '':
+                    attr['vals'].append(int(val))
+
+        if len(attr['vals']) == 1:
+            attr['val'] = int(attr['vals'][0])
+            
+        return attr
+        # }}}
+
+    def bound(self, val, min, max): # {{{
+        if val > max:
+            return max
+
+        if val < min:
+            return min
+
+        return val
+        # }}}
+
+    def xterm_to_rgb(self, color_code): # {{{
+        if color_code < 16:
+            ascii_colors = ['000000', 'CD0000', '00CD00', 'CDCD00', '0000EE', 'CD00CD', '00CDCD', 'E5E5E5', 
+                   '7F7F7F', 'FF0000', '00FF00', 'FFFF00', '5C5CFF', 'FF00FF', '00FFFF', 'FFFFFF']
+            return ascii_colors[color_code]
+
+        elif color_code < 232:
+            cc = int(color_code) - 16
+
+            p1 = "%02x" % (math.floor(cc / 36) * (255/5))
+            p2 = "%02x" % (math.floor((cc % 36) / 6) * (255/5))
+            p3 = "%02x" % (math.floor(cc % 6) * (255/5))
+
+            return p1 + p2 + p3
+        else:
+            grey_tone = "%02x" % math.floor((255/24) * (color_code - 232))
+            return grey_tone + grey_tone + grey_tone
+        # }}}
+
+    # }}}
+
+
+import os, signal, pty, tty, select, fcntl, termios, struct
+
+###################################################################################################
+class ConqueSubprocess:
+
+    # process id
+    pid = 0
+    
+    # stdout+stderr file descriptor
+    fd = None
+
+    # constructor
+    def __init__(self): # {{{
+        self.pid = 0
+        # }}}
+
+    # create the pty or whatever (whatever == windows)
+    def open(self, command, env = {}): # {{{
+        command_arr  = command.split()
+        executable   = command_arr[0]
+        args         = command_arr
+
+        try:
+            self.pid, self.fd = pty.fork()
+
+        except:
+            pass
+
+
+        # child proc, replace with command after altering terminal attributes
+        if self.pid == 0:
+
+            # set requested environment variables
+            for k in env.keys():
+                os.environ[k] = env[k]
+
+            # set some attributes
+            try:
+                attrs = tty.tcgetattr(1)
+                attrs[0] = attrs[0] ^ tty.IGNBRK
+                attrs[0] = attrs[0] | tty.BRKINT | tty.IXANY | tty.IMAXBEL
+                attrs[2] = attrs[2] | tty.HUPCL
+                attrs[3] = attrs[3] | tty.ICANON | tty.ECHO | tty.ISIG | tty.ECHOKE
+                attrs[6][tty.VMIN]  = 1
+                attrs[6][tty.VTIME] = 0
+                tty.tcsetattr(1, tty.TCSANOW, attrs)
+            except:
+                pass
+
+            os.execvp(executable, args)
+
+        # else master, do nothing
+        else:
+            pass
+
+        # }}}
+
+    # read from pty
+    # XXX - select.poll() doesn't work in OS X!!!!!!!
+    def read(self, timeout = 1): # {{{
+
+        output = ''
+        read_timeout = float(timeout) / 1000
+
+        try:
+            # what, no do/while?
+            while 1:
+                s_read, s_write, s_error = select.select( [ self.fd ], [], [], read_timeout)
+
+                lines = ''
+                for s_fd in s_read:
+                    try:
+                        lines = os.read( self.fd, 32 )
+                    except:
+                        pass
+                    output = output + lines
+
+                if lines == '':
+                    break
+        except:
+            pass
+
+        return output
+        # }}}
+
+    # I guess this one's not bad
+    def write(self, input): # {{{
+        try:
+            os.write(self.fd, input)
+        except:
+            pass
+        # }}}
+
+    # signal process
+    def signal(self, signum): # {{{
+        try:
+            os.kill(self.pid, signum)
+        except:
+            pass
+        # }}}
+
+    # get process status
+    def get_status(self): #{{{
+
+        p_status = True
+
+        try:
+            if os.waitpid( self.pid, os.WNOHANG )[0]:
+                p_status = False
+        except:
+            p_status = False
+
+        return p_status
+
+        # }}}
+
+    # update window size in kernel, then send SIGWINCH to fg process
+    def window_resize(self, lines, columns): # {{{
+        try:
+            fcntl.ioctl(self.fd, termios.TIOCSWINSZ, struct.pack("HHHH", lines, columns, 0, 0))
+            os.kill(self.pid, signal.SIGWINCH)
+        except:
+            pass
+
+        # }}}
+
+
+###################################################################################################
+# ConqueScreen is an extention of the vim.current.buffer object
+# It restricts the working indices of the buffer object to the scroll region which pty is expecting
+# It also uses 1-based indexes, to match escape sequence commands
+#
+# E.g.:
+#   s = ConqueScreen()
+#   ...
+#   s[5] = 'Set 5th line in terminal to this line'
+#   s.append('Add new line to terminal')
+#   s[5] = 'Since previous append() command scrolled the terminal down, this is a different line than first cb[5] call'
+#
+
+import vim
+
+class ConqueScreen(object):
+
+    # CLASS PROPERTIES  {{{
+
+    # the buffer
+    buffer          = None
+
+    # screen and scrolling regions
+    screen_top      = 1
+
+    # screen width
+    screen_width    = 80
+    screen_height    = 80
+
+    # }}}
+
+    def __init__(self): # {{{
+        self.buffer = vim.current.buffer
+
+        self.screen_top = 1
+        self.screen_width = vim.current.window.width
+        self.screen_height = vim.current.window.height
+    # }}}
+
+    ###############################################################################################
+    # List overload {{{
+    def __len__(self): # {{{
+        return len(self.buffer)
+    # }}}
+
+    def __getitem__(self, key): # {{{
+        real_line = self.get_real_idx(key)
+
+        # if line is past buffer end, add lines to buffer
+        if real_line >= len(self.buffer):
+            for i in range(len(self.buffer), real_line + 1):
+                self.append(' ' * self.screen_width)
+
+        return self.buffer[ real_line ]
+    # }}}
+
+    def __setitem__(self, key, value): # {{{
+        real_line = self.get_real_idx(key)
+
+        # if line is past end of screen, append
+        if real_line == len(self.buffer):
+            self.buffer.append(value)
+        else:
+            self.buffer[ real_line ] = value
+    # }}}
+
+    def __delitem__(self, key): # {{{
+        del self.buffer[ self.screen_top + key - 2 ]
+    # }}}
+
+    def append(self, value): # {{{
+        if len(self.buffer) > self.screen_top + self.screen_height - 1:
+            self.buffer[len(self.buffer) - 1] = value
+        else:
+            self.buffer.append(value)
+
+        if len(self.buffer) > self.screen_top + self.screen_height - 1:
+            self.screen_top += 1
+        if vim.current.buffer.number == self.buffer.number:
+            vim.command('normal G')
+    # }}}
+
+    def insert(self, line, value): # {{{
+
+        l = self.screen_top + line - 2
+        self.buffer[l:l] = [ value ]
+    
+    # }}}
+    # }}}
+
+    ###############################################################################################
+    # Util {{{
+    def get_top(self): # {{{
+        return self.screen_top
+    # }}}
+
+    def get_real_idx(self, line): # {{{
+        return (self.screen_top + line - 2)
+    # }}}
+
+    def get_real_line(self, line): # {{{
+        return (self.screen_top + line - 1)
+    # }}}
+
+    def set_screen_width(self, width): # {{{
+        self.screen_width = width
+    # }}}
+
+    # }}}
+
+    ###############################################################################################
+    def clear(self): # {{{
+        self.buffer.append(' ')
+        vim.command('normal Gzt')
+        self.screen_top = len(self.buffer)
+    # }}}
+
+    def set_cursor(self, line, column): # {{{
+        # figure out line
+        real_line =  self.screen_top + line - 1
+        if real_line > len(self.buffer):
+            for l in range(len(self.buffer) - 1, real_line):
+                self.buffer.append('')
+
+        # figure out column
+        real_column = column
+        if len(self.buffer[real_line - 1]) < real_column:
+            self.buffer[real_line - 1] = self.buffer[real_line - 1] + ' ' * (real_column - len(self.buffer[real_line - 1]))
+
+        # python version is occasionally grumpy
+        try:
+            vim.current.window.cursor = (real_line, real_column - 1)
+        except:
+            vim.command('call cursor(' + str(real_line) + ', ' + str(real_column) + ')')
+    # }}}
+
+    def reset_size(self, line): # {{{
+
+
+
+
+        # save cursor line number
+        real_line = self.screen_top + line
+
+        # reset screen size
+        self.screen_width = vim.current.window.width
+        self.screen_height = vim.current.window.height
+        self.screen_top = len(self.buffer) - vim.current.window.height + 1
+        if self.screen_top < 1:
+            self.screen_top = 1
+
+
+        # align bottom of buffer to bottom of screen
+        vim.command('normal ' + str(self.screen_height) + 'kG')
+
+        # return new relative line number
+        return (real_line - self.screen_top)
+    # }}}
+
+    def scroll_to_bottom(self): # {{{
+        vim.current.window.cursor = (len(self.buffer) - 1, 1)
+    # }}}
+        
+    def align(self): # {{{
+        # align bottom of buffer to bottom of screen
+        vim.command('normal ' + str(self.screen_height) + 'kG')
+    # }}}
+
+
+EOF
+
+endif
+
diff --git a/vim/tmp/conque/doc/conque_term.txt b/vim/tmp/conque/doc/conque_term.txt
new file mode 100644 (file)
index 0000000..ff8ca54
--- /dev/null
@@ -0,0 +1,156 @@
+*ConqueTerm* Plugin to run a shell in a buffer
+
+The ConqueTerm plugin will convert a buffer into a terminal emulator, allowing
+you to run a shell or shell application in the buffer.
+
+                                                           *conque_term-usage*
+
+Type :ConqueTerm <command> to launch an application in the current buffer. E.g.
+
+  :ConqueTerm bash
+  :ConqueTerm mysql -h localhost -u joe_lunchbox Menu
+  :ConqueTerm man top
+
+Use :ConqueTermSplit or :ConqueTermVSplit to open Conque in a new horizontal
+or vertical buffer.
+
+Keys pressed in insert mode will be sent to the shell, along with output from
+the 'p' command in normal mode.
+
+Press the <Esc> key twice to send a single <Esc> to the shell. Pressing this 
+key once will leave insert mode like normal.
+
+Press <F9> in any buffer to send a visual selection to the shell.
+
+
+                                                         *conque_term-settings*
+
+Set the following in your .vimrc (default values shown)
+
+" Enable colors. Setting this to 0 will make your terminal faster.
+let g:ConqueTerm_Color = 1
+
+" Set your terminal type. I strong recommend leaving this as vt100, 
+" however more features may be enabled with xterm.
+let g:ConqueTerm_TERM = 'vt100'
+
+" Set buffer syntax. Conque has highlighting for MySQL, but not much else.
+let g:ConqueTerm_Syntax = 'conque'
+
+" Continue updating shell when it's not the current, focused buffer
+let g:ConqueTerm_ReadUnfocused = 1
+
+
+                                                     *conque_term-requirements*
+
+The following minimum requirements are needed to run Conque. Conque will not 
+run on Windows without a Cygwin-like environment.
+
+ - Vim 7.1
+ - Python 2.3
+ - Supported operating systems: *nix, Mac, or Cygwin
+
+Tested on:
+ - Vim 7.2 / Python 2.6 / Ubuntu 9.10 (Gnome & GTK)
+ - Vim 7.2 / Python 2.6 / FreeBSD 8.0 (GTK)
+ - Vim 7.1 / Python 2.6 / FreeBSD 8.0 (GTK)
+ x Vim 7.0 / Python 2.6 / FreeBSD 8.0 (GTK)
+    * feedkeys() doesn't restart updatetime
+ - Vim 7.2 / Python 2.4 / OpenSolaris 2009.06 (Gnome)
+ - Vim 7.2 / Python 2.4 / CentOS 5.3 (no GUI)
+ - Vim 7.1 / Python 2.3 / RHEL 4 (no GUI)
+ - Vim 7.2 / Python 2.5 / Cygwin (Windows Vista 64b)
+ - MacVim 7.2 / Python 2.3 / OS X 10.6.2
+
+                                                             *conque_term-bugs*
+
+The following are known limitations:
+
+ - Font/color highlighting is imperfect and slow. If you don't care about
+   color in your shell, set g:ConqueTerm_Color = 0 in your .vimrc
+ - Conque only supports the extended ASCII character set for input, not utf-8.
+ - VT100 escape sequence support is not complete.
+ - Alt/Meta key support in Vim isn't great in general, and conque is no 
+   exception. Pressing <Esc><Esc>x or <Esc><M-x> instead of <M-x> works in 
+   most cases.
+
+                                                             *conque_term-todo*
+
+ - Fix pasting from named registers
+ - Polling unfucused conque buffers (Top explodes when window resizes)
+ - Enable graphics character set
+ - Consider supporting xterm escapes
+ - Improve color logic
+ - Find a solution to UTF-8 input (See InsertCharPre in Vim todo.txt)
+ - Find an alternative to updatetime polling (See Vim todo.txt)
+ - Find a graceful solution to Meta key input
+ - Windows support 
+   (See PyConsole http://www.vim.org/scripts/script.php?script_id=1974)
+ - Always: look for performance improvements
+
+
+                                                       *conque_term-contribute*
+
+The two contributions most in need are improvements to Vim itself. I currently 
+use hacks to simulate a key press event and repeating CursorHold event. The 
+Vim todo.txt document lists proposed improvements to give users this behavior 
+without hacks. Having a key press event should allow Conque to work with multi-
+byte input. If you are a Vim developer, please consider prioritizing these two 
+items: 
+
+ - todo.txt (Autocommands, line ~3137)
+     8   Add an event like CursorHold that is triggered repeatedly, not just 
+         once after typing something.
+
+ - todo.txt (Autocommands, proposed event list, line ~3189)
+     InsertCharPre   - user typed character Insert mode, before inserting the
+     char.  Pattern is matched with text before the cursor. Set v:char to the 
+     character, can be changed. (not triggered when 'paste' is set).
+
+Bugs, suggestions and patches are all welcome.
+
+For more information visit http://conque.googlecode.com
+
+Check out the latest from svn at http://conque.googlecode.com/svn/trunk/
+
+                                                       *conque_term-changelog*
+
+ - 1.0 / 2010-02-
+    * Complete python rewrite
+    * Add support for ncurses based applications
+    * Add continuous polling, instead of using <Tab>
+    * Improve speed
+    * Improve syntax highlighting
+
+ - 0.6 / 2009-12-18
+    * Fix GVim errors with non-english locale
+    * No functional changes
+
+ - 0.5 / 2009-12-02
+    * Various performance enhancements and bugfixes. 
+    * Rewritten escape sequence processing
+
+ - 0.4 / 2009-10-30
+    * Improved history and tab completion
+    * Fix escape sequence formatting and improve highlighting
+    * Send selected text to shell from any buffer
+    * Add special handling of "vi" and "man" commands
+    * Improve error handling
+    * Add key mappings for <C-p> <C-n> <C-l> <C-j>
+    * Various bugfixes
+
+ - 0.3 / 2009-10-13
+    * Apply escape sequence coloring to output, e.g. ls --color
+    * Clean up syntax files for portability
+    * Fix several Vim 7.1 bugs
+    * Bugfixes for multiple shell buffers
+    * Add experimental shell folding option
+
+ - 0.2 / 2009-10-01
+    * Rewritten subprocess management module in python instead of c
+    * Added support for OS X, partial support for Windows
+    * Improved tab completion
+
+ - 0.1 / 2009-09-03
+    * Initial release
+
diff --git a/vim/tmp/conque/plugin/conque_term.vim b/vim/tmp/conque/plugin/conque_term.vim
new file mode 100644 (file)
index 0000000..07f96e0
--- /dev/null
@@ -0,0 +1,93 @@
+" FILE:     plugin/conque_term.vim {{{
+" AUTHOR:   Nico Raffo <nicoraffo@gmail.com>
+" MODIFIED: 2010-05-27
+" VERSION:  1.1, for Vim 7.0
+" LICENSE:
+" Conque - pty interaction in Vim
+" Copyright (C) 2009-2010 Nico Raffo 
+"
+" MIT License
+" 
+" Permission is hereby granted, free of charge, to any person obtaining a copy
+" of this software and associated documentation files (the "Software"), to deal
+" in the Software without restriction, including without limitation the rights
+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+" copies of the Software, and to permit persons to whom the Software is
+" furnished to do so, subject to the following conditions:
+" 
+" The above copyright notice and this permission notice shall be included in
+" all copies or substantial portions of the Software.
+" 
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+" THE SOFTWARE.
+" }}}
+
+" See docs/conque_term.txt for help or type :help conque_term
+
+if exists('g:ConqueTerm_Loaded') || v:version < 700
+    finish
+endif
+
+" **********************************************************************************************************
+" **** CONFIG **********************************************************************************************
+" **********************************************************************************************************
+
+" Choose key mapping to leave insert mode {{{
+" If you choose something other than '<Esc>', then <Esc> will be sent to terminal
+" Using a different key will usually fix Alt/Meta key issues
+if !exists('g:ConqueTerm_EscKey')
+    let g:ConqueTerm_EscKey = '<Esc>'
+endif " }}}
+
+" Enable color. {{{
+" If your apps use a lot of color it will slow down the shell.
+if !exists('g:ConqueTerm_Color')
+    let g:ConqueTerm_Color = 1
+endif " }}}
+
+" TERM environment setting {{{
+if !exists('g:ConqueTerm_TERM')
+    let g:ConqueTerm_TERM =  'vt100'
+endif " }}}
+
+" Syntax for your buffer {{{
+if !exists('g:ConqueTerm_Syntax')
+    let g:ConqueTerm_Syntax = 'conque_term'
+endif " }}}
+
+" Keep on updating the shell window after you've switched to another buffer {{{
+if !exists('g:ConqueTerm_ReadUnfocused')
+    let g:ConqueTerm_ReadUnfocused = 0
+endif " }}}
+
+" Use this regular expression to highlight prompt {{{
+if !exists('g:ConqueTerm_PromptRegex')
+    let g:ConqueTerm_PromptRegex = '^\w\+@[0-9A-Za-z_.-]\+:[0-9A-Za-z_./\~,:-]\+\$'
+endif " }}}
+
+" Allow user to use <C-w> keys to switch window in insert mode. {{{
+if !exists('g:ConqueTerm_CWInsert')
+    let g:ConqueTerm_CWInsert = 0
+endif " }}}
+
+" **********************************************************************************************************
+" **** Startup *********************************************************************************************
+" **********************************************************************************************************
+
+" Startup {{{
+
+let g:ConqueTerm_Loaded = 1
+let g:ConqueTerm_Idx = 1
+
+command! -nargs=+ -complete=shellcmd ConqueTerm call conque_term#open(<q-args>)
+command! -nargs=+ -complete=shellcmd ConqueTermSplit call conque_term#open(<q-args>, ['belowright split'])
+command! -nargs=+ -complete=shellcmd ConqueTermVSplit call conque_term#open(<q-args>, ['belowright vsplit'])
+command! -nargs=+ -complete=shellcmd ConqueTermTab call conque_term#open(<q-args>, ['tabnew'])
+
+" }}}
+
diff --git a/vim/tmp/conque/syntax/conque_term.vim b/vim/tmp/conque/syntax/conque_term.vim
new file mode 100644 (file)
index 0000000..7607913
--- /dev/null
@@ -0,0 +1,75 @@
+
+" *******************************************************************************************************************
+" MySQL *************************************************************************************************************
+" *******************************************************************************************************************
+
+syn match MySQLTableHead "^ *|.*| *$" nextgroup=MySQLTableDivide contains=MySQLTableBar oneline skipwhite skipnl
+syn match MySQLTableBody "^ *|.*| *$" nextgroup=MySQLTableBody,MySQLTableEnd contains=MySQLTableBar,MySQLNull,MySQLBool,MySQLNumber,MySQLStorageClass oneline skipwhite skipnl
+syn match MySQLTableEnd "^ *+[+=-]\++ *$" oneline 
+syn match MySQLTableDivide "^ *+[+=-]\++ *$" nextgroup=MySQLTableBody oneline skipwhite skipnl
+syn match MySQLTableStart "^ *+[+=-]\++ *$" nextgroup=MySQLTableHead oneline skipwhite skipnl
+syn match MySQLNull " NULL " contained contains=MySQLTableBar
+syn match MySQLStorageClass " PRI " contained
+syn match MySQLStorageClass " MUL " contained
+syn match MySQLStorageClass " UNI " contained
+syn match MySQLStorageClass " CURRENT_TIMESTAMP " contained
+syn match MySQLStorageClass " auto_increment " contained
+syn match MySQLTableBar "|" contained
+syn match MySQLNumber "|\? *\d\+ *|" contained contains=MySQLTableBar
+syn match MySQLQueryStat "^\d\+ rows\? in set.*" oneline
+syn match MySQLPromptLine "^.\?mysql> .*$" contains=MySQLKeyword,MySQLPrompt,MySQLString oneline
+syn match MySQLPromptLine "^    -> .*$" contains=MySQLKeyword,MySQLPrompt,MySQLString oneline
+syn match MySQLPrompt "^.\?mysql>" contained oneline
+syn match MySQLPrompt "^    ->" contained oneline
+syn case ignore
+syn keyword MySQLKeyword select count max sum avg date show table tables status like as from left right outer inner join contained 
+syn keyword MySQLKeyword where group by having limit offset order desc asc show contained
+syn case match
+syn region MySQLString start=+'+ end=+'+ skip=+\\'+ contained oneline
+syn region MySQLString start=+"+ end=+"+ skip=+\\"+ contained oneline
+syn region MySQLString start=+`+ end=+`+ skip=+\\`+ contained oneline
+
+hi def link MySQLPrompt Identifier
+hi def link MySQLTableHead Title
+hi def link MySQLTableBody Normal
+hi def link MySQLBool Boolean
+hi def link MySQLStorageClass StorageClass
+hi def link MySQLNumber Number
+hi def link MySQLKeyword Keyword
+hi def link MySQLString String
+
+" terms which have no reasonable default highlight group to link to
+hi MySQLTableHead term=bold cterm=bold gui=bold
+if &background == 'dark'
+    hi MySQLTableEnd term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLTableDivide term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLTableStart term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLTableBar term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLNull term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+    hi MySQLQueryStat term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
+elseif &background == 'light'
+    hi MySQLTableEnd term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLTableDivide term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLTableStart term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLTableBar term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLNull term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+    hi MySQLQueryStat term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
+endif
+
+
+" *******************************************************************************************************************
+" Bash **************************************************************************************************************
+" *******************************************************************************************************************
+
+" Typical Prompt
+silent execute "syn match ConquePromptLine '" . g:ConqueTerm_PromptRegex . ".*$' contains=ConquePrompt,ConqueString oneline"
+silent execute "syn match ConquePrompt '" . g:ConqueTerm_PromptRegex . "' contained oneline"
+hi def link ConquePrompt Identifier
+
+" Strings
+syn region ConqueString start=+'+ end=+'+ skip=+\\'+ contained oneline
+syn region ConqueString start=+"+ end=+"+ skip=+\\"+ contained oneline
+syn region ConqueString start=+`+ end=+`+ skip=+\\`+ contained oneline
+hi def link ConqueString String
+
+" vim: foldmethod=marker
diff --git a/vim/tmp/conque_1.1.tar.gz b/vim/tmp/conque_1.1.tar.gz
new file mode 100644 (file)
index 0000000..96f95b4
Binary files /dev/null and b/vim/tmp/conque_1.1.tar.gz differ
diff --git a/vim/tmp/cucumber b/vim/tmp/cucumber
new file mode 160000 (submodule)
index 0000000..2ef3e5a
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 2ef3e5a4876a4cd5ea83a0dcbf17f5c3edbf9de3
diff --git a/vim/tmp/endwise b/vim/tmp/endwise
new file mode 160000 (submodule)
index 0000000..9a9d199
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 9a9d1994eaeae3f2f23da6bb71111782ab70276c
diff --git a/vim/tmp/fugitive b/vim/tmp/fugitive
new file mode 160000 (submodule)
index 0000000..201bdd0
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 201bdd0eff4cd79847cf006f143deb62f8f97342
diff --git a/vim/tmp/gist-vim b/vim/tmp/gist-vim
new file mode 160000 (submodule)
index 0000000..37e98ed
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 37e98ed00e1262ef80d232a9f0e0529afd4ed6ce
diff --git a/vim/tmp/git b/vim/tmp/git
new file mode 160000 (submodule)
index 0000000..291cbe9
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 291cbe97f2c367f40360949f19b4fa8fb0740e9f
diff --git a/vim/tmp/haml b/vim/tmp/haml
new file mode 160000 (submodule)
index 0000000..de3e72a
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit de3e72a384c9b1cc8707c9bc37cefc24d8484ebf
diff --git a/vim/tmp/indent_object b/vim/tmp/indent_object
new file mode 160000 (submodule)
index 0000000..78fffa6
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 78fffa609b3e6b84ef01ee4c9aba6d7435d7b18e
diff --git a/vim/tmp/irblack b/vim/tmp/irblack
new file mode 160000 (submodule)
index 0000000..59622ca
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 59622caff32a7925181ab139701fad3eee54ae51
diff --git a/vim/tmp/javascript b/vim/tmp/javascript
new file mode 160000 (submodule)
index 0000000..9990a76
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 9990a767695c78a44611ce33fb2dbc25c83d8827
diff --git a/vim/tmp/markdown b/vim/tmp/markdown
new file mode 160000 (submodule)
index 0000000..ae3a265
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit ae3a2653f824bb9e969f462c5d77e035a518ea61
diff --git a/vim/tmp/nerdcommenter b/vim/tmp/nerdcommenter
new file mode 160000 (submodule)
index 0000000..093e6b3
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 093e6b3f765b728c129a4271f1f34bb70e671f08
diff --git a/vim/tmp/nerdtree b/vim/tmp/nerdtree
new file mode 160000 (submodule)
index 0000000..3bb112d
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 3bb112d916a3e78f2e6528b869cdad1f7d826114
diff --git a/vim/tmp/puppet b/vim/tmp/puppet
new file mode 160000 (submodule)
index 0000000..1f3b151
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 1f3b151b2d4eefc2f1d59c0d381d01d32d56eb50
diff --git a/vim/tmp/rails b/vim/tmp/rails
new file mode 160000 (submodule)
index 0000000..d94405a
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit d94405aae64ff10fc10a78807b5e9214c83c60df
diff --git a/vim/tmp/rspec b/vim/tmp/rspec
new file mode 160000 (submodule)
index 0000000..4e6e495
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 4e6e4956dd3f3ae58daf1087352951a2ba7137bf
diff --git a/vim/tmp/scala b/vim/tmp/scala
new file mode 160000 (submodule)
index 0000000..e3746cd
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit e3746cd5703bedf1009c869e555a3b847b361701
diff --git a/vim/tmp/searchfold b/vim/tmp/searchfold
new file mode 160000 (submodule)
index 0000000..f2b988c
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit f2b988c592bc8989c2b9300f241ebb0aefde43e6
diff --git a/vim/tmp/snipmate b/vim/tmp/snipmate
new file mode 160000 (submodule)
index 0000000..f5a75d0
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit f5a75d075d3c005ebe69e3f5e56cf99516e8aa3b
diff --git a/vim/tmp/solarized b/vim/tmp/solarized
new file mode 160000 (submodule)
index 0000000..528a59f
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21
diff --git a/vim/tmp/supertab b/vim/tmp/supertab
new file mode 160000 (submodule)
index 0000000..80ec653
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 80ec6539e4139a2e0281a0f1e36d5038d55ad980
diff --git a/vim/tmp/surround b/vim/tmp/surround
new file mode 160000 (submodule)
index 0000000..f6c9d3b
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit f6c9d3beb2d11959d22b2555636aeb0c37e66aa1
diff --git a/vim/tmp/syntastic b/vim/tmp/syntastic
new file mode 160000 (submodule)
index 0000000..cf6aa9a
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit cf6aa9a4143704e0e3070302ffe593636d6e8cc9
diff --git a/vim/tmp/taglist b/vim/tmp/taglist
new file mode 160000 (submodule)
index 0000000..53041fb
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 53041fbc45398a9af631a20657e109707a455339
diff --git a/vim/tmp/textile b/vim/tmp/textile
new file mode 160000 (submodule)
index 0000000..5d25629
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 5d25629d066d01f3c9e0872ac18565afbb84a6dd
diff --git a/vim/tmp/unimpaired b/vim/tmp/unimpaired
new file mode 160000 (submodule)
index 0000000..1c9dcee
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 1c9dcee02bc23dc5757c2c8f3cc2e4964ed1e636
diff --git a/vim/tmp/vim-coffee-script b/vim/tmp/vim-coffee-script
new file mode 160000 (submodule)
index 0000000..dc16925
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit dc1692561461fd0b7642e05b03b7670974112eee
diff --git a/vim/tmp/vividchalk b/vim/tmp/vividchalk
new file mode 160000 (submodule)
index 0000000..c824c2a
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit c824c2a5c1d96a7d2ec2df6baf7231dcee621130
diff --git a/vim/tmp/zoomwin b/vim/tmp/zoomwin
new file mode 160000 (submodule)
index 0000000..e7ee18e
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit e7ee18e2e7ed60509aa951cd34b57193fa14e5ab
diff --git a/vim/vimrc b/vim/vimrc
new file mode 100644 (file)
index 0000000..3941f22
--- /dev/null
+++ b/vim/vimrc
@@ -0,0 +1,158 @@
+set nocompatible
+
+set number
+set ruler
+syntax on
+
+" Set encoding
+set encoding=utf-8
+
+" Whitespace stuff
+set nowrap
+set tabstop=2
+set shiftwidth=2
+set softtabstop=2
+set expandtab
+set list listchars=tab:\ \ ,trail:ยท
+
+" Searching
+set hlsearch
+set incsearch
+set ignorecase
+set smartcase
+
+" Tab completion
+set wildmode=list:longest,list:full
+set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
+
+" Status bar
+set laststatus=2
+
+" Without setting this, ZoomWin restores windows in a way that causes
+" equalalways behavior to be triggered the next time CommandT is used.
+" This is likely a bludgeon to solve some other issue, but it works
+set noequalalways
+
+" NERDTree configuration
+let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
+map <Leader>n :NERDTreeToggle<CR>
+
+" CTags
+map <Leader>rt :!ctags --extra=+f -R *<CR><CR>
+map <C-\> :tnext<CR>
+
+" Remember last location in file
+if has("autocmd")
+  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
+    \| exe "normal g'\"" | endif
+endif
+
+function s:setupWrapping()
+  set wrap
+  set wrapmargin=2
+  set textwidth=72
+endfunction
+
+function s:setupMarkup()
+  call s:setupWrapping()
+  map <buffer> <Leader>p :Hammer<CR>
+endfunction
+
+" make uses real tabs
+au FileType make set noexpandtab
+
+" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
+au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru}    set ft=ruby
+
+" md, markdown, and mk are markdown and define buffer-local preview
+au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} call s:setupMarkup()
+
+" add json syntax highlighting
+au BufNewFile,BufRead *.json set ft=javascript
+
+au BufRead,BufNewFile *.txt call s:setupWrapping()
+
+" make Python follow PEP8 ( http://www.python.org/dev/peps/pep-0008/ )
+au FileType python set softtabstop=4 tabstop=4 shiftwidth=4 textwidth=79
+
+" allow backspacing over everything in insert mode
+set backspace=indent,eol,start
+
+" load the plugin and indent settings for the detected filetype
+filetype plugin indent on
+
+" Opens an edit command with the path of the currently edited file filled in
+" Normal mode: <Leader>e
+map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
+
+" Opens a tab edit command with the path of the currently edited file filled in
+" Normal mode: <Leader>t
+map <Leader>te :tabe <C-R>=expand("%:p:h") . "/" <CR>
+
+" Inserts the path of the currently edited file into a command
+" Command mode: Ctrl+P
+cmap <C-P> <C-R>=expand("%:p:h") . "/" <CR>
+
+" Unimpaired configuration
+" Bubble single lines
+nmap <C-Up> [e
+nmap <C-Down> ]e
+" Bubble multiple lines
+vmap <C-Up> [egv
+vmap <C-Down> ]egv
+
+" Enable syntastic syntax checking
+let g:syntastic_enable_signs=1
+let g:syntastic_quiet_warnings=1
+
+" gist-vim defaults
+if has("mac")
+  let g:gist_clip_command = 'pbcopy'
+elseif has("unix")
+  let g:gist_clip_command = 'xclip -selection clipboard'
+endif
+let g:gist_detect_filetype = 1
+let g:gist_open_browser_after_post = 1
+
+" Use modeline overrides
+set modeline
+set modelines=10
+
+" Default color scheme
+set t_Co=256
+color railscasts
+
+" Directories for swp files
+set backupdir=~/.vim/backup
+set directory=~/.vim/backup
+
+" Turn off jslint errors by default
+let g:JSLintHighlightErrorLine = 0
+
+" MacVIM shift+arrow-keys behavior (required in .vimrc)
+let macvim_hig_shift_movement = 1
+
+" % to bounce from do to end etc.
+runtime! macros/matchit.vim
+
+" Show (partial) command in the status line
+set showcmd
+
+" Include user's local vim config
+if filereadable(expand("~/.vimrc.local"))
+  source ~/.vimrc.local
+endif
+
+" Mapping for TagBar
+nmap <F8> :TagbarToggle<CR>
+
+" Mapping for CommandTBuffer
+map <Leader>t :CtrlP<CR>
+map <Leader>T :CtrlPBuffer<CR>
+map <Leader>R :CtrlPClearCache<CR>
+
+" Color Column
+set colorcolumn=81
+
+" Add Pathogen
+call pathogen#infect()