From 2cd0786fb610e9c6604cc4bf7716b763d3cb2dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=B6hring?= Date: Tue, 10 Feb 2015 03:59:59 +0100 Subject: [PATCH] updated AAALL the configs --- dot.Xdefaults | 78 +- dot.conkyrc | 30 - dot.nvimrc | 34 + dot.oh-my-zsh/MIT-LICENSE.txt | 21 - dot.oh-my-zsh/README.textile | 89 - dot.oh-my-zsh/custom/example.zsh | 5 - .../custom/example/example.plugin.zsh | 2 - dot.oh-my-zsh/custom/lib/correction.zsh | 10 - dot.oh-my-zsh/custom/lib/history.zsh | 15 - dot.oh-my-zsh/custom/lib/key-bindings.zsh | 152 - dot.oh-my-zsh/custom/lib/misc.zsh | 19 - dot.oh-my-zsh/lib/aliases.zsh | 26 - dot.oh-my-zsh/lib/completion.zsh | 74 - dot.oh-my-zsh/lib/correction.zsh | 1 - dot.oh-my-zsh/lib/correction.zsh.old | 10 - dot.oh-my-zsh/lib/directories.zsh | 39 - dot.oh-my-zsh/lib/edit-command-line.zsh | 3 - dot.oh-my-zsh/lib/functions.zsh | 17 - dot.oh-my-zsh/lib/git.zsh | 132 - dot.oh-my-zsh/lib/grep.zsh | 6 - dot.oh-my-zsh/lib/history.zsh | 1 - dot.oh-my-zsh/lib/history.zsh.old | 13 - dot.oh-my-zsh/lib/key-bindings.zsh | 1 - dot.oh-my-zsh/lib/key-bindings.zsh.old | 50 - dot.oh-my-zsh/lib/misc.zsh | 1 - dot.oh-my-zsh/lib/misc.zsh.old | 15 - dot.oh-my-zsh/lib/rvm.zsh | 8 - dot.oh-my-zsh/lib/spectrum.zsh | 28 - dot.oh-my-zsh/lib/termsupport.zsh | 35 - dot.oh-my-zsh/lib/theme-and-appearance.zsh | 36 - dot.oh-my-zsh/log/.easter-egg | 4 - dot.oh-my-zsh/oh-my-zsh.sh | 80 - dot.oh-my-zsh/plugins/ant/ant.plugin.zsh | 26 - .../apache2-macports.plugin.zsh | 6 - .../plugins/archlinux/archlinux.plugin.zsh | 93 - .../plugins/autojump/autojump.plugin.zsh | 13 - .../plugins/battery/battery.plugin.zsh | 71 - dot.oh-my-zsh/plugins/brew/_brew | 80 - dot.oh-my-zsh/plugins/brew/brew.plugin.zsh | 1 - dot.oh-my-zsh/plugins/bundler/_bundler | 82 - .../plugins/bundler/bundler.plugin.zsh | 43 - dot.oh-my-zsh/plugins/bwana/bwana.plugin.zsh | 13 - dot.oh-my-zsh/plugins/cake/cake.plugin.zsh | 36 - dot.oh-my-zsh/plugins/capistrano/_capistrano | 10 - .../plugins/cloudapp/cloudapp.plugin.zsh | 2 - dot.oh-my-zsh/plugins/cloudapp/cloudapp.rb | 60 - dot.oh-my-zsh/plugins/coffee/_coffee | 71 - dot.oh-my-zsh/plugins/colemak/colemak-less | 6 - .../plugins/colemak/colemak.plugin.zsh | 22 - .../command-not-found.plugin.zsh | 5 - .../plugins/compleat/compleat.plugin.zsh | 20 - .../plugins/composer/composer.plugin.zsh | 29 - dot.oh-my-zsh/plugins/cp/cp.plugin.zsh | 14 - dot.oh-my-zsh/plugins/cpanm/_cpanm | 67 - .../plugins/debian/debian.plugin.zsh | 186 - .../plugins/dircycle/dircycle.plugin.zsh | 10 - .../plugins/dirpersist/dirpersist.plugin.zsh | 39 - .../plugins/django/django.plugin.zsh | 223 - .../plugins/encode64/encode64.plugin.zsh | 4 - dot.oh-my-zsh/plugins/extract/_extract | 8 - .../plugins/extract/extract.plugin.zsh | 80 - dot.oh-my-zsh/plugins/fasd/fasd.plugin.zsh | 6 - .../plugins/forklift/forklift.plugin.zsh | 44 - dot.oh-my-zsh/plugins/gas/_gas | 34 - dot.oh-my-zsh/plugins/gem/_gem | 64 - .../plugins/git-extras/git-extras.plugin.zsh | 285 - .../plugins/git-flow/git-flow.plugin.zsh | 337 - .../git-hubflow/git-hubflow.plugin.zsh | 348 - .../git-remote-branch.plugin.zsh | 18 - dot.oh-my-zsh/plugins/git/git.plugin.zsh | 93 - dot.oh-my-zsh/plugins/gitfast/_git | 78 - .../plugins/gitfast/git-completion.bash | 2483 - dot.oh-my-zsh/plugins/gitfast/git-prompt.sh | 290 - .../plugins/gitfast/gitfast.plugin.zsh | 7 - dot.oh-my-zsh/plugins/github/_github | 40 - .../plugins/github/github.plugin.zsh | 71 - .../plugins/gnu-utils/gnu-utils.plugin.zsh | 80 - .../plugins/gpg-agent/gpg-agent.plugin.zsh | 26 - .../plugins/gradle/gradle.plugin.zsh | 119 - .../plugins/grails/grails.plugin.zsh | 54 - dot.oh-my-zsh/plugins/heroku/_heroku | 159 - .../plugins/history-substring-search/README | 7 - .../history-substring-search.plugin.zsh | 12 - .../history-substring-search.zsh | 642 - .../plugins/history/history.plugin.zsh | 8 - .../plugins/jake-node/jake-node.plugin.zsh | 14 - dot.oh-my-zsh/plugins/jira/jira.plugin.zsh | 38 - dot.oh-my-zsh/plugins/jruby/jruby.plugin.zsh | 4 - dot.oh-my-zsh/plugins/kate/kate.plugin.zsh | 9 - dot.oh-my-zsh/plugins/knife/_knife | 185 - dot.oh-my-zsh/plugins/laravel/_artisan | 40 - .../plugins/laravel/laravel.plugin.zsh | 3 - .../last-working-dir.plugin.zsh | 24 - dot.oh-my-zsh/plugins/lein/lein.plugin.zsh | 41 - .../plugins/lighthouse/lighthouse.plugin.zsh | 16 - dot.oh-my-zsh/plugins/lol/lol.plugin.zsh | 38 - dot.oh-my-zsh/plugins/macports/_port | 89 - .../plugins/macports/macports.plugin.zsh | 8 - .../plugins/mercurial/mercurial.plugin.zsh | 20 - dot.oh-my-zsh/plugins/mvn/mvn.plugin.zsh | 170 - .../mysql-macports/mysql-macports.plugin.zsh | 8 - dot.oh-my-zsh/plugins/nanoc/_nanoc | 44 - dot.oh-my-zsh/plugins/nanoc/nanoc.plugin.zsh | 9 - dot.oh-my-zsh/plugins/node/node.plugin.zsh | 5 - dot.oh-my-zsh/plugins/npm/npm.plugin.zsh | 1 - dot.oh-my-zsh/plugins/nyan/nyan.plugin.zsh | 5 - dot.oh-my-zsh/plugins/osx/_man-preview | 5 - dot.oh-my-zsh/plugins/osx/osx.plugin.zsh | 156 - dot.oh-my-zsh/plugins/pass/_pass | 119 - .../per-directory-history.plugin.zsh | 149 - dot.oh-my-zsh/plugins/perl/perl.plugin.zsh | 62 - dot.oh-my-zsh/plugins/phing/phing.plugin.zsh | 19 - dot.oh-my-zsh/plugins/pip/_pip | 74 - dot.oh-my-zsh/plugins/pj/pj.plugin.zsh | 42 - dot.oh-my-zsh/plugins/pow/pow.plugin.zsh | 66 - dot.oh-my-zsh/plugins/powder/_powder | 4 - .../plugins/python/python.plugin.zsh | 12 - dot.oh-my-zsh/plugins/rails/rails.plugin.zsh | 16 - .../plugins/rails3/rails3.plugin.zsh | 23 - dot.oh-my-zsh/plugins/rake/rake.plugin.zsh | 6 - dot.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh | 57 - dot.oh-my-zsh/plugins/rbfu/rbfu.plugin.zsh | 42 - dot.oh-my-zsh/plugins/redis-cli/_redis-cli | 142 - dot.oh-my-zsh/plugins/rsync/rsync.plugin.zsh | 4 - dot.oh-my-zsh/plugins/ruby/ruby.plugin.zsh | 6 - dot.oh-my-zsh/plugins/rvm/rvm.plugin.zsh | 51 - .../plugins/screen/screen.plugin.zsh | 54 - .../plugins/sprunge/sprunge.plugin.zsh | 62 - .../plugins/ssh-agent/ssh-agent.plugin.zsh | 62 - .../plugins/sublime/sublime.plugin.zsh | 21 - .../plugins/supervisor/_supervisorctl | 136 - dot.oh-my-zsh/plugins/supervisor/_supervisord | 32 - .../plugins/supervisor/supervisor.plugin.zsh | 1 - dot.oh-my-zsh/plugins/suse/suse.plugin.zsh | 7 - dot.oh-my-zsh/plugins/svn/svn.plugin.zsh | 62 - .../plugins/symfony/symfony.plugin.zsh | 13 - .../plugins/symfony2/symfony2.plugin.zsh | 19 - .../plugins/systemd/systemd.plugin.zsh | 11 - dot.oh-my-zsh/plugins/taskwarrior/_task | 248 - .../taskwarrior/taskwarrior.plugin.zsh | 21 - .../terminalapp/terminalapp.plugin.zsh | 39 - dot.oh-my-zsh/plugins/terminitor/_terminitor | 38 - .../plugins/textmate/textmate.plugin.zsh | 12 - dot.oh-my-zsh/plugins/themes/_theme | 3 - .../plugins/themes/themes.plugin.zsh | 24 - dot.oh-my-zsh/plugins/thor/_thor | 4 - .../plugins/urltools/urltools.plugin.zsh | 36 - dot.oh-my-zsh/plugins/vagrant/_vagrant | 111 - .../plugins/vi-mode/vi-mode.plugin.zsh | 35 - .../virtualenvwrapper.plugin.zsh | 40 - .../plugins/vundle/vundle.plugin.zsh | 23 - dot.oh-my-zsh/plugins/wakeonlan/README | 29 - dot.oh-my-zsh/plugins/wakeonlan/_wake | 4 - .../plugins/wakeonlan/wakeonlan.plugin.zsh | 14 - dot.oh-my-zsh/plugins/yum/yum.plugin.zsh | 16 - dot.oh-my-zsh/plugins/zeus/README.md | 43 - dot.oh-my-zsh/plugins/zeus/zeus.plugin.zsh | 61 - dot.oh-my-zsh/plugins/zsh-syntax-highlighting | 1 - dot.oh-my-zsh/templates/zshrc.zsh-template | 39 - dot.oh-my-zsh/themes/3den.zsh-theme | 7 - dot.oh-my-zsh/themes/Soliah.zsh-theme | 86 - dot.oh-my-zsh/themes/adben.zsh-theme | 26 - dot.oh-my-zsh/themes/af-magic.zsh-theme | 36 - dot.oh-my-zsh/themes/afowler.zsh-theme | 10 - dot.oh-my-zsh/themes/agnoster.zsh-theme | 115 - dot.oh-my-zsh/themes/alanpeabody.zsh-theme | 28 - dot.oh-my-zsh/themes/apple.zsh-theme | 29 - dot.oh-my-zsh/themes/arrow.zsh-theme | 14 - dot.oh-my-zsh/themes/aussiegeek.zsh-theme | 8 - dot.oh-my-zsh/themes/awesomepanda.zsh-theme | 18 - dot.oh-my-zsh/themes/bira.zsh-theme | 21 - dot.oh-my-zsh/themes/blinks.zsh-theme | 30 - dot.oh-my-zsh/themes/candy-kingdom.zsh-theme | 37 - dot.oh-my-zsh/themes/candy.zsh-theme | 7 - dot.oh-my-zsh/themes/clean.zsh-theme | 14 - dot.oh-my-zsh/themes/cloud.zsh-theme | 10 - dot.oh-my-zsh/themes/crunch.zsh-theme | 43 - dot.oh-my-zsh/themes/cypher.zsh-theme | 4 - dot.oh-my-zsh/themes/dallas.zsh-theme | 32 - dot.oh-my-zsh/themes/darkblood.zsh-theme | 9 - dot.oh-my-zsh/themes/daveverwer.zsh-theme | 7 - dot.oh-my-zsh/themes/dieter.zsh-theme | 56 - dot.oh-my-zsh/themes/dogenpunk.zsh-theme | 85 - dot.oh-my-zsh/themes/dpoggi.zsh-theme | 14 - dot.oh-my-zsh/themes/dst.zsh-theme | 16 - dot.oh-my-zsh/themes/dstufft.zsh-theme | 19 - dot.oh-my-zsh/themes/duellj.zsh-theme | 8 - dot.oh-my-zsh/themes/eastwood.zsh-theme | 23 - dot.oh-my-zsh/themes/edvardm.zsh-theme | 6 - dot.oh-my-zsh/themes/evan.zsh-theme | 2 - dot.oh-my-zsh/themes/example.zsh-theme | 5 - dot.oh-my-zsh/themes/fino-time.zsh-theme | 39 - dot.oh-my-zsh/themes/fino.zsh-theme | 46 - dot.oh-my-zsh/themes/fishy.zsh-theme | 24 - dot.oh-my-zsh/themes/flazz.zsh-theme | 19 - dot.oh-my-zsh/themes/fletcherm.zsh-theme | 12 - dot.oh-my-zsh/themes/fox.zsh-theme | 8 - dot.oh-my-zsh/themes/frisk.zsh-theme | 22 - dot.oh-my-zsh/themes/frontcube.zsh-theme | 12 - dot.oh-my-zsh/themes/funky.zsh-theme | 14 - dot.oh-my-zsh/themes/fwalch.zsh-theme | 6 - dot.oh-my-zsh/themes/gallifrey.zsh-theme | 8 - dot.oh-my-zsh/themes/gallois.zsh-theme | 25 - .../themes/garyblessington.zsh-theme | 6 - dot.oh-my-zsh/themes/gentoo.zsh-theme | 8 - dot.oh-my-zsh/themes/geoffgarside.zsh-theme | 5 - dot.oh-my-zsh/themes/gnzh.zsh-theme | 54 - dot.oh-my-zsh/themes/gozilla.zsh-theme | 15 - dot.oh-my-zsh/themes/humza.zsh-theme | 26 - dot.oh-my-zsh/themes/imajes.zsh-theme | 5 - dot.oh-my-zsh/themes/intheloop.zsh-theme | 24 - dot.oh-my-zsh/themes/jbergantine.zsh-theme | 6 - dot.oh-my-zsh/themes/jispwoso.zsh-theme | 4 - dot.oh-my-zsh/themes/jnrowe.zsh-theme | 38 - dot.oh-my-zsh/themes/jonathan.zsh-theme | 143 - dot.oh-my-zsh/themes/josh.zsh-theme | 43 - dot.oh-my-zsh/themes/jreese.zsh-theme | 16 - dot.oh-my-zsh/themes/jtriley.zsh-theme | 8 - dot.oh-my-zsh/themes/juanghurtado.zsh-theme | 46 - dot.oh-my-zsh/themes/junkfood.zsh-theme | 34 - dot.oh-my-zsh/themes/kafeitu.zsh-theme | 6 - dot.oh-my-zsh/themes/kardan.zsh-theme | 12 - dot.oh-my-zsh/themes/kennethreitz.zsh-theme | 13 - dot.oh-my-zsh/themes/kolo.zsh-theme | 24 - dot.oh-my-zsh/themes/kphoen.zsh-theme | 50 - dot.oh-my-zsh/themes/lambda.zsh-theme | 6 - dot.oh-my-zsh/themes/linuxonly | 80 - dot.oh-my-zsh/themes/lukerandall.zsh-theme | 24 - dot.oh-my-zsh/themes/macovsky-ruby.zsh-theme | 15 - dot.oh-my-zsh/themes/macovsky.zsh-theme | 14 - dot.oh-my-zsh/themes/maran.zsh-theme | 6 - dot.oh-my-zsh/themes/mgutz.zsh-theme | 6 - dot.oh-my-zsh/themes/mh.zsh-theme | 24 - dot.oh-my-zsh/themes/mikeh.zsh-theme | 23 - dot.oh-my-zsh/themes/miloshadzic.zsh-theme | 8 - dot.oh-my-zsh/themes/minimal.zsh-theme | 18 - dot.oh-my-zsh/themes/mortalscumbag.zsh-theme | 59 - dot.oh-my-zsh/themes/mrtazz.zsh-theme | 7 - dot.oh-my-zsh/themes/murilasso.zsh-theme | 14 - dot.oh-my-zsh/themes/muse.zsh-theme | 30 - dot.oh-my-zsh/themes/nanotech.zsh-theme | 7 - dot.oh-my-zsh/themes/nebirhos.zsh-theme | 21 - dot.oh-my-zsh/themes/nicoulaj.zsh-theme | 43 - dot.oh-my-zsh/themes/norm.zsh-theme | 4 - dot.oh-my-zsh/themes/obraun.zsh-theme | 11 - dot.oh-my-zsh/themes/philips.zsh-theme | 14 - dot.oh-my-zsh/themes/pmcgee.zsh-theme | 16 - dot.oh-my-zsh/themes/psy.zsh-theme | 56 - dot.oh-my-zsh/themes/pygmalion.zsh-theme | 9 - dot.oh-my-zsh/themes/re5et.zsh-theme | 15 - dot.oh-my-zsh/themes/rgm.zsh-theme | 8 - dot.oh-my-zsh/themes/risto.zsh-theme | 6 - dot.oh-my-zsh/themes/rixius.zsh-theme | 24 - dot.oh-my-zsh/themes/rkj-repos.zsh-theme | 29 - dot.oh-my-zsh/themes/rkj.zsh-theme | 8 - dot.oh-my-zsh/themes/robbyrussell.zsh-theme | 6 - dot.oh-my-zsh/themes/sammy.zsh-theme | 6 - dot.oh-my-zsh/themes/simonoff.zsh-theme | 141 - dot.oh-my-zsh/themes/simple.zsh-theme | 6 - dot.oh-my-zsh/themes/skaro.zsh-theme | 7 - dot.oh-my-zsh/themes/smt.zsh-theme | 91 - dot.oh-my-zsh/themes/sorin.zsh-theme | 48 - dot.oh-my-zsh/themes/sporty_256.zsh-theme | 13 - dot.oh-my-zsh/themes/steeef.zsh-theme | 100 - dot.oh-my-zsh/themes/sunaku.zsh-theme | 26 - dot.oh-my-zsh/themes/sunrise.zsh-theme | 96 - dot.oh-my-zsh/themes/superjarin.zsh-theme | 24 - dot.oh-my-zsh/themes/suvash.zsh-theme | 30 - dot.oh-my-zsh/themes/takashiyoshida.zsh-theme | 27 - dot.oh-my-zsh/themes/terminalparty.zsh-theme | 9 - dot.oh-my-zsh/themes/theunraveler.zsh-theme | 16 - dot.oh-my-zsh/themes/tjkirch.zsh-theme | 15 - dot.oh-my-zsh/themes/tjkirch_mod.zsh-theme | 13 - dot.oh-my-zsh/themes/tonotdo.zsh-theme | 12 - dot.oh-my-zsh/themes/trapd00r.zsh-theme | 95 - dot.oh-my-zsh/themes/wedisagree.zsh-theme | 107 - dot.oh-my-zsh/themes/wezm+.zsh-theme | 7 - dot.oh-my-zsh/themes/wezm.zsh-theme | 7 - dot.oh-my-zsh/themes/wuffers.zsh-theme | 5 - .../themes/xiong-chiamiov-plus.zsh-theme | 6 - dot.oh-my-zsh/themes/xiong-chiamiov.zsh-theme | 6 - dot.oh-my-zsh/themes/zhann.zsh-theme | 15 - dot.oh-my-zsh/tools/check_for_upgrade.sh | 52 - dot.oh-my-zsh/tools/install.sh | 38 - dot.oh-my-zsh/tools/require_tool.sh | 161 - dot.oh-my-zsh/tools/theme_chooser.sh | 96 - dot.oh-my-zsh/tools/uninstall.sh | 28 - dot.oh-my-zsh/tools/upgrade.sh | 19 - dot.vim/.VimballRecord | 4 - dot.vim/.netrwhist | 8 - dot.vim/after/plugin/snipMate.vim | 35 - dot.vim/autoload/RltvNmbr.vim | 263 - dot.vim/autoload/conque_term.vim | 1378 - dot.vim/autoload/pathogen.vim | 139 - dot.vim/autoload/rails.vim | 4647 - dot.vim/autoload/snipMate.vim | 433 - dot.vim/autoload/vimwiki.vim | 1088 - dot.vim/autoload/vimwiki_diary.vim | 281 - dot.vim/autoload/vimwiki_html.vim | 1311 - dot.vim/autoload/vimwiki_lst.vim | 359 - dot.vim/autoload/vimwiki_tbl.vim | 510 - dot.vim/autoload/xml/jsf_c.vim | 126 - dot.vim/autoload/xml/jsf_h.vim | 222 - dot.vim/autoload/xml/stl_c.vim | 95 - dot.vim/autoload/xml/stl_fmt.vim | 88 - dot.vim/autoload/xml/stl_sql.vim | 49 - dot.vim/autoload/xml/stl_x.vim | 77 - dot.vim/autoload/xml/tc.vim | 463 - dot.vim/autoload/xml/tx.vim | 109 - dot.vim/autoload/zencoding.vim | 2058 - dot.vim/bundle/vim-coffee-script | 1 - dot.vim/colors/deveiate.vim | 90 - dot.vim/colors/focuspoint.vim | 110 - dot.vim/colors/fruity.vim | 147 - dot.vim/colors/gardener.vim | 271 - dot.vim/colors/inkpot.vim | 216 - dot.vim/colors/nightflight2.vim | 47 - dot.vim/colors/railcasts.vim | 96 - dot.vim/colors/wombat.vim | 51 - dot.vim/colors/wombat256mod.vim | 96 - dot.vim/colors/zenburn.vim | 315 - dot.vim/compiler/javac_ex.vim | 19 - dot.vim/doc/CuteTodoList.txt | 129 - dot.vim/doc/Makefile | 60 - dot.vim/doc/Makefile.in | 29 - dot.vim/doc/NERD_commenter.txt | 1266 - dot.vim/doc/README | 110 - dot.vim/doc/README.new | 17 - dot.vim/doc/RltvNmbr.txt | 113 - dot.vim/doc/catalog.xml | 12 - dot.vim/doc/conque_term.txt | 156 - dot.vim/doc/ft-csv.txt | 1466 - dot.vim/doc/fugitive.txt | 220 - dot.vim/doc/imaps.txt | 116 - dot.vim/doc/potwiki.txt | 204 - dot.vim/doc/rails.txt | 1202 - dot.vim/doc/snipMate.txt | 286 - dot.vim/doc/taglist.txt | 1501 - dot.vim/doc/tags | 834 - dot.vim/doc/textile.txt | 52 - dot.vim/doc/twitvim.txt | 1312 - dot.vim/doc/vcde.txt | 80 - dot.vim/doc/vimwiki.txt | 2147 - dot.vim/doc/vjde.txt | 871 - dot.vim/doc/zencoding.txt | 383 - dot.vim/ftdetect/csv.vim | 6 - dot.vim/ftdetect/haml.vim | 2 - dot.vim/ftdetect/opa.vim | 5 - dot.vim/ftdetect/scala.vim | 1 - dot.vim/ftplugin/README.rst | 70 - dot.vim/ftplugin/csv.vim | 2000 - dot.vim/ftplugin/haml.vim | 66 - dot.vim/ftplugin/html_snip_helper.vim | 10 - dot.vim/ftplugin/pyflakes.vim | 203 - dot.vim/ftplugin/pyflakes/LICENSE | 21 - dot.vim/ftplugin/pyflakes/README.rst | 36 - dot.vim/ftplugin/pyflakes/bin/pyflakes | 4 - .../ftplugin/pyflakes/pyflakes/__init__.py | 0 dot.vim/ftplugin/pyflakes/pyflakes/ast.py | 311 - dot.vim/ftplugin/pyflakes/pyflakes/checker.py | 389 - .../ftplugin/pyflakes/pyflakes/messages.py | 77 - .../pyflakes/pyflakes/scripts/__init__.py | 0 .../pyflakes/pyflakes/scripts/pyflakes.py | 63 - .../pyflakes/pyflakes/test/__init__.py | 0 .../pyflakes/pyflakes/test/harness.py | 24 - .../pyflakes/pyflakes/test/test_imports.py | 512 - .../pyflakes/pyflakes/test/test_other.py | 234 - .../pyflakes/pyflakes/test/test_script.py | 48 - .../pyflakes/test/test_undefined_names.py | 182 - dot.vim/ftplugin/pyflakes/setup.py | 19 - dot.vim/ftplugin/python_ifold.c.vim | 250 - dot.vim/ftplugin/sass.vim | 18 - dot.vim/ftplugin/textile.vim | 51 - dot.vim/ftplugin/vimwiki.vim | 384 - dot.vim/headers/article.haml | 10 - dot.vim/headers/c | 9 - dot.vim/headers/html | 40 - dot.vim/headers/py | 14 - dot.vim/headers/syntaxhighlighterbrush.js | 18 - dot.vim/headers/tex | 54 - dot.vim/indent/haml.vim | 73 - dot.vim/indent/python.vim | 196 - dot.vim/indent/sass.vim | 39 - dot.vim/indent/scala.vim | 83 - dot.vim/indent/tex.vim | 139 - dot.vim/ltags | 78 - dot.vim/plugin/31-create-scala.vim | 55 - dot.vim/plugin/NERD_commenter.vim | 3362 - dot.vim/plugin/RltvNmbr.vim | 263 - dot.vim/plugin/RltvNmbrPlugin.vim | 37 - dot.vim/plugin/ShowFunc.vim | 566 - dot.vim/plugin/SimpleFold.vim | 280 - dot.vim/plugin/SyntaxFolds.vim | 323 - dot.vim/plugin/conque_term.vim | 80 - dot.vim/plugin/csv.vim | 19 - dot.vim/plugin/cuteTodo.vim | 607 - dot.vim/plugin/filebrowser.vim | 250 - dot.vim/plugin/fugitive.vim | 1703 - dot.vim/plugin/imaps.vim | 831 - dot.vim/plugin/instant-markdown.vim | 18 - dot.vim/plugin/libList.vim | 249 - dot.vim/plugin/lodgeit.vim | 134 - dot.vim/plugin/notmuch.vim | 1432 - dot.vim/plugin/occur.vim | 68 - dot.vim/plugin/phpdoc.vim | 506 - dot.vim/plugin/potwiki.vim | 685 - dot.vim/plugin/pydoc.vim | 78 - dot.vim/plugin/pysmell.vim | 84 - dot.vim/plugin/rails.vim | 314 - dot.vim/plugin/snipMate.vim | 247 - dot.vim/plugin/taglist.vim.bak | 4546 - dot.vim/plugin/textile.vim | 5 - dot.vim/plugin/textutil.vim | 182 - dot.vim/plugin/twitvim.vim | 2370 - dot.vim/plugin/vimwiki.vim | 398 - dot.vim/plugin/zencoding.vim | 137 - dot.vim/pydiction | 198231 --------------- dot.vim/pydiction-0.5/LICENSE.txt | 89 - dot.vim/pydiction-0.5/README | 123 - dot.vim/pydiction-0.5/pydiction.py | 95 - dot.vim/signs/priol1.ico | Bin 26694 -> 0 bytes dot.vim/signs/priol1.png | Bin 1276 -> 0 bytes dot.vim/signs/priol2.ico | Bin 26694 -> 0 bytes dot.vim/signs/priol2.png | Bin 1472 -> 0 bytes dot.vim/signs/priop1.ico | Bin 26694 -> 0 bytes dot.vim/signs/priop1.png | Bin 1651 -> 0 bytes dot.vim/signs/priop2.ico | Bin 26694 -> 0 bytes dot.vim/signs/priop2.png | Bin 1999 -> 0 bytes dot.vim/snippets/_.snippets | 7 - dot.vim/snippets/autoit.snippets | 66 - dot.vim/snippets/c.snippets | 110 - dot.vim/snippets/cpp.snippets | 30 - dot.vim/snippets/html.snippets | 190 - dot.vim/snippets/java.snippets | 78 - dot.vim/snippets/javascript.snippets | 74 - dot.vim/snippets/mako.snippets | 54 - dot.vim/snippets/objc.snippets | 184 - dot.vim/snippets/perl.snippets | 91 - dot.vim/snippets/php.snippets | 216 - dot.vim/snippets/python.snippets | 86 - dot.vim/snippets/ruby.snippets | 420 - dot.vim/snippets/sh.snippets | 28 - dot.vim/snippets/snippet.snippets | 7 - dot.vim/snippets/tcl.snippets | 92 - dot.vim/snippets/vim.snippets | 32 - dot.vim/snippets/zsh.snippets | 58 - dot.vim/src/CSParser.cs | 165 - dot.vim/src/Makefile | 25 - dot.vim/src/lex.yy.c | 2447 - dot.vim/src/my_system.cpp | 117 - dot.vim/src/my_system.h | 4 - dot.vim/src/previewwindow.cpp | 990 - dot.vim/src/previewwindow.hpp | 6 - dot.vim/src/readtags.c | 1194 - dot.vim/src/readtags.h | 252 - dot.vim/src/tipswnd.c | 372 - dot.vim/src/tipswnd.lex | 524 - dot.vim/src/vjde/completion/ClassInfo.java | 642 - dot.vim/src/vjde/completion/ClassPathDir.java | 140 - .../src/vjde/completion/ClassPathEntry.java | 189 - dot.vim/src/vjde/completion/ClassPathZip.java | 94 - .../src/vjde/completion/ClassesByName.java | 44 - dot.vim/src/vjde/completion/Completion.java | 943 - dot.vim/src/vjde/completion/Document.java | 175 - .../src/vjde/completion/Document.java.oooold | 356 - .../vjde/completion/DynamicClassLoader.java | 537 - .../src/vjde/completion/MultiValueMap.java | 85 - .../src/vjde/completion/PackageClasses.java | 73 - .../vjde/completion/PackageCompletion.java | 35 - .../src/vjde/completion/SourceDocReader.java | 260 - .../src/vjde/completion/Struts2Configure.java | 460 - dot.vim/src/wspawn.cpp | 75 - dot.vim/syntax/asmx86.vim | 597 - dot.vim/syntax/conque_term.vim | 77 - dot.vim/syntax/csv.vim | 181 - dot.vim/syntax/haml.vim | 107 - dot.vim/syntax/javascript.vim | 246 - dot.vim/syntax/less.vim | 305 - dot.vim/syntax/lyx.vim | 17 - dot.vim/syntax/nimrod.vim | 187 - dot.vim/syntax/notmuch-compose.vim | 7 - dot.vim/syntax/notmuch-folders.vim | 12 - dot.vim/syntax/notmuch-git-diff.vim | 26 - dot.vim/syntax/notmuch-search.vim | 12 - dot.vim/syntax/notmuch-show.vim | 24 - dot.vim/syntax/opa.vim | 165 - dot.vim/syntax/opajs.vim | 166 - dot.vim/syntax/preview.vim | 22 - dot.vim/syntax/python.vim | 181 - dot.vim/syntax/sass.vim | 64 - dot.vim/syntax/scala.vim | 151 - dot.vim/syntax/snippet.vim | 19 - dot.vim/syntax/textile.vim | 87 - dot.vim/syntax/vimwiki.vim | 236 - dot.vim/syntax/vimwiki_default.vim | 83 - dot.vim/syntax/vimwiki_media.vim | 67 - dot.vim/syntax/vjde.vim | 30 - dot.vim/vimrc | 157 - dot.vimrc | 52 +- dot.xinitrc | 84 +- dot.xmobarrc | 37 + dot.zshrc | 69 +- herbstluftwm/autostart | 160 + herbstluftwm/panel.sh | 41 + herbstluftwm/restartpanels.sh | 16 + herbstluftwm/tag_status.sh | 31 + i3/config | 184 - i3/i3status | 58 - subtle/grabs.rb | 189 - subtle/gravities.rb | 74 - subtle/hooks.rb | 41 - subtle/options.rb | 17 - subtle/panel.rb | 57 - subtle/styles.rb | 89 - subtle/sublets.rb | 50 - subtle/subtle.rb | 42 - subtle/tags.rb | 222 - subtle/views.rb | 76 - wmfs/keysrc | 107 - wmfs/rulesrc | 29 - wmfs/themesrc | 59 - wmfs/wmfs2_status_cpugraph.sh | 51 - wmfs/wmfsrc | 112 - 523 files changed, 417 insertions(+), 283043 deletions(-) delete mode 100644 dot.conkyrc create mode 100644 dot.nvimrc delete mode 100644 dot.oh-my-zsh/MIT-LICENSE.txt delete mode 100644 dot.oh-my-zsh/README.textile delete mode 100644 dot.oh-my-zsh/custom/example.zsh delete mode 100644 dot.oh-my-zsh/custom/example/example.plugin.zsh delete mode 100644 dot.oh-my-zsh/custom/lib/correction.zsh delete mode 100644 dot.oh-my-zsh/custom/lib/history.zsh delete mode 100644 dot.oh-my-zsh/custom/lib/key-bindings.zsh delete mode 100644 dot.oh-my-zsh/custom/lib/misc.zsh delete mode 100644 dot.oh-my-zsh/lib/aliases.zsh delete mode 100644 dot.oh-my-zsh/lib/completion.zsh delete mode 120000 dot.oh-my-zsh/lib/correction.zsh delete mode 100644 dot.oh-my-zsh/lib/correction.zsh.old delete mode 100644 dot.oh-my-zsh/lib/directories.zsh delete mode 100644 dot.oh-my-zsh/lib/edit-command-line.zsh delete mode 100644 dot.oh-my-zsh/lib/functions.zsh delete mode 100644 dot.oh-my-zsh/lib/git.zsh delete mode 100644 dot.oh-my-zsh/lib/grep.zsh delete mode 120000 dot.oh-my-zsh/lib/history.zsh delete mode 100644 dot.oh-my-zsh/lib/history.zsh.old delete mode 120000 dot.oh-my-zsh/lib/key-bindings.zsh delete mode 100644 dot.oh-my-zsh/lib/key-bindings.zsh.old delete mode 120000 dot.oh-my-zsh/lib/misc.zsh delete mode 100644 dot.oh-my-zsh/lib/misc.zsh.old delete mode 100644 dot.oh-my-zsh/lib/rvm.zsh delete mode 100644 dot.oh-my-zsh/lib/spectrum.zsh delete mode 100644 dot.oh-my-zsh/lib/termsupport.zsh delete mode 100644 dot.oh-my-zsh/lib/theme-and-appearance.zsh delete mode 100644 dot.oh-my-zsh/log/.easter-egg delete mode 100644 dot.oh-my-zsh/oh-my-zsh.sh delete mode 100644 dot.oh-my-zsh/plugins/ant/ant.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/apache2-macports/apache2-macports.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/autojump/autojump.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/battery/battery.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/brew/_brew delete mode 100644 dot.oh-my-zsh/plugins/brew/brew.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/bundler/_bundler delete mode 100644 dot.oh-my-zsh/plugins/bundler/bundler.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/bwana/bwana.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/cake/cake.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/capistrano/_capistrano delete mode 100644 dot.oh-my-zsh/plugins/cloudapp/cloudapp.plugin.zsh delete mode 100755 dot.oh-my-zsh/plugins/cloudapp/cloudapp.rb delete mode 100644 dot.oh-my-zsh/plugins/coffee/_coffee delete mode 100644 dot.oh-my-zsh/plugins/colemak/colemak-less delete mode 100644 dot.oh-my-zsh/plugins/colemak/colemak.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/compleat/compleat.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/composer/composer.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/cp/cp.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/cpanm/_cpanm delete mode 100644 dot.oh-my-zsh/plugins/debian/debian.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/dircycle/dircycle.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/dirpersist/dirpersist.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/django/django.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/encode64/encode64.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/extract/_extract delete mode 100644 dot.oh-my-zsh/plugins/extract/extract.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/fasd/fasd.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/forklift/forklift.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/gas/_gas delete mode 100644 dot.oh-my-zsh/plugins/gem/_gem delete mode 100644 dot.oh-my-zsh/plugins/git-extras/git-extras.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/git-hubflow/git-hubflow.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/git-remote-branch/git-remote-branch.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/git/git.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/gitfast/_git delete mode 100644 dot.oh-my-zsh/plugins/gitfast/git-completion.bash delete mode 100644 dot.oh-my-zsh/plugins/gitfast/git-prompt.sh delete mode 100644 dot.oh-my-zsh/plugins/gitfast/gitfast.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/github/_github delete mode 100644 dot.oh-my-zsh/plugins/github/github.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/gradle/gradle.plugin.zsh delete mode 100755 dot.oh-my-zsh/plugins/grails/grails.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/heroku/_heroku delete mode 100644 dot.oh-my-zsh/plugins/history-substring-search/README delete mode 100644 dot.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh delete mode 100644 dot.oh-my-zsh/plugins/history/history.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/jake-node/jake-node.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/jira/jira.plugin.zsh delete mode 100755 dot.oh-my-zsh/plugins/jruby/jruby.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/kate/kate.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/knife/_knife delete mode 100644 dot.oh-my-zsh/plugins/laravel/_artisan delete mode 100644 dot.oh-my-zsh/plugins/laravel/laravel.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/last-working-dir/last-working-dir.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/lein/lein.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/lol/lol.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/macports/_port delete mode 100644 dot.oh-my-zsh/plugins/macports/macports.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/mvn/mvn.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/mysql-macports/mysql-macports.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/nanoc/_nanoc delete mode 100644 dot.oh-my-zsh/plugins/nanoc/nanoc.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/node/node.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/npm/npm.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/nyan/nyan.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/osx/_man-preview delete mode 100644 dot.oh-my-zsh/plugins/osx/osx.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/pass/_pass delete mode 100644 dot.oh-my-zsh/plugins/per-directory-history/per-directory-history.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/perl/perl.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/phing/phing.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/pip/_pip delete mode 100644 dot.oh-my-zsh/plugins/pj/pj.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/pow/pow.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/powder/_powder delete mode 100644 dot.oh-my-zsh/plugins/python/python.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/rails/rails.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/rails3/rails3.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/rake/rake.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/rbfu/rbfu.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/redis-cli/_redis-cli delete mode 100644 dot.oh-my-zsh/plugins/rsync/rsync.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/ruby/ruby.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/rvm/rvm.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/screen/screen.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/sprunge/sprunge.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/ssh-agent/ssh-agent.plugin.zsh delete mode 100755 dot.oh-my-zsh/plugins/sublime/sublime.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/supervisor/_supervisorctl delete mode 100644 dot.oh-my-zsh/plugins/supervisor/_supervisord delete mode 100644 dot.oh-my-zsh/plugins/supervisor/supervisor.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/suse/suse.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/svn/svn.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/symfony/symfony.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/systemd/systemd.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/taskwarrior/_task delete mode 100644 dot.oh-my-zsh/plugins/taskwarrior/taskwarrior.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/terminalapp/terminalapp.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/terminitor/_terminitor delete mode 100644 dot.oh-my-zsh/plugins/textmate/textmate.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/themes/_theme delete mode 100644 dot.oh-my-zsh/plugins/themes/themes.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/thor/_thor delete mode 100644 dot.oh-my-zsh/plugins/urltools/urltools.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/vagrant/_vagrant delete mode 100644 dot.oh-my-zsh/plugins/vi-mode/vi-mode.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/vundle/vundle.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/wakeonlan/README delete mode 100644 dot.oh-my-zsh/plugins/wakeonlan/_wake delete mode 100644 dot.oh-my-zsh/plugins/wakeonlan/wakeonlan.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/yum/yum.plugin.zsh delete mode 100644 dot.oh-my-zsh/plugins/zeus/README.md delete mode 100644 dot.oh-my-zsh/plugins/zeus/zeus.plugin.zsh delete mode 160000 dot.oh-my-zsh/plugins/zsh-syntax-highlighting delete mode 100644 dot.oh-my-zsh/templates/zshrc.zsh-template delete mode 100644 dot.oh-my-zsh/themes/3den.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/Soliah.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/adben.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/af-magic.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/afowler.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/agnoster.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/alanpeabody.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/apple.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/arrow.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/aussiegeek.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/awesomepanda.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/bira.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/blinks.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/candy-kingdom.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/candy.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/clean.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/cloud.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/crunch.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/cypher.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/dallas.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/darkblood.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/daveverwer.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/dieter.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/dogenpunk.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/dpoggi.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/dst.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/dstufft.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/duellj.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/eastwood.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/edvardm.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/evan.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/example.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/fino-time.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/fino.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/fishy.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/flazz.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/fletcherm.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/fox.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/frisk.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/frontcube.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/funky.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/fwalch.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/gallifrey.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/gallois.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/garyblessington.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/gentoo.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/geoffgarside.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/gnzh.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/gozilla.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/humza.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/imajes.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/intheloop.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/jbergantine.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/jispwoso.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/jnrowe.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/jonathan.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/josh.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/jreese.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/jtriley.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/juanghurtado.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/junkfood.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/kafeitu.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/kardan.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/kennethreitz.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/kolo.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/kphoen.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/lambda.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/linuxonly delete mode 100644 dot.oh-my-zsh/themes/lukerandall.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/macovsky-ruby.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/macovsky.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/maran.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/mgutz.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/mh.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/mikeh.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/miloshadzic.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/minimal.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/mortalscumbag.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/mrtazz.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/murilasso.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/muse.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/nanotech.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/nebirhos.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/nicoulaj.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/norm.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/obraun.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/philips.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/pmcgee.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/psy.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/pygmalion.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/re5et.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/rgm.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/risto.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/rixius.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/rkj-repos.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/rkj.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/robbyrussell.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/sammy.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/simonoff.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/simple.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/skaro.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/smt.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/sorin.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/sporty_256.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/steeef.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/sunaku.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/sunrise.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/superjarin.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/suvash.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/takashiyoshida.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/terminalparty.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/theunraveler.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/tjkirch.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/tjkirch_mod.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/tonotdo.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/trapd00r.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/wedisagree.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/wezm+.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/wezm.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/wuffers.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/xiong-chiamiov-plus.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/xiong-chiamiov.zsh-theme delete mode 100644 dot.oh-my-zsh/themes/zhann.zsh-theme delete mode 100644 dot.oh-my-zsh/tools/check_for_upgrade.sh delete mode 100755 dot.oh-my-zsh/tools/install.sh delete mode 100755 dot.oh-my-zsh/tools/require_tool.sh delete mode 100755 dot.oh-my-zsh/tools/theme_chooser.sh delete mode 100644 dot.oh-my-zsh/tools/uninstall.sh delete mode 100644 dot.oh-my-zsh/tools/upgrade.sh delete mode 100644 dot.vim/.VimballRecord delete mode 100644 dot.vim/.netrwhist delete mode 100644 dot.vim/after/plugin/snipMate.vim delete mode 100644 dot.vim/autoload/RltvNmbr.vim delete mode 100644 dot.vim/autoload/conque_term.vim delete mode 100644 dot.vim/autoload/pathogen.vim delete mode 100644 dot.vim/autoload/rails.vim delete mode 100644 dot.vim/autoload/snipMate.vim delete mode 100644 dot.vim/autoload/vimwiki.vim delete mode 100644 dot.vim/autoload/vimwiki_diary.vim delete mode 100644 dot.vim/autoload/vimwiki_html.vim delete mode 100644 dot.vim/autoload/vimwiki_lst.vim delete mode 100644 dot.vim/autoload/vimwiki_tbl.vim delete mode 100644 dot.vim/autoload/xml/jsf_c.vim delete mode 100644 dot.vim/autoload/xml/jsf_h.vim delete mode 100644 dot.vim/autoload/xml/stl_c.vim delete mode 100644 dot.vim/autoload/xml/stl_fmt.vim delete mode 100644 dot.vim/autoload/xml/stl_sql.vim delete mode 100644 dot.vim/autoload/xml/stl_x.vim delete mode 100644 dot.vim/autoload/xml/tc.vim delete mode 100644 dot.vim/autoload/xml/tx.vim delete mode 100644 dot.vim/autoload/zencoding.vim delete mode 160000 dot.vim/bundle/vim-coffee-script delete mode 100644 dot.vim/colors/deveiate.vim delete mode 100644 dot.vim/colors/focuspoint.vim delete mode 100644 dot.vim/colors/fruity.vim delete mode 100644 dot.vim/colors/gardener.vim delete mode 100644 dot.vim/colors/inkpot.vim delete mode 100644 dot.vim/colors/nightflight2.vim delete mode 100644 dot.vim/colors/railcasts.vim delete mode 100644 dot.vim/colors/wombat.vim delete mode 100644 dot.vim/colors/wombat256mod.vim delete mode 100644 dot.vim/colors/zenburn.vim delete mode 100644 dot.vim/compiler/javac_ex.vim delete mode 100644 dot.vim/doc/CuteTodoList.txt delete mode 100644 dot.vim/doc/Makefile delete mode 100644 dot.vim/doc/Makefile.in delete mode 100644 dot.vim/doc/NERD_commenter.txt delete mode 100644 dot.vim/doc/README delete mode 100644 dot.vim/doc/README.new delete mode 100644 dot.vim/doc/RltvNmbr.txt delete mode 100644 dot.vim/doc/catalog.xml delete mode 100644 dot.vim/doc/conque_term.txt delete mode 100644 dot.vim/doc/ft-csv.txt delete mode 100644 dot.vim/doc/fugitive.txt delete mode 100644 dot.vim/doc/imaps.txt delete mode 100644 dot.vim/doc/potwiki.txt delete mode 100644 dot.vim/doc/rails.txt delete mode 100644 dot.vim/doc/snipMate.txt delete mode 100755 dot.vim/doc/taglist.txt delete mode 100644 dot.vim/doc/tags delete mode 100644 dot.vim/doc/textile.txt delete mode 100644 dot.vim/doc/twitvim.txt delete mode 100644 dot.vim/doc/vcde.txt delete mode 100644 dot.vim/doc/vimwiki.txt delete mode 100644 dot.vim/doc/vjde.txt delete mode 100644 dot.vim/doc/zencoding.txt delete mode 100644 dot.vim/ftdetect/csv.vim delete mode 100644 dot.vim/ftdetect/haml.vim delete mode 100644 dot.vim/ftdetect/opa.vim delete mode 100644 dot.vim/ftdetect/scala.vim delete mode 100644 dot.vim/ftplugin/README.rst delete mode 100644 dot.vim/ftplugin/csv.vim delete mode 100644 dot.vim/ftplugin/haml.vim delete mode 100644 dot.vim/ftplugin/html_snip_helper.vim delete mode 100644 dot.vim/ftplugin/pyflakes.vim delete mode 100644 dot.vim/ftplugin/pyflakes/LICENSE delete mode 100644 dot.vim/ftplugin/pyflakes/README.rst delete mode 100644 dot.vim/ftplugin/pyflakes/bin/pyflakes delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/__init__.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/ast.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/checker.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/messages.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/scripts/__init__.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/scripts/pyflakes.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/test/__init__.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/test/harness.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/test/test_imports.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/test/test_other.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/test/test_script.py delete mode 100644 dot.vim/ftplugin/pyflakes/pyflakes/test/test_undefined_names.py delete mode 100644 dot.vim/ftplugin/pyflakes/setup.py delete mode 100644 dot.vim/ftplugin/python_ifold.c.vim delete mode 100644 dot.vim/ftplugin/sass.vim delete mode 100644 dot.vim/ftplugin/textile.vim delete mode 100644 dot.vim/ftplugin/vimwiki.vim delete mode 100644 dot.vim/headers/article.haml delete mode 100644 dot.vim/headers/c delete mode 100644 dot.vim/headers/html delete mode 100644 dot.vim/headers/py delete mode 100644 dot.vim/headers/syntaxhighlighterbrush.js delete mode 100644 dot.vim/headers/tex delete mode 100644 dot.vim/indent/haml.vim delete mode 100644 dot.vim/indent/python.vim delete mode 100644 dot.vim/indent/sass.vim delete mode 100644 dot.vim/indent/scala.vim delete mode 100644 dot.vim/indent/tex.vim delete mode 100755 dot.vim/ltags delete mode 100644 dot.vim/plugin/31-create-scala.vim delete mode 100644 dot.vim/plugin/NERD_commenter.vim delete mode 100644 dot.vim/plugin/RltvNmbr.vim delete mode 100644 dot.vim/plugin/RltvNmbrPlugin.vim delete mode 100644 dot.vim/plugin/ShowFunc.vim delete mode 100644 dot.vim/plugin/SimpleFold.vim delete mode 100644 dot.vim/plugin/SyntaxFolds.vim delete mode 100644 dot.vim/plugin/conque_term.vim delete mode 100644 dot.vim/plugin/csv.vim delete mode 100644 dot.vim/plugin/cuteTodo.vim delete mode 100644 dot.vim/plugin/filebrowser.vim delete mode 100644 dot.vim/plugin/fugitive.vim delete mode 100644 dot.vim/plugin/imaps.vim delete mode 100644 dot.vim/plugin/instant-markdown.vim delete mode 100644 dot.vim/plugin/libList.vim delete mode 100644 dot.vim/plugin/lodgeit.vim delete mode 100644 dot.vim/plugin/notmuch.vim delete mode 100644 dot.vim/plugin/occur.vim delete mode 100644 dot.vim/plugin/phpdoc.vim delete mode 100644 dot.vim/plugin/potwiki.vim delete mode 100644 dot.vim/plugin/pydoc.vim delete mode 100644 dot.vim/plugin/pysmell.vim delete mode 100644 dot.vim/plugin/rails.vim delete mode 100644 dot.vim/plugin/snipMate.vim delete mode 100644 dot.vim/plugin/taglist.vim.bak delete mode 100644 dot.vim/plugin/textile.vim delete mode 100644 dot.vim/plugin/textutil.vim delete mode 100644 dot.vim/plugin/twitvim.vim delete mode 100644 dot.vim/plugin/vimwiki.vim delete mode 100644 dot.vim/plugin/zencoding.vim delete mode 100755 dot.vim/pydiction delete mode 100755 dot.vim/pydiction-0.5/LICENSE.txt delete mode 100755 dot.vim/pydiction-0.5/README delete mode 100755 dot.vim/pydiction-0.5/pydiction.py delete mode 100644 dot.vim/signs/priol1.ico delete mode 100644 dot.vim/signs/priol1.png delete mode 100644 dot.vim/signs/priol2.ico delete mode 100644 dot.vim/signs/priol2.png delete mode 100644 dot.vim/signs/priop1.ico delete mode 100644 dot.vim/signs/priop1.png delete mode 100644 dot.vim/signs/priop2.ico delete mode 100644 dot.vim/signs/priop2.png delete mode 100644 dot.vim/snippets/_.snippets delete mode 100644 dot.vim/snippets/autoit.snippets delete mode 100644 dot.vim/snippets/c.snippets delete mode 100644 dot.vim/snippets/cpp.snippets delete mode 100644 dot.vim/snippets/html.snippets delete mode 100644 dot.vim/snippets/java.snippets delete mode 100644 dot.vim/snippets/javascript.snippets delete mode 100644 dot.vim/snippets/mako.snippets delete mode 100644 dot.vim/snippets/objc.snippets delete mode 100644 dot.vim/snippets/perl.snippets delete mode 100644 dot.vim/snippets/php.snippets delete mode 100644 dot.vim/snippets/python.snippets delete mode 100644 dot.vim/snippets/ruby.snippets delete mode 100644 dot.vim/snippets/sh.snippets delete mode 100644 dot.vim/snippets/snippet.snippets delete mode 100644 dot.vim/snippets/tcl.snippets delete mode 100644 dot.vim/snippets/vim.snippets delete mode 100644 dot.vim/snippets/zsh.snippets delete mode 100644 dot.vim/src/CSParser.cs delete mode 100644 dot.vim/src/Makefile delete mode 100644 dot.vim/src/lex.yy.c delete mode 100644 dot.vim/src/my_system.cpp delete mode 100644 dot.vim/src/my_system.h delete mode 100644 dot.vim/src/previewwindow.cpp delete mode 100644 dot.vim/src/previewwindow.hpp delete mode 100644 dot.vim/src/readtags.c delete mode 100644 dot.vim/src/readtags.h delete mode 100644 dot.vim/src/tipswnd.c delete mode 100644 dot.vim/src/tipswnd.lex delete mode 100644 dot.vim/src/vjde/completion/ClassInfo.java delete mode 100644 dot.vim/src/vjde/completion/ClassPathDir.java delete mode 100644 dot.vim/src/vjde/completion/ClassPathEntry.java delete mode 100644 dot.vim/src/vjde/completion/ClassPathZip.java delete mode 100644 dot.vim/src/vjde/completion/ClassesByName.java delete mode 100644 dot.vim/src/vjde/completion/Completion.java delete mode 100644 dot.vim/src/vjde/completion/Document.java delete mode 100644 dot.vim/src/vjde/completion/Document.java.oooold delete mode 100644 dot.vim/src/vjde/completion/DynamicClassLoader.java delete mode 100644 dot.vim/src/vjde/completion/MultiValueMap.java delete mode 100644 dot.vim/src/vjde/completion/PackageClasses.java delete mode 100644 dot.vim/src/vjde/completion/PackageCompletion.java delete mode 100644 dot.vim/src/vjde/completion/SourceDocReader.java delete mode 100644 dot.vim/src/vjde/completion/Struts2Configure.java delete mode 100644 dot.vim/src/wspawn.cpp delete mode 100644 dot.vim/syntax/asmx86.vim delete mode 100644 dot.vim/syntax/conque_term.vim delete mode 100644 dot.vim/syntax/csv.vim delete mode 100644 dot.vim/syntax/haml.vim delete mode 100644 dot.vim/syntax/javascript.vim delete mode 100644 dot.vim/syntax/less.vim delete mode 100644 dot.vim/syntax/lyx.vim delete mode 100644 dot.vim/syntax/nimrod.vim delete mode 100644 dot.vim/syntax/notmuch-compose.vim delete mode 100644 dot.vim/syntax/notmuch-folders.vim delete mode 100644 dot.vim/syntax/notmuch-git-diff.vim delete mode 100644 dot.vim/syntax/notmuch-search.vim delete mode 100644 dot.vim/syntax/notmuch-show.vim delete mode 100644 dot.vim/syntax/opa.vim delete mode 100644 dot.vim/syntax/opajs.vim delete mode 100644 dot.vim/syntax/preview.vim delete mode 100644 dot.vim/syntax/python.vim delete mode 100644 dot.vim/syntax/sass.vim delete mode 100644 dot.vim/syntax/scala.vim delete mode 100644 dot.vim/syntax/snippet.vim delete mode 100644 dot.vim/syntax/textile.vim delete mode 100644 dot.vim/syntax/vimwiki.vim delete mode 100644 dot.vim/syntax/vimwiki_default.vim delete mode 100644 dot.vim/syntax/vimwiki_media.vim delete mode 100644 dot.vim/syntax/vjde.vim delete mode 100644 dot.vim/vimrc create mode 100644 dot.xmobarrc create mode 100755 herbstluftwm/autostart create mode 100755 herbstluftwm/panel.sh create mode 100755 herbstluftwm/restartpanels.sh create mode 100755 herbstluftwm/tag_status.sh delete mode 100644 i3/config delete mode 100644 i3/i3status delete mode 100644 subtle/grabs.rb delete mode 100644 subtle/gravities.rb delete mode 100644 subtle/hooks.rb delete mode 100644 subtle/options.rb delete mode 100644 subtle/panel.rb delete mode 100644 subtle/styles.rb delete mode 100644 subtle/sublets.rb delete mode 100644 subtle/subtle.rb delete mode 100644 subtle/tags.rb delete mode 100644 subtle/views.rb delete mode 100644 wmfs/keysrc delete mode 100644 wmfs/rulesrc delete mode 100644 wmfs/themesrc delete mode 100644 wmfs/wmfs2_status_cpugraph.sh delete mode 100644 wmfs/wmfsrc diff --git a/dot.Xdefaults b/dot.Xdefaults index 3b9e1f8..25c932f 100644 --- a/dot.Xdefaults +++ b/dot.Xdefaults @@ -5,11 +5,18 @@ ! and others ! general settings: -Xft.antialias: true +Xft.antialias: 0 +Xft.autohint: 0 +Xft.lcdfilter: lcddefault +Xft.hintstyle: hintfull +Xft.hinting: 1 +Xft.rgba: rgb +Xft.dpi: 96 ! colors: ! color settings... since I want the same ones for xterm I decided to remove every "urxvt" *foreground: #cccccc *background: #191919 +*font: xft:monofur-24 ! Black + Dark Grey ! was #222222 and/or #333333 !*color0: [90]#191919 @@ -80,76 +87,7 @@ urxvt.urlLauncher: /usr/bin/vimprobable2 urxvt.scrollstyle: plain urxvt.scrollBar: false -URxvt.font: xft:monofur:pixelsize=16:,xft:AR PL UMing CN:pixelsize=12,xft:Arial Unicode MS:pixelsize=12,xft:Dejavu Sans:pixelsize=12: -!URxvt*font: -*-pixelcarnage monospace-*-*-*-*-*-*-*-*-*-*-*-* -!Rxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=11 -!Rxvt*font: -*-optismall-*-*-*-*-*-*-*-*-*-*-*-* -!URxvt*font: -artwiz-cure.de-*-*-*-*-*-*-*-*-*-*-*-* -!URxvt*font: 7x13 -!URxvt.font: xft:inconsolata-g:pixelsize=12,xft:AR PL UMing CN:pixelsize=10 -!URxvt*font: -*-pixelcarnage monospace-*-*-*-*-*-*-*-*-*-*-*-* -!URxvt.font: xft:Dejavu Sans Mono:pixelsize=12,xft:AR PL UMing CN:pixelsize=10,xft:Arial Unicode MS:pixelsize=12,xft:Dejavu Sans:pixelsize=12: -!urxvt.font: -*-proggytiny-*-*-*-*-*-*-*-*-*-*-*-* URxvt*matcher.button: 3 !URxvt.keysym.C-minus: command:\033]50;xft:Monospace:size=10:antialias=true\007 URxvt.keysym.C-minus: perl:mark-yank-urls:activate_mark_mode - -xosview*captions: True -xosview*font: -*-lucida-*-r-*-*-8-*-*-*-*-*-*-* - -xosview*cpu: True -xosview*mem: True -xosview*net: True -xosview*disk: True -xosview*load: True -xosview*swap: True -xosview*page: True -xosview*gfx: True -xosview*NFSStats: False -xosview*NFSDStats: False -xosview*serial(0-9): True -xosview*interrupts: False -xosview*lmstemp: False -xosview*battery: True -xosview*RAID: False - -xosview*foreground: #282828 -xosview*background: #000000 -xosview*borderwidth: 0 - -xosview*usedlabels: False -xosview*labels: True - -xosview*meterLabelColor: #888888 -xosview*usedLabelColor: #ffffff - -xosview*memUsedFormat: autoscale -xosview*memUsedColor: #a9cc92 -xosview*memFreeColor: #383838 -xosview*memBufferColor: #181818 -xosview*memCacheColor: #181818 - -xosview*swapUsedFormat: autoscale -xosview*swapUsedColor: #a9cc92 -xosview*swapFreeColor: #383838 - -xosview*cpuUserColor: #a9cc92 -xosview*cpuFreeColor: #383838 -xosview*cpuNiceColor: #889955 -xosview*cpuSystemColor: #889955 -xosview*cpuInterruptColor: #ff0000 - -xosview*netIface: wlan0 -xosview*netInColor: #a9cc92 -xosview*netOutColor: #bb0000 -xosview*netBackground: #383838 - -xosview*diskUsedColor: #a9cc92 -xosview*diskWriteColor: #bb0000 -xosview*diskReadColor: #00bb00 -xosview*diskIdleColor: #383838 - -xosview*pageIdleColor: #383838 - -xosview*batteryUsedColor: #383838 diff --git a/dot.conkyrc b/dot.conkyrc deleted file mode 100644 index 16bfba5..0000000 --- a/dot.conkyrc +++ /dev/null @@ -1,30 +0,0 @@ -use_xft yes -xftfont 123:size=8 -xftalpha 0.1 -update_interval 2 -total_run_times 0 -own_window no -double_buffer yes -maximum_width 600 -draw_shades no -draw_outline no -draw_borders no -draw_graph_borders no -default_color white -color1 FFA300 -default_shade_color red -default_outline_color green -alignment bottom_right -gap_x 0 -gap_y 100 -no_buffers yes -uppercase no -cpu_avg_samples 2 -net_avg_samples 1 -override_utf8_locale yes -use_spacer right - - -TEXT -${voffset 20}${color EAEAEA}${font Philosopher:pixelsize=120}${time %H:%M}${font}${voffset -77}${offset 10}${color1}${font Philosopher:pixelsize=42}${time %d} ${voffset -15}${color EAEAEA}${font Philosopher:pixelsize=22}${time %B} ${time %Y}${font}${voffset 27}${font Philosopher:pixelsize=58}${offset -173}${time %A}${font} -${voffset 3}${offset 10}${font Ubuntu:pixelsize=13}${color1}ROOT $color${fs_used_perc /}%${offset 12}${color1}HOME $color${fs_used_perc /home}%${offset 12}${color1}RAM $color$memperc%${offset 12}${color1}LOAD $color${loadavg 1} ${offset 12}${color1}TMP $color${acpitemp}°C diff --git a/dot.nvimrc b/dot.nvimrc new file mode 100644 index 0000000..bb25ac3 --- /dev/null +++ b/dot.nvimrc @@ -0,0 +1,34 @@ +call plug#begin('~/.nvim/plugged') + +Plug 'kchmck/vim-coffee-script' +Plug 'tpope/vim-haml' +Plug 'tpope/vim-speeddating' +Plug 'kien/ctrlp.vim' +Plug 'spolu/dwm.vim' +Plug 'mileszs/ack.vim' +Plug 'sunaku/xoria256.vim' +Plug 'mattn/emmet-vim' +Plug 'digitaltoad/vim-jade' +Plug 'wavded/vim-stylus' +Plug 'wting/rust.vim' +Plug 'farseer90718/vim-taskwarrior' + +call plug#end() + +let g:ackprg = 'ag --nogroup --nocolor --column' +colorscheme xoria256 + +set expandtab +set shiftwidth=4 +set tabstop=4 +set softtabstop=4 +set encoding=utf-8 +set textwidth=79 +set colorcolumn=80 +set scrolloff=5 +set laststatus=2 +set number +set wildmenu +set wildmode=list:longest,full +"set cryptmethod=blowfish +set t_Co=256 diff --git a/dot.oh-my-zsh/MIT-LICENSE.txt b/dot.oh-my-zsh/MIT-LICENSE.txt deleted file mode 100644 index f6edab6..0000000 --- a/dot.oh-my-zsh/MIT-LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors) - -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. diff --git a/dot.oh-my-zsh/README.textile b/dot.oh-my-zsh/README.textile deleted file mode 100644 index 0a4545b..0000000 --- a/dot.oh-my-zsh/README.textile +++ /dev/null @@ -1,89 +0,0 @@ -A handful of functions, auto-complete helpers, and stuff that makes you shout... - - -bq. "OH MY ZSHELL!" - -h2. Setup - -@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9. - -h3. The automatic installer... (do you trust me?) - -You can install this via the command line with either `curl` or `wget`. - -h4. via `curl` - -@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@ - -h4. via `wget` - -@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@ - -h3. The manual way - - -1. Clone the repository - - @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ - -2. *OPTIONAL* Backup your existing ~/.zshrc file - - @cp ~/.zshrc ~/.zshrc.orig@ - -3. Create a new zsh config by copying the zsh template we've provided. - - @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@ - - -4. Set zsh as your default shell: - - @chsh -s /bin/zsh@ - -5. Start / restart zsh (open a new terminal is easy enough...) - -h3. Problems? - -You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_. - -h2. Usage - -* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible) -** example: @plugins=(git osx ruby)@ -* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@. -** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_. -* much much more... take a look at @lib/@ what _Oh My Zsh_ offers... - -h2. Useful - -the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty for tips. - -h3. Customization - -If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory. -If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin. -If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@. - - -h3. Uninstalling - -If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config). - -h2. Help out! - -I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! - -h3. (Don't) Send us your theme! (for now) - --I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.- - -We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there. - - - -h2. Contributors - -This project wouldn't exist without all of our awesome users and contributors. - -* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors - -Thank you so much! diff --git a/dot.oh-my-zsh/custom/example.zsh b/dot.oh-my-zsh/custom/example.zsh deleted file mode 100644 index 28ffcae..0000000 --- a/dot.oh-my-zsh/custom/example.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Add yourself some shortcuts to projects you often work on -# Example: -# -# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr -# \ No newline at end of file diff --git a/dot.oh-my-zsh/custom/example/example.plugin.zsh b/dot.oh-my-zsh/custom/example/example.plugin.zsh deleted file mode 100644 index 406f274..0000000 --- a/dot.oh-my-zsh/custom/example/example.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom plugins in the custom/plugins directory. Plugins placed -# here will override ones with the same name in the main plugins directory. diff --git a/dot.oh-my-zsh/custom/lib/correction.zsh b/dot.oh-my-zsh/custom/lib/correction.zsh deleted file mode 100644 index 60039b3..0000000 --- a/dot.oh-my-zsh/custom/lib/correction.zsh +++ /dev/null @@ -1,10 +0,0 @@ -setopt correct - -alias man='nocorrect man' -alias mv='nocorrect mv' -alias mysql='nocorrect mysql' -alias mkdir='nocorrect mkdir' -alias gist='nocorrect gist' -alias heroku='nocorrect heroku' -alias ebuild='nocorrect ebuild' -alias hpodder='nocorrect hpodder' diff --git a/dot.oh-my-zsh/custom/lib/history.zsh b/dot.oh-my-zsh/custom/lib/history.zsh deleted file mode 100644 index 724529d..0000000 --- a/dot.oh-my-zsh/custom/lib/history.zsh +++ /dev/null @@ -1,15 +0,0 @@ -## Command history configuration -HISTFILE=$HOME/.zsh_history -HISTSIZE=10000 -SAVEHIST=10000 - -setopt append_history -setopt extended_history -setopt hist_expire_dups_first -setopt hist_ignore_all_dups # ignore duplication command history list -setopt hist_ignore_space -setopt hist_reduce_blanks -setopt hist_save_no_dups -setopt hist_verify -setopt inc_append_history -setopt share_history # share command history data diff --git a/dot.oh-my-zsh/custom/lib/key-bindings.zsh b/dot.oh-my-zsh/custom/lib/key-bindings.zsh deleted file mode 100644 index 017acd4..0000000 --- a/dot.oh-my-zsh/custom/lib/key-bindings.zsh +++ /dev/null @@ -1,152 +0,0 @@ -man-command () -{ - if [ -n "$BUFFER" ] - then - local FirstArg=`echo $BUFFER | awk '{print $1}'` - man $FirstArg - fi -} - -sudo-command () -{ - if [ -n "$BUFFER" -a "${BUFFER:0:4}" != "sudo" ] - then - BUFFER="sudo $BUFFER" - zle end-of-line - fi -} - -move-pointer-to-next-arg () -{ - if [ -n "$BUFFER" ] - then - CURSOR=`echo | awk ' - { curpos=5; arg=$BUFFER; orig=arg; - arg=substr(arg, curpos); - if (substr(arg, 1, 1) == "-") arg=substr(arg, 2); - curpos+=index(arg, "-"); - print curpos; }'` - fi -} - -move-pointer-after-command () -{ - if [ -n "$BUFFER" ] - then - local LenOfFirstArg=`echo $BUFFER | awk '{ print length($1) }'` - CURSOR=$LenOfFirstArg - fi -} - -# bmi calculator and it doesn't care if you start width height or width -# eg: `bmi 65 1.8` and `bmi 1.8 65` is the same -bmi () -{ - local w=$1 - local h=$2 - if [[ $w -lt $h ]] - then - h=$1 - w=$2 - fi - echo $(($w/$h/$h)) -} - -zle -N man-command # shows the man-page of the written command -zle -N sudo-command # writes "sudo " in front of the buffer -zle -N move-pointer-after-command # moves the pointer between command and first parameter -zle -N move-pointer-to-next-arg - - -bindkey -e -bindkey '\ew' kill-region -bindkey -s '\el' "ls\n" -bindkey '^r' history-incremental-search-backward - -bindkey '^[[1~' beginning-of-line # [Begin] -bindkey '^[[2~' overwrite-mode # [Insert] -bindkey '^[[3~' delete-char # [Delete] -bindkey '^[[4~' end-of-line # [End] -bindkey "^[[5~" up-line-or-history # [Page-Up] -bindkey "^[[6~" down-line-or-history # [Page-Down] - -# make search up and down work, so partially type and hit up/down to find relevant stuff -bindkey '^[[A' up-line-or-search -bindkey '^[[B' down-line-or-search - -bindkey "^[[H" beginning-of-line -bindkey "^[OH" beginning-of-line -bindkey "^[[F" end-of-line -bindkey "^[OF" end-of-line -bindkey ' ' magic-space # also do history expansion on space - -#bindkey "^[[1;5C" forward-word -#bindkey "^[[1;5D" backward-word -#TODO: make keybindings ctrl+right and ctrl+left work -bindkey "^[[OC" move-pointer-to-next-arg -bindkey "^[[OD" move-pointer-after-command - -bindkey '^[[Z' reverse-menu-complete - -# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ -bindkey '^?' backward-delete-char -bindkey "^[[3~" delete-char -bindkey "^[3;5~" delete-char -bindkey "\e[3~" delete-char - -bindkey '^N' man-command -bindkey '^S' sudo-command -bindkey '^U' kill-whole-line -bindkey '^Q' push-input -bindkey '^P' yank -bindkey '^f' forward-word -bindkey '^b' backward-word - -# some command shortcuts -alias ls='ls --color=always' -alias lh='ls -lh' -alias ls_sizesorted='ls -lSrah' -alias lad='ls -d .*(/)' # only show dot-directories -alias lsa='ls -a .*(.)' # only show dot-files -alias lss='ls -l *(s,S,t)' # only files with setgid/setuid/sticky flag -alias lsl='ls -l *(@[1,10])' # only symlinks -alias lsx='ls -l *(*[1,10])' # only executables -alias lsw='ls -ld *(R,W,X.^ND/)' # world-{readable,writable,executable} files -alias lsbig="ls -flh *(.OL[1,10])" # display the biggest files -alias lsd='ls -d ^.*(/)' # only show directories -alias lse='ls -d *(/^F)' # only show empty directories -alias lsnew="ls -drl *(Dom[1,10])" # display the newest files and directories -alias lsold="ls -rtlh *(Dom[1,10])" # display the oldest files and directories -alias lssmall="ls -Srl *(.oL[1,10])" # display the smallest files -alias screensaver='clear; for ((;;)); do echo -ne "\033[$((1+RANDOM%LINES));$((1+RANDOM%COLUMNS))H\033[$((RANDOM%2));3$((RANDOM%8))m$((RANDOM%10))"; sleep 0.1 ; done' # credits to lkj@commandlinefu.com - -# global aliases – like aliases working _behind_ the command -alias -g _C='|wc -l' -alias -g _G='|grep' -alias -g _H='|head' -alias -g _L='|less' -alias -g _N='&>/dev/null' -alias -g _R='| tr A-z N-za-m' -alias -g _T='|tail' -# -# Unbind c-s and c-q -stty -ixon - -# consider emacs keybindings: - -#bindkey -e ## emacs key bindings -# -#bindkey '^[[A' up-line-or-search -#bindkey '^[[B' down-line-or-search -#bindkey '^[^[[C' emacs-forward-word -#bindkey '^[^[[D' emacs-backward-word -# -#bindkey -s '^X^Z' '%-^M' -#bindkey '^[e' expand-cmd-path -#bindkey '^[^I' reverse-menu-complete -#bindkey '^X^N' accept-and-infer-next-history -#bindkey '^W' kill-region -#bindkey '^I' complete-word -## Fix weird sequence that rxvt produces -#bindkey -s '^[[Z' '\t' -# diff --git a/dot.oh-my-zsh/custom/lib/misc.zsh b/dot.oh-my-zsh/custom/lib/misc.zsh deleted file mode 100644 index c6c3de5..0000000 --- a/dot.oh-my-zsh/custom/lib/misc.zsh +++ /dev/null @@ -1,19 +0,0 @@ -## smart urls -autoload -U url-quote-magic -zle -N self-insert url-quote-magic - -## file rename magick -bindkey "^[m" copy-prev-shell-word - -## jobs -setopt long_list_jobs - -## redirect protection -unsetopt clobber - -## pager -export PAGER="less" -export LESS="-R" -export EDITOR="vim" - -export LC_CTYPE=$LANG diff --git a/dot.oh-my-zsh/lib/aliases.zsh b/dot.oh-my-zsh/lib/aliases.zsh deleted file mode 100644 index a7f699c..0000000 --- a/dot.oh-my-zsh/lib/aliases.zsh +++ /dev/null @@ -1,26 +0,0 @@ -# Push and pop directories on directory stack -alias pu='pushd' -alias po='popd' - -# Basic directory operations -alias ...='cd ../..' -alias -- -='cd -' - -# Super user -alias _='sudo' -alias please='sudo' - -#alias g='grep -in' - -# Show history -alias history='fc -l 1' - -# List direcory contents -alias lsa='ls -lah' -alias l='ls -lA1' -alias ll='ls -l' -alias la='ls -lA' -alias sl=ls # often screw this up - -alias afind='ack-grep -il' - diff --git a/dot.oh-my-zsh/lib/completion.zsh b/dot.oh-my-zsh/lib/completion.zsh deleted file mode 100644 index 568590b..0000000 --- a/dot.oh-my-zsh/lib/completion.zsh +++ /dev/null @@ -1,74 +0,0 @@ -# fixme - the load process here seems a bit bizarre - -unsetopt menu_complete # do not autoselect the first completion entry -unsetopt flowcontrol -setopt auto_menu # show completion menu on succesive tab press -setopt complete_in_word -setopt always_to_end - -WORDCHARS='' - -zmodload -i zsh/complist - -## case-insensitive (all),partial-word and then substring completion -if [ "x$CASE_SENSITIVE" = "xtrue" ]; then - zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - unset CASE_SENSITIVE -else - zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' -fi - -zstyle ':completion:*' list-colors '' - -# should this be in keybindings? -bindkey -M menuselect '^o' accept-and-infer-next-history - -zstyle ':completion:*:*:*:*:*' menu select -zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' -#zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" -#zstyle ':completion:*:*:kill:*:processes' command "ps -u `whoami` --forest -e -o pid,user,tty,cmd" -zstyle ':completion:*:*:kill:*:processes' command "ps xfo pid,user,tty,cmd" - -# disable named-directories autocompletion -zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories -cdpath=(.) - -# use /etc/hosts and known_hosts for hostname completion -[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$( /dev/null) || \ - ref=$(git rev-parse --short HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - - -# Checks if working tree is dirty -parse_git_dirty() { - local SUBMODULE_SYNTAX='' - if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then - if [[ $POST_1_7_2_GIT -gt 0 ]]; then - SUBMODULE_SYNTAX="--ignore-submodules=dirty" - fi - if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then - echo "$ZSH_THEME_GIT_PROMPT_DIRTY" - else - echo "$ZSH_THEME_GIT_PROMPT_CLEAN" - fi - fi -} - -# get the difference between the local and remote branches -git_remote_status() { - remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/} - if [[ -n ${remote} ]] ; then - ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) - behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) - - if [ $ahead -eq 0 ] && [ $behind -gt 0 ] - then - echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE" - elif [ $ahead -gt 0 ] && [ $behind -eq 0 ] - then - echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE" - elif [ $ahead -gt 0 ] && [ $behind -gt 0 ] - then - echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" - fi - fi -} - -# Checks if there are commits ahead from remote -function git_prompt_ahead() { - if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then - echo "$ZSH_THEME_GIT_PROMPT_AHEAD" - fi -} - -# Formats prompt string for current git commit short SHA -function git_prompt_short_sha() { - SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" -} - -# Formats prompt string for current git commit long SHA -function git_prompt_long_sha() { - SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" -} - -# Get the status of the working tree -git_prompt_status() { - INDEX=$(git status --porcelain -b 2> /dev/null) - STATUS="" - if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" - fi - if $(echo "$INDEX" | grep '^A ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS" - elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS" - fi - if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - fi - if $(echo "$INDEX" | grep '^R ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS" - fi - if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" - elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" - elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" - fi - if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then - STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS" - fi - if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" - fi - if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS" - fi - if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS" - fi - if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS" - fi - echo $STATUS -} - -#compare the provided version of git to the version installed and on path -#prints 1 if input version <= installed version -#prints -1 otherwise -function git_compare_version() { - local INPUT_GIT_VERSION=$1; - local INSTALLED_GIT_VERSION - INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION}); - INSTALLED_GIT_VERSION=($(git --version)); - INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]}); - - for i in {1..3}; do - if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then - echo -1 - return 0 - fi - done - echo 1 -} - -#this is unlikely to change so make it all statically assigned -POST_1_7_2_GIT=$(git_compare_version "1.7.2") -#clean up the namespace slightly by removing the checker function -unset -f git_compare_version - - diff --git a/dot.oh-my-zsh/lib/grep.zsh b/dot.oh-my-zsh/lib/grep.zsh deleted file mode 100644 index 93c4270..0000000 --- a/dot.oh-my-zsh/lib/grep.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# -# Color grep results -# Examples: http://rubyurl.com/ZXv -# -export GREP_OPTIONS='--color=auto' -export GREP_COLOR='1;32' \ No newline at end of file diff --git a/dot.oh-my-zsh/lib/history.zsh b/dot.oh-my-zsh/lib/history.zsh deleted file mode 120000 index 86772ad..0000000 --- a/dot.oh-my-zsh/lib/history.zsh +++ /dev/null @@ -1 +0,0 @@ -/home/nk/.oh-my-zsh/custom/lib/history.zsh \ No newline at end of file diff --git a/dot.oh-my-zsh/lib/history.zsh.old b/dot.oh-my-zsh/lib/history.zsh.old deleted file mode 100644 index 876936b..0000000 --- a/dot.oh-my-zsh/lib/history.zsh.old +++ /dev/null @@ -1,13 +0,0 @@ -## Command history configuration -HISTFILE=$HOME/.zsh_history -HISTSIZE=10000 -SAVEHIST=10000 - -setopt append_history -setopt extended_history -setopt hist_expire_dups_first -setopt hist_ignore_dups # ignore duplication command history list -setopt hist_ignore_space -setopt hist_verify -setopt inc_append_history -setopt share_history # share command history data diff --git a/dot.oh-my-zsh/lib/key-bindings.zsh b/dot.oh-my-zsh/lib/key-bindings.zsh deleted file mode 120000 index 3efb642..0000000 --- a/dot.oh-my-zsh/lib/key-bindings.zsh +++ /dev/null @@ -1 +0,0 @@ -/home/nk/.oh-my-zsh/custom/lib/key-bindings.zsh \ No newline at end of file diff --git a/dot.oh-my-zsh/lib/key-bindings.zsh.old b/dot.oh-my-zsh/lib/key-bindings.zsh.old deleted file mode 100644 index 5f499f3..0000000 --- a/dot.oh-my-zsh/lib/key-bindings.zsh.old +++ /dev/null @@ -1,50 +0,0 @@ -# TODO: Explain what some of this does.. - -bindkey -e -bindkey '\ew' kill-region -bindkey -s '\el' "ls\n" -bindkey '^r' history-incremental-search-backward -bindkey "^[[5~" up-line-or-history -bindkey "^[[6~" down-line-or-history - -# make search up and down work, so partially type and hit up/down to find relevant stuff -bindkey '^[[A' up-line-or-search -bindkey '^[[B' down-line-or-search - -bindkey "^[[H" beginning-of-line -bindkey "^[[1~" beginning-of-line -bindkey "^[OH" beginning-of-line -bindkey "^[[F" end-of-line -bindkey "^[[4~" end-of-line -bindkey "^[OF" end-of-line -bindkey ' ' magic-space # also do history expansion on space - -bindkey "^[[1;5C" forward-word -bindkey "^[[1;5D" backward-word - -bindkey '^[[Z' reverse-menu-complete - -# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ -bindkey '^?' backward-delete-char -bindkey "^[[3~" delete-char -bindkey "^[3;5~" delete-char -bindkey "\e[3~" delete-char - -# consider emacs keybindings: - -#bindkey -e ## emacs key bindings -# -#bindkey '^[[A' up-line-or-search -#bindkey '^[[B' down-line-or-search -#bindkey '^[^[[C' emacs-forward-word -#bindkey '^[^[[D' emacs-backward-word -# -#bindkey -s '^X^Z' '%-^M' -#bindkey '^[e' expand-cmd-path -#bindkey '^[^I' reverse-menu-complete -#bindkey '^X^N' accept-and-infer-next-history -#bindkey '^W' kill-region -#bindkey '^I' complete-word -## Fix weird sequence that rxvt produces -#bindkey -s '^[[Z' '\t' -# diff --git a/dot.oh-my-zsh/lib/misc.zsh b/dot.oh-my-zsh/lib/misc.zsh deleted file mode 120000 index 526dbd2..0000000 --- a/dot.oh-my-zsh/lib/misc.zsh +++ /dev/null @@ -1 +0,0 @@ -/home/nk/.oh-my-zsh/custom/lib/misc.zsh \ No newline at end of file diff --git a/dot.oh-my-zsh/lib/misc.zsh.old b/dot.oh-my-zsh/lib/misc.zsh.old deleted file mode 100644 index a8678b8..0000000 --- a/dot.oh-my-zsh/lib/misc.zsh.old +++ /dev/null @@ -1,15 +0,0 @@ -## smart urls -autoload -U url-quote-magic -zle -N self-insert url-quote-magic - -## file rename magick -bindkey "^[m" copy-prev-shell-word - -## jobs -setopt long_list_jobs - -## pager -export PAGER="less" -export LESS="-R" - -export LC_CTYPE=$LANG diff --git a/dot.oh-my-zsh/lib/rvm.zsh b/dot.oh-my-zsh/lib/rvm.zsh deleted file mode 100644 index e8744e6..0000000 --- a/dot.oh-my-zsh/lib/rvm.zsh +++ /dev/null @@ -1,8 +0,0 @@ -# get the name of the ruby version -function rvm_prompt_info() { - [ -f $HOME/.rvm/bin/rvm-prompt ] || return - local rvm_prompt - rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null) - [[ "${rvm_prompt}x" == "x" ]] && return - echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}" -} diff --git a/dot.oh-my-zsh/lib/spectrum.zsh b/dot.oh-my-zsh/lib/spectrum.zsh deleted file mode 100644 index 2fdf537..0000000 --- a/dot.oh-my-zsh/lib/spectrum.zsh +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/zsh -# A script to make using 256 colors in zsh less painful. -# P.C. Shyamshankar -# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ - -typeset -Ag FX FG BG - -FX=( - reset "%{%}" - bold "%{%}" no-bold "%{%}" - italic "%{%}" no-italic "%{%}" - underline "%{%}" no-underline "%{%}" - blink "%{%}" no-blink "%{%}" - reverse "%{%}" no-reverse "%{%}" -) - -for color in {000..255}; do - FG[$color]="%{[38;5;${color}m%}" - BG[$color]="%{[48;5;${color}m%}" -done - -# Show all 256 colors with color number -function spectrum_ls() { - for code in {000..255}; do - print -P -- "$code: %F{$code}Test%f" - done -} - diff --git a/dot.oh-my-zsh/lib/termsupport.zsh b/dot.oh-my-zsh/lib/termsupport.zsh deleted file mode 100644 index c056989..0000000 --- a/dot.oh-my-zsh/lib/termsupport.zsh +++ /dev/null @@ -1,35 +0,0 @@ -#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title -#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1 -#Fully support screen, iterm, and probably most modern xterm and rxvt -#Limited support for Apple Terminal (Terminal can't set window or tab separately) -function title { - if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then - return - fi - if [[ "$TERM" == screen* ]]; then - print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars - elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then - print -Pn "\e]2;$2:q\a" #set window name - print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) - fi -} - -ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD -ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" - -#Appears when you have the prompt -function omz_termsupport_precmd { - title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE -} - -#Appears at the beginning of (and during) of command execution -function omz_termsupport_preexec { - emulate -L zsh - setopt extended_glob - local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - title "$CMD" "%100>...>${2:gs/%/%%}%<<" -} - -autoload -U add-zsh-hook -add-zsh-hook precmd omz_termsupport_precmd -add-zsh-hook preexec omz_termsupport_preexec diff --git a/dot.oh-my-zsh/lib/theme-and-appearance.zsh b/dot.oh-my-zsh/lib/theme-and-appearance.zsh deleted file mode 100644 index aec6772..0000000 --- a/dot.oh-my-zsh/lib/theme-and-appearance.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ls colors -autoload colors; colors; -export LSCOLORS="Gxfxcxdxbxegedabagacad" -#export LS_COLORS - -# Enable ls colors -if [ "$DISABLE_LS_COLORS" != "true" ] -then - # Find the option for using colors in ls, depending on the version: Linux or BSD - ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G' -fi - -#setopt no_beep -setopt auto_cd -setopt multios -setopt cdablevarS - -if [[ x$WINDOW != x ]] -then - SCREEN_NO="%B$WINDOW%b " -else - SCREEN_NO="" -fi - -# Apply theming defaults -PS1="%n@%m:%~%# " - -# git theming default: Variables for theming the git info prompt -ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name -ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt -ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty -ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean - -# Setup the prompt with pretty colors -setopt prompt_subst - diff --git a/dot.oh-my-zsh/log/.easter-egg b/dot.oh-my-zsh/log/.easter-egg deleted file mode 100644 index 2533149..0000000 --- a/dot.oh-my-zsh/log/.easter-egg +++ /dev/null @@ -1,4 +0,0 @@ -This file is only here so that Git will keep a log directory as .gitignore is ignoring all the log files within it. - -feel free to add love notes for people here. - diff --git a/dot.oh-my-zsh/oh-my-zsh.sh b/dot.oh-my-zsh/oh-my-zsh.sh deleted file mode 100644 index 689a79f..0000000 --- a/dot.oh-my-zsh/oh-my-zsh.sh +++ /dev/null @@ -1,80 +0,0 @@ -# Check for updates on initial load... -if [ "$DISABLE_AUTO_UPDATE" != "true" ] -then - /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh -fi - -# Initializes Oh My Zsh - -# add a function path -fpath=($ZSH/functions $ZSH/completions $fpath) - -# Load all of the config files in ~/oh-my-zsh that end in .zsh -# TIP: Add files you don't want in git to .gitignore -for config_file ($ZSH/lib/*.zsh); do - source $config_file -done - -# Set ZSH_CUSTOM to the path where your custom config files -# and plugins exists, or else we will use the default custom/ -if [[ -z "$ZSH_CUSTOM" ]]; then - ZSH_CUSTOM="$ZSH/custom" -fi - - -is_plugin() { - local base_dir=$1 - local name=$2 - test -f $base_dir/plugins/$name/$name.plugin.zsh \ - || test -f $base_dir/plugins/$name/_$name -} -# Add all defined plugins to fpath. This must be done -# before running compinit. -for plugin ($plugins); do - if is_plugin $ZSH_CUSTOM $plugin; then - fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) - elif is_plugin $ZSH $plugin; then - fpath=($ZSH/plugins/$plugin $fpath) - fi -done - -# Load and run compinit -autoload -U compinit -compinit -i - - -# Load all of the plugins that were defined in ~/.zshrc -for plugin ($plugins); do - if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then - source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh - elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then - source $ZSH/plugins/$plugin/$plugin.plugin.zsh - fi -done - -# Load all of your custom configurations from custom/ -for config_file ($ZSH_CUSTOM/*.zsh(N)); do - source $config_file -done -unset config_file - -# Load the theme -if [ "$ZSH_THEME" = "random" ] -then - themes=($ZSH/themes/*zsh-theme) - N=${#themes[@]} - ((N=(RANDOM%N)+1)) - RANDOM_THEME=${themes[$N]} - source "$RANDOM_THEME" - echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." -else - if [ ! "$ZSH_THEME" = "" ] - then - if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ] - then - source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" - else - source "$ZSH/themes/$ZSH_THEME.zsh-theme" - fi - fi -fi diff --git a/dot.oh-my-zsh/plugins/ant/ant.plugin.zsh b/dot.oh-my-zsh/plugins/ant/ant.plugin.zsh deleted file mode 100644 index 691d4d2..0000000 --- a/dot.oh-my-zsh/plugins/ant/ant.plugin.zsh +++ /dev/null @@ -1,26 +0,0 @@ -stat -f%m . > /dev/null 2>&1 -if [ "$?" = 0 ]; then - stat_cmd=(stat -f%m) -else - stat_cmd=(stat -L --format=%Y) -fi - -_ant_does_target_list_need_generating () { - if [ ! -f .ant_targets ]; then return 0; - else - accurate=$($stat_cmd .ant_targets) - changed=$($stat_cmd build.xml) - return $(expr $accurate '>=' $changed) - fi -} - -_ant () { - if [ -f build.xml ]; then - if _ant_does_target_list_need_generating; then - sed -n '/ .ant_targets - fi - compadd `cat .ant_targets` - fi -} - -compdef _ant ant diff --git a/dot.oh-my-zsh/plugins/apache2-macports/apache2-macports.plugin.zsh b/dot.oh-my-zsh/plugins/apache2-macports/apache2-macports.plugin.zsh deleted file mode 100644 index 1caa4cf..0000000 --- a/dot.oh-my-zsh/plugins/apache2-macports/apache2-macports.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# commands to control local apache2 server installation -# paths are for osx installation via macports - -alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start' -alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop' -alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart' diff --git a/dot.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh b/dot.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh deleted file mode 100644 index ae92a0b..0000000 --- a/dot.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh +++ /dev/null @@ -1,93 +0,0 @@ -# Archlinux zsh aliases and functions -# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins - -# Look for yaourt, and add some useful functions if we have it. -if [[ -x `which yaourt` ]]; then - upgrade () { - yaourt -Syu - } - alias yaconf='yaourt -C' # Fix all configuration files with vimdiff - # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips - alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. - alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation - alias yain='yaourt -S' # Install specific package(s) from the repositories - alias yains='yaourt -U' # Install specific package not from the repositories but from a file - alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies - alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies - alias yarep='yaourt -Si' # Display information about a given package in the repositories - alias yareps='yaourt -Ss' # Search for package(s) in the repositories - alias yaloc='yaourt -Qi' # Display information about a given package in the local database - alias yalocs='yaourt -Qs' # Search for package(s) in the local database - # Additional yaourt alias examples - if [[ -x `which abs` ]]; then - alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories - else - alias yaupd='yaourt -Sy' # Update and refresh the local package and ABS databases against repositories - fi - alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package - alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist -else - upgrade() { - sudo pacman -Syu - } -fi - -# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips -alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. -alias pacin='sudo pacman -S' # Install specific package(s) from the repositories -alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file -alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies -alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies -alias pacrep='pacman -Si' # Display information about a given package in the repositories -alias pacreps='pacman -Ss' # Search for package(s) in the repositories -alias pacloc='pacman -Qi' # Display information about a given package in the local database -alias paclocs='pacman -Qs' # Search for package(s) in the local database -# Additional pacman alias examples -if [[ -x `which abs` ]]; then - alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories -else - alias pacupd='sudo pacman -Sy' # Update and refresh the local package and ABS databases against repositories -fi -alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package -alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist - -# https://bbs.archlinux.org/viewtopic.php?id=93683 -paclist() { - sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' -} - -alias paclsorphans='sudo pacman -Qdt' -alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)' - -pacdisowned() { - tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$ - db=$tmp/db - fs=$tmp/fs - - mkdir "$tmp" - trap 'rm -rf "$tmp"' EXIT - - pacman -Qlq | sort -u > "$db" - - find /bin /etc /lib /sbin /usr \ - ! -name lost+found \ - \( -type d -printf '%p/\n' -o -print \) | sort > "$fs" - - comm -23 "$fs" "$db" -} - -pacmanallkeys() { - # Get all keys for developers and trusted users - curl https://www.archlinux.org/{developers,trustedusers}/ | - awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' | - xargs sudo pacman-key --recv-keys -} - -pacmansignkeys() { - for key in $*; do - sudo pacman-key --recv-keys $key - sudo pacman-key --lsign-key $key - printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \ - --no-permission-warning --command-fd 0 --edit-key $key - done -} diff --git a/dot.oh-my-zsh/plugins/autojump/autojump.plugin.zsh b/dot.oh-my-zsh/plugins/autojump/autojump.plugin.zsh deleted file mode 100644 index 3894ccd..0000000 --- a/dot.oh-my-zsh/plugins/autojump/autojump.plugin.zsh +++ /dev/null @@ -1,13 +0,0 @@ -if [ $commands[autojump] ]; then # check if autojump is installed - if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package - . /usr/share/autojump/autojump.zsh - elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation - . /etc/profile.d/autojump.zsh - elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation - . $HOME/.autojump/etc/profile.d/autojump.zsh - elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports - . /opt/local/etc/profile.d/autojump.zsh - elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew - . `brew --prefix`/etc/autojump.zsh - fi -fi diff --git a/dot.oh-my-zsh/plugins/battery/battery.plugin.zsh b/dot.oh-my-zsh/plugins/battery/battery.plugin.zsh deleted file mode 100644 index 95f8906..0000000 --- a/dot.oh-my-zsh/plugins/battery/battery.plugin.zsh +++ /dev/null @@ -1,71 +0,0 @@ -########################################### -# Battery plugin for oh-my-zsh # -# Original Author: Peter hoeg (peterhoeg) # -# Email: peter@speartail.com # -########################################### -# Author: Sean Jones (neuralsandwich) # -# Email: neuralsandwich@gmail.com # -# Modified to add support for Apple Mac # -########################################### - -if [[ $(uname) == "Darwin" ]] ; then - - function battery_pct_remaining() { - if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then - typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //') - typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //') - integer i=$(((currentcapacity/maxcapacity) * 100)) - echo $i - else - echo "External Power" - fi - } - - function battery_time_remaining() { - if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then - timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //') - echo "~$((timeremaining / 60)):$((timeremaining % 60))" - else - echo "∞" - fi - } - - function battery_pct_prompt () { - if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then - b=$(battery_pct_remaining) - if [ $b -gt 50 ] ; then - color='green' - elif [ $b -gt 20 ] ; then - color='yellow' - else - color='red' - fi - echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" - else - echo "" - fi - } - -elif [[ $(uname) == "Linux" ]] ; then - - if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then - function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" } - function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') } - function battery_pct_prompt() { - b=$(battery_pct_remaining) - if [ $b -gt 50 ] ; then - color='green' - elif [ $b -gt 20 ] ; then - color='yellow' - else - color='red' - fi - echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" - } - else - error_msg='no battery' - function battery_pct_remaining() { echo $error_msg } - function battery_time_remaining() { echo $error_msg } - function battery_pct_prompt() { echo '' } - fi -fi diff --git a/dot.oh-my-zsh/plugins/brew/_brew b/dot.oh-my-zsh/plugins/brew/_brew deleted file mode 100644 index 1dcf0a4..0000000 --- a/dot.oh-my-zsh/plugins/brew/_brew +++ /dev/null @@ -1,80 +0,0 @@ -#compdef brew -#autoload - -# imported from the latest homebrew contributions - -_brew_all_formulae() { - formulae=(`brew search`) -} - -_brew_installed_formulae() { - installed_formulae=(`brew list`) -} - -local -a _1st_arguments -_1st_arguments=( - 'cat:display formula file for a formula' - 'cleanup:uninstall unused and old versions of packages' - 'create:create a new formula' - 'deps:list dependencies and dependants of a formula' - 'doctor:audits your installation for common issues' - 'edit:edit a formula' - 'home:visit the homepage of a formula or the brew project' - 'info:information about a formula' - 'install:install a formula' - 'link:link a formula' - 'list:list files in a formula or not-installed formulae' - 'log:git commit log for a formula' - 'missing:check all installed formuale for missing dependencies.' - 'outdated:list formulas for which a newer version is available' - 'prune:remove dead links' - 'remove:remove a formula' - 'search:search for a formula (/regex/ or string)' - 'server:start a local web app that lets you browse formulae (requires Sinatra)' - 'unlink:unlink a formula' - 'update:freshen up links' - 'upgrade:upgrade outdated formulae' - 'uses:show formulas which depend on a formula' -) - -local expl -local -a formulae installed_formulae - -_arguments \ - '(-v)-v[verbose]' \ - '(--cellar)--cellar[brew cellar]' \ - '(--config)--config[brew configuration]' \ - '(--env)--env[brew environment]' \ - '(--repository)--repository[brew repository]' \ - '(--version)--version[version information]' \ - '(--prefix)--prefix[where brew lives on this system]' \ - '(--cache)--cache[brew cache]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "brew subcommand" _1st_arguments - return -fi - -case "$words[1]" in - search|-S) - _arguments \ - '(--macports)--macports[search the macports repository]' \ - '(--fink)--fink[search the fink repository]' ;; - list|ls) - _arguments \ - '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ - '(--versions)--versions[list all installed versions of a formula]' \ - '1: :->forms' && return 0 - - if [[ "$state" == forms ]]; then - _brew_installed_formulae - _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae - fi ;; - install|home|homepage|log|info|abv|uses|cat|deps|edit|options) - _brew_all_formulae - _wanted formulae expl 'all formulae' compadd -a formulae ;; - remove|rm|uninstall|unlink|cleanup|link|ln) - _brew_installed_formulae - _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;; -esac diff --git a/dot.oh-my-zsh/plugins/brew/brew.plugin.zsh b/dot.oh-my-zsh/plugins/brew/brew.plugin.zsh deleted file mode 100644 index c2e9588..0000000 --- a/dot.oh-my-zsh/plugins/brew/brew.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -alias brews='brew list -1' diff --git a/dot.oh-my-zsh/plugins/bundler/_bundler b/dot.oh-my-zsh/plugins/bundler/_bundler deleted file mode 100644 index 5d22cac..0000000 --- a/dot.oh-my-zsh/plugins/bundler/_bundler +++ /dev/null @@ -1,82 +0,0 @@ -#compdef bundle - -local curcontext="$curcontext" state line _gems _opts ret=1 - -_arguments -C -A "-v" -A "--version" \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '1: :->cmds' \ - '*:: :->args' && ret=0 - -case $state in - cmds) - _values "bundle command" \ - "install[Install the gems specified by the Gemfile or Gemfile.lock]" \ - "update[Update dependencies to their latest versions]" \ - "package[Package the .gem files required by your application]" \ - "exec[Execute a script in the context of the current bundle]" \ - "config[Specify and read configuration options for bundler]" \ - "check[Determine whether the requirements for your application are installed]" \ - "list[Show all of the gems in the current bundle]" \ - "show[Show the source location of a particular gem in the bundle]" \ - "console[Start an IRB session in the context of the current bundle]" \ - "open[Open an installed gem in the editor]" \ - "viz[Generate a visual representation of your dependencies]" \ - "init[Generate a simple Gemfile, placed in the current directory]" \ - "gem[Create a simple gem, suitable for development with bundler]" \ - "help[Describe available tasks or one specific task]" - ret=0 - ;; - args) - case $line[1] in - help) - _values 'commands' \ - 'install' \ - 'update' \ - 'package' \ - 'exec' \ - 'config' \ - 'check' \ - 'list' \ - 'show' \ - 'console' \ - 'open' \ - 'viz' \ - 'init' \ - 'gem' \ - 'help' && ret=0 - ;; - install) - _arguments \ - '(--no-color)--no-color[disable colorization in output]' \ - '(--local)--local[do not attempt to connect to rubygems.org]' \ - '(--quiet)--quiet[only output warnings and errors]' \ - '(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \ - '(--system)--system[install to the system location]' \ - '(--deployment)--deployment[install using defaults tuned for deployment environments]' \ - '(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \ - '(--path)--path=-[specify a different path than the system default]:path:_files' \ - '(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \ - '(--without)--without=-[exclude gems that are part of the specified named group]:groups' - ret=0 - ;; - exec) - _normal && ret=0 - ;; - (open|show) - _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') ) - if [[ $_gems != "" ]]; then - _values 'gems' $_gems && ret=0 - fi - ;; - *) - _opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) - _opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) - if [[ $_opts != "" ]]; then - _values 'options' $_opts && ret=0 - fi - ;; - esac - ;; -esac - -return ret diff --git a/dot.oh-my-zsh/plugins/bundler/bundler.plugin.zsh b/dot.oh-my-zsh/plugins/bundler/bundler.plugin.zsh deleted file mode 100644 index 10c221a..0000000 --- a/dot.oh-my-zsh/plugins/bundler/bundler.plugin.zsh +++ /dev/null @@ -1,43 +0,0 @@ -alias be="bundle exec" -alias bi="bundle install" -alias bl="bundle list" -alias bp="bundle package" -alias bu="bundle update" - -# The following is based on https://github.com/gma/bundler-exec - -bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus) - -## Functions - -_bundler-installed() { - which bundle > /dev/null 2>&1 -} - -_within-bundled-project() { - local check_dir=$PWD - while [ $check_dir != "/" ]; do - [ -f "$check_dir/Gemfile" ] && return - check_dir="$(dirname $check_dir)" - done - false -} - -_run-with-bundler() { - if _bundler-installed && _within-bundled-project; then - bundle exec $@ - else - $@ - fi -} - -## Main program -for cmd in $bundled_commands; do - eval "function unbundled_$cmd () { $cmd \$@ }" - eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}" - alias $cmd=bundled_$cmd - - if which _$cmd > /dev/null 2>&1; then - compdef _$cmd bundled_$cmd=$cmd - fi -done diff --git a/dot.oh-my-zsh/plugins/bwana/bwana.plugin.zsh b/dot.oh-my-zsh/plugins/bwana/bwana.plugin.zsh deleted file mode 100644 index 455da86..0000000 --- a/dot.oh-my-zsh/plugins/bwana/bwana.plugin.zsh +++ /dev/null @@ -1,13 +0,0 @@ -# -# Requires http://www.bruji.com/bwana/ -# -if [[ -e /Applications/Bwana.app ]] || - ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana ) -then - function man() { - open "man:$1" - } -else - echo "Bwana lets you read man files in Safari through a man: URI scheme" - echo "To use it within Zsh, install it from http://www.bruji.com/bwana/" -fi diff --git a/dot.oh-my-zsh/plugins/cake/cake.plugin.zsh b/dot.oh-my-zsh/plugins/cake/cake.plugin.zsh deleted file mode 100644 index 1d0d196..0000000 --- a/dot.oh-my-zsh/plugins/cake/cake.plugin.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# Set this to 1 if you want to cache the tasks -_cake_cache_task_list=1 - -# Cache filename -_cake_task_cache_file='.cake_task_cache' - -_cake_get_target_list () { - cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' -} - -_cake_does_target_list_need_generating () { - - if [ ${_cake_cache_task_list} -eq 0 ]; then - return 1; - fi - - if [ ! -f ${_cake_task_cache_file} ]; then return 0; - else - accurate=$(stat -f%m $_cake_task_cache_file) - changed=$(stat -f%m Cakefile) - return $(expr $accurate '>=' $changed) - fi -} - -_cake () { - if [ -f Cakefile ]; then - if _cake_does_target_list_need_generating; then - _cake_get_target_list > ${_cake_task_cache_file} - compadd `cat ${_cake_task_cache_file}` - else - compadd `_cake_get_target_list` - fi - fi -} - -compdef _cake cake \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/capistrano/_capistrano b/dot.oh-my-zsh/plugins/capistrano/_capistrano deleted file mode 100644 index cf6b50c..0000000 --- a/dot.oh-my-zsh/plugins/capistrano/_capistrano +++ /dev/null @@ -1,10 +0,0 @@ -#compdef cap -#autoload - -if [ -f config/deploy.rb ]; then - if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then - echo "\nGenerating .cap_tasks~..." > /dev/stderr - cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~ - fi - compadd `cat .cap_tasks~` -fi diff --git a/dot.oh-my-zsh/plugins/cloudapp/cloudapp.plugin.zsh b/dot.oh-my-zsh/plugins/cloudapp/cloudapp.plugin.zsh deleted file mode 100644 index 99252f6..0000000 --- a/dot.oh-my-zsh/plugins/cloudapp/cloudapp.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/zsh -alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb diff --git a/dot.oh-my-zsh/plugins/cloudapp/cloudapp.rb b/dot.oh-my-zsh/plugins/cloudapp/cloudapp.rb deleted file mode 100755 index a11cfdb..0000000 --- a/dot.oh-my-zsh/plugins/cloudapp/cloudapp.rb +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env ruby -# -# cloudapp -# Zach Holman / @holman -# -# Uploads a file from the command line to CloudApp, drops it into your -# clipboard (on a Mac, at least). -# -# Example: -# -# cloudapp drunk-blake.png -# -# This requires Aaron Russell's cloudapp_api gem: -# -# gem install cloudapp_api -# -# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of: -# -# email -# password - -require 'rubygems' -begin - require 'cloudapp_api' -rescue LoadError - puts "You need to install cloudapp_api: gem install cloudapp_api" - exit!(1) -end - -config_file = "#{ENV['HOME']}/.cloudapp" -unless File.exist?(config_file) - puts "You need to type your email and password (one per line) into "+ - "`~/.cloudapp`" - exit!(1) -end - -email,password = File.read(config_file).split("\n") - -class HTTParty::Response - # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU - # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT - def ok? ; true end -end - -if ARGV[0].nil? - puts "You need to specify a file to upload." - exit!(1) -end - -CloudApp.authenticate(email,password) -url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url - -# Say it for good measure. -puts "Uploaded to #{url}." - -# Get the embed link. -url = "#{url}/#{ARGV[0].split('/').last}" - -# Copy it to your (Mac's) clipboard. -`echo '#{url}' | tr -d "\n" | pbcopy` diff --git a/dot.oh-my-zsh/plugins/coffee/_coffee b/dot.oh-my-zsh/plugins/coffee/_coffee deleted file mode 100644 index 5c8eb9a..0000000 --- a/dot.oh-my-zsh/plugins/coffee/_coffee +++ /dev/null @@ -1,71 +0,0 @@ -#compdef coffee -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use 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 the zsh-users nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Coffee.js v0.6.11 (http://coffeejs.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Mario Fernandez (https://github.com/sirech) -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line ret=1 -typeset -A opt_args - -_arguments -C \ - '(- *)'{-h,--help}'[display this help message]' \ - '(- *)'{-v,--version}'[display the version number]' \ - '(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \ - '(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \ - '(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \ - '(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \ - '(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' \ - '(--nodejs)--nodejs[pass options directly to the "node" binary]' \ - '(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \ - '(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \ - '(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \ - '(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \ - '(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \ - '(-r --require)'{-r,--require}'[require a library before executing your script]:library' \ - '(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \ - '(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \ - '*:script or directory:_files' && ret=0 - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/dot.oh-my-zsh/plugins/colemak/colemak-less b/dot.oh-my-zsh/plugins/colemak/colemak-less deleted file mode 100644 index e4ca4fa..0000000 --- a/dot.oh-my-zsh/plugins/colemak/colemak-less +++ /dev/null @@ -1,6 +0,0 @@ -n forw-line -e back-line -k repeat-search -\ek repeat-search-all -K reverse-search -\eK reverse-search-all diff --git a/dot.oh-my-zsh/plugins/colemak/colemak.plugin.zsh b/dot.oh-my-zsh/plugins/colemak/colemak.plugin.zsh deleted file mode 100644 index 34d42c2..0000000 --- a/dot.oh-my-zsh/plugins/colemak/colemak.plugin.zsh +++ /dev/null @@ -1,22 +0,0 @@ -# ctrl-j newline -bindkey '^n' accept-line -bindkey -a '^n' accept-line - -# another rotation to match qwerty -bindkey -a 'n' down-line-or-history -bindkey -a 'e' up-line-or-history -bindkey -a 'i' vi-forward-char - -# make qwerty -bindkey -a 'k' vi-repeat-search -bindkey -a 'K' vi-rev-repeat-search -bindkey -a 'u' vi-insert -bindkey -a 'U' vi-insert-bol -bindkey -a 'l' vi-undo-change -bindkey -a 'N' vi-join - -# spare -bindkey -a 'j' vi-forward-word-end -bindkey -a 'J' vi-forward-blank-word-end - -lesskey $ZSH_CUSTOM/plugins/colemak/colemak-less diff --git a/dot.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh b/dot.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh deleted file mode 100644 index 567da1b..0000000 --- a/dot.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Uses the command-not-found package zsh support -# as seen in http://www.porcheron.info/command-not-found-for-zsh/ -# this is installed in Ubuntu - -[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found diff --git a/dot.oh-my-zsh/plugins/compleat/compleat.plugin.zsh b/dot.oh-my-zsh/plugins/compleat/compleat.plugin.zsh deleted file mode 100644 index 38f1b39..0000000 --- a/dot.oh-my-zsh/plugins/compleat/compleat.plugin.zsh +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: compleat.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.0 -# ------------------------------------------------------------------------------ - -if (( ${+commands[compleat]} )); then - local prefix="${commands[compleat]:h:h}" - local setup="${prefix}/share/compleat-1.0/compleat_setup" - - if [[ -f "$setup" ]]; then - if ! bashcompinit >/dev/null 2>&1; then - autoload -U bashcompinit - bashcompinit -i - fi - - source "$setup" - fi -fi diff --git a/dot.oh-my-zsh/plugins/composer/composer.plugin.zsh b/dot.oh-my-zsh/plugins/composer/composer.plugin.zsh deleted file mode 100644 index c9b762d..0000000 --- a/dot.oh-my-zsh/plugins/composer/composer.plugin.zsh +++ /dev/null @@ -1,29 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: composer.plugin.zsh -# DESCRIPTION: oh-my-zsh composer plugin file. -# AUTHOR: Daniel Gomes (me@danielcsgomes.com) -# VERSION: 1.0.0 -# ------------------------------------------------------------------------------ - -# Composer basic command completion -_composer_get_command_list () { - composer --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' -} - -_composer () { - if [ -f composer.json ]; then - compadd `_composer_get_command_list` - fi -} - -compdef _composer composer - -# Aliases -alias c='composer' -alias csu='composer self-update' -alias cu='composer update' -alias ci='composer install' -alias ccp='composer create-project' - -# install composer in the current directory -alias cget='curl -s https://getcomposer.org/installer | php' \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/cp/cp.plugin.zsh b/dot.oh-my-zsh/plugins/cp/cp.plugin.zsh deleted file mode 100644 index 7355a99..0000000 --- a/dot.oh-my-zsh/plugins/cp/cp.plugin.zsh +++ /dev/null @@ -1,14 +0,0 @@ -#Show progress while file is copying - -# Rsync options are: -# -p - preserve permissions -# -o - preserve owner -# -g - preserve group -# -h - output in human-readable format -# --progress - display progress -# -b - instead of just overwriting an existing file, save the original -# --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync" -# -e /dev/null - only work on local files -# -- - everything after this is an argument, even if it looks like an option - -alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --" diff --git a/dot.oh-my-zsh/plugins/cpanm/_cpanm b/dot.oh-my-zsh/plugins/cpanm/_cpanm deleted file mode 100644 index 58451d3..0000000 --- a/dot.oh-my-zsh/plugins/cpanm/_cpanm +++ /dev/null @@ -1,67 +0,0 @@ -#compdef cpanm - -## -# cpanminus Z Shell completion script -## -# -# Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011) -# -# The latest code is always located at: -# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm -# - -local arguments curcontext="$curcontext" -typeset -A opt_args - - -arguments=( - -# Commands -# '(--install -i)'{--install,-i}'[Installs the modules]' - '(- :)--self-upgrade[Upgrades itself]' - '(- :)--info[Displays distribution info on CPAN]' - '(--installdeps)--installdeps[Only install dependencies]' - '(--look)--look[Download/unpack the distribution and then open the directory with your shell]' - '(- :)'{--help,-h}'[Displays help information]' - '(- :)'{--version,-V}'[Displays software version]' - -# Options - {--force,-f}'[Force install]' - {--notest,-n}'[Do not run unit tests]' - {--sudo,-S}'[sudo to run install commands]' - '(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]' - '(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]' - {--local-lib,-l}'[Specify the install base to install modules]' - {--local-lib-contained,-L}'[Specify the install base to install all non-core modules]' - '--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls' - '--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]' - '--prompt[Prompt when configure/build/test fails]' - '--reinstall[Reinstall the distribution even if you already have the latest version installed]' - '--interactive[Turn on interactive configure]' - - '--scandeps[Scan the depencencies of given modules and output the tree in a text format]' - '--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)' - - '--save-dists[Specify the optional directory path to copy downloaded tarballs]' -# '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]' - - '--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]' - '(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]' - '(--man-pages)--no-man-pages[Do not generate man pages]' - - - # Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP, - # Wget, cURL and HTTP::Tiny (in that order) and uses the first one available. - # (So that the exclusions are not enabled here for the completion) - '(--lwp)--lwp[Use LWP module to download stuff]' - '(--wget)--wget[Use GNU Wget (if available) to download stuff]' - '(--curl)--curl[Use cURL (if available) to download stuff]' - -# Other completions - '*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"' - # '*::args: _normal' # this looks for default files (any files) -) -_arguments -s $arguments \ - && return 0 - -return 1 diff --git a/dot.oh-my-zsh/plugins/debian/debian.plugin.zsh b/dot.oh-my-zsh/plugins/debian/debian.plugin.zsh deleted file mode 100644 index 55b90e3..0000000 --- a/dot.oh-my-zsh/plugins/debian/debian.plugin.zsh +++ /dev/null @@ -1,186 +0,0 @@ -# Authors: -# https://github.com/AlexBio -# https://github.com/dbb -# -# Debian-related zsh aliases and functions for zsh - -# Use aptitude if installed, or apt-get if not. -# You can just set apt_pref='apt-get' to override it. -if [[ -e $( which aptitude 2>&1 ) ]]; then - apt_pref='aptitude' -else - apt_pref='apt-get' -fi - -# Use sudo by default if it's installed -if [[ -e $( which sudo 2>&1 ) ]]; then - use_sudo=1 -fi - -# Aliases ################################################################### -# These are for more obscure uses of apt-get and aptitude that aren't covered -# below. -alias ag='apt-get' -alias ap='aptitude' - -# Some self-explanatory aliases -alias acs="apt-cache search" -alias aps='aptitude search' -alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \ - --no-gui --disable-columns search" # search package - -# apt-file -alias afs='apt-file search --regexp' - - -# These are apt-get only -alias asrc='apt-get source' -alias app='apt-cache policy' - -# superuser operations ###################################################### -if [[ $use_sudo -eq 1 ]]; then -# commands using sudo ####### - alias aac='sudo $apt_pref autoclean' - alias abd='sudo $apt_pref build-dep' - alias ac='sudo $apt_pref clean' - alias ad='sudo $apt_pref update' - alias adg='sudo $apt_pref update && sudo $apt_pref upgrade' - alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade' - alias afu='sudo apt-file update' - alias ag='sudo $apt_pref upgrade' - alias ai='sudo $apt_pref install' - # Install all packages given on the command line while using only the first word of each line: - # acs ... | ail - alias ail="sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install' - alias ap='sudo $apt_pref purge' - alias ar='sudo $apt_pref remove' - - # apt-get only - alias ads='sudo $apt_pref dselect-upgrade' - - # Install all .deb files in the current directory. - # Warning: you will need to put the glob in single quotes if you use: - # glob_subst - alias dia='sudo dpkg -i ./*.deb' - alias di='sudo dpkg -i' - - # Remove ALL kernel images and headers EXCEPT the one in use - alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ - ?not(~n`uname -r`))' - - -# commands using su ######### -else - alias aac='su -ls \'$apt_pref autoclean\' root' - abd() { - cmd="su -lc '$apt_pref build-dep $@' root" - print "$cmd" - eval "$cmd" - } - alias ac='su -ls \'$apt_pref clean\' root' - alias ad='su -lc \'$apt_pref update\' root' - alias adg='su -lc \'$apt_pref update && aptitude safe-upgrade\' root' - alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root' - alias afu='su -lc "apt-file update"' - alias ag='su -lc \'$apt_pref safe-upgrade\' root' - ai() { - cmd="su -lc 'aptitude -P install $@' root" - print "$cmd" - eval "$cmd" - } - ap() { - cmd="su -lc '$apt_pref -P purge $@' root" - print "$cmd" - eval "$cmd" - } - ar() { - cmd="su -lc '$apt_pref -P remove $@' root" - print "$cmd" - eval "$cmd" - } - - # Install all .deb files in the current directory - # Assumes glob_subst is off - alias dia='su -lc "dpkg -i ./*.deb" root' - alias di='su -lc "dpkg -i" root' - - # Remove ALL kernel images and headers EXCEPT the one in use - alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \ - ?not(~n`uname -r`))'\'' root' -fi - - -# Misc. ##################################################################### -# print all installed packages -alias allpkgs='aptitude search -F "%p" --disable-columns ~i' - -# Create a basic .deb package -alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' - - -# Functions ################################################################# -# create a simple script that can be used to 'duplicate' a system -apt-copy() { - print '#!/bin/sh'"\n" > apt-copy.sh - - cmd='$apt_pref install' - - for p in ${(f)"$(aptitude search -F "%p" --disable-columns \~i)"}; { - cmd="${cmd} ${p}" - } - - print $cmd "\n" >> apt-copy.sh - - chmod +x apt-copy.sh -} - -# Prints apt history -# Usage: -# apt-history install -# apt-history upgrade -# apt-history remove -# apt-history rollback -# apt-history list -# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html -apt-history () { - case "$1" in - install) - zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*) - ;; - upgrade|remove) - zgrep --no-filename $1 $(ls -rt /var/log/dpkg*) - ;; - rollback) - zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \ - grep "$2" -A10000000 | \ - grep "$3" -B10000000 | \ - awk '{print $4"="$5}' - ;; - list) - zcat $(ls -rt /var/log/dpkg*) - ;; - *) - echo "Parameters:" - echo " install - Lists all packages that have been installed." - echo " upgrade - Lists all packages that have been upgraded." - echo " remove - Lists all packages that have been removed." - echo " rollback - Lists rollback information." - echo " list - Lists all contains of dpkg logs." - ;; - esac -} - -# Kernel-package building shortcut -kerndeb () { - # temporarily unset MAKEFLAGS ( '-j3' will fail ) - MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) - print '$MAKEFLAGS set to '"'$MAKEFLAGS'" - appendage='-custom' # this shows up in $ (uname -r ) - revision=$(date +"%Y%m%d") # this shows up in the .deb file name - - make-kpkg clean - - time fakeroot make-kpkg --append-to-version "$appendage" --revision \ - "$revision" kernel_image kernel_headers -} - diff --git a/dot.oh-my-zsh/plugins/dircycle/dircycle.plugin.zsh b/dot.oh-my-zsh/plugins/dircycle/dircycle.plugin.zsh deleted file mode 100644 index 46a0ab2..0000000 --- a/dot.oh-my-zsh/plugins/dircycle/dircycle.plugin.zsh +++ /dev/null @@ -1,10 +0,0 @@ -## -# dircycle plugin: enables cycling through the directory -# stack using Ctrl+Shift+Left/Right - -eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }" -zle -N insert-cycledleft -bindkey "\e[1;6D" insert-cycledleft -eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }" -zle -N insert-cycledright -bindkey "\e[1;6C" insert-cycledright diff --git a/dot.oh-my-zsh/plugins/dirpersist/dirpersist.plugin.zsh b/dot.oh-my-zsh/plugins/dirpersist/dirpersist.plugin.zsh deleted file mode 100644 index 0f6d9f4..0000000 --- a/dot.oh-my-zsh/plugins/dirpersist/dirpersist.plugin.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/zsh -# -# Make the dirstack more persistant -# -# Add dirpersist to $plugins in ~/.zshrc to load -# - -# $zdirstore is the file used to persist the stack -zdirstore=~/.zdirstore - -dirpersistinstall () { - if grep 'dirpersiststore' ~/.zlogout > /dev/null; then - else - if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then - echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout - else - echo "If you don't want this message to appear, remove dirspersist from \$plugins" - fi - fi -} - -dirpersiststore () { - dirs -p | perl -e 'foreach (reverse ) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore -} - -dirpersistrestore () { - if [ -f $zdirstore ]; then - source $zdirstore - fi -} - -DIRSTACKSIZE=10 -setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups - -dirpersistinstall -dirpersistrestore - -# Make popd changes permanent without having to wait for logout -alias popd="popd;dirpersiststore" diff --git a/dot.oh-my-zsh/plugins/django/django.plugin.zsh b/dot.oh-my-zsh/plugins/django/django.plugin.zsh deleted file mode 100644 index 0bbd031..0000000 --- a/dot.oh-my-zsh/plugins/django/django.plugin.zsh +++ /dev/null @@ -1,223 +0,0 @@ -#compdef manage.py - -typeset -ga nul_args -nul_args=( - '--settings=-[the Python path to a settings module.]:file:_files' - '--pythonpath=-[a directory to add to the Python path.]::directory:_directories' - '--traceback[print traceback on exception.]' - "--version[show program's version number and exit.]" - {-h,--help}'[show this help message and exit.]' -) - -_managepy-adminindex(){ - _arguments -s : \ - $nul_args \ - '*::directory:_directories' && ret=0 -} - -_managepy-createcachetable(){ - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-dbshell(){ - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-diffsettings(){ - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-dumpdata(){ - _arguments -s : \ - '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \ - '--indent=-[specifies the indent level to use when pretty-printing output.]:' \ - $nul_args \ - '*::appname:_applist' && ret=0 -} - -_managepy-flush(){ - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ - $nul_args && ret=0 -} - -_managepy-help(){ - _arguments -s : \ - '*:command:_managepy_cmds' \ - $nul_args && ret=0 -} - -_managepy_cmds(){ - local line - local -a cmd - _call_program help-command ./manage.py help \ - |& sed -n '/^ /s/[(), ]/ /gp' \ - | while read -A line; do cmd=($line $cmd) done - _describe -t managepy-command 'manage.py command' cmd -} - -_managepy-inspectdb(){ - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-loaddata(){ - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '*::file:_files' \ - $nul_args && ret=0 -} - -_managepy-reset(){ - _arguments -s : \ - '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ - '*::appname:_applist' \ - $nul_args && ret=0 -} - -_managepy-runfcgi(){ - local state - - local fcgi_opts - fcgi_opts=( - 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)' - 'host[hostname to listen on..]:' - 'port[port to listen on.]:' - 'socket[UNIX socket to listen on.]::file:_files' - 'method[prefork or threaded (default prefork)]:method:(prefork threaded)' - 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:' - 'maxspare[max number of spare processes / threads.]:' - 'minspare[min number of spare processes / threads.]:' - 'maxchildren[hard limit number of processes / threads.]:' - 'daemonize[whether to detach from terminal.]:boolean:(False True)' - 'pidfile[write the spawned process-id to this file.]:file:_files' - 'workdir[change to this directory when daemonizing.]:directory:_files' - 'outlog[write stdout to this file.]:file:_files' - 'errlog[write stderr to this file.]:file:_files' - ) - - _arguments -s : \ - $nul_args \ - '*: :_values "FCGI Setting" $fcgi_opts' && ret=0 -} - -_managepy-runserver(){ - _arguments -s : \ - '--noreload[tells Django to NOT use the auto-reloader.]' \ - '--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \ - $nul_args && ret=0 -} - -_managepy-shell(){ - _arguments -s : \ - '--plain[tells Django to use plain Python, not IPython.]' \ - $nul_args && ret=0 -} - -_managepy-sql(){} -_managepy-sqlall(){} -_managepy-sqlclear(){} -_managepy-sqlcustom(){} -_managepy-sqlflush(){} -_managepy-sqlindexes(){} -_managepy-sqlinitialdata(){} -_managepy-sqlreset(){} -_managepy-sqlsequencereset(){} -_managepy-startapp(){} - -_managepy-syncdb() { - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ - $nul_args && ret=0 -} - -_managepy-test() { - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ - '*::appname:_applist' \ - $nul_args && ret=0 -} - -_managepy-testserver() { - _arguments -s : \ - '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ - '--addrport=-[port number or ipaddr:port to run the server on.]' \ - '*::fixture:_files' \ - $nul_args && ret=0 -} - -_managepy-validate() { - _arguments -s : \ - $nul_args && ret=0 -} - -_managepy-commands() { - local -a commands - - commands=( - 'adminindex:prints the admin-index template snippet for the given app name(s).' - 'createcachetable:creates the table needed to use the SQL cache backend.' - 'dbshell:runs the command-line client for the current DATABASE_ENGINE.' - "diffsettings:displays differences between the current settings.py and Django's default settings." - 'dumpdata:Output the contents of the database as a fixture of the given format.' - 'flush:Executes ``sqlflush`` on the current database.' - 'help:manage.py help.' - 'inspectdb:Introspects the database tables in the given database and outputs a Django model module.' - 'loaddata:Installs the named fixture(s) in the database.' - 'reset:Executes ``sqlreset`` for the given app(s) in the current database.' - 'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,' - 'runserver:Starts a lightweight Web server for development.' - 'shell:Runs a Python interactive interpreter.' - 'sql:Prints the CREATE TABLE SQL statements for the given app name(s).' - 'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).' - 'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).' - 'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).' - 'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.' - 'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).' - "sqlinitialdata:RENAMED: see 'sqlcustom'" - 'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).' - 'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).' - "startapp:Creates a Django app directory structure for the given app name in this project's directory." - "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created." - 'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.' - 'testserver:Runs a development server with data from the given fixture(s).' - 'validate:Validates all installed models.' - ) - - _describe -t commands 'manage.py command' commands && ret=0 -} - -_applist() { - local line - local -a apps - _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\ - bn=op.basename(op.abspath(op.curdir));[sys\\ - .stdout.write(str(re.sub(r'^%s\.(.*?)$' % - bn, r'\1', i)) + '\n') for i in django.conf.settings.\\ - INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \ - | while read -A line; do apps=($line $apps) done - _values 'Application' $apps && ret=0 -} - -_managepy() { - local curcontext=$curcontext ret=1 - - if ((CURRENT == 2)); then - _managepy-commands - else - shift words - (( CURRENT -- )) - curcontext="${curcontext%:*:*}:managepy-$words[1]:" - _call_function ret _managepy-$words[1] - fi -} - -compdef _managepy manage.py -compdef _managepy django -compdef _managepy django-manage diff --git a/dot.oh-my-zsh/plugins/encode64/encode64.plugin.zsh b/dot.oh-my-zsh/plugins/encode64/encode64.plugin.zsh deleted file mode 100644 index 3b59447..0000000 --- a/dot.oh-my-zsh/plugins/encode64/encode64.plugin.zsh +++ /dev/null @@ -1,4 +0,0 @@ -encode64(){ echo -n $1 | base64 } -decode64(){ echo -n $1 | base64 -D } -alias e64=encode64 -alias d64=decode64 diff --git a/dot.oh-my-zsh/plugins/extract/_extract b/dot.oh-my-zsh/plugins/extract/_extract deleted file mode 100644 index dca8909..0000000 --- a/dot.oh-my-zsh/plugins/extract/_extract +++ /dev/null @@ -1,8 +0,0 @@ -#compdef extract -#autoload - -_arguments \ - '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 - - diff --git a/dot.oh-my-zsh/plugins/extract/extract.plugin.zsh b/dot.oh-my-zsh/plugins/extract/extract.plugin.zsh deleted file mode 100644 index 5c125e9..0000000 --- a/dot.oh-my-zsh/plugins/extract/extract.plugin.zsh +++ /dev/null @@ -1,80 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: extract.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.1 -# ------------------------------------------------------------------------------ - - -function extract() { - local remove_archive - local success - local file_name - local extract_dir - - if (( $# == 0 )); then - echo "Usage: extract [-option] [file ...]" - echo - echo Options: - echo " -r, --remove Remove archive." - echo - echo "Report bugs to ." - fi - - remove_archive=1 - if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then - remove_archive=0 - shift - fi - - while (( $# > 0 )); do - if [[ ! -f "$1" ]]; then - echo "extract: '$1' is not a valid file" 1>&2 - shift - continue - fi - - success=0 - file_name="$( basename "$1" )" - extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )" - case "$1" in - (*.tar.gz|*.tgz) tar xvzf "$1" ;; - (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; - (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ - && tar --xz -xvf "$1" \ - || xzcat "$1" | tar xvf - ;; - (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \ - && tar --lzma -xvf "$1" \ - || lzcat "$1" | tar xvf - ;; - (*.tar) tar xvf "$1" ;; - (*.gz) gunzip "$1" ;; - (*.bz2) bunzip2 "$1" ;; - (*.xz) unxz "$1" ;; - (*.lzma) unlzma "$1" ;; - (*.Z) uncompress "$1" ;; - (*.zip) unzip "$1" -d $extract_dir ;; - (*.rar) unrar e -ad "$1" ;; - (*.7z) 7za x "$1" ;; - (*.deb) - mkdir -p "$extract_dir/control" - mkdir -p "$extract_dir/data" - cd "$extract_dir"; ar vx "../${1}" > /dev/null - cd control; tar xzvf ../control.tar.gz - cd ../data; tar xzvf ../data.tar.gz - cd ..; rm *.tar.gz debian-binary - cd .. - ;; - (*) - echo "extract: '$1' cannot be extracted" 1>&2 - success=1 - ;; - esac - - (( success = $success > 0 ? $success : $? )) - (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1" - shift - done -} - -alias x=extract - diff --git a/dot.oh-my-zsh/plugins/fasd/fasd.plugin.zsh b/dot.oh-my-zsh/plugins/fasd/fasd.plugin.zsh deleted file mode 100644 index d42584f..0000000 --- a/dot.oh-my-zsh/plugins/fasd/fasd.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -if [ $commands[fasd] ]; then # check if fasd is installed - eval "$(fasd --init auto)" - alias v='f -e vim' - alias o='a -e open' -fi - diff --git a/dot.oh-my-zsh/plugins/forklift/forklift.plugin.zsh b/dot.oh-my-zsh/plugins/forklift/forklift.plugin.zsh deleted file mode 100644 index 056069d..0000000 --- a/dot.oh-my-zsh/plugins/forklift/forklift.plugin.zsh +++ /dev/null @@ -1,44 +0,0 @@ -# Open folder in ForkLift.app from console -# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de -# -# Usage: -# fl [] -# -# Opens specified directory or current working directory in ForkLift.app -# -# Notes: -# It assumes Shift+Cmd+G launches go to folder panel and Cmd+N opens new -# app window. -# -# https://gist.github.com/3313481 -function fl { - if [ ! -z "$1" ]; then - DIR=$1 - if [ ! -d "$DIR" ]; then - DIR=$(dirname $DIR) - fi - if [ "$DIR" != "." ]; then - PWD=`cd "$DIR";pwd` - fi - fi - osascript 2>&1 1>/dev/null <cmds' \ - '*: :->args' && ret=0 - -case $state in - cmds) - cmds=( - "version:Prints Gas's version" - "use:Uses author" - "show:Shows your current user" - "list:Lists your authors" - "import:Imports current user to gasconfig" - "help:Describe available tasks or one specific task" - "delete:Deletes author" - "add:Adds author to gasconfig" - ) - _describe -t commands 'gas command' cmds && ret=0 - ;; - args) - case $line[1] in - (use|delete) - _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 - ;; - esac - ;; -esac - -return ret diff --git a/dot.oh-my-zsh/plugins/gem/_gem b/dot.oh-my-zsh/plugins/gem/_gem deleted file mode 100644 index 83cba40..0000000 --- a/dot.oh-my-zsh/plugins/gem/_gem +++ /dev/null @@ -1,64 +0,0 @@ -#compdef gem -#autoload - -# gem zsh completion, based on homebrew completion - -_gem_installed() { - installed_gems=(`gem list --local --no-versions`) -} - -local -a _1st_arguments -_1st_arguments=( - 'cert:Manage RubyGems certificates and signing settings' - 'check:Check installed gems' - 'cleanup:Clean up old versions of installed gems in the local repository' - 'contents:Display the contents of the installed gems' - 'dependency:Show the dependencies of an installed gem' - 'environment:Display information about the RubyGems environment' - 'fetch:Download a gem and place it in the current directory' - 'generate_index:Generates the index files for a gem server directory' - 'help:Provide help on the `gem` command' - 'install:Install a gem into the local repository' - 'list:Display gems whose name starts with STRING' - 'lock:Generate a lockdown list of gems' - 'mirror:Mirror a gem repository' - 'outdated:Display all gems that need updates' - 'owner:Manage gem owners on RubyGems.org.' - 'pristine:Restores installed gems to pristine condition from files located in the gem cache' - 'push:Push a gem up to RubyGems.org' - 'query:Query gem information in local or remote repositories' - 'rdoc:Generates RDoc for pre-installed gems' - 'search:Display all gems whose name contains STRING' - 'server:Documentation and gem repository HTTP server' - 'sources:Manage the sources and cache file RubyGems uses to search for gems' - 'specification:Display gem specification (in yaml)' - 'stale:List gems along with access times' - 'uninstall:Uninstall gems from the local repository' - 'unpack:Unpack an installed gem to the current directory' - 'update:Update the named gems (or all installed gems) in the local repository' - 'which:Find the location of a library file you can require' -) - -local expl -local -a gems installed_gems - -_arguments \ - '(-v --version)'{-v,--version}'[show version]' \ - '(-h --help)'{-h,--help}'[show help]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "gem subcommand" _1st_arguments - return -fi - -case "$words[1]" in - list) - if [[ "$state" == forms ]]; then - _gem_installed - _requested installed_gems expl 'installed gems' compadd -a installed_gems - fi ;; - uninstall|update) - _gem_installed - _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;; -esac diff --git a/dot.oh-my-zsh/plugins/git-extras/git-extras.plugin.zsh b/dot.oh-my-zsh/plugins/git-extras/git-extras.plugin.zsh deleted file mode 100644 index 8419166..0000000 --- a/dot.oh-my-zsh/plugins/git-extras/git-extras.plugin.zsh +++ /dev/null @@ -1,285 +0,0 @@ -#compdef git -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for git-extras (http://github.com/visionmedia/git-extras). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Alexis GRIMALDI (https://github.com/agrimaldi) -# -# ------------------------------------------------------------------------------ -# Inspirations -# ----------- -# -# * git-extras (http://github.com/visionmedia/git-extras) -# * git-flow-completion (http://github.com/bobthecow/git-flow-completion) -# -# ------------------------------------------------------------------------------ - - -__git_command_successful () { - if (( ${#pipestatus:#0} > 0 )); then - _message 'not a git repository' - return 1 - fi - return 0 -} - - -__git_tag_names() { - local expl - declare -a tag_names - tag_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/}) - __git_command_successful || return - _wanted tag-names expl tag-name compadd $* - $tag_names -} - - -__git_branch_names() { - local expl - declare -a branch_names - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful || return - _wanted branch-names expl branch-name compadd $* - $branch_names -} - - -__git_feature_branch_names() { - local expl - declare -a branch_names - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/}) - __git_command_successful || return - _wanted branch-names expl branch-name compadd $* - $branch_names -} - - -__git_refactor_branch_names() { - local expl - declare -a branch_names - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/}) - __git_command_successful || return - _wanted branch-names expl branch-name compadd $* - $branch_names -} - - -__git_bug_branch_names() { - local expl - declare -a branch_names - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/}) - __git_command_successful || return - _wanted branch-names expl branch-name compadd $* - $branch_names -} - - -__git_submodule_names() { - local expl - declare -a submodule_names - submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"}) - __git_command_successful || return - _wanted submodule-names expl submodule-name compadd $* - $submodule_names -} - - -__git_author_names() { - local expl - declare -a author_names - author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"}) - __git_command_successful || return - _wanted author-names expl author-name compadd $* - $author_names -} - - -_git-changelog() { - _arguments \ - '(-l --list)'{-l,--list}'[list commits]' \ -} - - -_git-effort() { - _arguments \ - '--above[ignore file with less than x commits]' \ -} - - -_git-contrib() { - _arguments \ - ':author:__git_author_names' -} - - -_git-count() { - _arguments \ - '--all[detailed commit count]' -} - - -_git-delete-branch() { - _arguments \ - ':branch-name:__git_branch_names' -} - - -_git-delete-submodule() { - _arguments \ - ':submodule-name:__git_submodule_names' -} - - -_git-delete-tag() { - _arguments \ - ':tag-name:__git_tag_names' -} - - -_git-extras() { - local curcontext=$curcontext state line ret=1 - declare -A opt_args - - _arguments -C \ - ': :->command' \ - '*:: :->option-or-argument' && ret=0 - - case $state in - (command) - declare -a commands - commands=( - 'update:update git-extras' - ) - _describe -t commands command commands && ret=0 - ;; - esac - - _arguments \ - '(-v --version)'{-v,--version}'[show current version]' \ -} - - -_git-graft() { - _arguments \ - ':src-branch-name:__git_branch_names' \ - ':dest-branch-name:__git_branch_names' -} - - -_git-squash() { - _arguments \ - ':branch-name:__git_branch_names' -} - - -_git-feature() { - local curcontext=$curcontext state line ret=1 - declare -A opt_args - - _arguments -C \ - ': :->command' \ - '*:: :->option-or-argument' && ret=0 - - case $state in - (command) - declare -a commands - commands=( - 'finish:merge feature into the current branch' - ) - _describe -t commands command commands && ret=0 - ;; - (option-or-argument) - curcontext=${curcontext%:*}-$line[1]: - case $line[1] in - (finish) - _arguments -C \ - ':branch-name:__git_feature_branch_names' - ;; - esac - esac -} - - -_git-refactor() { - local curcontext=$curcontext state line ret=1 - declare -A opt_args - - _arguments -C \ - ': :->command' \ - '*:: :->option-or-argument' && ret=0 - - case $state in - (command) - declare -a commands - commands=( - 'finish:merge refactor into the current branch' - ) - _describe -t commands command commands && ret=0 - ;; - (option-or-argument) - curcontext=${curcontext%:*}-$line[1]: - case $line[1] in - (finish) - _arguments -C \ - ':branch-name:__git_refactor_branch_names' - ;; - esac - esac -} - - -_git-bug() { - local curcontext=$curcontext state line ret=1 - declare -A opt_args - - _arguments -C \ - ': :->command' \ - '*:: :->option-or-argument' && ret=0 - - case $state in - (command) - declare -a commands - commands=( - 'finish:merge bug into the current branch' - ) - _describe -t commands command commands && ret=0 - ;; - (option-or-argument) - curcontext=${curcontext%:*}-$line[1]: - case $line[1] in - (finish) - _arguments -C \ - ':branch-name:__git_bug_branch_names' - ;; - esac - esac -} - - -zstyle ':completion:*:*:git:*' user-commands \ - changelog:'populate changelog file with commits since the previous tag' \ - contrib:'display author contributions' \ - count:'count commits' \ - delete-branch:'delete local and remote branch' \ - delete-submodule:'delete submodule' \ - delete-tag:'delete local and remote tag' \ - extras:'git-extras' \ - graft:'merge commits from source branch to destination branch' \ - squash:'merge commits from source branch into the current one as a single commit' \ - feature:'create a feature branch' \ - refactor:'create a refactor branch' \ - bug:'create a bug branch' \ - summary:'repository summary' \ - effort:'display effort statistics' \ - repl:'read-eval-print-loop' \ - commits-since:'list commits since a given date' \ - release:'release commit with the given tag' \ - alias:'define, search and show aliases' \ - ignore:'add patterns to .gitignore' \ - info:'show info about the repository' \ - create-branch:'create local and remote branch' \ - fresh-branch:'create empty local branch' \ - undo:'remove the latest commit' \ - setup:'setup a git repository' \ - touch:'one step creation of new files' \ - obliterate:'Completely remove a file from the repository, including past commits and tags' \ - local-commits:'list unpushed commits on the local branch' \ diff --git a/dot.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh b/dot.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh deleted file mode 100644 index ec21019..0000000 --- a/dot.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh +++ /dev/null @@ -1,337 +0,0 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-flow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest verion. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-flow-completion.zsh -# -# c. Or, use this file as a oh-my-zsh plugin. -# - -_git-flow () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'init:Initialize a new git repo with support for the branching model.' - 'feature:Manage your feature branches.' - 'release:Manage your release branches.' - 'hotfix:Manage your hotfix branches.' - 'support:Manage your support branches.' - 'version:Shows version information.' - ) - _describe -t commands 'git flow' subcommands - ;; - - (options) - case $line[1] in - - (init) - _arguments \ - -f'[Force setting of gitflow branches, even if already configured]' - ;; - - (version) - ;; - - (hotfix) - __git-flow-hotfix - ;; - - (release) - __git-flow-release - ;; - - (feature) - __git-flow-feature - ;; - esac - ;; - esac -} - -__git-flow-release () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new release branch.' - 'finish:Finish a release branch.' - 'list:List all your release branches. (Alias to `git flow release`)' - ) - _describe -t commands 'git flow release' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':version:__git_flow_version_list' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - -k'[Keep branch after performing finish]'\ - -n"[Don't tag this release]"\ - ':version:__git_flow_version_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-hotfix () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new hotfix branch.' - 'finish:Finish a hotfix branch.' - 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' - ) - _describe -t commands 'git flow hotfix' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':hotfix:__git_flow_version_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - -k'[Keep branch after performing finish]'\ - -n"[Don't tag this release]"\ - ':hotfix:__git_flow_hotfix_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-feature () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new feature branch.' - 'finish:Finish a feature branch.' - 'list:List all your feature branches. (Alias to `git flow feature`)' - 'publish: publish' - 'track: track' - 'diff: diff' - 'rebase: rebase' - 'checkout: checkout' - 'pull: pull' - ) - _describe -t commands 'git flow feature' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':feature:__git_flow_feature_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - -k'[Keep branch after performing finish]'\ - ':feature:__git_flow_feature_list' - ;; - - (publish) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (track) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (diff) - _arguments \ - ':branch:__git_flow_feature_list'\ - ;; - - (rebase) - _arguments \ - -i'[Do an interactive rebase]' \ - ':branch:__git_flow_feature_list' - ;; - - (checkout) - _arguments \ - ':branch:__git_flow_feature_list'\ - ;; - - (pull) - _arguments \ - ':remote:__git_remotes'\ - ':branch:__git_flow_feature_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git_flow_version_list () -{ - local expl - declare -a versions - - versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted versions expl 'version' compadd $versions -} - -__git_flow_feature_list () -{ - local expl - declare -a features - - features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted features expl 'feature' compadd $features -} - -__git_remotes () { - local expl gitdir remotes - - gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) - __git_command_successful || return - - remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) - __git_command_successful || return - - # TODO: Should combine the two instead of either or. - if (( $#remotes > 0 )); then - _wanted remotes expl remote compadd $* - $remotes - else - _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" - fi -} - -__git_flow_hotfix_list () -{ - local expl - declare -a hotfixes - - hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted hotfixes expl 'hotfix' compadd $hotfixes -} - -__git_branch_names () { - local expl - declare -a branch_names - - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful || return - - _wanted branch-names expl branch-name compadd $* - $branch_names -} - -__git_command_successful () { - if (( ${#pipestatus:#0} > 0 )); then - _message 'not a git repository' - return 1 - fi - return 0 -} - -zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' diff --git a/dot.oh-my-zsh/plugins/git-hubflow/git-hubflow.plugin.zsh b/dot.oh-my-zsh/plugins/git-hubflow/git-hubflow.plugin.zsh deleted file mode 100644 index a09f883..0000000 --- a/dot.oh-my-zsh/plugins/git-hubflow/git-hubflow.plugin.zsh +++ /dev/null @@ -1,348 +0,0 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-hubflow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest verion. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-hubflow-completion.zsh -# -# c. Or, use this file as a oh-my-zsh plugin. -# - -_git-hf () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'init:Initialize a new git repo with support for the branching model.' - 'feature:Manage your feature branches.' - 'release:Manage your release branches.' - 'hotfix:Manage your hotfix branches.' - 'support:Manage your support branches.' - 'update:Pull upstream changes down into your master and develop branches.' - 'version:Shows version information.' - ) - _describe -t commands 'git hf' subcommands - ;; - - (options) - case $line[1] in - - (init) - _arguments \ - -f'[Force setting of gitflow branches, even if already configured]' - ;; - - (version) - ;; - - (hotfix) - __git-hf-hotfix - ;; - - (release) - __git-hf-release - ;; - - (feature) - __git-hf-feature - ;; - esac - ;; - esac -} - -__git-hf-release () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new release branch.' - 'finish:Finish a release branch.' - 'list:List all your release branches. (Alias to `git hf release`)' - 'cancel:Cancel release' - 'push:Push release to github' - 'pull:Pull release from github' - 'track:Track release' - ) - _describe -t commands 'git hf release' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':version:__git_hf_version_list' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - -k'[Keep branch after performing finish]'\ - -n"[Don't tag this release]"\ - ':version:__git_hf_version_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-hf-hotfix () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new hotfix branch.' - 'finish:Finish a hotfix branch.' - 'list:List all your hotfix branches. (Alias to `git hf hotfix`)' - 'publish:Publish the hotfix branch.' - 'track:Track the hotfix branch.' - 'pull:Pull the hotfix from github.' - 'push:Push the hotfix to github.' - 'cancel:Cancel the hotfix.' - ) - _describe -t commands 'git hf hotfix' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':hotfix:__git_hf_version_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - -k'[Keep branch after performing finish]'\ - -n"[Don't tag this release]"\ - ':hotfix:__git_hf_hotfix_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-hf-feature () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'list:List all your feature branches. (Alias to `git hf feature`)' - 'start:Start a new feature branch' - 'finish:Finish a feature branch' - 'submit:submit' - 'track:track' - 'diff:Diff' - 'rebase:Rebase feature branch against develop' - 'checkout:Checkout feature' - 'pull:Pull feature branch from github' - 'push:Push feature branch to github' - 'cancel:Cancel feature' - ) - _describe -t commands 'git hf feature' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':feature:__git_hf_feature_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__git_hf_feature_list' - ;; - - (publish) - _arguments \ - ':feature:__git_hf_feature_list'\ - ;; - - (track) - _arguments \ - ':feature:__git_hf_feature_list'\ - ;; - - (diff) - _arguments \ - ':branch:__git_branch_names'\ - ;; - - (rebase) - _arguments \ - -i'[Do an interactive rebase]' \ - ':branch:__git_branch_names' - ;; - - (checkout) - _arguments \ - ':branch:__git_hf_feature_list'\ - ;; - - (pull) - _arguments \ - ':remote:__git_remotes'\ - ':branch:__git_branch_names' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git_hf_version_list () -{ - local expl - declare -a versions - - versions=(${${(f)"$(_call_program versions git hf release list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted versions expl 'version' compadd $versions -} - -__git_hf_feature_list () -{ - local expl - declare -a features - - features=(${${(f)"$(_call_program features git hf feature list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted features expl 'feature' compadd $features -} - -__git_remotes () { - local expl gitdir remotes - - gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) - __git_command_successful || return - - remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) - __git_command_successful || return - - # TODO: Should combine the two instead of either or. - if (( $#remotes > 0 )); then - _wanted remotes expl remote compadd $* - $remotes - else - _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" - fi -} - -__git_hf_hotfix_list () -{ - local expl - declare -a hotfixes - - hotfixes=(${${(f)"$(_call_program hotfixes git hf hotfix list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted hotfixes expl 'hotfix' compadd $hotfixes -} - -__git_branch_names () { - local expl - declare -a branch_names - - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful || return - - _wanted branch-names expl branch-name compadd $* - $branch_names -} - -__git_command_successful () { - if (( ${#pipestatus:#0} > 0 )); then - _message 'not a git repository' - return 1 - fi - return 0 -} - -zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' diff --git a/dot.oh-my-zsh/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/dot.oh-my-zsh/plugins/git-remote-branch/git-remote-branch.plugin.zsh deleted file mode 100644 index ff98cbf..0000000 --- a/dot.oh-my-zsh/plugins/git-remote-branch/git-remote-branch.plugin.zsh +++ /dev/null @@ -1,18 +0,0 @@ -_git_remote_branch() { - ref=$(git symbolic-ref HEAD 2> /dev/null) - if [[ -n $ref ]]; then - if (( CURRENT == 2 )); then - # first arg: operation - compadd create publish rename delete track - elif (( CURRENT == 3 )); then - # second arg: remote branch name - compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"` - elif (( CURRENT == 4 )); then - # third arg: remote name - compadd `git remote` - fi - else; - _files - fi -} -compdef _git_remote_branch grb diff --git a/dot.oh-my-zsh/plugins/git/git.plugin.zsh b/dot.oh-my-zsh/plugins/git/git.plugin.zsh deleted file mode 100644 index 154aa6d..0000000 --- a/dot.oh-my-zsh/plugins/git/git.plugin.zsh +++ /dev/null @@ -1,93 +0,0 @@ -# Aliases -alias g='git' -compdef g=git -alias gst='git status' -compdef _git gst=git-status -alias gl='git pull' -compdef _git gl=git-pull -alias gup='git pull --rebase' -compdef _git gup=git-fetch -alias gp='git push' -compdef _git gp=git-push -alias gd='git diff' -gdv() { git diff -w "$@" | view - } -compdef _git gdv=git-diff -alias gc='git commit -v' -compdef _git gc=git-commit -alias gca='git commit -v -a' -compdef _git gca=git-commit -alias gco='git checkout' -compdef _git gco=git-checkout -alias gcm='git checkout master' -alias gr='git remote' -compdef _git gr=git-remote -alias grv='git remote -v' -compdef _git grv=git-remote -alias grmv='git remote rename' -compdef _git grmv=git-remote -alias grrm='git remote remove' -compdef _git grrm=git-remote -alias grset='git remote set-url' -compdef _git grset=git-remote -alias grup='git remote update' -compdef _git grset=git-remote -alias gb='git branch' -compdef _git gb=git-branch -alias gba='git branch -a' -compdef _git gba=git-branch -alias gcount='git shortlog -sn' -compdef gcount=git -alias gcl='git config --list' -alias gcp='git cherry-pick' -compdef _git gcp=git-cherry-pick -alias glg='git log --stat --max-count=5' -compdef _git glg=git-log -alias glgg='git log --graph --max-count=5' -compdef _git glgg=git-log -alias glgga='git log --graph --decorate --all' -compdef _git glgga=git-log -alias gss='git status -s' -compdef _git gss=git-status -alias ga='git add' -compdef _git ga=git-add -alias gm='git merge' -compdef _git gm=git-merge -alias grh='git reset HEAD' -alias grhh='git reset HEAD --hard' -alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' -alias gf='git ls-files | grep' -alias gpoat='git push origin --all && git push origin --tags' - -# Will cd into the top of the current repository -# or submodule. -alias grt='cd $(git rev-parse --show-toplevel || echo ".")' - -# Git and svn mix -alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' -compdef git-svn-dcommit-push=git - -alias gsr='git svn rebase' -alias gsd='git svn dcommit' -# -# Will return the current branch name -# Usage example: git pull origin $(current_branch) -# -function current_branch() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || \ - ref=$(git rev-parse --short HEAD 2> /dev/null) || return - echo ${ref#refs/heads/} -} - -function current_repository() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || \ - ref=$(git rev-parse --short HEAD 2> /dev/null) || return - echo $(git remote -v | cut -d':' -f 2) -} - -# these aliases take advantage of the previous function -alias ggpull='git pull origin $(current_branch)' -compdef ggpull=git -alias ggpush='git push origin $(current_branch)' -compdef ggpush=git -alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' -compdef ggpnp=git diff --git a/dot.oh-my-zsh/plugins/gitfast/_git b/dot.oh-my-zsh/plugins/gitfast/_git deleted file mode 100644 index 4577502..0000000 --- a/dot.oh-my-zsh/plugins/gitfast/_git +++ /dev/null @@ -1,78 +0,0 @@ -#compdef git gitk - -# zsh completion wrapper for git -# -# You need git's bash completion script installed somewhere, by default on the -# same directory as this script. -# -# If your script is on ~/.git-completion.sh instead, you can configure it on -# your ~/.zshrc: -# -# zstyle ':completion:*:*:git:*' script ~/.git-completion.sh -# -# The recommended way to install this script is to copy to -# '~/.zsh/completion/_git', and then add the following to your ~/.zshrc file: -# -# fpath=(~/.zsh/completion $fpath) - -complete () -{ - # do nothing - return 0 -} - -zstyle -s ":completion:*:*:git:*" script script -test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash -ZSH_VERSION='' . "$script" - -__gitcomp () -{ - emulate -L zsh - - local cur_="${3-$cur}" - - case "$cur_" in - --*=) - ;; - *) - local c IFS=$' \t\n' - local -a array - for c in ${=1}; do - c="$c${4-}" - case $c in - --*=*|*.) ;; - *) c="$c " ;; - esac - array+=("$c") - done - compset -P '*[=:]' - compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 - ;; - esac -} - -__gitcomp_nl () -{ - emulate -L zsh - - local IFS=$'\n' - compset -P '*[=:]' - compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 -} - -_git () -{ - local _ret=1 - () { - emulate -L ksh - local cur cword prev - cur=${words[CURRENT-1]} - prev=${words[CURRENT-2]} - let cword=CURRENT-1 - __${service}_main - } - let _ret && _default -S '' && _ret=0 - return _ret -} - -_git diff --git a/dot.oh-my-zsh/plugins/gitfast/git-completion.bash b/dot.oh-my-zsh/plugins/gitfast/git-completion.bash deleted file mode 100644 index be800e0..0000000 --- a/dot.oh-my-zsh/plugins/gitfast/git-completion.bash +++ /dev/null @@ -1,2483 +0,0 @@ -#!bash -# -# bash/zsh completion support for core Git. -# -# Copyright (C) 2006,2007 Shawn O. Pearce -# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). -# Distributed under the GNU General Public License, version 2.0. -# -# The contained completion routines provide support for completing: -# -# *) local and remote branch names -# *) local and remote tag names -# *) .git/remotes file names -# *) git 'subcommands' -# *) tree paths within 'ref:path/to/file' expressions -# *) common --long-options -# -# To use these routines: -# -# 1) Copy this file to somewhere (e.g. ~/.git-completion.sh). -# 2) Add the following line to your .bashrc/.zshrc: -# source ~/.git-completion.sh -# 3) Consider changing your PS1 to also show the current branch, -# see git-prompt.sh for details. - -if [[ -n ${ZSH_VERSION-} ]]; then - autoload -U +X bashcompinit && bashcompinit -fi - -case "$COMP_WORDBREAKS" in -*:*) : great ;; -*) COMP_WORDBREAKS="$COMP_WORDBREAKS:" -esac - -# __gitdir accepts 0 or 1 arguments (i.e., location) -# returns location of .git repo -__gitdir () -{ - # Note: this function is duplicated in git-prompt.sh - # When updating it, make sure you update the other one to match. - if [ -z "${1-}" ]; then - if [ -n "${__git_dir-}" ]; then - echo "$__git_dir" - elif [ -n "${GIT_DIR-}" ]; then - test -d "${GIT_DIR-}" || return 1 - echo "$GIT_DIR" - elif [ -d .git ]; then - echo .git - else - git rev-parse --git-dir 2>/dev/null - fi - elif [ -d "$1/.git" ]; then - echo "$1/.git" - else - echo "$1" - fi -} - -__gitcomp_1 () -{ - local c IFS=$' \t\n' - for c in $1; do - c="$c$2" - case $c in - --*=*|*.) ;; - *) c="$c " ;; - esac - printf '%s\n' "$c" - done -} - -# The following function is based on code from: -# -# bash_completion - programmable completion functions for bash 3.2+ -# -# Copyright © 2006-2008, Ian Macdonald -# © 2009-2010, Bash Completion Maintainers -# -# -# 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 2, 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, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# The latest version of this software can be obtained here: -# -# http://bash-completion.alioth.debian.org/ -# -# RELEASE: 2.x - -# This function can be used to access a tokenized list of words -# on the command line: -# -# __git_reassemble_comp_words_by_ref '=:' -# if test "${words_[cword_-1]}" = -w -# then -# ... -# fi -# -# The argument should be a collection of characters from the list of -# word completion separators (COMP_WORDBREAKS) to treat as ordinary -# characters. -# -# This is roughly equivalent to going back in time and setting -# COMP_WORDBREAKS to exclude those characters. The intent is to -# make option types like --date= and : easy to -# recognize by treating each shell word as a single token. -# -# It is best not to set COMP_WORDBREAKS directly because the value is -# shared with other completion scripts. By the time the completion -# function gets called, COMP_WORDS has already been populated so local -# changes to COMP_WORDBREAKS have no effect. -# -# Output: words_, cword_, cur_. - -__git_reassemble_comp_words_by_ref() -{ - local exclude i j first - # Which word separators to exclude? - exclude="${1//[^$COMP_WORDBREAKS]}" - cword_=$COMP_CWORD - if [ -z "$exclude" ]; then - words_=("${COMP_WORDS[@]}") - return - fi - # List of word completion separators has shrunk; - # re-assemble words to complete. - for ((i=0, j=0; i < ${#COMP_WORDS[@]}; i++, j++)); do - # Append each nonempty word consisting of just - # word separator characters to the current word. - first=t - while - [ $i -gt 0 ] && - [ -n "${COMP_WORDS[$i]}" ] && - # word consists of excluded word separators - [ "${COMP_WORDS[$i]//[^$exclude]}" = "${COMP_WORDS[$i]}" ] - do - # Attach to the previous token, - # unless the previous token is the command name. - if [ $j -ge 2 ] && [ -n "$first" ]; then - ((j--)) - fi - first= - words_[$j]=${words_[j]}${COMP_WORDS[i]} - if [ $i = $COMP_CWORD ]; then - cword_=$j - fi - if (($i < ${#COMP_WORDS[@]} - 1)); then - ((i++)) - else - # Done. - return - fi - done - words_[$j]=${words_[j]}${COMP_WORDS[i]} - if [ $i = $COMP_CWORD ]; then - cword_=$j - fi - done -} - -if ! type _get_comp_words_by_ref >/dev/null 2>&1; then -if [[ -z ${ZSH_VERSION:+set} ]]; then -_get_comp_words_by_ref () -{ - local exclude cur_ words_ cword_ - if [ "$1" = "-n" ]; then - exclude=$2 - shift 2 - fi - __git_reassemble_comp_words_by_ref "$exclude" - cur_=${words_[cword_]} - while [ $# -gt 0 ]; do - case "$1" in - cur) - cur=$cur_ - ;; - prev) - prev=${words_[$cword_-1]} - ;; - words) - words=("${words_[@]}") - ;; - cword) - cword=$cword_ - ;; - esac - shift - done -} -else -_get_comp_words_by_ref () -{ - while [ $# -gt 0 ]; do - case "$1" in - cur) - cur=${COMP_WORDS[COMP_CWORD]} - ;; - prev) - prev=${COMP_WORDS[COMP_CWORD-1]} - ;; - words) - words=("${COMP_WORDS[@]}") - ;; - cword) - cword=$COMP_CWORD - ;; - -n) - # assume COMP_WORDBREAKS is already set sanely - shift - ;; - esac - shift - done -} -fi -fi - -# Generates completion reply with compgen, appending a space to possible -# completion words, if necessary. -# It accepts 1 to 4 arguments: -# 1: List of possible completion words. -# 2: A prefix to be added to each possible completion word (optional). -# 3: Generate possible completion matches for this word (optional). -# 4: A suffix to be appended to each possible completion word (optional). -__gitcomp () -{ - local cur_="${3-$cur}" - - case "$cur_" in - --*=) - COMPREPLY=() - ;; - *) - local IFS=$'\n' - COMPREPLY=($(compgen -P "${2-}" \ - -W "$(__gitcomp_1 "${1-}" "${4-}")" \ - -- "$cur_")) - ;; - esac -} - -# Generates completion reply with compgen from newline-separated possible -# completion words by appending a space to all of them. -# It accepts 1 to 4 arguments: -# 1: List of possible completion words, separated by a single newline. -# 2: A prefix to be added to each possible completion word (optional). -# 3: Generate possible completion matches for this word (optional). -# 4: A suffix to be appended to each possible completion word instead of -# the default space (optional). If specified but empty, nothing is -# appended. -__gitcomp_nl () -{ - local IFS=$'\n' - COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}")) -} - -__git_heads () -{ - local dir="$(__gitdir)" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/heads - return - fi -} - -__git_tags () -{ - local dir="$(__gitdir)" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/tags - return - fi -} - -# __git_refs accepts 0, 1 (to pass to __gitdir), or 2 arguments -# presence of 2nd argument means use the guess heuristic employed -# by checkout for tracking branches -__git_refs () -{ - local i hash dir="$(__gitdir "${1-}")" track="${2-}" - local format refs - if [ -d "$dir" ]; then - case "$cur" in - refs|refs/*) - format="refname" - refs="${cur%/*}" - track="" - ;; - *) - for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do - if [ -e "$dir/$i" ]; then echo $i; fi - done - format="refname:short" - refs="refs/tags refs/heads refs/remotes" - ;; - esac - git --git-dir="$dir" for-each-ref --format="%($format)" \ - $refs - if [ -n "$track" ]; then - # employ the heuristic used by git checkout - # Try to find a remote branch that matches the completion word - # but only output if the branch name is unique - local ref entry - git --git-dir="$dir" for-each-ref --shell --format="ref=%(refname:short)" \ - "refs/remotes/" | \ - while read -r entry; do - eval "$entry" - ref="${ref#*/}" - if [[ "$ref" == "$cur"* ]]; then - echo "$ref" - fi - done | uniq -u - fi - return - fi - case "$cur" in - refs|refs/*) - git ls-remote "$dir" "$cur*" 2>/dev/null | \ - while read -r hash i; do - case "$i" in - *^{}) ;; - *) echo "$i" ;; - esac - done - ;; - *) - git ls-remote "$dir" HEAD ORIG_HEAD 'refs/tags/*' 'refs/heads/*' 'refs/remotes/*' 2>/dev/null | \ - while read -r hash i; do - case "$i" in - *^{}) ;; - refs/*) echo "${i#refs/*/}" ;; - *) echo "$i" ;; - esac - done - ;; - esac -} - -# __git_refs2 requires 1 argument (to pass to __git_refs) -__git_refs2 () -{ - local i - for i in $(__git_refs "$1"); do - echo "$i:$i" - done -} - -# __git_refs_remotes requires 1 argument (to pass to ls-remote) -__git_refs_remotes () -{ - local i hash - git ls-remote "$1" 'refs/heads/*' 2>/dev/null | \ - while read -r hash i; do - echo "$i:refs/remotes/$1/${i#refs/heads/}" - done -} - -__git_remotes () -{ - local i IFS=$'\n' d="$(__gitdir)" - test -d "$d/remotes" && ls -1 "$d/remotes" - for i in $(git --git-dir="$d" config --get-regexp 'remote\..*\.url' 2>/dev/null); do - i="${i#remote.}" - echo "${i/.url*/}" - done -} - -__git_list_merge_strategies () -{ - git merge -s help 2>&1 | - sed -n -e '/[Aa]vailable strategies are: /,/^$/{ - s/\.$// - s/.*:// - s/^[ ]*// - s/[ ]*$// - p - }' -} - -__git_merge_strategies= -# 'git merge -s help' (and thus detection of the merge strategy -# list) fails, unfortunately, if run outside of any git working -# tree. __git_merge_strategies is set to the empty string in -# that case, and the detection will be repeated the next time it -# is needed. -__git_compute_merge_strategies () -{ - test -n "$__git_merge_strategies" || - __git_merge_strategies=$(__git_list_merge_strategies) -} - -__git_complete_revlist_file () -{ - local pfx ls ref cur_="$cur" - case "$cur_" in - *..?*:*) - return - ;; - ?*:*) - ref="${cur_%%:*}" - cur_="${cur_#*:}" - case "$cur_" in - ?*/*) - pfx="${cur_%/*}" - cur_="${cur_##*/}" - ls="$ref:$pfx" - pfx="$pfx/" - ;; - *) - ls="$ref" - ;; - esac - - case "$COMP_WORDBREAKS" in - *:*) : great ;; - *) pfx="$ref:$pfx" ;; - esac - - __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \ - | sed '/^100... blob /{ - s,^.* ,, - s,$, , - } - /^120000 blob /{ - s,^.* ,, - s,$, , - } - /^040000 tree /{ - s,^.* ,, - s,$,/, - } - s/^.* //')" \ - "$pfx" "$cur_" "" - ;; - *...*) - pfx="${cur_%...*}..." - cur_="${cur_#*...}" - __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" - ;; - *..*) - pfx="${cur_%..*}.." - cur_="${cur_#*..}" - __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" - ;; - *) - __gitcomp_nl "$(__git_refs)" - ;; - esac -} - - -__git_complete_file () -{ - __git_complete_revlist_file -} - -__git_complete_revlist () -{ - __git_complete_revlist_file -} - -__git_complete_remote_or_refspec () -{ - local cur_="$cur" cmd="${words[1]}" - local i c=2 remote="" pfx="" lhs=1 no_complete_refspec=0 - if [ "$cmd" = "remote" ]; then - ((c++)) - fi - while [ $c -lt $cword ]; do - i="${words[c]}" - case "$i" in - --mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;; - --all) - case "$cmd" in - push) no_complete_refspec=1 ;; - fetch) - COMPREPLY=() - return - ;; - *) ;; - esac - ;; - -*) ;; - *) remote="$i"; break ;; - esac - ((c++)) - done - if [ -z "$remote" ]; then - __gitcomp_nl "$(__git_remotes)" - return - fi - if [ $no_complete_refspec = 1 ]; then - COMPREPLY=() - return - fi - [ "$remote" = "." ] && remote= - case "$cur_" in - *:*) - case "$COMP_WORDBREAKS" in - *:*) : great ;; - *) pfx="${cur_%%:*}:" ;; - esac - cur_="${cur_#*:}" - lhs=0 - ;; - +*) - pfx="+" - cur_="${cur_#+}" - ;; - esac - case "$cmd" in - fetch) - if [ $lhs = 1 ]; then - __gitcomp_nl "$(__git_refs2 "$remote")" "$pfx" "$cur_" - else - __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" - fi - ;; - pull|remote) - if [ $lhs = 1 ]; then - __gitcomp_nl "$(__git_refs "$remote")" "$pfx" "$cur_" - else - __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" - fi - ;; - push) - if [ $lhs = 1 ]; then - __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" - else - __gitcomp_nl "$(__git_refs "$remote")" "$pfx" "$cur_" - fi - ;; - esac -} - -__git_complete_strategy () -{ - __git_compute_merge_strategies - case "$prev" in - -s|--strategy) - __gitcomp "$__git_merge_strategies" - return 0 - esac - case "$cur" in - --strategy=*) - __gitcomp "$__git_merge_strategies" "" "${cur##--strategy=}" - return 0 - ;; - esac - return 1 -} - -__git_list_all_commands () -{ - local i IFS=" "$'\n' - for i in $(git help -a|egrep '^ [a-zA-Z0-9]') - do - case $i in - *--*) : helper pattern;; - *) echo $i;; - esac - done -} - -__git_all_commands= -__git_compute_all_commands () -{ - test -n "$__git_all_commands" || - __git_all_commands=$(__git_list_all_commands) -} - -__git_list_porcelain_commands () -{ - local i IFS=" "$'\n' - __git_compute_all_commands - for i in "help" $__git_all_commands - do - case $i in - *--*) : helper pattern;; - applymbox) : ask gittus;; - applypatch) : ask gittus;; - archimport) : import;; - cat-file) : plumbing;; - check-attr) : plumbing;; - check-ref-format) : plumbing;; - checkout-index) : plumbing;; - commit-tree) : plumbing;; - count-objects) : infrequent;; - credential-cache) : credentials helper;; - credential-store) : credentials helper;; - cvsexportcommit) : export;; - cvsimport) : import;; - cvsserver) : daemon;; - daemon) : daemon;; - diff-files) : plumbing;; - diff-index) : plumbing;; - diff-tree) : plumbing;; - fast-import) : import;; - fast-export) : export;; - fsck-objects) : plumbing;; - fetch-pack) : plumbing;; - fmt-merge-msg) : plumbing;; - for-each-ref) : plumbing;; - hash-object) : plumbing;; - http-*) : transport;; - index-pack) : plumbing;; - init-db) : deprecated;; - local-fetch) : plumbing;; - lost-found) : infrequent;; - ls-files) : plumbing;; - ls-remote) : plumbing;; - ls-tree) : plumbing;; - mailinfo) : plumbing;; - mailsplit) : plumbing;; - merge-*) : plumbing;; - mktree) : plumbing;; - mktag) : plumbing;; - pack-objects) : plumbing;; - pack-redundant) : plumbing;; - pack-refs) : plumbing;; - parse-remote) : plumbing;; - patch-id) : plumbing;; - peek-remote) : plumbing;; - prune) : plumbing;; - prune-packed) : plumbing;; - quiltimport) : import;; - read-tree) : plumbing;; - receive-pack) : plumbing;; - remote-*) : transport;; - repo-config) : deprecated;; - rerere) : plumbing;; - rev-list) : plumbing;; - rev-parse) : plumbing;; - runstatus) : plumbing;; - sh-setup) : internal;; - shell) : daemon;; - show-ref) : plumbing;; - send-pack) : plumbing;; - show-index) : plumbing;; - ssh-*) : transport;; - stripspace) : plumbing;; - symbolic-ref) : plumbing;; - tar-tree) : deprecated;; - unpack-file) : plumbing;; - unpack-objects) : plumbing;; - update-index) : plumbing;; - update-ref) : plumbing;; - update-server-info) : daemon;; - upload-archive) : plumbing;; - upload-pack) : plumbing;; - write-tree) : plumbing;; - var) : infrequent;; - verify-pack) : infrequent;; - verify-tag) : plumbing;; - *) echo $i;; - esac - done -} - -__git_porcelain_commands= -__git_compute_porcelain_commands () -{ - __git_compute_all_commands - test -n "$__git_porcelain_commands" || - __git_porcelain_commands=$(__git_list_porcelain_commands) -} - -__git_pretty_aliases () -{ - local i IFS=$'\n' - for i in $(git --git-dir="$(__gitdir)" config --get-regexp "pretty\..*" 2>/dev/null); do - case "$i" in - pretty.*) - i="${i#pretty.}" - echo "${i/ */}" - ;; - esac - done -} - -__git_aliases () -{ - local i IFS=$'\n' - for i in $(git --git-dir="$(__gitdir)" config --get-regexp "alias\..*" 2>/dev/null); do - case "$i" in - alias.*) - i="${i#alias.}" - echo "${i/ */}" - ;; - esac - done -} - -# __git_aliased_command requires 1 argument -__git_aliased_command () -{ - local word cmdline=$(git --git-dir="$(__gitdir)" \ - config --get "alias.$1") - for word in $cmdline; do - case "$word" in - \!gitk|gitk) - echo "gitk" - return - ;; - \!*) : shell command alias ;; - -*) : option ;; - *=*) : setting env ;; - git) : git itself ;; - *) - echo "$word" - return - esac - done -} - -# __git_find_on_cmdline requires 1 argument -__git_find_on_cmdline () -{ - local word subcommand c=1 - while [ $c -lt $cword ]; do - word="${words[c]}" - for subcommand in $1; do - if [ "$subcommand" = "$word" ]; then - echo "$subcommand" - return - fi - done - ((c++)) - done -} - -__git_has_doubledash () -{ - local c=1 - while [ $c -lt $cword ]; do - if [ "--" = "${words[c]}" ]; then - return 0 - fi - ((c++)) - done - return 1 -} - -__git_whitespacelist="nowarn warn error error-all fix" - -_git_am () -{ - local dir="$(__gitdir)" - if [ -d "$dir"/rebase-apply ]; then - __gitcomp "--skip --continue --resolved --abort" - return - fi - case "$cur" in - --whitespace=*) - __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" - return - ;; - --*) - __gitcomp " - --3way --committer-date-is-author-date --ignore-date - --ignore-whitespace --ignore-space-change - --interactive --keep --no-utf8 --signoff --utf8 - --whitespace= --scissors - " - return - esac - COMPREPLY=() -} - -_git_apply () -{ - case "$cur" in - --whitespace=*) - __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" - return - ;; - --*) - __gitcomp " - --stat --numstat --summary --check --index - --cached --index-info --reverse --reject --unidiff-zero - --apply --no-add --exclude= - --ignore-whitespace --ignore-space-change - --whitespace= --inaccurate-eof --verbose - " - return - esac - COMPREPLY=() -} - -_git_add () -{ - __git_has_doubledash && return - - case "$cur" in - --*) - __gitcomp " - --interactive --refresh --patch --update --dry-run - --ignore-errors --intent-to-add - " - return - esac - COMPREPLY=() -} - -_git_archive () -{ - case "$cur" in - --format=*) - __gitcomp "$(git archive --list)" "" "${cur##--format=}" - return - ;; - --remote=*) - __gitcomp_nl "$(__git_remotes)" "" "${cur##--remote=}" - return - ;; - --*) - __gitcomp " - --format= --list --verbose - --prefix= --remote= --exec= - " - return - ;; - esac - __git_complete_file -} - -_git_bisect () -{ - __git_has_doubledash && return - - local subcommands="start bad good skip reset visualize replay log run" - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - if [ -f "$(__gitdir)"/BISECT_START ]; then - __gitcomp "$subcommands" - else - __gitcomp "replay start" - fi - return - fi - - case "$subcommand" in - bad|good|reset|skip|start) - __gitcomp_nl "$(__git_refs)" - ;; - *) - COMPREPLY=() - ;; - esac -} - -_git_branch () -{ - local i c=1 only_local_ref="n" has_r="n" - - while [ $c -lt $cword ]; do - i="${words[c]}" - case "$i" in - -d|-m) only_local_ref="y" ;; - -r) has_r="y" ;; - esac - ((c++)) - done - - case "$cur" in - --set-upstream-to=*) - __gitcomp "$(__git_refs)" "" "${cur##--set-upstream-to=}" - ;; - --*) - __gitcomp " - --color --no-color --verbose --abbrev= --no-abbrev - --track --no-track --contains --merged --no-merged - --set-upstream-to= --edit-description --list - --unset-upstream - " - ;; - *) - if [ $only_local_ref = "y" -a $has_r = "n" ]; then - __gitcomp_nl "$(__git_heads)" - else - __gitcomp_nl "$(__git_refs)" - fi - ;; - esac -} - -_git_bundle () -{ - local cmd="${words[2]}" - case "$cword" in - 2) - __gitcomp "create list-heads verify unbundle" - ;; - 3) - # looking for a file - ;; - *) - case "$cmd" in - create) - __git_complete_revlist - ;; - esac - ;; - esac -} - -_git_checkout () -{ - __git_has_doubledash && return - - case "$cur" in - --conflict=*) - __gitcomp "diff3 merge" "" "${cur##--conflict=}" - ;; - --*) - __gitcomp " - --quiet --ours --theirs --track --no-track --merge - --conflict= --orphan --patch - " - ;; - *) - # check if --track, --no-track, or --no-guess was specified - # if so, disable DWIM mode - local flags="--track --no-track --no-guess" track=1 - if [ -n "$(__git_find_on_cmdline "$flags")" ]; then - track='' - fi - __gitcomp_nl "$(__git_refs '' $track)" - ;; - esac -} - -_git_cherry () -{ - __gitcomp "$(__git_refs)" -} - -_git_cherry_pick () -{ - case "$cur" in - --*) - __gitcomp "--edit --no-commit" - ;; - *) - __gitcomp_nl "$(__git_refs)" - ;; - esac -} - -_git_clean () -{ - __git_has_doubledash && return - - case "$cur" in - --*) - __gitcomp "--dry-run --quiet" - return - ;; - esac - COMPREPLY=() -} - -_git_clone () -{ - case "$cur" in - --*) - __gitcomp " - --local - --no-hardlinks - --shared - --reference - --quiet - --no-checkout - --bare - --mirror - --origin - --upload-pack - --template= - --depth - " - return - ;; - esac - COMPREPLY=() -} - -_git_commit () -{ - __git_has_doubledash && return - - case "$cur" in - --cleanup=*) - __gitcomp "default strip verbatim whitespace - " "" "${cur##--cleanup=}" - return - ;; - --reuse-message=*|--reedit-message=*|\ - --fixup=*|--squash=*) - __gitcomp_nl "$(__git_refs)" "" "${cur#*=}" - return - ;; - --untracked-files=*) - __gitcomp "all no normal" "" "${cur##--untracked-files=}" - return - ;; - --*) - __gitcomp " - --all --author= --signoff --verify --no-verify - --edit --no-edit - --amend --include --only --interactive - --dry-run --reuse-message= --reedit-message= - --reset-author --file= --message= --template= - --cleanup= --untracked-files --untracked-files= - --verbose --quiet --fixup= --squash= - " - return - esac - COMPREPLY=() -} - -_git_describe () -{ - case "$cur" in - --*) - __gitcomp " - --all --tags --contains --abbrev= --candidates= - --exact-match --debug --long --match --always - " - return - esac - __gitcomp_nl "$(__git_refs)" -} - -__git_diff_common_options="--stat --numstat --shortstat --summary - --patch-with-stat --name-only --name-status --color - --no-color --color-words --no-renames --check - --full-index --binary --abbrev --diff-filter= - --find-copies-harder - --text --ignore-space-at-eol --ignore-space-change - --ignore-all-space --exit-code --quiet --ext-diff - --no-ext-diff - --no-prefix --src-prefix= --dst-prefix= - --inter-hunk-context= - --patience - --raw - --dirstat --dirstat= --dirstat-by-file - --dirstat-by-file= --cumulative -" - -_git_diff () -{ - __git_has_doubledash && return - - case "$cur" in - --*) - __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex - --base --ours --theirs --no-index - $__git_diff_common_options - " - return - ;; - esac - __git_complete_revlist_file -} - -__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff - tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare -" - -_git_difftool () -{ - __git_has_doubledash && return - - case "$cur" in - --tool=*) - __gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}" - return - ;; - --*) - __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex - --base --ours --theirs - --no-renames --diff-filter= --find-copies-harder - --relative --ignore-submodules - --tool=" - return - ;; - esac - __git_complete_file -} - -__git_fetch_options=" - --quiet --verbose --append --upload-pack --force --keep --depth= - --tags --no-tags --all --prune --dry-run -" - -_git_fetch () -{ - case "$cur" in - --*) - __gitcomp "$__git_fetch_options" - return - ;; - esac - __git_complete_remote_or_refspec -} - -_git_format_patch () -{ - case "$cur" in - --thread=*) - __gitcomp " - deep shallow - " "" "${cur##--thread=}" - return - ;; - --*) - __gitcomp " - --stdout --attach --no-attach --thread --thread= - --output-directory - --numbered --start-number - --numbered-files - --keep-subject - --signoff --signature --no-signature - --in-reply-to= --cc= - --full-index --binary - --not --all - --cover-letter - --no-prefix --src-prefix= --dst-prefix= - --inline --suffix= --ignore-if-in-upstream - --subject-prefix= - " - return - ;; - esac - __git_complete_revlist -} - -_git_fsck () -{ - case "$cur" in - --*) - __gitcomp " - --tags --root --unreachable --cache --no-reflogs --full - --strict --verbose --lost-found - " - return - ;; - esac - COMPREPLY=() -} - -_git_gc () -{ - case "$cur" in - --*) - __gitcomp "--prune --aggressive" - return - ;; - esac - COMPREPLY=() -} - -_git_gitk () -{ - _gitk -} - -__git_match_ctag() { - awk "/^${1////\\/}/ { print \$1 }" "$2" -} - -_git_grep () -{ - __git_has_doubledash && return - - case "$cur" in - --*) - __gitcomp " - --cached - --text --ignore-case --word-regexp --invert-match - --full-name --line-number - --extended-regexp --basic-regexp --fixed-strings - --perl-regexp - --files-with-matches --name-only - --files-without-match - --max-depth - --count - --and --or --not --all-match - " - return - ;; - esac - - case "$cword,$prev" in - 2,*|*,-*) - if test -r tags; then - __gitcomp_nl "$(__git_match_ctag "$cur" tags)" - return - fi - ;; - esac - - __gitcomp_nl "$(__git_refs)" -} - -_git_help () -{ - case "$cur" in - --*) - __gitcomp "--all --info --man --web" - return - ;; - esac - __git_compute_all_commands - __gitcomp "$__git_all_commands $(__git_aliases) - attributes cli core-tutorial cvs-migration - diffcore gitk glossary hooks ignore modules - namespaces repository-layout tutorial tutorial-2 - workflows - " -} - -_git_init () -{ - case "$cur" in - --shared=*) - __gitcomp " - false true umask group all world everybody - " "" "${cur##--shared=}" - return - ;; - --*) - __gitcomp "--quiet --bare --template= --shared --shared=" - return - ;; - esac - COMPREPLY=() -} - -_git_ls_files () -{ - __git_has_doubledash && return - - case "$cur" in - --*) - __gitcomp "--cached --deleted --modified --others --ignored - --stage --directory --no-empty-directory --unmerged - --killed --exclude= --exclude-from= - --exclude-per-directory= --exclude-standard - --error-unmatch --with-tree= --full-name - --abbrev --ignored --exclude-per-directory - " - return - ;; - esac - COMPREPLY=() -} - -_git_ls_remote () -{ - __gitcomp_nl "$(__git_remotes)" -} - -_git_ls_tree () -{ - __git_complete_file -} - -# Options that go well for log, shortlog and gitk -__git_log_common_options=" - --not --all - --branches --tags --remotes - --first-parent --merges --no-merges - --max-count= - --max-age= --since= --after= - --min-age= --until= --before= - --min-parents= --max-parents= - --no-min-parents --no-max-parents -" -# Options that go well for log and gitk (not shortlog) -__git_log_gitk_options=" - --dense --sparse --full-history - --simplify-merges --simplify-by-decoration - --left-right --notes --no-notes -" -# Options that go well for log and shortlog (not gitk) -__git_log_shortlog_options=" - --author= --committer= --grep= - --all-match -" - -__git_log_pretty_formats="oneline short medium full fuller email raw format:" -__git_log_date_formats="relative iso8601 rfc2822 short local default raw" - -_git_log () -{ - __git_has_doubledash && return - - local g="$(git rev-parse --git-dir 2>/dev/null)" - local merge="" - if [ -f "$g/MERGE_HEAD" ]; then - merge="--merge" - fi - case "$cur" in - --pretty=*|--format=*) - __gitcomp "$__git_log_pretty_formats $(__git_pretty_aliases) - " "" "${cur#*=}" - return - ;; - --date=*) - __gitcomp "$__git_log_date_formats" "" "${cur##--date=}" - return - ;; - --decorate=*) - __gitcomp "long short" "" "${cur##--decorate=}" - return - ;; - --*) - __gitcomp " - $__git_log_common_options - $__git_log_shortlog_options - $__git_log_gitk_options - --root --topo-order --date-order --reverse - --follow --full-diff - --abbrev-commit --abbrev= - --relative-date --date= - --pretty= --format= --oneline - --cherry-pick - --graph - --decorate --decorate= - --walk-reflogs - --parents --children - $merge - $__git_diff_common_options - --pickaxe-all --pickaxe-regex - " - return - ;; - esac - __git_complete_revlist -} - -__git_merge_options=" - --no-commit --no-stat --log --no-log --squash --strategy - --commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit -" - -_git_merge () -{ - __git_complete_strategy && return - - case "$cur" in - --*) - __gitcomp "$__git_merge_options" - return - esac - __gitcomp_nl "$(__git_refs)" -} - -_git_mergetool () -{ - case "$cur" in - --tool=*) - __gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}" - return - ;; - --*) - __gitcomp "--tool=" - return - ;; - esac - COMPREPLY=() -} - -_git_merge_base () -{ - __gitcomp_nl "$(__git_refs)" -} - -_git_mv () -{ - case "$cur" in - --*) - __gitcomp "--dry-run" - return - ;; - esac - COMPREPLY=() -} - -_git_name_rev () -{ - __gitcomp "--tags --all --stdin" -} - -_git_notes () -{ - local subcommands='add append copy edit list prune remove show' - local subcommand="$(__git_find_on_cmdline "$subcommands")" - - case "$subcommand,$cur" in - ,--*) - __gitcomp '--ref' - ;; - ,*) - case "$prev" in - --ref) - __gitcomp_nl "$(__git_refs)" - ;; - *) - __gitcomp "$subcommands --ref" - ;; - esac - ;; - add,--reuse-message=*|append,--reuse-message=*|\ - add,--reedit-message=*|append,--reedit-message=*) - __gitcomp_nl "$(__git_refs)" "" "${cur#*=}" - ;; - add,--*|append,--*) - __gitcomp '--file= --message= --reedit-message= - --reuse-message=' - ;; - copy,--*) - __gitcomp '--stdin' - ;; - prune,--*) - __gitcomp '--dry-run --verbose' - ;; - prune,*) - ;; - *) - case "$prev" in - -m|-F) - ;; - *) - __gitcomp_nl "$(__git_refs)" - ;; - esac - ;; - esac -} - -_git_pull () -{ - __git_complete_strategy && return - - case "$cur" in - --*) - __gitcomp " - --rebase --no-rebase - $__git_merge_options - $__git_fetch_options - " - return - ;; - esac - __git_complete_remote_or_refspec -} - -_git_push () -{ - case "$prev" in - --repo) - __gitcomp_nl "$(__git_remotes)" - return - esac - case "$cur" in - --repo=*) - __gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}" - return - ;; - --*) - __gitcomp " - --all --mirror --tags --dry-run --force --verbose - --receive-pack= --repo= --set-upstream - " - return - ;; - esac - __git_complete_remote_or_refspec -} - -_git_rebase () -{ - local dir="$(__gitdir)" - if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then - __gitcomp "--continue --skip --abort" - return - fi - __git_complete_strategy && return - case "$cur" in - --whitespace=*) - __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" - return - ;; - --*) - __gitcomp " - --onto --merge --strategy --interactive - --preserve-merges --stat --no-stat - --committer-date-is-author-date --ignore-date - --ignore-whitespace --whitespace= - --autosquash - " - - return - esac - __gitcomp_nl "$(__git_refs)" -} - -_git_reflog () -{ - local subcommands="show delete expire" - local subcommand="$(__git_find_on_cmdline "$subcommands")" - - if [ -z "$subcommand" ]; then - __gitcomp "$subcommands" - else - __gitcomp_nl "$(__git_refs)" - fi -} - -__git_send_email_confirm_options="always never auto cc compose" -__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all" - -_git_send_email () -{ - case "$cur" in - --confirm=*) - __gitcomp " - $__git_send_email_confirm_options - " "" "${cur##--confirm=}" - return - ;; - --suppress-cc=*) - __gitcomp " - $__git_send_email_suppresscc_options - " "" "${cur##--suppress-cc=}" - - return - ;; - --smtp-encryption=*) - __gitcomp "ssl tls" "" "${cur##--smtp-encryption=}" - return - ;; - --*) - __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to - --compose --confirm= --dry-run --envelope-sender - --from --identity - --in-reply-to --no-chain-reply-to --no-signed-off-by-cc - --no-suppress-from --no-thread --quiet - --signed-off-by-cc --smtp-pass --smtp-server - --smtp-server-port --smtp-encryption= --smtp-user - --subject --suppress-cc= --suppress-from --thread --to - --validate --no-validate" - return - ;; - esac - COMPREPLY=() -} - -_git_stage () -{ - _git_add -} - -__git_config_get_set_variables () -{ - local prevword word config_file= c=$cword - while [ $c -gt 1 ]; do - word="${words[c]}" - case "$word" in - --global|--system|--file=*) - config_file="$word" - break - ;; - -f|--file) - config_file="$word $prevword" - break - ;; - esac - prevword=$word - c=$((--c)) - done - - git --git-dir="$(__gitdir)" config $config_file --list 2>/dev/null | - while read -r line - do - case "$line" in - *.*=*) - echo "${line/=*/}" - ;; - esac - done -} - -_git_config () -{ - case "$prev" in - branch.*.remote) - __gitcomp_nl "$(__git_remotes)" - return - ;; - branch.*.merge) - __gitcomp_nl "$(__git_refs)" - return - ;; - remote.*.fetch) - local remote="${prev#remote.}" - remote="${remote%.fetch}" - if [ -z "$cur" ]; then - COMPREPLY=("refs/heads/") - return - fi - __gitcomp_nl "$(__git_refs_remotes "$remote")" - return - ;; - remote.*.push) - local remote="${prev#remote.}" - remote="${remote%.push}" - __gitcomp_nl "$(git --git-dir="$(__gitdir)" \ - for-each-ref --format='%(refname):%(refname)' \ - refs/heads)" - return - ;; - pull.twohead|pull.octopus) - __git_compute_merge_strategies - __gitcomp "$__git_merge_strategies" - return - ;; - color.branch|color.diff|color.interactive|\ - color.showbranch|color.status|color.ui) - __gitcomp "always never auto" - return - ;; - color.pager) - __gitcomp "false true" - return - ;; - color.*.*) - __gitcomp " - normal black red green yellow blue magenta cyan white - bold dim ul blink reverse - " - return - ;; - help.format) - __gitcomp "man info web html" - return - ;; - log.date) - __gitcomp "$__git_log_date_formats" - return - ;; - sendemail.aliasesfiletype) - __gitcomp "mutt mailrc pine elm gnus" - return - ;; - sendemail.confirm) - __gitcomp "$__git_send_email_confirm_options" - return - ;; - sendemail.suppresscc) - __gitcomp "$__git_send_email_suppresscc_options" - return - ;; - --get|--get-all|--unset|--unset-all) - __gitcomp_nl "$(__git_config_get_set_variables)" - return - ;; - *.*) - COMPREPLY=() - return - ;; - esac - case "$cur" in - --*) - __gitcomp " - --global --system --file= - --list --replace-all - --get --get-all --get-regexp - --add --unset --unset-all - --remove-section --rename-section - " - return - ;; - branch.*.*) - local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp "remote merge mergeoptions rebase" "$pfx" "$cur_" - return - ;; - branch.*) - local pfx="${cur%.*}." cur_="${cur#*.}" - __gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "." - return - ;; - guitool.*.*) - local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp " - argprompt cmd confirm needsfile noconsole norescan - prompt revprompt revunmerged title - " "$pfx" "$cur_" - return - ;; - difftool.*.*) - local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp "cmd path" "$pfx" "$cur_" - return - ;; - man.*.*) - local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp "cmd path" "$pfx" "$cur_" - return - ;; - mergetool.*.*) - local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp "cmd path trustExitCode" "$pfx" "$cur_" - return - ;; - pager.*) - local pfx="${cur%.*}." cur_="${cur#*.}" - __git_compute_all_commands - __gitcomp_nl "$__git_all_commands" "$pfx" "$cur_" - return - ;; - remote.*.*) - local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp " - url proxy fetch push mirror skipDefaultUpdate - receivepack uploadpack tagopt pushurl - " "$pfx" "$cur_" - return - ;; - remote.*) - local pfx="${cur%.*}." cur_="${cur#*.}" - __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "." - return - ;; - url.*.*) - local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_" - return - ;; - esac - __gitcomp " - add.ignoreErrors - advice.commitBeforeMerge - advice.detachedHead - advice.implicitIdentity - advice.pushNonFastForward - advice.resolveConflict - advice.statusHints - alias. - am.keepcr - apply.ignorewhitespace - apply.whitespace - branch.autosetupmerge - branch.autosetuprebase - browser. - clean.requireForce - color.branch - color.branch.current - color.branch.local - color.branch.plain - color.branch.remote - color.decorate.HEAD - color.decorate.branch - color.decorate.remoteBranch - color.decorate.stash - color.decorate.tag - color.diff - color.diff.commit - color.diff.frag - color.diff.func - color.diff.meta - color.diff.new - color.diff.old - color.diff.plain - color.diff.whitespace - color.grep - color.grep.context - color.grep.filename - color.grep.function - color.grep.linenumber - color.grep.match - color.grep.selected - color.grep.separator - color.interactive - color.interactive.error - color.interactive.header - color.interactive.help - color.interactive.prompt - color.pager - color.showbranch - color.status - color.status.added - color.status.changed - color.status.header - color.status.nobranch - color.status.untracked - color.status.updated - color.ui - commit.status - commit.template - core.abbrev - core.askpass - core.attributesfile - core.autocrlf - core.bare - core.bigFileThreshold - core.compression - core.createObject - core.deltaBaseCacheLimit - core.editor - core.eol - core.excludesfile - core.fileMode - core.fsyncobjectfiles - core.gitProxy - core.ignoreCygwinFSTricks - core.ignoreStat - core.ignorecase - core.logAllRefUpdates - core.loosecompression - core.notesRef - core.packedGitLimit - core.packedGitWindowSize - core.pager - core.preferSymlinkRefs - core.preloadindex - core.quotepath - core.repositoryFormatVersion - core.safecrlf - core.sharedRepository - core.sparseCheckout - core.symlinks - core.trustctime - core.warnAmbiguousRefs - core.whitespace - core.worktree - diff.autorefreshindex - diff.statGraphWidth - diff.external - diff.ignoreSubmodules - diff.mnemonicprefix - diff.noprefix - diff.renameLimit - diff.renames - diff.suppressBlankEmpty - diff.tool - diff.wordRegex - difftool. - difftool.prompt - fetch.recurseSubmodules - fetch.unpackLimit - format.attach - format.cc - format.headers - format.numbered - format.pretty - format.signature - format.signoff - format.subjectprefix - format.suffix - format.thread - format.to - gc. - gc.aggressiveWindow - gc.auto - gc.autopacklimit - gc.packrefs - gc.pruneexpire - gc.reflogexpire - gc.reflogexpireunreachable - gc.rerereresolved - gc.rerereunresolved - gitcvs.allbinary - gitcvs.commitmsgannotation - gitcvs.dbTableNamePrefix - gitcvs.dbdriver - gitcvs.dbname - gitcvs.dbpass - gitcvs.dbuser - gitcvs.enabled - gitcvs.logfile - gitcvs.usecrlfattr - guitool. - gui.blamehistoryctx - gui.commitmsgwidth - gui.copyblamethreshold - gui.diffcontext - gui.encoding - gui.fastcopyblame - gui.matchtrackingbranch - gui.newbranchtemplate - gui.pruneduringfetch - gui.spellingdictionary - gui.trustmtime - help.autocorrect - help.browser - help.format - http.lowSpeedLimit - http.lowSpeedTime - http.maxRequests - http.minSessions - http.noEPSV - http.postBuffer - http.proxy - http.sslCAInfo - http.sslCAPath - http.sslCert - http.sslCertPasswordProtected - http.sslKey - http.sslVerify - http.useragent - i18n.commitEncoding - i18n.logOutputEncoding - imap.authMethod - imap.folder - imap.host - imap.pass - imap.port - imap.preformattedHTML - imap.sslverify - imap.tunnel - imap.user - init.templatedir - instaweb.browser - instaweb.httpd - instaweb.local - instaweb.modulepath - instaweb.port - interactive.singlekey - log.date - log.decorate - log.showroot - mailmap.file - man. - man.viewer - merge. - merge.conflictstyle - merge.log - merge.renameLimit - merge.renormalize - merge.stat - merge.tool - merge.verbosity - mergetool. - mergetool.keepBackup - mergetool.keepTemporaries - mergetool.prompt - notes.displayRef - notes.rewrite. - notes.rewrite.amend - notes.rewrite.rebase - notes.rewriteMode - notes.rewriteRef - pack.compression - pack.deltaCacheLimit - pack.deltaCacheSize - pack.depth - pack.indexVersion - pack.packSizeLimit - pack.threads - pack.window - pack.windowMemory - pager. - pretty. - pull.octopus - pull.twohead - push.default - rebase.autosquash - rebase.stat - receive.autogc - receive.denyCurrentBranch - receive.denyDeleteCurrent - receive.denyDeletes - receive.denyNonFastForwards - receive.fsckObjects - receive.unpackLimit - receive.updateserverinfo - remotes. - repack.usedeltabaseoffset - rerere.autoupdate - rerere.enabled - sendemail. - sendemail.aliasesfile - sendemail.aliasfiletype - sendemail.bcc - sendemail.cc - sendemail.cccmd - sendemail.chainreplyto - sendemail.confirm - sendemail.envelopesender - sendemail.from - sendemail.identity - sendemail.multiedit - sendemail.signedoffbycc - sendemail.smtpdomain - sendemail.smtpencryption - sendemail.smtppass - sendemail.smtpserver - sendemail.smtpserveroption - sendemail.smtpserverport - sendemail.smtpuser - sendemail.suppresscc - sendemail.suppressfrom - sendemail.thread - sendemail.to - sendemail.validate - showbranch.default - status.relativePaths - status.showUntrackedFiles - status.submodulesummary - submodule. - tar.umask - transfer.unpackLimit - url. - user.email - user.name - user.signingkey - web.browser - branch. remote. - " -} - -_git_remote () -{ - local subcommands="add rename remove set-head set-branches set-url show prune update" - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - __gitcomp "$subcommands" - return - fi - - case "$subcommand" in - rename|remove|set-url|show|prune) - __gitcomp_nl "$(__git_remotes)" - ;; - set-head|set-branches) - __git_complete_remote_or_refspec - ;; - update) - local i c='' IFS=$'\n' - for i in $(git --git-dir="$(__gitdir)" config --get-regexp "remotes\..*" 2>/dev/null); do - i="${i#remotes.}" - c="$c ${i/ */}" - done - __gitcomp "$c" - ;; - *) - COMPREPLY=() - ;; - esac -} - -_git_replace () -{ - __gitcomp_nl "$(__git_refs)" -} - -_git_reset () -{ - __git_has_doubledash && return - - case "$cur" in - --*) - __gitcomp "--merge --mixed --hard --soft --patch" - return - ;; - esac - __gitcomp_nl "$(__git_refs)" -} - -_git_revert () -{ - case "$cur" in - --*) - __gitcomp "--edit --mainline --no-edit --no-commit --signoff" - return - ;; - esac - __gitcomp_nl "$(__git_refs)" -} - -_git_rm () -{ - __git_has_doubledash && return - - case "$cur" in - --*) - __gitcomp "--cached --dry-run --ignore-unmatch --quiet" - return - ;; - esac - COMPREPLY=() -} - -_git_shortlog () -{ - __git_has_doubledash && return - - case "$cur" in - --*) - __gitcomp " - $__git_log_common_options - $__git_log_shortlog_options - --numbered --summary - " - return - ;; - esac - __git_complete_revlist -} - -_git_show () -{ - __git_has_doubledash && return - - case "$cur" in - --pretty=*|--format=*) - __gitcomp "$__git_log_pretty_formats $(__git_pretty_aliases) - " "" "${cur#*=}" - return - ;; - --*) - __gitcomp "--pretty= --format= --abbrev-commit --oneline - $__git_diff_common_options - " - return - ;; - esac - __git_complete_file -} - -_git_show_branch () -{ - case "$cur" in - --*) - __gitcomp " - --all --remotes --topo-order --current --more= - --list --independent --merge-base --no-name - --color --no-color - --sha1-name --sparse --topics --reflog - " - return - ;; - esac - __git_complete_revlist -} - -_git_stash () -{ - local save_opts='--keep-index --no-keep-index --quiet --patch' - local subcommands='save list show apply clear drop pop create branch' - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - case "$cur" in - --*) - __gitcomp "$save_opts" - ;; - *) - if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then - __gitcomp "$subcommands" - else - COMPREPLY=() - fi - ;; - esac - else - case "$subcommand,$cur" in - save,--*) - __gitcomp "$save_opts" - ;; - apply,--*|pop,--*) - __gitcomp "--index --quiet" - ;; - show,--*|drop,--*|branch,--*) - COMPREPLY=() - ;; - show,*|apply,*|drop,*|pop,*|branch,*) - __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ - | sed -n -e 's/:.*//p')" - ;; - *) - COMPREPLY=() - ;; - esac - fi -} - -_git_submodule () -{ - __git_has_doubledash && return - - local subcommands="add status init update summary foreach sync" - if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then - case "$cur" in - --*) - __gitcomp "--quiet --cached" - ;; - *) - __gitcomp "$subcommands" - ;; - esac - return - fi -} - -_git_svn () -{ - local subcommands=" - init fetch clone rebase dcommit log find-rev - set-tree commit-diff info create-ignore propget - proplist show-ignore show-externals branch tag blame - migrate mkdirs reset gc - " - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - __gitcomp "$subcommands" - else - local remote_opts="--username= --config-dir= --no-auth-cache" - local fc_opts=" - --follow-parent --authors-file= --repack= - --no-metadata --use-svm-props --use-svnsync-props - --log-window-size= --no-checkout --quiet - --repack-flags --use-log-author --localtime - --ignore-paths= $remote_opts - " - local init_opts=" - --template= --shared= --trunk= --tags= - --branches= --stdlayout --minimize-url - --no-metadata --use-svm-props --use-svnsync-props - --rewrite-root= --prefix= --use-log-author - --add-author-from $remote_opts - " - local cmt_opts=" - --edit --rmdir --find-copies-harder --copy-similarity= - " - - case "$subcommand,$cur" in - fetch,--*) - __gitcomp "--revision= --fetch-all $fc_opts" - ;; - clone,--*) - __gitcomp "--revision= $fc_opts $init_opts" - ;; - init,--*) - __gitcomp "$init_opts" - ;; - dcommit,--*) - __gitcomp " - --merge --strategy= --verbose --dry-run - --fetch-all --no-rebase --commit-url - --revision --interactive $cmt_opts $fc_opts - " - ;; - set-tree,--*) - __gitcomp "--stdin $cmt_opts $fc_opts" - ;; - create-ignore,--*|propget,--*|proplist,--*|show-ignore,--*|\ - show-externals,--*|mkdirs,--*) - __gitcomp "--revision=" - ;; - log,--*) - __gitcomp " - --limit= --revision= --verbose --incremental - --oneline --show-commit --non-recursive - --authors-file= --color - " - ;; - rebase,--*) - __gitcomp " - --merge --verbose --strategy= --local - --fetch-all --dry-run $fc_opts - " - ;; - commit-diff,--*) - __gitcomp "--message= --file= --revision= $cmt_opts" - ;; - info,--*) - __gitcomp "--url" - ;; - branch,--*) - __gitcomp "--dry-run --message --tag" - ;; - tag,--*) - __gitcomp "--dry-run --message" - ;; - blame,--*) - __gitcomp "--git-format" - ;; - migrate,--*) - __gitcomp " - --config-dir= --ignore-paths= --minimize - --no-auth-cache --username= - " - ;; - reset,--*) - __gitcomp "--revision= --parent" - ;; - *) - COMPREPLY=() - ;; - esac - fi -} - -_git_tag () -{ - local i c=1 f=0 - while [ $c -lt $cword ]; do - i="${words[c]}" - case "$i" in - -d|-v) - __gitcomp_nl "$(__git_tags)" - return - ;; - -f) - f=1 - ;; - esac - ((c++)) - done - - case "$prev" in - -m|-F) - COMPREPLY=() - ;; - -*|tag) - if [ $f = 1 ]; then - __gitcomp_nl "$(__git_tags)" - else - COMPREPLY=() - fi - ;; - *) - __gitcomp_nl "$(__git_refs)" - ;; - esac -} - -_git_whatchanged () -{ - _git_log -} - -__git_main () -{ - local i c=1 command __git_dir - - while [ $c -lt $cword ]; do - i="${words[c]}" - case "$i" in - --git-dir=*) __git_dir="${i#--git-dir=}" ;; - --bare) __git_dir="." ;; - --help) command="help"; break ;; - -c) c=$((++c)) ;; - -*) ;; - *) command="$i"; break ;; - esac - ((c++)) - done - - if [ -z "$command" ]; then - case "$cur" in - --*) __gitcomp " - --paginate - --no-pager - --git-dir= - --bare - --version - --exec-path - --exec-path= - --html-path - --info-path - --work-tree= - --namespace= - --no-replace-objects - --help - " - ;; - *) __git_compute_porcelain_commands - __gitcomp "$__git_porcelain_commands $(__git_aliases)" ;; - esac - return - fi - - local completion_func="_git_${command//-/_}" - declare -f $completion_func >/dev/null && $completion_func && return - - local expansion=$(__git_aliased_command "$command") - if [ -n "$expansion" ]; then - completion_func="_git_${expansion//-/_}" - declare -f $completion_func >/dev/null && $completion_func - fi -} - -__gitk_main () -{ - __git_has_doubledash && return - - local g="$(__gitdir)" - local merge="" - if [ -f "$g/MERGE_HEAD" ]; then - merge="--merge" - fi - case "$cur" in - --*) - __gitcomp " - $__git_log_common_options - $__git_log_gitk_options - $merge - " - return - ;; - esac - __git_complete_revlist -} - -__git_func_wrap () -{ - if [[ -n ${ZSH_VERSION-} ]]; then - emulate -L bash - setopt KSH_TYPESET - - # workaround zsh's bug that leaves 'words' as a special - # variable in versions < 4.3.12 - typeset -h words - - # workaround zsh's bug that quotes spaces in the COMPREPLY - # array if IFS doesn't contain spaces. - typeset -h IFS - fi - local cur words cword prev - _get_comp_words_by_ref -n =: cur words cword prev - $1 -} - -# Setup completion for certain functions defined above by setting common -# variables and workarounds. -# This is NOT a public function; use at your own risk. -__git_complete () -{ - local wrapper="__git_wrap${2}" - eval "$wrapper () { __git_func_wrap $2 ; }" - complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \ - || complete -o default -o nospace -F $wrapper $1 -} - -# wrapper for backwards compatibility -_git () -{ - __git_wrap__git_main -} - -# wrapper for backwards compatibility -_gitk () -{ - __git_wrap__gitk_main -} - -__git_complete git __git_main -__git_complete gitk __gitk_main - -# The following are necessary only for Cygwin, and only are needed -# when the user has tab-completed the executable name and consequently -# included the '.exe' suffix. -# -if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then -__git_complete git.exe __git_main -fi diff --git a/dot.oh-my-zsh/plugins/gitfast/git-prompt.sh b/dot.oh-my-zsh/plugins/gitfast/git-prompt.sh deleted file mode 100644 index bf20491..0000000 --- a/dot.oh-my-zsh/plugins/gitfast/git-prompt.sh +++ /dev/null @@ -1,290 +0,0 @@ -# bash/zsh git prompt support -# -# Copyright (C) 2006,2007 Shawn O. Pearce -# Distributed under the GNU General Public License, version 2.0. -# -# This script allows you to see the current branch in your prompt. -# -# To enable: -# -# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). -# 2) Add the following line to your .bashrc/.zshrc: -# source ~/.git-prompt.sh -# 3) Change your PS1 to also show the current branch: -# Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' -# ZSH: PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ ' -# -# The argument to __git_ps1 will be displayed only if you are currently -# in a git repository. The %s token will be the name of the current -# branch. -# -# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value, -# unstaged (*) and staged (+) changes will be shown next to the branch -# name. You can configure this per-repository with the -# bash.showDirtyState variable, which defaults to true once -# GIT_PS1_SHOWDIRTYSTATE is enabled. -# -# You can also see if currently something is stashed, by setting -# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed, -# then a '$' will be shown next to the branch name. -# -# If you would like to see if there're untracked files, then you can set -# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked -# files, then a '%' will be shown next to the branch name. -# -# If you would like to see the difference between HEAD and its upstream, -# set GIT_PS1_SHOWUPSTREAM="auto". A "<" indicates you are behind, ">" -# indicates you are ahead, "<>" indicates you have diverged and "=" -# indicates that there is no difference. You can further control -# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list -# of values: -# -# verbose show number of commits ahead/behind (+/-) upstream -# legacy don't use the '--count' option available in recent -# versions of git-rev-list -# git always compare HEAD to @{upstream} -# svn always compare HEAD to your SVN upstream -# -# By default, __git_ps1 will compare HEAD to your SVN upstream if it can -# find one, or @{upstream} otherwise. Once you have set -# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by -# setting the bash.showUpstream config variable. - -# __gitdir accepts 0 or 1 arguments (i.e., location) -# returns location of .git repo -__gitdir () -{ - # Note: this function is duplicated in git-completion.bash - # When updating it, make sure you update the other one to match. - if [ -z "${1-}" ]; then - if [ -n "${__git_dir-}" ]; then - echo "$__git_dir" - elif [ -n "${GIT_DIR-}" ]; then - test -d "${GIT_DIR-}" || return 1 - echo "$GIT_DIR" - elif [ -d .git ]; then - echo .git - else - git rev-parse --git-dir 2>/dev/null - fi - elif [ -d "$1/.git" ]; then - echo "$1/.git" - else - echo "$1" - fi -} - -# stores the divergence from upstream in $p -# used by GIT_PS1_SHOWUPSTREAM -__git_ps1_show_upstream () -{ - local key value - local svn_remote svn_url_pattern count n - local upstream=git legacy="" verbose="" - - svn_remote=() - # get some config options from git-config - local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')" - while read -r key value; do - case "$key" in - bash.showupstream) - GIT_PS1_SHOWUPSTREAM="$value" - if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then - p="" - return - fi - ;; - svn-remote.*.url) - svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value" - svn_url_pattern+="\\|$value" - upstream=svn+git # default upstream is SVN if available, else git - ;; - esac - done <<< "$output" - - # parse configuration values - for option in ${GIT_PS1_SHOWUPSTREAM}; do - case "$option" in - git|svn) upstream="$option" ;; - verbose) verbose=1 ;; - legacy) legacy=1 ;; - esac - done - - # Find our upstream - case "$upstream" in - git) upstream="@{upstream}" ;; - svn*) - # get the upstream from the "git-svn-id: ..." in a commit message - # (git-svn uses essentially the same procedure internally) - local svn_upstream=($(git log --first-parent -1 \ - --grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null)) - if [[ 0 -ne ${#svn_upstream[@]} ]]; then - svn_upstream=${svn_upstream[ ${#svn_upstream[@]} - 2 ]} - svn_upstream=${svn_upstream%@*} - local n_stop="${#svn_remote[@]}" - for ((n=1; n <= n_stop; n++)); do - svn_upstream=${svn_upstream#${svn_remote[$n]}} - done - - if [[ -z "$svn_upstream" ]]; then - # default branch name for checkouts with no layout: - upstream=${GIT_SVN_ID:-git-svn} - else - upstream=${svn_upstream#/} - fi - elif [[ "svn+git" = "$upstream" ]]; then - upstream="@{upstream}" - fi - ;; - esac - - # Find how many commits we are ahead/behind our upstream - if [[ -z "$legacy" ]]; then - count="$(git rev-list --count --left-right \ - "$upstream"...HEAD 2>/dev/null)" - else - # produce equivalent output to --count for older versions of git - local commits - if commits="$(git rev-list --left-right "$upstream"...HEAD 2>/dev/null)" - then - local commit behind=0 ahead=0 - for commit in $commits - do - case "$commit" in - "<"*) ((behind++)) ;; - *) ((ahead++)) ;; - esac - done - count="$behind $ahead" - else - count="" - fi - fi - - # calculate the result - if [[ -z "$verbose" ]]; then - case "$count" in - "") # no upstream - p="" ;; - "0 0") # equal to upstream - p="=" ;; - "0 "*) # ahead of upstream - p=">" ;; - *" 0") # behind upstream - p="<" ;; - *) # diverged from upstream - p="<>" ;; - esac - else - case "$count" in - "") # no upstream - p="" ;; - "0 0") # equal to upstream - p=" u=" ;; - "0 "*) # ahead of upstream - p=" u+${count#0 }" ;; - *" 0") # behind upstream - p=" u-${count% 0}" ;; - *) # diverged from upstream - p=" u+${count#* }-${count% *}" ;; - esac - fi - -} - - -# __git_ps1 accepts 0 or 1 arguments (i.e., format string) -# returns text to add to bash PS1 prompt (includes branch name) -__git_ps1 () -{ - local g="$(__gitdir)" - if [ -n "$g" ]; then - local r="" - local b="" - if [ -f "$g/rebase-merge/interactive" ]; then - r="|REBASE-i" - b="$(cat "$g/rebase-merge/head-name")" - elif [ -d "$g/rebase-merge" ]; then - r="|REBASE-m" - b="$(cat "$g/rebase-merge/head-name")" - else - if [ -d "$g/rebase-apply" ]; then - if [ -f "$g/rebase-apply/rebasing" ]; then - r="|REBASE" - elif [ -f "$g/rebase-apply/applying" ]; then - r="|AM" - else - r="|AM/REBASE" - fi - elif [ -f "$g/MERGE_HEAD" ]; then - r="|MERGING" - elif [ -f "$g/CHERRY_PICK_HEAD" ]; then - r="|CHERRY-PICKING" - elif [ -f "$g/BISECT_LOG" ]; then - r="|BISECTING" - fi - - b="$(git symbolic-ref HEAD 2>/dev/null)" || { - - b="$( - case "${GIT_PS1_DESCRIBE_STYLE-}" in - (contains) - git describe --contains HEAD ;; - (branch) - git describe --contains --all HEAD ;; - (describe) - git describe HEAD ;; - (* | default) - git describe --tags --exact-match HEAD ;; - esac 2>/dev/null)" || - - b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." || - b="unknown" - b="($b)" - } - fi - - local w="" - local i="" - local s="" - local u="" - local c="" - local p="" - - if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then - if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then - c="BARE:" - else - b="GIT_DIR!" - fi - elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then - if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then - if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then - git diff --no-ext-diff --quiet --exit-code || w="*" - if git rev-parse --quiet --verify HEAD >/dev/null; then - git diff-index --cached --quiet HEAD -- || i="+" - else - i="#" - fi - fi - fi - if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ]; then - git rev-parse --verify refs/stash >/dev/null 2>&1 && s="$" - fi - - if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then - if [ -n "$(git ls-files --others --exclude-standard)" ]; then - u="%" - fi - fi - - if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then - __git_ps1_show_upstream - fi - fi - - local f="$w$i$s$u" - printf -- "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r$p" - fi -} diff --git a/dot.oh-my-zsh/plugins/gitfast/gitfast.plugin.zsh b/dot.oh-my-zsh/plugins/gitfast/gitfast.plugin.zsh deleted file mode 100644 index 7e50cf7..0000000 --- a/dot.oh-my-zsh/plugins/gitfast/gitfast.plugin.zsh +++ /dev/null @@ -1,7 +0,0 @@ -dir=$(dirname $0) -source $dir/../git/git.plugin.zsh -source $dir/git-prompt.sh - -function git_prompt_info() { - __git_ps1 "${ZSH_THEME_GIT_PROMPT_PREFIX//\%/%%}%s${ZSH_THEME_GIT_PROMPT_SUFFIX//\%/%%}" -} diff --git a/dot.oh-my-zsh/plugins/github/_github b/dot.oh-my-zsh/plugins/github/_github deleted file mode 100644 index 83e1713..0000000 --- a/dot.oh-my-zsh/plugins/github/_github +++ /dev/null @@ -1,40 +0,0 @@ -#compdef github -#autoload - -# in order to make this work, you will need to have the github gem installed -# http://github.com/defunkt/github-gem - -# github zsh completion, based on homebrew completion - -local -a _1st_arguments -_1st_arguments=( - 'browse:Open this repo in a web browser' - 'clone:Clone a repo' - 'config:Automatically set configuration info, or pass args to specify' - 'create-from-local:Create a new GitHub repository from the current local repository' - 'create:Create a new empty GitHub repository' - 'fetch:Fetch from a remote to a local branch' - 'fetch_all:Fetch all refs from a user' - 'fork:Forks a GitHub repository' - 'home:Open this repos master branch in a web browser' - 'ignore:Ignore a SHA from github network commits' - 'info:Info about this project' - 'issues:Project issues tools' - 'network:Project network tools - sub-commands : web [user], list, fetch, commits' - 'open:Open the given user/project in a web browser' - 'pull-request:Generate the text for a pull request' - 'pull:Pull from a remote' - 'search:Search GitHub for the given repository name' - 'track:Track another users repository' -) - -local expl -local -a pkgs installed_pkgs - -_arguments \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "github subcommand" _1st_arguments - return -fi diff --git a/dot.oh-my-zsh/plugins/github/github.plugin.zsh b/dot.oh-my-zsh/plugins/github/github.plugin.zsh deleted file mode 100644 index 598b059..0000000 --- a/dot.oh-my-zsh/plugins/github/github.plugin.zsh +++ /dev/null @@ -1,71 +0,0 @@ -# Setup hub function for git, if it is available; http://github.com/defunkt/hub -if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then - # eval `hub alias -s zsh` - function git(){ - if ! (( $+_has_working_hub )); then - hub --version &> /dev/null - _has_working_hub=$(($? == 0)) - fi - if (( $_has_working_hub )) ; then - hub "$@" - else - command git "$@" - fi - } -fi - -# Functions ################################################################# - -# https://github.com/dbb - - -# empty_gh [NAME_OF_REPO] -# -# Use this when creating a new repo from scratch. -empty_gh() { # [NAME_OF_REPO] - repo = $1 - ghuser=$( git config github.user ) - - mkdir "$repo" - cd "$repo" - git init - touch README - git add README - git commit -m 'Initial commit.' - git remote add origin git@github.com:${ghuser}/${repo}.git - git push -u origin master -} - -# new_gh [DIRECTORY] -# -# Use this when you have a directory that is not yet set up for git. -# This function will add all non-hidden files to git. -new_gh() { # [DIRECTORY] - cd "$1" - ghuser=$( git config github.user ) - - git init - # add all non-dot files - print '.*'"\n"'*~' >> .gitignore - git add ^.* - git commit -m 'Initial commit.' - git remote add origin git@github.com:${ghuser}/${repo}.git - git push -u origin master -} - -# exist_gh [DIRECTORY] -# -# Use this when you have a git repo that's ready to go and you want to add it -# to your GitHub. -exist_gh() { # [DIRECTORY] - cd "$1" - name=$( git config user.name ) - ghuser=$( git config github.user ) - repo=$1 - - git remote add origin git@github.com:${ghuser}/${repo}.git - git push -u origin master -} - -# End Functions ############################################################# - diff --git a/dot.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh b/dot.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh deleted file mode 100644 index e59265d..0000000 --- a/dot.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh +++ /dev/null @@ -1,80 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: gnu-utils.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.0 -# ------------------------------------------------------------------------------ - - -if [[ -x "${commands[gwhoami]}" ]]; then - __gnu_utils() { - emulate -L zsh - local gcmds - local gcmd - local cmd - local prefix - - # coreutils - gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod' - 'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate' - 'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand' - 'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid' - 'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum' - 'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc' - 'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd' - 'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum' - 'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort' - 'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest' - 'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname' - 'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho' - 'gwhoami' 'gyes') - - # Not part of coreutils, installed separately. - gcmds+=('gsed' 'gtar' 'gtime') - - for gcmd in "${gcmds[@]}"; do - # - # This method allows for builtin commands to be primary but it's - # lost if hash -r or rehash -f is executed. Thus, those two - # functions have to be wrapped. - # - (( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]} - - # - # This method generates wrapper functions. - # It will override shell builtins. - # - # (( ${+commands[$gcmd]} )) && \ - # eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }" - - # - # This method is inflexible since the aliases are at risk of being - # overriden resulting in the BSD coreutils being called. - # - # (( ${+commands[$gcmd]} )) && \ - # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}" - done - - return 0 - } - __gnu_utils; - - function hash() { - if [[ "$*" =~ "-(r|f)" ]]; then - builtin hash "$@" - __gnu_utils - else - builtin hash "$@" - fi - } - - function rehash() { - if [[ "$*" =~ "-f" ]]; then - builtin rehash "$@" - __gnu_utils - else - builtin rehash "$@" - fi - } -fi - diff --git a/dot.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh b/dot.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh deleted file mode 100644 index 8cc71fd..0000000 --- a/dot.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh +++ /dev/null @@ -1,26 +0,0 @@ -# Based on ssh-agent code - -local GPG_ENV=$HOME/.gnupg/gpg-agent.env - -function start_agent { - /usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null - chmod 600 ${GPG_ENV} - . ${GPG_ENV} > /dev/null -} - -# Source GPG agent settings, if applicable -if [ -f "${GPG_ENV}" ]; then - . ${GPG_ENV} > /dev/null - ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || { - start_agent; - } -else - start_agent; -fi - -export GPG_AGENT_INFO -export SSH_AUTH_SOCK -export SSH_AGENT_PID - -GPG_TTY=$(tty) -export GPG_TTY diff --git a/dot.oh-my-zsh/plugins/gradle/gradle.plugin.zsh b/dot.oh-my-zsh/plugins/gradle/gradle.plugin.zsh deleted file mode 100644 index fc4c78c..0000000 --- a/dot.oh-my-zsh/plugins/gradle/gradle.plugin.zsh +++ /dev/null @@ -1,119 +0,0 @@ -#!zsh -############################################################################## -# A descriptive listing of core Gradle commands -############################################################################ -function _gradle_core_commands() { - local ret=1 state - _arguments ':subcommand:->subcommand' && ret=0 - - case $state in - subcommand) - subcommands=( - "properties:Display all project properties" - "tasks:Calculate and display all tasks" - "dependencies:Calculate and display all dependencies" - "projects:Discover and display all sub-projects" - "build:Build the project" - "help:Display help" - ) - _describe -t subcommands 'gradle subcommands' subcommands && ret=0 - esac - - return ret -} - -function _gradle_arguments() { - _arguments -C \ - '-a[Do not rebuild project dependencies]' \ - '-h[Help]' \ - '-D[System property]' \ - '-d[Log at the debug level]' \ - '--gui[Launches the Gradle GUI app]' \ - '--stop[Stop the Gradle daemon]' \ - '--daemon[Use the Gradle daemon]' \ - '--no-daemon[Do not use the Gradle daemon]' \ - '--no-opt[Do not perform any task optimization]' \ - '-i[Log at the info level]' \ - '-m[Dry run]' \ - '-P[Set a project property]' \ - '--profile[Profile the build time]' \ - '-q[Log at the quiet level (only show errors)]' \ - '-v[Print the Gradle version info]' \ - '-x[Specify a task to be excluded]' \ - '*::command:->command' \ - && return 0 -} - - -############################################################################## -# Are we in a directory containing a build.gradle file? -############################################################################ -function in_gradle() { - if [[ -f build.gradle ]]; then - echo 1 - fi -} - -############################################################################ -# Define the stat_cmd command based on platform behavior -########################################################################## -stat -f%m . > /dev/null 2>&1 -if [ "$?" = 0 ]; then - stat_cmd=(stat -f%m) -else - stat_cmd=(stat -L --format=%Y) -fi - -############################################################################## Examine the build.gradle file to see if its -# timestamp has changed, and if so, regen -# the .gradle_tasks cache file -############################################################################ -_gradle_does_task_list_need_generating () { - if [ ! -f .gradletasknamecache ]; then return 0; - else - accurate=$($stat_cmd .gradletasknamecache) - changed=$($stat_cmd build.gradle) - return $(expr $accurate '>=' $changed) - fi -} - - -############################################################################## -# Discover the gradle tasks by running "gradle tasks --all" -############################################################################ -_gradle_tasks () { - if [ in_gradle ]; then - _gradle_arguments - if _gradle_does_task_list_need_generating; then - gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache - fi - compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache` - fi -} - -_gradlew_tasks () { - if [ in_gradle ]; then - _gradle_arguments - if _gradle_does_task_list_need_generating; then - gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache - fi - compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache` - fi -} - - -############################################################################## -# Register the completions against the gradle and gradlew commands -############################################################################ -compdef _gradle_tasks gradle -compdef _gradlew_tasks gradlew - - -############################################################################## -# Open questions for future improvements: -# 1) Should 'gradle tasks' use --all or just the regular set? -# 2) Should gradlew use the same approach as gradle? -# 3) Should only the " - " be replaced with a colon so it can work -# with the richer descriptive method of _arguments? -# gradle tasks | grep "^[a-zA-Z0-9]*\ -\ " | sed "s/ - /\:/" -############################################################################# diff --git a/dot.oh-my-zsh/plugins/grails/grails.plugin.zsh b/dot.oh-my-zsh/plugins/grails/grails.plugin.zsh deleted file mode 100755 index cc6f9c5..0000000 --- a/dot.oh-my-zsh/plugins/grails/grails.plugin.zsh +++ /dev/null @@ -1,54 +0,0 @@ -_enumerateGrailsScripts() { - # Default directoryies - directories=($GRAILS_HOME/scripts ~/.grails/scripts ./scripts) - - # Check all of the plugins directories, if they exist - if [ -d plugins ] - then - directories+=(plugins/*/scripts) - fi - - # Enumerate all of the Groovy files - files=() - for dir in $directories; - do - if [ -d $dir ] - then - files+=($dir/[^_]*.groovy) - fi - done - - # Don't try to basename () - if [ ${#files} -eq 0 ]; - then - return - fi - - # - Strip the path - # - Remove all scripts with a leading '_' - # - PackagePlugin_.groovy -> PackagePlugin - # - PackagePlugin -> Package-Plugin - # - Package-Plugin -> package-plugin - basename $files \ - | sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\ - -e 's/([a-z])([A-Z])/\1-\2/g' \ - | tr "[:upper:]" "[:lower:]" \ - | sort \ - | uniq -} - -_grails() { - if (( CURRENT == 2 )); then - scripts=( $(_enumerateGrailsScripts) ) - - if [ ${#scripts} -ne 0 ]; - then - _multi_parts / scripts - return - fi - fi - - _files -} - -compdef _grails grails diff --git a/dot.oh-my-zsh/plugins/heroku/_heroku b/dot.oh-my-zsh/plugins/heroku/_heroku deleted file mode 100644 index a95c386..0000000 --- a/dot.oh-my-zsh/plugins/heroku/_heroku +++ /dev/null @@ -1,159 +0,0 @@ -#compdef heroku - -# Heroku Autocomplete plugin for Oh-My-Zsh -# Requires: The Heroku client gem (https://github.com/heroku/heroku) -# Author: Ali B. (http://awhitebox.com) - -local -a _1st_arguments -_1st_arguments=( - "account\:confirm_billing":"Confirm that your account can be billed at the end of the month" - "addons":"list installed addons" - "addons\:list":"list all available addons" - "addons\:add":"install an addon" - "addons\:upgrade":"upgrade an existing addon" - "addons\:downgrade":"downgrade an existing addon" - "addons\:remove":"uninstall an addon" - "addons\:open":"open an addon's dashboard in your browser" - "apps":"list your apps" - "apps\:info":"show detailed app information" - "apps\:create":"create a new app" - "apps\:rename":"rename the app" - "apps\:open":"open the app in a web browser" - "apps\:destroy":"permanently destroy an app" - "auth\:login":"log in with your heroku credentials" - "auth\:logout":"clear local authentication credentials" - "config":"display the config vars for an app" - "config\:add":"add one or more config vars" - "config\:remove":"remove a config var" - "db\:push":"push local data up to your app" - "db\:pull":"pull heroku data down into your local database" - "domains":"list custom domains for an app" - "domains\:add":"add a custom domain to an app" - "domains\:remove":"remove a custom domain from an app" - "domains\:clear":"remove all custom domains from an app" - "help":"list available commands or display help for a specific command" - "keys":"display keys for the current user" - "keys\:add":"add a key for the current user" - "keys\:remove":"remove a key from the current user" - "keys\:clear":"remove all authentication keys from the current user" - "logs":"display recent log output" - "logs\:cron":"DEPRECATED: display cron logs from legacy logging" - "logs\:drains":"manage syslog drains" - "maintenance\:on":"put the app into maintenance mode" - "maintenance\:off":"take the app out of maintenance mode" - "pg\:info":"display database information" - "pg\:ingress":"allow direct connections to the database from this IP for one minute" - "pg\:promote":"sets DATABASE as your DATABASE_URL" - "pg\:psql":"open a psql shell to the database" - "pg\:reset":"delete all data in DATABASE" - "pg\:unfollow":"stop a replica from following and make it a read/write database" - "pg\:wait":"monitor database creation, exit when complete" - "pgbackups":"list captured backups" - "pgbackups\:url":"get a temporary URL for a backup" - "pgbackups\:capture":"capture a backup from a database id" - "pgbackups\:restore":"restore a backup to a database" - "pgbackups\:destroy":"destroys a backup" - "plugins":"list installed plugins" - "plugins\:install":"install a plugin" - "plugins\:uninstall":"uninstall a plugin" - "ps\:dynos":"scale to QTY web processes" - "ps\:workers":"scale to QTY background processes" - "ps":"list processes for an app" - "ps\:restart":"restart an app process" - "ps\:scale":"scale processes by the given amount" - "releases":"list releases" - "releases\:info":"view detailed information for a release" - "rollback":"roll back to an older release" - "run":"run an attached process" - "run\:rake":"remotely execute a rake command" - "run\:console":"open a remote console session" - "sharing":"list collaborators on an app" - "sharing\:add":"add a collaborator to an app" - "sharing\:remove":"remove a collaborator from an app" - "sharing\:transfer":"transfer an app to a new owner" - "ssl":"list certificates for an app" - "ssl\:add":"add an ssl certificate to an app" - "ssl\:remove":"remove an ssl certificate from an app" - "ssl\:clear":"remove all ssl certificates from an app" - "stack":"show the list of available stacks" - "stack\:migrate":"prepare migration of this app to a new stack" - "version":"show heroku client version" -) - -_arguments '*:: :->command' - -if (( CURRENT == 1 )); then - _describe -t commands "heroku command" _1st_arguments - return -fi - -local -a _command_args -case "$words[1]" in - apps:info) - _command_args=( - '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \ - ) - ;; - apps:create) - _command_args=( - '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \ - '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \ - '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \ - ) - ;; - config) - _command_args=( - '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \ - ) - ;; - db:push) - _command_args=( - '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ - '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ - '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \ - '(-f|--filter)'{-f,--filter}'[only push certain tables]' \ - '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ - '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \ - ) - ;; - db:pull) - _command_args=( - '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ - '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ - '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \ - '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \ - '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ - '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \ - ) - ;; - keys) - _command_args=( - '(-l|--long)'{-l,--long}'[display extended information for each key]' \ - ) - ;; - logs) - _command_args=( - '(-n|--num)'{-n,--num}'[the number of lines to display]' \ - '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \ - '(-s|--source)'{-s,--source}'[only display logs from the given source]' \ - '(-t|--tail)'{-t,--tail}'[continually stream logs]' \ - ) - ;; - pgbackups:capture) - _command_args=( - '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \ - ) - ;; - stack) - _command_args=( - '(-a|--all)'{-a,--all}'[include deprecated stacks]' \ - ) - ;; - esac - -_arguments \ - $_command_args \ - '(--app)--app[the app name]' \ - '(--remote)--remote[the remote name]' \ - && return 0 - diff --git a/dot.oh-my-zsh/plugins/history-substring-search/README b/dot.oh-my-zsh/plugins/history-substring-search/README deleted file mode 100644 index be11adf..0000000 --- a/dot.oh-my-zsh/plugins/history-substring-search/README +++ /dev/null @@ -1,7 +0,0 @@ -To activate this script, load it into an interactive ZSH session: - - % source history-substring-search.zsh - -See the "history-substring-search.zsh" file for more information: - - % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more diff --git a/dot.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh b/dot.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh deleted file mode 100644 index 99a5922..0000000 --- a/dot.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh +++ /dev/null @@ -1,12 +0,0 @@ -# This file integrates the history-substring-search script into oh-my-zsh. - -source "$ZSH/plugins/history-substring-search/history-substring-search.zsh" - -if test "$CASE_SENSITIVE" = true; then - unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS -fi - -if test "$DISABLE_COLOR" = true; then - unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND -fi diff --git a/dot.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh b/dot.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh deleted file mode 100644 index 53f707c..0000000 --- a/dot.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh +++ /dev/null @@ -1,642 +0,0 @@ -#!/usr/bin/env zsh -# -# This is a clean-room implementation of the Fish[1] shell's history search -# feature, where you can type in any part of any previously entered command -# and press the UP and DOWN arrow keys to cycle through the matching commands. -# -#----------------------------------------------------------------------------- -# Usage -#----------------------------------------------------------------------------- -# -# 1. Load this script into your interactive ZSH session: -# -# % source history-substring-search.zsh -# -# If you want to use the zsh-syntax-highlighting[6] script along with this -# script, then make sure that you load it *before* you load this script: -# -# % source zsh-syntax-highlighting.zsh -# % source history-substring-search.zsh -# -# 2. Type any part of any previous command and then: -# -# * Press the UP arrow key to select the nearest command that (1) contains -# your query and (2) is older than the current command in the command -# history. -# -# * Press the DOWN arrow key to select the nearest command that (1) -# contains your query and (2) is newer than the current command in the -# command history. -# -# * Press ^U (the Control and U keys simultaneously) to abort the search. -# -# 3. If a matching command spans more than one line of text, press the LEFT -# arrow key to move the cursor away from the end of the command, and then: -# -# * Press the UP arrow key to move the cursor to the line above. When the -# cursor reaches the first line of the command, pressing the UP arrow -# key again will cause this script to perform another search. -# -# * Press the DOWN arrow key to move the cursor to the line below. When -# the cursor reaches the last line of the command, pressing the DOWN -# arrow key again will cause this script to perform another search. -# -#----------------------------------------------------------------------------- -# Configuration -#----------------------------------------------------------------------------- -# -# This script defines the following global variables. You may override their -# default values only after having loaded this script into your ZSH session. -# -# * HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND is a global variable that defines -# how the query should be highlighted inside a matching command. Its default -# value causes this script to highlight using bold, white text on a magenta -# background. See the "Character Highlighting" section in the zshzle(1) man -# page to learn about the kinds of values you may assign to this variable. -# -# * HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND is a global variable that -# defines how the query should be highlighted when no commands in the -# history match it. Its default value causes this script to highlight using -# bold, white text on a red background. See the "Character Highlighting" -# section in the zshzle(1) man page to learn about the kinds of values you -# may assign to this variable. -# -# * HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS is a global variable that defines -# how the command history will be searched for your query. Its default value -# causes this script to perform a case-insensitive search. See the "Globbing -# Flags" section in the zshexpn(1) man page to learn about the kinds of -# values you may assign to this variable. -# -#----------------------------------------------------------------------------- -# History -#----------------------------------------------------------------------------- -# -# This script was originally written by Peter Stephenson[2], who published it -# to the ZSH users mailing list (thereby making it public domain) in September -# 2009. It was later revised by Guido van Steen and released under the BSD -# license (see below) as part of the fizsh[3] project in January 2011. -# -# It was later extracted from fizsh[3] release 1.0.1, refactored heavily, and -# repackaged as both an oh-my-zsh plugin[4] and as an independently loadable -# ZSH script[5] by Suraj N. Kurapati in 2011. -# -# It was further developed[4] by Guido van Steen, Suraj N. Kurapati, Sorin -# Ionescu, and Vincent Guerci in 2011. -# -# [1]: http://fishshell.com -# [2]: http://www.zsh.org/mla/users/2009/msg00818.html -# [3]: http://sourceforge.net/projects/fizsh/ -# [4]: https://github.com/robbyrussell/oh-my-zsh/pull/215 -# [5]: https://github.com/sunaku/zsh-history-substring-search -# [6]: https://github.com/nicoulaj/zsh-syntax-highlighting -# -############################################################################## -# -# Copyright (c) 2009 Peter Stephenson -# Copyright (c) 2011 Guido van Steen -# Copyright (c) 2011 Suraj N. Kurapati -# Copyright (c) 2011 Sorin Ionescu -# Copyright (c) 2011 Vincent Guerci -# All rights reserved. -# -# Redistribution and use 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 the FIZSH nor the names of its contributors -# may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# 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 HOLDER 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. -# -############################################################################## - -#----------------------------------------------------------------------------- -# configuration variables -#----------------------------------------------------------------------------- - -HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' -HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' -HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' - -#----------------------------------------------------------------------------- -# the main ZLE widgets -#----------------------------------------------------------------------------- - -function history-substring-search-up() { - _history-substring-search-begin - - _history-substring-search-up-history || - _history-substring-search-up-buffer || - _history-substring-search-up-search - - _history-substring-search-end -} - -function history-substring-search-down() { - _history-substring-search-begin - - _history-substring-search-down-history || - _history-substring-search-down-buffer || - _history-substring-search-down-search - - _history-substring-search-end -} - -zle -N history-substring-search-up -zle -N history-substring-search-down - -bindkey '\e[A' history-substring-search-up -bindkey '\e[B' history-substring-search-down - -#----------------------------------------------------------------------------- -# implementation details -#----------------------------------------------------------------------------- - -setopt extendedglob -zmodload -F zsh/parameter - -# -# We have to "override" some keys and widgets if the -# zsh-syntax-highlighting plugin has not been loaded: -# -# https://github.com/nicoulaj/zsh-syntax-highlighting -# -if [[ $+functions[_zsh_highlight] -eq 0 ]]; then - # - # Dummy implementation of _zsh_highlight() - # that simply removes existing highlights - # - function _zsh_highlight() { - region_highlight=() - } - - # - # Remove existing highlights when the user - # inserts printable characters into $BUFFER - # - function ordinary-key-press() { - if [[ $KEYS == [[:print:]] ]]; then - region_highlight=() - fi - zle .self-insert - } - zle -N self-insert ordinary-key-press - - # - # Override ZLE widgets to invoke _zsh_highlight() - # - # https://github.com/nicoulaj/zsh-syntax-highlighting/blob/ - # bb7fcb79fad797a40077bebaf6f4e4a93c9d8163/zsh-syntax-highlighting.zsh#L121 - # - #--------------8<-------------------8<-------------------8<----------------- - # - # Copyright (c) 2010-2011 zsh-syntax-highlighting contributors - # All rights reserved. - # - # Redistribution and use 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 the zsh-syntax-highlighting contributors nor the - # names of its contributors may be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # 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 HOLDER 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. - - # Load ZSH module zsh/zleparameter, needed to override user defined widgets. - zmodload zsh/zleparameter 2>/dev/null || { - echo 'zsh-syntax-highlighting: failed loading zsh/zleparameter, exiting.' >&2 - return -1 - } - - # Override ZLE widgets to make them invoke _zsh_highlight. - for event in ${${(f)"$(zle -la)"}:#(_*|orig-*|.run-help|.which-command)}; do - if [[ "$widgets[$event]" == completion:* ]]; then - eval "zle -C orig-$event ${${${widgets[$event]}#*:}/:/ } ; $event() { builtin zle orig-$event && _zsh_highlight } ; zle -N $event" - else - case $event in - accept-and-menu-complete) - eval "$event() { builtin zle .$event && _zsh_highlight } ; zle -N $event" - ;; - - # The following widgets should NOT remove any previously - # applied highlighting. Therefore we do not remap them. - .forward-char|.backward-char|.up-line-or-history|.down-line-or-history) - ;; - - .*) - clean_event=$event[2,${#event}] # Remove the leading dot in the event name - case ${widgets[$clean_event]-} in - (completion|user):*) - ;; - *) - eval "$clean_event() { builtin zle $event && _zsh_highlight } ; zle -N $clean_event" - ;; - esac - ;; - *) - ;; - esac - fi - done - unset event clean_event - #-------------->8------------------->8------------------->8----------------- -fi - -function _history-substring-search-begin() { - _history_substring_search_move_cursor_eol=false - _history_substring_search_query_highlight= - - # - # Continue using the previous $_history_substring_search_result by default, - # unless the current query was cleared or a new/different query was entered. - # - if [[ -z $BUFFER || $BUFFER != $_history_substring_search_result ]]; then - # - # For the purpose of highlighting we will also keep - # a version without doubly-escaped meta characters. - # - _history_substring_search_query=$BUFFER - - # - # $BUFFER contains the text that is in the command-line currently. - # we put an extra "\\" before meta characters such as "\(" and "\)", - # so that they become "\\\(" and "\\\)". - # - _history_substring_search_query_escaped=${BUFFER//(#m)[\][()|\\*?#<>~^]/\\$MATCH} - - # - # Find all occurrences of the search query in the history file. - # - # (k) turns it an array of line numbers. - # - # (on) seems to remove duplicates, which are default - # options. They can be turned off by (ON). - # - _history_substring_search_matches=(${(kon)history[(R)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)*${_history_substring_search_query_escaped}*]}) - - # - # Define the range of values that $_history_substring_search_match_index - # can take: [0, $_history_substring_search_matches_count_plus]. - # - _history_substring_search_matches_count=$#_history_substring_search_matches - _history_substring_search_matches_count_plus=$(( _history_substring_search_matches_count + 1 )) - _history_substring_search_matches_count_sans=$(( _history_substring_search_matches_count - 1 )) - - # - # If $_history_substring_search_match_index is equal to - # $_history_substring_search_matches_count_plus, this indicates that we - # are beyond the beginning of $_history_substring_search_matches. - # - # If $_history_substring_search_match_index is equal to 0, this indicates - # that we are beyond the end of $_history_substring_search_matches. - # - # If we have initially pressed "up" we have to initialize - # $_history_substring_search_match_index to - # $_history_substring_search_matches_count_plus so that it will be - # decreased to $_history_substring_search_matches_count. - # - # If we have initially pressed "down" we have to initialize - # $_history_substring_search_match_index to - # $_history_substring_search_matches_count so that it will be increased to - # $_history_substring_search_matches_count_plus. - # - if [[ $WIDGET == history-substring-search-down ]]; then - _history_substring_search_match_index=$_history_substring_search_matches_count - else - _history_substring_search_match_index=$_history_substring_search_matches_count_plus - fi - fi -} - -function _history-substring-search-end() { - _history_substring_search_result=$BUFFER - - # move the cursor to the end of the command line - if [[ $_history_substring_search_move_cursor_eol == true ]]; then - CURSOR=${#BUFFER} - fi - - # highlight command line using zsh-syntax-highlighting - _zsh_highlight - - # highlight the search query inside the command line - if [[ -n $_history_substring_search_query_highlight && -n $_history_substring_search_query ]]; then - # - # The following expression yields a variable $MBEGIN, which - # indicates the begin position + 1 of the first occurrence - # of _history_substring_search_query_escaped in $BUFFER. - # - : ${(S)BUFFER##(#m$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)($_history_substring_search_query##)} - local begin=$(( MBEGIN - 1 )) - local end=$(( begin + $#_history_substring_search_query )) - region_highlight+=("$begin $end $_history_substring_search_query_highlight") - fi - - # For debugging purposes: - # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} - # read -k -t 200 && zle -U $REPLY - - # Exit successfully from the history-substring-search-* widgets. - true -} - -function _history-substring-search-up-buffer() { - # - # Check if the UP arrow was pressed to move the cursor within a multi-line - # buffer. This amounts to three tests: - # - # 1. $#buflines -gt 1. - # - # 2. $CURSOR -ne $#BUFFER. - # - # 3. Check if we are on the first line of the current multi-line buffer. - # If so, pressing UP would amount to leaving the multi-line buffer. - # - # We check this by adding an extra "x" to $LBUFFER, which makes - # sure that xlbuflines is always equal to the number of lines - # until $CURSOR (including the line with the cursor on it). - # - local buflines XLBUFFER xlbuflines - buflines=(${(f)BUFFER}) - XLBUFFER=$LBUFFER"x" - xlbuflines=(${(f)XLBUFFER}) - - if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xlbuflines -ne 1 ]]; then - zle up-line-or-history - return true - fi - - false -} - -function _history-substring-search-down-buffer() { - # - # Check if the DOWN arrow was pressed to move the cursor within a multi-line - # buffer. This amounts to three tests: - # - # 1. $#buflines -gt 1. - # - # 2. $CURSOR -ne $#BUFFER. - # - # 3. Check if we are on the last line of the current multi-line buffer. - # If so, pressing DOWN would amount to leaving the multi-line buffer. - # - # We check this by adding an extra "x" to $RBUFFER, which makes - # sure that xrbuflines is always equal to the number of lines - # from $CURSOR (including the line with the cursor on it). - # - local buflines XRBUFFER xrbuflines - buflines=(${(f)BUFFER}) - XRBUFFER="x"$RBUFFER - xrbuflines=(${(f)XRBUFFER}) - - if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xrbuflines -ne 1 ]]; then - zle down-line-or-history - return true - fi - - false -} - -function _history-substring-search-up-history() { - # - # Behave like up in ZSH, except clear the $BUFFER - # when beginning of history is reached like in Fish. - # - if [[ -z $_history_substring_search_query ]]; then - - # we have reached the absolute top of history - if [[ $HISTNO -eq 1 ]]; then - BUFFER= - - # going up from somewhere below the top of history - else - zle up-history - fi - - return true - fi - - false -} - -function _history-substring-search-down-history() { - # - # Behave like down-history in ZSH, except clear the - # $BUFFER when end of history is reached like in Fish. - # - if [[ -z $_history_substring_search_query ]]; then - - # going down from the absolute top of history - if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then - BUFFER=${history[1]} - _history_substring_search_move_cursor_eol=true - - # going down from somewhere above the bottom of history - else - zle down-history - fi - - return true - fi - - false -} - -function _history-substring-search-up-search() { - _history_substring_search_move_cursor_eol=true - - # - # Highlight matches during history-substring-up-search: - # - # The following constants have been initialized in - # _history-substring-search-up/down-search(): - # - # $_history_substring_search_matches is the current list of matches - # $_history_substring_search_matches_count is the current number of matches - # $_history_substring_search_matches_count_plus is the current number of matches + 1 - # $_history_substring_search_matches_count_sans is the current number of matches - 1 - # $_history_substring_search_match_index is the index of the current match - # - # The range of values that $_history_substring_search_match_index can take - # is: [0, $_history_substring_search_matches_count_plus]. A value of 0 - # indicates that we are beyond the end of - # $_history_substring_search_matches. A value of - # $_history_substring_search_matches_count_plus indicates that we are beyond - # the beginning of $_history_substring_search_matches. - # - # In _history-substring-search-up-search() the initial value of - # $_history_substring_search_match_index is - # $_history_substring_search_matches_count_plus. This value is set in - # _history-substring-search-begin(). _history-substring-search-up-search() - # will initially decrease it to $_history_substring_search_matches_count. - # - if [[ $_history_substring_search_match_index -ge 2 ]]; then - # - # Highlight the next match: - # - # 1. Decrease the value of $_history_substring_search_match_index. - # - # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index-- )) - BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - - elif [[ $_history_substring_search_match_index -eq 1 ]]; then - # - # We will move beyond the end of $_history_substring_search_matches: - # - # 1. Decrease the value of $_history_substring_search_match_index. - # - # 2. Save the current buffer in $_history_substring_search_old_buffer, - # so that it can be retrieved by - # _history-substring-search-down-search() later. - # - # 3. Make $BUFFER equal to $_history_substring_search_query. - # - # 4. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index-- )) - _history_substring_search_old_buffer=$BUFFER - BUFFER=$_history_substring_search_query - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - - elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count_plus ]]; then - # - # We were beyond the beginning of $_history_substring_search_matches but - # UP makes us move back to $_history_substring_search_matches: - # - # 1. Decrease the value of $_history_substring_search_match_index. - # - # 2. Restore $BUFFER from $_history_substring_search_old_buffer. - # - # 3. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index-- )) - BUFFER=$_history_substring_search_old_buffer - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - fi -} - -function _history-substring-search-down-search() { - _history_substring_search_move_cursor_eol=true - - # - # Highlight matches during history-substring-up-search: - # - # The following constants have been initialized in - # _history-substring-search-up/down-search(): - # - # $_history_substring_search_matches is the current list of matches - # $_history_substring_search_matches_count is the current number of matches - # $_history_substring_search_matches_count_plus is the current number of matches + 1 - # $_history_substring_search_matches_count_sans is the current number of matches - 1 - # $_history_substring_search_match_index is the index of the current match - # - # The range of values that $_history_substring_search_match_index can take - # is: [0, $_history_substring_search_matches_count_plus]. A value of 0 - # indicates that we are beyond the end of - # $_history_substring_search_matches. A value of - # $_history_substring_search_matches_count_plus indicates that we are beyond - # the beginning of $_history_substring_search_matches. - # - # In _history-substring-search-down-search() the initial value of - # $_history_substring_search_match_index is - # $_history_substring_search_matches_count. This value is set in - # _history-substring-search-begin(). - # _history-substring-search-down-search() will initially increase it to - # $_history_substring_search_matches_count_plus. - # - if [[ $_history_substring_search_match_index -le $_history_substring_search_matches_count_sans ]]; then - # - # Highlight the next match: - # - # 1. Increase $_history_substring_search_match_index by 1. - # - # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index++ )) - BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - - elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count ]]; then - # - # We will move beyond the beginning of $_history_substring_search_matches: - # - # 1. Increase $_history_substring_search_match_index by 1. - # - # 2. Save the current buffer in $_history_substring_search_old_buffer, so - # that it can be retrieved by _history-substring-search-up-search() - # later. - # - # 3. Make $BUFFER equal to $_history_substring_search_query. - # - # 4. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index++ )) - _history_substring_search_old_buffer=$BUFFER - BUFFER=$_history_substring_search_query - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - - elif [[ $_history_substring_search_match_index -eq 0 ]]; then - # - # We were beyond the end of $_history_substring_search_matches but DOWN - # makes us move back to the $_history_substring_search_matches: - # - # 1. Increase $_history_substring_search_match_index by 1. - # - # 2. Restore $BUFFER from $_history_substring_search_old_buffer. - # - # 3. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - (( _history_substring_search_match_index++ )) - BUFFER=$_history_substring_search_old_buffer - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - fi -} - -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et diff --git a/dot.oh-my-zsh/plugins/history/history.plugin.zsh b/dot.oh-my-zsh/plugins/history/history.plugin.zsh deleted file mode 100644 index 0f4aa4b..0000000 --- a/dot.oh-my-zsh/plugins/history/history.plugin.zsh +++ /dev/null @@ -1,8 +0,0 @@ -alias h='history' - -function hs -{ - history | grep $* -} - -alias hsi='hs -i' diff --git a/dot.oh-my-zsh/plugins/jake-node/jake-node.plugin.zsh b/dot.oh-my-zsh/plugins/jake-node/jake-node.plugin.zsh deleted file mode 100644 index a9eef40..0000000 --- a/dot.oh-my-zsh/plugins/jake-node/jake-node.plugin.zsh +++ /dev/null @@ -1,14 +0,0 @@ -#---oh-my-zsh plugin : task Autocomplete for Jake tool--- -# Jake : https://github.com/mde/jake -# Warning : Jakefile should have the right case : Jakefile or jakefile -# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10 -# Author : Alexandre Lacheze (@al3xstrat) -# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh - -function _jake () { - if [ -f Jakefile ]||[ -f jakefile ]; then - compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"` - fi -} - -compdef _jake jake \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/jira/jira.plugin.zsh b/dot.oh-my-zsh/plugins/jira/jira.plugin.zsh deleted file mode 100644 index b91f93c..0000000 --- a/dot.oh-my-zsh/plugins/jira/jira.plugin.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# To use: add a .jira-url file in the base of your project -# You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory -# .jira-url in the current directory takes precedence -# -# If you use Rapid Board, set: -#JIRA_RAPID_BOARD="yes" -# in you .zshrc -# -# Setup: cd to/my/project -# echo "https://name.jira.com" >> .jira-url -# Usage: jira # opens a new issue -# jira ABC-123 # Opens an existing issue -open_jira_issue () { - if [ -f .jira-url ]; then - jira_url=$(cat .jira-url) - elif [ -f ~/.jira-url ]; then - jira_url=$(cat ~/.jira-url) - elif [[ "x$JIRA_URL" != "x" ]]; then - jira_url=$JIRA_URL - else - echo "JIRA url is not specified anywhere." - return 0 - fi - - if [ -z "$1" ]; then - echo "Opening new issue" - `open $jira_url/secure/CreateIssue!default.jspa` - else - echo "Opening issue #$1" - if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then - `open $jira_url/issues/$1` - else - `open $jira_url/browse/$1` - fi - fi -} - -alias jira='open_jira_issue' diff --git a/dot.oh-my-zsh/plugins/jruby/jruby.plugin.zsh b/dot.oh-my-zsh/plugins/jruby/jruby.plugin.zsh deleted file mode 100755 index bb7975b..0000000 --- a/dot.oh-my-zsh/plugins/jruby/jruby.plugin.zsh +++ /dev/null @@ -1,4 +0,0 @@ -# Aliases -alias jrspec='jruby --debug -S rspec --debug' -alias jprofile='jruby --profile.api -S rspec' -alias jexec='jruby -S' diff --git a/dot.oh-my-zsh/plugins/kate/kate.plugin.zsh b/dot.oh-my-zsh/plugins/kate/kate.plugin.zsh deleted file mode 100644 index eb16522..0000000 --- a/dot.oh-my-zsh/plugins/kate/kate.plugin.zsh +++ /dev/null @@ -1,9 +0,0 @@ - -# Kate -# Start kate always silent -alias kate='kate >/dev/null 2>&1' - -function kt () { - cd $1 - kate $1 -} \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/knife/_knife b/dot.oh-my-zsh/plugins/knife/_knife deleted file mode 100644 index dec4912..0000000 --- a/dot.oh-my-zsh/plugins/knife/_knife +++ /dev/null @@ -1,185 +0,0 @@ -#compdef knife - -# These flags should be available everywhere according to man knife -knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes ) - -# knife has a very special syntax, some example calls are: -# knife status -# knife cookbook list -# knife role show ROLENAME -# knife data bag show DATABAGNAME -# knife role show ROLENAME --attribute ATTRIBUTENAME -# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes - -# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces -_knife() { - local curcontext="$curcontext" state line - typeset -A opt_args - cloudproviders=(bluebox ec2 rackspace slicehost terremark) - _arguments \ - '1: :->knifecmd'\ - '2: :->knifesubcmd'\ - '3: :->knifesubcmd2' \ - '4: :->knifesubcmd3' \ - '5: :->knifesubcmd4' \ - '6: :->knifesubcmd5' - - case $state in - knifecmd) - compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders - ;; - knifesubcmd) - case $words[2] in - (bluebox|ec2|rackspace|slicehost|terremark) - compadd "$@" server images - ;; - client) - compadd -Q "$@" "bulk delete" list create show delete edit reregister - ;; - configure) - compadd "$@" client - ;; - cookbook) - compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload - ;; - environment) - compadd -Q "$@" list create delete edit show "from file" - ;; - node) - compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete" - ;; - recipe) - compadd "$@" list - ;; - role) - compadd -Q "$@" "bulk delete" create delete edit "from file" list show - ;; - windows) - compadd "$@" bootstrap - ;; - *) - _arguments '2:Subsubcommands:($(_knife_options1))' - esac - ;; - knifesubcmd2) - case $words[3] in - server) - compadd "$@" list create delete - ;; - images) - compadd "$@" list - ;; - site) - compadd "$@" vendor show share search download list unshare - ;; - (show|delete|edit) - _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))' - ;; - (upload|test) - _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)' - ;; - list) - compadd -a "$@" knife_general_flags - ;; - bag) - compadd -Q "$@" show edit list "from file" create delete - ;; - *) - _arguments '3:Subsubcommands:($(_knife_options2))' - esac - ;; - knifesubcmd3) - case $words[3] in - show) - case $words[2] in - cookbook) - versioncomp=1 - _arguments '4:Cookbookversions:($(_cookbook_versions) latest)' - ;; - (node|client|role) - compadd "$@" --attribute - esac - esac - case $words[4] in - (show|edit) - _arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))' - ;; - file) - _arguments '*:file or directory:_files -g "*.(rb|json)"' - ;; - list) - compadd -a "$@" knife_general_flags - ;; - *) - _arguments '*:Subsubcommands:($(_knife_options3))' - esac - ;; - knifesubcmd4) - if (( versioncomp > 0 )); then - compadd "$@" attributes definitions files libraries providers recipes resources templates - else - _arguments '*:Subsubcommands:($(_knife_options2))' - fi - ;; - knifesubcmd5) - _arguments '*:Subsubcommands:($(_knife_options3))' - esac -} - -# Helper functions to provide the argument completion for several depths of commands -_knife_options1() { - ( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -_knife_options2() { - ( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -_knife_options3() { - ( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -# The chef_x_remote functions use knife to get a list of objects of type x on the server -_chef_roles_remote() { - (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_clients_remote() { - (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_nodes_remote() { - (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_cookbooks_remote() { - (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_sitecookbooks_remote() { - (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_data_bags_remote() { - (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') -} - -_chef_environments_remote() { - (knife environment list | awk '{print $1}') -} - -# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server -_chef_cookbooks_local() { - local knife_rb="$HOME/.chef/knife.rb" - if [ -f ./.chef/knife.rb ]; then - knife_rb="./.chef/knife.rb" - fi - (for i in $( grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done) -} - -# This function extracts the available cookbook versions on the chef server -_cookbook_versions() { - (knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g') -} - -_knife "$@" diff --git a/dot.oh-my-zsh/plugins/laravel/_artisan b/dot.oh-my-zsh/plugins/laravel/_artisan deleted file mode 100644 index 8637514..0000000 --- a/dot.oh-my-zsh/plugins/laravel/_artisan +++ /dev/null @@ -1,40 +0,0 @@ -#compdef artisan - -# Laravel autocompletion -# Author: John Hamelink -# -# This plugin does the following: -# - Adds aliases and autocompletion for artisan -# - Adds aliases and autocompletion for bob - -local curcontext="$curcontext" state line _opts _bundles ret=1 -_arguments -C \ - '1: :->cmds' \ - '*:: :->args' && ret=0 - -case $state in - cmds) - - _values "Artisan command" \ - 'session\:install[Create a session table]' \ - 'migrate[Manage Migrations]' \ - 'test[Run a test]' \ - 'route\:\:call[Call a route in the CLI]' \ - 'key\:\:generate[Generate a key]' - ret=0 - ;; - args) - case $line[1] in - migrate) - _values \ - 'install[Create the Laravel migration table' \ - 'make[Create a migration]' \ - 'rollback[Roll back to the last migration operation]' \ - 'reset[Roll back all migrations that have ever run]' - ret=0 - ;; - esac - ;; -esac - -return ret diff --git a/dot.oh-my-zsh/plugins/laravel/laravel.plugin.zsh b/dot.oh-my-zsh/plugins/laravel/laravel.plugin.zsh deleted file mode 100644 index ed932ee..0000000 --- a/dot.oh-my-zsh/plugins/laravel/laravel.plugin.zsh +++ /dev/null @@ -1,3 +0,0 @@ -#!zsh -alias artisan='php artisan' -alias bob='php artisan bob::build' diff --git a/dot.oh-my-zsh/plugins/last-working-dir/last-working-dir.plugin.zsh b/dot.oh-my-zsh/plugins/last-working-dir/last-working-dir.plugin.zsh deleted file mode 100644 index 190bc27..0000000 --- a/dot.oh-my-zsh/plugins/last-working-dir/last-working-dir.plugin.zsh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env zsh -# Keeps track of the last used working directory and automatically jumps -# into it for new shells. - -# Flag indicating if we've previously jumped to last directory. -typeset -g ZSH_LAST_WORKING_DIRECTORY -mkdir -p "$ZSH/cache" -local cache_file="$ZSH/cache/last-working-dir" - -# Updates the last directory once directory is changed. -function chpwd() { - echo "$PWD" > "$cache_file" -} - -# Changes directory to the last working directory. -function lwd() { - [[ ! -r "$cache_file" ]] || cd `cat "$cache_file"` -} - -# Automatically jump to last working directory unless this isn't the first time -# this plugin has been loaded. -if [[ -z "$ZSH_LAST_WORKING_DIRECTORY" ]]; then - lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true -fi diff --git a/dot.oh-my-zsh/plugins/lein/lein.plugin.zsh b/dot.oh-my-zsh/plugins/lein/lein.plugin.zsh deleted file mode 100644 index 11c9297..0000000 --- a/dot.oh-my-zsh/plugins/lein/lein.plugin.zsh +++ /dev/null @@ -1,41 +0,0 @@ -function _lein_commands() { - local ret=1 state - _arguments ':subcommand:->subcommand' && ret=0 - - case $state in - subcommand) - subcommands=( - "classpath:print the classpath of the current project" - "clean:remove compiled files and dependencies from project" - "compile:ahead-of-time compile the project" - "deploy:build jar and deploy to remote repository" - "deps:download and install all dependencies" - "help:display a list of tasks or help for a given task" - "install:install the project and its dependencies in your local repository" - "int:enter an interactive task shell" - "interactive:enter an interactive task shell" - "jack-in:jack in to a clojure slime session from emacs." - "jar:create a jar file containing the compiled .class files" - "javac:compile java source files" - "new:create a new project skeleton" - "plugin:manage user-level plugins" - "pom:write a pom.xml file to disk for maven interop" - "repl:start a repl session either with the current project or standalone" - "retest:run only the test namespaces which failed last time around" - "run:run the project's -main function" - "search:search remote maven repositories for matching jars" - "swank:launch swank server for Emacs to connect" - "test:run the project's tests" - "test!:run a project's tests after cleaning and fetching dependencies" - "trampoline:run a task without nesting the project's JVM inside Leiningen's." - "uberjar:Create a jar including the contents of each of deps" - "upgrade:upgrade leiningen to the latest stable release" - "version:print leiningen's version" - ) - _describe -t subcommands 'leiningen subcommands' subcommands && ret=0 - esac - - return ret -} - -compdef _lein_commands lein diff --git a/dot.oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh b/dot.oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh deleted file mode 100644 index 7661c6a..0000000 --- a/dot.oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh +++ /dev/null @@ -1,16 +0,0 @@ -# To use: add a .lighthouse file into your directory with the URL to the -# individual project. For example: -# https://rails.lighthouseapp.com/projects/8994 -# Example usage: http://screencast.com/t/ZDgwNDUwNT -open_lighthouse_ticket () { - if [ ! -f .lighthouse-url ]; then - echo "There is no .lighthouse-url file in the current directory..." - return 0; - else - lighthouse_url=$(cat .lighthouse-url); - echo "Opening ticket #$1"; - `open $lighthouse_url/tickets/$1`; - fi -} - -alias lho='open_lighthouse_ticket' diff --git a/dot.oh-my-zsh/plugins/lol/lol.plugin.zsh b/dot.oh-my-zsh/plugins/lol/lol.plugin.zsh deleted file mode 100644 index ae065c1..0000000 --- a/dot.oh-my-zsh/plugins/lol/lol.plugin.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# LOL!!1 -# Source: http://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh - -alias wtf='dmesg' -alias onoz='cat /var/log/errors.log' -alias rtfm='man' - -alias :3='echo' -alias visible='echo' -alias invisible='cat' -alias moar='more' -alias tldr='less' -alias alwayz='tail -f' - -alias icanhas='mkdir' -alias gimmeh='touch' -alias donotwant='rm' -alias dowant='cp' -alias gtfo='mv' -alias nowai='chmod' - -alias hai='cd' -alias iz='ls' -alias plz='pwd' -alias ihasbucket='df -h' - -alias inur='locate' -alias iminurbase='finger' - -alias btw='nice' -alias obtw='nohup' - -alias nomz='ps aux' -alias nomnom='killall' - -alias byes='exit' -alias cya='reboot' -alias kthxbai='halt' diff --git a/dot.oh-my-zsh/plugins/macports/_port b/dot.oh-my-zsh/plugins/macports/_port deleted file mode 100644 index 06d7fb4..0000000 --- a/dot.oh-my-zsh/plugins/macports/_port +++ /dev/null @@ -1,89 +0,0 @@ -#compdef port - -local subcmds - -# we cache the list of ports -# we shall use some cache policy to avoid problems with new ports -if (( ! $+portlist )); then - portlist=($(port echo all; echo "all current active inactive installed uninstalled outdated")) -fi - -subcmds=( -'activate' -'archive' -'build' -'cat' -'clean' -'configure' -'contents' -'deactivate' -'dependents' -'deps' -'destroot' -'dir' -'distcheck' -'distclean' -'dmg' -'echo' -'edit' -'extract' -'fetch' -'file' -'help' -'info' -'install' -'installed' -'list' -'livecheck' -'location' -'mpkg' -'outdated' -'patch' -'pkg' -'provides' -'rpmpackage' -'search' -'selfupdate' -'sync' -'test' -'unarchive' -'uninstall' -'upgrade' -'variants' -'version' -) - -_arguments -C \ -'-v[verbose mode (generate verbose messages)]' \ -'-d[debug mode (generate debugging messages)]' \ -'-q[quiet mode (suppress messages)]' \ -'-D[specify portdir]' \ -'-k[keep mode (do not autoclean after install)]' \ -'-n[dont follow dependencies in upgrade (only for upgrading)]' \ -'-a[upgrade all installed ports (only for upgrading)]' \ -'-u[uninstall non-active ports when upgrading and uninstalling]' \ -'-f[force mode (ignore state file)]' \ -'-s[source-only mode]' \ -'-b[binary-only mode]' \ -'-o[honor state files older than Portfile]' \ -'*::command:->command' \ -&& return 0 - -case $state in - command) - if ((CURRENT == 1)); then - state=subcommands - else - state=portname - fi - ;; -esac - -case $state in - subcommands) - _describe -t commands 'port commands' subcmds - ;; - portname) - _describe -t commands 'available ports' portlist - ;; -esac diff --git a/dot.oh-my-zsh/plugins/macports/macports.plugin.zsh b/dot.oh-my-zsh/plugins/macports/macports.plugin.zsh deleted file mode 100644 index 277352e..0000000 --- a/dot.oh-my-zsh/plugins/macports/macports.plugin.zsh +++ /dev/null @@ -1,8 +0,0 @@ -#Aliases -alias pc="sudo port clean --all installed" -alias pi="sudo port install $1" -alias psu="sudo port selfupdate" -alias puni="sudo port uninstall inactive" -alias puo="sudo port upgrade outdated" -alias pup="psu && puo" - diff --git a/dot.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh b/dot.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh deleted file mode 100644 index a3a6ff8..0000000 --- a/dot.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh +++ /dev/null @@ -1,20 +0,0 @@ - -# Mercurial -alias hgc='hg commit' -alias hgb='hg branch' -alias hgba='hg branches' -alias hgco='hg checkout' -alias hgd='hg diff' -alias hged='hg diffmerge' -# pull and update -alias hgl='hg pull -u' -alias hgp='hg push' -alias hgs='hg status' -# this is the 'git commit --amend' equivalent -alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' - -function hg_current_branch() { - if [ -d .hg ]; then - echo hg:$(hg branch) - fi -} \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/mvn/mvn.plugin.zsh b/dot.oh-my-zsh/plugins/mvn/mvn.plugin.zsh deleted file mode 100644 index da29b4f..0000000 --- a/dot.oh-my-zsh/plugins/mvn/mvn.plugin.zsh +++ /dev/null @@ -1,170 +0,0 @@ -# mvn-color based on https://gist.github.com/1027800 -export BOLD=`tput bold` -export UNDERLINE_ON=`tput smul` -export UNDERLINE_OFF=`tput rmul` -export TEXT_BLACK=`tput setaf 0` -export TEXT_RED=`tput setaf 1` -export TEXT_GREEN=`tput setaf 2` -export TEXT_YELLOW=`tput setaf 3` -export TEXT_BLUE=`tput setaf 4` -export TEXT_MAGENTA=`tput setaf 5` -export TEXT_CYAN=`tput setaf 6` -export TEXT_WHITE=`tput setaf 7` -export BACKGROUND_BLACK=`tput setab 0` -export BACKGROUND_RED=`tput setab 1` -export BACKGROUND_GREEN=`tput setab 2` -export BACKGROUND_YELLOW=`tput setab 3` -export BACKGROUND_BLUE=`tput setab 4` -export BACKGROUND_MAGENTA=`tput setab 5` -export BACKGROUND_CYAN=`tput setab 6` -export BACKGROUND_WHITE=`tput setab 7` -export RESET_FORMATTING=`tput sgr0` - - -# Wrapper function for Maven's mvn command. -mvn-color() -{ - # Filter mvn output using sed - mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \ - -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \ - -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" - - # Make sure formatting is reset - echo -ne ${RESET_FORMATTING} -} - -# Override the mvn command with the colorized one. -#alias mvn="mvn-color" - -# aliases -alias mvncie='mvn clean install eclipse:eclipse' -alias mvnci='mvn clean install' -alias mvne='mvn eclipse:eclipse' -alias mvnce='mvn clean eclipse:clean eclipse:eclipse' -alias mvnd='mvn deploy' -alias mvnp='mvn package' -alias mvnc='mvn clean' -alias mvncom='mvn compile' -alias mvnt='mvn test' -alias mvnag='mvn archetype:generate' - -function listMavenCompletions { - reply=( - # common lifecycle - clean process-resources compile process-test-resources test-compile test package verify install deploy site - - # common plugins - deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt - - # deploy - deploy:deploy-file - # failsafe - failsafe:integration-test failsafe:verify - # install - install:install-file - # site - site:site site:deploy site:run site:stage site:stage-deploy - # surefire - surefire:test - - # checkstyle - checkstyle:checkstyle checkstyle:check - # javadoc - javadoc:javadoc javadoc:jar javadoc:aggregate - # jxr - jxr:jxr - # pmd - pmd:pmd pmd:cpd pmd:check pmd:cpd-check - - # ant - ant:ant ant:clean - # antrun - antrun:run - # archetype - archetype:generate archetype:create-from-project archetype:crawl - # assembly - assembly:single assembly:assembly - # dependency - dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:get dependency:go-offline dependency:list dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies - # enforcer - enforcer:enforce - # gpg - gpg:sign gpg:sign-and-deploy-file - # help - help:active-profiles help:all-profiles help:describe help:effective-pom help:effective-settings help:evaluate help:expressions help:system - # release - release:clean release:prepare release:rollback release:perform release:stage release:branch release:update-versions - # repository - repository:bundle-create repository:bundle-pack - # source - source:aggregate source:jar source:jar-no-fork - - # eclipse - eclipse:clean eclipse:eclipse - # idea - idea:clean idea:idea - - # jetty - jetty:run jetty:run-exploded - # cargo - cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help - # jboss - jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy - # tomcat - tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:undeploy - # tomcat6 - tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy - # tomcat7 - tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy - # exec - exec:exec exec:java - # versions - versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert - # scm - scm:add scm:checkin scm:checkout scm:update scm:status - # buildnumber - buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset - - # war - war:war war:exploded war:inplace war:manifest - # ear - ear:ear ear:generate-application-xml - # ejb - ejb:ejb - # android - android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices - # nexus - nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download - # repository - repository:bundle-create repository:bundle-pack repository:help - - # sonar - sonar:sonar - # license - license:format license:check - # hibernate3 - hibernate3:hbm2ddl hibernate3:help - # liquibase - liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback - # flyway - flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate - # gwt - gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test - - # options - -Dmaven.test.skip=true -DskipTests -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven - - # arguments - -am -amd -B -C -c -cpu -D -e -emp -ep -f -fae -ff -fn -gs -h -l -N -npr -npu -nsu -o -P -pl -q -rf -s -T -t -U -up -V -v -X - - cli:execute cli:execute-phase - archetype:generate generate-sources - cobertura:cobertura - -Dtest= `if [ -d ./src ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi` - ); -} - -compctl -K listMavenCompletions mvn diff --git a/dot.oh-my-zsh/plugins/mysql-macports/mysql-macports.plugin.zsh b/dot.oh-my-zsh/plugins/mysql-macports/mysql-macports.plugin.zsh deleted file mode 100644 index c39563f..0000000 --- a/dot.oh-my-zsh/plugins/mysql-macports/mysql-macports.plugin.zsh +++ /dev/null @@ -1,8 +0,0 @@ -# commands to control local mysql-server installation -# paths are for osx installation via macports - -alias mysqlstart='sudo /opt/local/share/mysql5/mysql/mysql.server start' -alias mysqlstop='sudo /opt/local/share/mysql5/mysql/mysql.server stop' -alias mysqlrestart='sudo /opt/local/share/mysql5/mysql/mysql.server restart' - -alias mysqlstatus='mysqladmin5 -u root -p ping' diff --git a/dot.oh-my-zsh/plugins/nanoc/_nanoc b/dot.oh-my-zsh/plugins/nanoc/_nanoc deleted file mode 100644 index fde07c3..0000000 --- a/dot.oh-my-zsh/plugins/nanoc/_nanoc +++ /dev/null @@ -1,44 +0,0 @@ -#compdef nanoc -#autoload - -# nanoc zsh completion - based on the homebrew zsh completion -# requires the 'nanoc' gem to be installed - -local -a _1st_arguments -_1st_arguments=( - 'autocompile:start the autocompiler' - 'compile:compile items of this site' - 'create-item:create an item' - 'create-layout:create a layout' - 'create-site:create a site' - 'deploy:deploy the compiled site' - 'help:show help' - 'prune:remove files not managed by nanoc from the output directory' - 'show-data:show data in this site' - 'show-plugins:show all available plugins' - 'show-rules:describe the rules for each item' - 'update:update the data stored by the data source to a newer version' - 'validate-css:validate the site’s CSS' - 'validate-html:validate the site’s HTML' - 'validate-links:validate links in site' - 'view:start the web server that serves static files' - 'watch:start the watcher' -) - -local expl -local -a pkgs installed_pkgs - -_arguments \ - '(--color)--color[enable color]' \ - '(--debug)--debug[enable debugging]' \ - '(--help)--help[show the help message and quit]' \ - '(--no-color)--no-color[disable color]' \ - '(--verbose)--verbose[make nanoc output more detailed]' \ - '(--version)--version[show version information and quit]' \ - '(--warn)--warn[enable warnings]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "nanoc subcommand" _1st_arguments - return -fi diff --git a/dot.oh-my-zsh/plugins/nanoc/nanoc.plugin.zsh b/dot.oh-my-zsh/plugins/nanoc/nanoc.plugin.zsh deleted file mode 100644 index 5a50646..0000000 --- a/dot.oh-my-zsh/plugins/nanoc/nanoc.plugin.zsh +++ /dev/null @@ -1,9 +0,0 @@ -alias n='nanoc' -alias na='nanoc autocompile' -alias nco='nanoc compile' -alias nci='nanoc create_item' -alias ncl='nanoc create_layout' -alias ncs='nanoc create_site' -alias nd='nanoc deploy' -alias nv='nanoc view' -alias nw='nanoc watch' diff --git a/dot.oh-my-zsh/plugins/node/node.plugin.zsh b/dot.oh-my-zsh/plugins/node/node.plugin.zsh deleted file mode 100644 index 3bbed6f..0000000 --- a/dot.oh-my-zsh/plugins/node/node.plugin.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Open the node api for your current version to the optional section. -# TODO: Make the section part easier to use. -function node-docs { - open "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1" -} diff --git a/dot.oh-my-zsh/plugins/npm/npm.plugin.zsh b/dot.oh-my-zsh/plugins/npm/npm.plugin.zsh deleted file mode 100644 index c3eb91d..0000000 --- a/dot.oh-my-zsh/plugins/npm/npm.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -eval "$(npm completion 2>/dev/null)" diff --git a/dot.oh-my-zsh/plugins/nyan/nyan.plugin.zsh b/dot.oh-my-zsh/plugins/nyan/nyan.plugin.zsh deleted file mode 100644 index 6321e5f..0000000 --- a/dot.oh-my-zsh/plugins/nyan/nyan.plugin.zsh +++ /dev/null @@ -1,5 +0,0 @@ -if [[ -x `which nc` ]]; then - alias nyan='nc -v miku.acm.uiuc.edu 23' # nyan cat -fi - - diff --git a/dot.oh-my-zsh/plugins/osx/_man-preview b/dot.oh-my-zsh/plugins/osx/_man-preview deleted file mode 100644 index 6cc344a..0000000 --- a/dot.oh-my-zsh/plugins/osx/_man-preview +++ /dev/null @@ -1,5 +0,0 @@ -#compdef man-preview -#autoload - -_man - diff --git a/dot.oh-my-zsh/plugins/osx/osx.plugin.zsh b/dot.oh-my-zsh/plugins/osx/osx.plugin.zsh deleted file mode 100644 index f278d4f..0000000 --- a/dot.oh-my-zsh/plugins/osx/osx.plugin.zsh +++ /dev/null @@ -1,156 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: osx.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.1.0 -# ------------------------------------------------------------------------------ - -function tab() { - local command="cd \\\"$PWD\\\"" - (( $# > 0 )) && command="${command}; $*" - - the_app=$( - osascript 2>/dev/null </dev/null </dev/null < 0 )) && command="${command}; $*" - - the_app=$( - osascript 2>/dev/null </dev/null < 0 )) && command="${command}; $*" - - the_app=$( - osascript 2>/dev/null </dev/null </dev/null </dev/null < 0 )) && qlmanage -p $* &>/dev/null & -} - -function man-preview() { - man -t "$@" | open -f -a Preview -} - -function trash() { - local trash_dir="${HOME}/.Trash" - local temp_ifs=$IFS - IFS=$'\n' - for item in "$@"; do - if [[ -e "$item" ]]; then - item_name="$(basename $item)" - if [[ -e "${trash_dir}/${item_name}" ]]; then - mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")" - else - mv -f "$item" "${trash_dir}/" - fi - fi - done - IFS=$temp_ifs -} - diff --git a/dot.oh-my-zsh/plugins/pass/_pass b/dot.oh-my-zsh/plugins/pass/_pass deleted file mode 100644 index f6c1a6c..0000000 --- a/dot.oh-my-zsh/plugins/pass/_pass +++ /dev/null @@ -1,119 +0,0 @@ -#compdef pass -#autoload - -# Copyright (C) 2012: -# Johan Venant -# Brian Mattern -# Jason A. Donenfeld . -# Santiago Borrazás -# All Rights Reserved. -# This file is licensed under the GPLv2+. Please see COPYING for more information. - - -_pass () { - local cmd - if (( CURRENT > 2)); then - cmd=${words[2]} - # Set the context for the subcommand. - curcontext="${curcontext%:*:*}:pass-$cmd" - # Narrow the range of words we are looking at to exclude `pass' - (( CURRENT-- )) - shift words - # Run the completion for the subcommand - case "${cmd}" in - init) - _arguments : \ - "-r[re-encrypt existing passwords]" \ - "--reencrypt[re-encrypt existing passwords]" - _pass_complete_keys - ;; - ls|list|edit) - _pass_complete_entries_with_subdirs - ;; - insert) - _arguments : \ - "-e[echo password to console]" \ - "--echo[echo password to console]" \ - "-m[multiline]" \ - "--multiline[multiline]" - _pass_complete_entries_with_subdirs - ;; - generate) - _arguments : \ - "-n[don't include symbols in password]" \ - "--no-symbols[don't include symbols in password]" \ - "-c[copy password to the clipboard]" \ - "--clip[copy password to the clipboard]" - _pass_complete_entries_with_subdirs - ;; - rm) - _arguments : \ - "-f[force deletion]" \ - "--force[force deletion]" \ - "-r[recursively delete]" \ - "--recursive[recursively delete]" - _pass_complete_entries_with_subdirs - ;; - git) - local -a subcommands - subcommands=( - "init:Initialize git repository" - "push:Push to remote repository" - "pull:Pull from remote repository" - "config:Show git config" - "log:Show git log" - "reflog:Show git reflog" - ) - _describe -t commands 'pass git' subcommands - ;; - show|*) - _pass_cmd_show - ;; - esac - else - local -a subcommands - subcommands=( - "init:Initialize new password storage" - "ls:List passwords" - "show:Decrypt and print a password" - "insert:Insert a new password" - "generate:Generate a new password using pwgen" - "edit:Edit a password with \$EDITOR" - "rm:Remove the password" - "git:Call git on the password store" - "version:Output version information" - "help:Output help message" - ) - _describe -t commands 'pass' subcommands - _arguments : \ - "--version[Output version information]" \ - "--help[Output help message]" - _pass_cmd_show - fi -} - -_pass_cmd_show () { - _arguments : \ - "-c[put it on the clipboard]" \ - "--clip[put it on the clipboard]" - _pass_complete_entries -} -_pass_complete_entries_helper () { - local IFS=$'\n' - local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' $(find "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) -} - -_pass_complete_entries_with_subdirs () { - _pass_complete_entries_helper -} - -_pass_complete_entries () { - _pass_complete_entries_helper -type f -} - -_pass_complete_keys () { - local IFS=$'\n' - # Extract names and email addresses from gpg --list-keys - _values 'gpg keys' $(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d') -} diff --git a/dot.oh-my-zsh/plugins/per-directory-history/per-directory-history.plugin.zsh b/dot.oh-my-zsh/plugins/per-directory-history/per-directory-history.plugin.zsh deleted file mode 100644 index 61e8b5a..0000000 --- a/dot.oh-my-zsh/plugins/per-directory-history/per-directory-history.plugin.zsh +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env zsh -# -# This is a implementation of per directory history for zsh, some -# implementations of which exist in bash[1,2]. It also implements -# a per-directory-history-toggle-history function to change from using the -# directory history to using the global history. In both cases the history is -# always saved to both the global history and the directory history, so the -# toggle state will not effect the saved histories. Being able to switch -# between global and directory histories on the fly is a novel feature as far -# as I am aware. -# -#------------------------------------------------------------------------------- -# Configuration -#------------------------------------------------------------------------------- -# -# HISTORY_BASE a global variable that defines the base directory in which the -# directory histories are stored -# -#------------------------------------------------------------------------------- -# History -#------------------------------------------------------------------------------- -# -# The idea/inspiration for a per directory history is from Stewart MacArthur[1] -# and Dieter[2], the implementation idea is from Bart Schaefer on the the zsh -# mailing list[3]. The implementation is by Jim Hester in September 2012. -# -# [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html -# [2]: http://dieter.plaetinck.be/per_directory_bash -# [3]: http://www.zsh.org/mla/users/1997/msg00226.html -# -################################################################################ -# -# Copyright (c) 2012 Jim Hester -# -# This software is provided 'as-is', without any express or implied warranty. -# In no event will the authors be held liable for any damages arising from the -# use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not claim -# that you wrote the original software. If you use this software in a product, -# an acknowledgment in the product documentation would be appreciated but is -# not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source distribution.. -# -################################################################################ - -#------------------------------------------------------------------------------- -# configuration, the base under which the directory histories are stored -#------------------------------------------------------------------------------- - -[[ -z $HISTORY_BASE ]] && HISTORY_BASE="$HOME/.directory_history" - -#------------------------------------------------------------------------------- -# toggle global/directory history used for searching - ctrl-G by default -#------------------------------------------------------------------------------- - -function per-directory-history-toggle-history() { - if [[ $_per_directory_history_is_global == true ]]; then - _per-directory-history-set-directory-history - print "\nusing local history\n" - else - _per-directory-history-set-global-history - print "\nusing global history\n" - fi - zle .push-line - zle .accept-line -} - -autoload per-directory-history-toggle-history -zle -N per-directory-history-toggle-history -bindkey '^G' per-directory-history-toggle-history - -#------------------------------------------------------------------------------- -# implementation details -#------------------------------------------------------------------------------- - -_per_directory_history_directory="$HISTORY_BASE${PWD:A}/history" - -function _per-directory-history-change-directory() { - _per_directory_history_directory="$HISTORY_BASE${PWD:A}/history" - mkdir -p ${_per_directory_history_directory:h} - if [[ $_per_directory_history_is_global == false ]]; then - #save to the global history - fc -AI $HISTFILE - #save history to previous file - local prev="$HISTORY_BASE${OLDPWD:A}/history" - mkdir -p ${prev:h} - fc -AI $prev - - #discard previous directory's history - local original_histsize=$HISTSIZE - HISTSIZE=0 - HISTSIZE=$original_histsize - - #read history in new file - if [[ -e $_per_directory_history_directory ]]; then - fc -R $_per_directory_history_directory - fi - fi -} - -function _per-directory-history-addhistory() { - print -sr -- ${1%%$'\n'} - fc -p $_per_directory_history_directory -} - - -function _per-directory-history-set-directory-history() { - if [[ $_per_directory_history_is_global == true ]]; then - fc -AI $HISTFILE - local original_histsize=$HISTSIZE - HISTSIZE=0 - HISTSIZE=$original_histsize - if [[ -e "$_per_directory_history_directory" ]]; then - fc -R "$_per_directory_history_directory" - fi - fi - _per_directory_history_is_global=false -} -function _per-directory-history-set-global-history() { - if [[ $_per_directory_history_is_global == false ]]; then - fc -AI $_per_directory_history_directory - local original_histsize=$HISTSIZE - HISTSIZE=0 - HISTSIZE=$original_histsize - if [[ -e "$HISTFILE" ]]; then - fc -R "$HISTFILE" - fi - fi - _per_directory_history_is_global=true -} - - -#add functions to the exec list for chpwd and zshaddhistory -chpwd_functions=(${chpwd_functions[@]} "_per-directory-history-change-directory") -zshaddhistory_functions=(${zshaddhistory_functions[@]} "_per-directory-history-addhistory") - -#start in directory mode -mkdir -p ${_per_directory_history_directory:h} -_per_directory_history_is_global=true -_per-directory-history-set-directory-history diff --git a/dot.oh-my-zsh/plugins/perl/perl.plugin.zsh b/dot.oh-my-zsh/plugins/perl/perl.plugin.zsh deleted file mode 100644 index f94c419..0000000 --- a/dot.oh-my-zsh/plugins/perl/perl.plugin.zsh +++ /dev/null @@ -1,62 +0,0 @@ -# https://github.com/dbbolton -# -# Below are some useful Perl-related aliases/functions that I use with zsh. - - -# Aliases ################################################################### - -# perlbrew ######## -alias pbi='perlbrew install' -alias pbl='perlbrew list' -alias pbo='perlbrew off' -alias pbs='perlbrew switch' -alias pbu='perlbrew use' - -# Perl ############ - -# perldoc` -alias pd='perldoc' - -# use perl like awk/sed -alias ple='perl -wlne' - -# show the latest stable release of Perl -alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/perl\-([\d\.]+)\.tar\.gz/) { print $1; exit;}'\' - - - -# Functions ################################################################# - -# newpl - creates a basic Perl script file and opens it with $EDITOR -newpl () { - # set $EDITOR to 'vim' if it is undefined - [[ -z $EDITOR ]] && EDITOR=vim - - # if the file exists, just open it - [[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1 - - # if it doesn't, make it, and open it - [[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\ - "\n\n" > $1 && $EDITOR $1 -} - - -# pgs - Perl Global Substitution -# find pattern = 1st arg -# replace pattern = 2nd arg -# filename = 3rd arg -pgs() { # [find] [replace] [filename] - perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3" -} - - -# Perl grep, because 'grep -P' is terrible. Lets you work with pipes or files. -prep() { # [pattern] [filename unless STDOUT] - perl -nle 'print if /'"$1"'/;' $2 -} - -# say - append a newline to 'print' -say() { - print "$1\n" -} - diff --git a/dot.oh-my-zsh/plugins/phing/phing.plugin.zsh b/dot.oh-my-zsh/plugins/phing/phing.plugin.zsh deleted file mode 100644 index 8f4adca..0000000 --- a/dot.oh-my-zsh/plugins/phing/phing.plugin.zsh +++ /dev/null @@ -1,19 +0,0 @@ -_phing_does_target_list_need_generating () { - if [ ! -f .phing_targets ]; then return 0; - else - accurate=$(stat -f%m .phing_targets) - changed=$(stat -f%m build.xml) - return $(expr $accurate '>=' $changed) - fi -} - -_phing () { - if [ -f build.xml ]; then - if _phing_does_target_list_need_generating; then - phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets - fi - compadd `cat .phing_targets` - fi -} - -compdef _phing phing diff --git a/dot.oh-my-zsh/plugins/pip/_pip b/dot.oh-my-zsh/plugins/pip/_pip deleted file mode 100644 index df53ba5..0000000 --- a/dot.oh-my-zsh/plugins/pip/_pip +++ /dev/null @@ -1,74 +0,0 @@ -#compdef pip -#autoload - -# pip zsh completion, based on homebrew completion - -_pip_all() { - # we cache the list of packages (originally from the macports plugin) - if (( ! $+piplist )); then - echo -n " (caching package index...)" - piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]')) - fi -} - -_pip_installed() { - installed_pkgs=(`pip freeze | cut -d '=' -f 1`) -} - -local -a _1st_arguments -_1st_arguments=( - 'bundle:create pybundles (archives containing multiple packages)' - 'freeze:output all currently installed packages (exact versions) to stdout' - 'help:show available commands' - 'install:install packages' - 'search:search PyPI' - 'uninstall:uninstall packages' - 'unzip:unzip individual packages' - 'zip:zip individual packages' -) - -local expl -local -a all_pkgs installed_pkgs - -_arguments \ - '(--version)--version[show version number of program and exit]' \ - '(-h --help)'{-h,--help}'[show help]' \ - '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \ - '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \ - '(-v --verbose)'{-v,--verbose}'[give more output]' \ - '(-q --quiet)'{-q,--quiet}'[give less output]' \ - '(--log)--log[log file location]' \ - '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \ - '(--timeout)--timeout[socket timeout (default 15s)]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "pip subcommand" _1st_arguments - return -fi - -case "$words[1]" in - search) - _arguments \ - '(--index)--index[base URL of Python Package Index]' ;; - freeze) - _arguments \ - '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;; - install) - _arguments \ - '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \ - '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \ - '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \ - '(--no-install)--no-install[only download packages]' \ - '(--no-download)--no-download[only install downloaded packages]' \ - '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \ - '1: :->packages' && return 0 - - if [[ "$state" == packages ]]; then - _pip_all - _wanted piplist expl 'packages' compadd -a piplist - fi ;; - uninstall) - _pip_installed - _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;; -esac diff --git a/dot.oh-my-zsh/plugins/pj/pj.plugin.zsh b/dot.oh-my-zsh/plugins/pj/pj.plugin.zsh deleted file mode 100644 index ba3765b..0000000 --- a/dot.oh-my-zsh/plugins/pj/pj.plugin.zsh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/zsh - -# -# Original idea by DefV (Jan De Poorter) -# Source: https://gist.github.com/pjaspers/368394#comment-1016 -# -# Usage: -# - Set `$PROJECT_PATHS` in your ~/.zshrc -# e.g.: PROJECT_PATHS=(~/src ~/work) -# - In ZSH you now can open a project directory with the command: `pj my-project` -# the plugin will locate the `my-project` directory in one of the $PROJECT_PATHS -# Also tab completion is supported. -# - `pjo my-project` will open the directory in $EDITOR -# - -function pj() { - cmd="cd" - file=$1 - - if [[ "open" == "$file" ]] then - file=$2 - cmd=(${(s: :)EDITOR}) - fi - - for project in $PROJECT_PATHS; do - if [[ -d $project/$file ]] then - $cmd "$project/$file" - unset project # Unset project var - return - fi - done - - echo "No such project $1" -} - -alias pjo="pj open" - -function _pj () { - compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $9 }'` -} - -compdef _pj pj diff --git a/dot.oh-my-zsh/plugins/pow/pow.plugin.zsh b/dot.oh-my-zsh/plugins/pow/pow.plugin.zsh deleted file mode 100644 index 399a54c..0000000 --- a/dot.oh-my-zsh/plugins/pow/pow.plugin.zsh +++ /dev/null @@ -1,66 +0,0 @@ -# Restart a rack app running under pow -# http://pow.cx/ -# -# Adds a kapow command that will restart an app -# -# $ kapow myapp -# -# Supports command completion. -# -# If you are not already using completion you might need to enable it with -# -# autoload -U compinit compinit -# -# Changes: -# -# Defaults to the current application, and will walk up the tree to find -# a config.ru file and restart the corresponding app -# -# Will Detect if a app does not exist in pow and print a (slightly) helpful -# error message - -rack_root_detect(){ - setopt chaselinks - local orgdir=$(pwd) - local basedir=$(pwd) - - while [[ $basedir != '/' ]]; do - test -e "$basedir/config.ru" && break - builtin cd ".." 2>/dev/null - basedir="$(pwd)" - done - - builtin cd $orgdir 2>/dev/null - [[ ${basedir} == "/" ]] && return 1 - echo `basename $basedir | sed -E "s/.(com|net|org)//"` -} - -kapow(){ - local vhost=$1 - [ ! -n "$vhost" ] && vhost=$(rack_root_detect) - if [ ! -h ~/.pow/$vhost ] - then - echo "pow: This domain isn’t set up yet. Symlink your application to ${vhost} first." - return 1 - fi - - [ ! -d ~/.pow/${vhost}/tmp ] && mkdir -p ~/.pow/$vhost/tmp - touch ~/.pow/$vhost/tmp/restart.txt; - [ $? -eq 0 ] && echo "pow: restarting $vhost.dev" -} -compctl -W ~/.pow -/ kapow - -powit(){ - local basedir=$(pwd) - local vhost=$1 - [ ! -n "$vhost" ] && vhost=$(rack_root_detect) - if [ ! -h ~/.pow/$vhost ] - then - echo "pow: Symlinking your app with pow. ${vhost}" - [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost - return 1 - fi -} - -# View the standard out (puts) from any pow app -alias kaput="tail -f ~/Library/Logs/Pow/apps/*" diff --git a/dot.oh-my-zsh/plugins/powder/_powder b/dot.oh-my-zsh/plugins/powder/_powder deleted file mode 100644 index 84e260a..0000000 --- a/dot.oh-my-zsh/plugins/powder/_powder +++ /dev/null @@ -1,4 +0,0 @@ -#compdef powder -#autoload - -compadd `powder help | grep powder | cut -d " " -f 4` diff --git a/dot.oh-my-zsh/plugins/python/python.plugin.zsh b/dot.oh-my-zsh/plugins/python/python.plugin.zsh deleted file mode 100644 index 852c8b9..0000000 --- a/dot.oh-my-zsh/plugins/python/python.plugin.zsh +++ /dev/null @@ -1,12 +0,0 @@ -# Find python file -alias pyfind='find . -name "*.py"' - -# Remove python compiled byte-code in either current directory or in a -# list of specified directories -function pyclean() { - ZSH_PYCLEAN_PLACES=${*:-'.'} - find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete -} - -# Grep among .py files -alias pygrep='grep --include="*.py"' diff --git a/dot.oh-my-zsh/plugins/rails/rails.plugin.zsh b/dot.oh-my-zsh/plugins/rails/rails.plugin.zsh deleted file mode 100644 index d3849b4..0000000 --- a/dot.oh-my-zsh/plugins/rails/rails.plugin.zsh +++ /dev/null @@ -1,16 +0,0 @@ -alias ss='thin --stats "/thin/stats" start' -alias sg='ruby script/generate' -alias sd='ruby script/destroy' -alias sp='ruby script/plugin' -alias sr='ruby script/runner' -alias ssp='ruby script/spec' -alias rdbm='rake db:migrate' -alias rdbtp='rake db:test:prepare' -alias migrate='rake db:migrate && rake db:test:prepare' -alias sc='ruby script/console' -alias sd='ruby script/server --debugger' -alias devlog='tail -f log/development.log' - -function remote_console() { - /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" -} diff --git a/dot.oh-my-zsh/plugins/rails3/rails3.plugin.zsh b/dot.oh-my-zsh/plugins/rails3/rails3.plugin.zsh deleted file mode 100644 index 237d059..0000000 --- a/dot.oh-my-zsh/plugins/rails3/rails3.plugin.zsh +++ /dev/null @@ -1,23 +0,0 @@ -# Rails 3 aliases, backwards-compatible with Rails 2. - -function _rails_command () { - if [ -e "script/server" ]; then - ruby script/$@ - else - ruby script/rails $@ - fi -} - -alias rc='_rails_command console' -alias rd='_rails_command destroy' -alias rdb='_rails_command dbconsole' -alias rdbm='rake db:migrate db:test:clone' -alias rg='_rails_command generate' -alias rgm='_rails_command generate migration' -alias rp='_rails_command plugin' -alias ru='_rails_command runner' -alias rs='_rails_command server' -alias rsd='_rails_command server --debugger' -alias devlog='tail -f log/development.log' -alias rdm='rake db:migrate' -alias rdr='rake db:rollback' diff --git a/dot.oh-my-zsh/plugins/rake/rake.plugin.zsh b/dot.oh-my-zsh/plugins/rake/rake.plugin.zsh deleted file mode 100644 index 16b933c..0000000 --- a/dot.oh-my-zsh/plugins/rake/rake.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -alias rake="noglob rake" # allows square brackts for rake task invocation -alias brake='noglob bundle exec rake' # execute the bundled rake gem -alias srake='noglob sudo rake' # noglob must come before sudo -alias sbrake='noglob sudo bundle exec rake' # altogether now ... - - diff --git a/dot.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh b/dot.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh deleted file mode 100644 index fb9df4b..0000000 --- a/dot.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh +++ /dev/null @@ -1,57 +0,0 @@ -_homebrew-installed() { - type brew &> /dev/null -} - -_rbenv-from-homebrew-installed() { - brew --prefix rbenv &> /dev/null -} - -FOUND_RBENV=0 -rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv") -if _homebrew-installed && _rbenv-from-homebrew-installed ; then - rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") -fi - -for rbenvdir in "${rbenvdirs[@]}" ; do - if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then - FOUND_RBENV=1 - export RBENV_ROOT=$rbenvdir - export PATH=${rbenvdir}/bin:$PATH - eval "$(rbenv init - zsh)" - - alias rubies="rbenv versions" - alias gemsets="rbenv gemset list" - - function current_ruby() { - echo "$(rbenv version-name)" - } - - function current_gemset() { - echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)" - } - - function gems { - local rbenv_path=$(rbenv prefix) - gem list $@ | sed -E \ - -e "s/\([0-9a-z, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ - -e "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \ - -e "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ - -e "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" - } - - function rbenv_prompt_info() { - if [[ -n $(current_gemset) ]] ; then - echo "$(current_ruby)@$(current_gemset)" - else - echo "$(current_ruby)" - fi - } - fi -done -unset rbenvdir - -if [ $FOUND_RBENV -eq 0 ] ; then - alias rubies='ruby -v' - function gemsets() { echo 'not supported' } - function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" } -fi diff --git a/dot.oh-my-zsh/plugins/rbfu/rbfu.plugin.zsh b/dot.oh-my-zsh/plugins/rbfu/rbfu.plugin.zsh deleted file mode 100644 index 0084852..0000000 --- a/dot.oh-my-zsh/plugins/rbfu/rbfu.plugin.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# Enables rbfu with --auto option, if available. -# -# Also provides a command to list all installed/available -# rubies. To ensure compatibility with themes, creates the -# rvm_prompt_info function to return the $RBFU_RUBY_VERSION -# version. - -command -v rbfu &>/dev/null - -if [[ $? -eq 0 ]]; then - eval "$(rbfu --init --auto)" - - # Internal: Print ruby version details, if it's currently - # active etc. - function _rbfu_rubies_print() { - local rb rb_out - rb=$(basename $1) - rb_out="$rb" - [[ -h $1 ]] && rb_out="$rb_out${fg[green]}@${reset_color}" - [[ "x$rb" == "x$2" ]] && rb_out="${fg[red]}$rb_out ${fg[red]}*${reset_color}" - echo $rb_out - } - - # Public: Provide a list with all available rubies, this basically depends - # on `ls -1` and .rfbu/rubies. Highlights the currently active ruby version - # and aliases. - function rbfu-rubies() { - local rbfu_dir active_rb - rbfu_dir=$RBFU_RUBIES - active_rb=$RBFU_RUBY_VERSION - [[ -z "$rbfu_dir" ]] && rbfu_dir="${HOME}/.rbfu/rubies" - [[ -z "$active_rb" ]] && active_rb="system" - _rbfu_rubies_print "${rbfu_dir}/system" $active_rb - for rb in $(ls -1 $rbfu_dir); do - _rbfu_rubies_print "${rbfu_dir}/${rb}" $active_rb - done - } - - # Public: Create rvm_prompt_info command for themes compatibility, unless - # it has already been defined. - [ ! -x rvm_prompt_info ] && function rvm_prompt_info() { echo "${RBFU_RUBY_VERSION:=system}" } -fi diff --git a/dot.oh-my-zsh/plugins/redis-cli/_redis-cli b/dot.oh-my-zsh/plugins/redis-cli/_redis-cli deleted file mode 100644 index 1569f29..0000000 --- a/dot.oh-my-zsh/plugins/redis-cli/_redis-cli +++ /dev/null @@ -1,142 +0,0 @@ -#compdef redis-cli rec -#autoload - -#redis cli completion, based off homebrew completion (ref. 2011-04-14) - -local -a _1st_arguments -_1st_arguments=( - 'append:append a value to a key' - 'auth:authenticate to the server' - 'bgrewriteeaof:asynchronously rewrite the append-only file' - 'bgsave:asynchornously save the dataset to disk' - 'blpop:remove and get the first element in a list, or block until one is available' - 'brpop:remove and get the last element in a list, or block until one is available' - 'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available' - # 'config get:get the value of a configuration parameter' - # 'config set:set a configuration parameter to the given value' - # 'config resetstat: reset the stats returned by INFO' - 'dbsize:return the number of keys in the selected database' - # 'debug object:get debugging information about a key' - # 'debug setgfault:make the server crash' - 'decr:decrement the integer value of a key by one' - 'decrby:decrement the integet value of a key by the given number' - 'del:delete a key' - 'discard:discard all commands issued after MULTI' - 'echo:echo the given string' - 'exec:execute all commands issued after a MULTI' - 'exists:determine if a key exists' - 'expire:set the time to live for a key, in seconds' - 'expireat:set the expiration for a key as a UNIX timestamp' - 'flushall:remove all keys from all databases' - 'flushdb:remove all keys from the current database' - 'get:get the value of a key' - 'getbit:returns the bit value at offset in the string value stored at key' - 'getrange:get a substring of the string stored at a key' - 'getset:set the string value of a key and return its old value' - 'hdel:delete a hash field' - 'hexists:determine if a hash field exists' - 'hget:get the value of a hash field' - 'hgetall:get all the fields and values in a hash' - 'hincrby:increment the integer value of a hash field by the given number' - 'hkeys:get all the fields in a hash' - 'hlen:get the number of fields in a hash' - 'hmget:get the values of all the given hash fields' - 'hmset:set multiple hash fields to multiple values' - 'hset:set the string value of a hash field' - 'hsetnx:set the value of a hash field, only if the field does not exist' - 'hvals:get all the values in a hash' - 'incr:increment the integer value of a key by one' - 'incrby:increment the integer value of a key by the given number' - 'info:get information and statistics about the server' - 'keys:find all keys matching the given pattern' - 'lastsave:get the UNIX timestamp of the last successful save to disk' - 'lindex:get an element from a list by its index' - 'linsert:insert an element before or after another element in a list' - 'llen:get the length of a list' - 'lpop:remove and get the first element in a list' - 'lpush:prepend a value to a list' - 'lpushx:prepend a value to a list, only if the list exists' - 'lrange:get a range of elements from a list' - 'lrem:remove elements from a list' - 'lset:set the value of an element in a list by its index' - 'ltrim:trim a list to the specified range' - 'mget:get the values of all the given keys' - 'monitor:listen for all requests received by the server in real time' - 'move:move a key to another database' - 'mset:set multiple keys to muliple values' - 'msetnx:set multiple keys tom ultiple values, only if none of the keys exist' - 'multi:mark the start of a transaction block' - 'object:inspect the internals of Redis objects' - 'persist:remove the expiration from a key' - 'ping:ping the server' - 'psubscribe:listen for messages published to channels matching the given patterns' - 'publish:post a message to a channel' - 'punsubscribe:stop listening for messages posted to channels matching the given patterns' - 'quit:close the connection' - 'randomkey:return a random key from the keyspace' - 'rename:rename a key' - 'renamenx:rename a key, only if the new key does not exist' - 'rpop:remove and get the last element in a list' - 'rpoplpush:remove the last element in a list, append it to another list and return it' - 'rpush:append a value to a list' - 'rpushx:append a value to a list, only if the list exists' - 'sadd:add a member to a set' - 'save:synchronously save the dataset to disk' - 'scard:get the number of members in a set' - 'sdiff:subtract multiple sets' - 'sdiffstore:subtract multiple sets and store the resulting set in a key' - 'select:change the selected database for the current connection' - 'set:set the string value of a key' - 'setbit:sets or clears the bit at offset in the string value stored at key' - 'setex:set the value and expiration of a key' - 'setnx:set the value of a key, only if the key does not exist' - 'setrange:overwrite part of a string at key starting at the specified offset' - 'shutdown:synchronously save the dataset to disk and then shut down the server' - 'sinter:intersect multiple sets' - 'sinterstore:intersect multiple sets and store the resulting set in a key' - 'sismember:determine if a given value is a member of a set' - 'slaveof:make the server a slave of another instance, or promote it as master' - 'smembers:get all the members in a set' - 'smove:move a member from one set to another' - 'sort:sort the elements in a list, set or sorted set' - 'spop:remove and return a random member from a set' - 'srandmember:get a random member from a set' - 'srem:remove a member from a set' - 'strlen:get the length of the value stored in a key' - 'subscribe:listen for messages published to the given channels' - 'sunion:add multiple sets' - 'sunionstore:add multiple sets and store the resulting set in a key' - 'ttl:get the time to live for a key' - 'type:determine the type stored at key' - 'unsubscribe:stop listening for messages posted to the given channels' - 'unwatch:forget about all watched keys' - 'watch:watch the given keys to determine execution of the MULTI/EXEC block' - 'zadd:add a member to a sorted set, or update its score if it already exists' - 'zcard:get the number of members in a sorted set' - 'zcount:count the members in a sorted set with scores within the given values' - 'zincrby:increment the score of a member in a sorted set' - 'zinterstore:intersect multiple sorted sets and store the resulting sorted set in a new key' - 'zrange:return a range of members in a sorted set, by index' - 'zrangebyscore:return a range of members in a sorted set, by score' - 'zrank:determine the index of a member in a sorted set' - 'zrem:remove a member from a sorted set' - 'zremrangebyrank:remove all members in a sorted set within the given indexes' - 'zremrangebyscore:remove all members in a sorted set within the given scores' - 'zrevrange:return a range of membrs in a sorted set, by index, with scores ordered from high to low' - 'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low' - 'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low' - 'zscore:get the score associated with the given member in a sorted set' - 'zunionstore:add multiple sorted sets and store te resulting sorted set in a new key' -) - -local expl - -_arguments \ - '(-v --version)'{-v,--version}'[show version]' \ - '(-h --help)'{-h,--help}'[show help]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "redis-cli subcommand" _1st_arguments - return -fi \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/rsync/rsync.plugin.zsh b/dot.oh-my-zsh/plugins/rsync/rsync.plugin.zsh deleted file mode 100644 index 33a31a5..0000000 --- a/dot.oh-my-zsh/plugins/rsync/rsync.plugin.zsh +++ /dev/null @@ -1,4 +0,0 @@ -alias rsync-copy="rsync -av --progress -h" -alias rsync-move="rsync -av --progress -h --remove-source-files" -alias rsync-update="rsync -avu --progress -h" -alias rsync-synchronize="rsync -avu --delete --progress -h" diff --git a/dot.oh-my-zsh/plugins/ruby/ruby.plugin.zsh b/dot.oh-my-zsh/plugins/ruby/ruby.plugin.zsh deleted file mode 100644 index 38e4d7c..0000000 --- a/dot.oh-my-zsh/plugins/ruby/ruby.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# TODO: Make this compatible with rvm. -# Run sudo gem on the system ruby, not the active ruby. -alias sgem='sudo gem' - -# Find ruby file -alias rfind='find . -name "*.rb" | xargs grep -n' diff --git a/dot.oh-my-zsh/plugins/rvm/rvm.plugin.zsh b/dot.oh-my-zsh/plugins/rvm/rvm.plugin.zsh deleted file mode 100644 index 1ab800b..0000000 --- a/dot.oh-my-zsh/plugins/rvm/rvm.plugin.zsh +++ /dev/null @@ -1,51 +0,0 @@ -fpath=($rvm_path/scripts/zsh/Completion $fpath) - -alias rubies='rvm list rubies' -alias gemsets='rvm gemset list' - -local ruby18='ruby-1.8.7-p334' -local ruby19='ruby-1.9.3-p194' - -function rb18 { - if [ -z "$1" ]; then - rvm use "$ruby18" - else - rvm use "$ruby18@$1" - fi -} - -_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`} -compdef _rb18 rb18 - -function rb19 { - if [ -z "$1" ]; then - rvm use "$ruby19" - else - rvm use "$ruby19@$1" - fi -} - -_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`} -compdef _rb19 rb19 - -function rvm-update { - rvm get head - rvm reload # TODO: Reload rvm completion? -} - -# TODO: Make this usable w/o rvm. -function gems { - local current_ruby=`rvm-prompt i v p` - local current_gemset=`rvm-prompt g` - - gem list $@ | sed \ - -Ee "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ - -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ - -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ - -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" -} - -function _rvm_completion { - source $rvm_path"/scripts/zsh/Completion/_rvm" -} -compdef _rvm_completion rvm diff --git a/dot.oh-my-zsh/plugins/screen/screen.plugin.zsh b/dot.oh-my-zsh/plugins/screen/screen.plugin.zsh deleted file mode 100644 index 7009e7a..0000000 --- a/dot.oh-my-zsh/plugins/screen/screen.plugin.zsh +++ /dev/null @@ -1,54 +0,0 @@ -# if using GNU screen, let the zsh tell screen what the title and hardstatus -# of the tab window should be. -if [[ "$TERM" == screen* ]]; then - if [[ $_GET_PATH == '' ]]; then - _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^\/home\//~/;s/^~$USER/~/"' - fi - if [[ $_GET_HOST == '' ]]; then - _GET_HOST='echo $HOST | sed "s/\..*//"' - fi - - # use the current user as the prefix of the current tab title - TAB_TITLE_PREFIX='"`'$_GET_HOST'`:`'$_GET_PATH' | sed "s:..*/::"`$PROMPT_CHAR"' - # when at the shell prompt, show a truncated version of the current path (with - # standard ~ replacement) as the rest of the title. - TAB_TITLE_PROMPT='$SHELL:t' - # when running a command, show the title of the command as the rest of the - # title (truncate to drop the path to the command) - TAB_TITLE_EXEC='$cmd[1]:t' - - # use the current path (with standard ~ replacement) in square brackets as the - # prefix of the tab window hardstatus. - TAB_HARDSTATUS_PREFIX='"[`'$_GET_PATH'`] "' - # when at the shell prompt, use the shell name (truncated to remove the path to - # the shell) as the rest of the title - TAB_HARDSTATUS_PROMPT='$SHELL:t' - # when running a command, show the command name and arguments as the rest of - # the title - TAB_HARDSTATUS_EXEC='$cmd' - - # tell GNU screen what the tab window title ($1) and the hardstatus($2) should be - function screen_set() - { - # set the tab window title (%t) for screen - print -nR $'\033k'$1$'\033'\\\ - - # set hardstatus of tab window (%h) for screen - print -nR $'\033]0;'$2$'\a' - } - # called by zsh before executing a command - function preexec() - { - local -a cmd; cmd=(${(z)1}) # the command string - eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_EXEC" - eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_EXEC" - screen_set $tab_title $tab_hardstatus - } - # called by zsh before showing the prompt - function precmd() - { - eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_PROMPT" - eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT" - screen_set $tab_title $tab_hardstatus - } -fi \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/sprunge/sprunge.plugin.zsh b/dot.oh-my-zsh/plugins/sprunge/sprunge.plugin.zsh deleted file mode 100644 index fcc9004..0000000 --- a/dot.oh-my-zsh/plugins/sprunge/sprunge.plugin.zsh +++ /dev/null @@ -1,62 +0,0 @@ -# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf -# Created by the blogger at the URL below...I don't know where to find his/her name -# Original found at http://www.shellperson.net/sprunge-pastebin-script/ - -usage() { -description | fmt -s >&2 -} - -description() { -cat << HERE - -DESCRIPTION - Upload data and fetch URL from the pastebin http://sprunge.us - -USAGE - $0 filename.txt - $0 text string - $0 < filename.txt - piped_data | $0 - -NOTES --------------------------------------------------------------------------- -* INPUT METHODS * -$0 can accept piped data, STDIN redirection [&2 - if [ "$*" ]; then - echo Arguments present... >&2 - if [ -f "$*" ]; then - echo Uploading the contents of "$*"... >&2 - cat "$*" - else - echo Uploading the text: \""$*"\"... >&2 - echo "$*" - fi | curl -F 'sprunge=<-' http://sprunge.us - else - echo No arguments found, printing USAGE and exiting. >&2 - usage - fi - else - echo Using input from a pipe or STDIN redirection... >&2 - curl -F 'sprunge=<-' http://sprunge.us - fi -} diff --git a/dot.oh-my-zsh/plugins/ssh-agent/ssh-agent.plugin.zsh b/dot.oh-my-zsh/plugins/ssh-agent/ssh-agent.plugin.zsh deleted file mode 100644 index c4e92a1..0000000 --- a/dot.oh-my-zsh/plugins/ssh-agent/ssh-agent.plugin.zsh +++ /dev/null @@ -1,62 +0,0 @@ -# -# INSTRUCTIONS -# -# To enabled agent forwarding support add the following to -# your .zshrc file: -# -# zstyle :omz:plugins:ssh-agent agent-forwarding on -# -# To load multiple identies use the identities style, For -# example: -# -# zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github -# -# -# CREDITS -# -# Based on code from Joseph M. Reagle -# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html -# -# Agent forwarding support based on ideas from -# Florent Thoumie and Jonas Pfenniger -# - -local _plugin__ssh_env=$HOME/.ssh/environment-$HOST -local _plugin__forwarding - -function _plugin__start_agent() -{ - local -a identities - - # start ssh-agent and setup environment - /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} - chmod 600 ${_plugin__ssh_env} - . ${_plugin__ssh_env} > /dev/null - - # load identies - zstyle -a :omz:plugins:ssh-agent identities identities - echo starting... - /usr/bin/ssh-add $HOME/.ssh/${^identities} -} - -# test if agent-forwarding is enabled -zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding -if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then - # Add a nifty symlink for screen/tmux if agent forwarding - [[ -L $SSH_AUTH_SOCK ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen - -elif [ -f "${_plugin__ssh_env}" ]; then - # Source SSH settings, if applicable - . ${_plugin__ssh_env} > /dev/null - ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { - _plugin__start_agent; - } -else - _plugin__start_agent; -fi - -# tidy up after ourselves -unfunction _plugin__start_agent -unset _plugin__forwarding -unset _plugin__ssh_env - diff --git a/dot.oh-my-zsh/plugins/sublime/sublime.plugin.zsh b/dot.oh-my-zsh/plugins/sublime/sublime.plugin.zsh deleted file mode 100755 index 1b2cbcd..0000000 --- a/dot.oh-my-zsh/plugins/sublime/sublime.plugin.zsh +++ /dev/null @@ -1,21 +0,0 @@ -# Sublime Text 2 Aliases -#unamestr = 'uname' - -local _sublime_darwin_subl=/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl - -if [[ $('uname') == 'Linux' ]]; then - if [ -f '/usr/bin/sublime_text' ]; then - st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & } - else - st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & } - fi -alias st=st_run -elif [[ $('uname') == 'Darwin' ]]; then - # Check if Sublime is installed in user's home application directory - if [[ -a $HOME/${_sublime_darwin_subl} ]]; then - alias st='$HOME/${_sublime_darwin_subl}' - else - alias st='${_sublime_darwin_subl}' - fi -fi -alias stt='st .' diff --git a/dot.oh-my-zsh/plugins/supervisor/_supervisorctl b/dot.oh-my-zsh/plugins/supervisor/_supervisorctl deleted file mode 100644 index d159f20..0000000 --- a/dot.oh-my-zsh/plugins/supervisor/_supervisorctl +++ /dev/null @@ -1,136 +0,0 @@ -#compdef supervisorctl - -typeset -A opt_args -local context state line - -_supervisorctl() { - _arguments -s -S \ - {--configuration,-c}"[configuration file path (default /etc/supervisor.conf)]:FILENAME:_files" \ - {--help,-h}"[print usage message and exit]:" \ - {--interactive,-i}"[start an interactive shell after executing commands]" \ - {--serverurl,-s}"[URL on which supervisord server is listening (default "http://localhost:9001").]" \ - {--username,-u}"[username to use for authentication with server]:USERNAME:_users" \ - {--password,-p}"[password to use for authentication with server]:PASSWORD:" \ - {--history-file,-r}"[keep a readline history (if readline is available)]:FILENAME:_files" \ - "*::supervisorctl commands:_supervisorctl_command" -} - -(( $+functions[_supervisorctl_command] )) || -_supervisorctl_command() { - local cmd ret=1 - - (( $+supervisorctl_cmds )) || _supervisorctl_cmds=( - "add:Activates any updates in config for process/group" \ - "avail:Display all configured processes" \ - "clear:Clear process/multiple-process/all-process log files" \ - "exit:Exit the supervisor shell." \ - "fg:Connect to a process in foreground mode" \ - "maintail:tail of supervisor main log file" \ - "open:Connect to a remote supervisord process. (for UNIX domain socket, use unix:///socket/path)" \ - "pid:Get the PID of supervisord." \ - "quit:Exit the supervisor shell." \ - "reload:Restart the remote supervisord." \ - "remove:Removes process/group from active config" \ - "reread:Reload the daemon's configuration files" \ - "restart:Restart process or group." \ - "shutdown:Shut the remote supervisord down." \ - "start:Start process or groups." \ - "status:Get process status info." \ - "stop:Stop process or group." \ - "tail:tail of process stdout" \ - "update:Reload config and add/remove as necessary" \ - "version:Show the version of the remote supervisord process" \ - "help:Show help" \ - ) - - if (( CURRENT == 1 )); then - _describe -t commands 'supervisorctl subcommand' _supervisorctl_cmds \ - || compadd "$@" - ${(s.:.)${(j.:.)_supervisorctl_syns}} - else - local curcontext="$curcontext" - - cmd="${${_supervisorctl_cmds[(r)$words[1]:*]%%:*}:-${(k)_supervisorctl_syns[(r)(*:|)$words[1](:*|)]}}" - if (( $#cmd )); then - curcontext="${curcontext%:*:*}:supervisorctl-${cmd}:" - _call_function ret _supervisorctl_$cmd || _message 'no more arguments' - else - _message "unknown supervisorctl command: $words[1]" - fi - return ret - fi -} - -# get supervisor contoroll processes -(( $+functions[_get_supervisor_procs] )) || -_get_supervisor_procs() { - local cache_policy - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - if [[ -z "$cache_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy _supervisor_procs_caching_policy - fi - - if ( [[ ${+_supervisor_procs} -eq 0 ]] || _cache_invalid supervisor_procs ) \ - && ! _retrieve_cache supervisor_procs; then - - _supervisor_procs=(${${(f)"$(supervisorctl status >/dev/null 2>&1 | awk -F' ' '{print $1}')"}}) - _store_cache supervisor_procs _supervisor_procs - fi - - local expl - _wanted supervisor_procs expl 'supervisor processes' compadd -a _supervisor_procs -} - -_supervisor_procs_caching_policy() { - local -a oldp - oldp=( "$1"(Nmw+1) ) - (( $#oldp )) -} - -(( $+functions[_supervisorctl_add] )) || -_supervisorctl_add() { - _arguments -s \ - "--help[use help system]" \ - "*::supervisorctl commands:_supervisorctl" -} - -(( $+functions[_supervisorctl_help] )) || -_supervisorctl_help() { - _arguments -s \ - "*:supervisorctl commands:_supervisorctl" -} - -(( $+functions[_supervisorctl_maintail] )) || -_supervisorctl_maintail() { - _arguments -s \ - '-f[Continuous tail of supervisor main log file (Ctrl-C to exit)]' -} - -(( $+functions[_supervisorctl_start] )) || -_supervisorctl_start() { - # TODO: add 'all' - _arguments -s \ - '*::supvervisor process:_get_supervisor_procs' -} - -(( $+functions[_supervisorctl_status] )) || -_supervisorctl_status() { - _arguments \ - '*::supvervisor process:_get_supervisor_procs' -} - -(( $+functions[_supervisorctl_stop] )) || -_supervisorctl_stop() { - # TODO: add 'all' - _arguments -s \ - '*::supvervisor process:_get_supervisor_procs' -} - -(( $+functions[_supervisorctl_tail] )) || -_supervisorctl_tail() { - # TODO: add 'stderr' - _arguments -s \ - '-f[Continuous tail of named process stdout Ctrl-C to exit.]' \ - '*::supvervisor process:_get_supervisor_procs' -} - -_supervisorctl "$@" diff --git a/dot.oh-my-zsh/plugins/supervisor/_supervisord b/dot.oh-my-zsh/plugins/supervisor/_supervisord deleted file mode 100644 index 34d2780..0000000 --- a/dot.oh-my-zsh/plugins/supervisor/_supervisord +++ /dev/null @@ -1,32 +0,0 @@ -#compdef supervisord - -typeset -A opt_args -local context state line - -_arguments \ - {--configuration,-c}"[configuration file]:FILENAME:_files" \ - {--nodaemon,-n}"[run in the foreground (same as 'nodaemon true' in config file)]" \ - {--help,-h}"[print this usage message and exit]:" \ - {--user,-u}"[run supervisord as this user]:USER:_users" \ - {--umask,-m}"[use this umask for daemon subprocess (default is 022)]" \ - {--directory,-d}"[directory to chdir to when daemonized]" \ - {--logfile,-l}"[use FILENAME as logfile path]:FILENAME:_files" \ - {--logfile_maxbytes,-y}"[use BYTES to limit the max size of logfile]" \ - {--logfile_backups,-z}"[number of backups to keep when max bytes reached]" \ - {--loglevel,-e}"[use LEVEL as log level (debug,info,warn,error,critical)]:level:->levels" \ - {--pidfile,-j}"[write a pid file for the daemon process to FILENAME]:FILENAME:_files" \ - {--identifier,-i}"[identifier used for this instance of supervisord]" \ - {--childlogdir,-q}"[the log directory for child process logs]:child log directory:_files -/" \ - {--nocleanup,-k}"[prevent the process from performing cleanup (removal of old automatic child log files) at startup.]" \ - {--minfds,-a}"[the minimum number of file descriptors for start success]" \ - {--strip_ansi,-t}"[strip ansi escape codes from process output]" \ - "--minprocs[the minimum number of processes available for start success]" \ - "--profile_options[run supervisord under profiler and output results based on OPTIONS, which is a comma-sep'd list of 'cumulative', 'calls', and/or 'callers', e.g. 'cumulative,callers')]" \ - "*::args:_gnu_generic" - -case $state in -levels) - levels=("debug" "info" "warn" "error" "critical") - _describe -t levels 'supervisord levels' levels && return 0 - ;; -esac diff --git a/dot.oh-my-zsh/plugins/supervisor/supervisor.plugin.zsh b/dot.oh-my-zsh/plugins/supervisor/supervisor.plugin.zsh deleted file mode 100644 index cf1997c..0000000 --- a/dot.oh-my-zsh/plugins/supervisor/supervisor.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -# DECLARION: This plugin was created by hhatto. What I did is just making a portal from https://bitbucket.org/hhatto/zshcompfunc4supervisor. diff --git a/dot.oh-my-zsh/plugins/suse/suse.plugin.zsh b/dot.oh-my-zsh/plugins/suse/suse.plugin.zsh deleted file mode 100644 index d462869..0000000 --- a/dot.oh-my-zsh/plugins/suse/suse.plugin.zsh +++ /dev/null @@ -1,7 +0,0 @@ -alias zi='sudo zypper install' -alias zrf='sudo zypper refresh' -alias zs='zypper search' -alias zup='sudo zypper dist-upgrade' -alias zrm='sudo zypper remove' -alias zp='sudo zypper patch' -alias zps='sudo zypper ps' diff --git a/dot.oh-my-zsh/plugins/svn/svn.plugin.zsh b/dot.oh-my-zsh/plugins/svn/svn.plugin.zsh deleted file mode 100644 index e38e892..0000000 --- a/dot.oh-my-zsh/plugins/svn/svn.plugin.zsh +++ /dev/null @@ -1,62 +0,0 @@ - -function svn_prompt_info { - if [ $(in_svn) ]; then - if [ "x$SVN_SHOW_BRANCH" = "xtrue" ]; then - unset SVN_SHOW_BRANCH - _DISPLAY=$(svn_get_branch_name) - else - _DISPLAY=$(svn_get_repo_name) - fi - echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ -$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" - unset _DISPLAY - fi -} - - -function in_svn() { - if [[ -d .svn ]]; then - echo 1 - fi -} - -function svn_get_repo_name { - if [ $(in_svn) ]; then - svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT - - svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" - fi -} - -function svn_get_branch_name { - _DISPLAY=$(svn info 2> /dev/null | awk -F/ '/^URL:/ { for (i=0; i<=NF; i++) { if ($i == "branches" || $i == "tags" ) { print $(i+1); break }; if ($i == "trunk") { print $i; break } } }') - if [ "x$_DISPLAY" = "x" ]; then - svn_get_repo_name - else - echo $_DISPLAY - fi - unset _DISPLAY -} - -function svn_get_rev_nr { - if [ $(in_svn) ]; then - svn info 2> /dev/null | sed -n s/Revision:\ //p - fi -} - -function svn_dirty_choose { - if [ $(in_svn) ]; then - svn status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]' - if [ $pipestatus[-1] -eq 0 ]; then - # Grep exits with 0 when "One or more lines were selected", return "dirty". - echo $1 - else - # Otherwise, no lines were found, or an error occurred. Return clean. - echo $2 - fi - fi -} - -function svn_dirty { - svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN -} diff --git a/dot.oh-my-zsh/plugins/symfony/symfony.plugin.zsh b/dot.oh-my-zsh/plugins/symfony/symfony.plugin.zsh deleted file mode 100644 index 9de7675..0000000 --- a/dot.oh-my-zsh/plugins/symfony/symfony.plugin.zsh +++ /dev/null @@ -1,13 +0,0 @@ -# symfony basic command completion - -_symfony_get_command_list () { - ./symfony | sed "1,/Available tasks/d" | awk 'BEGIN { cat=null; } /^[A-Za-z]+$/ { cat = $1; } /^ :[a-z]+/ { print cat $1; }' -} - -_symfony () { - if [ -f symfony ]; then - compadd `_symfony_get_command_list` - fi -} - -compdef _symfony symfony diff --git a/dot.oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh b/dot.oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh deleted file mode 100644 index cc9ffeb..0000000 --- a/dot.oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh +++ /dev/null @@ -1,19 +0,0 @@ -# Symfony2 basic command completion - -_symfony2_get_command_list () { - app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' -} - -_symfony2 () { - if [ -f app/console ]; then - compadd `_symfony2_get_command_list` - fi -} - -compdef _symfony2 app/console -compdef _symfony2 sf - -#Alias -alias sf2='php app/console' -alias sf2clear='php app/console cache:clear' - diff --git a/dot.oh-my-zsh/plugins/systemd/systemd.plugin.zsh b/dot.oh-my-zsh/plugins/systemd/systemd.plugin.zsh deleted file mode 100644 index 7d3db0f..0000000 --- a/dot.oh-my-zsh/plugins/systemd/systemd.plugin.zsh +++ /dev/null @@ -1,11 +0,0 @@ -user_commands=( - list-units is-active status show help list-unit-files - is-enabled list-jobs show-environment) - -sudo_commands=( - start stop reload restart try-restart isolate kill - reset-failed enable disable reenable preset mask unmask - link load cancel set-environment unset-environment) - -for c in $user_commands; do; alias sc-$c="systemctl $c"; done -for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done diff --git a/dot.oh-my-zsh/plugins/taskwarrior/_task b/dot.oh-my-zsh/plugins/taskwarrior/_task deleted file mode 100644 index 0bda738..0000000 --- a/dot.oh-my-zsh/plugins/taskwarrior/_task +++ /dev/null @@ -1,248 +0,0 @@ -#compdef task -# zsh completion for taskwarrior -# -# taskwarrior - a command line task list manager. -# -# Copyright 2010 - 2011 Johannes Schlatow -# Copyright 2009 P.C. Shyamshankar -# -# 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. -# -# http://www.opensource.org/licenses/mit-license.php -# -typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers -_task_projects=($(task _projects)) -_task_tags=($(task _tags)) -_task_ids=($(task _ids)) -_task_config=($(task _config)) -_task_columns=($(task _columns)) -_task_modifiers=( - 'before' \ - 'after' \ - 'none' \ - 'any' \ - 'is' \ - 'isnt' \ - 'has' \ - 'hasnt' \ - 'startswith' \ - 'endswith' \ - 'word' \ - 'noword' -) -_task_conjunctions=( - 'and' \ - 'or' \ - 'xor' \ - '\)' - '\(' -) -_task_cmds=($(task _commands)) -_task_zshcmds=( ${(f)"$(task _zshcommands)"} ) - -_task() { - _arguments -s -S \ - "*::task default:_task_default" - return 0 -} - -local -a reply args word -word=$'[^\0]#\0' - -# priorities -local -a task_priorities -_regex_words values 'task priorities' \ - 'H:High' \ - 'M:Middle' \ - 'L:Low' -task_priorities=("$reply[@]") - -# projects -local -a task_projects -task_projects=( - /"$word"/ - ":values:task projects:compadd -a _task_projects" -) - -local -a _task_dates -_regex_words values 'task dates' \ - 'tod*ay:Today' \ - 'yes*terday:Yesterday' \ - 'tom*orrow:Tomorrow' \ - 'sow:Start of week' \ - 'soww:Start of work week' \ - 'socw:Start of calendar week' \ - 'som:Start of month' \ - 'soy:Start of year' \ - 'eow:End of week' \ - 'eoww:End of work week' \ - 'eocw:End of calendar week' \ - 'eom:End of month' \ - 'eoy:End of year' \ - 'mon:Monday' \ - 'tue:Tuesday'\ - 'wed:Wednesday' \ - 'thu:Thursday' \ - 'fri:Friday' \ - 'sat:Saturday' \ - 'sun:Sunday' -_task_dates=("$reply[@]") - -local -a _task_reldates -_regex_words values 'task reldates' \ - 'hrs:n hours' \ - 'day:n days' \ - '1st:first' \ - '2nd:second' \ - '3rd:third' \ - 'th:4th, 5th, etc.' \ - 'wks:weeks' -_task_reldates=("$reply[@]") - -task_dates=( - \( "$_task_dates[@]" \| - \( /$'[0-9][0-9]#'/- \( "$_task_reldates[@]" \) \) - \) -) - -_regex_words values 'task frequencies' \ - 'daily:Every day' \ - 'day:Every day' \ - 'weekdays:Every day skipping weekend days' \ - 'weekly:Every week' \ - 'biweekly:Every two weeks' \ - 'fortnight:Every two weeks' \ -+ 'monthly:Every month' \ - 'quarterly:Every three months' \ - 'semiannual:Every six months' \ - 'annual:Every year' \ - 'yearly:Every year' \ - 'biannual:Every two years' \ - 'biyearly:Every two years' -_task_freqs=("$reply[@]") - -local -a _task_frequencies -_regex_words values 'task frequencies' \ - 'd:days' \ - 'w:weeks' \ - 'q:quarters' \ - 'y:years' -_task_frequencies=("$reply[@]") - -task_freqs=( - \( "$_task_freqs[@]" \| - \( /$'[0-9][0-9]#'/- \( "$_task_frequencies[@]" \) \) - \) -) - -# attributes -local -a task_attributes -_regex_words -t ':' default 'task attributes' \ - 'pro*ject:Project name:$task_projects' \ - 'du*e:Due date:$task_dates' \ - 'wa*it:Date until task becomes pending:$task_dates' \ - 're*cur:Recurrence frequency:$task_freqs' \ - 'pri*ority:priority:$task_priorities' \ - 'un*til:Recurrence end date:$task_dates' \ - 'fg:Foreground color' \ - 'bg:Background color' \ - 'li*mit:Desired number of rows in report' -task_attributes=("$reply[@]") - -args=( - \( "$task_attributes[@]" \| - \( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \| - \( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \| - \( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \| - \( /"$word"/ \) - \) \# -) -_regex_arguments _task_attributes "${args[@]}" - -## task commands - -# filter completion -(( $+functions[_task_filter] )) || -_task_filter() { - _task_attributes "$@" - - # TODO complete conjunctions only if the previous word is a filter expression, i.e. attribute, ID, any non-command - _describe -t default 'task conjunctions' _task_conjunctions -} - -# merge completion -(( $+functions[_task_merge] )) || -_task_merge() { - # TODO match URIs in .taskrc - _files -} - -# push completion -(( $+functions[_task_push] )) || -_task_push() { - # TODO match URIs in .taskrc - _files -} - -# pull completion -(( $+functions[_task_pull] )) || -_task_pull() { - # TODO match URIs in .taskrc - _files -} - -# execute completion -(( $+functions[_task_execute] )) || -_task_execute() { - _files -} - -# id-only completion -(( $+functions[_task_id] )) || -_task_id() { - _describe -t values 'task IDs' _task_zshids -} - -## first level completion => task sub-command completion -(( $+functions[_task_default] )) || -_task_default() { - local cmd ret=1 - - integer i=1 - while (( i < $#words )) - do - cmd="${_task_cmds[(r)$words[$i]]}" - if (( $#cmd )); then - _call_function ret _task_${cmd} || - _call_function ret _task_filter || - _message "No command remaining." - return ret - fi - (( i++ )) - done - - # update IDs - _task_zshids=( ${(f)"$(task _zshids)"} ) - - _describe -t commands 'task command' _task_zshcmds - _describe -t values 'task IDs' _task_zshids - _call_function ret _task_filter - - return ret -} diff --git a/dot.oh-my-zsh/plugins/taskwarrior/taskwarrior.plugin.zsh b/dot.oh-my-zsh/plugins/taskwarrior/taskwarrior.plugin.zsh deleted file mode 100644 index c183004..0000000 --- a/dot.oh-my-zsh/plugins/taskwarrior/taskwarrior.plugin.zsh +++ /dev/null @@ -1,21 +0,0 @@ -################################################################################ -# Author: Pete Clark -# Email: pete[dot]clark[at]gmail[dot]com -# Version: 0.1 (05/24/2011) -# License: WTFPL -# -# This oh-my-zsh plugin adds smart tab completion for -# TaskWarrior. It uses the zsh tab completion -# script (_task) distributed with TaskWarrior for the completion definitions. -# -# Typing task[tabtab] will give you a list of current tasks, task 66[tabtab] -# gives a list of available modifications for that task, etc. -################################################################################ - -zstyle ':completion:*:*:task:*' verbose yes -zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u' - -zstyle ':completion:*:*:task:*' group-name '' - -alias t=task -compdef _task t=task diff --git a/dot.oh-my-zsh/plugins/terminalapp/terminalapp.plugin.zsh b/dot.oh-my-zsh/plugins/terminalapp/terminalapp.plugin.zsh deleted file mode 100644 index 2249b1e..0000000 --- a/dot.oh-my-zsh/plugins/terminalapp/terminalapp.plugin.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# Set Apple Terminal.app resume directory -# based on this answer: http://superuser.com/a/315029 -# 2012-10-26: (javageek) Changed code using the updated answer - -# Tell the terminal about the working directory whenever it changes. -if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then - update_terminal_cwd() { - # Identify the directory using a "file:" scheme URL, including - # the host name to disambiguate local vs. remote paths. - - # Percent-encode the pathname. - local URL_PATH='' - { - # Use LANG=C to process text byte-by-byte. - local i ch hexch LANG=C - for ((i = 1; i <= ${#PWD}; ++i)); do - ch="$PWD[i]" - if [[ "$ch" =~ [/._~A-Za-z0-9-] ]]; then - URL_PATH+="$ch" - else - hexch=$(printf "%02X" "'$ch") - URL_PATH+="%$hexch" - fi - done - } - - local PWD_URL="file://$HOST$URL_PATH" - #echo "$PWD_URL" # testing - printf '\e]7;%s\a' "$PWD_URL" - } - - # Register the function so it is called whenever the working - # directory changes. - autoload add-zsh-hook - add-zsh-hook chpwd update_terminal_cwd - - # Tell the terminal about the initial directory. - update_terminal_cwd -fi diff --git a/dot.oh-my-zsh/plugins/terminitor/_terminitor b/dot.oh-my-zsh/plugins/terminitor/_terminitor deleted file mode 100644 index 1ce87c3..0000000 --- a/dot.oh-my-zsh/plugins/terminitor/_terminitor +++ /dev/null @@ -1,38 +0,0 @@ -#compdef terminitor -#autoload - -# terminitor zsh completion - -_terminitor_available_scripts() { - scripts=(`for SCRIPT in ~/.config/terminitor/*.term ; do basename $SCRIPT .term ; done`) -} - -local -a _1st_arguments -_1st_arguments=( - 'create:create a Termfile in directory' - 'delete:delete terminitor script' - 'edit:open termitor script' - 'fetch:clone the designated repo and run setup' - 'help:Describe available tasks or one specific task' - 'init:create initial root terminitor folder' - 'list:lists all terminitor scripts' - 'setup:execute setup in the terminitor script' - 'start:runs the terminitor script' - 'update:update Terminitor to new global path(.config/.terminitor)' -) - -local expl - -_arguments \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "terminitor task" _1st_arguments - return -fi - -case "$words[1]" in - start|edit|delete|setup) - _terminitor_available_scripts - _wanted scripts expl 'installed scripts' compadd -a scripts ;; -esac diff --git a/dot.oh-my-zsh/plugins/textmate/textmate.plugin.zsh b/dot.oh-my-zsh/plugins/textmate/textmate.plugin.zsh deleted file mode 100644 index a11a097..0000000 --- a/dot.oh-my-zsh/plugins/textmate/textmate.plugin.zsh +++ /dev/null @@ -1,12 +0,0 @@ -alias et='mate .' -alias ett='mate Gemfile app config features lib db public spec test Rakefile Capfile Todo' -alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo' -alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo' - -# Edit Ruby app in TextMate -alias mr='mate CHANGELOG app config db lib public script spec test' - -function tm() { - cd $1 - mate $1 -} diff --git a/dot.oh-my-zsh/plugins/themes/_theme b/dot.oh-my-zsh/plugins/themes/_theme deleted file mode 100644 index 8214ddb..0000000 --- a/dot.oh-my-zsh/plugins/themes/_theme +++ /dev/null @@ -1,3 +0,0 @@ -#compdef theme - -_arguments "1: :($(lstheme | tr "\n" " "))" diff --git a/dot.oh-my-zsh/plugins/themes/themes.plugin.zsh b/dot.oh-my-zsh/plugins/themes/themes.plugin.zsh deleted file mode 100644 index 8bab257..0000000 --- a/dot.oh-my-zsh/plugins/themes/themes.plugin.zsh +++ /dev/null @@ -1,24 +0,0 @@ -function theme -{ - if [ "$1" = "random" ]; then - themes=($ZSH/themes/*zsh-theme) - N=${#themes[@]} - ((N=(RANDOM%N)+1)) - RANDOM_THEME=${themes[$N]} - source "$RANDOM_THEME" - echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." - else - if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ] - then - source "$ZSH_CUSTOM/$1.zsh-theme" - else - source "$ZSH/themes/$1.zsh-theme" - fi - fi -} - -function lstheme -{ - cd $ZSH/themes - ls *zsh-theme | sed 's,\.zsh-theme$,,' -} diff --git a/dot.oh-my-zsh/plugins/thor/_thor b/dot.oh-my-zsh/plugins/thor/_thor deleted file mode 100644 index 9f7ed5a..0000000 --- a/dot.oh-my-zsh/plugins/thor/_thor +++ /dev/null @@ -1,4 +0,0 @@ -#compdef thor -#autoload - -compadd `thor list | grep thor | cut -d " " -f 2` diff --git a/dot.oh-my-zsh/plugins/urltools/urltools.plugin.zsh b/dot.oh-my-zsh/plugins/urltools/urltools.plugin.zsh deleted file mode 100644 index 4ddfff8..0000000 --- a/dot.oh-my-zsh/plugins/urltools/urltools.plugin.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# URL Tools -# Adds handy command line aliases useful for dealing with URLs -# -# Taken from: -# http://ruslanspivak.com/2010/06/02/urlencode-and-urldecode-from-a-command-line/ - -if [[ $(whence $URLTOOLS_METHOD) = "" ]]; then - URLTOOLS_METHOD="" -fi - -if [[ $(whence node) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xnode" ) ]]; then - alias urlencode='node -e "console.log(encodeURIComponent(process.argv[1]))"' - alias urldecode='node -e "console.log(decodeURIComponent(process.argv[1]))"' -elif [[ $(whence python) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then - alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"' - alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"' -elif [[ $(whence ruby) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xruby" ) ]]; then - alias urlencode='ruby -r cgi -e "puts CGI.escape(ARGV[0])"' - alias urldecode='ruby -r cgi -e "puts CGI.unescape(ARGV[0])"' -elif [[ $(whence php) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xphp" ) ]]; then - alias urlencode='php -r "echo rawurlencode(\$argv[1]); echo \"\n\";"' - alias urldecode='php -r "echo rawurldecode(\$argv[1]); echo \"\\n\";"' -elif [[ $(whence perl) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xperl" ) ]]; then - if perl -MURI::Encode -e 1&> /dev/null; then - alias urlencode='perl -MURI::Encode -ep "uri_encode($ARGV[0]);"' - alias urldecode='perl -MURI::Encode -ep "uri_decode($ARGV[0]);"' - elif perl -MURI::Escape -e 1 &> /dev/null; then - alias urlencode='perl -MURI::Escape -ep "uri_escape($ARGV[0]);"' - alias urldecode='perl -MURI::Escape -ep "uri_unescape($ARGV[0]);"' - else - alias urlencode="perl -e '\$new=\$ARGV[0]; \$new =~ s/([^A-Za-z0-9])/sprintf(\"%%%02X\", ord(\$1))/seg; print \"\$new\n\";'" - alias urldecode="perl -e '\$new=\$ARGV[0]; \$new =~ s/\%([A-Fa-f0-9]{2})/pack(\"C\", hex(\$1))/seg; print \"\$new\n\";'" - fi -fi - -unset URLTOOLS_METHOD \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/vagrant/_vagrant b/dot.oh-my-zsh/plugins/vagrant/_vagrant deleted file mode 100644 index 9bed1e3..0000000 --- a/dot.oh-my-zsh/plugins/vagrant/_vagrant +++ /dev/null @@ -1,111 +0,0 @@ -#compdef vagrant -#autoload - -# vagrant zsh completion - -local -a _1st_arguments -_1st_arguments=( - 'box:Box commands' - 'destroy:Destroys the vagrant environment' - 'halt:Halts the currently running vagrant environment' - 'help:[TASK] Describe available tasks or one specific task' - 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' - 'package:Packages a vagrant environment for distribution' - 'provision:Run the provisioner' - 'reload:Reload the vagrant environment' - 'resume:Resumes a suspend vagrant environment' - 'ssh:SSH into the currently running environment' - 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' - 'status:Shows the status of the current Vagrant environment.' - 'suspend:Suspends the currently running vagrant environment' - 'up:Creates the vagrant environment' - 'version:Prints the Vagrant version information' -) - -local -a _box_arguments -_box_arguments=( - 'add:NAME URI Add a box to the system' - 'help:COMMAND Describe subcommands or one specific subcommand' - 'list:Lists all installed boxes' - 'remove:NAME Remove a box from the system' - 'repackage:NAME Repackage an installed box into a `.box` file.' -) - -__task_list () -{ - local expl - declare -a tasks - - tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) - - _wanted tasks expl 'help' compadd $tasks -} - -__box_list () -{ - _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g') -} - -__vm_list () -{ - _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *:\([a-zA-Z0-9]\+\)' 2>/dev/null | cut -d: -f2) -} - -__vagrant-box () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "gem subcommand" _box_arguments - return - ;; - - (options) - case $line[1] in - (repackage|remove) - _arguments ':feature:__box_list' - ;; - esac - ;; - esac -} - - - - -local expl -local -a boxes installed_boxes - -local curcontext="$curcontext" state line -typeset -A opt_args - -_arguments -C \ - ':command:->command' \ - '*::options:->options' - -case $state in - (command) - _describe -t commands "gem subcommand" _1st_arguments - return - ;; - - (options) - case $line[1] in - (help) - _arguments ':feature:__task_list' - ;; - - (box) - __vagrant-box - ;; - (up|provision|package|destroy|reload|ssh|halt|resume|status) - _arguments ':feature:__vm_list' - esac - ;; -esac diff --git a/dot.oh-my-zsh/plugins/vi-mode/vi-mode.plugin.zsh b/dot.oh-my-zsh/plugins/vi-mode/vi-mode.plugin.zsh deleted file mode 100644 index a061004..0000000 --- a/dot.oh-my-zsh/plugins/vi-mode/vi-mode.plugin.zsh +++ /dev/null @@ -1,35 +0,0 @@ -# Ensures that $terminfo values are valid and updates editor information when -# the keymap changes. -function zle-keymap-select zle-line-init zle-line-finish { - # The terminal must be in application mode when ZLE is active for $terminfo - # values to be valid. - if (( ${+terminfo[smkx]} )); then - printf '%s' ${terminfo[smkx]} - fi - if (( ${+terminfo[rmkx]} )); then - printf '%s' ${terminfo[rmkx]} - fi - - zle reset-prompt - zle -R -} - -zle -N zle-line-init -zle -N zle-line-finish -zle -N zle-keymap-select - -bindkey -v - -# if mode indicator wasn't setup by theme, define default -if [[ "$MODE_INDICATOR" == "" ]]; then - MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" -fi - -function vi_mode_prompt_info() { - echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}" -} - -# define right prompt, if it wasn't defined by a theme -if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then - RPS1='$(vi_mode_prompt_info)' -fi diff --git a/dot.oh-my-zsh/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/dot.oh-my-zsh/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh deleted file mode 100644 index 0ed2565..0000000 --- a/dot.oh-my-zsh/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ /dev/null @@ -1,40 +0,0 @@ -wrapsource=`which virtualenvwrapper_lazy.sh` - -if [[ -f "$wrapsource" ]]; then - source $wrapsource - - if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then - # Automatically activate Git projects' virtual environments based on the - # directory name of the project. Virtual environment name can be overridden - # by placing a .venv file in the project root with a virtualenv name in it - function workon_cwd { - # Check that this is a Git repo - PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null` - if (( $? == 0 )); then - # Check for virtualenv name override - ENV_NAME=`basename "$PROJECT_ROOT"` - if [[ -f "$PROJECT_ROOT/.venv" ]]; then - ENV_NAME=`cat "$PROJECT_ROOT/.venv"` - fi - # Activate the environment only if it is not already active - if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then - if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then - workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME" - fi - fi - elif [ $CD_VIRTUAL_ENV ]; then - # We've just left the repo, deactivate the environment - # Note: this only happens if the virtualenv was activated automatically - deactivate && unset CD_VIRTUAL_ENV - fi - unset PROJECT_ROOT - } - - # New cd function that does the virtualenv magic - function cd { - builtin cd "$@" && workon_cwd - } - fi -else - print "zsh virtualenvwrapper plugin: Cannot find virtualenvwrapper_lazy.sh. Please install with \`pip install virtualenvwrapper\`." -fi diff --git a/dot.oh-my-zsh/plugins/vundle/vundle.plugin.zsh b/dot.oh-my-zsh/plugins/vundle/vundle.plugin.zsh deleted file mode 100644 index 005a584..0000000 --- a/dot.oh-my-zsh/plugins/vundle/vundle.plugin.zsh +++ /dev/null @@ -1,23 +0,0 @@ -function vundle-init () { - if [ ! -d ~/.vim/bundle/vundle/ ] - then - mkdir -p ~/.vim/bundle/vundle/ - fi - - if [ ! -d ~/.vim/bundle/vundle/.git/ ] - then - git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle - echo "\n\tRead about vim configuration for vundle at https://github.com/gmarik/vundle\n" - fi -} - -function vundle () { - vundle-init - vim -c "execute \"BundleInstall\" | q | q" -} - - -function vundle-update () { - vundle-init - vim -c "execute \"BundleInstall!\" | q | q" -} diff --git a/dot.oh-my-zsh/plugins/wakeonlan/README b/dot.oh-my-zsh/plugins/wakeonlan/README deleted file mode 100644 index 16fdd45..0000000 --- a/dot.oh-my-zsh/plugins/wakeonlan/README +++ /dev/null @@ -1,29 +0,0 @@ -This plugin provides a wrapper around the "wakeonlan" tool available from most -distributions' package repositories, or from the following website: - -http://gsd.di.uminho.pt/jpo/software/wakeonlan/ - -In order to use this wrapper, create the ~/.wakeonlan directory, and place in -that directory one file for each device you would like to be able to wake. Give -the file a name that describes the device, such as its hostname. Each file -should contain a line with the mac address of the target device and the network -broadcast address. - -For instance, there might be a file ~/.wakeonlan/leto with the following -contents: - -00:11:22:33:44:55:66 192.168.0.255 - -To wake that device, use the following command: - -# wake leto - -The available device names will be autocompleted, so: - -# wake - -...will suggest "leto", along with any other configuration files that were -placed in the ~/.wakeonlan directory. - -For more information regarding the configuration file format, check the -wakeonlan man page. diff --git a/dot.oh-my-zsh/plugins/wakeonlan/_wake b/dot.oh-my-zsh/plugins/wakeonlan/_wake deleted file mode 100644 index 4ab10d3..0000000 --- a/dot.oh-my-zsh/plugins/wakeonlan/_wake +++ /dev/null @@ -1,4 +0,0 @@ -#compdef wake -#autoload - -_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0 diff --git a/dot.oh-my-zsh/plugins/wakeonlan/wakeonlan.plugin.zsh b/dot.oh-my-zsh/plugins/wakeonlan/wakeonlan.plugin.zsh deleted file mode 100644 index 6cef7d4..0000000 --- a/dot.oh-my-zsh/plugins/wakeonlan/wakeonlan.plugin.zsh +++ /dev/null @@ -1,14 +0,0 @@ -function wake() { - local config_file="$HOME/.wakeonlan/$1" - if [[ ! -f "$config_file" ]]; then - echo "ERROR: There is no configuration file at \"$config_file\"." - return 1 - fi - - if (( ! $+commands[wakeonlan] )); then - echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" - return 1 - fi - - wakeonlan -f "$config_file" -} diff --git a/dot.oh-my-zsh/plugins/yum/yum.plugin.zsh b/dot.oh-my-zsh/plugins/yum/yum.plugin.zsh deleted file mode 100644 index 69abfc4..0000000 --- a/dot.oh-my-zsh/plugins/yum/yum.plugin.zsh +++ /dev/null @@ -1,16 +0,0 @@ -## Aliases - -alias ys="yum search" # search package -alias yp="yum info" # show package info -alias yl="yum list" # list packages -alias ygl="yum grouplist" # list package groups -alias yli="yum list installed" # print all installed packages -alias ymc="yum makecache" # rebuilds the yum package list - -alias yu="sudo yum update" # upgrate packages -alias yi="sudo yum install" # install package -alias ygi="sudo yum groupinstall" # install package group -alias yr="sudo yum remove" # remove package -alias ygr="sudo yum groupremove" # remove pagage group -alias yrl="sudo yum remove --remove-leaves" # remove package and leaves -alias yc="sudo yum clean all" # clean cache \ No newline at end of file diff --git a/dot.oh-my-zsh/plugins/zeus/README.md b/dot.oh-my-zsh/plugins/zeus/README.md deleted file mode 100644 index d7c2aef..0000000 --- a/dot.oh-my-zsh/plugins/zeus/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## zeus -**Maintainer:** [b4mboo](https://github.com/b4mboo) - -* `zi` aliases `zeus init` -* `zinit` aliases `zeus init` - -* `zs` aliases `zeus start` -* `ztart` aliases `zeus start` - -* `zc` aliases `zeus console` -* `zonsole` aliases `zeus console` - -* `zsr` aliases `zeus server` -* `zerver` aliases `zeus server` - -* `zr` aliases `zeus rake` -* `zake` aliases `zeus rake` - -* `zg` aliases `zeus generate` -* `zenerate` aliases `zeus generate` - -* `zrn` aliases `zeus runner` -* `zunner` aliases `zeus runner` - -* `zcu` aliases `zeus cucumber` -* `zucumber` aliases `zeus cucumber` - -* `zspec` aliases `zeus rspec` - -* `zt` aliases `zeus test` -* `zest` aliases `zeus test` - -* `zu` aliases `zeus test test/unit/*` -* `zunits` aliases `zeus test test/unit/*` - -* `zf` aliases `zeus test test/functional/*` -* `zunctional` aliases `zeus test test/functional/*` - -* `za` aliases `zeus test test/unit/*; zeus test test/functional/; zeus cucumber` -* `zall` aliases `zeus test test/unit/*; zeus test test/functional/; zeus cucumber` - -* `zsw` aliases `rm .zeus.sock` -* `zweep` aliases `rm .zeus.sock` diff --git a/dot.oh-my-zsh/plugins/zeus/zeus.plugin.zsh b/dot.oh-my-zsh/plugins/zeus/zeus.plugin.zsh deleted file mode 100644 index 1658b34..0000000 --- a/dot.oh-my-zsh/plugins/zeus/zeus.plugin.zsh +++ /dev/null @@ -1,61 +0,0 @@ -# Some aliases for zeus. (See: https://github.com/burke/zeus) -# Zeus preloads your Rails environment and forks that process whenever -# needed. This effectively speeds up Rails' boot process to under 1 sec. - -# Always use bundler. -# Rails depends on bundler, so we can be pretty sure, that there are no -# problems with this command. For all the other aliases I provided an -# alternative, in case people have conflicts with other plugins (e.g. suse). -alias zeus='bundle exec zeus' - -# Init -alias zi='zeus init' -alias zinit='zeus init' - -# Start -alias zs='zeus start' -alias ztart='zeus start' - -# Console -alias zc='zeus console' -alias zonsole='zeus console' - -# Server -alias zsr='zeus server' -alias zerver='zeus server' - -# Rake -alias zr='zeus rake' -alias zake='zeus rake' - -# Generate -alias zg='zeus generate' -alias zenerate='zeus generate' - -# Runner -alias zrn='zeus runner' -alias zunner='zeus runner' - -# Cucumber -alias zcu='zeus cucumber' -alias zucumber='zeus cucumber' - -# Rspec -alias zspec='zeus rspec' - -# Test -alias zt='zeus test' -alias zest='zeus test' - -alias zu='zeus test test/unit/*' -alias zunits='zeus test test/unit/*' - -alias zf='zeus test test/functional/*' -alias zunctional='zeus test test/functional/*' - -alias za='zeus test test/unit/*; zeus test test/functional/; zeus cucumber' -alias zall='zeus test test/unit/*; zeus test test/functional/; zeus cucumber' - -# Clean up crashed zeus instances. -alias zsw='rm .zeus.sock' -alias zweep='rm .zeus.sock' diff --git a/dot.oh-my-zsh/plugins/zsh-syntax-highlighting b/dot.oh-my-zsh/plugins/zsh-syntax-highlighting deleted file mode 160000 index 4519467..0000000 --- a/dot.oh-my-zsh/plugins/zsh-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 45194671af8e1d6b37b16e214a58674762ab8e49 diff --git a/dot.oh-my-zsh/templates/zshrc.zsh-template b/dot.oh-my-zsh/templates/zshrc.zsh-template deleted file mode 100644 index 2ea9934..0000000 --- a/dot.oh-my-zsh/templates/zshrc.zsh-template +++ /dev/null @@ -1,39 +0,0 @@ -# Path to your oh-my-zsh configuration. -ZSH=$HOME/.oh-my-zsh - -# Set name of the theme to load. -# Look in ~/.oh-my-zsh/themes/ -# Optionally, if you set this to "random", it'll load a random theme each -# time that oh-my-zsh is loaded. -ZSH_THEME="robbyrussell" - -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - -# Set to this to use case-sensitive completion -# CASE_SENSITIVE="true" - -# Comment this out to disable bi-weekly auto-update checks -# DISABLE_AUTO_UPDATE="true" - -# Uncomment to change how many often would you like to wait before auto-updates occur? (in days) -# export UPDATE_ZSH_DAYS=13 - -# Uncomment following line if you want to disable colors in ls -# DISABLE_LS_COLORS="true" - -# Uncomment following line if you want to disable autosetting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment following line if you want red dots to be displayed while waiting for completion -# COMPLETION_WAITING_DOTS="true" - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(git) - -source $ZSH/oh-my-zsh.sh - -# Customize to your needs... diff --git a/dot.oh-my-zsh/themes/3den.zsh-theme b/dot.oh-my-zsh/themes/3den.zsh-theme deleted file mode 100644 index 1d2c7db..0000000 --- a/dot.oh-my-zsh/themes/3den.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT=$'%{$fg[white]%}$(~/.rvm/bin/rvm-prompt) %{$fg_bold[cyan]%}%~%{$reset_color%}$(git_prompt_info) %{$fg[cyan]%}%D{[%I:%M:%S]}\ -%{$fg_bold[green]%}%n$%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="*" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/dot.oh-my-zsh/themes/Soliah.zsh-theme b/dot.oh-my-zsh/themes/Soliah.zsh-theme deleted file mode 100644 index 237e70f..0000000 --- a/dot.oh-my-zsh/themes/Soliah.zsh-theme +++ /dev/null @@ -1,86 +0,0 @@ -PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(check_git_prompt_info) -$ ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" - -# Text to display if the branch is dirty -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" - -# Text to display if the branch is clean -ZSH_THEME_GIT_PROMPT_CLEAN="" - -# Colors vary depending on time lapsed. -ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" -ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" - - -# Git sometimes goes into a detached head state. git_prompt_info doesn't -# return anything in this case. So wrap it in another function and check -# for an empty string. -function check_git_prompt_info() { - if git rev-parse --git-dir > /dev/null 2>&1; then - if [[ -z $(git_prompt_info) ]]; then - echo "%{$fg[magenta]%}detached-head%{$reset_color%})" - else - echo "$(git_prompt_info)" - fi - fi -} - -# Determine if we are using a gemset. -function rvm_gemset() { - GEMSET=`rvm gemset list | grep '=>' | cut -b4-` - if [[ -n $GEMSET ]]; then - echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|" - fi - -} - -# Determine the time since last commit. If branch is clean, -# use a neutral color, otherwise colors will vary according to time. -function git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` - now=`date +%s` - seconds_since_last_commit=$((now-last_commit)) - - # Totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [[ -n $(git status -s 2> /dev/null) ]]; then - if [ "$MINUTES" -gt 30 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" - elif [ "$MINUTES" -gt 10 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - fi - - if [ "$HOURS" -gt 24 ]; then - echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - elif [ "$MINUTES" -gt 60 ]; then - echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - else - echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "($(rvm_gemset)$COLOR~|" - fi - fi -} diff --git a/dot.oh-my-zsh/themes/adben.zsh-theme b/dot.oh-my-zsh/themes/adben.zsh-theme deleted file mode 100644 index 9f777e8..0000000 --- a/dot.oh-my-zsh/themes/adben.zsh-theme +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env zsh -local USER_HOST='%{$terminfo[bold]$fg[yellow]%}%n@%m%{$reset_color%}' -local RETURN_CODE="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -local GIT_BRANCH='%{$terminfo[bold]$fg[red]%}$(git_prompt_info)%{$reset_color%}' -local CURRENT_DIR='%{$terminfo[bold]$fg[green]%} %~%{$reset_color%}' -local RUBY_RVM='%{$fg[gray]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -local COMMAND_TIP='%{$terminfo[bold]$fg[blue]%}$(wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d' | sed 's/^/║/g')%{$reset_color%}' -######### PROMPT ######### -PROMPT="%{$terminfo[bold]$fg[blue]%}╔═ %{$reset_color%}${USER_HOST} ${CURRENT_DIR} ${RUBY_RVM} ${GIT_BRANCH} -${COMMAND_TIP} -%{$terminfo[bold]$fg[blue]%}╚═ %{$reset_color%}%B%{$terminfo[bold]$fg[white]%}$%b%{$reset_color%} " -RPS1='${RETURN_CODE}' -RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' -######### PROMPT ######### -########## GIT ########### -ZSH_THEME_GIT_PROMPT_PREFIX="‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%}›" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" -ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}" -########## GIT ########### diff --git a/dot.oh-my-zsh/themes/af-magic.zsh-theme b/dot.oh-my-zsh/themes/af-magic.zsh-theme deleted file mode 100644 index c1b00c6..0000000 --- a/dot.oh-my-zsh/themes/af-magic.zsh-theme +++ /dev/null @@ -1,36 +0,0 @@ -# af-magic.zsh-theme -# -# Author: Andy Fleming -# URL: http://andyfleming.com/ -# Repo: https://github.com/andyfleming/oh-my-zsh -# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme -# -# Created on: June 19, 2012 -# Last modified on: June 20, 2012 - - - -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -# primary prompt -PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%} -$FG[032]%~\ -$(git_prompt_info) \ -$FG[105]%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='${return_code}' - - -# color vars -eval my_gray='$FG[237]' -eval my_orange='$FG[214]' - -# right prompt -RPROMPT='$my_gray%n@%m%{$reset_color%}%' - -# git settings -ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:" -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/afowler.zsh-theme b/dot.oh-my-zsh/themes/afowler.zsh-theme deleted file mode 100644 index 3a4753f..0000000 --- a/dot.oh-my-zsh/themes/afowler.zsh-theme +++ /dev/null @@ -1,10 +0,0 @@ -if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi - -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%m %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' - -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/agnoster.zsh-theme b/dot.oh-my-zsh/themes/agnoster.zsh-theme deleted file mode 100644 index c3107c0..0000000 --- a/dot.oh-my-zsh/themes/agnoster.zsh-theme +++ /dev/null @@ -1,115 +0,0 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 -# -# agnoster's Theme - https://gist.github.com/3712874 -# A Powerline-inspired theme for ZSH -# -# # README -# -# In order for this theme to render correctly, you will need a -# [Powerline-patched font](https://gist.github.com/1595572). -# -# In addition, I recommend the -# [Solarized theme](https://github.com/altercation/solarized/) and, if you're -# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app - -# it has significantly better color fidelity. -# -# # Goals -# -# The aim of this theme is to only show you *relevant* information. Like most -# prompts, it will only show git information when in a git working directory. -# However, it goes a step further: everything from the current user and -# hostname to whether the last call exited with an error to whether background -# jobs are running in this shell will all be displayed automatically when -# appropriate. - -### Segment drawing -# A few utility functions to make it easy and re-usable to draw segmented prompts - -CURRENT_BG='NONE' -SEGMENT_SEPARATOR='⮀' - -# Begin a segment -# Takes two arguments, background and foreground. Both can be omitted, -# rendering default background/foreground. -prompt_segment() { - local bg fg - [[ -n $1 ]] && bg="%K{$1}" || bg="%k" - [[ -n $2 ]] && fg="%F{$2}" || fg="%f" - if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then - echo -n " %{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%} " - else - echo -n "%{$bg%}%{$fg%} " - fi - CURRENT_BG=$1 - [[ -n $3 ]] && echo -n $3 -} - -# End the prompt, closing any open segments -prompt_end() { - if [[ -n $CURRENT_BG ]]; then - echo -n " %{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" - else - echo -n "%{%k%}" - fi - echo -n "%{%f%}" - CURRENT_BG='' -} - -### Prompt components -# Each component will draw itself, and hide itself if no information needs to be shown - -# Context: user@hostname (who am I and where am I) -prompt_context() { - local user=`whoami` - - if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then - prompt_segment black default "%(!.%{%F{yellow}%}.)$user@%m" - fi -} - -# Git: branch/detached head, dirty status -prompt_git() { - local ref dirty - if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then - ZSH_THEME_GIT_PROMPT_DIRTY='±' - dirty=$(parse_git_dirty) - ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" - if [[ -n $dirty ]]; then - prompt_segment yellow black - else - prompt_segment green black - fi - echo -n "${ref/refs\/heads\//⭠ }$dirty" - fi -} - -# Dir: current working directory -prompt_dir() { - prompt_segment blue black '%~' -} - -# Status: -# - was there an error -# - am I root -# - are there background jobs? -prompt_status() { - local symbols - symbols=() - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" - [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" - [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" - - [[ -n "$symbols" ]] && prompt_segment black default "$symbols" -} - -## Main prompt -build_prompt() { - RETVAL=$? - prompt_status - prompt_context - prompt_dir - prompt_git - prompt_end -} - -PROMPT='%{%f%b%k%}$(build_prompt) ' diff --git a/dot.oh-my-zsh/themes/alanpeabody.zsh-theme b/dot.oh-my-zsh/themes/alanpeabody.zsh-theme deleted file mode 100644 index 4a1b1b3..0000000 --- a/dot.oh-my-zsh/themes/alanpeabody.zsh-theme +++ /dev/null @@ -1,28 +0,0 @@ - -local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}' -local pwd='%{$fg[blue]%}%~%{$reset_color%}' -local rvm='' -if which rvm-prompt &> /dev/null; then - rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -else - if which rbenv &> /dev/null; then - rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' - fi -fi -local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})' -local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" - -PROMPT="${user} ${pwd}$ " -RPROMPT="${return_code} ${git_branch} ${rvm}" diff --git a/dot.oh-my-zsh/themes/apple.zsh-theme b/dot.oh-my-zsh/themes/apple.zsh-theme deleted file mode 100644 index 275341d..0000000 --- a/dot.oh-my-zsh/themes/apple.zsh-theme +++ /dev/null @@ -1,29 +0,0 @@ -function toon { - echo -n "" -} - -get_git_dirty() { - git diff --quiet || echo '*' -} - -autoload -Uz vcs_info -autoload -U colors && colors -zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes -zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes -zstyle ':vcs_info:*' actionformats \ - '%F{5}%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f ' -zstyle ':vcs_info:*' formats \ - '%F{5}%F{5}[%F{2}%b%c%u%F{5}]%f ' -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -zstyle ':vcs_info:*' enable git cvs svn - -theme_precmd () { - vcs_info -} - -setopt prompt_subst -PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}' - -autoload -U add-zsh-hook -add-zsh-hook precmd theme_precmd \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/arrow.zsh-theme b/dot.oh-my-zsh/themes/arrow.zsh-theme deleted file mode 100644 index d62dcdc..0000000 --- a/dot.oh-my-zsh/themes/arrow.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi - -PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}' -RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="*" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -# See http://geoff.greer.fm/lscolors/ -export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx" -export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:" - diff --git a/dot.oh-my-zsh/themes/aussiegeek.zsh-theme b/dot.oh-my-zsh/themes/aussiegeek.zsh-theme deleted file mode 100644 index c2c7f65..0000000 --- a/dot.oh-my-zsh/themes/aussiegeek.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ - -PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$(git_prompt_info)$fg[yellow]$(rvm_prompt_info)$fg_bold[blue] ]$reset_color - $ ' -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[green](" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" -ZSH_THEME_GIT_PROMPT_CLEAN="✔" -ZSH_THEME_GIT_PROMPT_DIRTY="✗" diff --git a/dot.oh-my-zsh/themes/awesomepanda.zsh-theme b/dot.oh-my-zsh/themes/awesomepanda.zsh-theme deleted file mode 100644 index 411b898..0000000 --- a/dot.oh-my-zsh/themes/awesomepanda.zsh-theme +++ /dev/null @@ -1,18 +0,0 @@ -# the svn plugin has to be activated for this to work. - -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " - - - -ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}" -ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}" - -ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" -ZSH_THEME_SVN_PROMPT_SUFFIX=")" -ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" -ZSH_THEME_SVN_PROMPT_CLEAN=" " \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/bira.zsh-theme b/dot.oh-my-zsh/themes/bira.zsh-theme deleted file mode 100644 index 2157204..0000000 --- a/dot.oh-my-zsh/themes/bira.zsh-theme +++ /dev/null @@ -1,21 +0,0 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' -local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' -local rvm_ruby='' -if which rvm-prompt &> /dev/null; then - rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' - fi -fi -local git_branch='$(git_prompt_info)%{$reset_color%}' - -PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} -╰─%B$%b " -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/blinks.zsh-theme b/dot.oh-my-zsh/themes/blinks.zsh-theme deleted file mode 100644 index ddb32f7..0000000 --- a/dot.oh-my-zsh/themes/blinks.zsh-theme +++ /dev/null @@ -1,30 +0,0 @@ -# https://github.com/blinks zsh theme - -function _prompt_char() { - if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then - echo "%{%F{blue}%}±%{%f%k%b%}" - else - echo ' ' - fi -} - -# This theme works with both the "dark" and "light" variants of the -# Solarized color schema. Set the SOLARIZED_THEME variable to one of -# these two values to choose. If you don't specify, we'll assume you're -# using the "dark" variant. - -case ${SOLARIZED_THEME:-dark} in - light) bkg=white;; - *) bkg=black;; -esac - -ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{${bkg}}%B%F{green}%}]" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -PROMPT='%{%f%k%b%} -%{%K{${bkg}}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{${bkg}}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%} -%{%K{${bkg}}%}$(_prompt_char)%{%K{${bkg}}%} %#%{%f%k%b%} ' - -RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}' diff --git a/dot.oh-my-zsh/themes/candy-kingdom.zsh-theme b/dot.oh-my-zsh/themes/candy-kingdom.zsh-theme deleted file mode 100644 index 25aeb65..0000000 --- a/dot.oh-my-zsh/themes/candy-kingdom.zsh-theme +++ /dev/null @@ -1,37 +0,0 @@ -# neuralsanwich.zsh-theme -# -# Author: Sean Jones -# URL: http://www.neuralsandwich.com -# Repo: -# Direct link: -# Create: -# Modified: - -if [ "x$OH_MY_ZSH_HG" = "x" ]; then - OH_MY_ZSH_HG="hg" -fi - -function hg_prompt_info { - $OH_MY_ZSH_HG prompt --angle-brackets "\ -< on %{$fg[magenta]%}%{$reset_color%}>\ -< at %{$fg[yellow]%}%{$reset_color%}>\ -%{$fg[green]%}%{$reset_color%}< -patches: >" 2>/dev/null -} - -function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || hostname -s -} - -PROMPT=' -%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) -%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" - -local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}" -RPROMPT='${return_status}$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}' diff --git a/dot.oh-my-zsh/themes/candy.zsh-theme b/dot.oh-my-zsh/themes/candy.zsh-theme deleted file mode 100644 index bc125c5..0000000 --- a/dot.oh-my-zsh/themes/candy.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\ -%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/dot.oh-my-zsh/themes/clean.zsh-theme b/dot.oh-my-zsh/themes/clean.zsh-theme deleted file mode 100644 index 7ee29cb..0000000 --- a/dot.oh-my-zsh/themes/clean.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi - -PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[yellow]%}%B" -ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/dot.oh-my-zsh/themes/cloud.zsh-theme b/dot.oh-my-zsh/themes/cloud.zsh-theme deleted file mode 100644 index 4efbf97..0000000 --- a/dot.oh-my-zsh/themes/cloud.zsh-theme +++ /dev/null @@ -1,10 +0,0 @@ -if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then - ZSH_THEME_CLOUD_PREFIX='☁' -fi - -PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]" \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/crunch.zsh-theme b/dot.oh-my-zsh/themes/crunch.zsh-theme deleted file mode 100644 index b2759a1..0000000 --- a/dot.oh-my-zsh/themes/crunch.zsh-theme +++ /dev/null @@ -1,43 +0,0 @@ -# CRUNCH - created from Steve Eley's cat waxing. -# Initially hacked from the Dallas theme. Thanks, Dallas Reedy. -# -# This theme assumes you do most of your oh-my-zsh'ed "colorful" work at a single machine, -# and eschews the standard space-consuming user and hostname info. Instead, only the -# things that vary in my own workflow are shown: -# -# * The time (not the date) -# * The RVM version and gemset (omitting the 'ruby' name if it's MRI) -# * The current directory -# * The Git branch and its 'dirty' state -# -# Colors are at the top so you can mess with those separately if you like. -# For the most part I stuck with Dallas's. - -CRUNCH_BRACKET_COLOR="%{$fg[white]%}" -CRUNCH_TIME_COLOR="%{$fg[yellow]%}" -CRUNCH_RVM_COLOR="%{$fg[magenta]%}" -CRUNCH_DIR_COLOR="%{$fg[cyan]%}" -CRUNCH_GIT_BRANCH_COLOR="%{$fg[green]%}" -CRUNCH_GIT_CLEAN_COLOR="%{$fg[green]%}" -CRUNCH_GIT_DIRTY_COLOR="%{$fg[red]%}" - -# These Git variables are used by the oh-my-zsh git_prompt_info helper: -ZSH_THEME_GIT_PROMPT_PREFIX="$CRUNCH_BRACKET_COLOR:$CRUNCH_GIT_BRANCH_COLOR" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_CLEAN=" $CRUNCH_GIT_CLEAN_COLOR✓" -ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" - -# Our elements: -CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" -if which rvm-prompt &> /dev/null; then - CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" -else - if which rbenv &> /dev/null; then - CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" - fi -fi -CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) " -CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ " - -# Put it all together! -PROMPT="$CRUNCH_TIME_$CRUNCH_RVM_$CRUNCH_DIR_$CRUNCH_PROMPT%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/cypher.zsh-theme b/dot.oh-my-zsh/themes/cypher.zsh-theme deleted file mode 100644 index 45df53d..0000000 --- a/dot.oh-my-zsh/themes/cypher.zsh-theme +++ /dev/null @@ -1,4 +0,0 @@ -# Based on evan's prompt -# Shows the exit status of the last command if non-zero -# Uses "#" instead of "»" when running with elevated privileges -PROMPT="%m %{${fg_bold[red]}%}:: %{${fg[green]}%}%3~%(0?. . ${fg[red]}%? )%{${fg[blue]}%}»%{${reset_color}%} " diff --git a/dot.oh-my-zsh/themes/dallas.zsh-theme b/dot.oh-my-zsh/themes/dallas.zsh-theme deleted file mode 100644 index e9b4f85..0000000 --- a/dot.oh-my-zsh/themes/dallas.zsh-theme +++ /dev/null @@ -1,32 +0,0 @@ -# Personalized! - -# Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} -DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}" -# Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -if which rvm-prompt &> /dev/null; then - DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" -else - if which rbenv &> /dev/null; then - DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}" - fi -fi -# Grab the current machine name: muscato -DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" -# Grab the current filepath, use shortcuts: ~/Desktop -# Append the current git branch, if in a git repository: ~aw@master -DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" -# Grab the current username: dallas -DALLAS_CURRENT_USER_="%{$fg[red]%}%n%{$reset_color%}" -# Use a % for normal users and a # for privelaged (root) users. -DALLAS_PROMPT_CHAR_="%{$fg[white]%}%(!.#.%%)%{$reset_color%}" -# For the git prompt, use a white @ and blue text for the branch name -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}@%{$fg[blue]%}" -# Close it all off by resetting the color and styles. -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -# Do nothing if the branch is clean (no changes). -ZSH_THEME_GIT_PROMPT_CLEAN="" -# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}✗✗✗" - -# Put it all together! -PROMPT="$DALLAS_CURRENT_TIME_$DALLAS_CURRENT_RUBY_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ " diff --git a/dot.oh-my-zsh/themes/darkblood.zsh-theme b/dot.oh-my-zsh/themes/darkblood.zsh-theme deleted file mode 100644 index 33508fb..0000000 --- a/dot.oh-my-zsh/themes/darkblood.zsh-theme +++ /dev/null @@ -1,9 +0,0 @@ -# meh. Dark Blood Rewind, a new beginning. - -PROMPT=$'%{$fg[red]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[red]%}@%{$fg_bold[white]%}%m%{$reset_color%}%{$fg[red]%}] [%{$fg_bold[white]%}/dev/%y%{$reset_color%}%{$fg[red]%}] %{$(git_prompt_info)%}%(?,,%{$fg[red]%}[%{$fg_bold[white]%}%?%{$reset_color%}%{$fg[red]%}]) -%{$fg[red]%}└[%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[red]%}]>%{$reset_color%} ' -PS2=$' %{$fg[red]%}|>%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}[%{$fg_bold[white]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[red]%}] " -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/daveverwer.zsh-theme b/dot.oh-my-zsh/themes/daveverwer.zsh-theme deleted file mode 100644 index 89aef92..0000000 --- a/dot.oh-my-zsh/themes/daveverwer.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -# Copied and modified from the oh-my-zsh theme from geoffgarside -# Red server name, green cwd, blue git status - -PROMPT='%{$fg[red]%}%m%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/dieter.zsh-theme b/dot.oh-my-zsh/themes/dieter.zsh-theme deleted file mode 100644 index 0a5e926..0000000 --- a/dot.oh-my-zsh/themes/dieter.zsh-theme +++ /dev/null @@ -1,56 +0,0 @@ -# the idea of this theme is to contain a lot of info in a small string, by -# compressing some parts and colorcoding, which bring useful visual cues, -# while limiting the amount of colors and such to keep it easy on the eyes. -# When a command exited >0, the timestamp will be in red and the exit code -# will be on the right edge. -# The exit code visual cues will only display once. -# (i.e. they will be reset, even if you hit enter a few times on empty command prompts) - -typeset -A host_repr - -# translate hostnames into shortened, colorcoded strings -host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4") - -# local time, color coded by last return code -time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}" -time_disabled="%{$fg[green]%}%*%{$reset_color%}" -time=$time_enabled - -# user part, color coded by privileges -local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}" - -# Hostname part. compressed and colorcoded per host_repr array -# if not found, regular hostname in default color -local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}" - -# Compacted $PWD -local pwd="%{$fg[blue]%}%c%{$reset_color%}" - -PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)' - -# i would prefer 1 icon that shows the "most drastic" deviation from HEAD, -# but lets see how this works out -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}" - -# elaborate exitcode on the right when >0 -return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -return_code_disabled= -return_code=$return_code_enabled - -RPS1='${return_code}' - -function accept-line-or-clear-warning () { - if [[ -z $BUFFER ]]; then - time=$time_disabled - return_code=$return_code_disabled - else - time=$time_enabled - return_code=$return_code_enabled - fi - zle accept-line -} -zle -N accept-line-or-clear-warning -bindkey '^M' accept-line-or-clear-warning diff --git a/dot.oh-my-zsh/themes/dogenpunk.zsh-theme b/dot.oh-my-zsh/themes/dogenpunk.zsh-theme deleted file mode 100644 index f4d65ab..0000000 --- a/dot.oh-my-zsh/themes/dogenpunk.zsh-theme +++ /dev/null @@ -1,85 +0,0 @@ -# ----------------------------------------------------------------------------- -# FILE: dogenpunk.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Matthew Nelson (dogenpunk@gmail.com) -# VERSION: 0.1 -# SCREENSHOT: coming soon -# ----------------------------------------------------------------------------- - -MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" -local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" - -PROMPT='%{$fg[blue]%}%m%{$reset_color%}%{$fg_bold[white]%} ओम् %{$reset_color%}%{$fg[cyan]%}%~:%{$reset_color%}$(git_time_since_commit)$(git_prompt_info) -%{$fg[red]%}%!%{$reset_color%} $(prompt_char) ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}git%{$reset_color%}@%{$bg[white]%}%{$fg[black]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" - -function prompt_char() { - git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return - hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return - echo "%{$fg[cyan]%}◯ %{$reset_color%}" -} - -# Colors vary depending on time lapsed. -ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" -ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" - -# Determine the time since last commit. If branch is clean, -# use a neutral color, otherwise colors will vary according to time. -function git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` - now=`date +%s` - seconds_since_last_commit=$((now-last_commit)) - - # Totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [[ -n $(git status -s 2> /dev/null) ]]; then - if [ "$MINUTES" -gt 30 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" - elif [ "$MINUTES" -gt 10 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - fi - - if [ "$HOURS" -gt 24 ]; then - echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - elif [ "$MINUTES" -gt 60 ]; then - echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - else - echo "($COLOR${MINUTES}m%{$reset_color%}|" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "($COLOR~|" - fi - fi -} diff --git a/dot.oh-my-zsh/themes/dpoggi.zsh-theme b/dot.oh-my-zsh/themes/dpoggi.zsh-theme deleted file mode 100644 index 6469a20..0000000 --- a/dot.oh-my-zsh/themes/dpoggi.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[$NCOLOR]%}%n%{$reset_color%}@%{$fg[cyan]%}%m\ -%{$reset_color%}:%{$fg[magenta]%}%~\ -$(git_prompt_info) \ -%{$fg[red]%}%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='${return_code}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}○%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%})%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/dst.zsh-theme b/dot.oh-my-zsh/themes/dst.zsh-theme deleted file mode 100644 index 3e2539d..0000000 --- a/dot.oh-my-zsh/themes/dst.zsh-theme +++ /dev/null @@ -1,16 +0,0 @@ - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -function prompt_char { - if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi -} - -PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%} -) -%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) -%_ $(prompt_char) ' - -RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/dot.oh-my-zsh/themes/dstufft.zsh-theme b/dot.oh-my-zsh/themes/dstufft.zsh-theme deleted file mode 100644 index 5a23fce..0000000 --- a/dot.oh-my-zsh/themes/dstufft.zsh-theme +++ /dev/null @@ -1,19 +0,0 @@ -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - hg root >/dev/null 2>/dev/null && echo 'Hg' && return - echo '○' -} - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - -PROMPT=' -%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) -$(virtualenv_info)$(prompt_char) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/dot.oh-my-zsh/themes/duellj.zsh-theme b/dot.oh-my-zsh/themes/duellj.zsh-theme deleted file mode 100644 index 7350b43..0000000 --- a/dot.oh-my-zsh/themes/duellj.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ - -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;34m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}%!%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' -RPROMPT='[%*]' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/dot.oh-my-zsh/themes/eastwood.zsh-theme b/dot.oh-my-zsh/themes/eastwood.zsh-theme deleted file mode 100644 index db25299..0000000 --- a/dot.oh-my-zsh/themes/eastwood.zsh-theme +++ /dev/null @@ -1,23 +0,0 @@ -#RVM settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then - RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" -else - if which rbenv &> /dev/null; then - RPS1="%{$fg[yellow]%}rbenv:%{$reset_color%}%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$reset_color%} $EPS1" - fi -fi - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -#Customized git status, oh-my-zsh currently does not allow render dirty status before branch -git_custom_status() { - local cb=$(current_branch) - if [ -n "$cb" ]; then - echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" - fi -} - -PROMPT='$(git_custom_status)%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b ' diff --git a/dot.oh-my-zsh/themes/edvardm.zsh-theme b/dot.oh-my-zsh/themes/edvardm.zsh-theme deleted file mode 100644 index f9ca1a9..0000000 --- a/dot.oh-my-zsh/themes/edvardm.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg_bold[white]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/evan.zsh-theme b/dot.oh-my-zsh/themes/evan.zsh-theme deleted file mode 100644 index 5ef1f40..0000000 --- a/dot.oh-my-zsh/themes/evan.zsh-theme +++ /dev/null @@ -1,2 +0,0 @@ -# Evan describes this sexy prompt as: "a skinny, topless prompt" -PROMPT='%m :: %2~ %B»%b ' \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/example.zsh-theme b/dot.oh-my-zsh/themes/example.zsh-theme deleted file mode 100644 index dbd9dc9..0000000 --- a/dot.oh-my-zsh/themes/example.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -# Found on the ZshWiki -# http://zshwiki.org/home/config/prompt -# - -PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/fino-time.zsh-theme b/dot.oh-my-zsh/themes/fino-time.zsh-theme deleted file mode 100644 index 7154e09..0000000 --- a/dot.oh-my-zsh/themes/fino-time.zsh-theme +++ /dev/null @@ -1,39 +0,0 @@ -# Fino-time theme by Aexander Berezovsky (http://berezovsky.me) based on Fino by Max Masnick (http://max.masnick.me) - -# Use with a dark background and 256-color terminal! -# Meant for people with RVM and git. Tested only on OS X 10.7. - -# You can set your computer name in the ~/.box-name file if you want. - -# Borrowing shamelessly from these oh-my-zsh themes: -# bira -# robbyrussell -# -# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '⠠⠵' && return - echo '○' -} - -function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || hostname -s -} - - -local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' -local current_dir='${PWD/#$HOME/~}' -local git_info='$(git_prompt_info)' - - -PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} %D - %* -╰─$(virtualenv_info)$(prompt_char) " - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" diff --git a/dot.oh-my-zsh/themes/fino.zsh-theme b/dot.oh-my-zsh/themes/fino.zsh-theme deleted file mode 100644 index 26e5471..0000000 --- a/dot.oh-my-zsh/themes/fino.zsh-theme +++ /dev/null @@ -1,46 +0,0 @@ -# Fino theme by Max Masnick (http://max.masnick.me) - -# Use with a dark background and 256-color terminal! -# Meant for people with RVM and git. Tested only on OS X 10.7. - -# You can set your computer name in the ~/.box-name file if you want. - -# Borrowing shamelessly from these oh-my-zsh themes: -# bira -# robbyrussell -# -# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - echo '○' -} - -function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || hostname -s -} - - -local rvm_ruby='' -if which rvm-prompt &> /dev/null; then - rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' - fi -fi -local current_dir='${PWD/#$HOME/~}' -local git_info='$(git_prompt_info)' - - -PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} -╰─$(virtualenv_info)$(prompt_char) " - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/fishy.zsh-theme b/dot.oh-my-zsh/themes/fishy.zsh-theme deleted file mode 100644 index e9f78a5..0000000 --- a/dot.oh-my-zsh/themes/fishy.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -# ZSH Theme emulating the Fish shell's default prompt. - -_fishy_collapsed_wd() { - echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g") -} - -local user_color='green'; [ $UID -eq 0 ] && user_color='red' -PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' - -local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}" -RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX=" " -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" diff --git a/dot.oh-my-zsh/themes/flazz.zsh-theme b/dot.oh-my-zsh/themes/flazz.zsh-theme deleted file mode 100644 index 280794f..0000000 --- a/dot.oh-my-zsh/themes/flazz.zsh-theme +++ /dev/null @@ -1,19 +0,0 @@ -if [ "$(whoami)" = "root" ] -then CARETCOLOR="red" -else CARETCOLOR="blue" -fi - -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} ' - -RPS1='$(vi_mode_prompt_info) ${return_code}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" - -MODE_INDICATOR="%{$fg_bold[magenta]%}<%{$reset_color%}%{$fg[magenta]%}<<%{$reset_color%}" - -# TODO use 265 colors -#MODE_INDICATOR="$FX[bold]$FG[020]<$FX[no_bold]%{$fg[blue]%}<<%{$reset_color%}" -# TODO use two lines if git diff --git a/dot.oh-my-zsh/themes/fletcherm.zsh-theme b/dot.oh-my-zsh/themes/fletcherm.zsh-theme deleted file mode 100644 index e961885..0000000 --- a/dot.oh-my-zsh/themes/fletcherm.zsh-theme +++ /dev/null @@ -1,12 +0,0 @@ -# Copied from old version of tonotdo's theme. LSCOLORS modified. -PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}•%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}⚡%{$fg_bold[blue]%})" - -export LSCOLORS="exfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/dot.oh-my-zsh/themes/fox.zsh-theme b/dot.oh-my-zsh/themes/fox.zsh-theme deleted file mode 100644 index 1959853..0000000 --- a/dot.oh-my-zsh/themes/fox.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -#fox theme -PROMPT='%{$fg[cyan]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[cyan]%}☮%{$fg_bold[white]%}%M%{$reset_color%}%{$fg[cyan]%}]%{$fg[white]%}-%{$fg[cyan]%}(%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[cyan]%})$(git_prompt_info) -└> % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="-[%{$reset_color%}%{$fg[white]%}git://%{$fg_bold[white]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[cyan]%}]-" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/frisk.zsh-theme b/dot.oh-my-zsh/themes/frisk.zsh-theme deleted file mode 100644 index 2c999a6..0000000 --- a/dot.oh-my-zsh/themes/frisk.zsh-theme +++ /dev/null @@ -1,22 +0,0 @@ -PROMPT=$' -%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)$(bzr_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%} -%{$fg_bold[black]%}>%{$reset_color%} ' - -PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" - -GIT_CB="git::" -ZSH_THEME_SCM_PROMPT_PREFIX="%{$fg[green]%}[" -ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -## Bazaar integration -bzr_prompt_info() { - BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'` - if [ -n "$BZR_CB" ]; then - BZR_DIRTY="" - [[ -n `bzr status` ]] && BZR_DIRTY="%{$fg[red]%} *%{$reset_color%}" - echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX" - fi -} diff --git a/dot.oh-my-zsh/themes/frontcube.zsh-theme b/dot.oh-my-zsh/themes/frontcube.zsh-theme deleted file mode 100644 index d9f5b6d..0000000 --- a/dot.oh-my-zsh/themes/frontcube.zsh-theme +++ /dev/null @@ -1,12 +0,0 @@ -local rvm="%{$fg[green]%}[$(rvm-prompt i v g)]%{$reset_color%}" - -PROMPT=' -%{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%} -%{$fg[green]%}➞ %{$reset_color%' - -RPROMPT='$(git_prompt_info) $(rvm)' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[red]%}✖ %{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}] %{$fg[green]%}✔%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/funky.zsh-theme b/dot.oh-my-zsh/themes/funky.zsh-theme deleted file mode 100644 index 2451296..0000000 --- a/dot.oh-my-zsh/themes/funky.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -# Taken from Tassilo's Blog -# http://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/ - -local blue_op="%{$fg[blue]%}[%{$reset_color%}" -local blue_cp="%{$fg[blue]%}]%{$reset_color%}" -local path_p="${blue_op}%~${blue_cp}" -local user_host="${blue_op}%n@%m${blue_cp}" -local ret_status="${blue_op}%?${blue_cp}" -local hist_no="${blue_op}%h${blue_cp}" -local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})" -PROMPT="╭─${path_p}─${user_host}─${ret_status}─${hist_no} -╰─${blue_op}${smiley}${blue_cp} %# " -local cur_cmd="${blue_op}%_${blue_cp}" -PROMPT2="${cur_cmd}> " \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/fwalch.zsh-theme b/dot.oh-my-zsh/themes/fwalch.zsh-theme deleted file mode 100644 index 24edf55..0000000 --- a/dot.oh-my-zsh/themes/fwalch.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/gallifrey.zsh-theme b/dot.oh-my-zsh/themes/gallifrey.zsh-theme deleted file mode 100644 index fce7cb9..0000000 --- a/dot.oh-my-zsh/themes/gallifrey.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -# ZSH Theme - Preview: http://img.skitch.com/20091113-qqtd3j8xinysujg5ugrsbr7x1y.jpg -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b ' -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/gallois.zsh-theme b/dot.oh-my-zsh/themes/gallois.zsh-theme deleted file mode 100644 index 3eac148..0000000 --- a/dot.oh-my-zsh/themes/gallois.zsh-theme +++ /dev/null @@ -1,25 +0,0 @@ -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -#Customized git status, oh-my-zsh currently does not allow render dirty status before branch -git_custom_status() { - local cb=$(current_branch) - if [ -n "$cb" ]; then - echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" - fi -} - -#RVM and git settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then - RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' -else - if which rbenv &> /dev/null; then - RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1' - else - RPS1='$(git_custom_status) $EPS1' - fi -fi - -PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' diff --git a/dot.oh-my-zsh/themes/garyblessington.zsh-theme b/dot.oh-my-zsh/themes/garyblessington.zsh-theme deleted file mode 100644 index b4f84a7..0000000 --- a/dot.oh-my-zsh/themes/garyblessington.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}: ' - -ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[blue]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[red]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/gentoo.zsh-theme b/dot.oh-my-zsh/themes/gentoo.zsh-theme deleted file mode 100644 index ee205d2..0000000 --- a/dot.oh-my-zsh/themes/gentoo.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -function prompt_char { - if [ $UID -eq 0 ]; then echo "#"; else echo $; fi -} - -PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=") " diff --git a/dot.oh-my-zsh/themes/geoffgarside.zsh-theme b/dot.oh-my-zsh/themes/geoffgarside.zsh-theme deleted file mode 100644 index 675ec72..0000000 --- a/dot.oh-my-zsh/themes/geoffgarside.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -# PROMPT="[%*] %n:%c $(git_prompt_info)%(!.#.$) " -PROMPT='[%*] %{$fg[cyan]%}%n%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/gnzh.zsh-theme b/dot.oh-my-zsh/themes/gnzh.zsh-theme deleted file mode 100644 index 3c6b8a4..0000000 --- a/dot.oh-my-zsh/themes/gnzh.zsh-theme +++ /dev/null @@ -1,54 +0,0 @@ -# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png -# Based on bira theme - -# load some modules -autoload -U colors zsh/terminfo # Used in the colour alias below -colors -setopt prompt_subst - -# make some aliases for the colours: (coud use normal escap.seq's too) -for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do - eval PR_$color='%{$fg[${(L)color}]%}' -done -eval PR_NO_COLOR="%{$terminfo[sgr0]%}" -eval PR_BOLD="%{$terminfo[bold]%}" - -# Check the UID -if [[ $UID -ge 1000 ]]; then # normal user - eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' - eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' - local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR' -elif [[ $UID -eq 0 ]]; then # root - eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' - eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' - local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR' -fi - -# Check if we are on SSH or not -if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then - eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH -else - eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH -fi - -local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" - -local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' -local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' -local rvm_ruby='' -if which rvm-prompt &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' - fi -fi -local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' - -#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " -PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} -╰─$PR_PROMPT " -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}" diff --git a/dot.oh-my-zsh/themes/gozilla.zsh-theme b/dot.oh-my-zsh/themes/gozilla.zsh-theme deleted file mode 100644 index c6b752e..0000000 --- a/dot.oh-my-zsh/themes/gozilla.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -RPROMPT='$(git_prompt_status)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" diff --git a/dot.oh-my-zsh/themes/humza.zsh-theme b/dot.oh-my-zsh/themes/humza.zsh-theme deleted file mode 100644 index 1078862..0000000 --- a/dot.oh-my-zsh/themes/humza.zsh-theme +++ /dev/null @@ -1,26 +0,0 @@ -# ZSH THEME Preview: https://skitch.com/huyy/rk979/humza.zshtheme - -let TotalBytes=0 -for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }') -do - let TotalBytes=$TotalBytes+$Bytes -done - # should it say b, kb, Mb, or Gb -if [ $TotalBytes -lt 1024 ]; then - TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) - suffix="b" -elif [ $TotalBytes -lt 1048576 ]; then - TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) - suffix="kb" -elif [ $TotalBytes -lt 1073741824 ]; then - TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) - suffix="Mb" -else - TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) - suffix="Gb" -fi - -PROMPT='%{$reset_color%}%n %{$fg[green]%}{%{$reset_color%}%~%{$fg[green]%}}%{$reset_color%}$(git_prompt_info) greetings, earthling %{$fg[green]%}[%{$reset_color%}%{$TotalSize%}%{$suffix%}%{$fg[green]%}]%{$fg[red]%}$%{$reset_color%} ☞ ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}±(" -ZSH_THEME_GIT_PROMPT_SUFFIX=");%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/imajes.zsh-theme b/dot.oh-my-zsh/themes/imajes.zsh-theme deleted file mode 100644 index 88c35b6..0000000 --- a/dot.oh-my-zsh/themes/imajes.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -# Found on the ZshWiki -# http://zshwiki.org/home/config/prompt -# - -PROMPT="%{$fg[red]%}%%%{$reset_color%} " \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/intheloop.zsh-theme b/dot.oh-my-zsh/themes/intheloop.zsh-theme deleted file mode 100644 index 85b4a4d..0000000 --- a/dot.oh-my-zsh/themes/intheloop.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -# ZSH theme by James Smith (http://loopj.com) -# A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status - -local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" - -local host_color="green" -if [ -n "$SSH_CLIENT" ]; then - local host_color="red" -fi - -PROMPT=' -%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[${host_color}]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status) -%{$fg_bold[cyan]%}❯%{$reset_color%} ' - - -RPROMPT='${return_status}%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}) %{$fg[yellow]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})" -ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}↓%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}↑%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}" \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/jbergantine.zsh-theme b/dot.oh-my-zsh/themes/jbergantine.zsh-theme deleted file mode 100644 index d84247c..0000000 --- a/dot.oh-my-zsh/themes/jbergantine.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[white]%}$(git_prompt_info)%{$fg_bold[white]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[white]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%})" diff --git a/dot.oh-my-zsh/themes/jispwoso.zsh-theme b/dot.oh-my-zsh/themes/jispwoso.zsh-theme deleted file mode 100644 index cdfef38..0000000 --- a/dot.oh-my-zsh/themes/jispwoso.zsh-theme +++ /dev/null @@ -1,4 +0,0 @@ -PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/%{$reset_color%} -%{$fg_bold[red]%}➜ %{$reset_color%} ' - -PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/jnrowe.zsh-theme b/dot.oh-my-zsh/themes/jnrowe.zsh-theme deleted file mode 100644 index bae88f7..0000000 --- a/dot.oh-my-zsh/themes/jnrowe.zsh-theme +++ /dev/null @@ -1,38 +0,0 @@ -autoload -U add-zsh-hook -autoload -Uz vcs_info - -zstyle ':vcs_info:*' actionformats \ - '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -zstyle ':vcs_info:*' formats '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -zstyle ':vcs_info:*' enable git - -add-zsh-hook precmd prompt_vcs - -prompt_vcs () { - vcs_info - - if [ "${vcs_info_msg_0_}" = "" ]; then - dir_status="%F{2}→%f" - elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then - dir_status="%F{1}▶%f" - elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then - dir_status="%F{3}▶%f" - else - dir_status="%F{2}▶%f" - fi -} - -function { - if [[ -n "$SSH_CLIENT" ]]; then - PROMPT_HOST=" ($HOST)" - else - PROMPT_HOST='' - fi -} - -local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)" - -PROMPT='${ret_status}%{$fg[blue]%}${PROMPT_HOST}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' - -# vim: set ft=zsh ts=4 sw=4 et: diff --git a/dot.oh-my-zsh/themes/jonathan.zsh-theme b/dot.oh-my-zsh/themes/jonathan.zsh-theme deleted file mode 100644 index 9f0f302..0000000 --- a/dot.oh-my-zsh/themes/jonathan.zsh-theme +++ /dev/null @@ -1,143 +0,0 @@ -functions rbenv_prompt_info >& /dev/null || rbenv_prompt_info(){} - -function theme_precmd { - local TERMWIDTH - (( TERMWIDTH = ${COLUMNS} - 1 )) - - - ### - # Truncate the path if it's too long. - - PR_FILLBAR="" - PR_PWDLEN="" - - local promptsize=${#${(%):---(%n@%m:%l)---()--}} - local rubyprompt=`rvm_prompt_info || rbenv_prompt_info` - local rubypromptsize=${#${rubyprompt}} - local pwdsize=${#${(%):-%~}} - - if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then - ((PR_PWDLEN=$TERMWIDTH - $promptsize)) - else - PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $rubypromptsize + $pwdsize)))..${PR_HBAR}.)}" - fi - -} - - -setopt extended_glob -theme_preexec () { - if [[ "$TERM" == "screen" ]]; then - local CMD=${1[(wr)^(*=*|sudo|-*)]} - echo -n "\ek$CMD\e\\" - fi -} - - -setprompt () { - ### - # Need this so the prompt will work. - - setopt prompt_subst - - - ### - # See if we can use colors. - - autoload colors zsh/terminfo - if [[ "$terminfo[colors]" -ge 8 ]]; then - colors - fi - for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do - eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' - eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' - (( count = $count + 1 )) - done - PR_NO_COLOUR="%{$terminfo[sgr0]%}" - - ### - # Modify Git prompt - ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}" - ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" - ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" - ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" - - ### - # See if we can use extended characters to look nicer. - - typeset -A altchar - set -A altchar ${(s..)terminfo[acsc]} - PR_SET_CHARSET="%{$terminfo[enacs]%}" - PR_SHIFT_IN="%{$terminfo[smacs]%}" - PR_SHIFT_OUT="%{$terminfo[rmacs]%}" - PR_HBAR=${altchar[q]:--} - PR_ULCORNER=${altchar[l]:--} - PR_LLCORNER=${altchar[m]:--} - PR_LRCORNER=${altchar[j]:--} - PR_URCORNER=${altchar[k]:--} - - - ### - # Decide if we need to set titlebar text. - - case $TERM in - xterm*) - PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}' - ;; - screen) - PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}' - ;; - *) - PR_TITLEBAR='' - ;; - esac - - - ### - # Decide whether to set a screen title - if [[ "$TERM" == "screen" ]]; then - PR_STITLE=$'%{\ekzsh\e\\%}' - else - PR_STITLE='' - fi - - - ### - # Finally, the prompt. - - PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\ -$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ -$PR_GREEN%$PR_PWDLEN<...<%~%<<\ -$PR_GREY)`rvm_prompt_info || rbenv_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ -$PR_CYAN%(!.%SROOT%s.%n)$PR_GREY@$PR_GREEN%m:%l\ -$PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\ - -$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\ -$PR_YELLOW%D{%H:%M:%S}\ -$PR_LIGHT_BLUE%{$reset_color%}`git_prompt_info``git_prompt_status`$PR_BLUE)$PR_CYAN$PR_SHIFT_IN$PR_HBAR\ -$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ ->$PR_NO_COLOUR ' - - # display exitcode on the right when >0 - return_code="%(?..%{$fg[red]%}%? ↵ %{$reset_color%})" - RPROMPT=' $return_code$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_BLUE$PR_HBAR$PR_SHIFT_OUT\ -($PR_YELLOW%D{%a,%b%d}$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR' - - PS2='$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ -$PR_BLUE$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\ -$PR_LIGHT_GREEN%_$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ -$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR ' -} - -setprompt - -autoload -U add-zsh-hook -add-zsh-hook precmd theme_precmd -add-zsh-hook preexec theme_preexec \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/josh.zsh-theme b/dot.oh-my-zsh/themes/josh.zsh-theme deleted file mode 100644 index 142e768..0000000 --- a/dot.oh-my-zsh/themes/josh.zsh-theme +++ /dev/null @@ -1,43 +0,0 @@ -grey='\e[0;90m' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})" - -function josh_prompt { - (( spare_width = ${COLUMNS} )) - prompt=" " - - branch=$(current_branch) - ruby_version=$(rvm_prompt_info || rbenv_prompt_info) - path_size=${#PWD} - branch_size=${#branch} - ruby_size=${#ruby_version} - user_machine_size=${#${(%):-%n@%m-}} - - if [[ ${#branch} -eq 0 ]] - then (( ruby_size = ruby_size + 1 )) - else - (( branch_size = branch_size + 4 )) - if [[ -n $(git status -s 2> /dev/null) ]]; then - (( branch_size = branch_size + 2 )) - fi - fi - - (( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) )) - - while [ ${#prompt} -lt $spare_width ]; do - prompt=" $prompt" - done - - prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)" - - echo $prompt -} - -setopt prompt_subst - -PROMPT=' -%n@%m $(josh_prompt) -%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} ' diff --git a/dot.oh-my-zsh/themes/jreese.zsh-theme b/dot.oh-my-zsh/themes/jreese.zsh-theme deleted file mode 100644 index 0fa6b4e..0000000 --- a/dot.oh-my-zsh/themes/jreese.zsh-theme +++ /dev/null @@ -1,16 +0,0 @@ -# ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png - -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \ -$(git_prompt_info)\ -%{$fg[red]%}%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='${return_code}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}±%{$fg[yellow]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="⚡" - diff --git a/dot.oh-my-zsh/themes/jtriley.zsh-theme b/dot.oh-my-zsh/themes/jtriley.zsh-theme deleted file mode 100644 index 15d77ed..0000000 --- a/dot.oh-my-zsh/themes/jtriley.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' -PROMPT="%{$fg_bold[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d -%{$fg_bold[yellow]%}%% %{$reset_color%}" - -#ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -#ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -#ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -#ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/juanghurtado.zsh-theme b/dot.oh-my-zsh/themes/juanghurtado.zsh-theme deleted file mode 100644 index 2f715cc..0000000 --- a/dot.oh-my-zsh/themes/juanghurtado.zsh-theme +++ /dev/null @@ -1,46 +0,0 @@ -# ------------------------------------------------------------------------ -# Juan G. Hurtado oh-my-zsh theme -# (Needs Git plugin for current_branch method) -# ------------------------------------------------------------------------ - -# Color shortcuts -RED=$fg[red] -YELLOW=$fg[yellow] -GREEN=$fg[green] -WHITE=$fg[white] -BLUE=$fg[blue] -RED_BOLD=$fg_bold[red] -YELLOW_BOLD=$fg_bold[yellow] -GREEN_BOLD=$fg_bold[green] -WHITE_BOLD=$fg_bold[white] -BLUE_BOLD=$fg_bold[blue] -RESET_COLOR=$reset_color - -# Format for git_prompt_info() -ZSH_THEME_GIT_PROMPT_PREFIX="" -ZSH_THEME_GIT_PROMPT_SUFFIX="" - -# Format for parse_git_dirty() -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}(*)" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -# Format for git_prompt_status() -ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged" -ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted" -ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed" -ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified" -ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added" -ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked" - -# Format for git_prompt_ahead() -ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)" - -# Format for git_prompt_long_sha() and git_prompt_short_sha() -ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$WHITE%}[%{$YELLOW%}" -ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]" - -# Prompt format -PROMPT=' -%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%} -%{$BLUE%}>%{$RESET_COLOR%} ' -RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/junkfood.zsh-theme b/dot.oh-my-zsh/themes/junkfood.zsh-theme deleted file mode 100644 index 57b4070..0000000 --- a/dot.oh-my-zsh/themes/junkfood.zsh-theme +++ /dev/null @@ -1,34 +0,0 @@ -# ------------------------------------------------------------------------ -# Tyler Cipriani -# oh-my-zsh theme -# Totally ripped off Dallas theme -# ------------------------------------------------------------------------ - -# Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}" - -# Grab the current machine name -JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%} ):%{$reset_color%}" - -# Grab the current username -JUNKFOOD_CURRENT_USER_="%{$fg_bold[green]%}%n%{$reset_color%}" - -# Grab the current filepath, use shortcuts: ~/Desktop -# Append the current git branch, if in a git repository: ~aw@master -JUNKFOOD_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" - -# For the git prompt, use a white @ and blue text for the branch name -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}@%{$fg_bold[white]%}" - -# Close it all off by resetting the color and styles. -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - -# Do nothing if the branch is clean (no changes). -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✔" - -# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗✗✗" - -# Put it all together! -PROMPT="$JUNKFOOD_TIME_$JUNKFOOD_CURRENT_USER_@$JUNKFOOD_MACHINE_$JUNKFOOD_LOCA_ - " diff --git a/dot.oh-my-zsh/themes/kafeitu.zsh-theme b/dot.oh-my-zsh/themes/kafeitu.zsh-theme deleted file mode 100644 index c4720b2..0000000 --- a/dot.oh-my-zsh/themes/kafeitu.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/kardan.zsh-theme b/dot.oh-my-zsh/themes/kardan.zsh-theme deleted file mode 100644 index fd6586a..0000000 --- a/dot.oh-my-zsh/themes/kardan.zsh-theme +++ /dev/null @@ -1,12 +0,0 @@ -# Simple theme based on my old zsh settings. - -function get_host { - echo '@'`hostname`'' -} - -PROMPT='> ' -RPROMPT='%~$(git_prompt_info)$(get_host)' - -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/kennethreitz.zsh-theme b/dot.oh-my-zsh/themes/kennethreitz.zsh-theme deleted file mode 100644 index 109be0c..0000000 --- a/dot.oh-my-zsh/themes/kennethreitz.zsh-theme +++ /dev/null @@ -1,13 +0,0 @@ -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[green]%}%c \ -$(git_prompt_info)\ -%{$fg[red]%}%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}" - diff --git a/dot.oh-my-zsh/themes/kolo.zsh-theme b/dot.oh-my-zsh/themes/kolo.zsh-theme deleted file mode 100644 index e743289..0000000 --- a/dot.oh-my-zsh/themes/kolo.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -autoload -U colors && colors - -autoload -Uz vcs_info - -zstyle ':vcs_info:*' stagedstr '%F{green}●' -zstyle ':vcs_info:*' unstagedstr '%F{yellow}●' -zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r' -zstyle ':vcs_info:*' enable git svn -theme_precmd () { - if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { - zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]' - } else { - zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]' - } - - vcs_info -} - -setopt prompt_subst -PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% ' - -autoload -U add-zsh-hook -add-zsh-hook precmd theme_precmd diff --git a/dot.oh-my-zsh/themes/kphoen.zsh-theme b/dot.oh-my-zsh/themes/kphoen.zsh-theme deleted file mode 100644 index 0e9b5e7..0000000 --- a/dot.oh-my-zsh/themes/kphoen.zsh-theme +++ /dev/null @@ -1,50 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: kphoen.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Kévin Gomez (geek63@gmail.com) -# VERSION: 1.0.0 -# SCREENSHOT: -# ------------------------------------------------------------------------------ - - -if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then - PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)] -%# ' - - ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}" - ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - # display exitcode on the right when >0 - return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - - RPROMPT='${return_code}$(git_prompt_status)%{$reset_color%}' - - ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" - ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" - ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" -else - PROMPT='[%n@%m:%~$(git_prompt_info)] -%# ' - - ZSH_THEME_GIT_PROMPT_PREFIX=" on" - ZSH_THEME_GIT_PROMPT_SUFFIX="" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - # display exitcode on the right when >0 - return_code="%(?..%? ↵)" - - RPROMPT='${return_code}$(git_prompt_status)' - - ZSH_THEME_GIT_PROMPT_ADDED=" ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" - ZSH_THEME_GIT_PROMPT_DELETED=" ✖" - ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" -fi diff --git a/dot.oh-my-zsh/themes/lambda.zsh-theme b/dot.oh-my-zsh/themes/lambda.zsh-theme deleted file mode 100644 index 63292d3..0000000 --- a/dot.oh-my-zsh/themes/lambda.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S - -PROMPT='λ %~/ $(git_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " diff --git a/dot.oh-my-zsh/themes/linuxonly b/dot.oh-my-zsh/themes/linuxonly deleted file mode 100644 index a11b80d..0000000 --- a/dot.oh-my-zsh/themes/linuxonly +++ /dev/null @@ -1,80 +0,0 @@ -# vim: set ts=2 textwidth=0 - -autoload -U add-zsh-hook -autoload -Uz vcs_info -local c0=$(printf "\033[0m") -local c1=$(printf "\033[38;5;215m") -local c2=$(printf "\033[38;5;209m") -local c3=$(printf "\033[38;5;203m") -local c4=$(printf "\033[33;4m") -local c5=$(printf "\033[38;5;137m") -local c6=$(printf "\033[38;5;240m") -local c7=$(printf "\033[38;5;149m") -local c8=$(printf "\033[38;5;126m") -local c9=$(printf "\033[38;5;162m") - -local foopath=$(perl /home/scp1/bin/foopath) - -if [ "$TERM" = "linux" ]; then - c1=$(printf "\033[34;1m") - c2=$(printf "\033[35m") - c3=$(printf "\033[31m") - c4=$(printf "\033[31;1m") - c5=$(printf "\033[32m") - c6=$(printf "\033[32;1m") - c7=$(printf "\033[33m") - c8=$(printf "\033[33;1m") - c9=$(printf "\033[34m") -fi - -#local newtv=$(perl $HOME/devel/newtv.pl) -local newtv='' - -zstyle ':vcs_info:*' actionformats \ - '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -zstyle ':vcs_info:*' formats \ - "%{$c8%}%s%{$c7%}:%{$c7%}(%{$c9%}%b%{$c7%})%f " -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -zstyle ':vcs_info:*' enable git - -add-zsh-hook precmd prompt_jnrowe_precmd - -prompt_jnrowe_precmd () { - vcs_info - - if [ "${vcs_info_msg_0_}" = "" ]; then - #dir_status="|%F{3}%n%F{7}@%F{3}%m%F{7}:%F{9}%l%f" - #dir_status="$c1%n%F{7}@%F{9}%m%F{7}:%F{12}%/" - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" - #dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$foopath%} %{$c0%}(%{$c5%}%?%{$c0%})" - - PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} -> ' - elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} -> ' - - elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" - - PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} -%{$c9%}·>%{$c0%} ' - else - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} -> ' - - fi -} - - -#PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$reset_color%} ${vcs_info_msg_0_}${dir_status}%{$reset_color%} -#> ' - -# vim: set ft=zsh ts=4 sw=4 et: - - diff --git a/dot.oh-my-zsh/themes/lukerandall.zsh-theme b/dot.oh-my-zsh/themes/lukerandall.zsh-theme deleted file mode 100644 index f4045bd..0000000 --- a/dot.oh-my-zsh/themes/lukerandall.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -# ZSH Theme - Preview: http://cl.ly/f701d00760f8059e06dc -# Thanks to gallifrey, upon whose theme this is based - -local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})" - -function my_git_prompt_info() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - GIT_STATUS=$(git_prompt_status) - [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS" - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - -PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(my_git_prompt_info)%{$reset_color%}%B»%b ' -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" -ZSH_THEME_GIT_PROMPT_ADDED="+" -ZSH_THEME_GIT_PROMPT_MODIFIED="*" -ZSH_THEME_GIT_PROMPT_RENAMED="~" -ZSH_THEME_GIT_PROMPT_DELETED="!" -ZSH_THEME_GIT_PROMPT_UNMERGED="?" - diff --git a/dot.oh-my-zsh/themes/macovsky-ruby.zsh-theme b/dot.oh-my-zsh/themes/macovsky-ruby.zsh-theme deleted file mode 100644 index 0453767..0000000 --- a/dot.oh-my-zsh/themes/macovsky-ruby.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -if which rvm-prompt &> /dev/null; then - PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' -else - if which rbenv &> /dev/null; then - PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' - fi -fi - -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/macovsky.zsh-theme b/dot.oh-my-zsh/themes/macovsky.zsh-theme deleted file mode 100644 index b6978b9..0000000 --- a/dot.oh-my-zsh/themes/macovsky.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -if which rvm-prompt &> /dev/null; then - PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' -else - if which rbenv &> /dev/null; then - PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' - fi -fi -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/maran.zsh-theme b/dot.oh-my-zsh/themes/maran.zsh-theme deleted file mode 100644 index 6fba046..0000000 --- a/dot.oh-my-zsh/themes/maran.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# Theme with full path names and hostname -# Handy if you work on different servers all the time; -PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/mgutz.zsh-theme b/dot.oh-my-zsh/themes/mgutz.zsh-theme deleted file mode 100644 index dcf3270..0000000 --- a/dot.oh-my-zsh/themes/mgutz.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[magenta]%}%1~$(git_prompt_info) %{$fg_bold[magenta]%}%# %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="*]" -ZSH_THEME_GIT_PROMPT_CLEAN="]" diff --git a/dot.oh-my-zsh/themes/mh.zsh-theme b/dot.oh-my-zsh/themes/mh.zsh-theme deleted file mode 100644 index 34a3765..0000000 --- a/dot.oh-my-zsh/themes/mh.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -# mh theme -# preview: http://cl.ly/1y2x0W0E3t2C0F29043z - -# features: -# path is autoshortened to ~30 characters -# displays git status (if applicable in current folder) -# turns username green if superuser, otherwise it is white - -# if superuser make the username green -if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi - -# prompt -PROMPT='[%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[red]%}%30<...<%~%<<%{$reset_color%}]%(!.#.$) ' -RPROMPT='$(git_prompt_info)' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[gray]%}(%{$fg_no_bold[yellow]%}%B" -ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[gray]%})%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✱" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/dot.oh-my-zsh/themes/mikeh.zsh-theme b/dot.oh-my-zsh/themes/mikeh.zsh-theme deleted file mode 100644 index 943f04d..0000000 --- a/dot.oh-my-zsh/themes/mikeh.zsh-theme +++ /dev/null @@ -1,23 +0,0 @@ -setopt prompt_subst -autoload colors -colors - -autoload -U add-zsh-hook -autoload -Uz vcs_info - -# check-for-changes can be really slow. -# you should disable it, if you work with large repositories -zstyle ':vcs_info:*:prompt:*' check-for-changes true - -add-zsh-hook precmd mikeh_precmd - -mikeh_precmd() { - vcs_info -} - -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B..[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B..%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <($vcs_info_msg_0_)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/miloshadzic.zsh-theme b/dot.oh-my-zsh/themes/miloshadzic.zsh-theme deleted file mode 100644 index ad53944..0000000 --- a/dot.oh-my-zsh/themes/miloshadzic.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -# Yay! High voltage and arrows! - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' diff --git a/dot.oh-my-zsh/themes/minimal.zsh-theme b/dot.oh-my-zsh/themes/minimal.zsh-theme deleted file mode 100644 index a2a1603..0000000 --- a/dot.oh-my-zsh/themes/minimal.zsh-theme +++ /dev/null @@ -1,18 +0,0 @@ -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}]%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} " -ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX -ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX -ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY -ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN - -vcs_status() { - if [[ ( $(whence in_svn) != "" ) && ( $(in_svn) == 1 ) ]]; then - svn_prompt_info - else - git_prompt_info - fi -} - -PROMPT='%2~ $(vcs_status)»%b ' \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/mortalscumbag.zsh-theme b/dot.oh-my-zsh/themes/mortalscumbag.zsh-theme deleted file mode 100644 index 5dbf2e4..0000000 --- a/dot.oh-my-zsh/themes/mortalscumbag.zsh-theme +++ /dev/null @@ -1,59 +0,0 @@ -function my_git_prompt() { - tester=$(git rev-parse --git-dir 2> /dev/null) || return - - INDEX=$(git status --porcelain 2> /dev/null) - STATUS="" - - # is branch ahead? - if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then - STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" - fi - - # is anything staged? - if $(echo "$INDEX" | grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then - STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED" - fi - - # is anything unstaged? - if $(echo "$INDEX" | grep -E -e '^[ MARC][MD] ' &> /dev/null); then - STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" - fi - - # is anything untracked? - if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then - STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" - fi - - # is anything unmerged? - if $(echo "$INDEX" | grep -E -e '^(A[AU]|D[DU]|U[ADU]) ' &> /dev/null); then - STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" - fi - - if [[ -n $STATUS ]]; then - STATUS=" $STATUS" - fi - - echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(my_current_branch)$STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - -function my_current_branch() { - echo $(current_branch || echo "(no branch)") -} - -function ssh_connection() { - if [[ -n $SSH_CONNECTION ]]; then - echo "%{$fg_bold[red]%}(ssh) " - fi -} - -local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})%?%{$reset_color%}" -PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n[${ret_status}] %# ' - -ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}" -ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}" -ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[magenta]%}↑" -ZSH_THEME_GIT_PROMPT_STAGED="%{$fg_bold[green]%}●" -ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[red]%}●" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[white]%}●" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[red]%}✕" -ZSH_THEME_GIT_PROMPT_SUFFIX=" $fg_bold[white]›%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/mrtazz.zsh-theme b/dot.oh-my-zsh/themes/mrtazz.zsh-theme deleted file mode 100644 index 214ba5a..0000000 --- a/dot.oh-my-zsh/themes/mrtazz.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%{$fg_bold[red]%}%m%{$reset_color%}:%{$fg[cyan]%}%c%{$reset_color%}:%# ' -RPROMPT='%{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}% ' - -ZSH_THEME_GIT_PROMPT_PREFIX="<%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$fg[green]%}>%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}>" diff --git a/dot.oh-my-zsh/themes/murilasso.zsh-theme b/dot.oh-my-zsh/themes/murilasso.zsh-theme deleted file mode 100644 index bc2b9b2..0000000 --- a/dot.oh-my-zsh/themes/murilasso.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' -local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}' -local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%}' -local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}' - -PROMPT="${user_host}:${current_dir} ${rvm_ruby} -${git_branch} %B$%b " -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/muse.zsh-theme b/dot.oh-my-zsh/themes/muse.zsh-theme deleted file mode 100644 index 4bd8fb8..0000000 --- a/dot.oh-my-zsh/themes/muse.zsh-theme +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env zsh -#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -setopt promptsubst - -autoload -U add-zsh-hook - -PROMPT_SUCCESS_COLOR=$FG[117] -PROMPT_FAILURE_COLOR=$FG[124] -PROMPT_VCS_INFO_COLOR=$FG[242] -PROMPT_PROMPT=$FG[077] -GIT_DIRTY_COLOR=$FG[133] -GIT_CLEAN_COLOR=$FG[118] -GIT_PROMPT_INFO=$FG[012] - -PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} ' - -#RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/nanotech.zsh-theme b/dot.oh-my-zsh/themes/nanotech.zsh-theme deleted file mode 100644 index 5d33316..0000000 --- a/dot.oh-my-zsh/themes/nanotech.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%F{green}%2c%F{blue} [%f ' -RPROMPT='$(git_prompt_info) %F{blue}] %F{green}%D{%L:%M} %F{yellow}%D{%p}%f' - -ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%f" -ZSH_THEME_GIT_PROMPT_DIRTY=" %F{red}*%f" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/dot.oh-my-zsh/themes/nebirhos.zsh-theme b/dot.oh-my-zsh/themes/nebirhos.zsh-theme deleted file mode 100644 index a5a226b..0000000 --- a/dot.oh-my-zsh/themes/nebirhos.zsh-theme +++ /dev/null @@ -1,21 +0,0 @@ -# Based on robbyrussell's theme, with host and rvm indicators. Example: -# @host ➜ currentdir rvm:(rubyversion@gemset) git:(branchname) - -# Get the current ruby version in use with RVM: -if [ -e ~/.rvm/bin/rvm-prompt ]; then - RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} " -else - if which rbenv &> /dev/null; then - RUBY_PROMPT_="%{$fg_bold[blue]%}rbenv:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} " - fi -fi - -# Get the host name (first 4 chars) -HOST_PROMPT_="%{$fg_bold[red]%}@$HOST[0,4] ➜ %{$fg_bold[cyan]%}%c " -GIT_PROMPT="%{$fg_bold[blue]%}\$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}" -PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$GIT_PROMPT" - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/nicoulaj.zsh-theme b/dot.oh-my-zsh/themes/nicoulaj.zsh-theme deleted file mode 100644 index 333aa5e..0000000 --- a/dot.oh-my-zsh/themes/nicoulaj.zsh-theme +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------ -# Prompt for the Zsh shell: -# * One line. -# * VCS info on the right prompt. -# * Only shows the path on the left prompt by default. -# * Crops the path to a defined length and only shows the path relative to -# the current VCS repository root. -# * Wears a different color wether the last command succeeded/failed. -# * Shows user@hostname if connected through SSH. -# * Shows if logged in as root or not. -# ------------------------------------------------------------------------------ - -# Customizable parameters. -PROMPT_PATH_MAX_LENGTH=30 -PROMPT_DEFAULT_END=❯ -PROMPT_ROOT_END=❯❯❯ -PROMPT_SUCCESS_COLOR=$FG[071] -PROMPT_FAILURE_COLOR=$FG[124] -PROMPT_VCS_INFO_COLOR=$FG[242] - -# Set required options. -setopt promptsubst - -# Load required modules. -autoload -U add-zsh-hook -autoload -Uz vcs_info - -# Add hook for calling vcs_info before each command. -add-zsh-hook precmd vcs_info - -# Set vcs_info parameters. -zstyle ':vcs_info:*' enable hg bzr git -zstyle ':vcs_info:*:*' check-for-changes true # Can be slow on big repos. -zstyle ':vcs_info:*:*' unstagedstr '!' -zstyle ':vcs_info:*:*' stagedstr '+' -zstyle ':vcs_info:*:*' actionformats "%S" "%r/%s/%b %u%c (%a)" -zstyle ':vcs_info:*:*' formats "%S" "%r/%s/%b %u%c" -zstyle ':vcs_info:*:*' nvcsformats "%~" "" - -# Define prompts. -PROMPT="%(0?.%{$PROMPT_SUCCESS_COLOR%}.%{$PROMPT_FAILURE_COLOR%})${SSH_TTY:+[%n@%m]}%{$FX[bold]%}%$PROMPT_PATH_MAX_LENGTH<..<"'${vcs_info_msg_0_%%.}'"%<<%(!.$PROMPT_ROOT_END.$PROMPT_DEFAULT_END)%{$FX[no-bold]%}%{$FX[reset]%} " -RPROMPT="%{$PROMPT_VCS_INFO_COLOR%}"'$vcs_info_msg_1_'"%{$FX[reset]%}" diff --git a/dot.oh-my-zsh/themes/norm.zsh-theme b/dot.oh-my-zsh/themes/norm.zsh-theme deleted file mode 100644 index 13077cc..0000000 --- a/dot.oh-my-zsh/themes/norm.zsh-theme +++ /dev/null @@ -1,4 +0,0 @@ -PROMPT='%{$fg[yellow]%}λ %m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/obraun.zsh-theme b/dot.oh-my-zsh/themes/obraun.zsh-theme deleted file mode 100644 index 08d1376..0000000 --- a/dot.oh-my-zsh/themes/obraun.zsh-theme +++ /dev/null @@ -1,11 +0,0 @@ -if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi - -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -PROMPT='%{$fg[green]%}[%*]%{$reset_color%} %{$fg_no_bold[cyan]%}%n %{${fg_bold[blue]}%}::%{$reset_color%} %{$fg[yellow]%}%m%{$reset_color%} %{$fg_no_bold[magenta]%} ➜ %{$reset_color%} %{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' - -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" - diff --git a/dot.oh-my-zsh/themes/philips.zsh-theme b/dot.oh-my-zsh/themes/philips.zsh-theme deleted file mode 100644 index f6e5b32..0000000 --- a/dot.oh-my-zsh/themes/philips.zsh-theme +++ /dev/null @@ -1,14 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi - -PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B" -ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="*" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:*.patch=00;34:*.o=00;32:*.so=01;35:*.ko=01;31:*.la=00;33' diff --git a/dot.oh-my-zsh/themes/pmcgee.zsh-theme b/dot.oh-my-zsh/themes/pmcgee.zsh-theme deleted file mode 100644 index e4e45c7..0000000 --- a/dot.oh-my-zsh/themes/pmcgee.zsh-theme +++ /dev/null @@ -1,16 +0,0 @@ -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi - -PROMPT=' -%{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%} %{$fg[white]%}%B${PWD/#$HOME/~}%b%{$reset_color%} -$(git_prompt_info)%(!.#.$) ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_no_bold[yellow]%}%B" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}*" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/dot.oh-my-zsh/themes/psy.zsh-theme b/dot.oh-my-zsh/themes/psy.zsh-theme deleted file mode 100644 index 9e9e808..0000000 --- a/dot.oh-my-zsh/themes/psy.zsh-theme +++ /dev/null @@ -1,56 +0,0 @@ -# pSy's zshell prompt -# zsh theme requires 256 color enabled terminal -# based on sporty_256 and fishy - -_collapsed_path() { - #TODO: collapse path elements until the path is short enough - #TODO eg: "/foo/bar/baz/quux/quarz" becomes "/f/b/baz/quux/quarz" if it still fits - #TODO or "/f/b/b/q/quarz" in the 2nd shortest form, "quarz" in the shortest - - # http://lavica.fesb.hr/cgi-bin/info2html?(zsh)The%20zsh/pcre%20Module - #echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g") - local TERMWIDTH - (( TERMWIDTH = ${COLUMNS} - 1 )) - - PR_FILLBAR="" - PR_PWDLEN="" - PR_GIT="$(git_prompt_info)" - - local pwd=%~ - local promptsize=${#${(%):-(%n@%m)--}} - local pwdsize=${#${(%):-%~}} - local gitinfosize=${#${(%):-$PR_GIT}} - -if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then - pwd=$(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g") - pwdsize=${#${(%):-$pwd}} - if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then - ((PR_PWDLEN=$TERMWIDTH - $promptsize - $gitinfosize)) - fi -fi - - echo "%$PR_PWDLEN<...<%~%<<" -} - - -RPROMPT='$(git_prompt_info) %F{208}$(_collapsed_path)%f%{$reset_color%}' -PROMPT='%(?..%F{124}·%?·)%F{208}%n%f%{$fg[white]%}@%F{039}%m%f%{$reset_color%} %{$fg[white]%}%# %{$reset_color%}' - -#ZSH_THEME_GIT_PROMPT_PREFIX="%F{154}±|%f%F{124}" -ZSH_THEME_GIT_PROMPT_PREFIX="%F{154}%f%F{124}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}%B✘%b%F{154}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%F{154}" - -#TODO: think about a nicer usage of these… -#ZSH_THEME_GIT_PROMPT_PREFIX=" " -#ZSH_THEME_GIT_PROMPT_SUFFIX="" -#ZSH_THEME_GIT_PROMPT_DIRTY="" -#ZSH_THEME_GIT_PROMPT_CLEAN="" -# -#ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" -#ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" -#ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" -#ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" -#ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" -#ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" diff --git a/dot.oh-my-zsh/themes/pygmalion.zsh-theme b/dot.oh-my-zsh/themes/pygmalion.zsh-theme deleted file mode 100644 index cf3bb90..0000000 --- a/dot.oh-my-zsh/themes/pygmalion.zsh-theme +++ /dev/null @@ -1,9 +0,0 @@ -# Yay! High voltage and arrows! - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -PROMPT='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' - diff --git a/dot.oh-my-zsh/themes/re5et.zsh-theme b/dot.oh-my-zsh/themes/re5et.zsh-theme deleted file mode 100644 index 5bded76..0000000 --- a/dot.oh-my-zsh/themes/re5et.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi - -local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})" - -PROMPT=' -%{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info) -%{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}' - -RPS1='${return_code} %D - %*' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ±" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥" diff --git a/dot.oh-my-zsh/themes/rgm.zsh-theme b/dot.oh-my-zsh/themes/rgm.zsh-theme deleted file mode 100644 index 9452a8b..0000000 --- a/dot.oh-my-zsh/themes/rgm.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -PROMPT=' -%n@%m %{$fg[cyan]%}%~ -%? $(git_prompt_info)%{$fg_bold[blue]%}%% %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}" diff --git a/dot.oh-my-zsh/themes/risto.zsh-theme b/dot.oh-my-zsh/themes/risto.zsh-theme deleted file mode 100644 index cb773a6..0000000 --- a/dot.oh-my-zsh/themes/risto.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# -*- sh -*- vim:set ft=sh ai et sw=4 sts=4: -# It might be bash like, but I can't have my co-workers knowing I use zsh -PROMPT='%{$fg[green]%}%n@%m:%{$fg_bold[blue]%}%2~ $(git_prompt_info)%{$reset_color%}%(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/rixius.zsh-theme b/dot.oh-my-zsh/themes/rixius.zsh-theme deleted file mode 100644 index c0c5c9c..0000000 --- a/dot.oh-my-zsh/themes/rixius.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -# /|/ Code by Stephen -# /|/ "Rixius" Middleton -# -# name in folder (github) -# ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right. -function collapse_pwd { - echo $(pwd | sed -e "s,^$HOME,~,") -} -function prompt_char { - echo -n "%{$bg[white]%}%{$fg[red]%}" - git branch >/dev/null 2>/dev/null && echo "±%{$reset_color%}" && return - echo "≥%{$reset_color%}" -} -RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}" - -PROMPT=' -%{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info) -$(prompt_char) ' -RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RIXIUS_PRE%}!%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$RIXIUS_PRE%}√%{$reset_color%}" diff --git a/dot.oh-my-zsh/themes/rkj-repos.zsh-theme b/dot.oh-my-zsh/themes/rkj-repos.zsh-theme deleted file mode 100644 index 318c315..0000000 --- a/dot.oh-my-zsh/themes/rkj-repos.zsh-theme +++ /dev/null @@ -1,29 +0,0 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 - -function hg_prompt_info { - hg prompt --angle-brackets "\ -%{$reset_color%}>\ -%{$reset_color%}>\ -%{$fg[red]%}%{$reset_color%}< -patches: >" 2>/dev/null -} - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" - -function mygit() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - -# alternate prompt with git & hg -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' - diff --git a/dot.oh-my-zsh/themes/rkj.zsh-theme b/dot.oh-my-zsh/themes/rkj.zsh-theme deleted file mode 100644 index 81b701e..0000000 --- a/dot.oh-my-zsh/themes/rkj.zsh-theme +++ /dev/null @@ -1,8 +0,0 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 - -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' - - diff --git a/dot.oh-my-zsh/themes/robbyrussell.zsh-theme b/dot.oh-my-zsh/themes/robbyrussell.zsh-theme deleted file mode 100644 index 7b524e8..0000000 --- a/dot.oh-my-zsh/themes/robbyrussell.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/sammy.zsh-theme b/dot.oh-my-zsh/themes/sammy.zsh-theme deleted file mode 100644 index 52e6e4b..0000000 --- a/dot.oh-my-zsh/themes/sammy.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg[white]%}%c$(git_prompt_info)$ % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="*)" -ZSH_THEME_GIT_PROMPT_CLEAN=")" diff --git a/dot.oh-my-zsh/themes/simonoff.zsh-theme b/dot.oh-my-zsh/themes/simonoff.zsh-theme deleted file mode 100644 index fb4d32e..0000000 --- a/dot.oh-my-zsh/themes/simonoff.zsh-theme +++ /dev/null @@ -1,141 +0,0 @@ -# Prompt -# -# Below are the color init strings for the basic file types. A color init -# string consists of one or more of the following numeric codes: -# Attribute codes: -# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed -# Text color codes: -# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white -# Background color codes: -# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white -function precmd { - - local TERMWIDTH - (( TERMWIDTH = ${COLUMNS} - 1 )) - - - ### - # Truncate the path if it's too long. - - PR_FILLBAR="" - PR_PWDLEN="" - - local promptsize=${#${(%):---(%n@%M:%l)---()}} - local pwdsize=${#${(%):-%~}} - local gitbranch="$(git_prompt_info)" - local rvmprompt="$(rvm_prompt_info)" - local gitbranchsize=${#${gitbranch:-''}} - local rvmpromptsize=${#${rvmprompt:-''}} - - if [[ "$promptsize + $pwdsize + $rvmpromptsize + $gitbranchsize" -gt $TERMWIDTH ]]; then - ((PR_PWDLEN=$TERMWIDTH - $promptsize)) - else - PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $pwdsize + $rvmpromptsize + $gitbranchsize)))..${PR_SPACE}.)}" - fi -} - - -setopt extended_glob - -preexec () { - if [[ "$TERM" == "screen" ]]; then - local CMD=${1[(wr)^(*=*|sudo|-*)]} - echo -n "\ek$CMD\e\\" - fi - - if [[ "$TERM" == "xterm" ]]; then - print -Pn "\e]0;$1\a" - fi - - if [[ "$TERM" == "rxvt" ]]; then - print -Pn "\e]0;$1\a" - fi - -} - -setprompt () { -### -# Need this so the prompt will work. - - setopt prompt_subst - - -### -# See if we can use colors. - - autoload colors zsh/terminfo - if [[ "$terminfo[colors]" -ge 8 ]]; then - colors - fi - for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do - eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' - eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' - (( count = $count + 1 )) - done - PR_NO_COLOUR="%{$terminfo[sgr0]%}" - - -### -# See if we can use extended characters to look nicer. - - typeset -A altchar -# set -A altchar "${(s..)terminfo[acsc]}" - PR_SET_CHARSET="%{$terminfo[enacs]%}" - PR_HBAR=${altchar[q]:--} - PR_ULCORNER=${altchar[l]:--} - PR_LLCORNER=${altchar[m]:--} - PR_LRCORNER=${altchar[j]:--} - PR_URCORNER=${altchar[k]:--} - - ### - # Modify Git prompt - ZSH_THEME_GIT_PROMPT_PREFIX=" [" - ZSH_THEME_GIT_PROMPT_SUFFIX="]" - ### - # Modify RVM prompt - ZSH_THEME_RVM_PROMPT_PREFIX=" [" - ZSH_THEME_RVM_PROMPT_SUFFIX="]" - - -### -# Decide if we need to set titlebar text. - - case $TERM in - xterm*|*rxvt*) - PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%M:%~ $(git_prompt_info) $(rvm_prompt_info) | ${COLUMNS}x${LINES} | %y\a%}' - ;; - screen) - PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}' - ;; - *) - PR_TITLEBAR='' - ;; - esac - - -### -# Decide whether to set a screen title - if [[ "$TERM" == "screen" ]]; then - PR_STITLE=$'%{\ekzsh\e\\%}' - else - PR_STITLE='' - fi - -### -# Finally, the prompt. -# - PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\ -$PR_RED$PR_HBAR<\ -$PR_BLUE%(!.$PR_RED%SROOT%s.%n)$PR_GREEN@$PR_BLUE%M:$PR_GREEN%$PR_PWDLEN<...<%~$PR_CYAN$(git_prompt_info)$(rvm_prompt_info)\ -$PR_RED>$PR_HBAR$PR_SPACE${(e)PR_FILLBAR}\ -$PR_RED$PR_HBAR<\ -$PR_GREEN%l$PR_RED>$PR_HBAR\ - -$PR_RED$PR_HBAR<\ -%(?..$PR_LIGHT_RED%?$PR_BLUE:)\ -$PR_LIGHT_BLUE%(!.$PR_RED.$PR_WHITE)%#$PR_RED>$PR_HBAR\ -$PR_NO_COLOUR ' - -} - -setprompt diff --git a/dot.oh-my-zsh/themes/simple.zsh-theme b/dot.oh-my-zsh/themes/simple.zsh-theme deleted file mode 100644 index a88d9d7..0000000 --- a/dot.oh-my-zsh/themes/simple.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg[green]%}%~%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%} ' - -ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" -ZSH_THEME_GIT_PROMPT_DIRTY=" ✗" -ZSH_THEME_GIT_PROMPT_CLEAN=" ✔" diff --git a/dot.oh-my-zsh/themes/skaro.zsh-theme b/dot.oh-my-zsh/themes/skaro.zsh-theme deleted file mode 100644 index 84b7b11..0000000 --- a/dot.oh-my-zsh/themes/skaro.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%{$fg_bold[green]%}%h %{$fg[cyan]%}%2~ %{$fg_bold[blue]%}$(git_prompt_info) %{$reset_color%}» ' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" - diff --git a/dot.oh-my-zsh/themes/smt.zsh-theme b/dot.oh-my-zsh/themes/smt.zsh-theme deleted file mode 100644 index 7a28752..0000000 --- a/dot.oh-my-zsh/themes/smt.zsh-theme +++ /dev/null @@ -1,91 +0,0 @@ -# ----------------------------------------------------------------------------- -# FILE: smt.zsh-theme -# DESCRIPTION: oh-my-zsh theme file, based on dogenpunk by Matthew Nelson. -# AUTHOR: Stephen Tudor (stephen@tudorstudio.com -# VERSION: 0.1 -# SCREENSHOT: coming soon -# ----------------------------------------------------------------------------- - -MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" -local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%} " - -ZSH_THEME_GIT_PROMPT_PREFIX="|" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[red]%}!%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✓%{$reset_color%}" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" - -# Format for git_prompt_long_sha() and git_prompt_short_sha() -ZSH_THEME_GIT_PROMPT_SHA_BEFORE="➤ %{$fg_bold[yellow]%}" -ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}" - -function prompt_char() { - git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return - hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return - echo "%{$fg[cyan]%}◯%{$reset_color%}" -} - -# Colors vary depending on time lapsed. -ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" -ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" -ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" - -# Determine the time since last commit. If branch is clean, -# use a neutral color, otherwise colors will vary according to time. -function git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` - now=`date +%s` - seconds_since_last_commit=$((now-last_commit)) - - # Totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [[ -n $(git status -s 2> /dev/null) ]]; then - if [ "$MINUTES" -gt 30 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" - elif [ "$MINUTES" -gt 10 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - fi - - if [ "$HOURS" -gt 24 ]; then - echo "[$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}]" - elif [ "$MINUTES" -gt 60 ]; then - echo "[$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}]" - else - echo "[$COLOR${MINUTES}m%{$reset_color%}]" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "[$COLOR~]" - fi - fi -} - -PROMPT=' -%{$fg[blue]%}%m%{$reset_color%} 福 %{$fg[cyan]%}%~ %{$reset_color%}$(git_prompt_short_sha)$(git_prompt_info) -%{$fg[red]%}%!%{$reset_color%} $(prompt_char) : ' - -RPROMPT='${return_status}$(git_time_since_commit)$(git_prompt_status)%{$reset_color%}' diff --git a/dot.oh-my-zsh/themes/sorin.zsh-theme b/dot.oh-my-zsh/themes/sorin.zsh-theme deleted file mode 100644 index 601dbe5..0000000 --- a/dot.oh-my-zsh/themes/sorin.zsh-theme +++ /dev/null @@ -1,48 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: sorin.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.2 -# SCREENSHOT: http://i.imgur.com/aipDQ.png -# ------------------------------------------------------------------------------ - - -if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then - MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" - local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" - - PROMPT='%{$fg[cyan]%}%c$(git_prompt_info) %(!.%{$fg_bold[red]%}#.%{$fg_bold[green]%}❯)%{$reset_color%} ' - - ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}git%{$reset_color%}:%{$fg[red]%}" - ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}' - - ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" - ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" - ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" -else - MODE_INDICATOR="❮❮❮" - local return_status="%(?::⏎)" - - PROMPT='%c$(git_prompt_info) %(!.#.❯) ' - - ZSH_THEME_GIT_PROMPT_PREFIX=" git:" - ZSH_THEME_GIT_PROMPT_SUFFIX="" - ZSH_THEME_GIT_PROMPT_DIRTY="" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - RPROMPT='${return_status}$(git_prompt_status)' - - ZSH_THEME_GIT_PROMPT_ADDED=" ✚" - ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" - ZSH_THEME_GIT_PROMPT_DELETED=" ✖" - ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" - ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" - ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" -fi diff --git a/dot.oh-my-zsh/themes/sporty_256.zsh-theme b/dot.oh-my-zsh/themes/sporty_256.zsh-theme deleted file mode 100644 index db0fc42..0000000 --- a/dot.oh-my-zsh/themes/sporty_256.zsh-theme +++ /dev/null @@ -1,13 +0,0 @@ -# zsh theme requires 256 color enabled terminal -# i.e TERM=xterm-256color -# Preview - http://www.flickr.com/photos/adelcampo/4556482563/sizes/o/ -# based on robbyrussell's shell but louder! - -PROMPT='%{$fg_bold[blue]%}$(git_prompt_info) %F{208}%c%f -%{$fg_bold[white]%}%# %{$reset_color%}' -RPROMPT='%B%F{208}%n%f%{$fg_bold[white]%}@%F{039}%m%f%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%F{154}±|%f%F{124}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}%B✘%b%F{154}|%f%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%F{154}|" diff --git a/dot.oh-my-zsh/themes/steeef.zsh-theme b/dot.oh-my-zsh/themes/steeef.zsh-theme deleted file mode 100644 index 312229e..0000000 --- a/dot.oh-my-zsh/themes/steeef.zsh-theme +++ /dev/null @@ -1,100 +0,0 @@ -# prompt style and colors based on Steve Losh's Prose theme: -# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme -# -# vcs_info modifications from Bart Trojanowski's zsh prompt: -# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt -# -# git untracked files modification from Brian Carper: -# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} -PR_GIT_UPDATE=1 - -setopt prompt_subst -autoload colors -colors - -autoload -U add-zsh-hook -autoload -Uz vcs_info - -#use extended color pallete if available -if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then - turquoise="%F{81}" - orange="%F{166}" - purple="%F{135}" - hotpink="%F{161}" - limegreen="%F{118}" -else - turquoise="$fg[cyan]" - orange="$fg[yellow]" - purple="$fg[magenta]" - hotpink="$fg[red]" - limegreen="$fg[green]" -fi - -# enable VCS systems you use -zstyle ':vcs_info:*' enable git svn - -# check-for-changes can be really slow. -# you should disable it, if you work with large repositories -zstyle ':vcs_info:*:prompt:*' check-for-changes true - -# set formats -# %b - branchname -# %u - unstagedstr (see below) -# %c - stagedstr (see below) -# %a - action (e.g. rebase-i) -# %R - repository path -# %S - path in the repository -PR_RST="%{${reset_color}%}" -FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" -FMT_ACTION="(%{$limegreen%}%a${PR_RST})" -FMT_UNSTAGED="%{$orange%}●" -FMT_STAGED="%{$limegreen%}●" - -zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" -zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" -zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}" -zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" -zstyle ':vcs_info:*:prompt:*' nvcsformats "" - - -function steeef_preexec { - case "$(history $HISTCMD)" in - *git*) - PR_GIT_UPDATE=1 - ;; - *svn*) - PR_GIT_UPDATE=1 - ;; - esac -} -add-zsh-hook preexec steeef_preexec - -function steeef_chpwd { - PR_GIT_UPDATE=1 -} -add-zsh-hook chpwd steeef_chpwd - -function steeef_precmd { - if [[ -n "$PR_GIT_UPDATE" ]] ; then - # check for untracked files or updated submodules, since vcs_info doesn't - if git ls-files --other --exclude-standard --directory 2> /dev/null | grep -q "."; then - PR_GIT_UPDATE=1 - FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" - else - FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" - fi - zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" - - vcs_info 'prompt' - PR_GIT_UPDATE= - fi -} -add-zsh-hook precmd steeef_precmd - -PROMPT=$' -%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_ -$(virtualenv_info)$ ' diff --git a/dot.oh-my-zsh/themes/sunaku.zsh-theme b/dot.oh-my-zsh/themes/sunaku.zsh-theme deleted file mode 100644 index 440fa90..0000000 --- a/dot.oh-my-zsh/themes/sunaku.zsh-theme +++ /dev/null @@ -1,26 +0,0 @@ -# Git-centric variation of the "fishy" theme. -# See screenshot at http://ompldr.org/vOHcwZg - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}+" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[magenta]%}!" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}-" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}>" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}#" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[yellow]%}?" - -ZSH_THEME_GIT_PROMPT_PREFIX="" -ZSH_THEME_GIT_PROMPT_SUFFIX=" " -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -local user_color='green' -test $UID -eq 0 && user_color='red' - -PROMPT='%(?..%{$fg_bold[red]%}exit %? -%{$reset_color%})'\ -'%{$bold_color%}$(git_prompt_status)%{$reset_color%}'\ -'$(git_prompt_info)'\ -'%{$fg[$user_color]%}%~%{$reset_color%}'\ -'%(!.#.>) ' - -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' diff --git a/dot.oh-my-zsh/themes/sunrise.zsh-theme b/dot.oh-my-zsh/themes/sunrise.zsh-theme deleted file mode 100644 index 88b371d..0000000 --- a/dot.oh-my-zsh/themes/sunrise.zsh-theme +++ /dev/null @@ -1,96 +0,0 @@ -#------------------------------------------------------------------------------- -# Sunrise theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com) -# Intended to be used with Solarized: http://ethanschoonover.com/solarized -# (Needs Git plugin for current_branch method) -#------------------------------------------------------------------------------- - -# Color shortcuts -R=$fg[red] -G=$fg[green] -M=$fg[magenta] -RB=$fg_bold[red] -YB=$fg_bold[yellow] -BB=$fg_bold[blue] -RESET=$reset_color - -if [ "$(whoami)" = "root" ]; then - PROMPTCOLOR="%{$RB%}" PREFIX="-!-"; -else - PROMPTCOLOR="" PREFIX="---"; -fi - -local return_code="%(?..%{$R%}%? ↵%{$RESET%})" - -# Get the status of the working tree (copied and modified from git.zsh) -custom_git_prompt_status() { - INDEX=$(git status --porcelain 2> /dev/null) - STATUS="" - # Non-staged - if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" - fi - if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" - fi - if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" - fi - if $(echo "$INDEX" | grep '^.M ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - fi - # Staged - if $(echo "$INDEX" | grep '^D ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_DELETED$STATUS" - fi - if $(echo "$INDEX" | grep '^R' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_RENAMED$STATUS" - fi - if $(echo "$INDEX" | grep '^M' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED$STATUS" - fi - if $(echo "$INDEX" | grep '^A' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_ADDED$STATUS" - fi - - if $(echo -n "$STATUS" | grep '.*' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_STATUS_PREFIX$STATUS" - fi - - echo $STATUS -} - -# get the name of the branch we are on (copied and modified from git.zsh) -function custom_git_prompt() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(git_prompt_ahead)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX" -} - -# %B sets bold text -PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} " - -ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}*" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➔" - -ZSH_THEME_GIT_STATUS_PREFIX=" " - -# Staged -ZSH_THEME_GIT_PROMPT_STAGED_ADDED="%{$G%}A" -ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED="%{$G%}M" -ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R" -ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D" - -# Not-staged -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}⁇" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M" -ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU" diff --git a/dot.oh-my-zsh/themes/superjarin.zsh-theme b/dot.oh-my-zsh/themes/superjarin.zsh-theme deleted file mode 100644 index 0be816d..0000000 --- a/dot.oh-my-zsh/themes/superjarin.zsh-theme +++ /dev/null @@ -1,24 +0,0 @@ -# Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -if which rvm-prompt &> /dev/null; then - JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" -else - if which rbenv &> /dev/null; then - JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}" - fi -fi - -# Grab the current filepath, use shortcuts: ~/Desktop -# Append the current git branch, if in a git repository -JARIN_CURRENT_LOCA_="%{$fg_bold[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%} <%{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" - -# Do nothing if the branch is clean (no changes). -ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}>" - -# Add a yellow ✗ if the branch is dirty -ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}> %{$fg[yellow]%}✗" - -# Put it all together! -PROMPT="$JARIN_CURRENT_RUBY_ $JARIN_CURRENT_LOCA_ " - diff --git a/dot.oh-my-zsh/themes/suvash.zsh-theme b/dot.oh-my-zsh/themes/suvash.zsh-theme deleted file mode 100644 index c87f645..0000000 --- a/dot.oh-my-zsh/themes/suvash.zsh-theme +++ /dev/null @@ -1,30 +0,0 @@ -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - hg root >/dev/null 2>/dev/null && echo 'Hg' && return - echo '○' -} - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - -function collapse_pwd { - echo $(pwd | sed -e "s,^$HOME,~,") -} - -if which rvm-prompt &> /dev/null; then - PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} -$(virtualenv_info)$(prompt_char) ' -else - if which rbenv &> /dev/null; then - PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%} -$(virtualenv_info)$(prompt_char) ' - fi -fi - - -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" -ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/dot.oh-my-zsh/themes/takashiyoshida.zsh-theme b/dot.oh-my-zsh/themes/takashiyoshida.zsh-theme deleted file mode 100644 index 419a8cf..0000000 --- a/dot.oh-my-zsh/themes/takashiyoshida.zsh-theme +++ /dev/null @@ -1,27 +0,0 @@ -# -# PROMPT -# -PROMPT_BRACKET_BEGIN='%{$fg_bold[white]%}[' -PROMPT_HOST='%{$fg_bold[cyan]%}%m' -PROMPT_SEPARATOR='%{$reset_color%}:' -PROMPT_DIR='%{$fg_bold[yellow]%}%c' -PROMPT_BRACKET_END='%{$fg_bold[white]%}]' - -PROMPT_USER='%{$fg_bold[white]%}%n' -PROMPT_SIGN='%{$reset_color%}%#' - -GIT_PROMPT_INFO='$(git_prompt_info)' - -# My current prompt looks like: -# [host:current_dir] (git_prompt_info) -# [username]% -PROMPT="${PROMPT_BRACKET_BEGIN}${PROMPT_HOST}${PROMPT_SEPARATOR}${PROMPT_DIR}${PROMPT_BRACKET_END}${GIT_PROMPT_INFO} -${PROMPT_BRACKET_BEGIN}${PROMPT_USER}${PROMPT_BRACKET_END}${PROMPT_SIGN} " - -# -# Git repository -# -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" -ZSH_THEME_GIT_PROMPT_CLEAN='' diff --git a/dot.oh-my-zsh/themes/terminalparty.zsh-theme b/dot.oh-my-zsh/themes/terminalparty.zsh-theme deleted file mode 100644 index 216ce37..0000000 --- a/dot.oh-my-zsh/themes/terminalparty.zsh-theme +++ /dev/null @@ -1,9 +0,0 @@ -PROMPT='%{$fg[green]%} %% ' -# RPS1='%{$fg[blue]%}%~%{$reset_color%} ' -RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}" - diff --git a/dot.oh-my-zsh/themes/theunraveler.zsh-theme b/dot.oh-my-zsh/themes/theunraveler.zsh-theme deleted file mode 100644 index e4bfb79..0000000 --- a/dot.oh-my-zsh/themes/theunraveler.zsh-theme +++ /dev/null @@ -1,16 +0,0 @@ -# Comment - -PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' - -RPROMPT='%{$fg[magenta]%}$(git_prompt_info)%{$reset_color%} $(git_prompt_status)%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/tjkirch.zsh-theme b/dot.oh-my-zsh/themes/tjkirch.zsh-theme deleted file mode 100644 index 446cde7..0000000 --- a/dot.oh-my-zsh/themes/tjkirch.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -function prompt_char { - if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi -} - -PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} -) -%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) -%_$(prompt_char) ' - -RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/dot.oh-my-zsh/themes/tjkirch_mod.zsh-theme b/dot.oh-my-zsh/themes/tjkirch_mod.zsh-theme deleted file mode 100644 index 1b206a7..0000000 --- a/dot.oh-my-zsh/themes/tjkirch_mod.zsh-theme +++ /dev/null @@ -1,13 +0,0 @@ -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -function prompt_char { - if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi -} - -PROMPT='%(?,,%{$fg[red]%}FAIL: $?%{$reset_color%} -)%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) %_$(prompt_char) ' - -RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/dot.oh-my-zsh/themes/tonotdo.zsh-theme b/dot.oh-my-zsh/themes/tonotdo.zsh-theme deleted file mode 100644 index a640703..0000000 --- a/dot.oh-my-zsh/themes/tonotdo.zsh-theme +++ /dev/null @@ -1,12 +0,0 @@ -PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}➜%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» ' -RPROMPT='[%*]' - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}✗%{$fg_bold[blue]%})" - -# LS colors, made with http://geoff.greer.fm/lscolors/ -export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/trapd00r.zsh-theme b/dot.oh-my-zsh/themes/trapd00r.zsh-theme deleted file mode 100644 index cba14c4..0000000 --- a/dot.oh-my-zsh/themes/trapd00r.zsh-theme +++ /dev/null @@ -1,95 +0,0 @@ -# Name: trapd00r zsh theme -# Author: Magnus Woldrich -# -# This theme needs a terminal supporting 256 colors as well as unicode. It also -# needs the script that splits up the current path and makes it fancy as located -# here: https://github.com/trapd00r/utils/blob/master/zsh_path -# -# By default it spans over two lines like so: -# -# scp1@shiva:pts/9-> /home » scp1 (0) -# > -# -# that's user@host:pts/-> splitted path (return status) -# -# If the current directory is a git repository, we span 3 lines; -# -# git❨ master ❩ DIRTY -# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0) -# > - -autoload -U add-zsh-hook -autoload -Uz vcs_info - -local c0=$( printf "\e[m") -local c1=$( printf "\e[38;5;245m") -local c2=$( printf "\e[38;5;250m") -local c3=$( printf "\e[38;5;242m") -local c4=$( printf "\e[38;5;197m") -local c5=$( printf "\e[38;5;225m") -local c6=$( printf "\e[38;5;240m") -local c7=$( printf "\e[38;5;242m") -local c8=$( printf "\e[38;5;244m") -local c9=$( printf "\e[38;5;162m") -local c10=$(printf "\e[1m") -local c11=$(printf "\e[38;5;208m\e[1m") -local c12=$(printf "\e[38;5;142m\e[1m") -local c13=$(printf "\e[38;5;196m\e[1m") - - -# We dont want to use the extended colorset in the TTY / VC. -if [ "$TERM" = "linux" ]; then - c1=$( printf "\e[34;1m") - c2=$( printf "\e[35m") - c3=$( printf "\e[31m") - c4=$( printf "\e[31;1m") - c5=$( printf "\e[32m") - c6=$( printf "\e[32;1m") - c7=$( printf "\e[33m") - c8=$( printf "\e[33;1m") - c9=$( printf "\e[34m") - - c11=$(printf "\e[35;1m") - c12=$(printf "\e[36m") - c13=$(printf "\e[31;1m") -fi - -zstyle ':vcs_info:*' actionformats \ - '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' - -zstyle ':vcs_info:*' formats \ - "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f " - -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -zstyle ':vcs_info:*' enable git - -add-zsh-hook precmd prompt_jnrowe_precmd - -prompt_jnrowe_precmd () { - vcs_info - if [ "${vcs_info_msg_0_}" = "" ]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} -> ' - -# modified, to be commited - elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} -> ' - - elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} -%{$c13%}>%{$c0%} ' - else - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" - PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} -> ' -fi -} - -# vim: set ft=zsh sw=2 et tw=0: diff --git a/dot.oh-my-zsh/themes/wedisagree.zsh-theme b/dot.oh-my-zsh/themes/wedisagree.zsh-theme deleted file mode 100644 index 7cb2793..0000000 --- a/dot.oh-my-zsh/themes/wedisagree.zsh-theme +++ /dev/null @@ -1,107 +0,0 @@ -# On a mac with snow leopard, for nicer terminal colours: - -# - Install SIMBL: http://www.culater.net/software/SIMBL/SIMBL.php -# - Download'Terminal-Colours': http://bwaht.net/code/TerminalColours.bundle.zip -# - Place that bundle in ~/Library/Application\ Support/SIMBL/Plugins (create that folder if it doesn't exist) -# - Open Terminal preferences. Go to Settings -> Text -> More -# - Change default colours to your liking. -# -# Here are the colours from Textmate's Monokai theme: -# -# Black: 0, 0, 0 -# Red: 229, 34, 34 -# Green: 166, 227, 45 -# Yellow: 252, 149, 30 -# Blue: 196, 141, 255 -# Magenta: 250, 37, 115 -# Cyan: 103, 217, 240 -# White: 242, 242, 242 - -# Thanks to Steve Losh: http://stevelosh.com/blog/2009/03/candy-colored-terminal/ - -# The prompt - -PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' - -# The right-hand prompt - -RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}' - -# Add this at the start of RPROMPT to include rvm info showing ruby-version@gemset-name -# %{$fg[yellow]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} - -# local time, color coded by last return code -time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}" -time_disabled="%{$fg[green]%}%*%{$reset_color%}" -time=$time_enabled - -ZSH_THEME_GIT_PROMPT_PREFIX=" ☁ %{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ☂" # Ⓓ -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" # ⓣ -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ☀" # Ⓞ - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✚" # ⓐ ⑃ -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ⚡" # ⓜ ⑁ -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" # ⓧ ⑂ -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➜" # ⓡ ⑄ -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ♒" # ⓤ ⑊ - -# More symbols to choose from: -# ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ -# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠ -# ⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬒ ⬓ ⬔ ⬕ ⬖ ⬗ ⬘ ⬙ ⬟ ⬤ 〒 ǀ ǁ ǂ ĭ Ť Ŧ - -# Determine if we are using a gemset. -function rvm_gemset() { - GEMSET=`rvm gemset list | grep '=>' | cut -b4-` - if [[ -n $GEMSET ]]; then - echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|" - fi -} - -# Determine the time since last commit. If branch is clean, -# use a neutral color, otherwise colors will vary according to time. -function git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` - now=`date +%s` - seconds_since_last_commit=$((now-last_commit)) - - # Totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [[ -n $(git status -s 2> /dev/null) ]]; then - if [ "$MINUTES" -gt 30 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" - elif [ "$MINUTES" -gt 10 ]; then - COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - fi - - if [ "$HOURS" -gt 24 ]; then - echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - elif [ "$MINUTES" -gt 60 ]; then - echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" - else - echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|" - fi - else - COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "($(rvm_gemset)$COLOR~|" - fi - fi -} \ No newline at end of file diff --git a/dot.oh-my-zsh/themes/wezm+.zsh-theme b/dot.oh-my-zsh/themes/wezm+.zsh-theme deleted file mode 100644 index fee3eb0..0000000 --- a/dot.oh-my-zsh/themes/wezm+.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%{${fg_bold[yellow]}%}%n%{$reset_color%}%{${fg[yellow]}%}@%m%{$reset_color%} $(git_prompt_info)%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )%{$fg[yellow]%}%#%{$reset_color%} ' -RPROMPT='%{$fg[green]%}%~%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/wezm.zsh-theme b/dot.oh-my-zsh/themes/wezm.zsh-theme deleted file mode 100644 index 1881343..0000000 --- a/dot.oh-my-zsh/themes/wezm.zsh-theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='$(git_prompt_info)%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )%{$fg[yellow]%}%#%{$reset_color%} ' -RPROMPT='%{$fg[green]%}%~%{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/themes/wuffers.zsh-theme b/dot.oh-my-zsh/themes/wuffers.zsh-theme deleted file mode 100644 index 4019d0a..0000000 --- a/dot.oh-my-zsh/themes/wuffers.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} x%{$fg_bold[blue]%}" - -PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current 2>/dev/null || rbenv version-name 2>/dev/null)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} ' diff --git a/dot.oh-my-zsh/themes/xiong-chiamiov-plus.zsh-theme b/dot.oh-my-zsh/themes/xiong-chiamiov-plus.zsh-theme deleted file mode 100644 index 095dae2..0000000 --- a/dot.oh-my-zsh/themes/xiong-chiamiov-plus.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/dot.oh-my-zsh/themes/xiong-chiamiov.zsh-theme b/dot.oh-my-zsh/themes/xiong-chiamiov.zsh-theme deleted file mode 100644 index 7c4c2e4..0000000 --- a/dot.oh-my-zsh/themes/xiong-chiamiov.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/dot.oh-my-zsh/themes/zhann.zsh-theme b/dot.oh-my-zsh/themes/zhann.zsh-theme deleted file mode 100644 index 574e0ce..0000000 --- a/dot.oh-my-zsh/themes/zhann.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -if which rvm-prompt &> /dev/null; then - RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}' -else - if which rbenv &> /dev/null; then - RPROMPT='%{$reset_color%} %{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//") %{$reset_color%}' - fi -fi - - -ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/dot.oh-my-zsh/tools/check_for_upgrade.sh b/dot.oh-my-zsh/tools/check_for_upgrade.sh deleted file mode 100644 index 581f03a..0000000 --- a/dot.oh-my-zsh/tools/check_for_upgrade.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -function _current_epoch() { - echo $(($(date +%s) / 60 / 60 / 24)) -} - -function _update_zsh_update() { - echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update -} - -function _upgrade_zsh() { - /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh - # update the zsh file - _update_zsh_update -} - -epoch_target=$UPDATE_ZSH_DAYS -if [[ -z "$epoch_target" ]]; then - # Default to old behavior - epoch_target=13 -fi - -if [ -f ~/.zsh-update ] -then - . ~/.zsh-update - - if [[ -z "$LAST_EPOCH" ]]; then - _update_zsh_update && return 0; - fi - - epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) - if [ $epoch_diff -gt $epoch_target ] - then - if [ "$DISABLE_UPDATE_PROMPT" = "true" ] - then - _upgrade_zsh - else - echo "[Oh My Zsh] Would you like to check for updates?" - echo "Type Y to update oh-my-zsh: \c" - read line - if [ "$line" = Y ] || [ "$line" = y ]; then - _upgrade_zsh - else - _update_zsh_update - fi - fi - fi -else - # create the zsh file - _update_zsh_update -fi - diff --git a/dot.oh-my-zsh/tools/install.sh b/dot.oh-my-zsh/tools/install.sh deleted file mode 100755 index 41f83e3..0000000 --- a/dot.oh-my-zsh/tools/install.sh +++ /dev/null @@ -1,38 +0,0 @@ -if [ -d ~/.oh-my-zsh ] -then - echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install" - exit -fi - -echo "\033[0;34mCloning Oh My Zsh...\033[0m" -hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { - echo "git not installed" - exit -} - -echo "\033[0;34mLooking for an existing zsh config...\033[0m" -if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] -then - echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m"; - mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh; -fi - -echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" -cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc - -echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" -echo "export PATH=$PATH" >> ~/.zshrc - -echo "\033[0;34mTime to change your default shell to zsh!\033[0m" -chsh -s `which zsh` - -echo "\033[0;32m"' __ __ '"\033[0m" -echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" -echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" -echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" -echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo "\033[0;32m"' /____/ '"\033[0m" - -echo "\n\n \033[0;32m....is now installed.\033[0m" -/usr/bin/env zsh -source ~/.zshrc diff --git a/dot.oh-my-zsh/tools/require_tool.sh b/dot.oh-my-zsh/tools/require_tool.sh deleted file mode 100755 index 1fa77f7..0000000 --- a/dot.oh-my-zsh/tools/require_tool.sh +++ /dev/null @@ -1,161 +0,0 @@ -__require_tool_version_compare () -{ - ( - # Locally ignore failures, otherwise we'll exit whenever $1 and $2 - # are not equal! - set +e - -awk_strverscmp=' - # Use only awk features that work with 7th edition Unix awk (1978). - # My, what an old awk you have, Mr. Solaris! - END { - while (length(v1) || length(v2)) { - # Set d1 to be the next thing to compare from v1, and likewise for d2. - # Normally this is a single character, but if v1 and v2 contain digits, - # compare them as integers and fractions as strverscmp does. - if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { - # Split v1 and v2 into their leading digit string components d1 and d2, - # and advance v1 and v2 past the leading digit strings. - for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue - for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue - d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) - d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) - if (d1 ~ /^0/) { - if (d2 ~ /^0/) { - # Compare two fractions. - while (d1 ~ /^0/ && d2 ~ /^0/) { - d1 = substr(d1, 2); len1-- - d2 = substr(d2, 2); len2-- - } - if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { - # The two components differ in length, and the common prefix - # contains only leading zeros. Consider the longer to be less. - d1 = -len1 - d2 = -len2 - } else { - # Otherwise, compare as strings. - d1 = "x" d1 - d2 = "x" d2 - } - } else { - # A fraction is less than an integer. - exit 1 - } - } else { - if (d2 ~ /^0/) { - # An integer is greater than a fraction. - exit 2 - } else { - # Compare two integers. - d1 += 0 - d2 += 0 - } - } - } else { - # The normal case, without worrying about digits. - if (v1 == "") d1 = v1; else { d1 = substr(v1, 1, 1); v1 = substr(v1,2) } - if (v2 == "") d2 = v2; else { d2 = substr(v2, 1, 1); v2 = substr(v2,2) } - } - if (d1 < d2) exit 1 - if (d1 > d2) exit 2 - } - } -' - awk "$awk_strverscmp" v1="$1" v2="$2" /dev/null - case $? in - 1) echo '<';; - 0) echo '=';; - 2) echo '>';; - esac - ) -} - - -__require_tool_fatal () -{ - echo $@ >/dev/stderr - return 1 -} - -# Usage: require_tool program version -# Returns: 0 if $1 version if greater equals than $2, 1 otherwise. -# In case of error, message is written on error output. -# -# Example: require_tool gcc 4.6 -# Use GCC environment variable if defined instead of lookup for the tool -# in the environment. -require_tool () -{ - envvar_name=$(echo $1 | tr '[:lower:]' '[:upper:]') - tool=$(printenv $envvar_name || echo $1) - local version=$($tool --version 2>/dev/null| \ - sed -n 's/.*[^0-9.]\([0-9]*\.[0-9.]*\).*/\1/p;q') - if test x"$version" = x ; then - echo "$tool is required" >/dev/stderr - return 1 - fi - case $(__require_tool_version_compare "$2" "$version") in - '>') - echo "$1 $2 or better is required: this is $tool $version" >/dev/stderr - return 1 - ;; - esac -} - -usage() { - cat < /dev/null ; then - echo "Already in favlist" - else - echo $THEME_NAME >> $FAVLIST - echo "Saved to favlist" - fi - -} - -function theme_chooser() { - for THEME in $(ls $THEMES_DIR); do - echo - theme_preview $THEME - echo - if [[ -z $1 ]]; then - noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ - insert_favlist $THEME_NAME - echo - fi - done -} - -while getopts ":lhs" Option -do - case $Option in - l ) list_themes ;; - s ) theme_chooser 0 ;; - h ) usage ;; - * ) usage ;; # Default. - esac -done - -if [[ -z $Option ]]; then - if [[ -z $1 ]]; then - banner - echo - theme_chooser - else - theme_preview $1".zsh-theme" - fi -fi diff --git a/dot.oh-my-zsh/tools/uninstall.sh b/dot.oh-my-zsh/tools/uninstall.sh deleted file mode 100644 index 41d6015..0000000 --- a/dot.oh-my-zsh/tools/uninstall.sh +++ /dev/null @@ -1,28 +0,0 @@ -echo "Removing ~/.oh-my-zsh" -if [[ -d ~/.oh-my-zsh ]] -then - rm -rf ~/.oh-my-zsh -fi - -echo "Looking for original zsh config..." -if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ] -then - echo "Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc"; - - if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] - then - ZSHRC_SAVE=".zshrc.omz-uninstalled-`date +%Y%m%d%H%M%S`"; - echo "Found ~/.zshrc -- Renaming to ~/${ZSHRC_SAVE}"; - mv ~/.zshrc ~/${ZSHRC_SAVE}; - fi - - mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc; - - source ~/.zshrc; -else - echo "Switching back to bash" - chsh -s /bin/bash - source /etc/profile -fi - -echo "Thanks for trying out Oh My Zsh. It's been uninstalled." diff --git a/dot.oh-my-zsh/tools/upgrade.sh b/dot.oh-my-zsh/tools/upgrade.sh deleted file mode 100644 index b2a1c06..0000000 --- a/dot.oh-my-zsh/tools/upgrade.sh +++ /dev/null @@ -1,19 +0,0 @@ -current_path=`pwd` -printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh" -cd $ZSH - -if git pull origin master -then - printf '\033[0;32m%s\033[0m\n' ' __ __ ' - printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' - printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' - printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' - printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' - printf '\033[0;32m%s\033[0m\n' ' /____/ ' - printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.' - printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest, be sure to follow Oh My Zsh on twitter: ' 'http://twitter.com/ohmyzsh' -else - printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' -fi - -cd "$current_path" \ No newline at end of file diff --git a/dot.vim/.VimballRecord b/dot.vim/.VimballRecord deleted file mode 100644 index fc392c2..0000000 --- a/dot.vim/.VimballRecord +++ /dev/null @@ -1,4 +0,0 @@ -twitvim-0.4.1.vba: call delete('/home/psy/.vim/plugin/twitvim.vim')|call delete('/home/psy/.vim/doc/twitvim.txt') -conque_term_1.0.vba: call delete('/home/psy/.vim/autoload/conque_term.vim')|call delete('/home/psy/.vim/doc/conque_term.txt')|call delete('/home/psy/.vim/plugin/conque_term.vim')|call delete('/home/psy/.vim/syntax/conque_term.vim') -RltvNmbr.vba: call delete('/home/psy/.vim/plugin/RltvNmbr.vim')|call delete('/home/psy/.vim/plugin/RltvNmbrPlugin.vim')|call delete('/home/psy/.vim/doc/RltvNmbr.txt')|call delete('/home/psy/.vim/autoload/RltvNmbr.vim') -csv-0.24.vmb: call delete('/home/nk/.vim/ftplugin/csv.vim')|call delete('/home/nk/.vim/doc/ft-csv.txt')|call delete('/home/nk/.vim/syntax/csv.vim')|call delete('/home/nk/.vim/ftdetect/csv.vim')|call delete('/home/nk/.vim/plugin/csv.vim') diff --git a/dot.vim/.netrwhist b/dot.vim/.netrwhist deleted file mode 100644 index 95ecb1d..0000000 --- a/dot.vim/.netrwhist +++ /dev/null @@ -1,8 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =6 -let g:netrw_dirhist_1='/home/nk/.gem/ruby/1.9.1/gems/liquid-2.3.0/lib' -let g:netrw_dirhist_2='/home/nk/.gem/ruby/1.9.1/gems/liquid-2.3.0/lib/extras' -let g:netrw_dirhist_3='/home/nk/.gem/ruby/1.9.1/gems/liquid-2.3.0/lib' -let g:netrw_dirhist_4='/home/nk/devel/projects/SWS-Log' -let g:netrw_dirhist_5='/home/nk/devel/homepage/portfolio' -let g:netrw_dirhist_6='/home/nk/devel/homepage/portfolio/_layouts' diff --git a/dot.vim/after/plugin/snipMate.vim b/dot.vim/after/plugin/snipMate.vim deleted file mode 100644 index 03e79ae..0000000 --- a/dot.vim/after/plugin/snipMate.vim +++ /dev/null @@ -1,35 +0,0 @@ -" 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 - -ino =TriggerSnippet() -snor i=TriggerSnippet() -ino =BackwardsSnippet() -snor i=BackwardsSnippet() -ino =ShowAvailableSnips() - -" 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 b -snor a -snor bi -snor ' b' -snor ` b` -snor % b% -snor U bU -snor ^ b^ -snor \ b\ -snor b - -" 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/dot.vim/autoload/RltvNmbr.vim b/dot.vim/autoload/RltvNmbr.vim deleted file mode 100644 index d279671..0000000 --- a/dot.vim/autoload/RltvNmbr.vim +++ /dev/null @@ -1,263 +0,0 @@ -" RltvNmbr.vim -" Author: Charles E. Campbell, Jr. -" Date: Nov 21, 2008 -" Version: 3 -" GetLatestVimScripts: 2351 1 :AutoInstall: RltvNmbr.vim -" Phillippians 1:27 : Only let your manner of life be worthy of the gospel of -" Christ, that, whether I come and see you or am absent, I may hear of -" your state, that you stand firm in one spirit, with one soul striving -" for the faith of the gospel -" --------------------------------------------------------------------- -" Load Once: {{{1 -if &cp || exists("g:loaded_RltvNmbr") - finish -endif -let g:loaded_RltvNmbr = "v3" -if v:version < 700 - echohl WarningMsg - echo "***warning*** this version of RltvNmbr needs vim 7.0" - echohl Normal - finish -endif -if !has("signs") - echoerr 'Sorry, your vim is missing +signs; use "configure --with-features=huge" , recompile, and install' - finish -endif -if !has("syntax") - echoerr 'Sorry, your vim is missing +syntax; use "configure --with-features=huge" , recompile, and install' - finish -endif -let s:keepcpo= &cpo -set cpo&vim -"DechoTabOn - -" --------------------------------------------------------------------- -" Parameters: {{{1 -let s:RLTVNMBR= 2683 -if !exists("g:DrChipTopLvlMenu") - let g:DrChipTopLvlMenu= "DrChip." -endif - -" ===================================================================== -" Functions: {{{1 - -" --------------------------------------------------------------------- -" RltvNmbr: {{{2 -fun! s:RltvNmbr(mode,...) -" call Dfunc("s:RltvNmbr(mode=".a:mode.((a:0 > 0)? " ".a:1.")" : ")")) - - if a:mode == 1 - " initial placement of signs -" call Decho("mode ".a:mode.": initial sign placement") - let wt = line("w0") - let wc = line(".") - let wb = line("w$") -" call Decho("initial placement of signs: wt=".wt." wc=".wc." wb=".wb) - let w = wt - let s:rltvnmbr_topline_{bufnr("%")} = wt - let s:rltvnmbr_curline_{bufnr("%")} = wc - let s:rltvnmbr_botline_{bufnr("%")} = wb - while w <= wb - if w == wc - let w= w + 1 - continue - endif - let wmwc = w - wc - if foldclosed(w) != -1 -" call Decho("skipping w=".w." wmwc=".wmwc." foldclosed=".foldclosed(w)) - let w= foldclosedend(w)+1 - continue - endif - if wmwc <= -100 - let w= wc - 99 - continue - endif - if wmwc >= 100 - break - endif - if wmwc < 0 - let name = "RLTVN_M".(-wmwc) - exe "sign place ".(s:RLTVNMBR + wmwc)." line=".w." name=".name." buffer=".bufnr("%") - else - let name = "RLTVN_P".wmwc - exe "sign place ".(s:RLTVNMBR + wmwc)." line=".w." name=".name." buffer=".bufnr("%") - endif - let w= w + 1 - endwhile - - elseif a:mode == 2 -" call Decho("mode ".a:mode.": consider removing and placing signs") - if exists("s:rltvnmbr_curline_{bufnr('%')}") - " remove and place signs - if line(".") != s:rltvnmbr_curline_{bufnr("%")} || line("w0") != s:rltvnmbr_topline_{bufnr("%")} || line("w$") != s:rltvnmbr_botline_{bufnr("%")} -" call Decho("do remove&place signs : (".line(".").",".line("w0").") =?= (".s:rltvnmbr_curline_{bufnr("%")}.",".s:rltvnmbr_topline_{bufnr("%")}.")") - exe "sign place ".s:RLTVNMBR." line=".s:rltvnmbr_curline_{bufnr("%")}." name=RLTVCURID buffer=".bufnr("%") - let lzkeep= &lz - set lz - call s:RltvNmbr(3) " remove signs - call s:RltvNmbr(1) " place signs - exe "sign unplace ".s:RLTVNMBR." buffer=".bufnr("%") - let &lz= lzkeep - endif - endif - - elseif a:mode == 3 - " removal of signs -" call Decho("mode ".a:mode.": removal of signs") - let wt = s:rltvnmbr_topline_{bufnr("%")} - let wc = s:rltvnmbr_curline_{bufnr("%")} - let wb = s:rltvnmbr_botline_{bufnr("%")} -" call Decho("using s:wt=".wt." s:wc=".wc." s:wb=".wb) - let w = wt - while w <= wb - if w == wc - let w= w + 1 - continue - endif - let wmwc = w - wc - if foldclosed(w) != -1 -" call Decho("skipping w=".w." wmwc=".wmwc." foldclosed=".foldclosed(w)) - let w= foldclosedend(w)+1 - continue - endif - if wmwc <= -100 - let w= wc - 99 - continue - endif - if wmwc >= 100 - break - endif - if wmwc < 0 - let name= "RLTVN_M".(-wmwc) - else - let name= "RLTVN_P".wmwc - endif - exe "sign unplace ".(s:RLTVNMBR + wmwc)." buffer=".bufnr("%") - let w= w + 1 - endwhile - - else - echoerr "mode=".a:mode." unsupported" - endif - -" call Dret("s:RltvNmbr") -endfun - -" --------------------------------------------------------------------- -" RltvNmbr#RltvNmbrCtrl: {{{2 -fun! RltvNmbr#RltvNmbrCtrl(start) -" call Dfunc("RltvNmbr#RltvNmbrCtrl(start=".a:start.")") - - if a:start && !exists("s:rltvnmbr_{bufnr('%')}") - let s:rltvnmbr_{bufnr("%")}= 1 - let b:rltvnmbrmode = 1 - - if !exists("s:rltvnmbr_signs") - let s:rltvnmbr_signs= 1 - hi default HL_RltvNmbr_Minus gui=none,italic ctermfg=red ctermbg=black guifg=red guibg=black - hi default HL_RltvNmbr_Positive gui=none,italic ctermfg=green ctermbg=black guifg=green guibg=black - silent call s:AvoidOtherSigns() - let L= 1 - while L <= 99 - exe "sign define RLTVN_M".L.' text='.string(L).' texthl=HL_RltvNmbr_Minus' - exe "sign define RLTVN_P".L.' text='.string(L).' texthl=HL_RltvNmbr_Positive' - let L= L+1 - endwhile - endif - sign define RLTVCURID text=-- texthl=Ignore - - exe "menu ".g:DrChipTopLvlMenu."RltvNmbr.Stop:RltvNmbr! :RltvNmbr!" - exe 'silent! unmenu '.g:DrChipTopLvlMenu.'RltvNmbr.Start' - call s:RltvNmbr(1) - augroup RltvNmbrAutoCmd - au! - au CursorHold * call RltvNmbr(2,"cursorhold") - au CursorMoved * call RltvNmbr(2,"cursormoved") - au FileChangedShellPost * call RltvNmbr(2,"filechangedshellpost") - au FocusGained * call RltvNmbr(2,"focusgained") - au FocusLost * call RltvNmbr(2,"focuslost") - au ShellCmdPost * call RltvNmbr(2,"shellcmdpost") - au ShellFilterPost * call RltvNmbr(2,"shellfilterpost") - au TabEnter * call RltvNmbr(2,"tabenter") - au VimResized * call RltvNmbr(2,"vimresized") - au WinEnter * call RltvNmbr(2,"winenter") - au ColorScheme * call ColorschemeLoaded() - augroup END - - elseif !a:start && exists("s:rltvnmbr_{bufnr('%')}") - let b:rltvnmbrmode = 0 - unlet s:rltvnmbr_{bufnr("%")} - augroup RltvNmbrAutoCmd - au! - augroup END - augroup! RltvNmbrAutoCmd - call s:RltvNmbr(3) - exe "sign unplace ".s:RLTVNMBR." buffer=".bufnr("%") - exe "menu ".g:DrChipTopLvlMenu."RltvNmbr.Start:RltvNmbr :RltvNmbr" - exe 'silent! unmenu '.g:DrChipTopLvlMenu.'RltvNmbr.Stop' - - else - echo "RltvNmbr is already ".((a:start)? "enabled" : "off") - endif -" call Dret("RltvNmbr#RltvNmbrCtrl") -endfun - -" --------------------------------------------------------------------- -" RltvNmbr#RltvNmbrToggle: supports the :RN command for quick relative-number-mode toggling {{{2 -" If the :RN command is already available, then it will not be overridden. -fun! RltvNmbr#RltvNmbrToggle() -" call Dfunc("RltvNmbr#RltvNmbrToggle()") - - if !exists("b:rltvnmbrmode") - let b:rltvnmbrmode= 0 - endif - if b:rltvnmbrmode == 0 - RltvNmbr - else - RltvNmbr! - endif - -" call Dret("RltvNmbr#RltvNmbrToggle") -endfun - -" --------------------------------------------------------------------- -" s:ColorschemeLoaded: {{{2 -fun! s:ColorschemeLoaded() -" call Dfunc("s:ColorschemeLoaded()") - hi HL_RltvNmbr_Minus ctermfg=red ctermbg=black guifg=red guibg=black - hi HL_RltvNmbr_Positive ctermfg=green ctermbg=black guifg=green guibg=black -" call Dret("s:ColorschemeLoaded") -endfun - -" --------------------------------------------------------------------- -" s:AvoidOtherSigns: {{{2 -fun! s:AvoidOtherSigns() -" call Dfunc("s:AvoidOtherSigns()") - if !exists("s:othersigns") - " only do this one time - redir => s:othersigns - sign place - redir END - " determine the max id being used and use one more than that as the beginning of RltvNmbr ids - let signlist= split(s:othersigns,'\n') - let idlist = map(signlist,"substitute(v:val,'^.\\{-}\\ 2 - let idlist = remove(idlist,2,-1) - let idlist = map(idlist,"str2nr(v:val)") - let idmax = max(idlist) - if idmax > s:RLTVNMBR - let s:RLTVNMBR = idmax + 1 -" call Decho("s:RLTVNMBR=".s:RLTVNMBR) - endif - endif - unlet s:othersigns - let s:othersigns= 1 - endif -" call Dret("s:AvoidOtherSigns : s:RLTVNMBR=".s:RLTVNMBR) -endfun - -" --------------------------------------------------------------------- -" Restore: {{{1 -let &cpo= s:keepcpo -unlet s:keepcpo -" vim: ts=4 fdm=marker diff --git a/dot.vim/autoload/conque_term.vim b/dot.vim/autoload/conque_term.vim deleted file mode 100644 index f9c4b32..0000000 --- a/dot.vim/autoload/conque_term.vim +++ /dev/null @@ -1,1378 +0,0 @@ -" FILE: plugin/conque_term.vim {{{ -" AUTHOR: Nico Raffo -" MODIFIED: 2010-02-02 -" VERSION: 1.0, 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 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" | echohl None - return 0 - endif - endif - - " set buffer window options - let g:Conque_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() - - 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 - silent execute h - endfor - silent execute "edit " . g:Conque_BufName - - " buffer settings - setlocal nocompatible " conque won't work in compatible 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 switchbuf=usetab " switch tabs with the command - setfiletype conque_term " useful - silent execute "setlocal syntax=" . g:ConqueTerm_Syntax - -endfunction " }}} - -" set key mappings and auto commands -function! conque_term#set_mappings() "{{{ - - " handle unexpected closing of shell, passes HUP to parent and all child processes - execute 'autocmd BufUnload python ' . b:ConqueTerm_Var . '.proc.signal(1)' - - " check for resized/scrolled buffer when entering buffer - execute 'autocmd BufEnter python ' . b:ConqueTerm_Var . '.update_window_size()' - - " set/reset updatetime on entering/exiting buffer - autocmd BufEnter set updatetime=50 - autocmd BufLeave set updatetime=1000 - - " check for resized/scrolled buffer when entering insert mode - " XXX - messed up since we enter insert mode at each updatetime - "execute 'autocmd InsertEnter python ' . b:ConqueTerm_Var . '.screen.align()' - - " read more output when this isn't the current buffer - if g:ConqueTerm_ReadUnfocused == 1 - autocmd CursorHold * call conque_term#read_all() - endif - - " use F22 key to get more input - inoremap "\\" - inoremap "\\" - silent execute 'autocmd CursorHoldI python ' . b:ConqueTerm_Var . '.auto_read()' - - " map ASCII 1-31 - for c in range(1, 31) - " - if c == 27 - continue - endif - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(chr(' . c . '))' - endfor - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(chr(27))' - silent execute 'nnoremap :python ' . b:ConqueTerm_Var . '.write(chr(3))' - - " map ASCII 33-127 - for i in range(33, 127) - " - if i == 124 - silent execute "inoremap :python " . b:ConqueTerm_Var . ".write(chr(124))" - continue - endif - silent execute "inoremap " . nr2char(i) . " :python " . b:ConqueTerm_Var . ".write(chr(" . i . "))" - endfor - - " map ASCII 128-255 - for i in range(128, 255) - silent execute "inoremap " . nr2char(i) . " :python " . b:ConqueTerm_Var . ".write('" . nr2char(i) . "')" - endfor - - " Special cases - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(u"\u0008")' - "silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(u"\u0009")' - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(u"\u000a")' - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(u"\u000d")' - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(" ")' - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(u"\u001b[A")' - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(u"\u001b[B")' - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(u"\u001b[C")' - silent execute 'inoremap :python ' . b:ConqueTerm_Var . '.write(u"\u001b[D")' - - " meta characters - "for c in split(s:chars_meta, '\zs') - " silent execute 'inoremap :call conque_term#press_key("' . c . '")a' - "endfor - - " send selected text into conque - vnoremap :call conque_term#send_selected(visualmode()) - - " remap paste keys - silent execute 'nnoremap p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))a' - silent execute 'nnoremap P :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))a' - silent execute 'nnoremap ]p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))a' - silent execute 'nnoremap [p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))a' - if has('gui_running') - silent execute 'inoremap :python ' . b:ConqueTerm_Var . ".write(vim.eval('@+'))a" - endif - - " disable other normal mode keys which insert text - nnoremap r :echo 'Replace mode disabled in shell.' - nnoremap R :echo 'Replace mode disabled in shell.' - nnoremap c :echo 'Change mode disabled in shell.' - nnoremap C :echo 'Change mode disabled in shell.' - nnoremap s :echo 'Change mode disabled in shell.' - nnoremap S :echo 'Change mode disabled in shell.' - - " help message about - "nnoremap :echo 'To send an to the terminal, press quickly in insert mode. Some programs, such as Vim, will also accept as a substitute for ' - -endfunction "}}} - -" send selected text from another buffer -function! conque_term#send_selected(type) "{{{ - let reg_save = @@ - - " yank current selection - silent execute "normal! `<" . a:type . "`>y" - - let @@ = substitute(@@, '^[\r\n]*', '', '') - let @@ = substitute(@@, '[\r\n]*$', '', '') - - silent execute ":sb " . g:Conque_BufName - silent execute 'python ' . g:ConqueTerm_Var . '.paste_selection()' - - let @@ = reg_save - startinsert! -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 - - " TODO - doesn't work - " restart updatetime - "call feedkeys("\x80\xFD\x35") -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 ********************************************************************************************** -" ********************************************************************************************************** - -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 - window = None - 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.window = vim.current.window - self.screen = ConqueScreen() - # }}} - - # start program and initialize this instance - def open(self, command, options): # {{{ - - # int vars - self.columns = self.window.width - self.lines = self.window.height - self.working_columns = self.window.width - self.working_lines = self.window.height - self.bottom = self.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): # {{{ - - # 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("\", "t")') - else: - vim.command('call feedkeys("\", "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] - - 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 = self.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 self.window.width != self.columns or self.window.height != self.lines: - - # reset all window size attributes to default - self.columns = self.window.width - self.lines = self.window.height - self.working_columns = self.window.width - self.working_lines = self.window.height - self.bottom = self.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 - # }}} - - # }}} - -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 - window = 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.window = vim.current.window - - self.screen_top = 1 - self.screen_width = self.window.width - self.screen_height = self.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])) - - # XXX - Using python's version makes lots of super-fun segfaults - self.window.cursor = (real_line, real_column - 1) - #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 = self.window.width - self.screen_height = self.window.height - self.screen_top = len(self.buffer) - self.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): # {{{ - self.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 - diff --git a/dot.vim/autoload/pathogen.vim b/dot.vim/autoload/pathogen.vim deleted file mode 100644 index ff7dba3..0000000 --- a/dot.vim/autoload/pathogen.vim +++ /dev/null @@ -1,139 +0,0 @@ -" pathogen.vim - path option manipulation -" Maintainer: Tim Pope -" Version: 1.2 - -" Install in ~/.vim/autoload (or ~\vimfiles\autoload). -" -" API is documented below. - -if exists("g:loaded_pathogen") || &cp - finish -endif -let g:loaded_pathogen = 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,'\\\@ output - silent filetype - redir END - let result = {} - let result.detection = match(output,'detection:ON') >= 0 - let result.indent = match(output,'indent:ON') >= 0 - let result.plugin = match(output,'plugin:ON') >= 0 - return result -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 - -" 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 = pathogen#glob_directories(a:path.sep."*[^~]") - let after = pathogen#glob_directories(a:path.sep."*[^~]".sep."after") - 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' - let list = [] - for dir in pathogen#split(&rtp) - if dir =~# '\ - -" Install this file as autoload/rails.vim. This file is sourced manually by -" plugin/rails.vim. It is in autoload directory to allow for future usage of -" Vim 7's autoload feature. - -" ============================================================================ - -" Exit quickly when: -" - this plugin was already loaded (or disabled) -" - when 'compatible' is set -if &cp || exists("g:autoloaded_rails") - finish -endif -let g:autoloaded_rails = '4.1' - -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(''), '\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: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,'\\\@' - 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 - 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 line = self.last_method_line(a:start) - if line - return s:sub(matchstr(self.getline(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 - let rline = self.last_opening_line('\C^\s*respond_to\s*\%(\ 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(...) - if RailsFileType() =~ '^view\>' - let format = fnamemodify(RailsFilePath(),':r:e') - else - let format = rails#buffer().last_format(a:0 > 1 ? a:2 : line(".")) - endif - if format == '' - return get({'rhtml': 'html', 'rxml': 'xml', 'rjs': 'js'},fnamemodify(RailsFilePath(),':e'),a:0 ? a:1 : '') - endif - return 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 = 'rhtml,erb,rxml,builder,rjs,mab,liquid,haml,dryml,mn' - -function! s:viewspattern() - return '\%('.s:gsub(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 =~ '\ 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,'[aeio]@ 0 && getbufvar(nr,'rails_file_type') != '' - return getbufvar(nr,'rails_file_type') - elseif f =~ '_controller\.rb$' || f =~ '\' - let r = "controller-api" - else - let r = "controller" - endif - elseif f =~ '_api\.rb' - let r = "api" - elseif f =~ '\' - let top = join(s:readfile(full_path,50),"\n") - let class = matchstr(top,'\') - if class == "ActiveResource::Base" - let class = "ares" - let r = "model-ares" - elseif class != '' - let class = tolower(s:gsub(class,'[^A-Z]','')) - let r = "model-".s:sub(class,'^amb>','mailer') - elseif f =~ '_mailer\.rb$' - let r = "model-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 =~ '\.*\.' - let r = "view-layout-" . e - elseif f =~ '\<\%(app/views\|components\)/.*/_\k\+\.\k\+\%(\.\k\+\)\=$' - let r = "view-partial-" . e - elseif f =~ '\.*\.' || f =~ '\' - if e == "yml" - let r = "fixtures-yaml" - else - let r = "fixtures" . (e == "" ? "" : "-" . e) - endif - elseif f =~ '\' || f=~ '\.*\.rb$' - let r = "config-routes" - elseif f =~ '\"')) - 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/'} - 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_background_ruby_command(cmd) dict abort - let cmd = s:esccmd(self.ruby_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 - else - exe "!".cmd - endif - return v:shell_error -endfunction - -function! s:app_execute_ruby_command(cmd) dict abort - exe "!".s:esccmd(self.ruby_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','execute_ruby_command','background_ruby_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(0,! && ? -1 : ,) - command! -buffer -bar -nargs=? -bang -range -complete=customlist,s:Complete_preview Rpreview :call s:Preview(0,,) - command! -buffer -bar -nargs=? -bang -complete=customlist,s:Complete_environments Rlog :call s:Log(0,) - command! -buffer -bar -nargs=* -bang -complete=customlist,s:Complete_set Rset :call s:Set(0,) - 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 0 || =~ "^\\([:'-]\\|g:\\)" | - \ exe RailsHelpCommand() | - \ else | call s:Doc(0,) | endif - command! -buffer -bar -nargs=0 -bang Rrefresh :if 0|unlet! g:autoloaded_rails|source `=s:file`|endif|call s:Refresh(0) - if exists(":NERDTree") - command! -buffer -bar -nargs=? -complete=customlist,s:Complete_cd Rtree :NERDTree `=rails#app().path()` - elseif exists(":Project") - command! -buffer -bar -nargs=? Rtree :call s:Project(0,) - endif - command! -buffer -bar -nargs=? Rproject :call s:warn("Warning: :Rproject has been deprecated in favor of :Rtree") | Rtree - if exists("g:loaded_dbext") - command! -buffer -bar -nargs=? -complete=customlist,s:Complete_environments Rdbext :call s:BufDatabase(2,)|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 -nargs=? -range -complete=customlist,s:controllerList Rextract :,call s:Extract(0,) - endif - if RailsFilePath() =~ '\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') && RailsFileType() == '' - echo msg." (Rails)" - elseif a:bang && exists('b:rails_root') - echo msg." (Rails-".RailsFileType().")" - elseif a:bang - echo msg - else - !rails - endif - return - endif - let dir = "" - if a:1 !~ '^-' - let dir = a:1 - elseif a:{a:0} =~ '[\/]' - let dir = a:{a:0} - else - let dir = a:1 - endif - let str = "" - let c = 1 - while c <= a:0 - let str .= " " . s:rquote(expand(a:{c})) - let c += 1 - endwhile - let dir = expand(dir) - let append = "" - if g:rails_default_database != "" && str !~ '-d \|--database=' - let append .= " -d ".g:rails_default_database - endif - if a:bang - let append .= " --force" - endif - exe "!rails".append.str - if filereadable(dir."/".g:rails_default_file) - edit `=dir.'/'.g:rails_default_file` - endif -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:\ %#%m,' - \.'%\\s%#%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 &l:makeprg !~# 'rake' - let &l:makeprg = 'rake' - endif - let &l:errorformat = s:efm_backtrace - let t = RailsFileType() - 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 - 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\>.*\|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 t = self.type_name() - let lnum = a:lnum < 0 ? 0 : a:lnum - if 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 t =~ '^config-routes\>' - return 'routes' - elseif t =~ '^fixtures-yaml\>' && lnum - return "db:fixtures:identify LABEL=".self.last_method(lnum) - elseif t =~ '^fixtures\>' && lnum == 0 - return "db:fixtures:load FIXTURES=".s:sub(fnamemodify(self.name(),':r'),'^.{-}/fixtures/','') - elseif t =~ '^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 t =~ '^spec\>' - if self.name() =~# '\' - let meth = self.last_method(lnum) - if meth =~ '^test_' - let call = " -n".meth."" - else - let call = "" - endif - if t =~ '^test-\%(unit\|functional\|integration\)$' - return s:sub(s:gsub(t,'-',':'),'unit$|functional$','&s')." TEST=\"%:p\"".s:sub(call,'^ ',' TESTOPTS=') - elseif self.name() =~# '\' && self.name() !~# '\' - return 'test:units TEST="%:p:r:s?[\/]app[\/]models[\/]?/test/unit/?_test.rb"' - elseif t=~ '^api\>' - return 'test:units TEST="%:p:r:s?[\/]app[\/]apis[\/]?/test/functional/?_test.rb"' - elseif t=~ '^\<\%(controller\|helper\|view\)\>' - if self.name() =~ '\' - if lnum > 0 - return 'cucumber FEATURE="%:p":'.lnum - else - return 'cucumber FEATURE="%:p"' - endif - elseif t =~ '^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 - elseif has("gui_win32") - command -bar -nargs=1 OpenURL :!start cmd /cstart /b - elseif executable("sensible-browser") - command -bar -nargs=1 OpenURL :!sensible-browser - 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/'),'\.sass$','.css')] - elseif self.name() =~ '^public/' - let urls = urls + [s:sub(self.name(),'^public','')] - 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 q :bwipe - 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(0,) - command! -buffer -bar -nargs=* -complete=customlist,s:Complete_generate Rgenerate :call rails#app().generate_command(0,) - command! -buffer -bar -nargs=* -complete=customlist,s:Complete_destroy Rdestroy :call rails#app().destroy_command(0,) - command! -buffer -bar -nargs=? -bang -complete=customlist,s:Complete_server Rserver :call rails#app().server_command(0,) - command! -buffer -bang -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rrunner :call rails#app().runner_command(0 ? -2 : (==?:-1),) - command! -buffer -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rp :call rails#app().runner_command(==?:-1,'p begin '..' end') - command! -buffer -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Rpp :call rails#app().runner_command(==?:-1,'require %{pp}; pp begin '..' end') - command! -buffer -nargs=1 -range=0 -complete=customlist,s:Complete_ruby Ry :call rails#app().runner_command(==?:-1,'y begin '..' 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_ruby_command(s:rquote("script/".cmd).str) - else - return self.execute_ruby_command(s:rquote("script/".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")) - call self.background_ruby_command(s:rquote("script/server")." ".a:arg) - else - "--daemon would be more descriptive but lighttpd does not support it - call self.execute_ruby_command(s:rquote("script/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_ruby_command("script/destroy") - elseif a:0 == 1 - return self.execute_ruby_command("script/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_ruby_command(s:rquote("script/destroy").str) - call self.cache.clear('user_classes') -endfunction - -function! s:app_generate_command(bang,...) dict - if a:0 == 0 - return self.execute_ruby_command("script/generate") - elseif a:0 == 1 - return self.execute_ruby_command("script/generate ".s:rquote(a:1)) - endif - let target = s:rquote(a:1) - let str = "" - let c = 2 - while c <= a:0 - let str .= " " . s:rquote(a:{c}) - let c += 1 - endwhile - if str !~ '-p\>' && str !~ '--pretend\>' - let execstr = self.ruby_shell_command('-r./config/boot -e "require '."'commands/generate'".'" -- '.target." -p -f".str) - let res = system(execstr) - let file = matchstr(res,'\s\+\%(create\|force\)\s\+\zs\f\+\.rb\ze\n') - if file == "" - let file = matchstr(res,'\s\+\%(exists\)\s\+\zs\f\+\.rb\ze\n') - endif - else - let file = "" - endif - if !self.execute_ruby_command("script/generate ".target.str) && 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+','') - "let P = a:P - strlen(a:CmdLine)+strlen(cmd) - 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\+\zs\w\+\ze\s\+') - if target =~# '^\%(\w*_\)\=controller$' - return filter(s:controllerList(a:ArgLead,"",""),'v:val !=# "application"') - elseif target =~# '^\%(\w*_\)\=model$' || target =~# '^scaffold\%(_resource\)\=$' || target ==# 'mailer' - return s:modelList(a:ArgLead,"","") - elseif target ==# 'migration' || target ==# 'session_migration' - return s:migrationList(a:ArgLead,"","") - elseif target ==# 'integration_test' || target ==# 'integration_spec' || target ==# 'feature' - return s:integrationtestList(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) - elseif target ==# 'web_service' - return s:apiList(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()` - command! -buffer -bar -nargs=? -complete=customlist,s:Complete_cd Rlcd :lcd `=rails#app().path()` - command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find Rfind :call s:Find(,'' ,) - command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find REfind :call s:Find(,'E',) - command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find RSfind :call s:Find(,'S',) - command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find RVfind :call s:Find(,'V',) - command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find RTfind :call s:Find(,'T',) - command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find Rsfind :RSfind - command! -buffer -bar -nargs=* -count=1 -complete=customlist,s:Complete_find Rtabfind :RTfind - command! -buffer -bar -nargs=* -bang -complete=customlist,s:Complete_edit Redit :call s:Edit(,'' ,) - command! -buffer -bar -nargs=* -bang -complete=customlist,s:Complete_edit REedit :call s:Edit(,'E',) - command! -buffer -bar -nargs=* -bang -complete=customlist,s:Complete_edit RSedit :call s:Edit(,'S',) - command! -buffer -bar -nargs=* -bang -complete=customlist,s:Complete_edit RVedit :call s:Edit(,'V',) - command! -buffer -bar -nargs=* -bang -complete=customlist,s:Complete_edit RTedit :call s:Edit(,'T',) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_edit RDedit :call s:Edit(,'D',) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related A :call s:Alternate('', ,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AE :call s:Alternate('E',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AS :call s:Alternate('S',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AV :call s:Alternate('V',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AT :call s:Alternate('T',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AD :call s:Alternate('D',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related AN :call s:Related('' ,,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related R :call s:Related('' ,,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RE :call s:Related('E',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RS :call s:Related('S',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RV :call s:Related('V',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RT :call s:Related('T',,,,) - command! -buffer -bar -nargs=* -range=0 -complete=customlist,s:Complete_related RD :call s:Related('D',,,,) -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*respond_to\s*\%(\ 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 - let results = sort(map(keys(seen),'s:sub(v:val,"[.]rb$","")')) - return s:autocamelize(results,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("") != 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*=>\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("")) - return expand("") - endif - - " UGH - let format = s:format('html') - - let res = s:findit('\v\s*.=',expand('%:h').'/\1') - if res != ""|return res.(fnamemodify(res,':e') == '' ? '.rb' : '')|endif - - let res = s:findit('\v['."'".'"]=',expand('%:h').'\1') - if res != ""|return res|endif - - let res = rails#underscore(s:findit('\v\s*<%(include|extend)\(=\s*<(\f+)>','\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() =~ '\\s*','\1'),'^/',''),'\k+$','_&') - if res != ""|return res."\n".s:findview(res)|endif - - let res = s:findamethod('render\s*:\%(template\|action\)\s\+=>\s*','\1.'.format.'\n\1') - if res != ""|return res|endif - - let res = s:sub(s:findfromview('render','\1'),'^/','') - if RailsFileType() =~ '^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\+=>\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 RailsFileType() =~ '^controller\>' - let contr = s:controller() - let view = s:findit('\s*\(\=','/\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("") - 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 # style output - let str = s:gsub(str,"[\"']",'') - if line =~# '\<\(require\|load\)\s*(\s*$' - return str - 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,'([^/]+)$','_\1') - let str = s:findview(str) - elseif line =~# '\\s*' - let str = s:findview(s:sub(str,'^/=','layouts/')) - elseif line =~# ':controller\s*=>\s*' - let str = 'app/controllers/'.str.'_controller.rb' - elseif line =~# '\' : '').cmd.'",)' - let cmd = strpart(cmds,0,1) - let cmds = strpart(cmds,1) - endwhile -endfunction - -function! s:BufFinderCommands() - command! -buffer -bar -nargs=+ Rnavcommand :call s:Navcommand(0,) - call s:addfilecmds("metal") - call s:addfilecmds("model") - call s:addfilecmds("view") - call s:addfilecmds("controller") - 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: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) - return s:completion_filter(rails#app().relglob("public/stylesheets/","**/*",".css"),a:A) -endfunction - -function! s:javascriptList(A,L,P) - return s:completion_filter(rails#app().relglob("public/javascripts/","**/*",".js"),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") - 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/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() =~ '\','".name."',\"".prefix."\",".string(suffix).",".string(filter).",".string(default).",)" - 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 migr = s:sub(glob(self.path('db/migrate/').glob),'.*\n','') - if s:startswith(migr,self.path()) - let migr = strpart(migr,1+strlen(self.path())) - endif - return migr -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 RailsFileType() == 'controller' - 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) - 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('html') - if glob(rails#app().path(file.'.'.format).'.*[^~]') != '' - let file .= '.' . format - endif - call s:findedit(a:cmd,file) - endif -endfunction - -function! s:findview(name) - " TODO: full support of nested extensions - let c = a:name - let pre = "app/views/" - let file = "" - if c !~ '/' - let controller = s:controller(1) - if controller != '' - let c = controller.'/'.c - endif - endif - if c =~ '\.\w\+\.\w\+$' || c =~ '\.'.s:viewspattern().'$' - return pre.c - elseif rails#app().has_file(pre.c.".rhtml") - let file = pre.c.".rhtml" - elseif rails#app().has_file(pre.c.".rxml") - let file = pre.c.".rxml" - else - let format = "." . s:format('html') - let vt = s:view_types."," - while 1 - while vt != "" - let t = matchstr(vt,'[^,]*') - let vt = s:sub(vt,'[^,]*,','') - if rails#app().has_file(pre.c.format.".".t) - let file = pre.c.format.".".t - break - endif - endwhile - if format == '' || file != '' - break - else - let format = '' - endif - endwhile - endif - return file -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 RailsFileType() =~ '^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: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) - else - return s:EditSimpleRb(a:cmd,"stylesheet",name,"public/stylesheets/",".css",1) - endif -endfunction - -function! s:javascriptEdit(cmd,...) - return s:EditSimpleRb(a:cmd,"javascript",a:0? a:1 : "application","public/javascripts/",".js",1) -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 && RailsFileType() =~# '^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'], 'spec': ['spec/controllers/','_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 [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.f.'_controller'.suffix) - return s:findedit(cmd,prefix.f.'_controller'.suffix.jump) - elseif rails#app().has_file(prefix.f.'_api'.suffix) - return s:findedit(cmd,prefix.f.'_api'.suffix.jump) - endif - endfor - return s:EditSimpleRb(a:cmd,"functionaltest",f.jump,tests[0][0],tests[0][1],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 mapping = {'test': ['test/integration/','_test.rb'], 'spec': ['spec/integration/','_spec.rb'], 'cucumber': ['features/','.feature']} - 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 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() =~ '\','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() - let t = self.type_name() - if a:0 && a:1 - let lastmethod = self.last_method(a:1) - if t =~ '^\%(controller\|model-mailer\)\>' && lastmethod != "" - let root = s:sub(s:sub(s:sub(f,'/application\.rb$','/shared_controller.rb'),'/%(controllers|models)/','/views/'),'%(_controller)=\.rb$','/'.lastmethod) - let format = self.last_format(a:1) - if format == '' | let format = 'html' | endif - if glob(self.app().path().'/'.root.'.'.format.'.*[^~]') != '' - return root . '.' . format - else - return root - endif - elseif f =~ '\' - return s:sub(s:sub(s:sub(f,'/views/','/controllers/'),'/layouts/(\k+)\..*$','/\1_controller.rb'),'' - 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 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(model,'#.{-}$','')) || model =~ '_mailer\.rb#' - return model - else - return controller - endif - elseif t =~ '^controller\>' - return s:sub(s:sub(f,'/controllers/','/helpers/'),'%(_controller)=\.rb$','_helper.rb') - " elseif t=~ '^helper\>' - " return s:findlayout(s:controller()) - elseif t =~ '^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'),'.{-}' - return s:sub(f,'_observer\.rb$','.rb') - elseif f =~ '\ me') - let migration = "db/migrate/".get(candidates,0,migrations[0]).".rb" - endif - return migration . (exists('l:lastmethod') && lastmethod != '' ? '#'.lastmethod : '') - elseif f =~ '\' - return "public/javascripts/application.js" - elseif f =~ '\' - let spec1 = fnamemodify(f,':s?\' - let dest = fnamemodify(f,':r:s?/layouts\>??').'/layout.'.fnamemodify(f,':e') - else - let dest = f - endif - return s:sub(s:sub(dest,'' - let api = s:sub(s:sub(f,'/controllers/','/apis/'),'_controller\.rb$','_api.rb') - return api - elseif t =~ '^api\>' - return s:sub(s:sub(f,'/apis/','/controllers/'),'_api\.rb$','_controller.rb') - elseif t =~ '^helper\>' - let controller = s:sub(s:sub(f,'/helpers/','/controllers/'),'_helper\.rb$','_controller.rb') - let controller = s:sub(controller,'application_controller','application') - let spec = s:sub(s:sub(f,'' && f =~ '\' - let file = rails#singularize(fnamemodify(f,":t:r")).'_test.rb' - return file - elseif f == '' - call s:warn("No filename present") - elseif f =~ '\' - return s:sub(s:sub(f,'' - return s:sub(file,'app/models/','test/unit/')."\n".s:sub(s:sub(file,'_test\.rb$','_spec.rb'),'app/models/','spec/models/') - elseif t =~ '^controller\>' - return s:sub(file,'' - return s:sub(file,'test/unit/','app/models/')."\n".s:sub(file,'test/unit/','lib/') - elseif t =~ '^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 t == 'spec-lib' - return s:sub(file,'' - return s:sub(file,' 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 RailsFileType() =~ '^view-layout\>' - if RailsFilePath() =~ '\' - let curdir = 'app/views/shared' - if file !~ '/' - let file = "shared/" .file - endif - else - let curdir = s:sub(RailsFilePath(),'.* 0 - if bufloaded(out) - return s:error("Partial already open in buffer ".bufnr(out)) - else - exe "bwipeout ".bufnr(out) - 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\".fspaces.renderstr."\.\" - finally - let &ai = old_ai - endtry - if renderstr =~ '<%' - norm ^6w - else - norm ^5w - endif - let ft = &ft - if &hidden - enew - else - new - endif - let shortout = fnamemodify(out,':.') - silent file `=shortout` - let &ft = ft - let @@ = partial - silent put - 0delete - let @@ = buf - if spaces != "" - silent! exe '%substitute/^'.spaces.'//' - endif - silent! exe '%substitute?\%(\w\|[@:"'."'".'-]\)\@?'.name.'?g' - 1 - call RailsBufInit(rails_root) - if exists("l:partial_warn") - call s:warn("Warning: partial exists!") - endif -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 =~ '\' - let add = s:migspc(line)."drop_table".s:mextargs(line,1).s:mkeep(line) - let lnum = s:endof(lnum) - elseif line =~ '\' - let add = s:sub(line,'\s*\(=\s*([^,){ ]*).*','create_table \1 do |t|'."\n".matchstr(line,'^\s*').'end').s:mkeep(line) - elseif line =~ '\' - let add = s:migspc(line).'remove_column'.s:mextargs(line,2).s:mkeep(line) - elseif line =~ '\' - let add = s:sub(line,'','add_column') - elseif line =~ '\' - 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,'\[^,]*,\s*\zs\%(\[[^]]*\]\|[:"'."'".']\w*["'."'".']\=\)') - if mat != '' - let add = s:sub(add,'\)=$',', :column => '.mat.'&') - endif - endif - let add .= s:mkeep(line) - elseif line =~ '\' - let add = s:sub(s:sub(line,'\s*','') - elseif line =~ '\' - let add = s:sub(line,'' - let add = s:migspc(line).'change_column'.s:mextargs(line,2).s:mkeep(line) - elseif line =~ '\' - 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 "" - \."atom_feed auto_discovery_link_tag auto_link " - \."benchmark button_to button_to_function button_to_remote " - \."cache capture cdata_section check_box check_box_tag collection_select concat content_for content_tag content_tag_for 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 draggable_element draggable_element_js drop_receiving_element drop_receiving_element_js " - \."error_message_on error_messages_for escape_javascript escape_once evaluate_remote_response excerpt " - \."field_set_tag fields_for file_field file_field_tag form form_for form_remote_for form_remote_tag form_tag " - \."grouped_collection_select grouped_options_for_select " - \."hidden_field hidden_field_tag highlight " - \."image_path image_submit_tag image_tag input " - \."javascript_cdata_section javascript_include_tag javascript_path javascript_tag " - \."l label label_tag link_to link_to_function link_to_if link_to_remote link_to_unless link_to_unless_current localize " - \."mail_to markdown " - \."number_to_currency number_to_human_size number_to_percentage number_to_phone number_with_delimiter number_with_precision " - \."observe_field observe_form option_groups_from_collection_for_select options_for_select options_from_collection_for_select " - \."partial_path password_field password_field_tag path_to_image path_to_javascript path_to_stylesheet periodically_call_remote pluralize " - \."radio_button radio_button_tag raw remote_form_for remote_function reset_cycle " - \."sanitize sanitize_css select select_date select_datetime select_day select_hour select_minute select_month select_second select_tag select_time select_year simple_format sortable_element sortable_element_js strip_links strip_tags stylesheet_link_tag stylesheet_path submit_tag submit_to_remote " - \."t tag text_area text_area_tag text_field text_field_tag textilize textilize_without_paragraph time_ago_in_words time_select time_zone_options_for_select time_zone_select translate truncate " - \."update_page update_page_tag url_for " - \."visual_effect " - \."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 t = RailsFileType() - let s:javascript_functions = "$ $$ $A $F $H $R $w jQuery" - let rails_helper_methods = '+\.\@+' - 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 t == '' - syn keyword rubyRailsMethod params request response session headers cookies flash - endif - if t =~ '^api\>' - syn keyword rubyRailsAPIMethod api_method inflect_names - endif - if t =~ '^model$' || t =~ '^model-arb\>' - syn keyword rubyRailsARMethod default_scope named_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 rubyRailsARClassMethod attr_accessible attr_protected establish_connection set_inheritance_column set_locking_column set_primary_key set_sequence_name set_table_name - syn keyword rubyRailsARValidationMethod validate 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 t =~ '^model-aro\>' - syn keyword rubyRailsARMethod observe - endif - if t =~ '^model-mailer\>' - syn keyword rubyRailsMethod logger - syn keyword rubyRailsControllerMethod helper helper_attr helper_method - endif - if t =~ '^controller\>' || t =~ '^view\>' || t=~ '^helper\>' - syn keyword rubyRailsMethod params request response session headers cookies flash - syn keyword rubyRailsRenderMethod render - syn keyword rubyRailsMethod logger - endif - if t =~ '^helper\>' || t=~ '^view\>' - exe "syn keyword rubyRailsHelperMethod ".s:sub(s:helpermethods(),'\%(\s*{\|\s*do\>\|\s*(\=\s*&\)\@!' - syn match rubyRailsViewMethod '\.\@' - if t =~ '\' - syn keyword rubyRailsMethod local_assigns - endif - elseif t =~ '^controller\>' - 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 - syn keyword rubyRailsRenderMethod render_to_string redirect_to head - syn match rubyRailsRenderMethod '\?\@!' - 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 t =~ '^\%(db-\)\=\%(migration\|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 - endif - if t =~ '^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 t !~ '^test-unit\>' - syn match rubyRailsTestControllerMethod '\.\@' - 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 t=~ '^spec\>' - syn keyword rubyRailsTestMethod describe context it specify it_should_behave_like before after subject fixtures controller_name helper_name - syn keyword rubyRailsTestMethod violated pending mock mock_model stub_model - syn match rubyRailsTestMethod '\.\@!\@!' - if t !~ '^spec-model\>' - syn match rubyRailsTestControllerMethod '\.\@' - syn keyword rubyRailsTestControllerMethod integrate_views - syn keyword rubyRailsMethod params request response session flash - endif - endif - if t =~ '^task\>' - syn match rubyRailsRakeMethod '^\s*\zs\%(task\|file\|namespace\|desc\|before\|after\|on\)\>\%(\s*=\)\@!' - endif - if t =~ '^model-awss\>' - syn keyword rubyRailsMethod member - endif - if t =~ '^config-routes\>' - syn match rubyRailsMethod '\.\zs\%(connect\|resources\=\|root\|named_route\|namespace\)\>' - 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 gem - - 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 erubyRailsUserClass ".classes." contained containedin=@erubyRailsRegions" - endif - if &syntax == "haml" - syn cluster erubyRailsRegions contains=hamlRubyCodeIncluded,hamlRubyCode,hamlRubyHash,@hamlEmbeddedRuby,rubyInterpolation - else - syn cluster erubyRailsRegions contains=erubyOneLiner,erubyBlock,erubyExpression,rubyInterpolation - endif - exe "syn keyword erubyRailsHelperMethod ".s:sub(s:helpermethods(),'\%(\s*{\|\s*do\>\|\s*(\=\s*&\)\@!' contained containedin=@erubyRailsRegions - syn keyword erubyRailsMethod debugger logger contained containedin=@erubyRailsRegions - syn keyword erubyRailsMethod params request response session headers cookies flash contained containedin=@erubyRailsRegions - syn match erubyRailsViewMethod '\.\@' contained containedin=@erubyRailsRegions - if t =~ '\' - syn keyword erubyRailsMethod local_assigns contained containedin=@erubyRailsRegions - endif - syn keyword erubyRailsRenderMethod render contained containedin=@erubyRailsRegions - syn case match - set isk+=$ - exe "syn keyword javascriptRailsFunction contained ".s:javascript_functions - 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 '\.\@' 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" - " 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 railsUserMethod railsMethod - hi def link erubyRailsUserClass railsUserClass - 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() - syn match railslogRender '^\s*\<\%(Processing\|Rendering\|Rendered\|Redirected\|Completed\)\>' - syn match railslogComment '^\s*# .*' - syn match railslogModel '^\s*\u\%(\w\|:\)* \%(Load\%( Including Associations\| IDs For Limited Eager Loading\)\=\|Columns\|Count\|Create\|Update\|Destroy\|Delete all\)\>' skipwhite nextgroup=railslogModelNum - syn match railslogModel '^\s*SQL\>' skipwhite nextgroup=railslogModelNum - syn region railslogModelNum start='(' end=')' contains=railslogNumber contained skipwhite nextgroup=railslogSQL - syn match railslogSQL '\u.*$' contained - " Destroy generates multiline SQL, ugh - syn match railslogSQL '^ \%(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 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 -" Statusline {{{1 - -function! s:addtostatus(letter,status) - let status = a:status - if status !~ 'rails' && g:rails_statusline - let status=substitute(status,'\C%'.tolower(a:letter),'%'.tolower(a:letter).'%{rails#statusline()}','') - if status !~ 'rails' - let status=substitute(status,'\C%'.toupper(a:letter),'%'.toupper(a:letter).'%{rails#STATUSLINE()}','') - endif - endif - return status -endfunction - -function! s:BufInitStatusline() - if g:rails_statusline - if &l:statusline == '' - let &l:statusline = &g:statusline - endif - if &l:statusline == '' - let &l:statusline='%<%f %h%m%r%=' - if &ruler - let &l:statusline .= '%-16( %l,%c-%v %)%P' - endif - endif - let &l:statusline = s:InjectIntoStatusline(&l:statusline) - endif -endfunction - -function! s:InitStatusline() - if g:rails_statusline - if &g:statusline == '' - let &g:statusline='%<%f %h%m%r%=' - if &ruler - let &g:statusline .= '%-16( %l,%c-%v %)%P' - endif - endif - let &g:statusline = s:InjectIntoStatusline(&g:statusline) - endif -endfunction - -function! s:InjectIntoStatusline(status) - let status = a:status - if status !~ 'rails' - let status = s:addtostatus('y',status) - let status = s:addtostatus('r',status) - let status = s:addtostatus('m',status) - let status = s:addtostatus('w',status) - let status = s:addtostatus('h',status) - if status !~ 'rails' - let status=substitute(status,'%=','%{rails#statusline()}%=','') - endif - if status !~ 'rails' && status != '' - let status .= '%{rails#statusline()}' - endif - endif - return status -endfunction - -function! rails#statusline(...) - if exists("b:rails_root") - let t = RailsFileType() - if t != "" && a:0 && a:1 - return "[Rails-".t."]" - else - return "[Rails]" - endif - else - return "" - endif -endfunction - -function! rails#STATUSLINE(...) - if exists("b:rails_root") - let t = RailsFileType() - if t != "" && a:0 && a:1 - return ",RAILS-".toupper(t) - else - return ",RAILS" - endif - else - return "" - endif -endfunction - -" }}}1 -" Mappings {{{1 - -function! s:BufMappings() - nnoremap RailsAlternate :A - nnoremap RailsRelated :R - nnoremap RailsFind :REfind - nnoremap RailsSplitFind :RSfind - nnoremap RailsVSplitFind :RVfind - nnoremap RailsTabFind :RTfind - if g:rails_mappings - if !hasmapto("RailsFind") - nmap gf RailsFind - endif - if !hasmapto("RailsSplitFind") - nmap f RailsSplitFind - endif - if !hasmapto("RailsTabFind") - nmap gf RailsTabFind - endif - if !hasmapto("RailsAlternate") - nmap [f RailsAlternate - endif - if !hasmapto("RailsRelated") - nmap ]f RailsRelated - endif - if exists("$CREAM") - imap RailsFind - imap RailsAlternate - imap RailsRelated - endif - endif - " SelectBuf you're a dirty hack - let v:errmsg = "" -endfunction - -" }}}1 -" Project {{{ - -function! s:Project(bang,arg) - let rr = rails#app().path() - exe "Project ".a:arg - let line = search('^[^ =]*="'.s:gsub(rr,'[\/]','[\\/]').'"') - let projname = s:gsub(fnamemodify(rr,':t'),'\=','-') " .'_on_rails' - if line && a:bang - let projname = matchstr(getline('.'),'^[^=]*') - " Most of this would be unnecessary if the project.vim author had just put - " the newlines AFTER each project rather than before. Ugh. - norm zR0"_d% - if line('.') > 2 - delete _ - endif - if line('.') != line('$') - .-2 - endif - let line = 0 - elseif !line - $ - endif - if !line - if line('.') > 1 - append - -. - endif - let line = line('.')+1 - call s:NewProject(projname,rr) - endif - normal! zMzo - if search("^ app=app {","W",line+10) - normal! zo - exe line - endif - normal! 0zt -endfunction - -function! s:NewProject(proj,rr) - let line = line('.')+1 - let template = s:NewProjectTemplate(a:proj,a:rr) - silent put =template - exe line - " Ugh. how else can I force detecting folds? - setlocal foldmethod=manual - norm! $% - silent exe "doautocmd User ".s:escarg(a:rr)."/Rproject" - let newline = line('.') - exe line - norm! $% - if line('.') != newline - call s:warn("Warning: Rproject autocommand failed to leave cursor at end of project") - endif - exe line - setlocal foldmethod=marker - setlocal nomodified - " FIXME: make undo stop here - if !exists("g:maplocalleader") - silent! normal \R - else " Needs to be tested - exe 'silent! normal '.g:maplocalleader.'R' - endif -endfunction - -function! s:NewProjectTemplate(proj,rr) - let str = a:proj.'="'.a:rr."\" CD=. filter=\"*\" {\n" - let str .= " app=app {\n" - for dir in ['apis','controllers','helpers','models','views'] - let str .= s:addprojectdir(a:rr,'app',dir) - endfor - let str .= " }\n" - let str .= " config=config {\n environments=environments {\n }\n }\n" - let str .= " db=db {\n" - let str .= s:addprojectdir(a:rr,'db','migrate') - let str .= " }\n" - let str .= " lib=lib filter=\"* */**/*.rb \" {\n tasks=tasks filter=\"**/*.rake\" {\n }\n }\n" - let str .= " public=public {\n images=images {\n }\n javascripts=javascripts {\n }\n stylesheets=stylesheets {\n }\n }\n" - if isdirectory(a:rr.'/spec') - let str .= " spec=spec {\n" - for dir in ['controllers','fixtures','helpers','models','views'] - let str .= s:addprojectdir(a:rr,'spec',dir) - endfor - let str .= " }\n" - endif - if isdirectory(a:rr.'/test') - let str .= " test=test {\n" - for dir in ['fixtures','functional','integration','mocks','unit'] - let str .= s:addprojectdir(a:rr,'test',dir) - endfor - let str .= " }\n" - end - let str .= "}\n" - return str -endfunction - -function! s:addprojectdir(rr,parentdir,dir) - if isdirectory(a:rr.'/'.a:parentdir.'/'.a:dir) - return ' '.a:dir.'='.a:dir." filter=\"**\" {\n }\n" - else - return '' - endif -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({'postgresql': 'pgsql', 'sqlite3': 'sqlite', 'sqlserver': 'sqlsrv', 'sybase': 'asa', 'oci': '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'] = '' - let dict['srvname'] = s:extractdbvar(out,'host') - 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\' - 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)) && (g:rails_dbext + (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 =~ '\\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 ,'[\"|]','\\&'),'\<','\\') - let expn2 = s:gsub(s:gsub(a:0 ? a:1 : '','[\"|]','\\&'),'\<','\\') - if a:0 - exe "inoreabbrev ".a:abbr." =selectiveexpand(".string(a:pat).",\"".expn."\",".string(a:abbr).",\"".expn2."\")" - else - exe "inoreabbrev ".a:abbr." =selectiveexpand(".string(a:pat).",\"".expn."\",".string(a:abbr).")" - 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(0,) - " Some of these were cherry picked from the TextMate snippets - if g:rails_abbreviations - let t = RailsFileType() - " Limit to the right filetypes. But error on the liberal side - if t =~ '^\(controller\|view\|helper\|test-functional\|test-integration\)\>' - Rabbrev pa[ params - Rabbrev rq[ request - Rabbrev rs[ response - Rabbrev se[ session - Rabbrev hd[ headers - Rabbrev co[ 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 t =~ '^\%(view\|helper\)\>' - Rabbrev dotiw distance_of_time_in_words - Rabbrev taiw time_ago_in_words - endif - if t =~ '^controller\>' - Rabbrev re( redirect_to - Rabbrev rea( redirect_to :action\ =>\ - Rabbrev rec( redirect_to :controller\ =>\ - Rabbrev rst( respond_to - endif - if t =~ '^model-arb\>' || t =~ '^model$' - 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 t =~ '^\%(db-\)\=\%(migration\|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 t =~ '^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 :c =TheCWord() - 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 AS:: ActiveSupport - Rabbrev AM:: ActionMailer - Rabbrev AE:: ActiveResource - Rabbrev AWS:: ActionWebService - 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 ".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\ ".mat - endif - let mat = matchstr(lines,'\C\ ".mat - endif - let mat = matchstr(lines,'\C\ 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 &ft == "mason" - setlocal filetype=eruby - elseif &ft =~ '^\%(conf\|ruby\)\=$' && expand("%:e") =~ '^\%(rjs\|rxml\|builder\|rake\|mab\)$' - setlocal filetype=ruby - elseif &ft =~ '^\%(conf\|ruby\)\=$' && expand("%:t") =~ '^\%(Rake\|Cap\)file$' - setlocal filetype=ruby - elseif &ft =~ '^\%(liquid\)\=$' && expand("%:e") == "liquid" - setlocal filetype=liquid - elseif &ft =~ '^\%(haml\|x\=html\)\=$' && expand("%:e") == "haml" - setlocal filetype=haml - elseif &ft =~ '^\%(sass\|conf\)\=$' && expand("%:e") == "sass" - setlocal filetype=sass - elseif &ft =~ '^\%(dryml\)\=$' && expand("%:e") == "dryml" - setlocal filetype=dryml - elseif (&ft == "" || v:version < 701) && expand("%:e") =~ '^\%(rhtml\|erb\)$' - setlocal filetype=eruby - elseif (&ft == "" || v:version < 700) && expand("%:e") == 'yml' - setlocal filetype=yaml - elseif firsttime - " Activate custom syntax - let &syntax = &syntax - endif - if firsttime - call s:BufInitStatusline() - endif - if expand("%:e") == "log" - setlocal modifiable filetype=railslog - silent! %s/\%(\e\[[0-9;]*m\|\r$\)//g - setlocal readonly nomodifiable noswapfile autoread foldmethod=syntax - nnoremap R :checktime - nnoremap G :checktime$ - nnoremap q :bwipe - $ - endif - call s:BufSettings() - call s:BufCommands() - call s:BufAbbreviations() - if exists("g:loaded_dbext") && g:loaded_dbext < 800 - call s:BufDatabase() - endif - " 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 = RailsFileType() - 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/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) == -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 = '*.'.s:gsub(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,.".s:gsub(s:view_types,',',',.').",.css,.js,.yml,.csv,.rake,.sql,.html,.xml") - let ft = self.getvar('&filetype') - if ft =~ '^\%(e\=ruby\|[yh]aml\|javascript\|css\|sass\)$' - 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('&suffixesadd',".rb,.".s:gsub(s:view_types,',',',.').",.yml,.csv,.rake,s.rb") - 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()) - call self.setvar('&suffixesadd',".yml,.csv,.rb,.".s:gsub(s:view_types,',',',.').",.rake,s.rb") - elseif ft == 'eruby' - call self.setvar('&suffixesadd',".".s:gsub(s:view_types,',',',.').",.rb,.css,.js,.html,.yml,.csv") - if exists("g:loaded_allml") - " allml is available on vim.org. - 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 - 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,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 xx xx -let s:sid = s:sub(maparg("xx"),'xx$','') -unmap xx -let s:file = expand(':p') - -if !exists('s:apps') - let s:apps = {} -endif - -" }}}1 - -let &cpo = s:cpo_save - -" vim:set sw=2 sts=2: diff --git a/dot.vim/autoload/snipMate.vim b/dot.vim/autoload/snipMate.vim deleted file mode 100644 index dcd28f6..0000000 --- a/dot.vim/autoload/snipMate.vim +++ /dev/null @@ -1,433 +0,0 @@ -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. - " 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, '`.\{-}`', - \ substitute(eval(matchstr(snippet, '`\zs.\{-}\ze`')), - \ "\n\\%$", '', ''), '') - endw - let snippet = substitute(snippet, "\r", "\n", '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 ? "\" : 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 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 "\".l.'v'.s:origWordLen."l\" - endif - return s:origWordLen == 1 ? "\".l.'gh' - \ : "\".l.'v'.(s:origWordLen - 1)."l\" -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/dot.vim/autoload/vimwiki.vim b/dot.vim/autoload/vimwiki.vim deleted file mode 100644 index c5a42a9..0000000 --- a/dot.vim/autoload/vimwiki.vim +++ /dev/null @@ -1,1088 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki autoload plugin file -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -if exists("g:loaded_vimwiki_auto") || &cp - finish -endif -let g:loaded_vimwiki_auto = 1 - -if has("win32") - let s:os_sep = '\' -else - let s:os_sep = '/' -endif - -let s:badsymbols = '['.g:vimwiki_badsyms.g:vimwiki_stripsym.'<>|?*:"]' - -" MISC helper functions {{{ - -function! vimwiki#chomp_slash(str) "{{{ - return substitute(a:str, '[/\\]\+$', '', '') -endfunction "}}} - -function! vimwiki#mkdir(path) "{{{ - let path = expand(a:path) - if !isdirectory(path) && exists("*mkdir") - let path = vimwiki#chomp_slash(path) - if s:is_windows() && !empty(g:vimwiki_w32_dir_enc) - let path = iconv(path, &enc, g:vimwiki_w32_dir_enc) - endif - call mkdir(path, "p") - endif -endfunction -" }}} - -function! vimwiki#safe_link(string) "{{{ - return substitute(a:string, s:badsymbols, g:vimwiki_stripsym, 'g') -endfunction -"}}} - -function! vimwiki#unsafe_link(string) "{{{ - return substitute(a:string, g:vimwiki_stripsym, s:badsymbols, 'g') -endfunction -"}}} - -function! vimwiki#subdir(path, filename)"{{{ - let path = expand(a:path) - let filename = expand(a:filename) - let idx = 0 - while path[idx] ==? filename[idx] - let idx = idx + 1 - endwhile - - let p = split(strpart(filename, idx), '[/\\]') - let res = join(p[:-2], s:os_sep) - if len(res) > 0 - let res = res.s:os_sep - endif - return res -endfunction"}}} - -function! vimwiki#current_subdir()"{{{ - return vimwiki#subdir(VimwikiGet('path'), expand('%:p')) -endfunction"}}} - -function! vimwiki#open_link(cmd, link, ...) "{{{ - if vimwiki#is_non_wiki_link(a:link) - call s:edit_file(a:cmd, a:link) - else - if a:0 - let vimwiki_prev_link = [a:1, []] - elseif &ft == 'vimwiki' - let vimwiki_prev_link = [expand('%:p'), getpos('.')] - endif - - if vimwiki#is_link_to_dir(a:link) - if g:vimwiki_dir_link == '' - call s:edit_file(a:cmd, VimwikiGet('path').a:link) - else - call s:edit_file(a:cmd, - \ VimwikiGet('path').a:link. - \ g:vimwiki_dir_link. - \ VimwikiGet('ext')) - endif - else - call s:edit_file(a:cmd, VimwikiGet('path').a:link.VimwikiGet('ext')) - endif - - if exists('vimwiki_prev_link') - let b:vimwiki_prev_link = vimwiki_prev_link - endif - endif -endfunction -" }}} - -function! vimwiki#select(wnum)"{{{ - if a:wnum < 1 || a:wnum > len(g:vimwiki_list) - return - endif - if &ft == 'vimwiki' - let b:vimwiki_idx = g:vimwiki_current_idx - endif - let g:vimwiki_current_idx = a:wnum - 1 -endfunction -" }}} - -function! vimwiki#generate_links()"{{{ - let links = s:get_links('*'.VimwikiGet('ext')) - - " We don't want link to itself. - let cur_link = expand('%:t:r') - call filter(links, 'v:val != cur_link') - - if len(links) - call append(line('$'), '= Generated Links =') - endif - - call sort(links) - - for link in links - if s:is_wiki_word(link) - call append(line('$'), '- '.link) - else - call append(line('$'), '- [['.link.']]') - endif - endfor -endfunction " }}} - -function! vimwiki#goto(key) "{{{ - call s:edit_file(':e', - \ VimwikiGet('path'). - \ a:key. - \ VimwikiGet('ext')) -endfunction "}}} - -function! s:is_windows() "{{{ - return has("win32") || has("win64") || has("win95") || has("win16") -endfunction "}}} - -function! s:get_links(pat) "{{{ - " search all wiki files in 'path' and its subdirs. - let subdir = vimwiki#current_subdir() - - " if current wiki is temporary -- was added by an arbitrary wiki file then do - " not search wiki files in subdirectories. Or it would hang the system if - " wiki file was created in $HOME or C:/ dirs. - if VimwikiGet('temp') - let search_dirs = '' - else - let search_dirs = '**/' - endif - let globlinks = glob(VimwikiGet('path').subdir.search_dirs.a:pat) - - " remove extensions (and backup extensions too: .wiki~) - let globlinks = substitute(globlinks, '\'.VimwikiGet('ext').'\~\?', "", "g") - let links = split(globlinks, '\n') - - " remove paths - let rem_path = escape(expand(VimwikiGet('path')).subdir, '\') - call map(links, 'substitute(v:val, rem_path, "", "g")') - - " Remove trailing slashes. - call map(links, 'substitute(v:val, "[/\\\\]*$", "", "g")') - - return links -endfunction "}}} - -" Builtin cursor doesn't work right with unicode characters. -function! s:cursor(lnum, cnum) "{{{ - exe a:lnum - exe 'normal! 0'.a:cnum.'|' -endfunction "}}} - -function! s:filename(link) "{{{ - let result = vimwiki#safe_link(a:link) - if a:link =~ '|' - let result = vimwiki#safe_link(split(a:link, '|')[0]) - elseif a:link =~ '][' - let result = vimwiki#safe_link(split(a:link, '][')[0]) - endif - return result -endfunction -" }}} - -function! s:is_wiki_word(str) "{{{ - if a:str =~ g:vimwiki_rxWikiWord && a:str !~ '[[:space:]\\/]' - return 1 - endif - return 0 -endfunction -" }}} - -function! s:edit_file(command, filename) "{{{ - let fname = escape(a:filename, '% ') - call vimwiki#mkdir(fnamemodify(a:filename, ":p:h")) - execute a:command.' '.fname -endfunction -" }}} - -function! s:search_word(wikiRx, cmd) "{{{ - let match_line = search(a:wikiRx, 's'.a:cmd) - if match_line == 0 - echomsg "vimwiki: Wiki link not found." - endif -endfunction -" }}} - -function! s:get_word_at_cursor(wikiRX) "{{{ - let col = col('.') - 1 - let line = getline('.') - let ebeg = -1 - let cont = match(line, a:wikiRX, 0) - while (ebeg >= 0 || (0 <= cont) && (cont <= col)) - let contn = matchend(line, a:wikiRX, cont) - if (cont <= col) && (col < contn) - let ebeg = match(line, a:wikiRX, cont) - let elen = contn - ebeg - break - else - let cont = match(line, a:wikiRX, contn) - endif - endwh - if ebeg >= 0 - return strpart(line, ebeg, elen) - else - return "" - endif -endf "}}} - -function! s:strip_word(word) "{{{ - let result = a:word - if strpart(a:word, 0, 2) == "[[" - " get rid of [[ and ]] - let w = strpart(a:word, 2, strlen(a:word)-4) - - if w =~ '|' - " we want "link" from [[link|link desc]] - let w = split(w, "|")[0] - elseif w =~ '][' - " we want "link" from [[link][link desc]] - let w = split(w, "][")[0] - endif - - let result = vimwiki#safe_link(w) - endif - return result -endfunction -" }}} - -function! vimwiki#is_non_wiki_link(lnk) "{{{ - let exts = '.\+\.\%('. - \ join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). - \ '\)$' - if a:lnk =~ exts - return 1 - endif - return 0 -endfunction "}}} - -function! vimwiki#is_link_to_dir(link) "{{{ - " Check if link is to a directory. - " It should be ended with \ or /. - if a:link =~ '.\+[/\\]$' - return 1 - endif - return 0 -endfunction " }}} - -function! s:print_wiki_list() "{{{ - let idx = 0 - while idx < len(g:vimwiki_list) - if idx == g:vimwiki_current_idx - let sep = ' * ' - echohl PmenuSel - else - let sep = ' ' - echohl None - endif - echo (idx + 1).sep.VimwikiGet('path', idx) - let idx += 1 - endwhile - echohl None -endfunction -" }}} - -function! s:update_wiki_link(fname, old, new) " {{{ - echo "Updating links in ".a:fname - let has_updates = 0 - let dest = [] - for line in readfile(a:fname) - if !has_updates && match(line, a:old) != -1 - let has_updates = 1 - endif - call add(dest, substitute(line, a:old, escape(a:new, "&"), "g")) - endfor - " add exception handling... - if has_updates - call rename(a:fname, a:fname.'#vimwiki_upd#') - call writefile(dest, a:fname) - call delete(a:fname.'#vimwiki_upd#') - endif -endfunction -" }}} - -function! s:update_wiki_links_dir(dir, old_fname, new_fname) " {{{ - let old_fname = substitute(a:old_fname, '[/\\]', '[/\\\\]', 'g') - let new_fname = a:new_fname - let old_fname_r = old_fname - let new_fname_r = new_fname - - if !s:is_wiki_word(new_fname) && s:is_wiki_word(old_fname) - let new_fname_r = '[['.new_fname.']]' - endif - - if !s:is_wiki_word(old_fname) - let old_fname_r = '\[\[\zs'.vimwiki#unsafe_link(old_fname). - \ '\ze\%(|.*\)\?\%(\]\[.*\)\?\]\]' - else - let old_fname_r = '\<'.old_fname.'\>' - endif - - let files = split(glob(VimwikiGet('path').a:dir.'*'.VimwikiGet('ext')), '\n') - for fname in files - call s:update_wiki_link(fname, old_fname_r, new_fname_r) - endfor -endfunction -" }}} - -function! s:tail_name(fname) "{{{ - let result = substitute(a:fname, ":", "__colon__", "g") - let result = fnamemodify(result, ":t:r") - let result = substitute(result, "__colon__", ":", "g") - return result -endfunction "}}} - -function! s:update_wiki_links(old_fname, new_fname) " {{{ - let old_fname = s:tail_name(a:old_fname) - let new_fname = s:tail_name(a:new_fname) - - let subdirs = split(a:old_fname, '[/\\]')[: -2] - - " TODO: Use Dictionary here... - let dirs_keys = [''] - let dirs_vals = [''] - if len(subdirs) > 0 - let dirs_keys = [''] - let dirs_vals = [join(subdirs, '/').'/'] - let idx = 0 - while idx < len(subdirs) - 1 - call add(dirs_keys, join(subdirs[: idx], '/').'/') - call add(dirs_vals, join(subdirs[idx+1 :], '/').'/') - let idx = idx + 1 - endwhile - call add(dirs_keys,join(subdirs, '/').'/') - call add(dirs_vals, '') - endif - - let idx = 0 - while idx < len(dirs_keys) - let dir = dirs_keys[idx] - let new_dir = dirs_vals[idx] - call s:update_wiki_links_dir(dir, - \ new_dir.old_fname, new_dir.new_fname) - let idx = idx + 1 - endwhile -endfunction " }}} - -function! s:get_wiki_buffers() "{{{ - let blist = [] - let bcount = 1 - while bcount<=bufnr("$") - if bufexists(bcount) - let bname = fnamemodify(bufname(bcount), ":p") - if bname =~ VimwikiGet('ext')."$" - let bitem = [bname, getbufvar(bname, "vimwiki_prev_link")] - call add(blist, bitem) - endif - endif - let bcount = bcount + 1 - endwhile - return blist -endfunction " }}} - -function! s:open_wiki_buffer(item) "{{{ - call s:edit_file('e', a:item[0]) - if !empty(a:item[1]) - call setbufvar(a:item[0], "vimwiki_prev_link", a:item[1]) - endif -endfunction " }}} - -" }}} - -" SYNTAX highlight {{{ -function! vimwiki#highlight_links() "{{{ - try - syntax clear VimwikiNoExistsLink - syntax clear VimwikiNoExistsLinkT - syntax clear VimwikiLink - syntax clear VimwikiLinkT - catch - endtry - - "" use max highlighting - could be quite slow if there are too many wikifiles - if VimwikiGet('maxhi') - " Every WikiWord is nonexistent - if g:vimwiki_camel_case - execute 'syntax match VimwikiNoExistsLink /'.g:vimwiki_rxWikiWord.'/ display' - execute 'syntax match VimwikiNoExistsLinkT /'.g:vimwiki_rxWikiWord.'/ display contained' - endif - execute 'syntax match VimwikiNoExistsLink /'.g:vimwiki_rxWikiLink1.'/ display contains=VimwikiNoLinkChar' - execute 'syntax match VimwikiNoExistsLink /'.g:vimwiki_rxWikiLink2.'/ display contains=VimwikiNoLinkChar' - - execute 'syntax match VimwikiNoExistsLinkT /'.g:vimwiki_rxWikiLink1.'/ display contained' - execute 'syntax match VimwikiNoExistsLinkT /'.g:vimwiki_rxWikiLink2.'/ display contained' - - " till we find them in vimwiki's path - call s:highlight_existed_links() - else - " A WikiWord (unqualifiedWikiName) - execute 'syntax match VimwikiLink /\<'.g:vimwiki_rxWikiWord.'\>/' - " A [[bracketed wiki word]] - execute 'syntax match VimwikiLink /'.g:vimwiki_rxWikiLink1.'/ display contains=VimwikiLinkChar' - execute 'syntax match VimwikiLink /'.g:vimwiki_rxWikiLink2.'/ display contains=VimwikiLinkChar' - - execute 'syntax match VimwikiLinkT /\<'.g:vimwiki_rxWikiWord.'\>/ display contained' - execute 'syntax match VimwikiLinkT /'.g:vimwiki_rxWikiLink1.'/ display contained' - execute 'syntax match VimwikiLinkT /'.g:vimwiki_rxWikiLink2.'/ display contained' - endif - - execute 'syntax match VimwikiLink `'.g:vimwiki_rxWeblink.'` display contains=@NoSpell' -endfunction "}}} - -function! s:highlight_existed_links() "{{{ - let links = s:get_links('*'.VimwikiGet('ext')) - - " Links with subdirs should be highlighted for linux and windows separators - " Change \ or / to [/\\] - let os_p = '[/\\]' - let os_p2 = escape(os_p, '\') - call map(links, 'substitute(v:val, os_p, os_p2, "g")') - - for link in links - if g:vimwiki_camel_case && - \ link =~ g:vimwiki_rxWikiWord && !vimwiki#is_non_wiki_link(link) - execute 'syntax match VimwikiLink /!\@/ display' - endif - execute 'syntax match VimwikiLink /\[\['. - \ escape(vimwiki#unsafe_link(link), '~&$.*'). - \ '\%(|\+.\{-}\)\{-}\]\]/ display contains=VimwikiLinkChar' - execute 'syntax match VimwikiLink /\[\['. - \ escape(vimwiki#unsafe_link(link), '~&$.*'). - \ '\]\[.\{-1,}\]\]/ display contains=VimwikiLinkChar' - - execute 'syntax match VimwikiLinkT /\[\['. - \ escape(vimwiki#unsafe_link(link), '~&$.*'). - \ '\%(|\+.\{-}\)\{-}\]\]/ display contained' - execute 'syntax match VimwikiLinkT /\[\['. - \ escape(vimwiki#unsafe_link(link), '~&$.*'). - \ '\]\[.\{-1,}\]\]/ display contained' - endfor - execute 'syntax match VimwikiLink /\[\[.\+\.\%(jpg\|png\|gif\)\%(|\+.*\)*\]\]/ display contains=VimwikiLinkChar' - execute 'syntax match VimwikiLink /\[\[.\+\.\%(jpg\|png\|gif\)\]\[.\+\]\]/ display contains=VimwikiLinkChar' - - execute 'syntax match VimwikiLinkT /\[\[.\+\.\%(jpg\|png\|gif\)\%(|\+.*\)*\]\]/ display contained' - execute 'syntax match VimwikiLinkT /\[\[.\+\.\%(jpg\|png\|gif\)\]\[.\+\]\]/ display contained' - - " Issue 103: Always highlight links to non-wiki files as existed. - execute 'syntax match VimwikiLink /\[\[.\+\.\%('. - \join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). - \'\)\%(|\+.*\)*\]\]/ display contains=VimwikiLinkChar' - execute 'syntax match VimwikiLink /\[\[.\+\.\%('. - \join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). - \'\)\]\[.\+\]\]/ display contains=VimwikiLinkChar' - - execute 'syntax match VimwikiLinkT /\[\[.\+\.\%('. - \join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). - \'\)\%(|\+.*\)*\]\]/ display contained' - execute 'syntax match VimwikiLinkT /\[\[.\+\.\%('. - \join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). - \'\)\]\[.\+\]\]/ display contained' - - " highlight dirs - let dirs = s:get_links('*/') - call map(dirs, 'substitute(v:val, os_p, os_p2, "g")') - for dir in dirs - execute 'syntax match VimwikiLink /\[\['. - \ escape(vimwiki#unsafe_link(dir), '~&$.*'). - \ '[/\\]*\%(|\+.*\)*\]\]/ display contains=VimwikiLinkChar' - execute 'syntax match VimwikiLink /\[\['. - \ escape(vimwiki#unsafe_link(dir), '~&$.*'). - \ '[/\\]*\%(\]\[\+.*\)*\]\]/ display contains=VimwikiLinkChar' - - execute 'syntax match VimwikiLinkT /\[\['. - \ escape(vimwiki#unsafe_link(dir), '~&$.*'). - \ '[/\\]*\%(|\+.*\)*\]\]/ display contained' - execute 'syntax match VimwikiLinkT /\[\['. - \ escape(vimwiki#unsafe_link(dir), '~&$.*'). - \ '[/\\]*\%(\]\[\+.*\)*\]\]/ display contained' - endfor -endfunction "}}} - -function! vimwiki#setup_colors() "{{{ - - function! s:set_visible_ignore_color() "{{{ - if !exists("g:colors_name") || g:colors_name == 'default' - if &background == 'light' - hi VimwikiIgnore guifg=#d0d0d0 - else - hi VimwikiIgnore guifg=#505050 - endif - else - hi link VimwikiIgnore Normal - endif - endfunction "}}} - - let hlfg_ignore = vimwiki#get_hl_param('Ignore', 'guifg') - let hlbg_normal = vimwiki#get_hl_param('Normal', 'guibg') - if hlfg_ignore == 'bg' || hlfg_ignore == hlbg_normal - call s:set_visible_ignore_color() - else - hi link VimwikiIgnore Ignore - endif - - if g:vimwiki_hl_headers == 0 - hi def link VimwikiHeader Title - return - endif - - if &background == 'light' - hi def VimwikiHeader1 guibg=bg guifg=#aa5858 gui=bold ctermfg=DarkRed - hi def VimwikiHeader2 guibg=bg guifg=#507030 gui=bold ctermfg=DarkGreen - hi def VimwikiHeader3 guibg=bg guifg=#1030a0 gui=bold ctermfg=DarkBlue - hi def VimwikiHeader4 guibg=bg guifg=#103040 gui=bold ctermfg=Black - hi def VimwikiHeader5 guibg=bg guifg=#505050 gui=bold ctermfg=Black - hi def VimwikiHeader6 guibg=bg guifg=#636363 gui=bold ctermfg=Black - else - hi def VimwikiHeader1 guibg=bg guifg=#e08090 gui=bold ctermfg=Red - hi def VimwikiHeader2 guibg=bg guifg=#80e090 gui=bold ctermfg=Green - hi def VimwikiHeader3 guibg=bg guifg=#6090e0 gui=bold ctermfg=Blue - hi def VimwikiHeader4 guibg=bg guifg=#c0c0f0 gui=bold ctermfg=White - hi def VimwikiHeader5 guibg=bg guifg=#e0e0f0 gui=bold ctermfg=White - hi def VimwikiHeader6 guibg=bg guifg=#f0f0f0 gui=bold ctermfg=White - endif -endfunction "}}} - -function vimwiki#get_hl_param(hgroup, hparam) "{{{ - redir => hlstatus - try - exe "silent hi ".a:hgroup - catch /E411/ - endtry - redir END - return matchstr(hlstatus, a:hparam.'\s*=\s*\zs\S\+') -endfunction "}}} - -function! vimwiki#hl_exists(hl) "{{{ - if !hlexists(a:hl) - return 0 - endif - redir => hlstatus - exe "silent hi" a:hl - redir END - return (hlstatus !~ "cleared") -endfunction -"}}} - -function! vimwiki#nested_syntax(filetype, start, end, textSnipHl) abort "{{{ -" From http://vim.wikia.com/wiki/VimTip857 - let ft=toupper(a:filetype) - let group='textGroup'.ft - if exists('b:current_syntax') - let s:current_syntax=b:current_syntax - " Remove current syntax definition, as some syntax files (e.g. cpp.vim) - " do nothing if b:current_syntax is defined. - unlet b:current_syntax - endif - - " Some syntax files set up iskeyword which might scratch vimwiki a bit. - " Let us save and restore it later. - " let b:skip_set_iskeyword = 1 - let is_keyword = &iskeyword - - execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim' - try - execute 'syntax include @'.group.' after/syntax/'.a:filetype.'.vim' - catch - endtry - - let &iskeyword = is_keyword - - if exists('s:current_syntax') - let b:current_syntax=s:current_syntax - else - unlet b:current_syntax - endif - execute 'syntax region textSnip'.ft. - \ ' matchgroup='.a:textSnipHl. - \ ' start="'.a:start.'" end="'.a:end.'"'. - \ ' contains=@'.group.' keepend' - - " A workaround to Issue 115: Nested Perl syntax highlighting differs from - " regular one. - " Perl syntax file has perlFunctionName which is usually has no effect due to - " 'contained' flag. Now we have 'syntax include' that makes all the groups - " included as 'contained' into specific group. - " Here perlFunctionName (with quite an angry regexp "\h\w*[^:]") clashes with - " the rest syntax rules as now it has effect being really 'contained'. - " Clear it! - if ft =~ 'perl' - syntax clear perlFunctionName - endif -endfunction "}}} - -"}}} - -" WIKI functions {{{ -function! vimwiki#find_next_link() "{{{ - call s:search_word(g:vimwiki_rxWikiLink.'\|'.g:vimwiki_rxWeblink, '') -endfunction -" }}} - -function! vimwiki#find_prev_link() "{{{ - call s:search_word(g:vimwiki_rxWikiLink.'\|'.g:vimwiki_rxWeblink, 'b') -endfunction -" }}} - -function! vimwiki#follow_link(split) "{{{ - if a:split == "split" - let cmd = ":split " - elseif a:split == "vsplit" - let cmd = ":vsplit " - else - let cmd = ":e " - endif - - let link = s:strip_word(s:get_word_at_cursor(g:vimwiki_rxWikiLink)) - if link == "" - let weblink = s:strip_word(s:get_word_at_cursor(g:vimwiki_rxWeblink)) - if weblink != "" - call VimwikiWeblinkHandler(escape(weblink, '#')) - else - execute "normal! \n" - endif - return - endif - - let subdir = vimwiki#current_subdir() - call vimwiki#open_link(cmd, subdir.link) - -endfunction " }}} - -function! vimwiki#go_back_link() "{{{ - if exists("b:vimwiki_prev_link") - " go back to saved WikiWord - let prev_word = b:vimwiki_prev_link - execute ":e ".substitute(prev_word[0], '\s', '\\\0', 'g') - call setpos('.', prev_word[1]) - endif -endfunction " }}} - -function! vimwiki#goto_index(index) "{{{ - call vimwiki#select(a:index) - call vimwiki#mkdir(VimwikiGet('path')) - - try - execute ':e '.fnameescape( - \ VimwikiGet('path').VimwikiGet('index').VimwikiGet('ext')) - catch /E37/ " catch 'No write since last change' error - execute ':split '. - \ VimwikiGet('path'). - \ VimwikiGet('index'). - \ VimwikiGet('ext') - catch /E325/ " catch 'ATTENTION' error (:h E325) - endtry -endfunction "}}} - -function! vimwiki#delete_link() "{{{ - "" file system funcs - "" Delete WikiWord you are in from filesystem - let val = input('Delete ['.expand('%').'] (y/n)? ', "") - if val != 'y' - return - endif - let fname = expand('%:p') - try - call delete(fname) - catch /.*/ - echomsg 'vimwiki: Cannot delete "'.expand('%:t:r').'"!' - return - endtry - execute "bdelete! ".escape(fname, " ") - - " reread buffer => deleted WikiWord should appear as non-existent - if expand('%:p') != "" - execute "e" - endif -endfunction "}}} - -function! vimwiki#rename_link() "{{{ - "" Rename WikiWord, update all links to renamed WikiWord - let subdir = vimwiki#current_subdir() - let old_fname = subdir.expand('%:t') - - " there is no file (new one maybe) - if glob(expand('%:p')) == '' - echomsg 'vimwiki: Cannot rename "'.expand('%:p'). - \'". It does not exist! (New file? Save it before renaming.)' - return - endif - - let val = input('Rename "'.expand('%:t:r').'" (y/n)? ', "") - if val!='y' - return - endif - - let new_link = input('Enter new name: ', "") - - if new_link =~ '[/\\]' - " It is actually doable but I do not have free time to do it. - echomsg 'vimwiki: Cannot rename to a filename with path!' - return - endif - - " check new_fname - it should be 'good', not empty - if substitute(new_link, '\s', '', 'g') == '' - echomsg 'vimwiki: Cannot rename to an empty filename!' - return - endif - if vimwiki#is_non_wiki_link(new_link) - echomsg 'vimwiki: Cannot rename to a filename with extension (ie .txt .html)!' - return - endif - - let new_link = subdir.new_link - let new_link = s:strip_word(new_link) - let new_fname = VimwikiGet('path').s:filename(new_link).VimwikiGet('ext') - - " do not rename if word with such name exists - let fname = glob(new_fname) - if fname != '' - echomsg 'vimwiki: Cannot rename to "'.new_fname. - \ '". File with that name exist!' - return - endif - " rename WikiWord file - try - echomsg "Renaming ".VimwikiGet('path').old_fname." to ".new_fname - let res = rename(expand('%:p'), expand(new_fname)) - if res != 0 - throw "Cannot rename!" - end - catch /.*/ - echomsg 'vimwiki: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"' - return - endtry - - let &buftype="nofile" - - let cur_buffer = [expand('%:p'), - \getbufvar(expand('%:p'), "vimwiki_prev_link")] - - let blist = s:get_wiki_buffers() - - " save wiki buffers - for bitem in blist - execute ':b '.escape(bitem[0], ' ') - execute ':update' - endfor - - execute ':b '.escape(cur_buffer[0], ' ') - - " remove wiki buffers - for bitem in blist - execute 'bwipeout '.escape(bitem[0], ' ') - endfor - - let setting_more = &more - setlocal nomore - - " update links - call s:update_wiki_links(old_fname, new_link) - - " restore wiki buffers - for bitem in blist - if bitem[0] != cur_buffer[0] - call s:open_wiki_buffer(bitem) - endif - endfor - - call s:open_wiki_buffer([new_fname, - \ cur_buffer[1]]) - " execute 'bwipeout '.escape(cur_buffer[0], ' ') - - echomsg old_fname." is renamed to ".new_fname - - let &more = setting_more -endfunction " }}} - -function! vimwiki#ui_select()"{{{ - call s:print_wiki_list() - let idx = input("Select Wiki (specify number): ") - if idx == "" - return - endif - call vimwiki#goto_index(idx) -endfunction -"}}} - -" }}} - -" TEXT OBJECTS functions {{{ - -function! vimwiki#TO_header(inner, visual) "{{{ - if !search('^\(=\+\).\+\1\s*$', 'bcW') - return - endif - - let sel_start = line("'<") - let sel_end = line("'>") - let block_start = line(".") - let advance = 0 - - let level = vimwiki#count_first_sym(getline('.')) - - let is_header_selected = sel_start == block_start - \ && sel_start != sel_end - - if a:visual && is_header_selected - if level > 1 - let level -= 1 - call search('^\(=\{'.level.'\}\).\+\1\s*$', 'bcW') - else - let advance = 1 - endif - endif - - normal! V - - if a:visual && is_header_selected - call cursor(sel_end + advance, 0) - endif - - if search('^\(=\{1,'.level.'}\).\+\1\s*$', 'W') - call cursor(line('.') - 1, 0) - else - call cursor(line('$'), 0) - endif - - if a:inner && getline(line('.')) =~ '^\s*$' - let lnum = prevnonblank(line('.') - 1) - call cursor(lnum, 0) - endif -endfunction -"}}} - -function! vimwiki#TO_table_cell(inner, visual) "{{{ - if col('.') == col('$')-1 - return - endif - - if a:visual - normal! `> - let sel_end = getpos('.') - normal! `< - let sel_start = getpos('.') - - let firsttime = sel_start == sel_end - - if firsttime - if !search('|\|\(-+-\)', 'cb', line('.')) - return - endif - if getline('.')[virtcol('.')] == '+' - normal! l - endif - if a:inner - normal! 2l - endif - let sel_start = getpos('.') - endif - - normal! `> - call search('|\|\(-+-\)', '', line('.')) - if getline('.')[virtcol('.')] == '+' - normal! l - endif - if a:inner - if firsttime || abs(sel_end[2] - getpos('.')[2]) != 2 - normal! 2h - endif - endif - let sel_end = getpos('.') - - call setpos('.', sel_start) - exe "normal! \" - call setpos('.', sel_end) - - " XXX: WORKAROUND. - " if blockwise selection is ended at | character then pressing j to extend - " selection furhter fails. But if we shake the cursor left and right then - " it works. - normal! hl - else - if !search('|\|\(-+-\)', 'cb', line('.')) - return - endif - if a:inner - normal! 2l - endif - normal! v - call search('|\|\(-+-\)', '', line('.')) - if !a:inner && getline('.')[virtcol('.')-1] == '|' - normal! h - elseif a:inner - normal! 2h - endif - endif -endfunction "}}} - -function! vimwiki#TO_table_col(inner, visual) "{{{ - let t_rows = vimwiki_tbl#get_rows(line('.')) - if empty(t_rows) - return - endif - - " TODO: refactor it! - if a:visual - normal! `> - let sel_end = getpos('.') - normal! `< - let sel_start = getpos('.') - - let firsttime = sel_start == sel_end - - if firsttime - " place cursor to the top row of the table - call s:cursor(t_rows[0][0], virtcol('.')) - " do not accept the match at cursor position if cursor is next to column - " separator of the table separator (^ is a cursor): - " |-----^-+-------| - " | bla | bla | - " |-------+-------| - " or it will select wrong column. - if strpart(getline('.'), virtcol('.')-1) =~ '^-+' - let s_flag = 'b' - else - let s_flag = 'cb' - endif - " search the column separator backwards - if !search('|\|\(-+-\)', s_flag, line('.')) - return - endif - " -+- column separator is matched --> move cursor to the + sign - if getline('.')[virtcol('.')] == '+' - normal! l - endif - " inner selection --> reduce selection - if a:inner - normal! 2l - endif - let sel_start = getpos('.') - endif - - normal! `> - if !firsttime && getline('.')[virtcol('.')] == '|' - normal! l - elseif a:inner && getline('.')[virtcol('.')+1] =~ '[|+]' - normal! 2l - endif - " search for the next column separator - call search('|\|\(-+-\)', '', line('.')) - " Outer selection selects a column without border on the right. So we move - " our cursor left if the previous search finds | border, not -+-. - if getline('.')[virtcol('.')] != '+' - normal! h - endif - if a:inner - " reduce selection a bit more if inner. - normal! h - endif - " expand selection to the bottom line of the table - call s:cursor(t_rows[-1][0], virtcol('.')) - let sel_end = getpos('.') - - call setpos('.', sel_start) - exe "normal! \" - call setpos('.', sel_end) - - else - " place cursor to the top row of the table - call s:cursor(t_rows[0][0], virtcol('.')) - " do not accept the match at cursor position if cursor is next to column - " separator of the table separator (^ is a cursor): - " |-----^-+-------| - " | bla | bla | - " |-------+-------| - " or it will select wrong column. - if strpart(getline('.'), virtcol('.')-1) =~ '^-+' - let s_flag = 'b' - else - let s_flag = 'cb' - endif - " search the column separator backwards - if !search('|\|\(-+-\)', s_flag, line('.')) - return - endif - " -+- column separator is matched --> move cursor to the + sign - if getline('.')[virtcol('.')] == '+' - normal! l - endif - " inner selection --> reduce selection - if a:inner - normal! 2l - endif - - exe "normal! \" - - " search for the next column separator - call search('|\|\(-+-\)', '', line('.')) - " Outer selection selects a column without border on the right. So we move - " our cursor left if the previous search finds | border, not -+-. - if getline('.')[virtcol('.')] != '+' - normal! h - endif - " reduce selection a bit more if inner. - if a:inner - normal! h - endif - " expand selection to the bottom line of the table - call s:cursor(t_rows[-1][0], virtcol('.')) - endif -endfunction "}}} - -function! vimwiki#count_first_sym(line) "{{{ - let first_sym = matchstr(a:line, '\S') - return len(matchstr(a:line, first_sym.'\+')) -endfunction "}}} - -function! vimwiki#AddHeaderLevel() "{{{ - let lnum = line('.') - let line = getline(lnum) - - if line =~ '^\s*$' - return - endif - - if line =~ '^\s*\(=\+\).\+\1\s*$' - let level = vimwiki#count_first_sym(line) - if level < 6 - let line = substitute(line, '\(=\+\).\+\1', '=&=', '') - call setline(lnum, line) - endif - else - let line = substitute(line, '^\s*', '&= ', '') - let line = substitute(line, '\s*$', ' =&', '') - call setline(lnum, line) - endif -endfunction -"}}} - -function! vimwiki#RemoveHeaderLevel() "{{{ - let lnum = line('.') - let line = getline(lnum) - - if line =~ '^\s*$' - return - endif - - if line =~ '^\s*\(=\+\).\+\1\s*$' - let level = vimwiki#count_first_sym(line) - let old = repeat('=', level) - let new = repeat('=', level - 1) - - let chomp = line =~ '=\s' - - let line = substitute(line, old, new, 'g') - - if level == 1 && chomp - let line = substitute(line, '^\s', '', 'g') - let line = substitute(line, '\s$', '', 'g') - endif - call setline(lnum, line) - endif -endfunction -" }}} - -" }}} diff --git a/dot.vim/autoload/vimwiki_diary.vim b/dot.vim/autoload/vimwiki_diary.vim deleted file mode 100644 index 31c6447..0000000 --- a/dot.vim/autoload/vimwiki_diary.vim +++ /dev/null @@ -1,281 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki autoload plugin file -" Desc: Handle diary notes -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" Load only once {{{ -if exists("g:loaded_vimwiki_diary_auto") || &cp - finish -endif -let g:loaded_vimwiki_diary_auto = 1 -"}}} - -function! s:prefix_zero(num) "{{{ - if a:num < 10 - return '0'.a:num - endif - return a:num -endfunction "}}} - -function! s:desc(d1, d2) "{{{ - return a:d1 == a:d2 ? 0 : a:d1 < a:d2 ? 1 : -1 -endfunction "}}} - -function! s:get_date_link(fmt) "{{{ - return strftime(a:fmt) -endfunction "}}} - -function! s:link_exists(lines, link) "{{{ - let link_exists = 0 - for line in a:lines - if line =~ escape(a:link, '[]\') - let link_exists = 1 - break - endif - endfor - return link_exists -endfunction "}}} - -function! s:diary_path() "{{{ - return VimwikiGet('path').VimwikiGet('diary_rel_path') -endfunction "}}} - -function! s:diary_index() "{{{ - return s:diary_path().VimwikiGet('diary_index').VimwikiGet('ext') -endfunction "}}} - -function! s:get_diary_range(lines, header) "{{{ - let rx = '\[\[\d\{4}-\d\d-\d\d\]\]' - let idx = 0 - let ln_start = -1 - let ln_end = -1 - for line in a:lines - if ln_start != -1 - if line =~ '^\s*\(=\)\+.*\1\s*$' || (line !~ rx && line !~ '^\s*$') - break - endif - endif - if line =~ '^\s*\(=\)\+\s*'.a:header.'\s*\1\s*$' - let ln_start = idx + 1 - endif - let idx += 1 - endfor - - let ln_end = idx - return [ln_start, ln_end] -endfunction "}}} - -function! s:diary_date_link() "{{{ - return s:get_date_link(VimwikiGet('diary_link_fmt')) -endfunction "}}} - -function! s:get_file_contents(file_name) "{{{ - let lines = [] - let bufnr = bufnr(expand(a:file_name)) - if bufnr != -1 - let lines = getbufline(bufnr, 1, '$') - else - try - let lines = readfile(expand(a:file_name)) - catch - endtry - endif - return [lines, bufnr] -endfunction "}}} - -function! s:get_links() "{{{ - let rx = '\d\{4}-\d\d-\d\d' - let s_links = glob(VimwikiGet('path').VimwikiGet('diary_rel_path'). - \ '*'.VimwikiGet('ext')) - - let s_links = substitute(s_links, '\'.VimwikiGet('ext'), "", "g") - let links = split(s_links, '\n') - - " remove backup files (.wiki~) - call filter(links, 'v:val !~ ''.*\~$''') - - " remove paths - call map(links, 'fnamemodify(v:val, ":t")') - - call filter(links, 'v:val =~ "'.escape(rx, '\').'"') - return links -endfunction "}}} - -function! s:get_position_links(link) "{{{ - let idx = -1 - let links = [] - if a:link =~ '\d\{4}-\d\d-\d\d' - let links = s:get_links() - " include 'today' into links - if index(links, s:diary_date_link()) == -1 - call add(links, s:diary_date_link()) - endif - call sort(links) - let idx = index(links, a:link) - endif - return [idx, links] -endfunction "}}} - -function! s:format_links(links) "{{{ - let lines = [] - let line = '| ' - let idx = 0 - let trigger = 0 - while idx < len(a:links) - if idx/VimwikiGet('diary_link_count') > trigger - let trigger = idx/VimwikiGet('diary_link_count') - call add(lines, substitute(line, '\s\+$', '', '')) - let line = '| ' - endif - let line .= a:links[idx].' | ' - let idx += 1 - endwhile - call add(lines, substitute(line, '\s\+$', '', '')) - call extend(lines, ['']) - - return lines -endfunction "}}} - -function! s:add_link(page, header, link) "{{{ - let [lines, bufnr] = s:get_file_contents(a:page) - - let [ln_start, ln_end] = s:get_diary_range(lines, a:header) - - let link = '[['.a:link.']]' - - let link_exists = s:link_exists(lines[ln_start : ln_end], link) - - if !link_exists - - if ln_start == -1 - call insert(lines, '= '.a:header.' =') - let ln_start = 1 - let ln_end = 1 - endif - - " removing 'old' links - let idx = ln_end - ln_start - while idx > 0 - call remove(lines, ln_start) - let idx -= 1 - endwhile - - " get all diary links from filesystem - let links = s:get_links() - call map(links, '"[[".v:val."]]"') - - " add current link - if index(links, link) == -1 - call add(links, link) - endif - - let links = sort(links, 's:desc') - call extend(lines, s:format_links(links), ln_start) - - if bufnr != -1 - exe 'buffer '.bufnr - if !&readonly - 1,$delete _ - call append(1, lines) - 1,1delete _ - endif - else - call writefile(lines, expand(a:page)) - endif - endif -endfunction "}}} - -function! s:make_date_link(...) "{{{ - if a:0 - let link = a:1 - else - let link = s:diary_date_link() - endif - let header = VimwikiGet('diary_header') - call s:add_link(s:diary_index(), header, link) - return VimwikiGet('diary_rel_path').link -endfunction "}}} - -function! vimwiki_diary#make_note(index, ...) "{{{ - call vimwiki#select(a:index) - call vimwiki#mkdir(VimwikiGet('path').VimwikiGet('diary_rel_path')) - if a:0 - let link = s:make_date_link(a:1) - else - let link = s:make_date_link() - endif - call vimwiki#open_link(':e ', link, s:diary_index()) -endfunction "}}} - -" Calendar.vim callback function. -function! vimwiki_diary#calendar_action(day, month, year, week, dir) "{{{ - let day = s:prefix_zero(a:day) - let month = s:prefix_zero(a:month) - - let link = a:year.'-'.month.'-'.day - if winnr('#') == 0 - if a:dir == 'V' - vsplit - else - split - endif - else - wincmd p - if !&hidden && &modified - new - endif - endif - - " Create diary note for a selected date in default wiki. - call vimwiki_diary#make_note(1, link) -endfunction "}}} - -" Calendar.vim sign function. -function vimwiki_diary#calendar_sign(day, month, year) "{{{ - let day = s:prefix_zero(a:day) - let month = s:prefix_zero(a:month) - let sfile = VimwikiGet('path').VimwikiGet('diary_rel_path'). - \ a:year.'-'.month.'-'.day.VimwikiGet('ext') - return filereadable(expand(sfile)) -endfunction "}}} - -function! vimwiki_diary#goto_next_day() "{{{ - let link = '' - let [idx, links] = s:get_position_links(expand('%:t:r')) - - if idx == (len(links) - 1) - return - endif - - if idx != -1 && idx < len(links) - 1 - let link = VimwikiGet('diary_rel_path').links[idx+1] - else - " goto today - let link = VimwikiGet('diary_rel_path').s:diary_date_link() - endif - - if len(link) - call vimwiki#open_link(':e ', link) - endif -endfunction "}}} - -function! vimwiki_diary#goto_prev_day() "{{{ - let link = '' - let [idx, links] = s:get_position_links(expand('%:t:r')) - - if idx == 0 - return - endif - - if idx > 0 - let link = VimwikiGet('diary_rel_path').links[idx-1] - else - " goto today - let link = VimwikiGet('diary_rel_path').s:diary_date_link() - endif - - if len(link) - call vimwiki#open_link(':e ', link) - endif -endfunction "}}} diff --git a/dot.vim/autoload/vimwiki_html.vim b/dot.vim/autoload/vimwiki_html.vim deleted file mode 100644 index e8750bf..0000000 --- a/dot.vim/autoload/vimwiki_html.vim +++ /dev/null @@ -1,1311 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki autoload plugin file -" Export to HTML -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" XXX: This file should be refactored! - -" Load only once {{{ -if exists("g:loaded_vimwiki_html_auto") || &cp - finish -endif -let g:loaded_vimwiki_html_auto = 1 -"}}} - -" SCRIPT VARS "{{{ -" Warn if html header or html footer do not exist only once. -let s:warn_html_header = 0 -let s:warn_html_footer = 0 -"}}} - -" UTILITY "{{{ -function! s:root_path(subdir) "{{{ - return repeat('../', len(split(a:subdir, '[/\\]'))) -endfunction "}}} - -function! s:syntax_supported() " {{{ - return VimwikiGet('syntax') == "default" -endfunction " }}} - -function! s:remove_blank_lines(lines) " {{{ - while !empty(a:lines) && a:lines[-1] =~ '^\s*$' - call remove(a:lines, -1) - endwhile -endfunction "}}} - -function! s:is_web_link(lnk) "{{{ - if a:lnk =~ '^\%(https://\|http://\|www.\|ftp://\|file://\)' - return 1 - endif - return 0 -endfunction "}}} - -function! s:is_img_link(lnk) "{{{ - if a:lnk =~ '\.\%(png\|jpg\|gif\|jpeg\)$' - return 1 - endif - return 0 -endfunction "}}} - -function! s:has_abs_path(fname) "{{{ - if a:fname =~ '\(^.:\)\|\(^/\)' - return 1 - endif - return 0 -endfunction "}}} - -function! s:create_default_CSS(path) " {{{ - let path = expand(a:path) - let css_full_name = path.VimwikiGet('css_name') - if glob(css_full_name) == "" - call vimwiki#mkdir(fnamemodify(css_full_name, ':p:h')) - let lines = [] - - call add(lines, 'body {font-family: Tahoma, sans-serif; margin: 1em 2em 1em 2em; font-size: 100%; line-height: 130%;}') - call add(lines, 'h1, h2, h3, h4, h5, h6 {font-family: Trebuchet MS, serif; margin-top: 1.5em; margin-bottom: 0.5em;}') - call add(lines, 'h1 {font-size: 2.0em; color: #a77070;}') - call add(lines, 'h2 {font-size: 1.6em; color: #779977;}') - call add(lines, 'h3 {font-size: 1.3em; color: #555577;}') - call add(lines, 'h4 {font-size: 1.2em; color: #222244;}') - call add(lines, 'h5 {font-size: 1.1em; color: #222244;}') - call add(lines, 'h6 {font-size: 1.0em; color: #222244;}') - call add(lines, 'p, pre, blockquote, table, ul, ol, dl {margin-top: 1em; margin-bottom: 1em;}') - call add(lines, 'ul ul, ul ol, ol ol, ol ul {margin-top: 0.5em; margin-bottom: 0.5em;}') - call add(lines, 'li {margin: 0.3em auto;}') - call add(lines, 'ul {margin-left: 2em; padding-left: 0.5em;}') - call add(lines, 'dt {font-weight: bold;}') - call add(lines, 'img {border: none;}') - call add(lines, 'pre {border-left: 1px solid #ccc; margin-left: 2em; padding-left: 0.5em;}') - call add(lines, 'blockquote {padding: 0.4em; background-color: #f6f5eb;}') - call add(lines, 'th, td {border: 1px solid #ccc; padding: 0.3em;}') - call add(lines, 'th {background-color: #f0f0f0;}') - call add(lines, 'hr {border: none; border-top: 1px solid #ccc; width: 100%;}') - call add(lines, 'del {text-decoration: line-through; color: #777777;}') - call add(lines, '.toc li {list-style-type: none;}') - call add(lines, '.todo {font-weight: bold; background-color: #f0ece8; color: #a03020;}') - call add(lines, '.justleft {text-align: left;}') - call add(lines, '.justright {text-align: right;}') - call add(lines, '.justcenter {text-align: center;}') - call add(lines, '.center {margin-left: auto; margin-right: auto;}') - - call writefile(lines, css_full_name) - echomsg "Default style.css is created." - endif -endfunction "}}} - -function! s:get_html_header(title, subdir, charset) "{{{ - let lines=[] - - if VimwikiGet('html_header') != "" && !s:warn_html_header - try - let lines = readfile(expand(VimwikiGet('html_header'))) - call map(lines, 'substitute(v:val, "%title%", "'. a:title .'", "g")') - call map(lines, 'substitute(v:val, "%root_path%", "'. - \ s:root_path(a:subdir) .'", "g")') - return lines - catch /E484/ - let s:warn_html_header = 1 - echomsg 'vimwiki: Header template '.VimwikiGet('html_header'). - \ ' does not exist!' - endtry - endif - - let css_name = expand(VimwikiGet('css_name')) - let css_name = substitute(css_name, '\', '/', 'g') - if !s:has_abs_path(css_name) - " Relative css file for deep links: [[dir1/dir2/dir3/filename]] - let css_name = s:root_path(a:subdir).css_name - endif - - " if no VimwikiGet('html_header') set up or error while reading template - " file -- use default header. - call add(lines, '') - call add(lines, '') - call add(lines, '') - call add(lines, ''.a:title.'') - call add(lines, '') - call add(lines, '') - call add(lines, '') - - return lines -endfunction "}}} - -function! s:get_html_footer() "{{{ - let lines=[] - - if VimwikiGet('html_footer') != "" && !s:warn_html_footer - try - let lines = readfile(expand(VimwikiGet('html_footer'))) - return lines - catch /E484/ - let s:warn_html_footer = 1 - echomsg 'vimwiki: Footer template '.VimwikiGet('html_footer'). - \ ' does not exist!' - endtry - endif - - " if no VimwikiGet('html_footer') set up or error while reading template - " file -- use default footer. - call add(lines, "") - call add(lines, '') - call add(lines, '') - - return lines -endfunction "}}} - -function! s:safe_html(line) "{{{ - "" htmlize symbols: < > & - - let line = substitute(a:line, '&', '\&', 'g') - - let tags = join(split(g:vimwiki_valid_html_tags, '\s*,\s*'), '\|') - let line = substitute(line,'<\%(/\?\%(' - \.tags.'\)\%(\s\{-1}\S\{-}\)\{-}/\?>\)\@!', - \'\<', 'g') - let line = substitute(line,'\%(', - \'\>', 'g') - return line -endfunction "}}} - -function! s:delete_html_files(path) "{{{ - let htmlfiles = split(glob(a:path.'**/*.html'), '\n') - for fname in htmlfiles - try - call delete(fname) - catch - echomsg 'vimwiki: Cannot delete '.fname - endtry - endfor -endfunction "}}} - -function! s:remove_comments(lines) "{{{ - let res = [] - let multiline_comment = 0 - - let idx = 0 - while idx < len(a:lines) - let line = a:lines[idx] - let idx += 1 - - if multiline_comment - let col = matchend(line, '-->',) - if col != -1 - let multiline_comment = 0 - let line = strpart(line, col) - else - continue - endif - endif - - if !multiline_comment && line =~ '' - let line = substitute(line, '', '', 'g') - if line =~ '^\s*$' - continue - endif - endif - - if !multiline_comment - let col = match(line, '" . (inline ? "" : "\n") . comment_indent . tmp - endif - let str .= tmp - let inner = current.value[1:-2] - if stridx(','.settings.html.inline_elements.',', ','.current.name.',') != -1 - let child_inline = 1 - else - let child_inline = 0 - endif - for child in current.child - let html = s:zen_toString(child, type, child_inline, filters) - if child.name == 'br' - let inner = substitute(inner, '\n\s*$', '', '') - endif - let inner .= html - endfor - if len(current.child) == 1 && current.child[0].name == '' - if stridx(','.settings.html.inline_elements.',', ','.current.name.',') == -1 - let str .= ">" . inner . "\n" - else - let str .= ">" . inner . "" - endif - elseif len(current.child) - if inline == 0 - if stridx(','.settings.html.inline_elements.',', ','.current.name.',') == -1 - let inner = substitute(inner, "\n", "\n" . indent, 'g') - let inner = substitute(inner, indent . "$", "", 'g') - let str .= ">\n" . indent . inner . "\n" - else - let str .= ">" . inner . "\n" - endif - else - let str .= ">" . inner . "" - endif - else - if inline == 0 - if stridx(','.settings.html.empty_elements.',', ','.current.name.',') != -1 - let str .= " />\n" - else - if stridx(','.settings.html.inline_elements.',', ','.current.name.',') == -1 && len(current.child) - let str .= ">\n" . inner . '${cursor}\n" - else - let str .= ">" . inner . '${cursor}\n" - endif - endif - else - if stridx(','.settings.html.empty_elements.',', ','.current.name.',') != -1 - let str .= " />" - else - let str .= ">" . inner . '${cursor}" - endif - endif - endif - if len(comment) > 0 - let str .= "" . (inline ? "" : "\n") . comment_indent - endif - return str -endfunction - -function! s:zen_toString(...) - let current = a:1 - if a:0 > 1 - let type = a:2 - else - let type = &ft - endif -" if !has_key(s:zen_settings, type) -" let type = 'html' -" endif - if len(type) == 0 | let type = 'html' | endif - if a:0 > 2 - let inline = a:3 - else - let inline = 0 - endif - if a:0 > 3 - if type(a:4) == 1 - let filters = split(a:4, '\s*,\s*') - else - let filters = a:4 - endif - else - let filters = ['html'] - endif - - if has_key(s:zen_settings, type) && has_key(s:zen_settings[type], 'indentation') - let indent = s:zen_settings[type].indentation - else - let indent = s:zen_settings.indentation - endif - let itemno = 0 - let str = '' - while itemno < current.multiplier - if len(current.name) - if exists('*g:zen_toString_'.type) - let str .= function('g:zen_toString_'.type)(s:zen_settings, current, type, inline, filters, itemno, indent) - elseif s:zen_useFilter(filters, 'haml') - let str .= s:zen_toString_haml(s:zen_settings, current, type, inline, filters, itemno, indent) - else - let str .= s:zen_toString_html(s:zen_settings, current, type, inline, filters, itemno, indent) - endif - else - let snippet = current.snippet - if len(current.snippet) == 0 - let snippets = s:zen_getResource(type, 'snippets', {}) - if !empty(snippets) && has_key(snippets, 'zensnippet') - let snippet = snippets['zensnippet'] - endif - endif - if len(snippet) > 0 - let tmp = substitute(snippet, '|', '${cursor}', 'g') - let tmp = substitute(tmp, '\${zenname}', current.name, 'g') - if type == 'css' && s:zen_useFilter(filters, 'fc') - let tmp = substitute(tmp, '^\([^:]\+\):\(.*\)$', '\1: \2', '') - endif - for attr in keys(current.attr) - let val = current.attr[attr] - let tmp = substitute(tmp, '\${' . attr . '}', val, 'g') - endfor - let str .= tmp - else - if len(current.name) - let str .= current.name - endif - if len(current.value) - let str .= current.value[1:-2] - endif - endif - let inner = '' - if len(current.child) - for n in current.child - let inner .= s:zen_toString(n, type, inline, filters) - endfor - let inner = substitute(inner, "\n", "\n" . indent, 'g') - endif - let str = substitute(str, '\${child}', inner, '') - endif - let itemno = itemno + 1 - endwhile - if s:zen_useFilter(filters, 'e') - let str = substitute(str, '&', '\&', 'g') - let str = substitute(str, '<', '\<', 'g') - let str = substitute(str, '>', '\>', 'g') - endif - return str -endfunction - -function! s:zen_getResource(type, name, default) - if !has_key(s:zen_settings, a:type) - return a:default - endif - let ret = a:default - - if has_key(s:zen_settings[a:type], a:name) - call s:zen_mergeConfig(ret, s:zen_settings[a:type][a:name]) - endif - - if has_key(s:zen_settings[a:type], 'extends') - let extends = s:zen_settings[a:type].extends - if type(extends) == 1 - let tmp = split(extends, '\s*,\s*') - unlet! extends - let extends = tmp - endif - for ext in extends - if has_key(s:zen_settings, ext) && has_key(s:zen_settings[ext], a:name) - call s:zen_mergeConfig(ret, s:zen_settings[ext][a:name]) - endif - endfor - endif - return ret -endfunction - -function! s:zen_getFileType() - let type = &ft - if type == 'xslt' | let type = 'xsl' | endif - if synIDattr(synID(line("."), col("."), 1), "name") =~ '^css' - let type = 'css' - endif - if synIDattr(synID(line("."), col("."), 1), "name") =~ '^html' - let type = 'html' - endif - if synIDattr(synID(line("."), col("."), 1), "name") =~ '^xml' - let type = 'xml' - endif - if synIDattr(synID(line("."), col("."), 1), "name") =~ '^javaScript' - let type = 'javascript' - endif - if len(type) == 0 | let type = 'html' | endif - return type -endfunction - -function! zencoding#expandAbbr(mode) range - let type = s:zen_getFileType() - let expand = '' - let filters = ['html'] - let line = '' - let part = '' - let rest = '' - - if has_key(s:zen_settings, type) && has_key(s:zen_settings[type], 'filters') - let filters = split(s:zen_settings[type].filters, '\s*,\s*') - endif - - if a:mode == 2 - let leader = substitute(input('Tag: ', ''), '^\s*\(.*\)\s*$', '\1', 'g') - if len(leader) == 0 - return - endif - let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$' - if leader =~ mx - let filters = split(matchstr(leader, mx)[1:], '\s*,\s*') - let leader = substitute(leader, mx, '', '') - endif - if leader =~ '\*' - let query = substitute(leader, '*', '*' . (a:lastline - a:firstline + 1), '') . '>{$line$}' - let items = s:zen_parseIntoTree(query, type).child - for item in items - let expand .= s:zen_toString(item, type, 0, filters) - endfor - let line = getline(a:firstline) - let part = substitute(line, '^\s*', '', '') - for n in range(a:firstline, a:lastline) - let lline = getline(n) - let lpart = substitute(lline, '^\s*', '', '') - let pos = stridx(expand, "$line$") - if pos != -1 - let expand = expand[:pos-1] . lpart . expand[pos+6:] - endif - endfor - else - let str = '' - if a:firstline != a:lastline - let line = getline(a:firstline) - let part = substitute(line, '^\s*', '', '') - for n in range(a:firstline, a:lastline) - if len(leader) > 0 - let str .= getline(n) . "\n" - else - let lpart = substitute(getline(n), '^\s*', '', '') - let str .= lpart . "\n" - endif - endfor - if len(leader) - let items = s:zen_parseIntoTree(leader, type).child - let items[0].value = "{\n".str."}" - else - let items = s:zen_parseIntoTree(leader, type).child - let items[0].value = "{".str."}" - endif - else - let str .= getline(a:firstline) - let items = s:zen_parseIntoTree(leader, type).child - let items[0].value = "{".str."}" - endif - for item in items - let expand .= s:zen_toString(item, type, 0, filters) - endfor - endif - silent! exe "normal! gvc" - else - let line = getline('.') - if col('.') < len(line) - let line = matchstr(line, '^\(.*\%'.col('.').'c.\)') - endif - if a:mode == 1 - let part = matchstr(line, '\([a-zA-Z0-9_\@:|]\+\)$') - else - let part = matchstr(line, '\(\S.*\)$') - endif - let rest = getline('.')[len(line):] - let str = part - let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$' - if str =~ mx - let filters = split(matchstr(str, mx)[1:], '\s*,\s*') - let str = substitute(str, mx, '', '') - endif - let items = s:zen_parseIntoTree(str, type).child - for item in items - let expand .= s:zen_toString(item, type, 0, filters) - endfor - endif - if len(expand) - if expand !~ '\${cursor}' - if a:mode == 2 | - let expand = '${cursor}' . expand - else - let expand .= '${cursor}' - endif - endif - let expand = substitute(expand, '${lang}', s:zen_settings.lang, 'g') - let expand = substitute(expand, '${charset}', s:zen_settings.charset, 'g') - let expand = substitute(expand, '\${cursor}', '$cursor$', '') - let expand = substitute(expand, '\${cursor}', '', 'g') - if has_key(s:zen_settings, 'timezone') && len(s:zen_settings.timezone) - let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S") . s:zen_settings.timezone, 'g') - else - " TODO: on windows, %z/%Z is 'Tokyo(Standard)' - let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S %z"), 'g') - endif - if line[:-len(part)-1] =~ '^\s\+$' - let indent = line[:-len(part)-1] - else - let indent = '' - endif - let expand = substitute(expand, '\n\s*$', '', 'g') - let expand = line[:-len(part)-1] . substitute(expand, "\n", "\n" . indent, 'g') . rest - let lines = split(expand, '\n') - call setline(line('.'), lines[0]) - if len(lines) > 1 - call append(line('.'), lines[1:]) - endif - endif - silent! exe "normal! ".len(part)."h" - if search('\$cursor\$', 'e') - let oldselection = &selection - let &selection = 'inclusive' - silent! exe "normal! v7h\"_s" - let &selection = oldselection - endif - if g:zencoding_debug > 1 - call getchar() - endif -endfunction - -function! zencoding#moveNextPrev(flag) - if search('><\/\|\(""\)\|^\s*$', a:flag ? 'Wpb' : 'Wp') == 3 - startinsert! - else - silent! normal! l - startinsert - endif -endfunction - -function! zencoding#imageSize() - let img_region = s:search_region('') - if !s:region_is_valid(img_region) || !s:cursor_in_region(img_region) - return - endif - let content = s:get_content(img_region) - if content !~ '^<]\+>$' - return - endif - let current = s:zen_parseTag(content) - let fn = current.attr.src - if fn !~ '^\(/\|http\)' - let fn = simplify(expand('%:h') . '/' . fn) - endif - let [type, width, height] = ['', -1, -1] - - if filereadable(fn) - let hex = substitute(system('xxd -p "'.fn.'"'), '\n', '', 'g') - else - let hex = substitute(system('curl -s "'.fn.'" | xxd -p'), '\n', '', 'g') - endif - - if hex =~ '^89504e470d0a1a0a' - let type = 'png' - let width = eval('0x'.hex[32:39]) - let height = eval('0x'.hex[40:47]) - endif - if hex =~ '^ffd8' - let pos = match(hex, 'ffc[02]') - let type = 'jpg' - let height = eval('0x'.hex[pos+10:pos+11])*256 + eval('0x'.hex[pos+12:pos+13]) - let width = eval('0x'.hex[pos+14:pos+15])*256 + eval('0x'.hex[pos+16:pos+17]) - endif - if hex =~ '^47494638' - let type = 'gif' - let width = eval('0x'.hex[14:15].hex[12:13]) - let height = eval('0x'.hex[18:19].hex[16:17]) - endif - - if width == -1 && height == -1 - return - endif - let current.attr.width = width - let current.attr.height = height - let html = s:zen_toString(current, 'html', 1) - call s:change_content(img_region, html) -endfunction - -function! zencoding#toggleComment() - if s:zen_getFileType() == 'css' - let line = getline('.') - let mx = '^\(\s*\)/\*\s*\(.*\)\s*\*/\s*$' - if line =~ mx - let space = substitute(matchstr(line, mx), mx, '\1', '') - let line = substitute(matchstr(line, mx), mx, '\2', '') - let line = space . substitute(line, '^\s*\|\s*$', '\1', 'g') - else - let mx = '^\(\s*\)\(.*\)\s*$' - let line = substitute(line, mx, '\1/* \2 */', '') - endif - call setline('.', line) - return - endif - - let curpos = getpos('.') - while 1 - let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>' - let pos1 = searchpos(mx, 'bcnW') - let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '') - let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]] - if content[-2:] == '/>' && s:point_in_region(curpos[1:2], block) - let comment_region = s:search_region('') - if !s:region_is_valid(comment_region) || !s:point_in_region(curpos[1:2], comment_region) || !(s:point_in_region(comment_region[0], block) && s:point_in_region(comment_region[1], block)) - let content = '' - call s:change_content(block, content) - else - let content = s:get_content(comment_region) - let content = substitute(content, '^$', '\1', '') - call s:change_content(comment_region, content) - endif - return - else - if tag_name[0] == '/' - let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', 'bcnW') - call setpos('.', [0, pos1[0], pos1[1], 0]) - let pos2 = searchpos('', 'cneW') - else - let pos2 = searchpos('', 'cneW') - endif - let block = [pos1, pos2] - if !s:region_is_valid(block) - call setpos('.', curpos) - let block = s:search_region('') - if !s:region_is_valid(block) - return - endif - endif - if s:point_in_region(curpos[1:2], block) - let comment_region = s:search_region('') - if !s:region_is_valid(comment_region) || !s:point_in_region(curpos[1:2], comment_region) || !(s:point_in_region(comment_region[0], block) && s:point_in_region(comment_region[1], block)) - let content = '' - call s:change_content(block, content) - else - let content = s:get_content(comment_region) - let content = substitute(content, '^$', '\1', '') - call s:change_content(comment_region, content) - endif - return - else - if block[0][0] > 0 - call setpos('.', [0, block[0][0]-1, block[0][1], 0]) - else - call setpos('.', curpos) - return - endif - endif - endif - endwhile -endfunction - -function! zencoding#splitJoinTag() - let curpos = getpos('.') - while 1 - let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>' - let pos1 = searchpos(mx, 'bcnW') - let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '') - let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]] - if content[-2:] == '/>' && s:cursor_in_region(block) - let content = content[:-3] . ">' - call s:change_content(block, content) - call setpos('.', [0, block[0][0], block[0][1], 0]) - return - else - if tag_name[0] == '/' - let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', 'bcnW') - call setpos('.', [0, pos1[0], pos1[1], 0]) - let pos2 = searchpos('', 'cneW') - else - let pos2 = searchpos('', 'cneW') - endif - let block = [pos1, pos2] - let content = s:get_content(block) - if s:point_in_region(curpos[1:2], block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>' - let content = matchstr(content, mx)[:-2] . '/>' - call s:change_content(block, content) - call setpos('.', [0, block[0][0], block[0][1], 0]) - return - else - if block[0][0] > 0 - call setpos('.', [0, block[0][0]-1, block[0][1], 0]) - else - call setpos('.', curpos) - return - endif - endif - endif - endwhile -endfunction - -function! zencoding#removeTag() - let curpos = getpos('.') - while 1 - let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>' - let pos1 = searchpos(mx, 'bcnW') - let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '') - let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]] - if content[-2:] == '/>' && s:cursor_in_region(block) - call s:change_content(block, '') - call setpos('.', [0, block[0][0], block[0][1], 0]) - return - else - if tag_name[0] == '/' - let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', 'bcnW') - call setpos('.', [0, pos1[0], pos1[1], 0]) - let pos2 = searchpos('', 'cneW') - else - let pos2 = searchpos('', 'cneW') - endif - let block = [pos1, pos2] - let content = s:get_content(block) - if s:point_in_region(curpos[1:2], block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>' - call s:change_content(block, '') - call setpos('.', [0, block[0][0], block[0][1], 0]) - return - else - if block[0][0] > 0 - call setpos('.', [0, block[0][0]-1, block[0][1], 0]) - else - call setpos('.', curpos) - return - endif - endif - endif - endwhile -endfunction - -function! zencoding#balanceTag(flag) range - let vblock = s:get_visualblock() - if a:flag == -2 || a:flag == 2 - let curpos = [0, line("'<"), col("'<"), 0] - else - let curpos = getpos('.') - endif - while 1 - let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>' - let pos1 = searchpos(mx, (a:flag == -2 ? 'nW' : 'bcnW')) - let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '') - let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]] - if !s:region_is_valid(block) - break - endif - if content[-2:] == '/>' && s:point_in_region(curpos[1:2], block) - call s:select_region(block) - return - else - if tag_name[0] == '/' - let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', a:flag == -2 ? 'nW' : 'bcnW') - if pos1[0] == 0 - break - endif - call setpos('.', [0, pos1[0], pos1[1], 0]) - let pos2 = searchpos('', 'cneW') - else - let pos2 = searchpos('', 'cneW') - endif - let block = [pos1, pos2] - if !s:region_is_valid(block) - break - endif - let content = s:get_content(block) - if a:flag == -2 - let check = s:region_in_region(vblock, block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>' - else - let check = s:point_in_region(curpos[1:2], block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>' - endif - if check - if a:flag < 0 - let l = getline(pos1[0]) - let content = matchstr(l[pos1[1]-1:], mx) - if pos1[1] + len(content) > len(l) - let pos1[0] += 1 - else - let pos1[1] += len(content) - endif - let pos2 = searchpos('\(\n\|.\)', 'cnW') - else - let pos2 = searchpos('', 'cneW') - endif - let block = [pos1, pos2] - call s:select_region(block) - return - else - if s:region_is_valid(block) - if a:flag == -2 - if setpos('.', [0, block[0][0]+1, block[0][1], 0]) == -1 - break - endif - else - if setpos('.', [0, block[0][0]-1, block[0][1], 0]) == -1 - break - endif - endif - else - break - endif - endif - endif - endwhile - if a:flag == -2 || a:flag == 2 - silent! exe "normal! gv" - else - call setpos('.', curpos) - endif -endfunction - -function! zencoding#anchorizeURL(flag) - let mx = 'https\=:\/\/[-!#$%&*+,./:;=?@0-9a-zA-Z_~]\+' - let pos1 = searchpos(mx, 'bcnW') - let url = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let block = [pos1, [pos1[0], pos1[1] + len(url) - 1]] - if !s:cursor_in_region(block) - return - endif - - let content = s:get_content_from_url(url) - let content = substitute(content, '\n', '', 'g') - let content = substitute(content, '\n\s*\n', '\n', 'g') - let head = strpart(content, 0, stridx(content, '')) - let title = substitute(head, '.*]*>\([^<]\+\)<\/title[^>]*>.*', '\1', 'g') - - if a:flag == 0 - let a = s:zen_parseTag('') - let a.attr.href = url - let a.value = '{' . title . '}' - let expand = s:zen_toString(a, 'html', 0, []) - let expand = substitute(expand, '\${cursor}', '', 'g') - else - let body = s:get_text_from_html(content) - let body = '{' . substitute(body, '^\(.\{0,100}\).*', '\1', '') . '...}' - - let blockquote = s:zen_parseTag('
') - let a = s:zen_parseTag('') - let a.attr.href = url - let a.value = '{' . title . '}' - call add(blockquote.child, a) - call add(blockquote.child, s:zen_parseTag('
')) - let p = s:zen_parseTag('

') - let p.value = body - call add(blockquote.child, p) - let cite = s:zen_parseTag('') - let cite.value = '{' . url . '}' - call add(blockquote.child, cite) - let expand = s:zen_toString(blockquote, 'html', 0, []) - let expand = substitute(expand, '\${cursor}', '', 'g') - let indent = substitute(getline('.'), '^\(\s*\).*', '\1', '') - let expand = substitute(expand, "\n", "\n" . indent, 'g') - endif - call s:change_content(block, expand) -endfunction - -"============================================================================== -" html utils -"============================================================================== -function! s:get_content_from_url(url) - silent! new - silent! exec '0r!curl -s -L "'.substitute(a:url, '#.*', '', '').'"' - let ret = join(getline(1, '$'), "\n") - silent! bw! - return ret -endfunction - -function! s:get_text_from_html(buf) - let threshold_len = 100 - let threshold_per = 0.1 - let buf = a:buf - - let buf = substitute(buf, '', '', 'g') - let buf = strpart(buf, stridx(buf, '')) - let buf = substitute(buf, ']*>.\{-}', '', 'g') - let buf = substitute(buf, ']*>.\{-}', '', 'g') - let res = '' - let max = 0 - let mx = '\(]\{-}>\)\|\(<\/td>\)\|\(]\{-}>\)\|\(<\/div>\)' - let m = split(buf, mx) - for str in m - let c = split(str, '<[^>]*?>') - let str = substitute(str, '<[^>]\{-}>', '', 'g') - let str = substitute(str, '>', '>', 'g') - let str = substitute(str, '<', '<', 'g') - let str = substitute(str, '"', '"', 'g') - let str = substitute(str, ''', "'", 'g') - let str = substitute(str, ' ', ' ', 'g') - let str = substitute(str, '¥', '\¥', 'g') - let str = substitute(str, '&', '\&', 'g') - let str = substitute(str, '^\s*\(.*\)\s*$', '\1', '') - let str = substitute(str, '\s\+', ' ', 'g') - let l = len(str) - if l > threshold_len - let per = len(c) / l - if max < l && per < threshold_per - let max = l - let res = str - endif - endif - endfor - let res = substitute(res, '^\s*\(.*\)\s*$', '\1', 'g') - return res -endfunction -"============================================================================== - -"============================================================================== -" region utils -"============================================================================== -" delete_content : delete content in region -" if region make from between '' and '' -" -------------------- -" begin: -" :end -" -------------------- -" this function make the content as following -" -------------------- -" begin::end -" -------------------- -function! s:delete_content(region) - let lines = getline(a:region[0][0], a:region[1][0]) - call setpos('.', [0, a:region[0][0], a:region[0][1], 0]) - silent! exe "delete ".(a:region[1][0] - a:region[0][0]) - call setline(line('.'), lines[0][:a:region[0][1]-2] . lines[-1][a:region[1][1]]) -endfunction - -" change_content : change content in region -" if region make from between '' and '' -" -------------------- -" begin: -" :end -" -------------------- -" and content is -" -------------------- -" foo -" bar -" baz -" -------------------- -" this function make the content as following -" -------------------- -" begin:foo -" bar -" baz:end -" -------------------- -function! s:change_content(region, content) - let newlines = split(a:content, '\n') - let oldlines = getline(a:region[0][0], a:region[1][0]) - call setpos('.', [0, a:region[0][0], a:region[0][1], 0]) - silent! exe "delete ".(a:region[1][0] - a:region[0][0]) - if len(newlines) == 0 - let tmp = '' - if a:region[0][1] > 1 - let tmp = oldlines[0][:a:region[0][1]-2] - endif - if a:region[1][1] > 1 - let tmp .= oldlines[-1][a:region[1][1]:] - endif - call setline(line('.'), tmp) - elseif len(newlines) == 1 - if a:region[0][1] > 1 - let newlines[0] = oldlines[0][:a:region[0][1]-2] . newlines[0] - endif - if a:region[1][1] > 1 - let newlines[0] .= oldlines[-1][a:region[1][1]:] - endif - call setline(line('.'), newlines[0]) - else - if a:region[0][1] > 1 - let newlines[0] = oldlines[0][:a:region[0][1]-2] . newlines[0] - endif - if a:region[1][1] > 1 - let newlines[-1] .= oldlines[-1][a:region[1][1]:] - endif - call setline(line('.'), newlines[0]) - call append(line('.'), newlines[1:]) - endif -endfunction - -" select_region : select region -" this function make a selection of region -function! s:select_region(region) - call setpos('.', [0, a:region[1][0], a:region[1][1], 0]) - normal! v - call setpos('.', [0, a:region[0][0], a:region[0][1], 0]) -endfunction - -" point_in_region : check point is in the region -" this function return 0 or 1 -function! s:point_in_region(point, region) - if !s:region_is_valid(a:region) | return 0 | endif - if a:region[0][0] > a:point[0] | return 0 | endif - if a:region[1][0] < a:point[0] | return 0 | endif - if a:region[0][0] == a:point[0] && a:region[0][1] > a:point[1] | return 0 | endif - if a:region[1][0] == a:point[0] && a:region[1][1] < a:point[1] | return 0 | endif - return 1 -endfunction - -" cursor_in_region : check cursor is in the region -" this function return 0 or 1 -function! s:cursor_in_region(region) - if !s:region_is_valid(a:region) | return 0 | endif - let cur = getpos('.')[1:2] - return s:point_in_region(cur, a:region) -endfunction - -" region_is_valid : check region is valid -" this function return 0 or 1 -function! s:region_is_valid(region) - if a:region[0][0] == 0 || a:region[1][0] == 0 | return 0 | endif - return 1 -endfunction - -" search_region : make region from pattern which is composing start/end -" this function return array of position -function! s:search_region(start, end) - return [searchpos(a:start, 'bcnW'), searchpos(a:end, 'cneW')] -endfunction - -" get_content : get content in region -" this function return string in region -function! s:get_content(region) - if !s:region_is_valid(a:region) - return '' - endif - let lines = getline(a:region[0][0], a:region[1][0]) - if a:region[0][0] == a:region[1][0] - let lines[0] = lines[0][a:region[0][1]-1:a:region[1][1]-1] - else - let lines[0] = lines[0][a:region[0][1]-1:] - let lines[-1] = lines[-1][:a:region[1][1]-1] - endif - return join(lines, "\n") -endfunction - -" region_in_region : check region is in the region -" this function return 0 or 1 -function! s:region_in_region(outer, inner) - if !s:region_is_valid(a:inner) || !s:region_is_valid(a:outer) - return 0 - endif - return s:point_in_region(a:inner[0], a:outer) && s:point_in_region(a:inner[1], a:outer) -endfunction - -" get_visualblock : get region of visual block -" this function return region of visual block -function! s:get_visualblock() - return [[line("'<"), col("'<")], [line("'>"), col("'>")]] -endfunction -"============================================================================== - -function! zencoding#ExpandWord(abbr, type, orig) - let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$' - let str = a:abbr - let type = a:type - - if len(type) == 0 | let type = 'html' | endif - if str =~ mx - let filters = split(matchstr(str, mx)[1:], '\s*,\s*') - let str = substitute(str, mx, '', '') - elseif has_key(s:zen_settings[a:type], 'filters') - let filters = split(s:zen_settings[a:type].filters, '\s*,\s*') - else - let filters = ['html'] - endif - let items = s:zen_parseIntoTree(str, a:type).child - let expand = '' - for item in items - let expand .= s:zen_toString(item, a:type, 0, filters) - endfor - if a:orig == 0 - let expand = substitute(expand, '\${lang}', s:zen_settings.lang, 'g') - let expand = substitute(expand, '\${charset}', s:zen_settings.charset, 'g') - let expand = substitute(expand, '\${cursor}', '', 'g') - endif - return expand -endfunction - -function! zencoding#CompleteTag(findstart, base) - if a:findstart - let line = getline('.') - let start = col('.') - 1 - while start > 0 && line[start - 1] =~ '[a-zA-Z0-9:\@]' - let start -= 1 - endwhile - return start - else - let type = s:zen_getFileType() - let res = [] - - let snippets = s:zen_getResource(type, 'snippets', {}) - for item in keys(snippets) - if stridx(item, a:base) != -1 - call add(res, substitute(item, '\${cursor}\||', '', 'g')) - endif - endfor - let aliases = s:zen_getResource(type, 'aliases', {}) - for item in values(aliases) - if stridx(item, a:base) != -1 - call add(res, substitute(item, '\${cursor}\||', '', 'g')) - endif - endfor - return res - endif -endfunction - -unlet! s:zen_settings -let s:zen_settings = { -\ 'indentation': "\t", -\ 'lang': "en", -\ 'charset': "UTF-8", -\ 'css': { -\ 'snippets': { -\ '@i': '@import url(|);', -\ '@m': "@media print {\n\t|\n}", -\ '@f': "@font-face {\n\tfont-family:|;\n\tsrc:url(|);\n}", -\ '!': '!important', -\ 'pos': 'position:|;', -\ 'pos:s': 'position:static;', -\ 'pos:a': 'position:absolute;', -\ 'pos:r': 'position:relative;', -\ 'pos:f': 'position:fixed;', -\ 't': 'top:|;', -\ 't:a': 'top:auto;', -\ 'r': 'right:|;', -\ 'r:a': 'right:auto;', -\ 'b': 'bottom:|;', -\ 'b:a': 'bottom:auto;', -\ 'l': 'left:|;', -\ 'l:a': 'left:auto;', -\ 'z': 'z-index:|;', -\ 'z:a': 'z-index:auto;', -\ 'fl': 'float:|;', -\ 'fl:n': 'float:none;', -\ 'fl:l': 'float:left;', -\ 'fl:r': 'float:right;', -\ 'cl': 'clear:|;', -\ 'cl:n': 'clear:none;', -\ 'cl:l': 'clear:left;', -\ 'cl:r': 'clear:right;', -\ 'cl:b': 'clear:both;', -\ 'd': 'display:|;', -\ 'd:n': 'display:none;', -\ 'd:b': 'display:block;', -\ 'd:i': 'display:inline;', -\ 'd:ib': 'display:inline-block;', -\ 'd:li': 'display:list-item;', -\ 'd:ri': 'display:run-in;', -\ 'd:cp': 'display:compact;', -\ 'd:tb': 'display:table;', -\ 'd:itb': 'display:inline-table;', -\ 'd:tbcp': 'display:table-caption;', -\ 'd:tbcl': 'display:table-column;', -\ 'd:tbclg': 'display:table-column-group;', -\ 'd:tbhg': 'display:table-header-group;', -\ 'd:tbfg': 'display:table-footer-group;', -\ 'd:tbr': 'display:table-row;', -\ 'd:tbrg': 'display:table-row-group;', -\ 'd:tbc': 'display:table-cell;', -\ 'd:rb': 'display:ruby;', -\ 'd:rbb': 'display:ruby-base;', -\ 'd:rbbg': 'display:ruby-base-group;', -\ 'd:rbt': 'display:ruby-text;', -\ 'd:rbtg': 'display:ruby-text-group;', -\ 'v': 'visibility:|;', -\ 'v:v': 'visibility:visible;', -\ 'v:h': 'visibility:hidden;', -\ 'v:c': 'visibility:collapse;', -\ 'ov': 'overflow:|;', -\ 'ov:v': 'overflow:visible;', -\ 'ov:h': 'overflow:hidden;', -\ 'ov:s': 'overflow:scroll;', -\ 'ov:a': 'overflow:auto;', -\ 'ovx': 'overflow-x:|;', -\ 'ovx:v': 'overflow-x:visible;', -\ 'ovx:h': 'overflow-x:hidden;', -\ 'ovx:s': 'overflow-x:scroll;', -\ 'ovx:a': 'overflow-x:auto;', -\ 'ovy': 'overflow-y:|;', -\ 'ovy:v': 'overflow-y:visible;', -\ 'ovy:h': 'overflow-y:hidden;', -\ 'ovy:s': 'overflow-y:scroll;', -\ 'ovy:a': 'overflow-y:auto;', -\ 'ovs': 'overflow-style:|;', -\ 'ovs:a': 'overflow-style:auto;', -\ 'ovs:s': 'overflow-style:scrollbar;', -\ 'ovs:p': 'overflow-style:panner;', -\ 'ovs:m': 'overflow-style:move;', -\ 'ovs:mq': 'overflow-style:marquee;', -\ 'zoo': 'zoom:1;', -\ 'cp': 'clip:|;', -\ 'cp:a': 'clip:auto;', -\ 'cp:r': 'clip:rect(|);', -\ 'bxz': 'box-sizing:|;', -\ 'bxz:cb': 'box-sizing:content-box;', -\ 'bxz:bb': 'box-sizing:border-box;', -\ 'bxsh': 'box-shadow:|;', -\ 'bxsh:n': 'box-shadow:none;', -\ 'bxsh:w': '-webkit-box-shadow:0 0 0 #000;', -\ 'bxsh:m': '-moz-box-shadow:0 0 0 0 #000;', -\ 'm': 'margin:|;', -\ 'm:a': 'margin:auto;', -\ 'm:0': 'margin:0;', -\ 'm:2': 'margin:0 0;', -\ 'm:3': 'margin:0 0 0;', -\ 'm:4': 'margin:0 0 0 0;', -\ 'mt': 'margin-top:|;', -\ 'mt:a': 'margin-top:auto;', -\ 'mr': 'margin-right:|;', -\ 'mr:a': 'margin-right:auto;', -\ 'mb': 'margin-bottom:|;', -\ 'mb:a': 'margin-bottom:auto;', -\ 'ml': 'margin-left:|;', -\ 'ml:a': 'margin-left:auto;', -\ 'p': 'padding:|;', -\ 'p:0': 'padding:0;', -\ 'p:2': 'padding:0 0;', -\ 'p:3': 'padding:0 0 0;', -\ 'p:4': 'padding:0 0 0 0;', -\ 'pt': 'padding-top:|;', -\ 'pr': 'padding-right:|;', -\ 'pb': 'padding-bottom:|;', -\ 'pl': 'padding-left:|;', -\ 'w': 'width:|;', -\ 'w:a': 'width:auto;', -\ 'h': 'height:|;', -\ 'h:a': 'height:auto;', -\ 'maw': 'max-width:|;', -\ 'maw:n': 'max-width:none;', -\ 'mah': 'max-height:|;', -\ 'mah:n': 'max-height:none;', -\ 'miw': 'min-width:|;', -\ 'mih': 'min-height:|;', -\ 'o': 'outline:|;', -\ 'o:n': 'outline:none;', -\ 'oo': 'outline-offset:|;', -\ 'ow': 'outline-width:|;', -\ 'os': 'outline-style:|;', -\ 'oc': 'outline-color:#000;', -\ 'oc:i': 'outline-color:invert;', -\ 'bd': 'border:|;', -\ 'bd+': 'border:1px solid #000;', -\ 'bd:n': 'border:none;', -\ 'bdbk': 'border-break:|;', -\ 'bdbk:c': 'border-break:close;', -\ 'bdcl': 'border-collapse:|;', -\ 'bdcl:c': 'border-collapse:collapse;', -\ 'bdcl:s': 'border-collapse:separate;', -\ 'bdc': 'border-color:#000;', -\ 'bdi': 'border-image:url(|);', -\ 'bdi:n': 'border-image:none;', -\ 'bdi:w': '-webkit-border-image:url(|) 0 0 0 0 stretch stretch;', -\ 'bdi:m': '-moz-border-image:url(|) 0 0 0 0 stretch stretch;', -\ 'bdti': 'border-top-image:url(|);', -\ 'bdti:n': 'border-top-image:none;', -\ 'bdri': 'border-right-image:url(|);', -\ 'bdri:n': 'border-right-image:none;', -\ 'bdbi': 'border-bottom-image:url(|);', -\ 'bdbi:n': 'border-bottom-image:none;', -\ 'bdli': 'border-left-image:url(|);', -\ 'bdli:n': 'border-left-image:none;', -\ 'bdci': 'border-corner-image:url(|);', -\ 'bdci:n': 'border-corner-image:none;', -\ 'bdci:c': 'border-corner-image:continue;', -\ 'bdtli': 'border-top-left-image:url(|);', -\ 'bdtli:n': 'border-top-left-image:none;', -\ 'bdtli:c': 'border-top-left-image:continue;', -\ 'bdtri': 'border-top-right-image:url(|);', -\ 'bdtri:n': 'border-top-right-image:none;', -\ 'bdtri:c': 'border-top-right-image:continue;', -\ 'bdbri': 'border-bottom-right-image:url(|);', -\ 'bdbri:n': 'border-bottom-right-image:none;', -\ 'bdbri:c': 'border-bottom-right-image:continue;', -\ 'bdbli': 'border-bottom-left-image:url(|);', -\ 'bdbli:n': 'border-bottom-left-image:none;', -\ 'bdbli:c': 'border-bottom-left-image:continue;', -\ 'bdf': 'border-fit:|;', -\ 'bdf:c': 'border-fit:clip;', -\ 'bdf:r': 'border-fit:repeat;', -\ 'bdf:sc': 'border-fit:scale;', -\ 'bdf:st': 'border-fit:stretch;', -\ 'bdf:ow': 'border-fit:overwrite;', -\ 'bdf:of': 'border-fit:overflow;', -\ 'bdf:sp': 'border-fit:space;', -\ 'bdl': 'border-left:|;', -\ 'bdl:a': 'border-length:auto;', -\ 'bdsp': 'border-spacing:|;', -\ 'bds': 'border-style:|;', -\ 'bds:n': 'border-style:none;', -\ 'bds:h': 'border-style:hidden;', -\ 'bds:dt': 'border-style:dotted;', -\ 'bds:ds': 'border-style:dashed;', -\ 'bds:s': 'border-style:solid;', -\ 'bds:db': 'border-style:double;', -\ 'bds:dtds': 'border-style:dot-dash;', -\ 'bds:dtdtds': 'border-style:dot-dot-dash;', -\ 'bds:w': 'border-style:wave;', -\ 'bds:g': 'border-style:groove;', -\ 'bds:r': 'border-style:ridge;', -\ 'bds:i': 'border-style:inset;', -\ 'bds:o': 'border-style:outset;', -\ 'bdw': 'border-width:|;', -\ 'bdt': 'border-top:|;', -\ 'bdt+': 'border-top:1px solid #000;', -\ 'bdt:n': 'border-top:none;', -\ 'bdtw': 'border-top-width:|;', -\ 'bdts': 'border-top-style:|;', -\ 'bdts:n': 'border-top-style:none;', -\ 'bdtc': 'border-top-color:#000;', -\ 'bdr': 'border-right:|;', -\ 'bdr+': 'border-right:1px solid #000;', -\ 'bdr:n': 'border-right:none;', -\ 'bdrw': 'border-right-width:|;', -\ 'bdrs': 'border-right-style:|;', -\ 'bdrs:n': 'border-right-style:none;', -\ 'bdrc': 'border-right-color:#000;', -\ 'bdb': 'border-bottom:|;', -\ 'bdb+': 'border-bottom:1px solid #000;', -\ 'bdb:n': 'border-bottom:none;', -\ 'bdbw': 'border-bottom-width:|;', -\ 'bdbs': 'border-bottom-style:|;', -\ 'bdbs:n': 'border-bottom-style:none;', -\ 'bdbc': 'border-bottom-color:#000;', -\ 'bdln': 'border-length:|;', -\ 'bdl+': 'border-left:1px solid #000;', -\ 'bdl:n': 'border-left:none;', -\ 'bdlw': 'border-left-width:|;', -\ 'bdls': 'border-left-style:|;', -\ 'bdls:n': 'border-left-style:none;', -\ 'bdlc': 'border-left-color:#000;', -\ 'bdrus': 'border-radius:|;', -\ 'bdtrrs': 'border-top-right-radius:|;', -\ 'bdtlrs': 'border-top-left-radius:|;', -\ 'bdbrrs': 'border-bottom-right-radius:|;', -\ 'bdblrs': 'border-bottom-left-radius:|;', -\ 'bg': 'background:|;', -\ 'bg+': 'background:#FFF url(|) 0 0 no-repeat;', -\ 'bg:n': 'background:none;', -\ 'bg:ie': 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''|x.png'');', -\ 'bgc': 'background-color:#FFF;', -\ 'bgi': 'background-image:url(|);', -\ 'bgi:n': 'background-image:none;', -\ 'bgr': 'background-repeat:|;', -\ 'bgr:n': 'background-repeat:no-repeat;', -\ 'bgr:x': 'background-repeat:repeat-x;', -\ 'bgr:y': 'background-repeat:repeat-y;', -\ 'bga': 'background-attachment:|;', -\ 'bga:f': 'background-attachment:fixed;', -\ 'bga:s': 'background-attachment:scroll;', -\ 'bgp': 'background-position:0 0;', -\ 'bgpx': 'background-position-x:|;', -\ 'bgpy': 'background-position-y:|;', -\ 'bgbk': 'background-break:|;', -\ 'bgbk:bb': 'background-break:bounding-box;', -\ 'bgbk:eb': 'background-break:each-box;', -\ 'bgbk:c': 'background-break:continuous;', -\ 'bgcp': 'background-clip:|;', -\ 'bgcp:bb': 'background-clip:border-box;', -\ 'bgcp:pb': 'background-clip:padding-box;', -\ 'bgcp:cb': 'background-clip:content-box;', -\ 'bgcp:nc': 'background-clip:no-clip;', -\ 'bgo': 'background-origin:|;', -\ 'bgo:pb': 'background-origin:padding-box;', -\ 'bgo:bb': 'background-origin:border-box;', -\ 'bgo:cb': 'background-origin:content-box;', -\ 'bgz': 'background-size:|;', -\ 'bgz:a': 'background-size:auto;', -\ 'bgz:ct': 'background-size:contain;', -\ 'bgz:cv': 'background-size:cover;', -\ 'c': 'color:#000;', -\ 'tbl': 'table-layout:|;', -\ 'tbl:a': 'table-layout:auto;', -\ 'tbl:f': 'table-layout:fixed;', -\ 'cps': 'caption-side:|;', -\ 'cps:t': 'caption-side:top;', -\ 'cps:b': 'caption-side:bottom;', -\ 'ec': 'empty-cells:|;', -\ 'ec:s': 'empty-cells:show;', -\ 'ec:h': 'empty-cells:hide;', -\ 'lis': 'list-style:|;', -\ 'lis:n': 'list-style:none;', -\ 'lisp': 'list-style-position:|;', -\ 'lisp:i': 'list-style-position:inside;', -\ 'lisp:o': 'list-style-position:outside;', -\ 'list': 'list-style-type:|;', -\ 'list:n': 'list-style-type:none;', -\ 'list:d': 'list-style-type:disc;', -\ 'list:c': 'list-style-type:circle;', -\ 'list:s': 'list-style-type:square;', -\ 'list:dc': 'list-style-type:decimal;', -\ 'list:dclz': 'list-style-type:decimal-leading-zero;', -\ 'list:lr': 'list-style-type:lower-roman;', -\ 'list:ur': 'list-style-type:upper-roman;', -\ 'lisi': 'list-style-image:|;', -\ 'lisi:n': 'list-style-image:none;', -\ 'q': 'quotes:|;', -\ 'q:n': 'quotes:none;', -\ 'q:ru': 'quotes:''\00AB'' ''\00BB'' ''\201E'' ''\201C'';', -\ 'q:en': 'quotes:''\201C'' ''\201D'' ''\2018'' ''\2019'';', -\ 'ct': 'content:|;', -\ 'ct:n': 'content:normal;', -\ 'ct:oq': 'content:open-quote;', -\ 'ct:noq': 'content:no-open-quote;', -\ 'ct:cq': 'content:close-quote;', -\ 'ct:ncq': 'content:no-close-quote;', -\ 'ct:a': 'content:attr(|);', -\ 'ct:c': 'content:counter(|);', -\ 'ct:cs': 'content:counters(|);', -\ 'coi': 'counter-increment:|;', -\ 'cor': 'counter-reset:|;', -\ 'va': 'vertical-align:|;', -\ 'va:sup': 'vertical-align:super;', -\ 'va:t': 'vertical-align:top;', -\ 'va:tt': 'vertical-align:text-top;', -\ 'va:m': 'vertical-align:middle;', -\ 'va:bl': 'vertical-align:baseline;', -\ 'va:b': 'vertical-align:bottom;', -\ 'va:tb': 'vertical-align:text-bottom;', -\ 'va:sub': 'vertical-align:sub;', -\ 'ta': 'text-align:|;', -\ 'ta:l': 'text-align:left;', -\ 'ta:c': 'text-align:center;', -\ 'ta:r': 'text-align:right;', -\ 'tal': 'text-align-last:|;', -\ 'tal:a': 'text-align-last:auto;', -\ 'tal:l': 'text-align-last:left;', -\ 'tal:c': 'text-align-last:center;', -\ 'tal:r': 'text-align-last:right;', -\ 'td': 'text-decoration:|;', -\ 'td:n': 'text-decoration:none;', -\ 'td:u': 'text-decoration:underline;', -\ 'td:o': 'text-decoration:overline;', -\ 'td:l': 'text-decoration:line-through;', -\ 'te': 'text-emphasis:|;', -\ 'te:n': 'text-emphasis:none;', -\ 'te:ac': 'text-emphasis:accent;', -\ 'te:dt': 'text-emphasis:dot;', -\ 'te:c': 'text-emphasis:circle;', -\ 'te:ds': 'text-emphasis:disc;', -\ 'te:b': 'text-emphasis:before;', -\ 'te:a': 'text-emphasis:after;', -\ 'th': 'text-height:|;', -\ 'th:a': 'text-height:auto;', -\ 'th:f': 'text-height:font-size;', -\ 'th:t': 'text-height:text-size;', -\ 'th:m': 'text-height:max-size;', -\ 'ti': 'text-indent:|;', -\ 'ti:-': 'text-indent:-9999px;', -\ 'tj': 'text-justify:|;', -\ 'tj:a': 'text-justify:auto;', -\ 'tj:iw': 'text-justify:inter-word;', -\ 'tj:ii': 'text-justify:inter-ideograph;', -\ 'tj:ic': 'text-justify:inter-cluster;', -\ 'tj:d': 'text-justify:distribute;', -\ 'tj:k': 'text-justify:kashida;', -\ 'tj:t': 'text-justify:tibetan;', -\ 'to': 'text-outline:|;', -\ 'to+': 'text-outline:0 0 #000;', -\ 'to:n': 'text-outline:none;', -\ 'tr': 'text-replace:|;', -\ 'tr:n': 'text-replace:none;', -\ 'tt': 'text-transform:|;', -\ 'tt:n': 'text-transform:none;', -\ 'tt:c': 'text-transform:capitalize;', -\ 'tt:u': 'text-transform:uppercase;', -\ 'tt:l': 'text-transform:lowercase;', -\ 'tw': 'text-wrap:|;', -\ 'tw:n': 'text-wrap:normal;', -\ 'tw:no': 'text-wrap:none;', -\ 'tw:u': 'text-wrap:unrestricted;', -\ 'tw:s': 'text-wrap:suppress;', -\ 'tsh': 'text-shadow:|;', -\ 'tsh+': 'text-shadow:0 0 0 #000;', -\ 'tsh:n': 'text-shadow:none;', -\ 'lh': 'line-height:|;', -\ 'whs': 'white-space:|;', -\ 'whs:n': 'white-space:normal;', -\ 'whs:p': 'white-space:pre;', -\ 'whs:nw': 'white-space:nowrap;', -\ 'whs:pw': 'white-space:pre-wrap;', -\ 'whs:pl': 'white-space:pre-line;', -\ 'whsc': 'white-space-collapse:|;', -\ 'whsc:n': 'white-space-collapse:normal;', -\ 'whsc:k': 'white-space-collapse:keep-all;', -\ 'whsc:l': 'white-space-collapse:loose;', -\ 'whsc:bs': 'white-space-collapse:break-strict;', -\ 'whsc:ba': 'white-space-collapse:break-all;', -\ 'wob': 'word-break:|;', -\ 'wob:n': 'word-break:normal;', -\ 'wob:k': 'word-break:keep-all;', -\ 'wob:l': 'word-break:loose;', -\ 'wob:bs': 'word-break:break-strict;', -\ 'wob:ba': 'word-break:break-all;', -\ 'wos': 'word-spacing:|;', -\ 'wow': 'word-wrap:|;', -\ 'wow:nm': 'word-wrap:normal;', -\ 'wow:n': 'word-wrap:none;', -\ 'wow:u': 'word-wrap:unrestricted;', -\ 'wow:s': 'word-wrap:suppress;', -\ 'lts': 'letter-spacing:|;', -\ 'f': 'font:|;', -\ 'f+': 'font:1em Arial,sans-serif;', -\ 'fw': 'font-weight:|;', -\ 'fw:n': 'font-weight:normal;', -\ 'fw:b': 'font-weight:bold;', -\ 'fw:br': 'font-weight:bolder;', -\ 'fw:lr': 'font-weight:lighter;', -\ 'fs': 'font-style:|;', -\ 'fs:n': 'font-style:normal;', -\ 'fs:i': 'font-style:italic;', -\ 'fs:o': 'font-style:oblique;', -\ 'fv': 'font-variant:|;', -\ 'fv:n': 'font-variant:normal;', -\ 'fv:sc': 'font-variant:small-caps;', -\ 'fz': 'font-size:|;', -\ 'fza': 'font-size-adjust:|;', -\ 'fza:n': 'font-size-adjust:none;', -\ 'ff': 'font-family:|;', -\ 'ff:s': 'font-family:serif;', -\ 'ff:ss': 'font-family:sans-serif;', -\ 'ff:c': 'font-family:cursive;', -\ 'ff:f': 'font-family:fantasy;', -\ 'ff:m': 'font-family:monospace;', -\ 'fef': 'font-effect:|;', -\ 'fef:n': 'font-effect:none;', -\ 'fef:eg': 'font-effect:engrave;', -\ 'fef:eb': 'font-effect:emboss;', -\ 'fef:o': 'font-effect:outline;', -\ 'fem': 'font-emphasize:|;', -\ 'femp': 'font-emphasize-position:|;', -\ 'femp:b': 'font-emphasize-position:before;', -\ 'femp:a': 'font-emphasize-position:after;', -\ 'fems': 'font-emphasize-style:|;', -\ 'fems:n': 'font-emphasize-style:none;', -\ 'fems:ac': 'font-emphasize-style:accent;', -\ 'fems:dt': 'font-emphasize-style:dot;', -\ 'fems:c': 'font-emphasize-style:circle;', -\ 'fems:ds': 'font-emphasize-style:disc;', -\ 'fsm': 'font-smooth:|;', -\ 'fsm:a': 'font-smooth:auto;', -\ 'fsm:n': 'font-smooth:never;', -\ 'fsm:aw': 'font-smooth:always;', -\ 'fst': 'font-stretch:|;', -\ 'fst:n': 'font-stretch:normal;', -\ 'fst:uc': 'font-stretch:ultra-condensed;', -\ 'fst:ec': 'font-stretch:extra-condensed;', -\ 'fst:c': 'font-stretch:condensed;', -\ 'fst:sc': 'font-stretch:semi-condensed;', -\ 'fst:se': 'font-stretch:semi-expanded;', -\ 'fst:e': 'font-stretch:expanded;', -\ 'fst:ee': 'font-stretch:extra-expanded;', -\ 'fst:ue': 'font-stretch:ultra-expanded;', -\ 'op': 'opacity:|;', -\ 'op:ie': 'filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);', -\ 'op:ms': '-ms-filter:''progid:DXImageTransform.Microsoft.Alpha(Opacity=100)'';', -\ 'rz': 'resize:|;', -\ 'rz:n': 'resize:none;', -\ 'rz:b': 'resize:both;', -\ 'rz:h': 'resize:horizontal;', -\ 'rz:v': 'resize:vertical;', -\ 'cur': 'cursor:|;', -\ 'cur:a': 'cursor:auto;', -\ 'cur:d': 'cursor:default;', -\ 'cur:c': 'cursor:crosshair;', -\ 'cur:ha': 'cursor:hand;', -\ 'cur:he': 'cursor:help;', -\ 'cur:m': 'cursor:move;', -\ 'cur:p': 'cursor:pointer;', -\ 'cur:t': 'cursor:text;', -\ 'pgbb': 'page-break-before:|;', -\ 'pgbb:au': 'page-break-before:auto;', -\ 'pgbb:al': 'page-break-before:always;', -\ 'pgbb:l': 'page-break-before:left;', -\ 'pgbb:r': 'page-break-before:right;', -\ 'pgbi': 'page-break-inside:|;', -\ 'pgbi:au': 'page-break-inside:auto;', -\ 'pgbi:av': 'page-break-inside:avoid;', -\ 'pgba': 'page-break-after:|;', -\ 'pgba:au': 'page-break-after:auto;', -\ 'pgba:al': 'page-break-after:always;', -\ 'pgba:l': 'page-break-after:left;', -\ 'pgba:r': 'page-break-after:right;', -\ 'orp': 'orphans:|;', -\ 'wid': 'widows:|;' -\ } -\ }, -\ 'html': { -\ 'snippets': { -\ 'cc:ie6': "", -\ 'cc:ie': "", -\ 'cc:noie': "\n\t${child}|\n", -\ 'html:4t': "\n" -\ ."\n" -\ ."\n" -\ ." \n" -\ ." \n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:4s': "\n" -\ ."\n" -\ ."\n" -\ ." \n" -\ ." \n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:xt': "\n" -\ ."\n" -\ ."\n" -\ ." \n" -\ ." \n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:xs': "\n" -\ ."\n" -\ ."\n" -\ ." \n" -\ ." \n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:xxs': "\n" -\ ."\n" -\ ."\n" -\ ." \n" -\ ." \n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:5': "\n" -\ ."\n" -\ ."\n" -\ ." \n" -\ ." \n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."" -\ }, -\ 'default_attributes': { -\ 'a': {'href': ''}, -\ 'a:link': {'href': 'http://|'}, -\ 'a:mail': {'href': 'mailto:|'}, -\ 'abbr': {'title': ''}, -\ 'acronym': {'title': ''}, -\ 'base': {'href': ''}, -\ 'bdo': {'dir': ''}, -\ 'bdo:r': {'dir': 'rtl'}, -\ 'bdo:l': {'dir': 'ltr'}, -\ 'del': {'datetime': '${datetime}'}, -\ 'ins': {'datetime': '${datetime}'}, -\ 'link:css': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|style.css'}, {'media': 'all'}], -\ 'link:print': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|print.css'}, {'media': 'print'}], -\ 'link:favicon': [{'rel': 'shortcut icon'}, {'type': 'image/x-icon'}, {'href': '|favicon.ico'}], -\ 'link:touch': [{'rel': 'apple-touch-icon'}, {'href': '|favicon.png'}], -\ 'link:rss': [{'rel': 'alternate'}, {'type': 'application/rss+xml'}, {'title': 'RSS'}, {'href': '|rss.xml'}], -\ 'link:atom': [{'rel': 'alternate'}, {'type': 'application/atom+xml'}, {'title': 'Atom'}, {'href': 'atom.xml'}], -\ 'meta:utf': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=UTF-8'}], -\ 'meta:win': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=Win-1251'}], -\ 'meta:compat': [{'http-equiv': 'X-UA-Compatible'}, {'content': 'IE=7'}], -\ 'style': {'type': 'text/css'}, -\ 'script': {'type': 'text/javascript'}, -\ 'script:src': [{'type': 'text/javascript'}, {'src': ''}], -\ 'img': [{'src': ''}, {'alt': ''}], -\ 'iframe': [{'src': ''}, {'frameborder': '0'}], -\ 'embed': [{'src': ''}, {'type': ''}], -\ 'object': [{'data': ''}, {'type': ''}], -\ 'param': [{'name': ''}, {'value': ''}], -\ 'map': {'name': ''}, -\ 'area': [{'shape': ''}, {'coords': ''}, {'href': ''}, {'alt': ''}], -\ 'area:d': [{'shape': 'default'}, {'href': ''}, {'alt': ''}], -\ 'area:c': [{'shape': 'circle'}, {'coords': ''}, {'href': ''}, {'alt': ''}], -\ 'area:r': [{'shape': 'rect'}, {'coords': ''}, {'href': ''}, {'alt': ''}], -\ 'area:p': [{'shape': 'poly'}, {'coords': ''}, {'href': ''}, {'alt': ''}], -\ 'link': [{'rel': 'stylesheet'}, {'href': ''}], -\ 'form': {'action': ''}, -\ 'form:get': {'action': '', 'method': 'get'}, -\ 'form:post': {'action': '', 'method': 'post'}, -\ 'form:upload': {'action': '', 'method': 'post', 'enctype': 'multipart/form-data'}, -\ 'label': {'for': ''}, -\ 'input': {'type': ''}, -\ 'input:hidden': [{'type': 'hidden'}, {'name': ''}], -\ 'input:h': [{'type': 'hidden'}, {'name': ''}], -\ 'input:text': [{'type': 'text'}, {'name': ''}, {'id': ''}], -\ 'input:t': [{'type': 'text'}, {'name': ''}, {'id': ''}], -\ 'input:search': [{'type': 'search'}, {'name': ''}, {'id': ''}], -\ 'input:email': [{'type': 'email'}, {'name': ''}, {'id': ''}], -\ 'input:url': [{'type': 'url'}, {'name': ''}, {'id': ''}], -\ 'input:password': [{'type': 'password'}, {'name': ''}, {'id': ''}], -\ 'input:p': [{'type': 'password'}, {'name': ''}, {'id': ''}], -\ 'input:datetime': [{'type': 'datetime'}, {'name': ''}, {'id': ''}], -\ 'input:date': [{'type': 'date'}, {'name': ''}, {'id': ''}], -\ 'input:datetime-local': [{'type': 'datetime-local'}, {'name': ''}, {'id': ''}], -\ 'input:month': [{'type': 'month'}, {'name': ''}, {'id': ''}], -\ 'input:week': [{'type': 'week'}, {'name': ''}, {'id': ''}], -\ 'input:time': [{'type': 'time'}, {'name': ''}, {'id': ''}], -\ 'input:number': [{'type': 'number'}, {'name': ''}, {'id': ''}], -\ 'input:color': [{'type': 'color'}, {'name': ''}, {'id': ''}], -\ 'input:checkbox': [{'type': 'checkbox'}, {'name': ''}, {'id': ''}], -\ 'input:c': [{'type': 'checkbox'}, {'name': ''}, {'id': ''}], -\ 'input:radio': [{'type': 'radio'}, {'name': ''}, {'id': ''}], -\ 'input:r': [{'type': 'radio'}, {'name': ''}, {'id': ''}], -\ 'input:range': [{'type': 'range'}, {'name': ''}, {'id': ''}], -\ 'input:file': [{'type': 'file'}, {'name': ''}, {'id': ''}], -\ 'input:f': [{'type': 'file'}, {'name': ''}, {'id': ''}], -\ 'input:submit': [{'type': 'submit'}, {'value': ''}], -\ 'input:s': [{'type': 'submit'}, {'value': ''}], -\ 'input:image': [{'type': 'image'}, {'src': ''}, {'alt': ''}], -\ 'input:i': [{'type': 'image'}, {'src': ''}, {'alt': ''}], -\ 'input:reset': [{'type': 'reset'}, {'value': ''}], -\ 'input:button': [{'type': 'button'}, {'value': ''}], -\ 'input:b': [{'type': 'button'}, {'value': ''}], -\ 'select': [{'name': ''}, {'id': ''}], -\ 'option': {'value': ''}, -\ 'textarea': [{'name': ''}, {'id': ''}, {'cols': '30'}, {'rows': '10'}], -\ 'menu:context': {'type': 'context'}, -\ 'menu:c': {'type': 'context'}, -\ 'menu:toolbar': {'type': 'toolbar'}, -\ 'menu:t': {'type': 'toolbar'}, -\ 'video': {'src': ''}, -\ 'audio': {'src': ''}, -\ 'html:xml': [{'xmlns': 'http://www.w3.org/1999/xhtml'}, {'xml:lang': '${lang}'}] -\ }, -\ 'aliases': { -\ 'link:*': 'link', -\ 'meta:*': 'meta', -\ 'area:*': 'area', -\ 'bdo:*': 'bdo', -\ 'form:*': 'form', -\ 'input:*': 'input', -\ 'script:*': 'script', -\ 'html:*': 'html', -\ 'a:*': 'a', -\ 'menu:*': 'menu', -\ 'bq': 'blockquote', -\ 'acr': 'acronym', -\ 'fig': 'figure', -\ 'ifr': 'iframe', -\ 'emb': 'embed', -\ 'obj': 'object', -\ 'src': 'source', -\ 'cap': 'caption', -\ 'colg': 'colgroup', -\ 'fst': 'fieldset', -\ 'btn': 'button', -\ 'optg': 'optgroup', -\ 'opt': 'option', -\ 'tarea': 'textarea', -\ 'leg': 'legend', -\ 'sect': 'section', -\ 'art': 'article', -\ 'hdr': 'header', -\ 'ftr': 'footer', -\ 'adr': 'address', -\ 'dlg': 'dialog', -\ 'str': 'strong', -\ 'sty': 'style', -\ 'prog': 'progress', -\ 'fset': 'fieldset', -\ 'datag': 'datagrid', -\ 'datal': 'datalist', -\ 'kg': 'keygen', -\ 'out': 'output', -\ 'det': 'details', -\ 'cmd': 'command' -\ }, -\ 'expandos': { -\ 'ol': 'ol>li', -\ 'ul': 'ul>li', -\ 'dl': 'dl>dt+dd', -\ 'map': 'map>area', -\ 'table': 'table>tr>td', -\ 'colgroup': 'colgroup>col', -\ 'colg': 'colgroup>col', -\ 'tr': 'tr>td', -\ 'select': 'select>option', -\ 'optgroup': 'optgroup>option', -\ 'optg': 'optgroup>option' -\ }, -\ 'empty_elements': 'area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command', -\ 'block_elements': 'address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6,style', -\ 'inline_elements': 'a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,small,span,strike,strong,sub,sup,textarea,tt,u,var', -\ }, -\ 'xsl': { -\ 'extends': 'html', -\ 'default_attributes': { -\ 'tmatch': [{'match': ''}, {'mode': ''}], -\ 'tname': [{'name': ''}], -\ 'xsl:when': {'test': ''}, -\ 'var': [{'name': ''}, {'select': ''}], -\ 'vari': {'name': ''}, -\ 'if': {'test': ''}, -\ 'call': {'name': ''}, -\ 'attr': {'name': ''}, -\ 'wp': [{'name': ''}, {'select': ''}], -\ 'par': [{'name': ''}, {'select': ''}], -\ 'val': {'select': ''}, -\ 'co': {'select': ''}, -\ 'each': {'select': ''}, -\ 'ap': [{'select': ''}, {'mode': ''}] -\ }, -\ 'aliases': { -\ 'tmatch': 'xsl:template', -\ 'tname': 'xsl:template', -\ 'var': 'xsl:variable', -\ 'vari': 'xsl:variable', -\ 'if': 'xsl:if', -\ 'call': 'xsl:call-template', -\ 'wp': 'xsl:with-param', -\ 'par': 'xsl:param', -\ 'val': 'xsl:value-of', -\ 'attr': 'xsl:attribute', -\ 'co' : 'xsl:copy-of', -\ 'each' : 'xsl:for-each', -\ 'ap' : 'xsl:apply-templates' -\ }, -\ 'expandos': { -\ 'choose': 'xsl:choose>xsl:when+xsl:otherwise' -\ } -\ }, -\ 'haml': { -\ 'extends': 'html' -\ }, -\ 'xhtml': { -\ 'extends': 'html' -\ }, -\ 'mustache': { -\ 'extends': 'html' -\ } -\} - -if exists('g:user_zen_settings') - call s:zen_mergeConfig(s:zen_settings, g:user_zen_settings) -endif - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim:set et: diff --git a/dot.vim/bundle/vim-coffee-script b/dot.vim/bundle/vim-coffee-script deleted file mode 160000 index 7d2042a..0000000 --- a/dot.vim/bundle/vim-coffee-script +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7d2042aecacca773c57bf3827d2f9a27ad3a348b diff --git a/dot.vim/colors/deveiate.vim b/dot.vim/colors/deveiate.vim deleted file mode 100644 index 354265f..0000000 --- a/dot.vim/colors/deveiate.vim +++ /dev/null @@ -1,90 +0,0 @@ -" -" Vim color theme: DevEiate -" -" Gvim color definition file, based loosely on Michael Granger's -" eye-pleasing theme for Textmate of the same name. -" Mahlon E. Smith -" Michael Granger -" -" Drop this into your ~/.vim/colors directory, then load it via -" :colorscheme deveiate -" -" $Id: deveiate.vim 66 2008-06-30 02:28:56Z mahlon $ - - -" ---------------------------------------- -" Color definition reference -" ---------------------------------------- -" :help group-name -" :help highlight-groups -" :help cterm-colors - -set background=dark -highlight clear -let g:colors_name="deveiate" - -" ---------------------------------------- -" highlight groups -" ---------------------------------------- -highlight Normal guifg=#f6dfb2 guibg=#00000f -highlight LineNr guifg=#333333 -highlight Cursor guibg=yellow guifg=NONE -highlight CursorLine guibg=#171520 -highlight Search guibg=#001632 guifg=NONE -highlight Visual guibg=#001632 guifg=NONE -highlight VisualNOS guibg=#001632 guifg=NONE -highlight Question guifg=yellow -highlight StatusLine guibg=#d4d2cb guifg=#292087 -highlight StatusLineNC guibg=#8372be guifg=#22115c -highlight TabLine guibg=black guifg=#333333 -highlight TabLineSel guibg=#333333 guifg=#f8f8f8 -highlight TabLineFill guifg=black -highlight WildMenu guifg=yellow guibg=#22115c -highlight Pmenu guibg=black guifg=#da8d53 -highlight PmenuSel guibg=black guifg=#76a3d7 -highlight PmenuSbar guibg=black -highlight PmenuThumb guibg=black guifg=#333333 -highlight Folded guifg=#8b98ab guibg=black -highlight FoldColumn guifg=#8b98ab guibg=black -highlight VertSplit guifg=black guibg=#333333 -highlight DiffAdd guifg=#f8f8f8 guibg=#253b22 -highlight DiffChange guifg=#f8f8f8 guibg=#4a410d -highlight DiffDelete guifg=#f8f8f8 guibg=#420e09 -highlight DiffText guifg=white guibg=#7d6f20 -highlight NonText guifg=#222222 - -" ---------------------------------------- -" syntax highlighting groups -" ---------------------------------------- -highlight Comment guifg=#a82419 -highlight Constant guifg=#76a3d7 -highlight Function guifg=#9b859d -highlight String guifg=#da8d53 -highlight Special guifg=#da8d53 -highlight PreProc gui=bold guifg=#00cbcd -highlight Identifier guifg=#9bda8b -highlight Number guifg=#9bda8b -highlight Float guifg=#9bda8b -highlight Statement guifg=#00cbcd -highlight todo guibg=NONE guifg=yellow -highlight MatchParen guifg=yellow guibg=NONE - - -" ---------------------------------------- -" ruby specific syntax highlighting -" ---------------------------------------- -highlight rubyConstant guifg=#76a3d7 -highlight rubyInstanceVariable guifg=#c2eaf4 -highlight rubyClassVariable guifg=#c2eaf4 -highlight rubySymbol guifg=#9bda8b -highlight rubyEscape guifg=#ddf2a4 -highlight rubyInterpolation guifg=#ddf2a4 -highlight rubyClass guifg=#c3adc5 -highlight rubyPseudoVariable guifg=#9bda8b -highlight rubyOperator guifg=#00cbcd - -" ---------------------------------------- -" other misc colors -" ---------------------------------------- -highlight MyTagListFileName guifg=yellow guibg=NONE - diff --git a/dot.vim/colors/focuspoint.vim b/dot.vim/colors/focuspoint.vim deleted file mode 100644 index a199393..0000000 --- a/dot.vim/colors/focuspoint.vim +++ /dev/null @@ -1,110 +0,0 @@ -" Vim color file inherit from the molokai.vim file -" -" Author: Chase Colman -" Version: 0.1 (2011.02.06) -" -" Note: Based on the molokai theme for vim -" by Tomas Restrepo who based it on Monokai 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="focuspoint" - -hi Boolean guifg=#CD5C5C -hi Character guifg=#E6DB74 -hi Number guifg=#CD5C5C -hi String guifg=#E6DB74 guibg=#242829 -hi Conditional guifg=#43AB59 gui=bold -hi Constant guifg=#CD5C5C gui=bold -hi Cursor guifg=#000000 guibg=#F8F8F0 -hi Debug guifg=#BCA3A3 gui=bold -hi Define guifg=#71ABC2 -hi Delimiter guifg=#8F8F8F -hi DiffAdd guibg=#13354A -hi DiffChange guifg=#89807D guibg=#4C4745 -hi DiffDelete guifg=#CD5C5C guibg=#571F1F -hi DiffText guibg=#4C4745 gui=italic,bold - -hi Directory guifg=#d1c79e gui=bold -hi Error guifg=#CD5C5C guibg=#571F1F -hi ErrorMsg guifg=#43AB59 guibg=#232526 gui=bold -hi Exception guifg=#d1c79e gui=bold -hi Float guifg=#CD5C5C -hi FoldColumn guifg=#465457 guibg=#000000 -hi Folded guifg=#465457 guibg=#000000 -hi Function guifg=#d1c79e -hi Identifier guifg=#BD8F2E -hi Ignore guifg=#808080 guibg=bg -hi IncSearch guifg=#C4BE89 guibg=#000000 - -hi Keyword guifg=#43AB59 gui=bold -hi Label guifg=#E6DB74 gui=none -hi Macro guifg=#C4BE89 gui=italic -hi SpecialKey guifg=#71ABC2 gui=italic - -hi MatchParen guifg=fg guibg=#455354 gui=bold -hi ModeMsg guifg=#E6DB74 -hi MoreMsg guifg=#E6DB74 -hi Operator guifg=#43AB59 - -" complete menu -hi Pmenu guifg=#87CEEB guibg=#000000 -hi PmenuSel guibg=#808080 -hi PmenuSbar guibg=#080808 -hi PmenuThumb guifg=#87CEEB - -hi PreCondit guifg=#d1c79e gui=bold -hi PreProc guifg=#d1c79e -hi Question guifg=#71ABC2 -hi Repeat guifg=#43AB59 gui=bold -hi Search guifg=#FFFFFF guibg=#455354 -" marks column -hi SignColumn guifg=#d1c79e guibg=#232526 -hi SpecialChar guifg=#43AB59 guibg=#242829 gui=bold -hi SpecialComment guifg=#465457 gui=bold -hi Special guifg=#71ABC2 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=#43AB59 gui=bold -hi StatusLine guifg=#455354 guibg=fg -hi StatusLineNC guifg=#7F7F7F guibg=#232526 -hi StorageClass guifg=#BD8F2E gui=italic -hi Structure guifg=#71ABC2 -hi Tag guifg=#43AB59 gui=italic -hi Title guifg=#ef5939 -hi Todo guifg=bg guibg=#71ABC2 gui=underline,bold - -hi Typedef guifg=#71ABC2 -hi Type guifg=#71ABC2 gui=bold -hi Underlined guifg=#808080 gui=underline - -hi VertSplit guifg=#080808 guibg=#080808 gui=bold -hi VisualNOS guibg=#403D3D -hi Visual guibg=#403D3D -hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold -hi WildMenu guifg=#71ABC2 guibg=#000000 - -hi Normal guifg=#F8F8F2 guibg=#1B1D1E -hi Comment guifg=#465457 -hi CursorLine guibg=#293739 -hi CursorColumn guibg=#293739 -hi LineNr guifg=#7F7F7F guibg=#232526 -hi NonText guifg=#232526 guibg=#232526 - diff --git a/dot.vim/colors/fruity.vim b/dot.vim/colors/fruity.vim deleted file mode 100644 index 261500c..0000000 --- a/dot.vim/colors/fruity.vim +++ /dev/null @@ -1,147 +0,0 @@ -" -" Fruity Color Scheme -" =================== -" -" Author: Armin Ronacher -" 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/dot.vim/colors/gardener.vim b/dot.vim/colors/gardener.vim deleted file mode 100644 index 6f71bc8..0000000 --- a/dot.vim/colors/gardener.vim +++ /dev/null @@ -1,271 +0,0 @@ -" Vim color file -" Original Maintainer: Anders Korte - -" Modified: by entheon -" Last Change: 13 Sept 2005 - -" Gardener v1.1 -" A modification of the Guardian colorscheme v1.2 - -" 'For code surgeons and web gardeners everywhere' - -" A nice earthy color scheme which is easy on the eyes. It -" has as it's base a dark background monocrhomatic khaki -" scheme with dabs of color thrown in here and there on the -" keywords. Plus lots of extra config options so you can -" tweak it to your liking and or make it more like the -" original Guardian scheme. All the defaults are what I like -" but if you want to change stuff just set the right var and -" it will change pretty much immediately, you might have to -" move out of and back into your buffer for it to refresh. - - -" Features: -" 256 Color XTerm Compatibility -" Richer Syntax -" Black Background -" Functions -" No Italics -" Purple Booleans -" Swapped Status Line Colors -" Other minor tweaks - -" Change Log: -" changed the ghastly puke salmon red to green like it -" should have been in the first place esp considering the -" name Gardener, now all vimsters can truly frolic in -" their Vim Gardens - -" Options: -" g:gardener_light_comments -" if this var exists then comments are white on a -" gray-blue background if it is not set then the -" comments default to medium grey with no background -" color, I can't stand bg colors but some people might -" like it, so I left it as an option. -" -" g:gardener_soil -" This is a GUI only option because there are no -" colors that work even in the 256 color XTerm. This -" option gives you a brownish background instead of a -" black background. I think the black background gives -" better contrast and thus is easier to read from. if -" you disagree then you've got this option -" -" g:gardener_setnum -" turns the background of the line numbers black - -" Using The Options: -" To enable a feature add the line -" let g:gardenter_some_feature=1 -" to your ~/.vimrc -" To disable the feature temporarily run the command -" :unlet g:gardener_some_feature -" To disable the feature permanently, simply remove -" the line from your .vimrc file. - -set background=dark -hi clear -syntax reset - -if has("gui_running") - -" Colors for the User Interface. - if exists("g:gardener_setnum") - hi linenr guibg=black guifg=#808080 gui=bold - else - hi linenr guibg=#262626 guifg=#808080 gui=bold - endif - - hi Cursor guibg=#cc4455 guifg=white gui=bold - hi link CursorIM Cursor - if exists("g:gardener_soil") - hi Normal guibg=#332211 guifg=white gui=none - else - hi Normal guibg=black guifg=white gui=none - endif - hi NonText guibg=#445566 guifg=#ffeecc gui=bold - hi Visual guibg=#557799 guifg=white gui=none - - hi Directory guibg=bg guifg=#337700 gui=none - - hi IncSearch guibg=#0066cc guifg=white gui=none - hi link Seach IncSearch - - hi SpecialKey guibg=bg guifg=fg gui=none - hi Titled guibg=bg guifg=fg gui=none - - hi ErrorMsg guibg=bg guifg=#ff0000 gui=bold - hi ModeMsg guibg=bg guifg=#ffeecc gui=none - hi link MoreMsg ModeMsg - hi Question guibg=bg guifg=#ccffcc gui=bold - hi link WarningMsg ErrorMsg - - hi StatusLineNC guibg=#ffeecc guifg=black gui=none - hi StatusLine guibg=#cc4455 guifg=white gui=bold - hi VertSplit guibg=#ffeecc guifg=black gui=none - - hi DiffAdd guibg=#446688 guifg=fg gui=none - hi DiffChange guibg=#558855 guifg=fg gui=none - hi DiffDelete guibg=#884444 guifg=fg gui=none - hi DiffText guibg=#884444 guifg=fg gui=bold - - " Colors for Syntax Highlighting. - if exists("g:gardener_light_comments") - hi Comment guibg=#334455 guifg=#dddddd gui=none - else - hi Comment guibg=bg guifg=#888888 gui=none - endif - - - hi Define guibg=bg guifg=#66ccdd gui=bold - hi Conditional guibg=bg guifg=#aadd55 gui=bold - - hi Constant guibg=bg guifg=white gui=bold - hi Identifier guibg=bg guifg=#ffddaa gui=none - hi String guibg=bg guifg=#ffffcc gui=none - hi Character guibg=bg guifg=#ffffcc gui=bold - hi Number guibg=bg guifg=#bbddff gui=bold - hi Boolean guibg=bg guifg=#ff55ff gui=bold - hi Float guibg=bg guifg=#bbddff gui=bold - - hi Function guibg=bg guifg=#ffffaa gui=bold - hi Statement guibg=bg guifg=#ffffcc gui=bold - - hi Repeat guibg=bg guifg=#ff9900 gui=bold - hi Label guibg=bg guifg=#ffccff gui=bold - hi Operator guibg=bg guifg=#cc9966 gui=bold - hi Keyword guibg=bg guifg=#66ffcc gui=bold - hi Exception guibg=bg guifg=#66ffcc gui=bold - - hi PreProc guibg=bg guifg=#ffcc99 gui=bold - hi Include guibg=bg guifg=#99cc99 gui=bold - hi link Macro Include - hi link PreCondit Include - - hi Type guibg=bg guifg=#ccffaa gui=bold - hi Structure guibg=bg guifg=#99ff99 gui=bold - hi Typedef guibg=bg guifg=#99cc99 gui=italic - - hi StorageClass guibg=bg guifg=#99cc99 gui=bold - hi Special guibg=bg guifg=#bbddff gui=bold - hi SpecialChar guibg=bg guifg=#bbddff gui=bold - hi Tag guibg=bg guifg=#bbddff gui=bold - hi Delimiter guibg=bg guifg=fg gui=bold - hi SpecialComment guibg=#334455 guifg=#dddddd gui=italic - hi Debug guibg=bg guifg=#ff9999 gui=none - - hi Underlined guibg=bg guifg=#99ccff gui=underline - - hi Title guibg=#445566 guifg=white gui=bold - hi Ignore guibg=bg guifg=#cccccc gui=italic - hi Error guibg=#ff0000 guifg=white gui=bold - hi Todo guibg=#556677 guifg=#ff0000 gui=bold - - hi htmlH1 guibg=bg guifg=#ffffff gui=bold - hi htmlH2 guibg=bg guifg=#dadada gui=bold - hi htmlH3 guibg=bg guifg=#c6c6c6 gui=bold - hi htmlH4 guibg=bg guifg=#b2b2b2 gui=bold - hi htmlH5 guibg=bg guifg=#9e9e9e gui=bold - hi htmlH6 guibg=bg guifg=#8a8a8a gui=bold - -else -" Colors for the User Interface. - - if exists("g:gardener_setnum") - exec "hi linenr cterm=BOLD ctermfg=235 ctermbg=244" - else - exec "hi linenr cterm=BOLD ctermfg=244 ctermbg=235" - endif - - - exec "hi Cursor cterm=BOLD ctermfg=255 ctermbg=167" - exec "hi CursorIM cterm=BOLD ctermfg=255 ctermbg=167" - - exec "hi Normal cterm=NONE ctermfg=255 ctermbg=233" - exec "hi NonText cterm=NONE ctermfg=230 ctermbg=233" - exec "hi Visual cterm=NONE ctermfg=255 ctermbg=68" - - exec "hi Linear cterm=NONE ctermfg=248 ctermbg=NONE" - - exec "hi Directory cterm=NONE ctermfg=64 ctermbg=NONE" - - exec "hi IncSearch cterm=NONE ctermfg=255 ctermbg=25" - - exec "hi ErrorMsg cterm=BOLD ctermfg=196 ctermbg=NONE" - exec "hi WarningMsg cterm=BOLD ctermfg=196 ctermbg=NONE" - exec "hi ModeMsg cterm=NONE ctermfg=230 ctermbg=NONE" - exec "hi MoreMsg cterm=NONE ctermfg=230 ctermbg=NONE" - exec "hi Question cterm=NONE ctermfg=194 ctermbg=NONE" - - exec "hi StatusLineNC cterm=NONE ctermfg=16 ctermbg=229" - exec "hi StatusLine cterm=BOLD ctermfg=255 ctermbg=167" - exec "hi VertSplit cterm=NONE ctermfg=16 ctermbg=229" - - exec "hi DiffAdd cterm=NONE ctermfg=255 ctermbg=60" - exec "hi DiffAdd cterm=NONE ctermfg=255 ctermbg=65" - exec "hi DiffAdd cterm=NONE ctermfg=255 ctermbg=95" - exec "hi DiffAdd cterm=BOLD ctermfg=255 ctermbg=95" - - " Colors for Syntax Highlighting. - if exists("g:gardener_light_comments") - exec "hi Comment cterm=NONE ctermfg=253 ctermbg=60" - else - exec "hi Comment cterm=NONE ctermfg=244 ctermbg=NONE" - endif - - exec "hi Constant cterm=BOLD ctermfg=255 ctermbg=NONE" - exec "hi String cterm=NONE ctermfg=230 ctermbg=NONE" - exec "hi Character cterm=BOLD ctermfg=230 ctermbg=NONE" - exec "hi Number cterm=BOLD ctermfg=153 ctermbg=NONE" - exec "hi Boolean cterm=NONE ctermfg=207 ctermbg=NONE" - exec "hi Float cterm=BOLD ctermfg=153 ctermbg=NONE" - - exec "hi Identifier cterm=NONE ctermfg=223 ctermbg=NONE" - exec "hi Function cterm=BOLD ctermfg=229 ctermbg=NONE" - exec "hi Statement cterm=BOLD ctermfg=230 ctermbg=NONE" - - exec "hi Define cterm=BOLD ctermfg=68 ctermbg=NONE" - exec "hi Conditional cterm=BOLD ctermfg=149 ctermbg=NONE" - - exec "hi Repeat cterm=BOLD ctermfg=208 ctermbg=NONE" - exec "hi Label cterm=BOLD ctermfg=225 ctermbg=NONE" - exec "hi Operator cterm=BOLD ctermfg=173 ctermbg=NONE" - exec "hi Keyword cterm=BOLD ctermfg=86 ctermbg=NONE" - exec "hi Exception cterm=BOLD ctermfg=86 ctermbg=NONE" - - exec "hi PreProc cterm=BOLD ctermfg=222 ctermbg=NONE" - exec "hi Include cterm=BOLD ctermfg=114 ctermbg=NONE" - exec "hi Macro cterm=BOLD ctermfg=114 ctermbg=NONE" - exec "hi PreCondit cterm=BOLD ctermfg=114 ctermbg=NONE" - - exec "hi Type cterm=BOLD ctermfg=193 ctermbg=NONE" - exec "hi StorageClass cterm=BOLD ctermfg=78 ctermbg=NONE" - exec "hi Structure cterm=BOLD ctermfg=114 ctermbg=NONE" - exec "hi Typedef cterm=BOLD ctermfg=114 ctermbg=NONE" - - exec "hi Special cterm=BOLD ctermfg=153 ctermbg=NONE" - exec "hi SpecialChar cterm=BOLD ctermfg=153 ctermbg=NONE" - exec "hi Tag cterm=BOLD ctermfg=153 ctermbg=NONE" - exec "hi Delimiter cterm=BOLD ctermfg=255 ctermbg=NONE" - exec "hi SpecialComment cterm=BOLD ctermfg=253 ctermbg=24" - exec "hi Debug cterm=NONE ctermfg=210 ctermbg=NONE" - - exec "hi Title cterm=BOLD ctermfg=255 ctermbg=60" - exec "hi Ignore cterm=NONE ctermfg=251 ctermbg=NONE" - exec "hi Error cterm=NONE ctermfg=255 ctermbg=196" - exec "hi Ignore cterm=NONE ctermfg=196 ctermbg=60" - - exec "hi htmlH1 cterm=BOLD ctermfg=255 ctermbg=NONE" - exec "hi htmlH2 cterm=BOLD ctermfg=253 ctermbg=NONE" - exec "hi htmlH3 cterm=BOLD ctermfg=251 ctermbg=NONE" - exec "hi htmlH4 cterm=BOLD ctermfg=249 ctermbg=NONE" - exec "hi htmlH5 cterm=BOLD ctermfg=247 ctermbg=NONE" - exec "hi htmlH6 cterm=BOLD ctermfg=245 ctermbg=NONE" - -endif -" And finally. - -let g:colors_name = "gardener" -let colors_name = "gardener" - diff --git a/dot.vim/colors/inkpot.vim b/dot.vim/colors/inkpot.vim deleted file mode 100644 index c6ecb46..0000000 --- a/dot.vim/colors/inkpot.vim +++ /dev/null @@ -1,216 +0,0 @@ -" Vim color file -" Name: inkpot.vim -" Maintainer: Ciaran McCreesh -" 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! M(a) - return strpart("0135", a:a, 1) + 0 -endfun - -" map a urxvt colour to an xterm-256 colour -fun! 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 + M(l:x) + (6 * M(l:y)) + (36 * 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=" . X(79) . " ctermbg=" . X(80) - else - exec "hi Normal cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(16) - endif - - exec "hi IncSearch cterm=BOLD ctermfg=" . X(80) . " ctermbg=" . X(73) - exec "hi Search cterm=NONE ctermfg=" . X(80) . " ctermbg=" . X(52) - exec "hi ErrorMsg cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(48) - exec "hi WarningMsg cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(68) - exec "hi ModeMsg cterm=BOLD ctermfg=" . X(38) . " ctermbg=" . "NONE" - exec "hi MoreMsg cterm=BOLD ctermfg=" . X(38) . " ctermbg=" . "NONE" - exec "hi Question cterm=BOLD ctermfg=" . X(52) . " ctermbg=" . "NONE" - - exec "hi StatusLine cterm=BOLD ctermfg=" . X(85) . " ctermbg=" . X(81) - exec "hi User1 cterm=BOLD ctermfg=" . X(28) . " ctermbg=" . X(81) - exec "hi User2 cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . X(81) - exec "hi StatusLineNC cterm=NONE ctermfg=" . X(84) . " ctermbg=" . X(81) - exec "hi VertSplit cterm=NONE ctermfg=" . X(84) . " ctermbg=" . X(81) - - exec "hi WildMenu cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(38) - - exec "hi MBENormal ctermfg=" . X(85) . " ctermbg=" . X(81) - exec "hi MBEChanged ctermfg=" . X(87) . " ctermbg=" . X(81) - exec "hi MBEVisibleNormal ctermfg=" . X(85) . " ctermbg=" . X(82) - exec "hi MBEVisibleChanged ctermfg=" . X(87) . " ctermbg=" . X(82) - - exec "hi DiffText cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(34) - exec "hi DiffChange cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(17) - exec "hi DiffDelete cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(32) - exec "hi DiffAdd cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(20) - - exec "hi Folded cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(35) - exec "hi FoldColumn cterm=NONE ctermfg=" . X(39) . " ctermbg=" . X(80) - - exec "hi Directory cterm=NONE ctermfg=" . X(28) . " ctermbg=" . "NONE" - exec "hi LineNr cterm=NONE ctermfg=" . X(39) . " ctermbg=" . X(80) - exec "hi NonText cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . "NONE" - exec "hi SpecialKey cterm=BOLD ctermfg=" . X(55) . " ctermbg=" . "NONE" - exec "hi Title cterm=BOLD ctermfg=" . X(48) . " ctermbg=" . "NONE" - exec "hi Visual cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(38) - - exec "hi Comment cterm=NONE ctermfg=" . X(52) . " ctermbg=" . "NONE" - exec "hi Constant cterm=NONE ctermfg=" . X(73) . " ctermbg=" . "NONE" - exec "hi String cterm=NONE ctermfg=" . X(73) . " ctermbg=" . X(81) - exec "hi Error cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(32) - exec "hi Identifier cterm=NONE ctermfg=" . X(53) . " ctermbg=" . "NONE" - exec "hi Ignore cterm=NONE" - exec "hi Number cterm=NONE ctermfg=" . X(69) . " ctermbg=" . "NONE" - exec "hi PreProc cterm=NONE ctermfg=" . X(25) . " ctermbg=" . "NONE" - exec "hi Special cterm=NONE ctermfg=" . X(55) . " ctermbg=" . "NONE" - exec "hi SpecialChar cterm=NONE ctermfg=" . X(55) . " ctermbg=" . X(81) - exec "hi Statement cterm=NONE ctermfg=" . X(27) . " ctermbg=" . "NONE" - exec "hi Todo cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(57) - exec "hi Type cterm=NONE ctermfg=" . X(71) . " ctermbg=" . "NONE" - exec "hi Underlined cterm=BOLD ctermfg=" . X(77) . " ctermbg=" . "NONE" - exec "hi TaglistTagName cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . "NONE" - - if v:version >= 700 - exec "hi Pmenu cterm=NONE ctermfg=" . X(87) . " ctermbg=" . X(82) - exec "hi PmenuSel cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(38) - exec "hi PmenuSbar cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(39) - exec "hi PmenuThumb cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(39) - - exec "hi SpellBad cterm=NONE ctermbg=" . X(32) - exec "hi SpellRare cterm=NONE ctermbg=" . X(33) - exec "hi SpellLocal cterm=NONE ctermbg=" . X(36) - exec "hi SpellCap cterm=NONE ctermbg=" . X(21) - exec "hi MatchParen cterm=NONE ctermbg=" . X(14) . "ctermfg=" . X(25) - endif -endif - -" vim: set et : diff --git a/dot.vim/colors/nightflight2.vim b/dot.vim/colors/nightflight2.vim deleted file mode 100644 index d5c653b..0000000 --- a/dot.vim/colors/nightflight2.vim +++ /dev/null @@ -1,47 +0,0 @@ -" local syntax file - set colors on a per-machine basis: -" vim: tw=0 ts=4 sw=4 -" Vim color file -" Maintainer: Ralf Holly -" Last Change: 2006 Dec 28 - -hi! clear -set background=dark -if exists("syntax_on") - syntax reset -endi - -let g:colors_name = "nightflight2" -"hi! Normal cterm=none ctermfg=darkgrey ctermbg=black guifg=#c0c0ff guibg=#000020 -hi! Normal cterm=none ctermfg=darkgrey ctermbg=black guifg=#c0c0ff guibg=#000025 -hi! Scrollbar cterm=bold ctermfg=darkcyan ctermbg=cyan guifg=darkcyan guibg=cyan -hi! Menu guifg=black guibg=cyan -hi! SpecialKey term=bold cterm=bold ctermfg=yellow guifg=yellow -hi! NonText term=bold cterm=bold ctermfg=yellow gui=none guifg=yellow -hi! Directory term=bold cterm=bold ctermfg=cyan guifg=cyan -hi! ErrorMsg term=standout cterm=bold ctermfg=white ctermbg=red guifg=white guibg=red -hi! Search term=reverse ctermfg=cyan ctermbg=blue guifg=cyan guibg=blue -hi! MoreMsg term=bold cterm=bold ctermfg=darkgreen gui=bold guifg=seagreen -hi! ModeMsg term=bold cterm=bold gui=bold guifg=white guibg=blue -hi! LineNr term=underline cterm=bold ctermfg=darkgrey guifg=#505070 -hi! Question term=standout cterm=bold ctermfg=darkgreen gui=bold guifg=green -hi! StatusLine term=bold,reverse cterm=bold ctermfg=black ctermbg=cyan gui=bold guifg=black guibg=cyan -hi! StatusLineNC term=reverse ctermfg=black ctermbg=darkcyan guifg=darkcyan guibg=black -hi! Title term=bold cterm=bold ctermfg=darkmagenta gui=bold guifg=magenta -hi! Visual term=reverse cterm=bold ctermfg=black ctermbg=white guifg=black guibg=white -hi! WarningMsg term=standout cterm=bold ctermfg=red guifg=red -hi! Cursor guifg=bg guibg=green -hi! Comment term=bold cterm=bold ctermfg=lightblue guifg=darkgrey -hi! Identifier term=bold cterm=bold ctermfg=green gui=none guifg=white -hi! Special term=bold cterm=bold ctermfg=cyan guifg=darkgrey -hi! Constant term=underline cterm=bold ctermfg=cyan guifg=#30df60 -hi! PreProc term=underline ctermfg=magenta guifg=#fcaf3e -hi! Statement term=bold cterm=bold ctermfg=green gui=none guifg=#8387ff -hi! Type term=underline cterm=bold ctermfg=lightgreen gui=none guifg=#8387ff -hi! Error term=reverse ctermfg=white ctermbg=red guifg=white guibg=red -hi! Todo term=standout ctermfg=white ctermbg=magenta guifg=white guibg=brown -" syntax match _COperators "+\|-\|\*\|;\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|)\|(\|{\|}\|\.\|\[\|\]" -hi! _COperators ctermfg=white guifg=white gui=none - -" For Vim 7 -hi! MatchParen ctermbg=blue guifg=white guibg=blue - diff --git a/dot.vim/colors/railcasts.vim b/dot.vim/colors/railcasts.vim deleted file mode 100644 index 2055b41..0000000 --- a/dot.vim/colors/railcasts.vim +++ /dev/null @@ -1,96 +0,0 @@ -" Vim color scheme -" -" Name: railscasts.vim -" Maintainer: Nick Moffitt -" Last Change: 01 Mar 2008 -" License: 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/dot.vim/colors/wombat.vim b/dot.vim/colors/wombat.vim deleted file mode 100644 index 9ad1e56..0000000 --- a/dot.vim/colors/wombat.vim +++ /dev/null @@ -1,51 +0,0 @@ -" 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/dot.vim/colors/wombat256mod.vim b/dot.vim/colors/wombat256mod.vim deleted file mode 100644 index 1137eb8..0000000 --- a/dot.vim/colors/wombat256mod.vim +++ /dev/null @@ -1,96 +0,0 @@ -" Vim color file -" Original Maintainer: Lars H. Nielsen (dengmao@gmail.com) -" Last Change: 2010-07-23 -" -" Modified version of wombat for 256-color terminals by -" David Liang (bmdavll@gmail.com) -" based on version by -" Danila Bespalov (danila.bespalov@gmail.com) - -set background=dark - -if version > 580 - hi clear - if exists("syntax_on") - syntax reset - endif -endif - -let colors_name = "wombat256mod" - - -" General colors -hi Normal ctermfg=252 ctermbg=234 cterm=none guifg=#e3e0d7 guibg=#242424 gui=none -hi Cursor ctermfg=234 ctermbg=228 cterm=none guifg=#242424 guibg=#eae788 gui=none -hi Visual ctermfg=251 ctermbg=239 cterm=none guifg=#c3c6ca guibg=#554d4b gui=none -hi VisualNOS ctermfg=251 ctermbg=236 cterm=none guifg=#c3c6ca guibg=#303030 gui=none -hi Search ctermfg=177 ctermbg=241 cterm=none guifg=#d787ff guibg=#636066 gui=none -hi Folded ctermfg=103 ctermbg=237 cterm=none guifg=#a0a8b0 guibg=#3a4046 gui=none -hi Title ctermfg=230 cterm=bold guifg=#ffffd7 gui=bold -hi StatusLine ctermfg=230 ctermbg=238 cterm=none guifg=#ffffd7 guibg=#444444 gui=italic -hi VertSplit ctermfg=238 ctermbg=238 cterm=none guifg=#444444 guibg=#444444 gui=none -hi StatusLineNC ctermfg=241 ctermbg=238 cterm=none guifg=#857b6f guibg=#444444 gui=none -hi LineNr ctermfg=241 ctermbg=232 cterm=none guifg=#857b6f guibg=#080808 gui=none -hi SpecialKey ctermfg=241 ctermbg=235 cterm=none guifg=#626262 guibg=#2b2b2b gui=none -hi WarningMsg ctermfg=203 guifg=#ff5f55 -hi ErrorMsg ctermfg=196 ctermbg=236 cterm=bold guifg=#ff2026 guibg=#3a3a3a gui=bold - -" Vim >= 7.0 specific colors -if version >= 700 -hi CursorLine ctermbg=236 cterm=none guibg=#32322f -hi MatchParen ctermfg=228 ctermbg=101 cterm=bold guifg=#eae788 guibg=#857b6f gui=bold -hi Pmenu ctermfg=230 ctermbg=238 guifg=#ffffd7 guibg=#444444 -hi PmenuSel ctermfg=232 ctermbg=192 guifg=#080808 guibg=#cae982 -endif - -" Diff highlighting -hi DiffAdd ctermbg=17 guibg=#2a0d6a -hi DiffDelete ctermfg=234 ctermbg=60 cterm=none guifg=#242424 guibg=#3e3969 gui=none -hi DiffText ctermbg=53 cterm=none guibg=#73186e gui=none -hi DiffChange ctermbg=237 guibg=#382a37 - -"hi CursorIM -"hi Directory -"hi IncSearch -"hi Menu -"hi ModeMsg -"hi MoreMsg -"hi PmenuSbar -"hi PmenuThumb -"hi Question -"hi Scrollbar -"hi SignColumn -"hi SpellBad -"hi SpellCap -"hi SpellLocal -"hi SpellRare -"hi TabLine -"hi TabLineFill -"hi TabLineSel -"hi Tooltip -"hi User1 -"hi User9 -"hi WildMenu - - -" Syntax highlighting -hi Keyword ctermfg=111 cterm=none guifg=#88b8f6 gui=none -hi Statement ctermfg=111 cterm=none guifg=#88b8f6 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=#cae982 gui=none -hi Identifier ctermfg=192 cterm=none guifg=#cae982 gui=none -hi Type ctermfg=186 cterm=none guifg=#d4d987 gui=none -hi Special ctermfg=229 cterm=none guifg=#eadead gui=none -hi String ctermfg=113 cterm=none guifg=#95e454 gui=italic -hi Comment ctermfg=246 cterm=none guifg=#9c998e gui=italic -hi Todo ctermfg=101 cterm=none guifg=#857b6f gui=italic - - -" Links -hi! link FoldColumn Folded -hi! link CursorColumn CursorLine -hi! link NonText LineNr - -" vim:set ts=4 sw=4 noet: diff --git a/dot.vim/colors/zenburn.vim b/dot.vim/colors/zenburn.vim deleted file mode 100644 index fba298c..0000000 --- a/dot.vim/colors/zenburn.vim +++ /dev/null @@ -1,315 +0,0 @@ -" Vim color file -" Maintainer: Jani Nurminen -" Last Change: $Id: zenburn.vim,v 2.5 2009/09/06 08:51:59 slinky Exp slinky $ -" 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. Then :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 -" -" CONFIGURABLE PARAMETERS: -" -" You can use the default (don't set any parameters), or you can -" set some parameters to tweak the Zenburn colours. -" -" * 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 -" -" * 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 NonText guifg=#404040 -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 NonText ctermfg=238 - 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 - 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 - 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 -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 -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 a bit different Error - hi Error guifg=#ef9f9f guibg=#201010 gui=bold -else - " default - hi Error guifg=#e37170 guibg=#332323 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/dot.vim/compiler/javac_ex.vim b/dot.vim/compiler/javac_ex.vim deleted file mode 100644 index 5ae0a09..0000000 --- a/dot.vim/compiler/javac_ex.vim +++ /dev/null @@ -1,19 +0,0 @@ -" Vim compiler file -" Compiler: javac -" Maintainer: Doug Kearns -" URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/javac.vim -" Last Change: 2004 Nov 27 - -if exists("current_compiler") - finish -endif -let current_compiler = "javac_ex" - -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal -endif - -CompilerSet makeprg=javac - -"CompilerSet errorformat=%E%f:%l:\ %m,%-Z%p^,%-C%.%#,%-G%.%# -CompilerSet errorformat=%E%f:%l:\ %m,%-Z%p^,%+C%.%#,%-G.%# \ No newline at end of file diff --git a/dot.vim/doc/CuteTodoList.txt b/dot.vim/doc/CuteTodoList.txt deleted file mode 100644 index 5b3870e..0000000 --- a/dot.vim/doc/CuteTodoList.txt +++ /dev/null @@ -1,129 +0,0 @@ -*CuteTodoList.txt* Plugin to handle a todo list, nicely (v1.3) - - Cute Todo List Plugin ~ - -1. The what and why of todoLists. |cuteTodoList| -2. How to use the different commands. |cuteTodoCommands| -3. How to manage the list. |cuteBufferUsage| -4. How to tweak the Todo list. |cuteTodoConfiguration| - -============================================================================== -*cuteTodoList* - -1. Why a Cute Todo list that even kitteh can't match ?~ - The aim of this plug-in is to provide a nice 'to do' list which doesn't - interfere with your code. All the things to do are stored in separate - files. - - Moreover the tasks can have priorities, and be sorted accordingly, - which help to manage the work flow without leaving Vim. - - The files containing tasks are stored at two distinct places : > - ~/.global.todo.txt - $pwd/.todo.txt -< - The global one is stored on your home directory, opened every time you use - the to-do list. The local one is intended to be used as a project-specific - list. - - This plug-in can also extract all tasks gathered in your open buffer. - If you mark something TODO in your document, you will see it appear in the - list after the next (manual) update. - - To be able to use this plugin, you must put : > - set nocompatible -> somwhere on your .vimrc - -============================================================================== -*cuteTodoCommands* List of hoogle related command - -2. Cute Todo List commands ~ - *TodoOpen* *:TodoOpen* - :TodoOpen - Open the Todo Window at the top or bottom of your current window. Cursor - stay at it's current position. - - *TodoClose* *:TodoClose* - :TodoClose - Close the Todo Window, whenever it is. Cursor stay where it is. - - *Todo* *:Todo* - :Todo - Add a todo in the local list. A prompt will appear to type the todo text. - - *Todog* *:Todog* - :Todog - Add a todo in the global list. A prompt will appear to type the todo text. - -============================================================================== -*cuteBufferUsage* How to use the todolist buffer - -3. Cute Todo List Buffer usage. ~ - *todo_+* - + - Increase task priority. The icon should transform from down arrow to (!). - - *todo_-* - - - Decrease task priority. The icon should transform from (!) to down arrow. - - *todo_^* - ^ - Move the task up in the list. - - *todo_v* - v - Move the task down in the list. - - *todo_m* - m - Modify the task, you'll be prompted to modify the text in the command - line. - - *todo_o* - o - Jump to the location of the gathered todo. - - *todo_s* - s - Sort the todos. Press multiple times to change sorting factor. - - *todo_u* - u - Scan all the open buffer to search for TODO and add them to the todo list - view. - ** - - Delete a task, no confirmation asked. the simple 'd' was avoided to - prevent manipulation error. - -============================================================================== -*cuteTodoConfiguration* Variables controlling CuteTodoList configuration - -4. Cute Todo List tweaks ~ - - *g:todo_list_buff_name* *todo_list_buff_name* -g:todo_list_buff_name - Default name of the todo list window, the default is 'Todo\ List', you - must escape spaces, as it is used as an Ex command argument. To change the - window name, use the following command : > - :let g:todo_list_buff_name= 'The\ name\ you\ want' -< - - *g:todo_generate_auto* *todo_generate_auto* -g:todo_generate_auto - To disable automatic generation : > - :let g:todo_generate_auto = 0 -< - *g:todo_list_filename* *todo_list_filename* -g:todo_list_filename - File name used to store the todo lists. The default is .todo.txt - - *g:todo_list_globfilename* *todo_list_globfilename* -g:todo_list_globfilename - File name used to store the global todo list. The defult is - '.global.todo.txt' - -============================================================================== - vim:tw=78:ts=8:ft=help:norl: - diff --git a/dot.vim/doc/Makefile b/dot.vim/doc/Makefile deleted file mode 100644 index 99a4861..0000000 --- a/dot.vim/doc/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -projects = latex-suite latex-suite-quickstart -htmlfiles = $(addsuffix .html, $(projects)) -txtfiles = $(addsuffix .txt, $(projects)) -cssfiles = $(addsuffix .css, $(projects)) -all = $(projects) $(htmlfiles) $(cssfiles) $(txtfiles) - - -xsltproc=xsltproc -db2vim=../../db2vim/db2vim - -# Use for debugging: -#xsltproc=strace -e trace=file xsltproc --nonet --load-trace -# export XML_DEBUG_CATALOG = 1 - -# Specify local catalog to not use system installed dtd/xsl files -# export XML_CATALOG_FILES=catalog.xml - -# User configuration of this Makefile goes into Makefile.local -# E.g. to use a catalog file installed by the user. --include Makefile.local - -# Default Target is to create all documentation files -all: $(all) - -# create multi page html (chunk xhtml) -$(projects): %: %.xml latex-suite-chunk.xsl latex-suite-common.xsl - $(xsltproc) -o $@/ latex-suite-chunk.xsl $< - -# create single html files -$(htmlfiles): %.html: %.xml latex-suite.xsl latex-suite-common.xsl - $(xsltproc) -o $@ latex-suite.xsl $< - -# create vim flat files -latex-suite.txt: %.txt: %.xml - $(db2vim) --prefix=ls_ $< > $@ - -latex-suite-quickstart.txt: %.txt: %.xml - $(db2vim) --prefix=lq_ $< > $@ - -# validate xml -validate: - for file in *.xml; do \ - xmllint --valid --noout $$file; \ - done - -clean: - rm -f $(htmlfiles) - rm -rf $(projects) - -# $(txtfiles) are currently in revision control, therefore they are not -# removed in the clean target -mr-proper: clean - rm -f $(txtfiles) - -upload: $(all) - rsync --delete -lrtvz $(all) shell.sourceforge.net:/home/groups/v/vi/vim-latex/htdocs/documentation/ -# Make sure that directories are group writeable, depends on bash beeing the remote shell - ssh shell.sourceforge.net chmod g+w "/home/groups/v/vi/vim-latex/htdocs/documentation/latex-suite{,-quickstart}" - -# vim:nowrap diff --git a/dot.vim/doc/Makefile.in b/dot.vim/doc/Makefile.in deleted file mode 100644 index 6d5e614..0000000 --- a/dot.vim/doc/Makefile.in +++ /dev/null @@ -1,29 +0,0 @@ -# Manual files -ls-flat: - java com.icl.saxon.StyleSheet latex-suite.xml latex-suite.xsl > latex-suite.html - -ls-chunk: - ( \ - cd latex-suite && \ - java com.icl.saxon.StyleSheet ../latex-suite.xml ../latex-suite-chunk.xsl \ - ) - -ls-txt: - db2vim --prefix=ls_ latex-suite.xml > latex-suite.txt - -# Quickstart files -lsq-flat: - java com.icl.saxon.StyleSheet latex-suite-quickstart.xml latex-suite.xsl > latex-suite-quickstart.html - -lsq-chunk: - ( \ - cd latex-suite-quickstart && \ - java com.icl.saxon.StyleSheet ../latex-suite-quickstart.xml ../latex-suite-chunk.xsl \ - ) - -lsq-txt: - db2vim --prefix=lq_ latex-suite-quickstart.xml > latex-suite-quickstart.txt - -cvsci: - cvs ci latex-suite.xml latex-suite.txt -# vim:nowrap diff --git a/dot.vim/doc/NERD_commenter.txt b/dot.vim/doc/NERD_commenter.txt deleted file mode 100644 index 2a3aabe..0000000 --- a/dot.vim/doc/NERD_commenter.txt +++ /dev/null @@ -1,1266 +0,0 @@ -*NERD_commenter.txt* Plugin for commenting code - - - NERD COMMENTER REFERENCE MANUAL~ - - - - - -============================================================================== -CONTENTS *NERDCommenterContents* - - 1.Intro...................................|NERDCommenter| - 2.Functionality provided..................|NERDComFunctionality| - 2.1 Functionality Summary.............|NERDComFunctionalitySummary| - 2.2 Functionality Details.............|NERDComFunctionalityDetails| - 2.2.1 Comment map.................|NERDComComment| - 2.2.2 Nested comment map..........|NERDComNestedComment| - 2.2.3 Toggle comment map..........|NERDComToggleComment| - 2.2.4 Minimal comment map.........|NERDComMinimalComment| - 2.2.5 Invert comment map..........|NERDComInvertComment| - 2.2.6 Sexy comment map............|NERDComSexyComment| - 2.2.7 Yank comment map............|NERDComYankComment| - 2.2.8 Comment to EOL map..........|NERDComEOLComment| - 2.2.9 Append com to line map......|NERDComAppendComment| - 2.2.10 Prepend com to line map....|NERDComPrependComment| - 2.2.11 Insert comment map.........|NERDComInsertComment| - 2.2.12 Use alternate delims map...|NERDComAltDelim| - 2.2.13 Comment aligned maps.......|NERDComAlignedComment| - 2.2.14 Uncomment line map.........|NERDComUncommentLine| - 2.3 Supported filetypes...............|NERDComFiletypes| - 2.4 Sexy Comments.....................|NERDComSexyComments| - 2.5 The NERDComment function..........|NERDComNERDComment| - 3.Options.................................|NERDComOptions| - 3.1 Options summary...................|NERDComOptionsSummary| - 3.2 Options details...................|NERDComOptionsDetails| - 3.3 Default delimiter Options.........|NERDComDefaultDelims| - 3.4 Key mapping Options...............|NERDComMappings| - 4.Issues with the script..................|NERDComIssues| - 4.1 Delimiter detection heuristics....|NERDComHeuristics| - 4.2 Nesting issues....................|NERDComNesting| - 5.The author..............................|NERDComAuthor| - 6.Changelog...............................|NERDComChangelog| - 7.Credits.................................|NERDComCredits| - 8.License.................................|NERDComLicense| - -============================================================================== -1. Intro *NERDCommenter* - -The NERD commenter provides many different commenting operations and styles -which may be invoked via key mappings and a commenting menu. These operations -are available for most filetypes. - -There are also options available that allow you to tweak the commenting engine -to you taste. - -============================================================================== -2. Functionality provided *NERDComFunctionality* - ------------------------------------------------------------------------------- -2.1 Functionality summary *NERDComFunctionalitySummary* - -The following key mappings are provided by default (there is also a menu -provided that contains menu items corresponding to all the below mappings): - -Most of the following mappings are for normal/visual mode only. The -|NERDComInsertComment| mapping is for insert mode only. - -[count],cc |NERDComComment| -Comments out the current line or text selected in visual mode. - - -[count],cn |NERDComNestedComment| -Same as |NERDComComment| but forces nesting. - -[count],c |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],cm |NERDComMinimalComment| -Comments the given lines using only one set of multipart delimiters if -possible. - - -[count],ci |NERDComInvertComment| -Toggles the comment state of the selected line(s) individually. Each selected -line that is commented is uncommented and vice versa. - - -[count],cs |NERDComSexyComment| -Comments out the selected lines ``sexily'' - - -[count],cy |NERDComYankComment| -Same as |NERDComComment| except that the commented line(s) are yanked -before commenting. - - -,c$ |NERDComEOLComment| -Comments the current line from the cursor to the end of line. - - -,cA |NERDComAppendComment| -Adds comment delimiters to the end of line and goes into insert mode between -them. - - -,cI |NERDComPrependComment| -Adds comment delimiters to the start of line and goes into insert mode between -them. - - - |NERDComInsertComment| -Adds comment delimiters at the current cursor position and inserts between. - - -,ca |NERDComAltDelim| -Switches to the alternative set of delimiters. - - -[count],cl -[count],cr -[count],cb |NERDComAlignedComment| -Same as |NERDComComment| except that the delimiters are aligned down the -left side (,cl), the right side (,cr) or both sides -(,cb). - - -[count],cu |NERDComUncommentLine| -Uncomments the selected line(s). - ------------------------------------------------------------------------------- -2.2 Functionality details *NERDComFunctionalityDetails* - ------------------------------------------------------------------------------- -2.2.1 Comment map *NERDComComment* - -Default mapping: [count],cc -Change the mapping with: NERDComLineMap. -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. - ------------------------------------------------------------------------------- -2.2.2 Nested comment map *NERDComNestedComment* - -Default mapping: [count],cn -Change the mapping with: NERDComLineNestMap. -Applicable modes: normal visual visual-line visual-block. - -Performs nested commenting. Works the same as ,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| - ------------------------------------------------------------------------------- -2.2.3 Toggle comment map *NERDComToggleComment* - -Default mapping: [count],c -Change the mapping with: NERDComLineToggleMap. -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. - ------------------------------------------------------------------------------- -2.2.4 Minimal comment map *NERDComMinimalComment* - -Default mapping: [count],cm -Change the mapping with: NERDComLineMinimalMap -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 -,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. - ------------------------------------------------------------------------------- -2.2.5 Invert comment map *NERDComInvertComment* - -Default mapping: ,ci -Change the mapping with: NERDComLineInvertMap. -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. - ------------------------------------------------------------------------------- -2.2.6 Sexy comment map *NERDComSexyComment* - -Default mapping: [count],cs -Change the mapping with: NERDComLineSexyMap -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| - ------------------------------------------------------------------------------- -2.2.7 Yank comment map *NERDComYankComment* - -Default mapping: [count],cy -Change the mapping with: NERDComLineYankMap -Applicable modes: normal visual visual-line visual-block. - -Same as ,cc except that it yanks the line(s) that are commented first. - ------------------------------------------------------------------------------- -2.2.8 Comment to EOL map *NERDComEOLComment* - -Default mapping: ,c$ -Change the mapping with: NERDComToEOLMap -Applicable modes: normal. - -Comments the current line from the current cursor position up to the end of -the line. - ------------------------------------------------------------------------------- -2.2.9 Append com to line map *NERDComAppendComment* - -Default mapping: ,cA -Change the mapping with: NERDAppendComMap. -Applicable modes: normal. - -Appends comment delimiters to the end of the current line and goes -to insert mode between the new delimiters. - ------------------------------------------------------------------------------- -2.2.10 Prepend com to line map *NERDComPrependComment* - -Default mapping: ,cI -Change the mapping with: NERDPrependComMap. -Applicable modes: normal. - -Prepends comment delimiters to the start of the current line and goes to -insert mode between the new delimiters. - ------------------------------------------------------------------------------- -2.2.11 Insert comment map *NERDComInsertComment* - -Default mapping: -Change the mapping with: NERDComInInsertMap. -Applicable modes: insert. - -Adds comment delimiters at the current cursor position and inserts -between them. - ------------------------------------------------------------------------------- -2.2.12 Use alternate delims map *NERDComAltDelim* - -Default mapping: ,ca -Change the mapping with: NERDAltComMap -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 ,ca -then they will be switched over to /**/ comments. - -See also |NERDComDefaultDelims| - ------------------------------------------------------------------------------- -2.2.13 Comment aligned maps *NERDComAlignedComment* - -Default mappings: [count],cl [count],cr [count],cb -Change the mappings with: NERDComAlignLeftMap, NERDComAlignRightMap and -NERDComAlignBothMap. -Applicable modes: normal visual-line. - -Same as ,cc except that the comment delimiters are aligned on the left -side, right 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. - ------------------------------------------------------------------------------- -2.2.14 Uncomment line map *NERDComUncommentLine* - -Default mapping: [count],cu -Change the mapping with: NERDUncomLineMap. -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| - ------------------------------------------------------------------------------- -2.3 Supported filetypes *NERDComFiletypes* - -Filetypes that can be commented by this plugin: -abaqus abc acedb ada ahdl amiga aml ampl ant apache apachestyle asm68k asm asn -aspvbs atlas autohotkey autoit automake ave awk basic b bc bdf bib bindzone -bst btm caos catalog c cfg cg ch changelog cl clean clipper cmake conf config -context cpp crontab cs csc csp css cterm cupl csv cvs dcl debchangelog -debcontrol debsources def diff django docbk dns dosbatch dosini dot dracula -dsl dtd dtml dylan ecd eiffel elf elmfilt erlang eruby eterm expect exports -fetchmail fgl focexec form fortran foxpro fstab fvwm fx gdb gdmo geek -gentoo-package-keywords' gentoo-package-mask' gentoo-package-use' gnuplot -gtkrc haskell hb h help hercules hog html htmldjango htmlos ia64 icon idlang -idl indent inform inittab ishd iss ist jam java javascript jess jgraph -jproperties jproperties jsp kconfig kix kscript lace lex lftp lifelines lilo -lisp lite lotos lout lprolog lscript lss lua lynx m4 mail make maple masm -master matlab mel mf mib mma model moduala. modula2 modula3 monk mush muttrc -named nasm nastran natural ncf netdict netrw nqc nroff nsis objc ocaml occam -omlet omnimark openroad opl ora otl ox pascal passwd pcap pccts perl pfmain -php phtml pic pike pilrc pine plaintex plm plsql po postscr pov povini ppd -ppwiz procmail progress prolog psf ptcap python python qf radiance ratpoison r -rc readline rebol registry remind rexx robots rpl rtf ruby sa samba sas sass -sather scheme scilab screen scsh sdl sed selectbuf sgml sgmldecl sgmllnx sh -sicad simula sinda skill slang sl slrnrc sm smarty smil smith sml snnsnet -snnspat snnsres snobol4 spec specman spice sql sqlforms sqlj sqr squid st stp -strace svn systemverilog tads taglist tags tak tasm tcl terminfo tex text -plaintex texinfo texmf tf tidy tli trasys tsalt tsscl tssgm uc uil vb verilog -verilog_systemverilog vgrindefs vhdl vim viminfo virata vo_base vrml vsejcl -webmacro wget winbatch wml wvdial xdefaults xf86conf xhtml xkb xmath xml -xmodmap xpm2 xpm xslt yacc yaml z8a - -If a language is not in the list of hardcoded supported filetypes then the -&commentstring vim option is used. - ------------------------------------------------------------------------------- -2.4 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 *. The NERD -commenter is capable of adding and removing comments of this type. - ------------------------------------------------------------------------------- -2.5 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', 'alignRight', 'alignBoth', 'norm', - 'nested', 'toEOL', 'prepend', '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. - - -============================================================================== -3. Options *NERDComOptions* - ------------------------------------------------------------------------------- -3.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. -|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. -|NERDMapleader| Specifies what all the commenting key - mappings will begin with. -|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. -|NERDShutUp| Stops "Unknown filetype" output from the - script -|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. - ------------------------------------------------------------------------------- -3.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 - #include - #include - |int| main(){ - | | printf("SUCK THIS\n"); - | | while(1){ - | | fork(); - | | } - |} | -< -If NERDBlockComIgnoreEmpty=0 then this code will become: > - #include - #include - #include - /*int*/ main(){ - /* */ printf("SUCK THIS\n"); - /* */ while(1){ - /* */ fork(); - /* */ } - /*} */ -< -Otherwise, the code block would become: > - #include - #include - #include - /*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 |visual-block| mode. - ------------------------------------------------------------------------------- - *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, comments -delimiters of the alternative style. - -For example, if you are editing a c++ file using // style comments and you go -,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 ,cn it will be changed to: > - /*FOO int horse BAR*/ -< -When we uncomment this line it will go back to what it was. - ------------------------------------------------------------------------------- - *NERDMapleader* -Values: arbitrary string. -Default: \c - -NERDMapleader is used to specify what all the NERD commenter key mappings -begin with. - -The default key mappings will look like this: > - \cc - \cu - \ca - \ci - \cs - ... -< -However, if this line: > - let NERDMapleader = ',x' -< -were present in your vimrc then the default mappings would look like this: > - ,xc - ,xu - ,xa - ,xi - ,xs - ... -< -This option only affects the mappings that have not been explicitly set -manually (see |NERDComMappings|). - ------------------------------------------------------------------------------- - *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 -c as the shortcut. - "3": Turns the 'Plugin -> comment' menu on with -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 adding nested comments. - ------------------------------------------------------------------------------- - *NERDShutUp* -Values: 0 or 1. -Default 1. - -This option is used to prevent the script from echoing "Unknown filetype" -messages. Stick this line in your vimrc: > - let NERDShutUp=1 -< ------------------------------------------------------------------------------- - *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 ,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. - ------------------------------------------------------------------------------- -3.4 Key mapping customisation *NERDComMappings* - -These options are used to override the default keys that are used for the -commenting mappings. Their values must be set to strings. As an example: if -you wanted to use the mapping ,foo to uncomment lines of code then -you would place this line in your vimrc > - let NERDUncomLineMap=",foo" -< -Check out |NERDComFunctionality| for details about what the following -mappings do. - -Default Mapping Option to override~ - -,ca NERDAltComMap -,ce NERDAppendComMap -,cl NERDComAlignLeftMap -,cb NERDComAlignBothMap -,cr NERDComAlignRightMap - NERDComInInsertMap -,ci NERDComLineInvertMap -,cc NERDComLineMap -,cn NERDComLineNestMap -,cs NERDComLineSexyMap -,c NERDComLineToggleMap -,cm NERDComLineMinimalMap -,c$ NERDComToEOLMap -,cy NERDComLineYankMap -,cu NERDUncomLineMap - -============================================================================== -4. Issues with the script *NERDComIssues* - - ------------------------------------------------------------------------------- -4.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. - ------------------------------------------------------------------------------- -4.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) - -============================================================================== -5. The author *NERDComAuthor* - -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? :( - -============================================================================== -7. Changelog *NERDComChangelog* - -2.1.16 - - compatibility fix for vim7.2, cheers to Ben Schmidt, David Fishburn, and - Erik Falor for the emails, and to JaGoTerr for posting the issue. -2.1.15 - - added pamconf support, thanks to Martin Kustermann - - added mason support, thanks to Indriði Einarsson - - added map support, thanks to Chris - - added bzr support, thanks to Stromnov - - added group support, thanks to Krzysztof A. Adamski - - change license to wtfpl - -2.1.14 - - added support for gitconfig, tar, nerdtree - - added support for dtrace, thanks to nicothakis for the post -2.1.13 - - added support for rib, pyrex/cython, liquid, services, gitcommit, - vimperator, and slice. Thanks to spookypeanut, Greg Jandl, Christophe - Benz, A Pontus, and Stromnov for emailing me and/or posting issues. - - set the NERDRemoveExtraSpaces option to 1 by default as the doc states - - other fixes: (thanks to Zhang Shuhan for all his emails and testing) - * made the sexy comment mapping fall back to normal commenting if sexy - comments arent possible for the current filetype - * fixed some bugs with sexy comments - * made the uncommenting side of toggle comments slightly more robust - * fixed a bug where some extra spaces werent being removed (although - the currect options were set) -2.1.12 - - added support for patran and dakota, thx to Jacobo Diaz for the email - - added support for gentoo-env-d, gentoo-init-d, gentoo-make-conf, grub, - modconf and sudoers filetypes, thx to Li Jin for the patch. - - added support for SVNdiff, gitAnnotate, gitdiff. Thx to nicothakis for - posting the issue - -2.1.11 - - fixed a bug with the selection option and visual commenting (again). - Thanks to Ingo Karkat (again). - -2.1.10 - - added support for Wikipedia (thanks to Chen Xing) - - added support for mplayerconf - - bugfixes (thanks to Ingo Karkat for the bug report/patch) - - added support for mkd (thanks to Stefano Zacchiroli) - -2.1.9 - - added support for mrxvtrc and aap, thx to Marco for the emails - - added dummy support for SVNAnnotate, SVKAnnotate and CVSAnnotate, thx to - nicothakis for posting the issue - -2.1.8 - - fixed a couple of bugs with the NERDSpaceDelims option, thx to - David Miani and Jeremy Hinegardner - - added dummy support for lhaskell, thx to pipp for posting the issue - - added an alternative set of delims for the plsql filetype, thx to Kuchma - Michael - - added support for spectre, thx to Brett Warneke - - added support for scala, thx to Renald Buter - - added support for asymptote, thx to Vladimir Lomov - - made NERDDefaultNesting enabled by default as this seems more intuitive, - thx to marco for the suggestion - - -2.1.7 - - added support for haml, thx to Greb Weber - - added support for asterisk, thx to Laurent ARNOUD - - added support for objcpp, thx to Nicolas Weber - - added support for the factor filetype, thx to Aaron Schaefer - - fixed a bug with the passwd filetype setup, thx to Yongwei Wu - - fixed a bug that was forcing filetypes with an alternative set of delims - to have at least one multipart set. - - split out the help file out from the script and repackaged everything as - a zip - -2.1.6 - - added support for gentoo-conf-d thanks to tinoucas for posting the issue - and the patch - - added support for the D filetype. Thanks to Greg Weber for the email. - - added dummy support for cobol, cheers to timberke for posting the issue. - - added support for velocity. Thanks to Bruce Sherrod for the email. - -2.1.5 - - added support for lilypond, bbx and lytex. Thanks to Eyolf Østrem for - the email. - - added an alterative set of delimiters for the dosbatch filetype, thanks - to Ingo Karkat for the email. - - added support for the markdown filetype. Thanks to Nicolas Weber for the - posting the issue. - -2.1.4 - - added support for the ahk filetype. Cheers to Don Hatlestad for the - email. - - added support for desktop and xsd filetypes. Thanks to Christophe Benz. - - added dummy support for Rails-log - - fixed a bunch of bugs in the comment delimiter setup process, thanks to - Cheng Fang for the email :D - - hardcore refactoring and removal of seldomly used, overly-complex - functionality. - - the script now requires vim 7 -2.1.3 - - fixed numerous bugs that were causing tabs to permanently be converted - to spaces, even if noexpandtab was set. Thanks to Heptite on #vim for - working with me to track them down :) - - added dummy support for "lookupfile". Thanks to David Fishburn for the - email. - - added support for "rst", thanks to Niels Aan de Brugh for the email. - -2.1.2 - - added support for the vera and ldif filetypes. Thanks to Normandie - Azucena and Florian Apolloner for the emails. - -2.1.1 - - added dummy support for SVNcommitlog and vcscommit. Thanks to John - O'Shea for the email. - - added support for Groovy. Thanks to Jason Mills for the email. -2.1.0 - - now the script resets the delimiters when the filetype of the buffer - changes (thanks to James Hales for the patch) - - added formal support/doc for prepending a count to many of the - commenting maps so you can go, eg, 5,cc to comment 5 lines from normal - mode. Thanks again to James Hales for the patch. - - added support for the "gams" filetype that Jorge Rodrigues created. - - added support for the "objc" filetype, thanks to Rainer Müller for the - email. - - added support for the "sass" filetype that Dmitry Ilyashevich created. - -2.0.7 - - Added support for eclass and ebuild filetypes. Thanks to Alex Tarkovsky - for the email. - -2.0.6 - - Changed the default setting of NERDMapleader to ",c", meaning all the - maps now start with ,c instead of \c. This is to stop a major mapping - clash with the vcscommand plugin. Anyone wanting to keep the \c map - leader should read :help NERDMapleader. - - Added support for debcontrol and dummy support for debchangelog - filetypes, thanks to Stefano Zacchiroli for the email. - - Made it so that the NERDShutUp option now only controls the "Pleeease - email the delimiters..." requests. It no longer affects the general - output of the script. - - Simplified the names of the help tags. - -2.0.5 - - Added support for autoit, autohotkey and docbk filetypes (thanks to - Michael Böhler) - - Added support for cmake (thanks to Aaron Small) - - Added support for htmldjango and django filetypes (thanks to Ramiro - Morales) - - Improved the delimiters for eruby again - - Applied a patch from Seth Mason to fix some pathing issues with the help - file installation. - -2.0.4 - - Added support for verilog_systemverilog and systemverilog filetypes - (Thanks to Alexey for the email) - - Added support for fstab, thanks to Lizendir for the email. - - Added support for the smarty filetype. - - Improved the delimiters for eruby. - - Added dummy support for changelog filetype. - -2.0.3 - - Added dummy support for the csv filetype (thx to Mark Woodward for the - email) - - Added dummy support for vo_base and otl filetypes (thanks to fREW for - the email) - -2.0.2: - - Minor bug fix that was stopping nested comments from working - -2.0.1: - - Fixed the visual bell for the |NERDComToEOLMap| map. - - Added another possible value to the NERDMenuMode option which causes the - menu to be displayed under 'Plugin -> Comment'. See :h NERDMenuMode. - This new menu mode is now the default. - - Added support for the occam filetype (thanks to Anders for emailing me) - - Made the main commenting function (NERDComment) available outside the - script. - - bug fixes and refactoring - -2.0.0: - - NOTE: renamed the script to NERD_commenter.vim. When you install this - version you must delete the old files: NERD_comments.vim and - NERD_comments.txt. - - Reworked the mappings and main entry point function for the script to - avoid causing visual-bells and screen scrolling. - - Changes to the script options (see |NERD_com-Customisation| for - details): - - They are all camel case now instead of underscored. - - Converted all of the regular expression options into simple boolean - options for simplicity. - - All the options are now stated positively, eg. - NERD_dont_remove_spaces_regexp has become NERDRemoveExtraSpaces. - - Some of the option names have been changed (other than in the above - ways) - - Some have been removed altogether, namely: NERD_create_h_filetype - (why was a commenting script creating a filetype?!), - NERD_left_align_regexp, NERD_right_align_regexp, - - - Removed all the NERD_use_alt_style_XXX_coms options and replaced them - with a better system. Now if a filetype has alternative delims, the - script will check whether an option of the form - "NERD_<&filetype>_alt_style" exists, and if it does then alt delims will - be used. See |NERD_com-cust-delims| for details. - - The script no longer removes extra spaces for sexy comments for the - NERDRemoveExtraSpaces option (it will still remove spaces if - NERDSpaceDelims is set). - - Added dummy support for viminfo and rtf. - - Added support for the "gentoo-package-\(keywords\|mask\|use\)" - filetypes. - - Added '#' comments as an alternative for the asm filetype - - Thanks to Markus Klinik and Anders for bug reports, and again to Anders - for his patch. Thanks to John O'Shea and fREW for the filetype - information. - -============================================================================== -7. Credits *NERDComCredits* - -Thanks and respect to the following people: - -Thanks to Nick Brettell for his many ideas and criticisms. A bloody good -bastard. -:normal :.-2s/good// - -Thanks to Matthew Hawkins for his awesome refactoring! - -Thanks to the authors of the vimspell whose documentation -installation function I stole :) - -Thanks to Greg Searle for the idea of using place-holders for nested comments. - -Thanks to Nguyen for the suggestions and pointing the h file highlighting bug! -Also, thanks for the idea of doing sexy comments as well as his suggestions -relating to it :P -Thanks again to Nguyen for complaining about the NERD_comments menu mapping -(-c) interfering with another mapping of his... and thus the -NERD_dont_create_menu_shortcut option was born :P -(it was then replaced with NERD_menu_mode in version 1.67 :) - -Cheers to Litchi for the idea of having a mapping that appends a comment to -the current line :) - -Thanks to jorge scandaliaris and Shufeng Zheng for telling me about some -problems with commenting in visual mode. Thanks again to Jorge for his -continued suggestions on this matter :) - -Thanks to Martin Stubenschrott for pointing out a bug with the mapping -:) Ive gotta stop breaking this mapping! - -Thanks to Markus Erlmann for pointing out a conflict that this script was -having with the taglist plugin. - -Thanks to Brent Rice for alerting me about, and helping me track down, a bug -in the script when the "ignorecase" option in vim was set. - -Thanks to Richard Willis for telling me about how line continuation was -causing problems on cygwin. Also, thanks pointing out a bug in the help file -and for suggesting // comments for c (its about time SOMEONE did :P). May ANSI -have mercy on your soul :) - -Thanks to Igor Prischepoff for suggesting that i implement "toggle comments". -Also, thanks for his suggested improvements about toggle comments after i -implemented them. - -Thanks to harry for telling me that i broke the cn mapping in 1.53 :), -and thanks again for telling me about a bug that occurred when editing a file -in a new tab. - -Thanks to Martin (Krischikim?) for his patch that fixed a bug with the doc -install function and added support for ada comments with spaces as well as -making a couple of other small changes. - -Thanks to David Bourgeois for pointing out a bug with when commenting c files -:)... [a few days later] ok i completely misunderstood what David was talking -about and ended up fixing a completely different bug to what he was talking -about :P - -Thanks to David Bourgeois for pointing out a bug when changing buffers. - -Cheers to Eike Von Seggern for sending me a patch to fix a bug in 1.60 that -was causing spaces to be added to the end of lines with single-part -delimiters. It's nice when people do my work for me :D - -Thanks to Torsten Blix for telling me about a couple of bugs when uncommenting -sexy comments. Sexy comments dont look so sexy when they are only half removed -:P - -Thanks to Alexander "boesi" Bosecke for pointing out a bug that was stopping -the NERD_space_delim_filetype_regexp option from working with left aligned -toggle comments. And for pointing out a bug when initialising VB comments. - -Thanks to Stefano Zacchiroli for suggesting the idea of "Minimal comments". -And for suggested improvements to minimal comments. - -Thanks to Norick Chen for emailing in a patch that fixed the asp delimiters. -In 1.65 - -Thanks to Joseph Barker for the sugesting that the menu be an optional -feature. - -Thanks to Gary Church and Tim Carey-Smith for complaining about the -keymappings and causing me to introduce the NERD_mapleader option :) - -Thanks to Markus Klinik for emailing me about a bug for sexy comments where -spaces were being eaten. - -Thanks to Anders for emailing me a patch to help get rid of all the visual -bells and screen scrolling. - -Thanks to Anders and Markus Klinik for emailing me about the screen scrolling -issues and finally getting me off my ass about them :P - -Thanks to Seth Mason for sending me a patch to fix some pathing issues for the -help doc installation. - -Cheers to James Hales for the patch that made the comment maps work better with -counts, and made the script reset comment delims for a buffer when its -filetype changes. - -Cheers to heptite on #vim for helping me track down some tab-space conversion -bugs. - -Cheers to Cheng Fang for the bug reports :D - -Cheers to Yongwei Wu for a bug report about the passwd filetype. - -Thanks to David Miani for reporting a space-removal bug when using the -NERDSpaceDelims option. - -Thanks to Jeremy Hinegardner for emailing me about a bug with aligned -comments and the NERDSpaceDelims option. - -Thanks to marco for suggesting NERDDefaultNesting be set by default. - -Thanks to Ingo Karkat for the bug reports and the bugfix patch. - -Thanks to Zhang Shuhan for sending me a report about spaces not being removed -properly in some circumstances. Also, thanks for emailing me a bunch of bug -reports about sexy/toggle comments and for testing my fixes. - -Thanks to tpope for the english lesson. - -Thanks to Ben Schmidt, David Fishburn, and Erik Falor for emailing me about an -incompatibility with vim7.2. Thanks also to JaGoTerr for posting the issue. - -Not to forget! Thanks to the following people for sending me new filetypes to -support :D - -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 -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 -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 -Aaron Schaefer factor -Laurent ARNOUD 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 -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 - -============================================================================== -8. License *NERDComLicense* - -The NERD commenter is released under the wtfpl. -See http://sam.zoy.org/wtfpl/COPYING. diff --git a/dot.vim/doc/README b/dot.vim/doc/README deleted file mode 100644 index 7ba1d7c..0000000 --- a/dot.vim/doc/README +++ /dev/null @@ -1,110 +0,0 @@ -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -This file is outdated, please look at README.new for updated information -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -==================================== -Generating Latex-Suite documentation -==================================== - -In order to generate the html files and vim-help files from the XML source, -you will need to do follow the following steps. The steps are complex only -for a windows machine. On most (modern) linux machines, the various -utilities are already installed and all you need to do is some -soft-linking. - -1. Download the Docbook XSL stylesheets from - - http://sourceforge.net/project/showfiles.php?group_id=21935 - - I downloaded docbook-xsl-1.61.2.tar.gz. Unpack this archive under the - present directory. You should see something like:: - - ./docbook-xsl-1.XX.X/ - - Rename this to:: - - ./docbook-xsl - - Alternatively, if you are on a modern unix system, the docbook-xsl - stylesheets should already be installed on your system. Soft-linking - will thus work more simply. On a typical Debian box, just do:: - - ln -s /usr/share/sgml/docbook/stylesheet/xsl/nwalsh docbook-xsl - - The docbook-xsl stylesheets can be installed via the docbook-xsl - package on Debian. (Just use apt-get). - -2. Download the Docbook DTD from - - http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip - - Extract this into a subdirectory ``docbook-xml/`` under the present - directory. You should see something like:: - - ./docbook-xml/ - - with a file ``docbookx.dtd`` located there. - - **CAUTION**: - The archive above does not create a top level directory but - unzips directly into the present directory. Therefore, make sure to - run the unzip by first creating ``./docbook-xml/``, copying the zip - file there and then unzipping. - - Alternatively, if you are on a modern unix system, the docbook-xml DTD - will already be installed. Softlinking will thus work. On a typical - Debian box, you could do:: - - ln -s /usr/share/sgml/docbook/dtd/xml/4.2 docbook-xml - - On debian, you need the docbook-xml package on Debian. (Just use - apt-get). - -3. Download saxon.jar from - - http://vim-latex.sourceforge.net/documentation/saxon.jar - - This is the bare .jar file without any of the other things which saxon - comes with. Add the ``saxon.jar`` file to your ``$CLASSPATH`` setting. - - **NOTE:** - The ``$CLASSPATH`` setting should point to the ``saxon.jar`` file, - not the directory where it resides. - - Again, on a unix system, you might not need to download this. For debian - systems, the saxon.jar file resides in:: - - /usr/share/java/saxon.jar - - You can point your ``$CLASSPATH`` to that file. - -4. Download db2vim (created by me :)) via anonymous cvs:: - - mkdir -p ~/bin/db2vim - cvs -d :pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex \ - co -d ~/bin/db2vim db2vim - - Add the ``~/bin/db2vim/`` directory thus created to your ``$PATH`` - setting. - -5. Create a new directory ``latex-suite/`` under the present directory for - the chunked html files to reside in. You should see something like:: - - ./latex-suite/ - -6. Copy ``Makefile.in`` to ``Makefile`` or ``makefile`` and perform any - necessary customizations. For example, if you are using Activestate - python under windows, you will need to change the ls-txt: target as:: - - python e:/srinath/testing/db2vim/db2vim latex-suite.xml > latex-suite.txt - - -Thats it! You are ready. Now you can do:: - - make ls-chunk - make ls-flat - make ls-txt - -to create the 3 formats. - -Author: Srinath Avadhanula diff --git a/dot.vim/doc/README.new b/dot.vim/doc/README.new deleted file mode 100644 index 678091c..0000000 --- a/dot.vim/doc/README.new +++ /dev/null @@ -1,17 +0,0 @@ -==================================== -Generating Latex-Suite documentation -==================================== - -You need: -- xsltproc -- Docbook XSL stylesheets (*) -- Docbook DTD (*) - -(*) These files will be downloaded every time you create the documentation, -unless you install or download them. - -On Fedora, you can run as root: - -yum install libxslt docbook-style-xsl docbook-dtds - -to install the required packages. diff --git a/dot.vim/doc/RltvNmbr.txt b/dot.vim/doc/RltvNmbr.txt deleted file mode 100644 index acadaa7..0000000 --- a/dot.vim/doc/RltvNmbr.txt +++ /dev/null @@ -1,113 +0,0 @@ -*RltvNmbr.txt* Relative Numbers Nov 21, 2008 - -Author: Charles E. Campbell, Jr. - (remove NOSPAM from Campbell's email first) -Copyright: (c) 2008 by Charles E. Campbell, Jr. *RltvNmbr-copyright* - The VIM LICENSE applies to RltvNmbr.vim and RltvNmbr.txt - (see |copyright|) except use "RltvNmbr instead of "Vim". - NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK. - -============================================================================== -1. Contents *RltvNmbr* *RltvNmbr-contents* {{{1 - - 1. Contents......................................: |RltvNmbr-contents| - 2. Relative Numbering Manual.....................: |RltvNmbr-manual| - 3. Relative Numbering History....................: |RltvNmbr-history| - -============================================================================== -2. Relative Numbering Manual *RltvNmbr-manual* {{{1 - -ENABLING AND DISABLING RELATIVE NUMBERING - The Relative Numbering plugin provides a command: > - :RltvNmbr[!] -< The :RltvNmbr command enables relative numbering. - The :RltvNmbr! command disables relative numbering. - - If :RN hasn't been previously defined, then one may also use > - :RN -< to toggle relative numbering. - - The RltvNumbr plugin reports on its enabled/disabled status with > - b:rltvnmbrmode=1 : RltvNmbr mode is enabled - b:rltvnmbrmode=0 : RltvNmbr mode is disabled -< This variable is used for reporting and to control :RN based toggling. - -YOU MUST HAVE SIGNS FOR THIS PLUGIN - To use this plugin your vim must have been compiled with the "huge" feature - set (so as to have +signs in the :version listing). Typically that means - having used > - configure --with-features=huge -< - To determine if your copy of vim has signs, you may: > - :echo has("signs") -< If it shows "1", then your vim supports signs. - - Alternatively, you may: > - :version -< and if +signs appears in the listing, then, again, your vim supports - signs. If it lists -signs, then unfortunately your vim does not do so. - -MODFIYING THE RELATIVE NUMBERING HIGHLIGHTING - The relative numbering signs are highlighted with > - - hi default HL_RltvNmbr_Minus gui=none,italic ctermfg=red ctermbg=black guifg=red guibg=black - hi default HL_RltvNmbr_Positive gui=none,italic ctermfg=green ctermbg=black guifg=green guibg=black - -< This information is provided so that you may know what to specify to use - your preferences in relative number highlighting. One way to get your - preferred colorization in is to put lines like the following into - .vim/after/plugin/RltvNmbr.vim: > - - au FileType * hi HL_RltvNmbr_Minus gui=none ctermfg=yellow ctermbg=black guifg=yellow guibg=black - au FileType * hi HL_RltvNmbr_Positive gui=none ctermfg=magenta ctermbg=black guifg=magenta guibg=black -< - -HOW TO START WITH RELATIVE NUMBERING MODE ENABLED - Using > - Unix: ~/.vim/after/plugin/RltvNmbr.vim - Windows: $HOME\_vimfiles\after\plugin\RltvNmbr.vim -< place the following line: > - call RltvNmbr#RltvNmbrCtrl(1) -< -THE RELATIVE NUMBERING PATCH - This plugin was inspired by the relative-numbering patch mentioned on the - vim-dev mailing list, written by Markus Heidelberg. You can find his patch at - -http://groups.google.com/group/vim_dev/attach/10fa0944a8b643b4/vim-7.2-relativenumber-02.patch?part=2 - - This plugin uses signs to enable relative numbering. Signs are assigned - on a buffer-by-buffer basis as an inherent limitation, so a given buffer - can only display one set of signs. The relative numbering patch does not - have this limitation. To see this effect, try using > - vim -O file file -< and use relative numbering provided by this plugin. You'll find that the - relative numbering column will change as you switch windows to reflect - your active cursor. - - -============================================================================== -3. Relative Numbering History *RltvNmbr-history* {{{1 - 3: Aug 22, 2008 * speeded up unplacing of signs - * included g:rltvnmbrmode to report en/dis-abled - * s:AvoidOtherSigns() written/included to - * allow RltvNmbr() to avoid using previously - existing sign IDs. - * included some more autocmds for rltv nmbr - updating - 2: Aug 19, 2008 * included :RN command which toggles - relative numbering - * included some more autocmds to update - relative numbering. - * made gvim's version use italic numbers - * :RN was toggling globally; now its done - on a buffer-by-buffer basis. - * Included DrChip menu support for gvim use - 1: Aug 18, 2008 * Initial release - Aug 18, 2008 * Fixed some bugs associated with folding - Aug 18, 2008 * Changes in colorscheme was clearing the - highlighting. Highlighting now restored. - -============================================================================== -Modelines: {{{1 -vim:tw=78:ts=8:ft=help:fdm=marker: - diff --git a/dot.vim/doc/catalog.xml b/dot.vim/doc/catalog.xml deleted file mode 100644 index cfc984c..0000000 --- a/dot.vim/doc/catalog.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/dot.vim/doc/conque_term.txt b/dot.vim/doc/conque_term.txt deleted file mode 100644 index ff8ca54..0000000 --- a/dot.vim/doc/conque_term.txt +++ /dev/null @@ -1,156 +0,0 @@ -*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 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 key twice to send a single to the shell. Pressing this -key once will leave insert mode like normal. - -Press 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 x or instead of 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 - * 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 - * 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/dot.vim/doc/ft-csv.txt b/dot.vim/doc/ft-csv.txt deleted file mode 100644 index 20a41e7..0000000 --- a/dot.vim/doc/ft-csv.txt +++ /dev/null @@ -1,1466 +0,0 @@ -*ft-csv.txt* For Vim version 7.3 Last Change: Thu, 12 Apr 2012 - -Author: Christian Brabandt -Version: 0.24 -Homepage: http://www.vim.org/scripts/script.php?script_id=2830 - -The VIM LICENSE applies to the CSV filetype plugin (see |copyright|). -NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK. - - *csv-toc* -1. Introduction.................................|csv-intro| -2. Installation.................................|csv-installation| -3. CSV Commands.................................|csv-commands| - 3.1 WhatColumn..............................|WhatColumn_CSV| - 3.2 NrColumns...............................|NrColumns_CSV| - 3.3 SearchInColumn..........................|SearchInColumn_CSV| - 3.4 HiColumn................................|HiColumn_CSV| - 3.5 ArrangeColumn...........................|ArrangeColumn_CSV| - 3.6 UnArrangeColumn.........................|UnArrangeColumn_CSV| - 3.7 DeleteColumn............................|DeleteColumn_CSV| - 3.8 InitCSV.................................|InitCSV| - 3.9 Header..................................|Header_CSV| - 3.10 Sort...................................|Sort_CSV| - 3.11 CopyColumn.............................|Copy_CSV| - 3.12 MoveColumn.............................|MoveCol_CSV| - 3.13 Sum of a column........................|SumCol_CSV| - 3.14 Create new records ....................|NewRecord_CSV| - 3.15 Change the delimiter...................|NewDelimiter_CSV| - 3.16 Check for duplicate records............|Duplicate_CSV| - 3.17 Normal mode commands...................|csv-mapping| - 3.18 Convert CSV file.......................|csv-convert| - 3.19 Dynamic filters........................|csv-filter| - 3.20 Analyze a column.......................|csv-analyze| - 3.21 Vertical Folding.......................|csv-vertfold| - 3.22 Transposing columns....................|csv-transpose| -4. CSV Filetype configuration...................|csv-configuration| - 4.1 Delimiter...............................|csv-delimiter| - 4.2 Column..................................|csv-column| - 4.3 HiGroup.................................|csv-higroup| - 4.4 Strict Columns..........................|csv-strict| - 4.5 Multibyte Chars.........................|csv-mbyte| - 4.6 Concealing..............................|csv-conceal| - 4.7 Newlines................................|csv-newline| - 4.8 Highlight column automatically..........|csv-hicol| - 4.9 Fixed width columns.....................|csv-fixedwidth| - 4.9.1 Manual setup - 4.9.2 Setup using a Wizard - 4.10 CSV Header lines.......................|csv-header| - 4.11 Number format..........................|csv-nrformat| - 4.12 Move folded lines......................|csv-move-folds| - 4.13 Using Comments.........................|csv-comments| -5. Functions....................................|CSV-Functions| - 5.1 CSVPat()................................|CSVPat()| -6. CSV Tips and Tricks..........................|csv-tips| - 6.1 Statusline..............................|csv-stl| - 6.2 Slow ArrangeCol.........................|csv-slow| - 6.3 Defining custom aggregate functions.....|csv-aggregate-functions| - 6.4 Autocommand on opening/closing files....|csv-arrange-autocmd| - 6.5 CSV Syntax error........................|csv-syntax-error| -7. CSV Changelog................................|csv-changelog| - -============================================================================== -1. Introduction *csv-intro* - -This plugin is used for handling column separated data with Vim. Usually those -files are called csv files and use the ',' as delimiter, though sometimes they -use e.g. the '|' or ';' as delimiter and there also exists fixedwidth columns. -The aim of this plugin is to ease handling these kinds of files. - -This is a filetype plugin for CSV files. It was heavily influenced by -the Vim Wiki Tip667 (http://vim.wikia.com/wiki/VimTip667), though it -works differently. For instructions on installing this file, type -:help add-local-help |add-local-help| inside Vim. For a screenshot, of -how the plugin can be used, see http://www.256bit.org/~chrisbra/csv.gif - -============================================================================== -2. Installation *csv-installation* - -In order to have vim automatically detect csv files, you need to have -|ftplugins| enabled (e.g. by having this line in your |.vimrc| file: > - - :filetype plugin on - -< -The plugin already sets up some logic, to detect CSV files. By default, -the plugin recognizes *.csv and *.dat files as csv filetype. In order that the -csv filetype plugin is loaded correctly, vim needs to be enabled to load -|filetype-plugins|. This can be ensured, by putting a line like this into your -|.vimrc|: > - :filetype plugin on -< -(see also |filetype-plugin-on|). - -In case this did not work, you need to setup vim like this: - -To have Vim automatically detect csv files, you need to do the following. - - 1) Create your user runtime directory if you do not have one yet. This - directory needs to be in your 'runtime' path. In Unix this would - typically the ~/.vim directory, while in Windows this is usually your - ~/vimfiles directory. Use :echo expand("~") to find out, what Vim thinks - your user directory is. - To create this directory, you can do: > - - :!mkdir ~/.vim -< - for Unix and > - - :!mkdir ~/vimfiles -< - for Windows. - - 2) In that directory you create a file that will detect csv files. > - - if exists("did_load_csvfiletype") - finish - endif - let did_load_csvfiletype=1 - - augroup filetypedetect - au! BufRead,BufNewFile *.csv,*.dat setfiletype csv - augroup END -< - You save this file as "filetype.vim" in your user runtime diretory: > - - :w ~/.vim/filetype.vim -< - 3) To be able to use your new filetype.vim detection, you need to restart - Vim. Vim will then load the csv filetype plugin for all files whose - names end with .csv. - -============================================================================== -3. Commands *csv-commands* - -The CSV ftplugin provides several Commands: - -3.1 WhatColumn *WhatColumn_CSV* --------------- - -If you would like to know, on which column the cursor is, use > - :WhatColumn - -Use the bang attribute, if you have a heading in the first line and you want -to know the name of the column in which the cursor is: > - :WhatColumn! -< - -3.2 NrColumns *NrColumns_CSV* --------------- - -:NrColumns outputs the maximum number of columns available. It does this by -testing the first 10 lines for the number of columns. This usually should be -enough. If you use the '!' attribute, it outputs the number of columns in the -current line. - -3.3 SearchInColumn *SearchInColumn_CSV* ------------------- - -Use :SearchInColumn to search for a pattern within a specific column. The -usage is: > - :SearchInColumn [] /{pat}/ -< - -So if you would like to search in Column 1 for the word foobar, you enter > - - :SearchInColumn 1 /foobar/ - -Instead of / as delimiter, you can use any other delimiter you like. If you -don't enter a column, the current column will be used. - -3.4 HiColumn *HiColumn_CSV* ------------- - -:HiColumn can be used to highlight Column . Currently the plugin uses -the WildMenu Highlight Group. If you would like to change this, you need to -define the variable |g:csv_hiGroup|. - -If you do not specify a , HiColumn will highlight the column on which the -cursor is. Use > - - :HiColumn! - -to remove any highlighting. - -If you want to automatically highlight a column, see |csv-hicol| - - *:ArrangeColumn* -3.5 ArrangeColumn *ArrangeColumn_CSV* ------------------ - -If you would like all columns to be visually arranged, you can use the > - - :[range]ArrangeColumn[!] - -command. Beware, that this will change your file and depending on the size of -your file may slow down Vim significantly. This is highly experimental. -:ArrangeCommand will try to vertically align all columns by their maximum -column size. - -Use the bang attribute to force recalculating the column width. This is -slower, but especially if you have modified the file, this will correctly -calculate the width of each column so that they can be correctly aligned. If -no column width has been calculated before, the width will be calculated, even -if the '!' has not been given. - -If [range] is not given, it defaults to the current line. - -Note, this can be very slow on large files or many columns (see -|csv-slow| on how to increase performance for this command). To prevent you -from accidently changing your csv file, the buffer will be set 'readonly' -afterwards. Note: this command does not work for fixed width columns -|csv-fixedwidth| - -See also |csv-arrange-autocmd| on how to have vim automaticaly arrange a CSV -file upon entering it. - -3.6 UnArrangeColumn *UnArrangeColumn_CSV* ------------------ - -If you would like to undo a previous :ArrangeColumn command, you can use this -command: > - - :[range]UnArrangeColumn - -Beware, that is no exact undo of the :ArrangeColumn command, since it strips -away all leading blanks for each column. So if previously a column contained -only some blanks, this command will strip all blanks. - -If [range] is given, it defaults to the current line. - -3.7 DeleteColumn *DeleteColumn_CSV* ----------------- - -The command :DeleteColumn can be used to delete a specific column. > - - :DeleteColumn 2 - -will delete column 2. - -If you don't specify a column number, it will delete the column on which the -cursor is. -You can also specify a search string. The plugin will then delete all columns -that match the pattern: > - - :DeleteColumn /foobar -< -will delete all columns where the pattern "foobar" matches. - -3.8 InitCSV *InitCSV* ------------ - -Reinitialize the Plugin. Use this, if you have changed the configuration -of the plugin (see |csv-configuration| ). - -3.9 Header lines *Header_CSV* ----------------- - -This command splits the csv-buffer and adds a window, that holds a small -fraction of the csv file. This is useful, if the first line contains some kind -of a heading and you want always to display it. This works similar to fixing a -certain line at the top. As optional argument, you can give the number of -columns from the top, that shall be displayed. By default, 1 is used (You can -define youre own default by setting the b:csv_headerline variable, see -|csv-header|). Use the '!' to close this window. So this > - - :Header 3 - -opens at the top a split window, that holds the first 3 lines, is fixed -and horizontally 'scrollbind'ed to the csv window and highlighted using the -CSVHeaderLine highlighting. -To close the header window, use > - - :Header! - -Note, this won't work with linebreaks in the column. - -Note also, that if you already have a horizontal header window (|VHeader_CSV|), -this command will close the horizontal Header window. This is because of a -limitation of Vim itsself, which doesn't allow to sync the scrolling between -two windows horizontally and at the same time have another window only sync -its scrolling vertically. - -Note: this command does not work for fixed width columns |csv-fixedwidth| - - *VHeader_CSV* - -If you want a vertical header line, use :VHeader. This works similar to the -|Header_CSV| command, except that it will open a vertical split window with -the first column always visible. It will always open the first column in the -new split window. Use the '!' to close the window. - -Note, this won't work with linebreaks in the column. -Note also: this command does not work for fixed width columns |csv-fixedwidth| - - - *VHeaderToggle_CSV* *HeaderToggle_CSV* - -Use the :HeaderToggle and :VHeaderToggle command to toggle displaying the -horizontal or vertical header line. - - -3.10 Sort *Sort_CSV* --------- - -This command can be used to sort the csv file on a certain column. If no range -is given, is sorts the whole file. Specify the column number to sort on as -argument. Use the '!' attribute to reverse the sort order. For example, the -following command sorts line 1 til 10 on the 3 column > - - :1,10Sort 3 - -While this command > - - :1,10Sort! 3 - -reverses the order based on column 3. - -Instead of a column, you can give the flag 'n' to have it sort numerically. -When no column number is given, it will sort by the column, on which the -cursor is currently. - -3.11 Copy Column *Copy_CSV* ----------------- - -If you need to copy a specific column, you can use the command :Column > - - :[N]Column [a] - -Copy column N into register a. This will copy all the values, that are -not folded-away (|csv-filter|) and skip comments. - -If you don't specify N, the column of the current cursor position is used. -If no register is given, the default register -|quotequote| is used. - - -3.12 Move A Column *MoveCol_CSV* ------------------- - -You can move one column to the right of another column by using the -:MoveColumn command > - - :[range]MoveColumn [source] [dest] - -This moves the column number source to the right of column nr destination. If -both arguments are not given, move the column on which the cursor is to the -right of the current last column. If [range] is not given, MoveColumn moves -the entire column, otherwise, it moves the columns only for the lines within -the range, e.g. given that your first line is a header line, which you don't -want to change > - - :2,$MoveColumn 1 $ - -this would move column 1 behind the last column, while keeping the header line -as is. - - -3.13 Sum of a Column *SumCol_CSV* --------------------- - -You can let Vim output the sum of a column using the :SumCol command > - - :[range]SumCol [nr] [/format/] - -This outputs the result of the column within the range given. If no range -is given, this will calculate the sum of the whole column. If is not -given, this calculates the sum for the column the cursor is on. Note, that the -delimiter will be stripped away from each value and also empty values won't be -considered. - -By default, Vim uses the a numerica format that uses the '.' as decimal -separator while there is no thousands separator. If youre file contains -the numbers in a different format, you can use the /format/ option to specify -a different thousands separator or a different decimal separator. The format -needs to be specified like this: - /x:y/ -where 'x' defines the thousands separator and y defines the decimal -separator and each one is optional. This means, that > - - :SumCol 1 /:,/ - -uses the default thousands separator and ',' as the decimal separator and > - - :SumCol 2 / :./ - -uses the Space as thousands separator and the '.' as decimal separator. - -Note, if you Vim is compiled without floating point number format (|+float|), -Vim will only aggregate the integer part and therefore won't use the 'y' -argument in the /format/ specifier. - -See also |csv-aggregate-functions| - -3.14 Create new Records *NewRecord_CSV* ------------------------ - -If you want to create one or several records, you can use the :NewRecord -command: > - - :[range]NewRecord [count] - -This will create in each line given by range [count] number of new empty -records. If [range] is not specified, creates a new line below the line the -cursor is on and if count is not given, it defaults to 1. - - -3.15 Change the delimiter *NewRecords_CSV* -------------------------- - -If you want to change the field delimiter of you can use the :NewDelimiter -command: > - - :NewDelimiter char - -This changes the field delimiter of your file to the new delimiter "char". - -3.16 Check for duplicate records *Duplicate_CSV* --------------------------------- - -If you want to check the file for duplicate records, use the command: > - - :Duplicate columnlist -< - -Columnlist needs to be a numeric comma-separated list of all columns that you -want to check. You can also use a range like '2-5' which means the plugin -should check columns 2,3,4 and 5. - -If the plugin finds a duplicate records, it outputs its line number (but it -only does that at most 10 times). - -3.17 Normal mode commands *csv-mapping* -------------------------- - -The csv filetype plugin redefines the following keys as: - - or L or W Move [count] field forwards - - or E or H Move [count] field backwards - - or K Move [count] lines upwards within the same column - - or J Move [count] lines downwards within the same column - - Dynamically fold all lines away, that don't match - the value in the current column. See |csv-filter| - - Dynamically fold all lines away, that match - the value in the current column. See |csv-filter| - - Remove last item from the dynamic filter. - See |csv-filter| - -also, the csv plugin defines these text-object: - -if Inner Field (contains everything up to the delimiter) - -af Outer Field (contains everything up to and including - the delimiter) - -Note, that the , , K and J overlap Vim's default mapping for ||, -||, |J| and |K| respectively. Therefore, this functionality has been -mapped to a sane default of J and K. If you haven't -changed the || or || variables, those the -is equival to a single backslash '\', e.g. \K would run the lookup function on -the word under the cursor and \J would join this line with the previous line. - - - *ConvertData_CSV* -3.18 Converting a CSV File *csv-convert* --------------------------- - -You can convert your CSV file to a different format with the command > - - ConvertData - -Use the the ! attribute, to convert your data without the delimiter. - -This command will interactively ask you for the definition of 3 variables. -After which it will convert your csv file into a new format, defined by those -3 variables and open the newly created file in a new window. Those 3 variables -define how the text converted. - -First, You need to define what has to be done, before converting your column -data. That is done with the "pre convert" variable. The content of this -variable will be put in front of the new document. - -Second, you define, what has to be put after the converted content of your -column data. This happens with the "post convert" variable. Basically the -contents of this variable will be put after processing the columns. - -Last, the columns need to be converted into your format. For this you can -specify a printf() format like string, that defines how your data will be -converted. You can use '%s' to specify placeholders, which will later be -replaced by the content of the actual column. - -For example, suppose you want to convert your data into HTML, then you first -call the > - - ConvertData - -At this point, Vim will ask you for input. First, you need to specify, what -needs to be done before processing the data: - -Pre convert text: ` - -This would specify to put the HTML Header before the actual data can be -processed. If the variable g:csv_pre_convert is already defined, Vim will -already show you its' content as default value. Simply pressing Enter will use -this data. After that, Vim asks, what the end of the converted file needs to -look like: - -Post convert text:
- -So here you are defining how to finish up the HTML file. If the variable -g:csv_post_convert is already defined, Vim will already show you its' content -as default value which you can confirm by pressing Enter. Last, you define, -how your columns need to be converted. Again, Vim asks you for how to do that: - -Converted text, use %s for column input: -%s%s%s - -This time, you can use '%s' expandos. They tell Vim, that they need to be -replaced by the actual content of your file. It does by going from the first -column in your file and replacing it with the corresponding %s in that order. -If there are less '%s' expandos then columns in your file, Vim will skip the -columns, that are not used. Again If the variable g:csv_convert is already -defined, Vim will already show you its' content as default value which you can -confirm by pressing Enter. - -After you hit Enter, Vim will convert your data and put it into a new window. -It may look like this: - - ` - ` - ` -
1,2,3,
2,2,4,
` - -Note, this is only a proof of concept. A better version of converting your -data to HTML is bundled with Vim (|:TOhtml|). - -But may be you want your data converted into SQL-insert statements. That could -be done like this: > - - ConvertData! - Pre convert text: ` - -(Leave this empty. It won't be used). - - Post convert text: Commit;` - -After inserting the data, commit it into the database. - - Converted text, use %s for column input: ` - Insert into table foobar values ('%s', '%s', %s); ` - -Note, that the last argument is not included within single quotation marks, -since in this case the data is assumed to be integer and won't need to be -quoted for the database. - -After hitting Enter, a new Window will be opened, which might look like this: - -Insert into table foobar values('Foobar', '2', 2011); -Insert into table foobar values('Bar', '1', 2011); -... -Commit; - -Since the command was used with the bang attribute (!), the converted data -doesn't include the column delimiters. - -Now you can copy it into your database, or further manipulate it. - -3.19 Dynamic filters *csv-filter* --------------------- - -If you are one a value and only want to see lines, that have the same value in -this column, you can dynamically filter the file and fold away all lines not -matching the value in the current column. To do so, simply press (Enter). -Now Vim will fold away all lines, that don't have the same value in this -particular row. Note, that leading blanks and the delimiter is removed and the -value is used literally when comparing with other values. If you press -on the value, all fields having the same value will be folded away. - -The way this is done is, that the value from the column is extracted and a -regular expression for that field is generated from it. In the end this -regular expression is used for folding the file. - -A subsequent or on another value, will add this value to the -current applied filter (this is like using the logical AND between the -currently active filter and the new value). To remove the last item from the -filter, press (backspace). If all items from the filter are removed, -folding will be disabled. - -If some command messes up the folding, you can use |zX| to have the folding -being reinitialized. - -By default, the first line is assumed to be the header and won't be folded -away. See also |csv-header|. - -If you have set the g:csv_move_folds variable and the file is modifiable, all -folded lines will be moved to the end of the file, so you can view all -non-folded lines as one consecutive area (see also |csv-move-folds|) - - *:Filter* *Filter_CSV* -To see the active filters, you can use the :Filter command. This will show you -a small summary, of what filters are active and looks like this: - -Nr Match Col Name Value ` -===================================================== ` -01 - 07 Price 23.10 ` -02 + 08 Qty 10 ` - -This means, there are two filters active. The current active filter is on -column 7 (column name is Price) and all values that match 23.10 will be folded -away AND all values that don't match a value of 10 in the QTY column will also -be folded away. -When removing one item from the filter by pressing , it will always remove -the last item (highest number in NR column) from the active filter values. - -Note, that depending on your csv file and the number of filters you used, -applying the filter might actually slow down vim, because a complex regular -expression is generated that is applied by the fold expression. Look into the -@/ (|quote_/|) register to see its value. - -Use |zX| to apply the current value of your search register as filter. Use > - - :Filters! - -to reapply all values from the current active filter and fold non-matching -items away. - - *Analyze_CSV* -3.20 Analyze a Column *csv-analyze* ---------------------- - -If you'd like to know, how the values are distributed among a certain column, -you can use the :Analyze command. So > - - :Analyze 3 - -outputs the the distribution of the top 5 values in column 3. This looks like -this: - -Nr Count % Value ` -============================= ` -01 20 50% 10 ` -02 10 25% 2 ` -03 10 25% 5 ` - -This tells you, that the the value '10' in column 3 occurs 50% of the time -(exactly 20 times) and the other 2 values '2' and '5' occur only 10 times, so -25% of the time. - - *VertFold_CSV* -3.21 Vertical Folding *csv-vertfold* ---------------------- - -Sometimes, you want to hide away certain columns to better view only certain -columns without having to horizontally scroll. You can use the :VertFold -command to hide certain columns: > - - :VertFold [] -< -This will hide all columns from the first until the number entered. It -currently can't hide single columns, because of the way, syntax highlighting -is used. This command uses the conceal-feature |:syn-conceal| to hide away -those columns. If no nr is given, hides all columns from the beginning till -the current column. - -Use > - :VertFold! - -to display all hidden columns again. - - *Transpose_CSV* -3.22 Transposing a column *csv-transpose* -------------------------- - -Transposing means to exchange rows and columns. You can transpose the csv -file, using the: > - - :[range]Transpose -< -command. If [range] is not given, it will transpose the complete file, -otherwise it will only transpose the lines in the range given. Note, comments -will be deleted and transposing does not work with fixed-width columns. - -============================================================================== -4. CSV Configuration *csv-configuration* - -The CSV plugin tries to automatically detect the field delimiter for your -file, cause although often the file is called CSV (comma separated values), a -semicolon is actually used. The column separator is stored in the buffer-local -variable b:delimiter. This delimiter is heavily used, because you need -it to define a column. Almost all commands use this variable therefore. - -4.1 Delimiter *csv-delimiter* -------------- - -To override the automatic detection of the plugin and define the separator -manually, use: > - - :let g:csv_delim=',' - -to let the comma be the delimiter. This sets the buffer local delimiter -variable b:delimiter. - -If your file does not consist of delimited columns, but rather is a fixed -width csv file, see |csv-fixedwidth| for configuring the plugin appropriately. - -If you changed the delimiter, you should reinitiliaze the plugin using -|InitCSV| - -4.2 Column *csv-column* ----------- - -The definition, of what a column is, is defined as buffer-local variable -b:col. By default this variable is initialized to: > - - let b:col='\%(\%([^' . b:delimiter . ']*"[^"]*"[^' . b:delimiter . ']*' - \. b:delimiter . '\)\|\%([^' . b:delimiter . ']*\%(' . b:delimiter - \. '\|$\)\)\)' - -This should take care of quoted delimiters within a column. Those should -obviously not count as a delimiter. This regular expression is quite -complex and might not always work on some complex cases (e.g. linebreaks -within a field, see RFC4180 for some ugly cases that will probably not work -with this plugin). - -If you changed the b:delimiter variable, you need to redefine the b:col -variable, cause otherwise it will not reflect the change. To change the -variable from the comma to a semicolon, you could call in your CSV-Buffer -this command: > - - :let b:col=substitute(b:col, ',', ';', 'g') - -Check with :echo b:col, if the definition is correct afterwards. - -You can also force the plugin to use your own defined regular expression as -column. That regular expression should include the delimiter for the columns. -To define your own regular expression, set the g:csv_col variable: > - - let g:csv_col='[^,]*,' - -This defines a column as a field delimited by the comma (where no comma can be -contained inside a field), similar to how |csv-strict| works. - -You should reinitialize the plugin afterwards |InitCSV| - -4.3 Highlighting Group *csv-higroup* ----------------------- - -By default the csv ftplugin uses the WildMenu highlighting Group to define how -the |HiColumn| command highlights columns. If you would like to define a -different highlighting group, you need to set this via the g:csv_hiGroup -variable. You can e.g. define it in your |.vimrc|: > - - :let g:csv_hiGroup = "IncSearch" - -You need to restart Vim, if you have changed this variable or use |InitCSV| - -The |hl-Title| highlighting is used for the Header line that is created by the -|Header_CSV| command. If you prefer a different highlighting, set the -g:csv_hiHeader variable to the prefered highlighting: > - - let g:csv_hiHeader = 'Pmenu' -< -This would set the header window to the |hl-Pmenu| highlighting, that is used -for the popup menu. To disable the custom highlighting, simply |unlet| the -variable: > - - unlet g:csv_hiHeader - -You should reinitialize the plugin afterwards |InitCSV| - -4.4 Strict Columns *csv-strict* ------------------- - -The default regular expression to define a column is quite complex -(|csv-column|). This slows down the processing and makes Vim use more memory -and it could still not fit to your specific use case. - -If you know, that in your data file, the delimiter cannot be contained inside -the fields quoted or escaped, you can speed up processing (this is quite -noticeable when using the |ArrangeColumn_CSV| command) by setting the -g:csv_strict_columns variable: > - - let g:csv_strict_columns = 1 - -This would define a column as this regex: > - - let b:col = '\%([^' . b:delimiter . ']*' . b:delimiter . '\|$\)' - -Much simpler then the default column definition, isn't it? -See also |csv-column| and |csv-delimiter| - -You can disable the effect if you |unlet| the variable: > - - unlet g:csv_strict_columns - -You should reinitialize the plugin afterwards |InitCSV| - -For example when opening a CSV file you get the Error |E363|: pattern uses -more memory than 'maxmempattern'. In this case, either increase the -'maxmempattern' or set the g:csv_strict_columns variable. - - -4.5 Multibyte Chars *csv-mbyte* -------------------- - -Unfortunately, when using the |ArrangeColumn_CSV| command, multibyte chars -make some trouble, because internally Vim uses bytes to specify the width of a -column. The CSV plugin tries to workaround that, by calculating the byte width -of each column, before aligning them. This is quite expensive and can slow -down processing. If you know, your data file only contains pure ASCII chars -(or you simply don't care, if some lines a off a little bit), set the -g:csv_no_multibyte variable: > - - let g:csv_no_multibyte = 1 - -And to force calculating the byte width of each column |unlet| the variable: > - - unlet g:csv_no_multibyte - -You should reinitialize the plugin afterwards |InitCSV| - -4.6 Concealing *csv-syntax* *csv-conceal* -------------------- - -The CSV plugin comes with a function to syntax highlight csv files. Basically -allt it does is highlight the columns and the header line. - -By default, the delimiter will not be displayed, if Vim supports |conceal| of -syntax items and instead draws a vertical line. If you don't want that, simply -set the g:csv_noconceal variable in your .vimrc > - - let g:csv_no_conceal = 1 - -and to disable it, simply unlet the variable > - - unlet g:csv_no_conceal - -You should reinitialize the plugin afterwards |InitCSV| -Note: You can also set the 'conceallevel' option to control how the concealed -chars will be displayed. - -If you want to customize the syntax colors, you can define your own groups. -The CSV plugin will use already defined highlighting groups, if they are -already defined, otherwise it will define its own defaults which should be -visible with 8, 16, 88 and 256 color terminals. For that it uses the -CSVColumnHeaderOdd and CSVColumnHeaderEven highlight groups for syntax -coloring the first line. All other lines get either the CSVColumnOdd or -CSVColumnEven highlighting. - -In case you want to define your own highlighting groups, you can define your -own syntax highlighting like this in your |.vimrc| > - - hi CSVColumnEven term=bold ctermbg=4 guibg=DarkBlue - hi CSVColumnOdd term=bold ctermbg=5 guibg=DarkMagenta - hi CSVColumnHeaderEven ... - hi CSVColumnHeaderOdd ... - -< -Note, these changes won't take effect, until you restart Vim. - - -4.7 Newlines *csv-newline* ------------- - -RFC4180 allows newlines in double quoted strings. By default, the csv-plugin -won't recognize newlines inside fields. It is however possible to make the -plugin aware of newlines within quoted strings. To enable this, set > - - let g:csv_nl = 1 - -and to disable it again, simply unset the variable > - - unlet g:csv_nl - -It is a good idea to reinitialize the plugin afterwards |InitCSV| - -Note, this might not work correctly in all cases. The syntax highlighting -seems to change on cursor movements. This could possibly be a bug in the -syntax highlighting engine of Vim. Also, |WhatColumn_CSV| can't handle -newlines inside fields and will most certainly be wrong. - -4.8 Highlight column automatically *csv-hicol* ----------------------------------- - -You can let vim automatically highlight the column on which the cursor is. -This works by defining an |CursorMoved| autocommand to always highlight the -column, when the cursor is moved in normal mode. Note, this does not update -the highlighting, if the Cursor is moved in Insert mode. To enable this, -define the g:csv_highlight_column variable like this > - - let g:csv_highlight_column = 'y' - -and to disable it again, simply unset the variable > - - unlet g:csv_highlight_column - -It is a good idea to reinitialize the plugin afterwards |InitCSV| - -4.9 Fixed width columns *csv-fixedwidth* ------------------------ - -Sometimes there are no real columns, but rather the file is fixed width with -no distinct delimiters between each column. The CSV plugin allows you to -handle such virtual columns like csv columns, if you define where each column -starts. - -Note: Except for |ArrangeColumn_CSV| and the |Header_CSV| commands, all -commands work in either mode. Those two commands won't do anything in the case -of fixedwidth columns, since they don't really make sense here. - -4.9.1 Manual setup ------------------- -You can do this, by setting the buffer-local variable -b:csv_fixed_width like this > - - let b:csv_fixed_width="1,5,9,13,17,21" - -This defines that each column starts at multiples of 4. Be sure, to issue -this command in the buffer, that contains your file, otherwise, it won't -have an effect, since this is a buffer-local option (|local-option|) - -After setting this variable, you should reinitialize the plugins using -|InitCSV| - - *CSVFixed* -4.9.2 Setup using a Wizard --------------------------- -Alternatively, you can setup the fixed width columns using the :CSVFixed -command. This provides a simple wizard to select each column. If you enter -the command: > - :CSVFixed -< -The first column will be highlighted and Vim outputs: -, , , , ... -This means, you can now use those 5 keys to configure the fixed-width columns: - - Use Cursor Left () and Cursor Right () to move the - highlighting bar. - If you press , this column will be fixed and remain - highlighted and there will be another bar, you can move using - the Cursor keys. This means this column will be considered to be - the border between 2 fixed with columns. - Abort - Press the backspace key, to remove the last column you fixed with - the key. - Use Enter to finish the wizard. This will use all fixed columns - to define the fixed width columns of your csv file. The plugin - will be initialized and syntax highlighting should appear. - -Note: This only works, if your Vim has the 'colorcolumn' option available -(This won't work with Vim < 7.3 and also not with a Vim without +syntax -feature). - - -4.10 CSV Header lines *csv-header* ---------------------- - -By default, dynamic filtering |csv-filter| will not fold away the first line. -If you don't like that, you can define your header line using the variable -b:csv_fold_headerline, e.g. > - - let b:csv_headerline = 0 - -to disable, that a header line won't be folded away. If your header line -instead is on line 5, simply set this variable to 5. This also applies to the -|Header_CSV| command. - -4.11 Number format *csv-nrformat* ------------------- -When using the |SumCol_CSV| command, you can specify a certain number format -using the /x:y/ argument. You can however also configure the plugin to detect -a different number format than the default number format (which does not -support a thousands separator and uses the '.' as decimal separator). - -To specify a different thousands separator by default, use > - - let b:csv_thousands_sep = ' ' - -to have the space use as thousands separator and > - - let b:csv_decimal_sep = ',' - -to use the comma as decimal separator. - -4.12 Move folded lines *csv-move-folds* ----------------------- - -If you use dynamic filters (see |csv-filter|), you can configure the plugin to -move all folded lines to the end of the file. This only happens if you set the -variable > - - let g:csv_move_folds = 1 -< -and the file is modifiable. This let's you see all non-folded records as a -consecutive area without being disrupted by folded lines. - -(Note, that this might currently not work -correctly all the times, as there seems to be a bug within Vim currently). - -4.13 Using comments *csv-comments* -------------------- - -Strictly speaking, in csv files there can't be any comments. You might however -still wish to comment or annotate certain sections in your file, so the CSV -plugin supports Comments. - -Be default, the CSV plugin will use the 'commentstring' setting to identify -comments. If this option includes the '%s' it will consider the part before -the '%s' as leading comment marker and the part behind it as comment -delimiter. - -You can however define your own comment marker, using the variable -g:csv_comment. Like with the 'commentstring' setting, you can use '%s' -expandos, that will denote where the actual comment text belongs. To define -your own comment string, put this in your |.vimrc| > - - :let g:csv_comment = '#' -< -Which will use the '#' sign as comment leader like in many scripting -languages. - -After setting this variable, you should reinitialize the plugins using -|InitCSV| - -============================================================================== -5. Functions *CSV-Funtions* - -The csv plugins also defines some functions, that can be used for scripting -when a csv file is open - -5.1 CSVPat() *CSVPat()* ------------- - -CSVPat({column}[, {pattern}]) - -This function returns the pattern for the selected column. If only columns is -given, returns the regular expression used to search for the pattern '.*' in -that column (which means the content of that column). Alternatively, an -optional pattern can be given, so the return string can be directly feeded to -the |/| or |:s| command, e.g. type: > - - :s/=CSVPat(3, 'foobar')/baz - -where the means pressing Control followed by R followed by = -(see |c_CTRL-R_=|). A prompt will apear, with the '=' as the first character -on which you can enter expressions. - -In this case enter CSVPat(3, 'foobar') which returns the pattern to search for -the string 'foobar' in the third column. After you press enter, the returned -pattern will be put after the :s command so you can directly enter / and the -substitute string. - - -============================================================================== -6. CSV Tips and Tricks *csv-tips* - -Here, there you'll find some small tips and tricks that might help when -working with CSV files. - -6.1 Statusline *csv-stl* --------------- -Suppose you want to include the column, on which the cursor is, into your -statusline. You can do this, by defining in your .vimrc the 'statusline' like -this: > - - function MySTL() - if has("statusline") - hi User1 term=standout ctermfg=0 ctermbg=11 guifg=Black guibg=Yellow - let stl = ... - if exists("*CSV_WCol") - let csv = '%1*%{&ft=~"csv" ? CSV_WCol() : ""}%*' - else - let csv = '' - endif - return stl.csv - endif - endfunc - set stl=%!MySTL() -< - -This will draw in your statusline right aligned the current column and max -column (like 1/10), if you are inside a CSV file. The column info will be -drawn using the User1 highlighting (|hl-User1|), that has been defined in the -second line of the function. In the third line of your function, put your -desired 'statusline' settings as |expression|. Note the section starting with -'if exists(..)' guards against not having loaded the filetype plugin. - - *CSV_WCol* - -The CSV_WCol() function controls, what will be outputed. In the simplest case, -when no argument is given, it simply returns on which column the cursor is. -This would look like '1/10' which means the cursor is on the first of 10 -columns. If you rather like to know the name of the column, simply give as -parameter to the function the string "Name". This will return the column name -as it is printed on the first line of that column. This can be adjusted, to -have the column name printed into the statusline (see |csv-stl| above) by -replacing the line > - - let csv = '%1*%{&ft=~"csv" ? CSV_WCol() : ""}%*' -< -by e.g. - - let csv = '%1*%{&ft=~"csv" ? CSV_WCol("Name") . " " . CSV_WCol() : ""}%*' - -which will output "Name 2/10" if the cursor is in the second column -which is named "Name". - -6.2 Slow ArrangeCol *csv-slow* -------------------- - -Processing a csv file using |ArrangeColumn_CSV| can be quite slow, because Vim -needs to calculate the width for each column and then replace each column by -itself widened by spaces to the optimal length. Unfortunately, csv files tend -to be quite big. Remember, for a file with 10,000 lines and 50 columns Vim -needs to process each cell, which accumulates to 500,000 substitutions. It -might take some time, until Vim is finished. - -You can speed up things a little bit, if you omit the '!' attribute to the -|ArrangeColumn| (but this will only work, if the width has been calculated -before, e.g. by issuing a :1ArrangeColumn command to arrange only the first -line. Additionally you can also configure how this command behaves by setting -some configuration variables. - -Here are some performance meassurements on how the various -configuration settings influence the |ArrangeColumn_CSV| command on a file -with 34 columns (on a 2.2GHz Core2Duo processor): - - Lines | default | strict¹ | multibyte² | strict + multibyte³ - ------------------------------------------------------------------------ - 1000 | 6.93 s | 5.53 s | 6.76 s | 5.66 s - 5000 | 15.2 s | 8.52 s | 14.27 s | 8.56 s - 10000 | 36.2 s | 24.67 s | 36.11 s | 24.26 s - 50000 | 162,23 s | 93.36 s | 152.25 s | 141.18 s - -¹ setting the g:csv_strict_columns variable (|csv-strict|) -² setting the g:csv_no_multibyte variable (|csv-mbyte|) -³ setting the g:csv_no_multibyte variable and g:csv_strict_columns variable - -Note, this was performed on a quite fast processor. If you need to work with -large files, be sure to have enough memory available, cause Vim needs to read -in the whole file into memory. You can also try the LargeFile plugin available -at http://www.vim.org/scripts/script.php?script_id=1506 which tunes several -Vim options (like |syn-off|, 'undolimits', 'fdm' and others). - - - -6.3 Defining custom aggregate functions *csv-aggregate-functions* ---------------------------------------- - -The CSV plugin already defines the |SumCol_CSV| command, to let you calculate -the sum of all values of a certain column within a given range. This will -consider all values within the range, that are not folded away (|csv-filter|), -and also skip comments and the header lines. The delimiter will be deleted -from each field. - -But it may be, that you don't need the sum, but would rather want to have the -average of all values within a certain column. You can define your own -function and let the plugin call it for a column like this: - - 1) You define your own custom function in the after directory of your - vim runtime path |after-directory| (see also #2 below) > - - fun! My_CSV_Average(col) - let sum=0 - for item in a:col - let sum+=item - endfor - return sum/len(a:col) - endfun -< - This function takes a list as argument, and calculates the average for - all items in the list. You could also make use of Vim's |eval()| - function and write your own Product function like this > - - fun! My_CSV_Product(col) - return eval(join(a:col, '*')) - endfun -< - - 2) Now define your own custom command, that calls your custom function for - a certain column > - - command! -buffer -nargs=? -range=% AvgCol - \ :echo csv#EvalColumn(, - \ "My_CSV_Average", ,) -< - This command should best be put into a file called csv.vim and save - it into your ~/.vim/after/ftplugin/ directory. Create directories - that don't exist yet. For Windows, this would be the - $VIMRUNTIME/vimfiles/after/ftplugin directory. - - 3) Make sure, your |.vimrc| includes a filetype plugin setting like this > - - filetype plugin on -< - This should make sure, that all the necessary scripts are loaded by - Vim. - - After restarting Vim, you can now use your custom command definition - :AvgCol. Use a range, for the number of lines you want to evaluate and - optionally use an argument to specify which column you want to be - evaluated > - - :2,$AvgCol 7 -< - This will evaluate the average of column seven (assuming, line 1 is the - header line, which should not be taken into account). - -6.4 Autocommand on opening/closing files *csv-arrange-autocmd* ----------------------------------------- - -If you want your CSV files to always be displayed like a table, you can -achieve this using the |ArrangeColumn_CSV| command and some autocommands. -Define these autocommands in your |.vimrc| > - - aug CSV_Editing - au! - au BufRead,BufWritePost *.csv :%ArrangeColumn - au BufWritePre *.csv :%UnArrangeColumn - aug end - -Upon Entering a csv file, Vim will visually arrange all columns and before -writing, those columns will be collapsed again. The BufWritePost autocommand -makes sure, that after the file has been written successfully, the csv file -will again be visually arranged. - -You can also simply set the variable > - - let g:csv_autocmd_arrange = 1 -< -in your vimrc and an autocmd will be installed, that visually arranges your -csv file whenever you open them for editing. - -Note, this is highly experimental and especially on big files, this might -take a while. - -6.5 Syntax error when opening a CSV file *csv-syntax-error* ----------------------------------------- - -This happens usually, when the syntax script is read before the filetype -plugin, so the plugin did not have a chance to setup the column delimiter -correctly. - -The easy way to fix it, is to reverse the order of the :syntax on (|:syn-on|) -and :filetype plugin (|:filetype-plugin-on|) statements in your |.vimrc| - -Alternatively, you can simply call |InitCSV| and ignore the error. - -============================================================================== -7. CSV Changelog *csv-changelog* - -0.24 Apr 12, 2012 {{{1 -- Allow to transpose the file (|csv-transpose|, suggested by Karan Mistry, - thanks!) -- |DeleteColumn_CSV| allows to specify a search pattern and all matching - columns will be deleted (suggested by Karan Mistry, thanks!) - -0.23 Mar 25, 2012 {{{1 -- Don't error out, when creating a new file and syntax highlighting - script can't find the delimiter - (ftplugin will still give a warning, so). -- Don't pollute the search register when loading a file -- Give Warning when number format is wrong -- Don't source ftdetect several times (patch by Zhao Cai, thanks!) -- |NewDelimiter_CSV| to change the delimiter of the file -- |Duplicate_CSV| to check for duplicate records in the file -- Issue https://github.com/chrisbra/csv.vim/issues/13 fixed (missing quote, - reported by y, thanks!) -- |CSVPat()| function -- 'lz' does not work with |:silent| |:s| (patch by Sergey Khorev, thanks!) -- support comments (|csv_comment|, suggested by Peng Yu, thanks!) -0.22 Nov 08, 2011 {{{1 -- Small enhancements to |SumCol_CSV| -- :Filters! reapplys the dynamic filter -- Apply |csv-aggregate-functions| only to those values, that are - not folded away. -- |SumCol_CSV| can use a different number format (suggested by James Cole, - thanks! (also |csv-nrformat| -- Documentation updates (suggested by James Cole and Peng Yu) -- More code cleanup and error handling - https://github.com/chrisbra/csv.vim/issues/9 reported Daniel Carl, thanks! - https://github.com/chrisbra/csv.vim/issues/8 patch by Daniel Carl, thanks! -- New Command |NewRecord_CSV| (suggest by James Cole, thanks!) -- new textobjects InnerField (if) and outerField (af) which contain the field - without or with the delimiter (suggested by James Cole, thanks!) -- |csv-arrange-autocmd| to let Vim automatically visually arrange the columns - using |ArrangeColumn_CSV| -- |csv-move-folds| let Vim move folded lines to the end -- implement a Menu for graphical Vim - -0.21 Oct 06, 2011 {{{1 -- same as 0.20 (erroneously uploaded to vim.org) - -0.20 Oct 06, 2011 {{{1 - -- Implement a wizard for initializing fixed-width columns (|CSVFixed|) -- Vertical folding (|VertFold_CSV|) -- fix plugin indentation (by Daniel Karl, thanks!) -- fixed missing bang parameter for HiColumn function (by Daniel Karl, thanks!) -- fixed broken autodection of delimiter (reported by Peng Yu, thanks!) - -0.19 Sep 26, 2011 {{{1 - -- Make |:ArrangeColumn| more robust -- Link CSVDelimiter to the Conceal highlighting group for Vim's that have - +conceal feature (suggested by John Orr, thanks!) -- allow the possibility to return the Column name in the statusline |csv-stl| - (suggested by John Orr, thanks!) -- documentation updates -- Allow to dynamically add Filters, see |csv-filter| -- Also display what filters are active, see |:Filter| -- Analyze a column for the distribution of a value |csv-analyze| -- Implement UnArrangeColumn command |UnArrangeColumn_CSV| - (suggested by Daniel Karl in https://github.com/chrisbra/csv.vim/issues/7) - -0.18 Aug 30, 2011 {{{1 - -- fix small typos in documentation -- document, that 'K' and 'J' have been remapped and the originial function is - available as \K and \J -- Delimiters should not be highlighted within a column, only when used - as actual delimiters (suggested by Peng Yu, thanks!) -- Performance improvements for |:ArrangeColumn| - -0.17 Aug 16, 2011 {{{1 - -- small cosmetic changes -- small documentation updates -- fold away changelog in help file -- Document, that |DeleteColumn_CSV| deletes the column on which the cursor - is, if no column number has been specified -- Support csv fixed width columns (|csv-fixedwidth|) -- Support to interactively convert your csv file to a different - format (|csv-convert|) - -0.16 Jul 25, 2011 {{{1 - -- Sort on the range, specified (reported by Peng Yu, thanks!) -- |MoveCol_CSV| to move a column behind another column (suggested by Peng Yu, - thanks!) -- Document how to use custom functions with a column - (|csv-aggregate-functions|) -- Use g:csv_highlight_column variable, to have Vim automatically highlight the - column on which the cursor is (|csv-hicol|) -- Header/VHeader command should work better now (|Header_CSV|, |VHeader_CSV|) -- Use setreg() for setting the register for the |Column_CSV| command and make - sure it is blockwise. -- Release 0.14 was not correctly uploaded to vim.org - -0.14 Jul 20, 2011 {{{1 - -- really use g:csv_no_conceal variable (reported by Antonio Ospite, thanks!) -- Force redrawing before displaying error messages in syntax script (reported - by Antonio Ospite, thanks!) -- Make syntax highlighting work better with different terminals (Should work - now with 8, 88 and 256 color terminals, tested with linux konsole, xterm and - rxvt) (https://github.com/chrisbra/csv.vim/issues/4) -- Automatically detect '|' as field separator for csv files - -0.13 Mar 14, 2011 {{{1 - -- documentation update -- https://github.com/chrisbra/csv.vim/issues#issue/2 ('splitbelow' breaks - |Header_CSV|, fix this; thanks lespea!) -- https://github.com/chrisbra/csv.vim/issues#issue/3 ('gdefault' breaks - |ArrangeColumn_CSV|, fix this; thanks lespea!) -- https://github.com/chrisbra/csv.vim/issues#issue/1 (make syntax highlighting - more robust, thanks lespea!) -- fix some small annoying bugs -- WhatColumn! displays column name - -0.12 Feb 24, 2011 {{{1 - -- bugfix release: -- don't use |:noa| when switching between windows -- make sure, colwidth() doesn't throw an error - -0.11 Feb 24, 2011 {{{1 - -- new command |Copy_CSV| -- |Search_CSV| did not find anything in the last column if no delimiter - was given (reported by chroyer) -- |VHeader_CSV| display the first column as Header similar to how - |Header_CSV| works -- |HeaderToggle_CSV| and |VHeaderToggle_CSV| commands that toggle displaying - the header lines/columns - -0.10 Feb 23, 2011 {{{1 - -- Only conceal real delimiters -- document g:csv_no_conceal variable -- document g:csv_nl variable -- document conceal feature and syntax highlighting -- Normal mode command / work like K/J -- More robust regular expression engine, that can also handle newlines inside - quoted strings. -- Slightly adjusted syntax highlighting - -0.9 Feb 19, 2011 {{{1 - -- use conceal char depending on encoding -- Map normal mode keys also for visual/select and operator pending mode - -0.8 Feb 17, 2011 {{{1 - -- Better Error handling -- HiColumn! removes highlighting -- Enable NrColumns, that was deactivated in v.0.7 -- a ColorScheme autocommand makes sure, that the syntax highlighting is - reapplied, after changing the colorscheme. -- SearchInColumn now searches in the current column, if no column has been - specified -- A lot more documentation -- Syntax Highlighting conceales delimiter -- small performance improvements for |ArrangeColumn_CSV| - -0.7 Feb 16, 2011 {{{1 - -- Make the motion commands 'W' and 'E' work more reliable -- Document how to setup filetype plugins -- Make |WhatColumn_CSV| work more reliable (report from - http://vim.wikia.com/Script:3280) -- DeleteColumn deletes current column, if no argument given -- |ArrangeColumn_CSV| handles errors better -- Code cleanup -- Syntax highlighting -- 'H' and 'L' move forward/backwards between csv fields -- 'K' and 'J' move upwards/downwards within the same column -- |Sort_CSV| to sort on a certain column -- |csv-tips| on how to colorize the statusline - -0.6 Feb 15, 2011 {{{1 - -- Make |ArrangeColumn_CSV| work more reliable (had problems with multibyte - chars before) -- Add |Header_CSV| function -- 'W' and 'E' move forward/backwards between csv fields -- provide a file ftdetect/csv.vim to detect csv files - -0.5 Apr 20 2010 {{{1 - -- documentation update -- switched to a public repository: http://github.com/chrisbra/csv.vim -- enabled GLVS (see |GLVS|) - -0.4a Mar 11 2010 {{{1 - -- fixed documentation - -0.4 Mar 11 2010 {{{1 - -- introduce |InitCSV| -- better Error handling -- HiColumn now by default highlights the current column, if no argument is - specified. - -0.3 Oct, 28 2010 {{{1 - -- initial Version - -vim:tw=78:ts=8:ft=help:norl:et:fdm=marker:fdl=0 diff --git a/dot.vim/doc/fugitive.txt b/dot.vim/doc/fugitive.txt deleted file mode 100644 index cb437f5..0000000 --- a/dot.vim/doc/fugitive.txt +++ /dev/null @@ -1,220 +0,0 @@ -*fugitive.txt* A Git wrapper so awesome, it should be illegal - -Author: Tim Pope *fugitive-author* -License: Same terms as Vim itself (see |license|) - -This plugin is only available if 'compatible' is not set. - -INTRODUCTION *fugitive* - -Install in ~/.vim, or in ~\vimfiles if you're on Windows and feeling lucky. -Vim 7.2 is recommended as it ships with syntax highlighting for many Git file -types. - -If you're in a hurry to get started, here are some things to try: - -In any file in your repository, run |:Gedit| HEAD. Press to jump to the -current branch. Press again to jump to the top most commit. Keep using - to explore parent commits, trees, and blobs. Use C in a tree or blob to -get back to the commit. - -Edit a file in the work tree and make some changes. Use |:Gdiff| to open up -the indexed version. Use |do| and |dp| on various hunks to bring the files in -sync, or use |:Gread| to pull in all changes. Write the indexed version to -stage the file. - -Run |:Gstatus| to check your repository's status. Use "-" to stage and reset -files and "p" to add/reset --patch them. Invoke |:Gcommit| to commit your -changes. - -Run |:Gblame| in a work tree file to see a blame in a vertical split. Press - on any line to reopen and reblame that file as it stood in that commit. -Press o or O on any line to inspect that commit in a split or a tab. - -Run |:Ggrep| to search the work tree or history. Run |:Gmove| to rename a -file. Run |:Gremove| to delete a file. - -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-: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. Press D to |:Gdiff| the file on the cursor - line. Press - to stage or unstage the file on the - cursor line. Press p to do so on a per hunk basis - (--patch). Press C to invoke |:Gcommit|. - - *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| - - *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! [revision] Deprecated synonym for |:Gread|. - - *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-: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-: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. - -:[range]Gblame [flags] Run git-blame on the given range. - -MAPPINGS *fugitive-mappings* - -These maps are available in Git objects. - - *fugitive-* - 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/dot.vim/doc/imaps.txt b/dot.vim/doc/imaps.txt deleted file mode 100644 index 087b3db..0000000 --- a/dot.vim/doc/imaps.txt +++ /dev/null @@ -1,116 +0,0 @@ - IMAP -- A fluid replacement for :imap - *imaps.txt* - Srinath Avadhanula - - - - Abstract - ======== -This plugin provides a function IMAP() which emulates vims |:imap| function. The -motivation for providing this plugin is that |:imap| suffers from problems -which get increasingly annoying with a large number of mappings. - -Consider an example. If you do > - imap lhs something - - -then a mapping is set up. However, there will be the following problems: -1. The 'ttimeout' option will generally limit how easily you can type the lhs. - if you type the left hand side too slowly, then the mapping will not be - activated. - -2. If you mistype one of the letters of the lhs, then the mapping is deactivated - as soon as you backspace to correct the mistake. - -3. The characters in lhs are shown on top of each other. This is fairly - distracting. This becomes a real annoyance when a lot of characters initiate - mappings. - -This script provides a function IMAP() which does not suffer from these -problems. - - - - *imaps.txt-toc* -|im_1| Using IMAP - -================================================================================ -Viewing this file - -This file can be viewed with all the sections and subsections folded to ease -navigation. By default, vim does not fold help documents. To create the folds, -press za now. The folds are created via a foldexpr which can be seen in the -last section of this file. - -See |usr_28.txt| for an introduction to folding and |fold-commands| for key -sequences and commands to work with folds. - -================================================================================ -Using IMAP *im_1* *imaps-usage* - - - -Each call to IMAP is made using the syntax: > - call IMAP (lhs, rhs, ft [, phs, phe]) - - -This is equivalent to having map to for all files of type . - -Some characters in the have special meaning which help in cursor placement -as described in |imaps-placeholders|. The optional arguments define these -special characters. - -Example One: > - call IMAP ("bit`", "\\begin{itemize}\\\item <++>\\\end{itemize}<++>", "tex") - - -This effectively sets up the map for "bit`" whenever you edit a latex file. When -you type in this sequence of letters, the following text is inserted: > - \begin{itemize} - \item * - \end{itemize}<++> - -where * shows the cursor position. The cursor position after inserting the text -is decided by the position of the first "place-holder". Place holders are -special characters which decide cursor placement and movement. In the example -above, the place holder characters are <+ and +>. After you have typed in the -item, press and you will be taken to the next set of <++>'s. Therefore by -placing the <++> characters appropriately, you can minimize the use of movement -keys. - -Set g:Imap_UsePlaceHolders to 0 to disable placeholders altogether. - -Set g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd to something else if you -want different place holder characters. Also, b:Imap_PlaceHolderStart and -b:Imap_PlaceHolderEnd override the values of g:Imap_PlaceHolderStart and -g:Imap_PlaceHolderEnd respectively. This is useful for setting buffer specific -place holders. - -Example Two: You can use the command to insert dynamic elements such as -dates. > - call IMAP ('date`', "\=strftime('%b %d %Y')\", '') - - - -With this mapping, typing date` will insert the present date into the file. - -================================================================================ -About this file - -This file was created automatically from its XML variant using db2vim. db2vim is -a python script which understands a very limited subset of the Docbook XML 4.2 -DTD and outputs a plain text file in vim help format. - -db2vim can be obtained via anonymous CVS from sourceforge.net. Use - -cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim - -Or you can visit the web-interface to sourceforge CVS at: -http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ - -The following modelines should nicely fold up this help manual. - -vim:ft=help:fdm=expr:nowrap -vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' -vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','--\ \ \ \ ','') -================================================================================ diff --git a/dot.vim/doc/potwiki.txt b/dot.vim/doc/potwiki.txt deleted file mode 100644 index b4a865c..0000000 --- a/dot.vim/doc/potwiki.txt +++ /dev/null @@ -1,204 +0,0 @@ -*potwiki.txt* Plain Old Text Wiki v1.25 - - - POTWIKI REFERENCE MANUAL~ - - -Maintaining a Wiki of plain text files with the plugin "potwiki" - - -============================================================================== -CONTENT *potwiki-contents* - - Installation : |potwiki-install| - potwiki intro : |potwiki| - Requirements : |potwiki-requirements| - potwiki commands : |potwiki-commands| - Customization : |potwiki-customize| - Bugs : |potwiki-bugs| - Todo list : |potwiki-todo| - -============================================================================== -1. potwiki Installation *potwiki-install* - - In order to install the plugin, place the potwiki.vim file into a plugin - directory in your runtime path (please see |add-global-plugin| and - |'runtimepath'|). - - |potwiki| may be customized by setting variables, creating maps, and - specifying event handlers. Please see |potwiki-customize| for more - details. - - *potwiki-auto-help* - This help file is automagically generated when the |potwiki| script is - loaded for the first time. - -============================================================================== -1.1. potwiki requirements *potwiki-requirements* - - potwiki should work with vim 6.0 or later versions. - -============================================================================== -2. potwiki intro *potwiki* - *wiki* *potwiki-intro* - - potwiki provides functions and mappings for maintaining a Wiki of plain - text files. - - The Wiki is a collection of text files in a single directory. These files - can contain hyper links to each other in the form of WikiWords. - - A WikiWord is a word which starts with an upper case letter and contains - at least one lower case letter and another upper case letter in this - order -- it's in 'camel case', e.g. - - ThisIsAWikiWord - - Such a WikiWord links to a file of exactly the same name in your - Wiki directory. - - By default you can also use digits and underscore in your WikiWords. - You can customize this to your needs. |potwiki-customize| - - When opening a Wiki file potwiki scans your Wiki directory to find - which WikiWords are valid links. WikiWords without a corresponding - file are highlighted as errors (otherwise it doesn't matter). - - The default mappings are defined as follow (By default, stands - for '\'. See |Leader| for more info) : - - ww - open the Wiki HomePage - wi - open the Wiki index - wf - follow a WikiWord (can be used in any buffer!) - we - edit a Wiki file - - The following mappings are present when editing a Wiki file: - - - close the file - - follow the WikiWord under the cursor - - move to the next WikiWord - - move to the previous WikiWord - wr - reload WikiWords - - See |potwiki-mappings-override| and |potwiki-options| to learn how to - override those default mappings. - -============================================================================== -3. potwiki commands *potwiki-commands* - - See |potwiki-intro| for default mapping. - - Currently potwiki does not define any commands. - -============================================================================== -4. potwiki customization *potwiki-customize* - -4.1. General configuration ~ --------------------------- - *loaded_potwiki* *potwiki-disable* - You can disable this script by putting the following line in your |vimrc| > - let loaded_potwiki = 1 -< - - You can define your own color scheme for potwiki highlighting, by setting - |highlight| on PotwikiWord and PotwikiWordNotFound groups. For example: -> - highlight PotwikiWord guifg=darkcyan - highlight PotwikiWordNotFound guibg=Red guifg=Yellow -< - When a wiki file is edited the 'filetype' and 'syntax' options are set - to 'potwiki'. You can use autocommands for this filetype to customize - your wiki editing. For exmaple: -> - :au Filetype potwiki set sts=4 -< - If you want to be able to switch the highlighting on and off with -> - :syntax on | enable | off -< - put the following line in a file called 'potwiki.vim' in your syntax - directory (usually ~/.vim/syntax): -> - call PotwikiSyntax() -< - -4.2. Mapping documentation: ~ ---------------------------- - *potwiki-mappings-override* - By default, a global mapping is defined for some commands. User-provided - mappings can be used instead by mapping to CommandName. This is - especially useful when these mappings collide with other existing mappings - (vim will warn of this during plugin initialization, but will not clobber - the existing mappings). - - For instance, to override the default mapping for :PotwikiHome to set it to - \wh, add the following to the |vimrc|: -> - nmap \wh PotwikiHome -< -4.3. Options documentation: ~ ---------------------------- - *potwiki-options* - Several variables are checked by the script to customize potwiki - behavior. You can set them using let in your |vimrc| file. - Example: -> - let potwiki_home = "$HOME/MyWiki/HomePage" -< - potwiki_suffix *potwiki_suffix* - This variable contains a suffix appended to the names of your - Wikifiles. - default: '' - - potwiki_home *potwiki_home* - This variable contains the filename of your Wiki HomePage. - default: $HOME/Wiki/HomePage + potwiki_suffix - - potwiki_home_dir *potwiki_home_dir* - This variable contains the path of your Wiki directory. - default: the directory containing the file set in potwiki_home. - - potwiki_upper *potwiki_upper* - Upper case characters for WikiWords. Uses the syntax of [ ] atoms - in regular expressions. - default: 'A-Z' - - potwiki_lower *potwiki_lower* - Lower case characters for WikiWords. Uses the syntax of [ ] atoms - in regular expressions. - default: 'a-z' - - potwiki_other *potwiki_other* - Non-letter characters for WikiWords. Uses the syntax of [ ] atoms - in regular expressions. - default: '0-9_' - - potwiki_autowrite *potwiki_autowrite* - If this is non-zero potwiki always writes a Wiki file when it - is closed by PotwikiClose or when you follow another WikiWord. - (The file is only written if it has been changed.) - - potwiki_ignore *potwiki_ignore* - A comma-separated list of words you don't want potwiki to - highlight. Don't include any whitespace in this list. - default: '' - -============================================================================== -6. potwiki bugs *potwiki-bugs* - - Please contact me if you find any bugs in - potwiki. I'm sure there are enough of them. - - Include 'potwiki' in the subject line when contacting me. - -============================================================================== -7. potwiki TODO list *potwiki-todo* - - Please contact me if you have suggestions - for improving potwiki. - - Include 'potwiki' in the subject line when contacting me. - -============================================================================== - - vim:tw=78:ts=8:ft=help:norl: diff --git a/dot.vim/doc/rails.txt b/dot.vim/doc/rails.txt deleted file mode 100644 index fa4c64a..0000000 --- a/dot.vim/doc/rails.txt +++ /dev/null @@ -1,1202 +0,0 @@ -*rails.txt* Plugin for working with Ruby on Rails applications - -Author: Tim Pope |rails-plugin-author| - -|rails-introduction| Introduction and Feature Summary -|rails-installation| Installation and Usage -|rails-install-vim| Installing and Configuring Vim -|rails-install-plugin| Installing and Using the Plugin -|rails-commands| General Commands -|rails-navigation| Navigation -|rails-gf| File Under Cursor - gf -|rails-alternate-related| Alternate and Related Files -|rails-model-navigation| Model Navigation Commands -|rails-controller-navigation| Controller Navigation Commands -|rails-misc-navigation| Miscellaneous Navigation 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* - -TextMate may be the latest craze for developing Ruby on Rails applications, -but Vim is forever. This plugin offers the following features for Ruby on -Rails application development. - -1. Automatically detects buffers containing files from Rails applications, - and applies settings to those buffers (and only those buffers). You can - use an autocommand to apply your own custom settings as well. - |rails-configuration| - -2. Unintrusive. Only files in a Rails application should be affected; regular - Ruby scripts are left untouched. Even when enabled, the plugin should keep - out of your way if you're not using its features. (If you find a situation - where this is not a case, contact the |rails-plugin-author|.) - -3. Easy navigation of the Rails directory structure. |gf| considers context - and knows about partials, fixtures, and much more. There are two commands, - :A (alternate) and :R (related) for easy jumping between files, including - favorites like model to migration, template to helper, and controller to - functional test. For more advanced usage, :Rmodel, :Rview, :Rcontroller, - and several other commands are provided. |rails-navigation| - -4. Enhanced syntax highlighting. From has_and_belongs_to_many to - distance_of_time_in_words, it's here. For easy completion of these long - method names, 'completefunc' is set to enable syntax based completion on - |i_CTRL-X_CTRL-U|. |rails-syntax| - -5. Interface to rake. Use :Rake to run the current test, spec, or feature. - Use :.Rake to do a focused run of just the method, example, or scenario on - the current line. :Rake can also run arbitrary migrations, load individual - fixtures, and more. |rails-rake| - -6. Interface to script/*. Generally, use ":Rscript about" to call - "script/about". Most commands have wrappers with additional features: - ":Rgenerate controller Blog" generates a blog controller and edits - app/controllers/blog_controller.rb. |rails-scripts| - -7. Partial extraction and migration inversion. |:Rextract| {file} replaces - the desired range (ideally selected in visual line mode) with "render - :partial => '{file}'", which is automatically created with your content. - The @{file} instance variable is replaced with the {file} local variable. - |:Rinvert| takes a self.up migration and writes a self.down. - |rails-refactoring| - -8. Integration with other plugins. |:Rtree| spawns NERDTree.vim or creates a - new project.vim project. If dbext.vim is installed, it will be - transparently configured to reflect database.yml. Cream users get some - additional mappings, and all GUI users get a menu. |rails-integration| - -============================================================================== -INSTALLATION AND USAGE *rails-installation* - -If you are familiar Vim and have the latest version installed, you may skip -directly to |rails-install-plugin| below. - -Installing and Configuring Vim ~ - *rails-install-vim* -Vim 7 or newer is required. If possible, install a version of Vim with the -|Ruby| interface compiled in, as a few features will make use of it when -available. - -If you are new to Vim, you need to create a vimrc. For Windows, this file -goes in ~\_vimrc (try :e ~\_vimrc if you don't know where this is). On other -platforms, use ~/.vimrc. A very minimal example file is shown below. -> - set nocompatible - syntax on - filetype plugin indent on -> -Installing and Using the Plugin ~ - *rails-install-plugin* -If you have the zip file, extract it to vimfiles (Windows) or ~/.vim -(everything else). You should have the following files: > - autoload/rails.vim - plugin/rails.vim - doc/rails.txt -See |add-local-help| for instructions on enabling the documentation. In a -nutshell: > - :helptags ~/.vim/doc - -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 {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} Edit {file}, relative to the application root. Append - :line or #method to jump within the file, as in - :Redit app/controllers/users_controller.rb:12 or - :Redit app/models/user.rb#activate . - - *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 -< The following appears to work on Windows: > - :command -bar -nargs=1 OpenURL :!start cmd /cstart /b -< On Debian compatible distributions, the following is - the preferred method: > - :command -bar -nargs=1 OpenURL :!sensible-browser -< 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 blog_controller - :find book_test -< - *rails-:Rfind* -:Rfind [{file}] Find {file}. Very similar to :find, but things like - BlogController are properly handled, and tab complete - works. The default filename is taken from under the - cursor in a manner quite similar to gf, described - below. - -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.find(: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 :partial => '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.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). A mapping for :A is [f . - - *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." A mapping for :R is ]f . -:RV -:RT -:RD - - *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/routes.rb config/database.yml config/environment.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. - -For the less common cases, a more deliberate set of commands are provided. -Each of the following takes an optional argument (with tab completion) but -defaults to a reasonable guess that follows Rails conventions. For example, -when editing app/models/employee.rb, :Rcontroller will default to -app/controllers/employees_controller.rb. The controller and model options -can override the mapping from model related files to controller related files -(Rset controller=hiring) and vice versa (Rset model=employee). See -|rails-:Rset|. - -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 |:Redit|. - - -Model Navigation Commands ~ - *rails-model-navigation* -The default for model navigation commands is the current model, if it can be -determined. For example, test/unit/post_test.rb would have a current model -of post. Otherwise, if a controller name can be determined, said controller -name will be singularized and used. To override this, use a command like: > - Rset model=comment - -:Rmodel |rails-:Rmodel| -:Rmigration |rails-:Rmigration| -:Robserver |rails-:Robserver| -:Rfixtures |rails-:Rfixtures| -:Runittest |rails-:Runittest| - - *rails-:Rmodel* -:Rmodel [{name}] Edit the specified model. - - *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-: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-:Rfixtures* -:Rfixtures [{name}] Edit the fixtures for the given 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 automatically. An - optional extension can be given, to distinguish - between YAML and CSV fixtures. - - *rails-:Runittest* -:Runittest [{name}] Edit the unit test or model spec for the specified - model. - -Controller Navigation Commands ~ - *rails-controller-navigation* -The default for controller navigation commands is the current controller, if -it can be determined. For example, test/functional/blog_test.rb would have a -current controller of blog. Otherwise, if a model name can be determined, -said model name will be pluralized and used. To override this, use a command -like: > - Rset controller=blog - -:Rcontroller |rails-:Rcontroller| -:Rhelper |rails-:Rhelper| -:Rview |rails-:Rview| -:Rlayout |rails-:Rlayout| -:Rfunctionaltest |rails-:Rfunctionaltest| - - *rails-:Rcontroller* -:Rcontroller [{name}] Edit the specified controller. - - *rails-:Rhelper* -:Rhelper [{name}] Edit the helper for the specified controller. - - *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. - - *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-:Rfunctionaltest* -:Rfunctionaltest [{name}] - Edit the functional test or controller spec for the - specified controller. - - *rails-:Rapi* -:Rapi [{name}] This command is obsolete; add it yourself with - |:Rnavcommand| if you still desire it. - -Miscellaneous Navigation Commands ~ - *rails-misc-navigation* - -The following commands are not clearly associated with models or controllers. - -:Rstylesheet |rails-:Rstylesheet| -:Rjavascript |rails-:Rjavascript| -:Rplugin |rails-:Rplugin| -:Rlib |rails-:Rlib| -:Rtask |rails-:Rtask| -:Rmetal |rails-:Rmetal| -:Renvironment |rails-:Renvironment| -:Rinitializer |rails-:Rinitializer| -:Rlocale |rails-:Rlocale| -:Rintegrationtest |rails-:Rintegrationtest| -:Rspec |rails-:Rspec| - - *rails-:Rstylesheet* -:Rstylesheet [{name}] Edit the stylesheet for the specified name, defaulting - to the current controller's name. - - *rails-:Rjavascript* -:Rjavascript [{name}] Edit the javascript for the specified name, defaulting - to the current controller's name. - - *rails-:Rplugin* -:Rplugin {plugin}[/{path}] - Edits a file within a plugin. If the path to the file - is omitted, it defaults to init.rb. - - *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 config/routes.rb. - - *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-:Rmetal* -:Rmetal [{name}] Edit the app/metal file specified. With no argument, - defaults to editing config/boot.rb. - - *rails-:Renvironment* -:Renvironment [{name}] Edit the config/environments file specified. With no - argument, defaults to editing config/environment.rb. - - *rails-:Rinitializer* -:Rinitializer [{name}] Edit the config/initializers file specified. With no - argument, defaults to editing config/routes.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-:Rintegrationtest* -:Rintegrationtest [{name}] - Edit the integration test, integration spec, or - cucumber feature specified. With no argument, - defaults to editing test/test_helper.rb. - - *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. - -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) - and opens the quickfix window if there were any - errors. 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=... SPEC_OPTS=--line=... -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 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

- 2

<%= @post.title %>

- 3

<%= @post.body %>

- 4
- -And you issue this command: > - - :2,3Rextract post - -Your file will change to this: > - - 1
- 2 <%= render :partial => 'post' %> - 3
- -And app/views/blog/_post.html.erb will now contain: > - - 1

<%= post.title %>

- 2

<%= post.body %>

- -As a special case, if the file had looked like this: > - - 1 <% for object in @posts -%> - 2

<%= object.title %>

- 3

<%= object.body %>

- 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* *rails-:Rproject* -:Rtree [{arg}] If |NERDTree| is installed, open a tree for the - application root or the given subdirectory. - Otherwise, if when the |project| plugin is installed, - invoke :Project (typically without an argument), and - search for the root of the current Rails application. - If it is not found, create a new project, with - appropriate directories (app, etc., but not vendor). - - *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 versions 8.00 and newer, this - command is called automatically when needed. For - older versions, it is called automatically when - rails.vim loads if |g:rails_dbext| is set (which it is - by default). - - *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 ~ -= <%= ^ %> -- <% ^ -%> -# <%# ^ %> - <% ^ -%>\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 as o anyways. -> - imap o -< -One can also use the surrounding in a plain Ruby file to append a bare -"end" on the following line. - - *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 -< - *rails-merb* -Merb support is a long term possibility. For now, if you touch -config/environment.rb in your Merb application, rails.vim will activate. -Send feedback on what's missing to the |rails-plugin-author| and perhaps one -day Merb can be officially supported. - -============================================================================== -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 (see |i_CTRL-]|) or a (if 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 render :partial => -Rabbrev vs( validates_size_of vs( validates_size_of( -Rabbrev pa[ params pa[:id] params[:id] -Rabbrev pa[ params pa params -Rabbrev pa[ params pa.inspect params.inspect -Rabbrev AR:: ActionRecord AR::Base ActiveRecord::Base -Rabbrev :a :action\ =>\ render :a 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 "". 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-@params* *rails-syntax-deprecated* -Certain deprecated syntax (like @params and render_text) is highlighted as an -error. If you trigger this highlighting, generally it means you need to -update your code. - - *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 = %<
Vim> -< - *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-'statusline'* *rails-'stl'* -Useful information is added to the 'statusline', when |g:rails_statusline| is -enabled. - - *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 :Rake -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 wsn wsdl_service_name - autocmd User Rails.model.arb* iabbr vfo validates_format_of - autocmd User Rails.view.erb* imap <%= %>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 preview=blog/edit/1 - :Rset alternate=app/models/ - :Rset l:task=preview " Special pseudo-task for :Rake - -Note the use of a scope prefix in the last example. - - *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 -Do not load the plugin. For emergency use only. - - *g:rails_abbreviations* -Enable Rails abbreviations. See |rails-abbreviations|. Enabled by default. - - *g:rails_dbext* > - let g:rails_dbext=1 -Enable integration with the dbext plugin, if it is installed. Defaults to the -value of |g:rails_expensive|. When this option is set, dbext settings are -automagically extracted from config/database.yml. Then, you can use features -like table name completion and commands like > - :Create database brablog_development - :Select * from posts where title like '%Denmark%' -Note that dbext is a complicated plugin, and may require additional -configuration. See |dbext| (if installed) and |sql-completion-dynamic|. - - *g:rails_ctags_arguments* > - let g:rails_ctags_arguments='--exclude="*.js"' -Additional arguments to pass to ctags from |:Rtags|. Defaults to -'--exclude=facebox.js --exclude="*.*.js"', which attempts to ignore jQuery -plugins that can choke up ctags. - - *g:rails_default_file* > - let g:rails_default_file='config/database.yml' -File to load when a new Rails application is created, or when loading an -existing project from the menu. Defaults to the README. - - *g:rails_default_database* > - let g:rails_default_database='sqlite3' -Database to use for new applications. Defaults to letting Rails decide. - - *rails-slow* *g:rails_expensive* > - let g:rails_expensive=1 -Enables or disables expensive (slow) features (typically involving calls to -the Ruby interpreter). Recommended for moderately fast computers. This -option used to be disabled by default on Windows, but now it is enabled by -default everywhere. If the Vim Ruby interface is available, this option is -mostly ignored, as spawning a new process is generally the bottleneck for most -expensive operations. Set this option to 0 if you experience painful delays -when first editing a file from a Rails application. - - *rails-screen* *g:rails_gnu_screen* > - let g:rails_gnu_screen=1 -Use GNU Screen (if it is running) to launch |:Rconsole| 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 1. - - *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_statusline* > - let g:rails_statusline=1 -Give a clue in the statusline when this plugin is enabled. Enabled by -default. This used to be a far more verbose indicator which included the -type of Rails file. If you actually liked this, you can add either -%{rails#statusline(1)} or %{rails#STATUSLINE(1)} to 'statusline' explicitly -(and let the author know, because this fallback is likely getting the boot). - - *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 him at . He -can also be found on Freenode's IRC network, hanging out in #rubyonrails and -#vim as tpope. - -The official homepage is - http://rails.vim.tpope.net -The latest stable version can be found at - http://www.vim.org/scripts/script.php?script_id=1567 -You can keep up to date with |GetLatestVimScripts|. - -The very latest development versions can be retrieved from Git: - http://github.com/tpope/vim-rails - git clone git://github.com/tpope/vim-rails.git - -The Github repository has Pledgie donations enabled. All donations made will -proxied along to ICCF, which goes to help needy children in |Uganda|. -Donations will be made in through the plugin author's vim.org account through -http://www.vim.org/sponsor/ . The voting privileges associated with the -donation will be used to vote for features that will enable better plugins in -the future. If you would rather keep those voting privileges for yourself, or -you want your donation to be tax deductible, donate directly through vim.org -instead. Donations made on or before December 24, 2009 will be matched in a -Christmas donation. - -Feedback is highly desired on this plugin. Please send all comments, -complaints, and compliments to the author. No bug is too small to report. - - *rails-license* -This plugin is distributable under the same terms as Vim itself. See -|license|. No warranties, expressed or implied. - -============================================================================== -vim:tw=78:ts=8:ft=help:norl: diff --git a/dot.vim/doc/snipMate.txt b/dot.vim/doc/snipMate.txt deleted file mode 100644 index 704d44a..0000000 --- a/dot.vim/doc/snipMate.txt +++ /dev/null @@ -1,286 +0,0 @@ -*snipMate.txt* Plugin for using TextMate-style snippets in Vim. - -snipMate *snippet* *snippets* *snipMate* -Last Change: July 13, 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 - -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 . - -For instance, in a C file using the default installation of snipMate.vim, if -you type "for" 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 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 . - -============================================================================== -SYNTAX *snippet-syntax* - -Snippets can be defined in two ways. They can be in their own file, named -after their trigger in 'snippets//.snippet', or they can be -defined together in a 'snippets/.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
tag, and then allow -the user to press to go to the middle of it: - > - snippet div -
- ${2} -
-< - *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 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 - - -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" 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///.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//.snippet'. If the snippet has -multiple matches, it should look like this: -'snippets///.snippet' (see |multi_snip|). - - *ResetSnippets()* -The ResetSnippets() function 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. - - *list-snippets* *i_CTRL-R_* -If you would like to see what snippets are available, simply type -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 =TriggerSnippet() - snor i=TriggerSnippet() - -to this: > - ino =TriggerSnippet() - snor i=TriggerSnippet() - -============================================================================== -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] 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.: > - - '${3}
' -< - 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 , 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 gmail com - -I greatly appreciate any suggestions or improvements offered for the script. - -============================================================================== - -vim:tw=78:ts=8:ft=help:norl: diff --git a/dot.vim/doc/taglist.txt b/dot.vim/doc/taglist.txt deleted file mode 100755 index 6a62b39..0000000 --- a/dot.vim/doc/taglist.txt +++ /dev/null @@ -1,1501 +0,0 @@ -*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 key to toggle the taglist window. -> - nnoremap :TlistToggle -< -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 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 key -or by double clicking the file name using the mouse. - -In the taglist window, you can use the [[ or key to jump to the -beginning of the previous file. You can use the ]] or 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 . - -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 -< -To load a saved taglist session, use the ":TlistSessionLoad" command: > - - :TlistSessionLoad -< -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~ - - 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. - 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 - Jump to the beginning of the previous file - ]] Jump to the beginning of the next file - Jump to the beginning of the next file - q Close the taglist window - 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-" command to get help on the various taglist -topics. - -You can press the key in the taglist window to display the help -information about using the taglist window. If you again press the 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 - - ;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 -< - 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/dot.vim/doc/tags b/dot.vim/doc/tags deleted file mode 100644 index a5f7d35..0000000 --- a/dot.vim/doc/tags +++ /dev/null @@ -1,834 +0,0 @@ -'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'* -'snippets' snipMate.txt /*'snippets'* -.snippet snipMate.txt /*.snippet* -.snippets snipMate.txt /*.snippets* -:ABitLy twitvim.txt /*:ABitLy* -:ACligs twitvim.txt /*:ACligs* -:AIsGd twitvim.txt /*:AIsGd* -:AMetamark twitvim.txt /*:AMetamark* -:ASnipurl twitvim.txt /*:ASnipurl* -:ATinyURL twitvim.txt /*:ATinyURL* -:ATrim twitvim.txt /*:ATrim* -:ATweetburner twitvim.txt /*:ATweetburner* -:AUrlBorg twitvim.txt /*:AUrlBorg* -:ArrangeColumn ft-csv.txt /*:ArrangeColumn* -:BPosttoTwitter twitvim.txt /*:BPosttoTwitter* -:BackTwitter twitvim.txt /*:BackTwitter* -:BitLy twitvim.txt /*:BitLy* -:CPosttoTwitter twitvim.txt /*:CPosttoTwitter* -:Cligs twitvim.txt /*:Cligs* -:DMSentTwitter twitvim.txt /*:DMSentTwitter* -:DMTwitter twitvim.txt /*:DMTwitter* -:Filter ft-csv.txt /*:Filter* -:ForwardTwitter twitvim.txt /*:ForwardTwitter* -:FriendsTwitter twitvim.txt /*:FriendsTwitter* -:IsGd twitvim.txt /*:IsGd* -:LocationTwitter twitvim.txt /*:LocationTwitter* -:Metamark twitvim.txt /*:Metamark* -:NextTwitter twitvim.txt /*:NextTwitter* -:PBitLy twitvim.txt /*:PBitLy* -:PCligs twitvim.txt /*:PCligs* -:PIsGd twitvim.txt /*:PIsGd* -:PMetamark twitvim.txt /*:PMetamark* -:PSnipurl twitvim.txt /*:PSnipurl* -:PTinyURL twitvim.txt /*:PTinyURL* -:PTrim twitvim.txt /*:PTrim* -:PTweetburner twitvim.txt /*:PTweetburner* -:PUrlBorg twitvim.txt /*:PUrlBorg* -:PosttoTwitter twitvim.txt /*:PosttoTwitter* -:PreviousTwitter twitvim.txt /*:PreviousTwitter* -:ProfileTwitter twitvim.txt /*:ProfileTwitter* -:PublicTwitter twitvim.txt /*:PublicTwitter* -:RateLimitTwitter twitvim.txt /*:RateLimitTwitter* -:RefreshTwitter twitvim.txt /*:RefreshTwitter* -:RepliesTwitter twitvim.txt /*:RepliesTwitter* -:SearchTwitter twitvim.txt /*:SearchTwitter* -:SendDMTwitter twitvim.txt /*:SendDMTwitter* -:Snipurl twitvim.txt /*:Snipurl* -:TinyURL twitvim.txt /*:TinyURL* -: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* -:Todo CuteTodoList.txt /*:Todo* -:TodoClose CuteTodoList.txt /*:TodoClose* -:TodoOpen CuteTodoList.txt /*:TodoOpen* -:Todog CuteTodoList.txt /*:Todog* -:Trim twitvim.txt /*:Trim* -:Tweetburner twitvim.txt /*:Tweetburner* -:UrlBorg twitvim.txt /*:UrlBorg* -:UserTwitter twitvim.txt /*:UserTwitter* -:VWS vimwiki.txt /*:VWS* -:Vimwiki2HTML vimwiki.txt /*:Vimwiki2HTML* -:VimwikiAll2HTML vimwiki.txt /*:VimwikiAll2HTML* -:VimwikiDeleteLink vimwiki.txt /*:VimwikiDeleteLink* -:VimwikiDiaryNextDay vimwiki.txt /*:VimwikiDiaryNextDay* -:VimwikiDiaryPrevDay vimwiki.txt /*:VimwikiDiaryPrevDay* -:VimwikiFollowLink vimwiki.txt /*:VimwikiFollowLink* -:VimwikiGenerateLinks vimwiki.txt /*:VimwikiGenerateLinks* -:VimwikiGoBackLink vimwiki.txt /*:VimwikiGoBackLink* -:VimwikiGoto vimwiki.txt /*:VimwikiGoto* -:VimwikiIndex vimwiki.txt /*:VimwikiIndex* -:VimwikiMakeDiaryNote vimwiki.txt /*:VimwikiMakeDiaryNote* -:VimwikiNextLink vimwiki.txt /*:VimwikiNextLink* -:VimwikiPrevLink vimwiki.txt /*:VimwikiPrevLink* -:VimwikiRenameLink vimwiki.txt /*:VimwikiRenameLink* -:VimwikiSearch vimwiki.txt /*:VimwikiSearch* -:VimwikiSplitLink vimwiki.txt /*:VimwikiSplitLink* -:VimwikiTabIndex vimwiki.txt /*:VimwikiTabIndex* -:VimwikiTabMakeDiaryNote vimwiki.txt /*:VimwikiTabMakeDiaryNote* -:VimwikiTable vimwiki.txt /*:VimwikiTable* -:VimwikiTableMoveColumnLeft vimwiki.txt /*:VimwikiTableMoveColumnLeft* -:VimwikiTableMoveColumnRight vimwiki.txt /*:VimwikiTableMoveColumnRight* -:VimwikiToggleListItem vimwiki.txt /*:VimwikiToggleListItem* -:VimwikiUISelect vimwiki.txt /*:VimwikiUISelect* -:VimwikiVSplitLink vimwiki.txt /*:VimwikiVSplitLink* -, zencoding.txt /*,* -/ zencoding.txt /*\/* -A zencoding.txt /*A* -D zencoding.txt /*D* -N zencoding.txt /*N* -a zencoding.txt /*a* -d zencoding.txt /*d* -i zencoding.txt /*i* -j zencoding.txt /*j* -k zencoding.txt /*k* -n zencoding.txt /*n* - CuteTodoList.txt /** -Analyze_CSV ft-csv.txt /*Analyze_CSV* -ArrangeColumn_CSV ft-csv.txt /*ArrangeColumn_CSV* -CSV-Funtions ft-csv.txt /*CSV-Funtions* -CSVFixed ft-csv.txt /*CSVFixed* -CSVPat() ft-csv.txt /*CSVPat()* -CSV_WCol ft-csv.txt /*CSV_WCol* -ConqueTerm conque_term.txt /*ConqueTerm* -ConvertData_CSV ft-csv.txt /*ConvertData_CSV* -Copy_CSV ft-csv.txt /*Copy_CSV* -CuteTodoList.txt CuteTodoList.txt /*CuteTodoList.txt* -DeleteColumn_CSV ft-csv.txt /*DeleteColumn_CSV* -Duplicate_CSV ft-csv.txt /*Duplicate_CSV* -ExtractSnips() snipMate.txt /*ExtractSnips()* -ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()* -Filename() snipMate.txt /*Filename()* -Filter_CSV ft-csv.txt /*Filter_CSV* -HeaderToggle_CSV ft-csv.txt /*HeaderToggle_CSV* -Header_CSV ft-csv.txt /*Header_CSV* -HiColumn_CSV ft-csv.txt /*HiColumn_CSV* -InitCSV ft-csv.txt /*InitCSV* -MoveCol_CSV ft-csv.txt /*MoveCol_CSV* -NERDAllowAnyVisualDelims NERD_commenter.txt /*NERDAllowAnyVisualDelims* -NERDBlockComIgnoreEmpty NERD_commenter.txt /*NERDBlockComIgnoreEmpty* -NERDComAlignedComment NERD_commenter.txt /*NERDComAlignedComment* -NERDComAltDelim NERD_commenter.txt /*NERDComAltDelim* -NERDComAppendComment NERD_commenter.txt /*NERDComAppendComment* -NERDComAuthor NERD_commenter.txt /*NERDComAuthor* -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* -NERDComFiletypes NERD_commenter.txt /*NERDComFiletypes* -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* -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* -NERDComPrependComment NERD_commenter.txt /*NERDComPrependComment* -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* -NERDCommentWholeLinesInVMode NERD_commenter.txt /*NERDCommentWholeLinesInVMode* -NERDCommenter NERD_commenter.txt /*NERDCommenter* -NERDCommenterContents NERD_commenter.txt /*NERDCommenterContents* -NERDCompactSexyComs NERD_commenter.txt /*NERDCompactSexyComs* -NERDDefaultNesting NERD_commenter.txt /*NERDDefaultNesting* -NERDLPlace NERD_commenter.txt /*NERDLPlace* -NERDMapleader NERD_commenter.txt /*NERDMapleader* -NERDMenuMode NERD_commenter.txt /*NERDMenuMode* -NERDRPlace NERD_commenter.txt /*NERDRPlace* -NERDRemoveAltComs NERD_commenter.txt /*NERDRemoveAltComs* -NERDRemoveExtraSpaces NERD_commenter.txt /*NERDRemoveExtraSpaces* -NERDShutUp NERD_commenter.txt /*NERDShutUp* -NERDSpaceDelims NERD_commenter.txt /*NERDSpaceDelims* -NERDUsePlaceHolders NERD_commenter.txt /*NERDUsePlaceHolders* -NERD_commenter.txt NERD_commenter.txt /*NERD_commenter.txt* -NewRecord_CSV ft-csv.txt /*NewRecord_CSV* -NewRecords_CSV ft-csv.txt /*NewRecords_CSV* -NrColumns_CSV ft-csv.txt /*NrColumns_CSV* -ResetSnippets() snipMate.txt /*ResetSnippets()* -RltvNmbr RltvNmbr.txt /*RltvNmbr* -RltvNmbr-contents RltvNmbr.txt /*RltvNmbr-contents* -RltvNmbr-copyright RltvNmbr.txt /*RltvNmbr-copyright* -RltvNmbr-history RltvNmbr.txt /*RltvNmbr-history* -RltvNmbr-manual RltvNmbr.txt /*RltvNmbr-manual* -RltvNmbr.txt RltvNmbr.txt /*RltvNmbr.txt* -SearchInColumn_CSV ft-csv.txt /*SearchInColumn_CSV* -Sort_CSV ft-csv.txt /*Sort_CSV* -SumCol_CSV ft-csv.txt /*SumCol_CSV* -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()* -Todo CuteTodoList.txt /*Todo* -TodoClose CuteTodoList.txt /*TodoClose* -TodoOpen CuteTodoList.txt /*TodoOpen* -Todog CuteTodoList.txt /*Todog* -Transpose_CSV ft-csv.txt /*Transpose_CSV* -TwitVim twitvim.txt /*TwitVim* -TwitVim-A-d twitvim.txt /*TwitVim-A-d* -TwitVim-A-g twitvim.txt /*TwitVim-A-g* -TwitVim-A-r twitvim.txt /*TwitVim-A-r* -TwitVim-A-t twitvim.txt /*TwitVim-A-t* -TwitVim-C-PageDown twitvim.txt /*TwitVim-C-PageDown* -TwitVim-C-PageUp twitvim.txt /*TwitVim-C-PageUp* -TwitVim-C-i twitvim.txt /*TwitVim-C-i* -TwitVim-C-o twitvim.txt /*TwitVim-C-o* -TwitVim-C-t twitvim.txt /*TwitVim-C-t* -TwitVim-Leader-@ twitvim.txt /*TwitVim-Leader-@* -TwitVim-Leader-Leader twitvim.txt /*TwitVim-Leader-Leader* -TwitVim-Leader-S-r twitvim.txt /*TwitVim-Leader-S-r* -TwitVim-Leader-X twitvim.txt /*TwitVim-Leader-X* -TwitVim-Leader-d twitvim.txt /*TwitVim-Leader-d* -TwitVim-Leader-e twitvim.txt /*TwitVim-Leader-e* -TwitVim-Leader-g twitvim.txt /*TwitVim-Leader-g* -TwitVim-Leader-p twitvim.txt /*TwitVim-Leader-p* -TwitVim-Leader-r twitvim.txt /*TwitVim-Leader-r* -TwitVim-LongURL twitvim.txt /*TwitVim-LongURL* -TwitVim-add twitvim.txt /*TwitVim-add* -TwitVim-cURL twitvim.txt /*TwitVim-cURL* -TwitVim-contents twitvim.txt /*TwitVim-contents* -TwitVim-credits twitvim.txt /*TwitVim-credits* -TwitVim-delete twitvim.txt /*TwitVim-delete* -TwitVim-direct-message twitvim.txt /*TwitVim-direct-message* -TwitVim-goto twitvim.txt /*TwitVim-goto* -TwitVim-highlight twitvim.txt /*TwitVim-highlight* -TwitVim-history twitvim.txt /*TwitVim-history* -TwitVim-hotkeys twitvim.txt /*TwitVim-hotkeys* -TwitVim-inreplyto twitvim.txt /*TwitVim-inreplyto* -TwitVim-install twitvim.txt /*TwitVim-install* -TwitVim-intro twitvim.txt /*TwitVim-intro* -TwitVim-line-length twitvim.txt /*TwitVim-line-length* -TwitVim-login-base64 twitvim.txt /*TwitVim-login-base64* -TwitVim-manual twitvim.txt /*TwitVim-manual* -TwitVim-mappings twitvim.txt /*TwitVim-mappings* -TwitVim-next twitvim.txt /*TwitVim-next* -TwitVim-non-cURL twitvim.txt /*TwitVim-non-cURL* -TwitVim-previous twitvim.txt /*TwitVim-previous* -TwitVim-profile twitvim.txt /*TwitVim-profile* -TwitVim-refresh twitvim.txt /*TwitVim-refresh* -TwitVim-reply twitvim.txt /*TwitVim-reply* -TwitVim-retweet twitvim.txt /*TwitVim-retweet* -TwitVim-ssl twitvim.txt /*TwitVim-ssl* -TwitVim-ssl-curl twitvim.txt /*TwitVim-ssl-curl* -TwitVim-ssl-perl twitvim.txt /*TwitVim-ssl-perl* -TwitVim-ssl-python twitvim.txt /*TwitVim-ssl-python* -TwitVim-ssl-ruby twitvim.txt /*TwitVim-ssl-ruby* -TwitVim-switch twitvim.txt /*TwitVim-switch* -TwitVim-timeline-commands twitvim.txt /*TwitVim-timeline-commands* -TwitVim-tips twitvim.txt /*TwitVim-tips* -TwitVim-update-commands twitvim.txt /*TwitVim-update-commands* -TwitVim-utility twitvim.txt /*TwitVim-utility* -UnArrangeColumn_CSV ft-csv.txt /*UnArrangeColumn_CSV* -VHeaderToggle_CSV ft-csv.txt /*VHeaderToggle_CSV* -VHeader_CSV ft-csv.txt /*VHeader_CSV* -VertFold_CSV ft-csv.txt /*VertFold_CSV* -VimwikiWeblinkHandler vimwiki.txt /*VimwikiWeblinkHandler* -Vjdegd vjde.txt /*Vjdegd* -Vjdeinfo vjde.txt /*Vjdeinfo* -WhatColumn_CSV ft-csv.txt /*WhatColumn_CSV* -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* -csv-aggregate-functions ft-csv.txt /*csv-aggregate-functions* -csv-analyze ft-csv.txt /*csv-analyze* -csv-arrange-autocmd ft-csv.txt /*csv-arrange-autocmd* -csv-changelog ft-csv.txt /*csv-changelog* -csv-column ft-csv.txt /*csv-column* -csv-commands ft-csv.txt /*csv-commands* -csv-comments ft-csv.txt /*csv-comments* -csv-conceal ft-csv.txt /*csv-conceal* -csv-configuration ft-csv.txt /*csv-configuration* -csv-convert ft-csv.txt /*csv-convert* -csv-delimiter ft-csv.txt /*csv-delimiter* -csv-filter ft-csv.txt /*csv-filter* -csv-fixedwidth ft-csv.txt /*csv-fixedwidth* -csv-header ft-csv.txt /*csv-header* -csv-hicol ft-csv.txt /*csv-hicol* -csv-higroup ft-csv.txt /*csv-higroup* -csv-installation ft-csv.txt /*csv-installation* -csv-intro ft-csv.txt /*csv-intro* -csv-mapping ft-csv.txt /*csv-mapping* -csv-mbyte ft-csv.txt /*csv-mbyte* -csv-move-folds ft-csv.txt /*csv-move-folds* -csv-newline ft-csv.txt /*csv-newline* -csv-nrformat ft-csv.txt /*csv-nrformat* -csv-slow ft-csv.txt /*csv-slow* -csv-stl ft-csv.txt /*csv-stl* -csv-strict ft-csv.txt /*csv-strict* -csv-syntax ft-csv.txt /*csv-syntax* -csv-syntax-error ft-csv.txt /*csv-syntax-error* -csv-tips ft-csv.txt /*csv-tips* -csv-toc ft-csv.txt /*csv-toc* -csv-transpose ft-csv.txt /*csv-transpose* -csv-vertfold ft-csv.txt /*csv-vertfold* -cuteBufferUsage CuteTodoList.txt /*cuteBufferUsage* -cuteTodoCommands CuteTodoList.txt /*cuteTodoCommands* -cuteTodoConfiguration CuteTodoList.txt /*cuteTodoConfiguration* -cuteTodoList CuteTodoList.txt /*cuteTodoList* -ft-csv.txt ft-csv.txt /*ft-csv.txt* -fugitive fugitive.txt /*fugitive* -fugitive#statusline() fugitive.txt /*fugitive#statusline()* -fugitive-:Gblame fugitive.txt /*fugitive-:Gblame* -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-:Glcd fugitive.txt /*fugitive-:Glcd* -fugitive-:Glog fugitive.txt /*fugitive-:Glog* -fugitive-:Gmove fugitive.txt /*fugitive-:Gmove* -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-:Gsplit fugitive.txt /*fugitive-:Gsplit* -fugitive-:Gstatus fugitive.txt /*fugitive-:Gstatus* -fugitive-:Gtabedit fugitive.txt /*fugitive-:Gtabedit* -fugitive-:Gvsplit fugitive.txt /*fugitive-:Gvsplit* -fugitive-:Gwrite fugitive.txt /*fugitive-:Gwrite* -fugitive- fugitive.txt /*fugitive-* -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-author fugitive.txt /*fugitive-author* -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:loaded_rails rails.txt /*g:loaded_rails* -g:rails_abbreviations rails.txt /*g:rails_abbreviations* -g:rails_ctags_arguments rails.txt /*g:rails_ctags_arguments* -g:rails_dbext rails.txt /*g:rails_dbext* -g:rails_default_database rails.txt /*g:rails_default_database* -g:rails_default_file rails.txt /*g:rails_default_file* -g:rails_expensive rails.txt /*g:rails_expensive* -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_statusline rails.txt /*g:rails_statusline* -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:todo_generate_auto CuteTodoList.txt /*g:todo_generate_auto* -g:todo_list_buff_name CuteTodoList.txt /*g:todo_list_buff_name* -g:todo_list_filename CuteTodoList.txt /*g:todo_list_filename* -g:todo_list_globfilename CuteTodoList.txt /*g:todo_list_globfilename* -g:vimwiki_CJK_length vimwiki.txt /*g:vimwiki_CJK_length* -g:vimwiki_auto_checkbox vimwiki.txt /*g:vimwiki_auto_checkbox* -g:vimwiki_badsyms vimwiki.txt /*g:vimwiki_badsyms* -g:vimwiki_browsers vimwiki.txt /*g:vimwiki_browsers* -g:vimwiki_camel_case vimwiki.txt /*g:vimwiki_camel_case* -g:vimwiki_conceallevel vimwiki.txt /*g:vimwiki_conceallevel* -g:vimwiki_dir_link vimwiki.txt /*g:vimwiki_dir_link* -g:vimwiki_file_exts vimwiki.txt /*g:vimwiki_file_exts* -g:vimwiki_fold_lists vimwiki.txt /*g:vimwiki_fold_lists* -g:vimwiki_fold_trailing_empty_lines vimwiki.txt /*g:vimwiki_fold_trailing_empty_lines* -g:vimwiki_folding vimwiki.txt /*g:vimwiki_folding* -g:vimwiki_global_ext vimwiki.txt /*g:vimwiki_global_ext* -g:vimwiki_hl_cb_checked vimwiki.txt /*g:vimwiki_hl_cb_checked* -g:vimwiki_hl_headers vimwiki.txt /*g:vimwiki_hl_headers* -g:vimwiki_html_header_numbering vimwiki.txt /*g:vimwiki_html_header_numbering* -g:vimwiki_html_header_numbering_sym vimwiki.txt /*g:vimwiki_html_header_numbering_sym* -g:vimwiki_list vimwiki.txt /*g:vimwiki_list* -g:vimwiki_list_ignore_newline vimwiki.txt /*g:vimwiki_list_ignore_newline* -g:vimwiki_listsyms vimwiki.txt /*g:vimwiki_listsyms* -g:vimwiki_lower vimwiki.txt /*g:vimwiki_lower* -g:vimwiki_menu vimwiki.txt /*g:vimwiki_menu* -g:vimwiki_stripsym vimwiki.txt /*g:vimwiki_stripsym* -g:vimwiki_table_auto_fmt vimwiki.txt /*g:vimwiki_table_auto_fmt* -g:vimwiki_upper vimwiki.txt /*g:vimwiki_upper* -g:vimwiki_use_calendar vimwiki.txt /*g:vimwiki_use_calendar* -g:vimwiki_use_mouse vimwiki.txt /*g:vimwiki_use_mouse* -g:vimwiki_valid_html_tags vimwiki.txt /*g:vimwiki_valid_html_tags* -g:vimwiki_w32_dir_enc vimwiki.txt /*g:vimwiki_w32_dir_enc* -g:vjde_taglib_uri vjde.txt /*g:vjde_taglib_uri* -hl-twitterLink twitvim.txt /*hl-twitterLink* -hl-twitterReply twitvim.txt /*hl-twitterReply* -hl-twitterTime twitvim.txt /*hl-twitterTime* -hl-twitterTitle twitvim.txt /*hl-twitterTitle* -hl-twitterUser twitvim.txt /*hl-twitterUser* -i_CTRL-R_ snipMate.txt /*i_CTRL-R_* -im_1 imaps.txt /*im_1* -imaps-usage imaps.txt /*imaps-usage* -imaps.txt imaps.txt /*imaps.txt* -imaps.txt-toc imaps.txt /*imaps.txt-toc* -list-snippets snipMate.txt /*list-snippets* -loaded_nerd_comments NERD_commenter.txt /*loaded_nerd_comments* -loaded_potwiki potwiki.txt /*loaded_potwiki* -macros/rails.vim rails.txt /*macros\/rails.vim* -multi_snip snipMate.txt /*multi_snip* -potwiki potwiki.txt /*potwiki* -potwiki-auto-help potwiki.txt /*potwiki-auto-help* -potwiki-bugs potwiki.txt /*potwiki-bugs* -potwiki-commands potwiki.txt /*potwiki-commands* -potwiki-contents potwiki.txt /*potwiki-contents* -potwiki-customize potwiki.txt /*potwiki-customize* -potwiki-disable potwiki.txt /*potwiki-disable* -potwiki-install potwiki.txt /*potwiki-install* -potwiki-intro potwiki.txt /*potwiki-intro* -potwiki-mappings-override potwiki.txt /*potwiki-mappings-override* -potwiki-options potwiki.txt /*potwiki-options* -potwiki-requirements potwiki.txt /*potwiki-requirements* -potwiki-todo potwiki.txt /*potwiki-todo* -potwiki.txt potwiki.txt /*potwiki.txt* -potwiki_autowrite potwiki.txt /*potwiki_autowrite* -potwiki_home potwiki.txt /*potwiki_home* -potwiki_home_dir potwiki.txt /*potwiki_home_dir* -potwiki_ignore potwiki.txt /*potwiki_ignore* -potwiki_lower potwiki.txt /*potwiki_lower* -potwiki_other potwiki.txt /*potwiki_other* -potwiki_suffix potwiki.txt /*potwiki_suffix* -potwiki_upper potwiki.txt /*potwiki_upper* -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-'statusline' rails.txt /*rails-'statusline'* -rails-'stl' rails.txt /*rails-'stl'* -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-:Rapi rails.txt /*rails-:Rapi* -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-: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-:Rproject rails.txt /*rails-:Rproject* -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-@params rails.txt /*rails-@params* -rails-abbreviations rails.txt /*rails-abbreviations* -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-controller-navigation rails.txt /*rails-controller-navigation* -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-install-plugin rails.txt /*rails-install-plugin* -rails-install-vim rails.txt /*rails-install-vim* -rails-installation rails.txt /*rails-installation* -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-merb rails.txt /*rails-merb* -rails-migrations rails.txt /*rails-migrations* -rails-misc-navigation rails.txt /*rails-misc-navigation* -rails-model-navigation rails.txt /*rails-model-navigation* -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-slow rails.txt /*rails-slow* -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-deprecated rails.txt /*rails-syntax-deprecated* -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-vim-integration rails.txt /*rails-vim-integration* -rails.txt rails.txt /*rails.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-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* -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-credits textile.txt /*textile-credits* -textile-requirements textile.txt /*textile-requirements* -textile.txt textile.txt /*textile.txt* -todo_+ CuteTodoList.txt /*todo_+* -todo_- CuteTodoList.txt /*todo_-* -todo_^ CuteTodoList.txt /*todo_^* -todo_generate_auto CuteTodoList.txt /*todo_generate_auto* -todo_list_buff_name CuteTodoList.txt /*todo_list_buff_name* -todo_list_filename CuteTodoList.txt /*todo_list_filename* -todo_list_globfilename CuteTodoList.txt /*todo_list_globfilename* -todo_m CuteTodoList.txt /*todo_m* -todo_o CuteTodoList.txt /*todo_o* -todo_s CuteTodoList.txt /*todo_s* -todo_u CuteTodoList.txt /*todo_u* -todo_v CuteTodoList.txt /*todo_v* -twitvim-identi.ca twitvim.txt /*twitvim-identi.ca* -twitvim.txt twitvim.txt /*twitvim.txt* -twitvim_api_root twitvim.txt /*twitvim_api_root* -twitvim_browser_cmd twitvim.txt /*twitvim_browser_cmd* -twitvim_cert_insecure twitvim.txt /*twitvim_cert_insecure* -twitvim_cligs_key twitvim.txt /*twitvim_cligs_key* -twitvim_count twitvim.txt /*twitvim_count* -twitvim_enable_perl twitvim.txt /*twitvim_enable_perl* -twitvim_enable_python twitvim.txt /*twitvim_enable_python* -twitvim_enable_ruby twitvim.txt /*twitvim_enable_ruby* -twitvim_enable_tcl twitvim.txt /*twitvim_enable_tcl* -twitvim_login twitvim.txt /*twitvim_login* -twitvim_login_b64 twitvim.txt /*twitvim_login_b64* -twitvim_proxy twitvim.txt /*twitvim_proxy* -twitvim_proxy_login twitvim.txt /*twitvim_proxy_login* -twitvim_proxy_login_b64 twitvim.txt /*twitvim_proxy_login_b64* -twitvim_retweet_format twitvim.txt /*twitvim_retweet_format* -twitvim_trim_login twitvim.txt /*twitvim_trim_login* -twitvim_urlborg_key twitvim.txt /*twitvim_urlborg_key* -v_, zencoding.txt /*v_,* -vcde vcde.txt /*vcde* -vimwiki vimwiki.txt /*vimwiki* -vimwiki-calendar vimwiki.txt /*vimwiki-calendar* -vimwiki-changelog vimwiki.txt /*vimwiki-changelog* -vimwiki-commands vimwiki.txt /*vimwiki-commands* -vimwiki-contents vimwiki.txt /*vimwiki-contents* -vimwiki-developers vimwiki.txt /*vimwiki-developers* -vimwiki-diary vimwiki.txt /*vimwiki-diary* -vimwiki-folding vimwiki.txt /*vimwiki-folding* -vimwiki-global-commands vimwiki.txt /*vimwiki-global-commands* -vimwiki-global-mappings vimwiki.txt /*vimwiki-global-mappings* -vimwiki-help vimwiki.txt /*vimwiki-help* -vimwiki-license vimwiki.txt /*vimwiki-license* -vimwiki-local-commands vimwiki.txt /*vimwiki-local-commands* -vimwiki-local-mappings vimwiki.txt /*vimwiki-local-mappings* -vimwiki-mappings vimwiki.txt /*vimwiki-mappings* -vimwiki-multiple-wikies vimwiki.txt /*vimwiki-multiple-wikies* -vimwiki-nohtml vimwiki.txt /*vimwiki-nohtml* -vimwiki-option-auto_export vimwiki.txt /*vimwiki-option-auto_export* -vimwiki-option-css_name vimwiki.txt /*vimwiki-option-css_name* -vimwiki-option-diary_header vimwiki.txt /*vimwiki-option-diary_header* -vimwiki-option-diary_index vimwiki.txt /*vimwiki-option-diary_index* -vimwiki-option-diary_link_count vimwiki.txt /*vimwiki-option-diary_link_count* -vimwiki-option-diary_rel_path vimwiki.txt /*vimwiki-option-diary_rel_path* -vimwiki-option-ext vimwiki.txt /*vimwiki-option-ext* -vimwiki-option-html_footer vimwiki.txt /*vimwiki-option-html_footer* -vimwiki-option-html_header vimwiki.txt /*vimwiki-option-html_header* -vimwiki-option-index vimwiki.txt /*vimwiki-option-index* -vimwiki-option-maxhi vimwiki.txt /*vimwiki-option-maxhi* -vimwiki-option-nested_syntaxes vimwiki.txt /*vimwiki-option-nested_syntaxes* -vimwiki-option-path vimwiki.txt /*vimwiki-option-path* -vimwiki-option-path_html vimwiki.txt /*vimwiki-option-path_html* -vimwiki-option-syntax vimwiki.txt /*vimwiki-option-syntax* -vimwiki-options vimwiki.txt /*vimwiki-options* -vimwiki-placeholders vimwiki.txt /*vimwiki-placeholders* -vimwiki-prerequisites vimwiki.txt /*vimwiki-prerequisites* -vimwiki-syntax vimwiki.txt /*vimwiki-syntax* -vimwiki-syntax-blockquotes vimwiki.txt /*vimwiki-syntax-blockquotes* -vimwiki-syntax-comments vimwiki.txt /*vimwiki-syntax-comments* -vimwiki-syntax-headers vimwiki.txt /*vimwiki-syntax-headers* -vimwiki-syntax-links vimwiki.txt /*vimwiki-syntax-links* -vimwiki-syntax-lists vimwiki.txt /*vimwiki-syntax-lists* -vimwiki-syntax-paragraphs vimwiki.txt /*vimwiki-syntax-paragraphs* -vimwiki-syntax-preformatted vimwiki.txt /*vimwiki-syntax-preformatted* -vimwiki-syntax-tables vimwiki.txt /*vimwiki-syntax-tables* -vimwiki-syntax-typefaces vimwiki.txt /*vimwiki-syntax-typefaces* -vimwiki-table-mappings vimwiki.txt /*vimwiki-table-mappings* -vimwiki-table-of-contents vimwiki.txt /*vimwiki-table-of-contents* -vimwiki-tables vimwiki.txt /*vimwiki-tables* -vimwiki-temporary-wiki vimwiki.txt /*vimwiki-temporary-wiki* -vimwiki-text-objects vimwiki.txt /*vimwiki-text-objects* -vimwiki-title vimwiki.txt /*vimwiki-title* -vimwiki-toc vimwiki.txt /*vimwiki-toc* -vimwiki-todo-lists vimwiki.txt /*vimwiki-todo-lists* -vimwiki.txt vimwiki.txt /*vimwiki.txt* -vimwiki_- vimwiki.txt /*vimwiki_-* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_wd vimwiki.txt /*vimwiki_wd* -vimwiki_wr vimwiki.txt /*vimwiki_wr* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_= vimwiki.txt /*vimwiki_=* -vimwiki_gqq vimwiki.txt /*vimwiki_gqq* -vimwiki_gww vimwiki.txt /*vimwiki_gww* -vimwiki_i_ vimwiki.txt /*vimwiki_i_* -vimwiki_i_ vimwiki.txt /*vimwiki_i_* -vimwiki_i_ vimwiki.txt /*vimwiki_i_* -viwmiki-global-options vimwiki.txt /*viwmiki-global-options* -viwmiki-local-options vimwiki.txt /*viwmiki-local-options* -vjde vjde.txt /*vjde* -vjde-auto-comp vjde.txt /*vjde-auto-comp* -vjde-code vjde.txt /*vjde-code* -vjde-command vjde.txt /*vjde-command* -vjde-define vjde.txt /*vjde-define* -vjde-desc vjde.txt /*vjde-desc* -vjde-doc vjde.txt /*vjde-doc* -vjde-fix-ex vjde.txt /*vjde-fix-ex* -vjde-fix-im vjde.txt /*vjde-fix-im* -vjde-fix-th vjde.txt /*vjde-fix-th* -vjde-fix-tools vjde.txt /*vjde-fix-tools* -vjde-goto vjde.txt /*vjde-goto* -vjde-html vjde.txt /*vjde-html* -vjde-iabbr vjde.txt /*vjde-iabbr* -vjde-implements vjde.txt /*vjde-implements* -vjde-import-extract vjde.txt /*vjde-import-extract* -vjde-import-sort vjde.txt /*vjde-import-sort* -vjde-install vjde.txt /*vjde-install* -vjde-java vjde.txt /*vjde-java* -vjde-java-pkg vjde.txt /*vjde-java-pkg* -vjde-javadoc vjde.txt /*vjde-javadoc* -vjde-jsp vjde.txt /*vjde-jsp* -vjde-override vjde.txt /*vjde-override* -vjde-preview vjde.txt /*vjde-preview* -vjde-project vjde.txt /*vjde-project* -vjde-qa vjde.txt /*vjde-qa* -vjde-refactor vjde.txt /*vjde-refactor* -vjde-rft-arg vjde.txt /*vjde-rft-arg* -vjde-rft-const vjde.txt /*vjde-rft-const* -vjde-rft-field vjde.txt /*vjde-rft-field* -vjde-rft-local vjde.txt /*vjde-rft-local* -vjde-taglib vjde.txt /*vjde-taglib* -vjde-tasklist vjde.txt /*vjde-tasklist* -vjde-template vjde.txt /*vjde-template* -vjde-todolist vjde.txt /*vjde-todolist* -vjde-variable vjde.txt /*vjde-variable* -vjde-wizard vjde.txt /*vjde-wizard* -vjde-xdoclet vjde.txt /*vjde-xdoclet* -vjde-xml vjde.txt /*vjde-xml* -vjde-xmldata vjde.txt /*vjde-xmldata* -vjde.txt vjde.txt /*vjde.txt* -vjde_auto_mark vjde.txt /*vjde_auto_mark* -vjde_autoload_stl vjde.txt /*vjde_autoload_stl* -vjde_autoload_taglib vjde.txt /*vjde_autoload_taglib* -vjde_cfu_java_dot vjde.txt /*vjde_cfu_java_dot* -vjde_cfu_java_para vjde.txt /*vjde_cfu_java_para* -vjde_doc_gui_height vjde.txt /*vjde_doc_gui_height* -vjde_doc_gui_width vjde.txt /*vjde_doc_gui_width* -vjde_javadoc_path vjde.txt /*vjde_javadoc_path* -vjde_lib_path vjde.txt /*vjde_lib_path* -vjde_out_path vjde.txt /*vjde_out_path* -vjde_show_paras vjde.txt /*vjde_show_paras* -vjde_show_preview vjde.txt /*vjde_show_preview* -vjde_src_path vjde.txt /*vjde_src_path* -vjde_use_window vjde.txt /*vjde_use_window* -vjde_web_app vjde.txt /*vjde_web_app* -vjde_xml_advance vjde.txt /*vjde_xml_advance* -wiki potwiki.txt /*wiki* -zencoding zencoding.txt /*zencoding* -zencoding-balance-tag-inward zencoding.txt /*zencoding-balance-tag-inward* -zencoding-balance-tag-outward zencoding.txt /*zencoding-balance-tag-outward* -zencoding-complete-tag zencoding.txt /*zencoding-complete-tag* -zencoding-contents zencoding.txt /*zencoding-contents* -zencoding-customize zencoding.txt /*zencoding-customize* -zencoding-customize-keymappings zencoding.txt /*zencoding-customize-keymappings* -zencoding-define-tags-behavior zencoding.txt /*zencoding-define-tags-behavior* -zencoding-expandabbr zencoding.txt /*zencoding-expandabbr* -zencoding-goto-next-point zencoding.txt /*zencoding-goto-next-point* -zencoding-goto-previous-point zencoding.txt /*zencoding-goto-previous-point* -zencoding-indent-size zencoding.txt /*zencoding-indent-size* -zencoding-install zencoding.txt /*zencoding-install* -zencoding-introduction zencoding.txt /*zencoding-introduction* -zencoding-make-anchor-url zencoding.txt /*zencoding-make-anchor-url* -zencoding-merge-lines zencoding.txt /*zencoding-merge-lines* -zencoding-quoted-text-url zencoding.txt /*zencoding-quoted-text-url* -zencoding-remove-tag zencoding.txt /*zencoding-remove-tag* -zencoding-split-join-tag zencoding.txt /*zencoding-split-join-tag* -zencoding-todo zencoding.txt /*zencoding-todo* -zencoding-toggle-comment zencoding.txt /*zencoding-toggle-comment* -zencoding-tutorial zencoding.txt /*zencoding-tutorial* -zencoding-update-image-size zencoding.txt /*zencoding-update-image-size* -zencoding-wrap-wtih-abbreviation zencoding.txt /*zencoding-wrap-wtih-abbreviation* -zencoding.txt zencoding.txt /*zencoding.txt* diff --git a/dot.vim/doc/textile.txt b/dot.vim/doc/textile.txt deleted file mode 100644 index ec3b6ab..0000000 --- a/dot.vim/doc/textile.txt +++ /dev/null @@ -1,52 +0,0 @@ -*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://whytheluckystiff.net/ruby/redcloth/ - -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* - -h2. Commands - -:TextilePreview - Render the current buffer to a temp file, and open it in - your web browser (OSX only) - - rp - -:TextileRenderTab - ... to a new tab - - rt - -:TextileRenderFile - ... to a file - - rf - - is \ by default, so rp == \rp - -============================================================================== -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/dot.vim/doc/twitvim.txt b/dot.vim/doc/twitvim.txt deleted file mode 100644 index 21722d3..0000000 --- a/dot.vim/doc/twitvim.txt +++ /dev/null @@ -1,1312 +0,0 @@ -*twitvim.txt* Twitter client for Vim - - --------------------------------- - TwitVim: A Twitter client for Vim - --------------------------------- - -Author: Po Shan Cheah - http://twitter.com/mortonfox - -License: The Vim License applies to twitvim.vim and twitvim.txt (see - |copyright|) except use "TwitVim" instead of "Vim". No warranty, - express or implied. Use at your own risk. - - -============================================================================== -1. Contents *TwitVim* *TwitVim-contents* - - 1. Contents...............................: |TwitVim-contents| - 2. Introduction...........................: |TwitVim-intro| - 3. Installation...........................: |TwitVim-install| - cURL...................................: |TwitVim-cURL| - twitvim.vim............................: |TwitVim-add| - twitvim_login..........................: |twitvim_login| - twitvim_proxy..........................: |twitvim_proxy| - twitvim_proxy_login....................: |twitvim_proxy_login| - twitvim_api_root.......................: |twitvim_api_root| - twitvim-identi.ca......................: |twitvim-identi.ca| - 3.1. Base64-Encoded Login.................: |TwitVim-login-base64| - twitvim_login_b64....................: |twitvim_login_b64| - twitvim_proxy_login_b64..............: |twitvim_proxy_login_b64| - 3.2. Alternatives to cURL.................: |TwitVim-non-cURL| - twitvim_enable_perl..................: |twitvim_enable_perl| - twitvim_enable_python................: |twitvim_enable_python| - twitvim_enable_ruby..................: |twitvim_enable_ruby| - twitvim_enable_tcl...................: |twitvim_enable_tcl| - 3.3. Using Twitter SSL API................: |TwitVim-ssl| - Twitter SSL via cURL.................: |TwitVim-ssl-curl| - twitvim_cert_insecure................: |twitvim_cert_insecure| - Twitter SSL via Perl interface.......: |TwitVim-ssl-perl| - Twitter SSL via Ruby interface.......: |TwitVim-ssl-ruby| - Twitter SSL via Python interface.....: |TwitVim-ssl-python| - 4. Manual.................................: |TwitVim-manual| - 4.1. Update Commands......................: |TwitVim-update-commands| - :PosttoTwitter.......................: |:PosttoTwitter| - :CPosttoTwitter......................: |:CPosttoTwitter| - :BPosttoTwitter......................: |:BPosttoTwitter| - :SendDMTwitter.......................: |:SendDMTwitter| - 4.2. Timeline Commands....................: |TwitVim-timeline-commands| - :UserTwitter.........................: |:UserTwitter| - twitvim_count........................: |twitvim_count| - :FriendsTwitter......................: |:FriendsTwitter| - :RepliesTwitter......................: |:RepliesTwitter| - :PublicTwitter.......................: |:PublicTwitter| - :DMTwitter...........................: |:DMTwitter| - :DMSentTwitter.......................: |:DMSentTwitter| - :BackTwitter.........................: |:BackTwitter| - :ForwardTwitter......................: |:ForwardTwitter| - :RefreshTwitter......................: |:RefreshTwitter| - :NextTwitter.........................: |:NextTwitter| - :PreviousTwitter.....................: |:PreviousTwitter| - 4.3. Mappings.............................: |TwitVim-mappings| - Alt-T................................: |TwitVim-A-t| - Ctrl-T...............................: |TwitVim-C-t| - Reply Feature........................: |TwitVim-reply| - Alt-R................................: |TwitVim-A-r| - r............................: |TwitVim-Leader-r| - Retweet Feature......................: |TwitVim-retweet| - R............................: |TwitVim-Leader-S-r| - twitvim_retweet_format...............: |twitvim_retweet_format| - Direct Message Feature...............: |TwitVim-direct-message| - Alt-D................................: |TwitVim-A-d| - d............................: |TwitVim-Leader-d| - Goto Feature.........................: |TwitVim-goto| - Alt-G................................: |TwitVim-A-g| - g............................: |TwitVim-Leader-g| - twitvim_browser_cmd..................: |twitvim_browser_cmd| - LongURL Feature......................: |TwitVim-LongURL| - e............................: |TwitVim-Leader-e| - User Profiles........................: |TwitVim-profile| - p............................: |TwitVim-Leader-p| - In-reply-to..........................: |TwitVim-inreplyto| - @............................: |TwitVim-Leader-@| - Delete...............................: |TwitVim-delete| - X............................: |TwitVim-Leader-X| - Ctrl-O...............................: |TwitVim-C-o| - Ctrl-I...............................: |TwitVim-C-i| - Refresh..............................: |TwitVim-refresh| - .....................: |TwitVim-Leader-Leader| - Next page............................: |TwitVim-next| - Ctrl-PageDown........................: |TwitVim-C-PageDown| - Previous page........................: |TwitVim-previous| - Ctrl-PageUp..........................: |TwitVim-C-PageUp| - 4.4. Utility Commands.....................: |TwitVim-utility| - :Tweetburner.........................: |:Tweetburner| - :ATweetburner........................: |:ATweetburner| - :PTweetburner........................: |:PTweetburner| - :Snipurl.............................: |:Snipurl| - :ASnipurl............................: |:ASnipurl| - :PSnipurl............................: |:PSnipurl| - :Metamark............................: |:Metamark| - :AMetamark...........................: |:AMetamark| - :PMetamark...........................: |:PMetamark| - :TinyURL.............................: |:TinyURL| - :ATinyURL............................: |:ATinyURL| - :PTinyURL............................: |:PTinyURL| - :BitLy...............................: |:BitLy| - :ABitLy..............................: |:ABitLy| - :PBitLy..............................: |:PBitLy| - :IsGd................................: |:IsGd| - :AIsGd...............................: |:AIsGd| - :PIsGd...............................: |:PIsGd| - :UrlBorg.............................: |:UrlBorg| - twitvim_urlborg_key..................: |twitvim_urlborg_key| - :AUrlBorg............................: |:AUrlBorg| - :PUrlBorg............................: |:PUrlBorg| - :Trim................................: |:Trim| - twitvim_trim_login...................: |twitvim_trim_login| - :ATrim...............................: |:ATrim| - :PTrim...............................: |:PTrim| - :Cligs...............................: |:Cligs| - twitvim_cligs_key....................: |twitvim_cligs_key| - :ACligs..............................: |:ACligs| - :PCligs..............................: |:PCligs| - :SearchTwitter.......................: |:SearchTwitter| - :RateLimitTwitter....................: |:RateLimitTwitter| - :ProfileTwitter......................: |:ProfileTwitter| - :LocationTwitter.....................: |:LocationTwitter| - 5. Timeline Highlighting..................: |TwitVim-highlight| - twitterUser............................: |hl-twitterUser| - twitterTime............................: |hl-twitterTime| - twitterTitle...........................: |hl-twitterTitle| - twitterLink............................: |hl-twitterLink| - twitterReply...........................: |hl-twitterReply| - 6. Tips and Tricks........................: |TwitVim-tips| - 6.1. Timeline Hotkeys.....................: |TwitVim-hotkeys| - 6.2. Switching between services...........: |TwitVim-switch| - 6.3. Line length in status line...........: |TwitVim-line-length| - 7. History................................: |TwitVim-history| - 8. Credits................................: |TwitVim-credits| - - -============================================================================== -2. Introduction *TwitVim-intro* - - TwitVim is a plugin that allows you to post to Twitter, a - microblogging service at http://www.twitter.com. - - Since version 0.2.19, TwitVim also supports other microblogging - services, such as identi.ca, that offer Twitter-compatible APIs. See - |twitvim_api_root| for information on configuring TwitVim for those - services. - - -============================================================================== -3. Installation *TwitVim-install* - - 1. Install cURL. *TwitVim-cURL* - - If you don't already have cURL on your system, download it from - http://curl.haxx.se/. Make sure that the curl executable is in a - directory listed in your PATH environment variable, or the equivalent - for your system. - - If you have the Perl, Python, Ruby, or Tcl interfaces, you may use one - of those instead of installing cURL. See |TwitVim-non-cURL| for - setup details. - - - 2. twitvim.vim *TwitVim-add* - - Add twitvim.vim to your plugins directory. The location depends on - your operating system. See |add-global-plugin| for details. - - If you installed from the Vimball (.vba) file, twitvim.vim should - already be in its correct place. - - - 3. twitvim_login *twitvim_login* - - Add the following to your vimrc: - - let twitvim_login = "USER:PASS" - - Replace USER with your Twitter user name and PASS with your Twitter - password. - - It is possible to avoid having your Twitter password in plaintext in - your vimrc. See |TwitVim-login-base64| for details. - - - 4. twitvim_proxy *twitvim_proxy* - - This step is only needed if you access the web through a HTTP proxy. - If you use a HTTP proxy, add the following to your vimrc: - - let twitvim_proxy = "proxyserver:proxyport" - - Replace proxyserver with the address of the HTTP proxy and proxyport - with the port number of the HTTP proxy. - - - 5. twitvim_proxy_login *twitvim_proxy_login* - - If the HTTP proxy requires authentication, add the following to your - vimrc: - - let twitvim_proxy_login = "proxyuser:proxypassword" - - Where proxyuser is your proxy user and proxypassword is your proxy - password. - - It is possible to avoid having your proxy password in plaintext in - your vimrc. See |TwitVim-login-base64| for details. - - - 6. twitvim_api_root *twitvim_api_root* - - This setting allows you to configure TwitVim to communicate with - servers other than twitter.com that implement a Twitter-compatible - API. - - *twitvim-identi.ca* - For instance, to use identi.ca instead of Twitter, add this to your - vimrc: - - let twitvim_api_root = "http://identi.ca/api" - - A server implementing a Twitter-compatible API may not support all of - Twitter's features, so some TwitVim commands may not work. - - ------------------------------------------------------------------------------- -3.1. Base64-Encoded Login *TwitVim-login-base64* - - For safety purposes, TwitVim allows you to specify your Twitter login - and proxy login information preencoded in base64. This is not truly - secure as it is not encryption but it can stop casual onlookers - from reading off your password when you edit your vimrc. - - *twitvim_login_b64* - To do that, set the following in your vimrc: - - let twitvim_login_b64 = "base64string" - - *twitvim_proxy_login_b64* - If your HTTP proxy needs authentication, set the following: - - let twitvim_proxy_login_b64 = "base64string" - - - Where base64string is your username:password encoded in base64. - - - An example: - - Let's say Joe User has a Twitter login of "joeuser" and a password of - "joepassword". His first step is to encode "joeuser:joepassword" in - Base64. He can either use a standalone utility to do that or, in a - pinch, he can do the encoding at websites such as the following: - http://makcoder.sourceforge.net/demo/base64.php - http://www.opinionatedgeek.com/dotnet/tools/Base64Encode/ - - The result is: am9ldXNlcjpqb2VwYXNzd29yZA== - - Then he adds the following to his vimrc: - - let twitvim_login_b64 = "am9ldXNlcjpqb2VwYXNzd29yZA==" - - And his setup is ready. - - ------------------------------------------------------------------------------- -3.2. Alternatives to cURL *TwitVim-non-cURL* - - TwitVim supports http networking through Vim's Perl, Python, Ruby, and - Tcl interfaces, so if you have any of those interfaces compiled into - your Vim program, you can use that instead of cURL. - - Generally, it is slightly faster to use one of those scripting - interfaces for networking because it avoids running an external - program. On Windows, it also avoids a brief taskbar flash when cURL - runs. - - To find out if you have those interfaces, use the |:version| command - and check the |+feature-list|. Then to enable this special http - networking code in TwitVim, add one of the following lines to your - vimrc: - - let twitvim_enable_perl = 1 - let twitvim_enable_python = 1 - let twitvim_enable_ruby = 1 - let twitvim_enable_tcl = 1 - - You can enable more than one scripting language but TwitVim will only - use the first one it finds. - - - 1. Perl interface *twitvim_enable_perl* - - To enable TwitVim's Perl networking code, add the following to your - vimrc: - - let twitvim_enable_perl = 1 - - TwitVim requires the MIME::Base64 and LWP::UserAgent modules. If you - have ActivePerl, these modules are included in the default - installation. - - - 2. Python interface *twitvim_enable_python* - - To enable TwitVim's Python networking code, add the following to your - vimrc: - - let twitvim_enable_python = 1 - - TwitVim requires the urllib, urllib2, and base64 modules. These - modules are in the Python standard library. - - - 3. Ruby interface *twitvim_enable_ruby* - - To enable TwitVim's Ruby networking code, add the following to your - vimrc: - - let twitvim_enable_ruby = 1 - - TwitVim requires the net/http, uri, and Base64 modules. These modules - are in the Ruby standard library. - - In addition, TwitVim requires a Vim patch to fix an if_ruby networking - problem. See the following message: - - http://www.mail-archive.com/vim_dev@googlegroups.com/msg03693.html - - and also Bram's correction to the patch: - - http://www.mail-archive.com/vim_dev@googlegroups.com/msg03713.html - - - 3. Tcl interface *twitvim_enable_tcl* - - To enable TwitVim's Tcl networking code, add the following to your - vimrc: - - let twitvim_enable_tcl = 1 - - TwitVim requires the http, uri, and base64 modules. uri and base64 are - in the Tcllib library so you may need to install that. See - http://tcllib.sourceforge.net/ - - If you have ActiveTcl 8.5, the default installation does not include - Tcllib. Run the following command from the shell to add Tcllib: - - teacup install tcllib - - ------------------------------------------------------------------------------- -3.3. Using Twitter SSL API *TwitVim-ssl* - - For added security, TwitVim can use the Twitter SSL API instead of the - regular Twitter API. You configure this by setting |twitvim_api_root| - to the https version of the URL: - - let twitvim_api_root = "https://twitter.com" - - For identi.ca: - - let twitvim_api_root = "https://identi.ca/api" - - There are certain pre-requisites, as explained below. - - - 1. Twitter SSL via cURL *TwitVim-ssl-curl* - - To use SSL via cURL, you need to install the SSL libraries and an - SSL-enabled build of cURL. - - *twitvim_cert_insecure* - Even after you've done that, cURL may complain about certificates that - failed verification. If you need to override certificate checking, set - twitvim_cert_insecure: - - let twitvim_cert_insecure = 1 - - - 2. Twitter SSL via Perl interface *TwitVim-ssl-perl* - - To use SSL via the TwitVim Perl interface (See |twitvim_enable_perl|), - you need to install the SSL libraries and the Crypt::SSLeay Perl - module. - - If you are using Twitter SSL over a proxy, do not set twitvim_proxy - and twitvim_proxy_login. Crypt::SSLeay gets proxy information from - the environment, so do this instead: - - let $HTTPS_PROXY="http://proxyserver:proxyport" - let $HTTPS_PROXY_USERNAME="user" - let $HTTPS_PROXY_PASSWORD="password" - - Alternatively, you can set those environment variables before starting - Vim. - - - 3. Twitter SSL via Ruby interface *TwitVim-ssl-ruby* - - To use SSL via Ruby, you need to install the SSL libraries and an - SSL-enabled build of Ruby. - - If Ruby produces the error "`write': Bad file descriptor" in http.rb, - then you need to check your certificates or override certificate - checking. See |twitvim_cert_insecure|. - - Set twitvim_proxy and twitvim_proxy_login as usual if using Twitter - SSL over a proxy. - - - 4. Twitter SSL via Python interface *TwitVim-ssl-python* - - To use SSL via Python, you need to install the SSL libraries and an - SSL-enabled build of Python. - - The Python interface does not yet support Twitter SSL over a proxy. - This is due to a missing feature in urllib2. - - - 5. Twitter SSL via TCL interface - - I do not know how to make this work with Twitter SSL yet. If you - succeed, let me know what you did. - - -============================================================================== -4. TwitVim Manual *TwitVim-manual* - ------------------------------------------------------------------------------- -4.1. Update Commands *TwitVim-update-commands* - - These commands post an update to your Twitter account. If the friends, - user, or public timeline is visible, TwitVim will insert the update - into the timeline view after posting it. - - :PosttoTwitter *:PosttoTwitter* - - This command will prompt you for a message and post it to Twitter. - - :CPosttoTwitter *:CPosttoTwitter* - - This command posts the current line in the current buffer to Twitter. - - :BPosttoTwitter *:BPosttoTwitter* - - This command posts the contents of the current buffer to Twitter. - - :SendDMTwitter {username} *:SendDMTwitter* - - This command will prompt you for a direct message to send to user - {username}. - ------------------------------------------------------------------------------- -4.2. Timeline Commands *TwitVim-timeline-commands* - - These commands retrieve a Twitter timeline and display it in a special - Twitter buffer. TwitVim applies syntax highlighting to highlight - certain elements in the timeline view. See |TwitVim-highlight| for a - list of highlighting groups it uses. - - - :[count]UserTwitter *:UserTwitter* - :[count]UserTwitter {username} - - This command displays your Twitter timeline. - - If you specify a {username}, this command displays the timeline for - that user. - - If you specify [count], that number is used as the page number. For - example, :2UserTwitter displays the second page from your user - timeline. - - *twitvim_count* - You can configure the number of tweets returned by :UserTwitter by - setting twitvim_count. For example, - - let twitvim_count = 50 - - will make :UserTwitter return 50 tweets instead of the default of 20. - You can set twitvim_count to any integer from 1 to 200. - - - :[count]FriendsTwitter *:FriendsTwitter* - :[count]FriendsTwitter {username} - - This command displays your Twitter timeline with updates from friends - merged in. - - If you specify a {username}, this command displays the friends - timeline for that user. Note: Twitter has disabled this API feature. - - If you specify [count], that number is used as the page number. For - example, :2FriendsTwitter displays the second page from your friends - timeline. - - You can configure the number of tweets returned by :FriendsTwitter by - setting |twitvim_count|. - - - :[count]RepliesTwitter *:RepliesTwitter* - - This command displays a timeline of @-replies that you've received - from other Twitter users. - - If you specify [count], that number is used as the page number. For - example, :2RepliesTwitter displays the second page from your replies - timeline. - - - :PublicTwitter *:PublicTwitter* - - This command displays the public timeline. - - - :[count]DMTwitter *:DMTwitter* - - This command displays direct messages that you've received. - - If you specify [count], that number is used as the page number. For - example, :2DMTwitter displays the second page from your direct - messages timeline. - - - :[count]DMSentTwitter *:DMSentTwitter* - - This command displays direct messages that you've sent. - - If you specify [count], that number is used as the page number. For - example, :2DMSentTwitter displays the second page from your direct - messages sent timeline. - - - :BackTwitter *:BackTwitter* - - This command takes you back to the previous timeline in the timeline - stack. TwitVim saves a limited number of timelines. This command - will display a warning if you attempt to go beyond the oldest saved - timeline. - - - :ForwardTwitter *:ForwardTwitter* - - This command takes you to the next timeline in the timeline stack. - It will display a warning if you attempt to go past the newest saved - timeline so this command can only be used after :BackTwitter. - - - :RefreshTwitter *:RefreshTwitter* - - This command refreshes the timeline. - - - :NextTwitter *:NextTwitter* - - This command loads the next (older) page in the timeline. - - - :PreviousTwitter *:PreviousTwitter* - - This command loads the previous (newer) page in the timeline. If the - timeline is on the first page, it issues a warning and doesn't do - anything. - - ------------------------------------------------------------------------------- -4.3. Mappings *TwitVim-mappings* - - Alt-T *TwitVim-A-t* - Ctrl-T *TwitVim-C-t* - - In visual mode, Alt-T posts the highlighted text to Twitter. - - Ctrl-T is an alternative to the Alt-T mapping. If the menu bar is - enabled, Alt-T pulls down the Tools menu. So use Ctrl-T instead. - - - *TwitVim-reply* - Alt-R *TwitVim-A-r* - r *TwitVim-Leader-r* - - This mapping is local to the timeline buffer. In the timeline buffer, - it starts composing an @-reply on the command line to the author of - the tweet on the current line. - - Under Cygwin, Alt-R is not recognized so you can use r as an - alternative. The character defaults to \ (backslash) but see - |mapleader| for information on customizing that. - - - *TwitVim-retweet* - R *TwitVim-Leader-S-r* - - This mapping (Note: uppercase 'R' instead of 'r'.) is local to the - timeline buffer. It is similar to the retweet feature in popular - Twitter clients. In the timeline buffer, it sends the current line to - the command line so that you can repost this line as a new tweet. - - *twitvim_retweet_format* - By default, TwitVim retweets tweets in the following format: - - Retweeting @user: text of the tweet - - You can customize the retweet format by adding the following to your - vimrc, for example: - - let twitvim_retweet_format = 'Retweet from %s: %t' - - or: - - let twitvim_retweet_format = '%t (retweeted from %s)' - - When you retweet a tweet, TwitVim will replace "%s" in - twitvim_retweet_format with the user name of the original poster and - "%t" with the text of the tweet. - - The default setting of twitvim_retweet_format is "Retweeting %s: %t" - - - *TwitVim-direct-message* - Alt-D *TwitVim-A-d* - d *TwitVim-Leader-d* - - This mapping is local to the timeline buffer. In the timeline buffer, - it starts composing a direct message on the command line to the author - of the tweet on the current line. - - Under Cygwin, Alt-D is not recognized so you can use d as an - alternative. The character defaults to \ (backslash) but see - |mapleader| for information on customizing that. - - - *TwitVim-goto* - Alt-G *TwitVim-A-g* - g *TwitVim-Leader-g* - - This mapping is local to the timeline and user profile buffers. It - launches the web browser with the URL at the cursor position. If you - visually select text before invoking this mapping, it launches the web - browser with the selected text as is. - - As a special case, if the cursor is on a word of the form @user or - user:, TwitVim will display that user's timeline in the timeline - buffer. This will not launch the web browser. - - In addition, if the cursor is on a word of the form #hashtag, TwitVim - will do a Twitter Search for that #hashtag. This too will not launch - the web browser. - - *twitvim_browser_cmd* - Before using this command, you need to tell TwitVim how to launch your - browser. For example, you can add the following to your vimrc: - - let twitvim_browser_cmd = 'firefox.exe' - - Of course, replace firefox.exe with the browser of your choice. - - - *TwitVim-LongURL* - e *TwitVim-Leader-e* - - This mapping is local to the timeline and user profile buffers. It - calls the LongURL API (see http://longurl.org/) to expand the short - URL at the cursor position. A short URL is a URL from a URL shortening - service such as TinyURL, SnipURL, etc. Use this feature if you wish to - preview a URL before browsing to it with |TwitVim-goto|. - - If you visually select text before invoking this mapping, it calls the - LongURL API with the selected text as is. - - If successful, TwitVim will display the result from LongURL in the - message area. - - - *TwitVim-profile* - p *TwitVim-Leader-p* - - This mapping is local to the timeline and user profile buffers. It - calls the Twitter API to retrieve user profile information (e.g. name, - location, bio, update count) for the user name at the cursor position. - It displays the information in a user profile buffer. - - If you visually select text before invoking this mapping, it uses the - selected text as is for the user name. - - See also |:ProfileTwitter|. - - - *TwitVim-inreplyto* - @ *TwitVim-Leader-@* - - This mapping is local to the timeline buffer. If the current line is - an @-reply tweet, it calls the Twitter API to retrieve the tweet to - which this one is replying. Then it will display that predecessor - tweet below the current one. - - If there is no in-reply-to information, it will show a warning and do - nothing. - - This mapping is useful in the replies timeline. See |:RepliesTwitter|. - - - *TwitVim-delete* - X *TwitVim-Leader-X* - - This mapping is local to the timeline buffer. The 'X' in the mapping - is uppercase. It calls the Twitter API to delete the tweet or message - on the current line. - - Note: You have to be the author of the tweet in order to delete it. - You can delete direct messages that you sent or received. - - - Ctrl-O *TwitVim-C-o* - - This mapping takes you to the previous timeline in the timeline stack. - See |:BackTwitter|. - - Ctrl-I *TwitVim-C-i* - - This mapping takes you to the next timeline in the timeline stack. - See |:ForwardTwitter|. - - - *TwitVim-refresh* - *TwitVim-Leader-Leader* - - This mapping refreshes the timeline. See |:RefreshTwitter|. - - - *TwitVim-next* - Ctrl-PageDown *TwitVim-C-PageDown* - - This mapping loads the next (older) page in the timeline. - See |:NextTwitter|. - - - *TwitVim-previous* - Ctrl-PageUp *TwitVim-C-PageUp* - - This command loads the previous (newer) page in the timeline. If the - timeline is on the first page, it issues a warning and doesn't do - anything. See |:PreviousTwitter|. - - ------------------------------------------------------------------------------- -4.4. Utility Commands *TwitVim-utility* - - :Tweetburner *:Tweetburner* - :Tweetburner {url} - - Tweetburner is a URL forwarding and shortening service. See - http://tweetburner.com/ - - This command calls the Tweetburner API to get a short URL in place of - . If {url} is not provided on the command line, the command will - prompt you to enter a URL. The short URL is then inserted into the - current buffer at the current position. - - :ATweetburner *:ATweetburner* - :ATweetburner {url} - - Same as :Tweetburner but appends, i.e. inserts after the current - position instead of at the current position, the short URL instead. - - :PTweetburner *:PTweetburner* - :PTweetburner {url} - - Same as :Tweetburner but prompts for a tweet on the command line with - the short URL already inserted. - - - :Snipurl *:Snipurl* - :Snipurl {url} - - SnipURL is a URL forwarding and shortening service. See - http://www.snipurl.com/ - - This command calls the SnipURL API to get a short URL in place of - . If {url} is not provided on the command line, the command will - prompt you to enter a URL. The short URL is then inserted into the - current buffer at the current position. - - :ASnipurl *:ASnipurl* - :ASnipurl {url} - - Same as :Snipurl but appends, i.e. inserts after the current - position instead of at the current position, the short URL instead. - - :PSnipurl *:PSnipurl* - :PSnipurl {url} - - Same as :Snipurl but prompts for a tweet on the command line with - the short URL already inserted. - - - :Metamark *:Metamark* - :Metamark {url} - - Metamark is a URL forwarding and shortening service. See - http://metamark.net/ - - This command calls the Metamark API to get a short URL in place of - . If {url} is not provided on the command line, the command will - prompt you to enter a URL. The short URL is then inserted into the - current buffer at the current position. - - :AMetamark *:AMetamark* - :AMetamark {url} - - Same as :Metamark but appends, i.e. inserts after the current - position instead of at the current position, the short URL instead. - - :PMetamark *:PMetamark* - :PMetamark {url} - - Same as :Metamark but prompts for a tweet on the command line with - the short URL already inserted. - - - :TinyURL *:TinyURL* - :TinyURL {url} - - TinyURL is a URL forwarding and shortening service. See - http://tinyurl.com - - This command calls the TinyURL API to get a short URL in place of - . If {url} is not provided on the command line, the command will - prompt you to enter a URL. The short URL is then inserted into the - current buffer at the current position. - - :ATinyURL *:ATinyURL* - :ATinyURL {url} - - Same as :TinyURL but appends, i.e. inserts after the current - position instead of at the current position, the short URL instead. - - :PTinyURL *:PTinyURL* - :PTinyURL {url} - - Same as :TinyURL but prompts for a tweet on the command line with - the short URL already inserted. - - - :BitLy *:BitLy* - :BitLy {url} - - bit.ly is a URL forwarding and shortening service. See - http://bit.ly/go - - This command calls the bit.ly API to get a short URL in place of - . If {url} is not provided on the command line, the command will - prompt you to enter a URL. The short URL is then inserted into the - current buffer at the current position. - - :ABitLy *:ABitLy* - :ABitLy {url} - - Same as :BitLy but appends, i.e. inserts after the current - position instead of at the current position, the short URL instead. - - :PBitLy *:PBitLy* - :PBitLy {url} - - Same as :BitLy but prompts for a tweet on the command line with - the short URL already inserted. - - - :IsGd *:IsGd* - :IsGd {url} - - is.gd is a URL forwarding and shortening service. See - http://is.gd - - This command calls the is.gd API to get a short URL in place of . - If {url} is not provided on the command line, the command will prompt - you to enter a URL. The short URL is then inserted into the current - buffer at the current position. - - :AIsGd *:AIsGd* - :AIsGd {url} - - Same as :IsGd but appends, i.e. inserts after the current position - instead of at the current position, the short URL instead. - - :PIsGd *:PIsGd* - :PIsGd {url} - - Same as :IsGd but prompts for a tweet on the command line with the - short URL already inserted. - - - :UrlBorg *:UrlBorg* - :UrlBorg {url} - - urlBorg is a URL forwarding and shortening service. See - http://urlborg.com - - This command calls the urlBorg API to get a short URL in place of - . If {url} is not provided on the command line, the command will - prompt you to enter a URL. The short URL is then inserted into the - current buffer at the current position. - - The urlBorg API requires an API key. A default API key is provided - with TwitVim and no configuration is required. However, if you wish to - supply your own key in order to track your urlBorg history and stats, - visit http://urlborg.com/a/account/ to retrieve your API key and then - add the following to your vimrc: - - *twitvim_urlborg_key* - let twitvim_urlborg_key = "12345-6789" - - Replace 12345-6789 with your API key. - - :AUrlBorg *:AUrlBorg* - :AUrlBorg {url} - - Same as :UrlBorg but appends, i.e. inserts after the current position - instead of at the current position, the short URL instead. - - :PUrlBorg *:PUrlBorg* - :PUrlBorg {url} - - Same as :UrlBorg but prompts for a tweet on the command line with the - short URL already inserted. - - - :Trim *:Trim* - :Trim {url} - - tr.im is a URL forwarding and shortening service. See http://tr.im/ - - This command calls the tr.im API to get a short URL in place of - . If {url} is not provided on the command line, the command will - prompt you to enter a URL. The short URL is then inserted into the - current buffer at the current position. - - If you login to the tr.im API, tr.im will keep track - of URLs that you have shortened. In order to do that, add the - following to your vimrc: - - *twitvim_trim_login* - let twitvim_trim_login = "trimuser:trimpassword" - - Where trimuser and trimpassword are your tr.im account user name and - password. - - You may also specify trimuser:trimpassword as a base64 encoded string: - - let twitvim_trim_login = "base64string" - - See |TwitVim-login-base64| for information on generating base64 - strings. - - :ATrim *:ATrim* - :ATrim {url} - - Same as :Trim but appends, i.e. inserts after the current position - instead of at the current position, the short URL instead. - - :PTrim *:PTrim* - :PTrim {url} - - Same as :Trim but prompts for a tweet on the command line with the - short URL already inserted. - - - :Cligs *:Cligs* - :Cligs {url} - - Cligs is a URL forwarding and shortening service. See http://cli.gs/ - - This command calls the Cligs API to get a short URL in place of - . If {url} is not provided on the command line, the command will - prompt you to enter a URL. The short URL is then inserted into the - current buffer at the current position. - - If you supply a Cligs API key, Cligs will keep track of URLs that you - have shortened. In order to do that, add the following to your vimrc: - - *twitvim_cligs_key* - let twitvim_cligs_key = "hexstring" - - where hexstring is the API key. You can get an API key by registering - for a user account at Cligs and then visiting http://cli.gs/user/api - - :ACligs *:ACligs* - :ACligs {url} - - Same as :Cligs but appends, i.e. inserts after the current position - instead of at the current position, the short URL instead. - - :PCligs *:PCligs* - :PCligs {url} - - Same as :Cligs but prompts for a tweet on the command line with the - short URL already inserted. - - - :[count]SearchTwitter *:SearchTwitter* - :[count]SearchTwitter {query} - - This command calls the Twitter Search API to search for {query}. If - {query} is not provided on the command line, the command will prompt - you for it. Search results are then displayed in the timeline buffer. - - All of the Twitter Search operators are supported implicitly. See - http://search.twitter.com/operators for a list of search operators. - - If you specify [count], that number is used as the page number. For - example, :2SearchTwitter hello displays the second page of search - results for the word hello. - - You can configure the number of tweets returned by :SearchTwitter by - setting |twitvim_count|. - - - :RateLimitTwitter *:RateLimitTwitter* - - This command calls the Twitter API to retrieve rate limit information. - It shows the current hourly limit, how many API calls you have - remaining, and when your quota will be reset. You can use it to check - if you have been temporarily locked out of Twitter for hitting the - rate limit. This command does not work on identi.ca. - - - :ProfileTwitter {username} *:ProfileTwitter* - - This command calls the Twitter API to retrieve user profile - information (e.g. name, location, bio, update count) for the specified - user. It displays the information in a user profile buffer. - - See also |TwitVim-Leader-p|. - - - :LocationTwitter {location} *:LocationTwitter* - - This command calls the Twitter API to set the location field in your - profile. There is no mandatory format for the location. It could be a - zip code, a town, coordinates, or pretty much anything. - - For example: - :LocationTwitter 10027 - :LocationTwitter New York, NY, USA - :LocationTwitter 40.811583, -73.954486 - - -============================================================================== -5. Timeline Highlighting *TwitVim-highlight* - - TwitVim uses a number of highlighting groups to highlight certain - elements in the Twitter timeline views. See |:highlight| for details - on how to customize these highlighting groups. - - twitterUser *hl-twitterUser* - - The Twitter user name at the beginning of each line. - - twitterTime *hl-twitterTime* - - The time a Twitter update was posted. - - twitterTitle *hl-twitterTitle* - - The header at the top of the timeline view. - - twitterLink *hl-twitterLink* - - Link URLs and #hashtags in a Twitter status. - - twitterReply *hl-twitterReply* - - @-reply in a Twitter status. - - -============================================================================== -6. Tips and Tricks *TwitVim-tips* - - Here are a few tips for using TwitVim more efficiently. - - ------------------------------------------------------------------------------- -6.1. Timeline Hotkeys *TwitVim-hotkeys* - - TwitVim does not autorefresh. However, you can make refreshing your - timeline easier by mapping keys to the timeline commands. For example, - I use the key for that: - - nnoremap :FriendsTwitter - nnoremap :UserTwitter - nnoremap :RepliesTwitter - nnoremap :DMTwitter - - ------------------------------------------------------------------------------- -6.2. Switching between services *TwitVim-switch* - - I have user accounts on both Twitter and identi.ca. Here is what I - added to my vimrc to make it easy to switch between the two services - within the same TwitVim session: - - function! Switch_to_twitter() - let g:twitvim_api_root = "http://twitter.com" - - let g:twitvim_login_b64 = "Twitter Base64 login" - - FriendsTwitter - endfunction - - function! Switch_to_identica() - let g:twitvim_api_root = "http://identi.ca/api" - - let g:twitvim_login_b64 = "identi.ca Base64 login" - - FriendsTwitter - endfunction - - command! ToTwitter :call Switch_to_twitter() - command! ToIdentica :call Switch_to_identica() - - With that in place, I can use :ToTwitter and :ToIdentica to switch - between services. I added a call to FriendsTwitter at the end of each - function so that I'll have a fresh timeline view after switching. You - may also use this technique to switch between different user accounts - on the same service. - - ------------------------------------------------------------------------------- -6.3. Line length in status line *TwitVim-line-length* - - Add the following to your |'statusline'| to display the length of the - current line: - - %{strlen(getline('.'))} - - This is useful if you compose tweets in a separate buffer and post - them with |:CPosttoTwitter|. With the line length in your status line, - you will know when you've reached the 140-character boundary. - -============================================================================== -7. TwitVim History *TwitVim-history* - - 0.4.1 : 2009-03-30 * Fixed a problem with usernames and search terms - that begin with digits. - 0.4.0 : 2009-03-09 * Added |:SendDMTwitter| to send direct messages - through API without relying on the "d user ..." - syntax. - * Modified Alt-D mapping in timeline to use - the :SendDMTwitter code. - * Added |:BackTwitter| and |:ForwardTwitter| - commands, Ctrl-O and Ctrl-I mappings to move back - and forth in the timeline stack. - * Improvements in window handling. TwitVim commands - will restore the cursor to the original window - when possible. - * Wrote some notes on using TwitVim with Twitter - SSL API. - * Added mapping to show predecessor tweet for an - @-reply. |TwitVim-inreplyto| - * Added mapping to delete a tweet or message. - |TwitVim-delete| - * Added commands and mappings to refresh the - timeline and load the next or previous page. - |TwitVim-refresh|, |TwitVim-next|, - |TwitVim-previous|. - 0.3.5 : 2009-01-30 * Added support for pagination and page length to - :SearchTwitter. - * Shortened default retweet prefix to "RT". - 0.3.4 : 2008-11-11 * Added |twitvim_count| option to allow user to - configure the number of tweets returned by - :FriendsTwitter and :UserTwitter. - 0.3.3 : 2008-10-06 * Added support for Cligs. |:Cligs| - * Fixed a problem with not being able to unset - the proxy if using Tcl http. - 0.3.2 : 2008-09-30 * Added command to display rate limit info. - |:RateLimitTwitter| - * Improved error reporting for :UserTwitter. - * Added command and mapping to display user - profile information. |:ProfileTwitter| - |TwitVim-Leader-p| - * Added command for updating location. - |:LocationTwitter| - * Added support for tr.im. |:Trim| - * Fixed error reporting in Tcl http code. - 0.3.1 : 2008-09-18 * Added support for LongURL. |TwitVim-LongURL| - * Added support for posting multibyte/Unicode - tweets in cURL mode. - * Remove newlines from text before retweeting. - 0.3.0 : 2008-09-12 * Added support for http networking through Vim's - Perl, Python, Ruby, and Tcl interfaces, as - alternatives to cURL. |TwitVim-non-cURL| - * Removed UrlTea support. - 0.2.24 : 2008-08-28 * Added retweet feature. See |TwitVim-retweet| - 0.2.23 : 2008-08-25 * Support in_reply_to_status_id parameter. - * Added tip on line length in statusline. - * Report browser launch errors. - * Set syntax highlighting on every timeline refresh. - 0.2.22 : 2008-08-13 * Rewrote time conversion code in Vim script - so we don't need Perl or Python any more. - * Do not URL-encode digits 0 to 9. - 0.2.21 : 2008-08-12 * Added tips section to documentation. - * Use create_or_reuse instead of create in UrlBorg - API so that it will always generate the same - short URL for the same long URL. - * Added support for highlighting #hashtags and - jumping to Twitter Searches for #hashtags. - * Added Python code to convert Twitter timestamps - to local time and simplify them. - 0.2.20 : 2008-07-24 * Switched from Summize to Twitter Search. - |:SearchTwitter| - 0.2.19 : 2008-07-23 * Added support for non-Twitter servers - implementing the Twitter API. This is for - identi.ca support. See |twitvim-identi.ca|. - 0.2.18 : 2008-07-14 * Added support for urlBorg API. |:UrlBorg| - 0.2.17 : 2008-07-11 * Added command to show DM Sent Timeline. - |:DMSentTwitter| - * Added support for pagination in Friends, User, - Replies, DM, and DM Sent timelines. - * Added support for bit.ly API and is.gd API. - |:BitLy| |:IsGd| - 0.2.16 : 2008-05-16 * Removed quotes around browser launch URL. - * Escape ! character in browser launch URL. - 0.2.15 : 2008-05-13 * Extend :UserTwitter and :FriendsTwitter to show - another user's timeline if argument supplied. - * Extend Alt-G mapping to jump to another user's - timeline if invoked over @user or user: - * Escape special Vim shell characters in URL when - launching web browser. - 0.2.14 : 2008-05-12 * Added support for Summize search API. - 0.2.13 : 2008-05-07 * Added mappings to launch web browser on URLs in - timeline. - 0.2.12 : 2008-05-05 * Allow user to specify Twitter login info and - proxy login info preencoded in base64. - |twitvim_login_b64| |twitvim_proxy_login_b64| - 0.2.11 : 2008-05-02 * Scroll to top in timeline window after adding - an update line. - * Add r and d mappings as - alternative to Alt-R and Alt-D because the - latter are not valid key combos under Cygwin. - 0.2.10 : 2008-04-25 * Shortened snipurl.com to snipr.com - * Added support for proxy authentication. - |twitvim_proxy_login| - * Handle Perl module load failure. Not that I - expect those modules to ever be missing. - 0.2.9 : 2008-04-23 * Added some status messages. - * Added menu items under Plugin menu. - * Allow Ctrl-T as an alternative to Alt-T to avoid - conflict with the menu bar. - * Added support for UrlTea API. - * Generalize URL encoding to all non-alpha chars. - 0.2.8 : 2008-04-22 * Encode URLs sent to URL-shortening services. - 0.2.7 : 2008-04-21 * Add support for TinyURL API. |:TinyURL| - * Add quick direct message feature. - |TwitVim-direct-message| - 0.2.6 : 2008-04-15 * Delete Twitter buffer to the blackhole register - to avoid stepping on registers unnecessarily. - * Quote login and proxy arguments before sending to - cURL. - * Added support for SnipURL API and Metamark API. - |:Snipurl| |:Metamark| - 0.2.5 : 2008-04-14 * Escape the "+" character in sent tweets. - * Added Perl code to convert Twitter timestamps to - local time and simplify them. - * Fix for timestamp highlight when the "|" - character appears in a tweet. - 0.2.4 : 2008-04-13 * Use in Tweetburner commands. - * Improve XML parsing so that order of elements - does not matter. - * Changed T mapping to Alt-T to avoid overriding - the |T| command. - 0.2.3 : 2008-04-12 * Added more Tweetburner commands. - 0.2.2 : 2008-04-11 * Added quick reply feature. - * Added Tweetburner support. |:Tweetburner| - * Changed client ident to "from twitvim". - 0.2.1 : 2008-04-10 * Bug fix for Chinese characters in timeline. - Thanks to Leiyue. - * Scroll up to newest tweet after refreshing - timeline. - * Changed Twitter window name to avoid unsafe - special characters and clashes with file names. - 0.2.0 : 2008-04-09 * Added views for public, friends, user timelines, - replies, and direct messages. - * Automatically insert user's posts into - public, friends, or user timeline, if visible. - * Added syntax highlighting for timeline view. - 0.1.2 : 2008-04-03 * Make plugin conform to guidelines in - |write-plugin|. - * Add help documentation. - 0.1.1 : 2008-04-01 * Add error reporting for cURL problems. - 0.1 : 2008-03-28 * Initial release. - - -============================================================================== -8. TwitVim Credits *TwitVim-credits* - - Thanks to Travis Jeffery, the author of the original VimTwitter script - (vimscript #2124), who came up with the idea of running cURL from Vim - to access the Twitter API. - - Techniques for managing the Twitter buffer were adapted from the NERD - Tree plugin (vimscript #1658) by Marty Grenfell. - - -============================================================================== -vim:tw=78:ts=8:ft=help:norl: diff --git a/dot.vim/doc/vcde.txt b/dot.vim/doc/vcde.txt deleted file mode 100644 index 28e4c7e..0000000 --- a/dot.vim/doc/vcde.txt +++ /dev/null @@ -1,80 +0,0 @@ - *vcde* - - -Description~ - VCDE is a c++ development support by VJDE framework. - -Future~ - Now, ctags file supported from two ways: - 1. ruby parser, - 2 readtags which come from ctag5.5.4 - Default , use readtags , Once the $VIM_RUNTIME/plugin/vjde/readtags is -not runnable for you OS, use following in your .vimrc to disable it. > - let g:vjde_readtags='' -< - Then, ruby parser will be used. - Code completion in a gui window or a preview window for c++,simply -namespace and typedef support. > - string str; - str.find - ^ -< - Parameter preview in a window while your input a after a -'(' > - string str; - str.find_first_of( - ^ -< - - For quickly search the tag of c++ , you can generate a index for your -tags. Use the flowing command: > - :call VjdeCppGenerateIdx() -< - It's use |tags| parameter , then generate a index for each tag file, -named tags.vjde_idx - NOTE: for *inux user, you must make sure that the director is writable -for the user. - - - -Setup~ - To setup the completion for your own cpp files, you can set > - g:vjde_cpp_exts -< - which is seperated by ';' , It's treat as the extensions of c++/c -files , like > - let g:vjde_cpp_exts='cpp;c;cxx;h;hpp;hxx' -< - -Smart pointer support~ - Sometimes , We had use some smart pointer ,such as > - typedef auto_ptr MyClassPtr; -< -At that time , some coding support is read a MyClassPtr as auto_ptr, so , code -completion is not working correctly. So , add a file which is located : > - ~/.vim/vjde/ptr.lst -< -Add the following line: > - auto_ptr - std::auto_ptr -< -Then , code completion will treat MyClassPtr as MyClass. - - -Other language Support ~ - NOTE: Just now, use omni completion instead of this -function. - VJDE support other language which is ctags supported. - Once you want to use with your language, setup the variable > - let g:vjde_ctags_exts='vim;rb' -< - Then, the vim and ruby file can be previewed! - -Global Variables~ -g:vjde_max_deeps - Search for member in Inheries . -g:vjde_max_tags - The tags number will be searched. - - - vim:ts=8 sw=8 noexpandtab tw=78 ft=help: diff --git a/dot.vim/doc/vimwiki.txt b/dot.vim/doc/vimwiki.txt deleted file mode 100644 index 56b9959..0000000 --- a/dot.vim/doc/vimwiki.txt +++ /dev/null @@ -1,2147 +0,0 @@ -*vimwiki.txt* A Personal Wiki for Vim - - __ __ ___ __ __ _ _ ___ ___ _ ___ ~ - | | | || | | |_| || | _ | || | | | | || | ~ - | |_| || | | || || || || | | |_| || | ~ - | || | | || || | | _|| | ~ - | || | | || || | | |_ | | ~ - | | | | | ||_|| || _ || | | _ || | ~ - |___| |___| |_| |_||__| |__||___| |___| |_||___| ~ - - - Version: 1.1.1 - -============================================================================== -CONTENTS *vimwiki-contents* - - 1. Intro |vimwiki| - 2. Prerequisites |vimwiki-prerequisites| - 3. Mappings |vimwiki-mappings| - 3.1. Global mappings |vimwiki-global-mappings| - 3.2. Local mappings |vimwiki-local-mappings| - 3.3. Text objects |vimwiki-text-objects| - 4. Commands |vimwiki-commands| - 4.1. Global commands |vimwiki-global-commands| - 4.2. Local commands |vimwiki-local-commands| - 5. Wiki syntax |vimwiki-syntax| - 5.1. Typefaces |vimwiki-syntax-typefaces| - 5.2. Links |vimwiki-syntax-links| - 5.3. Headers |vimwiki-syntax-headers| - 5.4. Paragraphs |vimwiki-syntax-paragraphs| - 5.5. Lists |vimwiki-syntax-lists| - 5.6. Tables |vimwiki-syntax-tables| - 5.7. Preformatted text |vimwiki-syntax-preformatted| - 5.8. Blockquotes |vimwiki-syntax-blockquotes| - 5.9. Comments |vimwiki-syntax-comments| - 6. Folding/Outline |vimwiki-folding| - 7. Placeholders |vimwiki-placeholders| - 8. Todo lists |vimwiki-todo-lists| - 9. Tables |vimwiki-tables| - 10. Diary |vimwiki-diary| - 11. Options |vimwiki-options| - 12. Help |vimwiki-help| - 13. Developers |vimwiki-developers| - 14. Changelog |vimwiki-changelog| - 15. License |vimwiki-license| - - -============================================================================== -1. Intro *vimwiki* - -Vimwiki is a personal wiki for Vim -- a number of linked text files that have -their own syntax highlighting. - -With vimwiki you can: - - organize notes and ideas; - - manage todo-lists; - - write documentation. - -To do a quick start press ww (this is usually \ww) to go to your index -wiki file. By default it is located in: > - ~/vimwiki/index.wiki - -Feed it with the following example: - -= My knowledge base = - * MyUrgentTasks -- things to be done _yesterday_!!! - * ProjectGutenberg -- good books are power. - * ScratchPad -- various temporary stuff. - - -Notice that ProjectGutenberg, MyUrgentTasks and ScratchPad highlighted as -errors. These are links in CamelCase form that do not exists yet. (CamelCase -form -- capitalized word connected with other capitalized words) - -Place cursor on ProjectGutenberg and press . Now you are in -ProjectGutenberg. Edit and save it, then press Backspace to return to previous -wiki file. You should see the difference now -- ProjectGutenberg is -highlighted as a link. - - -============================================================================== -2. Prerequisites *vimwiki-prerequisites* - -Make sure you have these settings in your vimrc file: > - set nocompatible - filetype plugin on - syntax on - -Without them Vimwiki will not work properly. - - -============================================================================== -3. Mappings *vimwiki-mappings* - -There are global and local mappings in vimwiki. - ------------------------------------------------------------------------------- -3.1. Global mappings *vimwiki-global-mappings* - -[count]ww or VimwikiIndex - Open index file of the [count]'s wiki. - - ww opens first wiki from |g:vimwiki_list|. - 1ww as above opens first wiki from |g:vimwiki_list|. - 2ww opens second wiki from |g:vimwiki_list|. - 3ww opens third wiki from |g:vimwiki_list|. - etc. - To remap: > - :map w VimwikiIndex -< -See also |:VimwikiIndex| - - -[count]wt or VimwikiTabIndex - Open index file of the [count]'s wiki in a new tab. - - wt tabopens first wiki from |g:vimwiki_list|. - 1wt as above tabopens first wiki from |g:vimwiki_list|. - 2wt tabopens second wiki from |g:vimwiki_list|. - 3wt tabopens third wiki from |g:vimwiki_list|. - etc. - To remap: > - :map t VimwikiTabIndex -< -See also |:VimwikiTabIndex| - - -ws or VimwikiUISelect - List and select available wikies. - To remap: > - :map wq VimwikiUISelect -< -See also|:VimwikiUISelect| - - -[count]ww or VimwikiMakeDiaryNote - Open diary wiki-file for today of the [count]'s wiki. - - ww opens diary wiki-file for today in the first wiki - from |g:vimwiki_list|. - 1ww as above opens diary wiki-file for today in the - first wiki from |g:vimwiki_list|. - 2ww opens diary wiki-file for today in the second wiki - from |g:vimwiki_list|. - 3ww opens diary wiki-file for today in the third wiki - from |g:vimwiki_list|. - etc. - To remap: > - :map d VimwikiMakeDiaryNote -< -See also|:VimwikiMakeDiaryNote| - - -[count]wt or VimwikiTabMakeDiaryNote - Open diary wiki-file for today of the [count]'s wiki in a new tab. - - wt tabopens diary wiki-file for today in the first - wiki from |g:vimwiki_list|. - 1wt as above tabopens diary wiki-file for today in the - first wiki from |g:vimwiki_list|. - 2wt tabopens diary wiki-file for today in the second - wiki from |g:vimwiki_list|. - 3wt tabopens diary wiki-file for today in the third - wiki from |g:vimwiki_list|. - etc. - To remap: > - :map dt VimwikiTabMakeDiaryNote -< -See also|:VimwikiTabMakeDiaryNote| - - ------------------------------------------------------------------------------- -3.2. Local mappings - -NORMAL MODE *vimwiki-local-mappings* - *vimwiki_* - Follow/Create wiki link. - Maps to |:VimwikiFollowLink|. - To remap: > - :map wf VimwikiFollowLink -< - *vimwiki_* - Split and follow/create wiki link. - Maps to |:VimwikiSplitLink|. - To remap: > - :map we VimwikiSplitLink -< - *vimwiki_* - Vertical split and follow/create wiki link. - Maps to |:VimwikiVSplitLink|. - To remap: > - :map wq VimwikiVSplitLink -< - *vimwiki_* - Go back to previous wiki link - Maps to |:VimwikiGoBackLink|. - To remap: > - :map wb VimwikiGoBackLink -< - *vimwiki_* - Find next wiki link. - Maps to |:VimwikiNextLink|. - To remap: > - :map wn VimwikiNextLink -< - *vimwiki_* - Find previous wiki link. - Maps to |:VimwikiPrevLink|. - To remap: > - :map wp VimwikiPrevLink -< - *vimwiki_wd* -wd Delete wiki link you are in. - Maps to |:VimwikiDeleteLink|. - To remap: > - :map dd VimwikiDeleteLink -< - *vimwiki_wr* -wr Rename wiki link you are in. - Maps to |:VimwikiRenameLink|. - To remap: > - :map rr VimwikiRenameLink -< - *vimwiki_* - Toggle list item on/off (checked/unchecked) - Maps to |:VimwikiToggleListItem|. - To remap: > - :map tt VimwikiToggleListItem -< See |vimwiki-todo-lists|. - - *vimwiki_=* -= Add header level. Create if needed. - There is nothing to indent with '==' command in - vimwiki, so it should be ok to use '=' here. - - *vimwiki_-* -- Remove header level. - - - *vimwiki_gqq* *vimwiki_gww* -gqq Format table. If you did some changes to a table - or without swapping insert/normal modes this command -gww reformat it. - - *vimwiki_* - Move current table column to the left. - See |:VimwikiTableMoveColumnLeft| - - *vimwiki_* - Move current table column to the right. - See |:VimwikiTableMoveColumnRight| - - *vimwiki_* - Open previous day diary link if available. - See |:VimwikiDiaryPrevDay| - - *vimwiki_* - Open next day diary link if available. - See |:VimwikiDiaryNextDay| - - -Works only if |g:vimwiki_use_mouse| is set to 1. -<2-LeftMouse> Follow/Create wiki link. - - Split and follow/create wiki link. - - Vertical split and follow/create wiki link. - - Go back to previous wiki link. - -Note: <2-LeftMouse> is just left double click. - - - -INSERT MODE *vimwiki-table-mappings* - *vimwiki_i_* - Goto table cell down to the current, create new row if - on the last one. - - *vimwiki_i_* - Goto next table cell, create new row if on the last - cell. - - *vimwiki_i_* - Insert
and a newline. - - ------------------------------------------------------------------------------- -3.3. Text objects *vimwiki-text-objects* - -ah A Header with leading empty lines. -ih Inner Header without leading empty lines. - -You can 'vah' to select a header with its contents or 'dah' to delete it or -'yah' to yank it or 'cah' to change it. - -a\ A cell in a table. -i\ Inner cell in a table. -ac A column in a table. -ic Inner column in a table. - -============================================================================== -4. Commands *vimwiki-commands* - ------------------------------------------------------------------------------- -4.1. Global Commands *vimwiki-global-commands* - -*:VimwikiIndex* - Open index file of the current wiki. - -*:VimwikiTabIndex* - Open index file of the current wiki in a new tab. - -*:VimwikiUISelect* - Open index file of the selected wiki. - -*:VimwikiMakeDiaryNote* - Open diary wiki-file for today of the current wiki. - -*:VimwikiTabMakeDiaryNote* - Open diary wiki-file for today of the current wiki in a new tab. - ------------------------------------------------------------------------------- -4.2. Local commands *vimwiki-local-commands* - -*:VimwikiFollowLink* - Follow/create wiki link.. - - -*:VimwikiGoBackLink* - Go back to previous wiki link. you come from. - - -*:VimwikiSplitLink* - Split and follow/create wiki link.. - - -*:VimwikiVSplitLink* - Vertical split and follow/create wiki link.. - - -*:VimwikiNextLink* - Find next wiki link.. - - -*:VimwikiPrevLink* - Find previous wiki link.. - -*:VimwikiGoto* - Goto link provided by an argument. For example: > - :VimwikiGoto HelloWorld -< opens opens/creates HelloWorld wiki page. - -*:VimwikiDeleteLink* - Delete wiki link. you are in. - - -*:VimwikiRenameLink* - Rename wiki link. you are in. - - -*:Vimwiki2HTML* - Convert current WikiPage to HTML. - - -*:VimwikiAll2HTML* - Convert all WikiPages to HTML. - - -*:VimwikiToggleListItem* - Toggle list item on/off (checked/unchecked) - See |vimwiki-todo-lists|. - - -*:VimwikiSearch* /pattern/ -*:VWS* /pattern/ - Search for /pattern/ in all files of current wiki. - To display next match use |:cnext| command. - To display previous match use |:cprevious| command. - - -*:VimwikiTable* - Create a table with 5 cols and 2 rows. - - :VimwikiTable cols rows - Create a table with a given cols and rows - - :VimwikiTable cols - Create a table with a given cols and 2 rows - -*:VimwikiTableMoveColumnLeft* , *:VimwikiTableMoveColumnRight* - Move current column to the left or to the right: - Example: > - - | head1 | head2 | head3 | head4 | head5 | - |--------+--------+--------+--------+--------| - | value1 | value2 | value3 | value4 | value5 | - - - Cursor is on 'head1'. - :VimwikiTableMoveColumnRight - - | head2 | head1 | head3 | head4 | head5 | - |--------+--------+--------+--------+--------| - | value2 | value1 | value3 | value4 | value5 | - - Cursor is on 'head3'. - :VimwikiTableMoveColumnLeft - - | head2 | head3 | head1 | head4 | head5 | - |--------+--------+--------+--------+--------| - | value2 | value3 | value1 | value4 | value5 | -< - - Commands are mapped to and respectively. - - -*:VimwikiGenerateLinks* - Insert all available links into current buffer. - -*:VimwikiDiaryNextDay* - Open next day diary link if available. - Mapped to . - -*:VimwikiDiaryPrevDay* - Open previous day diary link if available. - Mapped to . - - -============================================================================== -5. Wiki syntax *vimwiki-syntax* - -There are a lot of different wikies out there. Most of them have their own -syntax and vimwiki is not an exception here. Default vimwiki's syntax is a -subset of google's wiki syntax markup. - -There is MediaWiki syntax file included in the distribution (it doesn't have -all the fancy stuff original MediaWiki syntax has though). -See |vimwiki-option-syntax|. - - ------------------------------------------------------------------------------- -5.1. Typefaces *vimwiki-syntax-typefaces* - -There are a few typefaces that gives you a bit of control on how your -text should be decorated: > - *bold text* - _italic text_ - ~~strikeout text~~ - `code (no syntax) text` - super^script^ - sub,,script,, - ------------------------------------------------------------------------------- -5.2. Links *vimwiki-syntax-links* - -Internal links~ -WikiWords: > - CapitalizedWordsConnected - -You can limit linking of WikiWords by adding an exclamation mark in front of -it: > - !CapitalizedWordsConnected - -Or disable it completely with |g:vimwiki_camel_case|. - -Link with spaces in it: > - [[This is a link]] -or: > - [[This is a link source|Description of the link]] -or: > - [[This is a link source][Description of the link]] - - -External links~ -Plain link: > - http://code.google.com/p/vimwiki - -Link with description: > - [http://habamax.ru/blog habamax home page] - - -Images and image links~ -Image link is the link with one of jpg, png or gif endings. -Plain image link: > - http://someaddr.com/picture.jpg -in html: > - - -Link to a local image: > - [[images/pabloymoira.jpg]] -in html: > - -Path to image (ie. images/pabloymoira.jpg) is relative to -|vimwiki-option-path_html|. - -Double bracketed link to an image: > - [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg]] -in html: > - - -Double bracketed link to an image with description text: > - [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg|dance]] -in html: > - dance - -Double bracketed link to an image with alternate text: > - [[http://habamax.ru/blog/wp-content/uploads/2009/01/2740254sm.jpg|dance|]] -in html: > - dance - -Double bracketed link to an image with alternate text and some style: > - [[http://helloworld.com/blabla.jpg|cool stuff|width:150px; height: 120px;]] -in html: > - cool stuff - -Double bracketed link to an image without alternate text and some style: > - [[http://helloworld.com/blabla.jpg||width:150px; height: 120px;]] -in html: > - - -Thumbnail link: > - [http://someaddr.com/bigpicture.jpg http://someaddr.com/thumbnail.jpg] -or > - [[http://someaddr.com/bigpicture.jpg|http://someaddr.com/thumbnail.jpg]] -in html: > - - - def hello(world): - for x in range(10): - print("Hello {0} number {1}".format(world, x)) -}}} - -Result of HTML export: > -
- def hello(world):
-     for x in range(10):
-         print("Hello {0} number {1}".format(world, x))
- 
- -This might be useful for coloring some programming code with external js tools -like google syntax highlighter. - -You can setup vimwiki to highlight code snippets in preformatted text. -See |vimwiki-option-nested_syntaxes| - ------------------------------------------------------------------------------- -5.8. Blockquotes *vimwiki-syntax-blockquotes* - -Text started with 4 or more spaces is a blockquote. - - This would be a blockquote in vimwiki. It is not highlighted in vim but - could be styled by css in html. Blockquotes are usually used to quote a - long piece of text from another source. - ------------------------------------------------------------------------------- -5.9. Comments *vimwiki-syntax-comments* - -Text between is a comment. -Ex: > - -< - -============================================================================== -6. Folding/Outline *vimwiki-folding* - -Vimwiki can fold or outline headers and list items. - -Example: -= My current task = - * [ ] Do stuff 1 - * [ ] Do substuff 1.1 - * [ ] Do substuff 1.2 - * [ ] Do substuff 1.2.1 - * [ ] Do substuff 1.2.2 - * [ ] Do substuff 1.3 - * [ ] Do stuff 2 - * [ ] Do stuff 3 - -Hit |zM| : -= My current task = [8] --------------------------------------~ - -Hit |zr| : -= My current task =~ - * [ ] Do stuff 1 [5] --------------------------------------~ - * [ ] Do stuff 2~ - * [ ] Do stuff 3~ - -Hit |zr| one more time: -= My current task =~ - * [ ] Do stuff 1~ - * [ ] Do substuff 1.1~ - * [ ] Do substuff 1.2 [2] -------------------------------~ - * [ ] Do substuff 1.3~ - * [ ] Do stuff 2~ - * [ ] Do stuff 3~ - -NOTE: Whether you use default syntax, folding on list items should work -properly only if all of them are indented using current |shiftwidth|. -For MediaWiki * or # should be in the first column. - -To turn folding on/off check |g:vimwiki_folding|. - -============================================================================== -7. Placeholders *vimwiki-placeholders* - ------------------------------------------------------------------------------- -%toc Table of Contents *vimwiki-toc* *vimwiki-table-of-contents* - -You can add 'table of contents' to your html page generated from wiki one. -Just place > - -%toc - -into your wiki page. -You can also add caption to your 'toc': > - -%toc Table of Contents - -or > - -%toc Whatever - - ------------------------------------------------------------------------------- -%title Title of the page *vimwiki-title* - -When you htmlize your wiki page you have default title which is the filename -of the page. -Place > - -%title My books - -into your wiki page if you want another title. - - ------------------------------------------------------------------------------- -%nohtml *vimwiki-nohtml* - -If you do not want a wiki page to be converted to html, place: - -%nohtml - -into it. - - -============================================================================== -8. Todo lists *vimwiki-todo-lists* - -You can have todo lists -- lists of items you can check/uncheck. - -Consider the following example: -= Toggleable list of todo items = - * [X] Toggle list item on/off. - * [X] Simple toggling between [ ] and [X]. - * [X] All list's subitems should be toggled on/off appropriately. - * [X] Toggle child subitems only if current line is list item - * [X] Parent list item should be toggled depending on it's child items. - * [X] Make numbered list items toggleable too - * [X] Add highlighting to list item boxes - * [X] Add [ ] to the next created with o, O and list item. - - -Pressing on the first list item will toggle it and all of it's child -items: -= Toggleable list of todo items = - * [ ] Toggle list item on/off. - * [ ] Simple toggling between [ ] and [X]. - * [ ] All list's subitems should be toggled on/off appropriately. - * [ ] Toggle child subitems only if current line is list item - * [ ] Parent list item should be toggled depending on it's child items. - * [X] Make numbered list items toggleable too - * [X] Add highlighting to list item boxes - * [X] Add [ ] to the next created with o, O and list item. - -Pressing on the third list item will toggle it and all of it's -parent items: -= Toggleable list of todo items = - * [.] Toggle list item on/off. - * [ ] Simple toggling between [ ] and [X]. - * [X] All list's subitems should be toggled on/off appropriately. - * [ ] Toggle child subitems only if current line is list item - * [ ] Parent list item should be toggled depending on it's child items. - * [ ] Make numbered list items toggleable too - * [ ] Add highlighting to list item boxes - * [ ] Add [ ] to the next created with o, O and list item. - -Parent items could be toggled by its child items. Symbol inside [ ] depends on -percentage of toggled child items(see also |g:vimwiki_listsyms|): > - [ ] -- 0% - [.] -- 1-33% - [o] -- 34-66% - [O] -- 67-99% - [X] -- 100% - -It is possible to toggle several list items using visual mode. - - -============================================================================== -9. Tables *vimwiki-tables* - -Use :VimwikiTable command to create default table with 5 columns and 2 rows: > - - | | | | | | - |---+---+---+---+---| - | | | | | | -< - -Tables are auto-formattable. Let's add some text into first cell: > - - | First Name | | | | | - |---+---+---+---+---| - | | | | | | -< - -Whenever you press , or leave Insert mode table is formatted: > - - | First Name | | | | | - |------------+---+---+---+---| - | | | | | | -< - -You can easily create nice looking text tables, just press and enter new -values: > - - | First Name | Last Name | Age | City | e-mail | - |------------+------------+-----+----------+----------------------| - | Vladislav | Pokrishkin | 31 | Moscow | vlad_pok@smail.com | - | James | Esfandiary | 27 | Istanbul | esfandiary@tmail.com | -< - -To indent table indent the first row. Then format it with 'gqq'. - - - -============================================================================== -10. Diary *vimwiki-diary* - -Diary helps you make daily notes. You can really easy add information into -vimwiki that should be sorted out later. Just hit ww to create -new daily note with name based on current date. The link to this newly created -file is added to a diary wiki file. - -Usage example with default settings: > - Consider today is 2010-01-27. - - Hit \w\w . - ~/vimwiki/diary.wiki is created. - - 2 following lines are added to ~/vimwiki/diary/diary.wiki : - = Diary = - | [[2010-01-27]] | - - ~/vimwiki/diary/2010-01-27.wiki is created. - You are ready to add your information there. - ------------------------------------------- - - On the next day. - Hit \w\w . - - The first line after = Diary = is changed in ~/vimwiki/diary/diary.wiki : - = Diary = - | [[2010-01-28]] | [[2010-01-27]] | - - ~/vimwiki/diary/2010-01-28.wiki is created. - You are ready to add your information there. -> - -By default there are 4 links on the line. All links are sorted by their dates. - -Calendar integration *vimwiki-calendar* ------------------------------------------------------------------------------- -If you have Calendar.vim installed you can use it to create diary notes. -Just open calendar with :Calendar and tap on the date. Wiki file would -be created in default wiki's diary. - -Get it from http://www.vim.org/scripts/script.php?script_id=52 - -See |g:vimwiki_use_calendar| option to turn it off/on. - - - -============================================================================== -11. Options *vimwiki-options* - -There are global and per wiki(local) options available to tune vimwiki. -All global options are set using the following template: > - let g:option_name=option_value - -All per wiki options are |Dictionary|'s pairs in a list of wikies -(dictionaries). See |g:vimwiki_list| option for more details. - ------------------------------------------------------------------------------- -*g:vimwiki_list* *vimwiki-multiple-wikies* - -Each item in g:vimwiki_list is a |Dictionary| that holds all customization -available for a wiki represented by that item. It is in form of > - {'option1': 'value1', 'option2: 'value2', ...} - -Consider the following example: > - let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}] - -It gives us one wiki located at ~/my_site/ that could be htmlized to -~/public_html/ - -The next example: > - let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}, - \ {'path': '~/my_docs/', 'ext': '.mdox'}] -gives us 2 wikies, first wiki as in previous example, second one is located in -~/my_docs/ and its files have .mdox extension. - -Empty |Dictionary| in the g:vimwiki_list is the wiki with default options: > - let g:vimwiki_list = [{}, - \ {'path': '~/my_docs/', 'ext': '.mdox'}] - -< - -You can also create wikis as a separate |Dictionary|s. > - - let wiki_1 = {} - let wiki_1.path = '~/my_docs/' - let wiki_1.html_header = '~/public_html/header.tpl' - let wiki_1.nested_syntaxes = {'python': 'python', 'c++': 'cpp'} - - let wiki_2 = {} - let wiki_2.path = '~/project_docs/' - let wiki_2.index = 'main' - - let g:vimwiki_list = [wiki_1, wiki_2] - -< - -PER WIKI OPTIONS *viwmiki-local-options* - - - -*vimwiki-option-path* ------------------------------------------------------------------------------- -Key Default value~ -path ~/vimwiki/ - -Description~ -Wiki files location: > - let g:vimwiki_list = [{'path': '~/my_site/'}] -< - -*vimwiki-option-path_html* ------------------------------------------------------------------------------- -Key Default value~ -path_html ~/vimwiki_html/ - -Description~ -HTML files converted from wiki files location: > - let g:vimwiki_list = [{'path': '~/my_site/', - \ 'path_html': '~/my_site_html/'}] - -If you omit this option path_html would be path - '/' + '_html/': > - let g:vimwiki_list = [{'path': '~/okidoki/'}] - -ie, path_html = '~/okidoki_html/' - -*vimwiki-option-auto_export* ------------------------------------------------------------------------------- -Key Default value Values~ -auto_export 0 0, 1 - -Description~ -Set this option to 1 to automatically generate HTML file when corresponding -wiki page is saved: > - let g:vimwiki_list = [{'path': '~/my_site/', 'auto_export': 1}] - -This will keep you HTML files up to date. - -*vimwiki-option-index* ------------------------------------------------------------------------------- -Key Default value~ -index index - -Description~ -Name of wiki index file: > - let g:vimwiki_list = [{'path': '~/my_site/', 'index': 'main'}] - -NOTE: Do not add extension. - - -*vimwiki-option-ext* ------------------------------------------------------------------------------- -Key Default value~ -ext .wiki - -Description~ -Extension of wiki files: > - let g:vimwiki_list = [{'path': '~/my_site/', - \ 'index': 'main', 'ext': '.document'}] - -< -*vimwiki-option-syntax* ------------------------------------------------------------------------------- -Key Default value Values~ -syntax default default, media - -Description~ -Wiki syntax. -You can use different markup languages (currently default vimwiki and -MediaWiki) but only vimwiki's default markup could be converted to HTML at the -moment. -To use MediaWiki's wiki markup: > - let g:vimwiki_list = [{'path': '~/my_site/', 'syntax': 'media'}] -< - -*vimwiki-option-html_header* ------------------------------------------------------------------------------- -Key Default value~ -html_header - -Description~ -Set up file name for html header template: > - let g:vimwiki_list = [{'path': '~/my_site/', - \ 'html_header': '~/public_html/header.tpl'}] - -This header.tpl could look like: > - - - - %title% - - - -
- -where - %title% is replaced by a wiki page name or by a |vimwiki-title| - %root_path% is replaced by a count of ../ for pages buried in subdirs: - if you have wikilink [[dir1/dir2/dir3/my page in a subdir]] then - %root_path% is replaced by '../../../'. - - -*vimwiki-option-html_footer* ------------------------------------------------------------------------------- -Key Default value~ -html_footer - -Description~ -Set up file name for html footer template: > - let g:vimwiki_list = [{'path': '~/my_site/', - \ 'html_footer': '~/public_html/footer.tpl'}] - -This footer.tpl could look like: > -
- - -< - -*vimwiki-option-css_name* ------------------------------------------------------------------------------- -Key Default value~ -css_name style.css - -Description~ -Set up css file name: > - let g:vimwiki_list = [{'path': '~/my_pages/', - \ 'css_name': 'main.css'}] -< -or even > - let g:vimwiki_list = [{'path': '~/my_pages/', - \ 'css_name': 'css/main.css'}] -< - - -*vimwiki-option-maxhi* ------------------------------------------------------------------------------- -Key Default value Values~ -maxhi 1 0, 1 - -Description~ -Non-existent wiki links highlighting could be quite slow and if you don't want -it set maxhi to 0: > - let g:vimwiki_list = [{'path': '~/my_site/', 'maxhi': 0}] - -This disables filesystem checks for wiki links. - - -*vimwiki-option-nested_syntaxes* ------------------------------------------------------------------------------- -Key Default value Values~ -nested_syntaxes {} pairs of highlight keyword and vim filetype - -Description~ -You can make preformatted text to be highlighted with a different syntaxes -available for vim. -For example the following setup in your vimrc: > - let wiki = {} - let wiki.path = '~/my_wiki/' - let wiki.nested_syntaxes = {'python': 'python', 'c++': 'cpp'} - let g:vimwiki_list = [wiki] - -would give you python and c++ highlighting in: > - {{{class="brush: python" - for i in range(1, 5): - print(i) - }}} - - {{{class="brush: c++" - #include "helloworld.h" - int helloworld() - { - printf("hello world"); - } - }}} - -or in: > - {{{c++ - #include "helloworld.h" - int helloworld() - { - printf("hello world"); - } - }}} - - {{{python - for i in range(1, 5): - print(i) - }}} - - - -*vimwiki-option-diary_rel_path* ------------------------------------------------------------------------------- -Key Default value~ -diary_rel_path diary/ - -Description~ -Related to |vimwiki-option-path| path for diary wiki-files. - - -*vimwiki-option-diary_index* ------------------------------------------------------------------------------- -Key Default value~ -diary_index diary - -Description~ -Name of wiki-file that holds all links to dated wiki-files. - - -*vimwiki-option-diary_header* ------------------------------------------------------------------------------- -Key Default value~ -diary_header Diary - -Description~ -Name of the header in |vimwiki-option-diary_index| where links to dated -wiki-files are located. - - -*vimwiki-option-diary_link_count* ------------------------------------------------------------------------------- -Key Default value~ -diary_link_count 4 - -Description~ -Number of maximum dated links placed on one line. -Ex: -= Diary = -| [[2010-01-30]] | [[2010-01-29]] | [[2010-01-28]] | [[2010-01-27]] | -| [[2010-01-26]] | [[2010-01-25]] | - - - - -GLOBAL OPTIONS *viwmiki-global-options* - -Use: > - let g:option_name=option_value -to set them. - ------------------------------------------------------------------------------- -*g:vimwiki_hl_headers* - -Highlight headers with =Reddish=, ==Greenish==, ===Blueish=== colors. - -Value Description~ -1 Use predefined colors to highlight different header levels. -0 Use |hl-Title| or VimwikiHeader1-VimwikiHeader6 (if defined - in a colorscheme) - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_hl_cb_checked* - -Checked list items could be highlighted with a color: - - * [X] the whole line could be highlighted with the option set to 1. - * [ ] I wish vim could use strikethru. - -Value Description~ -1 Highlight checked [X] check box with |group-name| "Comment". -0 Don't. - -Default: 0 - - ------------------------------------------------------------------------------- -*g:vimwiki_global_ext* *vimwiki-temporary-wiki* - -If a file with a registered wiki extension is opened in a dir that is not -listed in |g:vimwiki_list| then: - -Value Description~ -1 make a temporary wiki in that dir. -0 don't make temporary wiki it that dir. - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_upper* *g:vimwiki_lower* - -This affects WikiWord detection. -By default WikiWord detection uses English and Russian letters. -You can set up your own: > - let g:vimwiki_upper = "A-Z\u0410-\u042f" - let g:vimwiki_lower = "a-z\u0430-\u044f" - - ------------------------------------------------------------------------------- -*g:vimwiki_auto_checkbox* - -if on, creates checkbox while toggling list item. - -Value Description~ -0 Do not create checkbox. -1 Create checkbox. - -Default: 1 - -Ex: -Press (|:VimwikiToggleListItem|) on a list item without checkbox to -create it: > - * List item -result: > - * [ ] List item - - ------------------------------------------------------------------------------- -*g:vimwiki_menu* - -GUI menu of available wikies to select. - -Value Description~ -'' No menu -'Vimwiki' Top level menu "Vimwiki" -'Plugin.Vimwiki' "Vimwiki" submenu of top level menu "Plugin" -etc. - -Default: 'Vimwiki' - ------------------------------------------------------------------------------- -*g:vimwiki_stripsym* - -Change strip symbol -- in Windows you cannot use /*?<>:" in file names so -vimwiki replaces them with neutral symbol (_ is default): > - let g:vimwiki_stripsym = '_' - -You can change it to a for example: > - let g:vimwiki_stripsym = ' ' - ------------------------------------------------------------------------------- -*g:vimwiki_badsyms* - -Consider you do not like spaces in filenames (as some vimwiki users do). -In that case you can set up bad symbols that would be converted to -|g:vimwiki_stripsym|: > - let g:vimwiki_badsyms = ' ' - -Now files for all [[links with spaces]] would be created like -'links_with_spaces'. - -This option is a complement one to |g:vimwiki_stripsym|. - ------------------------------------------------------------------------------- -*g:vimwiki_listsyms* - -String of 5 symbols for list items with checkboxes. -Default value is ' .oOX'. - -g:vimwiki_listsyms[0] is for 0% done items. -g:vimwiki_listsyms[4] is for 100% done items. - ------------------------------------------------------------------------------- -*g:vimwiki_use_mouse* - -Use local mouse mappings from |vimwiki-local-mappings|. - -Value Description~ -0 Do not use mouse mappings. -1 Use mouse mappings. - -Default: 0 - ------------------------------------------------------------------------------- -*g:vimwiki_folding* - -Enable/disable vimwiki's folding/outline. Folding in vimwiki is using 'expr' -foldmethod which is very flexible but really slow. - -Value Description~ -0 Disable folding. -1 Enable folding. - -Default: 0 - ------------------------------------------------------------------------------- -*g:vimwiki_fold_lists* - -Enable/disable folding of list subitems. - -Value Description~ -0 Disable list subitem's folding. -1 Enable list subitem's folding. - -Default: 0 - ------------------------------------------------------------------------------- -*g:vimwiki_fold_trailing_empty_lines* - -Fold or do not fold empty lines between folded headers. - -Value Description~ -0 Fold only one empty line. The rest empty lines are unfolded. -1 Fold in all empty lines. - -Default: 0 - ------------------------------------------------------------------------------- -*g:vimwiki_camel_case* - -If you do not want WikiWord to be a link this setting is just for you. - -Value Description~ -0 Do not make links from CamelCased words. -1 Make links from CamelCased words. - -Default: 1 - ------------------------------------------------------------------------------- -*g:vimwiki_list_ignore_newline* - -This is HTML related. -Convert newlines to
s in multiline list items. - -Value Description~ -0 Newlines in a list item are converted to
s. -1 Ignore newlines. - -Default: 1 - ------------------------------------------------------------------------------- -*g:vimwiki_use_calendar* - -Create new or open existing diary wiki-file for the date selected in Calendar. -See |vimwiki-calendar|. - -Value Description~ -0 Do not use calendar. -1 Use calendar. - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_browsers* *VimwikiWeblinkHandler* - -You can open external weblinks in a webbrowser. Webbrowsers are listed in -|g:vimwiki_browsers|. - -For win32 it is: chrome, opera, firefox and explorer. -For other OSes it is: opera, firefox and konqueror. - -The first available browser from the list is used to open weblink. -If you have opera and firefox and want weblinks to be opened in the latter -just: > - let g:vimwiki_browsers=['C:\Program Files\Firefox\firefox.exe'] - -or redefine VimwikiWeblinkHandler function: > - function! VimwikiWeblinkHandler(weblink) - let browser = 'C:\Program Files\Firefox\firefox.exe' - execute '!start "'.browser.'" ' . a:weblink - endfunction - - ------------------------------------------------------------------------------- -*g:vimwiki_table_auto_fmt* - -Turn on/off table auto-formatting. - -Value Description~ -0 Do not auto-format tables. -1 Auto-format tables. - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_w32_dir_enc* - -Convert directory name from current |encoding| into 'g:vimwiki_w32_dir_enc' -before it is created. - -If you have 'enc=utf-8' and set up > - let g:vimwiki_w32_dir_enc = 'cp1251' -< -then following the next link with : > - [[привет/мир]] -> -would convert utf-8 'привет' to cp1251 and create directory with that name. - -Default: '' - - ------------------------------------------------------------------------------- -*g:vimwiki_CJK_length* - -Use special method to calculate correct length of the strings with double wide -characters. (To align table cells properly) - -Value Description~ -0 Do not use it. -1 Use it. - -Default: 0 - -Note: Vim73 has new function |strdisplaywidth|, so for Vim73 users this option -is obsolete. - - ------------------------------------------------------------------------------- -*g:vimwiki_dir_link* - -This option is about what to do with links to directories -- [[directory/]], -[[papers/]], etc. - -Value Description~ -'' Open 'directory/' using standard netrw plugin. -'index' Open 'directory/index.wiki', create if needed. -'main' Open 'directory/main.wiki', create if needed. -etc. - -Default: '' (empty string) - - ------------------------------------------------------------------------------- -*g:vimwiki_html_header_numbering* - -Set this option if you want headers to be auto numbered in html. - -ex: > - 1 Header1 - 1.1 Header2 - 1.2 Header2 - 1.2.1 Header3 - 1.2.2 Header3 - 1.3 Header2 - 2 Header1 - 3 Header1 -etc. - -Value Description~ -0 Header numbering is off. -1 Header numbering is on. Headers are numbered starting from - header level 1. -2 Header numbering is on. Headers are numbered starting from - header level 2. -etc. -Example when g:vimwiki_html_header_numbering = 2: > - Header1 - 1 Header2 - 2 Header2 - 2.1 Header3 - 2.1.1 Header4 - 2.1.2 Header4 - 2.2 Header3 - 3 Header2 - 4 Header2 -etc. - -Default: 0 - - ------------------------------------------------------------------------------- -*g:vimwiki_html_header_numbering_sym* - -Ending symbol for |g:vimwiki_html_header_numbering|. - -Value Description~ -'.' Dot would be added to the end of header's number. -')' Closing bracket would be added to the end of header's number. -etc. - -With - let g:vimwiki_html_header_numbering = '.' -headers would look like: > - 1. Header1 - 1.1. Header2 - 1.2. Header2 - 1.2.1. Header3 - 1.2.2. Header3 - 1.3. Header2 - 2. Header1 - 3. Header1 - - -Default: '' (empty) - - ------------------------------------------------------------------------------- -*g:vimwiki_file_exts* - -Comma separated list of file extensions. - -Consider you have the following link: [[my_script.php][my script]]. -If there is 'php' extension in g:vimwiki_file_exts this link would be htmlized -to
my script. -Otherwise it would be my script (note .html) - - -Default: 'pdf,txt,doc,rtf,xls,php,zip,rar,7z,html,gz' - - ------------------------------------------------------------------------------- -*g:vimwiki_valid_html_tags* - -Comma separated list of html tags that can be used in vimwiki. - -Default: 'b,i,s,u,sub,sup,kbd,br,hr' - - ------------------------------------------------------------------------------- -*g:vimwiki_conceallevel* - -In vim73 |conceallevel| is local to window, thus if you open viwmiki buffer in -a new tab or window, it would be set to default value. - -Vimwiki sets |conceallevel| to g:vimwiki_conceallevel everytime vimwiki buffer -is entered. - -Default: 3 - - - - -============================================================================== -12. Help *vimwiki-help* - -Your help in making vimwiki better is really appreciated! -Any help. Would it be spell correction or code snippet to patch -- everything -is welcomed. - -Issues could be filled in at http://code.google.com/p/vimwiki/issues . - - -============================================================================== -13. Developers *vimwiki-developers* - - - Maxim Kim - Original author. - - Mikhail Trishchenkov - Joined in at Dec 2009. - -Vimwiki's website: http://code.google.com/p/vimwiki/ -Vim plugins website: http://www.vim.org/scripts/script.php?script_id=2226 - -... afterword - -Many thanks to all of you for voting vimwiki up on www.vim.org. I do vimwiki -in my spare time I could use to dance argentine tango with beautiful women. -Your votes are kind of a good replacement. ;) - -Sincerely yours, -Maxim Kim. - - -============================================================================== -14. Changelog *vimwiki-changelog* - -1.1.1~ - * FIX: Issue 122: Dot character in vimwiki's directory path isn't escaped. - * FIX: Issue 123: Where is Vimwiki2HTML and other commands? Sometimes - filetype is not set up to vimwiki. - * FIX: Issue 124: Highlight group not found: Normal - -1.1~ - * NEW: Issue 57: Make it possible to have pre block inside list item. - * NEW: Issue 82: Add quick goto command. See |:VimwikiGoto|. - * NEW: Issue 83: Quick switch in diary. See |:VimwikiDiaryNextDay| and - |:VimwikiDiaryPrevDay| commands. - * FIX: Issue 84: Vimwiki rename removed the WikiWord display name. - * FIX: Issue 85: Errors if you have '~' subdirectory in a wiki directory. - * FIX: Issue 86: Existed links '[[WikiLink1|Alias1]] | [[WikiLink2]]' are - highlighted as a single link. - * FIX: Issue 88: Underline text. See |g:vimwiki_valid_html_tags|. - * FIX: Issue 92: Wikies in a subdir could be renamed to an empty file. - * FIX: Issue 93: Use alias name in html title. See |vimwiki-title|. - * FIX: Issue 94: Relative links to PHP files are broken. See - |g:vimwiki_file_exts| for details. - * FIX: Issue 96: Closing bracket at the end of weblink shouldn't be a part - of that link. - * FIX: Issue 97: Error opening weblink in a browser if it has # inside. - * FIX: Issue 99: Vim is not responding while opening arbitrary wiki file. - * FIX: Issue 100: Additional content on diary index page could be - corrupted. - * NEW: Issue 101: Customized HTML tags. See |g:vimwiki_valid_html_tags| - * NEW: Issue 102: Conceal feature usage. See |g:vimwiki_conceallevel|. - * FIX: Issue 103: Always highlight links to non-wiki files as existed. - * FIX: Issue 104: vimwiki#nested_syntax needs 'keepend' to avoid contained - language syntax eat needed '}}}'. - * FIX: Issue 105: on a todo list item with [ ] doesn't create new - todo list item. - * FIX: Issue 106: With MediaWiki syntax on a child todo list - item produce errors. - * FIX: Issue 107: With MediaWiki syntax on a list item creates - todo list item without space between * and [ ]. - * FIX: Issue 110: Syntax highlighting doesn't work for indented codeblock. - * FIX: Issue 115: Nested Perl syntax highlighting differs from regular - one. - * MISC: Many vimwiki commands were renamed from Vimwiki.*Word to - Vimwiki.*Link. VimwikiGoHome is renamed to VimwikiIndex, - VimwikiTabGoHome to VimwikiTabIndex. - * MISC: vimwiki-option-gohome is removed. - -1.0~ - * NEW: Issue 41: Table cell and column text objects. See - |vimwiki-text-objects|. - * NEW: Issue 42: Commands to move table columns left and right. See - |:VimwikiTableMoveColumnLeft| and |:VimwikiTableMoveColumnRight|. - * NEW: Issue 44: should move cursor to the previous table cell. - * NEW: Issue 45: It should be possible to indent tables. Indented tables - are centered in html. - * NEW: Issue 46: Do not htmlize some wiki pages (blacklist). New - placeholder is added: %nohtml. See |vimwiki-nohtml|. - * FIX: Issue 47: Lists aren't HTMLized properly. - * FIX: Issue 48: With autochdir it is impossible to have path_html such as - 'd:\vimwiki\html\' - * FIX: Issue 49: Table is not HTMLized properly at the end of wiki page. - * FIX: Issue 50: Inline formatting is not performed in table cells. - * FIX: Issue 51: Cannot insert '-' (minus) into table cells of the first - column. - * FIX: Issue 52: Table cell width is incorrect when double wide characters - are used (ie. Chinese). Check |g:vimwiki_CJK_length|. - * NEW: Issue 53: Wiki markup can not nested. (Use links and inline markup - in Headers). - * NEW: Issue 54: Highlight for placeholders. - * NEW: Issue 56: Directory indexes. See |g:vimwiki_dir_link| option and - |:VimwikiGenerateLinks| command. - * NEW: Issue 58: Html new lines with
. Could be inserted with - in insert mode. - * FIX: Issue 59: List item's text can't be started from *. - * NEW: Issue 60: Links inside completed gtd-items. - * NEW: Issue 61: Headers numbering. See |g:vimwiki_html_header_numbering| - and |g:vimwiki_html_header_numbering_sym| options. - * FIX: Issue 63: Table cannot have leading empty cells in html. - * FIX: Issue 65: Table separator is not htmlized right if on top of the - table. - * FIX: Issue 66: Table empty cells are very small in html. - * FIX: Issue 67: Wrong html conversion of multilined list item with bold - text on the start of next line. - * FIX: Issue 68: auto-indent problem with langmap. - * FIX: Issue 73: Link navigation by Tab. "Escaped" wiki-word should be - skipped for navigation with . - * FIX: Issue 75: `code` syntax doesn't display correctly in toc. - * FIX: Issue 77: Diary index only showing link to today's diary entry - file for extensions other than '.wiki'. - * FIX: Issue 79: Further calendar.vim integration -- add sign to calendar - date if it has corresponding diary page. - * FIX: Issue 80: Debian Lenny GUI Vim 7.2 has problems with toggling inner - todo list items. - * FIX: Issue 81: Don't convert WikiWord as a link in html when - `let g:vimwiki_camel_case = 0` - -0.9.9~ - * NEW: Diary. Help in making daily notes. See |vimwiki-diary|. Now you can - really easy add information into vimwiki that should be sorted out - later. - * NEW: Tables are redesigned. Syntax is changed. Now they are - auto-formattable. You can navigate them with and in insert - mode. See |vimwiki-syntax-tables| and |vimwiki-tables| for more details. - * NEW: Keyword STARTED: is added. - * NEW: Words TODO:, DONE:, STARTED:, XXX:, FIXME:, FIXED: are highlighed - inside headers. - * FIX: Export to html external links with 'file://' protocol. Ex: - [file:///home/user1/book.pdf my book]. - * FIX: Menu is corrupted if wiki's path contains spaces. - * FIX: Settings |wrap| and |linebreak| are removed from ftplugin. Add them - into your personal settings file `.vim/after/ftplugin/vimwiki.vim` if - needed. - * NEW: Headers are highlighted in different colors by default. - See |g:vimwiki_hl_headers| to turn it off. - * FIX: Issue 40: Links with russian subdirs don't work. - * NEW: It is now possible to generate HTML files automatically on page - save. See |vimwiki-option-auto_export|. - - -0.9.8~ - * NEW: Rename |g:vimwiki_fold_empty_lines| to - |g:vimwiki_fold_trailing_empty_lines|. - * NEW: One can use '-' along with '*' to start unordered list item. - * NEW: List items could be started from the first column. - As a result some limitations appeared: - - a space after *, - or # for a list item is mandatory. - - |g:vimwiki_fold_trailing_empty_lines| if set to 0 folds one trailing - empty line. - * NEW: Folding is off by default. Use |g:vimwiki_folding| to enable it. - * NEW: Speed up vimwiki's folding a bit. Should lag a bit less in a long - todo lists. - * NEW: Centered headers. Start header with at least one space to make it - html centered. - * NEW: Change in default css: header's colors. - * NEW: Vimwiki is aware of |GetLatestVimScripts| now. - * FIX: Use tag instead of custom in html. - * FIX: There are no text styling in htmlized quoted text. - * FIX: set default value of g:vimwiki_fold_lists to 0 as written in this - help. - * FIX: Issue 33: Folded list items have wrong indentation when 'tabs' are - used. - * FIX: Issue 34: vimwiki#subdir got wrong dir when VimwikiGet('path') is a - symbolic link. Thanks lilydjwg for the patch. - * FIX: Issue 28: todo-list auto-indent enhancement. New item should always - be unchecked. - * Issue 36: Change the name of the Search command to VimwikiSearch as it - conflicts with MultipleSearch. Alias :VWS is also available. - * NEW: You can generate 'Table of contents' of your wiki page. See - |vimwiki-toc| for details. - -0.9.701~ - * FIX: Issue 30: Highlighting doesn't work for checked list item. - -0.9.7~ - * NEW: Default checkbox symbols are changed to [ ], [.], [o], [O], [X]. - You can change them using |g:vimwiki_listsyms| variable. - * NEW: Color group names are renamed from wikiBold, wikiItalic, etc to - VimwikiBold, VimwikiItalic, etc. - * NEW: Open external links in a browser. There are default browsers - defined in |g:vimwiki_browsers| list. You can also redefine - |VimwikiWeblinkHandler| function to open weblinks in other programs. - * NEW: Issue 25: Toggle the states of multiple TODO list items at a time - (in VISUAL and in VISUAL LINE modes) - * NEW: Issue 26: Highlight code snippets in vimwiki's pre. See - |vimwiki-option-nested_syntaxes|. Thanks kriomant. - * NEW: Issue 27: Automatic garbage deletion from html directory. - * NEW: Save all open vimwiki buffers before export to html. - * NEW: Issue 29: Custom :Search command. - * NEW: Header text objects are now expandable in VISUAL mode. Tap 'vah' to - select a header. Tap again 'ah' to expand selection further. Thanks Andy - Wokula. - * FIX: Folding settings are reset to vim defaults in a new tab (think of - \wt) so you cannot hide things in folds. - * FIX: https links in form of [https://hello.world.com] are not exported - into html. Thanks Saurabh Sarpal for the patch. - -0.9.6~ - * NEW: You can have multiline list items. See |vimwiki-syntax-lists|. - * NEW: You can ignore newlines in multiline list items when do export to - html. See |g:vimwiki_list_ignore_newline| option. - * NEW: Different checkbox symbols [.], [:], [o] are added. See - |vimwiki-todo-lists|. - * NEW: Now there is no longer syntax of preformatted text that is started - by a whitespace. - * NEW: Blockquotes. See |vimwiki-syntax-blockquote|. - * NEW: Per wiki folding option (vimwiki-option-folding) is removed. Global - |g:vimwiki_folding| and |g:vimwiki_fold_lists| are added. - * NEW: Due to being quite slow folding of list items is off by default. - Use |g:vimwiki_fold_lists| to turn it on. - * NEW: If you want replace some symbols in a wikifilename use - |g:vimwiki_badsyms| option (Andreas Baldeau). - * FIX: Command |:VimwikiToggleListItem| doesn't work for one of the two - wikies opened at the same time with different syntaxes. - * FIX: Command |:VimwikiToggleListItem| do not switch parent checkboxes if - there are non-checkbox list items available. - * FIX: Issue 24: Link error in html when write [[one.two.three]]. - * FIX: Rename WikiWord to something with a colon (:) does nasty things. - * FIX: Command |:VimwikiToggleListItem| do not switch right if there are - list items without checkboxes in the list. - -0.9.5~ - * NEW: Added |g:vimwiki_global_ext| to control creation of temporary - wikies in dirs that are not listed in |g:vimwiki_list|. - * NEW: Added |g:vimwiki_hl_headers| to highlight headers with different - predefined colors. - * NEW: Checked [X] items are not highlighted with Comment syntax group by - default. Use |g:vimwiki_hl_cb_checked| to turn it on. - * NEW: Added new syntax for links: [[link address][link description]]. - * NEW: Added allias of mapping for *nix systems. - * NEW: Added |g:vimwiki_camel_case|. Set it to 0 if you do not want - CamelCased WikiWords to be linkified. - * FIX: Links with g:vimwiki_stripsym (default '_') [[My_Link|Text]] are - not highlighted when created. - * FIX: indent/vimwiki.vim is obsolete. If you upgrade from previous - versions remove it. It causes wrong list indentation if noexpandtab is - set. - * FIX: If tabs and spaces are used to indent list items html export gives - error. Thanks Klaus Ethgen for report. - * FIX: Some html export fixes. - -0.9.4~ - * NEW: Links with directories: [[dir1/dir2/Link|Text]]. Thanks Jie Wu. - * NEW: Added %root_path% template variable to get relative root dir of - path_html. See |vimwiki-option-html_header|. - * FIX: Indent is incorrect for vim without "float" compile option. Thanks - Julian Kooij. - * FIX: Convert to html doesn't work right with links like [[foo::bar]]. - * FIX: Rename wikiword doesn't work right when rename WikiWord to - [[WikiWord blablabla]]. - * FIX: Renaming of links with description doesn't work. - * FIX: Weblinks with commas are not highlighted. - * MISC: Some changes in default css file. - -0.9.3~ - * NEW: g:vimwiki_menu option is a string which is menu path. So one can - use let g:vimwiki_menu = 'Plugin.Vimwiki' to set the menu to the right - place. - * NEW: g:vimwiki_fold_empty_lines -- don't or do fold in empty lines - between headers. See |g:vimwiki_fold_empty_lines| - * FIX: Encoding error when running vimwiki in Windows XP Japanese. - Thanks KarasAya. - -0.9.2c~ - * FIX: Regression: Export HTML link error with [[Link|Text]]. - -0.9.2b~ - * FIX: Installation on Linux doesn't work. (Dos line endings in Vimball - archive file). - * FIX: Clear out FlexWiki ftplugin's setup. Now you don't have to hack - filetype.vim to get rid of unexpected ':setlocal bomb' from FlexWiki's - ftplugin. - * FIX: When write done: it will show another done: in html file. - -0.9.2a~ - * FIX: Installation on Linux doesn't work. (Dos line endings in - autoload/vimwiki_lst.vim and indent/vimwiki.vim). - -0.9.2~ - * NEW: Option 'folding' added to turn folding on/off. - * NEW: Header text object. See |vimwiki-text-objects|. - * NEW: Add/remove Header levels with '=' and '-'. See |vimwiki_=|. - * NEW: Vimwiki GUI menu to select available wikies. See |g:vimwiki_menu|. - * NEW: You can specify the name of your css file now. See - |vimwiki-option-css_name| - * NEW: You can add styles to image links, see |vimwiki-syntax-links|. - * FIX: History doesn't work after |VimwikiRenameWord|. - * FIX: Some of wikipedia links are not correctly highlighted. Links with - parentheses. - * MISC: Renamed vimwiki_gtd to vimwiki_lst. - -0.9.1~ - * NEW: HTML Table cell text alignment, see |vimwiki-syntax-tables| - * NEW: Wikipage history simplified. Each vimwiki buffer now holds - b:vimwiki_prev_word which is list of [PrevWord, getpos()]. - * NEW: If highlight for groups wikiHeader1..wikiHeader6 exist (defined in - a colorscheme) -- use it. Otherwise use Title highlight for all Headers. - * FIX: Warn only once if 'html_header' or 'html_footer' does not exist. - * FIX: Wrong folding for the text after the last nested list item. - * FIX: Bold and Italic aren't highlighted in tables without spaces - between || and * or _. ||*bold*||_asdf_ || (Thanks Brett Stahlman) - -0.9.0~ - * NEW: You can add classes to 'pre' tag -- |vimwiki-syntax-preformatted|. - This might be useful for coloring some programming code with external js - tools like google syntax highlighter. - * NEW: !WikiPage is not highlighted. It is just a plain word WikiPage in - HTML, without exclamation mark - * NEW: Definition lists, see |vimwiki-syntax-lists|. - * NEW: New implementation of |:VimwikiRenameWord|. CAUTION: It was tested - on 2 computers only, backup your wiki before use it. Email me if it - doesn't work for you. - * FIX: Less than 3 symbols are not highlighted in Bold and Italic. - * FIX: Added vimwiki autocmd group to avoid clashes with user defined - autocmds. - * FIX: Pressing ESC while |:VimwikiUISelect| opens current wiki index - file. Should cancel wiki selection. - -0.8.3~ - * NEW: on a list item creates checkbox. - * FIX: With * in the first column, shouldn't insert more * (default - syntax). - * FIX: With MediaWiki's ** [ ], should insert it on the next line. - * FIX: HTML export should use 'fileencoding' instead of 'encoding'. - * FIX: Code cleanup. - -0.8.2~ - * DEL: Removed google syntax file. - * NEW: Default vimwiki syntax is a subset of google's one. Header's has - been changed from !Header to =Header=. It is easier to maintain only 2 - syntaxes. See |vimwiki-syntax-headers|. - * NEW: Multiline paragraphs -- less longlines. - * NEW: Comments. See |vimwiki-syntax-comments|. - * DEL: Removed setlocal textwidth = 0 from ftplugin. - * FIX: New regexps for bold, italic, bolditalic. - * FIX: The last item in List sometimes fold-in incorrectly. - * FIX: Minor tweaks on default css. - -0.8.1~ - * NEW: Vimwiki's foldmethod changed from syntax to expr. Foldtext is - changed to be nicer with folded list items. - * NEW: Fold/outline list items. - * NEW: It is possible now to edit wiki files in arbitrary directories - which is not in g:vimwiki_list's paths. New WikiWords are created in the - path of the current WikiWord. - * NEW: User can remap Vimwiki's built in mappings. - * NEW: Added |g:vimwiki_use_mouse|. It is off by default. - * FIX: Removed mapping. - -0.8.0~ - * NEW: Multiple wikies support. A lot of options have been changed, see - |vimwiki-options| - * NEW: Auto create directories. - * NEW: Checked list item highlighted as comment. - * FIX: Multiple 'set ft=vimwiki' for each buffer disabled. Vimwiki should - load its buffers a bit faster now. - -0.7.1~ - * NEW: VimwikiToggleListItem added to be able to remap to - anything user prefers more. - * FIX: Toggleable list items do not work with MediaWiki markup. - * FIX: Changing g:vimwiki_home_html to path with ~ while vimwiki is - loaded gives errors for HTML export. - * DEL: Command :VimwikiExploreHome. - -0.7.0~ - * NEW: GTD stuff -- toggleable list items. See |vimwiki-todo-lists|. - * FIX: Headers do not fold inner headers. (Thanks Brett Stahlman) - * FIX: Remove last blank lines from preformatted text at the end of file. - * DEL: Removed g:vimwiki_smartCR option. - -0.6.2~ - * NEW: [[link|description]] is available now. - * FIX: Barebone links (ie: http://bla-bla-bla.org/h.pl?id=98) get extra - escaping of ? and friends so they become invalid in HTML. - * FIX: In linux going to [[wiki with whitespaces]] and then pressing BS - to go back to prev wikipage produce error. (Thanks Brendon Bensel for - the fix) - * FIX: Remove setlocal encoding and fileformat from vimwiki ftplugin. - * FIX: Some tweaks on default style.css - -0.6.1~ - * FIX: [blablabla bla] shouldn't be converted to a link. - * FIX: Remove extra annoing empty strings from PRE tag made from - whitespaces in HTML export. - * FIX: Moved functions related to HTML converting to new autoload module - to increase a bit vimwiki startup time. - -0.6~ - * NEW: Header and footer templates. See|g:vimwiki_html_header| and - |g:vimwiki_html_footer|. - * FIX: |:Vimwiki2HTML| does not recognize ~ as part of a valid path. - -0.5.3~ - * FIX: Fixed |:VimwikiRenameWord|. Error when g:vimwiki_home had - whitespaces in path. - * FIX: |:VimwikiSplitWord| and |:VimwikiVSplitWord| didn't work. - -0.5.2~ - * NEW: Added |:VimwikiGoHome|, |:VimwikiTabGoHome| and - |:VimwikiExploreHome| commands. - * NEW: Added wt mapping to open vimwiki index file in a new tab. - * NEW: Added g:vimwiki_gohome option that controls how|:VimwikiGoHome| - works when current buffer is changed. (Thanks Timur Zaripov) - * FIX: Fixed |:VimwikiRenameWord|. Very bad behaviour when autochdir - isn't set up. - * FIX: Fixed commands :Wiki2HTML and :WikiAll2HTML to be available only - for vimwiki buffers. - * FIX: Renamed :Wiki2HTML and :WikiAll2HTML to |:Vimwiki2HTML| and - |:VimwikiAll2HTML| commands. - * FIX: Help file corrections. - -0.5.1~ - * NEW: This help is created. - * NEW: Now you can fold headers. - * NEW: VimwikiGoHome and VimwikiExploreHome were added. - * FIX: Bug with {{{HelloWikiWord}}} export to HTML is fixed. - * DEL: Sync option removed from: Syntax highlighting for preformatted - text {{{ }}}. - -0.5~ - * NEW: vimwiki default markup to HTML conversion improved. - * NEW: Added basic GoogleWiki and MediaWiki markup languages. - * NEW: Chinese [[complex wiki words]]. - -0.4~ - * NEW: vimwiki=>HTML converter in plain Vim language. - * NEW: Plugin autoload. - -0.3.4~ - * FIX: Backup files (.wiki~) caused a bunch of errors while opening wiki - files. - -0.3.3~ - * FIX: [[wiki word with dots at the end...]] didn't work. - * NEW: Added error handling for delete wiki word function. - * NEW: Added keybindings o and O for list items when g:vimwiki_smartCR=1. - * NEW: Added keybinding wh to visit wiki home directory. - -0.3.2~ - * FIX: Renaming -- error if complex wiki word contains %. - * FIX: Syntax highlighting for preformatted text {{{ }}}. Sync option - added. - * FIX: smartCR bug fix. - -0.3.1~ - * FIX: Renaming -- [[hello world?]] to [[hello? world]] links are not - updated. - * FIX: Buffers menu is a bit awkward after renaming. - * NEW: Use mouse to follow links. Left double-click to follow WikiWord, - Rightclick then Leftclick to go back. - -0.3~ - * NEW: Highlight non-existent WikiWords. - * NEW: Delete current WikiWord (wd). - * NEW: g:vimwiki_smartCR=2 => use Vim comments (see :h comments :h - formatoptions) feature to deal with list items. (thx -- Dmitry - Alexandrov) - * NEW: Highlight TODO:, DONE:, FIXED:, FIXME:. - * NEW: Rename current WikiWord -- be careful on Windows you cannot rename - wikiword to WikiWord. After renaming update all links to that renamed - WikiWord. - * FIX: Bug -- do not duplicate WikiWords in wiki history. - * FIX: After renaming [[wiki word]] twice buffers are not deleted. - * FIX: Renaming from [[wiki word]] to WikiWord result is [[WikiWord]] - * FIX: More than one complex words on one line is bugging each other when - try go to one of them. [[bla bla bla]] [[dodo dodo dodo]] becomes bla - bla bla]] [[dodo dodo dodo. - - -0.2.2~ - * NEW: Added keybinding -- split WikiWord - * NEW: Added keybinding -- vertical split WikiWord - -0.2.1~ - * NEW: Install on Linux now works. - -0.2~ - * NEW: Added part of Google's Wiki syntax. - * NEW: Added auto insert # with ENTER. - * NEW: On/Off auto insert bullet with ENTER. - * NEW: Strip [[complex wiki name]] from symbols that cannot be used in - file names. - * NEW: Links to non-wiki files. Non wiki files are files with extensions - ie [[hello world.txt]] or [[my homesite.html]] - -0.1~ - * First public version. - -============================================================================== -15. License *vimwiki-license* - -The MIT Licence -http://www.opensource.org/licenses/mit-license.php - -Copyright (c) 2008-2010 Maxim Kim - -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 diff --git a/dot.vim/doc/vjde.txt b/dot.vim/doc/vjde.txt deleted file mode 100644 index b76eb63..0000000 --- a/dot.vim/doc/vjde.txt +++ /dev/null @@ -1,871 +0,0 @@ -*vjde.txt* Plugging for Java/? language - For Vim version 7.0 - *vjde* - - Comments: - - Description |vjde-desc| - Install |vjde-install| - VJDE project |vjde-project| - search auto-completion |vjde-auto-comp| - java |vjde-java| - cpp |vcde| - ruby |vjde-ruby| - java |vjde-java-pkg| - jsp |vjde-jsp| - taglib |vjde-taglib| - xslt |vjde-xsl| - html |vjde-html| - xml |vjde-xml| - xdoclet |vjde-xdoclet| - javadoc |vjde-javadoc| - iabbr |vjde-iabbr| - document viewer |vjde-doc| - Preview window |vjde-preview| - Re factor tools |vjde-refactor| - extract local variable |vjde-rft-local| - extract member variable |vjde-rft-field| - extract argument |vjde-rft-arg| - extract constance |vjde-rft-const| - quick fix tools |vjde-fix-tools| - surround by try/catch |vjde-fix-ex| - add throws |vjde-fix-th| - Add import |vjde-fix-im| - Code tools |vjde-code| - override methods |vjde-override| - implements methods |vjde-implements| - sort imports |vjde-import-sort| - extract imports |vjde-import-extract| - wizard |vjde-wizard| - template define |vjde-template| - search definition |vjde-define| - goto definition |vjde-goto| - to-do list view |vjde-tasklist| - VJDE usefull command list |vjde-command| - VJDE variable |vjde-variable| - VJDE to-do list |vjde-todolist| - VJDE Q&A |vjde-qa| - - *vjde-desc* -Desc~ -Now , C++ supported with ruby and ctags. See |vcde| for detail. -Now , Csharp supported . - -This tools wich is named "Vim Java Development Environment". -Current version, has two tools : Project and Auto Completion -Auto completion is available to :java ,jsp, taglib , html - -Show Auto Completion in Preview window , and select or input in the -Preview window, is map to show doc of current In Preview window. -See |vjde_javadoc_path| for how to setup a java document path to be shown in -the preview window. - -Require : ruby , rexml for ruby - -the future list is: - -Some plug-in is already used for Vim JDE~ -a. Project File Plug-in already -b. match it -c. auto import ok -d. getter setter ok -e. compiler - -I will do:~ - -1. Project management ok -2. Auto completion ok -3. Template ok -4. Extend tool -5. Implementing tool ok -6. Getter/Setter ok -7. To-do List ok, but don't committed - - - *vjde-install* -Install~ - For Windows , for the document viewer , must copy plugin/vjde/wspawn.exe -to you path, such as JAVA_HOME/bin ... - *vjde-project* -Project~ -Project tools is used to save the VJDE variables, while you -change your variable,some command is useful to save and restore -the current settings. - -Of course, you can add variable settings on the vimrc or anywhere -the vim can be found. - -Load project - > - :Vjdeload filename - - :Vjdeas filename - - :Vjdesave -< - -Auto completion ~ - *vjde-auto-comp* -For c++ or other ctags supported language , see |vcde| -Setup custom completion function > - :set cfu=VjdeCompletionFun -< -Setup classpath variable: > - :let g:vjde_lib_path="lib/j2ee.jar:lib/struts.jar:build/classes" -< - *vjde-java* -Once you input something like : > - String str; - str.to-X-U - System.out.println(str.to-X-U - System.out.println(str.toUpperCase().-X-U - return str.to-X-U - new str.to-X-U - ... [operator] str.to-X-U - ... = str.to-X-U -< -Package completion~ - *vjde-java-pkg* -Completion for package and classes: > - import java.-X-U - applet awt... - import java.util.-X-U - Abstract... -< -In source Code : > - java.util.-x-u - Abstract.. -< - -Jsp file completion~ - *vjde-jsp* -the same as for jsp files > - <%! - str.to-x-u - %> - <% - str.to-x-u - %> - <%= session.get-x-u %> -< - -Taglib completion ~ - *vjde-taglib* -I add the taglib completion for jsp developer. -Just now, completion with tld use xml-completion of |ft-xml-omni|. - -For Example , I want to use completion for the following: > - -X-U - out forEach... - -X-U - out - -X-U - value default .... - -x-u - include useBean .... - -< - -At first , I had use this command : > - :XMLns stl_c c -< See |XMLns| for detail of this command. -I had generate xmldata for STL taglib, use the following name: > - stl_c - stl_sql - stl_fn - stl_fmt - stl_x -< -You had to use you own prefix , For example , your coding is: > - <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -< You should use following command: > - :XMLns stl_sql sql -< -To generate your own taglib from the tld file , You can use the following -command. > - :VjdeTld2Data -< TLD file is your own TLD file. Name is used to identify your xmldata. See -|xml-omni-datafile| for Detail. I will generate the file at -$VJDE/autoload/xml/.vim . -NOTE: This function is |ruby| required. - *vjde-html* -Html auto completion :~ -use it like: > - <-x-u - % %= .... - -x-u - bgcolor fgcolor.... - -x-u - aqua antiquewhit .... - - :VjdeDtd2Data -< -See |vjde-xmldata| for detail. -Note: This function is |ruby| required. -Xdoclet completion~ - *vjde-xdoclet* *vjde-javadoc* -Xdoclet completion is used for xdoclet. -While coding comment ,use : > - /** - * @-x-u - author param return ... hibernate.class hibernate.subclass... - * @hibernate.class -x-u - lazy ... - * @hibernate.class lazy="-x-u - true" false" -< -Default , xdoclet support javadoc only. -Add you own part , such as ejb.* ,hibernate.* to > - ~/.vim/vjde/xdoclet.def -< -while the xdoclet is enabled , automatically load the define from > - ~/.vim/vjde/xdoclet.def -< - -file format is simple , line which is started / or * is treated as comment. > - [private|public] enum BOOLEAN { - value1,value2 - } - public tag tagname < tagparent1,parent2 { - attr [ATTRTYPE] attr1; - attr attr2 { - value1,value2 - } - attr BOOLEAN attr3; - .... - } -< - - Note: once you change the xdoclet.def , backup is need for next time . -Update VJDE will recover it. - - *vjde-doc* -Document viewer~ - When you preview your code completion in a gui window, for some -delays, the document of this function or member will be shown. - It's depends on : - g:vjde_javadoc_path '/javadocs/api/' - g:vjde_doc_gui_height height of the window - g:vjde_doc_gui_width width of the window - g:vjde_doc_delay once a item selected ,delay how long. - (1/1000 seconds) default 2000 - See |vjde-variable| - *vjde-iabbr* -Iabbr~ - Iabbr is some codelet,just something like : - a while block, a for block ... - use to invoke this tools on gui running - - For example ,to use ruby with Iabbr - - Install your own iabbr as ~/.vim/vjde/ruby.iab - setup g:vjde_iab_exts='rb' - - so , for your ruby file which is used '.rb' as the extend - - Iabbr define file is |vjde-template|, and use the first '|' as the -cursor position. - -Refactor~ - Note:Use g:vjde_utils_setup=0 to avoid command definition - - *vjde-preview* -Vjde Preview window~ - VJDE Preview window is a tool for preview in a gui tools for -selection. - I had Use this window to preview the VJDE completion and code template -. - In Java , html , It's use the completion cfu |cfu| to generate lines -to use. It's used like: -NOTE: - Preview.name ~ - name of the previewer , must equals the variable name; - Preview.preview_buffer ~ - The buffer to be shown, It's the first line is -a description of content , like > - java.lang.System: -< -or > - java.lang.System:c - element->: - body->attributes: - bgground->values: -< - Each line of the preview_buffer, the first word ( It's separated by a -space) is the type of the tag, the second word ( It's separated by ';' or '(') -it the tag name. All the other is trusted as comment. For example > - java.io.PrintStream in; - boolean equals(java.lang.Object); - ... - element body; - element html; - .... -< - previewer.onSelect ~ - is called when use select a word in preview window. - Both GUI or Console preview are. It's has a parameter - which is the user selected word. - previewer.previewLinesFun ~ - It's be called with a parameter - which is previewer self. like > - call previewer.PreviewLinesFun(self) -< - previewer.docLineFun ~ - This function it's called to get the document preview window -line. It's would return a String , which is comma separated. like > - 400;300;2000;java -cp vjde.jar vjde.completion.Document - /mnt/win_e/downloads/docs/api/ src -< - It's used as : - doc width ; doc height ; delay mills;command line to get document - I will add preview.preview_buffer[0] and the -user selected tag name at the end of command line , and call it , trust the -stdout as the document which to be shown. - - previewer.CFU ~ - At first , It's call the |cfu| function to complete code -complation. - Then , call previewer.previewLinesFun to get buffer would be -shown. - Third , call preview.docLineFun get the docment define line - Third, call the previewer.Preview to preview. - - Four , call preview.onSelect to handle the user input. - - NOTE:See vjde_preview.vim for detail. -> - - let java_previewer = VjdePreviewWindow_New() - let java_previewer.name = 'java_previewer' - let java_previewer.onSelect='VjdeInsertWord' - let java_previewer.previewLinesFun='GetJavaCompletionLines' - let java_previewer.docLineFun='VjdeGetDocWindowLine' - - - au BufNewFile,BufRead,BufEnter *.java imap :call java_previewer.CFU('',1)a -< - NOTE:you can put you preview content to preview buffer > - call add(previewer.preview_buffer,'line1'); -< - - - Used for the code template: > - - let g:iab_previewer = VjdePreviewWindow_New() - let g:iab_previewer.name='iab_previewer' - let g:iab_previewer.onSelect='VjdePreviewIabSelect' - let g:iab_previewer.previewLinesFun='' - ... - ... - call g:iab_previewer.Preview(0) -< - See vjde_java_iab.vim for detail. - *vjde-refactor* -Variable refactoring~ -normal mode: - put your cursor on the variable , use the following command - *vjde-rft-field* -> - rf -< change current variable to member field. - *vjde-rft-local* -> - rl -< change current variable as local variable. - *vjde-rft-arg* -> - rp -< Add current variable as argument of method. - - *vjde-rft-const* -Visula mode , a variable is selected ,only support -String , char ,int ,long,double - select a number or a quoited String , > - rc -Make the current symbol as a private final static variable. - *vjde-fix-tools* -Vjde fix tools~ -Fix tools is used for fix some minimal compile bugs. Now , -unreported exception is supported - *vjde-fix-ex* -Vjde Exception fix is used for fix uncatched exception compile error -For example > - java.net.URLConnection con= new java.net.URL("").openConnection(); -< -Once compile the code of above, two exception is not catched. > - :cc " move the cusor to current error line - ff -< - this line is change to : > - try { - java.net.URLConnection con ... - } - catch(UN... e1) { - } - catch(IOExce.. e5) { - } -< -It's a simple and useful tools. - - *vjde-fix-th* -This tools is fix unreported exception to function declaration,use throws on -function to generate code . - - *vjde-fix-im* -Automatically add import for Word under cursor. > - ai -< - - -See |quickfix| for more compile support. - - - *vjde-code* -Code tools~ -This tools for code generation . - *vjde-override* -Override the parents method. -I the class , execute : > - :call Vjde_override(0) -< -list the class method , select the index of method, separated by comma or -space , then ,the code will generated on the end of class definition. - - *vjde-implements* -Implements the methods of implements . > - :call Vjde_override(1) - oe -> -list the class method , select the index of method, separated by comma or -space , then ,the code will generated on the end of class definition. - - *vjde-import-sort* -to sort the file imports lines , select the lines of import statement. > - :call Vjde_sort_import() - js -< -or > - :[range]call Vjde_sort_import() -< -the lines : > - import java.awt.*; - import com.abc.*; - import javax.applet.*; - import java.io.*; - import org.apache.*; -< -change to : > - import java.awt.*; - import java.io.*; - - import javax.applet.*; - - import org.apache.*; - - import com.abc.* -< - -Extract import~ - *vjde-import-extract* -This is a simple import tool. It's used to extract a import to define. -For example , a line: > - javax.servlet.http.HttpSession session = reqeust..... -< -put the cursor on the work "HttpSession" , use a key > - je -< -the javax.servlet.http.HttpSession would be imported, > - import javax.servlet.http.HttpSession; -< -and this line become: > - - HttpSession session = request.... -< - - *vjde-wizard* -Wizard ~ -Wizard is a tool template tools. -It's generated from a definition file and used by any language. -Default template file: -Note:$VIM/vimfiles/plugin/vjde/tlds/java.vjde -Everyone can define a new template and use it. -Wizard engines generate any lines from the template. > -< Generate a class > - :VjdeNclass -< Generate a class with a main > - :VjdeNmain -< Generate a interface > - :VjdeNinte -< Generate a property > - :VjdeNprop -< - *vjde-template* -Template file~ - Template can be defined by you self. -this is a simple description for template file. -a template is started by the following commands -Define a template~ -Definition a template started(^:the line of started): > - template {templatename} [;template desc] -< -Definition a parameter used by template( in a template , would zero or more > - parameter {parametername} [;parameter desc] -< -Definition a body of template ( followed by any text : > - body -< -End of a template > - endtemplate -< -Note:All of these worlds (template|temp , parameter|para , body, endtemplate|endt) -must at the beginning of a line. -Note: [;template desc] [;parameter desc] must started with a ';' - -Template comment ~ -the line is started with a '/' is comment : > - //this is a comment - /this is a comment too -< -Would be ignored -And , the line which is started with '\' will be handled: - remove the '\', leave all the following : > - \//abc -< treated as '//abc' , is not a comment ; > - \body - - %AnthorTemplateName% -< Just like the entity of xml. -Well find the Template which named by "AnthorTemplateName" , and -insert the text of that template here. - -Template Variable ~ - Template variable once defined , can be used in template body. > - %{variablename} - - %{Time.now} -< Can be a ruby command can be resolved by ruby eval() function. -Once you have to have the String like : > - %{notbetreatedasabove} -< -Can be writed as the following : > - %{"%"}{notbetreatedasabove} -< - -Note See $VIM/vimfiles/plugin/vjde/tlds/java.vjde , template JUnitCase for - a powerfull ussage. - *Vjdeinfo* *vjde-define* -Search Definition~ -This tool is used to find a variable info or function define. -For example (both java and jsp file is available): -Show class information > - System.out.println(.... - ^ place sursor here ,then execute: - :Vjdei - the constructor,fields,methods, and inner class will be echoed. -< -Show information of fields > - System.out.println(.... - ^ place cursor here, then execute: - :Vjdei - the field which is called "out" would be echoed. like: - class : java.lang.System - java.io.PrintWriter out; -< -Show information of methods > - System.out.println(.... - ^ cursor here - the method which name is started with "println" will be echoed. - like: - class : java.io.PrintWriter - public void print(bool); - public void print(int); - ..... - would be printed -< -Show information of taglibs -for a tag definition > - \nout\n..... -< -For a tag attribute definition > - \nvalue\n..... - -< - - *Vjdegd* *vjde-goto* -Goto Declaration ~ - Goto the declaration of current works under cursor. It's search the -path for all source and goto the method or fields declaration. > - :Vjdegd -< - - *vjde-tasklist* -We can find something like "//TODO Add something here" is a task list; -This tool is used to search task in a file quickly. -Just a command: > - :TDlist -< - - - *vjde-command* -command for normal mode: -\ai - Add import under cursor -\oe - extend some methods of class -\oi - implements some interface of current class -\fr - fix compiler errors with throws statement. -\ft - fix compiler errors with try-catch statement -\jc - generate constructor of class with all members. -\jt - surround line with try-catch statement -\jd - read the document of symbol that under cursor. -\jg - generate getter-setter of current member. -\je - add import for current line,it used for this line > - java.io.PrintWriter -> -would add import statement and change this line to > - PrintWriter -< - -\ep - change current variable to function parameters. -\em - chnage current variable to member of class. - -command for visul mode: -\js - sort the selected import statement. -\jt - surround the selected lines with try-catch statement. -\en - change the selected to a static const defination. - - *vjde-variable* -Note:the define like : > - g:vjde_show_paras [0|1] -< -is indicate: the global variable g:vjde_show_paras accept two values , 0 or 1. -the first is the default value. - *vjde_use_window* -g:vjde_use_window [1|0] -sometimes , you want to show some infomation , for example, the document of -a method. your can use normal command > - \jd -< -to show the document the symbol under cursor. Just support for java -method,member. this function is dependented on g:vjde_javadoc_path - *vjde_show_paras* -g:vjde_show_paras [0|1] - while the auto completion is called, the parameter info display or -not. - *vjde_lib_path* -g:vjde_lib_path - the class search path form auto completion. - *vjde_out_path* -g:vjde_out_path - the output path for compile - *vjde_src_path* -g:vjde_src_path - the src path for code template - - *vjde_web_app* -g:vjde_web_app - not used , - *vjde_autoload_stl* -g:vjde_autoload_stl [1|0] - load the Standard Tag libray on startup - *vjde_autoload_taglib* -g:vjde_autoload_taglib [1|0] - load the Tag libray on startup - *g:vjde_taglib_uri* -g:vjde_taglib_uri - a dictory for relation-ship of xml-datafile and taglib uri. > - g:vjde_taglib_uri={'http://java.sun.com/jsp/jstl/core' : 'stl_c' , - 'http://java.sun.com/jsp/jstl/sql' : 'stl_sql' } -< - when this relation is exists, once you used taglib in your file : > - <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%> -< - when your input like : > - -< - I whill call > - :XMLns stl_c c -< - so , autocompletion will do for you. - - *vjde_auto_mark* -g:vjde_auto_mark [1|0] - Once Goto the declaration, see |Vjdegd|,mark current as J - - *vjde_xml_advance* -g:vjde_xml_advance [1|0] - While completion for xml, search the dtd exactly for the children -elements or all elements. - - *vjde_show_preview* -g:vjde_show_preview[1|0] - While Completion for java , split a preview window to show the full -information or not. - - *vjde_cfu_java_dot* -g:vjde_cfu_java_dot [1|0] - setup auto command for "."(dot) or not . if ture while . is typed , show all of the completion in a preview window. - - *vjde_cfu_java_para* -g:vjde_cfu_java_para [0|1] - setup auto command for "(" or not . if true, while ( is typed, show all -override function and parameter types and throws in a preview window. - - *vjde_javadoc_path* -g:vjde_javadoc_path - setup the javadoc path, must be 'd:\javadocs\api\' , end with a -splash, and reference to the api document path. - *vjde_doc_gui_height* -g:vjde_doc_gui_height - document viewer height - - *vjde_doc_gui_width* -g:vjde_doc_gui_width - document viewer width - -g:vjde_doc_delay - timemillis to delay. - -g:vjde_preview_gui [0|1] - setup the preview for gui. - Note:gtk+2.0 runtime is required. - -g:vjde_preview_gui_width [350] - preview width for the gui window - -g:vjde_preview_gui_height [170] - preview height for the gui window - -g:vjde_use_project [0|1] - use project.vim as the project file manager. > - if g:vjde_use_project && !exist(':Project') - runtime plugin/vjde/project.vim - endif -< -While a vjde project is loaded , the project file manager is enabled > - if filereadable('.prj') && exists(':Project') - exec 'Project .prj' - endif - -< -g:vjde_completion_key - Completion key for user completion. > - if has('gui_running') - let g:vjde_completion_key='' - else - let g:vjde_completion_key='' - endif -< -g:vjde_iab_exts - This variable is used for iab tools. All the extension is add can use - to completion for code template. > - let g:vjde_iab_exts='cpp;h;c;hpp' -< -g:vjde_java_symbol - For fix tool to find a message.You can change it to your own local: > - if !exists('g:vjde_java_symbol') - let g:vjde_java_symbol= 'cannot find symbol\nsymbol\s*: class \([^ \t;\s]*\)\n' - endif -< -g:vjde_java_exception - For fix tool to find a exception message : > - if !exists('g:vjde_java_exception') - let g:vjde_java_exception = '\(unreported exception \)\([^ \t;]*\);' - endif -< -g:vjde_cs_libs - For completion with csharp, use this parameter, looks like > - let g:vjde_cs_libs='d:/mono-1.1.13.4/lib/mono/2.0/mscorlib.dll;..' -< -g:vjde_cs_cmd - For command line of csharp , looks like: > - let g:vjde_cs_cmd='mono.exe d:/vim/vimfiles/plugin/vjde/CSParser.exe' -< - Default value is : > - let g:vjde_cs_cmd='mono.exe '.g:vjde_install_path.'/vjde/CSParser.exe' -< -ruby - $java_command - the java command line, linux, is tested for "java", - for MS windows , "javaw" is recommend - $vjde_java_cfu - $vjde_java_cfu.found_class - the java completion function implements. It's contain -the last class which is be searched. - - - *vjde-todolist* -1. template - such as , new class , new interface,new ejb.... OK. -2. extends and implements - select a class and extend or implement it. OK. -3. some other tools - getter/setter generator OK. - auto import OK. - auto documention - - *vjde-qa* -Note: Most of setting is auto command enabled . -see vjde.vim for detail. - - Q1. I had install this plugin, but , when I use -x-u, it said, not -found, why? - A1. Check your |cfu| settings. "VjdeCompletionFun" is expected. - - Q2. I had used this tool for a java code completion, but I can't use it for jsp, -why? - A2. Check your g:vjde_lib_path settings.The j2ee.jar or another is -include. like: > - let g:vjde_lib_path="/home/me/lib/j2ee.jar:build/classes" -< - Q3. I am MS Windows user, while I use -x-u, a command window is -occurred, how to avoid it? - A3. You must use "javaw" instead of "java", use this command: > - ruby $java_command="javaw" -< - Q4. I am MS Windows user, I can't see the document , although the -g:vjde_javadoc_path is correctly. - A3. Confirm the wspawn.exe is run enable from you command window. - - for 2.00.01 later version. use this command: > - let g:vjde_java_command='javaw' -< - - - -=============================================================== - vim:ts=8 sw=8 noexpandtab tw=78 ft=help: diff --git a/dot.vim/doc/zencoding.txt b/dot.vim/doc/zencoding.txt deleted file mode 100644 index 14eb904..0000000 --- a/dot.vim/doc/zencoding.txt +++ /dev/null @@ -1,383 +0,0 @@ -*zencoding.txt* ZenCoding for Vim - - ------------------------------------------------------- - ZenCoding: vim plugins for HTML and CSS hi-speed coding - ------------------------------------------------------- - -Author: Yasuhiro Matsumoto -WebSite: http://mattn.kaoriya.net/ -Repository: http://github.com/mattn/zencoding-vim -Site: http://mattn.github.com/zencoding-vim -License: BSD style license - -============================================================================== -CONTENTS *zencoding-contents* - -Introduction |zencoding-introduction| -Install |zencoding-install| -Tutorial |zencoding-tutorial| - 1. Expand Abbreviation |zencoding-expandabbr| - 2. Wrap with Abbreviation |zencoding-wrap-wtih-abbreviation| - 3. Balance Tag Inward |zencoding-balance-tag-inward| - 4. Balance Tag Outward |zencoding-balance-tag-outward| - 5. Go to Next Edit Point |zencoding-goto-next-point| |n| - 6. Go to Previous Edit Point |zencoding-goto-previous-point| - 7. Update Size |zencoding-update-image-size| - 8. Merge Lines |zencoding-merge-lines| - 9. Remove Tag |zencoding-remove-tag| - 10. Split/Join Tag |zencoding-split-join-tag| - 11. Toggle Comment |zencoding-toggle-comment| - 12. Make anchor from URL |zencoding-make-anchor-url| - 13. Make quoted text from URL |zencoding-quoted-text-url| -Customize |zencoding-customize| - 1. Key Mappings |zencoding-customize-keymappings| - 2. Indent Size |zencoding-indent-size| - 3. Define Tag's Behavior |zencoding-define-tags-behavior| - 4. Complete Tag |zencoding-complete-tag| -ToDo |zencoding-todo| - -============================================================================== -INTRODUCTION *zencoding-introduction* *zencoding* - -|ZenCoding| is an editor plugin for high-speed HTML, XML, XSL (or any other -structured code format) coding and editing. The core of this plugin is a -powerful abbreviation engine which allows you to expand expressions?similar to -CSS selectors?into HTML code: -> - div#page>div.logo+ul#navigation>li*5>a -< -...can be expanded into: -> -
- - -
-< -Read more about current Zen Coding syntax - http://code.google.com/p/zen-coding/wiki/ZenHTMLSelectorsEn - -Abbreviation engine has a modular structure which allows you to expand -abbreviations into different languages. Zen Coding currently supports CSS, -HTML, XML/XSL and HAML languages via filters. - -============================================================================== -INSTALL *zencoding-install* - -Install the distributed files into Vim runtime directory which is usually -~/.vim/, or $HOME/vimfiles on Windows. - -If you install pathogen that provided from Tim Pope, you should extract the -file into 'bundle' directory. - -============================================================================== -TUTORIAL *zencoding-tutorial* - -If you are seeing this file as :help, then you can't edit this file. -You should copy this section and create new buffer, paste and write as -'zencoding-tutor.txt'. Formally, open the file to start tutorial. - -1. Expand Abbreviation *zencoding-expandabbr* *,* - - Type abbreviation as 'div>p#foo$*3>a' and type |,|. -> -
-

- -

-

- -

-

- -

-
-< -2. Wrap with Abbreviation *zencoding-wrap-wtih-abbreviation* *v_,* - - Write as below. -> - test1 - test2 - test3 -< - Then do visual select(line wize) and type |,|. - If you request 'Tag:', then type 'ul>li*'. -> -
    -
  • test1
  • -
  • test2
  • -
  • test3
  • -
-< - If you type tag as 'blockquote', then you'll see as following. -> -
- test1 - test2 - test3 -
-< -3. Balance Tag Inward *zencoding-balance-tag-inward* *d* - - To select inward of ul tag, type |d| in insert mode. -> -
    - *
  • -
  • -
  • -
-< - If cursor is at '*', |d| select from begin of
    to end of
. - If cursor is at first of
  • , it select
  • . - -4. Balance Tag Outward *zencoding-balance-tag-outward* *D* - - To select outward of ul tag, insert mode, type D in insert mode. -> -
      - *
    • -
    • -
    • -
    -< - If cursor is at '*', |d| select from next letter of
      to previous - letter of
    . - If cursor is at first of
  • , it select
  • . - -5. Go to Next Edit Point *zencoding-goto-next-point* *n* - - To jump next point that need to edit, type |n| in insert mode. -> - *
    foo
    -
    -< - If cursor is at '*', |n| move a cursor into attribute value of div - specified id as 'foo'. And type again |n| move a cursor into inner of - div specified id as 'bar'. - -6. Go to Previous Edit Point *zencoding-goto-previous-point* *N* - - To jump previous point that need to edit, type |N| in insert mode. -> -
    foo
    -
    * -< - If cursor is at '*', |N| move a cursor into div specified id as 'bar'. - And type again |N| move a cursor into attribute value of 'foo'. - -7. Update Size *zencoding-update-image-size* *i* - - To expand or update size of image, type |i| on img tag -> - -< - Type 'i' on img tag -> - -< - If you change image, then type it again. it will be following. -> - -< -8. Merge Lines *zencoding-merge-lines* - - To join multi line text like following, type |J|. -> -
      -
    • -
    • -
    • -
    -< - If you select part of line include
  • and type |J|, it will be following. -> -
      -
    • -
    -< -9. Remove Tag *zencoding-remove-tag* *k* - - To remove tag in the block, type |k|. -> - -< - Type |k| in insert mode, then -> -
    - -
    -< - And type |k| in there again, then div will be removed. - -10. Split/Join Tag *zencoding-split-join-tag* *j* - - To join block, type |j|. -> -
    - cursor is here -
    -< - Type |j| in insert mode. then, -> -
    -< - And type |j| in there again. -> -
    -
    -< -11. Toggle Comment *zencoding-toggle-comment* */* - - Move cursor to block -> -
    - hello world -
    -< - Type '/' in insert mode. -> - -< - Type '/' in there again. -> -
    - hello world -
    -< -12. Make anchor from URL *zencoding-make-anchor-url* *a* - - Move cursor to URL -> - http://www.google.com/ -< - Type |a| -> - Google -< -13. Make quoted text from URL *zencoding-quoted-text-url* *A* - - Move cursor to URL -> - http://github.com/ -< - Type |A| -> -
    - Secure source code hosting and collaborative development - GitHub
    -

    How does it work? Get up and running in seconds by forking a project, pushing an existing repository...

    - http://github.com/ -
    -< -============================================================================== -CUSTOMIZE *zencoding-customize* - -1. Key Mapping *zencoding-customize-keymappings* - - To specify leading key for expanding or balance tag, or for all, - Add this line in your vimrc: > -> - let g:user_zen_leader_key = '' -< - Or if you prefer to map for each actions, then you set each variables. - - 'user_zen_expandabbr_key' - 'user_zen_expandword_key' - 'user_zen_balancetaginward_key' - 'user_zen_balancetagoutward_key' - 'user_zen_next_key' - 'user_zen_prev_key' - 'user_zen_imagesize_key' - 'user_zen_togglecomment_key' - 'user_zen_splitjointag_key' - 'user_zen_removetag_key' - 'user_zen_anchorizeurl_key' - 'user_zen_anchorizesummary_key' - -2. Indent Size *zencoding-indent-size* - - To change indent size of html, add this code in your vimrc. -> - let g:user_zen_settings = { - \ 'html' : { - \ 'indentation' : ' ' - \ }, - \} -< - If you prefer to change global indent size then add this. -> - let g:user_zen_settings = { - \ 'indentation' : ' ' - \} -< -3. Define Tag's Behavior *zencoding-define-tags-behavior* - - zencoding.vim can change behavior of expanding abbreviation for each - filetypes as |Dictionary|. for details, see official site of zencoding. - for example, vimmer can add following. -> - let g:user_zen_settings = { - \ 'lang' : 'ja', - \ 'html' : { - \ 'filters' : 'html', - \ 'indentation' : ' ' - \ }, - \ 'perl' : { - \ 'indentation' : ' ', - \ 'aliases' : { - \ 'req' : "require '|'" - \ }, - \ 'snippets' : { - \ 'use' : "use strict\nuse warnings\n\n", - \ 'w' : "warn \"${cursor}\";", - \ }, - \ }, - \ 'php' : { - \ 'extends' : 'html', - \ 'filters' : 'html,c', - \ }, - \ 'css' : { - \ 'filters' : 'fc', - \ }, - \ 'javascript' : { - \ 'snippets' : { - \ 'jq' : "$(function() {\n\t${cursor}${child}\n});", - \ 'jq:each' : "$.each(arr, function(index, item)\n\t${child}\n});", - \ 'fn' : "(function() {\n\t${cursor}\n})();", - \ 'tm' : "setTimeout(function() {\n\t${cursor}\n}, 100);", - \ }, - \ }, - \ 'java' : { - \ 'indentation' : ' ', - \ 'snippets' : { - \ 'main': "public static void main(String[] args) {\n\t|\n}", - \ 'println': "System.out.println(\"|\");", - \ 'class': "public class | {\n}\n", - \ }, - \ }, - \} -< -4. Complete Tag *zencoding-complete-tag* - - If you want to complete tags using |ominifunc| then add this. -> - let g:use_zen_complete_tag = 1 -< -============================================================================== -TODO *zencoding-todo* - * wrapping inline selected. - * more documents. - * more contributor. - * more time to improve zencodig.vim. - -============================================================================== -vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0: diff --git a/dot.vim/ftdetect/csv.vim b/dot.vim/ftdetect/csv.vim deleted file mode 100644 index 998a962..0000000 --- a/dot.vim/ftdetect/csv.vim +++ /dev/null @@ -1,6 +0,0 @@ -" Install Filetype detection for CSV files -augroup ftdetect_csv - au! - au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv -augroup END - diff --git a/dot.vim/ftdetect/haml.vim b/dot.vim/ftdetect/haml.vim deleted file mode 100644 index 1446691..0000000 --- a/dot.vim/ftdetect/haml.vim +++ /dev/null @@ -1,2 +0,0 @@ -autocmd BufNewFile,BufRead *.haml setf haml -autocmd BufNewFile,BufRead *.sass setf sass diff --git a/dot.vim/ftdetect/opa.vim b/dot.vim/ftdetect/opa.vim deleted file mode 100644 index a2372c5..0000000 --- a/dot.vim/ftdetect/opa.vim +++ /dev/null @@ -1,5 +0,0 @@ -augroup filetypedetect - au! BufRead,BufNewFile *.js.opa setfiletype opajs - au! BufRead,BufNewFile *.classic.opa setfiletype opa - au! BufRead,BufNewFile *.opa setfiletype opa -augroup END diff --git a/dot.vim/ftdetect/scala.vim b/dot.vim/ftdetect/scala.vim deleted file mode 100644 index 0689273..0000000 --- a/dot.vim/ftdetect/scala.vim +++ /dev/null @@ -1 +0,0 @@ -au BufRead,BufNewFile *.scala set filetype=scala diff --git a/dot.vim/ftplugin/README.rst b/dot.vim/ftplugin/README.rst deleted file mode 100644 index 40c73c5..0000000 --- a/dot.vim/ftplugin/README.rst +++ /dev/null @@ -1,70 +0,0 @@ -pyflakes-vim -============ - -A Vim plugin for checking Python code on the fly. - -PyFlakes catches common Python errors like mistyping a variable name or -accessing a local before it is bound, and also gives warnings for things like -unused imports. - -pyflakes-vim uses the output from PyFlakes to highlight errors in your code. - -Make sure to check vim.org_ for the latest updates. - -.. _pyflakes.vim: http://www.vim.org/scripts/script.php?script_id=2441 -.. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441 - -Quick Installation ------------------- - -1. Make sure your ``.vimrc`` has:: - - filetype on " enables filetype detection - filetype plugin on " enables filetype specific plugins - -2. Download the latest release_. - -3. Unzip ``pyflakes.vim`` and the ``pyflakes`` directory into - ``~/.vim/ftplugin/python`` (or somewhere similar on your - `runtime path`_ that will be sourced for Python files). - -.. _release: http://www.vim.org/scripts/script.php?script_id=2441 -.. _runtime path: http://vimdoc.sourceforge.net/htmldoc/options.html#'runtimepath' - -Installation ------------- - -If you downloaded this from vim.org_, then just drop the contents of the zip -file into ``~/.vim/ftplugin/python``. - -Otherwise, you'll need PyFlakes on your PYTHONPATH somewhere. I recommend -getting my PyFlakes_ fork, which uses the ``_ast`` module new to Python 2.5, -and is faster and more current than PyFlakes' old usage of the deprecated -``compiler`` module. - -.. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441 -.. _PyFlakes: http://github.com/kevinw/pyflakes - -Hacking -------- - -:: - - git clone git://github.com/kevinw/pyflakes-vim.git - cd pyflakes-vim - git clone git://github.com/kevinw/pyflakes.git - -TODO ----- - * signs_ support (show warning and error icons to left of the buffer area) - * configuration variables - * parse or intercept useful output from the warnings module - -.. _signs: http://www.vim.org/htmldoc/sign.html - -Changelog ---------- - -Please see http://www.vim.org/scripts/script.php?script_id=2441 for a history of -all changes. - diff --git a/dot.vim/ftplugin/csv.vim b/dot.vim/ftplugin/csv.vim deleted file mode 100644 index ea407d1..0000000 --- a/dot.vim/ftplugin/csv.vim +++ /dev/null @@ -1,2000 +0,0 @@ -" Filetype plugin for editing CSV files. "{{{1 -" Author: Christian Brabandt -" Version: 0.24 -" Script: http://www.vim.org/scripts/script.php?script_id=2830 -" License: VIM License -" Last Change: Thu, 12 Apr 2012 21:16:30 +0200 -" Documentation: see :help ft-csv.txt -" GetLatestVimScripts: 2830 23 :AutoInstall: csv.vim -" -" Some ideas are taken from the wiki http://vim.wikia.com/wiki/VimTip667 -" though, implementation differs. - -" Plugin folklore "{{{2 -if v:version < 700 || exists('b:did_ftplugin') - finish -endif -let b:did_ftplugin = 1 - -let s:cpo_save = &cpo -set cpo&vim - -" Function definitions: "{{{2 -fu! Warn(mess) "{{{3 - echohl WarningMsg - echomsg "CSV: " . a:mess - echohl Normal -endfu - -fu! Init() "{{{3 - " Hilight Group for Columns - if exists("g:csv_hiGroup") - let s:hiGroup = g:csv_hiGroup - else - let s:hiGroup="WildMenu" - endif - if !exists("g:csv_hiHeader") - let s:hiHeader = "Title" - else - let s:hiHeader = g:csv_hiHeader - endif - exe "hi link CSVHeaderLine" s:hiHeader - - " Determine default Delimiter - if !exists("g:csv_delim") - let b:delimiter=GetDelimiter() - else - let b:delimiter=g:csv_delim - endif - - " Define custom commentstring - if !exists("g:csv_comment") - let b:csv_cmt = split(&cms, '%s') - else - let b:csv_cmt = split(g:csv_comment, '%s') - endif - - if empty(b:delimiter) && !exists("b:csv_fixed_width") - call Warn("No delimiter found. See :h csv-delimiter to set it manually!") - " Use a sane default as delimiter: - let b:delimiter = ',' - endif - - let s:del='\%(' . b:delimiter . '\|$\)' - " Pattern for matching a single column - if !exists("g:csv_strict_columns") && !exists("g:csv_col") - \ && !exists("b:csv_fixed_width") - " - Allow double quotes as escaped quotes only insides double quotes - " - Allow linebreaks only, if g:csv_nl isn't set (this is - " only allowed in double quoted strings see RFC4180), though this - " does not work with :WhatColumn and might mess up syntax - " highlighting. - " - optionally allow whitespace in front of the fields (to make it - " work with :ArrangeCol (that is actually not RFC4180 valid)) - " - Should work with most ugly solutions that are available - let b:col='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') . - \ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) . - \ '[^"]\|""\)*"\)' . s:del . '\)\|\%(' . - \ '[^' . b:delimiter . ']*' . s:del . '\)\)' - elseif !exists("g:csv_col") && exists("g:csv_strict_columns") - " strict columns - let b:col='\%([^' . b:delimiter . ']*' . s:del . '\)' - elseif exists("b:csv_fixed_width") - " Fixed width column - let b:col='' - " Check for sane default - if b:csv_fixed_width =~? '[^0-9,]' - call Warn("Please specify the list of character columns" . - \ "like this: '1,3,5'. See also :h csv-fixedwidth") - return - endif - let b:csv_fixed_width_cols=split(b:csv_fixed_width, ',') - " Force evaluating as numbers - call map(b:csv_fixed_width_cols, 'v:val+0') - else - " User given column definition - let b:col = g:csv_col - endif - - " undo when setting a new filetype - let b:undo_ftplugin = "setlocal sol< tw< wrap<" - \ . "| setl fen< fdm< fdl< fdc< fml<" - - " CSV local settings - setl nostartofline tw=0 nowrap - - if has("conceal") - setl cole=2 cocu=nc - let b:undo_ftplugin .= '| setl cole< cocu< ' - endif - - " define buffer-local commands - call CommandDefinitions() - - " Check Header line - " Defines which line is considered to be a header line - call CheckHeaderLine() - - " CSV specific mappings - call CSVMappings() - - " force reloading CSV Syntax Highlighting - if exists("b:current_syntax") - unlet b:current_syntax - " Force reloading syntax file - endif - call DoAutoCommands() - " enable CSV Menu - call Menu(1) - call DisableFolding() - silent do Syntax - - " Remove configuration variables - let b:undo_ftplugin .= "| unlet! b:delimiter b:col" - \ . "| unlet! b:csv_fixed_width_cols b:csv_filter" - \ . "| unlet! b:csv_fixed_width b:csv_list b:col_width" - \ . "| unlet! b:csv_SplitWindow b:csv_headerline" - \ . "| unlet! b:csv_thousands_sep b:csv_decimal_sep" - - " Delete all functions - " disabled currently, because otherwise when switching ft - " I think, the functions wouldn't be available anymore - " - " let b:undo_ftplugin .= "| delf Warn | delf Init | - " \ delf GetPat | delf SearchColumn | delf DelColumn | - " \ delf HiCol | delf GetDelimiter | delf WColumn | - " \ delf MaxColumns | delf ColWidth | delf ArCol | - " \ delf PrepUnArCol | delf UnArCol | - " \ delf CalculateColumnWidth | delf Columnize | - " \ delf GetColPat | delf SplitHeaderLine | - " \ delf SplitHeaderToggle | delf MoveCol | - " \ delf SortComplete | delf SortList | delf Sort | - " \ delf CSV_WCol | delf CopyCol | delf MoveColumn | - " \ delf SumColumn csv#EvalColumn | delf DoForEachColumn | - " \ delf PrepareDoForEachColumn | delf CSVMappings | - " \ delf Map | delf EscapeValue | delf FoldValue | - " \ delf PrepareFolding | delf OutputFilters | - " \ delf SortFilter | delf GetColumn | - " \ delf RemoveLastItem | delf DisableFolding | - " \ delf GetSID | delf CheckHeaderLine | - " \ delf AnalyzeColumn | delf Vertfold | - " \ delf InitCSVFixedWidth | delf LocalCmd | - " \ delf CommandDefinitions | delf NumberFormat | - " \ delf NewRecord | delf MoveOver | delf Menu | - " \ delf NewDelimiter | delf DuplicateRows | delf IN | - " \ delf SaveOptions | delf CheckDuplicates | - " \ delf CompleteColumnNr | delf CSVPat | delf Transpose -endfu - -fu! DoAutoCommands() "{{{3 - " Highlight column, on which the cursor is? - if exists("g:csv_highlight_column") && g:csv_highlight_column =~? 'y' && - \ !exists("#CSV_HI#CursorMoved") - aug CSV_HI - au! - au CursorMoved HiColumn - aug end - " Set highlighting for column, on which the cursor is currently - HiColumn - elseif exists("#CSV_HI#CursorMoved") - aug CSV_HI - au! CursorMoved - aug end - aug! CSV_HI - " Remove any existing highlighting - HiColumn! - endif - " undo autocommand: - let b:undo_ftplugin .= '| exe "sil! au! CSV_HI CursorMoved "' - let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI" |exe "sil! HiColumn!"' - - " Visually arrange columns when opening a csv file - if exists("g:csv_autocmd_arrange") && - \ !exists("#CSV_Edit#BufReadPost") - aug CSV_Edit - au! - au BufReadPost,BufWritePost *.csv,*.dat :sil %ArrangeColumn - au BufWritePre *.csv,*.dat :sil %UnArrangeColumn - aug end - elseif exists("#CSV_Edit#BufReadPost") - aug CSV_Edit - au! - aug end - aug! CSV_Edit - endif - " undo autocommand: - let b:undo_ftplugin .= '| exe "sil! au! CSV_Edit BufRead,BufWritePost,BufWritePre *.csv,*.dat "' - let b:undo_ftplugin .= '| exe "sil! aug! CSV_Edit"' - - if !exists("#CSV#ColorScheme") - " Make sure, syntax highlighting is applied - " after changing the colorscheme - augroup CSV - au! - au ColorScheme *.csv,*.dat,*.tsv,*.tab do Syntax - augroup end - endif - let b:undo_ftplugin .= '| exe "sil! au! CSV ColorScheme *.csv,*.dat "' - let b:undo_ftplugin .= '| exe "sil! aug! CSV"' - - if has("gui_running") && !exists("#CSV_Menu#FileType") - augroup CSV_Menu - au! - au FileType csv call Menu(1) - au BufEnter call Menu(1) " enable - au BufLeave call Menu(0) " disable - augroup END - "let b:undo_ftplugin .= '| sil! amenu disable CSV' - let b:undo_ftplugin .= '| sil! call Menut(0)' - endif -endfu - -fu! GetPat(colnr, maxcolnr, pat) "{{{3 - if a:colnr > 1 && a:colnr < a:maxcolnr - if !exists("b:csv_fixed_width_cols") - return '^' . GetColPat(a:colnr-1,0) . '\%([^' . - \ b:delimiter . ']*\)\?\zs' . a:pat . '\ze' . - \ '\%([^' . b:delimiter .']*\)\?' . - \ b:delimiter . GetColPat(a:maxcolnr - a:colnr, 0) . - \ '$' - else - return '\%' . b:csv_fixed_width_cols[(a:colnr - 1)] . 'c\zs' - \ . a:pat . '.\{-}\ze\%' - \ . (b:csv_fixed_width_cols[a:colnr]) . 'c\ze' - endif - elseif a:colnr == a:maxcolnr - if !exists("b:csv_fixed_width_cols") - return '^' . GetColPat(a:colnr - 1,0) . - \ '\%([^' . b:delimiter . - \ ']*\)\?\zs' . a:pat . '\ze' - else - return '\%' . b:csv_fixed_width_cols[-1] . - \ 'c\zs' . a:pat . '\ze' - endif - else " colnr = 1 - if !exists("b:csv_fixed_width_cols") - return '^' . '\%([^' . b:delimiter . ']*\)\?\zs' . a:pat . - \ '\ze\%([^' . b:delimiter . ']*\)\?' . b:delimiter . - \ GetColPat(a:maxcolnr -1 , 0) . '$' - else - return a:pat . '\ze.\{-}\%' . b:csv_fixed_width_cols[1] . 'c' - endif - endif - return '' -endfu - -fu! SearchColumn(arg) "{{{3 - try - let arglist=split(a:arg) - if len(arglist) == 1 - let colnr=WColumn() - let pat=substitute(arglist[0], '^\(.\)\(.*\)\1$', '\2', '') - if pat == arglist[0] - throw "E684" - endif - else - let colnr=arglist[0] - let pat=substitute(arglist[1], '^\(.\)\(.*\)\1$', '\2', '') - if pat == arglist[1] - throw "E684" - endif - endif - "catch /^Vim\%((\a\+)\)\=:E684/ - catch /E684/ " catch error index out of bounds - call Warn("Error! Usage :SearchInColumn [] /pattern/") - return 1 - endtry - let maxcolnr = MaxColumns() - if colnr > maxcolnr - call Warn("There exists no column " . colnr) - return 1 - endif - let @/ = GetPat(colnr, maxcolnr, pat) - try - norm! n - catch /^Vim\%((\a\+)\)\=:E486/ - " Pattern not found - echohl Error - echomsg "E486: Pattern not found in column " . colnr . ": " . pat - if &vbs > 0 - echomsg substitute(v:exception, '^[^:]*:', '','') - endif - echohl Normal - endtry -endfu - - -fu! DeleteColumn(arg) "{{{3 - let _wsv = winsaveview() - if a:arg =~ '^[/]' - let i = 0 - let pat = a:arg[1:] - call cursor(1,1) - while search(pat, 'cW') - " Delete matching column - sil call DelColumn('') - let i+=1 - endw - else - let i = 1 - sil call DelColumn(a:arg) - endif - if i > 1 - call Warn(printf("%d columns deleted", i)) - else - call Warn("1 column deleted") - endif - call winrestview(_wsv) -endfu - -fu! DelColumn(colnr) "{{{3 - let maxcolnr = MaxColumns() - let _p = getpos('.') - - if empty(a:colnr) - let colnr=WColumn() - else - let colnr=a:colnr - endif - - if colnr > maxcolnr - call Warn("There exists no column " . colnr) - return - endif - - if colnr != '1' - if !exists("b:csv_fixed_width_cols") - let pat= '^' . GetColPat(colnr-1,1) . b:col - else - let pat= GetColPat(colnr,0) - endif - else - " distinction between csv and fixed width does not matter here - let pat= '^' . GetColPat(colnr,0) - endif - if &ro - let ro = 1 - setl noro - else - let ro = 0 - endif - exe ':%s/' . escape(pat, '/') . '//' - call setpos('.', _p) - if ro - setl ro - endif -endfu - -fu! HiCol(colnr, bang) "{{{3 - if a:colnr > MaxColumns() && !a:bang - call Warn("There exists no column " . a:colnr) - return - endif - if !a:bang - if empty(a:colnr) - let colnr=WColumn() - else - let colnr=a:colnr - endif - - if colnr==1 - let pat='^'. GetColPat(colnr,0) - elseif !exists("b:csv_fixed_width_cols") - let pat='^'. GetColPat(colnr-1,1) . b:col - else - let pat=GetColPat(colnr,0) - endif - endif - - if exists("*matchadd") - if exists("s:matchid") - " ignore errors, that come from already deleted matches - sil! call matchdelete(s:matchid) - endif - " Additionally, filter all matches, that could have been used earlier - let matchlist=getmatches() - call filter(matchlist, 'v:val["group"] !~ s:hiGroup') - call setmatches(matchlist) - if a:bang - return - endif - let s:matchid=matchadd(s:hiGroup, pat, 0) - elseif !a:bang - exe ":2match " . s:hiGroup . ' /' . pat . '/' - endif -endfu - -fu! GetDelimiter() "{{{3 - if !exists("b:csv_fixed_width_cols") - let _cur = getpos('.') - let _s = @/ - let Delim= {0: ';', 1: ',', 2: '|', 3: ' '} - let temp = {} - " :silent :s does not work with lazyredraw - let _lz = &lz - set nolz - for i in values(Delim) - redir => temp[i] - exe "silent! %s/" . i . "/&/nge" - redir END - endfor - let &lz = _lz - let Delim = map(temp, 'matchstr(substitute(v:val, "\n", "", ""), "^\\d\\+")') - let Delim = filter(temp, 'v:val=~''\d''') - let max = max(values(temp)) - - let result=[] - call setpos('.', _cur) - let @/ = _s - for [key, value] in items(Delim) - if value == max - return key - endif - endfor - return '' - else - " There is no delimiter for fixedwidth files - return '' - endif -endfu - -fu! WColumn(...) "{{{3 - " Return on which column the cursor is - let _cur = getpos('.') - if !exists("b:csv_fixed_width_cols") - let line=getline('.') - " move cursor to end of field - "call search(b:col, 'ec', line('.')) - call search(b:col, 'ec') - let end=col('.')-1 - let fields=(split(line[0:end],b:col.'\zs')) - let ret=len(fields) - if exists("a:1") && a:1 > 0 - " bang attribute - let head = split(getline(1),b:col.'\zs') - " remove preceeding whitespace - let ret = substitute(head[ret-1], '^\s\+', '', '') - " remove delimiter - let ret = substitute(ret, b:delimiter. '$', '', '') - endif - else - let temp=getpos('.')[2] - let j=1 - let ret = 1 - for i in sort(b:csv_fixed_width_cols, "SortList") - if temp >= i - let ret = j - endif - let j += 1 - endfor - endif - call setpos('.',_cur) - return ret -endfu - -fu! MaxColumns(...) "{{{3 - if exists("a:0") && a:0 == 1 - let this_col = 1 - else - let this_col = 0 - endif - "return maximum number of columns in first 10 lines - if !exists("b:csv_fixed_width_cols") - if this_col - let i = a:1 - else - let i = 1 - endif - while 1 - let l = getline(i, i+10) - - " Filter comments out - let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\') - call filter(l, 'v:val !~ pat') - if !empty(l) || this_col - break - else - let i+=10 - endif - endw - - if empty(l) - throw 'csv:no_col' - endif - let fields=[] - let result=0 - for item in l - let temp=len(split(item, b:col.'\zs')) - let result=(temp>result ? temp : result) - endfor - return result - else - return len(b:csv_fixed_width_cols) - endif -endfu - -fu! ColWidth(colnr) "{{{3 - " Return the width of a column - " Internal function - let width=20 "Fallback (wild guess) - let tlist=[] - - if !exists("b:csv_fixed_width_cols") - if !exists("b:csv_list") - let b:csv_list=getline(1,'$') - let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\') - call filter(b:csv_list, 'v:val !~ pat') - call map(b:csv_list, 'split(v:val, b:col.''\zs'')') - endif - try - for item in b:csv_list - call add(tlist, item[a:colnr-1]) - endfor - " we have a list of the first 10 rows - " Now transform it to a list of field a:colnr - " and then return the maximum strlen - " That could be done in 1 line, but that would look ugly - "call map(list, 'split(v:val, b:col."\\zs")[a:colnr-1]') - call map(tlist, 'substitute(v:val, ".", "x", "g")') - call map(tlist, 'strlen(v:val)') - return max(tlist) - catch - throw "ColWidth-error" - return width - endtry - elseif a:colnr > 0 - return b:csv_fixed_width_cols[a:colnr] - b:csv_fixed_width_cols[(a:colnr - 1)] - endif -endfu - -fu! ArrangeCol(first, last, bang) range "{{{3 - "TODO: Why doesn't that work? - " is this because of the range flag? - " It's because of the way, Vim works with - " a:firstline and a:lastline parameter, therefore - " explicitly give the range as argument to the function - if exists("b:csv_fixed_width_cols") - " Nothing to do - call Warn("ArrangeColumn does not work with fixed width column!") - return - endif - let cur=winsaveview() - if a:bang || !exists("b:col_width") - " Force recalculation of Column width - call CalculateColumnWidth() - endif - - if &ro - " Just in case, to prevent the Warning - " Warning: W10: Changing read-only file - let ro = 1 - setl noro - else - let ro = 0 - endif - exe a:first . ',' . a:last .'s/' . (b:col) . - \ '/\=Columnize(submatch(0))/' . (&gd ? '' : 'g') - " Clean up variables, that were only needed for Columnize() function - unlet! s:columnize_count s:max_cols s:prev_line - if ro - setl ro - unlet ro - endif - call winrestview(cur) -endfu - -fu! PrepUnArrangeCol(first, last) "{{{3 - " Because of the way, Vim works with - " a:firstline and a:lastline parameter, - " explicitly give the range as argument to the function - if exists("b:csv_fixed_width_cols") - " Nothing to do - call Warn("UnArrangeColumn does not work with fixed width column!") - return - endif - let cur=winsaveview() - - if &ro - " Just in case, to prevent the Warning - " Warning: W10: Changing read-only file - setl noro - endif - exe a:first . ',' . a:last .'s/' . (b:col) . - \ '/\=UnArrangeCol(submatch(0))/' . (&gd ? '' : 'g') - " Clean up variables, that were only needed for Columnize() function - call winrestview(cur) -endfu - -fu! UnArrangeCol(match) "{{{3 - " Strip leading white space, also trims empty records: - return substitute(a:match, '^\s\+', '', '') - " only strip leading white space, if a non-white space follows: - "return substitute(a:match, '^\s\+\ze\S', '', '') -endfu - -fu! CalculateColumnWidth() "{{{3 - " Internal function, not called from external, - " does not work with fixed width columns - let b:col_width=[] - " Force recalculating the Column width - unlet! b:csv_list - let s:max_cols=MaxColumns() - try - for i in range(1,s:max_cols) - call add(b:col_width, ColWidth(i)) - endfor - catch /ColWidth/ - call Warn("Error: getting Column Width, using default!") - endtry - " delete buffer content in variable b:csv_list, - " this was only necessary for calculating the max width - unlet! b:csv_list -endfu - -fu! Columnize(field) "{{{3 - " Internal function, not called from external, - " does not work with fixed width columns - if !exists("s:columnize_count") - let s:columnize_count = 0 - endif - - if !exists("s:max_cols") - let s:max_cols = len(b:col_width) - endif - - if exists("s:prev_line") && s:prev_line != line('.') - let s:columnize_count = 0 - endif - - let s:prev_line = line('.') - " convert zero based indexed list to 1 based indexed list, - " Default: 20 width, in case that column width isn't defined - " Careful: Keep this fast! Using - " let width=get(b:col_width,WColumn()-1,20) - " is too slow, so we are using: - let width=get(b:col_width, (s:columnize_count % s:max_cols), 20) - - let s:columnize_count += 1 - if !exists("g:csv_no_multibyte") && - \ match(a:field, '[^ -~]') != -1 - " match characters outside the ascii range - let a = split(a:field, '\zs') - let add = eval(join(map(a, 'len(v:val)'), '+')) - let add -= len(a) - else - let add = 0 - endif - - " Add one for the frame - " plus additional width for multibyte chars, - " since printf(%*s..) uses byte width! - let width = width + add + 1 - - if width == strlen(a:field) - " Column has correct length, don't use printf() - return a:field - else - return printf("%*s", width , a:field) - endif -endfun - -fu! GetColPat(colnr, zs_flag) "{{{3 - " Return Pattern for given column - if a:colnr > 1 - if !exists("b:csv_fixed_width_cols") - let pat=b:col . '\{' . (a:colnr) . '\}' - else - if a:colnr >= len(b:csv_fixed_width_cols) - " Get last column - let pat='\%' . b:csv_fixed_width_cols[-1] . 'c.*' - else - let pat='\%' . b:csv_fixed_width_cols[(a:colnr - 1)] . - \ 'c.\{-}\%' . b:csv_fixed_width_cols[a:colnr] . 'c' - endif - endif - elseif !exists("b:csv_fixed_width_cols") - let pat=b:col - else - let pat='\%' . b:csv_fixed_width_cols[0] . 'c.\{-}' . - \ (len(b:csv_fixed_width_cols) > 1 ? - \ '\%' . b:csv_fixed_width_cols[1] . 'c' : - \ '') - endif - return pat . (a:zs_flag ? '\zs' : '') -endfu - -fu! SplitHeaderLine(lines, bang, hor) "{{{3 - if exists("b:csv_fixed_width_cols") - call Warn("Header does not work with fixed width column!") - return - endif - " Check that there exists a header line - call CheckHeaderLine() - if !a:bang - " A Split Header Window already exists, - " first close the already existing Window - if exists("b:csv_SplitWindow") - call SplitHeaderLine(a:lines, 1, a:hor) - endif - " Split Window - let _stl = &l:stl - let _sbo = &sbo - if a:hor - setl scrollopt=hor scrollbind - let lines = empty(a:lines) ? s:csv_fold_headerline : a:lines - abo sp - 1 - exe "resize" . lines - setl scrollopt=hor scrollbind winfixheight - "let &l:stl=repeat(' ', winwidth(0)) - let &l:stl="%#Normal#".repeat(' ',winwidth(0)) - " Highlight first row - let win = winnr() - else - setl scrollopt=ver scrollbind - 0 - let b=b:col - let a=[] - let a=CopyCol('',1) - " Force recalculating columns width - unlet! b:csv_list - try - let width = ColWidth(1) - catch /ColWidth/ - call Warn("Error: getting Column Width, using default!") - endtry - let b=b:col - abo vsp +enew - let b:col=b - call append(0, a) - $d _ - sil %s/.*/\=printf("%.*s", width, submatch(0))/eg - 0 - exe "vert res" width - setl scrollopt=ver scrollbind winfixwidth - setl buftype=nowrite bufhidden=hide noswapfile nobuflisted - let win = winnr() - endif - call matchadd("CSVHeaderLine", b:col) - exe "wincmd p" - let b:csv_SplitWindow = win - else - " Close split window - if !exists("b:csv_SplitWindow") - return - endif - exe b:csv_SplitWindow . "wincmd w" - if exists("_stl") - let &l_stl = _stl - endif - if exists("_sbo") - let &sbo = _sbo - endif - setl noscrollbind - wincmd c - unlet! b:csv_SplitWindow - endif -endfu - -fu! SplitHeaderToggle(hor) "{{{3 - if !exists("b:csv_SplitWindow") - :call SplitHeaderLine(1,0,a:hor) - else - :call SplitHeaderLine(1,1,a:hor) - endif -endfu - -" TODO: from here on add logic for fixed-width csv files! -fu! MoveCol(forward, line) "{{{3 - " Move cursor position upwards/downwards left/right - let colnr=WColumn() - let maxcol=MaxColumns() - let cpos=getpos('.')[2] - if !exists("b:csv_fixed_width_cols") - call search(b:col, 'bc', line('.')) - endif - let spos=getpos('.')[2] - - " Check for valid column - " a:forward == 1 : search next col - " a:forward == -1: search prev col - " a:forward == 0 : stay in col - if colnr - v:count1 >= 1 && a:forward == -1 - let colnr -= v:count1 - elseif colnr - v:count1 < 1 && a:forward == -1 - let colnr = 0 - elseif colnr + v:count1 <= maxcol && a:forward == 1 - let colnr += v:count1 - elseif colnr + v:count1 > maxcol && a:forward == 1 - let colnr = maxcol + 1 - endif - - let line=a:line - if line < 1 - let line=1 - elseif line > line('$') - let line=line('$') - endif - - " Generate search pattern - if colnr == 1 - let pat = '^' . GetColPat(colnr-1,0) - "let pat = pat . '\%' . line . 'l' - elseif (colnr == 0) || (colnr == maxcol + 1) - if !exists("b:csv_fixed_width_cols") - let pat=b:col - else - if a:forward > 0 - " Move forwards - let pat=GetColPat(1, 0) - else - " Move backwards - let pat=GetColPat(maxcol, 0) - endif - endif - else - if !exists("b:csv_fixed_width_cols") - let pat='^'. GetColPat(colnr-1,1) . b:col - else - let pat=GetColPat(colnr,0) - endif - "let pat = pat . '\%' . line . 'l' - endif - - " Search - " move left/right - if a:forward > 0 - call search(pat, 'W') - elseif a:forward < 0 - call search(pat, 'bWe') - " Moving upwards/downwards - elseif line >= line('.') - call search(pat . '\%' . line . 'l', '', line) - " Move to the correct screen column - " This is a best effort approach, we might still - " leave the column (if the next column is shorter) - if !exists("b:csv_fixed_width_cols") - let a = getpos('.') - let a[2]+= cpos-spos - else - let a = getpos('.') - let a[2] = cpos - endif - call setpos('.', a) - elseif line < line('.') - call search(pat . '\%' . line . 'l', 'b', line) - " Move to the correct screen column - if !exists("b:csv_fixed_width_cols") - let a = getpos('.') - let a[2]+= cpos-spos - else - let a = getpos('.') - let a[2] = cpos - endif - call setpos('.', a) - endif -endfun - -fu! SortComplete(A,L,P) "{{{3 - return join(range(1,MaxColumns()),"\n") -endfun - -fu! SortList(a1, a2) "{{{3 - return a:a1+0 == a:a2+0 ? 0 : a:a1+0 > a:a2+0 ? 1 : -1 -endfu - -fu! Sort(bang, line1, line2, colnr) range "{{{3 - let wsv=winsaveview() - if a:colnr =~? 'n' - let numeric = 1 - else - let numeric = 0 - endif - let col = (empty(a:colnr) || a:colnr !~? '\d\+') ? WColumn() : a:colnr+0 - if col != 1 - if !exists("b:csv_fixed_width_cols") - let pat= '^' . GetColPat(col-1,1) . b:col - else - let pat= '^' . GetColPat(col,0) - endif - else - let pat= '^' . GetColPat(col,0) - endif - exe a:line1 ',' a:line2 . "sort" . (a:bang ? '!' : '') . - \' r ' . (numeric ? 'n' : '') . ' /' . pat . '/' - call winrestview(wsv) -endfun - -fu! CSV_WCol(...) "{{{3 - try - if exists("a:1") && (a:1 == 'Name' || a:1 == 1) - return printf("%s", WColumn(1)) - else - return printf(" %d/%d", WColumn(), MaxColumns()) - endif - catch - return '' - endtry -endfun - -fu! CopyCol(reg, col) "{{{3 - " Return Specified Column into register reg - let col = a:col == "0" ? WColumn() : a:col+0 - let mcol = MaxColumns() - if col == '$' || col > mcol - let col = mcol - endif - let a = [] - " Don't get lines, that are currently filtered away - if !exists("b:csv_filter") || empty(b:csv_filter) - let a=getline(1, '$') - else - for line in range(1, line('$')) - if foldlevel(line) - continue - else - call add(a, getline(line)) - endif - endfor - endif - " Filter comments out - let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\') - call filter(a, 'v:val !~ pat') - - if !exists("b:csv_fixed_width_cols") - call map(a, 'split(v:val, ''^'' . b:col . ''\zs'')[col-1]') - else - call map(a, 'matchstr(v:val, GetColPat(col, 0))') - endif - if a:reg =~ '[-"0-9a-zA-Z*+]' - "exe ':let @' . a:reg . ' = "' . join(a, "\n") . '"' - " set the register to blockwise mode - call setreg(a:reg, join(a, "\n"), 'b') - else - return a - endif -endfu - -fu! MoveColumn(start, stop, ...) range "{{{3 - " Move column behind dest - " Explicitly give the range as argument, - " cause otherwise, Vim would move the cursor - let wsv = winsaveview() - - let col = WColumn() - let max = MaxColumns() - - " If no argument is given, move current column after last column - let source=(exists("a:1") && a:1 > 0 && a:1 <= max ? a:1 : col) - let dest =(exists("a:2") && a:2 > 0 && a:2 <= max ? a:2 : max) - - " translate 1 based columns into zero based list index - let source -= 1 - let dest -= 1 - - if source >= dest - call Warn("Destination column before source column, aborting!") - return - endif - - " Swap line by line, instead of reading the whole range into memory - - for i in range(a:start, a:stop) - let content = getline(i) - if content =~ '^\s*\V'. escape(b:csv_cmt[0], '\\') - " skip comments - continue - endif - if !exists("b:csv_fixed_width_cols") - let fields=split(content, b:col . '\zs') - else - let fields=[] - for j in range(1, max, 1) - call add(fields, matchstr(content, GetColPat(j,0))) - endfor - endif - - " Add delimiter to destination column, in case there was none, - " remove delimiter from source, in case destination did not have one - if matchstr(fields[dest], '.$') !~? b:delimiter - let fields[dest] = fields[dest] . b:delimiter - if matchstr(fields[source], '.$') =~? b:delimiter - let fields[source] = substitute(fields[source], - \ '^\(.*\).$', '\1', '') - endif - endif - - let fields= (source == 0 ? [] : fields[0 : (source-1)]) - \ + fields[ (source+1) : dest ] - \ + [ fields[source] ] + fields[(dest+1):] - - call setline(i, join(fields, '')) - endfor - - call winrestview(wsv) - -endfu - -fu! SumColumn(list) "{{{3 - " Sum a list of values, but only consider the digits within each value - " parses the digits according to the given format (if none has been - " specified, assume POSIX format (without thousand separator) If Vim has - " does not support floats, simply sum up only the integer part - if empty(a:list) - return 0 - else - let sum = has("float") ? 0.0 : 0 - for item in a:list - if empty(item) - continue - endif - let nr = matchstr(item, '\d\(.*\d\)\?$') - let format1 = '^\d\+\zs\V' . s:nr_format[0] . '\m\ze\d' - let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d' - try - let nr = substitute(nr, format1, '', '') - if has("float") && s:nr_format[1] != '.' - let nr = substitute(nr, format2, '.', '') - endif - catch - let nr = 0 - endtry - let sum += (has("float") ? str2float(nr) : (nr + 0)) - endfor - if has("float") - if float2nr(sum) == sum - return float2nr(sum) - else - return printf("%.2f", sum) - endif - endif - return sum - endif -endfu - -fu! csv#EvalColumn(nr, func, first, last) range "{{{3 - let save = winsaveview() - call CheckHeaderLine() - let nr = matchstr(a:nr, '^\d\+') - let col = (empty(nr) ? WColumn() : nr) - " don't take the header line into consideration - let start = a:first - 1 + s:csv_fold_headerline - let stop = a:last - 1 + s:csv_fold_headerline - - let column = CopyCol('', col)[start : stop] - " Delete delimiter - call map(column, 'substitute(v:val, b:delimiter . "$", "", "g")') - call map(column, 'substitute(v:val, ''^\s\+$'', "", "g")') - " Delete empty values - " Leave this up to the function that does something - " with each value - "call filter(column, '!empty(v:val)') - - " parse the optional number format - let format = matchstr(a:nr, '/[^/]*/') - call NumberFormat() - if !empty(format) - try - let s = [] - " parse the optional number format - let str = matchstr(format, '/\zs[^/]*\ze/', 0, start) - let s = matchlist(str, '\(.\)\?:\(.\)\?')[1:2] - if len(s) == 0 - " Number format wrong - call Warn("Numberformat wrong, needs to be /x:y/!") - return '' - endif - if !empty(s[0]) - let s:nr_format[0] = s[0] - endif - if !empty(s[1]) - let s:nr_format[1] = s[1] - endif - endtry - endif - try - let result=call(function(a:func), [column]) - return result - catch - " Evaluation of expression failed - echohl Title - echomsg "Evaluating" matchstr(a:func, '[a-zA-Z]\+$') - \ "failed for column" col . "!" - echohl Normal - return '' - finally - call winrestview(save) - endtry -endfu - - -fu! DoForEachColumn(start, stop, bang) range "{{{3 - " Do something for each column, - " e.g. generate SQL-Statements, convert to HTML, - " something like this - " TODO: Define the function - " needs a csv_pre_convert variable - " csv_post_convert variable - " csv_convert variable - " result contains converted buffer content - let result = [] - - if !exists("g:csv_convert") - call Warn("You need to define how to convert your data using" . - \ "the g:csv_convert variable, see :h csv-convert") - return - endif - - if exists("g:csv_pre_convert") && !empty(g:csv_pre_convert) - call add(result, g:csv_pre_convert) - endif - - for item in range(a:start, a:stop, 1) - let t = g:csv_convert - let line = getline(item) - if line =~ '^\s*\V'. escape(b:csv_cmt[0], '\\') - " Filter comments out - call add(result, line) - continue - endif - let context = split(g:csv_convert, '%s') - let columns = len(context) - if columns > MaxColumns() - let columns = MaxColumns() - elseif columns == 1 - call Warn("No Columns defined in your g:csv_convert variable, Aborting") - return - endif - - if !exists("b:csv_fixed_width_cols") - let fields=split(line, b:col . '\zs') - if a:bang - call map(fields, 'substitute(v:val, b:delimiter . - \ ''\?$'' , "", "")') - endif - else - let fields=[] - for j in range(1, columns, 1) - call add(fields, matchstr(line, GetColPat(j,0))) - endfor - endif - for j in range(1, columns, 1) - let t=substitute(t, '%s', fields[j-1], '') - endfor - call add(result, t) - endfor - - if exists("g:csv_post_convert") && !empty(g:csv_post_convert) - call add(result, g:csv_post_convert) - endif - - new - call append('$', result) - 1d _ - -endfun - -fu! PrepareDoForEachColumn(start, stop, bang) range"{{{3 - let pre = exists("g:csv_pre_convert") ? g:csv_pre_convert : '' - let g:csv_pre_convert=input('Pre convert text: ', pre) - let post = exists("g:csv_post_convert") ? g:csv_post_convert : '' - let g:csv_post_convert=input('Post convert text: ', post) - let convert = exists("g:csv_convert") ? g:csv_convert : '' - let g:csv_convert=input("Converted text, use %s for column input:\n", convert) - call DoForEachColumn(a:start, a:stop, a:bang) -endfun -fu! EscapeValue(val) "{{{3 - return '\V' . escape(a:val, '\') -endfu - -fu! FoldValue(lnum, filter) "{{{3 - call CheckHeaderLine() - - if (a:lnum == s:csv_fold_headerline) - " Don't fold away the header line - return 0 - endif - let result = 0 - - for item in values(a:filter) - " always fold comments away - let content = getline(a:lnum) - if content =~ '^\s*\V'. escape(b:csv_cmt[0], '\\') - return 1 - elseif eval('content' . (item.match ? '!~' : '=~') . 'item.pat') - let result += 1 - endif - endfor - return (result > 0) -endfu - -fu! PrepareFolding(add, match) "{{{3 - if !has("folding") - return - endif - - " Move folded-parts away? - if exists("g:csv_move_folds") - let s:csv_move_folds = g:csv_move_folds - else - let s:csv_move_folds = 0 - endif - - if !exists("b:csv_filter") - let b:csv_filter = {} - endif - if !exists("s:filter_count") || s:filter_count < 1 - let s:filter_count = 0 - endif - let cpos = winsaveview() - - if !a:add - " remove last added item from filter - if len(b:csv_filter) > 0 - call RemoveLastItem(s:filter_count) - let s:filter_count -= 1 - if len(b:csv_filter) == 0 - call DisableFolding() - return - endif - else - " Disable folding, if no pattern available - call DisableFolding() - return - endif - else - - let col = WColumn() - let max = MaxColumns() - let a = GetColumn(line('.'), col) - - if !exists("b:csv_fixed_width") - try - " strip leading whitespace - if (a =~ '\s\+'. b:delimiter . '$') - let b = split(a, '^\s\+\ze[^' . b:delimiter. ']\+')[0] - else - let b = a - endif - catch /^Vim\%((\a\+)\)\=:E684/ - " empty pattern - should match only empty columns - let b = a - endtry - - " strip trailing delimiter - try - let a = split(b, b:delimiter . '$')[0] - catch /^Vim\%((\a\+)\)\=:E684/ - let a = b - endtry - - if a == b:delimiter - try - let a=repeat(' ', ColWidth(col)) - catch - " no-op - endtry - endif - endif - - " Make a column pattern - let b= '\%(' . - \ (exists("b:csv_fixed_width") ? '.*' : '') . - \ GetPat(col, max, EscapeValue(a) . '\m') . - \ '\)' - - let s:filter_count += 1 - let b:csv_filter[col] = { 'pat': b, 'id': s:filter_count, - \ 'col': col, 'orig': a, 'match': a:match} - - endif - " Put the pattern into the search register, so they will also - " be highlighted -" let @/ = '' -" for val in sort(values(b:csv_filter), 'SortFilter') -" let @/ .= val.pat . (val.id == s:filter_count ? '' : '\&') -" endfor - let sid = GetSID() - " Don't put spaces between the arguments! - exe 'setl foldexpr=' . sid . '_FoldValue(v:lnum,b:csv_filter)' - "setl foldexpr=s:FoldValue(v:lnum,@/) - " Be sure to also fold away single screen lines - setl fen fdm=expr fdl=0 fdc=2 fml=0 - "setl foldtext=substitute(v:folddashes,'-','\ ','g') - let &foldtext=strlen(v:folddashes) . ' lines hidden' - setl fillchars-=fold:- - " Move folded area to the bottom, so there is only on consecutive - " non-folded area - if exists("s:csv_move_folds") && s:csv_move_folds - \ && !&l:ro && &l:ma - folddoclosed m$ - let cpos.lnum = s:csv_fold_headerline + 1 - endif - call winrestview(cpos) -endfu - -fu! OutputFilters(bang) "{{{3 - if !a:bang - call CheckHeaderLine() - if s:csv_fold_headerline - let title="Nr\tMatch\tCol\t Name\tValue" - else - let title="Nr\tMatch\tCol\tValue" - endif - echohl "Title" - echo printf("%s", title) - echo printf("%s", repeat("=",strdisplaywidth(title))) - echohl "Normal" - if !exists("b:csv_filter") || len(b:csv_filter) == 0 - echo printf("%s", "No active filter") - else - let items = values(b:csv_filter) - call sort(items, "SortFilter") - for item in items - if s:csv_fold_headerline - echo printf("%02d\t% 2s\t%02d\t%10.10s\t%s", - \ item.id, (item.match ? '+' : '-'), item.col, - \ substitute(GetColumn(1, item.col), - \ b:col.'$', '', ''), item.orig) - else - echo printf("%02d\t% 2s\t%02d\t%s", - \ item.id, (item.match ? '+' : '-'), - \ item.col, item.orig) - endif - endfor - endif - else - " Reapply filter again - if !exists("b:csv_filter") || len(b:csv_filter) == 0 - call Warn("No filters defined currently!") - return - else - let sid = GetSID() - exe 'setl foldexpr=' . sid . '_FoldValue(v:lnum,b:csv_filter)' - endif - endif -endfu - -fu! SortFilter(a, b) "{{{3 - return a:a.id == a:b.id ? 0 : - \ a:a.id > a:b.id ? 1 : -1 -endfu - -fu! GetColumn(line, col) "{{{3 - " Return Column content at a:line, a:col - let a=getline(a:line) - " Filter comments out - if a =~ '^\s*\V'. escape(b:csv_cmt[0], '\\') - return '' - endif - - if !exists("b:csv_fixed_width_cols") - try - let a = split(a, '^' . b:col . '\zs')[a:col - 1] - catch - " index out of range - let a = '' - endtry - else - let a = matchstr(a, GetColPat(a:col, 0)) - endif - return substitute(a, '^\s\+\|\s\+$', '', 'g') -endfu - -fu! RemoveLastItem(count) "{{{3 - for [key,value] in items(b:csv_filter) - if value.id == a:count - call remove(b:csv_filter, key) - endif - endfor -endfu - -fu! DisableFolding() "{{{3 - setl nofen fdm=manual fdc=0 fdl=0 fillchars+=fold:- -endfu - -fu! GetSID() "{{{3 - if v:version > 703 || v:version == 703 && has("patch032") - return maparg('W', "", "", 1).sid - else - "return substitute(maparg('W'), '\(\d\+\)_', '\1', '') - return matchstr(expand(''), '\zs\d\+\ze_GetSID$') - endif -endfu - -fu! NumberFormat() "{{{3 - let s:nr_format = [',', '.'] - if exists("b:csv_thousands_sep") - let s:nr_format[0] = b:csv_thousands_sep - endif - if exists("b:csv_decimal_sep") - let s:nr_format[1] = b:csv_decimal_sep - endif -endfu - -fu! CheckHeaderLine() "{{{3 - if !exists("b:csv_headerline") - let s:csv_fold_headerline = 1 - else - let s:csv_fold_headerline = b:csv_headerline - endif -endfu - -fu! AnalyzeColumn(...) "{{{3 - let maxcolnr = MaxColumns() - if len(a:000) == 1 - let colnr = a:1 - else - let colnr = WColumn() - endif - - if colnr > maxcolnr - call Warn("There exists no column " . colnr) - return 1 - endif - - " Initialize s:fold_headerline - call CheckHeaderLine() - let data = CopyCol('', colnr)[s:csv_fold_headerline : -1] - let qty = len(data) - let res = {} - for item in data - if !get(res, item) - let res[item] = 0 - endif - let res[item]+=1 - endfor - - let max_items = reverse(sort(values(res))) - if len(max_items) > 5 - call remove(max_items, 5, -1) - call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''') - endif - - if has("float") - let title="Nr\tCount\t % \tValue" - else - let title="Nr\tCount\tValue" - endif - echohl "Title" - echo printf("%s", title) - echohl "Normal" - echo printf("%s", repeat('=', strdisplaywidth(title))) - - let i=1 - for val in max_items - for key in keys(res) - if res[key] == val && i <= len(max_items) - if !empty(b:delimiter) - let k = substitute(key, b:delimiter . '\?$', '', '') - else - let k = key - endif - if has("float") - echo printf("%02d\t%02d\t%2.0f%%\t%.50s", i, res[key], - \ ((res[key] + 0.0)/qty)*100, k) - else - echo printf("%02d\t%02d\t%.50s", i, res[key], k) - endif - call remove(res,key) - let i+=1 - else - continue - endif - endfor - endfor - unlet max_items -endfunc - - -fu! Vertfold(bang, col) "{{{3 - if a:bang - do Syntax - return - endif - if !has("conceal") - call Warn("Concealing not supported in your Vim") - return - endif - if empty(b:delimiter) && !exists("b:csv_fixed_width_cols") - call Warn("There are no columns defined, can't hide away anything!") - return - endif - if empty(a:col) - let colnr=WColumn() - else - let colnr=a:col - endif - let pat=GetPat(colnr, MaxColumns(), '.*') - if exists("b:csv_fixed_width_cols") && - \ pat !~ '^\^\.\*' - " Make the pattern implicitly start at line start, - " so it will be applied by syntax highlighting (:h :syn-priority) - let pat='^.*' . pat - endif - let pat=substitute(pat, '\\zs\(\.\*\)\@=', '', '') - if !empty(pat) - exe "syn match CSVFold /" . pat . "/ conceal cchar=+" - endif -endfu - -fu! InitCSVFixedWidth() "{{{3 - if !exists("+cc") - " TODO: make this work with a custom matchadd() command for older - " Vims, that don't have 'colorcolumn' - call Warn("'colorcolumn' option not available") - return - endif - " Turn off syntax highlighting - syn clear - let _cc = &l:cc - let &l:cc = 1 - redraw! - let list = [] - let tcc = &l:cc - echo ", , , , ..." - let char=getchar() - while 1 - if char == "\" || char == "\" - let tcc = eval('tcc'.(char=="\" ? '-' : '+').'1') - elseif char == "\" || char == 32 " Space - call add(list, tcc) - elseif char == "\" || char == 127 - call remove(list, -1) - elseif char == "\" || char == 27 - let &l:cc=_cc - redraw! - return - else - break - endif - let &l:cc=tcc . (!empty(list)? ',' . join(list, ','):'') - redraw! - echo ", , , , ..." - let char=getchar() - endw - if tcc > 0 - call add(list,tcc) - endif - let b:csv_fixed_width_cols=[] - let tcc=0 - if !empty(list) - call Break() - " Remove duplicate entries - for val in sort(list, "SortList") - if val==tcc - continue - endif - call add(b:csv_fixed_width_cols, val) - let tcc=val - endfor - let b:csv_fixed_width=join(sort(b:csv_fixed_width_cols, - \ "SortList"), ',') - call Init() - endif - let &l:cc=_cc - redraw! -endfu - -fu! Break() - return -endfu - -fu! NewRecord(line1, line2, count) "{{{3 - if a:count =~ "\D" - call WarningMsg("Invalid count specified") - return - endif - - let cnt = (empty(a:count) ? 1 : a:count) - let record = "" - for item in range(1,MaxColumns()) - if !exists("b:col_width") - " Best guess width - let record .= printf("%20s", b:delimiter) - else - let record .= printf("%*s", b:col_width[item-1]+1, b:delimiter) - endif - endfor - - if getline(1)[-1:] != b:delimiter - let record = record[0:-2] . " " - endif - - let line = [] - for item in range(cnt) - call add(line, record) - endfor - for nr in range(a:line1, a:line2) - call append(nr, line) - endfor -endfu - -fu! MoveOver(outer) "{{{3 - " Move over a field - " a:outer means include the delimiter - let last = 0 - let mode = a:outer - - if WColumn() == MaxColumns() - let last = 1 - if !mode && getline('.')[-1:] != b:delimiter - " No trailing delimiter, so inner == outer - let mode = 1 - endif - endif - " Use the mapped key - exe ":sil! norm E" - let _s = @/ - if last - exe "sil! norm! /" . b:col . "\v$h" . (mode ? "" : "\") - else - exe "sil! norm! /" . b:col . "\vn\" . (mode ? "" : "\") - endif - let @/ = _s -endfu - -fu! CSVMappings() "{{{3 - call Map('noremap', 'W', ':call MoveCol(1, line("."))') - call Map('noremap', 'E', ':call MoveCol(-1, line("."))') - call Map('noremap', 'K', ':call MoveCol(0, - \ line(".")-v:count1)') - call Map('noremap', 'J', ':call MoveCol(0, - \ line(".")+v:count1)') - call Map('nnoremap', '', ':call PrepareFolding(1, - \ 1)') - call Map('nnoremap', '', ':call PrepareFolding(1, - \ 0)') - call Map('nnoremap', '', ':call PrepareFolding(0, - \ 1)') - " Text object: Field - call Map('vnoremap', 'if', ':call MoveOver(0)') - call Map('vnoremap', 'af', ':call MoveOver(1)') - call Map('omap', 'af', ':norm vaf') - call Map('omap', 'if', ':norm vif') - " Remap original values to a sane backup - call Map('noremap', 'J', 'J') - call Map('noremap', 'K', 'K') - call Map('vnoremap', 'W', 'W') - call Map('vnoremap', 'E', 'E') - call Map('noremap', 'H', 'H') - call Map('noremap', 'L', 'L') - call Map('nnoremap', '', '') - call Map('nnoremap', '', '') - call Map('nnoremap', '', '') - call Map('map', '', 'W') - call Map('map', '', 'E') - call Map('map', 'H', 'E') - call Map('map', 'L', 'W') - call Map('map', '', 'K') - call Map('map', '', 'J') -endfu - -fu! CommandDefinitions() "{{{3 - call LocalCmd("WhatColumn", ':echo WColumn(0)', - \ '-bang') - call LocalCmd("NrColumns", ':call NrColumns()', '-bang') - call LocalCmd("HiColumn", ':call HiCol(,0)', - \ '-bang -nargs=?') - call LocalCmd("SearchInColumn", - \ ':call SearchColumn()', '-nargs=*') - call LocalCmd("DeleteColumn", ':call DeleteColumn()', - \ '-nargs=? -complete=custom,SortComplete') - call LocalCmd("ArrangeColumn", - \ ':call ArrangeCol(, , 0)', - \ '-range -bang') - call LocalCmd("UnArrangeColumn", - \':call PrepUnArrangeCol(, )', - \ '-range') - call LocalCmd("InitCSV", ':call Init()', '') - call LocalCmd('Header', - \ ':call SplitHeaderLine(,0,1)', - \ '-nargs=? -bang') - call LocalCmd('VHeader', - \ ':call SplitHeaderLine(,0,0)', - \ '-nargs=? -bang') - call LocalCmd("HeaderToggle", - \ ':call SplitHeaderToggle(1)', '') - call LocalCmd("VHeaderToggle", - \ ':call SplitHeaderToggle(0)', '') - call LocalCmd("Sort", - \ ':call Sort(0, ,,)', - \ '-nargs=* -bang -range=% -complete=custom,SortComplete') - call LocalCmd("Column", - \ ':call CopyCol(empty()?''"'':,)', - \ '-count -register') - call LocalCmd("MoveColumn", - \ ':call MoveColumn(,,)', - \ '-range=% -nargs=* -complete=custom,SortComplete') - call LocalCmd("SumCol", - \ ':echo csv#EvalColumn(, "SumColumn", ,)', - \ '-nargs=? -range=% -complete=custom,SortComplete') - call LocalCmd("ConvertData", - \ ':call PrepareDoForEachColumn(,,0)', - \ '-bang -nargs=? -range=%') - call LocalCmd("Filters", ':call OutputFilters(0)', - \ '-nargs=0 -bang') - call LocalCmd("Analyze", ':call AnalyzeColumn()', - \ '-nargs=?') - call LocalCmd("VertFold", ':call Vertfold(0,)', - \ '-bang -nargs=? -range=% -complete=custom,SortComplete') - call LocalCmd("CSVFixed", ':call InitCSVFixedWidth()', '') - call LocalCmd("NewRecord", ':call NewRecord(, - \ , )', '-nargs=? -range') - call LocalCmd("NewDelimiter", ':call NewDelimiter()', - \ '-nargs=1') - call LocalCmd("Duplicates", ':call CheckDuplicates()', - \ '-nargs=1 -complete=custom,CompleteColumnNr') - call LocalCmd('Transpose', ':call Transpose(, )', - \ '-range=%') -endfu - -fu! Map(map, name, definition) "{{{3 - " All mappings are buffer local - exe a:map " " a:name a:definition - " should already exists - if a:map == 'nnoremap' - let unmap = 'nunmap' - elseif a:map == 'noremap' || a:map == 'map' - let unmap = 'unmap' - elseif a:map == 'vnoremap' - let unmap = 'vunmap' - elseif a:map == 'omap' - let unmap = 'ounmap' - endif - let b:undo_ftplugin .= "| " . unmap . " " . a:name -endfu - -fu! LocalCmd(name, definition, args) "{{{3 - if !exists(':'.a:name) - exe "com! -buffer " a:args a:name a:definition - let b:undo_ftplugin .= "| sil! delc " . a:name - endif -endfu - -fu! Menu(enable) "{{{3 - if a:enable - " Make a menu for the graphical vim - amenu CSV.&Init\ Plugin :InitCSV - amenu CSV.SetUp\ &fixedwidth\ Cols :CSVFixed - amenu CSV.-sep1- - amenu &CSV.&Column.&Number :WhatColumn - amenu CSV.Column.N&ame :WhatColumn! - amenu CSV.Column.&Highlight\ column :HiColumn - amenu CSV.Column.&Remove\ highlight :HiColumn! - amenu CSV.Column.&Delete :DeleteColumn - amenu CSV.Column.&Sort :%Sort - amenu CSV.Column.&Copy :Column - amenu CSV.Column.&Move :%MoveColumn - amenu CSV.Column.S&um :%SumCol - amenu CSV.Column.Analy&ze :Analyze - amenu CSV.Column.&Arrange :%ArrangeCol - amenu CSV.Column.&UnArrange :%UnArrangeCol - amenu CSV.-sep2- - amenu CSV.&Toggle\ Header :HeaderToggle - amenu CSV.&ConvertData :ConvertData - amenu CSV.Filters :Filters - amenu CSV.Hide\ C&olumn :VertFold - amenu CSV.&New\ Record :NewRecord - else - " just in case the Menu wasn't defined properly - sil! amenu disable CSV - endif -endfu - -fu! SaveOptions(list) "{{{3 - let save = {} - for item in a:list - exe "let save.". item. " = &l:". item - endfor - return save -endfu - -fu! NewDelimiter(newdelimiter) "{{{3 - let save = SaveOptions(['ro', 'ma']) - if exists("b:csv_fixed_width_cols") - call Warn("NewDelimiter does not work with fixed width column!") - return - endif - if !&l:ma - setl ma - endif - if &l:ro - setl noro - endif - let line=1 - while line <= line('$') - " Don't change delimiter for comments - if getline(line) =~ '^\s*\V'. escape(b:csv_cmt[0], '\\') - let line+=1 - continue - endif - let fields=split(getline(line), b:col . '\zs') - " Remove field delimiter - call map(fields, 'substitute(v:val, b:delimiter . - \ ''\?$'' , "", "")') - call setline(line, join(fields, a:newdelimiter)) - let line+=1 - endwhile - " reset local buffer options - for [key, value] in items(save) - call setbufvar('', '&'. key, value) - endfor - "reinitialize the plugin - call Init() -endfu - -fu! IN(list, value) "{{{3 - for item in a:list - if item == a:value - return 1 - endif - endfor - return 0 -endfu - -fu! DuplicateRows(columnlist) "{{{3 - let duplicates = {} - let cnt = 0 - let line = 1 - while line <= line('$') - let key = "" - let i = 1 - let content = getline(line) - " Skip comments - if content =~ '^\s*\V'. escape(b:csv_cmt[0], '\\') - continue - endif - let cols = split(content, b:col. '\zs') - for column in cols - if IN(a:columnlist, i) - let key .= column - endif - let i += 1 - endfor - if has_key(duplicates, key) && cnt < 10 - call Warn("Duplicate Row ". line) - let cnt += 1 - elseif has_key(duplicates, key) - call Warn("More duplicate Rows after: ". line) - call Warn("Aborting...") - return - else - let duplicates[key] = 1 - endif - let line += 1 - endwhile - if cnt == 0 - call Warn("No Duplicate Row found!") - endif -endfu - -fu! CompleteColumnNr(A,L,P) "{{{3 - return join(range(1,MaxColumns()), "\n") -endfu - -fu! CheckDuplicates(list) "{{{3 - let string = a:list - if string =~ '\d\s\?-\s\?\d' - let string = substitute(string, '\(\d\+\)\s\?-\s\?\(\d\+\)', - \ '\=join(range(submatch(1),submatch(2)), ",")', '') - endif - let list=split(string, ',') - call DuplicateRows(list) -endfu - -fu! Transpose(line1, line2) "{{{3 - " Note: - Comments will be deleted. - " - Does not work with fixed-width columns - if exists("b:csv_fixed_width") - call Warn("Transposing does not work with fixed-width columns!") - return - endif - let _wsv = winsaveview() - let TrailingDelim = 0 - - if line('$') > 1 - let TrailingDelim = getline(1) =~ b:delimiter.'$' - endif - - let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\') - - try - let columns = MaxColumns(a:line1) - catch - " No column, probably because of comment or empty line - " so use the number of columns from the beginning of the file - let columns = MaxColumns() - endtry - let matrix = [] - for line in range(a:line1, a:line2) - " Filter comments out - if getline(line) =~ pat - continue - endif - let r = [] - for row in range(1,columns) - let field = GetColumn(line, row) - call add(r, field) - endfor - call add(matrix, r) - endfor - unlet row - - " create new transposed matrix - let transposed = [] - for row in matrix - let i = 0 - for val in row - if get(transposed, i, []) == [] - call add(transposed, []) - endif - if val[-1:] != b:delimiter - let val .= b:delimiter - endif - call add(transposed[i], val) - let i+=1 - endfor - endfor - " Save memory - unlet! matrix - call map(transposed, 'join(v:val, '''')') - if !TrailingDelim - call map(transposed, 'substitute(v:val, b:delimiter.''\?$'', "", "")') - endif - " filter out empty records - call filter(transposed, 'v:val != b:delimiter') - - " Insert transposed data - let delete_last_line = 0 - if a:line1 == 1 && a:line2 == line('$') - let delete_last_line = 1 - endif - exe a:line1. ",". a:line2. "d _" - let first = (a:line1 > 0 ? (a:line1 - 1) : 0) - call append(first, transposed) - if delete_last_line - sil $d _ - endif - " save memory - unlet! transposed - call winrestview(_wsv) -endfu - - -fu! NrColumns(bang) "{{{3 - if !empty(a:bang) - try - let cols = MaxColumns(line('.')) - catch - " No column or comment line - call Warn("No valid CSV Column!") - endtry - else - let cols = MaxColumns() - endif - echo cols -endfu - -fu! CSVPat(colnr, ...) "{{{3 - " Make sure, we are working in a csv file - if &ft != 'csv' - return '' - endif - " encapsulates GetPat(), that returns the search pattern for a - " given column and tries to set the cursor at the specific position - let pat = GetPat(a:colnr, MaxColumns(), a:0 ? a:1 : '.*') - "let pos = match(pat, '.*\\ze') + 1 - " Try to set the cursor at the beginning of the pattern - " does not work - "call setcmdpos(pos) - return pat -endfu - -" Initialize Plugin "{{{2 -call Init() -let &cpo = s:cpo_save -unlet s:cpo_save - -" Vim Modeline " {{{2 -" vim: set foldmethod=marker et: diff --git a/dot.vim/ftplugin/haml.vim b/dot.vim/ftplugin/haml.vim deleted file mode 100644 index 7febe0b..0000000 --- a/dot.vim/ftplugin/haml.vim +++ /dev/null @@ -1,66 +0,0 @@ -" Vim filetype plugin -" Language: Haml -" Maintainer: Tim Pope - -" 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/dot.vim/ftplugin/html_snip_helper.vim b/dot.vim/ftplugin/html_snip_helper.vim deleted file mode 100644 index 2e54570..0000000 --- a/dot.vim/ftplugin/html_snip_helper.vim +++ /dev/null @@ -1,10 +0,0 @@ -" 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/dot.vim/ftplugin/pyflakes.vim b/dot.vim/ftplugin/pyflakes.vim deleted file mode 100644 index b2f8f8a..0000000 --- a/dot.vim/ftplugin/pyflakes.vim +++ /dev/null @@ -1,203 +0,0 @@ -" pyflakes.vim - A script to highlight Python code on the fly with warnings -" from Pyflakes, a Python lint tool. -" -" Place this script and the accompanying pyflakes directory in -" .vim/after/ftplugin/python. -" -" See README for additional installation and information. -" -" Thanks to matlib.vim for ideas/code on interactive linting. -" -" Maintainer: Kevin Watters -" Version: 0.1 - -if exists("b:did_pyflakes_plugin") - finish " only load once -else - let b:did_pyflakes_plugin = 1 -endif - -if !exists('g:pyflakes_builtins') - let g:pyflakes_builtins = [] -endif - -if !exists("b:did_python_init") - python << EOF -import vim -import os.path -import sys - -# get the directory this script is in: the pyflakes python module should be installed there. -scriptdir = os.path.join(os.path.dirname(vim.eval('expand("")')), 'pyflakes') -sys.path.insert(0, scriptdir) - -from pyflakes import checker, ast, messages -from operator import attrgetter - -class SyntaxError(messages.Message): - message = 'could not compile: %s' - def __init__(self, filename, lineno, col, message): - messages.Message.__init__(self, filename, lineno, col) - self.message_args = (message,) - -class blackhole(object): - write = flush = lambda *a, **k: None - -def check(buffer): - filename = buffer.name - contents = '\n'.join(buffer[:]) - - builtins = [] - try: - builtins = eval(vim.eval('string(g:pyflakes_builtins)')) - except Exception: - pass - - try: - # TODO: use warnings filters instead of ignoring stderr - old_stderr, sys.stderr = sys.stderr, blackhole() - try: - tree = ast.parse(contents, filename) - finally: - sys.stderr = old_stderr - except: - try: - value = sys.exc_info()[1] - lineno, offset, line = value[1][1:] - except IndexError: - lineno, offset, line = 1, 0, '' - if line.endswith("\n"): - line = line[:-1] - - return [SyntaxError(filename, lineno, offset, str(value))] - else: - w = checker.Checker(tree, filename, builtins = builtins) - w.messages.sort(key = attrgetter('lineno')) - return w.messages - - -def vim_quote(s): - return s.replace("'", "''") -EOF - let b:did_python_init = 1 -endif - -au BufLeave call s:ClearPyflakes() - -au BufEnter call s:RunPyflakes() -au InsertLeave call s:RunPyflakes() -au InsertEnter call s:RunPyflakes() -au BufWritePost call s:RunPyflakes() - -au CursorHold call s:RunPyflakes() -au CursorHoldI call s:RunPyflakes() - -au CursorHold call s:GetPyflakesMessage() -au CursorMoved call s:GetPyflakesMessage() - -if !exists("*s:PyflakesUpdate") - function s:PyflakesUpdate() - silent call s:RunPyflakes() - call s:GetPyflakesMessage() - endfunction -endif - -" Call this function in your .vimrc to update PyFlakes -if !exists(":PyflakesUpdate") - command PyflakesUpdate :call s:PyflakesUpdate() -endif - -" Hook common text manipulation commands to update PyFlakes -" TODO: is there a more general "text op" autocommand we could register -" for here? -noremap dd dd:PyflakesUpdate -noremap dw dw:PyflakesUpdate -noremap u u:PyflakesUpdate -noremap :PyflakesUpdate - -" WideMsg() prints [long] message up to (&columns-1) length -" guaranteed without "Press Enter" prompt. -if !exists("*s:WideMsg") - function s:WideMsg(msg) - let x=&ruler | let y=&showcmd - set noruler noshowcmd - redraw - echo a:msg - let &ruler=x | let &showcmd=y - endfun -endif - -if !exists("*s:RunPyflakes") - function s:RunPyflakes() - highlight link PyFlakes SpellBad - - if exists("b:cleared") - if b:cleared == 0 - silent call s:ClearPyflakes() - let b:cleared = 1 - endif - else - let b:cleared = 1 - endif - - let b:matched = [] - let b:matchedlines = {} - python << EOF -for w in check(vim.current.buffer): - vim.command('let s:matchDict = {}') - vim.command("let s:matchDict['lineNum'] = " + str(w.lineno)) - vim.command("let s:matchDict['message'] = '%s'" % vim_quote(w.message % w.message_args)) - vim.command("let b:matchedlines[" + str(w.lineno) + "] = s:matchDict") - - if w.col is None: - # without column information, just highlight the whole line - # (minus the newline) - vim.command(r"let s:mID = matchadd('PyFlakes', '\%" + str(w.lineno) + r"l\n\@!')") - else: - # with a column number, highlight the first keyword there - vim.command(r"let s:mID = matchadd('PyFlakes', '^\%" + str(w.lineno) + r"l\_.\{-}\zs\k\+\k\@!\%>" + str(w.col) + r"c')") - - vim.command("call add(b:matched, s:matchDict)") -EOF - let b:cleared = 0 - endfunction -end - -" keep track of whether or not we are showing a message -let b:showing_message = 0 - -if !exists("*s:GetPyflakesMessage") - function s:GetPyflakesMessage() - let s:cursorPos = getpos(".") - - " if there's a message for the line the cursor is currently on, echo - " it to the console - if has_key(b:matchedlines, s:cursorPos[1]) - let s:pyflakesMatch = get(b:matchedlines, s:cursorPos[1]) - call s:WideMsg(s:pyflakesMatch['message']) - let b:showing_message = 1 - return - endif - - " otherwise, if we're showing a message, clear it - if b:showing_message == 1 - echo - let b:showing_message = 0 - endif - endfunction -endif - -if !exists('*s:ClearPyflakes') - function s:ClearPyflakes() - let s:matches = getmatches() - for s:matchId in s:matches - if s:matchId['group'] == 'PyFlakes' - call matchdelete(s:matchId['id']) - endif - endfor - let b:matched = [] - let b:matchedlines = {} - let b:cleared = 1 - endfunction -endif - diff --git a/dot.vim/ftplugin/pyflakes/LICENSE b/dot.vim/ftplugin/pyflakes/LICENSE deleted file mode 100644 index 42b8cf3..0000000 --- a/dot.vim/ftplugin/pyflakes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) 2005 Divmod, Inc., http://www.divmod.com/ - -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. diff --git a/dot.vim/ftplugin/pyflakes/README.rst b/dot.vim/ftplugin/pyflakes/README.rst deleted file mode 100644 index 9ac34fc..0000000 --- a/dot.vim/ftplugin/pyflakes/README.rst +++ /dev/null @@ -1,36 +0,0 @@ -pyflakes -======== - -This version of PyFlakes_ has been improved to use Python's newer ``ast`` -module, instead of ``compiler``. So code checking happens faster, and will stay -up to date with new language changes. - -.. _PyFlakes: http://http://www.divmod.org/trac/wiki/DivmodPyflakes - -TODO ----- - -Importing several modules from the same package results in unnecessary warnings: - -:: - - import a.b - import a.c # Redefinition of unused "a" from line 1 - -The following construct for defining a function differently depending on some -condition results in a redefinition warning: - -:: - - if some_condition: - def foo(): do_foo() - else: - def foo(): do_bar() # redefinition of function 'foo' from line 2 - -IDE Integration ---------------- - -* vim: pyflakes-vim_ - -.. _pyflakes-vim: http://github.com/kevinw/pyflakes-vim - diff --git a/dot.vim/ftplugin/pyflakes/bin/pyflakes b/dot.vim/ftplugin/pyflakes/bin/pyflakes deleted file mode 100644 index 3f50805..0000000 --- a/dot.vim/ftplugin/pyflakes/bin/pyflakes +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/python - -from pyflakes.scripts.pyflakes import main -main() diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/__init__.py b/dot.vim/ftplugin/pyflakes/pyflakes/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/ast.py b/dot.vim/ftplugin/pyflakes/pyflakes/ast.py deleted file mode 100644 index d52025f..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/ast.py +++ /dev/null @@ -1,311 +0,0 @@ -# -*- coding: utf-8 -*- -""" - ast - ~~~ - - The `ast` module helps Python applications to process trees of the Python - abstract syntax grammar. The abstract syntax itself might change with - each Python release; this module helps to find out programmatically what - the current grammar looks like and allows modifications of it. - - An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as - a flag to the `compile()` builtin function or by using the `parse()` - function from this module. The result will be a tree of objects whose - classes all inherit from `ast.AST`. - - A modified abstract syntax tree can be compiled into a Python code object - using the built-in `compile()` function. - - Additionally various helper functions are provided that make working with - the trees simpler. The main intention of the helper functions and this - module in general is to provide an easy to use interface for libraries - that work tightly with the python syntax (template engines for example). - - - :copyright: Copyright 2008 by Armin Ronacher. - :license: Python License. -""" -from _ast import * -from _ast import __version__ - - -def parse(expr, filename='', mode='exec'): - """ - Parse an expression into an AST node. - Equivalent to compile(expr, filename, mode, PyCF_ONLY_AST). - """ - return compile(expr, filename, mode, PyCF_ONLY_AST) - - -def literal_eval(node_or_string): - """ - Safely evaluate an expression node or a string containing a Python - expression. The string or node provided may only consist of the following - Python literal structures: strings, numbers, tuples, lists, dicts, booleans, - and None. - """ - _safe_names = {'None': None, 'True': True, 'False': False} - if isinstance(node_or_string, basestring): - node_or_string = parse(node_or_string, mode='eval') - if isinstance(node_or_string, Expression): - node_or_string = node_or_string.body - def _convert(node): - if isinstance(node, Str): - return node.s - elif isinstance(node, Num): - return node.n - elif isinstance(node, Tuple): - return tuple(map(_convert, node.elts)) - elif isinstance(node, List): - return list(map(_convert, node.elts)) - elif isinstance(node, Dict): - return dict((_convert(k), _convert(v)) for k, v - in zip(node.keys, node.values)) - elif isinstance(node, Name): - if node.id in _safe_names: - return _safe_names[node.id] - raise ValueError('malformed string') - return _convert(node_or_string) - - -def dump(node, annotate_fields=True, include_attributes=False): - """ - Return a formatted dump of the tree in *node*. This is mainly useful for - debugging purposes. The returned string will show the names and the values - for fields. This makes the code impossible to evaluate, so if evaluation is - wanted *annotate_fields* must be set to False. Attributes such as line - numbers and column offsets are not dumped by default. If this is wanted, - *include_attributes* can be set to True. - """ - def _format(node): - if isinstance(node, AST): - fields = [(a, _format(b)) for a, b in iter_fields(node)] - rv = '%s(%s' % (node.__class__.__name__, ', '.join( - ('%s=%s' % field for field in fields) - if annotate_fields else - (b for a, b in fields) - )) - if include_attributes and node._attributes: - rv += fields and ', ' or ' ' - rv += ', '.join('%s=%s' % (a, _format(getattr(node, a))) - for a in node._attributes) - return rv + ')' - elif isinstance(node, list): - return '[%s]' % ', '.join(_format(x) for x in node) - return repr(node) - if not isinstance(node, AST): - raise TypeError('expected AST, got %r' % node.__class__.__name__) - return _format(node) - - -def copy_location(new_node, old_node): - """ - Copy source location (`lineno` and `col_offset` attributes) from - *old_node* to *new_node* if possible, and return *new_node*. - """ - for attr in 'lineno', 'col_offset': - if attr in old_node._attributes and attr in new_node._attributes \ - and hasattr(old_node, attr): - setattr(new_node, attr, getattr(old_node, attr)) - return new_node - - -def fix_missing_locations(node): - """ - When you compile a node tree with compile(), the compiler expects lineno and - col_offset attributes for every node that supports them. This is rather - tedious to fill in for generated nodes, so this helper adds these attributes - recursively where not already set, by setting them to the values of the - parent node. It works recursively starting at *node*. - """ - def _fix(node, lineno, col_offset): - if 'lineno' in node._attributes: - if not hasattr(node, 'lineno'): - node.lineno = lineno - else: - lineno = node.lineno - if 'col_offset' in node._attributes: - if not hasattr(node, 'col_offset'): - node.col_offset = col_offset - else: - col_offset = node.col_offset - for child in iter_child_nodes(node): - _fix(child, lineno, col_offset) - _fix(node, 1, 0) - return node - -def add_col_end(node): - def _fix(node, next): - children = list(iter_child_nodes(node)) - for i, child in enumerate(children): - next_offset = children[i+1].col_offset if i < len(children) else next.col_offset - child.col_end = next_offset - - -def increment_lineno(node, n=1): - """ - Increment the line number of each node in the tree starting at *node* by *n*. - This is useful to "move code" to a different location in a file. - """ - if 'lineno' in node._attributes: - node.lineno = getattr(node, 'lineno', 0) + n - for child in walk(node): - if 'lineno' in child._attributes: - child.lineno = getattr(child, 'lineno', 0) + n - return node - - -def iter_fields(node): - """ - Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` - that is present on *node*. - """ - if node._fields is None: - return - - for field in node._fields: - try: - yield field, getattr(node, field) - except AttributeError: - pass - - -def iter_child_nodes(node): - """ - Yield all direct child nodes of *node*, that is, all fields that are nodes - and all items of fields that are lists of nodes. - """ - for name, field in iter_fields(node): - if isinstance(field, AST): - yield field - elif isinstance(field, list): - for item in field: - if isinstance(item, AST): - yield item - - -def get_docstring(node, clean=True): - """ - Return the docstring for the given node or None if no docstring can - be found. If the node provided does not have docstrings a TypeError - will be raised. - """ - if not isinstance(node, (FunctionDef, ClassDef, Module)): - raise TypeError("%r can't have docstrings" % node.__class__.__name__) - if node.body and isinstance(node.body[0], Expr) and \ - isinstance(node.body[0].value, Str): - if clean: - import inspect - return inspect.cleandoc(node.body[0].value.s) - return node.body[0].value.s - - -def walk(node): - """ - Recursively yield all child nodes of *node*, in no specified order. This is - useful if you only want to modify nodes in place and don't care about the - context. - """ - from collections import deque - todo = deque([node]) - while todo: - node = todo.popleft() - todo.extend(iter_child_nodes(node)) - yield node - - -class NodeVisitor(object): - """ - A node visitor base class that walks the abstract syntax tree and calls a - visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. - - This class is meant to be subclassed, with the subclass adding visitor - methods. - - Per default the visitor functions for the nodes are ``'visit_'`` + - class name of the node. So a `TryFinally` node visit function would - be `visit_TryFinally`. This behavior can be changed by overriding - the `visit` method. If no visitor function exists for a node - (return value `None`) the `generic_visit` visitor is used instead. - - Don't use the `NodeVisitor` if you want to apply changes to nodes during - traversing. For this a special visitor exists (`NodeTransformer`) that - allows modifications. - """ - - def visit(self, node): - """Visit a node.""" - method = 'visit_' + node.__class__.__name__ - visitor = getattr(self, method, self.generic_visit) - return visitor(node) - - def generic_visit(self, node): - """Called if no explicit visitor function exists for a node.""" - for field, value in iter_fields(node): - if isinstance(value, list): - for item in value: - if isinstance(item, AST): - self.visit(item) - elif isinstance(value, AST): - self.visit(value) - - -class NodeTransformer(NodeVisitor): - """ - A :class:`NodeVisitor` subclass that walks the abstract syntax tree and - allows modification of nodes. - - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. - - Here is an example transformer that rewrites all occurrences of name lookups - (``foo``) to ``data['foo']``:: - - class RewriteName(NodeTransformer): - - def visit_Name(self, node): - return copy_location(Subscript( - value=Name(id='data', ctx=Load()), - slice=Index(value=Str(s=node.id)), - ctx=node.ctx - ), node) - - Keep in mind that if the node you're operating on has child nodes you must - either transform the child nodes yourself or call the :meth:`generic_visit` - method for the node first. - - For nodes that were part of a collection of statements (that applies to all - statement nodes), the visitor may also return a list of nodes rather than - just a single node. - - Usually you use the transformer like this:: - - node = YourTransformer().visit(node) - """ - - def generic_visit(self, node): - for field, old_value in iter_fields(node): - old_value = getattr(node, field, None) - if isinstance(old_value, list): - new_values = [] - for value in old_value: - if isinstance(value, AST): - value = self.visit(value) - if value is None: - continue - elif not isinstance(value, AST): - new_values.extend(value) - continue - new_values.append(value) - old_value[:] = new_values - elif isinstance(old_value, AST): - new_node = self.visit(old_value) - if new_node is None: - delattr(node, field) - else: - setattr(node, field, new_node) - return node diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/checker.py b/dot.vim/ftplugin/pyflakes/pyflakes/checker.py deleted file mode 100644 index 2d933a0..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/checker.py +++ /dev/null @@ -1,389 +0,0 @@ -import ast -from pyflakes import messages -import __builtin__ - - -allowed_before_future = (ast.Module, ast.ImportFrom, ast.Expr, ast.Str) -defined_names = set(('__file__', '__builtins__')) - -class Binding(object): - """ - @ivar used: pair of (L{Scope}, line-number) indicating the scope and - line number that this binding was last used - """ - def __init__(self, name, source): - self.name = name - self.source = source - self.used = False - - def __str__(self): - return self.name - - def __repr__(self): - return '<%s object %r from line %r at 0x%x>' % (self.__class__.__name__, - self.name, - self.source.lineno, - id(self)) - -class UnBinding(Binding): - '''Created by the 'del' operator.''' - -class Importation(Binding): - def __init__(self, name, source): - name = name.split('.')[0] - super(Importation, self).__init__(name, source) - -class Assignment(Binding): - pass - -class FunctionDefinition(Binding): - pass - - -class Scope(dict): - import_starred = False # set to True when import * is found - - def __repr__(self): - return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), dict.__repr__(self)) - - def __init__(self): - super(Scope, self).__init__() - -class ClassScope(Scope): - pass - - - -class FunctionScope(Scope): - """ - I represent a name scope for a function. - - @ivar globals: Names declared 'global' in this function. - """ - def __init__(self): - super(FunctionScope, self).__init__() - self.globals = {} - - - -class ModuleScope(Scope): - pass - -class Checker(ast.NodeVisitor): - def __init__(self, tree, filename='(none)', builtins = None): - ast.NodeVisitor.__init__(self) - - self.deferred = [] - self.dead_scopes = [] - self.messages = [] - self.filename = filename - self.scope_stack = [ModuleScope()] - self.futures_allowed = True - self.builtins = frozenset(builtins or []) - - self.visit(tree) - for handler, scope in self.deferred: - self.scope_stack = scope - handler() - del self.scope_stack[1:] - self.pop_scope() - self.check_dead_scopes() - - def defer(self, callable): - '''Schedule something to be called after just before completion. - - This is used for handling function bodies, which must be deferred - because code later in the file might modify the global scope. When - `callable` is called, the scope at the time this is called will be - restored, however it will contain any new bindings added to it. - ''' - self.deferred.append( (callable, self.scope_stack[:]) ) - - def check_dead_scopes(self): - # Check for modules that were imported but unused - for scope in self.dead_scopes: - for importation in scope.itervalues(): - if isinstance(importation, Importation) and not importation.used: - self.report(messages.UnusedImport, importation.source.lineno, importation.name) - - def push_function_scope(self): - self.scope_stack.append(FunctionScope()) - - def push_class_scope(self): - self.scope_stack.append(ClassScope()) - - def pop_scope(self): - scope = self.scope_stack.pop() - self.dead_scopes.append(scope) - - @property - def scope(self): - return self.scope_stack[-1] - - def report(self, message_class, *args, **kwargs): - self.messages.append(message_class(self.filename, *args, **kwargs)) - - def visit_Import(self, node): - for name_node in node.names: - # "import bar as foo" -> name=bar, asname=foo - name = name_node.asname or name_node.name - self.add_binding(node, Importation(name, node)) - - def visit_GeneratorExp(self, node): - for generator in node.generators: - self.visit(generator.iter) - self.assign_vars(generator.target) - - for generator in node.generators: - if hasattr(node, 'elt'): - self.visit(node.elt) - - self.visit_nodes(generator.ifs) - - visit_ListComp = visit_GeneratorExp - - def visit_For(self, node): - ''' - Process bindings for loop variables. - ''' - self.visit_nodes(node.iter) - - for var in self.flatten(node.target): - upval = self.scope.get(var.id) - if isinstance(upval, Importation) and upval.used: - self.report(messages.ImportShadowedByLoopVar, - node.lineno, node.col_offset, var.id, upval.source.lineno) - - self.add_binding(var, Assignment(var.id, var)) - - self.visit_nodes(node.body + node.orelse) - - def visit_FunctionDef(self, node): - - try: - decorators = node.decorator_list - except AttributeError: - # Use .decorators for Python 2.5 compatibility - decorators = node.decorators - - self.visit_nodes(decorators) - self.add_binding(node, FunctionDefinition(node.name, node)) - self.visit_Lambda(node) - - def visit_Lambda(self, node): - self.visit_nodes(node.args.defaults) - - def run_function(): - self.push_function_scope() - - # Check for duplicate arguments - argnames = set() - for arg in self.flatten(node.args.args): - if arg.id in argnames: - self.report(messages.DuplicateArgument, arg.lineno, arg.col_offset, arg.id) - argnames.add(arg.id) - - self.assign_vars(node.args.args, report_redef=False) - if node.args.vararg is not None: - self.add_binding(node, Assignment(node.args.vararg, node), False) - if node.args.kwarg is not None: - self.add_binding(node, Assignment(node.args.kwarg, node), False) - self.visit_nodes(node.body) - self.pop_scope() - - self.defer(run_function) - - def visit_Name(self, node): - ''' - Locate names in locals / function / globals scopes. - ''' - scope, name = self.scope, node.id - - # try local scope - import_starred = scope.import_starred - try: - scope[name].used = (scope, node.lineno, node.col_offset) - except KeyError: - pass - else: - return - - # try enclosing function scopes - for func_scope in self.scope_stack[-2:0:-1]: - import_starred = import_starred or func_scope.import_starred - if not isinstance(func_scope, FunctionScope): - continue - try: - func_scope[name].used = (scope, node.lineno, node.col_offset) - except KeyError: - pass - else: - return - - # try global scope - import_starred = import_starred or self.scope_stack[0].import_starred - try: - self.scope_stack[0][node.id].used = (scope, node.lineno, node.col_offset) - except KeyError: - if not import_starred and not self.is_builtin(name): - self.report(messages.UndefinedName, node.lineno, node.col_offset, name) - - def assign_vars(self, targets, report_redef=True): - scope = self.scope - - for target in self.flatten(targets): - name = target.id - # if the name hasn't already been defined in the current scope - if isinstance(scope, FunctionScope) and name not in scope: - # for each function or module scope above us - for upscope in self.scope_stack[:-1]: - if not isinstance(upscope, (FunctionScope, ModuleScope)): - continue - - upval = upscope.get(name) - # if the name was defined in that scope, and the name has - # been accessed already in the current scope, and hasn't - # been declared global - if upval is not None: - if upval.used and upval.used[0] is scope and name not in scope.globals: - # then it's probably a mistake - self.report(messages.UndefinedLocal, - upval.used[1], upval.used[2], name, upval.source.lineno, upval.source.col_offset) - - self.add_binding(target, Assignment(name, target), report_redef) - - def visit_Assign(self, node): - for target in node.targets: - self.visit_nodes(node.value) - self.assign_vars(node.targets) - - def visit_Delete(self, node): - for target in self.flatten(node.targets): - if isinstance(self.scope, FunctionScope) and target.id in self.scope.globals: - del self.scope.globals[target.id] - else: - self.add_binding(target, UnBinding(target.id, target)) - - def visit_With(self, node): - self.visit(node.context_expr) - - # handle new bindings made by optional "as" part - if node.optional_vars is not None: - self.assign_vars(node.optional_vars) - - self.visit_nodes(node.body) - - def visit_ImportFrom(self, node): - if node.module == '__future__': - if not self.futures_allowed: - self.report(messages.LateFutureImport, node.lineno, node.col_offset, [alias.name for alias in node.names]) - else: - self.futures_allowed = False - - for alias in node.names: - if alias.name == '*': - self.scope.import_starred = True - self.report(messages.ImportStarUsed, node.lineno, node.col_offset, node.module) - continue - name = alias.asname or alias.name - importation = Importation(name, node) - if node.module == '__future__': - importation.used = (self.scope, node.lineno, node.col_offset) - self.add_binding(node, importation) - - def visit_Global(self, node): - ''' - Keep track of global declarations. - ''' - scope = self.scope - if isinstance(scope, FunctionScope): - scope.globals.update(dict.fromkeys(node.names)) - - def visit_ClassDef(self, node): - self.add_binding(node, Assignment(node.name, node)) - self.visit_nodes(node.bases) - - self.push_class_scope() - self.visit_nodes(node.body) - self.pop_scope() - - def visit_excepthandler(self, node): - if node.type is not None: - self.visit(node.type) - if node.name is not None: - self.assign_vars(node.name) - self.visit_nodes(node.body) - - visit_ExceptHandler = visit_excepthandler # in 2.6, this was CamelCased - - def flatten(self, nodes): - if isinstance(nodes, ast.Attribute): - self.visit(nodes) - return [] - elif isinstance(nodes, ast.Subscript): - self.visit(nodes.value) - self.visit(nodes.slice) - return [] - elif isinstance(nodes, ast.Name): - return [nodes] - elif isinstance(nodes, (ast.Tuple, ast.List)): - return self.flatten(nodes.elts) - - flattened_nodes = [] - for node in nodes: - if hasattr(node, 'elts'): - flattened_nodes += self.flatten(node.elts) - elif node is not None: - flattened_nodes += self.flatten(node) - - return flattened_nodes - - def add_binding(self, node, value, report_redef=True): - line, col, scope, name = node.lineno, node.col_offset, self.scope, value.name - - # Check for a redefined function - func = scope.get(name) - if (isinstance(func, FunctionDefinition) and isinstance(value, FunctionDefinition)): - self.report(messages.RedefinedFunction, line, name, func.source.lineno) - - # Check for redefining an unused import - if report_redef and not isinstance(scope, ClassScope): - for up_scope in self.scope_stack[::-1]: - upval = up_scope.get(name) - if isinstance(upval, Importation) and not upval.used: - self.report(messages.RedefinedWhileUnused, line, col, name, upval.source.lineno) - - # Check for "del undefined_name" - if isinstance(value, UnBinding): - try: - del scope[name] - except KeyError: - self.report(messages.UndefinedName, line, col, name) - else: - scope[name] = value - - def visit(self, node): - if not isinstance(node, allowed_before_future): - self.futures_allowed = False - - return super(Checker, self).visit(node) - - def visit_nodes(self, nodes): - try: - nodes = list(getattr(nodes, 'elts', nodes)) - except TypeError: - nodes = [nodes] - - for node in nodes: - self.visit(node) - - def is_builtin(self, name): - if hasattr(__builtin__, name): - return True - if name in defined_names: - return True - if name in self.builtins: - return True - - return False - diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/messages.py b/dot.vim/ftplugin/pyflakes/pyflakes/messages.py deleted file mode 100644 index 15a920e..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/messages.py +++ /dev/null @@ -1,77 +0,0 @@ -# (c) 2005 Divmod, Inc. See LICENSE file for details - -class Message(object): - message = '' - message_args = () - def __init__(self, filename, lineno, col = None): - self.filename = filename - self.lineno = lineno - self.col = col - def __str__(self): - if self.col is not None: - return '%s:%s(%d): %s' % (self.filename, self.lineno, self.col, self.message % self.message_args) - else: - return '%s:%s: %s' % (self.filename, self.lineno, self.message % self.message_args) - - -class UnusedImport(Message): - message = '%r imported but unused' - def __init__(self, filename, lineno, name): - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class RedefinedWhileUnused(Message): - message = 'redefinition of unused %r from line %r' - def __init__(self, filename, lineno, col, name, orig_lineno): - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class ImportShadowedByLoopVar(Message): - message = 'import %r from line %r shadowed by loop variable' - def __init__(self, filename, lineno, col, name, orig_lineno): - Message.__init__(self, filename, lineno, col) - self.message_args = (name, orig_lineno) - - -class ImportStarUsed(Message): - message = "'from %s import *' used; unable to detect undefined names" - def __init__(self, filename, lineno, col, modname): - Message.__init__(self, filename, lineno, col) - self.message_args = (modname,) - - -class UndefinedName(Message): - message = 'undefined name %r' - def __init__(self, filename, lineno, col, name): - Message.__init__(self, filename, lineno, col) - self.message_args = (name,) - - -class UndefinedLocal(Message): - message = "local variable %r (defined in enclosing scope on line %r) referenced before assignment" - def __init__(self, filename, lineno, col, name, orig_lineno, orig_col): - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class DuplicateArgument(Message): - message = 'duplicate argument %r in function definition' - def __init__(self, filename, lineno, col, name): - Message.__init__(self, filename, lineno, col) - self.message_args = (name,) - - -class RedefinedFunction(Message): - message = 'redefinition of function %r from line %r' - def __init__(self, filename, lineno, name, orig_lineno): - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class LateFutureImport(Message): - message = 'future import(s) %r after other statements' - def __init__(self, filename, lineno, col, names): - Message.__init__(self, filename, lineno) - self.message_args = (names,) diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/scripts/__init__.py b/dot.vim/ftplugin/pyflakes/pyflakes/scripts/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/scripts/pyflakes.py b/dot.vim/ftplugin/pyflakes/pyflakes/scripts/pyflakes.py deleted file mode 100644 index 06937a7..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/scripts/pyflakes.py +++ /dev/null @@ -1,63 +0,0 @@ - -""" -Implementation of the command-line I{pyflakes} tool. -""" - -import _ast -import sys -import os - -checker = __import__('pyflakes.checker').checker - -def check(codeString, filename): - try: - tree = compile(codeString, filename, 'exec', _ast.PyCF_ONLY_AST) - except (SyntaxError, IndentationError): - value = sys.exc_info()[1] - try: - (lineno, offset, line) = value[1][1:] - except IndexError: - print >> sys.stderr, 'could not compile %r' % (filename,) - return 1 - if line.endswith("\n"): - line = line[:-1] - print >> sys.stderr, '%s:%d: could not compile' % (filename, lineno) - print >> sys.stderr, line - print >> sys.stderr, " " * (offset-2), "^" - return 1 - else: - w = checker.Checker(tree, filename) - w.messages.sort(lambda a, b: cmp(a.lineno, b.lineno)) - for warning in w.messages: - print warning - return len(w.messages) - - -def checkPath(filename): - """ - Check the given path, printing out any warnings detected. - - @return: the number of warnings printed - """ - if os.path.exists(filename): - return check(file(filename, 'U').read() + '\n', filename) - else: - print >> sys.stderr, '%s: no such file' % (filename,) - return 1 - -def main(): - warnings = 0 - args = sys.argv[1:] - if args: - for arg in args: - if os.path.isdir(arg): - for dirpath, dirnames, filenames in os.walk(arg): - for filename in filenames: - if filename.endswith('.py'): - warnings += checkPath(os.path.join(dirpath, filename)) - else: - warnings += checkPath(arg) - else: - warnings += check(sys.stdin.read(), '') - - raise SystemExit(warnings > 0) diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/test/__init__.py b/dot.vim/ftplugin/pyflakes/pyflakes/test/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/test/harness.py b/dot.vim/ftplugin/pyflakes/pyflakes/test/harness.py deleted file mode 100644 index 765cda4..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/test/harness.py +++ /dev/null @@ -1,24 +0,0 @@ - -import textwrap - -from twisted.trial import unittest - -from pyflakes import checker, ast - - -class Test(unittest.TestCase): - - def flakes(self, input, *expectedOutputs): - w = checker.Checker(ast.parse(textwrap.dedent(input))) - outputs = [type(o) for o in w.messages] - expectedOutputs = list(expectedOutputs) - outputs.sort() - expectedOutputs.sort() - self.assert_(outputs == expectedOutputs, '''\ -for input: -%s -expected outputs: -%s -but got: -%s''' % (input, repr(expectedOutputs), '\n'.join([str(o) for o in w.messages]))) - return w diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/test/test_imports.py b/dot.vim/ftplugin/pyflakes/pyflakes/test/test_imports.py deleted file mode 100644 index 4f87f3e..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/test/test_imports.py +++ /dev/null @@ -1,512 +0,0 @@ - -from sys import version_info - -from pyflakes import messages as m -from pyflakes.test import harness - -class Test(harness.Test): - - def test_unusedImport(self): - self.flakes('import fu, bar', m.UnusedImport, m.UnusedImport) - self.flakes('from baz import fu, bar', m.UnusedImport, m.UnusedImport) - - def test_aliasedImport(self): - self.flakes('import fu as FU, bar as FU', m.RedefinedWhileUnused, m.UnusedImport) - self.flakes('from moo import fu as FU, bar as FU', m.RedefinedWhileUnused, m.UnusedImport) - - def test_usedImport(self): - self.flakes('import fu; print fu') - self.flakes('from baz import fu; print fu') - - def test_redefinedWhileUnused(self): - self.flakes('import fu; fu = 3', m.RedefinedWhileUnused) - self.flakes('import fu; del fu', m.RedefinedWhileUnused) - self.flakes('import fu; fu, bar = 3', m.RedefinedWhileUnused) - self.flakes('import fu; [fu, bar] = 3', m.RedefinedWhileUnused) - - def test_redefinedByFunction(self): - self.flakes(''' - import fu - def fu(): - pass - ''', m.RedefinedWhileUnused) - - def test_redefinedInNestedFunction(self): - """ - Test that shadowing a global name with a nested function definition - generates a warning. - """ - self.flakes(''' - import fu - def bar(): - def baz(): - def fu(): - pass - ''', m.RedefinedWhileUnused, m.UnusedImport) - - def test_redefinedByClass(self): - self.flakes(''' - import fu - class fu: - pass - ''', m.RedefinedWhileUnused) - - def test_redefinedInClass(self): - """ - Test that shadowing a global with a class attribute does not produce a - warning. - """ - self.flakes(''' - import fu - class bar: - fu = 1 - print fu - ''') - - def test_usedInFunction(self): - self.flakes(''' - import fu - def fun(): - print fu - ''') - - def test_shadowedByParameter(self): - self.flakes(''' - import fu - def fun(fu): - print fu - ''', m.UnusedImport) - - self.flakes(''' - import fu - def fun(fu): - print fu - print fu - ''') - - def test_newAssignment(self): - self.flakes('fu = None') - - def test_usedInGetattr(self): - self.flakes('import fu; fu.bar.baz') - self.flakes('import fu; "bar".fu.baz', m.UnusedImport) - - def test_usedInSlice(self): - self.flakes('import fu; print fu.bar[1:]') - - def test_usedInIfBody(self): - self.flakes(''' - import fu - if True: print fu - ''') - - def test_usedInIfConditional(self): - self.flakes(''' - import fu - if fu: pass - ''') - - def test_usedInElifConditional(self): - self.flakes(''' - import fu - if False: pass - elif fu: pass - ''') - - def test_usedInElse(self): - self.flakes(''' - import fu - if False: pass - else: print fu - ''') - - def test_usedInCall(self): - self.flakes('import fu; fu.bar()') - - def test_usedInClass(self): - self.flakes(''' - import fu - class bar: - bar = fu - ''') - - def test_usedInClassBase(self): - self.flakes(''' - import fu - class bar(object, fu.baz): - pass - ''') - - def test_notUsedInNestedScope(self): - self.flakes(''' - import fu - def bleh(): - pass - print fu - ''') - - def test_usedInFor(self): - self.flakes(''' - import fu - for bar in range(9): - print fu - ''') - - def test_usedInForElse(self): - self.flakes(''' - import fu - for bar in range(10): - pass - else: - print fu - ''') - - def test_redefinedByFor(self): - self.flakes(''' - import fu - for fu in range(2): - pass - ''', m.RedefinedWhileUnused) - - def test_shadowedByFor(self): - """ - Test that shadowing a global name with a for loop variable generates a - warning. - """ - self.flakes(''' - import fu - fu.bar() - for fu in (): - pass - ''', m.ImportShadowedByLoopVar) - - def test_shadowedByForDeep(self): - """ - Test that shadowing a global name with a for loop variable nested in a - tuple unpack generates a warning. - """ - self.flakes(''' - import fu - fu.bar() - for (x, y, z, (a, b, c, (fu,))) in (): - pass - ''', m.ImportShadowedByLoopVar) - - def test_usedInReturn(self): - self.flakes(''' - import fu - def fun(): - return fu - ''') - - def test_usedInOperators(self): - self.flakes('import fu; 3 + fu.bar') - self.flakes('import fu; 3 % fu.bar') - self.flakes('import fu; 3 - fu.bar') - self.flakes('import fu; 3 * fu.bar') - self.flakes('import fu; 3 ** fu.bar') - self.flakes('import fu; 3 / fu.bar') - self.flakes('import fu; 3 // fu.bar') - self.flakes('import fu; -fu.bar') - self.flakes('import fu; ~fu.bar') - self.flakes('import fu; 1 == fu.bar') - self.flakes('import fu; 1 | fu.bar') - self.flakes('import fu; 1 & fu.bar') - self.flakes('import fu; 1 ^ fu.bar') - self.flakes('import fu; 1 >> fu.bar') - self.flakes('import fu; 1 << fu.bar') - - def test_usedInAssert(self): - self.flakes('import fu; assert fu.bar') - - def test_usedInSubscript(self): - self.flakes('import fu; fu.bar[1]') - - def test_usedInLogic(self): - self.flakes('import fu; fu and False') - self.flakes('import fu; fu or False') - self.flakes('import fu; not fu.bar') - - def test_usedInList(self): - self.flakes('import fu; [fu]') - - def test_usedInTuple(self): - self.flakes('import fu; (fu,)') - - def test_usedInTry(self): - self.flakes(''' - import fu - try: fu - except: pass - ''') - - def test_usedInExcept(self): - self.flakes(''' - import fu - try: fu - except: pass - ''') - - def test_redefinedByExcept(self): - self.flakes(''' - import fu - try: pass - except Exception, fu: pass - ''', m.RedefinedWhileUnused) - - def test_usedInRaise(self): - self.flakes(''' - import fu - raise fu.bar - ''') - - def test_usedInYield(self): - self.flakes(''' - import fu - def gen(): - yield fu - ''') - - def test_usedInDict(self): - self.flakes('import fu; {fu:None}') - self.flakes('import fu; {1:fu}') - - def test_usedInParameterDefault(self): - self.flakes(''' - import fu - def f(bar=fu): - pass - ''') - - def test_usedInAttributeAssign(self): - self.flakes('import fu; fu.bar = 1') - - def test_usedInKeywordArg(self): - self.flakes('import fu; fu.bar(stuff=fu)') - - def test_usedInAssignment(self): - self.flakes('import fu; bar=fu') - self.flakes('import fu; n=0; n+=fu') - - def test_usedInListComp(self): - self.flakes('import fu; [fu for _ in range(1)]') - self.flakes('import fu; [1 for _ in range(1) if fu]') - - def test_redefinedByListComp(self): - self.flakes('import fu; [1 for fu in range(1)]', m.RedefinedWhileUnused) - - - def test_usedInTryFinally(self): - self.flakes(''' - import fu - try: pass - finally: fu - ''') - - self.flakes(''' - import fu - try: fu - finally: pass - ''') - - def test_usedInWhile(self): - self.flakes(''' - import fu - while 0: - fu - ''') - - self.flakes(''' - import fu - while fu: pass - ''') - - def test_usedInGlobal(self): - self.flakes(''' - import fu - def f(): global fu - ''', m.UnusedImport) - - def test_usedInBackquote(self): - self.flakes('import fu; `fu`') - - def test_usedInExec(self): - self.flakes('import fu; exec "print 1" in fu.bar') - - def test_usedInLambda(self): - self.flakes('import fu; lambda: fu') - - def test_shadowedByLambda(self): - self.flakes('import fu; lambda fu: fu', m.UnusedImport) - - def test_usedInSliceObj(self): - self.flakes('import fu; "meow"[::fu]') - - def test_unusedInNestedScope(self): - self.flakes(''' - def bar(): - import fu - fu - ''', m.UnusedImport, m.UndefinedName) - - def test_methodsDontUseClassScope(self): - self.flakes(''' - class bar: - import fu - def fun(self): - fu - ''', m.UnusedImport, m.UndefinedName) - - def test_nestedFunctionsNestScope(self): - self.flakes(''' - def a(): - def b(): - fu - import fu - ''') - - def test_nestedClassAndFunctionScope(self): - self.flakes(''' - def a(): - import fu - class b: - def c(self): - print fu - ''') - - def test_importStar(self): - self.flakes('from fu import *', m.ImportStarUsed) - - def test_packageImport(self): - self.flakes('import fu.bar; fu.bar') - test_packageImport.todo = "this has been hacked to treat 'import fu.bar' as just 'import fu'" - - def test_assignRHSFirst(self): - self.flakes('import fu; fu = fu') - self.flakes('import fu; fu, bar = fu') - self.flakes('import fu; [fu, bar] = fu') - self.flakes('import fu; fu += fu') - - def test_tryingMultipleImports(self): - self.flakes(''' - try: - import fu - except ImportError: - import bar as fu - ''') - test_tryingMultipleImports.todo = '' - - def test_nonGlobalDoesNotRedefine(self): - self.flakes(''' - import fu - def a(): - fu = 3 - fu - ''') - - def test_functionsRunLater(self): - self.flakes(''' - def a(): - fu - import fu - ''') - - def test_functionNamesAreBoundNow(self): - self.flakes(''' - import fu - def fu(): - fu - fu - ''', m.RedefinedWhileUnused) - - def test_ignoreNonImportRedefinitions(self): - self.flakes('a = 1; a = 2') - - def test_importingForImportError(self): - self.flakes(''' - try: - import fu - except ImportError: - pass - ''') - test_importingForImportError.todo = '' - - def test_explicitlyPublic(self): - '''imports mentioned in __all__ are not unused''' - self.flakes('import fu; __all__ = ["fu"]') - test_explicitlyPublic.todo = "this would require importing the module or doing smarter parsing" - - def test_importedInClass(self): - '''Imports in class scope can be used through self''' - self.flakes(''' - class c: - import i - def __init__(self): - self.i - ''') - test_importedInClass.todo = 'requires evaluating attribute access' - - def test_futureImport(self): - '''__future__ is special''' - self.flakes('from __future__ import division') - - def test_futureImportFirst(self): - """ - __future__ imports must come before anything else. - """ - self.flakes(''' - x = 5 - from __future__ import division - ''', m.LateFutureImport) - - - -class Python24Tests(harness.Test): - """ - Tests for checking of syntax which is valid in Python 2.4 and newer. - """ - if version_info < (2, 4): - skip = "Python 2.4 required for generator expression and decorator tests." - - - def test_usedInGenExp(self): - """ - Using a global in a generator expression results in no warnings. - """ - self.flakes('import fu; (fu for _ in range(1))') - self.flakes('import fu; (1 for _ in range(1) if fu)') - - - def test_redefinedByGenExp(self): - """ - Re-using a global name as the loop variable for a generator - expression results in a redefinition warning. - """ - self.flakes('import fu; (1 for fu in range(1))', m.RedefinedWhileUnused) - - - def test_usedAsDecorator(self): - """ - Using a global name in a decorator statement results in no warnings, - but using an undefined name in a decorator statement results in an - undefined name warning. - """ - self.flakes(''' - from interior import decorate - @decorate - def f(): - return "hello" - ''') - - self.flakes(''' - from interior import decorate - @decorate('value') - def f(): - return "hello" - ''') - - self.flakes(''' - @decorate - def f(): - return "hello" - ''', m.UndefinedName) diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/test/test_other.py b/dot.vim/ftplugin/pyflakes/pyflakes/test/test_other.py deleted file mode 100644 index 26a306c..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/test/test_other.py +++ /dev/null @@ -1,234 +0,0 @@ -# (c) 2005-2008 Divmod, Inc. -# See LICENSE file for details - -""" -Tests for various Pyflakes behavior. -""" - -from sys import version_info - -from pyflakes import messages as m -from pyflakes.test import harness - - -class Test(harness.Test): - - def test_duplicateArgs(self): - self.flakes('def fu(bar, bar): pass', m.DuplicateArgument) - - def test_localReferencedBeforeAssignment(self): - self.flakes(''' - a = 1 - def f(): - a; a=1 - f() - ''', m.UndefinedName) - test_localReferencedBeforeAssignment.todo = 'this requires finding all assignments in the function body first' - - def test_redefinedFunction(self): - """ - Test that shadowing a function definition with another one raises a - warning. - """ - self.flakes(''' - def a(): pass - def a(): pass - ''', m.RedefinedFunction) - - def test_redefinedClassFunction(self): - """ - Test that shadowing a function definition in a class suite with another - one raises a warning. - """ - self.flakes(''' - class A: - def a(): pass - def a(): pass - ''', m.RedefinedFunction) - - def test_functionDecorator(self): - """ - Test that shadowing a function definition with a decorated version of - that function does not raise a warning. - """ - self.flakes(''' - from somewhere import somedecorator - - def a(): pass - a = somedecorator(a) - ''') - - def test_classFunctionDecorator(self): - """ - Test that shadowing a function definition in a class suite with a - decorated version of that function does not raise a warning. - """ - self.flakes(''' - class A: - def a(): pass - a = classmethod(a) - ''') - - def test_unaryPlus(self): - '''Don't die on unary +''' - self.flakes('+1') - - - -class Python25Test(harness.Test): - """ - Tests for checking of syntax only available in Python 2.5 and newer. - """ - if version_info < (2, 5): - skip = "Python 2.5 required for if-else and with tests" - - def test_ifexp(self): - """ - Test C{foo if bar else baz} statements. - """ - self.flakes("a = 'moo' if True else 'oink'") - self.flakes("a = foo if True else 'oink'", m.UndefinedName) - self.flakes("a = 'moo' if True else bar", m.UndefinedName) - - - def test_withStatementNoNames(self): - """ - No warnings are emitted for using inside or after a nameless C{with} - statement a name defined beforehand. - """ - self.flakes(''' - from __future__ import with_statement - bar = None - with open("foo"): - bar - bar - ''') - - def test_withStatementSingleName(self): - """ - No warnings are emitted for using a name defined by a C{with} statement - within the suite or afterwards. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as bar: - bar - bar - ''') - - - def test_withStatementTupleNames(self): - """ - No warnings are emitted for using any of the tuple of names defined by - a C{with} statement within the suite or afterwards. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as (bar, baz): - bar, baz - bar, baz - ''') - - - def test_withStatementSingleNameUndefined(self): - """ - An undefined name warning is emitted if the name first defined by a - C{with} statement is used before the C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - bar - with open('foo') as bar: - pass - ''', m.UndefinedName) - - - def test_withStatementTupleNamesUndefined(self): - """ - An undefined name warning is emitted if a name first defined by a the - tuple-unpacking form of the C{with} statement is used before the - C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - baz - with open('foo') as (bar, baz): - pass - ''', m.UndefinedName) - - - def test_withStatementSingleNameRedefined(self): - """ - A redefined name warning is emitted if a name bound by an import is - rebound by the name defined by a C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - import bar - with open('foo') as bar: - pass - ''', m.RedefinedWhileUnused) - - - def test_withStatementTupleNamesRedefined(self): - """ - A redefined name warning is emitted if a name bound by an import is - rebound by one of the names defined by the tuple-unpacking form of a - C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - import bar - with open('foo') as (bar, baz): - pass - ''', m.RedefinedWhileUnused) - - - def test_withStatementUndefinedInside(self): - """ - An undefined name warning is emitted if a name is used inside the - body of a C{with} statement without first being bound. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as bar: - baz - ''', m.UndefinedName) - - - def test_withStatementNameDefinedInBody(self): - """ - A name defined in the body of a C{with} statement can be used after - the body ends without warning. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as bar: - baz = 10 - baz - ''') - - - def test_withStatementUndefinedInExpression(self): - """ - An undefined name warning is emitted if a name in the I{test} - expression of a C{with} statement is undefined. - """ - self.flakes(''' - from __future__ import with_statement - with bar as baz: - pass - ''', m.UndefinedName) - - self.flakes(''' - from __future__ import with_statement - with bar as bar: - pass - ''', m.UndefinedName) - - def test_listNestedListComprehension(self): - self.flakes(''' - root = [['213', '123'], ['4354']] - foo = [int(c) for group in root for c in group] - ''') - diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/test/test_script.py b/dot.vim/ftplugin/pyflakes/pyflakes/test/test_script.py deleted file mode 100644 index b6fb685..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/test/test_script.py +++ /dev/null @@ -1,48 +0,0 @@ - -""" -Tests for L{pyflakes.scripts.pyflakes}. -""" - -import sys -from StringIO import StringIO - -from twisted.python.filepath import FilePath -from twisted.trial.unittest import TestCase - -from pyflakes.scripts.pyflakes import checkPath - -def withStderrTo(stderr, f): - """ - Call C{f} with C{sys.stderr} redirected to C{stderr}. - """ - (outer, sys.stderr) = (sys.stderr, stderr) - try: - return f() - finally: - sys.stderr = outer - - - -class CheckTests(TestCase): - """ - Tests for L{check} and L{checkPath} which check a file for flakes. - """ - def test_missingTrailingNewline(self): - """ - Source which doesn't end with a newline shouldn't cause any - exception to be raised nor an error indicator to be returned by - L{check}. - """ - fName = self.mktemp() - FilePath(fName).setContent("def foo():\n\tpass\n\t") - self.assertFalse(checkPath(fName)) - - - def test_checkPathNonExisting(self): - """ - L{checkPath} handles non-existing files. - """ - err = StringIO() - count = withStderrTo(err, lambda: checkPath('extremo')) - self.assertEquals(err.getvalue(), 'extremo: no such file\n') - self.assertEquals(count, 1) diff --git a/dot.vim/ftplugin/pyflakes/pyflakes/test/test_undefined_names.py b/dot.vim/ftplugin/pyflakes/pyflakes/test/test_undefined_names.py deleted file mode 100644 index 57e4e3c..0000000 --- a/dot.vim/ftplugin/pyflakes/pyflakes/test/test_undefined_names.py +++ /dev/null @@ -1,182 +0,0 @@ - -from sys import version_info - -from pyflakes import messages as m -from pyflakes.test import harness - - -class Test(harness.Test): - def test_undefined(self): - self.flakes('bar', m.UndefinedName) - - def test_definedInListComp(self): - self.flakes('[a for a in range(10) if a]') - - - def test_functionsNeedGlobalScope(self): - self.flakes(''' - class a: - def b(): - fu - fu = 1 - ''') - - def test_builtins(self): - self.flakes('range(10)') - - def test_magic_globals(self): - self.flakes('__file__') - - def test_globalImportStar(self): - '''Can't find undefined names with import *''' - self.flakes('from fu import *; bar', m.ImportStarUsed) - - def test_localImportStar(self): - '''A local import * still allows undefined names to be found in upper scopes''' - self.flakes(''' - def a(): - from fu import * - bar - ''', m.ImportStarUsed, m.UndefinedName) - - def test_unpackedParameter(self): - '''Unpacked function parameters create bindings''' - self.flakes(''' - def a((bar, baz)): - bar; baz - ''') - - def test_definedByGlobal(self): - '''"global" can make an otherwise undefined name in another function defined''' - self.flakes(''' - def a(): global fu; fu = 1 - def b(): fu - ''') - test_definedByGlobal.todo = '' - - def test_del(self): - '''del deletes bindings''' - self.flakes('a = 1; del a; a', m.UndefinedName) - - def test_delGlobal(self): - '''del a global binding from a function''' - self.flakes(''' - a = 1 - def f(): - global a - del a - a - ''') - - def test_delUndefined(self): - '''del an undefined name''' - self.flakes('del a', m.UndefinedName) - - def test_globalFromNestedScope(self): - '''global names are available from nested scopes''' - self.flakes(''' - a = 1 - def b(): - def c(): - a - ''') - - def test_laterRedefinedGlobalFromNestedScope(self): - """ - Test that referencing a local name that shadows a global, before it is - defined, generates a warning. - """ - self.flakes(''' - a = 1 - def fun(): - a - a = 2 - ''', m.UndefinedLocal) - - def test_laterRedefinedGlobalFromNestedScope2(self): - """ - Test that referencing a local name in a nested scope that shadows a - global declared in an enclosing scope, before it is defined, generates - a warning. - """ - self.flakes(''' - a = 1 - def fun(): - global a - def fun2(): - a - a = 2 - ''', m.UndefinedLocal) - - - def test_doubleNestingReportsClosestName(self): - """ - Test that referencing a local name in a nested scope that shadows a - variable declared in two different outer scopes before it is defined - in the innermost scope generates an UnboundLocal warning which - refers to the nearest shadowed name. - """ - exc = self.flakes(''' - def a(): - x = 1 - def b(): - x = 2 # line 5 - def c(): - x - x = 3 - ''', m.UndefinedLocal).messages[0] - self.assertEqual(exc.message_args, ('x', 5)) - - - def test_laterRedefinedGlobalFromNestedScope3(self): - """ - Test that referencing a local name in a nested scope that shadows a - global, before it is defined, generates a warning. - """ - self.flakes(''' - def fun(): - a = 1 - def fun2(): - a - a = 1 - ''', m.UndefinedLocal) - - def test_nestedClass(self): - '''nested classes can access enclosing scope''' - self.flakes(''' - def f(foo): - class C: - bar = foo - def f(self): - return foo - return C() - - f(123).f() - ''') - - def test_badNestedClass(self): - '''free variables in nested classes must bind at class creation''' - self.flakes(''' - def f(): - class C: - bar = foo - foo = 456 - - f() - ''', m.UndefinedName) - - - -class Python24Test(harness.Test): - """ - Tests for checking of syntax which is valid in Python 2.4 and newer. - """ - if version_info < (2, 4): - skip = "Python 2.4 required for generator expression tests." - - def test_definedInGenExp(self): - """ - Using the loop variable of a generator expression results in no - warnings. - """ - self.flakes('(a for a in xrange(10) if a)') diff --git a/dot.vim/ftplugin/pyflakes/setup.py b/dot.vim/ftplugin/pyflakes/setup.py deleted file mode 100644 index d875a9e..0000000 --- a/dot.vim/ftplugin/pyflakes/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/python -# (c) 2005 Divmod, Inc. See LICENSE file for details - -from distutils.core import setup - -setup( - name="pyflakes", - license="MIT", - version="0.2.1", - description="passive checker of Python programs", - author="Phil Frost", - maintainer="Moe Aboulkheir", - maintainer_email="moe@divmod.com", - url="http://www.divmod.org/projects/pyflakes", - packages=["pyflakes", "pyflakes.scripts"], - scripts=["bin/pyflakes"], - long_description="""Pyflakes is program to analyze Python programs and detect various errors. It -works by parsing the source file, not importing it, so it is safe to use on -modules with side effects. It's also much faster.""") diff --git a/dot.vim/ftplugin/python_ifold.c.vim b/dot.vim/ftplugin/python_ifold.c.vim deleted file mode 100644 index 2ab9ebf..0000000 --- a/dot.vim/ftplugin/python_ifold.c.vim +++ /dev/null @@ -1,250 +0,0 @@ -" Vim folding file -" Language: Python -" Author: Jorrit Wiersma (foldexpr), Max Ischenko (foldtext), Robert, -" Ames (line counts), Jean-Pierre Chauvel (bugfixes and improvements) -" Last Change: 2008 Apr 20 -" Version: 2.9.c -" Bugfixes: Jean-Pierre Chauvel - - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -if !exists("g:ifold_mode") - let g:ifold_mode = 1 -endif - -" map f :call ToggleFold() - -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set expandtab -set autoindent -set foldcolumn=1 - -let w:nestinglevel = 0 -let w:signature = 0 -let w:is_folded = 1 - -function! PythonFoldText() - let line = getline(v:foldstart) - let nnum = nextnonblank(v:foldstart + 1) - let nextline = getline(nnum) - if nextline =~ '^\s\+"""$' - let line = line . getline(nnum + 1) - elseif nextline =~ '^\s\+"""' - let line = line . ' ' . matchstr(nextline, '"""\zs.\{-}\ze\("""\)\?$') - elseif nextline =~ '^\s\+"[^"]\+"$' - let line = line . ' ' . matchstr(nextline, '"\zs.*\ze"') - elseif nextline =~ '^\s\+pass\s*$' - let line = line . ' pass' - endif - let size = 1 + v:foldend - v:foldstart - if size < 10 - let size = " " . size - endif - if size < 100 - let size = " " . size - endif - if size < 1000 - let size = " " . size - endif - return size . " lines: " . line -endfunction - -function! GetPythonFold(lnum) - let line = getline(a:lnum - 1) - - " Classes and functions get their own folds - if line =~ '^\s*\(class\|def\)\s' - " Verify if the next line is a class or function definition - " as well - let imm_nnum = a:lnum + 1 - let nnum = nextnonblank(imm_nnum) - if nnum - imm_nnum < 2 - let nind = indent(nnum) - let pind = indent(a:lnum - 1) - if pind >= nind - let nline = getline(nnum) - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - endif - endif - let w:nestinglevel = indent(a:lnum - 1) - return ">" . ((w:nestinglevel + &sw) / &sw) - endif - - " If next line has less or equal indentation than the first one, - " we end a fold. - let nind = indent(nextnonblank(a:lnum + 1)) - if nind <= w:nestinglevel - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - else - let ind = indent(a:lnum) - if ind == (w:nestinglevel + &sw) - if nind < ind - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - endif - endif - endif - - " If none of the above apply, keep the indentation - return "=" -endfunction - -function! GetPythonFoldBest(lnum) - " Determine folding level in Python source - " - let line = getline(a:lnum - 1) - - " Handle Support markers - if line =~ '{{{' - return "a1" - elseif line =~ '}}}' - return "s1" - endif - - " Classes and functions get their own folds - if line =~ '^\s*\(class\|def\)\s' - " Verify if the next line is a class or function definition - " as well - let imm_nnum = a:lnum + 1 - let nnum = nextnonblank(imm_nnum) - let nind = indent(nnum) - let pind = indent(a:lnum - 1) - if pind >= nind - let nline = getline(nnum) - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - endif - let w:nestinglevel = indent(a:lnum - 1) - return ">" . ((w:nestinglevel + &sw) / &sw) - endif - - " If next line has less or equal indentation than the first one, - " we end a fold. - let nnonblank = nextnonblank(a:lnum + 1) - let nextline = getline(nnonblank) - if (nextline !~ '^#\+.*') - let nind = indent(nnonblank) - if nind <= w:nestinglevel - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - else - let ind = indent(a:lnum) - if ind == (w:nestinglevel + &sw) - if nind < ind - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - endif - endif - endif - endif - - " If none of the above apply, keep the indentation - return "=" -endfunction - -function! GetPythonFoldExperimental(lnum) - " Determine folding level in Python source - " - let line = getline(a:lnum - 1) - - " Handle suport markers - if line =~ '{{{' - return "a1" - elseif line =~ '}}}' - return "s1" - endif - - " Classes and functions get their own folds - if line =~ '^\s*\(class\|def\)\s' - " Verify if the next line is a class or function definition - " as well - let imm_nnum = a:lnum + 1 - let nnum = nextnonblank(imm_nnum) - let nind = indent(nnum) - let pind = indent(a:lnum - 1) - if pind >= nind - let nline = getline(nnum) - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - endif - let w:signature = 1 - let w:nestinglevel = indent(a:lnum - 1) - endif - - if line =~ '^.*:' && w:signature - let w:signature = 0 - return ">" . ((w:nestinglevel + &sw) / &sw) - endif - - " If next line has less or equal indentation than the first one, - " we end a fold. - let nnonblank = nextnonblank(a:lnum + 1) - let nextline = getline(nnonblank) - if (nextline !~ '^#\+.*') - let nind = indent(nnonblank) - if nind <= w:nestinglevel - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - else - let ind = indent(a:lnum) - if ind == (w:nestinglevel + &sw) - if nind < ind - let w:nestinglevel = nind - return "<" . ((w:nestinglevel + &sw) / &sw) - endif - endif - endif - endif - - " If none of the above apply, keep the indentation - return "=" -endfunction - -function! ToggleFold() - let w:nestinglevel = 0 - let w:signature = 0 - if w:is_folded - set foldexpr=0 - let w:is_folded = 0 - else - call ReFold() - " Open the fold we are in - exec 'norm! zO' - let w:is_folded = 1 - endif -endfunction - -" In case folding breaks down -function! ReFold() - set foldmethod=expr - set foldexpr=0 - set foldmethod=expr - if g:ifold_mode == 0 - set foldexpr=GetPythonFold(v:lnum) - else - if g:ifold_mode == 1 - set foldexpr=GetPythonFoldBest(v:lnum) - else - if g:ifold_mode == 2 - set foldexpr=GetPythonFoldExperimental(v:lnum) - endif - endif - endif - - if g:ifold_mode - set foldtext=PythonFoldText() - else - set foldtext='Folded\ code' - endif - echo -endfunction - -call ReFold() diff --git a/dot.vim/ftplugin/sass.vim b/dot.vim/ftplugin/sass.vim deleted file mode 100644 index ad03977..0000000 --- a/dot.vim/ftplugin/sass.vim +++ /dev/null @@ -1,18 +0,0 @@ -" Vim filetype plugin -" Language: Sass -" Maintainer: Tim Pope - -" 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< inc< ofu<" - -setlocal commentstring=//\ %s -setlocal omnifunc=csscomplete#CompleteCSS - -let &l:include = '^\s*@import\s\+\%(url(\)\=' - -" vim:set sw=2: diff --git a/dot.vim/ftplugin/textile.vim b/dot.vim/ftplugin/textile.vim deleted file mode 100644 index 32ca699..0000000 --- a/dot.vim/ftplugin/textile.vim +++ /dev/null @@ -1,51 +0,0 @@ -" 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 rp :TextilePreview -noremap rf :TextileRenderFile -noremap rt :TextileRenderTab -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 = "" . bufname("%") . "\n" . html . "\n" - return writefile(split(html, "\n"), a:filename) -endfunction - -function! TextileRenderBufferToPreview() - let filename = "/tmp/textile-preview.html" - call TextileRenderFile(getbufline(bufname("%"), 1, '$'), filename) - - " Modify this line to make it compatible on other platforms - call system("open -a Safari ". filename) -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/dot.vim/ftplugin/vimwiki.vim b/dot.vim/ftplugin/vimwiki.vim deleted file mode 100644 index 7d66e14..0000000 --- a/dot.vim/ftplugin/vimwiki.vim +++ /dev/null @@ -1,384 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki filetype plugin file -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 " Don't load another plugin for this buffer - -" UNDO list {{{ -" Reset the following options to undo this plugin. -let b:undo_ftplugin = "setlocal ". - \ "suffixesadd< isfname< comments< ". - \ "autowriteall< ". - \ "formatoptions< foldtext< ". - \ "foldmethod< foldexpr< commentstring< " -" UNDO }}} - -" MISC STUFF {{{ - -setlocal autowriteall -setlocal commentstring= - -if g:vimwiki_conceallevel && exists("+conceallevel") - let &conceallevel = g:vimwiki_conceallevel -endif - -" MISC }}} - -" GOTO FILE: gf {{{ -execute 'setlocal suffixesadd='.VimwikiGet('ext') -setlocal isfname-=[,] -" gf}}} - -" Autocreate list items {{{ -" for list items, and list items with checkboxes -if VimwikiGet('syntax') == 'default' - setl comments=b:*,b:#,b:- - setl formatlistpat=^\\s*[*#-]\\s* -else - setl comments=n:*,n:# -endif -setlocal formatoptions=tnro - -if !empty(&langmap) - " Valid only if langmap is a comma separated pairs of chars - let l_o = matchstr(&langmap, '\C,\zs.\zeo,') - if l_o - exe 'nnoremap '.l_o.' :call vimwiki_lst#kbd_oO("o")a' - endif - - let l_O = matchstr(&langmap, '\C,\zs.\zeO,') - if l_O - exe 'nnoremap '.l_O.' :call vimwiki_lst#kbd_oO("O")a' - endif -endif - -" COMMENTS }}} - -" FOLDING for headers and list items using expr fold method. {{{ -function! VimwikiFoldLevel(lnum) "{{{ - let line = getline(a:lnum) - - " Header folding... - if line =~ g:vimwiki_rxHeader - let n = vimwiki#count_first_sym(line) - return '>'.n - endif - - if g:vimwiki_fold_trailing_empty_lines == 0 - if line =~ '^\s*$' - let nnline = getline(nextnonblank(a:lnum + 1)) - if nnline =~ g:vimwiki_rxHeader - let n = vimwiki#count_first_sym(nnline) - return '<'.n - endif - endif - endif - - " List item folding... - if g:vimwiki_fold_lists - let base_level = s:get_base_level(a:lnum) - - let rx_list_item = '\('. - \ g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber. - \ '\)' - - - if line =~ rx_list_item - let [nnum, nline] = s:find_forward(rx_list_item, a:lnum) - let level = s:get_li_level(a:lnum) - let leveln = s:get_li_level(nnum) - let adj = s:get_li_level(s:get_start_list(rx_list_item, a:lnum)) - - if leveln > level - return ">".(base_level+leveln-adj) - else - return (base_level+level-adj) - endif - else - " process multilined list items - let [pnum, pline] = s:find_backward(rx_list_item, a:lnum) - if pline =~ rx_list_item - if indent(a:lnum) > indent(pnum) - let level = s:get_li_level(pnum) - let adj = s:get_li_level(s:get_start_list(rx_list_item, pnum)) - - let [nnum, nline] = s:find_forward(rx_list_item, a:lnum) - if nline =~ rx_list_item - let leveln = s:get_li_level(nnum) - if leveln > level - return (base_level+leveln-adj) - endif - endif - - return (base_level+level-adj) - endif - endif - endif - - return base_level - endif - - return -1 -endfunction "}}} - -function! s:get_base_level(lnum) "{{{ - let lnum = a:lnum - 1 - while lnum > 0 - if getline(lnum) =~ g:vimwiki_rxHeader - return vimwiki#count_first_sym(getline(lnum)) - endif - let lnum -= 1 - endwhile - return 0 -endfunction "}}} - -function! s:find_forward(rx_item, lnum) "{{{ - let lnum = a:lnum + 1 - - while lnum <= line('$') - let line = getline(lnum) - if line =~ a:rx_item - \ || line =~ '^\S' - \ || line =~ g:vimwiki_rxHeader - break - endif - let lnum += 1 - endwhile - - return [lnum, getline(lnum)] -endfunction "}}} - -function! s:find_backward(rx_item, lnum) "{{{ - let lnum = a:lnum - 1 - - while lnum > 1 - let line = getline(lnum) - if line =~ a:rx_item - \ || line =~ '^\S' - break - endif - let lnum -= 1 - endwhile - - return [lnum, getline(lnum)] -endfunction "}}} - -function! s:get_li_level(lnum) "{{{ - if VimwikiGet('syntax') == 'media' - let level = vimwiki#count_first_sym(getline(a:lnum)) - else - let level = (indent(a:lnum) / &sw) - endif - return level -endfunction "}}} - -function! s:get_start_list(rx_item, lnum) "{{{ - let lnum = a:lnum - while lnum >= 1 - let line = getline(lnum) - if line !~ a:rx_item && line =~ '^\S' - return nextnonblank(lnum + 1) - endif - let lnum -= 1 - endwhile - return 0 -endfunction "}}} - -function! VimwikiFoldText() "{{{ - let line = substitute(getline(v:foldstart), '\t', - \ repeat(' ', &tabstop), 'g') - return line.' ['.(v:foldend - v:foldstart).']' -endfunction "}}} - -" FOLDING }}} - -" COMMANDS {{{ -command! -buffer Vimwiki2HTML - \ call vimwiki_html#Wiki2HTML(expand(VimwikiGet('path_html')), - \ expand('%')) -command! -buffer VimwikiAll2HTML - \ call vimwiki_html#WikiAll2HTML(expand(VimwikiGet('path_html'))) - -command! -buffer VimwikiNextLink call vimwiki#find_next_link() -command! -buffer VimwikiPrevLink call vimwiki#find_prev_link() -command! -buffer VimwikiDeleteLink call vimwiki#delete_link() -command! -buffer VimwikiRenameLink call vimwiki#rename_link() -command! -buffer VimwikiFollowLink call vimwiki#follow_link('nosplit') -command! -buffer VimwikiGoBackLink call vimwiki#go_back_link() -command! -buffer VimwikiSplitLink call vimwiki#follow_link('split') -command! -buffer VimwikiVSplitLink call vimwiki#follow_link('vsplit') - -command! -buffer -range VimwikiToggleListItem call vimwiki_lst#ToggleListItem(, ) - -command! -buffer VimwikiGenerateLinks call vimwiki#generate_links() - -exe 'command! -buffer -nargs=* VimwikiSearch vimgrep '. - \ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ') - -exe 'command! -buffer -nargs=* VWS vimgrep '. - \ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ') - -command! -buffer -nargs=1 VimwikiGoto call vimwiki#goto("") - -" table commands -command! -buffer -nargs=* VimwikiTable call vimwiki_tbl#create() -command! -buffer VimwikiTableAlignQ call vimwiki_tbl#align_or_cmd('gqq') -command! -buffer VimwikiTableAlignW call vimwiki_tbl#align_or_cmd('gww') -command! -buffer VimwikiTableMoveColumnLeft call vimwiki_tbl#move_column_left() -command! -buffer VimwikiTableMoveColumnRight call vimwiki_tbl#move_column_right() - -" diary commands -command! -buffer VimwikiDiaryNextDay call vimwiki_diary#goto_next_day() -command! -buffer VimwikiDiaryPrevDay call vimwiki_diary#goto_prev_day() - -" COMMANDS }}} - -" KEYBINDINGS {{{ -if g:vimwiki_use_mouse - nmap - nmap - noremap <2-LeftMouse> :VimwikiFollowLink - noremap :VimwikiSplitLink - noremap :VimwikiVSplitLink - noremap :VimwikiGoBackLink -endif - -if !hasmapto('VimwikiFollowLink') - nmap VimwikiFollowLink -endif -noremap ${2} -snippet scriptsrc - ${2} -snippet style - ${3} -snippet base - -snippet r - -snippet div -
    - ${2} -
    -# Embed QT Movie -snippet movie - - - - - - ${6} -snippet fieldset -
    - ${1:name} - - ${3} -
    -snippet form -
    - ${3} - - -

    -
    -snippet h1 -

    ${2:$1}

    -snippet input - ${4} -snippet label - ${7} -snippet link - ${4} -snippet mailto - ${3:email me} -snippet meta - ${3} -snippet opt - ${3} -snippet optt - ${2} -snippet select - ${5} -snippet table - - - -
    ${2:Header}
    ${3:Data}
    ${4} -snippet textarea - ${5} diff --git a/dot.vim/snippets/java.snippets b/dot.vim/snippets/java.snippets deleted file mode 100644 index fd705cb..0000000 --- a/dot.vim/snippets/java.snippets +++ /dev/null @@ -1,78 +0,0 @@ -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 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} diff --git a/dot.vim/snippets/javascript.snippets b/dot.vim/snippets/javascript.snippets deleted file mode 100644 index 51f5e05..0000000 --- a/dot.vim/snippets/javascript.snippets +++ /dev/null @@ -1,74 +0,0 @@ -# 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/dot.vim/snippets/mako.snippets b/dot.vim/snippets/mako.snippets deleted file mode 100644 index 2a0aef9..0000000 --- a/dot.vim/snippets/mako.snippets +++ /dev/null @@ -1,54 +0,0 @@ -snippet def - <%def name="${1:name}"> - ${2:} - -snippet call - <%call expr="${1:name}"> - ${2:} - -snippet doc - <%doc> - ${1:} - -snippet text - <%text> - ${1:} - -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 -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/dot.vim/snippets/objc.snippets b/dot.vim/snippets/objc.snippets deleted file mode 100644 index 4749bb7..0000000 --- a/dot.vim/snippets/objc.snippets +++ /dev/null @@ -1,184 +0,0 @@ -# #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 -# Class Implementation -snippet impl - @implementation ${1:`Filename('', 'someClass')`} - ${2} - @end -snippet init - - (id)init - { - [super init]; - return self; - } -snippet ifself - if (self = [super init]) { - ${1:/* code */} - } - return self; -snippet ibo - IBOutlet ${1:NSSomeClass} *${2:$1};${3} -# Category -snippet cat - @interface ${1:NSObject} (${2:Category}) - @end - - @implementation $1 ($2) - ${3} - @end -# Category Interface -snippet cath - @interface ${1:NSObject} (${2:Category}) - ${3} - @end -# NSArray -snippet array - NSMutableArray *${1:array} = [NSMutable array];${2} -# NSDictionary -snippet dict - NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2} -# NSBezierPath -snippet bez - NSBezierPath *${1:path} = [NSBezierPath bezierPath];${2} -# 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; - } -# Method: Initialize -snippet I - + (void) initialize - { - [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWIthObjectsAndKeys: - ${1}@"value", @"key", - nil]]; - } -# 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 forarray - unsigned int ${1:object}Count = [${2:array} count]; - - for (unsigned int index = 0; index < $1Count; index++) { - ${3:id} $1 = [$2 $1AtIndex:index]; - ${4} - } -# 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} -# retain -snippet ret - [${1:foo} retain];${2} -# release -snippet rel - [${1:foo} release]; - ${2:$1 = nil;} -# 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:foo} -snippet cl - @class ${1:Foo};${2} -snippet color - [[NSColor ${1:blackColor}] set]; diff --git a/dot.vim/snippets/perl.snippets b/dot.vim/snippets/perl.snippets deleted file mode 100644 index cf8f9fc..0000000 --- a/dot.vim/snippets/perl.snippets +++ /dev/null @@ -1,91 +0,0 @@ -# #!/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} -# For Loop -snippet for - for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4:# body...} - } -# Foreach Loop -snippet fore - foreach my $${1:x} (@${2:array}) { - ${3:# body...} - } -# Foreach Loop One-line -snippet xfore - ${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 = ; close FILE }${3} diff --git a/dot.vim/snippets/php.snippets b/dot.vim/snippets/php.snippets deleted file mode 100644 index 3ce9e26..0000000 --- a/dot.vim/snippets/php.snippets +++ /dev/null @@ -1,216 +0,0 @@ -snippet php - -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/dot.vim/snippets/python.snippets b/dot.vim/snippets/python.snippets deleted file mode 100644 index d511184..0000000 --- a/dot.vim/snippets/python.snippets +++ /dev/null @@ -1,86 +0,0 @@ -snippet #! - #!/usr/bin/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/dot.vim/snippets/ruby.snippets b/dot.vim/snippets/ruby.snippets deleted file mode 100644 index bf1d7f1..0000000 --- a/dot.vim/snippets/ruby.snippets +++ /dev/null @@ -1,420 +0,0 @@ -# #!/usr/bin/ruby -snippet #! - #!/usr/bin/ruby - -# New Block -snippet =b - =begin rdoc - ${1} - =end -snippet y - :yields: ${1:arguments} -snippet rb - #!/usr/bin/env ruby -wKU - -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 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 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 eak - each_key { |${1:key}| ${2} } -snippet eal - each_line { |${1:line}| ${2} } -snippet eap - each_pair { |${1:name}, ${2:val}| ${3} } -snippet eas- - each_slice(${1:2}) { |${2:group}| ${3} } -snippet eav - each_value { |${1:val}| ${2} } -snippet eawi - each_with_index { |${1:e}, ${2:i}| ${3} } -snippet reve - reverse_each { |${1:e}| ${2} } -snippet inj - inject(${1:init}) { |${2:mem}, ${3:var}| ${4} } -snippet map - map { |${1:e}| ${2} } -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 det - detect { |${1:e}| ${2} } -snippet fet - fetch(${1:name}) { |${2:key}| ${3} } -snippet fin - find { |${1:e}| ${2} } -snippet fina - find_all { |${1:e}| ${2} } -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 max - max { |a, b|, ${1} } -snippet min - min { |a, b|, ${1} } -snippet par - partition { |${1:e}|, ${2} } -snippet rej - reject { |${1:e}|, ${2} } -snippet sel - select { |${1:e}|, ${2} } -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/dot.vim/snippets/sh.snippets b/dot.vim/snippets/sh.snippets deleted file mode 100644 index f035126..0000000 --- a/dot.vim/snippets/sh.snippets +++ /dev/null @@ -1,28 +0,0 @@ -# #!/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/dot.vim/snippets/snippet.snippets b/dot.vim/snippets/snippet.snippets deleted file mode 100644 index 854c058..0000000 --- a/dot.vim/snippets/snippet.snippets +++ /dev/null @@ -1,7 +0,0 @@ -# snippets for making snippets :) -snippet snip - snippet ${1:trigger} - ${2} -snippet msnip - snippet ${1:trigger} ${2:description} - ${3} diff --git a/dot.vim/snippets/tcl.snippets b/dot.vim/snippets/tcl.snippets deleted file mode 100644 index bee2ef8..0000000 --- a/dot.vim/snippets/tcl.snippets +++ /dev/null @@ -1,92 +0,0 @@ -# #!/usr/bin/tclsh -snippet #! - #!/usr/bin/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/dot.vim/snippets/vim.snippets b/dot.vim/snippets/vim.snippets deleted file mode 100644 index 64e7807..0000000 --- a/dot.vim/snippets/vim.snippets +++ /dev/null @@ -1,32 +0,0 @@ -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/dot.vim/snippets/zsh.snippets b/dot.vim/snippets/zsh.snippets deleted file mode 100644 index 7aee05b..0000000 --- a/dot.vim/snippets/zsh.snippets +++ /dev/null @@ -1,58 +0,0 @@ -# #!/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/dot.vim/src/CSParser.cs b/dot.vim/src/CSParser.cs deleted file mode 100644 index b7d5add..0000000 --- a/dot.vim/src/CSParser.cs +++ /dev/null @@ -1,165 +0,0 @@ -namespace Wangfc { - using System; - using System.Reflection; - public class CSParser { - static string tn = null; - static string[] libs ; - static string[] nss ; - static string bas=null; - // mono CSParaser typename libs namespace - // mono CSParaser Assembly d:/mono-1.1.13.4/lib/mono/2.0/mscorlib.dll "System;System.Reflection" - public static void Main(string[] argv) { - if ( argv.Length < 2 ) { - return; - } - if ( argv.Length >3 ) { - bas = argv[3]; - } - tn = argv[0]; - - libs = argv[1].Split(';'); - if ( argv.Length < 3 ) { - nss = new string[1]; - nss[0]=""; - } - else { - nss = argv[2].Split(';'); - for ( int i = 0 ; i < nss.Length ; i++ ) { - if (nss[i].Trim().Length==0) - nss[i] = ""; - else - nss[i] = nss[i].Trim()+"."; - } - } - findType(); - } - private static void findType() { - foreach ( string lib in libs ) { - Assembly assem = Assembly.LoadFrom(lib); - if ( assem == null ) { - continue; - } - Module[] module = assem.GetModules(); - if (module != null ) { - foreach (Module m in module) { - if (genModule(m)) { - return; - } - } - } - Type[] typeInfo = assem.GetTypes(); - int find = 0; - string fchar = " " ; - foreach ( string ns in nss) { - string tof = ns+tn; - int len = tof.Length; - if ( bas != null ) { - tof = tof+"."+bas ; - } - foreach ( Type t in typeInfo) { - if ( t.FullName.StartsWith(tof) && - t.FullName.IndexOf('.',len+1,t.FullName.Length-len-1)<0) { - if (find==0) { - Console.WriteLine("["); - Console.WriteLine("\""+ns+tn+"\","); - Console.WriteLine("["); - find = 2; - } - Console.WriteLine( fchar +"[\""+ t.FullName.Substring(len+1) + "\",\""+t.FullName+"\"]"); - fchar = ","; - find += 1; - if ( find>=50) { - break; - } - } - } - if ( find > 0 ) { - Console.WriteLine("],"); - //constructor - Console.WriteLine("["); - Console.WriteLine("],"); - //methods - Console.WriteLine("["); - Console.WriteLine("],"); - // inner class - Console.WriteLine("["); - Console.WriteLine("],"); - Console.WriteLine("0"); - Console.WriteLine("]"); - return; - } - } - } - } - private static bool genModule(Module m) { - foreach ( string ns in nss) { - Type t = m.GetType(ns+ tn); - if ( t != null ) { - genType(t); - return true; - } - } - /* - Type[] infos = m.GetTypes(); - foreach ( Type t in infos) { - } - */ - return false; - } - private static void genType(Type t ) { - Console.WriteLine("["); - Console.WriteLine("\""+t.FullName+"\","); - string fchar = " " ; - // properties - PropertyInfo[] infos = t.GetProperties(); - Console.WriteLine("["); - foreach (PropertyInfo i in infos ) { - Console.WriteLine( fchar +"[\""+ i.Name + "\",\""+i.PropertyType+"\"]"); - fchar = ","; - } - Console.WriteLine("],"); - - //constructor - Console.WriteLine("["); - Console.WriteLine("],"); - // methods - Console.WriteLine("["); - fchar=" "; - MethodInfo[] methods = t.GetMethods(); - foreach ( MethodInfo m in methods ) { - Console.Write( fchar +"[\""+ m.Name + "\",\""+m.ReturnType+"\","); - ParameterInfo[] paras = m.GetParameters(); - string mchar=""; - foreach ( ParameterInfo pi in paras ) { - Console.Write(mchar+"\""+pi.ParameterType+ " " + pi.Name + "\""); - mchar=","; - } - Console.WriteLine(mchar+"[ ],0]"); - fchar=","; - } - Console.WriteLine("],"); - // inner class - Console.WriteLine("["); - Console.WriteLine("],"); - Console.WriteLine("0"); - Console.WriteLine("]"); - - /* - FieldInfo[] infos = t.GetFields(); - foreach ( FieldInfo i in infos ) { - Console.WriteLine(fchar + i.Name); - fchar = ","; - } - */ - /* - MemberInfo[] infos = t.GetMembers(); - foreach ( MemberInfo i in infos ) { - Console.WriteLine(fchar + i.Name); - fchar = ","; - } - */ - } - } -} - -// vim: ts=4 sws=4 diff --git a/dot.vim/src/Makefile b/dot.vim/src/Makefile deleted file mode 100644 index 78db7d6..0000000 --- a/dot.vim/src/Makefile +++ /dev/null @@ -1,25 +0,0 @@ - -LEX = flex -I -#cc = gcc -DYYDEBUG=1 -CC = gcc -DYYDEBUG=1 - -dll : - #flex tipswnd.lex - $(CC) -o ../plugin/vjde/tipswnd.dll -shared lex.yy.c -DDLL -lcomctl32 -lgdi32 -mwindows - $(CC) -o ../plugin/vjde/readtags -DREADTAGS_MAIN readtags.c -mwindows - g++ -o ../plugin/vjde/wspawn wspawn.cpp -mwindows - -tipswnd :build/lex.yy.o - $(CC) -o tipswnd build/lex.yy.o -luser32 -lcomctl32 -lgdi32 -mwindows - - -build/%.o :%.c - $(CC) -c -o build/$(*F).o $< - -lex.yy.c :tipswnd.lex - flex tipswnd.lex - -clean : - rm -rf build/*.o - rm lex.yy.c - diff --git a/dot.vim/src/lex.yy.c b/dot.vim/src/lex.yy.c deleted file mode 100644 index 26004ba..0000000 --- a/dot.vim/src/lex.yy.c +++ /dev/null @@ -1,2447 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 57 -#define YY_END_OF_BUFFER 58 -static yyconst short int yy_accept[367] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 58, 48, - 56, 52, 1, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 46, 55, 51, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 55, 55, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 47, - 54, 49, 47, 47, 47, 47, 47, 47, 47, 47, - 54, 54, 47, 47, 47, 47, 47, 47, 47, 37, - 53, 50, 2, 37, 37, 37, 37, 37, 37, 37, - 48, 56, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 46, 55, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 0, 0, 44, - 55, 55, 55, 44, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 47, 54, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, - 45, 54, 54, 54, 45, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 37, 36, 35, 53, 37, 37, - 37, 37, 37, 37, 37, 48, 48, 48, 48, 48, - 48, 48, 30, 48, 48, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 16, 46, 46, 44, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 16, 46, 46, - - 47, 47, 47, 47, 47, 47, 23, 47, 47, 45, - 47, 47, 47, 47, 47, 47, 23, 47, 47, 37, - 37, 37, 37, 37, 6, 37, 48, 48, 48, 48, - 27, 26, 48, 28, 29, 46, 46, 0, 46, 46, - 46, 13, 12, 46, 14, 15, 46, 46, 0, 46, - 46, 46, 13, 12, 46, 14, 15, 0, 47, 47, - 20, 19, 47, 21, 22, 0, 47, 47, 20, 19, - 47, 21, 22, 37, 37, 8, 37, 37, 7, 48, - 48, 48, 48, 48, 46, 46, 0, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 0, 47, 47, - - 47, 47, 47, 47, 9, 37, 37, 5, 48, 48, - 24, 48, 25, 46, 46, 0, 34, 10, 46, 11, - 46, 46, 34, 10, 46, 11, 0, 33, 17, 18, - 33, 17, 18, 3, 4, 48, 48, 41, 46, 46, - 0, 38, 46, 46, 38, 0, 48, 40, 46, 43, - 0, 46, 43, 0, 48, 46, 32, 46, 31, 48, - 46, 46, 39, 42, 42, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 1, 1, 1, 1, 1, 1, 1, 5, - 6, 1, 1, 7, 8, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, - 1, 1, 1, 1, 10, 1, 11, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, - 1, 13, 14, 15, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 16, 17, 18, 19, - - 20, 21, 22, 23, 24, 1, 1, 25, 26, 27, - 28, 1, 1, 29, 30, 31, 32, 1, 33, 1, - 34, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[35] = - { 0, - 1, 2, 3, 2, 4, 1, 5, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[378] = - { 0, - 0, 0, 34, 68, 101, 127, 153, 177, 915, 0, - 105, 916, 916, 898, 893, 881, 888, 876, 886, 880, - 880, 878, 873, 0, 109, 916, 888, 883, 86, 879, - 867, 877, 871, 871, 869, 864, 131, 120, 158, 201, - 208, 227, 162, 116, 199, 212, 180, 213, 194, 0, - 169, 916, 175, 861, 871, 865, 865, 863, 858, 246, - 185, 253, 260, 218, 246, 251, 254, 266, 268, 136, - 119, 916, 142, 214, 289, 239, 162, 296, 298, 300, - 0, 306, 860, 857, 858, 857, 854, 868, 851, 851, - 854, 855, 0, 307, 850, 847, 857, 849, 846, 845, - - 842, 856, 839, 839, 842, 843, 252, 285, 314, 295, - 325, 329, 336, 337, 322, 328, 330, 336, 342, 345, - 344, 361, 358, 360, 373, 363, 0, 394, 845, 837, - 831, 824, 835, 818, 815, 814, 812, 375, 401, 406, - 387, 413, 417, 424, 425, 392, 410, 415, 416, 429, - 430, 428, 443, 444, 317, 328, 351, 159, 449, 451, - 465, 470, 472, 475, 477, 820, 786, 793, 788, 795, - 785, 796, 0, 788, 784, 791, 774, 801, 781, 761, - 755, 757, 735, 732, 0, 718, 703, 916, 470, 467, - 485, 490, 487, 495, 493, 505, 511, 513, 519, 527, - - 699, 682, 655, 651, 636, 646, 0, 635, 629, 916, - 536, 535, 537, 545, 550, 558, 553, 563, 566, 436, - 539, 542, 486, 586, 565, 589, 614, 605, 605, 589, - 0, 0, 591, 0, 0, 583, 569, 578, 560, 537, - 521, 0, 0, 513, 0, 0, 579, 584, 610, 597, - 599, 605, 611, 613, 621, 619, 627, 522, 510, 500, - 0, 0, 497, 0, 0, 651, 636, 642, 644, 650, - 652, 658, 660, 594, 600, 642, 679, 681, 686, 500, - 485, 475, 465, 468, 465, 446, 426, 429, 400, 383, - 382, 670, 675, 687, 693, 690, 685, 361, 370, 350, - - 350, 699, 705, 702, 691, 725, 728, 731, 324, 319, - 0, 338, 0, 299, 287, 282, 0, 0, 292, 0, - 719, 721, 722, 734, 735, 736, 268, 0, 0, 0, - 737, 749, 750, 756, 765, 245, 254, 0, 239, 247, - 199, 0, 755, 767, 758, 196, 184, 0, 168, 0, - 175, 764, 770, 166, 128, 123, 916, 772, 916, 128, - 123, 788, 0, 0, 780, 916, 819, 824, 829, 113, - 834, 838, 843, 848, 852, 857, 862 - } ; - -static yyconst short int yy_def[378] = - { 0, - 366, 1, 366, 366, 367, 368, 369, 369, 366, 370, - 366, 366, 366, 370, 370, 370, 370, 370, 370, 370, - 370, 370, 370, 371, 366, 366, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 372, 373, 373, 372, - 372, 372, 42, 42, 42, 42, 42, 42, 42, 374, - 366, 366, 374, 374, 374, 374, 374, 374, 374, 375, - 376, 376, 375, 63, 63, 63, 63, 63, 63, 377, - 366, 366, 377, 377, 377, 377, 377, 377, 377, 377, - 370, 366, 370, 370, 370, 370, 370, 370, 370, 370, - 370, 370, 371, 366, 371, 371, 371, 371, 371, 371, - - 371, 371, 371, 371, 371, 371, 42, 366, 373, 42, - 373, 373, 366, 373, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 374, 366, 374, 374, - 374, 374, 374, 374, 374, 374, 374, 63, 366, 376, - 63, 376, 376, 366, 376, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 377, 377, 377, 366, 377, 377, - 377, 377, 377, 377, 377, 370, 370, 370, 370, 370, - 370, 370, 370, 370, 370, 371, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 371, 366, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - - 374, 374, 374, 374, 374, 374, 374, 374, 374, 366, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 377, - 377, 377, 377, 377, 377, 377, 370, 370, 370, 370, - 370, 370, 370, 370, 370, 371, 371, 366, 371, 371, - 371, 371, 371, 371, 371, 371, 42, 42, 366, 42, - 42, 42, 42, 42, 42, 42, 42, 366, 374, 374, - 374, 374, 374, 374, 374, 366, 63, 63, 63, 63, - 63, 63, 63, 377, 377, 377, 377, 377, 377, 370, - 370, 370, 370, 370, 371, 371, 366, 371, 371, 371, - 371, 42, 42, 42, 42, 42, 42, 366, 374, 374, - - 374, 63, 63, 63, 377, 377, 377, 377, 370, 370, - 370, 370, 370, 371, 371, 366, 371, 371, 371, 371, - 42, 42, 42, 42, 42, 42, 366, 374, 374, 374, - 63, 63, 63, 377, 377, 370, 370, 370, 371, 371, - 366, 371, 42, 42, 42, 366, 370, 370, 371, 371, - 366, 42, 42, 366, 370, 371, 366, 42, 366, 370, - 371, 42, 370, 371, 42, 0, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366 - } ; - -static yyconst short int yy_nxt[951] = - { 0, - 10, 11, 12, 11, 13, 10, 11, 10, 10, 10, - 10, 14, 15, 16, 17, 10, 18, 19, 20, 10, - 10, 10, 10, 21, 22, 10, 23, 10, 10, 10, - 10, 10, 10, 10, 24, 25, 26, 25, 24, 24, - 25, 24, 24, 24, 24, 27, 28, 29, 30, 24, - 31, 32, 33, 24, 24, 24, 24, 34, 35, 24, - 36, 24, 24, 24, 24, 24, 24, 24, 37, 38, - 26, 38, 37, 37, 39, 37, 37, 37, 37, 40, - 41, 42, 43, 37, 44, 45, 46, 37, 37, 37, - 37, 47, 48, 37, 49, 37, 37, 37, 37, 37, - - 37, 37, 51, 52, 51, 97, 82, 51, 82, 98, - 94, 82, 94, 81, 53, 94, 99, 54, 55, 56, - 158, 111, 158, 111, 57, 58, 112, 59, 61, 52, - 61, 364, 108, 62, 108, 107, 363, 109, 110, 107, - 63, 156, 157, 64, 65, 66, 107, 156, 157, 121, - 67, 68, 361, 69, 71, 72, 71, 360, 73, 113, - 158, 113, 158, 74, 112, 114, 75, 156, 157, 76, - 128, 77, 128, 78, 359, 128, 79, 80, 71, 72, - 71, 107, 73, 357, 120, 107, 142, 74, 142, 162, - 75, 143, 107, 76, 129, 77, 356, 78, 130, 107, - - 79, 80, 108, 107, 108, 131, 124, 109, 110, 108, - 107, 108, 355, 107, 109, 110, 115, 107, 107, 156, - 157, 122, 107, 354, 107, 126, 351, 116, 108, 107, - 108, 107, 107, 109, 110, 107, 107, 138, 159, 123, - 125, 138, 107, 107, 156, 157, 117, 139, 138, 139, - 118, 149, 140, 141, 144, 350, 144, 119, 349, 143, - 145, 139, 348, 139, 347, 138, 140, 141, 150, 138, - 138, 107, 161, 138, 138, 107, 138, 138, 151, 146, - 152, 138, 107, 147, 138, 138, 108, 138, 108, 138, - 148, 138, 188, 153, 156, 157, 138, 346, 138, 154, - - 342, 156, 157, 156, 157, 156, 157, 82, 94, 82, - 94, 341, 82, 94, 107, 108, 340, 108, 107, 160, - 163, 114, 156, 157, 164, 107, 111, 165, 111, 339, - 113, 112, 113, 156, 157, 112, 114, 113, 108, 113, - 108, 107, 94, 188, 114, 107, 338, 107, 337, 191, - 189, 107, 107, 107, 336, 107, 156, 157, 190, 107, - 107, 107, 192, 107, 107, 107, 107, 107, 107, 330, - 193, 329, 107, 194, 195, 107, 196, 107, 328, 107, - 107, 107, 107, 107, 107, 327, 107, 200, 107, 197, - 198, 107, 107, 107, 138, 128, 107, 128, 138, 199, - - 128, 320, 139, 107, 139, 138, 138, 139, 210, 139, - 138, 211, 319, 145, 142, 138, 142, 138, 144, 143, - 144, 318, 138, 143, 145, 144, 139, 144, 139, 138, - 128, 210, 145, 138, 138, 138, 212, 317, 138, 138, - 138, 156, 157, 213, 215, 138, 214, 138, 138, 138, - 316, 138, 138, 138, 156, 157, 156, 157, 217, 138, - 138, 216, 138, 138, 220, 274, 138, 138, 219, 218, - 156, 157, 315, 138, 138, 156, 157, 156, 157, 221, - 156, 157, 156, 157, 314, 247, 107, 313, 249, 107, - 107, 156, 157, 107, 312, 222, 311, 107, 248, 224, - - 107, 223, 277, 226, 107, 225, 107, 250, 107, 107, - 251, 310, 253, 107, 107, 107, 107, 107, 107, 309, - 107, 301, 252, 107, 107, 107, 300, 255, 107, 299, - 107, 298, 107, 254, 107, 107, 107, 291, 107, 266, - 256, 107, 107, 107, 156, 157, 107, 156, 157, 107, - 107, 257, 267, 290, 138, 138, 138, 107, 138, 138, - 268, 276, 275, 289, 269, 138, 138, 138, 138, 138, - 156, 157, 138, 138, 271, 138, 138, 138, 270, 288, - 138, 138, 138, 138, 272, 138, 138, 287, 138, 138, - 273, 156, 157, 138, 156, 157, 138, 286, 107, 156, - - 157, 278, 107, 107, 292, 156, 157, 107, 285, 107, - 279, 108, 293, 108, 107, 284, 294, 188, 107, 287, - 107, 283, 107, 305, 107, 295, 306, 107, 107, 107, - 107, 282, 107, 281, 107, 107, 107, 296, 107, 280, - 107, 107, 107, 107, 107, 297, 107, 156, 157, 107, - 107, 107, 139, 265, 139, 302, 264, 107, 210, 138, - 298, 138, 263, 138, 262, 138, 138, 138, 303, 138, - 261, 138, 138, 138, 138, 138, 304, 138, 260, 138, - 138, 138, 138, 138, 156, 157, 156, 157, 138, 321, - 138, 156, 157, 107, 107, 323, 156, 157, 107, 259, - - 107, 322, 258, 307, 326, 107, 107, 331, 107, 107, - 107, 308, 107, 107, 324, 107, 107, 107, 138, 325, - 107, 333, 138, 107, 138, 138, 332, 246, 138, 138, - 156, 157, 138, 156, 157, 138, 156, 157, 107, 245, - 107, 107, 107, 345, 107, 107, 334, 335, 244, 343, - 344, 107, 107, 107, 107, 107, 138, 107, 107, 107, - 138, 156, 157, 243, 107, 107, 107, 138, 138, 138, - 156, 157, 138, 138, 352, 353, 242, 107, 107, 138, - 138, 107, 241, 107, 240, 107, 107, 107, 107, 107, - 107, 107, 358, 107, 107, 107, 365, 107, 239, 107, - - 107, 362, 107, 107, 238, 237, 236, 107, 235, 234, - 107, 107, 233, 232, 231, 230, 229, 228, 107, 50, - 50, 50, 50, 50, 60, 60, 60, 60, 60, 70, - 70, 70, 70, 70, 93, 227, 209, 93, 107, 107, - 208, 107, 107, 109, 109, 207, 109, 109, 127, 206, - 205, 127, 138, 138, 204, 138, 138, 140, 140, 203, - 140, 140, 155, 202, 201, 155, 155, 187, 186, 185, - 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, - 174, 173, 172, 171, 170, 169, 168, 167, 166, 137, - 136, 135, 134, 133, 132, 106, 105, 104, 103, 102, - - 101, 100, 96, 95, 92, 91, 90, 89, 88, 87, - 86, 85, 84, 83, 366, 9, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 366 - } ; - -static yyconst short int yy_chk[951] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - - 4, 4, 5, 5, 5, 29, 11, 5, 11, 29, - 25, 11, 25, 370, 5, 25, 29, 5, 5, 5, - 71, 38, 71, 38, 5, 5, 38, 5, 6, 6, - 6, 361, 37, 6, 37, 44, 360, 37, 37, 44, - 6, 70, 70, 6, 6, 6, 44, 73, 73, 44, - 6, 6, 356, 6, 7, 7, 7, 355, 7, 39, - 158, 39, 158, 7, 39, 39, 7, 77, 77, 7, - 51, 7, 51, 7, 354, 51, 7, 7, 8, 8, - 8, 43, 8, 351, 43, 43, 61, 8, 61, 77, - 8, 61, 43, 8, 53, 8, 349, 8, 53, 47, - - 8, 8, 40, 47, 40, 53, 47, 40, 40, 41, - 47, 41, 347, 49, 41, 41, 40, 49, 45, 74, - 74, 45, 45, 346, 49, 49, 341, 41, 42, 45, - 42, 46, 48, 42, 42, 46, 48, 64, 74, 46, - 48, 64, 46, 48, 76, 76, 42, 60, 64, 60, - 42, 64, 60, 60, 62, 340, 62, 42, 339, 62, - 62, 63, 337, 63, 336, 65, 63, 63, 65, 65, - 66, 107, 76, 67, 66, 107, 65, 67, 66, 63, - 67, 66, 107, 63, 67, 68, 108, 69, 108, 68, - 63, 69, 108, 68, 75, 75, 68, 327, 69, 69, - - 319, 78, 78, 79, 79, 80, 80, 82, 94, 82, - 94, 316, 82, 94, 110, 109, 315, 109, 110, 75, - 78, 109, 155, 155, 79, 110, 111, 80, 111, 314, - 112, 111, 112, 156, 156, 112, 112, 113, 114, 113, - 114, 115, 113, 113, 114, 115, 312, 116, 310, 117, - 115, 116, 115, 117, 309, 118, 157, 157, 116, 118, - 117, 119, 118, 121, 120, 119, 118, 121, 120, 301, - 119, 300, 119, 120, 121, 120, 122, 123, 299, 124, - 122, 123, 126, 124, 122, 298, 126, 126, 123, 123, - 124, 122, 125, 126, 138, 128, 125, 128, 138, 125, - - 128, 291, 139, 125, 139, 138, 141, 140, 139, 140, - 141, 146, 290, 140, 142, 146, 142, 141, 143, 142, - 143, 289, 146, 143, 143, 144, 145, 144, 145, 147, - 144, 144, 145, 147, 148, 149, 147, 288, 148, 149, - 147, 220, 220, 148, 150, 148, 149, 152, 150, 151, - 287, 152, 150, 151, 159, 159, 160, 160, 152, 150, - 151, 151, 153, 154, 159, 220, 153, 154, 154, 153, - 161, 161, 286, 153, 154, 162, 162, 163, 163, 160, - 164, 164, 165, 165, 285, 189, 190, 284, 191, 189, - 190, 223, 223, 189, 283, 161, 282, 190, 190, 163, - - 189, 162, 223, 165, 191, 164, 193, 192, 191, 192, - 193, 281, 195, 192, 194, 191, 195, 193, 194, 280, - 192, 263, 194, 195, 196, 194, 260, 197, 196, 259, - 197, 258, 198, 196, 197, 196, 198, 244, 199, 211, - 199, 197, 199, 198, 221, 221, 200, 222, 222, 199, - 200, 200, 212, 241, 212, 211, 213, 200, 212, 211, - 213, 222, 221, 240, 214, 212, 211, 213, 214, 215, - 225, 225, 217, 215, 216, 214, 217, 216, 215, 239, - 215, 216, 218, 217, 218, 219, 218, 238, 216, 219, - 219, 224, 224, 218, 226, 226, 219, 237, 247, 274, - - 274, 224, 247, 248, 247, 275, 275, 248, 236, 247, - 226, 249, 248, 249, 248, 233, 250, 249, 251, 249, - 250, 230, 251, 274, 252, 251, 275, 250, 252, 251, - 253, 229, 254, 228, 253, 252, 254, 252, 256, 227, - 255, 253, 256, 254, 255, 255, 257, 276, 276, 256, - 257, 255, 266, 209, 266, 267, 208, 257, 266, 267, - 266, 268, 206, 269, 205, 268, 267, 269, 268, 270, - 204, 271, 268, 270, 269, 271, 271, 272, 203, 273, - 270, 272, 271, 273, 277, 277, 278, 278, 272, 292, - 273, 279, 279, 292, 293, 294, 305, 305, 293, 202, - - 292, 293, 201, 277, 297, 293, 294, 302, 297, 296, - 294, 278, 295, 296, 295, 297, 295, 294, 302, 296, - 296, 304, 302, 295, 303, 304, 303, 187, 303, 302, - 306, 306, 304, 307, 307, 303, 308, 308, 321, 186, - 322, 323, 321, 325, 322, 323, 306, 307, 184, 321, - 322, 322, 323, 324, 325, 326, 331, 324, 325, 326, - 331, 334, 334, 183, 324, 325, 326, 331, 332, 333, - 335, 335, 332, 333, 343, 344, 182, 345, 343, 332, - 333, 345, 181, 352, 180, 343, 344, 352, 345, 353, - 344, 358, 352, 353, 352, 358, 362, 344, 179, 365, - - 353, 358, 358, 365, 178, 177, 176, 362, 175, 174, - 365, 362, 172, 171, 170, 169, 168, 167, 362, 367, - 367, 367, 367, 367, 368, 368, 368, 368, 368, 369, - 369, 369, 369, 369, 371, 166, 137, 371, 372, 372, - 136, 372, 372, 373, 373, 135, 373, 373, 374, 134, - 133, 374, 375, 375, 132, 375, 375, 376, 376, 131, - 376, 376, 377, 130, 129, 377, 377, 106, 105, 104, - 103, 102, 101, 100, 99, 98, 97, 96, 95, 92, - 91, 90, 89, 88, 87, 86, 85, 84, 83, 59, - 58, 57, 56, 55, 54, 36, 35, 34, 33, 32, - - 31, 30, 28, 27, 23, 22, 21, 20, 19, 18, - 17, 16, 15, 14, 9, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 366 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "tipswnd.lex" -#define INITIAL 0 -/* - * -gcc -D DLL -shared -o ../plugin/vjde/tipswnd.dll tipswnd.c -luser32 -lcomctl32 -lgdi32 -mwindows - */ -#line 6 "tipswnd.lex" -#include -#ifdef DLL -#define _DL_EXPORT __declspec(dllexport) extern -#else -#define _DL_EXPORT -#include "data.h" -#endif - -#define YY_INPUT(buf,result,max_size) {\ - result = GetNextChar(buf, max_size); \ - if ( result <= 0 ) \ - result = YY_NULL; \ - } - -int GetNextChar(char* buf,int max_size); -char cBuffer[2048]; -int bufferSize; -int offset; -int iLineCount; -int top ; -int left; -int iMaxWidth; -int iMaxHeight; -BOOL stoped ; - -HWND hwndText; // Vim 봰 -HWND m_vimHwnd; // vim -HDC hdc; -int paintX=2; -int paintY=0; -SIZE sizeXY; -int paramSkip; -int currentLine; -void ColoredText(int r , int g, int b ,char *p , int l) ; -void MyTextOut(char *p , int l) ; -#define MYLIST 1 - -#define MYLISTEX 2 - -#define PARAMETER 3 - -#line 737 "lex.yy.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 46 "tipswnd.lex" - -#line 893 "lex.yy.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 367 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 916 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 47 "tipswnd.lex" -{ -MyTextOut(yytext,1); -if (paramSkip==0) { - BEGIN PARAMETER; -} -paramSkip=1; -} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 54 "tipswnd.lex" -{ -MyTextOut(yytext,1); -BEGIN 0; -} - YY_BREAK -case 3: -#line 59 "tipswnd.lex" -case 4: -#line 60 "tipswnd.lex" -case 5: -#line 61 "tipswnd.lex" -case 6: -#line 62 "tipswnd.lex" -case 7: -#line 63 "tipswnd.lex" -case 8: -#line 64 "tipswnd.lex" -case 9: -#line 65 "tipswnd.lex" -case 10: -#line 66 "tipswnd.lex" -case 11: -#line 67 "tipswnd.lex" -case 12: -#line 68 "tipswnd.lex" -case 13: -#line 69 "tipswnd.lex" -case 14: -#line 70 "tipswnd.lex" -case 15: -#line 71 "tipswnd.lex" -case 16: -#line 72 "tipswnd.lex" -case 17: -#line 73 "tipswnd.lex" -case 18: -#line 74 "tipswnd.lex" -case 19: -#line 75 "tipswnd.lex" -case 20: -#line 76 "tipswnd.lex" -case 21: -#line 77 "tipswnd.lex" -case 22: -#line 78 "tipswnd.lex" -case 23: -#line 79 "tipswnd.lex" -case 24: -#line 80 "tipswnd.lex" -case 25: -#line 81 "tipswnd.lex" -case 26: -#line 82 "tipswnd.lex" -case 27: -#line 83 "tipswnd.lex" -case 28: -#line 84 "tipswnd.lex" -case 29: -#line 85 "tipswnd.lex" -case 30: -YY_RULE_SETUP -#line 85 "tipswnd.lex" -{ - ColoredText(0x00,0x00,0xff,yytext,strlen(yytext)); -} - YY_BREAK -case 31: -#line 89 "tipswnd.lex" -case 32: -#line 90 "tipswnd.lex" -case 33: -#line 91 "tipswnd.lex" -case 34: -YY_RULE_SETUP -#line 91 "tipswnd.lex" -{ - ColoredText(0xff,0,0xff,yytext,strlen(yytext)); -} - YY_BREAK -case 35: -YY_RULE_SETUP -#line 94 "tipswnd.lex" -{ - ColoredText(0xff,0x00,0x00,yytext,strlen(yytext)-1); - MyTextOut(",",1); -} - YY_BREAK -case 36: -YY_RULE_SETUP -#line 98 "tipswnd.lex" -{ - ColoredText(0xff,0x00,0x00,yytext,strlen(yytext)-1); - MyTextOut(")",1); - BEGIN 0; -} - YY_BREAK -case 37: -YY_RULE_SETUP -#line 103 "tipswnd.lex" -{ - MyTextOut(yytext,strlen(yytext)); -} - YY_BREAK -case 38: -YY_RULE_SETUP -#line 106 "tipswnd.lex" -{ - ColoredText(0xff,0x00,0xff,yytext,strlen(yytext)); - BEGIN MYLISTEX; -} - YY_BREAK -case 39: -#line 111 "tipswnd.lex" -case 40: -#line 112 "tipswnd.lex" -case 41: -#line 113 "tipswnd.lex" -case 42: -#line 114 "tipswnd.lex" -case 43: -YY_RULE_SETUP -#line 114 "tipswnd.lex" -{ - ColoredText(0xff,0,0xff,yytext,strlen(yytext)); - BEGIN MYLIST; -} - YY_BREAK -case 44: -YY_RULE_SETUP -#line 118 "tipswnd.lex" -{ - ColoredText(0xff,0x00,0x00,yytext,strlen(yytext)-1); -} - YY_BREAK -case 45: -YY_RULE_SETUP -#line 121 "tipswnd.lex" -{ - ColoredText(0xbb,0x00,0x00,yytext,strlen(yytext)-1); -} - YY_BREAK -case 46: -#line 126 "tipswnd.lex" -case 47: -#line 127 "tipswnd.lex" -case 48: -YY_RULE_SETUP -#line 127 "tipswnd.lex" -{ - MyTextOut(yytext,strlen(yytext)); -} - YY_BREAK -case 49: -#line 131 "tipswnd.lex" -case 50: -#line 132 "tipswnd.lex" -case 51: -#line 133 "tipswnd.lex" -case 52: -YY_RULE_SETUP -#line 133 "tipswnd.lex" -{ -++currentLine; -paintX=2; -paintY= currentLine*iMaxHeight+2; -} - YY_BREAK -case 53: -#line 139 "tipswnd.lex" -case 54: -#line 140 "tipswnd.lex" -case 55: -#line 141 "tipswnd.lex" -case 56: -YY_RULE_SETUP -#line 141 "tipswnd.lex" -{ - //TextOut(hdc,paintX,paintY,yytext,strlen(yytext)); - GetTextExtentPoint(hdc,yytext,strlen(yytext),&sizeXY); - paintX += sizeXY.cx; -} - YY_BREAK -case 57: -YY_RULE_SETUP -#line 146 "tipswnd.lex" -ECHO; - YY_BREAK -#line 1178 "lex.yy.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(MYLIST): -case YY_STATE_EOF(MYLISTEX): -case YY_STATE_EOF(PARAMETER): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 367 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 367 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 366); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 146 "tipswnd.lex" - - -void MyTextOut(char *p,int l) { - TextOut(hdc,paintX,paintY,p,l); - GetTextExtentPoint(hdc,p,l,&sizeXY); - paintX += sizeXY.cx; -} -void ColoredText(int r , int g, int b ,char *p , int l) { - SetTextColor(hdc, RGB(r,g,b)); //ɫ - TextOut(hdc,paintX,paintY,p,l); - GetTextExtentPoint(hdc,p,l,&sizeXY); - paintX += sizeXY.cx; - SetTextColor(hdc, RGB(0x0,0,0x0)); //ɫ -} -int GetNextChar(char* buf,int max_size) { - if ( offset>=bufferSize) { - return 0; - } - int len = bufferSize-offset-1; - len = max_size>len?len:max_size; - memcpy(buf,cBuffer,len); - offset += len; - return len; -} -int yywrap() -{ - return 1; -} -BOOL CALLBACK EnumWndProc(HWND hWnd,LPARAM lParam) -{ - HWND* lhwnd=(HWND*)lParam; - char buf[50]; - GetClassName(hWnd,buf,50); - //VimTextArea is the class name of main editing window of VIM - if (strcmp(buf,"VimTextArea") == 0) - { - *lhwnd=hWnd; - return FALSE; - } - return TRUE; -} -void FindVimWindow() -{ - HWND hTempHwnd = GetForegroundWindow(); - if(hTempHwnd) - { - m_vimHwnd = hTempHwnd; - } - else - { - //but getting VIM window failed get the Desktop window. This is used to get the - //VIM rectangle. So even desktop window is also OK. - m_vimHwnd = GetDesktopWindow(); - } - - //Get the editing window in the VIM. - EnumChildWindows(m_vimHwnd,EnumWndProc,(LPARAM)&hwndText); - - //GetWindowRect(hwndText,vimRect); -} -void PaintText(HDC hdc) -{ -paintX=2; -paintY=2; -currentLine = 0; -offset= 0; -paramSkip=0; -yylex(); -} -BOOL RetriveTextSize(HDC hdc) -{ - SIZE size ; - - iLineCount = 0; - iMaxWidth = 0; - iMaxHeight = 0; - - char *p = cBuffer; - char *temp = cBuffer; - while ( *temp != '\0') { - if (*temp == '\n') { - iLineCount++; - GetTextExtentPoint(hdc,p,temp-p-1,&size); - { - iMaxWidth = size.cx > iMaxWidth ? size.cx:iMaxWidth; - iMaxHeight = size.cy > iMaxHeight ? size.cy:iMaxHeight; - } - p = temp+1; - } - ++temp; - } - if ( p < temp ) - { //δһ\n - iLineCount++; - GetTextExtentPoint(hdc,p,temp-p-1,&size); - { - iMaxWidth = size.cx > iMaxWidth ? size.cx:iMaxWidth; - iMaxHeight = size.cy > iMaxHeight ? size.cy:iMaxHeight; - } - } -} -int ReadInt(char *in,int l) -{ - char buffer[64]; - snprintf(buffer,l,"%s",in); - return atoi(buffer); -} -int AdjustPosEx(LPRECT rect, int w,int h) -{ - if ( left+w+10 > rect->right ) { - if ( left > w+10 ) { - left = left - w - 10; - } - else { - left = rect->right - w - 20; - } - } - if ( top + h + 10 > rect->bottom ) { - if ( top > h + 10 ) { - top = top - h - 20; - } - else { - top = rect->bottom - h - 20; - } - } -} -/** - * Caculate the left-top point of tips window. - * @param in "8;12;30;80;\n.." - * line;col; line total;colums total; - */ -int AdjustPos(LPRECT rect,char *in) -{ - int t,l,w,h; - char *p = in; - char *temp = in; - char buffer[128]; - - while ( *temp!=';') ++temp; - t = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - l = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - h = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - w = ReadInt(p,temp-p); - ++temp; - ++temp; // skip a \n - - top = (rect->bottom-rect->top)*t/h + rect->top; - left = (rect->right-rect->left)*l/w + rect->left; - return temp - in; - - //snprintf(buffer,64,p, -} -//һϢ -//:ھϢϢϢ -LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - //ȤϢ - switch (message) - { - case WM_KEYDOWN: - switch (wParam) - { - stoped = TRUE; - DestroyWindow(hwnd); - return 0; - } - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN://Ϣ - { - stoped = TRUE; - DestroyWindow(hwnd); - return 0; - } - case WM_PAINT: - { - char hello[]="ãEasyWin !"; - char buff[128]; - //HDC hdc; - PAINTSTRUCT ps; - RECT rect; - HFONT font; - HGDIOBJ oldFont; - - - font = CreateFont(12, 0, 0, 0, FW_REGULAR, 0, 0, 0, 0, 0, 0, 0, 0, "MS Sans Serif"); - - hdc=BeginPaint( hwnd,&ps ); //ȡ豸 - - oldFont = SelectObject(hdc,font); - RetriveTextSize(hdc); - - GetWindowRect( GetDesktopWindow() , &rect); - AdjustPosEx(&rect,iMaxWidth+20,iMaxHeight * iLineCount + 20); - MoveWindow(hwnd,left,top, iMaxWidth+20,(iMaxHeight * iLineCount)+20,TRUE); - - - GetClientRect(hwnd,&rect); - InflateRect(&rect,-1,-1); - FillRect(hdc, &rect,CreateSolidBrush(RGB(0xff,0xff,0x99))); - //FillRect(hdc, &rect,CreateSolidBrush(RGB(0x00,0x00,0xff))); - - SelectObject(hdc,CreatePen(PS_SOLID,2,RGB(162,162,162))); - - SetBkMode(hdc,TRANSPARENT); - SetTextColor(hdc, RGB(0,0,0)); //ɫ - - oldFont = SelectObject(hdc,font); - PaintText(hdc); - - SelectObject(hdc,oldFont); - EndPaint( hwnd, &ps ); //ͷԴ - break; - } - case WM_CLOSE: - break; - case WM_DESTROY: - //PostQuitMessage(0); - //ûرմڣ٣˳Ϣ˳Ϣѭ - return 0 ; - } - return 0; - //Ϣϵͳṩȱʡ - return DefWindowProc(hwnd, message, wParam, lParam); -} - -_DL_EXPORT int tipsWnd(char *in) -{ - //1.עᴰ - static TCHAR szAppName[] = TEXT ("HelloWin") ; // - //""ṹ - - // - HWND hwnd ; - RECT rect; - - FindVimWindow(); - GetWindowRect(hwndText,&rect); - int offset = AdjustPos(&rect,in); - //top = rect.top; - //left = rect.left; - // - hwnd = CreateWindowEx( - WS_EX_DLGMODALFRAME|WS_EX_TOOLWINDOW,//|WS_EX_TOPMOST, - //szAppName, - "#32770", - TEXT("The Hello Program"), - WS_POPUP|WS_DLGFRAME|WS_OVERLAPPED, - 0, - 0, - 400, - 300, - m_vimHwnd, - NULL, - NULL, - NULL); - //sprintf(cBuffer,"%s","Hello \n world!\nǾڲ.--------------------\n^_^\n"); - snprintf(cBuffer,2048,"%s",in+offset); - bufferSize = strlen(cBuffer); - - SetWindowLongPtr(hwnd,DWL_DLGPROC,(LPARAM)WndProc); - - ShowWindow (hwnd, SW_SHOW) ; - UpdateWindow (hwnd) ; - - //Ϣѭ - MSG msg ; - while (!stoped ) { - if ( GetMessage(&msg,NULL,0,0)== 0 ) { - break; - } - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - /* - while (GetMessage (&msg, NULL, 0, 0)) //ϢȡϢ - { - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - */ - //UnregisterClass(szAppName,NULL); - return strlen(in); ; -} -#ifndef DLL -//Ӧó -//:ʵǰһʵľвʾʽ -int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, - PSTR szCmdLine, int iCmdShow) -{ - //1.עᴰ - static TCHAR szAppName[] = TEXT ("HelloWin") ; // - //""ṹ - /* - WNDCLASS wndclass ; - wndclass.style = CS_HREDRAW | CS_VREDRAW ; - wndclass.lpfnWndProc = WndProc ; //Ϣ - wndclass.cbClsExtra = 0 ; - wndclass.cbWndExtra = 0 ; - wndclass.hInstance = hInstance ; //ʵ - wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; //ͼ - wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; // - wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); //ˢ - wndclass.lpszMenuName = NULL ; - wndclass.lpszClassName = szAppName; // - //ע - if (!RegisterClass (&wndclass)) - { - MessageBox (NULL, TEXT ("RegisterClass Fail!"), - szAppName, MB_ICONERROR) ; - return 0 ; - } - */ - - // - HWND hwnd ; - hwnd = CreateWindowEx( - WS_EX_DLGMODALFRAME, - //WS_EX_APPWINDOW, - "#32770", - //szAppName, - TEXT("The Hello Program"), - //WS_OVERLAPPEDWINDOW, - WS_POPUP, - 0, - 0, - 400, - 300, - NULL, - NULL, - NULL, - NULL); - - top = 0; - left =0; - - sprintf(cBuffer,"%s","Hellow\nWorld\nǾڲ.\nParameters:\n"); -#ifndef DLL - snprintf(cBuffer,2048,"%s",testdata); -#endif - bufferSize = strlen(cBuffer); - SetWindowLongPtr(hwnd,DWL_DLGPROC,(LPARAM)WndProc); - - ShowWindow (hwnd, iCmdShow) ; - UpdateWindow (hwnd) ; - - //Ϣѭ - MSG msg ; - while (!stoped ) { - if ( GetMessage(&msg,NULL,0,0)== 0 ) { - break; - } - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - - /* - while (GetMessage (&msg, NULL, 0, 0) ) //ϢȡϢ - { - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - */ - return 0 ; -} -#endif - -// vim: ts=4:sw=4:sts=4 diff --git a/dot.vim/src/my_system.cpp b/dot.vim/src/my_system.cpp deleted file mode 100644 index e34b4a6..0000000 --- a/dot.vim/src/my_system.cpp +++ /dev/null @@ -1,117 +0,0 @@ -#ifdef _WIN32 -#include -#include -#include -#include -unsigned int my_system(const char *cmd,char *result,int maxLen){ - PROCESS_INFORMATION pi; - STARTUPINFO siStartInfo; - SECURITY_ATTRIBUTES saAttr; - std::string Output, tmp; - char command_line[2048]; - DWORD dwRead; - char* buf; int len; - HANDLE hRead, hWrite; - - - saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); - saAttr.bInheritHandle = TRUE; - saAttr.lpSecurityDescriptor = NULL; - if (!CreatePipe(&hRead, &hWrite, &saAttr, 0)) - { - return 0; - } - - memset(&pi, 0, sizeof(pi)); - sprintf(command_line, "wspawn -h %d %s", (unsigned int)hWrite,cmd); - ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) ); - siStartInfo.cb = sizeof(STARTUPINFO); - siStartInfo.wShowWindow = SW_HIDE; - siStartInfo.dwFlags = STARTF_USESHOWWINDOW; - if (!CreateProcess( NULL, command_line, NULL, NULL, TRUE, - 0, NULL, NULL, &siStartInfo, &pi)) - { - return 0; - } - - if(!ReadFile( hRead, &len, sizeof(int), &dwRead, NULL) || dwRead == 0) - return 0; - while(len) - { - buf = new char[len + 1]; - memset(buf, 0, len + 1); - - if(!ReadFile( hRead, buf, len, &dwRead, NULL) || dwRead == 0) - return 0; - - tmp = buf; - //tmp.Replace("\n", "\r\n"); - Output += tmp; - - - delete[] buf; - if(!ReadFile( hRead, &len, sizeof(int), &dwRead, NULL) || dwRead == 0) - return 0; - } - - //printf("%d \n%s\n",Output.length(),Output.c_str()); - _snprintf(result,maxLen,"%s",Output.c_str()); - WaitForSingleObject(pi.hProcess, 30000); - - CloseHandle(hRead); - CloseHandle(hWrite); - - return Output.size(); -} -#else -#include -#include -#include -#include -unsigned int my_system(const char* pCmd, char* pResult, int size) { - int fd[2]; - int pid; - int count; - int left; - char* p = 0; - int maxlen = size - 1; - memset(pResult, 0, size); - if(pipe(fd)) - { - printf("pipe error\n"); - return 0; - } - if((pid = fork()) == 0) - {// chile process - int fd2[2]; - if(pipe(fd2)) - { - printf("pipe2 error\n"); - return 0; - } - close(1); - dup2(fd2[1],1); - close(fd[0]); - close(fd2[1]); - system(pCmd); - read(fd2[0], pResult, maxlen); - pResult[strlen(pResult)-1] = 0; - write(fd[1], pResult, strlen(pResult)); - close(fd2[0]); - exit(0); - } - // parent process - close(fd[1]); - p = pResult; - left = maxlen; - while((count = read(fd[0], p, left))) { - p += count; - left -= count; - if(left == 0) - break; - } - close(fd[0]); - return 1; - -} -#endif diff --git a/dot.vim/src/my_system.h b/dot.vim/src/my_system.h deleted file mode 100644 index dc9275b..0000000 --- a/dot.vim/src/my_system.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MY_SYSTEM_H -#define MY_SYSTEM_H -unsigned int my_system(const char *cmd,char *result,int maxLen); -#endif diff --git a/dot.vim/src/previewwindow.cpp b/dot.vim/src/previewwindow.cpp deleted file mode 100644 index a5046e3..0000000 --- a/dot.vim/src/previewwindow.cpp +++ /dev/null @@ -1,990 +0,0 @@ -#include -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#include -#endif -#include "my_system.h" - -#define DOC_LENGTH 5124 - -//#define MAX(a,b) (a)>(b)?(a):(b) - -#if defined(DLL) && defined(_WIN32) -#define _DL_EXPORT __declspec(dllexport) extern -#else -#define _DL_EXPORT -#endif -#ifdef AS_C -extern "C" { -#endif -//ADD COMMENT -//Add by wangfc - using std::string; - using std::vector; - - static char pre_select_buffer[256];//user input - string user_input; - int key_release_count=0; - int winposx = 0; - int winposy = 0; - gboolean useShort = FALSE; - - guint tag = 0;//timeout id - guint intval = 1000; //interval - - - enum COLUM { TAG_NAME,RET_VAL,COMMENT,TAG_VAL }; - - GtkWidget *window=NULL; - GtkWidget *input_label = NULL; - GtkWidget *line_list = NULL; - GtkWidget *scrolledwindow2=NULL;// init_list_store(); - - GtkListStore* list_store=NULL; - - vector lines; - string base(""); - - void on_row_selected (GtkTreeView *treeview, - GtkTreePath *arg1, - GtkTreeViewColumn *arg2, - gpointer user_data); - -void on_cursor_changed(GtkTreeView *treeview, - gpointer user_data) ; - - -#ifdef _WIN32 - typedef struct _Rectangle { - int x; - int y; - int width; - int height; - } MRectangle; -#else - typedef GdkRectangle MRectangle; -#endif - - //use for doc preview - GtkWidget *doc_window = NULL; - GtkWidget *doc_view = NULL; - GtkWidget *scrolledwindow3=NULL;// init_list_store(); - char doc_buffer[DOC_LENGTH]; - guint timeout_handler = 0; - guint idle_handler = 0; - guint delay=1000; - MRectangle doc_rect; - gboolean use_doc=FALSE; - gboolean first_time = FALSE; - string doc_cmd_line; - - - - void init_window(int x,int y,int width,int height); - void on_key_release_event( GtkWidget *widget, GdkEventKey *data ); - void destroy( GtkWidget *widget, gpointer data ); - char* preview_window(vector &v,const string& base,int x,int y,int width,int height); - void update_label() ; - void get_select_val(); - void init_list_store(); - void get_vim_text_area_rectangle(MRectangle &rect); - void get_desktop_rectangle(MRectangle &rect) ; - void get_vim_caret_pos(int &x1,int &y1, - const int line,const int col, // cursor line and col for vim - const int width1 , const int height1, // vim lines and cols in window - const int width2 , const int height2); // tool window width heigth - - gboolean show_doc_window(gpointer data) ;//show the document; - void remove_last_timeout(); - void add_new_timeout(); - gboolean show_doc_thread(gpointer data) ;//show the document; - - - - void on_key_release_event2( GtkWidget *widget, GdkEventKey *data ); - void destroy( GtkWidget *widget, gpointer data ); - /* - gboolean show_docment(gpointer data); - void timeout_setup() { - if (tag != -1) { - g_source_remove(tag); - } - tag = g_timeout_add(intval,show_document,NULL) - } - */ -#ifdef _GTK_LINUX - void get_window_rect(GdkWindow* window , MRectangle &rect) - { - //gdk_window_get_frame_extents(window,&rect); - gdk_drawable_get_size(GDK_DRAWABLE(window),&rect.width,&rect.height); - gdk_window_get_deskrelative_origin(window,&rect.x,&rect.y); - } - void get_vim_text_area_rectangle(MRectangle &rect) - { - GdkWindow* root = gdk_get_default_root_window(); - GList *children = gdk_window_peek_children(root); - GList* temp1 = g_list_first(children); - GList* temp = NULL; - int x ,y ; - while ( temp1 != NULL) { - gdk_window_get_root_origin(GDK_WINDOW(temp1->data),&x,&y); - if ( x==winposx && y==winposy) { - temp = gdk_window_peek_children(GDK_WINDOW(temp1->data)); - break; - } - temp1 = g_list_next(temp1); - } - if( temp != NULL) { - get_window_rect(GDK_WINDOW(temp->data),rect); - //if (rect.x == winposx && rect.y>winposy) - //temp = g_list_next(temp); - } - } - void get_desktop_rectangle(MRectangle &rect) - { - GdkWindow* root = gdk_get_default_root_window(); - get_window_rect(GDK_WINDOW(root),rect); - } -#endif -#ifdef _WIN32 - HWND m_vimHwnd; - BOOL CALLBACK EnumWndProc(HWND hWnd,LPARAM lParam) - { - HWND* lhwnd=(HWND*)lParam; - char buf[50]; - ::GetClassName(hWnd,buf,50); - //VimTextArea is the class name of main editing window of VIM - if (strcmp(buf,"VimTextArea") == 0) - { - *lhwnd=hWnd; - return FALSE; - } - return TRUE; - } - void get_vim_text_area_rectangle(MRectangle &rect) - { - HWND hTempHwnd = GetForegroundWindow(); - if(hTempHwnd) - { - m_vimHwnd = hTempHwnd; - } - else - { - //but getting VIM window failed get the Desktop window. This is used to get the - //VIM rectangle. So even desktop window is also OK. - m_vimHwnd = ::GetDesktopWindow(); - } - RECT vimRect; - - HWND hwndText; - //Get the editing window in the VIM. - EnumChildWindows(m_vimHwnd,EnumWndProc,(LPARAM)&hwndText); - - - ::GetWindowRect(hwndText,&vimRect); - rect.x = vimRect.left; - rect.y = vimRect.top; - rect.width = vimRect.right-vimRect.left+1; - rect.height = vimRect.bottom-vimRect.top+1; - } - void get_desktop_rectangle(MRectangle &rect) - { - RECT deskRect; - ::GetWindowRect(::GetDesktopWindow(),&deskRect); - rect.x = deskRect.left; - rect.y = deskRect.top; - rect.width = deskRect.right-deskRect.left+1; - rect.height = deskRect.bottom-deskRect.top +1; - } - - -#endif - void get_vim_caret_pos(int &x1,int &y1, - const int line,const int col, // cursor line and col for vim - const int width1 , const int height1, // vim lines and cols in window - const int width2 , const int height2) // tool window width heigth - { - - MRectangle vimRect ,deskRect; - get_vim_text_area_rectangle(vimRect); - get_desktop_rectangle(deskRect); - - int winHeight = vimRect.height; - int winWidth = vimRect.width; - - - double vimLine = line; - double vimCol = col; - double vimLines = height1; - double vimCols = width1; - - double dy = (winHeight/(vimLines+1)) * vimLine; - double dx = (winWidth/(vimCols+1)) * vimCol; - - int x = (int) dx + vimRect.x; - int y = (int) dy + vimRect.y; - int height = height2; - int width = width2; - - // if list window is beyond desktop window put it accordingly - if (y + height > deskRect.height) - { - y = y - height - 15; - } - if (x + width > deskRect.width) - { - //gputleft = true; - x = x - width; - } - else - { - } - x1 =x; - y1 =y; - } - void get_select_val() - { - GtkTreeIter iter; - if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(line_list)), - ((GtkTreeModel**)(&list_store)),&iter)) - { - gchar *val; - gtk_tree_model_get (GTK_TREE_MODEL(list_store), &iter, TAG_NAME,&val, -1); - user_input.clear(); - //user_input.append(val+(base.length())); - user_input.append(val); - g_free(val); - } - } - string get_short_name(string name) - { - if ( !useShort ) - return name; - int index_dot = name.rfind('.'); - if ( index_dot>0) { - return name.substr(index_dot+1); - } - return name; - } - string get_short_tag(string tag) - { - if ( !useShort ) - return tag; - string stag = ""; - string temp; - int index_dot; - - - int index = tag.find('('); - stag.append(tag.substr(0,index+1)); - - int next = tag.find(',',index); - index +=1; - while ( next > 0 ) // find a parameter - { - temp = tag.substr(index,next-index); - stag.append(get_short_name(temp)); - stag.append(","); - index = next+1; - next = tag.find(',',index); - } - next = tag.find(')',index); - if ( next >0) - { - temp = tag.substr(index,next-index); - stag.append(get_short_name(temp)); - //index_dot = temp.rfind('.'); - //if ( index_dot>0) { - //stag.append(temp.substr(index_dot+1)); - //} - //else { - //stag.append(temp); - //} - stag.append(")"); - index = next+1; - next = tag.find(',',index); - } - return stag; - } - void create_column(string &temp) - { - GtkTreeIter iter_tree; - int index_space = temp.find_first_of(" \t"); - int index_comma = temp.find(';'); - int index_right = temp.find(')'); - if ( index_space > 0 ) - { - gtk_list_store_append(list_store,&iter_tree); - if ( index_right > 0 && index_right 0 ) - { - gtk_list_store_set(list_store,&iter_tree, - RET_VAL,get_short_name(temp.substr(0,index_space)).c_str(), - TAG_NAME, - get_short_tag(temp.substr(index_space+1,index_right-index_space)).c_str(), - COMMENT,index_right < index_comma-1? - temp.substr(index_right+1,index_comma-index_right-1).c_str():temp.substr(std::max(index_right,index_comma)+1).c_str(), - TAG_VAL ,temp.substr(index_space+1,index_right-index_space).c_str(), - -1); - } - else - { - gtk_list_store_set(list_store,&iter_tree, - RET_VAL,get_short_name(temp.substr(0,index_space)).c_str(), - TAG_NAME,get_short_tag(temp.substr(index_space+1)).c_str(), - COMMENT,"", - TAG_VAL ,temp.substr(index_space+1).c_str(), - -1); - } - return; - } - if ( index_comma > 0 ) - { - gtk_list_store_set(list_store,&iter_tree, - RET_VAL,get_short_name(temp.substr(0,index_space)).c_str(), - TAG_NAME,temp.substr(index_space+1,index_comma-index_space-1).c_str(), - COMMENT,index_comma ::const_iterator iter = lines.begin(); - //skiping first line,preview parameter - if ( iter != lines.end() ) iter++; - //skiping second line , document window parameter - if ( iter != lines.end() ) iter++; - - for( ; iter != lines.end(); iter++) - { - string temp = *iter; - create_column(temp); - } - } - - void update_label() - { - string text = "";//style=\"italic\">"; - text += base; - text += user_input; - text+=""; - gtk_label_set_markup((GtkLabel*)input_label,text.c_str()); - GtkTreeIter iter ; - gchar *val; - - string text1 = base+user_input; - if ( text1.length()==0) - return; - if ( !gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list_store),&iter)) - return; - do { - gtk_tree_model_get (GTK_TREE_MODEL(list_store), &iter, TAG_NAME,&val, -1); - if (strlen(val)>=text1.length()) { - if ( strncmp(text1.c_str(),val,text1.length())==0 ) { - gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(line_list)), - &iter); - gtk_tree_view_set_cursor(GTK_TREE_VIEW(line_list), - gtk_tree_model_get_path(GTK_TREE_MODEL(list_store), &iter), - NULL, - FALSE); - g_free(val); - //TODO:set the document window timeout here - return; - } - } - g_free(val); - } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(list_store),&iter)); - } - - _DL_EXPORT int has_gtk(char *str) - { - return 1; - } - - int read_int(string &firstline,char sp,int len,int &curr) - { - int index = firstline.find(';',curr); - index = index==-1?len:index; - int x = atoi(firstline.substr(curr,index-curr).c_str()); - curr = index+1; - return x; - } - //50;50;200;100;abc; - //cursor col; cursor line;text area width;text area height;window width;window height;vim pos x;vim posy;a:base; - _DL_EXPORT char* preview(char *str) - { - string para(str); - - std::istringstream input(para); - string temp; - while (getline(input,temp)) { - lines.push_back(temp); - } - int x = 50; - int y = 50; - int width=250; - int height=100; - int tw=50; - int th = 50; - if ( lines.size()>0) - {//Preview windows define - string firstline=lines[0]; - int len = firstline.length(); - int curr = 0; - if ( curr < len ) { - x = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - y = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - tw = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - th = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - width = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - height = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - winposx = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - winposy = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - useShort = read_int(firstline,';',len,curr)>0; - } - if ( curr < len ) { - int index = firstline.find(';',curr); - index = index==-1?len:index; - base = firstline.substr(curr,index-curr); - curr = index+1; - } - } - - if ( lines.size()>1) - { - string docline = lines[1]; - int len = docline.length(); - int curr = 0; - if ( curr < len) { - doc_rect.width = read_int(docline,';',len,curr); - } - if ( curr < len ) { - doc_rect.height = read_int(docline,';',len,curr); - } - if ( curr < len ) { - delay = read_int(docline,';',len,curr); - } - if ( curr < len ) { - int index = docline.find(';',curr); - index = index==-1?len:index; - doc_cmd_line = docline.substr(curr,index-curr); - curr = index+1; - use_doc = TRUE; - } - } - - //char buffer[128]; - //snprintf(buffer,127,"test x%d y%d tw%d th%d w%d h%d px%d py%d",x,y,tw,th,width,height,winposx,winposy); - //lines.push_back(buffer); - - get_vim_caret_pos(x,y,x,y,tw,th,width,height); - - MRectangle drect ; - get_desktop_rectangle(drect); - /* - if ( x+width+doc_rect.width>drect.width) { - doc_rect.x = drect.width-width-doc_rect.width; - } - else { - } - */ - doc_rect.x = 0; - doc_rect.y = 0; - if ( y+height+doc_rect.height+4 >= drect.height) { - if ( x + width + doc_rect.width < drect.width) { - doc_rect.x = x+width; - doc_rect.y = y; - } - else if ( x >= doc_rect.width) { - doc_rect.x = x - doc_rect.width; - doc_rect.y = y; - } - else if ( y >= doc_rect.height) { - doc_rect.x = x; - doc_rect.y = y - doc_rect.height; - } - //doc_rect.y = drect.height-height-doc_rect.height; - } - - else { - doc_rect.y = y+height+4; - doc_rect.x = x; - } - - return preview_window(lines,base,x,y,width,height); - } - - - char* preview_window(vector &v,const string& base,int x,int y,int width,int height) - { - user_input ="";// g_string_new(""); - gtk_init(0,NULL); - - - init_window(x,y,width,height); - first_time = TRUE; - - gtk_main (); - doc_window = NULL; - - snprintf(pre_select_buffer,255,"%s",user_input.c_str()); - return pre_select_buffer; - } - - void init_window(int x,int y,int width,int height) - { - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_decorated((GtkWindow*)window,FALSE); -#ifdef _WIN32 - gtk_window_set_modal((GtkWindow*)window,FALSE); -#else - gtk_window_set_modal((GtkWindow*)window,TRUE); -#endif - gtk_window_move((GtkWindow*)window,x,y); - gtk_window_resize((GtkWindow*)window,width,height); - gtk_window_set_title(GTK_WINDOW(window),"preview"); - - - list_store = gtk_list_store_new(4,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING); - init_list_store(); - - line_list = gtk_tree_view_new_with_model((GtkTreeModel*)list_store); - - if ( use_doc) { - g_signal_connect(line_list,"cursor-changed",(GCallback)on_cursor_changed,NULL); - } - - GtkTreeViewColumn *column; - GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); - g_object_set(G_OBJECT(renderer),"cell-background","yellow",NULL); - - column = gtk_tree_view_column_new_with_attributes ("Title", - renderer, - "text",0, - NULL); - gtk_tree_view_append_column((GtkTreeView*)line_list,column); - column = gtk_tree_view_column_new_with_attributes ("Title2", - renderer, - "text",1, - NULL); - gtk_tree_view_append_column((GtkTreeView*)line_list,column); - column = gtk_tree_view_column_new_with_attributes ("Title3", - renderer, - "text",2, - NULL); - gtk_tree_view_append_column((GtkTreeView*)line_list,column); - gtk_tree_view_set_headers_visible((GtkTreeView*)line_list,FALSE); - gtk_tree_selection_set_mode( gtk_tree_view_get_selection(GTK_TREE_VIEW(line_list)), - GTK_SELECTION_SINGLE); - - GtkWidget* vbox = gtk_vbox_new(FALSE,1); - - - input_label = gtk_label_new(base.c_str()); - gtk_widget_set_size_request(input_label,width,13); - - scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); - - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_SHADOW_IN); - - gtk_box_pack_start((GtkBox*) vbox,input_label, FALSE,FALSE,1); - gtk_box_pack_start((GtkBox*) vbox,scrolledwindow2, TRUE,TRUE,1); - - gtk_container_add(GTK_CONTAINER(window),vbox); - gtk_container_add (GTK_CONTAINER (scrolledwindow2), line_list); - - gtk_window_set_accept_focus(GTK_WINDOW(window),TRUE); - g_signal_connect (G_OBJECT (window), "key_release_event", - G_CALLBACK (on_key_release_event), NULL); - - - gtk_widget_show (scrolledwindow2); - gtk_widget_show(input_label); - gtk_widget_show(line_list); - gtk_widget_show(vbox); - gtk_widget_show (window); - - - update_label(); - } - -/* һص */ -void destroy( GtkWidget *widget, - gpointer data ) -{ - if ( doc_window) { - gtk_widget_destroy(doc_window); - doc_window = NULL; - } - if ( window) { - gtk_widget_destroy(window); - window = NULL; - } - gtk_main_quit (); -} - -void on_key_release_event( GtkWidget *widget, - GdkEventKey *data ) -{ - - if ( idle_handler ) { - g_source_remove(idle_handler); - idle_handler = 0; - } - key_release_count+=1; - switch ( data->keyval) { - case 32://SPACE - if ( key_release_count<=1) - return; - get_select_val(); - destroy(widget,data); - return; - case 65288://BACKSPACE - if (user_input.length()>=1) { - user_input.erase(user_input.length()-1,1); - - update_label(); - } - return; - case 65289://TAB - get_select_val(); - destroy(widget,data); - return; - case 65293: //ENTER - if ( key_release_count<=1) - return; - get_select_val(); - destroy(widget,data); - return; - case 65307: //ESC - user_input.clear(); - destroy(widget,data); - return; - case GDK_Shift_L: - case GDK_Shift_R: - case GDK_Control_L: - case GDK_Control_R: - case GDK_Caps_Lock: - case GDK_Shift_Lock: - case GDK_Meta_L: - case GDK_Meta_R: - case GDK_Alt_L: - case GDK_Alt_R: - case GDK_VoidSymbol: - return; - } - if ( data->keyval > 0x20 && data->keyval<=0x7D) { - user_input+= char(data->keyval); - update_label(); - //gtk_widget_grab_focus(line_list); - } -} - -void on_key_release_event2( GtkWidget *widget, - GdkEventKey *data ) -{ - if ( key_release_count++==0) { - return ; - } - switch ( data->keyval) { - case 32://SPACE - if (doc_window) - gtk_widget_destroy(doc_window); - gtk_main_quit (); - return; - case 65293: //ENTER - if (doc_window) - gtk_widget_destroy(doc_window); - gtk_main_quit (); - return; - case 65307: //ESC - if (doc_window) - gtk_widget_destroy(doc_window); - gtk_main_quit (); - return; - case GDK_Shift_L: - case GDK_Shift_R: - case GDK_Control_L: - case GDK_Control_R: - case GDK_Caps_Lock: - case GDK_Shift_Lock: - case GDK_Meta_L: - case GDK_Meta_R: - case GDK_Alt_L: - case GDK_Alt_R: - case GDK_VoidSymbol: - return; - } -} - -int main(int argc,char* argv[]) -{ - printf("%s\n",preview(argv[1])); - printf("meger test"); - printf("meger "); - return 0; -} - - string get_select_tag() - { - string str; - GtkTreeIter iter; - if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(line_list)), - ((GtkTreeModel**)(&list_store)),&iter)) - { - gchar *val; - gtk_tree_model_get (GTK_TREE_MODEL(list_store), &iter, TAG_VAL,&val, -1); - str.append(val); - g_free(val); - } - return str; - } - gboolean show_doc_thread(gpointer data) { - string cmd_line; - if ( lines.size()>2) { - cmd_line.append(doc_cmd_line); - cmd_line.append(" \""); - cmd_line.append(lines[2]); - cmd_line.append("\" \""); - cmd_line.append(get_select_tag().c_str()); - cmd_line.append("\""); - } - //char show[128] ; - //sprintf(show,"%d %d %d %d" , doc_rect.x,doc_rect.y,doc_rect.width,doc_rect.height); - /* - GtkTextBuffer *buffer; - buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (doc_view)); - */ - memset(doc_buffer,0,DOC_LENGTH); - my_system(cmd_line.c_str(),doc_buffer,DOC_LENGTH); - if (strlen(doc_buffer)>5) { - if ( doc_window == NULL) { - doc_window = gtk_window_new(GTK_WINDOW_POPUP); - gtk_window_set_decorated(GTK_WINDOW(doc_window),FALSE); - gtk_window_set_modal(GTK_WINDOW(doc_window),FALSE); - gtk_window_move(GTK_WINDOW(doc_window),doc_rect.x,doc_rect.y); - gtk_window_resize(GTK_WINDOW(doc_window),doc_rect.width,doc_rect.height); - gtk_window_set_title(GTK_WINDOW(doc_window),"document"); - - doc_view = gtk_label_new("");//gtk_text_view_new(); - gtk_label_set_justify(GTK_LABEL(doc_view),GTK_JUSTIFY_LEFT); - //g_object_set(G_OBJECT(doc_view),"editable",FALSE,NULL); - scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwindow3),doc_view); - gtk_container_add(GTK_CONTAINER(doc_window),scrolledwindow3); - - g_signal_connect (G_OBJECT (doc_window), "key_release_event", - G_CALLBACK (on_key_release_event2), NULL); - gtk_widget_show(scrolledwindow3); - gtk_widget_show(doc_view); - gtk_widget_show(doc_window); - } - gtk_label_set_markup(GTK_LABEL(doc_view),doc_buffer); - } - // gtk_text_buffer_set_text (buffer, doc_buffer, -1); - return FALSE; - } - gboolean show_doc_window(gpointer data) {//show the document; - /* - if ( first_time ) { - first_time = FALSE; - return FALSE; - } - */ - /* - if ( doc_window == NULL) { - doc_window = gtk_window_new(GTK_WINDOW_POPUP); - gtk_window_set_decorated(GTK_WINDOW(doc_window),FALSE); - gtk_window_set_modal(GTK_WINDOW(doc_window),FALSE); - gtk_window_move(GTK_WINDOW(doc_window),doc_rect.x,doc_rect.y); - gtk_window_resize(GTK_WINDOW(doc_window),doc_rect.width,doc_rect.height); - gtk_window_set_title(GTK_WINDOW(doc_window),"document"); - - doc_view = gtk_label_new("");//gtk_text_view_new(); - gtk_label_set_justify(GTK_LABEL(doc_view),GTK_JUSTIFY_LEFT); - //g_object_set(G_OBJECT(doc_view),"editable",FALSE,NULL); - scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwindow3),doc_view); - gtk_container_add(GTK_CONTAINER(doc_window),scrolledwindow3); - - g_signal_connect (G_OBJECT (doc_window), "key_release_event", - G_CALLBACK (on_key_release_event2), NULL); - gtk_widget_show(scrolledwindow3); - gtk_widget_show(doc_view); - gtk_widget_show(doc_window); - } - */ - //gtk_label_set_text((GtkLabel*)input_label,get_select_tag().c_str()); - if ( idle_handler ) { - g_source_remove(idle_handler); - idle_handler = 0; - } - idle_handler = g_idle_add(show_doc_thread,NULL); - return FALSE; - } - void remove_last_timeout() - { - if (timeout_handler) { - g_source_remove(timeout_handler); - timeout_handler = 0; - } - if ( doc_window != NULL ) { - //gtk_widget_hide(doc_window); - //gtk_widget_destroy(doc_window); - //doc_window = NULL; - } - } - void add_new_timeout() - { - timeout_handler = g_timeout_add(delay, - show_doc_window, - NULL); - } - void on_row_selected(GtkTreeView *treeview, - GtkTreePath *arg1, - GtkTreeViewColumn *arg2, - gpointer user_data) { - if ( use_doc) - { - remove_last_timeout(); - add_new_timeout(); - } - } - -void on_cursor_changed(GtkTreeView *treeview, - gpointer user_data) { - if ( use_doc) - { - remove_last_timeout(); - add_new_timeout(); - } -} - -int information_window(int x, int y, int width,int height,char *str) -{ - gtk_init(0,NULL); - doc_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_decorated(GTK_WINDOW(doc_window),FALSE); - gtk_window_set_modal(GTK_WINDOW(doc_window),TRUE); - gtk_window_move(GTK_WINDOW(doc_window),x,y); - gtk_window_set_title(GTK_WINDOW(doc_window),""); - - doc_view = gtk_label_new(""); - gtk_label_set_justify(GTK_LABEL(doc_view),GTK_JUSTIFY_LEFT); - - //gtk_label_set_text(GTK_LABEL(doc_view),str); - - char *markup; - markup = g_markup_printf_escaped("%s",str); - gtk_label_set_markup(GTK_LABEL(doc_view),markup); - g_free(markup); - - GtkRequisition req; - gtk_widget_size_request(GTK_WIDGET(doc_view),&req); - - gtk_window_resize(GTK_WINDOW(doc_window), - width, - std::min(req.height,height)); - - scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); - - g_signal_connect (G_OBJECT (doc_window), "key_release_event", - G_CALLBACK (on_key_release_event2), NULL); - - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwindow3),doc_view); - gtk_container_add(GTK_CONTAINER(doc_window),scrolledwindow3); - gtk_widget_show(doc_view); - gtk_widget_show(scrolledwindow3); - gtk_widget_show(doc_window); - - gtk_main(); - return 0; -} - -_DL_EXPORT int information(char *str) -{ - string para(str); - std::istringstream input(para); - string temp; - while ( getline(input,temp)) { - lines.push_back(temp); - } - int x = 50; - int y = 50; - int width=250; - int height=100; - int tw=50; - int th = 50; - int skip = 0; - if ( lines.size()>0) - {//Preview windows define - string firstline=lines[0]; - skip = firstline.size()+1; - int len = firstline.length(); - int curr = 0; - if ( curr < len ) { - x = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - y = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - tw = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - th = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - width = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - height = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - winposx = read_int(firstline,';',len,curr); - } - if ( curr < len ) { - winposy = read_int(firstline,';',len,curr); - } - get_vim_caret_pos(x,y,x,y,tw,th,width,height); - return information_window(x,y,width,height,str+skip); - } -} -#ifdef AS_C -} -#endif - - diff --git a/dot.vim/src/previewwindow.hpp b/dot.vim/src/previewwindow.hpp deleted file mode 100644 index 96b2a79..0000000 --- a/dot.vim/src/previewwindow.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _PREVIEWWINDOW_HPP -#define _PREVIEWWINDOW_HPP -char* preview_window(vector &v,const string& base,int x,int y,int width,int height); -#endif -//test - diff --git a/dot.vim/src/readtags.c b/dot.vim/src/readtags.c deleted file mode 100644 index 08f2e0f..0000000 --- a/dot.vim/src/readtags.c +++ /dev/null @@ -1,1194 +0,0 @@ -/* -* $Id: readtags.c,v 1.24 2003/07/20 18:46:30 darren Exp $ -* -* Copyright (c) 1996-2003, Darren Hiebert -* -* This source code is released into the public domain. -* -* This module contains functions for reading tag files. -*/ -/* Compile command: - * gcc -o ../plugin/vjde/readtags -DREADTAGS_MAIN readtags.c -mwindows - */ -/* -* INCLUDE FILES -*/ -#include -#include -#include -#include -#include -#include /* to declare off_t */ - -#include "readtags.h" - -/* -* MACROS -*/ -#define TAB '\t' - - -/* -* DATA DECLARATIONS -*/ -typedef struct { - size_t size; - char *buffer; -} vstring; - -/* Information about current tag file */ -struct sTagFile { - /* has the file been opened and this structure initialized? */ - short initialized; - /* format of tag file */ - short format; - /* how is the tag file sorted? */ - sortType sortMethod; - /* pointer to file structure */ - FILE* fp; - /* file position of first character of `line' */ - off_t pos; - /* size of tag file in seekable positions */ - off_t size; - /* last line read */ - vstring line; - /* name of tag in last line read */ - vstring name; - /* defines tag search state */ - struct { - /* file position of last match for tag */ - off_t pos; - /* name of tag last searched for */ - const char *name; - /* length of name for partial matches */ - size_t nameLength; - /* peforming partial match */ - short partial; - /* ignoring case */ - short ignorecase; - } search; - /* miscellaneous extension fields */ - struct { - /* number of entries in `list' */ - unsigned short max; - /* list of key value pairs */ - tagExtensionField *list; - } fields; - /* buffers to be freed at close */ - struct { - /* name of program author */ - char *author; - /* name of program */ - char *name; - /* URL of distribution */ - char *url; - /* program version */ - char *version; - } program; -}; - -/* -* DATA DEFINITIONS -*/ -const char *const EmptyString = ""; -const char *const PseudoTagPrefix = "!_"; - -/* -* FUNCTION DEFINITIONS -*/ - -/* - * Compare two strings, ignoring case. - * Return 0 for match, < 0 for smaller, > 0 for bigger - * Make sure case is folded to uppercase in comparison (like for 'sort -f') - * This makes a difference when one of the chars lies between upper and lower - * ie. one of the chars [ \ ] ^ _ ` for ascii. (The '_' in particular !) - */ -static int struppercmp (const char *s1, const char *s2) -{ - int result; - do - { - result = toupper ((int) *s1) - toupper ((int) *s2); - } while (result == 0 && *s1++ != '\0' && *s2++ != '\0'); - return result; -} - -static int strnuppercmp (const char *s1, const char *s2, size_t n) -{ - int result; - do - { - result = toupper ((int) *s1) - toupper ((int) *s2); - } while (result == 0 && --n > 0 && *s1++ != '\0' && *s2++ != '\0'); - return result; -} - -static int growString (vstring *s) -{ - int result = 0; - size_t newLength; - char *newLine; - if (s->size == 0) - { - newLength = 128; - newLine = (char*) malloc (newLength); - *newLine = '\0'; - } - else - { - newLength = 2 * s->size; - newLine = (char*) realloc (s->buffer, newLength); - } - if (newLine == NULL) - perror ("string too large"); - else - { - s->buffer = newLine; - s->size = newLength; - result = 1; - } - return result; -} - -/* Copy name of tag out of tag line */ -static void copyName (tagFile *const file) -{ - size_t length; - const char *end = strchr (file->line.buffer, '\t'); - if (end == NULL) - { - end = strchr (file->line.buffer, '\n'); - if (end == NULL) - end = strchr (file->line.buffer, '\r'); - } - if (end != NULL) - length = end - file->line.buffer; - else - length = strlen (file->line.buffer); - while (length >= file->name.size) - growString (&file->name); - strncpy (file->name.buffer, file->line.buffer, length); - file->name.buffer [length] = '\0'; -} - -static int readTagLineRaw (tagFile *const file) -{ - int result = 1; - int reReadLine; - - /* If reading the line places any character other than a null or a - * newline at the last character position in the buffer (one less than - * the buffer size), then we must resize the buffer and reattempt to read - * the line. - */ - do - { - char *const pLastChar = file->line.buffer + file->line.size - 2; - char *line; - - file->pos = ftell (file->fp); - reReadLine = 0; - *pLastChar = '\0'; - line = fgets (file->line.buffer, (int) file->line.size, file->fp); - if (line == NULL) - { - /* read error */ - if (! feof (file->fp)) - perror ("readTagLine"); - result = 0; - } - else if (*pLastChar != '\0' && - *pLastChar != '\n' && *pLastChar != '\r') - { - /* buffer overflow */ - growString (&file->line); - fseek (file->fp, file->pos, SEEK_SET); - reReadLine = 1; - } - else - { - size_t i = strlen (file->line.buffer); - while (i > 0 && - (file->line.buffer [i - 1] == '\n' || file->line.buffer [i - 1] == '\r')) - { - file->line.buffer [i - 1] = '\0'; - --i; - } - } - } while (reReadLine && result); - if (result) - copyName (file); - return result; -} - -static int readTagLine (tagFile *const file) -{ - int result; - do - { - result = readTagLineRaw (file); - } while (result && *file->name.buffer == '\0'); - return result; -} - -static tagResult growFields (tagFile *const file) -{ - tagResult result = TagFailure; - unsigned short newCount = 2 * file->fields.max; - tagExtensionField *newFields = (tagExtensionField*) - realloc (file->fields.list, newCount * sizeof (tagExtensionField)); - if (newFields == NULL) - perror ("too many extension fields"); - else - { - file->fields.list = newFields; - file->fields.max = newCount; - result = TagSuccess; - } - return result; -} - -static void parseExtensionFields (tagFile *const file, tagEntry *const entry, - char *const string) -{ - char *p = string; - while (p != NULL && *p != '\0') - { - while (*p == TAB) - *p++ = '\0'; - if (*p != '\0') - { - char *colon; - char *field = p; - p = strchr (p, TAB); - if (p != NULL) - *p++ = '\0'; - colon = strchr (field, ':'); - if (colon == NULL) - entry->kind = field; - else - { - const char *key = field; - const char *value = colon + 1; - *colon = '\0'; - if (strcmp (key, "kind") == 0) - entry->kind = value; - else if (strcmp (key, "file") == 0) - entry->fileScope = 1; - else if (strcmp (key, "line") == 0) - entry->address.lineNumber = atol (value); - else - { - if (entry->fields.count == file->fields.max) - growFields (file); - file->fields.list [entry->fields.count].key = key; - file->fields.list [entry->fields.count].value = value; - ++entry->fields.count; - } - } - } - } -} - -static void parseTagLine (tagFile *file, tagEntry *const entry) -{ - int i; - char *p = file->line.buffer; - char *tab = strchr (p, TAB); - int fieldsPresent = 0; - - entry->fields.list = NULL; - entry->fields.count = 0; - entry->kind = NULL; - entry->fileScope = 0; - - entry->name = p; - if (tab != NULL) - { - *tab = '\0'; - p = tab + 1; - entry->file = p; - tab = strchr (p, TAB); - if (tab != NULL) - { - *tab = '\0'; - p = tab + 1; - if (*p == '/' || *p == '?') - { - /* parse pattern */ - int delimiter = *(unsigned char*) p; - entry->address.lineNumber = 0; - entry->address.pattern = p; - do - { - p = strchr (p + 1, delimiter); - } while (p != NULL && *(p - 1) == '\\'); - if (p == NULL) - { - /* invalid pattern */ - } - else - ++p; - } - else if (isdigit ((int) *(unsigned char*) p)) - { - /* parse line number */ - entry->address.pattern = p; - entry->address.lineNumber = atol (p); - while (isdigit ((int) *(unsigned char*) p)) - ++p; - } - else - { - /* invalid pattern */ - } - fieldsPresent = (strncmp (p, ";\"", 2) == 0); - *p = '\0'; - if (fieldsPresent) - parseExtensionFields (file, entry, p + 2); - } - } - if (entry->fields.count > 0) - entry->fields.list = file->fields.list; - for (i = entry->fields.count ; i < file->fields.max ; ++i) - { - file->fields.list [i].key = NULL; - file->fields.list [i].value = NULL; - } -} - -static char *duplicate (const char *str) -{ - char *result = NULL; - if (str != NULL) - { - result = (char*) malloc (strlen (str) + 1); - if (result == NULL) - perror (NULL); - else - strcpy (result, str); - } - return result; -} - -static void readPseudoTags (tagFile *const file, tagFileInfo *const info) -{ - fpos_t startOfLine; - const size_t prefixLength = strlen (PseudoTagPrefix); - if (info != NULL) - { - info->file.format = 1; - info->file.sort = TAG_UNSORTED; - info->program.author = NULL; - info->program.name = NULL; - info->program.url = NULL; - info->program.version = NULL; - } - while (1) - { - fgetpos (file->fp, &startOfLine); - if (! readTagLine (file)) - break; - if (strncmp (file->line.buffer, PseudoTagPrefix, prefixLength) != 0) - break; - else - { - tagEntry entry; - const char *key, *value; - parseTagLine (file, &entry); - key = entry.name + prefixLength; - value = entry.file; - if (strcmp (key, "TAG_FILE_SORTED") == 0) - file->sortMethod = (sortType) atoi (value); - else if (strcmp (key, "TAG_FILE_FORMAT") == 0) - file->format = atoi (value); - else if (strcmp (key, "TAG_PROGRAM_AUTHOR") == 0) - file->program.author = duplicate (value); - else if (strcmp (key, "TAG_PROGRAM_NAME") == 0) - file->program.name = duplicate (value); - else if (strcmp (key, "TAG_PROGRAM_URL") == 0) - file->program.url = duplicate (value); - else if (strcmp (key, "TAG_PROGRAM_VERSION") == 0) - file->program.version = duplicate (value); - if (info != NULL) - { - info->file.format = file->format; - info->file.sort = file->sortMethod; - info->program.author = file->program.author; - info->program.name = file->program.name; - info->program.url = file->program.url; - info->program.version = file->program.version; - } - } - } - fsetpos (file->fp, &startOfLine); -} - -static void gotoFirstLogicalTag (tagFile *const file) -{ - fpos_t startOfLine; - const size_t prefixLength = strlen (PseudoTagPrefix); - rewind (file->fp); - while (1) - { - fgetpos (file->fp, &startOfLine); - if (! readTagLine (file)) - break; - if (strncmp (file->line.buffer, PseudoTagPrefix, prefixLength) != 0) - break; - } - fsetpos (file->fp, &startOfLine); -} - -static tagFile *initialize (const char *const filePath, tagFileInfo *const info) -{ - tagFile *result = (tagFile*) malloc (sizeof (tagFile)); - if (result != NULL) - { - memset (result, 0, sizeof (tagFile)); - growString (&result->line); - growString (&result->name); - result->fields.max = 20; - result->fields.list = (tagExtensionField*) malloc ( - result->fields.max * sizeof (tagExtensionField)); - result->fp = fopen (filePath, "r"); - if (result->fp == NULL) - { - free (result); - result = NULL; - info->status.error_number = errno; - } - else - { - fseek (result->fp, 0, SEEK_END); - result->size = ftell (result->fp); - rewind (result->fp); - readPseudoTags (result, info); - info->status.opened = 1; - result->initialized = 1; - } - } - return result; -} - -static void terminate (tagFile *const file) -{ - fclose (file->fp); - - free (file->line.buffer); - free (file->name.buffer); - free (file->fields.list); - - if (file->program.author != NULL) - free (file->program.author); - if (file->program.name != NULL) - free (file->program.name); - if (file->program.url != NULL) - free (file->program.url); - if (file->program.version != NULL) - free (file->program.version); - - memset (file, 0, sizeof (tagFile)); - - free (file); -} - -static tagResult readNext (tagFile *const file, tagEntry *const entry) -{ - tagResult result = TagFailure; - if (file == NULL || ! file->initialized) - result = TagFailure; - else if (! readTagLine (file)) - result = TagFailure; - else - { - if (entry != NULL) - parseTagLine (file, entry); - result = TagSuccess; - } - return result; -} - -static const char *readFieldValue ( - const tagEntry *const entry, const char *const key) -{ - const char *result = NULL; - int i; - if (strcmp (key, "kind") == 0) - result = entry->kind; - else if (strcmp (key, "file") == 0) - result = EmptyString; - else for (i = 0 ; i < entry->fields.count && result == NULL ; ++i) - if (strcmp (entry->fields.list [i].key, key) == 0) - result = entry->fields.list [i].value; - return result; -} - -static int readTagLineSeek (tagFile *const file, const off_t pos) -{ - int result = 0; - if (fseek (file->fp, pos, SEEK_SET) == 0) - { - result = readTagLine (file); /* read probable partial line */ - if (pos > 0 && result) - result = readTagLine (file); /* read complete line */ - } - return result; -} - -static int nameComparison (tagFile *const file) -{ - int result; - if (file->search.ignorecase) - { - if (file->search.partial) - result = strnuppercmp (file->search.name, file->name.buffer, - file->search.nameLength); - else - result = struppercmp (file->search.name, file->name.buffer); - } - else - { - if (file->search.partial) - result = strncmp (file->search.name, file->name.buffer, - file->search.nameLength); - else - result = strcmp (file->search.name, file->name.buffer); - } - return result; -} - -static void findFirstNonMatchBefore (tagFile *const file) -{ -#define JUMP_BACK 512 - int more_lines; - int comp; - off_t start = file->pos; - off_t pos = start; - do - { - if (pos < (off_t) JUMP_BACK) - pos = 0; - else - pos = pos - JUMP_BACK; - more_lines = readTagLineSeek (file, pos); - comp = nameComparison (file); - } while (more_lines && comp == 0 && pos > 0 && pos < start); -} - -static tagResult findFirstMatchBefore (tagFile *const file) -{ - tagResult result = TagFailure; - int more_lines; - off_t start = file->pos; - findFirstNonMatchBefore (file); - do - { - more_lines = readTagLine (file); - if (nameComparison (file) == 0) - result = TagSuccess; - } while (more_lines && result != TagSuccess && file->pos < start); - return result; -} - -static tagResult findBinary (tagFile *const file) -{ - tagResult result = TagFailure; - off_t lower_limit = 0; - off_t upper_limit = file->size; - off_t last_pos = 0; - off_t pos = upper_limit / 2; - while (result != TagSuccess) - { - if (! readTagLineSeek (file, pos)) - { - /* in case we fell off end of file */ - result = findFirstMatchBefore (file); - break; - } - else if (pos == last_pos) - { - /* prevent infinite loop if we backed up to beginning of file */ - break; - } - else - { - const int comp = nameComparison (file); - last_pos = pos; - if (comp < 0) - { - upper_limit = pos; - pos = lower_limit + ((upper_limit - lower_limit) / 2); - } - else if (comp > 0) - { - lower_limit = pos; - pos = lower_limit + ((upper_limit - lower_limit) / 2); - } - else if (pos == 0) - result = TagSuccess; - else - result = findFirstMatchBefore (file); - } - } - return result; -} - -static tagResult findSequential (tagFile *const file) -{ - tagResult result = TagFailure; - if (file->initialized) - { - while (result == TagFailure && readTagLine (file)) - { - if (nameComparison (file) == 0) - result = TagSuccess; - } - } - return result; -} - -static tagResult find (tagFile *const file, tagEntry *const entry, - const char *const name, const int options) -{ - tagResult result = TagFailure; - file->search.name = name; - file->search.nameLength = strlen (name); - file->search.partial = (options & TAG_PARTIALMATCH) != 0; - file->search.ignorecase = (options & TAG_IGNORECASE) != 0; - fseek (file->fp, 0, SEEK_END); - file->size = ftell (file->fp); - rewind (file->fp); - if ((file->sortMethod == TAG_SORTED && !file->search.ignorecase) || - (file->sortMethod == TAG_FOLDSORTED && file->search.ignorecase)) - { -#ifdef DEBUG - printf ("\n"); -#endif - result = findBinary (file); - } - else - { -#ifdef DEBUG - printf ("\n"); -#endif - result = findSequential (file); - } - - if (result != TagSuccess) - file->search.pos = file->size; - else - { - file->search.pos = file->pos; - if (entry != NULL) - parseTagLine (file, entry); - } - return result; -} - -static tagResult findNext (tagFile *const file, tagEntry *const entry) -{ - tagResult result = TagFailure; - if ((file->sortMethod == TAG_SORTED && !file->search.ignorecase) || - (file->sortMethod == TAG_FOLDSORTED && file->search.ignorecase)) - { - result = tagsNext (file, entry); - if (result == TagSuccess && nameComparison (file) != 0) - result = TagFailure; - } - else - { - result = findSequential (file); - if (result == TagSuccess && entry != NULL) - parseTagLine (file, entry); - } - return result; -} - -/* -* EXTERNAL INTERFACE -*/ - -extern tagFile *tagsOpen (const char *const filePath, tagFileInfo *const info) -{ - return initialize (filePath, info); -} - -extern tagResult tagsSetSortType (tagFile *const file, const sortType type) -{ - tagResult result = TagFailure; - if (file != NULL && file->initialized) - { - file->sortMethod = type; - result = TagSuccess; - } - return result; -} - -extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry) -{ - tagResult result = TagFailure; - if (file != NULL && file->initialized) - { - gotoFirstLogicalTag (file); - result = readNext (file, entry); - } - return result; -} - -extern tagResult tagsNext (tagFile *const file, tagEntry *const entry) -{ - tagResult result = TagFailure; - if (file != NULL && file->initialized) - result = readNext (file, entry); - return result; -} - -extern const char *tagsField (const tagEntry *const entry, const char *const key) -{ - const char *result = NULL; - if (entry != NULL) - result = readFieldValue (entry, key); - return result; -} - -extern tagResult tagsFind (tagFile *const file, tagEntry *const entry, - const char *const name, const int options) -{ - tagResult result = TagFailure; - if (file != NULL && file->initialized) - result = find (file, entry, name, options); - return result; -} - -extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry) -{ - tagResult result = TagFailure; - if (file != NULL && file->initialized) - result = findNext (file, entry); - return result; -} - -extern tagResult tagsClose (tagFile *const file) -{ - tagResult result = TagFailure; - if (file != NULL && file->initialized) - { - terminate (file); - result = TagSuccess; - } - return result; -} - -/* -* TEST FRAMEWORK -*/ - -#ifdef READTAGS_MAIN - -static const char *TagFileName = "tags"; -static const char *Kind=NULL; -static const char *Key=NULL; -static const char *Value=NULL; -static const char *Temp=NULL; -static const char *ProgramName; -static int extensionFields; -static int searchDefine ; -static int SortOverride; -static int max_lines = -1; -static sortType SortMethod; - -static void printTag (const tagEntry *entry) -{ - int i; - int first = 1; - const char* separator = ";\""; - const char* const empty = ""; -/* "sep" returns a value only the first time it is evaluated */ -#define sep (first ? (first = 0, separator) : empty) - printf ("%s\t%s\t%s", - entry->name, entry->file, entry->address.pattern); - if (extensionFields) - { - if (entry->kind != NULL && entry->kind [0] != '\0') - printf ("%s\t%s", sep, entry->kind); - if (entry->fileScope) - printf ("%s\tfile:", sep); -#if 0 - if (entry->address.lineNumber > 0) - printf ("%s\tline:%lu", sep, entry->address.lineNumber); -#endif - for (i = 0 ; i < entry->fields.count ; ++i) - printf ("%s\t%s:%s", sep, entry->fields.list [i].key, - entry->fields.list [i].value); - } - putchar ('\n'); -#undef sep -} -static tagResult is_member(const tagEntry *entry,const char *const k,const char* const v) -{ - int i=0; - for (i = 0 ; i < entry->fields.count ; ++i) - { - if (struppercmp(entry->fields.list[i].key,k)==0) { - if (struppercmp(entry->fields.list[i].value,v)==0) - { - return TagSuccess; - } - } -#ifdef DEBUG - else { - printf("%s\n",entry->fields.list[i].key); - } -#endif - } - return TagFailure; -} -static int is_define ( const tagEntry* entry,const char* const kind) -{ - int result=0; - const char *ptr = kind; - if ( entry->kind==NULL || entry->kind[0]=='\0') return 0; - do - { - result = result | (int)entry->kind[0]==(int)*ptr; - } while ( *ptr++ != '\0' && result!=1); - return result; -} -static void findTag (const char *const name, const int options) -{ - tagFileInfo info; - tagEntry entry; - tagFile *const file = tagsOpen (TagFileName, &info); - int result=1; - if (file == NULL) - { - fprintf (stderr, "%s: cannot open tag file: %s: %s\n", - ProgramName, strerror (info.status.error_number), name); - exit (1); - } - else - { - if (SortOverride) - tagsSetSortType (file, SortMethod); - if (tagsFind (file, &entry, name, options) == TagSuccess) - { - do - { - /*if (is_define(&entry)) */ - result = 1; - if (Kind!=NULL) - { - result = result & is_define(&entry,Kind); - } - if (Key != NULL) - { - result = result & is_member(&entry,Key,Value); - } - if (result) - { - printTag (&entry); - max_lines --; - } - } while (tagsFindNext (file, &entry) == TagSuccess&&(max_lines!=0)); - } - tagsClose (file); - } -} -static void findMembers(const char *const k,const char* const v, - const char *const name, const int options) -{ - tagFileInfo info; - tagEntry entry; - tagFile *const file = tagsOpen (TagFileName, &info); - if (file == NULL) - { - fprintf (stderr, "%s: cannot open tag file: %s: %s\n", - ProgramName, strerror (info.status.error_number), name); - exit (1); - } - else - { - if (SortOverride) - tagsSetSortType (file, SortMethod); - if (tagsFind (file, &entry, name, options) == TagSuccess) - { - do - { - if (is_member(&entry,k,v)) - { - if ( Kind!=NULL ) { - if (is_define(&entry,Kind)) { - printTag (&entry); - max_lines --; - } - } - else { - printTag (&entry); - max_lines --; - } - } - } while (tagsFindNext (file, &entry) == TagSuccess&&(max_lines!=0)); - } - tagsClose (file); - } -} - -static void findTag4Kind(const char *const k, - const char *const name, const int options) -{ - tagFileInfo info; - tagEntry entry; - tagFile *const file = tagsOpen (TagFileName, &info); - if (file == NULL) - { - fprintf (stderr, "%s: cannot open tag file: %s: %s\n", - ProgramName, strerror (info.status.error_number), name); - exit (1); - } - else - { - if (SortOverride) - tagsSetSortType (file, SortMethod); - if (tagsFind (file, &entry, name, options) == TagSuccess) - { - do - { - if (is_define(&entry,k)) - { - printTag (&entry); - max_lines --; - } - } while (tagsFindNext (file, &entry) == TagSuccess&&(max_lines!=0)); - } - tagsClose (file); - } -} -static void listTags (void) -{ - tagFileInfo info; - tagEntry entry; - tagFile *const file = tagsOpen (TagFileName, &info); - int result = 1; - if (file == NULL) - { - fprintf (stderr, "%s: cannot open tag file: %s: %s\n", - ProgramName, strerror (info.status.error_number), TagFileName); - exit (1); - } - else - { - while (tagsNext (file, &entry) == TagSuccess && max_lines!=0) - { - result = 1; - if (Kind!=NULL) - { - result = result & is_define(&entry,Kind); - } - if (Key != NULL) - { - result = result & is_member(&entry,Key,Value); - } - if (result) - { - printTag (&entry); - max_lines --; - } - } - tagsClose (file); - } -} - -static void listMembers (const char* const k , const char* const v) -{ - tagFileInfo info; - tagEntry entry; - tagFile *const file = tagsOpen (TagFileName, &info); - if (file == NULL) - { - fprintf (stderr, "%s: cannot open tag file: %s: %s\n", - ProgramName, strerror (info.status.error_number), TagFileName); - exit (1); - } - else - { -#ifdef DEBUG - printf("%d\n" , max_lines); -#endif - while (tagsNext (file, &entry) == TagSuccess && max_lines!=0) - { - if ( is_member(&entry,k,v)) - { - if ( Kind!=NULL ) { - if (is_define(&entry,Kind)) { - printTag (&entry); - max_lines --; - } - } - else { - printTag (&entry); - max_lines --; - } - } - } -#ifdef DEBUG - printf("%d\n" , max_lines); -#endif - tagsClose (file); - } -} -const char *const Usage = - "Find tag file entries matching specified names.\n\n" - "Usage: %s [-ilpd] [-s[0|1]] [-t file] ([-k kind]|-f field value) [name(s)] \n\n" - "Options:\n" - " -e Include extension fields in output.\n" - " -i Perform case-insensitive matching.\n" - " -m number max line of tags \n" - " -l List all tags.\n" - " -p Perform partial matching.\n" - " -k kind Search for the tag with kind.\n" - " -s[0|1|2] Override sort detection of tag file.\n" - " -f field value Use specified tag file (default: \"tags\").\n" - " -t file Use specified tag file (default: \"tags\").\n" - "Note that options are acted upon as encountered, so order is significant.\n"; -int main( int argc, char* argv[] ) -{ - int options = 0; - int actionSupplied = 0; - int i; - ProgramName = argv [0]; - if (argc == 1) - { - fprintf (stderr, Usage, ProgramName); - exit (1); - } - for (i = 1 ; i < argc ; ++i) - { - const char *const arg = argv [i]; - if (arg [0] != '-') - { - /* - if (Key !=NULL) { - findMembers(Key,Value,arg,options); - } - else if (Kind!=NULL) { - findTag4Kind(Kind,arg,options); - } - else { - } - */ - findTag (arg, options); - actionSupplied = 1; - } - else - { - size_t j; - for (j = 1 ; arg [j] != '\0' ; ++j) - { - switch (arg [j]) - { - case 'e': extensionFields = 1; break; - case 'i': options |= TAG_IGNORECASE; break; - case 'p': options |= TAG_PARTIALMATCH; break; - case 'l': listTags (); actionSupplied = 1; break; - - case 'k': - if (arg [j+1] != '\0') - { - Kind = arg + j + 1; - j += strlen (Kind); - } - else if (i + 1 < argc) - Kind = argv [++i]; - else - { - fprintf (stderr, Usage, ProgramName); - exit (1); - } - break; - - case 'f': - if (arg [j+1] != '\0') - { - Key = arg + j + 1; - j += strlen (Kind); - } - else if (i + 1 < argc) - Key = argv [++i]; - else - { - fprintf (stderr, Usage, ProgramName); - exit (1); - } - Value = argv[++i]; - break; - case 't': - if (arg [j+1] != '\0') - { - TagFileName = arg + j + 1; - j += strlen (TagFileName); - } - else if (i + 1 < argc) - TagFileName = argv [++i]; - else - { - fprintf (stderr, Usage, ProgramName); - exit (1); - } - break; - case 'm': - if (arg [j+1] != '\0') - { - Temp = arg + j + 1; - j += strlen (Value); - } - else if (i + 1 < argc) - Temp = argv [++i]; - else - { - fprintf (stderr, Usage, ProgramName); - exit (1); - } - max_lines = atoi(Temp); - break; - case 's': - SortOverride = 1; - ++j; - if (arg [j] == '\0') - SortMethod = TAG_SORTED; - else if (strchr ("012", arg[j]) != NULL) - SortMethod = (sortType) (arg[j] - '0'); - else - { - fprintf (stderr, Usage, ProgramName); - exit (1); - } - break; - default: - fprintf (stderr, "%s: unknown option: %c\n", - ProgramName, arg[j]); - exit (1); - break; - } - } - } - } - if (Key!= NULL && !actionSupplied) - { - listMembers(Key,Value); - actionSupplied = 1; - } - if (! actionSupplied) - { - fprintf (stderr, - "%s: no action specified: specify tag name(s) or -l option\n", - ProgramName); - exit (1); - } - return 0; -} - -#endif - -/* vi:set tabstop=8 shiftwidth=4: */ diff --git a/dot.vim/src/readtags.h b/dot.vim/src/readtags.h deleted file mode 100644 index a02626e..0000000 --- a/dot.vim/src/readtags.h +++ /dev/null @@ -1,252 +0,0 @@ -/* -* $Id: readtags.h,v 1.12 2003/04/01 05:02:21 darren Exp $ -* -* Copyright (c) 1996-2003, Darren Hiebert -* -* This source code is released for the public domain. -* -* This file defines the public interface for looking up tag entries in tag -* files. -* -* The functions defined in this interface are intended to provide tag file -* support to a software tool. The tag lookups provided are sufficiently fast -* enough to permit opening a sorted tag file, searching for a matching tag, -* then closing the tag file each time a tag is looked up (search times are -* on the order of hundreths of a second, even for huge tag files). This is -* the recommended use of this library for most tool applications. Adhering -* to this approach permits a user to regenerate a tag file at will without -* the tool needing to detect and resynchronize with changes to the tag file. -* Even for an unsorted 24MB tag file, tag searches take about one second. -*/ -#ifndef READTAGS_H -#define READTAGS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* -* MACROS -*/ - -/* Options for tagsSetSortType() */ -typedef enum { - TAG_UNSORTED, TAG_SORTED, TAG_FOLDSORTED -} sortType ; - -/* Options for tagsFind() */ -#define TAG_FULLMATCH 0x0 -#define TAG_PARTIALMATCH 0x1 - -#define TAG_OBSERVECASE 0x0 -#define TAG_IGNORECASE 0x2 - -/* -* DATA DECLARATIONS -*/ - -typedef enum { TagFailure = 0, TagSuccess = 1 } tagResult; - -struct sTagFile; - -typedef struct sTagFile tagFile; - -/* This structure contains information about the tag file. */ -typedef struct { - - struct { - /* was the tag file successfully opened? */ - int opened; - - /* errno value when 'opened' is false */ - int error_number; - } status; - - /* information about the structure of the tag file */ - struct { - /* format of tag file (1 = original, 2 = extended) */ - short format; - - /* how is the tag file sorted? */ - sortType sort; - } file; - - - /* information about the program which created this tag file */ - struct { - /* name of author of generating program (may be null) */ - const char *author; - - /* name of program (may be null) */ - const char *name; - - /* URL of distribution (may be null) */ - const char *url; - - /* program version (may be null) */ - const char *version; - } program; - -} tagFileInfo; - -/* This structure contains information about an extension field for a tag. - * These exist at the end of the tag in the form "key:value"). - */ -typedef struct { - - /* the key of the extension field */ - const char *key; - - /* the value of the extension field (may be an empty string) */ - const char *value; - -} tagExtensionField; - -/* This structure contains information about a specific tag. */ -typedef struct { - - /* name of tag */ - const char *name; - - /* path of source file containing definition of tag */ - const char *file; - - /* address for locating tag in source file */ - struct { - /* pattern for locating source line - * (may be NULL if not present) */ - const char *pattern; - - /* line number in source file of tag definition - * (may be zero if not known) */ - unsigned long lineNumber; - } address; - - /* kind of tag (may by name, character, or NULL if not known) */ - const char *kind; - - /* is tag of file-limited scope? */ - short fileScope; - - /* miscellaneous extension fields */ - struct { - /* number of entries in `list' */ - unsigned short count; - - /* list of key value pairs */ - tagExtensionField *list; - } fields; - -} tagEntry; - - -/* -* FUNCTION PROTOTYPES -*/ - -/* -* This function must be called before calling other functions in this -* library. It is passed the path to the tag file to read and a (possibly -* null) pointer to a structure which, if not null, will be populated with -* information about the tag file. If successful, the function will return a -* handle which must be supplied to other calls to read information from the -* tag file, and info.status.opened will be set to true. If unsuccessful, -* info.status.opened will be set to false and info.status.error_number will -* be set to the errno value representing the system error preventing the tag -* file from being successfully opened. -*/ -extern tagFile *tagsOpen (const char *const filePath, tagFileInfo *const info); - -/* -* This function allows the client to override the normal automatic detection -* of how a tag file is sorted. Permissible values for `type' are -* TAG_UNSORTED, TAG_SORTED, TAG_FOLDSORTED. Tag files in the new extended -* format contain a key indicating whether or not they are sorted. However, -* tag files in the original format do not contain such a key even when -* sorted, preventing this library from taking advantage of fast binary -* lookups. If the client knows that such an unmarked tag file is indeed -* sorted (or not), it can override the automatic detection. Note that -* incorrect lookup results will result if a tag file is marked as sorted when -* it actually is not. The function will return TagSuccess if called on an -* open tag file or TagFailure if not. -*/ -extern tagResult tagsSetSortType (tagFile *const file, const sortType type); - -/* -* Reads the first tag in the file, if any. It is passed the handle to an -* opened tag file and a (possibly null) pointer to a structure which, if not -* null, will be populated with information about the first tag file entry. -* The function will return TagSuccess another tag entry is found, or -* TagFailure if not (i.e. it reached end of file). -*/ -extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry); - -/* -* Step to the next tag in the file, if any. It is passed the handle to an -* opened tag file and a (possibly null) pointer to a structure which, if not -* null, will be populated with information about the next tag file entry. The -* function will return TagSuccess another tag entry is found, or TagFailure -* if not (i.e. it reached end of file). It will always read the first tag in -* the file immediately after calling tagsOpen(). -*/ -extern tagResult tagsNext (tagFile *const file, tagEntry *const entry); - -/* -* Retrieve the value associated with the extension field for a specified key. -* It is passed a pointer to a structure already populated with values by a -* previous call to tagsNext(), tagsFind(), or tagsFindNext(), and a string -* containing the key of the desired extension field. If no such field of the -* specified key exists, the function will return null. -*/ -extern const char *tagsField (const tagEntry *const entry, const char *const key); - -/* -* Find the first tag matching `name'. The structure pointed to by `entry' -* will be populated with information about the tag file entry. If a tag file -* is sorted using the C locale, a binary search algorithm is used to search -* the tag file, resulting in very fast tag lookups, even in huge tag files. -* Various options controlling the matches can be combined by bit-wise or-ing -* certain values together. The available values are: -* -* TAG_PARTIALMATCH -* Tags whose leading characters match `name' will qualify. -* -* TAG_FULLMATCH -* Only tags whose full lengths match `name' will qualify. -* -* TAG_IGNORECASE -* Matching will be performed in a case-insenstive manner. Note that -* this disables binary searches of the tag file. -* -* TAG_OBSERVECASE -* Matching will be performed in a case-senstive manner. Note that -* this enables binary searches of the tag file. -* -* The function will return TagSuccess if a tag matching the name is found, or -* TagFailure if not. -*/ -extern tagResult tagsFind (tagFile *const file, tagEntry *const entry, const char *const name, const int options); - -/* -* Find the next tag matching the name and options supplied to the most recent -* call to tagsFind() for the same tag file. The structure pointed to by -* `entry' will be populated with information about the tag file entry. The -* function will return TagSuccess if another tag matching the name is found, -* or TagFailure if not. -*/ -extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry); - -/* -* Call tagsTerminate() at completion of reading the tag file, which will -* close the file and free any internal memory allocated. The function will -* return TagFailure is no file is currently open, TagSuccess otherwise. -*/ -extern tagResult tagsClose (tagFile *const file); - -#ifdef __cplusplus -}; -#endif - -#endif - -/* vi:set tabstop=8 shiftwidth=4: */ diff --git a/dot.vim/src/tipswnd.c b/dot.vim/src/tipswnd.c deleted file mode 100644 index 84a4b74..0000000 --- a/dot.vim/src/tipswnd.c +++ /dev/null @@ -1,372 +0,0 @@ -//#include "stdafx.h" -/* - * -gcc -D DLL -shared -o ../plugin/vjde/tipswnd.dll tipswnd.c -luser32 -lcomctl32 -lgdi32 -mwindows - */ -#include -#ifdef DLL -#define _DL_EXPORT __declspec(dllexport) extern -#else -#define _DL_EXPORT -#endif - -char cBuffer[2048]; -int iLineCount; -int top ; -int left; -int iMaxWidth; -int iMaxHeight; -BOOL stoped ; - -HWND hwndText; // Vim 봰 -HWND m_vimHwnd; // vim - -BOOL CALLBACK EnumWndProc(HWND hWnd,LPARAM lParam) -{ - HWND* lhwnd=(HWND*)lParam; - char buf[50]; - GetClassName(hWnd,buf,50); - //VimTextArea is the class name of main editing window of VIM - if (strcmp(buf,"VimTextArea") == 0) - { - *lhwnd=hWnd; - return FALSE; - } - return TRUE; -} -void FindVimWindow() -{ - HWND hTempHwnd = GetForegroundWindow(); - if(hTempHwnd) - { - m_vimHwnd = hTempHwnd; - } - else - { - //but getting VIM window failed get the Desktop window. This is used to get the - //VIM rectangle. So even desktop window is also OK. - m_vimHwnd = GetDesktopWindow(); - } - - //Get the editing window in the VIM. - EnumChildWindows(m_vimHwnd,EnumWndProc,(LPARAM)&hwndText); - - //GetWindowRect(hwndText,vimRect); -} -void PaintText(HDC hdc) -{ - char *p = cBuffer; - char *temp = cBuffer; - int line = 0; - while ( *temp != '\0') { - if (*temp == '\n') { - TextOut( hdc, 2 , iMaxHeight * line + 2, p, temp-p );// - line ++; - p = temp+1; - } - ++temp; - } - if ( p < temp ) - { //δһ\n - TextOut( hdc, 2 , iMaxHeight * line + 2, p, temp-p );// - } -} -BOOL RetriveTextSize(HDC hdc) -{ - SIZE size ; - - iLineCount = 0; - iMaxWidth = 0; - iMaxHeight = 0; - - char *p = cBuffer; - char *temp = cBuffer; - while ( *temp != '\0') { - if (*temp == '\n') { - iLineCount++; - GetTextExtentPoint(hdc,p,temp-p-1,&size); - { - iMaxWidth = size.cx > iMaxWidth ? size.cx:iMaxWidth; - iMaxHeight = size.cy > iMaxHeight ? size.cy:iMaxHeight; - } - p = temp+1; - } - ++temp; - } - if ( p < temp ) - { //δһ\n - iLineCount++; - GetTextExtentPoint(hdc,p,temp-p-1,&size); - { - iMaxWidth = size.cx > iMaxWidth ? size.cx:iMaxWidth; - iMaxHeight = size.cy > iMaxHeight ? size.cy:iMaxHeight; - } - } -} -int ReadInt(char *in,int l) -{ - char buffer[64]; - snprintf(buffer,l,"%s",in); - return atoi(buffer); -} -int AdjustPosEx(LPRECT rect, int w,int h) -{ - if ( left+w+10 > rect->right ) { - if ( left > w+10 ) { - left = left - w - 10; - } - else { - left = rect->right - w - 20; - } - } - if ( top + h + 10 > rect->bottom ) { - if ( top > h + 10 ) { - top = top - h - 20; - } - else { - top = rect->bottom - h - 20; - } - } -} -/** - * Caculate the left-top point of tips window. - * @param in "8;12;30;80;\n.." - * line;col; line total;colums total; - */ -int AdjustPos(LPRECT rect,char *in) -{ - int t,l,w,h; - char *p = in; - char *temp = in; - char buffer[128]; - - while ( *temp!=';') ++temp; - t = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - l = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - h = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - w = ReadInt(p,temp-p); - ++temp; - ++temp; // skip a \n - - top = (rect->bottom-rect->top)*t/h + rect->top; - left = (rect->right-rect->left)*l/w + rect->left; - return temp - in; - - //snprintf(buffer,64,p, -} -//һϢ -//:ھϢϢϢ -LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - //ȤϢ - switch (message) - { - case WM_KEYDOWN: - switch (wParam) - { - stoped = TRUE; - DestroyWindow(hwnd); - return 0; - } - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN://Ϣ - { - stoped = TRUE; - DestroyWindow(hwnd); - return 0; - } - case WM_PAINT: - { - char hello[]="ãEasyWin !"; - char buff[128]; - HDC hdc; - PAINTSTRUCT ps; - RECT rect; - HFONT font; - HGDIOBJ oldFont; - - - font = CreateFont(12, 0, 0, 0, FW_REGULAR, 0, 0, 0, 0, 0, 0, 0, 0, "MS Sans Serif"); - - hdc=BeginPaint( hwnd,&ps ); //ȡ豸 - - oldFont = SelectObject(hdc,font); - RetriveTextSize(hdc); - - GetWindowRect( GetDesktopWindow() , &rect); - AdjustPosEx(&rect,iMaxWidth+20,iMaxHeight * iLineCount + 20); - MoveWindow(hwnd,left,top, iMaxWidth+20,(iMaxHeight * iLineCount)+20,TRUE); - - - GetClientRect(hwnd,&rect); - InflateRect(&rect,-1,-1); - FillRect(hdc, &rect,CreateSolidBrush(RGB(0xff,0xff,0x99))); - - SelectObject(hdc,CreatePen(PS_SOLID,2,RGB(162,162,162))); - - SetBkMode(hdc,TRANSPARENT); - SetTextColor(hdc, RGB(0,0,0)); //ɫ - - oldFont = SelectObject(hdc,font); - PaintText(hdc); - - SelectObject(hdc,oldFont); - EndPaint( hwnd, &ps ); //ͷԴ - break; - } - case WM_CLOSE: - break; - case WM_DESTROY: - //PostQuitMessage(0); - //ûرմڣ٣˳Ϣ˳Ϣѭ - return 0 ; - } - return 0; - //Ϣϵͳṩȱʡ - return DefWindowProc(hwnd, message, wParam, lParam); -} - -_DL_EXPORT int tipsWnd(char *in) -{ - //1.עᴰ - static TCHAR szAppName[] = TEXT ("HelloWin") ; // - //""ṹ - - // - HWND hwnd ; - RECT rect; - - FindVimWindow(); - GetWindowRect(hwndText,&rect); - int offset = AdjustPos(&rect,in); - //top = rect.top; - //left = rect.left; - // - hwnd = CreateWindowEx( - WS_EX_DLGMODALFRAME|WS_EX_TOOLWINDOW, - //szAppName, - "#32770", - TEXT("The Hello Program"), - WS_POPUP|WS_DLGFRAME|WS_OVERLAPPED, - 0, - 0, - 400, - 300, - NULL, - NULL, - NULL, - NULL); - //sprintf(cBuffer,"%s","Hello \n world!\nǾڲ.--------------------\n^_^\n"); - snprintf(cBuffer,2048,"%s",in+offset); - SetWindowLongPtr(hwnd,DWL_DLGPROC,(LPARAM)WndProc); - - ShowWindow (hwnd, SW_SHOW) ; - UpdateWindow (hwnd) ; - - //Ϣѭ - MSG msg ; - while (!stoped ) { - if ( GetMessage(&msg,NULL,0,0)== 0 ) { - break; - } - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - /* - while (GetMessage (&msg, NULL, 0, 0)) //ϢȡϢ - { - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - */ - //UnregisterClass(szAppName,NULL); - return strlen(in); ; -} -#ifndef DLL -//Ӧó -//:ʵǰһʵľвʾʽ -int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, - PSTR szCmdLine, int iCmdShow) -{ - //1.עᴰ - static TCHAR szAppName[] = TEXT ("HelloWin") ; // - //""ṹ - /* - WNDCLASS wndclass ; - wndclass.style = CS_HREDRAW | CS_VREDRAW ; - wndclass.lpfnWndProc = WndProc ; //Ϣ - wndclass.cbClsExtra = 0 ; - wndclass.cbWndExtra = 0 ; - wndclass.hInstance = hInstance ; //ʵ - wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; //ͼ - wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; // - wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); //ˢ - wndclass.lpszMenuName = NULL ; - wndclass.lpszClassName = szAppName; // - //ע - if (!RegisterClass (&wndclass)) - { - MessageBox (NULL, TEXT ("RegisterClass Fail!"), - szAppName, MB_ICONERROR) ; - return 0 ; - } - */ - - // - HWND hwnd ; - hwnd = CreateWindowEx( - WS_EX_DLGMODALFRAME, - //WS_EX_APPWINDOW, - "#32770", - //szAppName, - TEXT("The Hello Program"), - //WS_OVERLAPPEDWINDOW, - WS_POPUP, - 0, - 0, - 400, - 300, - NULL, - NULL, - NULL, - NULL); - - sprintf(cBuffer,"%s","Hello \n world!\nǾڲ.--------------------\n^_^\n"); - SetWindowLongPtr(hwnd,DWL_DLGPROC,(LPARAM)WndProc); - - ShowWindow (hwnd, iCmdShow) ; - UpdateWindow (hwnd) ; - - //Ϣѭ - MSG msg ; - while (!stoped ) { - if ( GetMessage(&msg,NULL,0,0)== 0 ) { - break; - } - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - - /* - while (GetMessage (&msg, NULL, 0, 0) ) //ϢȡϢ - { - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - */ - return 0 ; -} -#endif -// vim: ts=4:sw=4:sts=4 diff --git a/dot.vim/src/tipswnd.lex b/dot.vim/src/tipswnd.lex deleted file mode 100644 index 6f277c1..0000000 --- a/dot.vim/src/tipswnd.lex +++ /dev/null @@ -1,524 +0,0 @@ -/* - * -gcc -D DLL -shared -o ../plugin/vjde/tipswnd.dll tipswnd.c -luser32 -lcomctl32 -lgdi32 -mwindows - */ -%{ -#include -#ifdef DLL -#define _DL_EXPORT __declspec(dllexport) extern -#else -#define _DL_EXPORT -#include "data.h" -#endif - -#define YY_INPUT(buf,result,max_size) {\ - result = GetNextChar(buf, max_size); \ - if ( result <= 0 ) \ - result = YY_NULL; \ - } - -int GetNextChar(char* buf,int max_size); -char cBuffer[2048]; -int bufferSize; -int offset; -int iLineCount; -int top ; -int left; -int iMaxWidth; -int iMaxHeight; -BOOL stoped ; - -HWND hwndText; // Vim 봰 -HWND m_vimHwnd; // vim -HDC hdc; -int paintX=2; -int paintY=0; -SIZE sizeXY; -int paramSkip; -int currentLine; -void ColoredText(int r , int g, int b ,char *p , int l) ; -void MyTextOut(char *p , int l) ; -%} - -%x MYLIST -%x MYLISTEX -%x PARAMETER -%% -\( { -MyTextOut(yytext,1); -if (paramSkip==0) { - BEGIN PARAMETER; -} -paramSkip=1; -} -\) { -MyTextOut(yytext,1); -BEGIN 0; -} -String | -double | -float | -int | -long | -byte | -Class | -String | -double | -char | -byte | -long | -null | -int | -String | -double | -char | -byte | -long | -null | -int | -String | -double | -char | -byte | -long | -null | -int { - ColoredText(0x00,0x00,0xff,yytext,strlen(yytext)); -} -See\ Also: | -See\ Also: | -Since: | -Since: { - ColoredText(0xff,0,0xff,yytext,strlen(yytext)); -} -[^ \t\n]+, { - ColoredText(0xff,0x00,0x00,yytext,strlen(yytext)-1); - MyTextOut(",",1); -} -[^ \t\n]+\) { - ColoredText(0xff,0x00,0x00,yytext,strlen(yytext)-1); - MyTextOut(")",1); - BEGIN 0; -} -[^ \t\n]+ { - MyTextOut(yytext,strlen(yytext)); -} -Throws: { - ColoredText(0xff,0x00,0xff,yytext,strlen(yytext)); - BEGIN MYLISTEX; -} -Parameters: | -Returns: | -Throws: | -Parameters: | -Returns: { - ColoredText(0xff,0,0xff,yytext,strlen(yytext)); - BEGIN MYLIST; -} -^[ \t]*[^ \t\n]+[ \t]*- { - ColoredText(0xff,0x00,0x00,yytext,strlen(yytext)-1); -} -^[ \t]*[^ \t\n]+[ \t]*- { - ColoredText(0xbb,0x00,0x00,yytext,strlen(yytext)-1); -} - -[^ \t\n,]+ | -[^ \t\n,]+ | -[^ \t\n(,]+ { - MyTextOut(yytext,strlen(yytext)); -} -\n | -\n | -\n | -\n { -++currentLine; -paintX=2; -paintY= currentLine*iMaxHeight+2; -} -[ \t]+ | -[ \t,]+ | -[ \t,]+ | -[ \t,]+ { - //TextOut(hdc,paintX,paintY,yytext,strlen(yytext)); - GetTextExtentPoint(hdc,yytext,strlen(yytext),&sizeXY); - paintX += sizeXY.cx; -} -%% - -void MyTextOut(char *p,int l) { - TextOut(hdc,paintX,paintY,p,l); - GetTextExtentPoint(hdc,p,l,&sizeXY); - paintX += sizeXY.cx; -} -void ColoredText(int r , int g, int b ,char *p , int l) { - SetTextColor(hdc, RGB(r,g,b)); //ɫ - TextOut(hdc,paintX,paintY,p,l); - GetTextExtentPoint(hdc,p,l,&sizeXY); - paintX += sizeXY.cx; - SetTextColor(hdc, RGB(0x0,0,0x0)); //ɫ -} -int GetNextChar(char* buf,int max_size) { - if ( offset>=bufferSize) { - return 0; - } - int len = bufferSize-offset-1; - len = max_size>len?len:max_size; - memcpy(buf,cBuffer,len); - offset += len; - return len; -} -int yywrap() -{ - return 1; -} -BOOL CALLBACK EnumWndProc(HWND hWnd,LPARAM lParam) -{ - HWND* lhwnd=(HWND*)lParam; - char buf[50]; - GetClassName(hWnd,buf,50); - //VimTextArea is the class name of main editing window of VIM - if (strcmp(buf,"VimTextArea") == 0) - { - *lhwnd=hWnd; - return FALSE; - } - return TRUE; -} -void FindVimWindow() -{ - HWND hTempHwnd = GetForegroundWindow(); - if(hTempHwnd) - { - m_vimHwnd = hTempHwnd; - } - else - { - //but getting VIM window failed get the Desktop window. This is used to get the - //VIM rectangle. So even desktop window is also OK. - m_vimHwnd = GetDesktopWindow(); - } - - //Get the editing window in the VIM. - EnumChildWindows(m_vimHwnd,EnumWndProc,(LPARAM)&hwndText); - - //GetWindowRect(hwndText,vimRect); -} -void PaintText(HDC hdc) -{ -paintX=2; -paintY=2; -currentLine = 0; -offset= 0; -paramSkip=0; -yylex(); -} -BOOL RetriveTextSize(HDC hdc) -{ - SIZE size ; - - iLineCount = 0; - iMaxWidth = 0; - iMaxHeight = 0; - - char *p = cBuffer; - char *temp = cBuffer; - while ( *temp != '\0') { - if (*temp == '\n') { - iLineCount++; - GetTextExtentPoint(hdc,p,temp-p-1,&size); - { - iMaxWidth = size.cx > iMaxWidth ? size.cx:iMaxWidth; - iMaxHeight = size.cy > iMaxHeight ? size.cy:iMaxHeight; - } - p = temp+1; - } - ++temp; - } - if ( p < temp ) - { //δһ\n - iLineCount++; - GetTextExtentPoint(hdc,p,temp-p-1,&size); - { - iMaxWidth = size.cx > iMaxWidth ? size.cx:iMaxWidth; - iMaxHeight = size.cy > iMaxHeight ? size.cy:iMaxHeight; - } - } -} -int ReadInt(char *in,int l) -{ - char buffer[64]; - snprintf(buffer,l,"%s",in); - return atoi(buffer); -} -int AdjustPosEx(LPRECT rect, int w,int h) -{ - if ( left+w+10 > rect->right ) { - if ( left > w+10 ) { - left = left - w - 10; - } - else { - left = rect->right - w - 20; - } - } - if ( top + h + 10 > rect->bottom ) { - if ( top > h + 10 ) { - top = top - h - 20; - } - else { - top = rect->bottom - h - 20; - } - } -} -/** - * Caculate the left-top point of tips window. - * @param in "8;12;30;80;\n.." - * line;col; line total;colums total; - */ -int AdjustPos(LPRECT rect,char *in) -{ - int t,l,w,h; - char *p = in; - char *temp = in; - char buffer[128]; - - while ( *temp!=';') ++temp; - t = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - l = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - h = ReadInt(p,temp-p); - ++temp; - p = temp; - - while ( *temp!=';' ) ++temp; - w = ReadInt(p,temp-p); - ++temp; - ++temp; // skip a \n - - top = (rect->bottom-rect->top)*t/h + rect->top; - left = (rect->right-rect->left)*l/w + rect->left; - return temp - in; - - //snprintf(buffer,64,p, -} -//һϢ -//:ھϢϢϢ -LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - //ȤϢ - switch (message) - { - case WM_KEYDOWN: - switch (wParam) - { - stoped = TRUE; - DestroyWindow(hwnd); - return 0; - } - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN://Ϣ - { - stoped = TRUE; - DestroyWindow(hwnd); - return 0; - } - case WM_PAINT: - { - char hello[]="ãEasyWin !"; - char buff[128]; - //HDC hdc; - PAINTSTRUCT ps; - RECT rect; - HFONT font; - HGDIOBJ oldFont; - - - font = CreateFont(12, 0, 0, 0, FW_REGULAR, 0, 0, 0, 0, 0, 0, 0, 0, "MS Sans Serif"); - - hdc=BeginPaint( hwnd,&ps ); //ȡ豸 - - oldFont = SelectObject(hdc,font); - RetriveTextSize(hdc); - - GetWindowRect( GetDesktopWindow() , &rect); - AdjustPosEx(&rect,iMaxWidth+20,iMaxHeight * iLineCount + 20); - MoveWindow(hwnd,left,top, iMaxWidth+20,(iMaxHeight * iLineCount)+20,TRUE); - - - GetClientRect(hwnd,&rect); - InflateRect(&rect,-1,-1); - FillRect(hdc, &rect,CreateSolidBrush(RGB(0xff,0xff,0x99))); - //FillRect(hdc, &rect,CreateSolidBrush(RGB(0x00,0x00,0xff))); - - SelectObject(hdc,CreatePen(PS_SOLID,2,RGB(162,162,162))); - - SetBkMode(hdc,TRANSPARENT); - SetTextColor(hdc, RGB(0,0,0)); //ɫ - - oldFont = SelectObject(hdc,font); - PaintText(hdc); - - SelectObject(hdc,oldFont); - EndPaint( hwnd, &ps ); //ͷԴ - break; - } - case WM_CLOSE: - break; - case WM_DESTROY: - //PostQuitMessage(0); - //ûرմڣ٣˳Ϣ˳Ϣѭ - return 0 ; - } - return 0; - //Ϣϵͳṩȱʡ - return DefWindowProc(hwnd, message, wParam, lParam); -} - -_DL_EXPORT int tipsWnd(char *in) -{ - //1.עᴰ - static TCHAR szAppName[] = TEXT ("HelloWin") ; // - //""ṹ - - // - HWND hwnd ; - RECT rect; - - FindVimWindow(); - GetWindowRect(hwndText,&rect); - int offset = AdjustPos(&rect,in); - //top = rect.top; - //left = rect.left; - // - hwnd = CreateWindowEx( - WS_EX_DLGMODALFRAME|WS_EX_TOOLWINDOW,//|WS_EX_TOPMOST, - //szAppName, - "#32770", - TEXT("The Hello Program"), - WS_POPUP|WS_DLGFRAME|WS_OVERLAPPED, - 0, - 0, - 400, - 300, - m_vimHwnd, - NULL, - NULL, - NULL); - //sprintf(cBuffer,"%s","Hello \n world!\nǾڲ.--------------------\n^_^\n"); - snprintf(cBuffer,2048,"%s",in+offset); - bufferSize = strlen(cBuffer); - - SetWindowLongPtr(hwnd,DWL_DLGPROC,(LPARAM)WndProc); - - ShowWindow (hwnd, SW_SHOW) ; - UpdateWindow (hwnd) ; - - //Ϣѭ - MSG msg ; - while (!stoped ) { - if ( GetMessage(&msg,NULL,0,0)== 0 ) { - break; - } - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - /* - while (GetMessage (&msg, NULL, 0, 0)) //ϢȡϢ - { - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - */ - //UnregisterClass(szAppName,NULL); - return strlen(in); ; -} -#ifndef DLL -//Ӧó -//:ʵǰһʵľвʾʽ -int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, - PSTR szCmdLine, int iCmdShow) -{ - //1.עᴰ - static TCHAR szAppName[] = TEXT ("HelloWin") ; // - //""ṹ - /* - WNDCLASS wndclass ; - wndclass.style = CS_HREDRAW | CS_VREDRAW ; - wndclass.lpfnWndProc = WndProc ; //Ϣ - wndclass.cbClsExtra = 0 ; - wndclass.cbWndExtra = 0 ; - wndclass.hInstance = hInstance ; //ʵ - wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; //ͼ - wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; // - wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); //ˢ - wndclass.lpszMenuName = NULL ; - wndclass.lpszClassName = szAppName; // - //ע - if (!RegisterClass (&wndclass)) - { - MessageBox (NULL, TEXT ("RegisterClass Fail!"), - szAppName, MB_ICONERROR) ; - return 0 ; - } - */ - - // - HWND hwnd ; - hwnd = CreateWindowEx( - WS_EX_DLGMODALFRAME, - //WS_EX_APPWINDOW, - "#32770", - //szAppName, - TEXT("The Hello Program"), - //WS_OVERLAPPEDWINDOW, - WS_POPUP, - 0, - 0, - 400, - 300, - NULL, - NULL, - NULL, - NULL); - - top = 0; - left =0; - - sprintf(cBuffer,"%s","Hellow\nWorld\nǾڲ.\nParameters:\n"); -#ifndef DLL - snprintf(cBuffer,2048,"%s",testdata); -#endif - bufferSize = strlen(cBuffer); - SetWindowLongPtr(hwnd,DWL_DLGPROC,(LPARAM)WndProc); - - ShowWindow (hwnd, iCmdShow) ; - UpdateWindow (hwnd) ; - - //Ϣѭ - MSG msg ; - while (!stoped ) { - if ( GetMessage(&msg,NULL,0,0)== 0 ) { - break; - } - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - - /* - while (GetMessage (&msg, NULL, 0, 0) ) //ϢȡϢ - { - TranslateMessage (&msg) ; //תϢ - DispatchMessage (&msg) ; //ɷϢ - } - */ - return 0 ; -} -#endif - -// vim: ts=4:sw=4:sts=4 diff --git a/dot.vim/src/vjde/completion/ClassInfo.java b/dot.vim/src/vjde/completion/ClassInfo.java deleted file mode 100644 index 6da7582..0000000 --- a/dot.vim/src/vjde/completion/ClassInfo.java +++ /dev/null @@ -1,642 +0,0 @@ -/* - * ClassInfo.java - * Copyright (C) 2002, 2003 Rodrigo Reyes (reyes@chez.com), - * Javier Lopez (jslopez@forumsys.com), - * Paul Kinnucan (pkinnucan@attbi.com) - * - * $Revision: 1.1.1.1 $ - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -package vjde.completion; - -import java.io.*; -import java.lang.reflect.*; - -/** - * This class provides information about classes on jde-global-classpath. - * - * @author Rodrigo Reyes (reyes@chez.com), - * @author Javier Lopez (jslopez@forumsys.com) - * @author Paul Kinnucan (pkinnucan@attbi.com) - */ - -public class ClassInfo { - - /************************************************************************* - * Constants - *************************************************************************/ - public static final String NIL = "nil"; - public static final String NL = "\n"; - public static final String T = "t"; - public static final String LIST = "list"; - public static final String START_PAREN = "("; - public static final String END_PAREN = ")"; - public static final String DOUBLE_QUOTE = "\""; - public static final String SPACE = " "; - public static final String START_LIST; - - static { - StringBuffer sb = new StringBuffer (10); - sb.append(START_PAREN); - sb.append(LIST); - sb.append(SPACE); - START_LIST = sb.toString(); - } - - /** - * Access level for a class member - */ - public static final int PUBLIC = 0; - - /** - * Access level for a class member - */ - public static final int PROTECTED = 1; - - /** - * Access level for a class member - */ - public static final int PACKAGE = 2; - - /** - * Access level for a class member - */ - public static final int PRIVATE = 3; - - public static final int FIELD_INFO = 0; - public static final int CTOR_INFO = 1; - public static final int METHOD_INFO = 2; - public static final int INNER_CLASS_INFO = 3; - - - - /** - * Tests whether a class is an ancestor of another class. - * This method prints "t" to standard out if the class is an ancestor - * of the other class. If the class is not an ancestor or either class - * cannot be found, this method prints nil to standard out. - * @param ancestor Name of the ancestor class - * @param child Name of the supposed child class - */ - public static void isAncestorOf(String ancestor, String child) { - try { - Class classAncestor = Class.forName( ancestor ); - Class classChild = Class.forName( child ); - if( classAncestor.isAssignableFrom( classChild ) ) - System.out.println(T); - else - System.out.println(NIL); - } catch( Exception ex) { - System.out.println(NIL); - } - } - - /** - * Returns true if the entity is accessible to the specified level of - * protection. - * @param modifiers the modifiers as returned by Member.getModifiers() - * or Class.getModifiers() - * @param level the level of protection - * @return if the Member is accessible to the specified level of - * protection. - * @see Member.getModifiers() - * @see Class.getModifiers() - */ - private static boolean isAccessible(int modifiers, int level) { - switch(level) { - case PUBLIC: // member is accessible if it has public access - return Modifier.isPublic (modifiers); - case PROTECTED: // accessible if member is protected - return Modifier.isProtected (modifiers); - case PACKAGE: // accessible if member is not public, protected - // or private - return (!Modifier.isPublic (modifiers) && - !Modifier.isProtected(modifiers) && - !Modifier.isPrivate (modifiers)); - case PRIVATE: // accessible if member is private - return Modifier.isPrivate (modifiers); - default: - // cannot get here any more, since the access level is - // only used internally - throw new Error("Completion.isAccessible(int, int) " + - "called with incorrect access level parameter:" - + level); - }//switch - } - - private static String accessLevel(int modifiers) { - String level; - if (Modifier.isPublic(modifiers)) { - level = String.valueOf(PUBLIC); - } else if (Modifier.isProtected(modifiers)) { - level = String.valueOf(PROTECTED); - } else if (Modifier.isPrivate(modifiers)) { - level = String.valueOf(PRIVATE); - } else { - level = String.valueOf(PACKAGE); - } - - return level; - } - - private static StringBuffer listModifiers(int modifiers) { - StringBuffer sb = new StringBuffer (30); - - if (Modifier.isAbstract(modifiers)) { - sb.append("\"abstract\""); - sb.append(SPACE); - } - - if (Modifier.isFinal(modifiers)) { - sb.append("\"final\""); - sb.append(SPACE); - } - - if (Modifier.isInterface(modifiers)) { - sb.append("\"interface\""); - sb.append(SPACE); - } - - if (Modifier.isNative(modifiers)) { - sb.append("\"native\""); - sb.append(SPACE); - } - - if (Modifier.isPrivate(modifiers)) { - sb.append("\"private\""); - sb.append(SPACE); - } - - if (Modifier.isProtected(modifiers)) { - sb.append("\"protected\""); - sb.append(SPACE); - } - - if (Modifier.isPublic(modifiers)) { - sb.append("\"public\""); - sb.append(SPACE); - } - - if (Modifier.isStatic(modifiers)) { - sb.append("\"static\""); - sb.append(SPACE); - } - - if (Modifier.isStrict(modifiers)) { - sb.append("\"strict\""); - sb.append(SPACE); - } - - if (Modifier.isSynchronized(modifiers)) { - sb.append("\"synchronized\""); - sb.append(SPACE); - } - - if (Modifier.isTransient(modifiers)) { - sb.append("\"transient\""); - sb.append(SPACE); - } - - if (Modifier.isVolatile(modifiers)) { - sb.append("\"volotile\""); - sb.append(SPACE); - } - - if (sb.length() > 0) { - StringBuffer temp = new StringBuffer(sb.length() + 26); - temp.append("(cons 'typemodifiers (list "); - temp.append(sb); - temp.append("))"); - sb = temp; - } - - return sb; - - } - - private static StringBuffer listExceptions(Class[] classes) { - StringBuffer sb = new StringBuffer (30); - - sb.append("(cons 'throws (list "); - for (int i = 0; i < classes.length; i++) { - sb.append(printWithinQuotes(className(classes[i]))); - if ((i + 1) != classes.length) { - sb.append(SPACE); - } - } - sb.append("))"); - - return sb; - } - - - /** - * Creates a field info list. The list has the following form - * - * (0 name access-level type) - * - * where 0 indicates that this info list is for a field, name is - * the name of the field, access-level is one of - * PUBLIC, PROTECTED, PACKAGE, or PRIVATE, and type is - * the type of the field. - * - * @param field field name - */ - private static StringBuffer tokenizeField(Field field) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(printWithinQuotes(field.getName())); - sb.append(SPACE); - sb.append("'variable"); - sb.append(SPACE); - sb.append(printWithinQuotes(className(field.getType()))); - sb.append(SPACE); - sb.append(NIL); // default value - sb.append(SPACE); - - StringBuffer modifiers = listModifiers(field.getModifiers()); - if (modifiers.length() > 0) { - sb.append(START_LIST); - sb.append(modifiers); - sb.append(END_PAREN); - } else { - sb.append(NIL); - } - sb.append(SPACE); - - sb.append(NIL); // docstring - sb.append(END_PAREN); - - return sb; - } - - /** - * Prints (list "name" "params") to the system output. - * - * @param name constructor name - * @param params parameter type - */ - private static StringBuffer tokenizeCtor(Constructor ctor) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(printWithinQuotes(ctor.getName())); - sb.append(SPACE); - sb.append("'function "); - sb.append(listClasses(ctor.getParameterTypes())); - sb.append(SPACE); - - // extra specifiers - sb.append(START_LIST); - sb.append("'(constructor . t)"); - StringBuffer temp = listModifiers(ctor.getModifiers()); - if (temp.length() > 0) { - sb.append(SPACE); - sb.append(temp); - } - Class[] types = ctor.getExceptionTypes(); - if (types.length > 0) { - sb.append(SPACE); - sb.append(listExceptions(types)); - } - sb.append(END_PAREN); - sb.append(SPACE); - - sb.append(NIL); // no docstring - - sb.append(END_PAREN); - - return sb; - } - - /** - * Prints (list "name" "returnType" "args") to the system output. - * - * @param name method name - * @param returnType method return type - * @param args method arguments - */ - private static StringBuffer tokenizeMethod(Method method) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(printWithinQuotes(method.getName())); - sb.append(SPACE); - sb.append("'function "); - sb.append(SPACE); - sb.append(listClasses(method.getParameterTypes())); - sb.append(SPACE); - - // extra specifiers - StringBuffer temp = listModifiers(method.getModifiers()); - Class[] types = method.getExceptionTypes(); - - if (sb.length() > 0 || types.length > 0) { - sb.append("(list"); - - if (temp.length() > 0) { - sb.append(SPACE); - sb.append(temp); - } - - if (types.length > 0) { - sb.append(SPACE); - sb.append(listExceptions(types)); - } - - } - - sb.append(END_PAREN); - sb.append(SPACE); - - sb.append(NIL); // no docstring - - sb.append(END_PAREN); - - return sb; - } - - /** - * Get (list INNERCLASSINFO "className" access) - * - * @param name className - */ - private static StringBuffer innerClassInfo(Class ic) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(printWithinQuotes(ic.getName())); - sb.append(SPACE); - sb.append(String.valueOf(INNER_CLASS_INFO)); - sb.append(SPACE); - sb.append(accessLevel(ic.getModifiers())); - sb.append(END_PAREN); - return sb; - } - - - /** - * Prints item within quotes i.e "item" - * - * @param item string to be quoted. - */ - private static String printWithinQuotes(String item) { - StringBuffer sb = new StringBuffer (30); - sb.append(DOUBLE_QUOTE); - sb.append(item); - sb.append(DOUBLE_QUOTE); - - return sb.toString(); - } - - - - - private static void getInheritedInnerClasses(Class c, StringBuffer sb) { - //This is only used while initializing - if (c == null) { - return; - } - - - Class[] classes = c.getDeclaredClasses(); - - - for (int index = 0; index < classes.length ; index++) { - Class ic = classes[index]; - if (!Modifier.isPrivate(ic.getModifiers())) { - sb.append(innerClassInfo(ic)); - } - } - - getInheritedInnerClasses(c.getSuperclass(), sb); - - } - - private static void getInnerClasses(Class c, StringBuffer sb) { - - - // Get methods declared by c. - Class[] classes = c.getDeclaredClasses(); - - for (int index = 0; index < classes.length ; index++) { - sb.append(innerClassInfo(classes[index])); - } - - getInheritedInnerClasses(c.getSuperclass(), sb); - - } - - - private static void getMemberInfo(Class c, StringBuffer sb) { - sb.append(START_LIST); - - // Get fields declared by c. - Field[] fields = c.getDeclaredFields(); - - for (int index = 0; index < fields.length ; index++) { - sb.append(tokenizeField(fields[index])); - } - - // constructors - Constructor[] ctors = c.getDeclaredConstructors(); - - for (int index = 0; index < ctors.length; index++) { - sb.append(tokenizeCtor(ctors[index])); - } - - // Get methods declared by c. - Method[] methods = c.getDeclaredMethods(); - - for (int index = 0; index < methods.length ; index++) { - sb.append(tokenizeMethod(methods[index])); - } - - // inner classes, including inherited classes - getInnerClasses(c, sb); - - sb.append(END_PAREN); - sb.append(NL); - - return; - } - - /** - * Gets information on the specified class. Information is returned as a - * list of lists that is printed to System.out. - * - * @param className a String value - */ - public static void getClassInfo(String className,String path) { - try { - DynamicClassLoader dcl = new DynamicClassLoader(path); - Class c = dcl.loadClass(className); - if (c != null) { - StringBuffer sb = new StringBuffer (3000); - sb.append(START_LIST); - sb.append(printWithinQuotes(className)); - sb.append(SPACE); - sb.append("'type"); - sb.append(SPACE); - getMemberInfo(c, sb); - sb.append(END_PAREN); - sb.append(NL); - - Writer out - = new BufferedWriter(new OutputStreamWriter(System.out)); - try { - out.write(sb.toString()); - out.flush(); - } catch (IOException e) { - } - } - } catch (ClassNotFoundException e) { - System.out.println(NIL); - } catch (Exception e) { - System.out.println("(error \"Trying to load " + className + - " caused a Java exception: " + e + "\")"); - } catch (UnsatisfiedLinkError e) { - // This occurs with classes that have native methods whose native - // implementations cannot be found. - System.out.println("(error \"Trying to load " + className + - " caused a Java UnsatisfiedLinkError: " + e + "\")"); - } catch (LinkageError e) { - System.out.println("(error \"Trying to load " + className + - " caused a Java LinkageError: " + e + "\")"); - } - } - - - - /** - * Looks up an unqualified class name in the class path to find possible - * fully qualified matches. - * - * @param className a value of type 'String' - * @param imports an array of imported packages - */ - public static void getClassInfo(String className, - String[]imports,String path) { - String name; - Class c; - for (int i = 0 ; i < imports.length ; i++) { - name = imports[i] + className; - try { - c = Class.forName(name); - if (c != null) { - getClassInfo(name,path); - } - } catch (ClassNotFoundException cnfe) { } - - } - System.out.println(NIL); - } - - static String className(Class c) { - if (c.isArray()) - return c.getComponentType().getName() + "[]"; - else - return c.getName(); - } - - static StringBuffer listClasses(Class[] classes) { - StringBuffer sb = new StringBuffer (100); - if (classes.length > 0) { - - sb.append(START_LIST); - sb.append(SPACE); - for (int i = 0; i < classes.length; i++) { - sb.append(printWithinQuotes(className(classes[i]))); - if ((i + 1) != classes.length) { - sb.append(SPACE); - } - } - sb.append(END_PAREN); - } else { - sb.append(NIL); - } - - return sb; - } - - /** - * Tests whether a class has a member of a specified name. - * If so, prints t to standard out; if not, nil. - * - * @param className Name of class - * @param memberName Name of member - */ - public static void hasMember(String className, String memberName,String path) { - try { - DynamicClassLoader dcl = new DynamicClassLoader(path); - Class c = dcl.loadClass(className); - if (c != null) { - - Field fields[] = c.getFields(); - boolean hasField = false; - - for (int index = 0; index < fields.length ; index++) { - if (fields[index].getName().equals(memberName)) { - hasField = true; - break; - } - } - - Method methods[] = c.getMethods(); - boolean hasMethod = false; - - for (int index = 0; index < methods.length ; index++) { - if (methods[index].getName().equals(memberName)) { - hasMethod = true; - break; - } - } - - - StringBuffer sb = new StringBuffer (3000); - sb.append(START_LIST); - sb.append(hasField ? "t" : "nil"); - sb.append(hasMethod ? " t" : " nil"); - sb.append(END_PAREN); - sb.append(NL); - - Writer out - = new BufferedWriter(new OutputStreamWriter(System.out)); - try { - out.write(sb.toString()); - out.flush(); - } catch (IOException e) { - } - } - } catch (Exception cnfe) {System.out.println(NIL);} - } - - - public static void main (String[] args) { - getClassInfo("java.lang.Object",""); - } - -} // ClassInfo - -/* - * $Log: ClassInfo.java,v $ - * Revision 1.1.1.1 2005/06/10 03:00:10 administrator - * no message - * - * Revision 1.2 2005/03/28 02:45:29 administrator - * ޸˼ļ· - * - */ - -// End of ClassInfo.java diff --git a/dot.vim/src/vjde/completion/ClassPathDir.java b/dot.vim/src/vjde/completion/ClassPathDir.java deleted file mode 100644 index 623bac2..0000000 --- a/dot.vim/src/vjde/completion/ClassPathDir.java +++ /dev/null @@ -1,140 +0,0 @@ -package vjde.completion; - -import java.io.File; - -/** - * A ClassPathEntry that represents a directory in which classes are - * stored. This is scanned recursively for classes at load time. - * - * Copyright (C) 2001, 2002, 2003 Eric D. Friedman (eric@hfriedman.rdsl.lmi.net) - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Created: Tue Aug 14 19:46:52 2001 - * - * @author Eric D. Friedman - * @version $Id: ClassPathDir.java,v 1.1.1.1 2005/06/10 03:00:10 administrator Exp $ - */ - -class ClassPathDir extends ClassPathEntry { - private File directory; - - /** - * Create an instance of ClassPathDir representing - * directory - * - * @param directory a File value - * @return a ClassPathDir value - */ - ClassPathDir (File directory) { - super(); - this.directory = directory; - } - - /** - * Perform a recursive scan of the directory and set the loaded - * flag to true. - * - */ - void load() { - addRecursively(directory,directory); - setLoaded(true); - } - - /** - * Search for classes in directory rooted at - * rootDir - * - * @param directory a File value - * @param rootDir a File value - */ - void addRecursively(File directory, File rootDir) { - String [] files = directory.list(); - - if (files == null) { - System.err.println("Cannot read contents of " + directory + "."); - return; - } // end of if () - - String current; - String rootPath = rootDir.getPath(); - String currentPath = directory.getPath(); - String packageName = currentPath.substring(rootPath.length()); - StringBuffer buf = new StringBuffer(); - - if (packageName.length() > 0) { - // Not the current directory - packageName = packageName.replace('\\', '.'); - packageName = packageName.replace('/', '.'); - packageName = packageName.substring(1); - } - - for (int i = 0; i < files.length; i++) { - current = files[i]; - if (current.toLowerCase().endsWith(".class")) { - current = current.substring(0, current.length() - 6); - current = current.replace('$', '.'); // To handle inner-class .class files - if (currentPath.indexOf(rootPath) != 0) { - System.err.println("currentPath doesn't start with rootPath!\n" - + "rootPath: " + rootPath + "\n" - + "currentPath: " + currentPath + "\n"); - } else if (packageName.length() > 0) { - // not the default package - buf.append(packageName); - buf.append('.'); - buf.append(current); - addClass(buf.toString()); - buf.setLength(0); - } else { - // The default package - addClass(current); - } - } else { - // Check if it's a directory to recurse into - File currentFile = new File(directory, current); - if (currentFile.isDirectory()) { - addRecursively(currentFile,rootDir); - } - } - } - } - - /** - * return the directory as our string value. - * - * @return a String value - */ - public String toString() { - return directory.toString(); - } -}// ClassPathDir - -/* - * $Log: ClassPathDir.java,v $ - * Revision 1.1.1.1 2005/06/10 03:00:10 administrator - * no message - * - * Revision 1.1.1.1 2005/03/28 02:32:21 administrator - * - * vim java development envionment. - * - * Revision 1.4 2003/10/20 03:55:49 paulk - * Fix to handle inner classes. - * - * - * - */ - -// End of ClassPathDir.java diff --git a/dot.vim/src/vjde/completion/ClassPathEntry.java b/dot.vim/src/vjde/completion/ClassPathEntry.java deleted file mode 100644 index 91bf1a3..0000000 --- a/dot.vim/src/vjde/completion/ClassPathEntry.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (C) 2001 Eric D. Friedman (eric@hfriedman.rdsl.lmi.net) - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -package vjde.completion; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -/** - * An abstraction of ClassPath entries, which can concretely include - * directories, zipfiles, and jarfiles, some of which are immutable - * inasmuch as they are part of the JDK and are shared across projects - * by virtue of being part of the boot classpath. - * - *

    ClassPathEntries are Singleton/Flyweight implementations: they - * can appear in multiple projects, but there is only ever one - * instance.

    - * - * Created: Tue Aug 14 19:28:04 2001 - * - * @author Eric D. Friedman - * @version $Id: ClassPathEntry.java,v 1.1.1.1 2005/06/10 03:00:10 administrator Exp $ - */ - -abstract class ClassPathEntry { - /** a map of unqualified class names to qualified names */ - protected MultiValueMap nameToClassMap = new MultiValueMap(); - /** a flag indicating whether this instance has been loaded or not */ - protected boolean loaded = false; - private static Map entryMap = new HashMap(); - - ClassPathEntry () { - } - - /** - * Returns the singleton/flyweight instance for - * resource. The specific instance type returned is - * based on the extension of the file or on it being a directory. - * - * @param resource a File value - * @return a ClassPathEntry value - * @exception IOException if an error occurs - * @exception IllegalArgumentException if resource is not a - * zip/jar or a directory. - */ - static ClassPathEntry instanceForEntry(File resource) - throws IOException { - ClassPathEntry entry = null; - - if (entryMap.containsKey(resource)) { - entry = (ClassPathEntry)entryMap.get(resource); - } else { - if (resource.getName().toLowerCase().endsWith(".jar")) { - entry = new ClassPathZip(resource); - } else if (resource.getName().toLowerCase().endsWith(".zip")) { - entry = new ClassPathZip(resource); - } else if (resource.isDirectory()) { - entry = new ClassPathDir(resource); - } else { - entry = null; // shouldn't be in classpath - } // end of else - - if (null != entry) { - entryMap.put(resource,entry); - } - } - return entry; - } - - /** - * defines class loading behavior. - * - * @exception IOException if an error occurs - */ - abstract void load() throws IOException; - - /** - * clears the class list in the entry. - * - */ - void clear() { - nameToClassMap.clear(); - setLoaded(false); - } - - /** - * clears and reloads the class list in the entry. - * - * @exception IOException if an error occurs - */ - void reload() throws IOException { - clear(); - load(); - } - - /** - * adds an unqualified => qualified mapping. - * - * @param qualifiedName a String value - */ - protected void addClass(String qualifiedName) { - String unqualified; - - int lastDot = qualifiedName.lastIndexOf('.'); - int innerClass = qualifiedName.indexOf('$'); - if (innerClass < 0) { - unqualified = qualifiedName.substring(lastDot + 1); - } else { - unqualified = qualifiedName.substring(innerClass + 1); - } - nameToClassMap.put(unqualified, qualifiedName); - } - - /** - * Returns the list of qualified names that map to the specified - * unqualified name. Lazily loads the classes. - * - * @param unqualifiedName a String value - * @return a List value - * @exception IOException if an error occurs - */ - List getClassNames(String unqualifiedName) - throws IOException { - if (! isLoaded()) { - load(); - } // end of if (! isLoaded()) - - return nameToClassMap.getAsList(unqualifiedName); - } - - - /** - * Get the value of loaded. - * @return value of loaded. - */ - public boolean isLoaded() { - return loaded; - } - - /** - * Set the value of loaded. - * - * @param loaded a boolean value - */ - public void setLoaded(boolean loaded) { - this.loaded = loaded; - } -}// ClassPathEntry - -/* - * $Log: ClassPathEntry.java,v $ - * Revision 1.1.1.1 2005/06/10 03:00:10 administrator - * no message - * - * Revision 1.1.1.1 2005/03/28 02:32:21 administrator - * - * vim java development envionment. - * - * Revision 1.4 2002/09/06 12:57:55 jslopez - * Fixes addClass method to handle inner classes in a friendlier manner. - * The key for an inner class such as jde.util.A$B was A$B. - * Now the key for such a class is only B. - * - * Revision 1.3 2001/10/17 04:09:33 paulk - * Cosmetic changes to fit JDE coding style. - * - * - */ - -// End of ClassPathEntry.java diff --git a/dot.vim/src/vjde/completion/ClassPathZip.java b/dot.vim/src/vjde/completion/ClassPathZip.java deleted file mode 100644 index 841467f..0000000 --- a/dot.vim/src/vjde/completion/ClassPathZip.java +++ /dev/null @@ -1,94 +0,0 @@ -package vjde.completion; - -import java.util.*; -import java.util.zip.*; -import java.io.*; - -/** - * A ClassPathEntry representing a ZIP or JAR file. - * - * Copyright (C) 2001, 2002 Eric D. Friedman (eric@hfriedman.rdsl.lmi.net) - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Created: Tuesday Aug 14 19:46:52 2001 - * - * @author Eric D. Friedman - * @version $Id: ClassPathZip.java,v 1.1.1.1 2005/06/10 03:00:10 administrator Exp $ - */ - -class ClassPathZip extends ClassPathEntry { - private File zipOrJar; - - /** - * Creates a ClassPathZip instance representing zipOrJar - * - * @param zipOrJar a File value - * @return a ClassPathZip value - * @exception IOException if an error occurs - */ - ClassPathZip (File zipOrJar) { - super(); - this.zipOrJar = zipOrJar; - } - - /** - * Load all of the classes in the zip/jar and set the loaded flag - * to true. - * - * @exception IOException if an error occurs - */ - void load() throws IOException { - ZipFile zipFile = new ZipFile(zipOrJar); - Enumeration enum2 = zipFile.entries(); - while (enum2.hasMoreElements()) { - ZipEntry zipEntry = (ZipEntry)enum2.nextElement(); - String current = zipEntry.getName(); - if (current.toLowerCase().endsWith(".class")) { - current = current.substring(0, current.length() - 6); - current = current.replace('/', '.'); - current = current.replace('\\', '.'); - current = current.replace('$', '.'); - super.addClass(current); - } - } - setLoaded(true); - } - - /** - * Return the zip/jar name as our string. - * - * @return a String value - */ - public String toString() { - return zipOrJar.toString(); - } -}// ClassPathZip - -/* - * $Log: ClassPathZip.java,v $ - * Revision 1.1.1.1 2005/06/10 03:00:10 administrator - * no message - * - * Revision 1.1.1.1 2005/03/28 02:32:21 administrator - * - * vim java development envionment. - * - * Revision 1.2 2002/11/30 04:36:06 paulk - * load() method now replaces a $ with a period (.) in class names. Thanks to Petter Mahlen. - * - */ - -// End of ClassPathZip.java diff --git a/dot.vim/src/vjde/completion/ClassesByName.java b/dot.vim/src/vjde/completion/ClassesByName.java deleted file mode 100644 index 52ab897..0000000 --- a/dot.vim/src/vjde/completion/ClassesByName.java +++ /dev/null @@ -1,44 +0,0 @@ -package vjde.completion; - -import java.util.Vector; -import java.util.Iterator; -//import java.io.BufferedReader; -import java.io.FileReader; -import java.io.BufferedReader; - -public class ClassesByName { - public static void main(String[] args) { - if ( args.length < 2 ) { - // [libpath] - return ; - } - Vector buffer =new Vector(); - - - // grep jdk1.5lst - /* - try { - BufferedReader in = new BufferedReader(new FileReader(args[1])); - String str = null; - String fullname="."+args[0]; - while ((str=in.readLine())!=null) { - if ( str.endsWith(fullname) ) { - buffer.add(str); - } - } - } - catch(Exception ex) { - //TODO: Add Exception handler here - } - for ( Iterator it = buffer.iterator() ; it.hasNext(); ) { - System.out.println(it.next()); - } - */ - if ( args.length < 3) - return ; - String[] names = new DynamicClassLoader(args[2]).getClass4Name(args[0]); - for ( int i=0 ; i< names.length ; i++ ) { - System.out.println(names[i].substring(0,names[i].length()-6)); - } - } -} diff --git a/dot.vim/src/vjde/completion/Completion.java b/dot.vim/src/vjde/completion/Completion.java deleted file mode 100644 index b6b5498..0000000 --- a/dot.vim/src/vjde/completion/Completion.java +++ /dev/null @@ -1,943 +0,0 @@ -/* - * - * Completion.java - * Copyright (C) 1999, 2001, 2002, 2003 Rodrigo Reyes (reyes@chez.com) - * - * $Revision: 1.1.1.1 $ - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -package vjde.completion; - -import java.lang.reflect.Modifier; -import java.lang.reflect.Field; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.io.Writer; -import java.io.BufferedWriter; -import java.io.OutputStreamWriter; -import java.io.IOException; -import java.util.Iterator; - -/** - * This class provides completion facilities. - * - * @author Rodrigo Reyes (reyes@chez.com) - */ - -public class Completion { - /************************************************************************* - * Constants - *************************************************************************/ - public static final String NIL = "[]"; - public static final String NL = "\n"; - public static final String T = "t"; - public static final String LIST = ""; - public static final String START_PAREN = "["; - public static final String END_PAREN = "]"; - public static final String DOUBLE_QUOTE = "\""; - public static final String SPACE = " "; - public static final String COMMA = ","; - public static final String START_LIST; - static { - StringBuffer sb = new StringBuffer (10); - sb.append(START_PAREN); - sb.append(LIST); - //sb.append(SPACE); - START_LIST = sb.toString(); - } - - /** - * Access level for a class member - */ - public static final int PUBLIC = 0; - - /** - * Access level for a class member - */ - public static final int PROTECTED = 1; - - /** - * Access level for a class member - */ - public static final int DEFAULT = 2; - - /** - * Access level for a class member - */ - public static final int PRIVATE = 3; - - /** - * Tests whether a class is an ancestor of another class. - * This method prints "t" to standard out if the class is an ancestor - * of the other class. If the class is not an ancestor or either class - * cannot be found, this method prints nil to standard out. - * @param ancestor Name of the ancestor class - * @param child Name of the supposed child class - */ - public static void isAncestorOf(String ancestor, String child) { - try { - Class classAncestor = Class.forName(ancestor); - Class classChild = Class.forName(child); - if (classAncestor.isAssignableFrom(classChild)) { - System.out.println(T); - } else { - System.out.println(NIL); - } - } catch (Exception ex) { - System.out.println(NIL); - } - } - - /** - * Returns true if the entity is accessible to the specified level of - * protection. - * @param modifiers the modifiers as returned by Member.getModifiers() - * or Class.getModifiers() - * @param level the level of protection - * @return if the Member is accessible to the specified level of - * protection. - * @see Member.getModifiers() - * @see Class.getModifiers() - */ - private static boolean isAccessible(int modifiers, int level) { - switch(level) { - case PUBLIC: // member is accessible if it has public access - return Modifier.isPublic (modifiers); - case PROTECTED: // accessible if member is protected - return Modifier.isProtected (modifiers) || Modifier.isPublic(modifiers); - case DEFAULT: // accessible if member is not public, protected - // or private - /* - return (!Modifier.isPublic (modifiers) - && !Modifier.isProtected(modifiers) - && !Modifier.isPrivate (modifiers)); - */ - return !Modifier.isPrivate(modifiers); - case PRIVATE: // accessible if member is private - return Modifier.isPrivate (modifiers); - default: - return !Modifier.isPrivate(modifiers); - // cannot get here any more, since the access level is - // only used internally - /* - throw new Error("Completion.isAccessible(int, int) " - + "called with incorrect access level parameter:" - + level); - */ - }//switch - } - - /** - * Prints (list "name" "type") to the system output. - * - * @param name field name - * @param type field type - */ - private static String printField(String name, String type) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(printWithinQuotes(name)); - sb.append(COMMA); - sb.append(printWithinQuotes(type)); - sb.append(END_PAREN); - sb.append(NL); - - return sb.toString(); - } - private static String printField(String leader,String name, String type) { - StringBuffer sb = new StringBuffer (30); - sb.append(leader); - sb.append(START_LIST); - sb.append(printWithinQuotes(name)); - sb.append(COMMA); - sb.append(printWithinQuotes(type)); - sb.append(END_PAREN); - - return sb.toString(); - } - - /** - * Prints (list "name" "params") to the system output. - * - * @param name constructor name - * @param params parameter type - */ - private static String printConstructor(String name, Class[] params) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(printWithinQuotes(name)); - if ( params.length >0 ) { - sb.append(COMMA); - sb.append(listClassArray(params)); - } - - return sb.toString(); - } - - /** - * Prints (list "name" "returnType" "args") to the system output. - * - * @param name method name - * @param returnType method return type - * @param args method arguments - */ - private static String printMethod(String name, - String returnType, - Class[] args) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(printWithinQuotes(name)); - sb.append(COMMA); - sb.append(printWithinQuotes(returnType)); - if ( args.length>0) - { - sb.append(COMMA); - sb.append(listClassArray(args)); - } - - return sb.toString(); - } - - /** - * Prints (list "className") to the system output. - * - * @param name className - */ - private static String printClass(String name) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(printWithinQuotes(name)); - sb.append(END_PAREN); - return sb.toString(); - } - - /** - * printExceptions - * - * @param exceptions a Class[] - * @return a String - */ - private static String printExceptions(Class[] exceptions) { - StringBuffer sb = new StringBuffer (30); - sb.append(START_LIST); - sb.append(listClassArray(exceptions)); - sb.append(END_PAREN); - return sb.toString(); - } - - /** - * Prints item within quotes i.e "item" - * - * @param item string to be quoted. - */ - private static String printWithinQuotes(String item) { - StringBuffer sb = new StringBuffer (30); - sb.append(DOUBLE_QUOTE); - sb.append(item); - sb.append(DOUBLE_QUOTE); - - return sb.toString(); - } - - /** - * Recursively finds fields of the specified access level in the - * supplied class and superclasses. - * - * @param c the class to start the search in - nothing is done if - * this is NULL - * @param level the access level to look for - * @param sb the StringBuffer where the results should be added - */ - private static void recursiveListFields(Class c, - int level, - StringBuffer sb) { - //This is only used while initializing - if (c == null) { - return; - } - - Field[] fields; - Field field; - String f; - - // ----- Added by Petter for interfaces - if (level == PUBLIC) { - // For public access, we can use getFields() and skip - // recursion. This ensures that the method works for - // interface types, and saves some function calls. - fields = c.getFields(); - } else { - fields = c.getDeclaredFields(); - } - // ----- End addition by Petter - - String leader=SPACE; - boolean first = true; - for (int index = 0; index < fields.length ; index++) { - field = fields[index]; - if (isAccessible(field.getModifiers(), level)) { - if ( !first ) { - leader=COMMA; - } - else - first = false; - - - f = printField(field.getName(), - className(field.getType())); - - - if (sb.toString().lastIndexOf(f) == -1) { - sb.append(leader); - sb.append(f); - } - } - } - - // ----- Addition by Petter to reduce the number of function - // calls and not list non-accessible private fields. - if (!c.isInterface() - && level != PRIVATE - && level != PUBLIC) { - // For interfaces, the getSuperClass() method will return - // nil, and in any case, the only type of access relevant - // for interfaces is PUBLIC. For PUBLIC access, the - // getFields() call has listed all the relevant fields. - // For PRIVATE access, that is only applicable in the - // calling class anyway, so we shouldn't do recursion. - recursiveListFields(c.getSuperclass(), level, sb); - } - // ----- End addition by Petter - } - - /** - * Finds constructors of the specified access level in the supplied class. - * - * @param c the class to search in - * @param level the access level to look for - * @param sb the StringBuffer where the results should be added - */ - private static void listConstructors(Class c, - int level, - StringBuffer sb) { - Constructor[] constrs = c.getDeclaredConstructors(); - Constructor constructor; - Class[] exceptions; - StringBuffer cons; - - String leader = SPACE; - boolean first = true; - for (int index = 0; index < constrs.length; index++) { - constructor = constrs[index]; - if (isAccessible(constructor.getModifiers(), level)) { - cons = new StringBuffer(100); - if ( !first) { - leader = COMMA; - } - else - first = false; - cons.append(printConstructor(constructor.getName(), - constructor.getParameterTypes())); - // Add exceptions - exceptions = constructor.getExceptionTypes(); - - cons.append(COMMA); - if (exceptions.length > 0) { - cons.append(printExceptions(exceptions)); - } else { - cons.append(NIL); - } - cons.append(END_PAREN); - cons.append(NL); - if (sb.toString().lastIndexOf(cons.toString()) == -1) { - sb.append(leader); - sb.append(cons); - } - } - } - } - - /** - * Recursively finds methods of the specified access level in the - * supplied class and superclasses. - * - * @param c the class to start the search in - nothing is done if this is - * NULL - * @param level the access level to look for - * @param sb the StringBuffer where the results should be added - */ - private static void recursiveListMethods(Class c, - int level, - StringBuffer sb) { - //This is only used while initializing - if (c == null) { - return; - } - - Method[] methods; - Method method; - Class[] exceptions; - StringBuffer temp; - - // ----- Added by Petter for interfaces - if (level == PUBLIC) { - // For public access, we can use getMethods() and skip - // recursion. This ensures that the method works for - // interface types, and saves some function calls. - methods = c.getMethods(); - } else { - methods = c.getDeclaredMethods(); - } - // ----- End addition by Petter - - String leader = SPACE; - boolean first = true; - for (int index = 0; index < methods.length ; index++) { - method = methods[index]; - if (isAccessible(method.getModifiers(), level)) { - if ( !first) { - leader=COMMA; - } - else - first = false; - temp = new StringBuffer(100); - temp.append(printMethod(method.getName(), - className(method.getReturnType()), - method.getParameterTypes())); - // Add exceptions - exceptions = method.getExceptionTypes(); - - temp.append(COMMA); - if (exceptions.length > 0) { - temp.append(printExceptions(exceptions)); - } else { - temp.append(NIL); - } - temp.append(COMMA); - temp.append(method.getModifiers()); - - temp.append(END_PAREN); - temp.append(SPACE); - temp.append(NL); - - if (sb.toString().lastIndexOf(temp.toString()) == -1) { - sb.append(leader); - sb.append(temp); - } - } - } - - - // ----- Addition by Petter to reduce the number of function - // calls and not list non-accessible private fields. - if (!c.isInterface() - && level != PRIVATE - && level != PUBLIC) { - // For interfaces, the getSuperClass() method will return - // nil, and in any case, the only type of access relevant - // for interfaces is PUBLIC. For PUBLIC access, the - // getMethods() call has listed all the relevant members. - // For PRIVATE access, that is only applicable in the - // calling class anyway, so we shouldn't do recursion. - recursiveListMethods(c.getSuperclass(), level, sb); - } - // ----- End addition by Petter - } - - /** - * Recursively finds inner classes of the specified access level - * in the supplied class and superclasses. - * - * @param c the class to start the search in - nothing is done if this is - * NULL - * @param level the access level to look for - * @param sb the StringBuffer where the results should be added - */ - private static void recursiveListInnerClasses(Class c, - int level, - StringBuffer sb) { - if (c == null) { - return; - } - - - Class[] innerClasses; - Class innerClass; - String clas; - - // ----- Added by Petter for interfaces - if (level == PUBLIC) { - // For public access, we can use getClasses() and skip - // recursion. This ensures that the method works for - // interface types, and saves some function calls. XXX - - // actually, this doesn't work properly, since classes - // defined in interfaces don't show up here. - innerClasses = c.getClasses(); - } - else { - innerClasses = c.getDeclaredClasses(); - } - // ----- End addition by Petter - String leader = SPACE; - boolean first = true; - for (int index = 0; index < innerClasses.length ; index++) { - innerClass = innerClasses[index]; - if (isAccessible(innerClass.getModifiers(), level)) { - clas = printClass(innerClass.getName()); - if (sb.toString().lastIndexOf(clas) == -1) { - if ( !first) { - leader = COMMA; - } - else - first = false; - sb.append(leader); - sb.append(clas); - sb.append(NL); - } - } - } - - // ----- Addition by Petter to reduce the number of function - // calls and not list non-accessible private fields. - if (!c.isInterface() && - level != PRIVATE && - level != PUBLIC) { - // For interfaces, the getSuperClass() method will return - // nil, and in any case, the only type of access relevant - // for interfaces is PUBLIC. For PUBLIC access, the - // getClasses() call has listed all the relevant members. - // For PRIVATE access, that is only applicable in the - // calling class anyway, so we shouldn't do recursion. - recursiveListInnerClasses(c.getSuperclass(), level, sb); - } - // ----- End addition by Petter - } - - private static void listClassInfo(Class c, int level, StringBuffer sb) { - sb.append(START_LIST); - sb.append(NL); - sb.append(printWithinQuotes(className(c))); - sb.append(COMMA); - sb.append(NL); - - //we add the protected/private fields depending on the access level - sb.append(START_LIST); - sb.append(NL); - recursiveListFields(c, level, sb); - //sb.append(NL); - sb.append(END_PAREN); - sb.append(COMMA); - sb.append(NL); - - // constructors - sb.append(START_LIST); - sb.append(NL); - listConstructors(c, level, sb); - //sb.append(NL); - sb.append(END_PAREN); - sb.append(COMMA); - sb.append(NL); - - // methods, added recursively - sb.append(START_LIST); - sb.append(NL); - recursiveListMethods(c, level, sb); - //sb.append(NL); - sb.append(END_PAREN); - sb.append(COMMA); - sb.append(NL); - - // inner classes, added recursively - sb.append(START_LIST); - sb.append(NL); - recursiveListInnerClasses(c, level, sb); - //sb.append(NL); - sb.append(END_PAREN); - sb.append(COMMA); - sb.append(NL); - - sb.append(c.getModifiers()); - - sb.append(NL); - sb.append(END_PAREN); - - return; - } - /** - * Gets information on the specified class. Information is returned as a - * list of lists that is printed to System.out. - * - * @param className a String value - */ - public static void getClassInfo(String path,String className) { - getClassInfo(path,className, PUBLIC); - } - - /** - * Gets information on the specified class. Information is returned as a - * list of lists that is printed to System.out. - * - * @param className a String value - * @param level access level i.e. public, protected, default, and private - */ - public static void getClassInfo(String path,String className, int level) { - try { - DynamicClassLoader dcl = new DynamicClassLoader(path); - Class c = dcl.loadClass(className); - if (c != null) { - StringBuffer sb = new StringBuffer (3000); - //sb.append(START_LIST); - //sb.append(NL); - listClassInfo(c, level, sb); - //sb.append(END_PAREN); - //sb.append(NL); - - Writer out - = new BufferedWriter(new OutputStreamWriter(System.out)); - try { - out.write(sb.toString()); - out.flush(); - } catch (IOException e) { - } - } - } catch (ClassNotFoundException e) { - System.out.println(NIL); - } catch (Exception e) { - System.out.println("(error \"Trying to load " + className + - " caused a Java exception: " + e + "\")"); - } catch (NoClassDefFoundError e) { - System.out.println(NIL); - } catch (UnsatisfiedLinkError e) { - // This occurs with classes that have native methods whose native - // implementations cannot be found. - System.out.println("(error \"Trying to load " + className + - " caused a Java UnsatisfiedLinkError: " + e + "\")"); - } catch (LinkageError e) { - System.out.println("(error \"Trying to load " + className + - " caused a Java LinkageError: " + e + "\")"); - } - } - - public static void getClassInfo(String path,String[] names,String[] imports) { - getClassInfo(path,names,imports,PUBLIC); - } - public static void getClassInfo(String path,String[] names,String[] imports,int level) { - DynamicClassLoader dcl = new DynamicClassLoader(path); - Class c= getClass(dcl,path,names[0].trim(),imports); - if ( c == null ) { - return; - } - int i = 1; - while ( i < names.length && c != null ) { - String name = names[i]; - String type = null; - Field[] fields= c.getDeclaredFields(); - for ( int j = 0 ; j < fields.length ; j++) { - if ( isAccessible(fields[j].getModifiers(),level) && - fields[j].getName().compareTo(name)==0 - ) { - //type = fields[j].getType().getName(); - type = componentName(fields[j].getType()); - break; - } - } - if ( type == null ) { - Method[] methods = c.getDeclaredMethods(); - for ( int j = 0 ; j < methods.length; j++ ) { - //System.err.println(className(methods[j].getReturnType())); - if ( isAccessible(methods[j].getModifiers(),level) && - methods[j].getName().compareTo(name)==0) { - type = componentName(methods[j].getReturnType()); - break; - } - } - } - if ( type != null ) { - c = getClass(dcl,path,type,new String[]{""}); - } - else { - c = null; - } - i ++; - } - // - if ( c!= null ) { - StringBuffer sb = new StringBuffer (3000); - //System.out.println(c.getName()); - //System.out.println(imports[imports.length-1]); - if (imports.length>1 && c.getName().startsWith(imports[imports.length-1])) { - if ( c.getName().substring(imports[imports.length-1].length()).indexOf('.')<0) - level = DEFAULT; - } - listClassInfo(c, level, sb); - Writer out - = new BufferedWriter(new OutputStreamWriter(System.out)); - try { - out.write(sb.toString()); - out.flush(); - } catch (IOException e) { - } - } - } - private static Class getClass(DynamicClassLoader dcl,String path,String name,String[] imports) { - Class c = null; - for (int i = 0 ; i < imports.length ; i++) { - try { - c = dcl.loadClass(imports[i].trim() + name); - } - catch(Exception e) { - continue; - //return null ; - } - if (c != null) { - return c; - } - } - return c; - } - public static void getClassInfo(String path,String className, - String[] imports) { - getClassInfo(path,className,imports,PUBLIC); - } - /** - * Looks up an unqualified class name in the class path to find possible - * fully qualified matches. - * - * @param className a value of type 'String' - * @param imports an array of imported packages - */ - public static void getClassInfo(String path,String className, - String[] imports,int level) { - String name; - Class c; - DynamicClassLoader dcl = new DynamicClassLoader(path); - for (int i = 0 ; i < imports.length ; i++) { - name = imports[i].trim() + className.trim(); - try { - c = dcl.loadClass(name); - //System.out.println(name); - // c = Class.forName(name); - if (c != null) { - //getClassInfo(path,name); - StringBuffer sb = new StringBuffer (3000); - listClassInfo(c, level, sb); - - Writer out - = new BufferedWriter(new OutputStreamWriter(System.out)); - try { - out.write(sb.toString()); - out.flush(); - } catch (IOException e) { - } - - return; - } - } catch (ClassNotFoundException e) { - // try to find className in another package. - } catch (Exception e) { - System.out.println("(error \"Trying to load " + name + - " caused a Java exception: " + e + "\")"); - } catch (NoClassDefFoundError e) { - //System.out.println(NIL); - } catch (UnsatisfiedLinkError e) { - // This occurs with classes that have native methods whose native - // implementations cannot be found. - System.out.println("(error \"Trying to load " + name + - " caused a Java UnsatisfiedLinkError: " + e + "\")"); - } catch (LinkageError e) { - System.out.println("(error \"Trying to load " + name + - " caused a Java LinkageError: " + e + "\")"); - } - } - System.out.println(NIL); - } - - static String className(Class c) { - if (c.isArray()) - return c.getComponentType().getName() + "[]"; - else - return c.getName(); - } - static String componentName(Class c) { - if (c.isArray()) - return c.getComponentType().getName() ; - else - return c.getName(); - } - - static String listClassArray(Class[] classes) { - StringBuffer sb = new StringBuffer (100); - for (int i = 0; i < classes.length; i++) { - sb.append(printWithinQuotes(className(classes[i]))); - if ((i + 1) != classes.length) { - sb.append(COMMA); - } - } - return sb.toString(); - } - public static void main (String[] args) { - if ( args.length < 2 ) { - System.out.println(" [ imports ....]"); - return; - } - int level = 0; - if ( args.length >= 3 ) { - level = Integer.parseInt(args[2]); - } - if ( args[1].indexOf("|",0)>0 ) { - if ( args.length >=4 ) { - String[] as = new String[args.length-2]; - as[0]=""; - System.arraycopy(args,3,as,1,args.length-3); - getClassInfo(args[0],args[1].split("\\|"),as,level); - return ; - } - else { - getClassInfo(args[0],args[1].split("\\|"),new String[]{""},level); - } - } - if ( args.length >= 4 ) { - - String[] as = new String[args.length-2]; - as[0]=""; - System.arraycopy(args,3,as,1,args.length-3); - getClassInfo(args[0],args[1],as,level); - } - else { - getClassInfo(args[0],args[1],level); - } - //getClassInfo("java.lang.String", 0); - //getClassInfo("java.awt.geom.Arc2D", 0); - //getClassInfo("java.lang.System", 0); - //getClassInfo("java.lang.Object", 2); - //getClassInfo("java.lang.Object", 3); - } - -} // Completion - -/* - * $Log: Completion.java,v $ - * Revision 1.1.1.1 2005/06/10 03:00:10 administrator - * no message - * - * Revision 1.5 2005/04/25 01:38:56 administrator - * - * update - * - * Revision 1.4 2005/04/04 00:48:06 administrator - * - * add many things . - * - * Revision 1.3 2005/03/29 10:10:52 administrator - * ok - * - * Revision 1.2 2005/03/29 01:07:17 administrator - * - * Support for extends , implements. - * - * Revision 1.1.1.1 2005/03/28 02:32:21 administrator - * - * vim java development envionment. - * - * Revision 1.23 2003/07/25 04:40:54 paulk - * Return NIL for NoClassDefFoundError. - * - * Revision 1.22 2003/07/25 04:26:09 paulk - * Revert to outputting nil for class not found exception. - * - * Revision 1.21 2003/07/25 04:10:18 paulk - * Trigger a Lisp error if trying to load a class causes a Java error or - * exception. - * - * Revision 1.20 2002/02/21 12:23:57 jslopez - * Rollback to create a new instance of the - * DynamicClassLoader all the time. - * - * Revision 1.19 2002/02/21 02:59:09 jslopez - * Updates the classInfoClass to reuse a single instance of the - * DynamicClassLoader. - * - * Revision 1.18 2002/02/20 12:34:39 jslopez - * Updates getClassInfo to catch Exception. - * - * Revision 1.17 2002/01/31 02:52:17 jslopez - * changes: - * - use getFields(), etc., for all public access: saves recursion, and ensures - * that we get the members from the interfaces, without needing to go through - * each of them. - * - do not do recursion for PUBLIC/PRIVATE access, or for interfaces. Saves - * function calls, and fixes a bug that meant listing non-accessible private - * members. - * - * Revision 1.16 2001/11/18 02:40:01 jslopez - * Cleaned up imports. - * - * Revision 1.15 2001/10/03 05:53:42 paulk - * Replaces calls to sb.lastIndexof(...) where sb is a StringBuffer that does - * not define the method lastIndexOf with calls to sb.toString().lastIndexOf(...). - * - * Revision 1.14 2001/09/28 13:35:05 jslopez - * Now getClassInfo retreives protected, and default package info - * for super classes. Thanks to Petter Mhln [petter.mahlen@chello.se] - * - * Revision 1.13 2001/09/09 14:30:07 jslopez - * Removed inecessary isPublic called in several places inside listClassInfo. - * Added more Inner class info to the listClassInfo method. - * - * Revision 1.12 2001/09/06 14:52:19 jslopez - * Removing debugging comment from the completion. - * - * Revision 1.11 2001/09/02 03:37:04 jslopez - * Moved all hardcoded strings to static final variables. - * Joined the two listClassInfo methods. - * Substituted all the System.out.print for the use of a StringBuffer. The result - * is print out at the end of the listClassInfo method. - * - * Revision 1.10 2001/08/14 05:15:02 paulk - * Miscellaneous updates. - * - * Revision 1.9 2001/07/21 03:56:23 paulk - * Addional inner class support. Thanks to Javier Lopez. - * - * Revision 1.8 2001/07/21 03:42:24 paulk - * Now includes inner classes in the class info list. Thanks to Javier Lopez. - * - * Revision 1.7 2001/07/06 02:00:09 paulk - * Makefile - * - * Revision 1.6 2001/06/27 03:09:04 paulk - * The isAccessible method now returns true for both private and protected methods - * when the access modifier is private. Thanks to "Javier Lopez" . - * - * Revision 1.5 2000/08/10 08:46:25 paulk - * Now outputs nil if class info not found. - * - * Revision 1.4 2000/08/01 07:44:49 paulk - * Adds an isAncestorOf method. Now gets private and protected methods and fields. Thanks to Stephan Nicolas. - * - * Revision 1.3 2000/07/27 04:49:52 paulk - * Now returns the type as well as name of each public field of a class. Thanks to Stephane Nicolas . - * - * Revision 1.2 2000/02/09 04:48:41 paulk - * Now uses Modifier.isPublic() to test whether a class's fields, - * methods, and constructors are public and hence candidates for - * completion. Now gets all fields and methods, not just those declared - * by the class. - * - */ - -// End of Completion.java diff --git a/dot.vim/src/vjde/completion/Document.java b/dot.vim/src/vjde/completion/Document.java deleted file mode 100644 index 4727ef0..0000000 --- a/dot.vim/src/vjde/completion/Document.java +++ /dev/null @@ -1,175 +0,0 @@ - - -/* - * Document.java 1.00 Wed Aug 24 15:02:50 й׼ʱ 2005 - * - * ȨϢ - */ - -package vjde.completion; -import java.util.StringTokenizer; -import java.io.File; -import java.io.FileReader; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.regex.Pattern; -import java.util.HashMap; -import java.util.regex.Matcher; - -public class Document { - String paths; - String className; - String member; - String src; - static HashMap tagMaps= new HashMap(); - static { - tagMaps.put("A",""); - tagMaps.put("/A",""); - tagMaps.put("B",""); - tagMaps.put("/B",""); - tagMaps.put("H3",""); - tagMaps.put("/H3",""); - tagMaps.put("CODE",""); - tagMaps.put("/CODE",""); - tagMaps.put("DD","\n"); - } - public Document(String ps,String src,String cname,String m) { - paths = ps; - int index = cname.indexOf(":",0); - if ( index > 0 ) { - className = cname.substring(0,index); - } - else { - className = cname; - } - member = m; - index = member.indexOf(";",0); - if ( index > 0 ) { - member = member.substring(0,index); - } - this.src = src; - } - public String read() throws Exception { - String fn = className.replace('.','/'); - File srcFile = new File(src+"/"+fn+".java"); - if ( srcFile.exists()) { - return readSource(srcFile); - } - StringTokenizer stks = new StringTokenizer(paths,File.pathSeparator); - while ( stks.hasMoreTokens()) { - String str = stks.nextToken(); - if (!str.endsWith("/") ) { - str = str+"/"; - } - File file = new File( str+fn+".html" ); - if ( file.exists()) { - return readFile(file); - } - } - return ""; - } - private String readSource(File f ) throws Exception { - String mem = member; - int index = member.indexOf("(",0); - if ( index > 0 ) { - mem = member.substring(0,index); - } - else { - index = member.indexOf(";",0); - if (index > 0 ) - mem = member.substring(0,index); - } - index = className.lastIndexOf("."); - String cn = className; - if ( index > 0 ) { - cn = className.substring(index+1); - } - SourceDocReader reader = new SourceDocReader(f.getAbsolutePath()); - return reader.getMemberDoc(cn,mem); - } - private String readFile(File f) throws IOException { - StringBuffer buffer = new StringBuffer(); - boolean find = false; - BufferedReader reader = new BufferedReader(new FileReader(f)); - String line ; - //Pattern pattern = Pattern.compile("(<([^ ]+) ?[^>]*>)"); - Pattern pattern = Pattern.compile("<([^ >]+)[^>]*>"); - //Pattern pattern = Pattern.compile("<[^>]*>"); - Pattern pattern2 = Pattern.compile(" "); - Pattern spacePattern = Pattern.compile("^\\s*$"); - while ( ( line = reader.readLine())!= null) { - if ((!find) && line.indexOf("",0)!=0) { - continue; - } - if ( line.indexOf("
    ",0)==0 ) { - break; - } - if ( find && line.indexOf("
    1) { - if (!spacePattern.matcher(temp).find()) { - buffer.append(temp); - if ( temp.compareTo("\n")!=0) { - buffer.append("\n"); - } - } - //String temp = pattern.matcher(line).replaceAll(""); - //if ( temp.length()>1) - // System.out.println(); - find = true; - } - reader.close(); - return buffer.toString(); - } - public static void main(String[] args) { - // - if ( args.length < 4 ) { - return; - } - String args4 = args[3]; - for ( int i = 4 ; i < args.length; i++) { - args4 = args4+" " + args[i]; - } - try { - Document doc = new Document(args[0],args[1],args[2],args4); - doc.useHTML = false; - //System.out.println(""); - System.out.println(doc.read().replaceFirst("\n","")); - //System.out.println(""); - } - catch(Exception ex) { - ex.printStackTrace(); - //TODO: Add Exception handler here - } - } - boolean useHTML = true; - private String getTags(String old) { - if (!useHTML) { - if (old.compareToIgnoreCase("DD")==0) { - return "\n"; - } - return " "; - } - if (tagMaps.containsKey(old)) - return (String) tagMaps.get(old); - return ""; - } - -} -// vim: ft=java diff --git a/dot.vim/src/vjde/completion/Document.java.oooold b/dot.vim/src/vjde/completion/Document.java.oooold deleted file mode 100644 index 18cbbeb..0000000 --- a/dot.vim/src/vjde/completion/Document.java.oooold +++ /dev/null @@ -1,356 +0,0 @@ -<<<<<<< .mine - - -/* - * Document.java 1.00 Wed Aug 24 15:02:50 й׼ʱ 2005 - * - * ȨϢ - */ - -package vjde.completion; -import java.util.StringTokenizer; -import java.io.File; -import java.io.FileReader; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.regex.Pattern; -import java.util.HashMap; -import java.util.regex.Matcher; - -public class Document { - String paths; - String className; - String member; - String src; - static HashMap tagMaps= new HashMap(); - static { - tagMaps.put("A",""); - tagMaps.put("/A",""); - tagMaps.put("B",""); - tagMaps.put("/B",""); - tagMaps.put("H3",""); - tagMaps.put("/H3",""); - tagMaps.put("CODE",""); - tagMaps.put("/CODE",""); - tagMaps.put("DD","\n"); - } - public Document(String ps,String src,String cname,String m) { - paths = ps; - int index = cname.indexOf(":",0); - if ( index > 0 ) { - className = cname.substring(0,index); - } - else { - className = cname; - } - member = m; - index = member.indexOf(";",0); - if ( index > 0 ) { - member = member.substring(0,index); - } - this.src = src; - } - public String read() throws Exception { - String fn = className.replace('.','/'); - File srcFile = new File(src+"/"+fn+".java"); - if ( srcFile.exists()) { - return readSource(srcFile); - } - StringTokenizer stks = new StringTokenizer(paths,File.pathSeparator); - while ( stks.hasMoreTokens()) { - String str = stks.nextToken(); - if (!str.endsWith("/") ) { - str = str+"/"; - } - File file = new File( str+fn+".html" ); - if ( file.exists()) { - return readFile(file); - } - } - return ""; - } - private String readSource(File f ) throws Exception { - String mem = member; - int index = member.indexOf("(",0); - if ( index > 0 ) { - mem = member.substring(0,index); - } - else { - index = member.indexOf(";",0); - if (index > 0 ) - mem = member.substring(0,index); - } - index = className.lastIndexOf("."); - String cn = className; - if ( index > 0 ) { - cn = className.substring(index+1); - } - SourceDocReader reader = new SourceDocReader(f.getAbsolutePath()); - return reader.getMemberDoc(cn,mem); - } - private String readFile(File f) throws IOException { - StringBuffer buffer = new StringBuffer(); - boolean find = false; - BufferedReader reader = new BufferedReader(new FileReader(f)); - String line ; - //Pattern pattern = Pattern.compile("(<([^ ]+) ?[^>]*>)"); - Pattern pattern = Pattern.compile("<([^ >]+)[^>]*>"); - //Pattern pattern = Pattern.compile("<[^>]*>"); - Pattern pattern2 = Pattern.compile(" "); - Pattern spacePattern = Pattern.compile("^\\s*$"); - while ( ( line = reader.readLine())!= null) { - if ((!find) && line.indexOf("",0)!=0) { - continue; - } - if ( line.indexOf("
    ",0)==0 ) { - break; - } - if ( find && line.indexOf("
    1) { - if (!spacePattern.matcher(temp).find()) { - buffer.append(temp); - if ( temp.compareTo("\n")!=0) { - buffer.append("\n"); - } - } - //String temp = pattern.matcher(line).replaceAll(""); - //if ( temp.length()>1) - // System.out.println(); - find = true; - } - reader.close(); - return buffer.toString(); - } - public static void main(String[] args) { - // - if ( args.length < 4 ) { - return; - } - String args4 = args[3]; - for ( int i = 4 ; i < args.length; i++) { - args4 = args4+" " + args[i]; - } - try { - Document doc = new Document(args[0],args[1],args[2],args4); - doc.useHTML = false; - //System.out.println(""); - System.out.println(doc.read().replaceFirst("\n","")); - //System.out.println(""); - } - catch(Exception ex) { - ex.printStackTrace(); - //TODO: Add Exception handler here - } - } - boolean useHTML = true; - private String getTags(String old) { - if (!useHTML) { - if (old.compareToIgnoreCase("DD")==0) { - return "\n"; - } - return " "; - } - if (tagMaps.containsKey(old)) - return (String) tagMaps.get(old); - return ""; - } - -} -// vim: ft=java -======= - - -/* - * Document.java 1.00 Wed Aug 24 15:02:50 й׼ʱ 2005 - * - * ȨϢ - */ - -package vjde.completion; -import java.util.StringTokenizer; -import java.io.File; -import java.io.FileReader; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.regex.Pattern; -import java.util.HashMap; -import java.util.regex.Matcher; - -public class Document { - String paths; - String className; - String member; - String src; - static HashMap tagMaps= new HashMap(); - static { - tagMaps.put("A",""); - tagMaps.put("/A",""); - tagMaps.put("B",""); - tagMaps.put("/B",""); - tagMaps.put("H3",""); - tagMaps.put("/H3",""); - tagMaps.put("CODE",""); - tagMaps.put("/CODE",""); - tagMaps.put("DD","\n"); - } - public Document(String ps,String src,String cname,String m) { - paths = ps; - int index = cname.indexOf(":",0); - if ( index > 0 ) { - className = cname.substring(0,index); - } - else { - className = cname; - } - member = m; - index = member.indexOf(";",0); - if ( index > 0 ) { - member = member.substring(0,index); - } - this.src = src; - } - public String read() throws Exception { - String fn = className.replace('.','/'); - File srcFile = new File(src+"/"+fn+".java"); - if ( srcFile.exists()) { - return readSource(srcFile); - } - StringTokenizer stks = new StringTokenizer(paths,File.pathSeparator); - while ( stks.hasMoreTokens()) { - String str = stks.nextToken(); - if (!str.endsWith("/") ) { - str = str+"/"; - } - File file = new File( str+fn+".html" ); - if ( file.exists()) { - return readFile(file); - } - else { - System.err.println("not found " + str+fn+".html"); - } - } - return ""; - } - private String readSource(File f ) throws Exception { - String mem = member; - int index = member.indexOf("(",0); - if ( index > 0 ) { - mem = member.substring(0,index); - } - else { - index = member.indexOf(";",0); - if (index > 0 ) - mem = member.substring(0,index); - } - index = className.lastIndexOf("."); - String cn = className; - if ( index > 0 ) { - cn = className.substring(index+1); - } - SourceDocReader reader = new SourceDocReader(f.getAbsolutePath()); - return reader.getMemberDoc(cn,mem); - } - private String readFile(File f) throws IOException { - StringBuffer buffer = new StringBuffer(); - boolean find = false; - BufferedReader reader = new BufferedReader(new FileReader(f)); - String line ; - //Pattern pattern = Pattern.compile("(<([^ ]+) ?[^>]*>)"); - Pattern pattern = Pattern.compile("<([^ >]+)[^>]*>"); - //Pattern pattern = Pattern.compile("<[^>]*>"); - Pattern pattern2 = Pattern.compile(" "); - Pattern spacePattern = Pattern.compile("^\\s*$"); - while ( ( line = reader.readLine())!= null) { - if ((!find) && line.indexOf("",0)!=0) { - continue; - } - if ( line.indexOf("
    ",0)==0 ) { - break; - } - if ( find && line.indexOf("
    1) { - if (!spacePattern.matcher(temp).find()) { - buffer.append(temp); - if ( temp.compareTo("\n")!=0) { - buffer.append("\n"); - } - } - //String temp = pattern.matcher(line).replaceAll(""); - //if ( temp.length()>1) - // System.out.println(); - find = true; - } - reader.close(); - return buffer.toString(); - } - public static void main(String[] args) { - if ( args.length < 4 ) { - System.err.println(" "); - return; - } - String args4 = args[3]; - for ( int i = 4 ; i < args.length; i++) { - args4 = args4+" " + args[i]; - } - try { - Document doc = new Document(args[0],args[1],args[2],args4); - doc.useHTML = false; - //System.out.println(""); - System.out.println(doc.read().replaceFirst("\n","")); - //System.out.println(""); - } - catch(Exception ex) { - ex.printStackTrace(); - //TODO: Add Exception handler here - } - } - boolean useHTML = true; - private String getTags(String old) { - if (!useHTML) { - if (old.compareToIgnoreCase("DD")==0) { - return "\n"; - } - return " "; - } - if (tagMaps.containsKey(old)) - return (String) tagMaps.get(old); - return ""; - } - -} -// vim: ft=java ->>>>>>> .r665 diff --git a/dot.vim/src/vjde/completion/DynamicClassLoader.java b/dot.vim/src/vjde/completion/DynamicClassLoader.java deleted file mode 100644 index 11fa10d..0000000 --- a/dot.vim/src/vjde/completion/DynamicClassLoader.java +++ /dev/null @@ -1,537 +0,0 @@ -/* - * DynamicClassLoader.java - * Copyright (C) 2001-2004 Javier Lopez (jslopez@forumsys.com) - * - * $Revision: 1.1.1.1 $ - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package vjde.completion; - -import java.util.Enumeration; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.StringTokenizer; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; -import java.util.Vector; -import java.util.HashMap; -import java.util.jar.JarFile; - - -/** - * The class DynamicClassLoader extends the - * abstract class ClassLoader. - * This class loads the class binaries from the file system - * all the time, it does not catch the class information. - * There is caveat to this, classes that come with the JDK - * such as java.lang.*, are loaded using the standard class loader. - * The rest of the class are always reloaded from the file system. - * - * Created: Sun Jul 01 08:11:12 2001 - * - * @author - * @version 1.0 - * @since jde2.2.8beta2 - */ -public class DynamicClassLoader extends ClassLoader { - - HashMap loaded = new HashMap(); - /** - * Class path. - * - */ - public static final String CLASS_PATH - = System.getProperty("java.class.path"); - - /** - * Platform dependent file separator. - * - */ - public static final String FILE_SEPARATOR - = System.getProperty("file.separator"); - - /** - * Platform dependent path separator. i.e. in Win32 is ';' in Unix is ':'. - * - */ - public static final String PATH_SEPARATOR - = System.getProperty("path.separator"); - - /** - * Char use to separate packages. i.e. '.' - * - */ - public static final char PACKAGE_SEPARATOR = '.'; - - /** - * Classes file type. i.e. class - * - */ - public static final String CLASS_FILE_TYPE = "class"; - - private String load_path = null; - public DynamicClassLoader(String path) { - load_path = path; - } - /** - * Loads a class information from the file system, - * if it fails it tries Class.forName(argClassName) - * - * @param argClassName name of the class to be loaded. - * @return Class of the type argClassName - * @exception ClassNotFoundException if the class cannot be found. - */ - public Class loadClass(String argClassName) throws ClassNotFoundException { - File file; - byte[] classBytes = null; - Class c = null; - - if (loaded.containsKey(argClassName)) - { - return (Class) loaded.get(argClassName); - } - //Checking if the class belong to either java.* or javax.* - if ((argClassName.startsWith("java.")) - || (argClassName.startsWith("javax.")) - ) { - return Class.forName(argClassName); - } // end of if () - - //First convert the class name from java.lang.String to java/lang/String - //where '/' is platform dependent. - String className = argClassName.replace(PACKAGE_SEPARATOR, - FILE_SEPARATOR.charAt(0)); - - //Then add the class file termination i.e. from java/lang/String - //to java/lang/String.class - className += PACKAGE_SEPARATOR + CLASS_FILE_TYPE; - - //Look for the class file in the current project classfile or in - //the system class path if there is no current classpath - //ProjectClasses pc = JdeUtilities.getCurrentProjectClass(); - //TODO Add class path handle here - String classpath = null; - if ( load_path != null) { - classpath = load_path; - } - - if (classpath == null || classpath.equals("")) { - classpath = CLASS_PATH; - } // end of if (classpath == null ) - - StringTokenizer st = new StringTokenizer(classpath, PATH_SEPARATOR); - ZipFile zf; - while (st.hasMoreTokens()) { - - file = new File(st.nextToken()); - - //Check if the file is a directory if is not - //assume it is a jar or zip file - try { - if (file.isDirectory()) { - //if the file is a directory try to locate the class file - //and load it. - file = new File(file, className); - classBytes = loadFile(file); - if (classBytes != null) { - break; - } // end of if (classBytes != null) - } else { - zf = new ZipFile(file); - classBytes = loadFile(zf, className); - if (classBytes != null) { - break; - } // end of if (classBytes != null) - }// end of if-else - } catch (IOException e) { - //ignore - } // end of try-catch - } // end of while (st.hasMoreTokens()) - - if (classBytes != null) { - try { - c = defineClass(argClassName, classBytes, 0, classBytes.length); - } catch (SecurityException e) { - //basic packages such as java.lang.* can't be loaded directly - c = Class.forName(argClassName); - } catch (ClassFormatError e) { - c = Class.forName(argClassName); - } catch (NoClassDefFoundError e) { - c = Class.forName(argClassName); - } - catch (LinkageError e) { - c = Class.forName(argClassName); - } - if ( c != null ) { - if (!loaded.containsKey(argClassName)) - { - loaded.put(argClassName,c); - } - } - return c; - } - else { - try { - c = Class.forName(argClassName); - if ( c != null ) { - if (!loaded.containsKey(argClassName)) - { - loaded.put(argClassName,c); - } - } - return c; - } catch (ClassNotFoundException e) { - //System.err.println(argClassName); - return null; - //throw new ClassNotFoundException(argClassName); - } // end of try-catch - } // end of else - }//end of loadClass - - public String[] getClass4Name(String name) { - String fullname = name+"."+CLASS_FILE_TYPE; - Vector v = new Vector(); - - String classpath = null; - if ( load_path != null) { - classpath = load_path; - } - - if (classpath == null || classpath.equals("")) { - classpath = CLASS_PATH; - } // end of if (classpath == null ) - - StringTokenizer st = new StringTokenizer(classpath, PATH_SEPARATOR); - - ZipFile zf; - File file; - while (st.hasMoreTokens()) { - - String t = st.nextToken(); - file = new File(t); - try { - if (file.isDirectory()) { - String pkg = file.getAbsolutePath();//+"/"+pkg_path; - list4Class(pkg,fullname,v,pkg.length()); - } else { - zf = new ZipFile(file); - Enumeration enums = zf.entries(); - while ( enums.hasMoreElements()) { - ZipEntry etry = (ZipEntry) enums.nextElement(); - String n ; - if ( !etry.isDirectory()) { - n = etry.getName(); - if ( n.endsWith('/'+fullname)) { - v.add(n.replace('/',PACKAGE_SEPARATOR)); - } - - } - } - }// end of if-else - } catch (IOException e) { - //ignore - } // end of try-catch - } // end of while (st.hasMoreTokens()) - - return (String[]) v.toArray(new String[v.size()]); - } - public String[] getClassNames(String pkg_path) { - //Vector v = new Vector(); - Vector v = new Vector(); - - String classpath = null; - if ( load_path != null) { - classpath = load_path; - } - - if (classpath == null || classpath.equals("")) { - classpath = CLASS_PATH; - } // end of if (classpath == null ) - pkg_path = pkg_path.replace(PACKAGE_SEPARATOR,'/'); - - StringTokenizer st = new StringTokenizer(classpath, PATH_SEPARATOR); - - ZipFile zf; - File file; - while (st.hasMoreTokens()) { - String t = st.nextToken(); - file = new File(t); - try { - if (file.isDirectory()) { - String pkg = file.getAbsolutePath();//+"/"+pkg_path; - if ( pkg_path.length()>0) { - pkg += "/"+pkg_path; - } - listClass(pkg,v); - } else { - zf = new ZipFile(file); - Enumeration enums = zf.entries(); - int len = pkg_path.length(); - while ( enums.hasMoreElements()) { - ZipEntry etry = (ZipEntry) enums.nextElement(); - String n ; - if ( !etry.isDirectory()) { - n = etry.getName(); - //System.out.println(n); - - if ( n.startsWith(pkg_path) && len < n.length()&&n.indexOf('/',len)==-1) { - v.add(n.substring(len).replace('/',PACKAGE_SEPARATOR)); - } - //n = n.replace('/',PACKAGE_SEPARATOR); - //v.add(n.substring(0,n.length()-1)); - } - } - }// end of if-else - } catch (IOException e) { - //ignore - } // end of try-catch - } // end of while (st.hasMoreTokens()) - - return (String[]) v.toArray(new String[v.size()]); - } - public String[] getPackageNames() { - //Vector v = new Vector(); - Vector v = new Vector(); - Package[] pkgs = super.getPackages(); - for ( int i = 0 ; i < pkgs.length ; i++) { - v.add(pkgs[i].getName()); - } - //for ( Package p : pkgs) { - //v.add(p.getName()); - //} - //return getPackages(); - String classpath = null; - if ( load_path != null) { - classpath = load_path; - } - - if (classpath == null || classpath.equals("")) { - classpath = CLASS_PATH; - } // end of if (classpath == null ) - - StringTokenizer st = new StringTokenizer(classpath, PATH_SEPARATOR); - ZipFile zf; - File file; - while (st.hasMoreTokens()) { - String t = st.nextToken(); - file = new File(t); - try { - if (file.isDirectory()) { - listDir(file,v,""); - } else { - zf = new JarFile(file); - Enumeration enums = zf.entries(); - while ( enums.hasMoreElements()) { - ZipEntry etry = (ZipEntry) enums.nextElement(); - String n ; - if (etry.isDirectory()) { - n = etry.getName(); - n = n.replace('/',PACKAGE_SEPARATOR); - v.add(n.substring(0,n.length()-1)); - } - else { - n = etry.getName(); - int l = n.lastIndexOf('/'); - if ( l> 0) { - n = n.substring(0,l).replace('/',PACKAGE_SEPARATOR); - if (!v.contains(n)) { - v.add(n); - } - } - } - } - }// end of if-else - } catch (IOException e) { - //ignore - } // end of try-catch - } // end of while (st.hasMoreTokens()) - - return (String[])v.toArray(new String[v.size()]); - } - private void listClass(String argFile,Vector v) { - File f = new File(argFile); - if ( f.isDirectory()) { - File[] fs = f.listFiles(new java.io.FilenameFilter() { - public boolean accept(File dir,String name) { - //System.out.println(name); - return name.endsWith("."+CLASS_FILE_TYPE); - } - }); - for ( int i = 0 ; i < fs.length ; i++) { - v.add(fs[i].getName()); - } - } - } - private void list4Class(String argFile,String fullname,Vector v,int length) { - File f = new File(argFile); - if ( f.isDirectory()) { - File[] fs = f.listFiles(new java.io.FilenameFilter() { - public boolean accept(File dir,String name) { - return true; - } - }); - for ( int i = 0 ; i < fs.length ; i++) { - if ( fs[i].getName().compareTo(fullname)==0) { - v.add(fs[i].getPath().substring(length+1).replace(FILE_SEPARATOR.charAt(0),PACKAGE_SEPARATOR)); - } - else if ( fs[i].isDirectory()) { - list4Class(fs[i].getAbsolutePath(),fullname,v,length); - } - } - } - } - private void listDir(File argFile,Vector v,String pre) { - //if ( argFile.isDirectory()) { - File[] names = argFile.listFiles(); - for ( int i = 0 ; i < names.length ; i++) - { - File n = names[i]; - if ( n.isDirectory() ) { - v.add(pre+n.getName()); - listDir(n,v,pre+n.getName()+"."); - } - } - //for ( int i = 0 ; i < names.length ; i++ ) { - //File n = names[i]; - //if ( n.isDirectory() ) { - //v.add(pre+n.getName()); - //listDir(n,v,pre+n.getName()+"."); - //} - //} - //} - } - - private byte[] loadFile(File argFile) { - byte[] b = null; - InputStream in = null; - if (argFile.exists()) { - try { - in = new FileInputStream(argFile); - b = read(in, (int)argFile.length()); - } catch (FileNotFoundException e) { - b = null; - } catch (IOException e) { - b = null; - } finally { - try { - in.close(); - } catch (IOException e) { - } // end of try-catch - }//end of try-finally - }// end of if - - return b; - } - - private byte[] loadFile(ZipFile argFile, String argClassName) { - //zip and jar files seems to always be separated by a '/' - argClassName = argClassName.replace(FILE_SEPARATOR.charAt(0), '/'); - byte[] b = null; - ZipEntry ze; - InputStream in; - try { - ze = argFile.getEntry(argClassName); - if (ze != null) { - in = argFile.getInputStream(ze); - b = read(in, (int) ze.getSize()); - } - } catch (IOException e) { - b = null; - } finally { - try { - argFile.close(); - } catch (IOException e) { - } - } - return b; - } - - private static byte[] read (InputStream is, int size) throws IOException { - int len = 0; - byte [] b = new byte[size]; - try { - while (true) { - int n = is.read(b, len, size - len); - if (n == -1 || n == 0) { - if (len < size) { - // ignore - } - break; - } else - len += n; - } - } finally { - try { - is.close(); - } catch (IOException e) {} // ignore - } - return b; - } - -}// DynamicClassLoader - -/* - * $Log: DynamicClassLoader.java,v $ - * Revision 1.1.1.1 2005/06/10 03:00:10 administrator - * no message - * - * Revision 1.5 2005/05/30 01:24:20 administrator - * - * remove ruby depends for java code completion. - * - * Revision 1.4 2005/03/31 09:58:02 administrator - * add search defination, class completion, variable type search bug fix - * - * Revision 1.3 2005/03/31 00:47:46 administrator - * - * Add package completion support. - * - * Revision 1.2 2005/03/30 06:31:11 administrator - * Package support - * - * Revision 1.1.1.1 2005/03/28 02:32:21 administrator - * - * vim java development envionment. - * - * Revision 1.7 2004/10/15 03:28:09 paulk - * Fixed bug caused by assuming that only one read operation is needed to - * read a class from the file system. Thanks to Suraj Acharya. - * - * Revision 1.6 2002/02/21 12:26:45 jslopez - * Updates the DynamicClassLoader to use the current project - * classpath stored in JdeUtilities. - * - * Revision 1.5 2001/07/21 04:01:21 paulk - * Now loads classes in java and javax packages instead of waiting for an exception to be thrown The purpose is two-fold, one is performance and the other one is to get rid of a nasty LinkageError. Contributed by Javier Lopez. - * - * Revision 1.4 2001/07/18 01:51:37 paulk - * Handles ClassFormatError and NoClassDefFoundErrror exceptions that can occur when trying to load classes. Thanks to Javier Lopez. - * - * Revision 1.3 2001/07/17 05:27:53 paulk - * Fixed to search vm startup classpath if classes not found on user classpath. Thanks to Javier. - * - * Revision 1.2 2001/07/07 04:49:43 paulk - * Removed DOS line endings. - * - * Revision 1.1 2001/07/06 01:59:02 paulk - * Initial revision. - * - */ - -// End of DynamicClassLoader.java diff --git a/dot.vim/src/vjde/completion/MultiValueMap.java b/dot.vim/src/vjde/completion/MultiValueMap.java deleted file mode 100644 index 515978c..0000000 --- a/dot.vim/src/vjde/completion/MultiValueMap.java +++ /dev/null @@ -1,85 +0,0 @@ - -package vjde.completion; - -import java.util.*; - -/** - * A HashMap subclass which adds multiple values with the same key to - * a List of values. Single values remain single keys, obviating the - * need to cart around single-element Lists. - * - * Copyright (C) 2001 Eric D. Friedman (eric@hfriedman.rdsl.lmi.net) - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Created: Tue Aug 14 19:36:50 2001 - * - * @author Eric D. Friedman - * @version $Id: MultiValueMap.java,v 1.1.1.1 2005/06/10 03:00:10 administrator Exp $ - */ - -public class MultiValueMap extends HashMap { - public MultiValueMap () { - super(); - } - - /** - * Convenience method for retrieving the value for - * key as a List, even when there is only a single - * value for that key in the map. The EMPTY_LIST is returned when - * no value is found for key making null checks - * unnecessary. - * - * @param key an Object value - * @return a List value - */ - public List getAsList(Object key) { - if (containsKey(key)) { - Object o = get(key); - if (o instanceof List) { - return (List)o; - } else { - return Arrays.asList(new Object[] { o }); - } // end of else - } else { - return Collections.EMPTY_LIST; - } // end of else - } - - /** - * inserts value into the map for key as a single element or, if - * values already exist, as an entry in key's list. - * - * @param key an Object value - * @param value an Object value - * @return null - */ - public Object put(Object key, Object value) { - if (containsKey(key)) { - Object other = get(key); - if (other instanceof List) { - ((List)other).add(value); - } else { - List l = new ArrayList(); - l.add(other); - l.add(value); - super.put(key, l); - } - } else { - super.put(key,value); - } - return null; - } -}// MultiValueMap diff --git a/dot.vim/src/vjde/completion/PackageClasses.java b/dot.vim/src/vjde/completion/PackageClasses.java deleted file mode 100644 index d2ec5b8..0000000 --- a/dot.vim/src/vjde/completion/PackageClasses.java +++ /dev/null @@ -1,73 +0,0 @@ -package vjde.completion; - -import java.util.Arrays; -import java.util.Vector; -import java.util.Iterator; -import java.io.BufferedReader; -import java.io.FileReader; -public class PackageClasses { - public static void main(String[] args) { - if ( args.length < 3 ) { - // - return ; - } - String[] names = new DynamicClassLoader(args[0]).getClassNames(args[1]); - - Vector buffer =new Vector(); - - String prefix = args[1]; - int prelen = args[1].length(); - boolean check = true; - if ( args.length>=4 && args[3].length()>0) { - prefix += args[3]; - check = false; - } - - /* - // grep jdk1.5lst - try { - BufferedReader in = new BufferedReader(new FileReader(args[2])); - String str = null; - while ((str=in.readLine())!=null) { - if ( str.startsWith(prefix) ) { - if ( check) { - if ( str.charAt(prelen)<='Z' && str.charAt(prelen)>='A') { - //buffer.add(str.substring(prelen)); - buffer.add(str); - } - } - else { - //buffer.add(str.substring(prelen)); - buffer.add(str); - } - } - } - } - catch(Exception ex) { - //TODO: Add Exception handler here - } - */ - - Arrays.sort(names); - - /* - for ( Iterator it = buffer.iterator() ; it.hasNext(); ) { - System.out.println(it.next()); - } - */ - - if (args.length >= 4 && args[3].length()>0) { - for ( int i = 0 ; i < names.length ; i++) { - if ( names[i].startsWith(args[3]) && names[i].indexOf('$')<0 && names[i].endsWith(".class")) { - System.out.println(names[i].substring(0,names[i].length()-6)); - } - } - } - else { - for ( int i = 0 ; i < names.length ; i++) { - if ( names[i].indexOf('$') < 0 && names[i].endsWith(".class")) - System.out.println(names[i].substring(0,names[i].length()-6)); - } - } - } -} diff --git a/dot.vim/src/vjde/completion/PackageCompletion.java b/dot.vim/src/vjde/completion/PackageCompletion.java deleted file mode 100644 index c4488ce..0000000 --- a/dot.vim/src/vjde/completion/PackageCompletion.java +++ /dev/null @@ -1,35 +0,0 @@ -package vjde.completion; - -import java.util.Arrays; -public class PackageCompletion { - public static void main(String[] args) { - if ( args.length < 1 ) { - System.out.println(" [package-name]"); - return; - } - //Package[] pkgs = Package.getPackages(); - //ClassLoader l = new DynamicClassLoader(args[0]); - String p = args.length>=1?args[0]:""; - //System.out.println(p); - String[] names = new DynamicClassLoader(p).getPackageNames(); - Arrays.sort(names); - - int length=0; - String prefix =""; - if ( args.length >= 2) { - prefix=args[1]; - length = prefix.length(); - - for ( int i = 0 ; i < names.length ; i++) { - if ( names[i].length()>=length && names[i].startsWith(prefix)) { - System.out.println(names[i]); - } - } - } - else { - for ( int i = 0 ; i < names.length ; i++) { - System.out.println(names[i]); - } - } - } -} diff --git a/dot.vim/src/vjde/completion/SourceDocReader.java b/dot.vim/src/vjde/completion/SourceDocReader.java deleted file mode 100644 index 7ee021e..0000000 --- a/dot.vim/src/vjde/completion/SourceDocReader.java +++ /dev/null @@ -1,260 +0,0 @@ - -/* - * SourceDocReader.java 1.00 Wed Aug 24 09:38:45 й׼ʱ 2005 - * - * ȨϢ - */ - -package vjde.completion; -import java.io.FileReader; -import java.io.StreamTokenizer; - -/** - * Java Plugin for Vim Intellisense. - * Author : Madan Ganesh (mganesh@baan.com) - * Dated : 25th September 2003 - * Version : javaft 0.92 - * - * You can modify the source, provided you leave this header information. - */ -public class SourceDocReader { - private String m_fileName; - public SourceDocReader(String f) { - this.m_fileName = f; - } - /** - * This method reads the documentation for the given class. - * - * @param className The class name for which the documentation has - * to be read. - * - * @return The documentation for the given class. - */ - public String getClassDoc(String className) throws Exception - { - FileReader fd = new FileReader(m_fileName); - - StreamTokenizer st = new StreamTokenizer(fd); - st.slashSlashComments(true); - st.wordChars((char)' ',(char)' '); - st.wordChars((char)'\t',(char)'\t'); - st.wordChars((int)'_',(int)'_'); - st.wordChars((int)'[',(int)']'); - st.wordChars((int)'{',(int)'}'); - st.wordChars((int)';',(int)';'); - st.wordChars((int)'(',(int)')'); - st.wordChars((int)',',(int)','); - st.wordChars((int)'=',(int)'='); - st.wordChars((int)'/',(int)'/'); - st.wordChars((int)'*',(int)'*'); - - String doc = ""; - while (st.nextToken() != StreamTokenizer.TT_EOF) - { - if (st.ttype == StreamTokenizer.TT_WORD) - { - doc = ""; - if (st.sval.startsWith("/**")) - { - doc = readDoc(st); - if (st.nextToken() == StreamTokenizer.TT_EOF) - { - doc = ""; - break; - } - } - if (indexOfOnly(st.sval,"class "+className) || (indexOfOnly(st.sval,"interface "+className))) - { - doc = st.sval + "

    " + doc; - break; - } - } - } - return doc; - } - - /** - * This method returns the documentation of the given member belonging to - * the class specified by the class name. - * - * @param className The name of the type whose member's - * documentation has to be read. - * - * @param member The member whose documentation has to be read. - * - * @return The documentation of the member. - */ - public String getMemberDoc(String className,String member) throws Exception - { - FileReader fd = new FileReader(m_fileName); - - StreamTokenizer st = new StreamTokenizer(fd); - st.slashSlashComments(true); - st.wordChars((char)' ',(char)' '); - st.wordChars((char)'\t',(char)'\t'); - st.wordChars((int)'_',(int)'_'); - st.wordChars((int)'[',(int)']'); - st.wordChars((int)'{',(int)'}'); - st.wordChars((int)';',(int)';'); - st.wordChars((int)'(',(int)')'); - st.wordChars((int)',',(int)','); - st.wordChars((int)'=',(int)'='); - st.wordChars((int)'/',(int)'/'); - st.wordChars((int)'*',(int)'*'); - - String doc = ""; - boolean classFound = false; - while (st.nextToken() != StreamTokenizer.TT_EOF) - { - if (st.ttype == StreamTokenizer.TT_WORD) - { - if (indexOfOnly(st.sval,"class "+className) || (indexOfOnly(st.sval,"interface "+className))) - { - classFound = true; - break; - } - } - - } - - if (classFound) - { - while (st.nextToken() != StreamTokenizer.TT_EOF) - { - if (st.ttype == StreamTokenizer.TT_WORD) - { - doc = ""; - if (st.sval.startsWith("/**")) - { - doc = readDoc(st); - } - - // First Collect the member signature completly. - if (!doc.equals("")) - { - String buffer = ""; - while (st.nextToken() != StreamTokenizer.TT_EOF) - { - if (st.ttype == StreamTokenizer.TT_WORD) - { - buffer += st.sval; - if (st.sval.endsWith("{") || st.sval.endsWith(";")) - { - break; - } - } - } - if (buffer.indexOf(member) != -1) - { - buffer = buffer.substring(0,buffer.length() - 1); - doc = buffer + "\n" + doc; - break; - } - } - } - } - } - else - { - throw new Exception(className + " not found in " + m_fileName); - } - - fd.close(); - return doc; - } - - public String getMemberTipDoc(String className,String member,int paramPos) throws Exception - { - return ""; - } - - // Helper Methods. - - /** - * This method consumes the documentation part of the tokenizer. - * - * @param st StreamTokenizer from which the immediate documentation - * portion is to be read. - * - * @return The documentation consumed from the stream. - */ - private String readDoc(StreamTokenizer st) throws Exception - { - String doc = ""; - while (st.nextToken() != StreamTokenizer.TT_EOF) - { - if (st.ttype == StreamTokenizer.TT_WORD) - { - if (st.sval.endsWith("*/")) - { - break; - } - String test = st.sval; - int pos = test.indexOf('*'); - if (pos != -1) - { - test = "\n"+test.substring(pos+1); - } - doc += test; - } - } - return doc; - } - /** - * Checks if the 'test' is part of 'whole' string and the 'test' ends in - * the 'whole' string. Eg - * whole - "class XPath implements Parser" - * test - "class XPath" - * returns true - * - * whole - "class XPathAPI implements Parser" - * test - "class XPath" - * return false - * - * whole - "class XPath{" - * test - "class XPath" - * returns true - */ - static boolean indexOfOnly(String whole,String test) - { - boolean ret = false; - int pos = whole.indexOf(test); - if (pos != -1) - { - String testSeparated = whole.substring(pos).trim(); - int l1 = test.length(); - int l2 = testSeparated.length(); - if (l1 == l2) - { - if (testSeparated.equals(test)) - { - ret = true; - } - } - else if (l2 > l1) - { - char c = testSeparated.charAt(l1); - if (c==' ' || c=='\t' || c=='{') - { - ret = true; - } - } - } - return ret; - } - - public static void main(String[] args) { - try { - SourceDocReader reader = new SourceDocReader("src/vjde/completion/SourceDocReader.java"); - String clsDoc = reader.getClassDoc("SourceDocReader"); - System.out.println(clsDoc); - System.out.println(); - String memberDoc = reader.getMemberDoc("SourceDocReader","getMemberDoc"); - System.out.println(memberDoc); - } - catch(Exception ex) { - //TODO: Add Exception handler here - } - } -} -// vim: ft=java diff --git a/dot.vim/src/vjde/completion/Struts2Configure.java b/dot.vim/src/vjde/completion/Struts2Configure.java deleted file mode 100644 index bf046b3..0000000 --- a/dot.vim/src/vjde/completion/Struts2Configure.java +++ /dev/null @@ -1,460 +0,0 @@ -package vjde.completion; -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; -import org.apache.struts2.convention.annotation.Actions; -import org.apache.struts2.convention.annotation.Action; -import org.apache.struts2.convention.annotation.Result; -import org.apache.struts2.convention.annotation.InterceptorRef; -import org.apache.struts2.convention.annotation.ExceptionMapping; -import java.util.ArrayList; -import org.w3c.dom.Document; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.ParserConfigurationException; -import org.xml.sax.SAXException; -import java.io.IOException; -import org.w3c.dom.NodeList; -import org.w3c.dom.Element; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathFactory; -import javax.xml.xpath.XPathExpression; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import java.io.FileInputStream; -class ResultImpl implements Result { - String name; - String location; - public ResultImpl(String n,String l) { - name = n; - location = l; - } - public String name() { - return name==null || name.length()==0 ? "success": name; - } - public String location() { - if ( location.indexOf('\n')>=0) { - return ""; - } - return location.trim(); - } - public String[] params() { - return new String[0]; - } - public String type() { - return null; - } - public Class annotationType() { - return null; - } -} -class ActionImpl implements Action { - String name ; - Result[] res; - public ActionImpl(String n,Result[] r) { - name = n; - res = r; - } - public String value() { - return name; - } - public Result[] results() { - return res; - } - public InterceptorRef[] interceptorRefs() { - return null; - } - public ExceptionMapping[] exceptionMappings() { - return null; - } - public String[] params() { - return new String[0]; - } - public Class annotationType() { - return null; - } -} -public class Struts2Configure { - XPathExpression exprpackage = null ; - XPathExpression expriclude= null ; - XPathExpression expkg= null ; - static XPathFactory factory = XPathFactory.newInstance(); - static XPath xpath = factory.newXPath(); - DocumentBuilder db = null ; - private static class MyAction { - public MyAction(Action a, String sp,String m,String k) { - action = a; - space = sp; - klass = k; - method = m==null?"execute":m; - url = space + action.value(); - } - public String url; - public Action action; - public String space; - public String method; - public String klass; - } - DynamicClassLoader dcl = null ; - String webapp; - String classpath; - String actionpkg; - String classname; - String currentPkg=null; - ArrayList actions = new ArrayList(); - public Struts2Configure(String webapp,String path,String pkg) - { - classpath = path; - this.webapp=webapp; - actionpkg=pkg; - dcl = new DynamicClassLoader(classpath); - } - public void findAnnotation() - { - findAnnotation(actionpkg); - String[] names = dcl.getPackageNames(); - for ( int i = 0 ; i < names.length ; i++) { - if ( names[i].startsWith(actionpkg)) - { - findAnnotation(names[i]); - } - } - } - public void findAnnotation(String pkg) - { - currentPkg = pkg; - String[] names = dcl.getClassNames(pkg); - for ( int i = 0 ; i < names.length ; i++) { - handlerClass(pkg,names[i]); - } - } - public void handlerClass(String p, String name) { - String fname = p+"." + name.substring(0,name.length()-6) ; - try { - //Class c = dcl.loadClass(fname); - Class c = Class.forName(fname); - if ( c != null ) { - Annotation[] anns = c.getDeclaredAnnotations(); - handleAnnotations(anns,c); - Method[] ms = c.getMethods(); - for ( int i = 0 ; i < ms.length; i++) { - //ms[i].getAnnotations() - //System.out.println(ms[i].getDeclaredAnnotations().length); - //System.out.println( ms[i].isAnnotationPresent(Deprecated.class)); - /* - org.apache.struts2.convention.annotation.Action t = ms[i].getAnnotation(org.apache.struts2.convention.annotation.Action.class); - System.out.println(t); - if ( t != null) - { - handleAction((Action)t,c,ms[i].getName()); - } - */ - handleAnnotations(ms[i].getDeclaredAnnotations(),c,ms[i]); - } - } - } - catch ( ClassNotFoundException ex) { - //ex.printStackTrace(); - } - } - public void handleAction(Action action,Class c) - { - handleAction(action,c,""); - //System.out.println(action.method()); - } - public void handleAction(Action action,Class c,String m) - { - String space = "/"; - if ( currentPkg.length() > actionpkg.length()) { - space = space + currentPkg.substring(actionpkg.length()+1) +"/"; - } - actions.add( new MyAction(action,space,m,c.getName())); - /* - System.out.println(m); - //System.out.println(c.getName()); - System.out.println(action.value()); - if ( currentPkg.length() > actionpkg.length()) { - System.out.println(currentPkg.substring(actionpkg.length()+1)); - } - Result[] results = action.results(); - for ( int i = 0 ; i < results.length; i++ ) { - System.out.println(results[i].name()); - System.out.println(results[i].location()); - } - */ - //System.out.println(action.method()); - } - public void handleAnnotations(Annotation[] anns,Class c,Method m) { - for ( int i = 0 ; i < anns.length ; i++ ) { - Annotation an = anns[i]; - //System.out.println( an.annotationType()); - if ( an instanceof Actions) { - Action[] actions = ((Actions)an).value(); - for ( int j = 0 ; j < actions.length; j++) { - handleAction(actions[j],c,m.getName()); - } - //System.out.println(an.annotationType().getName()); - } - else if ( an instanceof Action) { - handleAction((Action)an,c,m.getName()); - } - else if ( an instanceof Deprecated){ - //System.out.println(an); - } - //System.out.println(an.annotationType().getName()); - - } - } - public void handleAnnotations(Annotation[] anns,Class c) { - for ( int i = 0 ; i < anns.length ; i++ ) { - //System.out.println(anns[i]); - Annotation an = anns[i]; - if ( an instanceof Actions) { - Action[] actions = ((Actions)an).value(); - for ( int j = 0 ; i < actions.length; j++) { - handleAction(actions[j],c); - } - //System.out.println(an.annotationType().getName()); - } - else if (an instanceof Action) { - handleAction((Action)an,c); - } - //System.out.println(an.annotationType().getName()); - - } - } - public void toOut() { - for ( MyAction act : actions) { - System.out.println(act.klass); - System.out.println(act.space); - System.out.println(act.method); - System.out.println(act.action.value()); - } - } - public StringBuffer result2Dict(MyAction action) { - StringBuffer b = new StringBuffer(); - b.append('{') ; - char sp=' '; - for (Result res : action.action.results()) { - b.append(String.format(" %3$c '%1$s' : '%2$s'",res.name(),res.location().replaceAll("'","''"),sp)); - sp = ','; - } - b.append('}'); - return b; - } - public StringBuffer action2List(MyAction a) { - StringBuffer b = new StringBuffer(); - b.append(String.format("['%1$s' , '%2$s' , '%3$s' , %4$s ]",a.klass, a.method,a.url,result2Dict(a).toString())); - return b; - } - public String actions2vim() { - StringBuffer b = new StringBuffer(); - b.append("[\n"); - for ( MyAction action : actions) { - b.append("\\"); - b.append(action2List(action).toString()); - b.append(','); - b.append("\n"); - } - b.append("\\]"); - return b.toString(); - } - public Document findStruts2(String webapp) - { - return findXml(webapp+"/WEB-INF/classes/struts.xml"); - } - public Document findWeb(String webapp) - { - return findXml(webapp+"/WEB-INF/web.xml"); - } - public NodeList findInclues(Document doc) { - if ( expriclude== null ) { - try { - expriclude= xpath.compile("//struts/include"); - } - catch(XPathExpressionException e1) { - } - } - try { - return (NodeList ) expriclude.evaluate(doc, XPathConstants.NODESET); - } - catch(XPathExpressionException e1) { - } - return null; - //return doc.getElementsByTagName("include"); - } - public NodeList findPackages(Document doc) { - if ( expkg== null ) { - try { - expkg= xpath.compile("//struts/package"); - } - catch(XPathExpressionException e1) { - } - } - try { - return (NodeList) expkg.evaluate(doc, XPathConstants.NODESET); - } - catch(XPathExpressionException e1) { - } - return null; - //return doc.getElementsByTagName("package"); - } - public void findInxml() { - handleXml( findStruts2(webapp)); - } - public void onPackage(Element pkg) { - Object result = null ; - if ( exprpackage == null ) { - try { - exprpackage = xpath.compile("action"); - } - catch(XPathExpressionException e1) { - } - } - try { - result = exprpackage.evaluate(pkg, XPathConstants.NODESET); - } - catch(XPathExpressionException e1) { - } - if ( result == null ) { - return ; - } - - NodeList paction = (NodeList) result; - //NodeList paction = pkg.getElementsByTagName("action"); - String space = pkg.getAttribute("namespace"); - if ( space == null ) { - space = "/"; - } - for ( int i = 0 ; i < paction.getLength() ; i++ ) { - final Element e = (Element) paction.item(i); - final String name = e.getAttribute("name"); - //System.out.println(name); - final String klass = e.getAttribute("class"); - String me = e.getAttribute("method"); - if ( me == null || me.length() ==0 ) { - me = "execute"; - } - Result[] res = onResult(e); - Action action = new ActionImpl(name,res); - /* - final Action action = new Action() { - public String value() { - return name; - } - public Result[] results() { - return onResult(e); - } - public InterceptorRef[] interceptorRefs() { - return null; - } - public ExceptionMapping[] exceptionMappings() { - return null; - } - public String[] params() { - return new String[0]; - } - public Class annotationType() { - return null; - } - }; - */ - - actions.add( new MyAction(action,space,me,klass)); - } - } - public Result[] onResult(Element act) { - NodeList paction = act.getElementsByTagName("result"); - Result[] res = new Result[paction.getLength()]; - for ( int i = 0 ; i < paction.getLength() ; i++ ) { - Element e = (Element) paction.item(i); - final String name = e.getAttribute("name"); - final String location = e.getTextContent(); - res[i] = new ResultImpl(name,location); - /* - res[i] = new Result() { - public String name() { - return name==null || name.length()==0 ? "success": name; - } - public String location() { - if ( location.indexOf('\n')>=0) { - return ""; - } - return location.trim(); - } - public String[] params() { - return new String[0]; - } - public String type() { - return null; - } - public Class annotationType() { - return null; - } - }; - */ - - //System.out.println(location); - } - return res; - } - public void handleXml(Document doc) { - long s = System.currentTimeMillis(); - if ( doc != null ) { - NodeList incs = findInclues(doc); - for ( int i = 0 ; i < incs.getLength(); i++ ) { - Element e = (Element) incs.item(i); - String file=e.getAttribute("file"); - Document dd2 = findXml(webapp+"/WEB-INF/classes/" + file); - if ( dd2 != null ) { - handleXml(dd2); - } - //System.out.println(file); - } - NodeList pkgs = findPackages(doc); - for ( int i = 0 ; i < pkgs.getLength() ; i++) { - Element e = (Element) pkgs.item(i); - onPackage(e); - } - } - System.out.println(System.currentTimeMillis()-s); - } - public Document findXml(String xml) { - System.out.println(xml); - if ( db == null ) { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setIgnoringComments(true); - dbf.setValidating(false); - try { - db = dbf.newDocumentBuilder(); - } - catch(ParserConfigurationException e1) { - e1.printStackTrace(System.err); - return null; - } - } - long s = System.currentTimeMillis(); - try { - return db.parse(new FileInputStream(xml)); - } - catch(IOException e2) { - e2.printStackTrace(System.err); - } - catch(SAXException e1) { - e1.printStackTrace(System.err); - } - finally { - System.out.println("parser " + (System.currentTimeMillis()-s)); - } - return null; - } - public static void main(String[] args) { - if ( args.length < 2) { - System.err.println(" "); - return; - } - Struts2Configure s2c = new Struts2Configure(args[0],"",args[1]); - s2c.findAnnotation(); - s2c.findInxml(); - //System.out.println(s2c.actions2vim()); - } -} diff --git a/dot.vim/src/wspawn.cpp b/dot.vim/src/wspawn.cpp deleted file mode 100644 index cdbeccb..0000000 --- a/dot.vim/src/wspawn.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// wspawn -// g++ -o ../plugin/vjde/wspawn wspawn.cpp -mwindows - -#include -#include -#include -#include -#include - -using namespace std; - -void exit_friendly(void) -{ - puts("벻ҪwSpawn."); - exit(0); -} - -int main( int argc, char *argv[] ) -{ - HANDLE hWrite = NULL; - DWORD dwWrited; - int i = 0, ret = 0, len = 0; - char psBuffer[256]; - FILE* child_output; - string command_line = ""; - - // УڹܵתΪHANDLE - if (argc < 2) - exit_friendly(); - if (!stricmp(argv[1], "-h")) - { - if (argc < 4) - exit_friendly(); - hWrite = (HANDLE)atoi(argv[2]); - i = 3; - } - else - i = 1; - - // ȡҪִе - for (; i < argc; i++) - { - command_line += argv[i]; - command_line += " "; - } - - // ʹ_popenӽ̲ض׼ļָ - if( (child_output = _popen( command_line.c_str(), "rt" )) == NULL ) - exit( 1 ); - - while( !feof( child_output ) ) - { - if( fgets( psBuffer, 255, child_output ) != NULL ) - { - if (hWrite) - { - // ӽ̵ı׼дܵṩԼĸ - // ʽдݿ鳤ȣ0ʾдݿ - len = strlen(psBuffer); - WriteFile(hWrite, &len, sizeof(int), &dwWrited, NULL); - WriteFile(hWrite, psBuffer, len, &dwWrited, NULL); - } - else - // δṩֱܵӴӡ - printf(psBuffer); - } - } - - // д"0"ʾݶд - len = 0; - if (hWrite) - WriteFile(hWrite, &len, sizeof(int), &dwWrited, NULL); - - return _pclose( child_output ); -} diff --git a/dot.vim/syntax/asmx86.vim b/dot.vim/syntax/asmx86.vim deleted file mode 100644 index 363677f..0000000 --- a/dot.vim/syntax/asmx86.vim +++ /dev/null @@ -1,597 +0,0 @@ -" Vim syntax file -" Hacked by Adam, from the 68000 asm syntax.... -" x Language: Motorola 68000 Assembler -" x Maintainer: Steve Wall -" Last change: 2001 May 01 -" -" This is incomplete. In particular, support for 68020 and -" up and 68851/68881 co-processors is partial or non-existant. -" Feel free to contribute... -" - -" 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 - -syn case ignore - -" syn region asmx86Comment start="#\(\(\(include\)\|\(define\)\|\(if\)\|\(ifndef\)\|\(endif\)\|\(end\)\|\(ifdef\)\)\s\)\!" end="$" - - -syn region asmx86Commenthash start="#\(\(define\)\|\(if\(n\=\(def\)\)\=\)\|\(include\)\|\(error\)\|\(end\(if\)\=\)\)\!" end="$" contains=asmx86Todo - -syn region asmx86Commenthash start="#" end="$" contains=asmx86Todo - -syn region asmx86Commenthash start=";" end="$" contains=asmx86Todo - - -syn match asmx86Operator "[-+*/]" " Must occur before Comments - -syn match asmx86PreProc "^\s*#\s*\(\(if\(n\=\(def\)\)\=\)\|\(end\(if\)\=\)\|\(define\)\|\(error\)\|\(else\)\)\>" - - -syn region asmx86Commentcpp start="\s*#\s*if\s\+0\+\>" end="\s*#\s*endif\>" contains=asmx86Todo -syn region asmx86Commentcxx start="//" end="$" contains=asmx86Todo -syn region asmx86Commentc start="/\*" end="\*/" contains=asmx86Todo - - -" Preprocessor, basics: - - -" First make ALL things that are behind #'s and the endline as comments. Then -" boil out the stuff that is vaild, like #defines, and such.... It's -" kinda tough, since we're allowing two conflicting syntaxes. But when we -" consider that the "#" mechanism in the pre-processor isn't ever seen by the -" underlying language, it begins to show itself, on why it is so weird. -" There's going to be "#"'es left behind by the cpp, so we need to remember -" that the assembler will see those as commments. We provide this commenting - - - -" Segment Registers -- -syn match asmx86Reg "%[cdefgs]s" - - -" Partial list of register symbols -" General Purpose Registers -- -"syn keyword asmx86Reg eax ax al ah -syn match asmx86Reg "%[abcd][xhl]" -syn match asmx86Reg "%e[abcd]x" -" syn keyword asmx86Reg ebx bx bl bh -" syn keyword asmx86Reg ecx cx cl ch -" syn keyword asmx86Reg edx dx dl dh - -" "Special" Registers -- -"syn keyword asmx86Reg ebp bp edi di esi si esp sp -syn match asmx86Reg "%[bs]p" -syn match asmx86Reg "%e[bs]p" -syn match asmx86Reg "%[ds]i" -syn match asmx86Reg "%e[ds]i" - - -" Protection, extra, and magic registers for all the OS-type fun stuff -- -syn match asmx86Reg "%[cd]r[0-3]" -syn match asmx86Reg "%[td]r[3-7]" -" syn keyword asmx86Reg cr0 cr1 cr2 cr3 -" syn keyword asmx86Reg tr3 tr4 tr5 tr6 tr7 -" syn keyword asmx86Reg dr0 dr1 dr2 dr3 dr4 dr5 dr6 dr7 - -syn keyword asmx86Reg gdtr ldtr idtr tr msw pdbr pfla - -" Page descriptor base register and page fault linear address - -" MC68010 -"syn keyword asmx86Reg vbr sfc sfcr dfc dfcr - -" MC68020 -"syn keyword asmx86Reg msp isp zpc cacr caar -"syn keyword asmx86Reg za0 za1 za2 za3 za4 za5 za6 za7 -"syn keyword asmx86Reg zd0 zd1 zd2 zd3 zd4 zd5 zd6 zd7 - -" MC68030 -"syn keyword asmx86Reg crp srp tc ac0 ac1 acusr tt0 tt1 mmusr - -" MC68040 -"syn keyword asmx86Reg dtt0 dtt1 itt0 itt1 urp - -" MC68851 registers -"syn keyword asmx86Reg cal val scc crp srp drp tc ac psr pcsr -"syn keyword asmx86Reg bac0 bac1 bac2 bac3 bac4 bac5 bac6 bac7 -"syn keyword asmx86Reg bad0 bad1 bad2 bad3 bad4 bad5 bad6 bad7 - -" MC68881/82 registers -"syn keyword asmx86Reg fp0 fp1 fp2 fp3 fp4 fp5 fp6 fp7 -"syn keyword asmx86Reg control status iaddr fpcr fpsr fpiar - - -"Not sure if this is the case for x86...... -" M68000 opcodes - order is important! -syn match asmx86Opcode "\" -syn match asmx86Opcode "\" -syn match asmx86Opcode "\" - -syn match asmx86Opcode "\" -syn match asmx86Opcode "\" -syn match asmx86Opcode "\" - -"" Main x86 branch instructions... - -syn match asmx86Opcode_br "\" -syn match asmx86Opcode_mv "\" -syn match asmx86Opcode_mv "\" -syn match asmx86Opcode_br "\" -syn match asmx86Opcode_mv "\" -syn match asmx86Opcode "\" - -syn match asmx86Opcode_mv "\" -syn match asmx86Opcode_mv "\" - -syn match asmx86Opcode "\" -syn match asmx86Opcode "\" -syn match asmx86Opcode "\" -syn match asmx86Opcode_mv "\" -syn match asmx86Opcode_mv "\" -syn match asmx86Opcode "\" - -syn match asmx86Opcode_mv "\" -syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -" syn match asmx86Opcode "\" -syn match hexNumber "$0x[0-9a-fA-F]\+\>" -syn match hexNumber "0x[0-9a-fA-F]\+\>" -syn match hexNumber "\<[0-9][0-9a-fA-F]*H\>" -syn match octNumber "@[0-7]\+\>" -syn match octNumber "\<[0-7]\+[QO]\>" -syn match binNumber "%[01]\+\>" -syn match binNumber "\<[01]\+B\>" -syn match decNumber "\<[0-9]\+D\=\>" -syn match floatE "_*E_*" contained -syn match floatExponent "_*E_*[-+]\=[0-9]\+" contained contains=floatE -syn match floatNumber "[-+]\=[0-9]\+_*E_*[-+]\=[0-9]\+" contains=floatExponent -syn match floatNumber "[-+]\=[0-9]\+\.[0-9]\+\(E[-+]\=[0-9]\+\)\=" contains=floatExponent -syn match floatNumber ":\([0-9a-f]\+_*\)\+" - -" Character string constants -"syn match asmx86StringError "'[ -~]*'" -"syn match asmx86StringError "'[ -~]*$" -"syn region asmx86String start="'" skip="''" end="'" oneline contains=asmx86CharError -syn match asmx86CharError "[^ -~]" contained - -" Immediate data -" syn match asmx86Immediate "#\$[0-9a-fA-F]\+" contains=hexNumber -" syn match asmx86Immediate "#[0-9][0-9a-fA-F]*H" contains=hexNumber -" syn match asmx86Immediate "#@[0-7]\+" contains=octNumber -" syn match asmx86Immediate "#[0-7]\+[QO]" contains=octNumber -" syn match asmx86Immediate "#%[01]\+" contains=binNumber -" syn match asmx86Immediate "#[01]\+B" contains=binNumber -" syn match asmx86Immediate "#[0-9]\+D\=" contains=decNumber -syn match asmx86Symbol "[a-z_?.][a-z0-9_?.$]*" contained -" syn match asmx86Immediate "#[a-z_?.][a-z0-9_?.]*" contains=asmx86Symbol - -" Special items for comments -syn keyword asmx86Todo contained TODO XXX FIXME CHANGED - -" Operators -syn match asmx86Operator "\.SIZEOF\." -syn match asmx86Operator "\.STARTOF\." -syn match asmx86Operator "<<" " shift left -syn match asmx86Operator ">>" " shift right -syn match asmx86Operator "&" " bit-wise logical and -syn match asmx86Operator "!" " bit-wise logical or -syn match asmx86Operator "!!" " exclusive or -syn match asmx86Operator "<>" " inequality -syn match asmx86Operator "=" " must be before other ops containing '=' -syn match asmx86Operator ">=" -syn match asmx86Operator "<=" -syn match asmx86Operator "==" " operand existance - used in macro definitions - -" Condition code style operators -syn match asmx86Operator "<[CV][CS]>" -syn match asmx86Operator "" -syn match asmx86Operator "" -syn match asmx86Operator "<[HM]I>" -syn match asmx86Operator "" -syn match asmx86Operator "" -syn match asmx86Operator "" - -" Include -syn match asmx86Include "\" -syn match asmx86Include display "^\s*#\s*include\>\s*["<]" contains=asmx86Included - - -" Comments -" syn match asmx86Comment ";.*" contains=asmx86Todo -" syn match asmx86Comment "#.*" contains=asmx86Todo -" syn match asmx86Comment "\s!.*"ms=s+1 contains=asmx86Todo -" syn match asmx86Comment "^\s*[*!].*" contains=asmx86Todo - -" Standard macros -syn match asmx86Cond "\" -syn match asmx86Cond "\" -syn match asmx86Cond "\" -syn match asmx86Cond "\" -syn match asmx86Repeat "\" -syn match asmx86Repeat "\" -syn match asmx86Repeat "\" -syn match asmx86Repeat "\" -syn match asmx86Repeat "\" - -" Macro definition -syn match asmx86Macro "\" -syn match asmx86Macro "\" -syn match asmx86Macro "\" -syn match asmx86MacroParam "\\[0-9]" - -" Conditional assembly -syn match asmx86PreCond "\" -syn match asmx86PreCond "\" -syn match asmx86PreCond "\" - -" Loop control -syn match asmx86PreCond "\" - -" Directives -syn match asmx86Directive "\" -syn match asmx86Directive "\" -syn match asmx86Directive "\" -syn match asmx86Directive "\" -syn match asmx86Directive "\<\(NO\)\=LIST\>" -syn match asmx86Directive "\" -syn match asmx86Directive "\" -syn match asmx86Directive "\" -syn match asmx86Directive "\" -syn match asmx86Directive "\<\(NO\)\=PAGE\>" -syn match asmx86Directive "\" -syn match asmx86Directive "\" -syn match asmx86Directive "\" -syn match asmx86Constraintconst "\.\(\(byte\)\|\(d\=word\)\)\>" - -syn case match - -" 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_asmx86_syntax_inits") - if version < 508 - let did_asmx86_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - " The default methods for highlighting. Can be overridden later - " Comment Constant Error Identifier PreProc Special Statement Todo Type - " - " Constant Boolean Character Number String - " Identifier Function - " PreProc Define Include Macro PreCondit - " Special Debug Delimiter SpecialChar SpecialComment Tag - " Statement Conditional Exception Keyword Label Operator Repeat - " Type StorageClass Structure Typedef - - HiLink asmx86Comment DarkGrey - HiLink asmx86Commentcpp DarkGrey - HiLink asmx86Commentc DarkGrey - HiLink asmx86Commentcxx DarkGrey - HiLink asmx86Commenthash DarkGrey - HiLink asmx86Todo Todo - - HiLink hexNumber Number " Constant - HiLink octNumber Number " Constant - HiLink binNumber Number " Constant - HiLink decNumber Number " Constant - HiLink floatNumber Number " Constant - HiLink floatExponent Number " Constant - HiLink floatE SpecialChar " Statement - "HiLink floatE Number " Constant - - HiLink asmx86Immediate Identifier " Statement - "HiLink asmx86Symbol Constant - - HiLink asmx86String String " Constant - HiLink asmx86Included String " Constant - HiLink asmx86CharError Error - HiLink asmx86StringError Error - - HiLink asmx86Reg Identifier - HiLink asmx86Operator Identifier - - HiLink asmx86Include Include " PreProc - HiLink asmx86Macro Macro " PreProc - HiLink asmx86PreProc PreProc " PreProc - HiLink asmx86MacroParam Keyword " Statement - - HiLink asmx86Directive Special - HiLink asmx86PreCond Special - - HiLink asmx86Constraint Keyword - HiLink asmx86Constraintconst Type - - - HiLink asmx86Opcode Keyword - HiLink asmx86Opcode_mv Special - HiLink asmx86Opcode_pre Todo - HiLink asmx86Opcode_br Macro - HiLink asmx86Opcode_io String - HiLink asmx86Opcode_o2 String - -" We have "normal" opcodes, "move" opcodes, "prefix" opcodes, and "branch" -" opcodes..... Prefixes are rare, and we should alert them VERY specially - - HiLink asmx86Cond Conditional " Statement - HiLink asmx86Repeat Repeat " Statement - - HiLink asmx86Label Type - delcommand HiLink -endif - -let b:current_syntax = "asmx86" - -" vim: ts=8 sw=2 diff --git a/dot.vim/syntax/conque_term.vim b/dot.vim/syntax/conque_term.vim deleted file mode 100644 index aabb017..0000000 --- a/dot.vim/syntax/conque_term.vim +++ /dev/null @@ -1,77 +0,0 @@ - -" ******************************************************************************************************************* -" 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 MySQLTableBar "|" contained -syn match MySQLNull " NULL " contained -syn match MySQLBool " YES " contained -syn match MySQLBool " NO " contained -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 MySQLNumber " \d\+ " contained -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/dot.vim/syntax/csv.vim b/dot.vim/syntax/csv.vim deleted file mode 100644 index 2a7c7ca..0000000 --- a/dot.vim/syntax/csv.vim +++ /dev/null @@ -1,181 +0,0 @@ -" A simple syntax highlighting, simply alternate colors between two -" adjacent columns -" Init {{{2 -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf8 -if version < 600 - syn clear -elseif exists("b:current_syntax") - finish -endif - -" Helper functions "{{{2 -fu! Warning(msg) "{{{3 - " Don't redraw, so we are not overwriting messages from the ftplugin - " script - "redraw! - echohl WarningMsg - echomsg "CSV Syntax:" . a:msg - echohl Normal -endfu - -fu! Esc(val, char) "{{2 - return '\V'.escape(a:val, '\\'.a:char).'\m' -endfu - -fu! CheckSaneSearchPattern() "{{{3 - let s:del_def = ',' - let s:col_def = '\%([^' . s:del_def . ']*' . s:del_def . '\|$\)' - - " First: - " Check for filetype plugin. This syntax script relies on the filetype - " plugin, else, it won't work properly. - redir => s:a |sil filetype | redir end - let s:a=split(s:a, "\n")[0] - if match(s:a, '\cplugin:off') > 0 - call Warning("No filetype support, only simple highlighting using" - \ . s:del_def . " as delimiter! See :h csv-installation") - endif - - " Check Comment setting - if !exists("g:csv_comment") - let b:csv_cmt = split(&cms, '%s') - else - let b:csv_cmt = split(g:csv_comment, '%s') - endif - - - " Second: Check for sane defaults for the column pattern - " Not necessary to check for fixed width columns - if exists("b:csv_fixed_width_cols") - return - endif - - - " Try a simple highlighting, if the defaults from the ftplugin - " don't exist - let s:col = exists("b:col") && !empty(b:col) ? b:col - \ : s:col_def - let s:del = exists("b:delimiter") && !empty(b:delimiter) ? b:delimiter - \ : s:del_def - let s:cmts = exists("b:csv_cmt") ? b:csv_cmt[0] : split(&cms, '&s')[0] - let s:cmte = exists("b:csv_cmt") && len(b:csv_cmt) == 2 ? b:csv_cmt[1] - \ : '' - - if line('$') > 1 && (!exists("b:col") || empty(b:col)) - " check for invalid pattern, ftplugin hasn't been loaded yet - call Warning("Invalid column pattern, using default pattern " . s:col_def) - endif -endfu - -" Syntax rules {{{2 -fu! DoHighlight() "{{{3 - if has("conceal") && !exists("g:csv_no_conceal") && - \ !exists("b:csv_fixed_width_cols") - " old val - "\ '\%(.\)\@=/ms=e,me=e contained conceal cchar=' . - " Has a problem with the last line! - exe "syn match CSVDelimiter /" . s:col . - \ '\n\=/ms=e,me=e contained conceal cchar=' . - \ (&enc == "utf-8" ? "│" : '|') - "exe "syn match CSVDelimiterEOL /" . s:del . - " \ '\?$/ contained conceal cchar=' . - " \ (&enc == "utf-8" ? "│" : '|') - hi def link CSVDelimiter Conceal - hi def link CSVDelimiterEOL Conceal - elseif !exists("b:csv_fixed_width_cols") - " The \%(.\)\@<= makes sure, the last char won't be concealed, - " if it isn't a delimiter - "exe "syn match CSVDelimiter /" . s:col . '\%(.\)\@<=/ms=e,me=e contained' - exe "syn match CSVDelimiter /" . s:col . '\n\=/ms=e,me=e contained' - "exe "syn match CSVDelimiterEOL /" . s:del . '\?$/ contained' - if has("conceal") - hi def link CSVDelimiter Conceal - hi def link CSVDelimiterEOL Conceal - else - hi def link CSVDelimiter Ignore - hi def link CSVDelimiterEOL Ignore - endif - endif " There is no delimiter for csv fixed width columns - - - if !exists("b:csv_fixed_width_cols") - exe 'syn match CSVColumnEven nextgroup=CSVColumnOdd /' - \ . s:col . '/ contains=CSVDelimiter,CSVDelimiterEOL' - exe 'syn match CSVColumnOdd nextgroup=CSVColumnEven /' - \ . s:col . '/ contains=CSVDelimiter,CSVDelimiterEOL' - - exe 'syn match CSVColumnHeaderEven nextgroup=CSVColumnHeaderOdd /\%1l' - \. s:col . '/ contains=CSVDelimiter,CSVDelimiterEOL' - exe 'syn match CSVColumnHeaderOdd nextgroup=CSVColumnHeaderEven /\%1l' - \. s:col . '/ contains=CSVDelimiter,CSVDelimiterEOL' - else - for i in range(len(b:csv_fixed_width_cols)) - let pat = '/\%' . b:csv_fixed_width_cols[i] . 'c.*' . - \ ((i == len(b:csv_fixed_width_cols)-1) ? '/' : - \ '\%' . b:csv_fixed_width_cols[i+1] . 'c/') - - let group = "CSVColumn" . (i%2 ? "Odd" : "Even" ) - let ngroup = "CSVColumn" . (i%2 ? "Even" : "Odd" ) - exe "syn match " group pat " nextgroup=" . ngroup - endfor - endif - " Comment regions - exe 'syn match CSVComment /'. Esc(s:cmts, '/'). '.*'. - \ (!empty(s:cmte) ? '\%('. Esc(s:cmte, '/'). '\)\?' - \: ''). '/' - hi def link CSVComment Comment -endfun - -fu! DoSyntaxDefinitions() "{{{3 - syn spell toplevel - - " Not really needed - syn case ignore - - if &t_Co < 88 - if !exists("b:csv_fixed_width_cols") - hi default CSVColumnHeaderOdd ctermfg=DarkRed ctermbg=15 - \ guibg=grey80 guifg=black term=underline cterm=standout,bold - \ gui=bold,underline - endif - hi default CSVColumnOdd ctermfg=DarkRed ctermbg=15 guibg=grey80 - \ guifg=black term=underline cterm=bold gui=underline - else - if !exists("b:csv_fixed_width_cols") - hi default CSVColumnHeaderOdd ctermfg=darkblue ctermbg=white - \ guibg=grey80 guifg=black cterm=standout,underline - \ gui=bold,underline - endif - hi default CSVColumnOdd ctermfg=darkblue ctermbg=white guibg=grey80 - \ guifg=black cterm=reverse,underline gui=underline - endif - - " ctermbg=8 should be safe, even in 8 color terms - if !exists("b:csv_fixed_width_cols") - hi default CSVColumnHeaderEven ctermfg=white ctermbg=darkgrey - \ guibg=grey50 guifg=black term=bold cterm=standout,underline - \ gui=bold,underline - endif - hi default CSVColumnEven ctermfg=white ctermbg=darkgrey guibg=grey50 - \ guifg=black term=bold cterm=underline gui=bold,underline -endfun - -" Main: {{{2 -" Make sure, we are using a sane, valid pattern for syntax -" highlighting -call CheckSaneSearchPattern() - -" Define all necessary syntax groups -call DoSyntaxDefinitions() - -" Highlight the file -call DoHighlight() - -" Set the syntax variable {{{2 -let b:current_syntax="csv" - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/dot.vim/syntax/haml.vim b/dot.vim/syntax/haml.vim deleted file mode 100644 index 4ffdf20..0000000 --- a/dot.vim/syntax/haml.vim +++ /dev/null @@ -1,107 +0,0 @@ -" Vim syntax file -" Language: Haml -" Maintainer: Tim Pope -" Filenames: *.haml - -if exists("b:current_syntax") - finish -endif - -if !exists("main_syntax") - let main_syntax = 'haml' -endif -let b:ruby_no_expensive = 1 - -runtime! syntax/html.vim -unlet! b:current_syntax -silent! syn include @hamlSassTop syntax/sass.vim -unlet! b:current_syntax -syn include @hamlRubyTop syntax/ruby.vim - -syn case match - -syn region rubyCurlyBlock start="{" end="}" contains=@hamlRubyTop contained containedin=rubyInterpolation -syn cluster hamlRubyTop add=rubyCurlyBlock - -syn cluster hamlComponent contains=hamlAttributes,hamlAttributesHash,hamlClassChar,hamlIdChar,hamlObject,hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable -syn cluster hamlEmbeddedRuby contains=hamlAttributesHash,hamlObject,hamlRuby,hamlRubyFilter -syn cluster hamlTop contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,hamlSassFilter,hamlComment,hamlHtmlComment - -syn match hamlBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=hamlTag,hamlClassChar,hamlIdChar,hamlRuby,hamlPlainChar,hamlInterpolatable - -syn match hamlTag "%\w\+" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent -syn region hamlAttributes matchgroup=hamlAttributesDelimiter start="(" end=")" contained contains=htmlArg,hamlAttributeString,hamlAttributeVariable,htmlEvent,htmlCssDefinition nextgroup=@hamlComponent -syn region hamlAttributesHash matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent -syn region hamlObject matchgroup=hamlObjectDelimiter start="\[" end="\]" contained contains=@hamlRubyTop nextgroup=@hamlComponent -syn match hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable -syn match hamlSelfCloser "/" contained -syn match hamlClassChar "\." contained nextgroup=hamlClass -syn match hamlIdChar "#{\@!" contained nextgroup=hamlId -syn match hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent -syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent -syn region hamlDocType start="^\s*!!!" end="$" - -syn region hamlRuby matchgroup=hamlRubyOutputChar start="[!&]\==\|\~" end="$" contained contains=@hamlRubyTop keepend -syn region hamlRuby matchgroup=hamlRubyChar start="-" end="$" contained contains=@hamlRubyTop keepend -syn match hamlPlainChar "\\" contained -syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="!\===\|!=\@!" end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape,@hamlHtmlTop -syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="&==\|&=\@!" end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape -syn region hamlInterpolation matchgroup=hamlInterpolationDelimiter start="#{" end="}" contains=@hamlRubyTop -syn match hamlInterpolationEscape "\\\@" contained contains=@hamlRubyTop - -syn region hamlAttributeString start=+\%(=\s*\)\@<='+ skip=+\%(\\\\\)*\\'+ end=+'+ contains=hamlInterpolation,hamlInterpolationEscape -syn region hamlAttributeString start=+\%(=\s*\)\@<="+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=hamlInterpolation,hamlInterpolationEscape -syn match hamlAttributeVariable "\%(=\s*\)\@<=\%(@@\=\|\$\)\=\w\+" contained - -syn match hamlHelper "\[^]]*]" contained containedin=hamlHtmlComment - -hi def link hamlSelfCloser Special -hi def link hamlDespacer Special -hi def link hamlClassChar Special -hi def link hamlIdChar Special -hi def link hamlTag Special -hi def link hamlClass Type -hi def link hamlId Identifier -hi def link hamlPlainChar Special -hi def link hamlInterpolatableChar hamlRubyChar -hi def link hamlRubyOutputChar hamlRubyChar -hi def link hamlRubyChar Special -hi def link hamlInterpolationDelimiter Delimiter -hi def link hamlInterpolationEscape Special -hi def link hamlAttributeString String -hi def link hamlAttributeVariable Identifier -hi def link hamlDocType PreProc -hi def link hamlFilter PreProc -hi def link hamlAttributesDelimiter Delimiter -hi def link hamlObjectDelimiter Delimiter -hi def link hamlHelper Function -hi def link hamlHtmlComment hamlComment -hi def link hamlComment Comment -hi def link hamlIEConditional SpecialComment -hi def link hamlError Error - -let b:current_syntax = "haml" - -if main_syntax == "haml" - unlet main_syntax -endif - -" vim:set sw=2: diff --git a/dot.vim/syntax/javascript.vim b/dot.vim/syntax/javascript.vim deleted file mode 100644 index 3ba7fca..0000000 --- a/dot.vim/syntax/javascript.vim +++ /dev/null @@ -1,246 +0,0 @@ -" Vim syntax file -" Language: JavaScript -" Maintainer: Yi Zhao (ZHAOYI) -" Last Change: June 4, 2009 -" Version: 0.7.7 -" Changes: Add "undefined" as a type keyword -" -" 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 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 support start -if !exists("javascript_ignore_javaScriptdoc") - syntax case ignore - - "" syntax coloring for javadoc comments (HTML) - "syntax include @javaHtml :p:h/html.vim - "unlet b:current_syntax - - syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold - syntax match javaScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite - syntax match javaScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>" - 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 javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline -syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/ -syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ -syntax match javaScriptLabel /\(?\s*\)\@/ - 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,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 /\/ nextgroup=javaScriptFuncName skipwhite - syntax match javaScriptOpAssign /=\@= 508 || !exists("did_javascript_syn_inits") - if version < 508 - let did_javascript_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink javaScriptComment Comment - HiLink javaScriptLineComment Comment - HiLink javaScriptDocComment Comment - HiLink javaScriptCommentTodo Todo - HiLink javaScriptCvsTag Function - HiLink javaScriptDocTags Special - HiLink javaScriptDocSeeTag Function - HiLink javaScriptDocParam Function - HiLink javaScriptStringS String - HiLink javaScriptStringD String - HiLink javaScriptRegexpString String - 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 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/dot.vim/syntax/less.vim b/dot.vim/syntax/less.vim deleted file mode 100644 index 95c6260..0000000 --- a/dot.vim/syntax/less.vim +++ /dev/null @@ -1,305 +0,0 @@ -" Vim syntax file -" Language: LESS Cascading Style Sheets -" Maintainer: Leaf Corcoran -" Modifier: Bryan J Swift -" URL: http://leafo.net/lessphp/vim/less.vim -" URL: http://gist.github.com/161047 -" Last Change: 2009 August 4 -" LESS by Leaf Corcoran -" CSS2 by Nikolai Weibull -" Full CSS2, HTML4 support by Yeti - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish -endif - let main_syntax = 'less' -endif - -syn case ignore - - - -syn keyword cssTagName abbr acronym address applet area a b base -syn keyword cssTagName basefont bdo big blockquote body br button -syn keyword cssTagName caption center cite code col colgroup dd del -syn keyword cssTagName dfn dir div dl dt em fieldset font form frame -syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i -syn keyword cssTagName iframe img input ins isindex kbd label legend li -syn keyword cssTagName link map menu meta noframes noscript ol optgroup -syn keyword cssTagName option p param pre q s samp script select small -syn keyword cssTagName span strike strong style sub sup tbody td -syn keyword cssTagName textarea tfoot th thead title tr tt ul u var -syn match cssTagName "\" -syn match cssTagName "\*" - -syn match cssTagName "@page\>" nextgroup=cssDefinition - -syn match cssSelectorOp "[+>.]" -syn match cssSelectorOp2 "[~|]\?=" contained -syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ - -try -syn match cssIdentifier "#[A-Za-zÀ-ÿ_@][A-Za-zÀ-ÿ0-9_@-]*" -catch /^.*/ -syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*" -endtry - -syn match cssMedia "@media\>" nextgroup=cssMediaType skipwhite skipnl -syn keyword cssMediaType contained screen print aural braile embosed handheld projection ty tv all nextgroup=cssMediaComma,cssMediaBlock skipwhite skipnl -syn match cssMediaComma "," nextgroup=cssMediaType skipwhite skipnl -syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssError,cssComment,cssDefinition,cssURL,cssUnicodeEscape,cssIdentifier - -syn match cssValueInteger "[-+]\=\d\+" -syn match cssValueNumber "[-+]\=\d\+\(\.\d*\)\=" -syn match cssValueLength "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)" - -syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)" -syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" -syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" - -syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl -syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr -syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>" -syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline -syn keyword cssFontDescriptorAttr contained all -syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend -syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+" -syn match cssUnicodeRange contained "U+\x\+-\x\+" - -syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow -" FIXME: These are actually case-insentivie too, but (a) specs recommend using -" mixed-case (b) it's hard to highlight the word `Background' correctly in -" all situations -syn case match -syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background -syn case ignore -syn match cssColor contained "\" -syn match cssColor contained "\" -syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" -syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" -"syn match cssColor contained "\" - -syn keyword cssCommonAttr contained auto none inherit -syn keyword cssCommonAttr contained top bottom -syn keyword cssCommonAttr contained medium normal - -syn match cssFontProp contained "\\(-\(family\|style\|variant\|weight\|size\(-adjust\)\=\|stretch\)\>\)\=" -syn match cssFontAttr contained "\<\(sans-\)\=\" -syn match cssFontAttr contained "\\(-\(caps\|caption\)\>\)\=" -syn match cssFontAttr contained "\" -syn match cssFontAttr contained "\" -syn match cssFontAttr contained "\" -syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\|status-bar\)-\)\=\(condensed\|expanded\)\>" -syn keyword cssFontAttr contained cursive fantasy monospace italic oblique -syn keyword cssFontAttr contained bold bolder lighter larger smaller -syn keyword cssFontAttr contained icon menu -syn match cssFontAttr contained "\" -syn keyword cssFontAttr contained large smaller larger -syn keyword cssFontAttr contained narrower wider - -syn keyword cssColorProp contained color -syn match cssColorProp contained "\" -syn match cssColorAttr contained "\" - -syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>" -syn match cssTextAttr contained "\" -syn match cssTextAttr contained "\" -syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>" -syn keyword cssTextAttr contained underline overline blink sub super middle -syn keyword cssTextAttr contained capitalize uppercase lowercase center justify baseline sub super - -syn match cssBoxProp contained "\<\(margin\|padding\|border\)\(-\(top\|right\|bottom\|left\)\)\=\>" -syn match cssBoxProp contained "\" -syn match cssBoxProp contained "\<\(width\|z-index\)\>" -syn match cssBoxProp contained "\<\(min\|max\)-\(width\|height\)\>" -syn keyword cssBoxProp contained width height float clear overflow clip visibility -syn keyword cssBoxAttr contained thin thick both -syn keyword cssBoxAttr contained dotted dashed solid double groove ridge inset outset -syn keyword cssBoxAttr contained hidden visible scroll collapse - -syn keyword cssGeneratedContentProp contained content quotes -syn match cssGeneratedContentProp contained "\" -syn match cssGeneratedContentProp contained "\" -syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>" -syn match cssAuralAttr contained "\" -syn match cssGeneratedContentAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>" -syn match cssGeneratedContentAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>" -syn match cssGeneratedContentAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>" -syn keyword cssGeneratedContentAttr contained disc circle square hebrew armenian georgian -syn keyword cssGeneratedContentAttr contained inside outside - -syn match cssPagingProp contained "\" -syn keyword cssPagingProp contained size marks inside orphans widows -syn keyword cssPagingAttr contained landscape portrait crop cross always avoid - -syn keyword cssUIProp contained cursor -syn match cssUIProp contained "\" -syn match cssUIAttr contained "\<[ns]\=[ew]\=-resize\>" -syn keyword cssUIAttr contained default crosshair pointer move wait help -syn keyword cssUIAttr contained thin thick -syn keyword cssUIAttr contained dotted dashed solid double groove ridge inset outset -syn keyword cssUIAttr contained invert - -syn match cssRenderAttr contained "\" -syn match cssRenderProp contained "\<\(display\|marker-offset\|unicode-bidi\|white-space\|list-item\|run-in\|inline-table\)\>" -syn keyword cssRenderProp contained position top bottom direction -syn match cssRenderProp contained "\<\(left\|right\)\>" -syn keyword cssRenderAttr contained block inline compact -syn match cssRenderAttr contained "\" -syn keyword cssRenderAttr contained static relative absolute fixed -syn keyword cssRenderAttr contained ltr rtl embed bidi-override pre nowrap -syn match cssRenderAttr contained "\" - -syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>" -syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numerals\)\)\=\)\>" -syn keyword cssAuralProp contained volume during azimuth elevation stress richness -syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>" -syn keyword cssAuralAttr contained silent -syn match cssAuralAttr contained "\" -syn keyword cssAuralAttr contained non mix -syn match cssAuralAttr contained "\<\(left\|right\)-side\>" -syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>" -syn keyword cssAuralAttr contained leftwards rightwards behind -syn keyword cssAuralAttr contained below level above higher -syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\)\>" -syn keyword cssAuralAttr contained faster slower -syn keyword cssAuralAttr contained male female child code digits continuous - -syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\|speak-header\)\>" -syn keyword cssTableAttr contained fixed collapse separate show hide once always - - - -syn match lessComment "//.*$" contains=@Spell -syn match lessVariable "@[A-Za-z_-][A-Za-z0-9_-]*" contained -syn region lessVariableDefinition start="^@" end=";" contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssDefinition,cssClassName,cssTagName,cssIdentifier,lessComment,lessVariable,lessFunction - -" captures both the definition and the call -syn region lessFunction matchgroup=lessFuncDef start="@[A-Za-z_-][A-Za-z0-9_-]*(" end=")" contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssDefinition,cssClassName,cssTagName,cssIdentifier,lessComment,lessVariable,lessFunction - - - - - -" FIXME: This allows cssMediaBlock before the semicolon, which is wrong. -syn region cssInclude start="@import" end=";" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType -syn match cssBraces contained "[{}]" -syn match cssError contained "{@<>" -syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssDefinition,cssClassName,cssTagName,cssIdentifier,lessComment,lessVariable,lessFunction -" syn match cssBraceError "}" - -syn match cssPseudoClass ":\S*" contains=cssPseudoClassId,cssUnicodeEscape -syn keyword cssPseudoClassId contained link visited active hover focus before after left right -syn match cssPseudoClassId contained "\" -syn region cssPseudoClassLang matchgroup=cssPseudoClassId start=":lang(" end=")" oneline - -syn region cssComment start="/\*" end="\*/" contains=@Spell - -syn match cssUnicodeEscape "\\\x\{1,6}\s\?" -syn match cssSpecialCharQQ +\\"+ contained -syn match cssSpecialCharQ +\\'+ contained -syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ -syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ -syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" - - - - -if main_syntax == "css" - syn sync minlines=10 -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_less_syn_inits") - if version < 508 - let did_less_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink lessComment Comment - HiLink lessVariable Special - HiLink lessFuncDef Function - HiLink cssComment Comment - HiLink cssTagName Statement - HiLink cssSelectorOp Special - HiLink cssSelectorOp2 Special - HiLink cssFontProp StorageClass - HiLink cssColorProp storageClass - HiLink cssTextProp StorageClass - HiLink cssBoxProp StorageClass - HiLink cssRenderProp StorageClass - HiLink cssAuralProp StorageClass - HiLink cssRenderProp StorageClass - HiLink cssGeneratedContentProp StorageClass - HiLink cssPagingProp StorageClass - HiLink cssTableProp StorageClass - HiLink cssUIProp StorageClass - HiLink cssFontAttr Type - HiLink cssColorAttr Type - HiLink cssTextAttr Type - HiLink cssBoxAttr Type - HiLink cssRenderAttr Type - HiLink cssAuralAttr Type - HiLink cssGeneratedContentAttr Type - HiLink cssPagingAttr Type - HiLink cssTableAttr Type - HiLink cssUIAttr Type - HiLink cssCommonAttr Type - HiLink cssPseudoClassId PreProc - HiLink cssPseudoClassLang Constant - HiLink cssValueLength Number - HiLink cssValueInteger Number - HiLink cssValueNumber Number - HiLink cssValueAngle Number - HiLink cssValueTime Number - HiLink cssValueFrequency Number - HiLink cssFunction Constant - HiLink cssURL String - HiLink cssFunctionName Function - HiLink cssColor Constant - HiLink cssIdentifier Function - HiLink cssInclude Include - HiLink cssImportant Special - HiLink cssBraces SpecialChar - HiLink cssBraceError Error - HiLink cssError Error - HiLink cssInclude Include - HiLink cssUnicodeEscape Special - HiLink cssStringQQ String - HiLink cssStringQ String - HiLink cssMedia Special - HiLink cssMediaType Special - HiLink cssMediaComma Normal - HiLink cssFontDescriptor Special - HiLink cssFontDescriptorFunction Constant - HiLink cssFontDescriptorProp StorageClass - HiLink cssFontDescriptorAttr Type - HiLink cssUnicodeRange Constant - HiLink cssClassName Function - delcommand HiLink -endif - -let b:current_syntax = "less" - -if main_syntax == 'less' - unlet main_syntax -endif - - -" vim: ts=8 - diff --git a/dot.vim/syntax/lyx.vim b/dot.vim/syntax/lyx.vim deleted file mode 100644 index f98f941..0000000 --- a/dot.vim/syntax/lyx.vim +++ /dev/null @@ -1,17 +0,0 @@ -syntax clear - -syntax keyword lyxCommand \\layout -syntax keyword lyxCommand \\the_end -syntax keyword lyxKey LatexCommand ERT Graphics Float FloatList -syntax keyword lyxKey status Open Closed -syntax keyword lyxKey wide collapsed -syntax keyword lyxBinary true false -syntax keyword lyxBinary Open Close -syntax region lyxInset start=/\\begin_inset/ end=/\\end_inset/ contains=ALL fold -syntax region lyxString start=/"/ end=/"/ - -highlight link lyxCommand Keyword -highlight link lyxKey Keyword -highlight link lyxString String -highlight link lyxInset Comment -highlight link lyxBinary Boolean diff --git a/dot.vim/syntax/nimrod.vim b/dot.vim/syntax/nimrod.vim deleted file mode 100644 index 9f4a9d3..0000000 --- a/dot.vim/syntax/nimrod.vim +++ /dev/null @@ -1,187 +0,0 @@ -" Vim syntax file -" Language: Nimrod -" Maintainer: Kearn Holliday (thekearnman at gmail dot com) -" Updated: 2009-05-15 -" -" Options to control nimrod syntax highlighting: -" -" For highlighted numbers: -" - let nimrod_highlight_numbers = 1 -" -" For highlighted builtin functions: -" - let nimrod_highlight_builtins = 1 -" -" For highlighted standard exceptions: -" - let nimrod_highlight_exceptions = 1 -" -" Highlight erroneous whitespace: -" - let nimrod_highlight_space_errors = 1 -" -" If you want all possible nimrod highlighting (the same as setting the -" preceding options): -" -" let nimrod_highlight_all = 1 -" - -" 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 - -syn region nimrodBrackets contained extend keepend matchgroup=Bold start=+\(\\\)\@" - syn match nimrodNumber "\<\d\+[LljJ]\=\>" - syn match nimrodNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" - syn match nimrodNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>" - syn match nimrodNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" -endif - -if exists("nimrod_highlight_builtins") - " builtin functions, types and objects, not really part of the syntax - syn keyword nimrodBuiltin int int8 int16 int32 int64 float float32 float64 bool - syn keyword nimrodBuiltin char string cstring pointer range array openarray seq - syn keyword nimrodBuiltin set Byte Natural Positive TObject PObject Conversion TResult TAddress - syn keyword nimrodBuiltin BiggestInt BiggestFloat cchar cschar cshort cint - syn keyword nimrodBuiltin clong clonglong cfloat cdouble clongdouble - syn keyword nimrodBuiltin cstringArray TEndian PFloat32 PFloat64 PInt64 PInt32 - syn keyword nimrodBuiltin TGC_Strategy TFile TFileMode TFileHandle isMainModule - syn keyword nimrodBuiltin CompileDate CompileTime NimrodVersion NimrodMajor - syn keyword nimrodBuiltin NimrodMinor NimrodPatch cpuEndian hostOS hostCPU inf - syn keyword nimrodBuiltin neginf nan QuitSuccess QuitFailure dbgLineHook stdin - syn keyword nimrodBuiltin stdout stderr defined new high low sizeof succ pred - syn keyword nimrodBuiltin inc dec newSeq len incl excl card ord chr ze ze64 - syn keyword nimrodBuiltin toU8 toU16 toU32 abs min max add repr - syn match nimrodBuiltin "\" - syn keyword nimrodBuiltin toFloat toBiggestFloat toInt toBiggestInt addQuitProc - syn keyword nimrodBuiltin copy setLen newString zeroMem copyMem moveMem - syn keyword nimrodBuiltin equalMem alloc alloc0 realloc dealloc setLen assert - syn keyword nimrodBuiltin swap getRefcount getCurrentException Msg - syn keyword nimrodBuiltin getOccupiedMem getFreeMem getTotalMem isNil seqToPtr - syn keyword nimrodBuiltin find pop GC_disable GC_enable GC_fullCollect - syn keyword nimrodBuiltin GC_setStrategy GC_enableMarkAnd Sweep - syn keyword nimrodBuiltin GC_disableMarkAnd Sweep GC_getStatistics GC_ref - syn keyword nimrodBuiltin GC_ref GC_ref GC_unref GC_unref GC_unref quit - syn keyword nimrodBuiltin OpenFile OpenFile CloseFile EndOfFile readChar - syn keyword nimrodBuiltin FlushFile readFile write readLine writeln writeln - syn keyword nimrodBuiltin getFileSize ReadBytes ReadChars readBuffer writeBytes - syn keyword nimrodBuiltin writeChars writeBuffer setFilePos getFilePos - syn keyword nimrodBuiltin fileHandle countdown countup items lines -endif - -if exists("nimrod_highlight_exceptions") - " builtin exceptions and warnings - syn keyword nimrodException E_Base EAsynch ESynch ESystem EIO EOS - syn keyword nimrodException ERessourceExhausted EArithmetic EDivByZero - syn keyword nimrodException EOverflow EAccessViolation EAssertionFailed - syn keyword nimrodException EControlC EInvalidValue EOutOfMemory EInvalidIndex - syn keyword nimrodException EInvalidField EOutOfRange EStackOverflow - syn keyword nimrodException ENoExceptionToReraise EInvalidObjectAssignment - syn keyword nimrodException EInvalidObject -endif - -if exists("nimrod_highlight_space_errors") - " trailing whitespace - syn match nimrodSpaceError display excludenl "\S\s\+$"ms=s+1 - " mixed tabs and spaces - syn match nimrodSpaceError display " \+\t" - syn match nimrodSpaceError display "\t\+ " -endif - -syn sync match nimrodSync grouphere NONE "):$" -syn sync maxlines=200 -syn sync minlines=2000 - -if version >= 508 || !exists("did_nimrod_syn_inits") - if version <= 508 - let did_nimrod_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - " The default methods for highlighting. Can be overridden later - HiLink nimrodBrackets Operator - HiLink nimrodStatement Statement - HiLink nimrodFunction Function - HiLink nimrodConditional Conditional - HiLink nimrodRepeat Repeat - HiLink nimrodString String - HiLink nimrodRawString String - HiLink nimrodEscape Special - HiLink nimrodOperator Operator - HiLink nimrodPreCondit PreCondit - HiLink nimrodComment Comment - HiLink nimrodTodo Todo - HiLink nimrodDecorator Define - if exists("nimrod_highlight_numbers") - HiLink nimrodNumber Number - endif - if exists("nimrod_highlight_builtins") - HiLink nimrodBuiltin Number - endif - if exists("nimrod_highlight_exceptions") - HiLink nimrodException Exception - endif - if exists("nimrod_highlight_space_errors") - HiLink nimrodSpaceError Error - endif - - delcommand HiLink -endif - -let b:current_syntax = "nimrod" - - diff --git a/dot.vim/syntax/notmuch-compose.vim b/dot.vim/syntax/notmuch-compose.vim deleted file mode 100644 index 19adb75..0000000 --- a/dot.vim/syntax/notmuch-compose.vim +++ /dev/null @@ -1,7 +0,0 @@ -runtime! syntax/mail.vim - -syntax region nmComposeHelp contains=nmComposeHelpLine start='^Notmuch-Help:\%1l' end='^\(Notmuch-Help:\)\@!' -syntax match nmComposeHelpLine /Notmuch-Help:/ contained - -highlight link nmComposeHelp Include -highlight link nmComposeHelpLine Error diff --git a/dot.vim/syntax/notmuch-folders.vim b/dot.vim/syntax/notmuch-folders.vim deleted file mode 100644 index 9477f86..0000000 --- a/dot.vim/syntax/notmuch-folders.vim +++ /dev/null @@ -1,12 +0,0 @@ -" notmuch folders mode syntax file - -syntax region nmFoldersCount start='^' end='\%10v' -syntax region nmFoldersName start='\%11v' end='\%31v' -syntax match nmFoldersSearch /([^()]\+)$/ - -highlight link nmFoldersCount Statement -highlight link nmFoldersName Type -highlight link nmFoldersSearch String - -highlight CursorLine term=reverse cterm=reverse gui=reverse - diff --git a/dot.vim/syntax/notmuch-git-diff.vim b/dot.vim/syntax/notmuch-git-diff.vim deleted file mode 100644 index 6f15fdc..0000000 --- a/dot.vim/syntax/notmuch-git-diff.vim +++ /dev/null @@ -1,26 +0,0 @@ -syn match diffRemoved "^-.*" -syn match diffAdded "^+.*" - -syn match diffSeparator "^---$" -syn match diffSubname " @@..*"ms=s+3 contained -syn match diffLine "^@.*" contains=diffSubname - -syn match diffFile "^diff .*" -syn match diffNewFile "^+++ .*" -syn match diffOldFile "^--- .*" - -hi def link diffOldFile diffFile -hi def link diffNewFile diffFile - -hi def link diffFile Type -hi def link diffRemoved Special -hi def link diffAdded Identifier -hi def link diffLine Statement -hi def link diffSubname PreProc - -syntax match gitDiffStatLine /^ .\{-}\zs[+-]\+$/ contains=gitDiffStatAdd,gitDiffStatDelete -syntax match gitDiffStatAdd /+/ contained -syntax match gitDiffStatDelete /-/ contained - -hi def link gitDiffStatAdd diffAdded -hi def link gitDiffStatDelete diffRemoved diff --git a/dot.vim/syntax/notmuch-search.vim b/dot.vim/syntax/notmuch-search.vim deleted file mode 100644 index f458d77..0000000 --- a/dot.vim/syntax/notmuch-search.vim +++ /dev/null @@ -1,12 +0,0 @@ -syntax region nmSearch start=/^/ end=/$/ oneline contains=nmSearchDate -syntax match nmSearchDate /^.\{-13}/ contained nextgroup=nmSearchNum -syntax match nmSearchNum /.\{-4}/ contained nextgroup=nmSearchFrom -syntax match nmSearchFrom /.\{-21}/ contained nextgroup=nmSearchSubject -syntax match nmSearchSubject /.\{0,}\(([^()]\+)$\)\@=/ contained nextgroup=nmSearchTags -syntax match nmSearchTags /.\+$/ contained - -highlight link nmSearchDate Statement -highlight link nmSearchNum Type -highlight link nmSearchFrom Include -highlight link nmSearchSubject Normal -highlight link nmSearchTags String diff --git a/dot.vim/syntax/notmuch-show.vim b/dot.vim/syntax/notmuch-show.vim deleted file mode 100644 index c3a98b7..0000000 --- a/dot.vim/syntax/notmuch-show.vim +++ /dev/null @@ -1,24 +0,0 @@ -" notmuch show mode syntax file - -syntax cluster nmShowMsgDesc contains=nmShowMsgDescWho,nmShowMsgDescDate,nmShowMsgDescTags -syntax match nmShowMsgDescWho /[^)]\+)/ contained -syntax match nmShowMsgDescDate / ([^)]\+[0-9]) / contained -syntax match nmShowMsgDescTags /([^)]\+)$/ contained - -syntax cluster nmShowMsgHead contains=nmShowMsgHeadKey,nmShowMsgHeadVal -syntax match nmShowMsgHeadKey /^[^:]\+: / contained -syntax match nmShowMsgHeadVal /^\([^:]\+: \)\@<=.*/ contained - -syntax cluster nmShowMsgBody contains=@nmShowMsgBodyMail,@nmShowMsgBodyGit -syntax include @nmShowMsgBodyMail syntax/mail.vim - -silent! syntax include @nmShowMsgBodyGit syntax/notmuch-git-diff.vim - -highlight nmShowMsgDescWho term=reverse cterm=reverse gui=reverse -highlight link nmShowMsgDescDate Type -highlight link nmShowMsgDescTags String - -highlight link nmShowMsgHeadKey Macro -"highlight link nmShowMsgHeadVal NONE - -highlight Folded term=reverse ctermfg=LightGrey ctermbg=Black guifg=LightGray guibg=Black diff --git a/dot.vim/syntax/opa.vim b/dot.vim/syntax/opa.vim deleted file mode 100644 index eb62ea9..0000000 --- a/dot.vim/syntax/opa.vim +++ /dev/null @@ -1,165 +0,0 @@ -" Vim syntax file -" Language: OPA -" Filenames: *.opa -" Maintainers: Raja Boujbel - -if version < 600 - syntax clear -elseif exists("b:current_syntax") && b:current_syntax == "opa" - finish -endif - -syn case match - -syn spell default - -syn keyword opaType int list char string option float void bool -syn keyword opaIf if then else -syn keyword opaMatch match with end -syn keyword opaKeywords do type and rec as -syn keyword opaPackage import import-plugin package -syn keyword opaDatabase database db -syn keyword opaParser parser -syn keyword opaCss css - -syn region opaCodeinString matchgroup=opaKeywords start=+[^\\]{+ matchgroup=opaKeywords end=+}+ containedin=opaString,opaHtml contains=ALL -syn region opaString start=+"+ skip=+\\"+ end=+"+ -syn region opaHtml start=+<[^:]\S+ skip=+->+ end=+>+ contains=opaColor,opaString - -syn match opaConstructor "\[\s*\]" -syn match opaBypass "%%" - -syn match opaFunDef "->" -syn match opaRefAssign "<-" -syn match opaEndStatement ";;" -syn match opaSemiColon ";" -syn match opaPipe "|" -syn match opaAffect "=" -syn match opaCoerce ":" -syn match opaDots "\.\.\." -syn match opaUnderscore "\<_\>" -syn match opaOperator "|>" -syn match opaOperator "+>" -syn match opaOperator "<+>" -syn match opaOperator "++" -syn match opaOperator "\^" -syn match opaOperator ">=" -syn match opaOperator "<=" -syn match opaOperator "\<<\>" -syn match opaOperator "\<>\>" -syn match opaDb "@" -syn match opaDb "?" -syn match opaHtmlIdentifier "#" - -syn match opaModule "\<\u\(\w\+\.\?\)\?" - -syn match opaDirective "@\w\+\(_\w\+\)\?" containedin=ALLBUT,opaComment,opaOneLineComent -syn match opaHtmlIdentifier "#\l\+\(_\w\+\)\?" containedin=ALLBUT,opaComment,opaOneLineComent,opaString - -syn region opaComment start=+/\*+ end=+\*/+ contains=@SpellopaComment,opaOneLineComent -syn match opaOneLineComent "//.*$" contains=@Spell -syn keyword opaTodo TODO FIXME XXX containedin=opaComment,opaOneLineComent - -syn match opaNumber "\<-\=\d\(_\|\d\)*[l|L|n]\?\>" -syn match opaNumber "\<-\=0[x|X]\(\x\|_\)\+[l|L|n]\?\>" -syn match opaNumber "\<-\=0[o|O]\(\o\|_\)\+[l|L|n]\?\>" -syn match opaNumber "\<-\=0[b|B]\([01]\|_\)\+[l|L|n]\?\>" -syn match opaFloat "\<-\=\d\(_\|\d\)*\.\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>" -syn match opaColor "\#\x\{6}\|\#\x\{6}" - -" Char definition according lexer defintion -syn match opaChar "'.'\|'\\[\'nbtr]'\|'\\\d\+'" - -syn match opaBraceErr "}" -syn match opaDblBraceErr "}}" -syn match opaBrackErr "\]" -syn match opaParenErr ")" -syn match opaHtmlErr "" -syn match opaBypassErr "%%" -syn match opaThenErr "\" -syn match opaEndErr "\" - -" try to include html syntax -" non concluant : opa syntax est inclu dans html syntax -" syn include @Html syntax/html.vim -" -syn region opaEncl transparent matchgroup=opaKeywords start="(" matchgroup=opaKeywords end=")" contains=ALLBUT,opaParenErr -syn region opaEncl transparent matchgroup=opaKeywords start="{{" matchgroup=opaKeywords end="}}" contains=ALLBUT,opaBraceErr -syn region opaEncl transparent matchgroup=opaKeywords start="{" matchgroup=opaKeywords end="}" contains=ALLBUT,opaBraceErr -syn region opaEnclBrack transparent matchgroup=opaKeywords start="\[" matchgroup=opaKeywords end="\]" contains=ALLBUT,opaBrackErr -syn region opaEncl transparent matchgroup=opaKeywords start="<>" matchgroup=opaKeywords end="" contains=ALLBUT,opaHtmlErr,opaModule -syn region opaEncl transparent matchgroup=opaKeywords start="%%" matchgroup=opaKeywords end="%%" contains=ALLBUT,opaBypassErr -syn region opaBegin transparent matchgroup=opaKeywords start="\" matchgroup=opaKeywords end="\" contains=ALLBUT,opaEndErr -syn region opaIf transparent matchgroup=opaKeywords start="\" matchgroup=opaKeywords end="\" contains=ALLBUT,opaThenErr - - -syn match opaDbIdentifier "/\w\+\(\(/\w\+\|\[.\+]\)\)*" contains=opaString,opaEnclBrack -syn match opaServer "server\(\s\|\n\|\r\)*=" - -syn sync minlines=50 -syn sync maxlines=500 - -if !exists("did_opa_syntax_inits") - let did_opa_syntax_inits = 1 - command -nargs=+ HiLink hi link -else - command -nargs=+ HiLink hi def link -endif - - -HiLink opaComment Comment -HiLink opaOneLineComent Comment -HiLink opaTodo Todo - -HiLink opaString String -HiLink opaStringinString String - -HiLink opaModule Include - -HiLink opaType Type - -HiLink opaKeywords Keyword -HiLink opaMatch Keyword -HiLink opaIf Keyword -HiLink opaDb Keyword -HiLink opaDatabase Keyword -HiLink opaServer Keyword -HiLink opaParser Keyword -HiLink opaCss Keyword -HiLink opaPackage Keyword - -HiLink opaFunDef Keyword -HiLink opaRefAssign Keyword -HiLink opaEndStatement Keyword -HiLink opaPipe Keyword -HiLink opaAffect Keyword -HiLink opaCoerce Keyword -HiLink opaSemiColon Keyword -HiLink opaDots Keyword -HiLink opaUnderscore Keyword -HiLink opaOperator Keyword - - -HiLink opaNumber Number -HiLink opaFloat Float -HiLink opaColor Number -HiLink opaChar Character - -HiLink opaConstructor Constant - -HiLink opaBraceErr Error -HiLink opaBrackErr Error -HiLink opaParenErr Error -HiLink opaHtmlErr Error -HiLink opaThenErr Error -HiLink opaEndErr Error - -HiLink opaHtml Special - -HiLink opaDirective Identifier -HiLink opaDbIdentifier Identifier -HiLink opaHtmlIdentifier Identifier - -delcommand HiLink - -let b:current_syntax = "opa" diff --git a/dot.vim/syntax/opajs.vim b/dot.vim/syntax/opajs.vim deleted file mode 100644 index 4383314..0000000 --- a/dot.vim/syntax/opajs.vim +++ /dev/null @@ -1,166 +0,0 @@ -" Vim syntax file -" Language: OPAJS -" Filenames: *.opa *.js.opa -" Maintainers: Raja Boujbel - -if version < 600 - syntax clear -elseif exists("b:current_syntax") && b:current_syntax == "opajs" - finish -endif - -syn case match - -syn spell default - -" Opa is case-sensitive -syn case match - -syn keyword opajsType int list string option float void bool -syn keyword opajsIf if else -syn keyword opajsMatch match -syn keyword opajsKeywords type and recursive as module -syn keyword opajsPackage import import-plugin package -syn keyword opajsDatabase database db -syn keyword opajsParser parser -syn keyword opajsCss css -syn keyword opajsDirectiveKW xml typeval static_content_directory static_resource_directory static_source_content static_binary_content static_include_directory catch client fail typeof lazy lazy_record thread_context with_thread_context throw track wrap unwrap callcc uncps atomic js_ident expand spawn wait server unsafe_cast toplevel assert opensums publish both prefer_client prefer_server prefer_both both_implem private public package nonexpansive asynchronous compiletime sliced_expr may_cps llarray specialize server_private opacapi stringifier xmlizer serializer comparator abstract - -syn region opajsCodeinString matchgroup=opajsKeywords start=+[^\\]{+ matchgroup=opajsKeywords end=+}+ containedin=opajsString,opajsHtml contains=ALL -syn region opajsString start=+"+ skip=+\\"+ end=+"+ -syn region opajsHtml start=+<[^:]\S+ skip=+->+ end=+>+ contains=opajsColor,opajsString - -syn match opajsConstructor "\[\s*\]" -syn match opajsBypass "%%" - -syn match opajsFunDef "->" -syn match opajsRefAssign "<-" -syn match opajsEndStatement ";;" -syn match opajsSemiColon ";" -syn match opajsPipe "|" -syn match opajsAffect "=" -syn match opajsCoerce ":" -syn match opajsDots "\.\.\." -syn match opajsUnderscore "\<_\>" -syn match opajsOperator "|>" -syn match opajsOperator "+>" -syn match opajsOperator "<+>" -syn match opajsOperator "++" -syn match opajsOperator "\^" -syn match opajsOperator ">=" -syn match opajsOperator "<=" -syn match opajsOperator "\<<\>" -syn match opajsOperator "\<>\>" -syn match opajsDb "@" -syn match opajsDb "?" -syn match opajsHtmlIdentifier "#" - -syn match opajsModule "\<\u\(\w\+\.\?\)\?" - -syn match opajsDirective "@\w\+\(_\w\+\)\?" containedin=ALLBUT,opajsComment,opajsOneLineComent -syn match opajsHtmlIdentifier "#\l\+\(_\w\+\)\?" containedin=ALLBUT,opajsComment,opajsOneLineComent,opajsString - -syn region opajsComment start=+/\*+ end=+\*/+ contains=@SpellopajsComment,opajsOneLineComent -syn match opajsOneLineComent "//.*$" contains=@Spell -syn keyword opajsTodo TODO FIXME XXX containedin=opajsComment,opajsOneLineComent - -syn match opajsNumber "\<-\=\d\(_\|\d\)*[l|L|n]\?\>" -syn match opajsNumber "\<-\=0[x|X]\(\x\|_\)\+[l|L|n]\?\>" -syn match opajsNumber "\<-\=0[o|O]\(\o\|_\)\+[l|L|n]\?\>" -syn match opajsNumber "\<-\=0[b|B]\([01]\|_\)\+[l|L|n]\?\>" -syn match opajsFloat "\<-\=\d\(_\|\d\)*\.\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>" -syn match opajsColor "\#\x\{6}\|\#\x\{6}" - -syn match opajsBraceErr "}" -syn match opajsDblBraceErr "}}" -syn match opajsBrackErr "\]" -syn match opajsParenErr ")" -syn match opajsHtmlErr "" -syn match opajsBypassErr "%%" -syn match opajsThenErr "\" -syn match opajsEndErr "\" - -" try to include html syntax -" non concluant : opajs syntax est inclu dans html syntax -" syn include @Html syntax/html.vim -" -syn region opajsEncl transparent matchgroup=opajsKeywords start="(" matchgroup=opajsKeywords end=")" contains=ALLBUT,opajsParenErr -syn region opajsEncl transparent matchgroup=opajsKeywords start="{{" matchgroup=opajsKeywords end="}}" contains=ALLBUT,opajsBraceErr -syn region opajsEncl transparent matchgroup=opajsKeywords start="{" matchgroup=opajsKeywords end="}" contains=ALLBUT,opajsBraceErr -syn region opajsEnclBrack transparent matchgroup=opajsKeywords start="\[" matchgroup=opajsKeywords end="\]" contains=ALLBUT,opajsBrackErr -syn region opajsEncl transparent matchgroup=opajsKeywords start="<>" matchgroup=opajsKeywords end="" contains=ALLBUT,opajsHtmlErr,opajsModule -syn region opajsEncl transparent matchgroup=opajsKeywords start="%%" matchgroup=opajsKeywords end="%%" contains=ALLBUT,opajsBypassErr -syn region opajsBegin transparent matchgroup=opajsKeywords start="\" matchgroup=opajsKeywords end="\" contains=ALLBUT,opajsEndErr -syn region opajsIf transparent matchgroup=opajsKeywords start="\" matchgroup=opajsKeywords end=")" contains=ALLBUT,opajsThenErr - - -syn match opajsDbIdentifier "/\w\+\(\(/\w\+\|\[.\+]\)\)*" contains=opajsString,opajsEnclBrack -syn match opajsServer "server\(\s\|\n\|\r\)*=" - -syn sync minlines=50 -syn sync maxlines=500 - -if !exists("did_opajs_syntax_inits") - let did_opajs_syntax_inits = 1 - command -nargs=+ HiLink hi link -else - command -nargs=+ HiLink hi def link -endif - - -HiLink opajsComment Comment -HiLink opajsOneLineComent Comment -HiLink opajsTodo Todo - -HiLink opajsString String -HiLink opajsStringinString String - -HiLink opajsModule Include - -HiLink opajsType Type - -HiLink opajsKeywords Keyword -HiLink opajsMatch Keyword -HiLink opajsIf Keyword -HiLink opajsDb Keyword -HiLink opajsDatabase Keyword -HiLink opajsServer Keyword -HiLink opajsParser Keyword -HiLink opajsCss Keyword -HiLink opajsPackage Keyword - -HiLink opajsFunDef Keyword -HiLink opajsRefAssign Keyword -HiLink opajsEndStatement Keyword -HiLink opajsPipe Keyword -HiLink opajsAffect Keyword -HiLink opajsCoerce Keyword -HiLink opajsSemiColon Keyword -HiLink opajsDots Keyword -HiLink opajsUnderscore Keyword -HiLink opajsOperator Keyword - - -HiLink opajsNumber Number -HiLink opajsFloat Float -HiLink opajsColor Number - -HiLink opajsConstructor Constant - -HiLink opajsBraceErr Error -HiLink opajsBrackErr Error -HiLink opajsParenErr Error -HiLink opajsHtmlErr Error -HiLink opajsThenErr Error -HiLink opajsEndErr Error - -HiLink opajsHtml Special - -HiLink opajsDirective Identifier -HiLink opajsDirectiveKW Identifier -HiLink opajsDbIdentifier Identifier -HiLink opajsHtmlIdentifier Identifier - -delcommand HiLink - -let b:current_syntax = "opajs" diff --git a/dot.vim/syntax/preview.vim b/dot.vim/syntax/preview.vim deleted file mode 100644 index c56f07b..0000000 --- a/dot.vim/syntax/preview.vim +++ /dev/null @@ -1,22 +0,0 @@ -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn match preInput /:[^:]*$/hs=s+1 - -syn keyword docOther : * -syn keyword javaScopeDecl public protected private abstract -syn keyword javaStorageClass static synchronized transient volatile final strictfp serializable -syn keyword javaType void boolean char byte short int long float double String null -syn keyword javaDoc Throws Returns Parameters Since -syn match docName /^ \* \i\+\(\s\+\-\)/he=e-2,hs=s+3 - -hi def link javaScopeDecl Keyword -hi def link javaStorageClass Keyword -hi def link javaDoc Identifier -hi def link javaType Keyword -hi def link docName Typedef -hi def link preInput Tag -hi def link docOther Special diff --git a/dot.vim/syntax/python.vim b/dot.vim/syntax/python.vim deleted file mode 100644 index 5288d9b..0000000 --- a/dot.vim/syntax/python.vim +++ /dev/null @@ -1,181 +0,0 @@ -" Vim syntax file -" Language: Python -" Maintainer: Neil Schemenauer -" Updated: 2006-10-15 -" Added Python 2.4 features 2006 May 4 (Dmitry Vasiliev) -" -" Options to control Python syntax highlighting: -" -" For highlighted numbers: -" -" let python_highlight_numbers = 1 -" -" For highlighted builtin functions: -" -" let python_highlight_builtins = 1 -" -" For highlighted standard exceptions: -" -" let python_highlight_exceptions = 1 -" -" Highlight erroneous whitespace: -" -" let python_highlight_space_errors = 1 -" -" If you want all possible Python highlighting (the same as setting the -" preceding options): -" -" let python_highlight_all = 1 -" - -" 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 - - -syn keyword pythonStatement break continue del -syn keyword pythonStatement except exec finally -syn keyword pythonStatement pass print raise -syn keyword pythonStatement return try with -syn keyword pythonStatement global assert -syn keyword pythonStatement lambda yield -syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite -syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" contained -syn keyword pythonRepeat for while -syn keyword pythonConditional if elif else -syn keyword pythonOperator and in is not or -" AS will be a keyword in Python 3 -syn keyword pythonPreCondit import from as -syn match pythonComment "#.*$" contains=pythonTodo,@Spell -syn keyword pythonTodo TODO FIXME XXX contained - -" Decorators (new in Python 2.4) -syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite - -" strings -syn region pythonString matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape,@Spell -syn region pythonString matchgroup=Normal start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape,@Spell -syn region pythonString matchgroup=Normal start=+[uU]\="""+ end=+"""+ contains=pythonEscape,@Spell -syn region pythonString matchgroup=Normal start=+[uU]\='''+ end=+'''+ contains=pythonEscape,@Spell -syn region pythonRawString matchgroup=Normal start=+[uU]\=[rR]'+ end=+'+ skip=+\\\\\|\\'+ contains=@Spell -syn region pythonRawString matchgroup=Normal start=+[uU]\=[rR]"+ end=+"+ skip=+\\\\\|\\"+ contains=@Spell -syn region pythonRawString matchgroup=Normal start=+[uU]\=[rR]"""+ end=+"""+ contains=@Spell -syn region pythonRawString matchgroup=Normal start=+[uU]\=[rR]'''+ end=+'''+ contains=@Spell -syn match pythonEscape +\\[abfnrtv'"\\]+ contained -syn match pythonEscape "\\\o\{1,3}" contained -syn match pythonEscape "\\x\x\{2}" contained -syn match pythonEscape "\(\\u\x\{4}\|\\U\x\{8}\)" contained -syn match pythonEscape "\\$" - -if exists("python_highlight_all") - let python_highlight_numbers = 1 - let python_highlight_builtins = 1 - let python_highlight_exceptions = 1 - let python_highlight_space_errors = 1 -endif - -if exists("python_highlight_numbers") - " numbers (including longs and complex) - syn match pythonNumber "\<0x\x\+[Ll]\=\>" - syn match pythonNumber "\<\d\+[LljJ]\=\>" - syn match pythonNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" - syn match pythonNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>" - syn match pythonNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" -endif - -if exists("python_highlight_builtins") - " builtin functions, types and objects, not really part of the syntax - syn keyword pythonBuiltin True False bool enumerate set frozenset help - syn keyword pythonBuiltin reversed sorted sum - syn keyword pythonBuiltin Ellipsis None NotImplemented __import__ abs - syn keyword pythonBuiltin apply buffer callable chr classmethod cmp - syn keyword pythonBuiltin coerce compile complex delattr dict dir divmod - syn keyword pythonBuiltin eval execfile file filter float getattr globals - syn keyword pythonBuiltin hasattr hash hex id input int intern isinstance - syn keyword pythonBuiltin issubclass iter len list locals long map max - syn keyword pythonBuiltin min object oct open ord pow property range - syn keyword pythonBuiltin raw_input reduce reload repr round setattr - syn keyword pythonBuiltin slice staticmethod str super tuple type unichr - syn keyword pythonBuiltin unicode vars xrange zip -endif - -if exists("python_highlight_exceptions") - " builtin exceptions and warnings - syn keyword pythonException ArithmeticError AssertionError AttributeError - syn keyword pythonException DeprecationWarning EOFError EnvironmentError - syn keyword pythonException Exception FloatingPointError IOError - syn keyword pythonException ImportError IndentationError IndexError - syn keyword pythonException KeyError KeyboardInterrupt LookupError - syn keyword pythonException MemoryError NameError NotImplementedError - syn keyword pythonException OSError OverflowError OverflowWarning - syn keyword pythonException ReferenceError RuntimeError RuntimeWarning - syn keyword pythonException StandardError StopIteration SyntaxError - syn keyword pythonException SyntaxWarning SystemError SystemExit TabError - syn keyword pythonException TypeError UnboundLocalError UnicodeError - syn keyword pythonException UnicodeEncodeError UnicodeDecodeError - syn keyword pythonException UnicodeTranslateError - syn keyword pythonException UserWarning ValueError Warning WindowsError - syn keyword pythonException ZeroDivisionError -endif - -if exists("python_highlight_space_errors") - " trailing whitespace - syn match pythonSpaceError display excludenl "\S\s\+$"ms=s+1 - " mixed tabs and spaces - syn match pythonSpaceError display " \+\t" - syn match pythonSpaceError display "\t\+ " -endif - -" This is fast but code inside triple quoted strings screws it up. It -" is impossible to fix because the only way to know if you are inside a -" triple quoted string is to start from the beginning of the file. If -" you have a fast machine you can try uncommenting the "sync minlines" -" and commenting out the rest. -syn sync match pythonSync grouphere NONE "):$" -syn sync maxlines=200 -"syn sync minlines=2000 - -if version >= 508 || !exists("did_python_syn_inits") - if version <= 508 - let did_python_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - " The default methods for highlighting. Can be overridden later - HiLink pythonStatement Statement - HiLink pythonFunction Function - HiLink pythonConditional Conditional - HiLink pythonRepeat Repeat - HiLink pythonString String - HiLink pythonRawString String - HiLink pythonEscape Special - HiLink pythonOperator Operator - HiLink pythonPreCondit PreCondit - HiLink pythonComment Comment - HiLink pythonTodo Todo - HiLink pythonDecorator Define - if exists("python_highlight_numbers") - HiLink pythonNumber Number - endif - if exists("python_highlight_builtins") - HiLink pythonBuiltin Function - endif - if exists("python_highlight_exceptions") - HiLink pythonException Exception - endif - if exists("python_highlight_space_errors") - HiLink pythonSpaceError Error - endif - - delcommand HiLink -endif - -let b:current_syntax = "python" - -" vim: ts=8 diff --git a/dot.vim/syntax/sass.vim b/dot.vim/syntax/sass.vim deleted file mode 100644 index c15a366..0000000 --- a/dot.vim/syntax/sass.vim +++ /dev/null @@ -1,64 +0,0 @@ -" Vim syntax file -" Language: Sass -" Maintainer: Tim Pope -" Filenames: *.sass - -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,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp - -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=sassScript -syn match sassCssAttribute ".*$" contained contains=@sassCssAttributes,sassConstant -syn match sassScript ".*$" contained contains=@sassCssAttributes,sassConstant -syn match sassConstant "![[:alnum:]_-]\+" -syn match sassConstantAssignment "\%(![[:alnum:]_]\+\s*\)\@<=\%(||\)\==" nextgroup=sassScript skipwhite -syn match sassMixin "^=.*" -syn match sassMixing "^\s\+\zs+.*" - -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=cssComment,cssURL,cssUnicodeEscape,cssMediaType -syn region sassDebugLine matchgroup=sassDebug start="@debug\>" end="$" contains=@sassCssAttributes,sassConstant -syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="$" contains=sassFor,@sassCssAttributes,sassConstant -syn keyword sassFor from to through contained - -syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained -syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo -syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo - -hi def link sassCssComment sassComment -hi def link sassComment Comment -hi def link sassConstant Identifier -hi def link sassMixing PreProc -hi def link sassMixin PreProc -hi def link sassTodo Todo -hi def link sassInclude Include -hi def link sassDebug Debug -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 sassAmpersand Character -hi def link sassId Identifier -hi def link sassClass Type - -let b:current_syntax = "sass" - -" vim:set sw=2: diff --git a/dot.vim/syntax/scala.vim b/dot.vim/syntax/scala.vim deleted file mode 100644 index 36605ab..0000000 --- a/dot.vim/syntax/scala.vim +++ /dev/null @@ -1,151 +0,0 @@ -" 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/dot.vim/syntax/snippet.vim b/dot.vim/syntax/snippet.vim deleted file mode 100644 index 5e919e7..0000000 --- a/dot.vim/syntax/snippet.vim +++ /dev/null @@ -1,19 +0,0 @@ -" 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/dot.vim/syntax/textile.vim b/dot.vim/syntax/textile.vim deleted file mode 100644 index 48a5d65..0000000 --- a/dot.vim/syntax/textile.vim +++ /dev/null @@ -1,87 +0,0 @@ -" -" 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: - -" 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 - else - command -nargs=+ HiLink hi def link - 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/dot.vim/syntax/vimwiki.vim b/dot.vim/syntax/vimwiki.vim deleted file mode 100644 index bd062df..0000000 --- a/dot.vim/syntax/vimwiki.vim +++ /dev/null @@ -1,236 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki syntax file -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" Quit if syntax file is already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" Links highlighting is controlled by vimwiki#highlight_links() function. -" It is called from setup_buffer_enter() function in the BufEnter autocommand. - -" Load concrete Wiki syntax -execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'.vim' - -" Concealed chars -if exists("+conceallevel") - syntax conceal on -endif -syn match VimwikiLinkChar contained /\[\[/ -syn match VimwikiLinkChar contained /\]\]/ -syn match VimwikiLinkChar contained /\[\[[^\[\]\|]\{-}|\ze.\{-}]]/ -syn match VimwikiLinkChar contained /\[\[[^\[\]\|]\{-}]\[\ze.\{-}]]/ - -syn match VimwikiNoLinkChar contained /\[\[/ -syn match VimwikiNoLinkChar contained /\]\]/ -syn match VimwikiNoLinkChar contained /\[\[[^\[\]\|]\{-}|\ze.*]]/ -syn match VimwikiNoLinkChar contained /\[\[[^\[\]\|]\{-}]\[\ze.*]]/ - -execute 'syn match VimwikiBoldChar contained /'.g:vimwiki_char_bold.'/' -execute 'syn match VimwikiItalicChar contained /'.g:vimwiki_char_italic.'/' -execute 'syn match VimwikiBoldItalicChar contained /'.g:vimwiki_char_bolditalic.'/' -execute 'syn match VimwikiItalicBoldChar contained /'.g:vimwiki_char_italicbold.'/' -execute 'syn match VimwikiCodeChar contained /'.g:vimwiki_char_code.'/' -execute 'syn match VimwikiDelTextChar contained /'.g:vimwiki_char_deltext.'/' -execute 'syn match VimwikiSuperScript contained /'.g:vimwiki_char_superscript.'/' -execute 'syn match VimwikiSubScript contained /'.g:vimwiki_char_subscript.'/' -if exists("+conceallevel") - syntax conceal off -endif - -" Non concealed chars -syn match VimwikiHeaderChar contained /\%(^\s*=\+\)\|\%(=\+\s*$\)/ -execute 'syn match VimwikiBoldCharT contained /'.g:vimwiki_char_bold.'/' -execute 'syn match VimwikiItalicCharT contained /'.g:vimwiki_char_italic.'/' -execute 'syn match VimwikiBoldItalicCharT contained /'.g:vimwiki_char_bolditalic.'/' -execute 'syn match VimwikiItalicBoldCharT contained /'.g:vimwiki_char_italicbold.'/' -execute 'syn match VimwikiCodeCharT contained /'.g:vimwiki_char_code.'/' -execute 'syn match VimwikiDelTextCharT contained /'.g:vimwiki_char_deltext.'/' -execute 'syn match VimwikiSuperScriptT contained /'.g:vimwiki_char_superscript.'/' -execute 'syn match VimwikiSubScriptT contained /'.g:vimwiki_char_subscript.'/' - - -" Emoticons -syntax match VimwikiEmoticons /\%((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/ - -let g:vimwiki_rxTodo = '\C\%(TODO:\|DONE:\|STARTED:\|FIXME:\|FIXED:\|XXX:\)' -execute 'syntax match VimwikiTodo /'. g:vimwiki_rxTodo .'/' - - -" Tables -" execute 'syntax match VimwikiTable /'.g:vimwiki_rxTable.'/' -syntax match VimwikiTableRow /^\s*|.\+|\s*$/ - \ transparent contains=VimwikiCellSeparator,VimwikiLinkT, - \ VimwikiNoExistsLinkT,VimwikiEmoticons,VimwikiTodo, - \ VimwikiBoldT,VimwikiItalicT,VimwikiBoldItalicT,VimwikiItalicBoldT, - \ VimwikiDelTextT,VimwikiSuperScriptT,VimwikiSubScriptT,VimwikiCodeT -syntax match VimwikiCellSeparator - \ /\%(|\)\|\%(-\@<=+\-\@=\)\|\%([|+]\@<=-\+\)/ contained - -" List items -execute 'syntax match VimwikiList /'.g:vimwiki_rxListBullet.'/' -execute 'syntax match VimwikiList /'.g:vimwiki_rxListNumber.'/' -execute 'syntax match VimwikiList /'.g:vimwiki_rxListDefine.'/' - -execute 'syntax match VimwikiBold /'.g:vimwiki_rxBold.'/ contains=VimwikiBoldChar' -execute 'syntax match VimwikiBoldT /'.g:vimwiki_rxBold.'/ contained contains=VimwikiBoldCharT' - -execute 'syntax match VimwikiItalic /'.g:vimwiki_rxItalic.'/ contains=VimwikiItalicChar' -execute 'syntax match VimwikiItalicT /'.g:vimwiki_rxItalic.'/ contained contains=VimwikiItalicCharT' - -execute 'syntax match VimwikiBoldItalic /'.g:vimwiki_rxBoldItalic.'/ contains=VimwikiBoldItalicChar,VimwikiItalicBoldChar' -execute 'syntax match VimwikiBoldItalicT /'.g:vimwiki_rxBoldItalic.'/ contained contains=VimwikiBoldItalicChatT,VimwikiItalicBoldCharT' - -execute 'syntax match VimwikiItalicBold /'.g:vimwiki_rxItalicBold.'/ contains=VimwikiBoldItalicChar,VimwikiItalicBoldChar' -execute 'syntax match VimwikiItalicBoldT /'.g:vimwiki_rxItalicBold.'/ contained contains=VimwikiBoldItalicCharT,VimsikiItalicBoldCharT' - -execute 'syntax match VimwikiDelText /'.g:vimwiki_rxDelText.'/ contains=VimwikiDelTextChar' -execute 'syntax match VimwikiDelTextT /'.g:vimwiki_rxDelText.'/ contained contains=VimwikiDelTextChar' - -execute 'syntax match VimwikiSuperScript /'.g:vimwiki_rxSuperScript.'/ contains=VimwikiSuperScriptChar' -execute 'syntax match VimwikiSuperScriptT /'.g:vimwiki_rxSuperScript.'/ contained contains=VimwikiSuperScriptCharT' - -execute 'syntax match VimwikiSubScript /'.g:vimwiki_rxSubScript.'/ contains=VimwikiSubScriptChar' -execute 'syntax match VimwikiSubScriptT /'.g:vimwiki_rxSubScript.'/ contained contains=VimwikiSubScriptCharT' - -execute 'syntax match VimwikiCode /'.g:vimwiki_rxCode.'/ contains=VimwikiCodeChar' -execute 'syntax match VimwikiCodeT /'.g:vimwiki_rxCode.'/ contained contains=VimwikiCodeCharT' - -"
    horizontal rule -execute 'syntax match VimwikiHR /'.g:vimwiki_rxHR.'/' - -execute 'syntax region VimwikiPre start=/'.g:vimwiki_rxPreStart. - \ '/ end=/'.g:vimwiki_rxPreEnd.'/ contains=VimwikiComment' - -" List item checkbox -syntax match VimwikiCheckBox /\[.\?\]/ -if g:vimwiki_hl_cb_checked - execute 'syntax match VimwikiCheckBoxDone /'. - \ g:vimwiki_rxListBullet.'\s*\['.g:vimwiki_listsyms[4].'\].*$/'. - \ ' contains=VimwikiNoExistsLink,VimwikiLink' - execute 'syntax match VimwikiCheckBoxDone /'. - \ g:vimwiki_rxListNumber.'\s*\['.g:vimwiki_listsyms[4].'\].*$/'. - \ ' contains=VimwikiNoExistsLink,VimwikiLink' -endif - -" placeholders -syntax match VimwikiPlaceholder /^\s*%toc\%(\s.*\)\?$/ contains=VimwikiPlaceholderParam -syntax match VimwikiPlaceholder /^\s*%nohtml\s*$/ -syntax match VimwikiPlaceholder /^\s*%title\%(\s.*\)\?$/ contains=VimwikiPlaceholderParam -syntax match VimwikiPlaceholderParam /\s.*/ contained - -" html tags -let html_tags = join(split(g:vimwiki_valid_html_tags, '\s*,\s*'), '\|') -exe 'syntax match VimwikiHTMLtag #\c#' -execute 'syntax match VimwikiBold #\c.\{-}# contains=VimwikiHTMLTag' -execute 'syntax match VimwikiItalic #\c.\{-}# contains=VimwikiHTMLTag' -execute 'syntax match VimwikiUnderline #\c.\{-}# contains=VimwikiHTMLTag' - -syntax region VimwikiComment start='' - -if g:vimwiki_hl_headers == 0 - execute 'syntax match VimwikiHeader /'.g:vimwiki_rxHeader.'/ contains=VimwikiTodo,VimwikiHeaderChar' -else - " Header levels, 1-6 - execute 'syntax match VimwikiHeader1 /'.g:vimwiki_rxH1.'/ contains=VimwikiTodo,VimwikiHeaderChar' - execute 'syntax match VimwikiHeader2 /'.g:vimwiki_rxH2.'/ contains=VimwikiTodo,VimwikiHeaderChar' - execute 'syntax match VimwikiHeader3 /'.g:vimwiki_rxH3.'/ contains=VimwikiTodo,VimwikiHeaderChar' - execute 'syntax match VimwikiHeader4 /'.g:vimwiki_rxH4.'/ contains=VimwikiTodo,VimwikiHeaderChar' - execute 'syntax match VimwikiHeader5 /'.g:vimwiki_rxH5.'/ contains=VimwikiTodo,VimwikiHeaderChar' - execute 'syntax match VimwikiHeader6 /'.g:vimwiki_rxH6.'/ contains=VimwikiTodo,VimwikiHeaderChar' -endif - -" group names "{{{ - -call vimwiki#setup_colors() - -hi def VimwikiBold term=bold cterm=bold gui=bold -hi def link VimwikiBoldT VimwikiBold - -hi def VimwikiItalic term=italic cterm=italic gui=italic -hi def link VimwikiItalicT VimwikiItalic - -hi def VimwikiBoldItalic term=bold cterm=bold gui=bold,italic -hi def link VimwikiItalicBold VimwikiBoldItalic -hi def link VimwikiBoldItalicT VimwikiBoldItalic -hi def link VimwikiItalicBoldT VimwikiBoldItalic - -hi def VimwikiUnderline gui=underline - -hi def link VimwikiCode PreProc -hi def link VimwikiCodeT VimwikiCode - -hi def link VimwikiNoExistsLink Error -hi def link VimwikiNoExistsLinkT VimwikiNoExistsLink - -hi def link VimwikiPre PreProc -hi def link VimwikiPreT VimwikiPre - -hi def link VimwikiLink Underlined -hi def link VimwikiLinkT Underlined - -hi def link VimwikiList Function -hi def link VimwikiCheckBox VimwikiList -hi def link VimwikiCheckBoxDone Comment -hi def link VimwikiEmoticons Character - -hi def link VimwikiDelText Constant -hi def link VimwikiDelTextT VimwikiDelText - -hi def link VimwikiSuperScript Number -hi def link VimwikiSuperScriptT VimwikiSuperScript - -hi def link VimwikiSubScript Number -hi def link VimwikiSubScriptT VimwikiSubScript - -hi def link VimwikiTodo Todo -hi def link VimwikiComment Comment - -hi def link VimwikiCellSeparator PreProc - -hi def link VimwikiPlaceholder SpecialKey -hi def link VimwikiPlaceholderParam String -hi def link VimwikiHTMLtag SpecialKey - -hi def link VimwikiBoldChar VimwikiIgnore -hi def link VimwikiItalicChar VimwikiIgnore -hi def link VimwikiBoldItalicChar VimwikiIgnore -hi def link VimwikiItalicBoldChar VimwikiIgnore -hi def link VimwikiDelTextChar VimwikiIgnore -hi def link VimwikiSuperScriptChar VimwikiIgnore -hi def link VimwikiSubScriptChar VimwikiIgnore -hi def link VimwikiCodeChar VimwikiIgnore -hi def link VimwikiHeaderChar VimwikiIgnore -hi def link VimwikiLinkChar VimwikiLink -hi def link VimwikiNoLinkChar VimwikiNoExistsLink - -hi def link VimwikiBoldCharT VimwikiIgnore -hi def link VimwikiItalicCharT VimwikiIgnore -hi def link VimwikiBoldItalicCharT VimwikiIgnore -hi def link VimwikiItalicBoldCharT VimwikiIgnore -hi def link VimwikiDelTextCharT VimwikiIgnore -hi def link VimwikiSuperScriptCharT VimwikiIgnore -hi def link VimwikiSubScriptCharT VimwikiIgnore -hi def link VimwikiCodeCharT VimwikiIgnore -hi def link VimwikiHeaderCharT VimwikiIgnore -hi def link VimwikiLinkCharT VimwikiLinkT -hi def link VimwikiNoLinkCharT VimwikiNoExistsLinkT -"}}} - -let b:current_syntax="vimwiki" - -" EMBEDDED syntax setup "{{{ -let nested = VimwikiGet('nested_syntaxes') -if !empty(nested) - for [hl_syntax, vim_syntax] in items(nested) - call vimwiki#nested_syntax(vim_syntax, - \ '^\s*{{{\%(.*[[:blank:][:punct:]]\)\?'. - \ hl_syntax.'\%([[:blank:][:punct:]].*\)\?', - \ '^\s*}}}', 'VimwikiPre') - endfor -endif -"}}} diff --git a/dot.vim/syntax/vimwiki_default.vim b/dot.vim/syntax/vimwiki_default.vim deleted file mode 100644 index 32eab67..0000000 --- a/dot.vim/syntax/vimwiki_default.vim +++ /dev/null @@ -1,83 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki syntax file -" Default syntax -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" text: *strong* -" let g:vimwiki_rxBold = '\*[^*]\+\*' -let g:vimwiki_rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*'. - \'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'. - \'\*'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_bold = '*' - -" text: _emphasis_ -" let g:vimwiki_rxItalic = '_[^_]\+_' -let g:vimwiki_rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_'. - \'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'. - \'_'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_italic = '_' - -" text: *_bold italic_* or _*italic bold*_ -let g:vimwiki_rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*_'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'_\*'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_bolditalic = '\*_' - -let g:vimwiki_rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_\*'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'\*_'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_italicbold = '_\*' - -" text: `code` -let g:vimwiki_rxCode = '`[^`]\+`' -let g:vimwiki_char_code = '`' - -" text: ~~deleted text~~ -let g:vimwiki_rxDelText = '\~\~[^~`]\+\~\~' -let g:vimwiki_char_deltext = '\~\~' - -" text: ^superscript^ -let g:vimwiki_rxSuperScript = '\^[^^`]\+\^' -let g:vimwiki_char_superscript = '^' - -" text: ,,subscript,, -let g:vimwiki_rxSubScript = ',,[^,`]\+,,' -let g:vimwiki_char_subscript = ',,' - -" Header levels, 1-6 -let g:vimwiki_rxH1 = '^\s*=\{1}[^=]\+.*[^=]\+=\{1}\s*$' -let g:vimwiki_rxH2 = '^\s*=\{2}[^=]\+.*[^=]\+=\{2}\s*$' -let g:vimwiki_rxH3 = '^\s*=\{3}[^=]\+.*[^=]\+=\{3}\s*$' -let g:vimwiki_rxH4 = '^\s*=\{4}[^=]\+.*[^=]\+=\{4}\s*$' -let g:vimwiki_rxH5 = '^\s*=\{5}[^=]\+.*[^=]\+=\{5}\s*$' -let g:vimwiki_rxH6 = '^\s*=\{6}[^=]\+.*[^=]\+=\{6}\s*$' -let g:vimwiki_rxHeader = '\%('.g:vimwiki_rxH1.'\)\|'. - \ '\%('.g:vimwiki_rxH2.'\)\|'. - \ '\%('.g:vimwiki_rxH3.'\)\|'. - \ '\%('.g:vimwiki_rxH4.'\)\|'. - \ '\%('.g:vimwiki_rxH5.'\)\|'. - \ '\%('.g:vimwiki_rxH6.'\)' - -let g:vimwiki_char_header = '\%(^\s*=\+\)\|\%(=\+\s*$\)' - -"
    , horizontal rule -let g:vimwiki_rxHR = '^----.*$' - -" List items start with optional whitespace(s) then '* ' or '# ' -let g:vimwiki_rxListBullet = '^\s*\%(\*\|-\)\s' -let g:vimwiki_rxListNumber = '^\s*#\s' - -let g:vimwiki_rxListDefine = '::\(\s\|$\)' - -" Preformatted text -let g:vimwiki_rxPreStart = '{{{' -let g:vimwiki_rxPreEnd = '}}}' diff --git a/dot.vim/syntax/vimwiki_media.vim b/dot.vim/syntax/vimwiki_media.vim deleted file mode 100644 index f667537..0000000 --- a/dot.vim/syntax/vimwiki_media.vim +++ /dev/null @@ -1,67 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki syntax file -" MediaWiki syntax -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" text: '''strong''' -let g:vimwiki_rxBold = "'''[^']\\+'''" -let g:vimwiki_char_bold = "'''" - -" text: ''emphasis'' -let g:vimwiki_rxItalic = "''[^']\\+''" -let g:vimwiki_char_italic = "''" - -" text: '''''strong italic''''' -let g:vimwiki_rxBoldItalic = "'''''[^']\\+'''''" -let g:vimwiki_rxItalicBold = g:vimwiki_rxBoldItalic -let g:vimwiki_char_bolditalic = "'''''" -let g:vimwiki_char_italicbold = g:vimwiki_char_bolditalic - -" text: `code` -let g:vimwiki_rxCode = '`[^`]\+`' -let g:vimwiki_char_code = '`' - -" text: ~~deleted text~~ -let g:vimwiki_rxDelText = '\~\~[^~]\+\~\~' -let g:vimwiki_char_deltext = '\~\~' - -" text: ^superscript^ -let g:vimwiki_rxSuperScript = '\^[^^]\+\^' -let g:vimwiki_char_superscript = '^' - -" text: ,,subscript,, -let g:vimwiki_rxSubScript = ',,[^,]\+,,' -let g:vimwiki_char_subscript = ',,' - -" Header levels, 1-6 -let g:vimwiki_rxH1 = '^\s*=\{1}[^=]\+.*[^=]\+=\{1}\s*$' -let g:vimwiki_rxH2 = '^\s*=\{2}[^=]\+.*[^=]\+=\{2}\s*$' -let g:vimwiki_rxH3 = '^\s*=\{3}[^=]\+.*[^=]\+=\{3}\s*$' -let g:vimwiki_rxH4 = '^\s*=\{4}[^=]\+.*[^=]\+=\{4}\s*$' -let g:vimwiki_rxH5 = '^\s*=\{5}[^=]\+.*[^=]\+=\{5}\s*$' -let g:vimwiki_rxH6 = '^\s*=\{6}[^=]\+.*[^=]\+=\{6}\s*$' -let g:vimwiki_rxHeader = '\%('.g:vimwiki_rxH1.'\)\|'. - \ '\%('.g:vimwiki_rxH2.'\)\|'. - \ '\%('.g:vimwiki_rxH3.'\)\|'. - \ '\%('.g:vimwiki_rxH4.'\)\|'. - \ '\%('.g:vimwiki_rxH5.'\)\|'. - \ '\%('.g:vimwiki_rxH6.'\)' -let g:vimwiki_char_header = '\%(^\s*=\+\)\|\%(=\+\s*$\)' - -"
    , horizontal rule -let g:vimwiki_rxHR = '^----.*$' - -" Tables. Each line starts and ends with '||'; each cell is separated by '||' -let g:vimwiki_rxTable = '||' - -" Bulleted list items start with whitespace(s), then '*' -" highlight only bullets and digits. -let g:vimwiki_rxListBullet = '^\s*\*\+\([^*]*$\)\@=' -let g:vimwiki_rxListNumber = '^\s*#\+' - -let g:vimwiki_rxListDefine = '^\%(;\|:\)\s' - -" Preformatted text -let g:vimwiki_rxPreStart = '
    '
    -let g:vimwiki_rxPreEnd = '<\/pre>'
    diff --git a/dot.vim/syntax/vjde.vim b/dot.vim/syntax/vjde.vim
    deleted file mode 100644
    index 78e4fb4..0000000
    --- a/dot.vim/syntax/vjde.vim
    +++ /dev/null
    @@ -1,30 +0,0 @@
    -" Vjde syntax file
    -" language : vjde template ,def files
    -"
    -if exists("b:current_syntax")
    -    finish
    -endif
    -syn keyword vjdeKeyword template temp endtemplate endt parameter param body 
    -syn keyword vjdeKeyword2 paras @paras @name name manager contained
    -syn match vjdeComment "^/.*$"
    -syn match vjdeEntity "^%.*%$"
    -syn match vjdeSpecialChar "^\\"
    -syn match vjdeDesc "\(^\(para\|temp\).*\)\@<=;.*$"
    -syn match vjdeParaName "\(^para[a-z]\+\s\+\)\@<=\<\i\+\>"
    -syn match vjdeTempName "\(^temp[a-z]\+\s\+\)\@<=\<\i\+\>"
    -syn region vjdeBody  matchgroup=vjdeIgnore start="^body" end="^endt" 
    -syn match vjdeIgnore "." contained
    -"syn match vjdeVariable "%{[^}]\+}"
    -syn region vjdeVariable start="%{" end="}" contains=vjdeKeyword2
    -
    -hi def link vjdeComment Comment
    -hi def link vjdeEntity Typedef
    -hi def link vjdeKeyword Keyword 
    -hi def link vjdeKeyword2 Identifier 
    -hi def link vjdeBody Constant
    -hi def link vjdeDesc String
    -hi def link vjdeParaName Typedef
    -hi def link vjdeTempName Typedef
    -hi def link vjdeVariable Typedef
    -hi def link vjdeSpecialChar SpecialChar
    -
    diff --git a/dot.vim/vimrc b/dot.vim/vimrc
    deleted file mode 100644
    index b998217..0000000
    --- a/dot.vim/vimrc
    +++ /dev/null
    @@ -1,157 +0,0 @@
    -" pSy's vimrc 0.1
    -" originally from http://arch.har-ikkje.net/configs/home/dot.vim/vimrc
    -
    -" -[ General behaviour ]-
    -" general
    -set nocompatible
    -set wrap
    -
    -" search
    -set ignorecase
    -set smartcase
    -set incsearch
    -set hlsearch
    -set showmatch
    -
    -
    -" indenting
    -set autoindent
    -set smartindent
    -
    -" command mode
    -set wildmenu
    -set wildmode=list:longest,full
    -
    -" -[ Look ]-
    -" general
    -set showcmd
    -set showmode
    -set number
    -
    -" statusline
    -set statusline=%<%f\ %y%h%m%r\ CWD:%{getcwd()}%=%-14.(%l,%c%V%)\ %P
    -set laststatus=2
    -
    -" -[ FileTypes ]-
    -filetype indent on
    -
    -" vim as pager
    -autocmd FileType man set colorcolumn=0
    -
    -" mail
    -autocmd FileType mail,human set formatoptions+=t textwidth=72
    -
    -" latex-suite
    -filetype plugin indent on
    -set grepprg=grep\ -nH\ $*
    -let g:tex_flavor = "latex"
    -
    -" Python stuff
    -autocmd FileType python let python_highlight_all = 1
    -autocmd FileType python let python_slow_sync = 1
    -autocmd FileType python set complete+=k/home/psy/.vim/pydiction iskeyword+=.,(
    -autocmd bufnewfile *.py so /home/psy/.vim/headers/py
    -autocmd bufnewfile *.py exe "1," . 10 . "g/File Name.*/s//File Name : " .expand("%")
    -autocmd bufnewfile *.py exe "1," . 10 . "g/Creation Date :.*/s//Creation Date : " .strftime("%d-%m-%Y")
    -autocmd Bufwritepre,filewritepre *.py execute "normal ma"
    -autocmd Bufwritepre,filewritepre *.py exe "1," . 10 . "g/Last Modified :.*/s/Last Modified :.*/Last Modified : " .strftime("%c")
    -autocmd bufwritepost,filewritepost *.py execute "normal Gi"
    -autocmd FileType python setlocal omnifunc=pysmell#Complete
    -
    -" Ruby, YAML, HAML, SASS, JavaScript, CoffeeScript, HTML stuff
    -autocmd FileType ruby,eruby,yaml,haml,sass,javascript,coffee,html setlocal softtabstop=2 shiftwidth=2 tabstop=2
    -let javaScript_fold=1
    -
    -" LaTeX
    -autocmd Filetype tex,latex set grepprg=grep\ -nH\ $
    -autocmd Filetype tex,latex let g:tex_flavor = "latex"
    -autocmd bufnewfile *.tex so /home/psy/.vim/headers/tex
    -
    -" Less (the CSS thing)
    -autocmd bufread,bufnewfile *.less set filetype=css
    -
    -" lyX
    -autocmd bufread,BufNewFile *.lyx set syntax=lyx foldmethod=syntax foldcolumn=3 filetype=lyx
    -autocmd bufread,BufNewFile *.lyx syntax sync fromstart
    -autocmd Filetype lyx,lyX set grepprg=grep\ -nH\ $
    -autocmd Filetype lyx,lyX let g:tex_flavor = "lyx"
    -
    -" C
    -autocmd bufnewfile *.c so /home/psy/.vim/headers/c
    -autocmd bufnewfile *.c exe "1," . 6 . "g/File Name.*/s//File Name : " .expand("%")
    -autocmd bufnewfile *.c exe "1," . 6 . "g/Creation Date :.*/s//Creation Date : " .strftime("%d-%m-%Y")
    -autocmd Bufwritepre,filewritepre *.c execute "normal ma"
    -autocmd Bufwritepre,filewritepre *.c exe "1," . 6 . "g/Last Modified :.*/s/Last Modified :.*/Last Modified : " .strftime("%c")
    -autocmd bufwritepost,filewritepost *.c execute "normal `a"
    -
    -" HTML
    -autocmd bufnewfile *.html so /home/psy/.vim/headers/html
    -
    -" Nimrod
    -autocmd BufRead,BufNewFile *.nim set filetype=nimrod 
    -
    -" JS SyntaxHighlighter Brush
    -autocmd bufnewfile shBrush*.js so /home/psy/.vim/headers/syntaxhighlighterbrush.js
    -
    -" php
    -autocmd bufnewfile *.php so /home/psy/.vim/plugins/phpdoc.vim
    -autocmd bufnewfile *.php inoremap  :call PhpDocSingle()i
    -autocmd bufnewfile *.php nnoremap  :call PhpDocSingle()
    -autocmd bufnewfile *.php vnoremap  :call PhpDocRange() 
    -
    -" markdown
    -autocmd bufread,bufnewfile *.md set filetype=markdown
    -
    -" blog entry auto renaming
    -function! Blog_RenameArticle()
    -    " paranoia?
    -	if isdirectory(expand("%"))
    -        return
    -	endif
    -
    -    let abspath = expand("%:p:h")
    -    if abspath !~ 'blog\.nkoehring\.de/src/pages/articles'
    -        return
    -    endif
    -
    -    let filename = expand("%:t")
    -    let matches = matchlist(filename, '\(\d\{14}\)\(\p\+\)')
    -
    -    if len(matches) > 0
    -        let oldname = abspath.'/'.matches[0]
    -        let newname = abspath.'/'.strftime("%Y%m%d%H%M%S").matches[2]
    -        call rename(oldname, newname)
    -        execute ":saveas! ".newname
    -    else
    -        execute ":saveas " .abspath. "/" .strftime("%Y%m%d%H%M%S"). "_" .filename
    -    endif
    -endfunction
    -
    -function! Blog_NewArticle()
    -    if expand("%:p:h") =~ 'blog\.nkoehring\.de/src/pages/articles'
    -        source /home/psy/.vim/headers/article.haml
    -    endif
    -endfunction
    -autocmd BufWritePre *.haml call Blog_RenameArticle()
    -autocmd BufNewFile *.haml call Blog_NewArticle()
    -
    -
    -" -[ Mappings ]-"
    -" taglist
    -nnoremap   :TlistToggle
    -inoremap   :TlistTogglea
    -nnoremap   :TlistUpdate
    -inoremap   :TlistUpdatea
    -inoremap # X#
    -
    -" map w!! to write as root
    -cmap w!! w !sudo tee % >/dev/null
    -
    -
    -" -[ Plugins and Scripts ]-
    -" taglist
    -let Tlist_Use_Right_Window = 1
    -let Tlist_Compart_Format = 1
    -let Tlist_Show_Menu = 1
    -let Tlist_Exit_OnlyWindow = 1
    -
    diff --git a/dot.vimrc b/dot.vimrc
    index f1fcf14..d6652e6 100644
    --- a/dot.vimrc
    +++ b/dot.vimrc
    @@ -1,3 +1,33 @@
    +set nocompatible               " be iMproved
    +filetype off                   " required!
    +
    +call vundle#begin()
    +
    +Plugin 'gmarik/Vundle.vim'
    +
    +" Bundles here:
    +Plugin 'kchmck/vim-coffee-script'
    +Plugin 'tpope/vim-haml'
    +Plugin 'tpope/vim-speeddating'
    +Plugin 'tpope/vim-sleuth'
    +Plugin 'kien/ctrlp.vim'
    +Plugin 'Lokaltog/vim-powerline'
    +Plugin 'flazz/vim-colorschemes'
    +Plugin 'spolu/dwm.vim'
    +Plugin 'mileszs/ack.vim'
    +Plugin 'mattn/webapi-vim'
    +Plugin 'mattn/gist-vim'
    +Plugin 'sunaku/xoria256.vim'
    +Plugin 'mattn/emmet-vim'
    +Plugin 'digitaltoad/vim-jade'
    +Plugin 'wavded/vim-stylus.git'
    +Plugin 'wting/rust.vim'
    +
    +call vundle#end()
    +filetype plugin indent on     " required! 
    +
    +let g:ackprg = 'ag --nogroup --nocolor --column'
    +
     set expandtab
     set shiftwidth=4
     set tabstop=4
    @@ -6,16 +36,16 @@ set encoding=utf-8
     set textwidth=79
     set colorcolumn=80
     set scrolloff=5
    -
    -call pathogen#runtime_append_all_bundles()
    -syntax on
    -filetype on            " enables filetype detection
    -filetype plugin on     " enables filetype specific plugins
    -
    -" colourstuff
    +set laststatus=2
    +set number
    +set wildmenu
    +set wildmode=list:longest,full
    +set cryptmethod=blowfish
     set t_Co=256
    -colorscheme wombat256mod
    -
    -source ~/.vim/vimrc
    -" GOOGLE: listchars
    +colorscheme xoria256
    +syn on
     
    +" rust stuff
    +set hidden
    +let g:racer_cmd = "/usr/bin/racer"
    +let $RUST_SRC_PATH="/usr/local/src/rust/src"
    diff --git a/dot.xinitrc b/dot.xinitrc
    index 626ee58..7895d9a 100644
    --- a/dot.xinitrc
    +++ b/dot.xinitrc
    @@ -1,67 +1,27 @@
    -#!/bin/sh
    +setxkbmap de
    +xset -b
     
    -#source .zsh/env
    -xset +fp /usr/share/fonts/local
    -xset fp rehash
    -xset -b # disable bell
    -#xrdb -merge $HOME/.Xresources
    -#xmodmap ~/.Xmodmap
    -#setxkbmap -layout de -option ctrl:nocaps
    +# synaptics touchpad (order is important here)
    +synclient RightButtonAreaLeft=4501
    +synclient RightButtonAreaRight=0
    +synclient RightButtonAreaTop=4100
    +synclient RightButtonAreaBottom=0
    +synclient MiddleButtonAreaRight=4500
    +synclient MiddleButtonAreaLeft=2500
    +synclient MiddleButtonAreaTop=4100
    +synclient MiddleButtonAreaBottom=0
    +xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Accel Profile" 2
    +xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Accel Constant Deceleration" 4
    +xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Accel Adaptive Deceleration" 4
    +xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Accel Velocity Scaling" 8
     
    -# deactivate touchpad tapping when typing
    -syndaemon -t -k -i 1 -d &
    +# syndaemon (disable touchpad while typing)
    +syndaemon -Rtki 1 &
     
    -# preload programs
    -hash firefox conky && #firefox &
    -conky -b -d -c $HOME/.conkyrc &
    -#sh ~/.fehbg &
    +# no eyestrain please
    +xflux -l 52.3 -g 13.3 -r 1
     
    +# sound
    +#exec start-pulseaudio-x11
     
    -memu(){
    -    memu="$(free -m | sed -n 's|^-.*:[ \t]*\([0-9]*\) .*|\1|gp')"
    -    echo "$memu"
    -}
    -memt(){
    -    memt="$(free -m | sed -n 's|^M.*:[ \t]*\([0-9]*\) .*|\1|gp')"
    -    echo "$memt"
    -}
    -cpu(){
    -    cpu="$(eval $(awk '/^cpu /{print "previdle=" $5 "; prevtotal=" $2+$3+$4+$5 }' /proc/stat); sleep 0.4;
    -	      eval $(awk '/^cpu /{print "idle=" $5 "; total=" $2+$3+$4+$5 }' /proc/stat);
    -	      intervaltotal=$((total-${prevtotal:-0}));
    -	      echo "$((100*( (intervaltotal) - ($idle-${previdle:-0}) ) / (intervaltotal) ))")"
    -    echo "$cpu" 
    -}
    -
    -
    -while true
    -do
    -	LOCALTIME=$(date '+%Y-%m-%d %H:%M')
    -	#IP=$(for i in `ip r`; do echo $i; done | grep -A 1 src | tail -n1) # can get confused if you use vmware
    -    IPs=$(ip r list scope link proto kernel | awk '{print $3 ":" $5}')
    -    IP=$(for x in $IPs; do echo -n $x" "; done)
    -	TEMP="$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))C"
    -    CPU=$(cpu)
    -    MEM=$(($(memu)*100/$(memt)))
    -
    -	if acpi -a | grep off-line > /dev/null
    -	then
    -		BAT="\\$(acpi -b | awk '{ print $4 " " $5 }' | tr -d ',')/"
    -	else
    -        if acpi -a | grep Full > /dev/null
    -        then
    -            BAT=""
    -        else
    -            BAT="/$(acpi -b | awk '{ print $4 " " $5 }' | tr -d ',')\\"
    -        fi
    -	fi
    -    xsetroot -name "$IP| CPU:$CPU% | MEM:$MEM% | $BAT | $TEMP | $LOCALTIME"
    -	sleep 5s
    -done &
    -
    -xbindkeys
    -sh ~/.fehbg
    -mkdir -p .cache/dwm/
    -while true; do
    -  dwm 2> ~/.cache/dwm/err
    -done
    +exec herbstluftwm
    diff --git a/dot.xmobarrc b/dot.xmobarrc
    new file mode 100644
    index 0000000..d9ccfa9
    --- /dev/null
    +++ b/dot.xmobarrc
    @@ -0,0 +1,37 @@
    +Config { font = "xft:monofur:pixelsize=36,FontAwesome:pixelsize=24"
    +       , border = TopB
    +       , borderWidth = -14
    +       , borderColor = "black"
    +       , bgColor = "gray10"
    +       , fgColor = "gray60"
    +       , position = TopSize C 100 50
    +       , lowerOnStart = True
    +       , pickBroadest = False
    +       , persistent = False
    +       , hideOnStart = False
    +       , iconRoot = "."
    +       , allDesktops = True
    +       , overrideRedirect = True
    +       , commands = [ Run Weather "EDDT" ["-t","°C",
    +                                          "-L","8","-H","25",
    +                                          "--normal","green",
    +                                          "--high","red",
    +                                          "--low","lightblue"] 36000
    +                    , Run Wireless "wlp1s0" ["-L","0","-H","70", "--low","red","--normal","yellow","--high","green"] 10
    +                    , Run Cpu ["-L","3","-H","50", "--normal","green","--high","red"] 10
    +                    , Run Memory ["-t","Mem: %"] 10
    +                    , Run Com "uname" ["-r"] "" 36000
    +                    , Run Date "%a %Y-%m-%d %H:%M:%S" "date" 10
    +                    , Run BatteryP ["BAT1"] ["-t","", "--", "-f",
    +"ADP1/online","-o","%/ left","-O"," (h left)","-i",""] 60
    +                    , Run Uptime ["-L","2","-H","7", "--low","green", "--normal","yellow", "--high","red"] 10
    +                    , Run CoreTemp ["-t", "(°C)", "-L", "40", "-H", "60", "-l", "lightblue", "-h", "red"] 50
    +                    , Run UnsafeStdinReader
    +                    ]
    +       , sepChar = "%"
    +       , alignSep = "}{"
    +       , template = " %cpu% %coretemp% | %memory% | wifi:%wlp1s0wi% | %battery% }\
    +                    \%UnsafeStdinReader%\
    +                    \{ %EDDT% | %uptime% %uname% | %date% "
    +       }
    +
    diff --git a/dot.zshrc b/dot.zshrc
    index 193cfb5..de496e1 100644
    --- a/dot.zshrc
    +++ b/dot.zshrc
    @@ -1,49 +1,34 @@
    -# Path to your oh-my-zsh configuration.
    -ZSH=$HOME/.oh-my-zsh
    +bindkey -v
    +source ~/.profile
    +source /usr/share/zsh/scripts/antigen/antigen.zsh
     
    -# Set name of the theme to load.
    -# Look in ~/.oh-my-zsh/themes/
    -# Optionally, if you set this to "random", it'll load a random theme each
    -# time that oh-my-zsh is loaded.
    -ZSH_THEME="psy"
    -
    -# Example aliases
    -# alias zshconfig="mate ~/.zshrc"
    -# alias ohmyzsh="mate ~/.oh-my-zsh"
    -
    -# Set to this to use case-sensitive completion
    -# CASE_SENSITIVE="true"
    -
    -# Comment this out to disable bi-weekly auto-update checks
    -# DISABLE_AUTO_UPDATE="true"
    -
    -# Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
    -# export UPDATE_ZSH_DAYS=13
    -
    -# Uncomment following line if you want to disable colors in ls
    -# DISABLE_LS_COLORS="true"
    -
    -# Uncomment following line if you want to disable autosetting terminal title.
    -# DISABLE_AUTO_TITLE="true"
    -
    -# Uncomment following line if you want red dots to be displayed while waiting for completion
     COMPLETION_WAITING_DOTS="true"
    +ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
    +ZSH_HIGHLIGHT_PATTERNS+=('rm -fr *' 'fg=white,bold,bg=red')
    +PROJECT_PATHS=(~/sources ~/sources/*)
     
    -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    -# Example format: plugins=(rails git textmate ruby lighthouse)
    -plugins=(git ruby archlinux bundler coffee compleat encode64 extract gem git-extras npm screen systemd urltools zsh-syntax-highlighting pj)
     
    -# Highlighters
    -ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
    +antigen use oh-my-zsh
     
    -# Project Paths for PJ
    -PROJECT_PATHS=(~/src ~/src/projects)
    +antigen bundle git
    +antigen bundle git-extras
    +antigen bundle ruby
    +antigen bundle archlinux
    +antigen bundle coffee
    +antigen bundle compleat
    +antigen bundle encode64
    +antigen bundle extract
    +antigen bundle gem
    +antigen bundle npm
    +antigen bundle screen
    +antigen bundle systemd
    +antigen bundle urltools
    +antigen bundle pj
     
    -source $ZSH/oh-my-zsh.sh
    -source $ZSH/lib/key-bindings.zsh
    +antigen bundle zsh-users/zsh-completions
    +antigen bundle zsh-users/zaw
    +antigen bundle zsh-users/zsh-syntax-highlighting
    +antigen theme https://gist.github.com/9263734.git psy
     
    -# Customize to your needs...
    -export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:/home/nk/.gem/ruby/1.9.1/bin:/home/nk/.gem/ruby/1.8/bin
    -
    -PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
    +antigen apply
    +source /usr/share/zsh-dwim/init.zsh
    diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart
    new file mode 100755
    index 0000000..e6452a7
    --- /dev/null
    +++ b/herbstluftwm/autostart
    @@ -0,0 +1,160 @@
    +#!/bin/bash
    +
    +# this is a simple config for herbstluftwm
    +
    +hc() {
    +    herbstclient "$@"
    +}
    +
    +hc emit_hook reload
    +
    +#xsetroot -solid '#5A8E3A'
    +sh ~/.fehbg
    +
    +# remove all existing keybindings
    +hc keyunbind --all
    +
    +# keybindings
    +# if you have a super key you will be much happier with Mod set to Mod4
    +#Mod=Mod1    # Use alt as the main modifier
    +Mod=Mod4   # Use the super key as the main modifier
    +
    +hc keybind $Mod-Shift-q quit
    +hc keybind $Mod-Shift-r reload
    +hc keybind $Mod-Shift-c close
    +hc keybind $Mod-Return spawn urxvt
    +hc keybind $Mod-p spawn dmenu_run -fn "-*-fixed-medium-*-*-*-24-*-*-*-*-*-*-*"
    +hc keybind $Mod-Shift-Return spawn lock
    +
    +# basic movement
    +# focusing clients
    +hc keybind $Mod-Left  focus left
    +hc keybind $Mod-Down  focus down
    +hc keybind $Mod-Up    focus up
    +hc keybind $Mod-Right focus right
    +hc keybind $Mod-h     focus left
    +hc keybind $Mod-j     focus down
    +hc keybind $Mod-k     focus up
    +hc keybind $Mod-l     focus right
    +
    +# moving clients
    +hc keybind $Mod-Shift-Left  shift left
    +hc keybind $Mod-Shift-Down  shift down
    +hc keybind $Mod-Shift-Up    shift up
    +hc keybind $Mod-Shift-Right shift right
    +hc keybind $Mod-Shift-h     shift left
    +hc keybind $Mod-Shift-j     shift down
    +hc keybind $Mod-Shift-k     shift up
    +hc keybind $Mod-Shift-l     shift right
    +
    +# splitting frames
    +# create an empty frame at the specified direction
    +hc keybind $Mod-u       split   bottom  0.5
    +hc keybind $Mod-o       split   right   0.5
    +# let the current frame explode into subframes
    +hc keybind $Mod-Control-space split explode
    +
    +# resizing frames
    +resizestep=0.05
    +hc keybind $Mod-Control-h       resize left +$resizestep
    +hc keybind $Mod-Control-j       resize down +$resizestep
    +hc keybind $Mod-Control-k       resize up +$resizestep
    +hc keybind $Mod-Control-l       resize right +$resizestep
    +hc keybind $Mod-Control-Left    resize left +$resizestep
    +hc keybind $Mod-Control-Down    resize down +$resizestep
    +hc keybind $Mod-Control-Up      resize up +$resizestep
    +hc keybind $Mod-Control-Right   resize right +$resizestep
    +
    +# tags
    +tag_names=( {1..9} )
    +tag_keys=( {1..9} 0 )
    +
    +hc rename default "${tag_names[0]}" || true
    +for i in ${!tag_names[@]} ; do
    +    hc add "${tag_names[$i]}"
    +    key="${tag_keys[$i]}"
    +    if ! [ -z "$key" ] ; then
    +        hc keybind "$Mod-$key" use_index "$i"
    +        hc keybind "$Mod-Shift-$key" move_index "$i"
    +    fi
    +done
    +
    +# cycle through tags
    +hc keybind $Mod-period use_index +1 --skip-visible
    +hc keybind $Mod-comma  use_index -1 --skip-visible
    +
    +# layouting
    +hc keybind $Mod-r remove
    +hc keybind $Mod-space cycle_layout 1
    +hc keybind $Mod-s floating toggle
    +hc keybind $Mod-f fullscreen toggle
    +hc keybind $Mod-t pseudotile toggle
    +
    +# mouse
    +hc mouseunbind --all
    +hc mousebind $Mod-Button1 move
    +hc mousebind $Mod-Button2 zoom
    +hc mousebind $Mod-Button3 resize
    +
    +# focus
    +hc keybind $Mod-BackSpace   cycle_monitor
    +hc keybind $Mod-Tab         cycle_all +1
    +hc keybind $Mod-Shift-Tab   cycle_all -1
    +hc keybind $Mod-c cycle
    +hc keybind $Mod-i jumpto urgent
    +
    +# colors
    +hc set frame_border_active_color '#222222'
    +hc set frame_border_normal_color '#101010'
    +hc set frame_bg_normal_color '#565656'
    +hc set frame_bg_active_color '#345F0C'
    +hc set frame_border_width 1
    +hc set window_border_width 3
    +hc set window_border_inner_width 1
    +hc set window_border_normal_color '#454545'
    +hc set window_border_active_color '#9fbc00'
    +hc set always_show_frame 1
    +hc set frame_bg_transparent 1
    +hc set frame_transparent_width 5
    +hc set frame_gap 4
    +# add overlapping window borders
    +hc set window_gap -2
    +hc set frame_padding 2
    +hc set smart_window_surroundings 0
    +hc set smart_frame_surroundings 1
    +hc set mouse_recenter_gap 0
    +hc set focus_follows_mouse 1
    +hc set focus_stealing_prevention 1
    +
    +# rules
    +hc unrule -F
    +#hc rule class=XTerm tag=3 # move all xterms to tag 3
    +hc rule focus=off # normally do not focus new clients
    +# give focus to most common terminals
    +hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
    +hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
    +hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
    +hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off
    +
    +# special applications
    +hc rule class=feh tag=9 fullscreen=on
    +#hc rule instance=xv class=MPlayer
    +
    +# unlock, just to be sure
    +hc unlock
    +
    +herbstclient set tree_style '╾│ ├└╼─┐'
    +
    +# do multi monitor setup here, e.g.:
    +# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
    +# or simply:
    +hc detect_monitors
    +
    +# find the panel
    +panel=~/.config/herbstluftwm/panel.sh
    +"$panel" $monitor &
    +#[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
    +#for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
    +#    # start it on each monitor
    +#    "$panel" $monitor &
    +#done
    diff --git a/herbstluftwm/panel.sh b/herbstluftwm/panel.sh
    new file mode 100755
    index 0000000..63cd13f
    --- /dev/null
    +++ b/herbstluftwm/panel.sh
    @@ -0,0 +1,41 @@
    +#!/bin/sh
    +
    +hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;}
    +
    +tags() {
    +    output=""
    +
    +    for tag in $(hc tag_status)
    +    do
    +        status=${tag:0:1}
    +        tag_id=${tag:1:1}
    +        case $status in
    +            '#')
    +                item="[$tag_id]"
    +                ;;
    +            ':')
    +                item="[$tag_id]"
    +                ;;
    +            '.')
    +                item="[$tag_id]"
    +                ;;
    +            '*')
    +                item="[$tag_id]"
    +                ;;
    +        esac
    +        action="$item"
    +        output="$output$action"
    +    done
    +
    +    echo $output
    +}
    +
    +panel_height=48
    +
    +for monitor in $(hc list_monitors | cut -d: -f1)
    +do
    +    hc pad $monitor $panel_height
    +done
    +
    +sh ~/.config/herbstluftwm/tag_status.sh | xmobar -d -o
    +
    diff --git a/herbstluftwm/restartpanels.sh b/herbstluftwm/restartpanels.sh
    new file mode 100755
    index 0000000..9d9110c
    --- /dev/null
    +++ b/herbstluftwm/restartpanels.sh
    @@ -0,0 +1,16 @@
    +#!/bin/bash
    +
    +installdir=/
    +
    +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
    +defaultpanel="$XDG_CONFIG_HOME/herbstluftwm/panel.sh"
    +
    +[ -x "$defaultpanel" ] || defaultpanel="$installdir/etc/xdg/herbstluftwm/panel.sh"
    +
    +panelcmd="${1:-$defaultpanel}"
    +
    +herbstclient emit_hook quit_panel
    +
    +for i in $(herbstclient list_monitors | cut -d':' -f1) ; do
    +    "$panelcmd" $i &
    +done
    diff --git a/herbstluftwm/tag_status.sh b/herbstluftwm/tag_status.sh
    new file mode 100755
    index 0000000..8d44aac
    --- /dev/null
    +++ b/herbstluftwm/tag_status.sh
    @@ -0,0 +1,31 @@
    +tags() {
    +    output=""
    +
    +    for tag in $(herbstclient tag_status)
    +    do
    +        status=${tag:0:1}
    +        tag_id=${tag:1:1}
    +        case $status in
    +            '#')
    +                title=$(herbstclient attr clients.focus.title)
    +                [ ${#title} -ge 30 ] && title="${title:0:29}…"
    +                item="[$title]"
    +                ;;
    +            ':')
    +                item="[$tag_id]"
    +                ;;
    +            '.')
    +                item="[$tag_id]"
    +                ;;
    +            '*')
    +                item="[$tag_id]"
    +                ;;
    +        esac
    +        action="$item"
    +        output="$output$action"
    +    done
    +
    +    echo $output
    +}
    +
    +while true; do tags; sleep .5; done
    diff --git a/i3/config b/i3/config
    deleted file mode 100644
    index d0d5204..0000000
    --- a/i3/config
    +++ /dev/null
    @@ -1,184 +0,0 @@
    -# This configuration uses Mod1 and Mod4. Make sure they are mapped properly using xev(1)
    -# and xmodmap(1). Usually, Mod1 is Alt (Alt_L) and Mod4 is Windows (Super_L)
    -
    -# ISO 10646 = Unicode
    -#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
    -font -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
    -#font  -artwiz-nu.de-*-*-*-*-*-*-*-*-*-*-*-*
    -
    -# for i3-msg
    -ipc-socket /tmp/i3-ipc.sock
    -
    -# Use Mouse+Mod1 to drag floating windows to their wanted position
    -floating_modifier Mod1
    -
    -# Fullscreen (Mod1+f)
    -bindsym Mod1+f fullscreen
    -
    -# change container layout (stacked, tabbed, default)
    -bindsym Mod1+s layout stacking
    -bindsym Mod1+w layout tabbed
    -bindsym Mod1+e layout default
    -
    -# Toggle tiling/floating of the current window
    -bindsym Mod4+space floating toggle
    -
    -# Go into the tiling layer / floating layer, depending on whether
    -# the current window is tiling / floating (Mod1+t)
    -bindsym Mod1+space focus mode_toggle
    -
    -# focus the parent container
    -bindsym Mod1+a focus parent
    -# focus the child container
    -bindsym Mod1+d focus child
    -
    -# Focus (Mod4+)
    -bindsym Mod4+Left focus left
    -bindsym Mod4+Down focus down
    -bindsym Mod4+Up focus up
    -bindsym Mod4+Right focus right
    -
    -# Focus Container (Mod1+)
    -bindsym Mod1+Left wch
    -bindsym Mod1+Down wcj
    -bindsym Mod1+Up wck
    -bindsym Mod1+Right wcl
    -
    -# Snap (Mod1+Control+)
    -bindsym Mod4+Control+Left sh
    -bindsym Mod4+Control+Down sj
    -bindsym Mod4+Control+Up sk
    -bindsym Mod4+Control+Right sl
    -
    -# Move (Mod1+Shift+)
    -bindsym Mod4+Shift+Left move left
    -bindsym Mod4+Shift+Down move down
    -bindsym Mod4+Shift+Up move up
    -bindsym Mod4+Shift+Right move right
    -
    -# Move Container (Mod4+Shift+)
    -bindsym Mod1+Shift+Left wcmh
    -bindsym Mod1+Shift+Down wcmj
    -bindsym Mod1+Shift+Up wcmk
    -bindsym Mod1+Shift+Right wcml
    -
    -# Workspaces (Mod1+1/2/…)
    -bindsym Mod1+1 workspace 1: foo
    -bindsym Mod1+2 workspace 2: www
    -bindsym Mod1+3 workspace 3: misc
    -bindsym Mod1+4 workspace 4: mail
    -bindsym Mod1+5 workspace 5
    -bindsym Mod1+6 workspace 6
    -bindsym Mod1+7 workspace 7
    -bindsym Mod1+8 workspace 8
    -bindsym Mod1+9 workspace 9: feh
    -bindsym Mod1+0 workspace 10
    -
    -# Move to Workspaces
    -bindsym Mod1+Shift+1 move workspace 1: foo
    -bindsym Mod1+Shift+2 move workspace 2: www
    -bindsym Mod1+Shift+3 move workspace 3: misc
    -bindsym Mod1+Shift+4 move workspace 4: mail
    -bindsym Mod1+Shift+5 move workspace 5
    -bindsym Mod1+Shift+6 move workspace 6
    -bindsym Mod1+Shift+7 move workspace 7
    -bindsym Mod1+Shift+8 move workspace 8
    -bindsym Mod1+Shift+9 move workspace 9: feh
    -bindsym Mod1+Shift+0 move workspace 10
    -
    -# Mod1+Shift+q kills the current client
    -bindsym Mod1+Shift+q kill
    -
    -# Mod1+v starts dmenu and launches the selected application
    -# for now, we don’t have an own launcher
    -bindsym Mod1+v exec /usr/bin/dmenu_run
    -
    -# reload the configuration file
    -bindsym Mod1+Shift+c reload
    -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
    -bindsym Mod1+Shift+r restart
    -# exit i3 (logs you out of your X session)
    -bindsym Mod1+Shift+e exit
    -
    -# split container
    -bindsym Mod4+v split v
    -bindsym Mod4+h split h
    -
    -# toggle border styles
    -bindsym Mod1+b border toggle
    -
    -mode "resize" {
    -  bindsym Left resize grow left
    -  bindsym Shift+Left resize shrink left
    -  bindsym Down resize grow bottom
    -  bindsym Shift+Down resize shrink bottom
    -  bindsym Up resize grow top
    -  bindsym Shift+Up resize shrink top
    -  bindsym Right resize grow right
    -  bindsym Shift+Right resize shrink right
    -  bindsym Return mode "default"
    -  bindsym Escape mode "default"
    -}
    -bindsym mod4+r mode "resize"
    -
    -# workspaces
    -workspace "1: foo" output LVDS1
    -workspace "2: www" output LVDS1
    -workspace "3: misc" output LVDS1
    -workspace "4: mail" output LVDS1
    -workspace "5: stuff" output VGA1
    -workspace "5: stuff" output HDMI1
    -workspace "9: feh" output LVDS1
    -
    -# I want fixed window behaviours
    -assign [class="^Firefox$"] → 2: www
    -assign [class="pidgin"] → 3: misc
    -assign [class="Examining"] → 10
    -assign [class="Transferring"] → 10
    -assign [class="^Thunderbird$"] → 4: mail
    -assign [class="^feh$"] → 9: feh
    -
    -for_window [class="^Generator-gtk$"] floating enable
    -for_window [class="^MPlayer$"] floating enable
    -
    -# program shortcuts
    -bindcode Mod4+36 exec /usr/local/bin/urxvt
    -#bindcode Mod4+46 exec /usr/bin/alock -bg shade:shade=20 -auth pam -cursor theme:name=xtr
    -bindcode Mod4+46 exec /usr/bin/i3lock -i ~/pics/screensaver.png -p win
    -bindcode Mod4+65 exec /usr/bin/uzbl-tabbed
    -bindsym XF86WebCam exec /usr/bin/scrot -d 0
    -bindsym XF86AudioRaiseVolume exec /usr/bin/vol_up
    -bindsym XF86AudioLowerVolume exec /usr/bin/vol_down
    -bindsym XF86AudioMute exec /usr/bin/mute_toggle
    -
    -# multimedia keys
    -#bindsym XF86AudioLowerVolume exec 
    -#bindsym XF86AudioRaiseVolume
    -
    -#bar {
    -#  mode dock
    -#  output LVDS1
    -#  tray_output LVDS1
    -#  status_command i3status --config ~/.config/i3/i3status
    -#  position: bottom
    -#  colors {
    -#    background #000000
    -#    statusline #AAAAAA
    -#  }
    -#}
    -
    -bar {
    -  status_command i3status --config ~/.config/i3/i3status
    -}
    -
    -# colors
    -# class                 border  bg      fg
    -client.unfocused        #333333 #000000 #777777
    -client.focused          #AAAAAA #555555 #FFFFFF
    -client.focused_inactive #AAAAAA #000000 #777777
    -
    -exec setxkbmap de
    -exec source .fehbg
    -exec archassistant
    -## x.flux ...for a nicer feeling in the eyes
    -exec redshift -l 51.332254:12.362 -t 6500K:4800K -m vidmode
    diff --git a/i3/i3status b/i3/i3status
    deleted file mode 100644
    index b724bd9..0000000
    --- a/i3/i3status
    +++ /dev/null
    @@ -1,58 +0,0 @@
    -general {
    -    colors = true
    -    interval = 2
    -}
    -
    -order = "disk /"
    -order += "disk /home"
    -order += "disk /tmp"
    -order += "wireless wlan0"
    -order += "ethernet eth0"
    -order += "battery 1"
    -order += "cpu_temperature 0"
    -order += "load"
    -order += "time"
    -
    -wireless wlan0 {
    -    format_up = "%quality@%essid (%bitrate)"
    -    format_down = "no wlan"
    -}
    -
    -ethernet eth0 {
    -    # if you use %speed, i3status requires root privileges
    -    format_up = "%ip (%speed)"
    -    format_down = "no eth"
    -}
    -
    -battery 1 {
    -    last_full_capacity = true
    -    format = "%status %percentage %remaining"
    -}
    -
    -#run_watch DHCP {
    -#    pidfile = "/var/run/dhclient*.pid"
    -#}
    -
    -time {
    -    format = "%Y-%m-%d %H:%M:%S"
    -}
    -
    -cpu_temperature 0 {
    -    format = "%degrees°C"
    -}
    -
    -load {
    -    format = "%1min"
    -}
    -
    -disk "/" {
    -    format = "%free"
    -}
    -
    -disk "/home" {
    -    format = "%free"
    -}
    -
    -disk "/tmp" {
    -    format = "%free"
    -}
    diff --git a/subtle/grabs.rb b/subtle/grabs.rb
    deleted file mode 100644
    index 977bb10..0000000
    --- a/subtle/grabs.rb
    +++ /dev/null
    @@ -1,189 +0,0 @@
    -#
    -# == Grabs
    -#
    -# Grabs are keyboard and mouse actions within subtle, every grab can be
    -# assigned either to a key and/or to a mouse button combination. A grab
    -# consists of a chain and an action.
    -#
    -# === Finding keys
    -#
    -# The best resource for getting the correct key names is
    -# */usr/include/X11/keysymdef.h*, but to make life easier here are some hints
    -# about it:
    -#
    -# * Numbers and letters keep their names, so *a* is *a* and *0* is *0*
    -# * Keypad keys need *KP_* as prefix, so *KP_1* is *1* on the keypad
    -# * Strip the *XK_* from the key names if looked up in
    -#   /usr/include/X11/keysymdef.h
    -# * Keys usually have meaningful english names
    -# * Modifier keys have special meaning (Alt (A), Control (C), Meta (M),
    -#   Shift (S), Super (W))
    -#
    -# === Chaining
    -#
    -# Chains are a combination of keys and modifiers to one or a list of keys
    -# and can be used in various ways to trigger an action. In subtle, there are
    -# two ways to define chains for grabs:
    -#
    -#   1. *Default*: Add modifiers to a key and use it for a grab
    -#
    -#      *Example*: grab "W-Return", "urxvt"
    -#
    -#   2. *Chain*: Define a list of grabs that need to be pressed in order
    -#
    -#      *Example*: grab "C-y Return", "urxvt"
    -#
    -# ==== Mouse buttons
    -#
    -# [*B1*]  = Button1 (Left mouse button)
    -# [*B2*]  = Button2 (Middle mouse button)
    -# [*B3*]  = Button3 (Right mouse button)
    -# [*B4*]  = Button4 (Mouse wheel up)
    -# [*B5*]  = Button5 (Mouse wheel down)
    -# [*...*]
    -# [*B20*] = Button20 (Are you sure that this is a mouse and not a keyboard?)
    -#
    -# ==== Modifiers
    -#
    -# [*A*] = Alt key (Mod1)
    -# [*C*] = Control key
    -# [*M*] = Meta key (Mod3)
    -# [*S*] = Shift key
    -# [*W*] = Super/Windows key (Mod4)
    -# [*G*] = Alt Gr (Mod5)
    -#
    -# === Action
    -#
    -# An action is something that happens when a grab is activated, this can be one
    -# of the following:
    -#
    -# [*symbol*] Run a subtle action
    -# [*string*] Start a certain program
    -# [*array*]  Cycle through gravities
    -# [*lambda*] Run a Ruby proc
    -#
    -# === Example
    -#
    -# This will create a grab that starts a urxvt when Alt+Enter are pressed:
    -#
    -#   grab "A-Return", "urxvt"
    -#   grab "C-a c",    "urxvt"
    -#
    -# === Link
    -#
    -# http://subforge.org/projects/subtle/wiki/Grabs
    -#
    -
    -# Jump to view1, view2, ...
    -grab "W-S-1", :ViewJump1
    -grab "W-S-2", :ViewJump2
    -grab "W-S-3", :ViewJump3
    -grab "W-S-4", :ViewJump4
    -grab "W-S-5", :ViewJump5
    -grab "W-S-6", :ViewJump6
    -grab "W-S-7", :ViewJump7
    -grab "W-S-8", :ViewJump8
    -grab "W-S-9", :ViewJump9
    -
    -# Switch current view
    -grab "W-1", :ViewSwitch1
    -grab "W-2", :ViewSwitch2
    -grab "W-3", :ViewSwitch3
    -grab "W-4", :ViewSwitch4
    -grab "W-5", :ViewSwitch5
    -grab "W-6", :ViewSwitch6
    -grab "W-7", :ViewSwitch7
    -grab "W-8", :ViewSwitch8
    -grab "W-9", :ViewSwitch9
    -
    -# Select next and prev view */
    -grab "KP_Add",      :ViewNext
    -grab "KP_Subtract", :ViewPrev
    -grab "W-Right",     :ViewNext
    -grab "W-Left",      :ViewPrev
    -
    -# Move mouse to screen1, screen2, ...
    -grab "W-A-1", :ScreenJump1
    -grab "W-A-2", :ScreenJump2
    -grab "W-A-3", :ScreenJump3
    -grab "W-A-4", :ScreenJump4
    -
    -# Force reload of config and sublets
    -grab "W-C-r", :SubtleReload
    -
    -# Force restart of subtle
    -grab "W-C-S-r", :SubtleRestart
    -
    -# Quit subtle
    -grab "W-C-q", :SubtleQuit
    -
    -# Move current window
    -grab "W-B1", :WindowMove
    -
    -# Resize current window
    -grab "W-B3", :WindowResize
    -
    -# Toggle floating mode of window
    -grab "W-space", :WindowFloat
    -
    -# Toggle fullscreen mode of window
    -grab "W-f", :WindowFull
    -
    -# Toggle sticky mode of window (will be visible on all views)
    -grab "W-S-s", :WindowStick
    -
    -# Toggle zaphod mode of window (will span across all screens)
    -grab "W-equal", :WindowZaphod
    -
    -# Raise window
    -grab "W-plus", :WindowRaise
    -
    -# Lower window
    -grab "W-minus", :WindowLower
    -
    -# Select next windows
    -grab "W-Left",  :WindowLeft
    -grab "W-Down",  :WindowDown
    -grab "W-Up",    :WindowUp
    -grab "W-Right", :WindowRight
    -
    -# Kill current window
    -grab "W-S-k", :WindowKill
    -
    -# Cycle between given gravities
    -#grab "W-KP_7", [ :top_left,     :top_left66,     :top_left33     ]
    -#grab "W-KP_8", [ :top,          :top66,          :top33          ]
    -#grab "W-KP_9", [ :top_right,    :top_right66,    :top_right33    ]
    -#grab "W-KP_4", [ :left,         :left66,         :left33         ]
    -#grab "W-KP_5", [ :center,       :center66,       :center33       ]
    -#grab "W-KP_6", [ :right,        :right66,        :right33        ]
    -#grab "W-KP_1", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
    -#grab "W-KP_2", [ :bottom,       :bottom66,       :bottom33       ]
    -#grab "W-KP_3", [ :bottom_right, :bottom_right66, :bottom_right33 ]
    -
    -# In case no numpad is available e.g. on notebooks
    -grab "W-q", [ :top_left,     :top_left66,     :top_left33     ]
    -grab "W-w", [ :top,          :top66,          :top33          ]
    -grab "W-e", [ :top_right,    :top_right66,    :top_right33    ]
    -grab "W-a", [ :left,         :left60,         :left33         ]
    -grab "W-s", [ :center,       :center66,       :center33       ]
    -grab "W-d", [ :right,        :right66,        :right40        ]
    -grab "W-y", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
    -grab "W-x", [ :bottom,       :bottom66,       :bottom33       ]
    -grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
    -
    -# Exec programs
    -grab "W-Return", "urxvt"
    -grab "W-l", "i3lock -i ~/pics/screensaver.png -p win"
    -grab "W-p" do
    -  Subtle::Contrib::Launcher.run
    -end
    -
    -# Run Ruby lambdas
    -grab "S-F2" do |c|
    -  puts c.name
    -end
    -
    -grab "S-F3" do
    -  puts Subtlext::VERSION
    -end
    diff --git a/subtle/gravities.rb b/subtle/gravities.rb
    deleted file mode 100644
    index 8aa0782..0000000
    --- a/subtle/gravities.rb
    +++ /dev/null
    @@ -1,74 +0,0 @@
    -#
    -# == Gravities
    -#
    -# Gravities are predefined sizes a window can be set to. There are several ways
    -# to set a certain gravity, most convenient is to define a gravity via a tag or
    -# change them during runtime via grab. Subtler and subtlext can also modify
    -# gravities.
    -#
    -# A gravity consists of four values which are a percentage value of the screen
    -# size. The first two values are x and y starting at the center of the screen
    -# and he last two values are the width and height.
    -#
    -# === Example
    -#
    -# Following defines a gravity for a window with 100% width and height:
    -#
    -#   gravity :example, [ 0, 0, 100, 100 ]
    -#
    -# === Link
    -#
    -# http://subforge.org/projects/subtle/wiki/Gravity
    -#
    -
    -# Top left
    -gravity :top_left,       [   0,   0,  50,  50 ]
    -gravity :top_left66,     [   0,   0,  50,  66 ]
    -gravity :top_left33,     [   0,   0,  50,  34 ]
    -
    -# Top
    -gravity :top,            [   0,   0, 100,  50 ]
    -gravity :top66,          [   0,   0, 100,  66 ]
    -gravity :top33,          [   0,   0, 100,  34 ]
    -
    -# Top right
    -gravity :top_right,      [  50,   0,  50,  50 ]
    -gravity :top_right66,    [  50,   0,  50,  66 ]
    -gravity :top_right33,    [  50,   0,  50,  33 ]
    -
    -# Left
    -gravity :left,           [   0,   0,  50, 100 ]
    -gravity :left66,         [   0,   0,  66, 100 ]
    -gravity :left60,         [   0,   0,  60, 100 ], :horz
    -gravity :left33,         [   0,   0,  33, 100 ]
    -
    -# Center
    -gravity :center,         [   0,   0, 100, 100 ]
    -gravity :center66,       [  17,  17,  66,  66 ]
    -gravity :center33,       [  33,  33,  33,  33 ]
    -
    -# Right
    -gravity :right,          [  50,   0,  50, 100 ]
    -gravity :right66,        [  34,   0,  66, 100 ]
    -gravity :right33,        [  67,   0,  33, 100 ]
    -gravity :right40,        [  60,   0,  40, 100 ], :vert
    -
    -# Bottom left
    -gravity :bottom_left,    [   0,  50,  50,  50 ]
    -gravity :bottom_left66,  [   0,  34,  50,  66 ]
    -gravity :bottom_left33,  [   0,  67,  50,  33 ]
    -
    -# Bottom
    -gravity :bottom,         [   0,  50, 100,  50 ]
    -gravity :bottom66,       [   0,  34, 100,  66 ]
    -gravity :bottom33,       [   0,  67, 100,  33 ]
    -
    -# Bottom right
    -gravity :bottom_right,   [  50,  50,  50,  50 ]
    -gravity :bottom_right66, [  50,  34,  50,  66 ]
    -gravity :bottom_right33, [  50,  67,  50,  33 ]
    -
    -# Gimp
    -gravity :gimp_image,     [  10,   0,  80, 100 ]
    -gravity :gimp_toolbox,   [   0,   0,  10, 100 ]
    -gravity :gimp_dock,      [  90,   0,  10, 100 ]
    diff --git a/subtle/hooks.rb b/subtle/hooks.rb
    deleted file mode 100644
    index 3f2066a..0000000
    --- a/subtle/hooks.rb
    +++ /dev/null
    @@ -1,41 +0,0 @@
    -#
    -# == Hooks
    -#
    -# And finally hooks are a way to bind Ruby scripts to a certain event.
    -#
    -# Following hooks exist so far:
    -#
    -# [*:client_create*]    Called whenever a window is created
    -# [*:client_configure*] Called whenever a window is configured
    -# [*:client_focus*]     Called whenever a window gets focus
    -# [*:client_kill*]      Called whenever a window is killed
    -#
    -# [*:tag_create*]       Called whenever a tag is created
    -# [*:tag_kill*]         Called whenever a tag is killed
    -#
    -# [*:view_create*]      Called whenever a view is created
    -# [*:view_configure*]   Called whenever a view is configured
    -# [*:view_jump*]        Called whenever the view is switched
    -# [*:view_kill*]        Called whenever a view is killed
    -#
    -# [*:tile*]             Called on whenever tiling would be needed
    -# [*:reload*]           Called on reload
    -# [*:start*]            Called on start
    -# [*:exit*]             Called on exit
    -#
    -# === Example
    -#
    -# This hook will print the name of the window that gets the focus:
    -#
    -#   on :client_focus do |c|
    -#     puts c.name
    -#   end
    -#
    -# === Link
    -#
    -# http://subforge.org/projects/subtle/wiki/Hooks
    -#
    -on :start do
    -  %x(sh /home/nk/.fehbg)
    -  spawn(*('conky -b -d'.split))
    -end
    diff --git a/subtle/options.rb b/subtle/options.rb
    deleted file mode 100644
    index ca9ccc5..0000000
    --- a/subtle/options.rb
    +++ /dev/null
    @@ -1,17 +0,0 @@
    -#
    -# == Options
    -#
    -# Following options change behaviour and sizes of the window manager:
    -#
    -
    -set :increase_step, 5
    -set :border_snap, 10
    -set :default_gravity, :center
    -set :urgent_dialogs, false
    -set :honor_size_hints, false
    -set :gravity_tiling, true
    -set :click_to_focus, false
    -set :skip_pointer_warp, false
    -set :skip_urgent_warp, false
    -# Set the WM_NAME of subtle (Java quirk)
    -# set :wmname, "LG3D"
    diff --git a/subtle/panel.rb b/subtle/panel.rb
    deleted file mode 100644
    index f61b846..0000000
    --- a/subtle/panel.rb
    +++ /dev/null
    @@ -1,57 +0,0 @@
    -#
    -# == Screen
    -#
    -# Generally subtle comes with two panels per screen, one on the top and one at
    -# the bottom. Each panel can be configured with different panel items and
    -# sublets screen wise. The default config uses top panel on the first screen
    -# only, it's up to the user to enable the bottom panel or disable either one
    -# or both.
    -
    -# === Properties
    -#
    -# [*stipple*]    This property adds a stipple pattern to both screen panels.
    -#
    -#                Example: stipple "~/stipple.xbm"
    -#                         stipple Subtlext::Icon.new("~/stipple.xbm")
    -#
    -# [*top*]        This property adds a top panel to the screen.
    -#
    -#                Example: top [ :views, :title ]
    -#
    -# [*bottom*]     This property adds a bottom panel to the screen.
    -#
    -#                Example: bottom [ :views, :title ]
    -
    -#
    -# Following items are available for the panels:
    -#
    -# [*:views*]     List of views with buttons
    -# [*:title*]     Title of the current active window
    -# [*:tray*]      Systray icons (Can be used only once)
    -# [*:keychain*]  Display current chain (Can be used only once)
    -# [*:sublets*]   Catch-all for installed sublets
    -# [*:sublet*]    Name of a sublet for direct placement
    -# [*:spacer*]    Variable spacer (free width / count of spacers)
    -# [*:center*]    Enclose items with :center to center them on the panel
    -# [*:separator*] Insert separator
    -#
    -# Empty panels are hidden.
    -#
    -# === Links
    -#
    -# http://subforge.org/projects/subtle/wiki/Multihead
    -# http://subforge.org/projects/subtle/wiki/Panel
    -#
    -
    -screen 1 do
    -  top    [ :views, :spacer, :title ]
    -  bottom [ :mpd, :spacer, :wifi, :ipaddr, :battery, :spacer, :fuzzytime, :tray ]
    -end
    -
    -# Example for a second screen:
    -#screen 2 do
    -#  top    [ :views, :title, :spacer ]
    -#  bottom [ ]
    -#end
    -
    -
    diff --git a/subtle/styles.rb b/subtle/styles.rb
    deleted file mode 100644
    index fad3b37..0000000
    --- a/subtle/styles.rb
    +++ /dev/null
    @@ -1,89 +0,0 @@
    -#
    -# == Styles
    -#
    -# Styles define various properties of styleable items in a CSS-like syntax.
    -#
    -# If no background color is given no color will be set. This will ensure a
    -# custom background pixmap won't be overwritten.
    -#
    -# Following properties are available for most the styles:
    -#
    -# [*foreground*] Foreground text color
    -# [*background*] Background color
    -# [*margin*]     Outer spacing
    -# [*border*]     Border color and size
    -# [*padding*]    Inner spacing
    -# [*font*]       Font string (xftontsel or xft)
    -#
    -# === Link
    -#
    -# http://subforge.org/projects/subtle/wiki/Styles
    -
    -# Style for all style elements
    -style :all do
    -  background  C[:brown]
    -  icon        "#757575"
    -  border      "#303030", 0
    -  padding     0, 3
    -  #font        "-*-webbycaps-*-*-*-*-7-*-*-*-*-*-*-*"
    -  font        "xft:monofur:pixelsize=14"
    -  #font        "xft:sans-8"
    -end
    -
    -# Style for the all views
    -style :views do
    -  foreground    "#757575"
    -  border_top    C[:brown], 1
    -  border_bottom C[:brown], 1
    -  padding_top -2
    -  padding_bottom -2
    -
    -  # Style for the active views
    -  style :focus do
    -    foreground    C[:orange]
    -  end
    -
    -  # Style for urgent window titles and views
    -  style :urgent do
    -    foreground  C[:red]
    -    border_top    C[:mild_orange], 2
    -    border_bottom C[:mild_orange], 2
    -  end
    -
    -  # Style for occupied views (views with clients)
    -  style :occupied do
    -    foreground  "#b8b8b8"
    -  end
    -end
    -
    -# Style for sublets
    -style :sublets do
    -  foreground  C[:orange]
    -end
    -
    -# Style for separator
    -style :separator do
    -  foreground  "#757575"
    -  separator   "|"
    -end
    -
    -# Style for focus window title
    -style :title do
    -  foreground  C[:orange]
    -end
    -
    -# Style for active/inactive windows
    -style :clients do
    -  active    "#303030", 2
    -  inactive  "#202020", 2
    -  margin    0
    -  width     50
    -end
    -
    -# Style for subtle
    -style :subtle do
    -  margin      0, 0, 0, 0
    -  panel       "#2D2815"
    -  background  "#3d3d3d"
    -  stipple     "#757575"
    -end
    diff --git a/subtle/sublets.rb b/subtle/sublets.rb
    deleted file mode 100644
    index 90b6fb0..0000000
    --- a/subtle/sublets.rb
    +++ /dev/null
    @@ -1,50 +0,0 @@
    -#
    -# == Sublets
    -#
    -# Sublets are Ruby scripts that provide data for the panel and can be managed
    -# with the sur script that comes with subtle.
    -#
    -# === Example
    -#
    -#  sur install clock
    -#  sur uninstall clock
    -#  sur list
    -#
    -# === Configuration
    -#
    -# All sublets have a set of configuration values that can be changed directly
    -# from the config of subtle.
    -#
    -# There are three default properties, that can be be changed for every sublet:
    -#
    -# [*interval*]    Update interval of the sublet
    -# [*foreground*]  Default foreground color
    -# [*background*]  Default background color
    -#
    -# sur can also give a brief overview about properties:
    -#
    -# === Example
    -#
    -#   sur config clock
    -#
    -# The syntax of the sublet configuration is similar to other configuration
    -# options in subtle:
    -#
    -# === Example
    -#
    -#  sublet :clock do
    -#    interval      30
    -#    foreground    "#eeeeee"
    -#    background    "#000000"
    -#    format_string "%H:%M:%S"
    -#  end
    -#
    -#  === Link
    -#
    -# http://subforge.org/projects/subtle/wiki/Sublets
    -#
    -
    -sublet :fuzzytime do
    -  interval    60
    -  locale      "de"
    -end
    diff --git a/subtle/subtle.rb b/subtle/subtle.rb
    deleted file mode 100644
    index 85c5820..0000000
    --- a/subtle/subtle.rb
    +++ /dev/null
    @@ -1,42 +0,0 @@
    -# -*- encoding: utf-8 -*-
    -#
    -# Author::  Christoph Kappel 
    -# Version:: $Id: data/subtle.rb,v 3182 2012/02/04 16:39:33 unexist $
    -# License:: GNU GPLv2
    -#
    -# = Subtle default configuration
    -#
    -# This file will be installed as default and can also be used as a starter for
    -# an own custom configuration file. The system wide config usually resides in
    -# +/etc/xdg/subtle+ and the user config in +HOME/.config/subtle+, both locations
    -# are dependent on the locations specified by +XDG_CONFIG_DIRS+ and
    -# +XDG_CONFIG_HOME+.
    -#
    -
    -$LOAD_PATH.unshift "/usr/share/subtle-contrib-hg/"
    -require "launcher.rb"
    -Subtle::Contrib::Launcher.fonts = [
    -  "xft:monofur:pixelsize=80",
    -  "xft:monofur:pixelsize=16",
    -]
    -
    -C = {
    -  :orange => "#FD971F",
    -  :mild_orange => "#A36D2E",
    -  :brown  => "#2D2815",
    -  :red    => "#F92672",
    -  :yellow => "#FECF35",
    -  :green  => "#A6E22E"
    -}
    -
    -load_config 'options.rb'
    -load_config 'gravities.rb'
    -load_config 'styles.rb'
    -load_config 'panel.rb'
    -load_config 'grabs.rb'
    -load_config 'tags.rb'
    -load_config 'views.rb'
    -load_config 'sublets.rb'
    -load_config 'hooks.rb'
    -
    -# vim:ts=2:bs=2:sw=2:et:fdm=marker
    diff --git a/subtle/tags.rb b/subtle/tags.rb
    deleted file mode 100644
    index 99f397a..0000000
    --- a/subtle/tags.rb
    +++ /dev/null
    @@ -1,222 +0,0 @@
    -#
    -# == Tags
    -#
    -# Tags are generally used in subtle for placement of windows. This placement is
    -# strict, that means that - aside from other tiling window managers - windows
    -# must have a matching tag to be on a certain view. This also includes that
    -# windows that are started on a certain view will not automatically be placed
    -# there.
    -#
    -# There are to ways to define a tag:
    -#
    -# === Simple
    -#
    -# The simple way just needs a name and a regular expression to just handle the
    -# placement:
    -#
    -# Example:
    -#
    -#  tag "terms", "terms"
    -#
    -# === Extended
    -#
    -# Additionally tags can do a lot more then just control the placement - they
    -# also have properties than can define and control some aspects of a window
    -# like the default gravity or the default screen per view.
    -#
    -# Example:
    -#
    -#  tag "terms" do
    -#    match   "xterm|[u]?rxvt"
    -#    gravity :center
    -#  end
    -#
    -# === Default
    -#
    -# Whenever a window has no tag it will get the default tag and be placed on the
    -# default view. The default view can either be set by the user with adding the
    -# default tag to a view by choice or otherwise the first defined view will be
    -# chosen automatically.
    -#
    -# === Properties
    -#
    -# [*borderless*] This property enables the borderless mode for tagged clients.
    -#
    -#                Example: borderless true
    -#                Links:    http://subforge.org/projects/subtle/wiki/Tagging#Borderless
    -#                          http://subforge.org/projects/subtle/wiki/Clients#Borderless
    -#
    -# [*fixed*]      This property enables the fixed mode for tagged clients.
    -#
    -#                Example: fixed true
    -#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Fixed
    -#                         http://subforge.org/projects/subtle/wiki/Clients#Fixed
    -#
    -# [*float*]      This property enables the float mode for tagged clients.
    -#
    -#                Example: float true
    -#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Float
    -#                         http://subforge.org/projects/subtle/wiki/Clients#Float
    -#
    -# [*full*]       This property enables the fullscreen mode for tagged clients.
    -#
    -#                Example: full true
    -#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Fullscreen
    -#                         http://subforge.org/projects/subtle/wiki/Clients#Fullscreen
    -#
    -# [*geometry*]   This property sets a certain geometry as well as floating mode
    -#                to the tagged client, but only on views that have this tag too.
    -#                It expects an array with x, y, width and height values whereas
    -#                width and height must be >0.
    -#
    -#                Example: geometry [100, 100, 50, 50]
    -#                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Geometry
    -#
    -# [*gravity*]    This property sets a certain to gravity to the tagged client,
    -#                but only on views that have this tag too.
    -#
    -#                Example: gravity :center
    -#                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Gravity
    -#
    -# [*match*]      This property adds matching patterns to a tag, a tag can have
    -#                more than one. Matching works either via plaintext, regex
    -#                (see man regex(7)) or window id. Per default tags will only
    -#                match the WM_NAME and the WM_CLASS portion of a client, this
    -#                can be changed with following possible values:
    -#
    -#                [*:name*]      Match the WM_NAME
    -#                [*:instance*]  Match the first (instance) part from WM_CLASS
    -#                [*:class*]     Match the second (class) part from WM_CLASS
    -#                [*:role*]      Match the window role
    -#                [*:type*]      Match the window type
    -#
    -#                Examples: match instance: "urxvt"
    -#                          match [:role, :class] => "test"
    -#                          match "[xa]+term"
    -#                Link:     http://subforge.org/projects/subtle/wiki/Tagging#Match
    -#
    -# [*position*]   Similar to the geometry property, this property just sets the
    -#                x/y coordinates of the tagged client, but only on views that
    -#                have this tag, too. It expects an array with x and y values.
    -#
    -#                Example: position [ 10, 10 ]
    -#                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Position
    -#
    -# [*resize*]     This property enables the float mode for tagged clients. When set,
    -#                subtle honors size hints, that define various size constraints like
    -#                sizes for columns and rows of a terminal.
    -#
    -#                Example: resize true
    -#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Resize
    -#                         http://subforge.org/projects/subtle/wiki/Clients#Resize
    -#
    -# [*stick*]      This property enables the stick mode for tagged clients. When set,
    -#                clients are visible on all views, even when they don't have matching
    -#                tags. On multihead, sticky clients keep the screen they are assigned
    -#                on.
    -#
    -#                Supported values are either true or a number to specify a screen.
    -#
    -#                Example: stick true
    -#                         stick 1
    -#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Stick
    -#                         http://subforge.org/projects/subtle/wiki/Clients#Stick
    -#
    -# [*type*]       This property sets the tagged client to be treated as a specific
    -#                window type though as the window sets the type itself. Following
    -#                types are possible:
    -#
    -#                [*:desktop*]  Treat as desktop window (_NET_WM_WINDOW_TYPE_DESKTOP)
    -#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Desktop
    -#                [*:dock*]     Treat as dock window (_NET_WM_WINDOW_TYPE_DOCK)
    -#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Dock
    -#                [*:toolbar*]  Treat as toolbar windows (_NET_WM_WINDOW_TYPE_TOOLBAR)
    -#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Toolbar
    -#                [*:splash*]   Treat as splash window (_NET_WM_WINDOW_TYPE_SPLASH)
    -#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Splash
    -#                [*:dialog*]   Treat as dialog window (_NET_WM_WINDOW_TYPE_DIALOG)
    -#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Dialog
    -#
    -#                Example: type :desktop
    -#                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Type
    -#
    -# [*urgent*]     This property enables the urgent mode for tagged clients. When set,
    -#                subtle automatically sets this client to urgent.
    -#
    -#                Example: urgent true
    -#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Stick
    -#                         http://subforge.org/projects/subtle/wiki/Clients#Urgent
    -#
    -# [*zaphod*]     This property enables the zaphod mode for tagged clients. When set,
    -#                the client spans across all connected screens.
    -#
    -#                Example: zaphod true
    -#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Zaphod
    -#                         http://subforge.org/projects/subtle/wiki/Clients#Zaphod
    -#
    -#
    -# === Link
    -#
    -# http://subforge.org/projects/subtle/wiki/Tagging
    -#
    -
    -# Simple tags
    -tag "terms" do
    -  match "xterm|[u]?rxvt"
    -  gravity :left60
    -end
    -
    -tag "browser",  "uzbl|opera|firefox|navigator"
    -tag "feh",      "feh"
    -
    -# Placement
    -tag "editor" do
    -  match  "[g]?vim"
    -  resize true
    -end
    -
    -tag "fixed" do
    -  geometry [ 10, 10, 100, 100 ]
    -  stick    true
    -end
    -
    -tag "resize" do
    -  match  "sakura|gvim"
    -  resize true
    -end
    -
    -tag "gravity" do
    -  gravity :center
    -end
    -
    -# Modes
    -tag "stick" do
    -  match "mplayer"
    -  float true
    -  stick true
    -end
    -
    -tag "float" do
    -  match "display"
    -  float true
    -end
    -
    -# Gimp
    -tag "gimp_image" do
    -  match   :role => "gimp-image-window"
    -  gravity :gimp_image
    -end
    -
    -tag "gimp_toolbox" do
    -  match   :role => "gimp-toolbox$"
    -  gravity :gimp_toolbox
    -end
    -
    -tag "gimp_dock" do
    -  match   :role => "gimp-dock"
    -  gravity :gimp_dock
    -end
    -
    -tag "gimp_scum" do
    -  match role: "gimp-.*|screenshot"
    -end
    diff --git a/subtle/views.rb b/subtle/views.rb
    deleted file mode 100644
    index 3b016b5..0000000
    --- a/subtle/views.rb
    +++ /dev/null
    @@ -1,76 +0,0 @@
    -#
    -# == Views
    -#
    -# Views are the virtual desktops in subtle, they show all windows that share a
    -# tag with them. Windows that have no tag will be visible on the default view
    -# which is the view with the default tag or the first defined view when this
    -# tag isn't set.
    -#
    -# Like tags views can be defined in two ways:
    -#
    -# === Simple
    -#
    -# The simple way is exactly the same as for tags:
    -#
    -# Example:
    -#
    -#   view "terms", "terms"
    -#
    -# === Extended
    -#
    -# The extended way for views is also similar to the tags, but with fewer
    -# properties.
    -#
    -# Example:
    -#
    -#  view "terms" do
    -#    match "terms"
    -#    icon  "/usr/share/icons/icon.xbm"
    -#  end
    -#
    -# === Properties
    -#
    -# [*match*]      This property adds a matching pattern to a view. Matching
    -#                works either via plaintext or regex (see man regex(7)) and
    -#                applies to names of tags.
    -#
    -#                Example: match "terms"
    -#
    -# [*dynamic*]    This property hides unoccupied views, views that display no
    -#                windows.
    -#
    -#                Example: dynamic true
    -#
    -# [*icon*]       This property adds an icon in front of the view name. The
    -#                icon can either be path to an icon or an instance of
    -#                Subtlext::Icon.
    -#
    -#                Example: icon "/usr/share/icons/icon.xbm"
    -#                         icon Subtlext::Icon.new("/usr/share/icons/icon.xbm")
    -#
    -# [*icon_only*]  This property hides the view name from the view buttons, just
    -#                the icon will be visible.
    -#
    -#                Example: icon_only true
    -#
    -#
    -# === Link
    -#
    -# http://subforge.org/projects/subtle/wiki/Tagging
    -#
    -
    -view "terms", "terms"
    -view "www",   "browser"
    -view "misc0" do
    -  match "gimp_.*|default"
    -  dynamic true
    -end
    -6.times do |i|
    -  view "misc#{i}" do
    -    dynamic true
    -  end
    -end
    -view "feh" do
    -  match "feh"
    -  dynamic true
    -end
    diff --git a/wmfs/keysrc b/wmfs/keysrc
    deleted file mode 100644
    index deb8a9e..0000000
    --- a/wmfs/keysrc
    +++ /dev/null
    @@ -1,107 +0,0 @@
    -[keys]
    -
    -  [key] mod = {"Super"} key = "Return" func = "spawn" cmd = "urxvt || xterm" [/key]
    -
    -  [key] mod = {"Control", "Alt"} key = "q" func = "quit" [/key]
    -  [key] mod = {"Control", "Alt"} key = "r" func = "reload" [/key]
    -
    -  # Tag manipulation
    -  [key] mod = {"Super"} key = "1" func = "tag_set" cmd = "0" [/key]
    -  [key] mod = {"Super"} key = "2" func = "tag_set" cmd = "1" [/key]
    -  [key] mod = {"Super"} key = "3" func = "tag_set" cmd = "2" [/key]
    -  [key] mod = {"Super"} key = "4" func = "tag_set" cmd = "3" [/key]
    -  [key] mod = {"Super"} key = "5" func = "tag_set" cmd = "4" [/key]
    -  [key] mod = {"Super"} key = "6" func = "tag_set" cmd = "5" [/key]
    -  [key] mod = {"Super"} key = "7" func = "tag_set" cmd = "6" [/key]
    -  [key] mod = {"Super"} key = "8" func = "tag_set" cmd = "7" [/key]
    -  [key] mod = {"Super"} key = "9" func = "tag_set" cmd = "8" [/key]
    -  [key] mod = {"Super"} key = "0" func = "tag_set" cmd = "9" [/key]
    -
    -  [key] mod = {"Super", "Shift"} key = "1" func = "tag_client" cmd = "0" [/key]
    -  [key] mod = {"Super", "Shift"} key = "2" func = "tag_client" cmd = "1" [/key]
    -  [key] mod = {"Super", "Shift"} key = "3" func = "tag_client" cmd = "2" [/key]
    -  [key] mod = {"Super", "Shift"} key = "4" func = "tag_client" cmd = "3" [/key]
    -  [key] mod = {"Super", "Shift"} key = "5" func = "tag_client" cmd = "4" [/key]
    -  [key] mod = {"Super", "Shift"} key = "6" func = "tag_client" cmd = "5" [/key]
    -  [key] mod = {"Super", "Shift"} key = "7" func = "tag_client" cmd = "6" [/key]
    -  [key] mod = {"Super", "Shift"} key = "8" func = "tag_client" cmd = "7" [/key]
    -
    -  [key] mod = {"Super"} key = "minus" func = "tag_del" [/key]
    -  [key] mod = {"Super", "Shift"} key = "minus" func = "tag_new" [/key]
    -
    -  # tag function: cmd = nameofthetag
    -  #[key] mod = {"Super"} key = "z" func = "tag" cmd = "2" [/key]
    -
    -  [key] mod = {"Super", "Alt"} key = "Right" func = "tag_next" [/key]
    -  [key] mod = {"Super", "Alt"} key = "Left"  func = "tag_prev" [/key]
    -
    -  [key] mod = {"Super", "Alt"} key = "Up"  func = "screen_next" [/key]
    -  [key] mod = {"Super", "Alt"} key = "Down" func = "screen_prev" [/key]
    -
    -  [key] mod = {"Super"} key = "q" func = "client_close" [/key]
    -
    -  # Focus next / prev client and next / prev tabbed client
    -  [key] mod = { "Alt" }            key = "Tab" func = "client_focus_next" [/key]
    -  [key] mod = { "Alt", "Shift" }   key = "Tab" func = "client_focus_prev" [/key]
    -  [key] mod = { "Super" }          key = "Tab" func = "client_focus_next_tab" [/key]
    -  [key] mod = { "Super", "Shift" } key = "Tab" func = "client_focus_prev_tab" [/key]
    -
    -  # Focus next client with direction
    -  [key] mod = {"Alt"} key = "Left" func = "client_focus_left"   [/key]
    -  [key] mod = {"Alt"} key = "Right" func = "client_focus_right"  [/key]
    -  [key] mod = {"Alt"} key = "Top" func = "client_focus_top"    [/key]
    -  [key] mod = {"Alt"} key = "Bottom" func = "client_focus_bottom" [/key]
    -
    -  # swap next client with direction:
    -  [key] mod = {"Control", "Shift"} key = "Left" func = "client_swap_left"   [/key]
    -  [key] mod = {"Control", "Shift"} key = "Right" func = "client_swap_right"  [/key]
    -  [key] mod = {"Control", "Shift"} key = "Top" func = "client_swap_top"    [/key]
    -  [key] mod = {"Control", "Shift"} key = "Bottom" func = "client_swap_bottom" [/key]
    -
    -  # Resize selected tiled client with direction
    -  [key] mod = {"Super"} key = "Left" func = "client_resize_left"   cmd = "20" [/key]
    -  [key] mod = {"Super"} key = "Right" func = "client_resize_left"   cmd = "-20" [/key]
    -  [key] mod = {"Super"} key = "Top" func = "client_resize_top"    cmd = "20" [/key]
    -  [key] mod = {"Super"} key = "Bottom" func = "client_resize_top"    cmd = "-20" [/key]
    -  [key] mod = {"Super", "Control"} key = "Left" func = "client_resize_right"  cmd = "-20" [/key]
    -  [key] mod = {"Super", "Control"} key = "Right" func = "client_resize_right"  cmd = "20" [/key]
    -  [key] mod = {"Super", "Control"} key = "Top" func = "client_resize_bottom" cmd = "-20" [/key]
    -  [key] mod = {"Super", "Control"} key = "Bottom" func = "client_resize_bottom" cmd = "20" [/key]
    -
    -  # Tabbing command
    -  [key] mod = {"Alt", "Shift"} key = "Left" func = "client_tab_left"   [/key]
    -  [key] mod = {"Alt", "Shift"} key = "Right" func = "client_tab_right"  [/key]
    -  [key] mod = {"Alt", "Shift"} key = "Top" func = "client_tab_top"    [/key]
    -  [key] mod = {"Alt", "Shift"} key = "Bottom" func = "client_tab_bottom" [/key]
    -  [key] mod = {"Alt", "Shift"} key = "u" func = "client_untab" [/key]
    -  [key] mod = {"Super"}        key = "t" func = "client_tab_next_opened" [/key]
    -
    -  # Layout manipulation
    -  [key] mod = {"Super"}          key = "m" func = "layout_vmirror" [/key]
    -  [key] mod = {"Super", "Shift"} key = "m" func = "layout_hmirror" [/key]
    -  [key] mod = {"Super"}          key = "r" func = "layout_rotate_right" [/key]
    -  [key] mod = {"Super", "Shift"} key = "r" func = "layout_rotate_left" [/key]
    -
    -  [key] mod = {"Control", "Super", "Alt"} key = "Left" func = "layout_integrate_left" [/key]
    -  [key] mod = {"Control", "Super", "Alt"} key = "Right" func = "layout_integrate_right" [/key]
    -  [key] mod = {"Control", "Super", "Alt"} key = "Top" func = "layout_integrate_top" [/key]
    -  [key] mod = {"Control", "Super", "Alt"} key = "Bottom" func = "layout_integrate_bottom" [/key]
    -
    -  # Layout set historic travelling function (TESTING)
    -  [key] mod = {"Super"} key = "o" func = "layout_prev_set" [/key]
    -  [key] mod = {"Super", "Shift"} key = "o" func = "layout_next_set" [/key]
    -
    -  # Toggle client free/tile
    -  [key] mod = {"Super"} key = "f" func = "client_toggle_free" [/key]
    -
    -  # Toggle client ignore_tag
    -  [key] mod = {"Super", "Shift"} key = "f" func = "client_toggle_ignore_tag" [/key]
    -
    -  # Toggle infobar visibility
    -  [key] mod = {"Super", "Shift"} key = "h" func = "infobar_toggle_hide" cmd = "default" [/key]
    -
    -  # Launcher
    -  [key] mod = {"Super"} key = "p" func = "launcher" cmd = "exec" [/key]
    -  [key] mod = {"Super"} key = "l" func = "spawn" cmd = "/usr/bin/i3lock -i ~/pics/screensaver.png -p win" [/key]
    -
    -[/keys]
    diff --git a/wmfs/rulesrc b/wmfs/rulesrc
    deleted file mode 100644
    index 78e4483..0000000
    --- a/wmfs/rulesrc
    +++ /dev/null
    @@ -1,29 +0,0 @@
    -[rules]
    -
    -  [rule]
    -      # use instance = "*" for a all-clients rule
    -      instance = "Navigator"
    -      # role   = "browser"
    -      # name   = ""
    -      # theme  = "default"
    -
    -      tag    = 1  # 2nd tag
    -      screen = 0
    -
    -      free       = false
    -      tab        = false
    -      ignore_tag = false
    -  [/rule]
    -
    -  [rule]
    -      instance = "feh"
    -      tag    = 8
    -      screen = 0
    -      free       = false
    -      tab        = false
    -      ignore_tag = false
    -  [/rule]
    -
    -[/rules]
    -
    -
    diff --git a/wmfs/themesrc b/wmfs/themesrc
    deleted file mode 100644
    index 9d63254..0000000
    --- a/wmfs/themesrc
    +++ /dev/null
    @@ -1,59 +0,0 @@
    -# Multi theme section
    -[themes]
    -
    -  [theme]
    -     # No name mean default
    -     #fixed name = "default"
    -
    -     #red:      #F92672
    -     #orange:   #FD971F
    -     #green:    #A6E22E
    -     #brown:    #2D2815
    -
    -     font = "-*-webbycaps-*-*-*-*-7-*-*-*-*-*-*-*"
    -
    -     # Bars
    -     bars_width = 13
    -     bars_fg = "#FD971F"
    -     bars_bg = "#2D2815"
    -
    -     # Element tags
    -     tags_normal_fg = "#FD971F"
    -     tags_normal_bg = "#2D2815"
    -     # tags_normal_statusline = ""
    -
    -     tags_sel_fg    = "#2D2815"
    -     tags_sel_bg    = "#FD971F"
    -     # tags_sel_statusline = ""
    -
    -     tags_occupied_fg = "#FD971F"
    -     tags_occupied_bg = "#2D2815"
    -     tags_occupied_statusline = "\R[0;12;100;1;#FD971F]"
    -
    -     tags_urgent_fg    = "#F92672"
    -     tags_urgent_bg    = "#2D2815"
    -     # tags_urgent_statusline = ""
    -
    -     tags_border_color = "#000000"
    -     tags_border_width = 0
    -
    -     # Frame / Client
    -     client_normal_fg = "#2D2815"
    -     client_normal_bg = "#000000"
    -     client_normal_statusline = "\s[3;9;#121212;x] \s[2;8;#ff0000;x](1;client_close)"
    -
    -     client_sel_fg = "#FD971F"
    -     client_sel_bg = "#000000"
    -     client_sel_statusline = "\s[3;9;#121212;x] \s[2;8;#ff0000;x](1;client_close)"
    -
    -     # client_free_statusline = ""
    -
    -     frame_bg = "#000000"
    -     client_titlebar_width = 0
    -     client_border_width = 0
    -
    -   [/theme]
    -
    -[/themes]
    -
    -
    diff --git a/wmfs/wmfs2_status_cpugraph.sh b/wmfs/wmfs2_status_cpugraph.sh
    deleted file mode 100644
    index 57284fe..0000000
    --- a/wmfs/wmfs2_status_cpugraph.sh
    +++ /dev/null
    @@ -1,51 +0,0 @@
    -#!/bin/zsh
    -
    -memu(){
    -    memu="$(free -m | sed -n 's|^-.*:[ \t]*\([0-9]*\) .*|\1|gp')"
    -    echo "$memu"
    -}
    -memt(){
    -    memt="$(free -m | sed -n 's|^M.*:[ \t]*\([0-9]*\) .*|\1|gp')"
    -    echo "$memt"
    -}
    -cpu(){
    -    cpu="$(eval $(awk '/^cpu /{print "previdle=" $5 "; prevtotal=" $2+$3+$4+$5 }' /proc/stat); sleep 0.4;
    -	      eval $(awk '/^cpu /{print "idle=" $5 "; total=" $2+$3+$4+$5 }' /proc/stat);
    -	      intervaltotal=$((total-${prevtotal:-0}));
    -	      echo "$((100*( (intervaltotal) - ($idle-${previdle:-0}) ) / (intervaltotal) ))")"
    -    echo "$cpu" 
    -}
    -
    -TIMING=1
    -red='#F92622'
    -orange='#FD971F'
    -yellow='#FDF71F'
    -green='#A6E22E'
    -
    -statustext()
    -{
    -    cpu_value=$(cpu)
    -    cpu_color=$green
    -    test $cpu_value -gt 50 && cpu_color=$yellow
    -    test $cpu_value -gt 90 && cpu_color=$red
    -
    -    mem_value=$(($(memu)*100/$(memt)))
    -    mem_color=$green
    -    test $mem_value -gt 50 && mem_color=$yellow
    -    test $mem_value -gt 90 && mem_color=$red
    -
    -    wmfs -c status "default \
    -        ^g[960;0;100;12;$cpu_value;100;#000000;$cpu_color;cpugraph] \
    -        ^s[963;11;#000000;CPU $cpu_value%] \
    -        ^s[962;10;$cpu_color;CPU $cpu_value%] \
    -        ^g[1065;0;100;12;$mem_value;100;#000000;$mem_color;memgraph]
    -        ^s[1068;11;#000000;MEM $mem_value%] \
    -        ^s[1067;10;$mem_color;MEM $mem_value%]
    -    "
    -}
    -
    -while true;
    -do
    -    statustext
    -    sleep $TIMING
    -done
    diff --git a/wmfs/wmfsrc b/wmfs/wmfsrc
    deleted file mode 100644
    index ca46051..0000000
    --- a/wmfs/wmfsrc
    +++ /dev/null
    @@ -1,112 +0,0 @@
    -#
    -# WMFS2 configuration file
    -#
    -
    -# Possible file inclusion:
    -# @include "file"
    -@include ~/.config/wmfs/keysrc
    -@include ~/.config/wmfs/rulesrc
    -@include ~/.config/wmfs/themesrc
    -
    -[bars]
    -
    -  # Position:
    -  #
    -  # 0  Top
    -  # 1  Bottom
    -  # 2  Hide
    -
    -  # Element type:
    -  #
    -  # t  Tags
    -  # s  Statustext (will take available space)
    -  # y  Systray (can be set only ONE time among all element)
    -  # l  Launcher (will be expended at launcher use)
    -
    -  [bar]
    -     position = 1
    -     screen = 0
    -     elements = "tlsy"   # element order in bar
    -     theme = "default"
    -  [/bar]
    -
    -# [bar]
    -#    position = 0
    -#    screen = 1
    -#    elements = "ts"
    -#    theme = "default"
    -# [/bar]
    -
    -[/bars]
    -
    -[tags]
    -
    -  # Tag wrapping navigation
    -  circular = false
    -
    -  # Use no screen option or screen = -1 to set tag on each screen
    -  [tag]
    -      screen = -1
    -      name = "foo"
    -      # statusline=""
    -  [/tag]
    -
    -  [tag] name = "www" [/tag]
    -  [tag] name = "3" [/tag]
    -  [tag] name = "4" [/tag]
    -  [tag] name = "5" [/tag]
    -  [tag] name = "6" [/tag]
    -  [tag] name = "7" [/tag]
    -  [tag] name = "8" [/tag]
    -  [tag] name = "feh" [/tag]
    -
    -  # Mousebinds associated to Tags element button
    -  [mouse] button = "1" func = "tag_click" [/mouse]
    -  [mouse] button = "4" func = "tag_next"  [/mouse]
    -  [mouse] button = "5" func = "tag_prev"  [/mouse]
    -
    -
    -[/tags]
    -
    -[client]
    -
    -  # Padding between clients (default: 0) :
    -  padding = 0
    -
    -  # Give focus to new created client (default = false)
    -  autofocus = false
    -
    -  theme = "default"
    -  key_modifier = "Super"
    -
    -  # Focus type:
    -  #  enter : focus follow mouse (default)
    -  #  click : click to focus
    -  #  everything-else : disable mouse focus support
    -  focus = enter
    -
    -  [mouse] button = "1" func = "client_focus_click"    [/mouse]
    -  [mouse] button = "1" func = "mouse_swap"            [/mouse]
    -  [mouse] button = "2" func = "mouse_tab"             [/mouse]
    -  [mouse] button = "3" func = "mouse_resize"          [/mouse]
    -  [mouse] button = "4" func = "client_focus_next_tab" [/mouse]
    -  [mouse] button = "5" func = "client_focus_prev_tab" [/mouse]
    -
    -[/client]
    -
    -[launchers]
    -
    -  # command can be an uicb function or an uicb function + extension (see example)
    -  [launcher]
    -     name = "exec"
    -     prompt = ">>"
    -
    -     # Example of uicb + ext:
    -     #   command = "spawn xterm -e"
    -     command = "spawn"
    -
    -     width = 150
    -  [/launcher]
    -
    -[/launchers]
    -