From 86d7f302445123ce79acca154a3e25ca319ed40c Mon Sep 17 00:00:00 2001 From: Brett Langdon Date: Thu, 25 Jun 2020 19:46:31 -0400 Subject: [PATCH] Squashed 'zshrc.d/oh-my-zsh/' changes from 8837782b..cea89f54 cea89f54 archlinux: fix pacweb breaking when multiple packages found (#9059) b706a919 core: add title support for mlterm (#8303) 8fe48793 Deprecate cloudapp plugin (fixes #8966) 5ffc0d03 init: don't run update check if DISABLE_AUTO_UPDATE (#9040) d47447a5 osx: refactor plugin and add a few features (#9026) 3f6e87df init: run update check in the same zsh process (#9019) db94f60d Change Discord invite URL 0f3c424e muse: clean up theme da01dc91 web-search: add Google Scholar (#9014) 60442dc4 web-search: allow custom search engines 3c777ebf update: refactor and fix logic in check_for_upgrade.sh (#8939) a2a83be9 smt: fix time since last commit logic 374b4e02 peepcode: add virtualenv prompt and fix git calls e27a6e75 chucknorris: normalize apostrophes (#9013) 9500b1f8 chucknorris: fix typos (#9012) 94e78436 chucknorris: remove duplicate quotes bed03446 Merge branch 'ohmyzsh/pull-7157' (#7157) f23e4912 Silence non-existent/empty dir errors in fastfile_{sync,ls} ed4e317b lib: don't override bigger HISTSIZE and SAVEHIST values (#8993) 82f02e80 wd: update to latest version (#8530) 0fd11130 web-search: add Wayback Archive (#8784) aee9e603 init: reapply hack for invalid ZSH_COMPDUMP filenames (b8761985) 5d1cdb22 fino-time: fix virtualenv prompt by escaping dollar sign (#8991) c58572d5 init: oops 0e12ebb4 init: use grep for zcompdump metadata check 93cc3964 Add deprecation notice for fedora and go plugins. cc065c7b Remove git-remote-branch and nyan plugins (deprecated) 2d6965f8 Fix load of various plugins: fastfile, keychain, sfffe, stack 68d51bd7 virtualenvwrapper: fix load and detection logic 375978fb jenv: fix Homebrew install path bug introduced in #7541 f7dd3d1f brew: remove completion deprecation notice and fix README 604f1ef9 kube-ps1: update to latest version (ede8098) 5ea25e67 Add `shell-proxy` plugin (#8692) aada4d62 Add plugin for bazel completion (#6434) f742baf7 Add plugin for LXD autocomplete (#7457) 6b5c8728 terraform: add fmt -recursive flag autocompletion (#8880) dd1df902 python: add line-number to pygrep (#8867) 3f245edf rbenv: fix redirect in current_gemset 7c9c148e asdf: fix completions if ASDF_DIR is already exported (#8538) 255ef8d5 git: add alias for git diff excluding lock files (#8935) 10538d11 docker: update to latest upstream completion (92dc906) (#8835) e675c821 archlinux: fix pacweb with non-English locales (#8916) 0a456cb3 vagrant: fix vagrant box autocomplete (#8929) 8cb449ee avit: fix $reset_color sequence in prompt e85ecf95 Use oh-my-zsh path variables in zshrc.zsh-template (#8960) 24c2b755 common-aliases: fix hardcoded .zshrc path (#5926) ff0d4909 git: clarify what the glp alias does (#8850) 4ac36d57 fino-time: fix git and ruby prompt sequences a3ea785c direnv: check if direnv is installed (#8809) 570729f2 forklift: add support for Forklift distributed via the Setapp (#8803) 77b409d5 git: add convenience aliases for `git apply` and `git am` (#8563) a25efd1e git: exclude devel branch from list in gbda alias (#8957) b721053c af-magic: account for active conda envs in dash line 25d0b2df man: look for man page for subcommands (#8798) fcd0747b core: remove inc_append_history option (#8048) d8f674cc git: exclude 'development' in gdba alias (#8902) 31c2dc32 jira: add tempo command (#8928) 9050ed34 pipenv: fix error when Pipfile is not a file (#8931) cfdd3c8d Revert "core: enable hist_reduce_blanks" 582c8cb2 Prefix cd calls with `builtin` (#8937) 8b51d17c frontend-search: add packagephobia (#8908) f7bf5665 update: fix bug in upgrade.sh: s/NORMAL/RESET/ (#8947) 4012df8f bundler: add alias for bundle add 3e14fdd6 bundler: add alias for bundle check (#5000) 29eddb66 update: display logo in rainbow colors (#8941) cbd6fbe7 core: enable hist_reduce_blanks 0e4b638c Add plugin for rustup completion (#8914) 587b5545 zsh-navigation-tools: update to 5937e57e fd786291 composer: fix documented aliases 2ecf2846 composer: add aliases for 'outdated' commands f6a03b23 composer: use cache to fix slowness during startup da8c19a0 core: fix zstyle definition of use-cache c52441b6 pygmalion: revert multiline prompt change 08cc808d magic-enter: define bindkey for vi mode as well b8761985 init: silence zcompdump metadata write for invalid ZSH_COMPDUMP filenames 0736a374 gitfast: proper synchronization (#8550) ff987384 core: fix cmp invocation in BSD systems dd1a7269 core: refresh zcompdump cache file in init script (#8878) 173d4ca6 core: move core folder to lib, for now 07bcf041 core: add basic Oh My Zsh CLI (#8876) 06b02766 sdk: support completion of new commands in 5.8.0 (#8870) 58a1a139 meta: add Ross Goldberg as owner of the sdk plugin 373e27d8 sdk: improve sdkman completion (#8854) c686aa3d aws: fix aws_change_access_key function with awscli v2 (#8816) 80f669db jsontools: correct usage for is_json (#8857) 2560f049 autojump: clarify need to install it first 31eca46e meta: basic CODEOWNERS file (gitfast plugin) 54c29bbd composer: fix cdo alias due to command api change (#8828) d53355ab tig: add more info in README (#8818) d6474237 battery: revert battery charging symbol 1-character-width hack 0caae908 lib: speed up slow parts of the lib files; other small fixes dbd16000 themes: fix minor syntax error 6ad6fea5 gnu-utils: append make to cmds (#8794) 621de1e2 colorized-man-pages: add hooks for dman and debman commands (#8776) 2a081d6e battery: remove printf usage where possible 3da469be battery: fix Full battery bug on Linux; force 1-char-width on charging symbol d247f98d nebirhos: use short hostname in prompt 00f3fa2c keychain: define SHORT_HOST if not defined bcc3ee8c systemd: remove newline from systemd prompt (#8772) 4d1202c7 git: fix markdown in README (#8769) 8b80461e history-substring-search: fixing my dumb mistake fd534eb9 history-substring-search: update to upstream version 2019-05-12 2a3a940a themes: change lstheme function to themes in $ZSH_CUSTOM in any level 6fbfc4c7 dotenv: add agree-once improvement to confirmation prompt (#8729) fe97382b virtualenvwrapper: look in $HOME/.local/bin directory (#8758) fe5ec4fe direnv: change direnv to not assume path (#8757) 6dee9f99 Add direnv plugin (#8666) 17be35d1 update path for snapd /snap/bin/* which is used by Linux systems (#8752) f400ea1e man: use only first element of command before prepending man (#8747) 07e3236b taskwarrior: update completion to latest version (dcdf712) 58e38155 autoenv: look in additional installation locations, redo logic 610b2529 Clean up plugin READMEs and a few plugins ff6d111d z: add markdown Readme (#8715) 27f4e079 updater: use hardcoded color sequences instead of tput 6ba2d9de updater: use `git config` instead of `git -c` for git < v1.7.2 79003802 archlinux: fix wrong parameters in pacfiles alias (#8712) a31dee2c sdk: remove invalid value "candidates" from sdk flush completion (#8725) e1a8d7c9 gradle: use upstream completion and fix some other stuff 4c735840 aws: fix awscli completion path on NixOS (#8707) bc7f596d nvm: add `install-latest-npm` to completion (#8709) 742c9845 phing: fix copy-paste error in README 2eb3e9d5 lib: support konsole* $TERM in title function (#8035) 1ef3d577 aws: add support for AWS CLI v2 autocompletion (#8670) 2f345a3d shrink-path: added glob and quote options (#7694) ecf2240b arcanist: add functions which allow copy-pasting of URLS (#8688) 76fb7a25 rbenv: fix rbenv_prompt_info prefix and suffix (#3764) 22fed4fb knife: fix refactor mistake 314dd205 knife: improve knife-solo support in completion (#3315) 93a2ba6b kube-ps1: update to latest upstream version (c685ac8) b9d5ee79 lib: automatic title: replace fg with description from jobs (#7982) 02d12538 lib: clean up termsupport.zsh d7825313 Use $jobstates and $jobtexts to look for jobs 831089a3 git: make the gpristine alias remove untracked git repos (#8697) bbe54e4e lib: use `command` to run rm in upgrade function (#8696) 40096685 random: remove random theme from possible themes to choose from 480f1ecd Merge branch 'update/jira-plugin' 587000ec Some tweaks to the Jira plugin 1f6e1555 Clean up jira function 95220004 Better support for branch name 2f6d79b7 Uppercase the issue in open issue command in the JIRA plugin 10ab2911 sdk: add support for local versions and optimize sed calls (#7870) 72707d92 python: add pyuserpaths function (#7758) ed94e06d command-not-found: speed up call to Homebrew command-not-found (#7740) e65bce84 shrink-path: add minimum length and ellipsis symbol options (#7382) 74420341 minikube: cache command completions (#7446) e42683b8 pip: add local Python package files to completion (#7442) d3dfc137 lib: use grep-alias cache only if ZSH_CACHE_DIR is writable 9ce7de9f Document ZSH_THEME_RANDOM_BLACKLIST setting 461b2134 Merge branch 'grep.zsh-improvements' dc190d87 Refactor grep.zsh file 8d814fdf Fast algorithm to determine grep alias flags 57b17810 Performance enhancement for lib/grep a8ed1c4e Ignore .tox folder in grep b4b50f20 Also set options for egrep and fgrep b6f2cfdb Exclude .idea folder from grep search scope 498cd722 Add git version requirement in documentation 14b4f62e updater: fix --autostash argument. Works for git > 1.7.1 1689e9bb zsh_reload: respect `$ZDOTDIR` when searching for `.zshrc` (#7706) befdb464 gitignore: add newline to `gi` output (#7586) dddbb5c9 mercurial: add hga alias to README (#7547) f94e55a1 mix: add format option to completion (#7256) e6122828 gradle: fix command option name in completion (#6586) 389de86c pass: update completion to upstream version (675a002e) (#6475) c3984a77 fasd: cache full fasd initialisation script (#6097) 5023a478 stack: use builtin completion command (#6230) a2cad167 lib: urlencode hostname in update_terminalapp_cwd (#6245) 864b4416 composer: keep composer autocompletion when using global (#5933) 6f85dc23 kitchen: change sed regex in completion to capture all commands (#5820) 888ab909 lib: add support for clippaste in WSL using powershell 3e16d643 geeknote: update completion (#4986) 08b04f5d fancy-ctrl-z: ensure widgets are called with full context (#4838) 2b499e1a lib: add termux commands to clipboard.zsh (#6243) 57739cbc lib: add support for clip.exe clipboard copy in WSL 65642dfc lib: support additional clipboard types (#7996) 18ee5dff Merge branch 'master' into clipboard 368198b7 Fix an issue with escape characters (#7979) 2c0315db ng: refactor README 79fff1ee macports: add rdeps and rdependents completion (#4717) ee7a9f6f jhbuild: add some missing commands and update README (#5195) 573901dd jhbuild: add shell alias (#3707) dbd2f77b norm: add hg prompt (#6725) 011c7153 nmap: add alias for ICMP scan (#4807) 6b54302b python: add alias to run the proper IPython based on virtualenv bccfe138 updater: add --autostash to git pull (#7172) 6cb8ff39 vagrant: document aliases 3c61bac9 vagrant: add common aliases (#3762) 01bfb574 zsh-interactive-cd: add vi-mode support (#8681) 1a880fdb installer: add option to install without replacing .zshrc (#8209) 60989084 npm: hardcode completion function and delete cached one (#8679) 3e9e385d battery: remove redundant grep calls in battery_pct function d9592838 avit: fix prompt sequence (fixes #8678) b72607bc Add JFrog CLI plugin (#8250) 7290a08b battery: fix floating point output in macOS 0e571427 installer: remove redundant cp command (#8668) 40b013f5 lib: delete upgrade lock in upgrade_oh_my_zsh f9a2d8ca vscode: add documentation for running in macOS (#8674) bc9fe742 Merge pull request #8651 from mcornella/random-theme-refactor 3d4890dc Add blacklist variable for random theme f4b4a446 Polish themes plugin and error out if theme not found b297bf92 Add themes in $ZSH_CUSTOM to the pool of candidates 6adad5c3 Move random theme functionality into "random" theme d76258ff avit: add years since last commit if appropriate 77813a33 avit: clean up theme code 443ad880 avit: replace custom prompt functions with OMZ ones c1b798af agnoster: fix bzr prompt with breezy installed (#8646) eeb49bf5 systemd: add prompt function to show systemd units' status (#7657) de261bd2 af-magic: fix virtualenv prompt suffix e8609b85 git: add `grename` to rename a local branch and in the origin remote (#8622) d49397a0 af-magic: fix dashed separator sizing and refactor 47eae26b web-search: add wolframalpha search engine (#8638) 1381da15 arcanist: document aliases fbbfd0f8 arcanist: add `arc diff --create` alias (#8610) 0bcecf2f dotnet: use official dotnet completion (#8518) aa4146a9 git: add alias for git stash --include-untracked (#8617) 72168aec cloudapp: fix copy-paste mistake in README (#8629) 52f9238b fzf: support for NixOS and Void Linux (#8618) 4fc570b0 kubectl: avoid conflict with existing f aliases in kca alias (#8625) f17e0219 dotenv: fix prompt newline 634a5093 dotenv: add ZSH_DOTENV_PROMPT config (#8624) a6df94d2 gradle: run gradle command instead of alias (#8620) 3ec04997 Add zsh-interactive-cd plugin e178ae39 dotenv: prompt before executing dotenv file (#8606) ebaccba6 battery: merge branch 'refactor-battery-plugin' 15a03744 Remove invalid batteries (#8275) b8b87629 Report only active battery (#4726) 5f6f7b6e Various syntax fixes and function naming equivalence 39e61614 Clean up Linux battery commands and syntax 1bd7a7ad Fix calculation for battery percentage (#4774) 17428f3c lib: load bash completion functions automatically 561e7169 jump: fix for `marks' and CTRL+G key binding 3c5bbcf5 jump: add support for directories starting with a dot (#4661) bc67a55f jump: fix issues in plugin and document CTRL+G key binding 9dffb319 vagrant: obey VAGRANT_CWD when completing vagrant commands (#7219) 05cae346 Detect dependency plugins in candy-kingdom and kiwi themes 83aa984d Add dotnet watch and dotnet watch run (#8612) f362b69d common-aliases: fix loading of is-at-least function (#6215) d88fbe62 systemadmin: fix header line sorting in pscpu (#6167) 1c300d3a lib: add git function to determine repository name (#4989) 22cf7159 kube-ps1: add example for common pitfall (#8318) bfec3166 systemd: refactor and add latest commands (#6250) beab76ed Update issues and PR templates (#8471) e81782ac virtualenvwrapper: rewrite init script location code (#8521) 77aa1795 Revert "fix: Update tmux plugin to use modern terminfo. (#8582)" 6bebc254 af-magic: fix showing aws prompt out of the box (#8243) 578b0860 Link to Actions page in GitHub Action badge df56d1ee Rename GitHub Action to CI 69caf98c fix: Update tmux plugin to use modern terminfo. (#8582) dcffc895 aws: fix array assignment in asp function 05a38c8b lol: fix docs for yolo alias (#8576) 7ff77120 vscode: use insiders build if stable not found (#8568) 64a7f6b3 Create Github Action to run tests (#8569) 4e45e12d virtualenvwrapper: fix finding script on Ubuntu 19.10 (#8451) a04728f1 init: force use of builtin test in is_plugin 530056d5 colored-man-pages: force `env` command (#8551) ce298d09 yarn: use zsh-completions latest version (493984e) 56297902 lib: add MSYS2 support to clipboard integration (#8542) aaa87063 pyenv: only run if pyenv not in $PATH (#8462) 78b07e92 extract: add lz4 support (#8510) ca627655 Bump license year (#8512) d9e64344 -mAdd hitokoto plugin (#8422) e034030f Laravel artisan commands extension (#8425) 42d04d38 Add kubectl all-namespaces aliases for k8s objects (#8434) df55690d Add kubectl log since aliases (#8448) d5f8fac4 Feature/add dotnet plugin (#8503) 8ed19ab5 Added MicroK8s plugin for ZSH (#8499) 6bac9eb1 extract: add lrz support (#8500) b0be0439 Feature/ionic plugin aliases (#8494) 016dd30f New alias zwip that launch cucumber with the :wip profile (#4111) d56d6dc1 Plugins: repo - add more aliases. (#3917) 9bfcab7d osx: use return instead of exit in spotify function 31219c02 osx: fix exit on quit command in spotify function (#8504) cf9aa420 Relocating chat/twitter d99ddab0 codeclimate: add README c63fca85 otp: add README and use clipcopy 67b5bfaa Rename some plugin READMEs for consistency 8ea20fdc tmux-cssh: add README ca8a5a0a svn-fast-info: add README, reorg. plugin 0c2f7514 sfffe: add README 9655377b rbfu: add README 4fd25920 paver: add README e891fbff knife_ssh: small tweaks 9c0ceb7a knife_ssh: add README 13260744 knife: add README and reformat completion file a952854c gnu-utils: add README, simplify plugin 59930902 glassfish: add README 7360d898 gas: add README 38929084 fastfile: add README e21fbe7d colorize: update plugin to support less options (#8392) e204c596 Rewrite gitstatus collection to be more robust (#7322) feaee044 Resolving conflict in README after recent updates for colorize plugin 674d0e1e Merge branch 'jjangga0214-patch-1-plugin-colorize' c494bbb8 Resolving conflict in colorize patch #7742 16ef5cca Update link for Pygments 1a0500b0 Change order of automatic virtualenv activation/deactivation (#6687) 3d6be08e yarn: add alias for yarn lint (#8481) 4338a731 fzf: add support for FreeBSD (#8474) 7dddfe0a fasd: fix plugins name in README (#8483) ad1169bf extract: add tar.lz support (#8479) 1761685d extract: add zstd support (#8469) 664664f6 arcanist: clarify README (#8461) 903a3e9d keychain: pass host as argument to keychain (#8436) 16154453 sbt: use new sbt command naming convention (#8426) 6390afd6 fzf: change debian completion file path (#8402) 671d21ac Mention FAQ in the README (#8051) 4deafdff Fix change to old shell on uninstall (#8430) 7b73c9ca tmux: add ZSH_TMUX_UNICODE to README be73666f tmux: add support for forced unicode support (#5166) 420e9d78 Merge branch 'master' into colorize-chroma-support 76d6b025 lol: fix yolo alias using https URL 3cc1fa40 Fix non-POSIX conditional syntax 1c98b9cc Remove current directory from sys.path in python invocations (#8408) b80b1a1e Actions to take after repository migration is complete (#8394) bb10c979 jenv: only add to PATH if not already on it (#8414) 9b5aebac colorize: update Pygments download link (#8407) 2e88a21f terraform: update completion (#8396) c130aadb Replace "restart shell" documentation "exec zsh" (#8411) 1ba0af65 Use safer append to hook function arrays (#8406) d4f32e9f rails: fix rendering issue in README (#8410) 68c4c062 extract: add RPM archive support (#8347) 26df8a22 git-auto-fetch: stop plugin from asking for ssh-key passphrase (#8399) 4888d4ad Add Twitter follow badge to README 2810a374 Add Discord badge to README 57226778 Merge pull request #2 from ProbstDJakob/colorize-chroma-support 5d5d2027 Echo to Error-Stream. Double quote to prevent globbing and word splitting. c194b515 Update default color to 'emacs' which both chroma & pygmentize support b776f1d2 Fix issue recognizing if tools are insalled 34b5ff58 Merge pull request #1 from ProbstDJakob/colorize-chroma-support d08238fb Fix some comments and messages. Remove (probably) debug messages. Improve ZSH_COLORIZE_TOOL recognition. 451fb257 osx: modify itunes function to support Apple Music (#8372) 8aa070db Update README.md 66e2284a Add support for chroma 0ad988c5 tmux: export ZSH_TMUX_CONFIG again to provide to tmux (#8390) e453731f osx: fix exit on unknown command in spotify function (#8375) 24d83d1e tmux: fix bad tmux config syntax and logical expression error in 86b39cf (#8374) 8b6b2ea0 upgrade: remove double whitespace in message (#7517) 24726678 extract: keep *.gz files with pigz and gunzip 86b39cfa tmux: allow to define a custom configuration path (#7606) ef96a38f Upgrade some URLs to HTTPS (#8202) 107e512c Remove line below copyright so that GitHub shows LICENSE details fc99e6db emacs: support BSD mktemp in emacsclient.sh (#8351) 1546e122 Fix badly resolved rebase conflict 4a9cd68e Merge branch 'jokester/override--ignore-submodules' (#2214) b7e37cea Clean up ignore submodules logic in parse_git_dirty 7cc3a32b Add an option about git submodules to ignore 0ec59e25 fasd: add README (#8334) 687c50bd fabric: fix awk "return not in function" error in completion e363109a alias-finder: fix wc numeric conditional (#8251) 9785d241 python: fix and extend pyclean (#7762) ce52ee02 Add profiles documentation (#8311) 36092aac powder: add README (#8310) c1e5cbed Fix order and reword some things 4eab95f0 mvn: add autocompletion for openliberty (#8244) 9d790ea6 fabric: add task descriptions to completion (#5439) cad48e38 Merge branch 'master' into fabric_task_description 225425fe Fix target_list creation. Supports fabric 1 and 2 eaa682c0 Add profiles documentation 40df67bc swiftpm: update completion for Swift 5.1 (#8248) 534ec60b Set default git-config values known to fix repository issues a7c740b1 rbenv: add README (#8293) 090ab73d safe-paste: add README (#8292) 05dfd0ae cargo: update completion to latest version (cdac4a8) aebf333b magic-enter: update README (#8284) 66290a39 supervisor: add README and update completion (#8285) bd9cd052 docker: reformat README (#8286) 160a801b Clean up README f48a40ee Reorganize stuff 166719c0 Format docker Readme like the other plugins. 39a4f928 Add Readme.md for supervisor. Sync completion with original source. 74165aba rails: detect gems.rb in _rake_command (#8223) 6b6f2b6d bundler: support new file naming convention (#6594) efee47b5 pass: add README (#8282) 45d22369 phing: add README (#8278) e8a6d328 eecms: add README (#8277) a41d308f bundler: make it play nice with functions that call wrapped commands (#8271) 3e4d10c4 lib: allow alias expansion in _ sudo alias (#8268) 563c0708 fzf: fix regression (#8269) f7d9dae1 bira: move virtualenv information (#8266) 767be6c4 git-remote-branch: add README (#8259) 87bd507f pod: add README (#8257) 11f36cf9 screen: add README (#8256) 1f8989ae rake: add README (#8254) ca6b3977 meta: remove automatic bug label on bug reports f56b6788 fzf: check for dpkg before checking for fzf in debian c1bc062e Update README f2be6617 Added README for pod 52f58785 rust: add README (#8242) bb97a9b3 Delete alias section 35aa3c13 add readme for the rust plugin 710a3d5a emotty: add README (#8240) a2cc84dd fbterm: add README (#8241) 49c423c7 battery: add support for sysctl in FreeBSD (#8155) c5b4613b python: add recurse flag to pygrep (#8217) ba57b5c7 chruby: add README (#8238) 98cd133c Reword and add extra information 11e23477 git-escape-magic: fix typos in README (#8234) 66bd299b compleat: add README (#8236) 7ea05bd5 Change description abc05fa4 sprunge: add README and refactor (#8239) 8bb9b044 singlechar: add README (#8232) f5614d2b terminalapp: delete plugin deprecated since 2015 (#8230) 79b2944a yarn: add yarn version alias (#8138) c9841f43 yarn: use zsh-completions latest version (87e1313) 7d410549 Adds chruby plugib README.md b09aed9c yarn: add ytc alias for test with coverage (#7664) c714d3fc gradle: support gdub completion (#6135) 82bd8828 Create README.md for compleat plugin 7e842cdd cloudapp: add README (#8229) fdebc227 Add READMEs for tugboat and colemak plugins (#8207) 13d88947 ufw: add README (#8227) a3b63aa6 Reword 5efe52d9 virtualenvwrapper: add README (#8226) 5f066dab Add README for pow and powify plugins (#8225) d5e7040e pyenv: add README (#8224) e2d5426f perl: add README (#8215) 896dd271 Some syntax changes and more function docs d8a78847 redis-cli: add README (#8214) a9d382a2 Small changes 456814d8 mysql-macports: add README (#8210) b45e0f48 dash: simplify completion logic e0bc6469 dash: add README (#8221) 357336bf Remove redundant section and document keyword args 4b65f439 docs: add README.md for Dash plugin dd0ade16 Create README.md 53d98734 Create README.md e1cb349f Update README.md 1be840b8 Create README.md 3848102a terminitor: add README (#8197) c60371a8 rebar: add README (#8198) d9bb732e rvm: add README (#8199) ff23aa0b n98-magerun: add README (#8200) 188eff06 Adding README for rvm ae0de113 cakephp3: add README (#8196) 4b8f4d52 yii: add README (#8194) 1a6480e4 bundler: add rubocop to bundled_commands (#8169) 372bb48c Add rubocop to bundler readme fc9093b7 Add rubocop to bundled_commands e38099de sublime: ignore wslpath errors if C drive is missing bf0cf4eb yarn: add Yarn Workspace aliases (#7491) f32b3027 yarn: add yd as yarn dev alias (#7663) 77ad69e0 jruby: add README (#8190) b8cfa0c7 Update README: include Yarn workspace shortcuts a6d71dda Update README with up-to-date platform requirements ec7ef7ee lein: add README (#8189) bb6ae70b fzf: add support for debian packages (#8001) 51f0eaad Add README for thor and pip plugins (#8185) 8bfeb375 oc: add README (#8188) f763244e autoenv: add README (#8184) 86dd1a48 react-native: add aliases for newer iPhones (#8170) 487f0af4 Fix table alignment 2004550a react-native: add aliases for newer iPhones to Doc ccee223a react-native: add aliases for newer iPhones f9e7c45a Add flutter plugin (#8150) be9160ef gcloud: add search path for Arch Linux (#8164) 6cfaa076 Add gcloud plugin (#8144) 095d56b5 Fix WSL check for WSL 2 and simplify nohup in open_command 32338fd4 robbyrussell: restore prompt spacing (#8148) 576e0992 z: update to latest version (e77e938) 093b56a7 git: fix gtl alias argument ddd359dd kube-ps1: add a note where to put the `PROMPT=...` line (#8142) fd4571d1 installer: allow chsh to work in termux f9e133b8 gitfast: fix error in git-prompt.sh (#8132) 4fb50b33 Unquote yes in conditional expressions for style consistency 229a1c97 gitfast: update completions (#8130) 101ea872 ssh-agent: check if `ssh-add -l` was successful c44569f0 robbyrussell: remove local variable (#8131) 9c3e3ae5 Change description for Evan's theme to something neutral (#6304) 2b4d7232 debian: fix bad function definitions (#8129) a870fee6 Update syntax on the remaining functions 1f58cd92 Updated git-prompt.sh to quote variables a4f6a996 meta: remove PR triage GitHub action :cry: b3d3ce8a Fix bad function definitions in Debian plugin 15dd7705 wd: point to the correct directory even if installed with antibody (#8116) a331063a git-escape-magic: fix typo (#8113) 9524db73 autojump: fix loading when autojump is not in $PATH (#8074) 2217a7c8 ripgrep: update completion to latest version (#8083) 08beebd8 homestead: repair sed regex (#8103) d6fc6edb git: fix `gbda` trying to delete worktree branches (#8102) df9cf723 plugins/git: Fix `gbda` trying to delete worktree branches caf0bfa0 ubuntu: fix aglu to list available upgrades (#8082) 3e0e9136 homestead: change key string for getting command list (#8008) 246e7832 feature: add condition for regular expression de3b14cf git: add aliases for git switch and restore (#8089) 43ed0b45 af-magic: add hg prompt and tweak virtualenv info (#8056) e604eaf5 lib: delete LC_CTYPE locale setting which causes problems 1908f7bd fabric: support fabric 2+ completion (#8010) 8634d954 Add git-escape-magic plugin (#2847) 90a0de46 Add alias-finder plugin (#7768) 97c0d0a5 Allow plugins sudo and thefuck to be loaded before vi-mode (#8087) c4c620ad meta: add DEBUG_ACTIONS flag to PR triage action 28232904 git-auto-fetch: override zle-line-init only if it exists 49741437 meta: move if condition on workflow to steps d8ad4e90 meta: convert workflow file to GitHub Actions v2 yml syntax 40fafe0f n98-magerun: support magerun for Magento 2 (#7950) 2156b4c0 colored-man-pages: add option to color any help command (#7173) 89366be4 Revert "agnoster: fix VIRTUAL_ENV_DISABLE_PROMPT logic (#8050)" (#8061) 26aad597 Add README file 6d2221e6 frontend-search: add duckduckgo as an option for fallback search (#7973) 59c1ec80 agnoster: fix VIRTUAL_ENV_DISABLE_PROMPT logic (#8050) 9817e1e7 common-aliases: add README (#8039) 508cba2f Removing plugin that was named after an external tool, which carries a history as a racist phrase. Was reported by a user of OMZ who shared some background on the terminology and how it made them feel. (#8027) 783dd150 change key string 0565251c Unset all local functions after running them b90f76c1 fzf: Adding support for debian packages d81cd753 clipboard: Fix bad expansion of exit-code test 841008c9 clipboard: Fix tmux clipcopy after testing d71d3d99 clipboard: Fix "cilppaste" -> "clippaste" typo 17f4cfca af-magic: make separator window-size-aware (#7739) 01e934d6 clipboard: Add support for several more clipboards 956ca639 clipboard: Avoid unnecessary re-detection each time d8555476 clipboard: Reduce unnecessary special-casing on stdin 29fb617e readme: document oneliner unattended installation command (#7983) 6cb98eda git: add missing grev alias to README (#7984) 902e3172 Avoid error messages when there is no job c1446b47 Automatic title: Replace fg with description from jobs b259cdf7 s/might/may c7a7b70e git-auto-fetch: silence stderr output (#7970) 7b2c4327 golang: add missing gom alias to README (#7961) 5f743e1a terraform: update README (#7934) c105c04b kubectl: add statefulset aliases (#7826) fb43df12 colorize: add style environment variable (#7635) fec2e56b adding gatsby command set (#7831) 5f18dbf8 Add a completion plugin for dnote (#7885) 36e13f48 Add PersistentVolumeClaim support to kubectl plugin (#7827) f992d434 git: add git revert alias (#7841) 9060c1dd crcandy: use 24h format in prompt (#7926) 078f64dc rails: fix typo in README (#7923) 69f37800 ubuntu: plugin cleanup and rename of ag alias to age (#7700) 7f98e1cb debian: fix alias completion, rename ag and clean up README (#7698) 24cd8e83 meta: change feature request label d0b29ff0 pip: fix no such file or directory error (#7916) 702a594d installer: don't rely on tput for coloring d69bad8e gitfast: downgrade to upstream v2.16 (#7918) 65f34ce8 kube-ps1: fix color bleeding in prompt (#7915) eb3d4630 gitfast: update to upstream v2.21 (#7914) 52fdae4b Merge pull request #5169 from mcornella/refactor-installer c8ac4038 installer: add documentation of new installer features to README b944fee6 installer: ask user about changing the shell to zsh 0824dcc9 installer: allow for tput errors 2e54ba2d installer: restore previous default shell with uninstall 66d6d088 installer: improve message formatting and color b931d6a9 installer: change to --unattended argument and add docs 065844fd installer: comment changes 1cf42a50 installer: add option to not run zsh at the end a40d9329 installer: don't run zsh at the end 794ff4a6 installer: add ability to skip the default shell change 43b3126b installer: use timestamped backups to preserve all old zshrcs 153f5e11 installer: use default color sequences on missing tput 220d69b2 installer: allow configuration of remote URL to clone from aa27430e installer: add ability to install from forked & branched repos a6a093ba installer: improve zsh binary path search in setup_shell 9d2b3ce7 installer: fix for Solus OS and systems with no /etc/shells 62216aaa installer: use guard clauses in setup_shell for better readability 8e10ac4d installer: make sure shell in /etc/shells is not commented 73f29087 installer: replace the current shell with the new ZSH instance 1fdd5351 installer: abstract error messages 576499a5 installer: fix for failed chsh quitting the installation a7bd1f99 installer: extract most code into functions f9444392 installer: reorganise and add comments 73ef051a installer: use tabs to allow future heredocs 9a832ccc installer: use exit-on-error from the beginning 27228d83 fasd: update `v` alias to evaluate $EDITOR lazily (#7900) 9930dd6e aws: use function keyword in function definitions 7f66a070 osx: add more arguments to `itunes vol` command (#7845) 1343ab67 aws: check availability of aws profiles (#7839) 5d875d68 ng: fix shwordsplit option use (#7880) 1f078898 emotty: fix for undefined $TTY (FreeBSD) (#7844) 8d4d766b frontend: add frontend search commands (#7863) 9598a855 aws: check for existence of config file in aws_profiles fa187791 torrent: add README (#7873) 60736c9f Add new kubectl alias to list all contexts (#7823) f62a71e9 meta: update issue templates 4ad4a816 git: clean up plugin file and delete current_repository function f8d5fdce git: move documentation from wiki to README 8022fdbd svn-fast-info: fix svn-fast-info printfs (#7140) f960e2be dotenv: add support for custom env file names (#7861) 5f7666e2 vi-mode: reset KEYMAP on accept-line (#7818) 5aa62461 rails: change rg alias to `rgen` (#7858) dfb060f8 meta: add initial issue templates 486fa101 lib: add ability to disable magic functions 4585c666 aws: really unset AWS*PROFILE variables in asp function (#7838) f5f630ff osx: update spotify to v2.1 (#7820) 10c1b7d2 jira: add a myissues option (#6696) 0232ac4b Merge branch 'master' into master ebc700be Add plugin for Please (#6568) 7b751635 vscode: add code-insiders support (#7836) b054e25d Add plugin for SDKMAN (#6483) 20ecca2b rbenv: improve rbenv loading based on pyenv (#7626) 4cadbcd2 Add plugin for pipenv (#6698) 76c7bd57 Merge branch 'apjanke/themes-rvm-prompt-function' (#4588) 299cd477 Themes: switch to using ruby_prompt_info() ea3e666e init: run compinit before loading lib/ files 0f0448fa ssh-agent: consolidate uppercase message (#7834) 239649ae lib: pass arguments to `d` to dirs (#6924) 78b241b1 Capitalizate github to GitHub (#5932) 58daf135 django: fix typo in completion (#6233) 81ed2561 jira: fix error when assigned or reported are default (#7731) 6da59ff0 frontend-search: add Angular 2 context (#7830) 63b8d652 Add small polishing touches b3498d11 Extracted angularjs to its own context for users who still use Angular <= 2 d4a3e064 zshrc: add option to bypass update prompt (#5891) bcd41006 convert + to %20 encoding cfe2263f updated search URL for angular 177d11d3 readme: add notice about shell changes (#6288) d0e4319a Add PersistentVolumeClaim support to kubectl plugin 8113ed06 Add GitHub Action to label Pull Requests 55f20fed hub: update completion to 2019-02-21 (819aa96) (#7821) 4eae0549 per-directory-history: redo README for Oh My Zsh 56610be1 colorize: fix mktemp parameter for compatibility (#7789) 6da85279 Revert "kubectl: rename k alias" (#7817) d16adb6a aws: fix path resolution of aws completion for Ubuntu (#7812) a46798b7 Update colorize README.md with env var details c7154e88 Add pygments style env var for colorized f5b2d9c7 meta: ignore example files in custom directory 2433ee81 react-native: add simulator aliases according to latest Xcode update (#7792) adade64c react-native: use new iOS simulator names (#7717) f4647658 core: set up colored ls output in FreeBSD (#7787) ebd13b60 colorize: add ability to colorize multiple files into less (#7662) cfd30e9e Colored ls output in FreeBSD #7565 9b2410fb Remove dots from installer URLs (#7780) 8db0f352 agnoster: remove empty line (#7775) 978b724c kubectl: rename k alias (#7749) 2c1880cf sfdx: add plugin and completion for sfdx (#6540) ebee94b8 bira: remove extra spaces (#7767) 8d95f760 rails: create README (#5841) fc9e427e sublime: refactor plugin and fix documentation (#7715) 4b9c4e97 bwana: change function name to bwana (#7769) 4456536a Simplify explanation of bwana function ecc1c6db [bwana plugin] Change function name 08da19e3 emacs: revert cab1ac6e682038b2ceca9d16f8c458c0e79149ca (#7765) b57c0ac6 Delete deprecated pure theme 3c8f73c3 git-prompt: fix LANG override for git status call 7824dc63 git: use is-at-least to test for git version 8d7ce18e vi-mode: remove TRAPWINCH from plugin (#7753) d36c1b8d kube_ps1: customize colors and dynamically toggle prompt (#7269) 0c3499ec Fix showing aws prompt out of the box for 'fishy' theme (#7747) afb28d33 git-prompt: add README (#7554) 5f9cc016 Fix redundant export of RPROMPT in aws plugin 5911aea4 lib: stop detecting git versions prior to 1.7.2 bb64446e Merge branch 'fix/autojump-plugin' b4c06f2b Complain when no autojump script was found fd105b6e Refactor and clean up autojump plugin 5a424fc1 Check first default Homebrew prefix 4ef29c9f Fix homebrew path location ab63d240 Use source instead of dot to load autojump 5e9ee67f Update autojump.plugin.zsh 481a649f NixOS: Use autojump.sh to figure out location of autojump.zsh cab1ac6e emacs: use open frame if there is one present b31106b3 git: minor syntax fix 35dc26a2 git: use stash 'push' instead of the deprecated 'save' (#7486) 1bd72f58 Update to inline conditional syntax 63291f4f Reword and fix formatting 4aa545ab archlinux: fix minor typo (#7752) a628b552 vi-mode: add CTRL+S to search history forward 8a94013f bira: add virtualenv support in prompt d0efa007 tmuxinator: fix completion file header ab140683 httpie: bundle zsh-completions completion (e5bd16f, 2016-12-18) 069df888 docker-compose: update completion (1f97a57, 2019-03-02) 351fa065 osx: added support for Hyper terminal (#7494) 62abaceb lib: fix issues with nounset and parameters used before defined (#7433) 680755bb iwhois: remove iwhois plugin 7b06d01f gitfast: document deprecated git plugin dependency f12f7b03 swiftpm: update autocompletion for Swift 5.0 (#7744) 2ec868dd swiftpm: improve README 17057537 gulp: fix completion function name 30594886 lib: delete PS1 default e83b70f2 pip: fix indexes URL (#6986) 0c000af7 cloudapp: fix permissions of credentials file 53d6a692 Fix showing aws prompt for theme fishy (append RPROMPT instead of overwrite) 482587cc vault: deprecate and update README 8c95c2b6 gitfast: update plugin (#7152) 728c8e71 nvm: load nvm script only if command doesn't already exist (#5454) 99814799 zshrc: remove SSH_KEY_PATH comment 651856d4 Update the swiftpm plugin autocompletion for Swift 5.0 c23ab009 upgrade: fix lock-out on first upgrade check a85ce89a refined: reset command exec time (#6117) 3cfcf5e0 git-prompt: run git status with LANG=C (#6087) 046d49f7 git: add 'gtl' alias to list tags matching a pattern (#7629) 67e0ef7a edit colorize plugin: add `-f terminal` option 4ddb2e38 Introducing a Code of Conduct based on the Contributor Covenant project. Adding links from the README and CONTRIBUTING pages to this, too, along with an email address for reporting abusive behavior to. Closes #7733 (#7734) 3a6bf6bd init: more informative warning if plugin not found (#7727) 831fba4e Revert "git: delete branches in `gbda` only if there are any (#6079)" (#7724) 93cbc161 git: use interactive mode in gclean 4b82b860 git: add `--no-gpg-sign` to gwip (#6031) 0e0789fb git: delete branches in `gbda` only if there are any (#6079) f1799de0 Add drush plugin (#4490) a43cef34 pyenv: detect pyenv from Homebrew faster (#7670) 15f29aac gradle: also support settings files (#7014) 7d27843e ubuntu: rename ag to age to avoid conflict with The Silver Searcher 7fe353cc ubuntu: clean up plugin and README b7b40b0b fd: fix fd-find completions for debian (#7704) 8fba5036 cargo: update completion (#5757) 61a7bc2d Update README a441f64d Update _cargo completion to 0.34.0 version ae7d0bcd golang: mod and list commands completion (#7665) d79415b1 command-not-found: add support for NixOS (#7701) 1e7033d6 Merge pull request #7166 from jounathaen/master 9538eae3 Added a new plugin which adds completion for ripgrep (rg) 647537f1 Added a new plugin which adds completion for fd (fd-find) f6a9a0a4 git: fix grt on path with spaces e59cc948 themes: fix prompt verbosity on window resize c56fa996 rake-fast: remove brackets from completion entries 6d143d42 aws: document aws_change_access_key and fix README 5f893dcd aws: clean up aws_change_access_key function 4f4985fd aws: added an alias for changing the AWS access key set on a profile 8cbdd795 aws: set AWS_EB_PROFILE for the EB CLI (#7388) 532a784b aws: refactor AWS plugin (#7615) 5ff21efa Add pygmalion-virtualenv theme (#5139) 08b73f92 lighthouse: add README and clean up plugin (#7316) e4189b9a Clean up lighthouse plugin a055930c Fix README 729c2f79 otp: added a plugin for oathtool one-time passwords (#3862) 1a2d930b aws: refactor completion sourcing logic (#7364) 83d11394 agnoster: show AWS_PROFILE in prompt (#6621) f03aa42c react-native: add iPad and Apple TV simulator aliases (#7603) 9975b162 web-search: add Givero (supports good causes) as search engine (#7581) 6fe4ac02 web-search: update alias for stackoverflow (#7660) 2b68600d suse: remove sudo from some zypper aliases (#7678) 1e11a3c1 init: fix erroneous plugin not found warning (#7686) 8aa8405e termsupport: add support for tmux* $TERM values (#7622) de2395c6 compfix: fix check for empty string (#7674) 779ff24c init: notify user if plugin isn't found (#7679) 9509fd6a Add git reset to origin alias to git plugin (#7630) 275e5b13 allow kubectl commands against all namespaces (#7637) e3e0dd59 fix typo (#7643) 52afbf77 per-directory-history: update to latest version (0e090e8) 93461548 docs: fixed themes link for readme (#7620) f319aa84 Updating Oh My Zsh shop URLs (#7619) 55575b88 lib: optimize default and env_default 4cdffcd4 init: cut down on the number of compaudit calls f99b58a3 fancy-ctrl-z: fix "hurt sme" typo (#7613) ca1123a0 Fix "hurt sme" typo 308b0468 Use stash 'push' or 'save' depending on Git version 22e00b02 Add Yarn Workspace command aliases cf07fe2c -r is not available for bsd sed 1a4052b0 Added README.md to lighthouse plugin 23688fc7 Add option to color any help command 1e161e83 fix subcommands completion 440d8ef3 fix escaping 5d0b90a7 redir debug output to std 5423f7fa complete installed sub-commands b9533cca complete --message-format da30a1d6 add description for --color d326cc5c target name completion b0a14907 Allow arguments to `d` to be passed to dirs afb02876 MOdified README to reflect changes for myissues command 132bffcb Added a myissues option fbc878cb Adds option to disable auto update prompt 9dd76fb6 add task description to fabric completion b6ed2e7a added aliases for ssh-config and global-status c840594c added aliases for vagrant git-subtree-dir: zshrc.d/oh-my-zsh git-subtree-split: cea89f54391c810198a7ace05f1063dd7e596bb7 --- .editorconfig | 10 + .github/CODEOWNERS | 3 + .github/ISSUE_TEMPLATE/bug_report.md | 36 + .github/ISSUE_TEMPLATE/feature_request.md | 26 + .github/ISSUE_TEMPLATE/support.md | 10 + .github/PULL_REQUEST_TEMPLATE.md | 17 + .github/workflows/main.yml | 36 + .gitignore | 4 +- CODE_OF_CONDUCT.md | 76 + CONTRIBUTING.md | 14 +- LICENSE.txt | 5 +- README.md | 117 +- lib/cli.zsh | 195 ++ lib/clipboard.zsh | 125 +- lib/compfix.zsh | 2 +- lib/completion.zsh | 7 +- lib/diagnostics.zsh | 8 +- lib/directories.zsh | 10 +- lib/functions.zsh | 20 +- lib/git.zsh | 49 +- lib/grep.zsh | 57 +- lib/history.zsh | 9 +- lib/misc.zsh | 33 +- lib/prompt_info_functions.zsh | 19 +- lib/spectrum.zsh | 26 +- lib/termsupport.zsh | 74 +- lib/theme-and-appearance.zsh | 7 +- oh-my-zsh.sh | 90 +- plugins/alias-finder/README.md | 46 + plugins/alias-finder/alias-finder.plugin.zsh | 47 + plugins/apache2-macports/README.md | 26 +- plugins/arcanist/README.md | 40 +- plugins/arcanist/arcanist.plugin.zsh | 18 +- plugins/archlinux/README.md | 12 +- plugins/archlinux/archlinux.plugin.zsh | 8 +- plugins/asdf/asdf.plugin.zsh | 2 +- plugins/autoenv/README.md | 20 + plugins/autoenv/autoenv.plugin.zsh | 60 +- plugins/autojump/README.md | 2 +- plugins/autojump/autojump.plugin.zsh | 53 +- plugins/aws/README.md | 30 +- plugins/aws/aws.plugin.zsh | 129 +- plugins/battery/battery.plugin.zsh | 185 +- plugins/bazel/README.md | 5 + plugins/bazel/_bazel | 341 +++ plugins/bower/README.md | 3 +- plugins/brew/README.md | 30 +- plugins/brew/brew.plugin.zsh | 16 - plugins/bundler/README.md | 25 +- plugins/bundler/bundler.plugin.zsh | 7 +- plugins/bwana/README.md | 9 - plugins/bwana/bwana.plugin.zsh | 13 - plugins/cake/README.md | 2 +- plugins/cakephp3/README.md | 16 + plugins/cargo/README.md | 4 +- plugins/cargo/_cargo | 809 +++--- plugins/catimg/README.md | 24 +- plugins/catimg/catimg.plugin.zsh | 2 +- plugins/catimg/catimg.sh | 2 +- plugins/chruby/README.md | 20 + plugins/chucknorris/README.md | 28 +- plugins/chucknorris/fortunes/chucknorris | 2526 ++--------------- plugins/cloudapp/README.md | 26 + plugins/cloudapp/cloudapp.plugin.zsh | 6 +- plugins/cloudapp/cloudapp.rb | 60 - plugins/codeclimate/README.md | 8 + plugins/coffee/README.md | 2 +- plugins/colemak/README.md | 48 + plugins/colored-man-pages/README.md | 18 + .../colored-man-pages.plugin.zsh | 13 +- plugins/colorize/README.md | 42 +- plugins/colorize/colorize.plugin.zsh | 115 +- plugins/command-not-found/README.md | 1 + .../command-not-found.plugin.zsh | 13 +- plugins/common-aliases/README.md | 121 + .../common-aliases/common-aliases.plugin.zsh | 3 +- plugins/compleat/README.md | 9 + plugins/composer/README.md | 32 +- plugins/composer/composer.plugin.zsh | 40 +- plugins/copybuffer/copybuffer.plugin.zsh | 4 +- plugins/copyfile/README.md | 3 +- plugins/cpanm/README.md | 6 +- plugins/dash/README.md | 28 + plugins/dash/dash.plugin.zsh | 52 +- plugins/debian/README.md | 114 +- plugins/debian/debian.plugin.zsh | 116 +- plugins/dircycle/README.md | 4 +- plugins/direnv/README.md | 15 + plugins/direnv/direnv.plugin.zsh | 16 + plugins/dirhistory/README.md | 22 + plugins/dirhistory/dirhistory.plugin.zsh | 3 +- plugins/dirpersist/README.md | 3 +- plugins/dirpersist/dirpersist.plugin.zsh | 3 +- plugins/django/README.md | 20 - plugins/django/django.plugin.zsh | 5 +- plugins/dnf/README.md | 14 +- plugins/dnote/README.md | 51 + plugins/dnote/_dnote | 39 + plugins/docker-compose/README.md | 3 +- plugins/docker-compose/_docker-compose | 168 +- plugins/docker/README.md | 15 +- plugins/docker/_docker | 18 +- plugins/dotenv/README.md | 47 +- plugins/dotenv/dotenv.plugin.zsh | 47 +- plugins/dotnet/README.md | 23 + plugins/dotnet/dotnet.plugin.zsh | 32 + plugins/drush/README.md | 83 + plugins/drush/drush.complete.sh | 50 + plugins/drush/drush.plugin.zsh | 104 + plugins/eecms/README.md | 11 + plugins/emacs/emacsclient.sh | 3 +- plugins/emoji-clock/emoji-clock.plugin.zsh | 2 +- plugins/emotty/README.md | 39 + plugins/emotty/emotty.plugin.zsh | 10 +- plugins/encode64/README.md | 25 +- plugins/extract/README.md | 9 + plugins/extract/_extract | 2 +- plugins/extract/extract.plugin.zsh | 13 +- plugins/fabric/README.md | 2 +- plugins/fabric/_fab | 19 +- plugins/fancy-ctrl-z/README.md | 6 +- plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh | 6 +- plugins/fasd/README.md | 21 + plugins/fasd/fasd.plugin.zsh | 24 +- plugins/fastfile/README.md | 84 + plugins/fastfile/fastfile.plugin.zsh | 41 +- plugins/fbterm/README.md | 10 + plugins/fd/README.md | 13 + plugins/fd/_fd | 83 + plugins/fedora/README.md | 2 +- plugins/fedora/fedora.plugin.zsh | 4 +- plugins/firewalld/{readme.md => README.md} | 0 plugins/flutter/README.md | 21 + plugins/flutter/_flutter | 37 + plugins/flutter/flutter.plugin.zsh | 7 + plugins/forklift/README.md | 18 +- plugins/forklift/forklift.plugin.zsh | 19 +- plugins/frontend-search/README.md | 80 +- plugins/frontend-search/_frontend-search.sh | 65 +- .../frontend-search.plugin.zsh | 59 +- plugins/fzf/fzf.plugin.zsh | 157 +- plugins/gas/README.md | 10 + plugins/gatsby/README.md | 7 + plugins/gatsby/_gatsby | 24 + plugins/gcloud/README.md | 24 + plugins/gcloud/gcloud.plugin.zsh | 33 + plugins/geeknote/README.md | 16 +- plugins/geeknote/_geeknote | 267 +- .../git-auto-fetch/git-auto-fetch.plugin.zsh | 31 +- plugins/git-escape-magic/README.md | 16 + plugins/git-escape-magic/git-escape-magic | 135 + .../git-escape-magic.plugin.zsh | 9 + plugins/git-extras/README.md | 10 +- plugins/git-extras/git-extras.plugin.zsh | 4 +- plugins/git-flow/README.md | 13 +- plugins/git-hubflow/git-hubflow.plugin.zsh | 12 +- plugins/git-prompt/README.md | 61 + plugins/git-prompt/git-prompt.plugin.zsh | 10 +- plugins/git-prompt/gitstatus.py | 22 +- .../git-remote-branch.plugin.zsh | 19 - plugins/git/README.md | 225 +- plugins/git/git.plugin.zsh | 99 +- plugins/gitfast/README.md | 131 +- plugins/gitfast/_git | 11 +- plugins/gitfast/git-completion.bash | 922 ++++-- plugins/gitfast/git-prompt.sh | 16 +- plugins/gitfast/gitfast.plugin.zsh | 4 +- plugins/gitfast/update | 9 + plugins/gitfast/updates.patch | 56 + plugins/github/README.md | 10 +- plugins/github/_hub | 11 +- plugins/gitignore/gitignore.plugin.zsh | 2 +- plugins/glassfish/README.md | 9 + plugins/glassfish/glassfish.plugin.zsh | 3 - plugins/gnu-utils/README.md | 38 + plugins/gnu-utils/gnu-utils.plugin.zsh | 130 +- plugins/go/README.md | 2 +- plugins/go/go.plugin.zsh | 4 +- plugins/golang/README.md | 1 + plugins/golang/golang.plugin.zsh | 79 +- plugins/gpg-agent/README.md | 3 +- plugins/gradle/README.md | 13 +- plugins/gradle/_gradle | 421 ++- plugins/gradle/_gradlew | 1 - plugins/gradle/gradle.plugin.zsh | 201 +- plugins/grails/README.md | 55 - plugins/gulp/gulp.plugin.zsh | 6 +- plugins/history-substring-search/README.md | 175 +- .../history-substring-search.plugin.zsh | 17 +- .../history-substring-search.zsh | 510 ++-- plugins/history/README.md | 20 +- plugins/history/history.plugin.zsh | 9 +- plugins/hitokoto/README.md | 15 + plugins/hitokoto/hitokoto.plugin.zsh | 14 + plugins/homestead/homestead.plugin.zsh | 2 +- plugins/httpie/README.md | 16 +- plugins/httpie/_httpie | 181 ++ plugins/httpie/httpie.plugin.zsh | 33 - plugins/ionic/README.md | 30 + plugins/ionic/ionic.plugin.zsh | 15 + plugins/iwhois/README.md | 24 - plugins/iwhois/iwhois.plugin.zsh | 5 - plugins/jenv/jenv.plugin.zsh | 4 +- plugins/jfrog/README.md | 11 + plugins/jfrog/jfrog.plugin.zsh | 10 + plugins/jhbuild/README.md | 34 +- plugins/jhbuild/jhbuild.plugin.zsh | 16 +- plugins/jira/README.md | 5 + plugins/jira/_jira | 1 + plugins/jira/jira.plugin.zsh | 36 +- plugins/jruby/README.md | 21 + plugins/jsontools/README.md | 38 +- plugins/jsontools/jsontools.plugin.zsh | 13 +- plugins/jump/README.md | 12 + plugins/jump/jump.plugin.zsh | 31 +- plugins/keychain/keychain.plugin.zsh | 14 +- plugins/kitchen/_kitchen | 2 +- plugins/knife/README.md | 25 + plugins/knife/_knife | 226 +- plugins/knife_ssh/README.md | 14 + plugins/knife_ssh/knife_ssh.plugin.zsh | 8 +- plugins/kube-ps1/README.md | 241 +- plugins/kube-ps1/kube-ps1.plugin.zsh | 314 +- plugins/kubectl/README.md | 17 + plugins/kubectl/kubectl.plugin.zsh | 38 + plugins/laravel/README.md | 17 + plugins/laravel/laravel.plugin.zsh | 15 + plugins/laravel4/README.md | 12 +- plugins/last-working-dir/README.md | 8 +- .../last-working-dir.plugin.zsh | 3 +- plugins/lein/README.md | 9 + plugins/lighthouse/README.md | 29 + plugins/lighthouse/lighthouse.plugin.zsh | 14 +- plugins/lol/README.md | 104 +- plugins/lol/lol.plugin.zsh | 2 +- plugins/lxd/README.md | 9 + plugins/lxd/lxd.plugin.zsh | 26 + plugins/macports/_port | 2 + plugins/magic-enter/README.md | 17 + plugins/magic-enter/Readme.md | 14 - plugins/magic-enter/magic-enter.plugin.zsh | 7 +- plugins/man/man.plugin.zsh | 26 +- plugins/mercurial/README.md | 96 +- plugins/mercurial/mercurial.plugin.zsh | 13 +- plugins/meteor/README.md | 5 +- plugins/microk8s/README.md | 24 + plugins/microk8s/microk8s.plugin.zsh | 82 + plugins/minikube/minikube.plugin.zsh | 11 +- plugins/mix/_mix | 3 +- plugins/mvn/README.md | 3 +- plugins/mvn/mvn.plugin.zsh | 2 + plugins/mysql-macports/README.md | 20 + plugins/n98-magerun/README.md | 21 + plugins/n98-magerun/n98-magerun.plugin.zsh | 14 +- plugins/ng/README.md | 37 +- plugins/ng/ng.plugin.zsh | 5 +- plugins/nmap/README.md | 54 +- plugins/nmap/nmap.plugin.zsh | 2 +- plugins/node/README.md | 9 +- plugins/npm/README.md | 5 +- plugins/npm/npm.plugin.zsh | 22 +- plugins/nvm/_nvm | 1 + plugins/nvm/nvm.plugin.zsh | 7 +- plugins/nyan/README.md | 5 - plugins/nyan/nyan.plugin.zsh | 10 - plugins/oc/README.md | 13 + plugins/osx/README.md | 51 +- plugins/osx/_security | 90 + plugins/osx/music | 170 ++ plugins/osx/osx.plugin.zsh | 246 +- plugins/osx/spotify | 75 +- plugins/otp/README.md | 22 + plugins/otp/otp.plugin.zsh | 45 + plugins/pass/README.md | 22 + plugins/pass/_pass | 8 + plugins/paver/README.md | 12 + plugins/paver/paver.plugin.zsh | 6 +- plugins/per-directory-history/README.md | 71 +- .../per-directory-history.zsh | 11 +- plugins/percol/README.md | 4 +- plugins/perl/README.md | 37 + plugins/perms/README.md | 14 +- plugins/phing/README.md | 9 + plugins/pip/README.md | 19 + plugins/pip/_pip | 1 + plugins/pip/pip.plugin.zsh | 5 +- plugins/pipenv/README.md | 28 + plugins/pipenv/pipenv.plugin.zsh | 43 + plugins/please/README.md | 26 + plugins/please/please.plugin.zsh | 7 + plugins/pod/README.md | 10 + plugins/pow/README.md | 21 + plugins/powder/README.md | 8 + plugins/powify/README.md | 10 + plugins/profiles/README.md | 25 + plugins/pyenv/README.md | 16 + plugins/pyenv/pyenv.plugin.zsh | 7 +- plugins/pylint/README.md | 7 +- plugins/pylint/pylint.plugin.zsh | 2 - plugins/python/README.md | 2 + plugins/python/python.plugin.zsh | 40 +- plugins/rails/README.md | 82 + plugins/rails/rails.plugin.zsh | 4 +- plugins/rake-fast/rake-fast.plugin.zsh | 2 +- plugins/rake/README.md | 37 + plugins/rbenv/README.md | 26 + plugins/rbenv/rbenv.plugin.zsh | 90 +- plugins/rbfu/README.md | 17 + plugins/react-native/README.md | 88 +- plugins/react-native/react-native.plugin.zsh | 53 +- plugins/rebar/README.md | 9 + plugins/redis-cli/README.md | 15 + plugins/repo/README.md | 28 +- plugins/repo/_repo | 2 - plugins/repo/repo.plugin.zsh | 16 +- plugins/ripgrep/README.md | 13 + plugins/ripgrep/_ripgrep | 612 ++++ plugins/ros/{README.mkd => README.md} | 0 plugins/rust/README.md | 9 + plugins/rustup/README.md | 9 + plugins/rustup/_rustup | 1143 ++++++++ plugins/rvm/README.md | 20 + plugins/safe-paste/README.md | 9 + plugins/salt/_salt | 2 +- plugins/sbt/README.md | 10 +- plugins/sbt/_sbt | 20 +- plugins/sbt/sbt.plugin.zsh | 10 +- plugins/scala/README.md | 13 +- plugins/screen/README.md | 10 + plugins/sdk/README.md | 14 + plugins/sdk/sdk.plugin.zsh | 58 + plugins/sfdx/README.md | 11 + plugins/sfdx/_sfdx | 1110 ++++++++ plugins/sfffe/README.md | 17 + plugins/sfffe/sfffe.plugin.zsh | 6 +- plugins/shell-proxy/README.md | 52 + plugins/shell-proxy/proxy.py | 72 + plugins/shell-proxy/shell-proxy.plugin.zsh | 16 + plugins/shell-proxy/ssh-agent.py | 16 + plugins/shell-proxy/ssh-proxy.py | 18 + plugins/shrink-path/README.md | 23 +- plugins/shrink-path/shrink-path.plugin.zsh | 52 +- plugins/singlechar/README.md | 118 + plugins/singlechar/singlechar.plugin.zsh | 12 +- plugins/sprunge/README.md | 32 + plugins/sprunge/sprunge.plugin.zsh | 86 +- plugins/ssh-agent/ssh-agent.plugin.zsh | 14 +- plugins/stack/stack.plugin.zsh | 39 +- plugins/sublime/README.md | 38 +- plugins/sublime/sublime.plugin.zsh | 191 +- plugins/sudo/README.md | 22 +- plugins/sudo/sudo.plugin.zsh | 4 +- plugins/supervisor/README.md | 13 + plugins/supervisor/_supervisorctl | 7 + plugins/suse/README.md | 40 +- plugins/suse/suse.plugin.zsh | 40 +- plugins/svn-fast-info/README.md | 56 + .../svn-fast-info/svn-fast-info.plugin.zsh | 77 +- plugins/swiftpm/README.md | 2 +- plugins/swiftpm/_swift | 225 +- plugins/systemadmin/systemadmin.plugin.zsh | 4 +- plugins/systemd/README.md | 41 + plugins/systemd/systemd.plugin.zsh | 80 +- plugins/taskwarrior/README.md | 7 +- plugins/taskwarrior/_task | 4 +- plugins/terminalapp/terminalapp.plugin.zsh | 6 - plugins/terminitor/README.md | 9 + plugins/terraform/README.md | 11 +- plugins/terraform/_terraform | 98 +- plugins/textmate/README.md | 3 +- plugins/thefuck/README.md | 2 +- plugins/thefuck/thefuck.plugin.zsh | 4 +- plugins/themes/_theme | 3 - plugins/themes/themes.plugin.zsh | 45 +- plugins/thor/README.md | 10 + plugins/tig/README.md | 2 +- plugins/timer/timer.plugin.zsh | 5 +- plugins/tmux-cssh/README.md | 10 + plugins/tmux-cssh/_tmux-cssh | 24 +- plugins/tmux/README.md | 8 +- plugins/tmux/tmux.extra.conf | 2 +- plugins/tmux/tmux.plugin.zsh | 14 +- plugins/tmuxinator/README.md | 12 +- plugins/tmuxinator/_tmuxinator | 6 +- plugins/torrent/README.md | 13 + plugins/tugboat/README.md | 12 + plugins/ubuntu/README.md | 68 +- plugins/ubuntu/ubuntu.plugin.zsh | 99 +- plugins/ufw/README.md | 18 + plugins/urltools/README.md | 8 +- plugins/urltools/urltools.plugin.zsh | 8 +- plugins/vagrant/README.md | 30 + plugins/vagrant/_vagrant | 6 +- plugins/vagrant/vagrant.plugin.zsh | 33 + plugins/vault/README.md | 19 +- plugins/vi-mode/vi-mode.plugin.zsh | 24 +- plugins/virtualenvwrapper/README.md | 38 + .../virtualenvwrapper.plugin.zsh | 76 +- plugins/vscode/README.md | 30 +- plugins/vscode/vscode.plugin.zsh | 41 +- plugins/wakeonlan/{README => README.md} | 24 +- plugins/wd/README.md | 219 +- plugins/wd/_wd.sh | 17 +- plugins/wd/wd.plugin.zsh | 7 +- plugins/wd/wd.sh | 59 +- plugins/web-search/README.md | 29 + plugins/web-search/web-search.plugin.zsh | 23 +- plugins/wp-cli/wp-cli.plugin.zsh | 2 +- plugins/yarn/README.md | 6 + plugins/yarn/_yarn | 34 +- plugins/yarn/yarn.plugin.zsh | 6 + plugins/yii/README.md | 15 + plugins/yii2/yii2.plugin.zsh | 2 +- plugins/yum/README.md | 2 +- plugins/z/README.md | 23 + plugins/z/z.sh | 25 +- plugins/zeus/README.md | 106 +- plugins/zeus/zeus.plugin.zsh | 1 + plugins/zsh-interactive-cd/README.md | 23 + .../zsh-interactive-cd.plugin.zsh | 148 + plugins/zsh-navigation-tools/LICENSE | 8 +- plugins/zsh-navigation-tools/Makefile | 35 + plugins/zsh-navigation-tools/README.md | 383 ++- plugins/zsh-navigation-tools/_n-kill | 6 +- plugins/zsh-navigation-tools/n-kill | 4 +- plugins/zsh-navigation-tools/n-list | 2 + .../zsh-navigation-tools.plugin.zsh | 25 +- plugins/zsh_reload/zsh_reload.plugin.zsh | 2 +- templates/zshrc.zsh-template | 17 +- themes/3den.zsh-theme | 2 +- themes/af-magic.zsh-theme | 50 +- themes/agnoster.zsh-theme | 55 +- themes/alanpeabody.zsh-theme | 14 +- themes/amuse.zsh-theme | 27 +- themes/avit.zsh-theme | 81 +- themes/bira.zsh-theme | 32 +- themes/candy-kingdom.zsh-theme | 24 +- themes/crcandy.zsh-theme | 2 +- themes/crunch.zsh-theme | 10 +- themes/dallas.zsh-theme | 13 +- themes/dst.zsh-theme | 2 +- themes/evan.zsh-theme | 4 +- themes/fino-time.zsh-theme | 14 +- themes/fino.zsh-theme | 12 +- themes/fishy.zsh-theme | 2 +- themes/frontcube.zsh-theme | 5 +- themes/gallifrey.zsh-theme | 2 +- themes/gallois.zsh-theme | 4 +- themes/gentoo.zsh-theme | 2 +- themes/gnzh.zsh-theme | 12 +- themes/itchy.zsh-theme | 4 +- themes/jaischeema.zsh-theme | 10 +- themes/kiwi.zsh-theme | 4 +- themes/macovsky-ruby.zsh-theme | 16 +- themes/macovsky.zsh-theme | 14 +- themes/mira.zsh-theme | 20 +- themes/muse.zsh-theme | 43 +- themes/nebirhos.zsh-theme | 2 +- themes/norm.zsh-theme | 5 +- themes/peepcode.zsh-theme | 19 +- themes/pure.zsh-theme | 10 - themes/pygmalion-virtualenv.zsh-theme | 49 + themes/pygmalion.zsh-theme | 12 +- themes/random.zsh-theme | 38 + themes/refined.zsh-theme | 1 + themes/robbyrussell.zsh-theme | 4 +- themes/simonoff.zsh-theme | 6 +- themes/smt.zsh-theme | 71 +- themes/sunrise.zsh-theme | 2 +- themes/suvash.zsh-theme | 15 +- themes/tjkirch.zsh-theme | 2 +- themes/tjkirch_mod.zsh-theme | 2 +- themes/wedisagree.zsh-theme | 5 +- tools/check_for_upgrade.sh | 116 +- tools/install.sh | 397 ++- tools/uninstall.sh | 32 +- tools/upgrade.sh | 82 +- 477 files changed, 16441 insertions(+), 7457 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/main.yml create mode 100644 CODE_OF_CONDUCT.md create mode 100644 lib/cli.zsh create mode 100644 plugins/alias-finder/README.md create mode 100644 plugins/alias-finder/alias-finder.plugin.zsh create mode 100644 plugins/autoenv/README.md create mode 100644 plugins/bazel/README.md create mode 100644 plugins/bazel/_bazel delete mode 100644 plugins/bwana/README.md delete mode 100644 plugins/bwana/bwana.plugin.zsh create mode 100644 plugins/cakephp3/README.md create mode 100644 plugins/chruby/README.md create mode 100644 plugins/cloudapp/README.md delete mode 100755 plugins/cloudapp/cloudapp.rb create mode 100644 plugins/codeclimate/README.md create mode 100644 plugins/colemak/README.md create mode 100644 plugins/colored-man-pages/README.md create mode 100644 plugins/common-aliases/README.md create mode 100644 plugins/compleat/README.md create mode 100644 plugins/dash/README.md create mode 100644 plugins/direnv/README.md create mode 100644 plugins/direnv/direnv.plugin.zsh create mode 100644 plugins/dnote/README.md create mode 100644 plugins/dnote/_dnote create mode 100644 plugins/dotnet/README.md create mode 100644 plugins/dotnet/dotnet.plugin.zsh create mode 100644 plugins/drush/README.md create mode 100644 plugins/drush/drush.complete.sh create mode 100644 plugins/drush/drush.plugin.zsh create mode 100644 plugins/eecms/README.md create mode 100644 plugins/emotty/README.md create mode 100644 plugins/fasd/README.md create mode 100644 plugins/fastfile/README.md create mode 100644 plugins/fbterm/README.md create mode 100644 plugins/fd/README.md create mode 100644 plugins/fd/_fd mode change 120000 => 100644 plugins/fedora/fedora.plugin.zsh rename plugins/firewalld/{readme.md => README.md} (100%) create mode 100644 plugins/flutter/README.md create mode 100644 plugins/flutter/_flutter create mode 100644 plugins/flutter/flutter.plugin.zsh create mode 100644 plugins/gas/README.md create mode 100644 plugins/gatsby/README.md create mode 100644 plugins/gatsby/_gatsby create mode 100644 plugins/gcloud/README.md create mode 100644 plugins/gcloud/gcloud.plugin.zsh create mode 100644 plugins/git-escape-magic/README.md create mode 100644 plugins/git-escape-magic/git-escape-magic create mode 100644 plugins/git-escape-magic/git-escape-magic.plugin.zsh create mode 100644 plugins/git-prompt/README.md delete mode 100644 plugins/git-remote-branch/git-remote-branch.plugin.zsh create mode 100755 plugins/gitfast/update create mode 100644 plugins/gitfast/updates.patch create mode 100644 plugins/glassfish/README.md create mode 100644 plugins/gnu-utils/README.md mode change 120000 => 100644 plugins/go/go.plugin.zsh mode change 120000 => 100644 plugins/gradle/_gradle delete mode 120000 plugins/gradle/_gradlew create mode 100644 plugins/hitokoto/README.md create mode 100644 plugins/hitokoto/hitokoto.plugin.zsh create mode 100644 plugins/httpie/_httpie delete mode 100644 plugins/httpie/httpie.plugin.zsh create mode 100644 plugins/ionic/README.md create mode 100644 plugins/ionic/ionic.plugin.zsh delete mode 100644 plugins/iwhois/README.md delete mode 100644 plugins/iwhois/iwhois.plugin.zsh create mode 100644 plugins/jfrog/README.md create mode 100644 plugins/jfrog/jfrog.plugin.zsh create mode 100644 plugins/jruby/README.md create mode 100644 plugins/knife/README.md create mode 100644 plugins/knife_ssh/README.md create mode 100644 plugins/lein/README.md create mode 100644 plugins/lighthouse/README.md create mode 100644 plugins/lxd/README.md create mode 100644 plugins/lxd/lxd.plugin.zsh create mode 100644 plugins/magic-enter/README.md delete mode 100644 plugins/magic-enter/Readme.md create mode 100644 plugins/microk8s/README.md create mode 100644 plugins/microk8s/microk8s.plugin.zsh create mode 100644 plugins/mysql-macports/README.md create mode 100644 plugins/n98-magerun/README.md delete mode 100644 plugins/nyan/README.md delete mode 100644 plugins/nyan/nyan.plugin.zsh create mode 100644 plugins/oc/README.md create mode 100644 plugins/osx/_security create mode 100644 plugins/osx/music create mode 100644 plugins/otp/README.md create mode 100644 plugins/otp/otp.plugin.zsh create mode 100644 plugins/pass/README.md create mode 100644 plugins/paver/README.md create mode 100644 plugins/perl/README.md create mode 100644 plugins/phing/README.md create mode 100644 plugins/pip/README.md create mode 100644 plugins/pipenv/README.md create mode 100644 plugins/pipenv/pipenv.plugin.zsh create mode 100644 plugins/please/README.md create mode 100644 plugins/please/please.plugin.zsh create mode 100644 plugins/pod/README.md create mode 100644 plugins/pow/README.md create mode 100644 plugins/powder/README.md create mode 100644 plugins/powify/README.md create mode 100644 plugins/profiles/README.md create mode 100644 plugins/pyenv/README.md create mode 100644 plugins/rails/README.md create mode 100644 plugins/rake/README.md create mode 100644 plugins/rbenv/README.md create mode 100644 plugins/rbfu/README.md create mode 100644 plugins/rebar/README.md create mode 100644 plugins/redis-cli/README.md create mode 100644 plugins/ripgrep/README.md create mode 100644 plugins/ripgrep/_ripgrep rename plugins/ros/{README.mkd => README.md} (100%) create mode 100644 plugins/rust/README.md create mode 100644 plugins/rustup/README.md create mode 100644 plugins/rustup/_rustup create mode 100644 plugins/rvm/README.md create mode 100644 plugins/safe-paste/README.md create mode 100644 plugins/screen/README.md create mode 100644 plugins/sdk/README.md create mode 100644 plugins/sdk/sdk.plugin.zsh create mode 100644 plugins/sfdx/README.md create mode 100644 plugins/sfdx/_sfdx create mode 100644 plugins/sfffe/README.md create mode 100644 plugins/shell-proxy/README.md create mode 100755 plugins/shell-proxy/proxy.py create mode 100644 plugins/shell-proxy/shell-proxy.plugin.zsh create mode 100755 plugins/shell-proxy/ssh-agent.py create mode 100755 plugins/shell-proxy/ssh-proxy.py create mode 100644 plugins/singlechar/README.md create mode 100644 plugins/sprunge/README.md create mode 100644 plugins/supervisor/README.md create mode 100644 plugins/svn-fast-info/README.md delete mode 100644 plugins/terminalapp/terminalapp.plugin.zsh create mode 100644 plugins/terminitor/README.md delete mode 100644 plugins/themes/_theme create mode 100644 plugins/thor/README.md create mode 100644 plugins/tmux-cssh/README.md create mode 100644 plugins/torrent/README.md create mode 100644 plugins/tugboat/README.md create mode 100644 plugins/ufw/README.md create mode 100644 plugins/vagrant/vagrant.plugin.zsh create mode 100644 plugins/virtualenvwrapper/README.md rename plugins/wakeonlan/{README => README.md} (67%) create mode 100644 plugins/yii/README.md create mode 100644 plugins/z/README.md create mode 100644 plugins/zsh-interactive-cd/README.md create mode 100644 plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh create mode 100644 plugins/zsh-navigation-tools/Makefile mode change 100644 => 120000 themes/macovsky-ruby.zsh-theme delete mode 100644 themes/pure.zsh-theme create mode 100644 themes/pygmalion-virtualenv.zsh-theme create mode 100644 themes/random.zsh-theme diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..aa18e0e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.sh] +indent_size = 4 +indent_style = tab diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..cba8e93 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# Plugin owners +plugins/gitfast/ @felipec +plugins/sdk/ @rgoldberg diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..7c1cb89 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,36 @@ +--- +name: Bug report +about: Create a report to help us improve Oh My Zsh +labels: 'Type: support' + +--- + + + +**Describe the bug** +A clear description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior, for example: +1. Enable this plugin '...' +2. Run command '...' or try the autocomplete command '...' +3. See error + +**Expected behavior** +A brief description of what should happen. + +**Screenshots and/or Recordings** +If applicable, add screenshots to help explain your problem. +You can also record an asciinema session: https://asciinema.org/ + +**Desktop (please complete the following information):** + - OS / Distro: [e.g. Arch Linux, macOS] + - Latest ohmyzsh Update?: [e.g. Yes/No] + - ZSH Version: [e.g. 5.6] + - Terminal emulator [e.g. iTerm2] + +**Additional context** +Add any other context about the problem here. This can be themes, plugins, custom configs. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..346eaba --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,26 @@ +--- +name: Feature request +about: Suggest a feature for Oh My Zsh +labels: 'Type: feature' + +--- + + + +**Is your feature request related to a particular plugin or theme? If so, specify it.** +The name of the plugin or theme that you would like us to improve. [...] + +**Is your feature request related to a problem? Please describe.** +A description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A description of what you want to happen. + +**Describe alternatives you've considered** +A description of any alternative solutions or features you've considered. This can also include other plugins or aliases. + +**Additional context** +Add any other context or screenshots about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at. diff --git a/.github/ISSUE_TEMPLATE/support.md b/.github/ISSUE_TEMPLATE/support.md new file mode 100644 index 0000000..d263841 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support.md @@ -0,0 +1,10 @@ +--- +name: Support +about: Request support for any problem you're having with Oh My Zsh +labels: 'Type: support' + +--- + +1. Look for similar issues already posted (including closed ones) +2. Include as much relevant information as possible +3. Try to make sure the issue is due to Oh My Zsh diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..6bcb90e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +## Standards checklist: + +- [ ] The PR title is descriptive. +- [ ] The PR doesn't replicate another PR which is already open. +- [ ] I have read the contribution guide and followed all the instructions. +- [ ] The code follows the code style guide detailed in the wiki. +- [ ] The code is mine or it's from somewhere with an MIT-compatible license. +- [ ] The code is efficient, to the best of my ability, and does not waste computer resources. +- [ ] The code is stable and I have tested it myself, to the best of my abilities. + +## Changes: + +- [...] + +## Other comments: + +... diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7ab7efd --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,36 @@ +name: CI +on: + pull_request: + types: + - opened + - synchronize + branches: + - master + push: + branches: + - master + +jobs: + tests: + name: Run tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - name: Set up git repository + uses: actions/checkout@v2 + - name: Install zsh + if: runner.os == 'Linux' + run: sudo apt-get update; sudo apt-get install zsh + - name: Test installer + run: sh ./tools/install.sh + - name: Check syntax + run: | + for file in ./oh-my-zsh.sh \ + ./lib/*.zsh \ + ./plugins/*/*.plugin.zsh \ + ./plugins/*/_* \ + ./themes/*.zsh-theme; do + zsh -n "$file" || return 1 + done diff --git a/.gitignore b/.gitignore index b202208..ec24a19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ # custom files custom/ -!custom/plugins/example -!custom/example.zsh # temp files directories cache/ log/ +*.swp +.DS_Store diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..20ad1cc --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official +project e-mail address, posting via an official social media account, or acting +as an appointed representative at an online or offline event. Representation of +a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ohmyzsh@planetargon.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac263fd..be67e93 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,10 @@ # CONTRIBUTING GUIDELINES -Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged and appreciated. +Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged, and appreciated. It is also essential for the development of the project. +First, please take a moment to review our [code of conduct](CODE_OF_CONDUCT.md). + These guidelines are an attempt at better addressing the huge amount of pending issues and pull requests. Please read them closely. @@ -29,7 +31,7 @@ your problem. If you find one, comment on it so we can know there are more people experiencing it. -If not, look at the [Troubleshooting](https://github.com/robbyrussell/oh-my-zsh/wiki/Troubleshooting) +If not, look at the [Troubleshooting](https://github.com/ohmyzsh/ohmyzsh/wiki/Troubleshooting) page for instructions on how to gather data to better debug your problem. Then, you can go ahead and create an issue with as much detail as you can provide. @@ -60,7 +62,7 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa You should be familiar with the basics of [contributing on GitHub](https://help.github.com/articles/using-pull-requests) and have a fork -[properly set up](https://github.com/robbyrussell/oh-my-zsh/wiki/Contribution-Technical-Practices). +[properly set up](https://github.com/ohmyzsh/ohmyzsh/wiki/Contribution-Technical-Practices). You MUST always create PRs with _a dedicated branch_ based on the latest upstream tree. @@ -83,7 +85,7 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa ### You have an addition -Please [do not](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#dont-send-us-your-theme-for-now) +Please [do not](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#dont-send-us-your-theme-for-now) send themes for now. Please be so kind as to [search](#use-the-search-luke) for any pending, merged or rejected Pull Requests @@ -107,7 +109,7 @@ to help you check whether a similar contribution to yours already exists. Please before making any contribution, it avoids duplicates and eases maintenance. Trust me, that works 90% of the time. -You can also take a look at the [FAQ](https://github.com/robbyrussell/oh-my-zsh/wiki/FAQ) +You can also take a look at the [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ) to be sure your contribution has not already come up. If all fails, your thing has probably not been reported yet, so you can go ahead @@ -119,5 +121,5 @@ and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-reque Very nice!! :) -Please have a look at the [Volunteer](https://github.com/robbyrussell/oh-my-zsh/wiki/Volunteers) +Please have a look at the [Volunteer](https://github.com/ohmyzsh/ohmyzsh/wiki/Volunteers) page for instructions on where to start and more. diff --git a/LICENSE.txt b/LICENSE.txt index 4d465b1..45ba85a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,7 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2009-2019 Robby Russell and contributors -See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors +Copyright (c) 2009-2020 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/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 diff --git a/README.md b/README.md index b3651a9..9fa0c20 100644 --- a/README.md +++ b/README.md @@ -6,24 +6,26 @@ Oh My Zsh is an open source, community-driven framework for managing your [zsh]( Sounds boring. Let's try again. -__Oh My Zsh will not make you a 10x developer...but you might feel like one.__ +__Oh My Zsh will not make you a 10x developer...but you may feel like one.__ Once installed, your terminal shell will become the talk of the town _or your money back!_ With each keystroke in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful themes. Strangers will come up to you in cafés and ask you, _"that is amazing! are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬 -To learn more, visit [ohmyz.sh](https://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. +To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord. + +[![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI) +[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh) +[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/ohmyzsh) ## Getting Started ### Prerequisites -__Disclaimer:__ _Oh My Zsh works best on macOS and Linux._ - -* Unix-like operating system (macOS or Linux) -* [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH) +* A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL is preferred, but cygwin or msys also mostly work. +* [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (run `zsh --version` to confirm), check the following instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH) * `curl` or `wget` should be installed -* `git` should be installed +* `git` should be installed (recommended v1.7.2 or higher) ### Basic Installation @@ -32,20 +34,31 @@ Oh My Zsh is installed by running one of the following commands in your terminal #### via curl ```shell -sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` #### via wget ```shell -sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" +sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +``` + +#### Manual inspection + +It's a good idea to inspect the install script from projects you don't yet know. You can do +that by downloading the install script first, looking through it so everything looks normal, +then running it: + +```shell +curl -Lo install.sh https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh +sh install.sh ``` ## Using Oh My Zsh ### Plugins -Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available. +Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a look in the [plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins) directory and/or the [wiki](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) to see what's currently available. #### Enabling Plugins @@ -69,13 +82,15 @@ plugins=( ) ``` +_Note that the plugins are separated by whitespace. **Do not** use commas between them._ + #### Using Plugins Most plugins (should! we're working on this) include a __README__, which documents how to use them. ### Themes -We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out! +We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki. Check them out! #### Selecting a Theme @@ -91,7 +106,7 @@ To use a different theme, simply change the value to match the name of your desi ```shell ZSH_THEME="agnoster" # (this is one of the fancy ones) -# see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#agnoster +# see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster ``` _Note: many themes require installing the [Powerline Fonts](https://github.com/powerline/fonts) in order to render properly._ @@ -100,7 +115,7 @@ Open up a new terminal window and your prompt should look something like this: ![Agnoster theme](https://cloud.githubusercontent.com/assets/2618447/6316862/70f58fb6-ba03-11e4-82c9-c083bf9a6574.png) -In case you did not find a suitable theme for your needs, please have a look at the wiki for [more of them](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes). +In case you did not find a suitable theme for your needs, please have a look at the wiki for [more of them](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes). If you're feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window. @@ -118,22 +133,68 @@ ZSH_THEME_RANDOM_CANDIDATES=( ) ``` +If you only know which themes you don't like, you can add them similarly to a blacklist: + +```shell +ZSH_THEME_RANDOM_BLACKLIST=(pygmalion tjkirch_mod) +``` + +### FAQ + +If you have some more questions or issues, you might find a solution in our [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ). + ## Advanced Topics If you're the type that likes to get their hands dirty, these sections might resonate. ### Advanced Installation -Some users may want to change the default path, or manually install Oh My Zsh. +Some users may want to manually install Oh My Zsh, or change the default path or other settings that +the installer accepts (these settings are also documented at the top of the install script). #### Custom Directory The default location is `~/.oh-my-zsh` (hidden in your home directory) -If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this: +If you'd like to change the install directory with the `ZSH` environment variable, either by running +`export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline +like this: + +```shell +ZSH="$HOME/.dotfiles/oh-my-zsh" sh install.sh +``` + +#### Unattended install + +If you're running the Oh My Zsh install script as part of an automated install, you can pass the +flag `--unattended` to the `install.sh` script. This will have the effect of not trying to change +the default shell, and also won't run `zsh` when the installation has finished. + +```shell +sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended +``` + +#### Installing from a forked repository + +The install script also accepts these variables to allow installation of a different repository: + +- `REPO` (default: `ohmyzsh/ohmyzsh`): this takes the form of `owner/repository`. If you set + this variable, the installer will look for a repository at `https://github.com/{owner}/{repository}`. + +- `REMOTE` (default: `https://github.com/${REPO}.git`): this is the full URL of the git repository + clone. You can use this setting if you want to install from a fork that is not on GitHub (GitLab, + Bitbucket...) or if you want to clone with SSH instead of HTTPS (`git@github.com:user/project.git`). + + _NOTE: it's incompatible with setting the `REPO` variable. This setting will take precedence._ + +- `BRANCH` (default: `master`): you can use this setting if you want to change the default branch to be + checked out when cloning the repository. This might be useful for testing a Pull Request, or if you + want to use a branch other than `master`. + +For example: ```shell -export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +REPO=apjanke/oh-my-zsh BRANCH=edge sh install.sh ``` #### Manual Installation @@ -141,7 +202,7 @@ export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubus ##### 1. Clone the repository: ```shell -git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh +git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh ``` ##### 2. *Optionally*, backup your existing `~/.zshrc` file: @@ -161,9 +222,11 @@ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc ##### 4. Change your default shell ```shell -chsh -s /bin/zsh +chsh -s $(which zsh) ``` +You must log out from your user session and log back in to see this change. + ##### 5. Initialize your new zsh configuration Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration. @@ -172,8 +235,10 @@ Once you open up a new terminal window, it should load zsh with Oh My Zsh's conf If you have any hiccups installing, here are a few common fixes. -* You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`. -* If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`. +* You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after +switching to `oh-my-zsh`. +* If you installed manually or changed the install location, check the `ZSH` environment variable in +`~/.zshrc`. ### Custom Plugins and Themes @@ -213,15 +278,19 @@ Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy b If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration. -## Contributing +## How do I contribute to Oh My Zsh? + +Before you participate in our delightful community, please read the [code of conduct](CODE_OF_CONDUCT.md). I'm far from being a [Zsh](https://www.zsh.org/) 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! -We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can. +We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/ohmyzsh/ohmyzsh/issues) and help where you can. + +See [Contributing](CONTRIBUTING.md) for more details. ### Do NOT send us themes -We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes) wiki page. +We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes) wiki page. ## Contributors @@ -238,7 +307,7 @@ We're on the social media. ## Merchandise -We have [stickers](https://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](https://shop.planetargon.com/products/ohmyzsh-t-shirts) for you to show off your love of Oh My Zsh. Again, this will help you become the talk of the town! +We have [stickers, shirts, and coffee mugs available](https://shop.planetargon.com/collections/oh-my-zsh?utm_source=github) for you to show off your love of Oh My Zsh. Again, you will become the talk of the town! ## License diff --git a/lib/cli.zsh b/lib/cli.zsh new file mode 100644 index 0000000..e25a9f0 --- /dev/null +++ b/lib/cli.zsh @@ -0,0 +1,195 @@ +#!/usr/bin/env zsh + +function omz { + [[ $# -gt 0 ]] || { + _omz::help + return 1 + } + + local command="$1" + shift + + # Subcommand functions start with _ so that they don't + # appear as completion entries when looking for `omz` + (( $+functions[_omz::$command] )) || { + _omz::help + return 1 + } + + _omz::$command "$@" +} + +function _omz { + local -a cmds subcmds + cmds=( + 'help:Usage information' + 'pr:Commands for Oh My Zsh Pull Requests' + ) + + if (( CURRENT == 2 )); then + _describe 'command' cmds + elif (( CURRENT == 3 )); then + case "$words[2]" in + pr) subcmds=( 'test:Test a Pull Request' 'clean:Delete all Pull Request branches' ) + _describe 'command' subcmds ;; + esac + fi + + return 0 +} + +compdef _omz omz + + +function _omz::help { + cat < [options] + +Available commands: + + help Print this help message + pr Commands for Oh My Zsh Pull Requests + +EOF +} + +function _omz::log { + # if promptsubst is set, a message with `` or $() + # will be run even if quoted due to `print -P` + setopt localoptions nopromptsubst + + # $1 = info|warn|error|debug + # $@ = text + + local logtype=$1 + local logname=${${functrace[1]#_}%:*} + shift + + # Don't print anything if debug is not active + if [[ $logtype = debug && -z $_OMZ_DEBUG ]]; then + return + fi + + # Choose coloring based on log type + case "$logtype" in + prompt) print -Pn "%S%F{blue}$logname%f%s: $@" ;; + debug) print -P "%F{white}$logname%f: $@" ;; + info) print -P "%F{green}$logname%f: $@" ;; + warn) print -P "%S%F{yellow}$logname%f%s: $@" ;; + error) print -P "%S%F{red}$logname%f%s: $@" ;; + esac >&2 +} + +function _omz::pr { + (( $# > 0 && $+functions[_omz::pr::$1] )) || { + cat < [options] + +Available commands: + + clean Delete all PR branches (ohmyzsh/pull-*) + test Fetch PR #NUMBER and rebase against master + +EOF + return 1 + } + + local command="$1" + shift + + _omz::pr::$command "$@" +} + +function _omz::pr::clean { + ( + set -e + builtin cd -q "$ZSH" + + _omz::log info "removing all Oh My Zsh Pull Request branches..." + command git branch --list 'ohmyzsh/pull-*' | while read branch; do + command git branch -D "$branch" + done + ) +} + +function _omz::pr::test { + # Allow $1 to be a URL to the pull request + if [[ "$1" = https://* ]]; then + 1="${1:t}" + fi + + # Check the input + if ! [[ -n "$1" && "$1" =~ ^[[:digit:]]+$ ]]; then + echo >&2 "Usage: omz pr test " + return 1 + fi + + # Save current git HEAD + local branch + branch=$(builtin cd -q "$ZSH"; git symbolic-ref --short HEAD) || { + _omz::log error "error when getting the current git branch. Aborting..." + return 1 + } + + + # Fetch PR onto ohmyzsh/pull- branch and rebase against master + # If any of these operations fail, undo the changes made + ( + set -e + builtin cd -q "$ZSH" + + # Get the ohmyzsh git remote + command git remote -v | while read remote url _; do + case "$url" in + https://github.com/ohmyzsh/ohmyzsh(|.git)) found=1; break ;; + git@github.com:ohmyzsh/ohmyzsh(|.git)) found=1; break ;; + esac + done + + (( $found )) || { + _omz::log error "could not found the ohmyzsh git remote. Aborting..." + return 1 + } + + # Fetch pull request head + _omz::log info "fetching PR #$1 to ohmyzsh/pull-$1..." + command git fetch -f "$remote" refs/pull/$1/head:ohmyzsh/pull-$1 || { + _omz::log error "error when trying to fetch PR #$1." + return 1 + } + + # Rebase pull request branch against the current master + _omz::log info "rebasing PR #$1..." + command git rebase master ohmyzsh/pull-$1 || { + command git rebase --abort &>/dev/null + _omz::log warn "could not rebase PR #$1 on top of master." + _omz::log warn "you might not see the latest stable changes." + _omz::log info "run \`zsh\` to test the changes." + return 1 + } + + _omz::log info "fetch of PR #${1} successful." + ) + + # If there was an error, abort running zsh to test the PR + [[ $? -eq 0 ]] || return 1 + + # Run zsh to test the changes + _omz::log info "running \`zsh\` to test the changes. Run \`exit\` to go back." + command zsh -l + + # After testing, go back to the previous HEAD if the user wants + _omz::log prompt "do you want to go back to the previous branch? [Y/n] " + read -r -k 1 + [[ "$REPLY" = [nN] ]] && return + + ( + set -e + builtin cd -q "$ZSH" + + command git checkout "$branch" -- || { + _omz::log error "could not go back to the previous branch ('$branch')." + return 1 + } + ) +} diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 2c93d1b..122145f 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -3,10 +3,23 @@ # This file has support for doing system clipboard copy and paste operations # from the command line in a generic cross-platform fashion. # -# On OS X and Windows, the main system clipboard or "pasteboard" is used. On other -# Unix-like OSes, this considers the X Windows CLIPBOARD selection to be the -# "system clipboard", and the X Windows `xclip` command must be installed. - +# This is uses essentially the same heuristic as neovim, with the additional +# special support for Cygwin. +# See: https://github.com/neovim/neovim/blob/e682d799fa3cf2e80a02d00c6ea874599d58f0e7/runtime/autoload/provider/clipboard.vim#L55-L121 +# +# - pbcopy, pbpaste (macOS) +# - cygwin (Windows running Cygwin) +# - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set) +# - xclip (if $DISPLAY is set) +# - xsel (if $DISPLAY is set) +# - lemonade (for SSH) https://github.com/pocke/lemonade +# - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ +# - win32yank (Windows) +# - tmux (if $TMUX is set) +# +# Defines two functions, clipcopy and clippaste, based on the detected platform. +## +# # clipcopy - Copy data to clipboard # # Usage: @@ -15,41 +28,8 @@ # # clipcopy - copies a file's contents to clipboard # -function clipcopy() { - emulate -L zsh - local file=$1 - if [[ $OSTYPE == darwin* ]]; then - if [[ -z $file ]]; then - pbcopy - else - cat $file | pbcopy - fi - elif [[ $OSTYPE == cygwin* ]]; then - if [[ -z $file ]]; then - cat > /dev/clipboard - else - cat $file > /dev/clipboard - fi - else - if (( $+commands[xclip] )); then - if [[ -z $file ]]; then - xclip -in -selection clipboard - else - xclip -in -selection clipboard $file - fi - elif (( $+commands[xsel] )); then - if [[ -z $file ]]; then - xsel --clipboard --input - else - cat "$file" | xsel --clipboard --input - fi - else - print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 - return 1 - fi - fi -} - +## +# # clippaste - "Paste" data from clipboard to stdout # # Usage: @@ -67,20 +47,61 @@ function clipcopy() { # # # Paste to a file # clippaste > file.txt -function clippaste() { +# +function detect-clipboard() { emulate -L zsh - if [[ $OSTYPE == darwin* ]]; then - pbpaste - elif [[ $OSTYPE == cygwin* ]]; then - cat /dev/clipboard + + if [[ "${OSTYPE}" == darwin* ]] && (( ${+commands[pbcopy]} )) && (( ${+commands[pbpaste]} )); then + function clipcopy() { pbcopy < "${1:-/dev/stdin}"; } + function clippaste() { pbpaste; } + elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then + function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; } + function clippaste() { cat /dev/clipboard; } + elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then + function clipcopy() { wl-copy < "${1:-/dev/stdin}"; } + function clippaste() { wl-paste; } + elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then + function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; } + function clippaste() { xclip -out -selection clipboard; } + elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then + function clipcopy() { xsel --clipboard --input < "${1:-/dev/stdin}"; } + function clippaste() { xsel --clipboard --output; } + elif (( ${+commands[lemonade]} )); then + function clipcopy() { lemonade copy < "${1:-/dev/stdin}"; } + function clippaste() { lemonade paste; } + elif (( ${+commands[doitclient]} )); then + function clipcopy() { doitclient wclip < "${1:-/dev/stdin}"; } + function clippaste() { doitclient wclip -r; } + elif (( ${+commands[win32yank]} )); then + function clipcopy() { win32yank -i < "${1:-/dev/stdin}"; } + function clippaste() { win32yank -o; } + elif [[ $OSTYPE == linux-android* ]] && (( $+commands[termux-clipboard-set] )); then + function clipcopy() { termux-clipboard-set "${1:-/dev/stdin}"; } + function clippaste() { termux-clipboard-get; } + elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then + function clipcopy() { tmux load-buffer "${1:--}"; } + function clippaste() { tmux save-buffer -; } + elif [[ $(uname -r) = *icrosoft* ]]; then + function clipcopy() { clip.exe < "${1:-/dev/stdin}"; } + function clippaste() { powershell.exe -noprofile -command Get-Clipboard; } else - if (( $+commands[xclip] )); then - xclip -out -selection clipboard - elif (( $+commands[xsel] )); then - xsel --clipboard --output - else - print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 - return 1 - fi + function _retry_clipboard_detection_or_fail() { + local clipcmd="${1}"; shift + if detect-clipboard; then + "${clipcmd}" "$@" + else + print "${clipcmd}: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 + return 1 + fi + } + function clipcopy() { _retry_clipboard_detection_or_fail clipcopy "$@"; } + function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } + return 1 fi } + +# Detect at startup. A non-zero exit here indicates that the dummy clipboards were set, +# which is not really an error. If the user calls them, they will attempt to redetect +# (for example, perhaps the user has now installed xclip) and then either print an error +# or proceed successfully. +detect-clipboard || true diff --git a/lib/compfix.zsh b/lib/compfix.zsh index 68decc1..b09b283 100644 --- a/lib/compfix.zsh +++ b/lib/compfix.zsh @@ -18,7 +18,7 @@ function handle_completion_insecurities() { insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} ) # If no such directories exist, get us out of here. - (( ! ${#insecure_dirs} )) && return + [[ -z "${insecure_dirs}" ]] && return # List ownership and permissions of all insecure directories. print "[oh-my-zsh] Insecure completion-dependent directories detected:" diff --git a/lib/completion.zsh b/lib/completion.zsh index c7db2eb..43927a2 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -41,8 +41,8 @@ fi zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories # Use caching so that commands like apt and dpkg complete are useable -zstyle ':completion::complete:*' use-cache 1 -zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR +zstyle ':completion:*' use-cache yes +zstyle ':completion:*' cache-path $ZSH_CACHE_DIR # Don't complete uninteresting users zstyle ':completion:*:*:*:users' ignored-patterns \ @@ -71,3 +71,6 @@ if [[ $COMPLETION_WAITING_DOTS = true ]]; then zle -N expand-or-complete-with-dots bindkey "^I" expand-or-complete-with-dots fi + +# automatically load bash completion functions +autoload -U +X bashcompinit && bashcompinit diff --git a/lib/diagnostics.zsh b/lib/diagnostics.zsh index 9c9905e..001de42 100644 --- a/lib/diagnostics.zsh +++ b/lib/diagnostics.zsh @@ -192,19 +192,19 @@ function _omz_diag_dump_one_big_text() { command ls -ld ~/.oh* builtin echo builtin echo oh-my-zsh git state: - (cd $ZSH && builtin echo "HEAD: $(git rev-parse HEAD)" && git remote -v && git status | command grep "[^[:space:]]") + (builtin cd $ZSH && builtin echo "HEAD: $(git rev-parse HEAD)" && git remote -v && git status | command grep "[^[:space:]]") if [[ $verbose -ge 1 ]]; then - (cd $ZSH && git reflog --date=default | command grep pull) + (builtin cd $ZSH && git reflog --date=default | command grep pull) fi builtin echo if [[ -e $ZSH_CUSTOM ]]; then local custom_dir=$ZSH_CUSTOM if [[ -h $custom_dir ]]; then - custom_dir=$(cd $custom_dir && pwd -P) + custom_dir=$(builtin cd $custom_dir && pwd -P) fi builtin echo "oh-my-zsh custom dir:" builtin echo " $ZSH_CUSTOM ($custom_dir)" - (cd ${custom_dir:h} && command find ${custom_dir:t} -name .git -prune -o -print) + (builtin cd ${custom_dir:h} && command find ${custom_dir:t} -name .git -prune -o -print) builtin echo fi diff --git a/lib/directories.zsh b/lib/directories.zsh index 14064b8..cf87bd7 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -21,7 +21,15 @@ alias 9='cd -9' alias md='mkdir -p' alias rd=rmdir -alias d='dirs -v | head -10' + +function d () { + if [[ -n $1 ]]; then + dirs "$@" + else + dirs -v | head -10 + fi +} +compdef _dirs d # List directory contents alias lsa='ls -lah' diff --git a/lib/functions.zsh b/lib/functions.zsh index 4ef8920..678e29c 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -3,11 +3,12 @@ function zsh_stats() { } function uninstall_oh_my_zsh() { - env ZSH=$ZSH sh $ZSH/tools/uninstall.sh + env ZSH="$ZSH" sh "$ZSH/tools/uninstall.sh" } function upgrade_oh_my_zsh() { - env ZSH=$ZSH sh $ZSH/tools/upgrade.sh + env ZSH="$ZSH" sh "$ZSH/tools/upgrade.sh" + command rm -rf "$ZSH/log/update.lock" } function take() { @@ -21,7 +22,7 @@ function open_command() { case "$OSTYPE" in darwin*) open_cmd='open' ;; cygwin*) open_cmd='cygstart' ;; - linux*) ! [[ $(uname -a) =~ "Microsoft" ]] && open_cmd='xdg-open' || { + linux*) [[ "$(uname -r)" != *icrosoft* ]] && open_cmd='nohup xdg-open' || { open_cmd='cmd.exe /c start ""' [[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 } } ;; @@ -31,12 +32,7 @@ function open_command() { ;; esac - # don't use nohup on OSX - if [[ "$OSTYPE" == darwin* ]]; then - ${=open_cmd} "$@" &>/dev/null - else - nohup ${=open_cmd} "$@" &>/dev/null - fi + ${=open_cmd} "$@" &>/dev/null } # @@ -79,7 +75,7 @@ function try_alias_value() { # 0 if the variable exists, 3 if it was set # function default() { - test `typeset +m "$1"` && return 0 + (( $+parameters[$1] )) && return 0 typeset -g "$1"="$2" && return 3 } @@ -93,8 +89,8 @@ function default() { # 0 if the env variable exists, 3 if it was set # function env_default() { - env | grep -q "^$1=" && return 0 - export "$1=$2" && return 3 + [[ ${parameters[$1]} = *-export* ]] && return 0 + export "$1=$2" && return 3 } diff --git a/lib/git.zsh b/lib/git.zsh index b923731..00cb00b 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -10,16 +10,23 @@ function git_prompt_info() { # Checks if working tree is dirty function parse_git_dirty() { - local STATUS='' + local STATUS local -a FLAGS FLAGS=('--porcelain') if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then - if [[ $POST_1_7_2_GIT -gt 0 ]]; then - FLAGS+='--ignore-submodules=dirty' - fi if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then FLAGS+='--untracked-files=no' fi + case "$GIT_STATUS_IGNORE_SUBMODULES" in + git) + # let git decide (this respects per-repo config in .gitmodules) + ;; + *) + # if unset: ignore dirty submodules + # other values are passed to --ignore-submodules + FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}" + ;; + esac STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1) fi if [[ -n $STATUS ]]; then @@ -181,28 +188,6 @@ function git_prompt_status() { echo $STATUS } -# Compares the provided version of git to the version installed and on path -# Outputs -1, 0, or 1 if the installed version is less than, equal to, or -# greater than the input version, respectively. -function git_compare_version() { - local INPUT_GIT_VERSION INSTALLED_GIT_VERSION i - INPUT_GIT_VERSION=(${(s/./)1}) - INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null)) - INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]}) - - for i in {1..3}; do - if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then - echo 1 - return 0 - fi - if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then - echo -1 - return 0 - fi - done - echo 0 -} - # Outputs the name of the current user # Usage example: $(git_current_user_name) function git_current_user_name() { @@ -215,7 +200,11 @@ function git_current_user_email() { command git config user.email 2>/dev/null } -# 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 -unfunction git_compare_version +# Output the name of the root directory of the git repository +# Usage example: $(git_repo_name) +function git_repo_name() { + local repo_path + if repo_path="$(git rev-parse --show-toplevel 2>/dev/null)" && [[ -n "$repo_path" ]]; then + echo ${repo_path:t} + fi +} diff --git a/lib/grep.zsh b/lib/grep.zsh index abc1650..a725e0f 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -1,28 +1,41 @@ -# is x grep argument available? -grep-flag-available() { - echo | grep $1 "" >/dev/null 2>&1 -} +__GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias -GREP_OPTIONS="" +# See if there's a cache file modified in the last day +__GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1)) +if [[ -n "$__GREP_ALIAS_CACHES" ]]; then + source "$__GREP_CACHE_FILE" +else + grep-flags-available() { + command grep "$@" "" &>/dev/null <<< "" + } -# color grep results -if grep-flag-available --color=auto; then - GREP_OPTIONS+=" --color=auto" -fi + # Ignore these folders (if the necessary grep flags are available) + EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}" -# ignore VCS folders (if the necessary grep flags are available) -VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}" + # Check for --exclude-dir, otherwise check for --exclude. If --exclude + # isn't available, --color won't be either (they were released at the same + # time (v2.5): https://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007 + if grep-flags-available --color=auto --exclude-dir=.cvs; then + GREP_OPTIONS="--color=auto --exclude-dir=$EXC_FOLDERS" + elif grep-flags-available --color=auto --exclude=.cvs; then + GREP_OPTIONS="--color=auto --exclude=$EXC_FOLDERS" + fi -if grep-flag-available --exclude-dir=.cvs; then - GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS" -elif grep-flag-available --exclude=.cvs; then - GREP_OPTIONS+=" --exclude=$VCS_FOLDERS" -fi + if [[ -n "$GREP_OPTIONS" ]]; then + # export grep, egrep and fgrep settings + alias grep="grep $GREP_OPTIONS" + alias egrep="egrep $GREP_OPTIONS" + alias fgrep="fgrep $GREP_OPTIONS" -# export grep settings -alias grep="grep $GREP_OPTIONS" + # write to cache file if cache directory is writable + if [[ -w "$ZSH_CACHE_DIR" ]]; then + alias -L grep egrep fgrep >| "$__GREP_CACHE_FILE" + fi + fi + + # Clean up + unset GREP_OPTIONS EXC_FOLDERS + unfunction grep-flags-available +fi -# clean up -unset GREP_OPTIONS -unset VCS_FOLDERS -unfunction grep-flag-available +unset __GREP_CACHE_FILE __GREP_ALIAS_CACHES diff --git a/lib/history.zsh b/lib/history.zsh index d8bbd41..0ee8cfe 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -12,12 +12,12 @@ function omz_history { builtin fc "$@" else # unless a number is provided, show all history events (starting from 1) - [[ ${@[-1]} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1 + [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1 fi } # Timestamp format -case $HIST_STAMPS in +case ${HIST_STAMPS-} in "mm/dd/yyyy") alias history='omz_history -f' ;; "dd.mm.yyyy") alias history='omz_history -E' ;; "yyyy-mm-dd") alias history='omz_history -i' ;; @@ -27,8 +27,8 @@ esac ## History file configuration [ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history" -HISTSIZE=50000 -SAVEHIST=10000 +[ "$HISTSIZE" -lt 50000 ] && HISTSIZE=50000 +[ "$SAVEHIST" -lt 10000 ] && SAVEHIST=10000 ## History command configuration setopt extended_history # record timestamp of command in HISTFILE @@ -36,5 +36,4 @@ setopt hist_expire_dups_first # delete duplicates first when HISTFILE size excee setopt hist_ignore_dups # ignore duplicated commands history list setopt hist_ignore_space # ignore commands that start with space setopt hist_verify # show command with history expansion to user before running it -setopt inc_append_history # add commands to HISTFILE in order of execution setopt share_history # share command history data diff --git a/lib/misc.zsh b/lib/misc.zsh index b30822b..a5d3af9 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -1,17 +1,17 @@ -## Load smart urls if available -# bracketed-paste-magic is known buggy in zsh 5.1.1 (only), so skip it there; see #4434 autoload -Uz is-at-least -if [[ $ZSH_VERSION != 5.1.1 ]]; then + +# *-magic is known buggy in some versions; disable if so +if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then for d in $fpath; do - if [[ -e "$d/url-quote-magic" ]]; then - if is-at-least 5.1; then - autoload -Uz bracketed-paste-magic - zle -N bracketed-paste bracketed-paste-magic - fi - autoload -Uz url-quote-magic - zle -N self-insert url-quote-magic - break - fi + if [[ -e "$d/url-quote-magic" ]]; then + if is-at-least 5.1; then + autoload -Uz bracketed-paste-magic + zle -N bracketed-paste bracketed-paste-magic + fi + autoload -Uz url-quote-magic + zle -N self-insert url-quote-magic + break + fi done fi @@ -22,19 +22,14 @@ env_default 'PAGER' 'less' env_default 'LESS' '-R' ## super user alias -alias _='sudo' +alias _='sudo ' ## more intelligent acking for ubuntu users -if which ack-grep &> /dev/null; then +if (( $+commands[ack-grep] )); then alias afind='ack-grep -il' else alias afind='ack -il' fi -# only define LC_CTYPE if undefined -if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then - export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG -fi - # recognize comments setopt interactivecomments diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh index 1d5c23e..5069c4b 100644 --- a/lib/prompt_info_functions.zsh +++ b/lib/prompt_info_functions.zsh @@ -10,9 +10,15 @@ # Dummy implementations that return false to prevent command_not_found # errors with themes, that implement these functions # Real implementations will be used when the respective plugins are loaded -function chruby_prompt_info hg_prompt_info pyenv_prompt_info \ - rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \ - virtualenv_prompt_info jenv_prompt_info { +function chruby_prompt_info \ + rbenv_prompt_info \ + hg_prompt_info \ + pyenv_prompt_info \ + svn_prompt_info \ + vi_mode_prompt_info \ + virtualenv_prompt_info \ + jenv_prompt_info \ +{ return 1 } @@ -22,10 +28,13 @@ function rvm_prompt_info() { [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1 local rvm_prompt rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null) - [[ "${rvm_prompt}x" == "x" ]] && return 1 - echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}" + [[ -z "${rvm_prompt}" ]] && return 1 + echo "${ZSH_THEME_RUBY_PROMPT_PREFIX}${rvm_prompt}${ZSH_THEME_RUBY_PROMPT_SUFFIX}" } +ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" + + # use this to enable users to see their ruby version, no matter which # version management system they use function ruby_prompt_info() { diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index 312ab22..d5c22a8 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -1,4 +1,3 @@ -#! /bin/zsh # A script to make using 256 colors in zsh less painful. # P.C. Shyamshankar # Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ @@ -6,32 +5,31 @@ typeset -AHg FX FG BG FX=( - reset "%{%}" - bold "%{%}" no-bold "%{%}" - italic "%{%}" no-italic "%{%}" - underline "%{%}" no-underline "%{%}" - blink "%{%}" no-blink "%{%}" - reverse "%{%}" no-reverse "%{%}" + 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%}" + FG[$color]="%{[38;5;${color}m%}" + BG[$color]="%{[48;5;${color}m%}" done - -ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} - # Show all 256 colors with color number function spectrum_ls() { + local ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} for code in {000..255}; do - print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}" + print -P -- "$code: $FG[$code]$ZSH_SPECTRUM_TEXT%{$reset_color%}" done } # Show all 256 colors where the background is set to specific color function spectrum_bls() { + local ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} for code in {000..255}; do - print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}" + print -P -- "$code: $BG[$code]$ZSH_SPECTRUM_TEXT%{$reset_color%}" done } diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 87d55ee..e3237ca 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -17,11 +17,11 @@ function title { : ${2=$1} case "$TERM" in - cygwin|xterm*|putty*|rxvt*|ansi) + cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm) print -Pn "\e]2;$2:q\a" # set window name print -Pn "\e]1;$1:q\a" # set tab name ;; - screen*) + screen*|tmux*) print -Pn "\ek$1:q\e\\" # set screen hardstatus ;; *) @@ -32,10 +32,10 @@ function title { # Try to use terminfo to set the title # If the feature is available set title if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then - echoti tsl - print -Pn "$1" - echoti fsl - fi + echoti tsl + print -Pn "$1" + echoti fsl + fi fi ;; esac @@ -50,22 +50,52 @@ fi # Runs before showing the prompt function omz_termsupport_precmd { - emulate -L zsh - - if [[ "$DISABLE_AUTO_TITLE" == true ]]; then - return - fi - + [[ "$DISABLE_AUTO_TITLE" == true ]] && return title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE } # Runs before executing the command function omz_termsupport_preexec { + [[ "$DISABLE_AUTO_TITLE" == true ]] && return + emulate -L zsh setopt extended_glob - if [[ "$DISABLE_AUTO_TITLE" == true ]]; then - return + # split command into array of arguments + local -a cmdargs + cmdargs=("${(z)2}") + # if running fg, extract the command from the job description + if [[ "${cmdargs[1]}" = fg ]]; then + # get the job id from the first argument passed to the fg command + local job_id jobspec="${cmdargs[2]#%}" + # logic based on jobs arguments: + # http://zsh.sourceforge.net/Doc/Release/Jobs-_0026-Signals.html#Jobs + # https://www.zsh.org/mla/users/2007/msg00704.html + case "$jobspec" in + <->) # %number argument: + # use the same passed as an argument + job_id=${jobspec} ;; + ""|%|+) # empty, %% or %+ argument: + # use the current job, which appears with a + in $jobstates: + # suspended:+:5071=suspended (tty output) + job_id=${(k)jobstates[(r)*:+:*]} ;; + -) # %- argument: + # use the previous job, which appears with a - in $jobstates: + # suspended:-:6493=suspended (signal) + job_id=${(k)jobstates[(r)*:-:*]} ;; + [?]*) # %?string argument: + # use $jobtexts to match for a job whose command *contains* + job_id=${(k)jobtexts[(r)*${(Q)jobspec}*]} ;; + *) # %string argument: + # use $jobtexts to match for a job whose command *starts with* + job_id=${(k)jobtexts[(r)${(Q)jobspec}*]} ;; + esac + + # override preexec function arguments with job command + if [[ -n "${jobtexts[$job_id]}" ]]; then + 1="${jobtexts[$job_id]}" + 2="${jobtexts[$job_id]}" + fi fi # cmd name only, or if this is sudo or ssh, the next cmd @@ -75,8 +105,9 @@ function omz_termsupport_preexec { title '$CMD' '%100>...>$LINE%<<' } -precmd_functions+=(omz_termsupport_precmd) -preexec_functions+=(omz_termsupport_preexec) +autoload -U add-zsh-hook +add-zsh-hook precmd omz_termsupport_precmd +add-zsh-hook preexec omz_termsupport_preexec # Keep Apple Terminal.app's current working directory updated @@ -90,16 +121,17 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then function update_terminalapp_cwd() { emulate -L zsh - # Percent-encode the pathname. - local URL_PATH="$(omz_urlencode -P $PWD)" - [[ $? != 0 ]] && return 1 + # Percent-encode the host and path names. + local URL_HOST URL_PATH + URL_HOST="$(omz_urlencode -P $HOST)" || return 1 + URL_PATH="$(omz_urlencode -P $PWD)" || return 1 # Undocumented Terminal.app-specific control sequence - printf '\e]7;%s\a' "file://$HOST$URL_PATH" + printf '\e]7;%s\a' "file://$URL_HOST$URL_PATH" } # Use a precmd hook instead of a chpwd hook to avoid contaminating output - precmd_functions+=(update_terminalapp_cwd) + add-zsh-hook precmd update_terminalapp_cwd # Run once to get initial cwd set update_terminalapp_cwd fi diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 96f34aa..5016d86 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -19,7 +19,7 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then # coreutils, so prefer it to "gls". gls --color -d . &>/dev/null && alias ls='gls --color=tty' colorls -G -d . &>/dev/null && alias ls='colorls -G' - elif [[ "$OSTYPE" == darwin* ]]; then + elif [[ "$OSTYPE" == (darwin|freebsd)* ]]; then # this is a good alias, it works by default just using $LSCOLORS ls -G . &>/dev/null && alias ls='ls -G' @@ -45,11 +45,10 @@ setopt prompt_subst [[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO="" -# 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 +ZSH_THEME_RUBY_PROMPT_PREFIX="(" +ZSH_THEME_RUBY_PROMPT_SUFFIX=")" diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index d7c68d3..5b05725 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -4,14 +4,9 @@ if [[ -z "$ZSH_CACHE_DIR" ]]; then ZSH_CACHE_DIR="$ZSH/cache" fi -# Migrate .zsh-update file to $ZSH_CACHE_DIR -if [ -f ~/.zsh-update ] && [ ! -f ${ZSH_CACHE_DIR}/.zsh-update ]; then - mv ~/.zsh-update ${ZSH_CACHE_DIR}/.zsh-update -fi - # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then - env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh + source $ZSH/tools/check_for_upgrade.sh fi # Initializes Oh My Zsh @@ -29,21 +24,13 @@ if [[ -z "$ZSH_CUSTOM" ]]; then fi -# 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 - custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}" - [ -f "${custom_config_file}" ] && config_file=${custom_config_file} - source $config_file -done - - 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 + builtin test -f $base_dir/plugins/$name/$name.plugin.zsh \ + || builtin test -f $base_dir/plugins/$name/_$name } + # Add all defined plugins to fpath. This must be done # before running compinit. for plugin ($plugins); do @@ -51,6 +38,8 @@ for plugin ($plugins); do fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) elif is_plugin $ZSH $plugin; then fpath=($ZSH/plugins/$plugin $fpath) + else + echo "[oh-my-zsh] plugin '$plugin' not found" fi done @@ -67,18 +56,50 @@ if [ -z "$ZSH_COMPDUMP" ]; then ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}" fi +# Construct zcompdump OMZ metadata +zcompdump_revision="#omz revision: $(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null)" +zcompdump_fpath="#omz fpath: $fpath" + +# Delete the zcompdump file if OMZ zcompdump metadata changed +if ! command grep -q -Fx "$zcompdump_revision" "$ZSH_COMPDUMP" 2>/dev/null \ + || ! command grep -q -Fx "$zcompdump_fpath" "$ZSH_COMPDUMP" 2>/dev/null; then + command rm -f "$ZSH_COMPDUMP" + zcompdump_refresh=1 +fi + if [[ $ZSH_DISABLE_COMPFIX != true ]]; then + source $ZSH/lib/compfix.zsh # If completion insecurities exist, warn the user - if ! compaudit &>/dev/null; then - handle_completion_insecurities - fi + handle_completion_insecurities # Load only from secure directories - compinit -i -d "${ZSH_COMPDUMP}" + compinit -i -C -d "${ZSH_COMPDUMP}" else # If the user wants it, load from all found directories - compinit -u -d "${ZSH_COMPDUMP}" + compinit -u -C -d "${ZSH_COMPDUMP}" +fi + +# Append zcompdump metadata if missing +if (( $zcompdump_refresh )); then + # Use `tee` in case the $ZSH_COMPDUMP filename is invalid, to silence the error + # See https://github.com/ohmyzsh/ohmyzsh/commit/dd1a7269#commitcomment-39003489 + tee -a "$ZSH_COMPDUMP" &>/dev/null <` as well as ``. + +| Function | Command | +| ------------------------- | --------------------------------- | +| ardu [URL or revision_id] | `arc diff --update` [revision_id] | +| arpa [URL or revision_id] | `arc patch` [revision_id] | diff --git a/plugins/arcanist/arcanist.plugin.zsh b/plugins/arcanist/arcanist.plugin.zsh index 3f4eb07..88e6713 100644 --- a/plugins/arcanist/arcanist.plugin.zsh +++ b/plugins/arcanist/arcanist.plugin.zsh @@ -9,13 +9,29 @@ alias arco='arc cover' alias arci='arc commit' alias ard='arc diff' +alias ardc='arc diff --create' alias ardnu='arc diff --nounit' alias ardnupc='arc diff --nounit --plan-changes' alias ardpc='arc diff --plan-changes' +alias ardp='arc diff --preview' # creates a new diff in the phab interface alias are='arc export' alias arh='arc help' alias arl='arc land' alias arli='arc lint' alias arls='arc list' -alias arpa='arc patch' + +# +# Functions +# (sorted alphabetically) +# + +ardu() { + # Both `ardu https://arcanist-url.com/`, and `ardu ` work. + arc diff --update "${1:t}" +} + +arpa() { + # Both `arpa https://arcanist-url.com/`, and `arpa ` work. + arc patch "${1:t}" +} diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md index 7ebe8e5..5882c76 100644 --- a/plugins/archlinux/README.md +++ b/plugins/archlinux/README.md @@ -1,5 +1,13 @@ # Archlinux plugin +This plugin adds some aliases and functions to work with Arch Linux. + +To use it, add `archlinux` to the plugins array in your zshrc file: + +```zsh +plugins=(... archlinux) +``` + ## Features #### YAY @@ -14,7 +22,7 @@ | yalocs | yay -Qs | Search for packages in the local database | | yalst | yay -Qe | List installed packages including from AUR (tagged as "local") | | yamir | yay -Syy | Force refresh of all package lists after updating mirrorlist | -| yaorph | yay -Qtd | Remove orphans using yaourt | +| yaorph | yay -Qtd | Remove orphans using yay | | yare | yay -R | Remove packages, keeping its settings and dependencies | | yarem | yay -Rns | Remove packages, including its settings and unneeded dependencies | | yarep | yay -Si | Display information about a package in the repositories | @@ -119,7 +127,7 @@ | pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages | | upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages | | pacfileupg | sudo pacman -Fy | Download fresh package databases from the server | -| pacfiles | pacman -Fs | Search package file names for matching strings | +| pacfiles | pacman -F | Search package file names for matching strings | | pacls | pacman -Ql | List files in a package | | pacown | pacman -Qo | Show which package owns a file | diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index e0101c7..4d39bd8 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -149,7 +149,7 @@ alias pacmir='sudo pacman -Syy' alias paclsorphans='sudo pacman -Qdt' alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)' alias pacfileupg='sudo pacman -Fy' -alias pacfiles='pacman -Fs' +alias pacfiles='pacman -F' alias pacls='pacman -Ql' alias pacown='pacman -Qo' @@ -208,12 +208,12 @@ function pacmansignkeys() { if (( $+commands[xdg-open] )); then function pacweb() { pkg="$1" - infos="$(pacman -Si "$pkg")" + infos="$(LANG=C pacman -Si "$pkg")" if [[ -z "$infos" ]]; then return fi - repo="$(grep '^Repo' <<< "$infos" | grep -oP '[^ ]+$')" - arch="$(grep '^Arch' <<< "$infos" | grep -oP '[^ ]+$')" + repo="$(grep -m 1 '^Repo' <<< "$infos" | grep -oP '[^ ]+$')" + arch="$(grep -m 1 '^Arch' <<< "$infos" | grep -oP '[^ ]+$')" xdg-open "https://www.archlinux.org/packages/$repo/$arch/$pkg/" &>/dev/null } fi diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 38b2255..c386d57 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -3,7 +3,7 @@ ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" ASDF_COMPLETIONS="$ASDF_DIR/completions" # If not found, check for Homebrew package -if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then +if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && (( $+commands[brew] )); then ASDF_DIR="$(brew --prefix asdf)" ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d" fi diff --git a/plugins/autoenv/README.md b/plugins/autoenv/README.md new file mode 100644 index 0000000..5dfb5fb --- /dev/null +++ b/plugins/autoenv/README.md @@ -0,0 +1,20 @@ +# Autoenv plugin + +This plugin loads the [Autoenv](https://github.com/inishchith/autoenv). + +To use it, add `autoenv` to the plugins array in your zshrc file: + +```zsh +plugins=(... autoenv) +``` + +## Functions + +* `use_env()`: creates and/or activates a virtualenv. For use in `.env` files. + See the source code for details. + +## Requirements + +In order to make this work, you will need to have the autoenv installed. + +More info on the usage and install at [the project's homepage](https://github.com/inishchith/autoenv). diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh index 3c1b0fa..bd03cf4 100644 --- a/plugins/autoenv/autoenv.plugin.zsh +++ b/plugins/autoenv/autoenv.plugin.zsh @@ -1,12 +1,39 @@ -# Activates autoenv or reports its failure +# Initialization: activate autoenv or report its absence () { +local d autoenv_dir install_locations if ! type autoenv_init >/dev/null; then - for d (~/.autoenv ~/.local/bin /usr/local/opt/autoenv /usr/local/bin); do + # Check if activate.sh is in $PATH + if (( $+commands[activate.sh] )); then + autoenv_dir="${commands[activate.sh]:h}" + fi + + # Locate autoenv installation + if [[ -z $autoenv_dir ]]; then + install_locations=( + ~/.autoenv + ~/.local/bin + /usr/local/opt/autoenv + /usr/local/bin + /usr/share/autoenv-git + ~/Library/Python/bin + ) + for d ( $install_locations ); do + if [[ -e $d/activate.sh ]]; then + autoenv_dir=$d + break + fi + done + fi + + # Look for Homebrew path as a last resort + if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then + d=$(brew --prefix)/opt/autoenv if [[ -e $d/activate.sh ]]; then autoenv_dir=$d - break fi - done + fi + + # Complain if autoenv is not installed if [[ -z $autoenv_dir ]]; then cat <&2 -------- AUTOENV --------- @@ -17,6 +44,7 @@ In the meantime the autoenv plugin is DISABLED. END return 1 fi + # Load autoenv source $autoenv_dir/activate.sh fi } @@ -27,17 +55,17 @@ fi # It only performs an action if the requested virtualenv is not the current one. use_env() { - typeset venv - venv="$1" - if [[ "${VIRTUAL_ENV:t}" != "$venv" ]]; then - if workon | grep -q "$venv"; then - workon "$venv" - else - echo -n "Create virtualenv $venv now? (Yn) " - read answer - if [[ "$answer" == "Y" ]]; then - mkvirtualenv "$venv" - fi - fi + local venv + venv="$1" + if [[ "${VIRTUAL_ENV:t}" != "$venv" ]]; then + if workon | grep -q "$venv"; then + workon "$venv" + else + echo -n "Create virtualenv $venv now? (Yn) " + read answer + if [[ "$answer" == "Y" ]]; then + mkvirtualenv "$venv" + fi fi + fi } diff --git a/plugins/autojump/README.md b/plugins/autojump/README.md index 18ff793..750ff56 100644 --- a/plugins/autojump/README.md +++ b/plugins/autojump/README.md @@ -8,4 +8,4 @@ To use it, add `autojump` to the plugins array in your zshrc file: plugins=(... autojump) ``` -More info on the usage: https://github.com/wting/autojump +**Note:** you have to [install autojump](https://github.com/wting/autojump#installation) first. diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index c0af676..f40b0e9 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -1,23 +1,34 @@ -if [ $commands[autojump] ]; then # check if autojump is installed - if [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation - . $HOME/.autojump/etc/profile.d/autojump.zsh - elif [ -f $HOME/.autojump/share/autojump/autojump.zsh ]; then # another manual user-local installation - . $HOME/.autojump/share/autojump/autojump.zsh - elif [ -f $HOME/.nix-profile/etc/profile.d/autojump.zsh ]; then # nix installation - . $HOME/.nix-profile/etc/profile.d/autojump.zsh - elif [ -f /run/current-system/sw/share/autojump/autojump.zsh ]; then # nixos installation - . /run/current-system/sw/share/autojump/autojump.zsh - elif [ -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 /etc/profile.d/autojump.sh ]; then # gentoo installation - . /etc/profile.d/autojump.sh - elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation - . /usr/local/share/autojump/autojump.zsh - elif [ -f /opt/local/etc/profile.d/autojump.sh ]; then # mac os x with ports - . /opt/local/etc/profile.d/autojump.sh - elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew - . `brew --prefix`/etc/autojump.sh +declare -a autojump_paths +autojump_paths=( + $HOME/.autojump/etc/profile.d/autojump.zsh # manual installation + $HOME/.autojump/share/autojump/autojump.zsh # manual installation + $HOME/.nix-profile/etc/profile.d/autojump.sh # NixOS installation + /run/current-system/sw/share/autojump/autojump.zsh # NixOS installation + /usr/share/autojump/autojump.zsh # Debian and Ubuntu package + /etc/profile.d/autojump.zsh # manual installation + /etc/profile.d/autojump.sh # Gentoo installation + /usr/local/share/autojump/autojump.zsh # FreeBSD installation + /opt/local/etc/profile.d/autojump.sh # macOS with MacPorts + /usr/local/etc/profile.d/autojump.sh # macOS with Homebrew (default) +) + +for file in $autojump_paths; do + if [[ -f "$file" ]]; then + source "$file" + found=1 + break + fi +done + +# if no path found, try Homebrew +if (( ! found && $+commands[brew] )); then + file=$(brew --prefix)/etc/profile.d/autojump.sh + if [[ -f "$file" ]]; then + source "$file" + found=1 fi fi + +(( ! found )) && echo '[oh-my-zsh] autojump not found. Please install it first.' + +unset autojump_paths file found diff --git a/plugins/aws/README.md b/plugins/aws/README.md index 8a45199..57c3b54 100644 --- a/plugins/aws/README.md +++ b/plugins/aws/README.md @@ -1,8 +1,7 @@ # aws This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html) -and a few utilities to manage AWS profiles: a function to change profiles with autocompletion support -and a function to get the current AWS profile. The current AWS profile is also displayed in `RPROMPT`. +and a few utilities to manage AWS profiles and display them in the prompt. To use it, add `aws` to the plugins array in your zshrc file. @@ -12,9 +11,28 @@ plugins=(... aws) ## Plugin commands -* `asp `: Sets `AWS_PROFILE` and `AWS_DEFAULT_PROFILE` (legacy) to ``. -It also adds it to your RPROMPT. +* `asp []`: sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to ``. + It also sets `$AWS_EB_PROFILE` to `` for the Elastic Beanstalk CLI. + Run `asp` without arguments to clear the profile. -* `agp`: Gets the current value of `AWS_PROFILE`. +* `agp`: gets the current value of `$AWS_PROFILE`. -* `aws_profiles`: Lists the available profiles in the file referenced in `AWS_CONFIG_FILE` (default: ~/.aws/config). Used to provide completion for the `asp` function. +* `aws_change_access_key`: changes the AWS access key of a profile. + +* `aws_profiles`: lists the available profiles in the `$AWS_CONFIG_FILE` (default: `~/.aws/config`). + Used to provide completion for the `asp` function. + +## Plugin options + +* Set `SHOW_AWS_PROMPT=false` in your zshrc file if you want to prevent the plugin from modifying your RPROMPT. + Some themes might overwrite the value of RPROMPT instead of appending to it, so they'll need to be fixed to + see the AWS profile prompt. + +## Theme + +The plugin creates an `aws_prompt_info` function that you can use in your theme, which displays +the current `$AWS_PROFILE`. It uses two variables to control how that is shown: + +- ZSH_THEME_AWS_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to ``. diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index af27e66..4b54464 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -1,49 +1,106 @@ -_homebrew-installed() { - type brew &> /dev/null - _xit=$? - if [ $_xit -eq 0 ];then - # ok , we have brew installed - # speculatively we check default brew prefix - if [ -h /usr/local/opt/awscli ];then - _brew_prefix="/usr/local/opt/awscli" - else - # ok , it is not default prefix - # this call to brew is expensive ( about 400 ms ), so at least let's make it only once - _brew_prefix=$(brew --prefix awscli) - fi - return 0 - else - return $_xit - fi -} - -_awscli-homebrew-installed() { - [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null -} - -function agp { +function agp() { echo $AWS_PROFILE } -function asp { - local rprompt=${RPROMPT//} +# AWS profile selection +function asp() { + if [[ -z "$1" ]]; then + unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_EB_PROFILE + echo AWS profile cleared. + return + fi + + local -a available_profiles + available_profiles=($(aws_profiles)) + if [[ -z "${available_profiles[(r)$1]}" ]]; then + echo "${fg[red]}Profile '$1' not found in '${AWS_CONFIG_FILE:-$HOME/.aws/config}'" >&2 + echo "Available profiles: ${(j:, :)available_profiles:-no profiles found}${reset_color}" >&2 + return 1 + fi export AWS_DEFAULT_PROFILE=$1 export AWS_PROFILE=$1 + export AWS_EB_PROFILE=$1 +} + +function aws_change_access_key() { + if [[ -z "$1" ]]; then + echo "usage: $0 " + return 1 + fi + + echo Insert the credentials when asked. + asp "$1" || return 1 + AWS_PAGER="" aws iam create-access-key + AWS_PAGER="" aws configure --profile "$1" + + echo You can now safely delete the old access key running \`aws iam delete-access-key --access-key-id ID\` + echo Your current keys are: + AWS_PAGER="" aws iam list-access-keys +} - export RPROMPT="$rprompt" +function aws_profiles() { + [[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1 + grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/' } -function aws_profiles { - reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) +function _aws_profiles() { + reply=($(aws_profiles)) } -compctl -K aws_profiles asp +compctl -K _aws_profiles asp aws_change_access_key -if which aws_zsh_completer.sh &>/dev/null; then - _aws_zsh_completer_path=$(which aws_zsh_completer.sh 2>/dev/null) -elif _homebrew-installed && _awscli-homebrew-installed; then - _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh +# AWS prompt +function aws_prompt_info() { + [[ -z $AWS_PROFILE ]] && return + echo "${ZSH_THEME_AWS_PREFIX:=}" +} + +if [ "$SHOW_AWS_PROMPT" != false ]; then + RPROMPT='$(aws_prompt_info)'"$RPROMPT" fi -[ -n "$_aws_zsh_completer_path" ] && [ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path -unset _aws_zsh_completer_path + +# Load awscli completions + +# AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back +if [[ -x /usr/local/bin/aws_completer ]]; then + autoload -Uz bashcompinit && bashcompinit + complete -C aws_completer aws +else + function _awscli-homebrew-installed() { + # check if Homebrew is installed + (( $+commands[brew] )) || return 1 + + # speculatively check default brew prefix + if [ -h /usr/local/opt/awscli ]; then + _brew_prefix=/usr/local/opt/awscli + else + # ok, it is not in the default prefix + # this call to brew is expensive (about 400 ms), so at least let's make it only once + _brew_prefix=$(brew --prefix awscli) + fi + } + + # get aws_zsh_completer.sh location from $PATH + _aws_zsh_completer_path="$commands[aws_zsh_completer.sh]" + + # otherwise check common locations + if [[ -z $_aws_zsh_completer_path ]]; then + # Homebrew + if _awscli-homebrew-installed; then + _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh + # Ubuntu + elif [[ -e /usr/share/zsh/vendor-completions/_awscli ]]; then + _aws_zsh_completer_path=/usr/share/zsh/vendor-completions/_awscli + # NixOS + elif [[ -e "${commands[aws]:P:h:h}/share/zsh/site-functions/aws_zsh_completer.sh" ]]; then + _aws_zsh_completer_path="${commands[aws]:P:h:h}/share/zsh/site-functions/aws_zsh_completer.sh" + # RPM + else + _aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh + fi + fi + + [[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path + unset _aws_zsh_completer_path _brew_prefix +fi diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 8f398cf..755ec8d 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -7,23 +7,25 @@ # Email: neuralsandwich@gmail.com # # Modified to add support for Apple Mac # ########################################### +# Author: J (927589452) # +# Modified to add support for FreeBSD # +########################################### -if [[ "$OSTYPE" = darwin* ]] ; then +if [[ "$OSTYPE" = darwin* ]]; then - function battery_pct() { - local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" - typeset -F maxcapacity=$(echo $smart_battery_status | grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //') - typeset -F currentcapacity=$(echo $smart_battery_status | grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //') - integer i=$(((currentcapacity/maxcapacity) * 100)) - echo $i + function battery_is_charging() { + ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ Yes' } - function plugged_in() { - [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ] + function battery_pct() { + local battery_status="$(ioreg -rc AppleSmartBattery)" + local -i capacity=$(sed -n -e '/MaxCapacity/s/^.*"MaxCapacity"\ =\ //p' <<< $battery_status) + local -i current=$(sed -n -e '/CurrentCapacity/s/^.*"CurrentCapacity"\ =\ //p' <<< $battery_status) + echo $(( current * 100 / capacity )) } function battery_pct_remaining() { - if plugged_in ; then + if battery_is_charging; then echo "External Power" else battery_pct @@ -32,9 +34,9 @@ if [[ "$OSTYPE" = darwin* ]] ; then function battery_time_remaining() { local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" - if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then - timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //') - if [ $timeremaining -gt 720 ] ; then + if [[ $(echo $smart_battery_status | command grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]]; then + timeremaining=$(echo $smart_battery_status | command grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //') + if [ $timeremaining -gt 720 ]; then echo "::" else echo "~$((timeremaining / 60)):$((timeremaining % 60))" @@ -45,39 +47,36 @@ if [[ "$OSTYPE" = darwin* ]] ; then } function battery_pct_prompt () { - if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then - b=$(battery_pct_remaining) - if [ $b -gt 50 ] ; then + local battery_pct color + if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ No'; then + battery_pct=$(battery_pct_remaining) + if [[ $battery_pct -gt 50 ]]; then color='green' - elif [ $b -gt 20 ] ; then + elif [[ $battery_pct -gt 20 ]]; then color='yellow' else color='red' fi - echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" + echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}" else echo "∞" fi } - function battery_is_charging() { - [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]] - } - -elif [[ "$OSTYPE" = linux* ]] ; then +elif [[ "$OSTYPE" = freebsd* ]]; then function battery_is_charging() { - ! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] + [[ $(sysctl -n hw.acpi.battery.state) -eq 2 ]] } function battery_pct() { - if (( $+commands[acpi] )) ; then - echo "$(acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]')" + if (( $+commands[sysctl] )); then + sysctl -n hw.acpi.battery.life fi } function battery_pct_remaining() { - if [ ! $(battery_is_charging) ] ; then + if ! battery_is_charging; then battery_pct else echo "External Power" @@ -85,76 +84,128 @@ elif [[ "$OSTYPE" = linux* ]] ; then } function battery_time_remaining() { - if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then - echo $(acpi 2>/dev/null | cut -f3 -d ',') + local remaining_time + remaining_time=$(sysctl -n hw.acpi.battery.time) + if [[ $remaining_time -ge 0 ]]; then + ((hour = $remaining_time / 60 )) + ((minute = $remaining_time % 60 )) + printf %02d:%02d $hour $minute fi } function battery_pct_prompt() { - b=$(battery_pct_remaining) - if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then - if [ $b -gt 50 ] ; then + local battery_pct color + battery_pct=$(battery_pct_remaining) + if battery_is_charging; then + echo "∞" + else + if [[ $battery_pct -gt 50 ]]; then color='green' - elif [ $b -gt 20 ] ; then + elif [[ $battery_pct -gt 20 ]]; then color='yellow' else color='red' fi - echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}" - else - echo "∞" + echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}" + fi + } + +elif [[ "$OSTYPE" = linux* ]]; then + + function battery_is_charging() { + ! acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -q '^Battery.*Discharging' + } + + function battery_pct() { + if (( $+commands[acpi] )); then + acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -E '^Battery.*(Full|(Disc|C)harging)' | cut -f2 -d ',' | tr -cd '[:digit:]' fi } -else - # Empty functions so we don't cause errors in prompts function battery_pct_remaining() { + if ! battery_is_charging; then + battery_pct + else + echo "External Power" + fi } function battery_time_remaining() { + if ! battery_is_charging; then + acpi 2>/dev/null | command grep -v "rate information unavailable" | cut -f3 -d ',' + fi } function battery_pct_prompt() { + local battery_pct color + battery_pct=$(battery_pct_remaining) + if battery_is_charging; then + echo "∞" + else + if [[ $battery_pct -gt 50 ]]; then + color='green' + elif [[ $battery_pct -gt 20 ]]; then + color='yellow' + else + color='red' + fi + echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}" + fi } + +else + # Empty functions so we don't cause errors in prompts + function battery_is_charging { false } + function battery_pct \ + battery_pct_remaining \ + battery_time_remaining \ + battery_pct_prompt { } fi function battery_level_gauge() { - local gauge_slots=${BATTERY_GAUGE_SLOTS:-10}; - local green_threshold=${BATTERY_GREEN_THRESHOLD:-6}; - local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-4}; - local color_green=${BATTERY_COLOR_GREEN:-%F{green}}; - local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}}; - local color_red=${BATTERY_COLOR_RED:-%F{red}}; - local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}}; - local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['}; - local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'}; - local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'}; - local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'}; - local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow}; - local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'}; - - local battery_remaining_percentage=$(battery_pct); + local gauge_slots=${BATTERY_GAUGE_SLOTS:-10} + local green_threshold=${BATTERY_GREEN_THRESHOLD:-$(( gauge_slots * 0.6 ))} + local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-$(( gauge_slots * 0.4 ))} + local color_green=${BATTERY_COLOR_GREEN:-%F{green}} + local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}} + local color_red=${BATTERY_COLOR_RED:-%F{red}} + local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}} + local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['} + local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'} + local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'} + local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'} + local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow} + local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'} + + local battery_remaining_percentage=$(battery_pct) + local filled empty gauge_color if [[ $battery_remaining_percentage =~ [0-9]+ ]]; then - local filled=$(((( $battery_remaining_percentage + $gauge_slots - 1) / $gauge_slots))); - local empty=$(($gauge_slots - $filled)); + filled=$(( ($battery_remaining_percentage * $gauge_slots) / 100 )) + empty=$(( $gauge_slots - $filled )) - if [[ $filled -gt $green_threshold ]]; then local gauge_color=$color_green; - elif [[ $filled -gt $yellow_threshold ]]; then local gauge_color=$color_yellow; - else local gauge_color=$color_red; + if [[ $filled -gt $green_threshold ]]; then + gauge_color=$color_green + elif [[ $filled -gt $yellow_threshold ]]; then + gauge_color=$color_yellow + else + gauge_color=$color_red fi else - local filled=$gauge_slots; - local empty=0; - filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'}; + filled=$gauge_slots + empty=0 + filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'} fi - local charging=' ' && battery_is_charging && charging=$charging_symbol; + local charging=' ' + battery_is_charging && charging=$charging_symbol - printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%} - printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled} + # Charging status and prefix + print -n ${charging_color}${charging}${color_reset}${battery_prefix}${gauge_color} + # Filled slots + [[ $filled -gt 0 ]] && printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled} + # Empty slots [[ $filled -lt $gauge_slots ]] && printf ${empty_symbol//\%/\%\%}'%.0s' {1..$empty} - printf ${color_reset//\%/\%\%}${battery_suffix//\%/\%\%}${color_reset//\%/\%\%} + # Suffix + print -n ${color_reset}${battery_suffix}${color_reset} } - - diff --git a/plugins/bazel/README.md b/plugins/bazel/README.md new file mode 100644 index 0000000..e5ffe6e --- /dev/null +++ b/plugins/bazel/README.md @@ -0,0 +1,5 @@ +## Bazel autocomplete plugin + +A copy of the completion script from the +[bazelbuild/bazel](https://github.com/bazelbuild/bazel/master/scripts/zsh_completion/_bazel) +git repo. diff --git a/plugins/bazel/_bazel b/plugins/bazel/_bazel new file mode 100644 index 0000000..827ce54 --- /dev/null +++ b/plugins/bazel/_bazel @@ -0,0 +1,341 @@ +#compdef bazel + +# Copyright 2015 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Installation +# ------------ +# +# 1. Add this script to a directory on your $fpath: +# fpath[1,0]=~/.zsh/completion/ +# mkdir -p ~/.zsh/completion/ +# cp scripts/zsh_completion/_bazel ~/.zsh/completion +# +# 2. Optionally, add the following to your .zshrc. +# zstyle ':completion:*' use-cache on +# zstyle ':completion:*' cache-path ~/.zsh/cache +# +# This way, the completion script does not have to parse Bazel's options +# repeatedly. The directory in cache-path must be created manually. +# +# 3. Restart the shell +# +# Options +# ------- +# completion:init:bazel:* cache-lifetime +# Lifetime for the completion cache (if turned on, default: 1 week) + +local curcontext="$curcontext" state line + +: ${BAZEL_COMPLETION_PACKAGE_PATH:=%workspace%} +: ${BAZEL:=bazel} +_bazel_b() { ${BAZEL} --noblock_for_lock "$@" 2>/dev/null; } + +# Default cache lifetime is 1 week +zstyle -s ":completion:${curcontext}:" cache-lifetime lifetime +if [[ -z "${lifetime}" ]]; then + lifetime=$((60*60*24*7)) +fi + +_bazel_cache_policy() { + local -a oldp + oldp=( "$1"(Nms+${lifetime}) ) + (( $#oldp )) +} + +_set_cache_policy() { + zstyle -s ":completion:*:$curcontext*" cache-policy update_policy + + if [[ -z "$update_policy" ]]; then + zstyle ":completion:$curcontext*" cache-policy _bazel_cache_policy + fi +} + +# Skips over all global arguments. After invocation, OFFSET contains the +# position of the bazel command in $words. +_adapt_subcommand_offset() { + OFFSET=2 + for w in ${words[2,-1]}; do + if [[ $w == (#b)-* ]]; then + (( OFFSET++ )) + else + return + fi + done +} + +# Retrieve the cache but also check that the value is not empty. +_bazel_safe_retrieve_cache() { + _retrieve_cache $1 && [[ ${(P)#2} -gt 0 ]] +} + +# Puts the name of the variable that contains the options for the bazel +# subcommand handed in as the first argument into the global variable +# _bazel_cmd_options. +_bazel_get_options() { + local lcmd=$1 + _bazel_cmd_options=_bazel_${lcmd}_options + _bazel_cmd_args=_bazel_${lcmd}_args + if [[ ${(P)#_bazel_cmd_options} != 0 ]]; then + return + fi + if _cache_invalid BAZEL_${lcmd}_options || _cache_invalid BAZEL_${lcmd}_args \ + || ! _bazel_safe_retrieve_cache BAZEL_${lcmd}_options ${_bazel_cmd_options} \ + || ! _retrieve_cache BAZEL_${lcmd}_args ${_bazel_cmd_args}; then + if ! eval "$(_bazel_b help completion)"; then + return + fi + local opts_var + if [[ $lcmd == "startup_options" ]]; then + opts_var="BAZEL_STARTUP_OPTIONS" + else + opts_var="BAZEL_COMMAND_${lcmd:u}_FLAGS" + fi + local -a raw_options + if ! eval "raw_options=(\${(@f)$opts_var})"; then + return + fi + + local -a option_list + for opt in $raw_options; do + case $opt in + --*"={"*) + local lst="${${opt##*"={"}%"}"}" + local opt="${opt%%=*}=" + option_list+=("${opt}:string:_values '' ${lst//,/ }") ;; + --*=path) + option_list+=("${opt%path}:path:_files") ;; + --*=label) + option_list+=("${opt%label}:target:_bazel_complete_target") ;; + --*=*) + option_list+=("${opt}:string:") ;; + *) + option_list+=("$opt") ;; + esac + done + + local -a cmd_args + local cmd_type + if eval "cmd_type=\${BAZEL_COMMAND_${lcmd:u}_ARGUMENT}" && [[ -n $cmd_type ]]; then + case $cmd_type in + label|label-*) + cmd_args+=("*::${cmd_type}:_bazel_complete_target_${cmd_type//-/_}") ;; + info-key) + cmd_args+=('1::key:_bazel_info_key') ;; + path) + cmd_args+=('1::profile:_path_files') ;; + "command|{"*"}") + local lst=${${cmd_type#"command|{"}%"}"} + cmd_args+=("1::topic:_bazel_help_topic -- ${lst//,/ }") ;; + esac + fi + + typeset -g "${_bazel_cmd_options}"="${(pj:|:)option_list[*]}" + _store_cache BAZEL_${lcmd}_options ${_bazel_cmd_options} + typeset -g "${_bazel_cmd_args}"="${(pj:|:)cmd_args[*]}" + _store_cache BAZEL_${lcmd}_args ${_bazel_cmd_args} + fi +} + +_get_build_targets() { + local pkg=$1 + local rule_re + typeset -a completions + case $target_type in + test) + rule_re=".*_test" + ;; + build) + rule_re=".*" + ;; + bin) + rule_re=".*_test|.*_binary" + ;; + esac + completions=(${$(_bazel_b query "kind(\"${rule_re}\", ${pkg}:all)" 2>/dev/null)##*:}) + if ( (( ${#completions} > 0 )) && [[ $target_type != run ]] ); then + completions+=(all) + fi + echo ${completions[*]} +} + +# Returns all packages that match $PREFIX. PREFIX may start with //, in which +# case the workspace roots are searched. Otherwise, they are completed based on +# PWD. +_get_build_packages() { + local workspace pfx + typeset -a package_roots paths final_paths + workspace=$PWD + package_roots=(${(ps.:.)BAZEL_COMPLETION_PACKAGE_PATH}) + package_roots=(${^package_roots//\%workspace\%/$workspace}) + if [[ "${(e)PREFIX}" == //* ]]; then + pfx=${(e)PREFIX[2,-1]} + else + pfx=${(e)PREFIX} + fi + paths=(${^package_roots}/${pfx}*(/)) + for p in ${paths[*]}; do + if [[ -f ${p}/BUILD || -f ${p}/BUILD.bazel ]]; then + final_paths+=(${p##*/}:) + fi + final_paths+=(${p##*/}/) + done + echo ${final_paths[*]} +} + +_package_remove_slash() { + if [[ $KEYS == ':' && $LBUFFER == */ ]]; then + LBUFFER=${LBUFFER[1,-2]} + fi +} + +# Completion function for BUILD targets, called by the completion system. +_bazel_complete_target() { + local expl + typeset -a packages targets + if [[ "${(e)PREFIX}" != *:* ]]; then + # There is no : in the prefix, completion can be either + # a package or a target, if the cwd is a package itself. + if [[ -f $PWD/BUILD || -f $PWD/BUILD.bazel ]]; then + targets=($(_get_build_targets "")) + _description build_target expl "BUILD target" + compadd "${expl[@]}" -a targets + fi + packages=($(_get_build_packages)) + _description build_package expl "BUILD package" + # Chop of the leading path segments from the prefix for display. + compset -P '*/' + compadd -R _package_remove_slash -S '' "${expl[@]}" -a packages + else + targets=($(_get_build_targets "${${(e)PREFIX}%:*}")) + _description build_target expl "BUILD target" + # Ignore the current prefix for the upcoming completion, since we only list + # the names of the targets, not the full path. + compset -P '*:' + compadd "${expl[@]}" -a targets + fi +} + +_bazel_complete_target_label() { + typeset -g target_type=build + _bazel_complete_target +} + +_bazel_complete_target_label_test() { + typeset -g target_type=test + _bazel_complete_target +} + +_bazel_complete_target_label_bin() { + typeset -g target_type=bin + _bazel_complete_target +} + +### Actual completion commands + +_bazel() { + _adapt_subcommand_offset + if (( CURRENT - OFFSET > 0 )); then + # Remember the subcommand name, stored globally so we can access it + # from any subsequent function + cmd=${words[OFFSET]//-/_} + + # Set the context for the subcommand. + curcontext="${curcontext%:*:*}:bazel-$cmd:" + _set_cache_policy + + # Narrow the range of words we are looking at to exclude cmd + # name and any leading options + (( CURRENT = CURRENT - OFFSET + 1 )) + shift $((OFFSET - 1)) words + # Run the completion for the subcommand + _bazel_get_options $cmd + _arguments : \ + ${(Pps:|:)_bazel_cmd_options} \ + ${(Pps:|:)_bazel_cmd_args} + else + _set_cache_policy + # Start special handling for global options, + # which can be retrieved by calling + # $ bazel help startup_options + _bazel_get_options startup_options + _arguments : \ + ${(Pps:|:)_bazel_cmd_options} \ + "*:commands:_bazel_commands" + fi + return +} + +_get_commands() { + # bazel_cmd_list is a global (g) array (a) + typeset -ga _bazel_cmd_list + # Use `bazel help` instead of `bazel help completion` to get command + # descriptions. + if _bazel_cmd_list=("${(@f)$(_bazel_b help | awk ' +/Available commands/ { command=1; } +/ [-a-z]+[ \t]+.+/ { if (command) { printf "%s:", $1; for (i=2; i<=NF; i++) printf "%s ", $i; print "" } } +/^$/ { command=0; }')}"); then + _store_cache BAZEL_commands _bazel_cmd_list + fi +} + +# Completion function for bazel subcommands, called by the completion system. +_bazel_commands() { + if [[ ${#_bazel_cmd_list} == 0 ]]; then + if _cache_invalid BAZEL_commands \ + || ! _bazel_safe_retrieve_cache BAZEL_commands _bazel_cmd_list; then + _get_commands + fi + fi + + _describe -t bazel-commands 'Bazel command' _bazel_cmd_list +} + +# Completion function for bazel help options, called by the completion system. +_bazel_help_topic() { + if [[ ${#_bazel_cmd_list} == 0 ]]; then + if _cache_invalid BAZEL_commands \ + || ! _bazel_safe_retrieve_cache BAZEL_commands _bazel_cmd_list; then + _get_commands + fi + fi + + while [[ $# -gt 0 ]]; do + if [[ $1 == -- ]]; then + shift + break + fi + shift + done + _bazel_help_list=($@) + _bazel_help_list+=($_bazel_cmd_list) + _describe -t bazel-help 'Help topic' _bazel_help_list +} + +# Completion function for bazel info keys, called by the completion system. +_bazel_info_key() { + if [[ ${#_bazel_info_keys_list} == 0 ]]; then + if _cache_invalid BAZEL_info_keys \ + || ! _bazel_safe_retrieve_cache BAZEL_info_keys _bazel_info_keys_list; then + typeset -ga _bazel_info_keys_list + # Use `bazel help` instead of `bazel help completion` to get info-key + # descriptions. + if _bazel_info_keys_list=("${(@f)$(_bazel_b help info-keys | awk ' + { printf "%s:", $1; for (i=2; i<=NF; i++) printf "%s ", $i; print "" }')}"); then + _store_cache BAZEL_info_keys _bazel_info_keys_list + fi + fi + fi + _describe -t bazel-info 'Key' _bazel_info_keys_list +} diff --git a/plugins/bower/README.md b/plugins/bower/README.md index 743b6a0..8877fbd 100644 --- a/plugins/bower/README.md +++ b/plugins/bower/README.md @@ -4,7 +4,7 @@ This plugin adds completion for [Bower](https://bower.io/) and a few useful alia To use it, add `bower` to the plugins array in your zshrc file: -``` +```zsh plugins=(... bower) ``` @@ -15,4 +15,3 @@ plugins=(... bower) | bi | `bower install` | Installs the project dependencies listed in bower.json | | bl | `bower list` | List local packages and possible updates | | bs | `bower search` | Finds all packages or a specific package. | - diff --git a/plugins/brew/README.md b/plugins/brew/README.md index c129a76..44af052 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -3,19 +3,27 @@ The plugin adds several aliases for common [brew](https://brew.sh) commands. To use it, add `brew` to the plugins array of your zshrc file: -``` + +```zsh plugins=(... brew) ``` ## Aliases -| Alias | Command | Description | -|--------|----------------------|---------------| -| brewp | `brew pin` | Pin a specified formulae, preventing them from being upgraded when issuing the brew upgrade command. | -| brews | `brew list -1` | List installed formulae, one entry per line, or the installed files for a given formulae. | -| brewsp | `brew list --pinned` | Show the versions of pinned formulae, or only the specified (pinned) formulae if formulae are given. | -| bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. | -| bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. | -| bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. | -| bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. | -| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. | \ No newline at end of file +| Alias | Command | Description | +|----------|-------------------------------------------------------------|---------------------------------------------------------------------| +| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. | +| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. | +| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. | +| `bubo` | `brew update && brew outdated` | Update Homebrew and all formulae, then list outdated formulae. | +| `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae, then run cleanup. | +| `bubu` | `bubo && bubc` | Do the last two operations above. | +| `bcubo` | `brew update && brew cask outdated` | Update Homebrew and alll formulae, then list outdated casks. | +| `bcubc` | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Update outdated casks, then run cleanup. | + +## Completion + +With the release of Homebrew 1.0, they decided to bundle the zsh completion as part of the +brew installation, so we no longer ship it with the brew plugin; now it only has brew +aliases. If you find that brew completion no longer works, make sure you have your Homebrew +installation fully up to date. diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index cfbaa34..fdea76c 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -6,19 +6,3 @@ alias bubc='brew upgrade && brew cleanup' alias bubu='bubo && bubc' alias bcubo='brew update && brew cask outdated' alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup' - -if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then - print -P '%F{yellow}'Oh My Zsh brew plugin: - cat <<-'EOF' - - With the advent of their 1.0 release, Homebrew has decided to bundle - the zsh completion as part of the brew installation, so we no longer - ship it with the brew plugin; now it only has brew aliases. - - If you find that brew completion no longer works, make sure you have - your Homebrew installation fully up to date. - - You will only see this message once. - EOF - print -P '%f' -fi diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md index dc2f170..a3bceb0 100644 --- a/plugins/bundler/README.md +++ b/plugins/bundler/README.md @@ -1,8 +1,10 @@ # Bundler -- adds completion for basic bundler commands -- adds short aliases for common bundler commands - - `be` aliased to `bundle exec`. +- Adds completion for basic bundler commands + +- Adds short aliases for common bundler commands + - `ba` aliased to `bundle add` + - `be` aliased to `bundle exec`. It also supports aliases (if `rs` is `rails server`, `be rs` will bundle-exec `rails server`). - `bl` aliased to `bundle list` - `bp` aliased to `bundle package` @@ -10,12 +12,15 @@ - `bout` aliased to `bundle outdated` - `bu` aliased to `bundle update` - `bi` aliased to `bundle install --jobs=` (only for bundler `>= 1.4.0`) -- adds a wrapper for common gems: - - looks for a binstub under `./bin/` and executes it (if present) - - calls `bundle exec ` otherwise + - `bcn` aliased to `bundle clean` + - `bck` aliased to `bundle check` + +- Adds a wrapper for common gems: + - Looks for a binstub under `./bin/` and executes it (if present) + - Calls `bundle exec ` otherwise Common gems wrapped by default (by name of the executable): -`annotate`, `cap`, `capify`, `cucumber`, `foodcritic`, `guard`, `hanami`, `irb`, `jekyll`, `kitchen`, `knife`, `middleman`, `nanoc`, `pry`, `puma`, `rackup`, `rainbows`, `rake`, `rspec`, `shotgun`, `sidekiq`, `spec`, `spork`, `spring`, `strainer`, `tailor`, `taps`, `thin`, `thor`, `unicorn` and `unicorn_rails`. +`annotate`, `cap`, `capify`, `cucumber`, `foodcritic`, `guard`, `hanami`, `irb`, `jekyll`, `kitchen`, `knife`, `middleman`, `nanoc`, `pry`, `puma`, `rackup`, `rainbows`, `rake`, `rspec`, `rubocop`, `shotgun`, `sidekiq`, `spec`, `spork`, `spring`, `strainer`, `tailor`, `taps`, `thin`, `thor`, `unicorn` and `unicorn_rails`. ## Configuration @@ -24,25 +29,29 @@ Please use the exact name of the executable and not the gem name. ### Add additional gems to be wrapped Add this before the plugin-list in your `.zshrc`: + ```sh BUNDLED_COMMANDS=(rubocop) plugins=(... bundler ...) ``` + This will add the wrapper for the `rubocop` gem (i.e. the executable). ### Exclude gems from being wrapped Add this before the plugin-list in your `.zshrc`: + ```sh UNBUNDLED_COMMANDS=(foreman spin) plugins=(... bundler ...) ``` + This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped. ## Excluded gems -These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/robbyrussell/oh-my-zsh/pull/2923) on GitHub for clarification. +These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/ohmyzsh/ohmyzsh/pull/2923) on GitHub for clarification. `berks` `foreman` diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 668e15d..65b0ffa 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,3 +1,4 @@ +alias ba="bundle add" alias be="bundle exec" alias bl="bundle list" alias bp="bundle package" @@ -6,6 +7,7 @@ alias bout="bundle outdated" alias bu="bundle update" alias bi="bundle_install" alias bcn="bundle clean" +alias bck="bundle check" bundled_commands=( annotate @@ -27,6 +29,7 @@ bundled_commands=( rainbows rake rspec + rubocop shotgun sidekiq spec @@ -81,7 +84,7 @@ _bundler-installed() { _within-bundled-project() { local check_dir="$PWD" while [ "$check_dir" != "/" ]; do - [ -f "$check_dir/Gemfile" ] && return + [ -f "$check_dir/Gemfile" -o -f "$check_dir/gems.rb" ] && return check_dir="$(dirname $check_dir)" done false @@ -94,7 +97,7 @@ _binstubbed() { _run-with-bundler() { if _bundler-installed && _within-bundled-project; then if _binstubbed $1; then - ./bin/$@ + ./bin/${^^@} else bundle exec $@ fi diff --git a/plugins/bwana/README.md b/plugins/bwana/README.md deleted file mode 100644 index 8cbeaa3..0000000 --- a/plugins/bwana/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Bwana - -This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). - -To use it add bwana to the plugins array in your zshrc file. - -```bash -plugins=(... bwana) -``` diff --git a/plugins/bwana/bwana.plugin.zsh b/plugins/bwana/bwana.plugin.zsh deleted file mode 100644 index b9a0479..0000000 --- a/plugins/bwana/bwana.plugin.zsh +++ /dev/null @@ -1,13 +0,0 @@ -# -# Requires https://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 https://www.bruji.com/bwana/" -fi diff --git a/plugins/cake/README.md b/plugins/cake/README.md index aad92a3..2c2a280 100644 --- a/plugins/cake/README.md +++ b/plugins/cake/README.md @@ -10,6 +10,6 @@ plugins=(... cake) ## Note -This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory. +This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory. It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your `.gitignore` files. diff --git a/plugins/cakephp3/README.md b/plugins/cakephp3/README.md new file mode 100644 index 0000000..7e8f664 --- /dev/null +++ b/plugins/cakephp3/README.md @@ -0,0 +1,16 @@ +# cakephp3 plugin + +The plugin adds aliases and autocompletion for [cakephp3](https://book.cakephp.org/3.0/en/index.html). + +To use it, add `cakephp3` to the plugins array of your zshrc file: +``` +plugins=(... cakephp3) +``` + +## Aliases + +| Alias | Command | +|-----------|-------------------------------| +| c3 | `bin/cake` | +| c3cache | `bin/cake orm_cache clear` | +| c3migrate | `bin/cake migrations migrate` | diff --git a/plugins/cargo/README.md b/plugins/cargo/README.md index 5fa688d..31bae4e 100644 --- a/plugins/cargo/README.md +++ b/plugins/cargo/README.md @@ -1,6 +1,6 @@ # cargo -This plugin adds completion for the Rust build tool [`cargo`](https://github.com/rust-lang/cargo). +This plugin adds completion for the Rust build tool [`Cargo`](https://github.com/rust-lang/cargo). To use it, add `cargo` to the plugins array in your zshrc file: @@ -8,4 +8,4 @@ To use it, add `cargo` to the plugins array in your zshrc file: plugins=(... cargo) ``` -Updated on October 4th, 2016. +Updated on March 3rd, 2019, from [Cargo 0.34.0](https://github.com/rust-lang/cargo/releases/tag/0.34.0). diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 54e709c..1269490 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -1,445 +1,368 @@ #compdef cargo -typeset -A opt_args autoload -U regexp-replace _cargo() { + local curcontext="$curcontext" ret=1 + local -a command_scope_spec common parallel features msgfmt triple target registry + local -a state line state_descr # These are set by _arguments + typeset -A opt_args + + common=( + '(-q --quiet)*'{-v,--verbose}'[use verbose output]' + '(-q --quiet -v --verbose)'{-q,--quiet}'[no output printed to stdout]' + '-Z+[pass unstable (nightly-only) flags to cargo]: :_cargo_unstable_flags' + '--frozen[require that Cargo.lock and cache are up-to-date]' + '--locked[require that Cargo.lock is up-to-date]' + '--color=[specify colorization option]:coloring:(auto always never)' + '(- 1 *)'{-h,--help}'[show help message]' + ) + + # leading items in parentheses are an exclusion list for the arguments following that arg + # See: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions + # - => exclude all other options + # 1 => exclude positional arg 1 + # * => exclude all other args + # +blah => exclude +blah + _arguments -s -S -C $common \ + '(- 1 *)--list[list installed commands]' \ + '(- 1 *)--explain=[provide a detailed explanation of an error message]:error code' \ + '(- 1 *)'{-V,--version}'[show version information]' \ + '(+beta +nightly)+stable[use the stable toolchain]' \ + '(+stable +nightly)+beta[use the beta toolchain]' \ + '(+stable +beta)+nightly[use the nightly toolchain]' \ + '1: :_cargo_cmds' \ + '*:: :->args' + + # These flags are mutually exclusive specifiers for the scope of a command; as + # they are used in multiple places without change, they are expanded into the + # appropriate command's `_arguments` where appropriate. + command_scope_spec=( + '(--bin --example --test --lib)--bench=[specify benchmark name]: :_cargo_benchmark_names' + '(--bench --bin --test --lib)--example=[specify example name]:example name' + '(--bench --example --test --lib)--bin=[specify binary name]:binary name' + '(--bench --bin --example --test)--lib=[specify library name]:library name' + '(--bench --bin --example --lib)--test=[specify test name]:test name' + ) + + parallel=( + '(-j --jobs)'{-j+,--jobs=}'[specify number of parallel jobs]:jobs [# of CPUs]' + ) + + features=( + '(--all-features)--features=[specify features to activate]:feature' + '(--features)--all-features[activate all available features]' + "--no-default-features[don't build the default features]" + ) + + msgfmt='--message-format=[specify error format]:error format [human]:(human json short)' + triple='--target=[specify target triple]:target triple' + target='--target-dir=[specify directory for all generated artifacts]:directory:_directories' + manifest='--manifest-path=[specify path to manifest]:path:_directories' + registry='--registry=[specify registry to use]:registry' + + case $state in + args) + curcontext="${curcontext%:*}-${words[1]}:" + case ${words[1]} in + bench) + _arguments -s -A "^--" $common $parallel $features $msgfmt $triple $target $manifest \ + "${command_scope_spec[@]}" \ + '--all-targets[benchmark all targets]' \ + "--no-run[compile but don't run]" \ + '(-p --package)'{-p+,--package=}'[specify package to run benchmarks for]:package:_cargo_package_names' \ + '--exclude=[exclude packages from the benchmark]:spec' \ + '--no-fail-fast[run all benchmarks regardless of failure]' \ + '1: :_guard "^-*" "bench name"' \ + '*:args:_default' + ;; + + build) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--all-targets[equivalent to specifying --lib --bins --tests --benches --examples]' \ + "${command_scope_spec[@]}" \ + '(-p --package)'{-p+,--package=}'[specify package to build]:package:_cargo_package_names' \ + '--release[build in release mode]' \ + '--build-plan[output the build plan in JSON]' \ + ;; + + check) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--all-targets[equivalent to specifying --lib --bins --tests --benches --examples]' \ + "${command_scope_spec[@]}" \ + '(-p --package)'{-p+,--package=}'[specify package to check]:package:_cargo_package_names' \ + '--release[check in release mode]' \ + ;; + + clean) + _arguments -s -S $common $triple $target $manifest \ + '(-p --package)'{-p+,--package=}'[specify package to clean]:package:_cargo_package_names' \ + '--release[clean release artifacts]' \ + '--doc[clean just the documentation directory]' + ;; + + doc) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--no-deps[do not build docs for dependencies]' \ + '--document-private-items[include non-public items in the documentation]' \ + '--open[open docs in browser after the build]' \ + '(-p --package)'{-p+,--package=}'[specify package to document]:package:_cargo_package_names' \ + '--release[build artifacts in release mode, with optimizations]' \ + ;; + + fetch) + _arguments -s -S $common $triple $manifest + ;; + + fix) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + "${command_scope_spec[@]}" \ + '--broken-code[fix code even if it already has compiler errors]' \ + '--edition[fix in preparation for the next edition]' \ + '--edition-idioms[fix warnings to migrate to the idioms of an edition]' \ + '--allow-no-vcs[fix code even if a VCS was not detected]' \ + '--allow-dirty[fix code even if the working directory is dirty]' \ + '--allow-staged[fix code even if the working directory has staged changes]' + ;; + + generate-lockfile) + _arguments -s -S $common $manifest + ;; + + git-checkout) + _arguments -s -S $common \ + '--reference=:reference' \ + '--url=:url:_urls' + ;; + + help) + _cargo_cmds + ;; + + init) + _arguments -s -S $common $registry \ + '--lib[use library template]' \ + '--edition=[specify edition to set for the crate generated]:edition:(2015 2018)' \ + '--vcs=[initialize a new repo with a given VCS]:vcs:(git hg pijul fossil none)' \ + '--name=[set the resulting package name]:name' \ + '1:path:_directories' + ;; + + install) + _arguments -s -S $common $parallel $features $triple $registry \ + '(-f --force)'{-f,--force}'[force overwriting of existing crates or binaries]' \ + '--bin=[only install the specified binary]:binary' \ + '--branch=[branch to use when installing from git]:branch' \ + '--debug[build in debug mode instead of release mode]' \ + '--example=[install the specified example instead of binaries]:example' \ + '--git=[specify URL from which to install the crate]:url:_urls' \ + '--path=[local filesystem path to crate to install]: :_directories' \ + '--rev=[specific commit to use when installing from git]:commit' \ + '--root=[directory to install packages into]: :_directories' \ + '--tag=[tag to use when installing from git]:tag' \ + '--vers=[version to install from crates.io]:version' \ + '--list[list all installed packages and their versions]' \ + '*: :_guard "^-*" "crate"' + ;; + + locate-project) + _arguments -s -S $common $manifest + ;; + + login) + _arguments -s -S $common $registry \ + '*: :_guard "^-*" "token"' + ;; + + metadata) + _arguments -s -S $common $features $manifest \ + "--no-deps[output information only about the root package and don't fetch dependencies]" \ + '--format-version=[specify format version]:version [1]:(1)' + ;; + + new) + _arguments -s -S $common $registry \ + '--lib[use library template]' \ + '--vcs:initialize a new repo with a given VCS:(git hg none)' \ + '--name=[set the resulting package name]' + ;; + + owner) + _arguments -s -S $common $registry \ + '(-a --add)'{-a,--add}'[specify name of a user or team to invite as an owner]:name' \ + '--index=[specify registry index]:index' \ + '(-l --list)'{-l,--list}'[list owners of a crate]' \ + '(-r --remove)'{-r,--remove}'[specify name of a user or team to remove as an owner]:name' \ + '--token=[specify API token to use when authenticating]:token' \ + '*: :_guard "^-*" "crate"' + ;; + + package) + _arguments -s -S $common $parallel $features $triple $target $manifest \ + '(-l --list)'{-l,--list}'[print files included in a package without making one]' \ + '--no-metadata[ignore warnings about a lack of human-usable metadata]' \ + '--allow-dirty[allow dirty working directories to be packaged]' \ + "--no-verify[don't build to verify contents]" + ;; + + pkgid) + _arguments -s -S $common $manifest \ + '(-p --package)'{-p+,--package=}'[specify package to get ID specifier for]:package:_cargo_package_names' \ + '*: :_guard "^-*" "spec"' + ;; + + publish) + _arguments -s -S $common $parallel $features $triple $target $manifest $registry \ + '--index=[specify registry index]:index' \ + '--allow-dirty[allow dirty working directories to be packaged]' \ + "--no-verify[don't verify the contents by building them]" \ + '--token=[specify token to use when uploading]:token' \ + '--dry-run[perform all checks without uploading]' + ;; + + read-manifest) + _arguments -s -S $common $manifest + ;; + + run) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--example=[name of the bin target]:name' \ + '--bin=[name of the bin target]:name' \ + '(-p --package)'{-p+,--package=}'[specify package with the target to run]:package:_cargo_package_names' \ + '--release[build in release mode]' \ + '*: :_default' + ;; + + rustc) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '(-p --package)'{-p+,--package=}'[specify package to build]:package:_cargo_package_names' \ + '--profile=[specify profile to build the selected target for]:profile' \ + '--release[build artifacts in release mode, with optimizations]' \ + "${command_scope_spec[@]}" \ + '*: : _dispatch rustc rustc -default-' + ;; + + rustdoc) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--document-private-items[include non-public items in the documentation]' \ + '--open[open the docs in a browser after the operation]' \ + '(-p --package)'{-p+,--package=}'[specify package to document]:package:_cargo_package_names' \ + '--release[build artifacts in release mode, with optimizations]' \ + "${command_scope_spec[@]}" \ + '*: : _dispatch rustdoc rustdoc -default-' + ;; + + search) + _arguments -s -S $common $registry \ + '--index=[specify registry index]:index' \ + '--limit=[limit the number of results]:results [10]' \ + '*: :_guard "^-*" "query"' + ;; + + test) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--test=[test name]: :_cargo_test_names' \ + '--no-fail-fast[run all tests regardless of failure]' \ + '--no-run[compile but do not run]' \ + '(-p --package)'{-p+,--package=}'[package to run tests for]:package:_cargo_package_names' \ + '--all[test all packages in the workspace]' \ + '--release[build artifacts in release mode, with optimizations]' \ + '1: :_cargo_test_names' \ + '(--doc --bin --example --test --bench)--lib[only test library]' \ + '(--lib --bin --example --test --bench)--doc[only test documentation]' \ + '(--lib --doc --example --test --bench)--bin=[binary name]' \ + '(--lib --doc --bin --test --bench)--example=[example name]' \ + '(--lib --doc --bin --example --bench)--test=[test name]' \ + '(--lib --doc --bin --example --test)--bench=[benchmark name]' \ + '*: :_default' + ;; + + uninstall) + _arguments -s -S $common \ + '(-p --package)'{-p+,--package=}'[specify package to uninstall]:package:_cargo_package_names' \ + '--bin=[only uninstall the specified binary]:name' \ + '--root=[directory to uninstall packages from]: :_files -/' \ + '*:crate:_cargo_installed_crates -F line' + ;; + + update) + _arguments -s -S $common $manifest \ + '--aggressive=[force dependency update]' \ + "--dry-run[don't actually write the lockfile]" \ + '(-p --package)'{-p+,--package=}'[specify package to update]:package:_cargo_package_names' \ + '--precise=[update single dependency to precise release]:release' + ;; + + verify-project) + _arguments -s -S $common $manifest + ;; + + version) + _arguments -s -S $common + ;; + + yank) + _arguments -s -S $common $registry \ + '--vers=[specify yank version]:version' \ + '--undo[undo a yank, putting a version back into the index]' \ + '--index=[specify registry index to yank from]:registry index' \ + '--token=[specify API token to use when authenticating]:token' \ + '*: :_guard "^-*" "crate"' + ;; + *) + # allow plugins to define their own functions + if ! _call_function ret _cargo-${words[1]}; then + # fallback on default completion for unknown commands + _default && ret=0 + fi + (( ! ret )) + ;; + esac + ;; + esac +} -_arguments \ - '(- 1 *)'{-h,--help}'[show help message]' \ - '(- 1 *)'{-V,--version}'[show version information]' \ - '(- 1 *)'--list'[list installed commands]' \ - '(- 1 *)'--explain'[Run `rustc --explain CODE`]' \ - '(- 1 *)'{-v,--verbose}'[use verbose output]' \ - '(- 1 *)'--color'[colorization option]' \ - '(- 1 *)'--frozen'[Require Cargo.lock and cache are up to date]' \ - '(- 1 *)'--locked'[Require Cargo.lock is up to date]' \ - '1: :_cargo_cmds' \ - '*:: :->args' - -case $state in - args) - case $words[1] in - bench) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - "${command_scope_spec[@]}" \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-default-features[do not build the default features]' \ - '--no-run[compile but do not run]' \ - '(-p,--package)'{-p=,--package=}'[package to run benchmarks for]:packages:_get_package_names' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - build) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - "${command_scope_spec[@]}" \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-default-features[do not build the default features]' \ - '(-p,--package)'{-p=,--package=}'[package to build]:packages:_get_package_names' \ - '--release=[build in release mode]' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - clean) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-p,--package)'{-p=,--package=}'[package to clean]:packages:_get_package_names' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[whether or not to clean release artifacts]' \ - '--target=[target triple(default:all)]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - doc) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-deps[do not build docs for dependencies]' \ - '--no-default-features[do not build the default features]' \ - '--open[open docs in browser after the build]' \ - '(-p, --package)'{-p,--package}'=[package to document]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[build artifacts in release mode, with optimizations]' \ - '--target=[build for the target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - fetch) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - generate-lockfile) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - git-checkout) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - 'q(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--reference=[REF]' \ - '--url=[URL]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - help) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '*: :_cargo_cmds' \ - ;; - - init) - _arguments \ - '--bin[use binary template]' \ - '--vcs:initialize a new repo with a given VCS:(git hg none)' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--name=[set the resulting package name]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - install) - _arguments \ - '--bin=[only install the specified binary]' \ - '--branch=[branch to use when installing from git]' \ - '--color=:colorization option:(auto always never)' \ - '--debug[build in debug mode instead of release mode]' \ - '--example[install the specified example instead of binaries]' \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '--git=[URL from which to install the crate]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - '--no-default-features[do not build the default features]' \ - '--path=[local filesystem path to crate to install]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--rev=[specific commit to use when installing from git]' \ - '--root=[directory to install packages into]' \ - '--tag=[tag to use when installing from git]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--vers=[version to install from crates.io]' \ - ;; - - locate-project) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - ;; - - login) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--host=[Host to set the token for]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - metadata) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - "--no-deps[output information only about the root package and don't fetch dependencies]" \ - '--no-default-features[do not include the default feature]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '--format-version=[format version(default: 1)]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - new) - _arguments \ - '--bin[use binary template]' \ - '--vcs:initialize a new repo with a given VCS:(git hg none)' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--name=[set the resulting package name]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - owner) - _arguments \ - '(-a, --add)'{-a,--add}'[add owner LOGIN]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--index[registry index]' \ - '(-l, --list)'{-l,--list}'[list owners of a crate]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-r, --remove)'{-r,--remove}'[remove owner LOGIN]' \ - '--token[API token to use when authenticating]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - package) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-l, --list)'{-l,--list}'[print files included in a package without making one]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-metadata[ignore warnings about a lack of human-usable metadata]' \ - '--no-verify[do not build to verify contents]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - pkgid) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - publish) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--host=[Host to set the token for]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-verify[Do not verify tarball until before publish]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--token[token to use when uploading]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - read-manifest) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - run) - _arguments \ - '--example=[name of the bin target]' \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--bin=[name of the bin target]' \ - '--no-default-features[do not build the default features]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release=[build in release mode]' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - '*: :_normal' \ - ;; - - rustc) - _arguments \ - '--color=:colorization option:(auto always never)' \ - '--features=[features to compile for the package]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to the manifest to fetch dependencies for]' \ - '--no-default-features[do not compile default features for the package]' \ - '(-p, --package)'{-p,--package}'=[profile to compile for]' \ - '--profile=[profile to build the selected target for]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[build artifacts in release mode, with optimizations]' \ - '--target=[target triple which compiles will be for]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - "${command_scope_spec[@]}" \ - ;; - - rustdoc) - _arguments \ - '--color=:colorization option:(auto always never)' \ - '--features=[space-separated list of features to also build]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to the manifest to document]' \ - '--no-default-features[do not build the `default` feature]' \ - '--open[open the docs in a browser after the operation]' \ - '(-p, --package)'{-p,--package}'=[package to document]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[build artifacts in release mode, with optimizations]' \ - '--target=[build for the target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - "${command_scope_spec[@]}" \ - ;; - - search) - _arguments \ - '--color=:colorization option:(auto always never)' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--host=[host of a registry to search in]' \ - '--limit=[limit the number of results]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - ;; - - test) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--test=[test name]: :_test_names' \ - '--no-default-features[do not build the default features]' \ - '--no-fail-fast[run all tests regardless of failure]' \ - '--no-run[compile but do not run]' \ - '(-p,--package)'{-p=,--package=}'[package to run tests for]:packages:_get_package_names' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[build artifacts in release mode, with optimizations]' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - '1: :_test_names' \ - ;; - - uninstall) - _arguments \ - '--bin=[only uninstall the binary NAME]' \ - '--color=:colorization option:(auto always never)' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-q, --quiet)'{-q,--quiet}'[less output printed to stdout]' \ - '--root=[directory to uninstall packages from]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - ;; - - update) - _arguments \ - '--aggressive=[force dependency update]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-p,--package)'{-p=,--package=}'[package to update]:packages:__get_package_names' \ - '--precise=[update single dependency to PRECISE]: :' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - verify-project) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - version) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - yank) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--index[registry index]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--token[API token to use when authenticating]' \ - '--undo[undo a yank, putting a version back into the index]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - '--vers[yank version]' \ - ;; - esac - ;; -esac +_cargo_unstable_flags() { + local flags + flags=( help ${${${(M)${(f)"$(_call_program flags cargo -Z help)"}:#*--*}/ #-- #/:}##*-Z } ) + _describe -t flags 'unstable flag' flags } -_cargo_cmds(){ -local -a commands;commands=( -'bench:execute all benchmarks of a local package' -'build:compile the current project' -'clean:remove generated artifacts' -'doc:build package documentation' -'fetch:fetch package dependencies' -'generate-lockfile:create lockfile' -'git-checkout:git checkout' -'help:get help for commands' -'init:create new project in current directory' -'install:install a Rust binary' -'locate-project:print "Cargo.toml" location' -'login:login to remote server' -'metadata:the metadata for a project in json' -'new:create a new project' -'owner:manage the owners of a crate on the registry' -'package:assemble local package into a distributable tarball' -'pkgid:print a fully qualified package specification' -'publish:upload package to the registry' -'read-manifest:print manifest in JSON format' -'run:run the main binary of the local package' -'rustc:compile a package and all of its dependencies' -'rustdoc:build documentation for a package' -'search:search packages on crates.io' -'test:execute all unit and tests of a local package' -'uninstall:remove a Rust binary' -'update:update dependencies' -'verify-project:check Cargo.toml' -'version:show version information' -'yank:remove pushed file from index' -) -_describe 'command' commands +_cargo_installed_crates() { + local expl + _description crates expl 'crate' + compadd "$@" "$expl[@]" - ${${${(f)"$(cargo install --list)"}:# *}%% *} +} +_cargo_cmds() { + local -a commands + # This uses Parameter Expansion Flags, which are a built-in Zsh feature. + # See more: http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags + # and http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion + # + # # How this work? + # + # First it splits the result of `cargo --list` at newline, then it removes the first line. + # Then it removes indentation (4 whitespaces) before each items. (Note the x## pattern [1]). + # Then it replaces those spaces between item and description with a `:` + # + # [1]: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org#patterns + commands=( ${${${(M)"${(f)$(_call_program commands cargo --list)}":# *}/ ##/}/ ##/:} ) + _describe -t commands 'command' commands } #FIXME: Disabled until fixed #gets package names from the manifest file -_get_package_names() -{ -} - -#TODO:see if it makes sense to have 'locate-project' to have non-json output. -#strips package name from json stuff -_locate_manifest(){ -local manifest=`cargo locate-project 2>/dev/null` -regexp-replace manifest '\{"root":"|"\}' '' -echo $manifest +_cargo_package_names() { + _message -e packages package } # Extracts the values of "name" from the array given in $1 and shows them as # command line options for completion -_get_names_from_array() -{ - local -a filelist; - local manifest=$(_locate_manifest) +_cargo_names_from_array() { + # strip json from the path + local manifest=${${${"$(cargo locate-project)"}%\"\}}##*\"} if [[ -z $manifest ]]; then return 0 fi @@ -449,52 +372,36 @@ _get_names_from_array() local in_block=false local block_name=$1 names=() - while read line - do + while read -r line; do if [[ $last_line == "[[$block_name]]" ]]; then in_block=true else - if [[ $last_line =~ '.*\[\[.*' ]]; then + if [[ $last_line =~ '\s*\[\[.*' ]]; then in_block=false fi fi if [[ $in_block == true ]]; then - if [[ $line =~ '.*name.*=' ]]; then - regexp-replace line '^.*name *= *|"' "" - names+=$line + if [[ $line =~ '\s*name\s*=' ]]; then + regexp-replace line '^\s*name\s*=\s*|"' '' + names+=( "$line" ) fi fi last_line=$line - done < $manifest - _describe $block_name names + done < "$manifest" + _describe "$block_name" names } #Gets the test names from the manifest file -_test_names() -{ - _get_names_from_array "test" +_cargo_test_names() { + _cargo_names_from_array "test" } #Gets the bench names from the manifest file -_benchmark_names() -{ - _get_names_from_array "bench" +_cargo_benchmark_names() { + _cargo_names_from_array "bench" } -# These flags are mutally exclusive specifiers for the scope of a command; as -# they are used in multiple places without change, they are expanded into the -# appropriate command's `_arguments` where appropriate. -set command_scope_spec -command_scope_spec=( - '(--bin --example --test --lib)--bench=[benchmark name]: :_benchmark_names' - '(--bench --bin --test --lib)--example=[example name]' - '(--bench --example --test --lib)--bin=[binary name]' - '(--bench --bin --example --test)--lib=[library name]' - '(--bench --bin --example --lib)--test=[test name]' -) - - _cargo diff --git a/plugins/catimg/README.md b/plugins/catimg/README.md index 2fc28a1..8f26880 100644 --- a/plugins/catimg/README.md +++ b/plugins/catimg/README.md @@ -2,27 +2,15 @@ Plugin for displaying images on the terminal using the the `catimg.sh` script provided by [posva](https://github.com/posva/catimg) -## Requirements - -- `convert` (ImageMagick) - -## Enabling the plugin +To use it, add `catimg` to the plugins array in your zshrc file: -1. Open your `.zshrc` file and add `catimg` in the plugins section: +```zsh +plugins=(... catimg) +``` - ```zsh - plugins=( - # all your enabled plugins - catimg - ) - ``` - -2. Reload the source file or restart your Terminal session: +## Requirements - ```console - $ source ~/.zshrc - $ - ``` +- `convert` (ImageMagick) ## Functions diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh index 5f58ecd..ca46444 100644 --- a/plugins/catimg/catimg.plugin.zsh +++ b/plugins/catimg/catimg.plugin.zsh @@ -4,7 +4,7 @@ # # # Ouput the content of an image to the stdout using the 256 colors of the # # terminal. # -# Github: https://github.com/posva/catimg # +# GitHub: https://github.com/posva/catimg # ################################################################################ diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh index 83ccf6a..713a032 100644 --- a/plugins/catimg/catimg.sh +++ b/plugins/catimg/catimg.sh @@ -4,7 +4,7 @@ # # # Ouput the content of an image to the stdout using the 256 colors of the # # terminal. # -# Github: https://github.com/posva/catimg # +# GitHub: https://github.com/posva/catimg # ################################################################################ function help() { diff --git a/plugins/chruby/README.md b/plugins/chruby/README.md new file mode 100644 index 0000000..d373006 --- /dev/null +++ b/plugins/chruby/README.md @@ -0,0 +1,20 @@ +# chruby plugin + +This plugin loads [chruby](https://github.com/postmodern/chruby), a tool that changes the +current Ruby version, and completion and a prompt function to display the Ruby version. +Supports brew and manual installation of chruby. + +To use it, add `chruby` to the plugins array in your zshrc file: +```zsh +plugins=(... chruby) +``` + +## Usage + +If you'd prefer to specify an explicit path to load chruby from +you can set variables like so: + +``` +zstyle :omz:plugins:chruby path /local/path/to/chruby.sh +zstyle :omz:plugins:chruby auto /local/path/to/auto.sh +``` diff --git a/plugins/chucknorris/README.md b/plugins/chucknorris/README.md index be7b97e..35f9891 100644 --- a/plugins/chucknorris/README.md +++ b/plugins/chucknorris/README.md @@ -1,6 +1,6 @@ # chucknorris -Chuck Norris fortunes plugin for oh-my-zsh +Chuck Norris fortunes plugin for oh-my-zsh. Perfectly suitable as MOTD. **Maintainers**: [apjanke](https://github.com/apjanke) [maff](https://github.com/maff) @@ -10,11 +10,31 @@ To use it add `chucknorris` to the plugins array in you zshrc file. plugins=(... chucknorris) ``` - -Depends on fortune (and cowsay if using chuck_cow) being installed (available via homebrew, apt, ...). Perfectly suitable as MOTD. - +## Usage | Command | Description | | ----------- | ------------------------------- | | `chuck` | Print random Chuck Norris quote | | `chuck_cow` | Print quote in cowthink | + +Example: output of `chuck_cow`: + +``` +Last login: Fri Jan 30 23:12:26 on ttys001 + ______________________________________ +( When Chuck Norris plays Monopoly, it ) +( affects the actual world economy. ) + -------------------------------------- + o ^__^ + o (oo)\_______ + (__)\ )\/\ + ||----w | + || || +``` + +## Requirements + +- `fortune` +- `cowsay` if using `chuck_cow` + +Available via homebrew, apt, ... diff --git a/plugins/chucknorris/fortunes/chucknorris b/plugins/chucknorris/fortunes/chucknorris index 2a13b06..1f4ca7a 100644 --- a/plugins/chucknorris/fortunes/chucknorris +++ b/plugins/chucknorris/fortunes/chucknorris @@ -1,2544 +1,636 @@ -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +King Kong climbed the Empire State building in fear of Chuck Norris who was downstairs at the time. % -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +"2012" is code for, Chuck Norris when he is pissed. % -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +"The Big Chuck Norris Roundhouse-Kick Theory" % -Outer space exists because it's afraid to be on the same planet with Chuck Norris. +"The wind cries Chuck Norris" % -Chuck Norris does not sleep. He waits. +"Walker Texas Ranger: The Movie 3-D" was considered by Warner Brothers; however the technology to create the visual effects will never be possible. % -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. % -Chuck Norris is the reason why Waldo is hiding. +Abraham Lincoln didn't die because he was shot, Chuck Norris roundhouse-kicked so fast his foot went back in time and killed Abraham Lincoln. % -Chuck Norris counted to infinity - twice. +Achievement Unlocked: Chuck Norris of Death % -There is no chin behind Chuck Norris’ beard. There is only another fist. +After Chuck counted to infinity the first time, he vowed to count to infinity a second time....by counting the bodies of those previously roundhoused. % -In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten. +Aliens fear that Chuck Norris might abduct them. % -There is no chin behind Chuck Norris' beard. There is only another fist. +An angry glare from Chuck Norris is known to kill on the spot. % -Chuck Norris does not teabag the ladies. He potato-sacks them. +Behind every successful man is Chuck Norris % -Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face. +Beware of dogs... Dogs, beware of Chuck Norris. % -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +Bruce Lee didn't defeat Chuck Norris. Chuck hit Bruce with a Delayed roundhouse kick that was so fast that Lee only felt the impact a year later! % -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. % -Chuck Norris' hand is the only hand that can beat a Royal Flush. +Casinos pay Chuck Norris not to play at anything or wish anyone good luck. % -Chuck Norris can lead a horse to water AND make it drink. +Chuck Norris - the new standard. % -Chuck Norris doesn’t wear a watch. HE decides what time it is. +Chuck Norris CAN balance the light-switch between ON and OFF. % -Chuck Norris can slam a revolving door. +Chuck Norris CAN believe it's not butter % -Chuck Norris does not get frostbite. Chuck Norris bites frost. +Chuck Norris CAN spell with an I before E even after C. % -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +Chuck Norris Can Play the Theme from the Twilight Zone with His Beard % -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +Chuck Norris Can Power Solar Panels. At Night. % -If you spell Chuck Norris in Scrabble, you win. Forever. +Chuck Norris Watches "the Nat.Geo. Specials" on Discovery Channel % -Guns don't kill people. Chuck Norris kills people. +Chuck Norris bowled a 301 after constructing another pin out of his beard hair % -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +Chuck Norris burnt a fire proof vest, UNDERWATER! % -The chief export of Chuck Norris is Pain. +Chuck Norris can French kiss his elbow. % -Chuck Norris has two speeds. Walk, and Kill. +Chuck Norris can bake in a Freezer. % -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +Chuck Norris can defuse bomb even if he cut the wrong wire % -Chuck Norris drives an ice cream truck covered in human skulls. +Chuck Norris can dig a hole in air. % -Chuck Norris is my Homeboy. +Chuck Norris can divide by zero. % -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +Chuck Norris can do a regime change with a roundhouse kick. % -Chuck Norris uses pepper spray to spice up his steaks. +Chuck Norris can fit 10 gallons of water in a 5 gallon water bucket % -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +Chuck Norris can grill a popsicle % -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +Chuck Norris can lead a horse to water AND make it drink. % -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +Chuck Norris can make his own megazord "The Chuck Norris Roundhouse Kickers Ultimate Super Awesome Megazord" % -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +Chuck Norris can milk an alligator % -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +Chuck Norris can play the death waltz with his chin. % -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +Chuck Norris can roundhouse kick someone through a window without breaking the glass % -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +Chuck Norris can roundhouse-kick round houses into squares. % -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +Chuck Norris can rub two fires together and make a stick! % -The quickest way to a man's heart is with Chuck Norris' fist. +Chuck Norris can see in 3D with just one eye. % -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +Chuck Norris can shoot a person 28 times with an unloaded gun. % -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +Chuck Norris can slam a revolving door. % -Chuck Norris can win a game of Connect Four in only three moves. +Chuck Norris can terminate a repeating decimal. % -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +Chuck Norris can turn toast back into bread % -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +Chuck Norris can win a game of Connect Four in only three moves. % -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +Chuck Norris can win in a top spinning tournament with a cube % -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +Chuck Norris can't get fired by Donald Trump % -Chuck Norris doesn’t wash his clothes, he disembowels them. +Chuck Norris can't perform Hadoukens, he IS a Hadouken % -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +Chuck Norris checks under his bed for Fedor Emelianenko because he takes Fedor to the vet regularly. % -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +Chuck Norris counted to infinity - twice. % -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +Chuck Norris created Heavy Metal when he was upset % -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +Chuck Norris does not get frostbite. Chuck Norris bites frost. % -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +Chuck Norris does not have a cell phone because he hears everything % -Chuck Norris can win in a top spinning tournament with a cube +Chuck Norris does not sleep. He waits. % -Beware of dogs... Dogs, beware of Chuck Norris. +Chuck Norris does not teabag the ladies. He potato-sacks them. % -Chuck Norris can dig a hole in air. +Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint. % -The apple falls far from the tree, when a roundhouse kick is taken to the trunk. +Chuck Norris doesn't call the wrong number, you just answer the wrong phone. % -Chuck Norris - the new standard. +Chuck Norris doesn't cheat death, he beats it fair and square. % -Chuck Norris told me to put this here. +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn't eat, he just sucks the energy out of food by staring at it % Chuck Norris doesn't exhale. The air runs desperately scared out of his lungs. % -Fear of spiders is aracnaphobia, fear of tight spaces is chlaustraphobia, fear of Chuck Norris is called Logic +Chuck Norris doesn't fight. He gives motivational seminars to die on their own to avoid a roundhouse kick to the face. % -When Chuck Norris goes to rodeos, bulls ride him. +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. % -Chuck Norris once walked down a street with his fists in his pockets. He was then arrested for concealing two deadly weapons. +Chuck Norris doesn't let it go. % -The meaning of life is Chuck Norris +Chuck Norris doesn't like Mudkipz % -Chuck Norris is the meaning of life. Too bad he's also the meaning of death. +Chuck Norris doesn't look for fun. The fun looks for Chuck Norris. % -If God doesn't know, Chuck does +Chuck Norris doesn't need a bulletproof vest to be bulletproof % -Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint. +Chuck Norris doesn't need a bulletproof vest. He catches them with his bare hands. % -The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage. +Chuck Norris doesn't need air, he is air % -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +Chuck Norris doesn't need sunglasses, the sun needs Chuck Norris glasses +% +Chuck Norris doesn't need to brush his teeth, his spit acts as a bleach. % Chuck Norris doesn't read books. He stares them down until he gets the information he wants. % -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +Chuck Norris doesn't read. He just stares at the book until he gets the information he wants. % -Outer space exists because it's afraid to be on the same planet with Chuck Norris. +Chuck Norris doesn't throw up if he drinks too much. Chuck Norris throws down! % -Chuck Norris does not sleep. He waits. +Chuck Norris doesn't brew up tea. He sucks the bag. % -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +Chuck Norris doesn't eat salad, he eats vegetarians % -Chuck Norris is the reason why Waldo is hiding. +Chuck Norris doesn't wash his clothes, he disembowels them. % -Chuck Norris counted to infinity - twice. +Chuck Norris doesn't wear a watch. HE decides what time it is. % -There is no chin behind Chuck Norris’ beard. There is only another fist. +Chuck Norris doesn't carry a list. He always knows what to do. % -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +Chuck Norris drives an ice cream truck covered in human skulls. % -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +Chuck Norris drowned a man ON LAND. % -Chuck Norris' hand is the only hand that can beat a Royal Flush. +Chuck Norris fed the Hunger Games % -Chuck Norris can lead a horse to water AND make it drink. +Chuck Norris found the hay in the needle stack. % -Chuck Norris doesn’t wear a watch. HE decides what time it is. +Chuck Norris found the last digit of pie % -Chuck Norris can slam a revolving door. +Chuck Norris had a knife thrown at him............ the knife didn't impale him, he impaled the knife % -Chuck Norris does not get frostbite. Chuck Norris bites frost. +Chuck Norris has a battle cruiser AND a car. % -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +Chuck Norris has killed the Dead Sea % -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +Chuck Norris has made a 148 break a snooker. % -If you spell Chuck Norris in Scrabble, you win. Forever. +Chuck Norris has two speeds. Walk, and Kill. % -Guns don't kill people. Chuck Norris kills people. +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. % -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +Chuck Norris is Chuck Norris % -The chief export of Chuck Norris is Pain. +Chuck Norris is allowed two carry-ons. % -Chuck Norris has two speeds. Walk, and Kill. +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. % -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +Chuck Norris is currently suing any broadway theater that plays "The Nutcracker". He claims its an infringement on his "other" roundhouse kick. % -Chuck Norris drives an ice cream truck covered in human skulls. +Chuck Norris is entitled to his own facts. % Chuck Norris is my Homeboy. % -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +Chuck Norris is overra... % -Chuck Norris uses pepper spray to spice up his steaks. +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. % -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +Chuck Norris is so hard, he uses diamonds as stress balls. % -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +Chuck Norris is so scary he makes Sharks swim backwards away from him % Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. % -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +Chuck Norris is the ghost in paranormal activity. % -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +Chuck Norris is the life of parties he doesn't attend. % -The quickest way to a man's heart is with Chuck Norris' fist. +Chuck Norris is the meaning of life. Too bad he's also the meaning of death. % -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. % -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +Chuck Norris is the only one who can tear a facebook page! % -Chuck Norris can win a game of Connect Four in only three moves. +Chuck Norris is the reason that the world will end in 2012. He was getting bored with the Earth % -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +Chuck Norris is the reason tumbleweeds tumble % -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +Chuck Norris is the reason why Waldo is hiding. % -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +Chuck Norris is waiting for Mt. St. Helens to erupt again. He's hoping the lava is hot enough to soften his beard so he can shave for the first time. % -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +Chuck Norris isn't allowed at the zoo because when he's there the animals are terriefied to come out their cages % -Chuck Norris doesn’t wash his clothes, he disembowels them. +Chuck Norris isn't appropriate...appropriate isn't Chuck Norris % -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +Chuck Norris killed Kemper % -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +Chuck Norris likes everyone on the earth, cause everyone he didn't like... Is dead... % -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +Chuck Norris made a statue bleed. % -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +Chuck Norris made the big bang just by clicking his fingers % -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +Chuck Norris never trains, because he's Chuck Norris. % -When God said "Let there be light!", Chuck Norris said "Only for half the day +Chuck Norris once asked a man to turn down his music, he refused, that man's baby was born deaf. % -Chuck Norris went up the creek without a paddle... or a canoe +Chuck Norris once cried just to see what it was like. The end result was the creation of life. % -Chuck Norris once asked a man to turn down his music, he refused, that man's baby was born deaf. +Chuck Norris once cut a knife with a stick of butter. % -Chuck Norris found the hay in the needle stack. +Chuck Norris once got a 200 yard punt return % -Chuck Norris doesn't need to brush his teeth, his spit acts as a bleach. +Chuck Norris once had a pet monkey........his name was KING KONG % Chuck Norris once had a street named after him. But the name removed at once, because nobody crosses Chuck Norris, and lives % -The planes in 9/11 were not hijacked. Chuck Norris was just playing with his old radio controller. +Chuck Norris once had a weak moment, just to know what it felt like. % -Machiavelli said it is better to be feared than loved because he was inspired by Chuck Norris. +Chuck Norris once played Duck Duck Goose with a group of Kindergarteners. Only one kid made it to first grade % -Chuck Norris Can Play the Theme from the Twilight Zone with His Beard +Chuck Norris once proved p^~p by induction on his beard hairs. % -Chuck Norris pees Adamantium +Chuck Norris once punched the ground to stop an earthquake. The resulting aftershock caused the BP oil spill % -The Beatles are on iTunes because Chuck Norris bought a Mac. +Chuck Norris once round-house kicked a salesman. Over the phone. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. % Chuck Norris once rounhouse kicked a football ...... it is now considered as a planet % -Chuck Norris yells at Drill Sergeants +Chuck Norris once taught a class of martial arts.Unfortunately Chuck had forgiven to take elephant tranquilizers and killed every one just by saluting % -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +Chuck Norris once thought he was wrong. He was, however, mistaken. % -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +Chuck Norris once tried to teach a fat, stupid kid Martial Arts. Unsuccessfully. The kid grew up to be Steven Seagal. % -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +Chuck Norris once walked down a street with his fists in his pockets. He was then arrested for concealing two deadly weapons. % -Outer space exists because it's afraid to be on the same planet with Chuck Norris. +Chuck Norris once won the tour de france riding a " big wheel" % -Chuck Norris does not sleep. He waits. +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." % -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +Chuck Norris owns all number 1 pencils. % -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -If at first you don't succeed, you're not Chuck Norris. -% -If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent.? -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -There is no such thing as being hard its called the Chuck Norris factor. -% -When Chuck Norris goes to the library, he looks for the guinness book of records in the comedy section. -% -Chuck Norris can shoot a person 28 times with an unloaded gun. -% -Chuck Norris' personal airplane is called Air Force Chuck -% -The letters in Chuck Norris cannot be unscrambled. -% -Cops don't need a badges in their wallets but only a picture of Chuck Norris. -% -Chuck Norris was the reason why the Great Wall of China was constructed. It failed miserably. -% -If you see a man in the street who looks like Chuck Norris, but isn't, run: you don't want to be caught in the resulting roundhouse kick to his face. -% -The red phone in the oval office...Rings directly to Chuck Norris Cell Phone -% -The only way sharks will come near CN underwater is when CN is inside of a cage. -% -Chuck Norris uses a real mouse to move the cursor, type on the keyboard, write e-mails, code entire websites, use photoshop, bring coffee. -% -If Chuck Norris were to get into a fight with another Chuck Norris, Chuck Norris would win. -% -"2012" is code for, Chuck Norris when he is pissed. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -In the back of the book of world records, it says "All records are held by Chuck Norris. The ones listed are in second place." -% -The only place where the Starship Enterprise refuses to boldly go is Chuck Norris' planet...which is all of them. -% -Chuck Norris once had a pet monkey........his name was KING KONG -% -Chuck Norris can make his own megazord "The Chuck Norris Roundhouse Kickers Ultimate Super Awesome Megazord" -% -Simon doesn't say...Chuck Norris says. -% -When does Chuck Norris run out of shotgun bullets?.....whenever he wants to. -% -The only sure things are Death and Taxes, and when Chuck Norris goes to work for the IRS, they'll be the same thing. -% -Chuck Norris' first job was as a paperboy. There were no survivors. -% -Chuck Norris can turn toast back into bread -% -Chuck Norris started Chuck Norris. -% -Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming -% -Chuck Norris killed Kemper -% -Did you here about the boy who cried Chuck Norris? -% -Chuck Norris can't perform Hadoukens, he IS a Hadouken -% -Behind every successful man is Chuck Norris -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but Chuck Norris roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -The square root of Chuck Norris is pain. Do not try to square Chuck Norris. The result is death -% -Chuck Norris doesn't read. He just stares at the book until he gets the information he wants. -% -Why didn't the chicken cross the road? Because Chuck Norris got to it first. -% -When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000. -% -Chuck Norris can milk an alligator -% -Chuck Norris doesn't eat, he just sucks the energy out of food by staring at it -% -Chuck Norris once proved p^~p by induction on his beard hairs. -% -The reason why batman only comes out at night is because he's afraid he might encounter Chuck Norris in the Morning and afternoon. -% -Chuck Norris can bake in a Freezer. -% -Chuck Norris is currently suing any broadway theater that plays "The Nutcracker". He claims its an infringement on his "other" roundhouse kick. -% -Chuck Norris once had a weak moment, just to know what it felt like. -% -Note to everyone: Please do not give beans to Chuck Norris or do you want another atombomb on hiroshima? -% -Chuck Norris has made a 148 break a snooker. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -http://chucknorrisfacts.com/ is built in Drupal because Chuck Norris knows a good CMS when he sees one. -% -The producers of the movie "The Last Airbender" are now in talks with Chuck Norris in Order to star him in their next sequal "The Last Skull Bender". -% -Some boots were made for walking. Some boots may walk all over you, but Chuck Norris' boot walk THROUGH you. -% -World War II began because Chuck Norris took a nap. When he woke up, Hitler found out and killed himself out of fear Chuck Norris would kill him. -% -The best part of waking up is not Folgers in your cup, it's knowing that Chuck Norris let you live. -% -Only Chuck Norris can win the mind game, 'cause he never minds. -% -Do you know why Chuck Norris didn't star in The Expandebles? Because all the others guys would have surrended at the beginning. -% -Bruce Lee didn't defeat Chuck Norris. Chuck hit Bruce with a Delayed roundhouse kick that was so fast that Lee only felt the impact a year later! -% -Chuck Norris doesn't need a bulletproof vest to be bulletproof -% -When Chuck Norris goes to Vegas, he doesn't have to gamble. The casinos just give him stacks of money. -% -Merlin was Chuck Norris' assistant. -% -If you put in the correct cheat code in Halo 2, you can have Master Cheif play without his helmet; revealing to be Chuck Norris. -% -Those who ignore history, are doomed by Chuck Norris. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Some kids pee their name in snow. Chuck Norris pees his name in concrete. -% -The Matrix Trilogy would have ended on the first movie if Keanu Reeves said, “I know Chuck Norris.” -% -Chuck Norris created Heavy Metal when he was upset -% -Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag. -% -When things go bump in the night.... it's Chuck Norris -% -Chuck Norris fed the Hunger Games -% -Chuck Norris played "Got your Nose" with Voldemort and won. -% -Chuck Norris had a knife thrown at him............ the knife didn't impale him, he impaled the knife -% -Chuck Norris doesn't let it go. -% -You know Chuck Norris' pet lizard, right? Last I heard, he was in the movie "Godzilla". Oh, and his pet turtle starred in "Gamera" as well. -% -Whatever Chuck Norris wants, it will instantly appear. -% -Chuck Norris once cut a knife with a stick of butter. -% -Chuck Norris shops at Sam's Club, but leaves without having his receipt checked -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -In 1945 The US army asked if they could clone Chuck Norris. instead he said he could sort out the Japanese. -% -One glance from Chuck Norris and snow turns itself yellow. -% -Chuck Norris checks under his bed for Fedor Emelianenko because he takes Fedor to the vet regularly. -% -Chuck Norris was the image used for Papa Smurf. -% -Chuck Norris is so scary he makes Sharks swim backwards away from him -% -When Chuck Norris tosses a coin, it lands on both head and tail. -% -Chuck Norris found the last digit of pie -% -Chuck Norris Watches "the Nat.Geo. Specials" on Discovery Channel -% -James Bond has a license to kill. He got it from Chuck Norris. -% -Chuck Norris is Chuck Norris -% -"The Big Chuck Norris Roundhouse-Kick Theory" -% -That's not an eclipse....that's the sun hiding from Chuck Norris. -% -Chuck Norris doesn't like Mudkipz -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Chuck Norris doesn’t eat salad, he eats vegetarians -% -Every time there's an earthquake, you know Chuck Norris is hungry. The earthquake is caused by his stomach growling. -% -Chuck Norris wasn't born on his birthday -% -One time a test cheated on Chuck Norris. -% -Chuck Norris won a stepdance contest by standing on his hands -% -Chuck Norris thretened to kill Michael Jackson, MJ got so scared to turned white. -% -When Steven Seagal kills a ninja, he only takes its hide. When Chuck Norris kills a ninja, he uses every part. -% -Chuck Norris is the life of parties he dosen't attend -% -Chuck Norris can rub two fires together and make a stick! -% -Contrary to popular beleif, Rome WAS built in a day, by Chuck Norris. -% -Chuck Norris rolled a 20 on a 6 sided die. -% -When chuck Norris was in school, he made his PE teacher run laps. -% -Chuck Norris wins NASCAR races with all right turns. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Chuck Norris is waiting for Mt. St. Helens to erupt again. He's hoping the lava is hot enough to soften his beard so he can shave for the first time. -% -Chuck Norris is overra... -% -Chuck Norris was originally in Mortal Kombat, but that version was deleted because no one can beat Chuck Norris in a fight. -% -Chuck Norris likes everyone on the earth, cause everyone he didn't like... Is dead... -% -Chunk Norris can make sour milk turn fresh -% -There is no limbo, only a world that doesn't know of Chuck Norris -% -Chuck Norris CAN believe it's not butter -% -Dog the Bounty Hunter can't track Chuck Norris down. -% -Abraham Lincoln didn't die because he was shot, Chuck Norris roundhouse-kicked so fast his foot went back in time and killed Abraham Lincoln. -% -When Chuck Norris inhales helium, his voice doesn't change. -% -When Chuck Norris drinks water, the water automatically pasteurized. -% -Chuck Norris once punched the ground to stop an earthquake. The resulting aftershock caused the BP oil spill -% -Chuck Norris can play the death waltz with his chin. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -More of a question than a fact: in a fight between Chuck Norris and Gordan Freeman who would win? -% -Chuck Norris once round-house kicked a salesman. Over the phone. -% -Chuck Norris can grill a popsicle -% -Chuck Norris' films are factual documentaries. -% -Casinos pay Chuck Norris not to play at anything or wish anyone good luck. -% -Chuck Norris once got a 200 yard punt return -% -Every line in a Chuck Norris haiku is "A roundhouse kick to the face." And they all have the correct number of syllables. -% -An angry glare from Chuck Norris is known to kill on the spot. -% -Evolution's driving mechanism is nature's desperate attempt to escape Chuck Norris. -% -When President Roosevelt dropped the atomic bomb on Hiroshima, he did so only because it was more human then sending Chuck Norris. -% -Don't get Chuck Norris angry, last time somebody did that Chuck Norris made the Grand Canyon. -% -In Texas, there are five sizes for fountain drinks: small, medium, large, Texas sized, and Chuck Norris Sized. It is a cup made of a human skull. -% -After Chuck counted to infinity the first time, he vowed to count to infinity a second time....by counting the bodies of those previously roundhoused. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Taking Karate Lessons = $100, Buying MMA DVD's= $150, Subscribing to a UFC event = $50, Getting a Roundhouse Kick from Chuck Norris = PRICELESS -% -Chuck Norris played the game of thrones and won -% -Chuck Norris doesn't need sunglasses, the sun needs Chuck Norris glasses -% -Chuck Norris doesn't call the wrong number, you just answer the wrong phone. -% -Chuck Norris once won the tour de france riding a " big wheel" -% -May the Force be with Chuck Norris... for it's own good. -% -Chuck Norris once played Duck Duck Goose with a group of Kindergarteners. Only one kid made it to first grade -% -During the Civil War Chuck Norris was a slave, his master would often beg him for mercy -% -Chuck Norris' glass is never half full or half empty. It stays full even after he takes a drink. -% - King Kong climbed the Empire State building in fear of Chuck Norris who was downstairs at the time. -% -Chuck Norris can French kiss his elbow. -% -Chuck Norris never trains, because he's Chuck Norris. -% -Every phobia known to man has a phobia of Chuck Norris -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Once upon a time, Chuck Norris found himself in a town called Shit Creek.....He opened a Paddle Store. -% -Chuck Norris Can Power Solar Panels. At Night. -% -When Betty White gets angry, she turns into the Hulk. When Valerie Bertinelli gets mad, she turns into Chuck Norris. -% -Chuck Norris is so hard, he uses diamonds as stress balls. -% -Chuck Norris can roundhouse kick someone through a window without breaking the glass -% -Chuck Norris. Enough said. -% -The letters in Chuck Norris cannot be unscrambled. -% -Chuck Norris once taught a class of martial arts.Unfortunately Chuck had forgiven to take elephant tranquilizers and killed every one just by saluting -% -Chuck Norris was heard in a soundproof room! -% -Chuck Norris can see in 3D with just one eye. -% -Chuck Norris owns all number 1 pencils. -% -Staring at Chuck Norris for extended periods of time without proper eye protection will cause blindess, and possibly foot sized brusies on the face. -% -Chuck Norris doesn’t brew up tea. He sucks the bag. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -They say death by a 1000 lashes was the most painful way to die, that was before they got roundhouse kicked in the face by Chuck Norris -% -Chuck Norris made a statue bleed. -% -Dead bodies were found of people that are still alive. These people will cross Chuck Norris in the future and will be round-house kicked back in time. -% -The reason why batman only comes out at night is because he's afraid he might encounter Chuck Norris in the Morning and afternoon. -% -The kids said when Chuck was eating Trix cereal ´´silly Chuck, Trix are for kids´´...what happened next?..............................Darfur happened. -% -Chuck Norris can roundhouse-kick round houses into squares. -% -Chuck Norris is allowed two carry-ons. -% -Chuck Norris can divide by zero. -% -Chuck Norris does not have a cell phone because he hears everything -% -Chuck Norris isn't appropriate...appropriate isn't Chuck Norris -% -Earth's rotation is purely governed by the direction that Chuck Norris is walking. -% -Chuck Norris drowned a man ON LAND. -% -The Jone's are trying to keep up with Chuck Norris -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Chuck Norris bowled a 301 after constructing another pin out of his beard hair -% -The only reason that USA lost the 2011 world cup to Japan is because Chuck Norris wasn't there. -% -Unlike Jack Bauer, Chuck Norris doesn't need bullets. A quick roundhouse to the face kills twice as fast. -% -There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up. -% -Chuck Norris' dog pick up after him. -% -Jedis are now taught to use the "Chuck" -% -Chuck Norris dosent carry a list. He always knows what to do. -% -When Chuck Norris performs a roundhouse kick, he's actually measuring the circumference of the universe. -% -Walker: Texas Ranger went into syndication before the first episode was shot. -% -Chuck Norris doesn't throw up if he drinks too much. Chuck Norris throws down! -% -"Walker Texas Ranger: The Movie 3-D" was considered by Warner Brothers; however the technology to create the visual effects will never be possible. -% -When Chuck Norris creates a login, it tells him "password not strong enough", he types in his name and it tells him "password too strong." -% -Chuck Norris isn't allowed at the zoo because when he's there the animals are terriefied to come out their cages -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris doesn’t wear a watch. HE decides what time it is. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Aliens fear that Chuck Norris might abduct them. -% -Chuck Norris splattered tiger blood and Adonis' dna on Charlie Sheen with 1 roundhouse kick! -% -How much wood could a woodchuck chuck if a woodchuck could chuck wood? No woodchuck could chuck Chuck's wood! -% -The sun only rises every morning because Chuck Norris allows it to. -% -Chuck Norris can do a regime change with a roundhouse kick. -% -Chuck Norris CAN spell with an I before E even after C. -% -Ghosts can see Chuck Norris -% -The answer to life, the universe and everything isnt 42. It's Chuck Norris. -% -When Chuck Norris pokes the Pillsbury Doughboy, it's not a laughing matter. -% -Chuck Norris once thought he was wrong. He was, however, mistaken. -% -Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming -% -"The wind cries Chuck Norris" -% -Chuck Norris doesn't need a bulletproof vest. He catches them with his bare hands. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. -% -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. -% -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. -% -Outer space exists because it's afraid to be on the same planet with Chuck Norris. -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is the reason why Waldo is hiding. -% -Chuck Norris counted to infinity - twice. -% -There is no chin behind Chuck Norris’ beard. There is only another fist. -% -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +Chuck Norris pees Adamantium % -Chuck Norris' hand is the only hand that can beat a Royal Flush. +Chuck Norris play's Texas hold em with Zeus, every second Wednesday of the month % -Chuck Norris can lead a horse to water AND make it drink. +Chuck Norris played "Got your Nose" with Voldemort and won. % -Chuck Norris doesn’t wear a watch. HE decides what time it is. +Chuck Norris played the game of thrones and won % -Chuck Norris can slam a revolving door. +Chuck Norris protects his body guards. % -Chuck Norris does not get frostbite. Chuck Norris bites frost. +Chuck Norris rolled a 20 on a 6 sided die. % -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +Chuck Norris roundhouse kicks people in the face first and asks questions later. % -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +Chuck Norris sent a BBM to an iphone. % -If you spell Chuck Norris in Scrabble, you win. Forever. +Chuck Norris shops at Sam's Club, but leaves without having his receipt checked % -Guns don't kill people. Chuck Norris kills people. +Chuck Norris shot a man with a knife % -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +Chuck Norris sleeps in Seattle. % -The chief export of Chuck Norris is Pain. +Chuck Norris splattered tiger blood and Adonis' dna on Charlie Sheen with 1 roundhouse kick! % -Chuck Norris has two speeds. Walk, and Kill. +Chuck Norris started Chuck Norris. % -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +Chuck Norris starts his day with 6 live chickens two cows, three pigs and a boiling hot cup of pure fury % -Chuck Norris drives an ice cream truck covered in human skulls. +Chuck Norris thretened to kill Michael Jackson, MJ got so scared to turned white. % -Chuck Norris is my Homeboy. +Chuck Norris told me to put this here. % -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +Chuck Norris uses a real mouse to move the cursor, type on the keyboard, write e-mails, code entire websites, use photoshop, bring coffee. % Chuck Norris uses pepper spray to spice up his steaks. % -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Chuck Norris: even Naruto can't believe it -% -Chuck Norris can fit 10 gallons of water in a 5 gallon water bucket -% -Chuck Norris roundhouse kicks people in the face first and asks questions later. -% -Chuck Norris is the only one who can tear a facebook page! -% -Chuck Norris doesn't need air, he is air -% -Chuck Norris once tried to teach a fat, stupid kid Martial Arts. Unsuccessfully. The kid grew up to be Steven Seagal. -% -Achievement Unlocked: Chuck Norris of Death +Chuck Norris was heard in a soundproof room! % -Chuck Norris is the ghost in paranormal activity. +Chuck Norris was once turned down for American Idol. When Simon was questioned about it, he replied "I'm retiring after this season". I wonder why? % -Chuck Norris can't get fired by Donald Trump +Chuck Norris was originally in Mortal Kombat, but that version was deleted because no one can beat Chuck Norris in a fight. % -Ozzy Osbourne once accidentally bit the head off a live bat - Chuck Norris once deliberately bit the head off a live pterodactyl. +Chuck Norris was the image used for Papa Smurf. % -Note to self: Don’t be the cashier to tell Chuck Norris his coupons have expired. +Chuck Norris was the reason why the Great Wall of China was constructed. It failed miserably. % Chuck Norris was what Willis was talking about. % -Chuck Norris is entitiled to his own facts. -% -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +Chuck Norris wasn't born on his birthday % -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +Chuck Norris watched the first steps on the moon... From his summer home on Mars % -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +Chuck Norris went up the creek without a paddle... or a canoe % -Outer space exists because it's afraid to be on the same planet with Chuck Norris. +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. % -Chuck Norris does not sleep. He waits. +Chuck Norris wins NASCAR races with all right turns. % -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +Chuck Norris won a stepdance contest by standing on his hands % -Chuck Norris is the reason why Waldo is hiding. +Chuck Norris yells at Drill Sergeants % -Chuck Norris counted to infinity - twice. +Chuck Norris' dog pick up after him. % -There is no chin behind Chuck Norris’ beard. There is only another fist. +Chuck Norris' films are factual documentaries. % -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +Chuck Norris' first job was as a paperboy. There were no survivors. % -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +Chuck Norris' glass is never half full or half empty. It stays full even after he takes a drink. % Chuck Norris' hand is the only hand that can beat a Royal Flush. % -Chuck Norris can lead a horse to water AND make it drink. +Chuck Norris' personal airplane is called Air Force Chuck % -Chuck Norris doesn’t wear a watch. HE decides what time it is. +Chuck Norris. Enough said. % -Chuck Norris can slam a revolving door. +Chuck Norris: even Naruto can't believe it % -Chuck Norris does not get frostbite. Chuck Norris bites frost. +Chunk Norris can make sour milk turn fresh % -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +Contrary to popular beleif, Rome WAS built in a day, by Chuck Norris. % Contrary to popular belief, America is not a democracy, it is a Chucktatorship. % -If you spell Chuck Norris in Scrabble, you win. Forever. -% -Guns don't kill people. Chuck Norris kills people. -% -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. -% -The chief export of Chuck Norris is Pain. -% -Chuck Norris has two speeds. Walk, and Kill. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris is my Homeboy. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris uses pepper spray to spice up his steaks. -% -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. % -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. -% -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Chuck Norris can win a game of Connect Four in only three moves. -% -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn’t wash his clothes, he disembowels them. -% -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -While visiting the hexagon, Chuck Norris was asked to demonstrate his famous roundhouse kick. Henceforth, it has been known as the Pentagon. -% -When Chuck Norris played the card game War with a friend, France surrendered. -% -If Goliath listened to Chuck Norris he would have won. +Cops don't need a badges in their wallets but only a picture of Chuck Norris. % -Chuck Norris can defuse bomb even if he cut the wrong wire +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. % -Chuck Norris sleeps in Seattle. +Dead bodies were found of people that are still alive. These people will cross Chuck Norris in the future and will be round-house kicked back in time. % -Chuck Norris shot a man with a knife +Did you here about the boy who cried Chuck Norris? % -The dictionary references Chuck Norris several times, he is metioned under Fear, Law, Order and Chucktatorship. +Do you know why Chuck Norris didn't star in The Expandebles? Because all the others guys would have surrended at the beginning. % -Chuck Norris CAN balance the light-switch between ON and OFF. +Dog the Bounty Hunter can't track Chuck Norris down. % -If Chuck was ever captured, he could win a game of Russian Roulette with six bullets in the revolver, he would shoot everyone else! +Don't get Chuck Norris angry, last time somebody did that Chuck Norris made the Grand Canyon. % -In a rain storm Chuck Norris stays dry. Rain drops are scared to hit him. +During the Civil War Chuck Norris was a slave, his master would often beg him for mercy % -Chuck Norris is the reason tumbleweeds tumble +Earth's rotation is purely governed by the direction that Chuck Norris is walking. % -The Earth was almost destroyed by a 50 km wide asteroid in 1984, but Chuck Norris roundhouse kicked it into the Sun. +Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming % -Chuck Norris can terminate a repeating decimal. +Every line in a Chuck Norris haiku is "A roundhouse kick to the face." And they all have the correct number of syllables. % -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +Every phobia known to man has a phobia of Chuck Norris % -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +Every time there's an earthquake, you know Chuck Norris is hungry. The earthquake is caused by his stomach growling. % -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +Everyone is so scared of Chuck Norris that they kiss his arse by writing these facts, too right they should % -Outer space exists because it's afraid to be on the same planet with Chuck Norris. +Evolution's driving mechanism is nature's desperate attempt to escape Chuck Norris. % -Chuck Norris does not sleep. He waits. +Fear of spiders is aracnaphobia, fear of tight spaces is chlaustraphobia, fear of Chuck Norris is called Logic % -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. % -Chuck Norris is the reason why Waldo is hiding. +Ghosts can see Chuck Norris % -Chuck Norris counted to infinity - twice. +Guns don't kill people. Chuck Norris kills people. % -There is no chin behind Chuck Norris’ beard. There is only another fist. +How much wood could a woodchuck chuck if a woodchuck could chuck wood? No woodchuck could chuck Chuck's wood! % -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass. % -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +If Chuck Norris were to get into a fight with another Chuck Norris, Chuck Norris would win. % -Chuck Norris' hand is the only hand that can beat a Royal Flush. +If Chuck was ever captured, he could win a game of Russian Roulette with six bullets in the revolver, he would shoot everyone else! % -Chuck Norris can lead a horse to water AND make it drink. +If God doesn't know, Chuck does % -Chuck Norris doesn’t wear a watch. HE decides what time it is. +If Goliath listened to Chuck Norris he would have won. % -Chuck Norris can slam a revolving door. +If at first you don't succeed, you're not Chuck Norris. % -Chuck Norris does not get frostbite. Chuck Norris bites frost. +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. % -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +If you put in the correct cheat code in Halo 2, you can have Master Cheif play without his helmet; revealing to be Chuck Norris. % -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +If you see a man in the street who looks like Chuck Norris, but isn't, run: you don't want to be caught in the resulting roundhouse kick to his face. % If you spell Chuck Norris in Scrabble, you win. Forever. % -Guns don't kill people. Chuck Norris kills people. +In 1945 The US army asked if they could clone Chuck Norris. instead he said he could sort out the Japanese. % -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +In Texas, there are five sizes for fountain drinks: small, medium, large, Texas sized, and Chuck Norris Sized. It is a cup made of a human skull. % -The chief export of Chuck Norris is Pain. +In a rain storm Chuck Norris stays dry. Rain drops are scared to hit him. % -Chuck Norris has two speeds. Walk, and Kill. +In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten. % -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +In the back of the book of world records, it says "All records are held by Chuck Norris. The ones listed are in second place." % -Chuck Norris drives an ice cream truck covered in human skulls. +James Bond has a license to kill. He got it from Chuck Norris. % -Chuck Norris is my Homeboy. +Jedis are now taught to use the "Chuck" % -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but Chuck Norris roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart. % -Chuck Norris uses pepper spray to spice up his steaks. +Machiavelli said it is better to be feared than loved because he was inspired by Chuck Norris. % -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +May the Force be with Chuck Norris... for it's own good. % -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +Merlin was Chuck Norris' assistant. % -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +More of a question than a fact: in a fight between Chuck Norris and Gordan Freeman who would win? % -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. % -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +Note to everyone: Please do not give beans to Chuck Norris or do you want another atombomb on hiroshima? % -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +Note to self: Don't be the cashier to tell Chuck Norris his coupons have expired. % -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +On the keyboard there is no control button because Chuck Norris is always in control. % -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +Once upon a time, Chuck Norris found himself in a town called Shit Creek.....He opened a Paddle Store. % -The quickest way to a man's heart is with Chuck Norris' fist. +One glance from Chuck Norris and snow turns itself yellow. % -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +One time a test cheated on Chuck Norris. % -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +Only Chuck Norris can win the mind game, 'cause he never minds. % -Chuck Norris can win a game of Connect Four in only three moves. +Only Chuck Norris is stronger than an Altoid. % -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +Outer space exists because it's afraid to be on the same planet with Chuck Norris. % -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +Ozzy Osbourne once accidentally bit the head off a live bat - Chuck Norris once deliberately bit the head off a live pterodactyl. % -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face. % -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. % -Chuck Norris doesn’t wash his clothes, he disembowels them. +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. % -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +Simon doesn't say...Chuck Norris says. % -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent.? % -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +Some boots were made for walking. Some boots may walk all over you, but Chuck Norris' boot walk THROUGH you. % -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +Some kids pee their name in snow. Chuck Norris pees his name in concrete. % -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag. % -Chuck Norris doesn't look for fun. The fun looks for Chuck Norris. +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. % -Chuck Norris starts his day with 6 live chickens two cows, three pigs and a boiling hot cup of pure fury +Staring at Chuck Norris for extended periods of time without proper eye protection will cause blindess, and possibly foot sized brusies on the face. % -The only word that rhymes with orange is Chuck Norris +Taking Karate Lessons = $100, Buying MMA DVD's= $150, Subscribing to a UFC event = $50, Getting a Roundhouse Kick from Chuck Norris = PRICELESS % -Everyone is so scared of Chuck Norris that they kiss his arse by writing these facts, too right they should +That's not an eclipse....that's the sun hiding from Chuck Norris. % -gmail@chucknorris.com +The Beatles are on iTunes because Chuck Norris bought a Mac. % -Chuck Norris play's Texas hold em with Zeus, every second Wednesday of the month +The Earth is made up of two-thirds water and one-third Chuck Norris. % -Chuck Norris has killed the Dead Sea +The Earth was almost destroyed by a 50 km wide asteroid in 1984, but Chuck Norris roundhouse kicked it into the Sun. % -On the keyboard there is no control button because Chuck Norris is always in control. +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. % -The truth hurts dosen't it, Chuck Norris' truth kills. +The Jone's are trying to keep up with Chuck Norris % -Chuck Norris sent a BBM to an iphone. +The Matrix Trilogy would have ended on the first movie if Keanu Reeves said, “I know Chuck Norris.” % -When Presidents speak, their nation listens. When Chuck Norris blinks, the whole World listens. +The answer to life, the universe and everything isnt 42. It's Chuck Norris. % -Chuck Norris once cried just to see what it was like. The end result was the creation of life. +The apple falls far from the tree, when a roundhouse kick is taken to the trunk. % -Chuck Norris is the reason that the world will end in 2012. He was getting bored with the Earth +The best part of waking up is not Folgers in your cup, it's knowing that Chuck Norris let you live. % -When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +The chief export of Chuck Norris is Pain. % -Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +The dictionary references Chuck Norris several times, he is metioned under Fear, Law, Order and Chucktatorship. % -There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +The kids said when Chuck was eating Trix cereal ´´silly Chuck, Trix are for kids´´...what happened next?..............................Darfur happened. % -Outer space exists because it's afraid to be on the same planet with Chuck Norris. +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. % -Chuck Norris does not sleep. He waits. +The letters in Chuck Norris cannot be unscrambled. % -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +The meaning of life is Chuck Norris % -Chuck Norris is the reason why Waldo is hiding. +The only place where the Starship Enterprise refuses to boldly go is Chuck Norris' planet...which is all of them. % -Chuck Norris counted to infinity - twice. +The only reason that USA lost the 2011 world cup to Japan is because Chuck Norris wasn't there. % -There is no chin behind Chuck Norris’ beard. There is only another fist. +The only sure things are Death and Taxes, and when Chuck Norris goes to work for the IRS, they'll be the same thing. % -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +The only way sharks will come near CN underwater is when CN is inside of a cage. % -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +The only word that rhymes with orange is Chuck Norris % -Chuck Norris' hand is the only hand that can beat a Royal Flush. +The planes in 9/11 were not hijacked. Chuck Norris was just playing with his old radio controller. % -Chuck Norris can lead a horse to water AND make it drink. +The producers of the movie "The Last Airbender" are now in talks with Chuck Norris in Order to star him in their next sequal "The Last Skull Bender". % -Chuck Norris doesn’t wear a watch. HE decides what time it is. +The quickest way to a man's heart is with Chuck Norris' fist. % -Chuck Norris can slam a revolving door. +The reason why batman only comes out at night is because he's afraid he might encounter Chuck Norris in the Morning and afternoon. % -Chuck Norris does not get frostbite. Chuck Norris bites frost. +The red phone in the oval office...Rings directly to Chuck Norris Cell Phone % -Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage. % -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +The square root of Chuck Norris is pain. Do not try to square Chuck Norris. The result is death % -If you spell Chuck Norris in Scrabble, you win. Forever. +The sun only rises every morning because Chuck Norris allows it to. % -Guns don't kill people. Chuck Norris kills people. +The truth hurts, doesn't it? Chuck Norris' truth kills. % -There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +There is no chin behind Chuck Norris' beard. There is only another fist. % -The chief export of Chuck Norris is Pain. +There is no chin behind Chuck Norris' beard. There is only another fist. % -Chuck Norris has two speeds. Walk, and Kill. +There is no limbo, only a world that doesn't know of Chuck Norris % -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +There is no such thing as being hard its called the Chuck Norris factor. % -Chuck Norris drives an ice cream truck covered in human skulls. +There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up. % -Chuck Norris is my Homeboy. +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. % -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. % -Chuck Norris uses pepper spray to spice up his steaks. +They say death by a 1000 lashes was the most painful way to die, that was before they got roundhouse kicked in the face by Chuck Norris % -Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +This one time at band camp... BAM! Chuck Norris. % -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +Those who ignore history, are doomed by Chuck Norris. % -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +Trick me once, shame on you, trick Chuck Norris.....rest in peace. % -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +Unlike Jack Bauer, Chuck Norris doesn't need bullets. A quick roundhouse to the face kills twice as fast. % -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +Walker: Texas Ranger went into syndication before the first episode was shot. % -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. % -If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +Whatever Chuck Norris wants, it will instantly appear. % -When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +When Betty White gets angry, she turns into the Hulk. When Valerie Bertinelli gets mad, she turns into Chuck Norris. % -The quickest way to a man's heart is with Chuck Norris' fist. +When Chuck Norris creates a login, it tells him "password not strong enough", he types in his name and it tells him "password too strong." % -Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. % -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +When Chuck Norris drinks water, the water automatically pasteurized. % -Chuck Norris can win a game of Connect Four in only three moves. +When Chuck Norris goes to Vegas, he doesn't have to gamble. The casinos just give him stacks of money. % -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +When Chuck Norris goes to rodeos, bulls ride him. % -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +When Chuck Norris goes to the library, he looks for the guinness book of records in the comedy section. % -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +When Chuck Norris inhales helium, his voice doesn't change. % -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +When Chuck Norris performs a roundhouse kick, he's actually measuring the circumference of the universe. % -Chuck Norris doesn’t wash his clothes, he disembowels them. +When Chuck Norris played the card game War with a friend, France surrendered. % -A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +When Chuck Norris pokes the Pillsbury Doughboy, it's not a laughing matter. % -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +When Chuck Norris roundhouse-kicks you HE decides when you will feel the impact . % -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. % -Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +When Chuck Norris tosses a coin, it lands on both head and tail. % -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +When God said "Let there be light!", Chuck Norris said "Only for half the day % -Only Chuck Norris is stronger than an Altoid. +When President Roosevelt dropped the atomic bomb on Hiroshima, he did so only because it was more human then sending Chuck Norris. % -Chuck Norris has a battlecruiser AND a car. +When Presidents speak, their nation listens. When Chuck Norris blinks, the whole World listens. % -Chuck Norris burnt a fire proof vest, UNDERWATER! +When Steven Seagal kills a ninja, he only takes its hide. When Chuck Norris kills a ninja, he uses every part. % -Chuck Norris was once turned down for American Idol. When Simon was questioned about it, he replied "I'm retiring after this season". I wonder why? +When chuck Norris was in school, he made his PE teacher run laps. % -Chuck Norris doesn't cheat death, he beats it fair and square. +When does Chuck Norris run out of shotgun bullets?.....whenever he wants to. % -When Chuck Norris roundhouse-kicks you HE decides when you will feel the impact . +When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000. % -Chuck Norris made the big bang just by clicking his fingers +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. % -Trick me once, shame on you, trick Chuck Norris.....rest in peace. +When things go bump in the night.... it's Chuck Norris % -Chuck Norris doesn't fight. He gives motivational seminars to die on their own to avoid a roundhouse kick to the face. +While visiting the hexagon, Chuck Norris was asked to demonstrate his famous roundhouse kick. Henceforth, it has been known as the Pentagon. % -This one time at band camp... BAM! Chuck Norris. +Why didn't the chicken cross the road? Because Chuck Norris got to it first. % -Chuck Norris protects his body guards. +World War II began because Chuck Norris took a nap. When he woke up, Hitler found out and killed himself out of fear Chuck Norris would kill him. % -Chuck Norris watched the first steps on the moon... From his summer home on Mars +You know Chuck Norris' pet lizard, right? Last I heard, he was in the movie "Godzilla". Oh, and his pet turtle starred in "Gamera" as well. % -The Earth is made up of two-thirds water and one-third Chuck Norris. +http://chucknorrisfacts.com/ is built in Drupal because Chuck Norris knows a good CMS when he sees one. % diff --git a/plugins/cloudapp/README.md b/plugins/cloudapp/README.md new file mode 100644 index 0000000..ef304ed --- /dev/null +++ b/plugins/cloudapp/README.md @@ -0,0 +1,26 @@ +# CloudApp plugin + +## The CloudApp API is deprecated, so the plugin will be removed shortly + +[CloudApp](https://www.getcloudapp.com) brings screen recording, screenshots, and GIF creation to the cloud, in an easy-to-use enterprise-level app. The CloudApp plugin allows you to upload a file to your CloadApp account from the command line. + +To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file: + +```zsh +plugins=(... cloudapp) +``` + +## Requirements + +1. [Aaron Russell's `cloudapp_api` gem](https://github.com/aaronrussell/cloudapp_api#installation) + +2. That you set your CloudApp credentials in `~/.cloudapp` as a simple text file like below: + ``` + email + password + ``` + +## Usage + +- `cloudapp `: uploads `` to your CloudApp account, and if you're using + macOS, copies the URL to your clipboard. diff --git a/plugins/cloudapp/cloudapp.plugin.zsh b/plugins/cloudapp/cloudapp.plugin.zsh index 99252f6..a4d92a0 100644 --- a/plugins/cloudapp/cloudapp.plugin.zsh +++ b/plugins/cloudapp/cloudapp.plugin.zsh @@ -1,2 +1,4 @@ -#!/bin/zsh -alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb +print -Pn "%F{yellow}" +print "[oh-my-zsh] The CloudApp API no longer works, so the cloudapp plugin will" +print "[oh-my-zsh] be removed shortly. Please remove it from your plugins list." +print -Pn "%f" diff --git a/plugins/cloudapp/cloudapp.rb b/plugins/cloudapp/cloudapp.rb deleted file mode 100755 index a11cfdb..0000000 --- a/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/plugins/codeclimate/README.md b/plugins/codeclimate/README.md new file mode 100644 index 0000000..0d712ac --- /dev/null +++ b/plugins/codeclimate/README.md @@ -0,0 +1,8 @@ +# codeclimate plugin + +This plugin adds autocompletion for the [`codeclimate` CLI](https://github.com/codeclimate/codeclimate). + +To use it, add `codeclimate` to the plugins array in your zshrc file: +```zsh +plugins=(... codeclimate) +``` diff --git a/plugins/coffee/README.md b/plugins/coffee/README.md index d6cd074..2baade8 100644 --- a/plugins/coffee/README.md +++ b/plugins/coffee/README.md @@ -1,4 +1,4 @@ -## Coffeescript Plugin +# Coffeescript Plugin This plugin provides aliases for quickly compiling and previewing your coffeescript code. diff --git a/plugins/colemak/README.md b/plugins/colemak/README.md new file mode 100644 index 0000000..4da4bc1 --- /dev/null +++ b/plugins/colemak/README.md @@ -0,0 +1,48 @@ +# Colemak plugin + +This plugin remaps keys in `zsh`'s [`vi`-style navigation mode](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Keymaps) +for a [Colemak](https://colemak.com/) keyboard layout, to match the QWERTY position: + +![Colemak layout on a US keyboard](https://colemak.com/wiki/images/6/6c/Colemak2.png) + +To use it, add it to the plugins array in your `~/.zshrc` file: + +``` +plugins=(... colemak) +``` + +You will also need to enable `vi` mode, so add another line to `~/.zshrc`: +``` +bindkey -v +``` + +Restart your shell and hit the `` key to activate `vicmd` (navigation) mode, +and start navigating `zsh` with your new keybindings! + +## Key bindings for vicmd + +| Old | New | Binding | Description | +|------------|------------|---------------------------|----------------------------------------------------| +| `CTRL`+`j` | `CTRL`+`n` | accept-line | Insert new line | +| `j` | `n` | down-line-or-history | Move one line down or command history forwards | +| `k` | `e` | up-line-or-history | Move one line up or command history backwards | +| `l` | `i` | vi-forward-char | Move one character to the right | +| `n` | `k` | vi-repeat-search | Repeat command search forwards | +| `N` | `K` | vi-rev-repeat-search | Repeat command search backwards | +| `i` | `u` | vi-insert | Enter insert mode | +| `I` | `U` | vi-insert-bol | Move to first non-blank char and enter insert mode | +| `` | `l` | vi-undo-change | Undo change | +| `J` | `N` | vi-join | Join the current line with the next one | +| `e` | `j` | vi-forward-word-end | Move to the end of the next word | +| `E` | `J` | vi-forward-blank-word-end | Move to end of the current or next word | + +## Key bindings for less + +| Keyboard shortcut | `less` key binding | +|-------------------|--------------------| +| `n` | forw-line | +| `e` | back-line | +| `k` | repeat-search | +| `ESC`+`k` | repeat-search-all | +| `K` | reverse-search | +| `ESC`+`K` | reverse-search-all | diff --git a/plugins/colored-man-pages/README.md b/plugins/colored-man-pages/README.md new file mode 100644 index 0000000..f34941e --- /dev/null +++ b/plugins/colored-man-pages/README.md @@ -0,0 +1,18 @@ +# Colored man pages plugin + +This plugin adds colors to man pages. + +To use it, add `colored-man-pages` to the plugins array in your zshrc file: + +```zsh +plugins=(... colored-man-pages) +``` + +It will also automatically colorize man pages displayed by `dman` or `debman`, +from [`debian-goodies`](https://packages.debian.org/stable/debian-goodies). + +You can also try to color other pages by prefixing the respective command with `colored`: + +```zsh +colored git help clone +``` diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh index 1bea536..ec51847 100644 --- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -16,8 +16,8 @@ EOF fi fi -function man() { - env \ +function colored() { + command env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ LESS_TERMCAP_me=$(printf "\e[0m") \ @@ -28,5 +28,12 @@ function man() { PAGER="${commands[less]:-$PAGER}" \ _NROFF_U=1 \ PATH="$HOME/bin:$PATH" \ - man "$@" + "$@" +} + +# Colorize man and dman/debman (from debian-goodies) +function man \ + dman \ + debman { + colored $0 "$@" } diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md index c006071..ee4ab80 100644 --- a/plugins/colorize/README.md +++ b/plugins/colorize/README.md @@ -2,17 +2,47 @@ With this plugin you can syntax-highlight file contents of over 300 supported languages and other text formats. -To use it, add colorize to the plugins array of your zshrc file: +Colorize will highlight the content based on the filename extension. If it can't find a syntax-highlighting +method for a given extension, it will try to find one by looking at the file contents. If no highlight method +is found it will just cat the file normally, without syntax highlighting. + +## Setup + +To use it, add colorize to the plugins array of your `~/.zshrc` file: ``` plugins=(... colorize) ``` -## Usage +## Configuration + +### Requirements + +This plugin requires that at least one of the following tools is installed: + +* [Chroma](https://github.com/alecthomas/chroma) +* [Pygments](https://pygments.org/download/) + +### Colorize tool + +Colorize supports `pygmentize` and `chroma` as syntax highlighter. By default colorize uses `pygmentize` unless it's not installed and `chroma` is. This can be overridden by the `ZSH_COLORIZE_TOOL` environment variable: -* `ccat [files]`: colorize the contents of the file (or files, if more than one are provided). If no arguments are passed it will colorize the standard input or stdin. +``` +ZSH_COLORIZE_TOOL=chroma +``` + +### Styles + +Pygments offers multiple styles. By default, the `default` style is used, but you can choose another theme by setting the `ZSH_COLORIZE_STYLE` environment variable: -Colorize will highlight the content based on the filename extension. If it can't find a syntax-highlighting method for a given extension, it will try to find one by looking at the file contents. If no highlight method is found it will just cat the file normally, without syntax highlighting. +``` +ZSH_COLORIZE_STYLE="colorful" +``` + +## Usage -## Requirements +* `ccat [files]`: colorize the contents of the file (or files, if more than one are provided). + If no files are passed it will colorize the standard input. -You have to install Pygments first: [pygments.org](http://pygments.org/download/) +* `cless [less-options] [files]`: colorize the contents of the file (or files, if more than one are provided) and open less. + If no files are passed it will colorize the standard input. + The LESSOPEN and LESSCLOSE will be overwritten for this to work, but only in a local scope. diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index 8eede9a..6ed9739 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -1,28 +1,113 @@ -# easier alias to use the plugin -alias ccat='colorize_via_pygmentize' +# Easier alias to use the plugin +alias ccat="colorize_cat" +alias cless="colorize_less" -colorize_via_pygmentize() { - if ! (( $+commands[pygmentize] )); then - echo "package 'Pygments' is not installed!" +# '$0:A' gets the absolute path of this file +ZSH_COLORIZE_PLUGIN_PATH=$0:A + +colorize_check_requirements() { + local available_tools=("chroma" "pygmentize") + + if [ -z "$ZSH_COLORIZE_TOOL" ]; then + if (( $+commands[pygmentize] )); then + ZSH_COLORIZE_TOOL="pygmentize" + elif (( $+commands[chroma] )); then + ZSH_COLORIZE_TOOL="chroma" + else + echo "Neither 'pygments' nor 'chroma' is installed!" >&2 + return 1 + fi + fi + + if [[ ${available_tools[(Ie)$ZSH_COLORIZE_TOOL]} -eq 0 ]]; then + echo "ZSH_COLORIZE_TOOL '$ZSH_COLORIZE_TOOL' not recognized. Available options are 'pygmentize' and 'chroma'." >&2 + return 1 + elif (( $+commands["$ZSH_COLORIZE_TOOL"] )); then + echo "Package '$ZSH_COLORIZE_TOOL' is not installed!" >&2 return 1 fi +} + +colorize_cat() { + if ! colorize_check_requirements; then + return 1 + fi + + # If the environment variable ZSH_COLORIZE_STYLE + # is set, use that theme instead. Otherwise, + # use the default. + if [ -z "$ZSH_COLORIZE_STYLE" ]; then + # Both pygmentize & chroma support 'emacs' + ZSH_COLORIZE_STYLE="emacs" + fi - # pygmentize stdin if no arguments passed + # Use stdin if no arguments have been passed. if [ $# -eq 0 ]; then - pygmentize -g + if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then + pygmentize -O style="$ZSH_COLORIZE_STYLE" -g + else + chroma --style="$ZSH_COLORIZE_STYLE" + fi return $? fi - # guess lexer from file extension, or - # guess it from file contents if unsuccessful + # Guess lexer from file extension, or guess it from file contents if unsuccessful. local FNAME lexer - for FNAME in $@ - do - lexer=$(pygmentize -N "$FNAME") - if [[ $lexer != text ]]; then - pygmentize -l "$lexer" "$FNAME" + for FNAME in "$@"; do + if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then + lexer=$(pygmentize -N "$FNAME") + if [[ $lexer != text ]]; then + pygmentize -O style="$ZSH_COLORIZE_STYLE" -l "$lexer" "$FNAME" + else + pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME" + fi else - pygmentize -g "$FNAME" + chroma --style="$ZSH_COLORIZE_STYLE" "$FNAME" fi done } + +# The less option 'F - Forward forever; like "tail -f".' will not work in this implementation +# caused by the lack of the ability to follow the file within pygmentize. +colorize_less() { + if ! colorize_check_requirements; then + return 1 + fi + + _cless() { + # LESS="-R $LESS" enables raw ANSI colors, while maintain already set options. + local LESS="-R $LESS" + + # This variable tells less to pipe every file through the specified command + # (see the man page of less INPUT PREPROCESSOR). + # 'zsh -ic "colorize_cat %s 2> /dev/null"' would not work for huge files like + # the ~/.zsh_history. For such files the tty of the preprocessor will be supended. + # Therefore we must source this file to make colorize_cat available in the + # preprocessor without the interactive mode. + # `2>/dev/null` will suppress the error for large files 'broken pipe' of the python + # script pygmentize, which will show up if less has not fully "loaded the file" + # (e.g. when not scrolled to the bottom) while already the next file will be displayed. + local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \ + ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \ + colorize_cat %s 2> /dev/null'" + + # LESSCLOSE will be set to prevent any errors by executing a user script + # which assumes that his LESSOPEN has been executed. + local LESSCLOSE="" + + LESS="$LESS" LESSOPEN="$LESSOPEN" LESSCLOSE="$LESSCLOSE" less "$@" + } + + if [ -t 0 ]; then + _cless "$@" + else + # The input is not associated with a terminal, therefore colorize_cat will + # colorize this input and pass it to less. + # Less has now to decide what to use. If any files have been provided, less + # will ignore the input by default, otherwise the colorized input will be used. + # If files have been supplied and the input has been redirected, this will + # lead to unnecessary overhead, but retains the ability to use the less options + # without checking for them inside this script. + colorize_cat | _cless "$@" + fi +} diff --git a/plugins/command-not-found/README.md b/plugins/command-not-found/README.md index df62d1f..1cf4ba6 100644 --- a/plugins/command-not-found/README.md +++ b/plugins/command-not-found/README.md @@ -27,5 +27,6 @@ It works out of the box with the command-not-found packages for: - [Arch Linux](https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found) - [macOS (Homebrew)](https://github.com/Homebrew/homebrew-command-not-found) - [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound) +- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found) You can add support for other platforms by submitting a Pull Request. diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index ba1262d..81d76e6 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -26,8 +26,13 @@ fi # OSX command-not-found support # https://github.com/Homebrew/homebrew-command-not-found -if type brew &> /dev/null; then - if brew command command-not-found-init > /dev/null 2>&1; then - eval "$(brew command-not-found-init)"; - fi +if [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then + source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' +fi + +# NixOS command-not-found support +if [ -x /run/current-system/sw/bin/command-not-found ]; then + command_not_found_handler () { + /run/current-system/sw/bin/command-not-found $@ + } fi diff --git a/plugins/common-aliases/README.md b/plugins/common-aliases/README.md new file mode 100644 index 0000000..d198a29 --- /dev/null +++ b/plugins/common-aliases/README.md @@ -0,0 +1,121 @@ +# Common Aliases Plugin + +This plugin creates helpful shortcut aliases for many commonly used commands. + +To use it add `common-aliases` to the plugins array in your zshrc file: + +```zsh +plugins=(... common-aliases) +``` + +## Aliases + +### ls command + +| Alias | Command | Description | +|-------|---------------|--------------------------------------------------------------------------------| +| l | `ls -lFh` | List files as a long list, show size, type, human-readable | +| la | `ls -lAFh` | List almost all files as a long list show size, type, human-readable | +| lr | `ls -tRFh` | List files recursively sorted by date, show type, human-readable | +| lt | `ls -ltFh` | List files as a long list sorted by date, show type, human-readable | +| ll | `ls -l` | List files as a long list | +| ldot | `ls -ld .*` | List dot files as a long list | +| lS | `ls -1FSsh` | List files showing only size and name sorted by size | +| lart | `ls -1Fcart` | List all files sorted in reverse of create/modification time (oldest first) | +| lrt | `ls -1Fcrt` | List files sorted in reverse of create/modification time(oldest first) | + +### File handling + +| Alias | Command | Description | +|-------|-----------------------|------------------------------------------------------------------------------------| +| rm | `rm -i` | Remove a file | +| cp | `cp -i` | Copy a file | +| mv | `mv -i` | Move a file | +| zshrc | `${=EDITOR} ~/.zshrc` | Quickly access the ~/.zshrc file | +| dud | `du -d 1 -h` | Display the size of files at depth 1 in current location in human-readable form | +| duf | `du -sh` | Display the size of files in current location in human-readable form | +| t | `tail -f` | Shorthand for tail which outputs the last part of a file | + +### find and grep + +| Alias | Command | Description | +|-------|-----------------------------------------------------|-----------------------------------------| +| fd | `find . -type d -name` | Find a directory with the given name | +| ff | `find . -type f -name` | Find a file with the given name | +| grep | `grep --color` | Searches for a query string | +| sgrep | `grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}` | Useful for searching within files | + +### Other Aliases + +| Alias | Command | Description | +|-----------|---------------------|-------------------------------------------------------------| +| h | `history` | Lists all recently used commands | +| hgrep | `fc -El 0 \| grep` | Searches for a word in the list of previously used commands | +| help | `man` | Opens up the man page for a command | +| p | `ps -f` | Displays currently executing processes | +| sortnr | `sort -n -r` | Used to sort the lines of a text file | +| unexport | `unset` | Used to unset an environment variable | + +## Global aliases + +These aliases are expanded in any position in the command line, meaning you can use them even at the +end of the command you've typed. Examples: + +Quickly pipe to less: +```zsh +$ ls -l /var/log L +# will run +$ ls -l /var/log | less +``` +Silences stderr output: +```zsh +$ find . -type f NE +# will run +$ find . -type f 2>/dev/null +``` + +| Alias | Command | Description | +|-------|-----------------------------|-------------------------------------------------------------| +| H | `\| head` | Pipes output to head which outputs the first part of a file | +| T | `\| tail` | Pipes output to tail which outputs the last part of a file | +| G | `\| grep` | Pipes output to grep to search for some word | +| L | `\| less` | Pipes output to less, useful for paging | +| M | `\| most` | Pipes output to more, useful for paging | +| LL | `2>&1 \| less` | Writes stderr to stdout and passes it to less | +| CA | `2>&1 \| cat -A` | Writes stderr to stdout and passes it to cat | +| NE | `2 > /dev/null` | Silences stderr | +| NUL | `> /dev/null 2>&1` | Silences both stdout and stderr | +| P | `2>&1\| pygmentize -l pytb` | Writes stderr to stdout and passes it to pygmentize | + +## File extension aliases + +These are special aliases that are triggered when a file name is passed as the command. For example, +if the pdf file extension is aliased to `acroread` (a popular Linux pdf reader), when running `file.pdf` +that file will be open with `acroread`. + +### Reading Docs + +| Alias | Command | Description | +|-------|-------------|-------------------------------------| +| pdf | `acroread` | Opens up a document using acroread | +| ps | `gv` | Opens up a .ps file using gv | +| dvi | `xdvi` | Opens up a .dvi file using xdvi | +| chm | `xchm` | Opens up a .chm file using xchm | +| djvu | `djview` | Opens up a .djvu file using djview | + +### Listing files inside a packed file + +| Alias | Command | Description | +|---------|-------------|-------------------------------------| +| zip | `unzip -l` | Lists files inside a .zip file | +| rar | `unrar l` | Lists files inside a .rar file | +| tar | `tar tf` | Lists files inside a .tar file | +| tar.gz | `echo` | Lists files inside a .tar.gz file | +| ace | `unace l` | Lists files inside a .ace file | + +### Some other features + +- Opens urls in terminal using browser specified by the variable `$BROWSER` +- Opens C, C++, Tex and text files using editor specified by the variable `$EDITOR` +- Opens images using image viewer specified by the variable `$XIVIEWER` +- Opens videos and other media using mplayer diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index 785a09c..023b1a5 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -13,7 +13,7 @@ alias lS='ls -1FSsh' alias lart='ls -1Fcart' alias lrt='ls -1Fcrt' -alias zshrc='${=EDITOR} ~/.zshrc' # Quick access to the ~/.zshrc file +alias zshrc='${=EDITOR} ${ZDOTDIR:-$HOME}/.zshrc' # Quick access to the .zshrc file alias grep='grep --color' alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} ' @@ -50,6 +50,7 @@ alias mv='mv -i' # zsh is able to auto-do some kungfoo # depends on the SUFFIX :) +autoload -Uz is-at-least if is-at-least 4.2.0; then # open browser on urls if [[ -n "$BROWSER" ]]; then diff --git a/plugins/compleat/README.md b/plugins/compleat/README.md new file mode 100644 index 0000000..af0e383 --- /dev/null +++ b/plugins/compleat/README.md @@ -0,0 +1,9 @@ +# compleat plugin + +This plugin looks for [compleat](https://github.com/mbrubeck/compleat) and loads its completion. + +To use it, add compleat to the plugins array in your zshrc file: + +```zsh +plugins=(... compleat) +``` diff --git a/plugins/composer/README.md b/plugins/composer/README.md index 2b4bae5..7a5f725 100644 --- a/plugins/composer/README.md +++ b/plugins/composer/README.md @@ -12,18 +12,20 @@ plugins=(... composer) ## Aliases -| Alias | Command | Description | -| ------ | -------------------------------------------- | -------------------------------------------------------------------------------------- | -| `c` | composer | Starts composer | -| `csu` | composer self-update | Updates composer to the latest version | -| `cu` | composer update | Updates composer dependencies and `composer.lock` file | -| `cr` | composer require | Adds new packages to `composer.json` | -| `crm` | composer remove | Removes packages from `composer.json` | -| `ci` | composer install | Resolves and installs dependencies from `composer.json` | -| `ccp` | composer create-project | Create new project from an existing package | -| `cdu` | composer dump-autoload | Updates the autoloader | -| `cdo` | composer dump-autoload --optimize-autoloader | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) | -| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory | -| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory | -| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory | -| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory | +| Alias | Command | Description | +| ------ | ------------------------------------------- | --------------------------------------------------------------------------------------- | +| `c` | `composer` | Starts composer | +| `csu` | `composer self-update` | Updates composer to the latest version | +| `cu` | `composer update` | Updates composer dependencies and `composer.lock` file | +| `cr` | `composer require` | Adds new packages to `composer.json` | +| `crm` | `composer remove` | Removes packages from `composer.json` | +| `ci` | `composer install` | Resolves and installs dependencies from `composer.json` | +| `ccp` | `composer create-project` | Create new project from an existing package | +| `cdu` | `composer dump-autoload` | Updates the autoloader | +| `cdo` | `composer dump-autoload -o` | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) | +| `cgu` | `composer global update` | Allows update command to run on COMPOSER_HOME directory | +| `cgr` | `composer global require` | Allows require command to run on COMPOSER_HOME directory | +| `cgrm` | `composer global remove` | Allows remove command to run on COMPOSER_HOME directory | +| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory | +| `co` | `composer outdated` | Shows a list of installed packages with available updates | +| `cod` | `composer outdated --direct` | Shows a list of installed packages with available updates which are direct dependencies | diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 6349610..330360c 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -15,20 +15,16 @@ _composer_get_required_list () { } _composer () { - local curcontext="$curcontext" state line - typeset -A opt_args - _arguments \ - '1: :->command'\ - '*: :->args' - - case $state in - command) - compadd $(_composer_get_command_list) - ;; - *) - compadd $(_composer_get_required_list) - ;; - esac + local curcontext="$curcontext" state line + typeset -A opt_args + _arguments \ + '*:: :->subcmds' + + if (( CURRENT == 1 )) || ( ((CURRENT == 2)) && [ "$words[1]" = "global" ] ) ; then + compadd $(_composer_get_command_list) + else + compadd $(_composer_get_required_list) + fi } compdef _composer composer @@ -43,17 +39,29 @@ alias crm='composer remove' alias ci='composer install' alias ccp='composer create-project' alias cdu='composer dump-autoload' -alias cdo='composer dump-autoload --optimize-autoloader' +alias cdo='composer dump-autoload -o' alias cgu='composer global update' alias cgr='composer global require' alias cgrm='composer global remove' +alias co='composer outdated' +alias cod='composer outdated --direct' # install composer in the current directory alias cget='curl -s https://getcomposer.org/installer | php' # Add Composer's global binaries to PATH, using Composer if available. if (( $+commands[composer] )); then - export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null) + _retrieve_cache composer + + if [[ -z $__composer_bin_dir ]]; then + __composer_bin_dir=$(composer global config bin-dir --absolute 2>/dev/null) + _store_cache composer __composer_bin_dir + fi + + # Add Composer's global binaries to PATH + export PATH="$PATH:$__composer_bin_dir" + + unset __composer_bin_dir else [ -d $HOME/.composer/vendor/bin ] && export PATH=$PATH:$HOME/.composer/vendor/bin [ -d $HOME/.config/composer/vendor/bin ] && export PATH=$PATH:$HOME/.config/composer/vendor/bin diff --git a/plugins/copybuffer/copybuffer.plugin.zsh b/plugins/copybuffer/copybuffer.plugin.zsh index cc205d4..483ed5a 100644 --- a/plugins/copybuffer/copybuffer.plugin.zsh +++ b/plugins/copybuffer/copybuffer.plugin.zsh @@ -1,9 +1,9 @@ # copy the active line from the command line buffer -# onto the system clipboard (requires clipcopy plugin) +# onto the system clipboard copybuffer () { if which clipcopy &>/dev/null; then - echo $BUFFER | clipcopy + printf "%s" "$BUFFER" | clipcopy else echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly." fi diff --git a/plugins/copyfile/README.md b/plugins/copyfile/README.md index 53138ad..a110b83 100644 --- a/plugins/copyfile/README.md +++ b/plugins/copyfile/README.md @@ -3,7 +3,8 @@ Puts the contents of a file in your system clipboard so you can paste it anywhere. To use, add `copyfile` to your plugins array: -``` + +```zsh plugins=(... copyfile) ``` diff --git a/plugins/cpanm/README.md b/plugins/cpanm/README.md index 3803e3e..13e93d0 100644 --- a/plugins/cpanm/README.md +++ b/plugins/cpanm/README.md @@ -1,9 +1,9 @@ # Cpanm This plugin provides completion for [Cpanm](https://github.com/miyagawa/cpanminus) ([docs](https://metacpan.org/pod/App::cpanminus)). - + To use it add cpanm to the plugins array in your zshrc file. - - ```bash + +```zsh plugins=(... cpanm) ``` diff --git a/plugins/dash/README.md b/plugins/dash/README.md new file mode 100644 index 0000000..0ca3e4e --- /dev/null +++ b/plugins/dash/README.md @@ -0,0 +1,28 @@ +# Dash plugin + +This plugin adds command line functionality for [Dash](https://kapeli.com/dash), +an API Documentation Browser for macOS. This plugin requires Dash to be installed +to work. + +To use it, add `dash` to the plugins array in your zshrc file: + +```zsh +plugins=(... dash) +``` + +## Usage + +- Open and switch to the dash application. +``` +dash +``` + +- Query for something in dash app: `dash query` +``` +dash golang +``` + +- You can optionally provide a keyword: `dash [keyword:]query` +``` +dash python:tuple +``` diff --git a/plugins/dash/dash.plugin.zsh b/plugins/dash/dash.plugin.zsh index b00d487..ace2e33 100644 --- a/plugins/dash/dash.plugin.zsh +++ b/plugins/dash/dash.plugin.zsh @@ -35,36 +35,30 @@ _dash() { if [[ "$locator" == "platform" ]]; then # Since these are the only special cases right now, let's not do the # expensive processing unless we have to - if [[ "$keyword" == "python" || "$keyword" == "java" || \ - "$keyword" == "qt" || "$keyword" == "cocs2d" ]]; then + if [[ "$keyword" = (python|java|qt|cocos2d) ]]; then docsetName=`echo $doc | grep -Eo "docsetName = .*?;" | sed -e "s/docsetName = \(.*\);/\1/" -e "s/[\":]//g"` - if [[ "$keyword" == "python" ]]; then - if [[ "$docsetName" == "Python 2" ]]; then - keyword="python2" - elif [[ "$docsetName" == "Python 3" ]]; then - keyword="python3" - fi - elif [[ "$keyword" == "java" ]]; then - if [[ "$docsetName" == "Java SE7" ]]; then - keyword="java7" - elif [[ "$docsetName" == "Java SE6" ]]; then - keyword="java6" - elif [[ "$docsetName" == "Java SE8" ]]; then - keyword="java8" - fi - elif [[ "$keyword" == "qt" ]]; then - if [[ "$docsetName" == "Qt 5" ]]; then - keyword="qt5" - elif [[ "$docsetName" == "Qt 4" ]]; then - keyword="qt4" - elif [[ "$docsetName" == "Qt" ]]; then - keyword="qt4" - fi - elif [[ "$keyword" == "cocos2d" ]]; then - if [[ "$docsetName" == "Cocos3D" ]]; then - keyword="cocos3d" - fi - fi + case "$keyword" in + python) + case "$docsetName" in + "Python 2") keyword="python2" ;; + "Python 3") keyword="python3" ;; + esac ;; + java) + case "$docsetName" in + "Java SE7") keyword="java7" ;; + "Java SE6") keyword="java6" ;; + "Java SE8") keyword="java8" ;; + esac ;; + qt) + case "$docsetName" in + "Qt 5") keyword="qt5" ;; + "Qt 4"|Qt) keyword="qt4" ;; + esac ;; + cocos2d) + case "$docsetName" in + Cocos3D) keyword="cocos3d" ;; + esac ;; + esac fi fi diff --git a/plugins/debian/README.md b/plugins/debian/README.md index a676674..da5675c 100644 --- a/plugins/debian/README.md +++ b/plugins/debian/README.md @@ -1,75 +1,85 @@ # debian -This plugin provides debian related zsh aliases. +This plugin provides Debian-related aliases and functions for zsh. + To use it add `debian` to the plugins array in your zshrc file. ```zsh plugins=(... debian) ``` +## Settings + +- `$apt_pref`: use apt or aptitude if installed, fallback is apt-get. +- `$apt_upgr`: use upgrade or safe-upgrade (for aptitude). + +Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh My Zsh) to override this behavior. + ## Common Aliases -| Alias | Command | Description | -| -------- | ------------------------------------------------------------------------------|--------------------------------------------------------------------------- | -| `age` | apt-get | Command line tool for handling packages | -| `api` | aptitude | Same functionality as `apt-get`, provides extra options while installation | -| `acs` | apt-cache search | Command line tool for searching apt software package cache | -| `aps` | aptitude search | Searches installed packages using aptitude | -| `as` | aptitude -F \"* %p -> %d \n(%v/%V)\" \ -no-gui --disable-columns search | - | -| `afs` | apt-file search --regexp | Search file in packages | -| `asrc` | apt-get source | Fetch source packages through `apt-get` | -| `app` | apt-cache policy | Displays priority of package sources | +| Alias | Command | Description | +| ------ | ---------------------------------------------------------------------- | ---------------------------------------------------------- | +| `age` | `apt-get` | Command line tool for handling packages | +| `api` | `aptitude` | Same functionality as `apt-get`, provides extra options | +| `acs` | `apt-cache search` | Command line tool for searching apt software package cache | +| `aps` | `aptitude search` | Searches installed packages using aptitude | +| `as` | `aptitude -F '* %p -> %d \n(%v/%V)' --no-gui --disable-columns search` | Print searched packages using a custom format | +| `afs` | `apt-file search --regexp` | Search file in packages | +| `asrc` | `apt-get source` | Fetch source packages through `apt-get` | +| `app` | `apt-cache policy` | Displays priority of package sources | ## Superuser Operations Aliases -| Alias | Command | Description | -| -------- | -------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------- | -| `aac` | sudo $apt_pref autoclean | Clears out the local repository of retrieved package files | -| `abd` | sudo $apt_pref build-dep | Installs all dependencies for building packages | -| `ac` | sudo $apt_pref clean | Clears out the local repository of retrieved package files except lock files | -| `ad` | sudo $apt_pref update | Updates the package lists for upgrades for packages | -| `adg` | sudo $apt_pref update && sudo $apt_pref $apt_upgr | Update and upgrade packages | -| `adu` | sudo $apt_pref update && sudo $apt_pref dist-upgrade | Smart upgrade that handles dependencies | -| `afu` | sudo apt-file update | Update the files in packages | -| `au` | sudo $apt_pref $apt_upgr | - | -| `ai` | sudo $apt_pref install | Command-line tool to install package | -| `ail` | sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install | Install all packages given on the command line while using only the first word of each line | -| `ap` | sudo $apt_pref purge | Removes packages along with configuration files | -| `ar` | sudo $apt_pref remove | Removes packages, keeps the configuration files | -| `ads` | sudo apt-get dselect-upgrade | Installs packages from list and removes all not in the list | -| `dia` | sudo dpkg -i ./*.deb | Install all .deb files in the current directory | -| `di` | sudo dpkg -i | Install all .deb files in the current directory | -| `kclean` | sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`)) | Remove ALL kernel images and headers EXCEPT the one in use | - -- `$apt_pref` - Use apt or aptitude if installed, fallback is apt-get. -- `$apt_upgr` - Use upgrade. +| Alias | Command | Description | +| -------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `aac` | `sudo $apt_pref autoclean` | Clears out the local repository of retrieved package files | +| `abd` | `sudo $apt_pref build-dep` | Installs all dependencies for building packages | +| `ac` | `sudo $apt_pref clean` | Clears out the local repository of retrieved package files except lock files | +| `ad` | `sudo $apt_pref update` | Updates the package lists for upgrades for packages | +| `adg` | `sudo $apt_pref update && sudo $apt_pref $apt_upgr` | Update and upgrade packages | +| `adu` | `sudo $apt_pref update && sudo $apt_pref dist-upgrade` | Smart upgrade that handles dependencies | +| `afu` | `sudo apt-file update` | Update the files in packages | +| `au` | `sudo $apt_pref $apt_upgr` | Install package upgrades | +| `ai` | `sudo $apt_pref install` | Command-line tool to install package | +| `ail` | `sed -e 's/ */ /g' -e 's/ *//' \| cut -s -d ' ' -f 1 \| xargs sudo $apt_pref install` | Install all packages given on the command line while using only the first word of each line | +| `ap` | `sudo $apt_pref purge` | Removes packages along with configuration files | +| `ar` | `sudo $apt_pref remove` | Removes packages, keeps the configuration files | +| `ads` | `sudo apt-get dselect-upgrade` | Installs packages from list and removes all not in the list | +| `dia` | `sudo dpkg -i ./*.deb` | Install all .deb files in the current directory | +| `di` | `sudo dpkg -i` | Install all .deb files in the current directory | +| `kclean` | `sudo aptitude remove -P ?and(~i~nlinux-(ima\|hea) ?not(~n$(uname -r)))` | Remove ALL kernel images and headers EXCEPT the one in use | ## Aliases - Commands using `su` -| Alias | Command | -| -------- | ------------------------------------------------------------------------------| -| `aac` | su -ls \'$apt_pref autoclean\' root | -| `ac` | su -ls \'$apt_pref clean\' root | -| `ad` | su -lc \'$apt_pref update\' root | -| `adg` | su -lc \'$apt_pref update && aptitude $apt_upgr\' root | -| `adu` | su -lc \'$apt_pref update && aptitude dist-upgrade\' root | -| `afu` | su -lc "apt-file update | -| `ag` | su -lc \'$apt_pref $apt_upgr\' root | -| `dia` | su -lc "dpkg -i ./*.deb" root | +| Alias | Command | +| ----- | --------------------------------------------------------- | +| `aac` | `su -ls "$apt_pref autoclean" root` | +| `ac` | `su -ls "$apt_pref clean" root` | +| `ad` | `su -lc "$apt_pref update" root` | +| `adg` | `su -lc "$apt_pref update && aptitude $apt_upgr" root` | +| `adu` | `su -lc "$apt_pref update && aptitude dist-upgrade" root` | +| `afu` | `su -lc "apt-file update"` | +| `au` | `su -lc "$apt_pref $apt_upgr" root` | +| `dia` | `su -lc "dpkg -i ./*.deb" root` | ## Miscellaneous Aliases -| Alias | Command | Description | -| -------- | -------------------------------------------------|---------------------------------------- | -| `allpkgs`| aptitude search -F "%p" --disable-columns ~i | Display all installed packages | -| `mydeb` | time dpkg-buildpackage -rfakeroot -us -uc | Create a basic .deb package | +| Alias | Command | Description | +| --------- | ---------------------------------------------- | ------------------------------ | +| `allpkgs` | `aptitude search -F "%p" --disable-columns ~i` | Display all installed packages | +| `mydeb` | `time dpkg-buildpackage -rfakeroot -us -uc` | Create a basic .deb package | ## Functions -| Fucntion | Description | -|-----------------------|-------------------------------------------------------------------------------| -| `apt-copy` | Create a simple script that can be used to 'duplicate' a system | -| `apt-history` | Displays apt history for a command | -| `kerndeb` | Builds kernel packages | -| `apt-list-packages` | List packages by size | +| Function | Description | +| ------------------- | --------------------------------------------------------------- | +| `apt-copy` | Create a simple script that can be used to 'duplicate' a system | +| `apt-history` | Displays apt history for a command | +| `kerndeb` | Builds kernel packages | +| `apt-list-packages` | List packages by size | + +## Authors +- [@AlexBio](https://github.com/AlexBio) +- [@dbb](https://github.com/dbb) +- [@Mappleconfusers](https://github.com/Mappleconfusers) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 654b692..68c6df1 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -1,25 +1,21 @@ -# Authors: -# https://github.com/AlexBio -# https://github.com/dbb -# https://github.com/Mappleconfusers -# -# Debian-related zsh aliases and functions for zsh - # Use apt or aptitude if installed, fallback is apt-get # You can just set apt_pref='apt-get' to override it. -if [[ -e $( which -p apt 2>&1 ) ]]; then - apt_pref='apt' - apt_upgr='upgrade' -elif [[ -e $( which -p aptitude 2>&1 ) ]]; then - apt_pref='aptitude' - apt_upgr='safe-upgrade' -else - apt_pref='apt-get' - apt_upgr='upgrade' + +if [[ -z $apt_pref || -z $apt_upgr ]]; then + if [[ -e $commands[apt] ]]; then + apt_pref='apt' + apt_upgr='upgrade' + elif [[ -e $commands[aptitude] ]]; then + apt_pref='aptitude' + apt_upgr='safe-upgrade' + else + apt_pref='apt-get' + apt_upgr='upgrade' + fi fi # Use sudo by default if it's installed -if [[ -e $( which -p sudo 2>&1 ) ]]; then +if [[ -e $commands[sudo] ]]; then use_sudo=1 fi @@ -32,8 +28,7 @@ alias api='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 +alias as="aptitude -F '* %p -> %d \n(%v/%V)' --no-gui --disable-columns search" # apt-file alias afs='apt-file search --regexp' @@ -46,60 +41,59 @@ 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 $apt_upgr' - alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade' - alias afu='sudo apt-file update' - alias au='sudo $apt_pref $apt_upgr' - alias ai='sudo $apt_pref install' + 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 $apt_upgr" + alias adu="sudo $apt_pref update && sudo $apt_pref dist-upgrade" + alias afu="sudo apt-file update" + alias au="sudo $apt_pref $apt_upgr" + 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' + 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-get dselect-upgrade' + alias ads="sudo apt-get 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' + 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`))' + 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() { + alias aac="su -ls '$apt_pref autoclean' root" + function 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 $apt_upgr\' 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 $apt_upgr\' root' - ai() { + alias ac="su -ls '$apt_pref clean' root" + alias ad="su -lc '$apt_pref update' root" + alias adg="su -lc '$apt_pref update && aptitude $apt_upgr' root" + alias adu="su -lc '$apt_pref update && aptitude dist-upgrade' root" + alias afu="su -lc '$apt-file update'" + alias au="su -lc '$apt_pref $apt_upgr' root" + function ai() { cmd="su -lc 'aptitude -P install $@' root" print "$cmd" eval "$cmd" } - ap() { + function ap() { cmd="su -lc '$apt_pref -P purge $@' root" print "$cmd" eval "$cmd" } - ar() { + function ar() { cmd="su -lc '$apt_pref -P remove $@' root" print "$cmd" eval "$cmd" @@ -111,8 +105,7 @@ else 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' + alias kclean='su -lc "aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n$(uname -r)))" root' fi # Completion ################################################################ @@ -121,16 +114,16 @@ fi # Registers a compdef for $1 that calls $apt_pref with the commands $2 # To do that it creates a new completion function called _apt_pref_$2 # -apt_pref_compdef() { +function apt_pref_compdef() { local f fb f="_apt_pref_${2}" eval "function ${f}() { - shift words; - service=\"\$apt_pref\"; - words=(\"\$apt_pref\" '$2' \$words); - ((CURRENT++)) - test \"\${apt_pref}\" = 'aptitude' && _aptitude || _apt + shift words; + service=\"\$apt_pref\"; + words=(\"\$apt_pref\" '$2' \$words); + ((CURRENT++)) + test \"\${apt_pref}\" = 'aptitude' && _aptitude || _apt }" compdef "$f" "$1" @@ -141,7 +134,7 @@ apt_pref_compdef abd "build-dep" apt_pref_compdef ac "clean" apt_pref_compdef ad "update" apt_pref_compdef afu "update" -apt_pref_compdef ag "$apt_upgr" +apt_pref_compdef au "$apt_upgr" apt_pref_compdef ai "install" apt_pref_compdef ail "install" apt_pref_compdef ap "purge" @@ -158,7 +151,7 @@ alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' # Functions ################################################################# # create a simple script that can be used to 'duplicate' a system -apt-copy() { +function apt-copy() { print '#!/bin/sh'"\n" > apt-copy.sh cmd='$apt_pref install' @@ -180,7 +173,7 @@ apt-copy() { # apt-history rollback # apt-history list # Based On: https://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html -apt-history () { +function apt-history() { case "$1" in install) zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*) @@ -209,11 +202,11 @@ apt-history () { } # Kernel-package building shortcut -kerndeb () { +function 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 ) + appendage='-custom' # this shows up in $(uname -r ) revision=$(date +"%Y%m%d") # this shows up in the .deb file name make-kpkg clean @@ -223,10 +216,9 @@ kerndeb () { } # List packages by size -function apt-list-packages { +function apt-list-packages() { dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | \ grep -v deinstall | \ sort -n | \ awk '{print $1" "$2}' } - diff --git a/plugins/dircycle/README.md b/plugins/dircycle/README.md index 3ac162f..3c9b3a9 100644 --- a/plugins/dircycle/README.md +++ b/plugins/dircycle/README.md @@ -15,10 +15,10 @@ This plugin enables directory navigation similar to using back and forward on br ) ``` -2. Reload the source file or restart your Terminal session: +2. Restart the shell or restart your Terminal session: ```console - $ source ~/.zshrc + $ exec zsh $ ``` diff --git a/plugins/direnv/README.md b/plugins/direnv/README.md new file mode 100644 index 0000000..8deaf38 --- /dev/null +++ b/plugins/direnv/README.md @@ -0,0 +1,15 @@ +# direnv plugin + +This plugin creates the [Direnv](https://direnv.net/) hook. + +To use it, add `direnv` to the plugins array in your zshrc file: + +```zsh +plugins=(... direnv) +``` + +## Requirements + +In order to make this work, you will need to have the direnv installed. + +More info on the usage and install: https://github.com/direnv/direnv diff --git a/plugins/direnv/direnv.plugin.zsh b/plugins/direnv/direnv.plugin.zsh new file mode 100644 index 0000000..5e32c4c --- /dev/null +++ b/plugins/direnv/direnv.plugin.zsh @@ -0,0 +1,16 @@ +# Don't continue if direnv is not found +command -v direnv &>/dev/null || return + +_direnv_hook() { + trap -- '' SIGINT; + eval "$(direnv export zsh)"; + trap - SIGINT; +} +typeset -ag precmd_functions; +if [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then + precmd_functions=( _direnv_hook ${precmd_functions[@]} ) +fi +typeset -ag chpwd_functions; +if [[ -z ${chpwd_functions[(r)_direnv_hook]} ]]; then + chpwd_functions=( _direnv_hook ${chpwd_functions[@]} ) +fi diff --git a/plugins/dirhistory/README.md b/plugins/dirhistory/README.md index 511f2be..2236507 100644 --- a/plugins/dirhistory/README.md +++ b/plugins/dirhistory/README.md @@ -7,6 +7,7 @@ To use it, add `dirhistory` to the plugins array in your zshrc file: ```zsh plugins=(... dirhistory) ``` + ## Keyboard Shortcuts | Shortcut | Description | @@ -15,3 +16,24 @@ plugins=(... dirhistory) | alt + right | Undo alt + left | | alt + up | Move into the parent directory | | alt + down | Move into the first child directory by alphabetical order | + +## Usage + +This plugin allows you to navigate the history of previous current-working-directories using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT. MAC users may alternately use OPT-LEFT and OPT-RIGHT. + +Also, navigate directory **hierarchy** using ALT-UP and ALT-DOWN. (mac keybindings not yet implemented). ALT-UP moves to higher hierarchy (shortcut for 'cd ..'). ALT-DOWN moves into the first directory found in alphabetical order (useful to navigate long empty directories e.g. java packages) + +For example, if the shell was started, and the following commands were entered: + +```shell +cd ~ +cd /usr +cd share +cd doc +``` + +Then entering ALT-LEFT at the prompt would change directory from /usr/share/doc to /usr/share, then if pressed again to /usr/, then ~. If ALT-RIGHT were pressed the directory would be changed to /usr/ again. + +After that, ALT-DOWN will probably go to /usr/bin (depends on your /usr structure), ALT-UP will return to /usr, then ALT-UP will get you to / + +**Currently the max history size is 30**. The navigation should work for xterm, PuTTY xterm mode, GNU screen, and on MAC with alternate keys as mentioned above. diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 239915e..35c43d7 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -53,7 +53,8 @@ function push_future() { } # Called by zsh when directory changes -chpwd_functions+=(chpwd_dirhistory) +autoload -U add-zsh-hook +add-zsh-hook chpwd chpwd_dirhistory function chpwd_dirhistory() { push_past $PWD # If DIRHISTORY_CD is not set... diff --git a/plugins/dirpersist/README.md b/plugins/dirpersist/README.md index 9880bc5..792fb4b 100644 --- a/plugins/dirpersist/README.md +++ b/plugins/dirpersist/README.md @@ -1,6 +1,7 @@ # Dirpersist plugin -This plugin keeps a running tally of the previous 20 unique directories in the $HOME/.zdirs file. When you cd to a new directory, it is prepended to the beginning of the file. +This plugin keeps a running tally of the previous 20 unique directories in the `$HOME/.zdirs` file. +When you cd to a new directory, it is prepended to the beginning of the file. To use it, add `dirpersist` to the plugins array in your zshrc file: diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh index 616e2c3..daadc38 100644 --- a/plugins/dirpersist/dirpersist.plugin.zsh +++ b/plugins/dirpersist/dirpersist.plugin.zsh @@ -11,7 +11,8 @@ if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD fi -chpwd_functions+=(chpwd_dirpersist) +autoload -U add-zsh-hook +add-zsh-hook chpwd chpwd_dirpersist chpwd_dirpersist() { if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi local -ax my_stack diff --git a/plugins/django/README.md b/plugins/django/README.md index 415f6b7..1740e55 100644 --- a/plugins/django/README.md +++ b/plugins/django/README.md @@ -34,23 +34,3 @@ runfcgi -- run this project as a fastcgi runserver -- start a lightweight web server for development ... ``` - -If you want to see the options available for a specific command, try: - -```zsh -$> python manage.py makemessages (press here) -``` - -And that would result in: - -```zsh ---all -a -- re-examine all code and templates ---domain -d -- domain of the message files (default: "django") ---extensions -e -- file extension(s) to examine (default: ".html") ---help -- display help information ---locale -l -- locale to process (default: all) ---pythonpath -- directory to add to the Python path ---settings -- python path to settings module -... -``` - diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh index 29a51d2..c2d00c1 100644 --- a/plugins/django/django.plugin.zsh +++ b/plugins/django/django.plugin.zsh @@ -154,7 +154,7 @@ _managepy-makemessages(){ "--no-default-ignore[Don't ignore the common glob-style patterns 'CVS', '.*', '*~' and '*.pyc'.]" \ "--no-wrap[Don't break long message lines into several lines.]" \ "--no-location[Don't write '#: filename:line' lines.]" \ - '--no-obsolete[emove obsolete message strings.]' \ + '--no-obsolete[Remove obsolete message strings.]' \ '--keep-pot[Keep .pot file after making messages.]' \ $nul_args && ret=0 } @@ -374,7 +374,8 @@ _managepy-commands() { _applist() { local line local -a apps - _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\ + _call_program help-command "python -c \"import sys; del sys.path[0];\\ + import os.path as op, re, django.conf;\\ 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.\\ diff --git a/plugins/dnf/README.md b/plugins/dnf/README.md index f9ef496..dc0d1e0 100644 --- a/plugins/dnf/README.md +++ b/plugins/dnf/README.md @@ -1,10 +1,14 @@ -## Description +# dnf plugin -This plugin makes `dnf` usage easier by adding aliases for the most -common commands. +This plugin makes `dnf` usage easier by adding aliases for the most common commands. -`dnf` is the new package manager for RPM-based distributions, which -replaces `yum`. +`dnf` is the new package manager for RPM-based distributions, which replaces `yum`. + +To use it, add `dnf` to the plugins array in your zshrc file: + +```zsh +plugins=(... dnf) +``` ## Aliases diff --git a/plugins/dnote/README.md b/plugins/dnote/README.md new file mode 100644 index 0000000..e1b9b70 --- /dev/null +++ b/plugins/dnote/README.md @@ -0,0 +1,51 @@ +# Dnote Plugin + +This plugin adds auto-completion for [Dnote](https://dnote.io) project. + +To use it, add `dnote` to the plugins array in your zshrc file: + +```zsh +plugins=(dnote) +``` + +## Usage + +At the basic level, this plugin completes all Dnote commands. + +```zsh +$ dnote a(press here) +``` + +would result in: + +```zsh +$ dnote add +``` + +For some commands, this plugin dynamically suggests matching book names. + +For instance, if you have three books that begin with 'j': 'javascript', 'job', 'js', + +```zsh +$ dnote view j(press here) +``` + +would result in: + +```zsh +$ dnote v j +javascript job js +``` + +As another example, + +```zsh +$ dnote edit ja(press here) +``` + +would result in: + + +```zsh +$ dnote v javascript +`````` diff --git a/plugins/dnote/_dnote b/plugins/dnote/_dnote new file mode 100644 index 0000000..c8b3348 --- /dev/null +++ b/plugins/dnote/_dnote @@ -0,0 +1,39 @@ +#compdef dnote + +local -a _1st_arguments + +_1st_arguments=( + 'add:add a new note' + 'view:list books, notes, or view a content' + 'edit:edit a note or a book' + 'remove:remove a note or a book' + 'find:find notes by keywords' + 'sync:sync data with the server' + 'login:login to the dnote server' + 'logout:logout from the dnote server' + 'version:print the current version' + 'help:get help about any command' +) + +get_booknames() { + local names=$(dnote view --name-only) + local -a ret + + while read -r line; do + ret+=("${line}") + done <<< "$names" + + echo "$ret" +} + +if (( CURRENT == 2 )); then + _describe -t commands "dnote subcommand" _1st_arguments + return +elif (( CURRENT == 3 )); then + case "$words[2]" in + v|view|a|add) + _alternative \ + "names:book names:($(get_booknames))" + esac +fi + diff --git a/plugins/docker-compose/README.md b/plugins/docker-compose/README.md index 07a87bc..1105e03 100644 --- a/plugins/docker-compose/README.md +++ b/plugins/docker-compose/README.md @@ -4,7 +4,8 @@ This plugin provides completion for [docker-compose](https://docs.docker.com/com aliases for frequent docker-compose commands. To use it, add docker-compose to the plugins array of your zshrc file: -``` + +```zsh plugins=(... docker-compose) ``` diff --git a/plugins/docker-compose/_docker-compose b/plugins/docker-compose/_docker-compose index c0a54cc..808b068 100644 --- a/plugins/docker-compose/_docker-compose +++ b/plugins/docker-compose/_docker-compose @@ -23,7 +23,7 @@ __docker-compose_all_services_in_compose_file() { local already_selected local -a services already_selected=$(echo $words | tr " " "|") - __docker-compose_q config --services \ + __docker-compose_q ps --services "$@" \ | grep -Ev "^(${already_selected})$" } @@ -31,125 +31,42 @@ __docker-compose_all_services_in_compose_file() { __docker-compose_services_all() { [[ $PREFIX = -* ]] && return 1 integer ret=1 - services=$(__docker-compose_all_services_in_compose_file) + services=$(__docker-compose_all_services_in_compose_file "$@") _alternative "args:services:($services)" && ret=0 return ret } -# All services that have an entry with the given key in their docker-compose.yml section -__docker-compose_services_with_key() { - local already_selected - local -a buildable - already_selected=$(echo $words | tr " " "|") - # flatten sections to one line, then filter lines containing the key and return section name. - __docker-compose_q config \ - | sed -n -e '/^services:/,/^[^ ]/p' \ - | sed -n 's/^ //p' \ - | awk '/^[a-zA-Z0-9]/{printf "\n"};{printf $0;next;}' \ - | grep " \+$1:" \ - | cut -d: -f1 \ - | grep -Ev "^(${already_selected})$" -} - # All services that are defined by a Dockerfile reference __docker-compose_services_from_build() { [[ $PREFIX = -* ]] && return 1 - integer ret=1 - buildable=$(__docker-compose_services_with_key build) - _alternative "args:buildable services:($buildable)" && ret=0 - - return ret + __docker-compose_services_all --filter source=build } # All services that are defined by an image __docker-compose_services_from_image() { [[ $PREFIX = -* ]] && return 1 - integer ret=1 - pullable=$(__docker-compose_services_with_key image) - _alternative "args:pullable services:($pullable)" && ret=0 - - return ret -} - -__docker-compose_get_services() { - [[ $PREFIX = -* ]] && return 1 - integer ret=1 - local kind - declare -a running paused stopped lines args services - - docker_status=$(docker ps > /dev/null 2>&1) - if [ $? -ne 0 ]; then - _message "Error! Docker is not running." - return 1 - fi - - kind=$1 - shift - [[ $kind =~ (stopped|all) ]] && args=($args -a) - - lines=(${(f)"$(_call_program commands docker $docker_options ps $args)"}) - services=(${(f)"$(_call_program commands docker-compose 2>/dev/null $compose_options ps -q)"}) - - # Parse header line to find columns - local i=1 j=1 k header=${lines[1]} - declare -A begin end - while (( j < ${#header} - 1 )); do - i=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 1 )) - j=$(( i + ${${header[$i,-1]}[(i) ]} - 1 )) - k=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 2 )) - begin[${header[$i,$((j-1))]}]=$i - end[${header[$i,$((j-1))]}]=$k - done - lines=(${lines[2,-1]}) - - # Container ID - local line s name - local -a names - for line in $lines; do - if [[ ${services[@]} == *"${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"* ]]; then - names=(${(ps:,:)${${line[${begin[NAMES]},-1]}%% *}}) - for name in $names; do - s="${${name%_*}#*_}:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}" - s="$s, ${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}" - s="$s, ${${${line[${begin[IMAGE]},${end[IMAGE]}]}/:/\\:}%% ##}" - if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then - stopped=($stopped $s) - else - if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = *\(Paused\)* ]]; then - paused=($paused $s) - fi - running=($running $s) - fi - done - fi - done - - [[ $kind =~ (running|all) ]] && _describe -t services-running "running services" running "$@" && ret=0 - [[ $kind =~ (paused|all) ]] && _describe -t services-paused "paused services" paused "$@" && ret=0 - [[ $kind =~ (stopped|all) ]] && _describe -t services-stopped "stopped services" stopped "$@" && ret=0 - - return ret + __docker-compose_services_all --filter source=image } __docker-compose_pausedservices() { [[ $PREFIX = -* ]] && return 1 - __docker-compose_get_services paused "$@" + __docker-compose_services_all --filter status=paused } __docker-compose_stoppedservices() { [[ $PREFIX = -* ]] && return 1 - __docker-compose_get_services stopped "$@" + __docker-compose_services_all --filter status=stopped } __docker-compose_runningservices() { [[ $PREFIX = -* ]] && return 1 - __docker-compose_get_services running "$@" + __docker-compose_services_all --filter status=running } __docker-compose_services() { [[ $PREFIX = -* ]] && return 1 - __docker-compose_get_services all "$@" + __docker-compose_services_all } __docker-compose_caching_policy() { @@ -196,9 +113,12 @@ __docker-compose_subcommand() { $opts_help \ "*--build-arg=[Set build-time variables for one service.]:=: " \ '--force-rm[Always remove intermediate containers.]' \ - '--memory[Memory limit for the build container.]' \ + '(--quiet -q)'{--quiet,-q}'[Curb build output]' \ + '(--memory -m)'{--memory,-m}'[Memory limit for the build container.]' \ '--no-cache[Do not use cache when building the image.]' \ '--pull[Always attempt to pull a newer version of the image.]' \ + '--compress[Compress the build context using gzip.]' \ + '--parallel[Build images in parallel.]' \ '*:services:__docker-compose_services_from_build' && ret=0 ;; (bundle) @@ -213,7 +133,8 @@ __docker-compose_subcommand() { '(--quiet -q)'{--quiet,-q}"[Only validate the configuration, don't print anything.]" \ '--resolve-image-digests[Pin image tags to digests.]' \ '--services[Print the service names, one per line.]' \ - '--volumes[Print the volume names, one per line.]' && ret=0 + '--volumes[Print the volume names, one per line.]' \ + '--hash[Print the service config hash, one per line. Set "service1,service2" for a list of specified services.]' \ && ret=0 ;; (create) _arguments \ @@ -222,11 +143,12 @@ __docker-compose_subcommand() { $opts_no_recreate \ $opts_no_build \ "(--no-build)--build[Build images before creating containers.]" \ - '*:services:__docker-compose_services_all' && ret=0 + '*:services:__docker-compose_services' && ret=0 ;; (down) _arguments \ $opts_help \ + $opts_timeout \ "--rmi[Remove images. Type must be one of: 'all': Remove all images used by any service. 'local': Remove only images that don't have a custom tag set by the \`image\` field.]:type:(all local)" \ '(-v --volumes)'{-v,--volumes}"[Remove named volumes declared in the \`volumes\` section of the Compose file and anonymous volumes attached to containers.]" \ $opts_remove_orphans && ret=0 @@ -235,16 +157,18 @@ __docker-compose_subcommand() { _arguments \ $opts_help \ '--json[Output events as a stream of json objects]' \ - '*:services:__docker-compose_services_all' && ret=0 + '*:services:__docker-compose_services' && ret=0 ;; (exec) _arguments \ $opts_help \ '-d[Detached mode: Run command in the background.]' \ '--privileged[Give extended privileges to the process.]' \ - '(-u --user)'{-u,--user=}'[Run the command as this user.]:username:_users' \ + '(-u --user)'{-u,--user=}'[Run the command as this user.]:username:_users' \ '-T[Disable pseudo-tty allocation. By default `docker-compose exec` allocates a TTY.]' \ '--index=[Index of the container if there are multiple instances of a service \[default: 1\]]:index: ' \ + '*'{-e,--env}'[KEY=VAL Set an environment variable (can be used multiple times)]:environment variable KEY=VAL: ' \ + '(-w --workdir)'{-w,--workdir=}'[Working directory inside the container]:workdir: ' \ '(-):running services:__docker-compose_runningservices' \ '(-):command: _command_names -e' \ '*::arguments: _normal' && ret=0 @@ -252,12 +176,12 @@ __docker-compose_subcommand() { (help) _arguments ':subcommand:__docker-compose_commands' && ret=0 ;; - (images) - _arguments \ - $opts_help \ - '-q[Only display IDs]' \ - '*:services:__docker-compose_services_all' && ret=0 - ;; + (images) + _arguments \ + $opts_help \ + '-q[Only display IDs]' \ + '*:services:__docker-compose_services' && ret=0 + ;; (kill) _arguments \ $opts_help \ @@ -271,7 +195,7 @@ __docker-compose_subcommand() { $opts_no_color \ '--tail=[Number of lines to show from the end of the logs for each container.]:number of lines: ' \ '(-t --timestamps)'{-t,--timestamps}'[Show timestamps]' \ - '*:services:__docker-compose_services_all' && ret=0 + '*:services:__docker-compose_services' && ret=0 ;; (pause) _arguments \ @@ -290,12 +214,16 @@ __docker-compose_subcommand() { _arguments \ $opts_help \ '-q[Only display IDs]' \ - '*:services:__docker-compose_services_all' && ret=0 + '--filter KEY=VAL[Filter services by a property]:=:' \ + '*:services:__docker-compose_services' && ret=0 ;; (pull) _arguments \ $opts_help \ '--ignore-pull-failures[Pull what it can and ignores images with pull failures.]' \ + '--no-parallel[Disable parallel pulling]' \ + '(-q --quiet)'{-q,--quiet}'[Pull without printing progress information]' \ + '--include-deps[Also pull services declared as dependencies]' \ '*:services:__docker-compose_services_from_image' && ret=0 ;; (push) @@ -317,6 +245,7 @@ __docker-compose_subcommand() { $opts_no_deps \ '-d[Detached mode: Run container in the background, print new container name.]' \ '*-e[KEY=VAL Set an environment variable (can be used multiple times)]:environment variable KEY=VAL: ' \ + '*'{-l,--label}'[KEY=VAL Add or override a label (can be used multiple times)]:label KEY=VAL: ' \ '--entrypoint[Overwrite the entrypoint of the image.]:entry point: ' \ '--name=[Assign a name to the container]:name: ' \ '(-p --publish)'{-p,--publish=}"[Publish a container's port(s) to the host]" \ @@ -326,6 +255,7 @@ __docker-compose_subcommand() { '(-u --user)'{-u,--user=}'[Run as specified username or uid]:username or uid:_users' \ '(-v --volume)*'{-v,--volume=}'[Bind mount a volume]:volume: ' \ '(-w --workdir)'{-w,--workdir=}'[Working directory inside the container]:workdir: ' \ + "--use-aliases[Use the services network aliases in the network(s) the container connects to]" \ '(-):services:__docker-compose_services' \ '(-):command: _command_names -e' \ '*::arguments: _normal' && ret=0 @@ -369,8 +299,10 @@ __docker-compose_subcommand() { "(--no-build)--build[Build images before starting containers.]" \ "(-d)--abort-on-container-exit[Stops all containers if any container was stopped. Incompatible with -d.]" \ '(-t --timeout)'{-t,--timeout}"[Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)]:seconds: " \ + '--scale[SERVICE=NUM Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.]:service scale SERVICE=NUM: ' \ + '--exit-code-from=[Return the exit code of the selected service container. Implies --abort-on-container-exit]:service:__docker-compose_services' \ $opts_remove_orphans \ - '*:services:__docker-compose_services_all' && ret=0 + '*:services:__docker-compose_services' && ret=0 ;; (version) _arguments \ @@ -409,8 +341,11 @@ _docker-compose() { '(- :)'{-h,--help}'[Get help]' \ '*'{-f,--file}"[${file_description}]:file:_files -g '*.yml'" \ '(-p --project-name)'{-p,--project-name}'[Specify an alternate project name (default: directory name)]:project name:' \ - '--verbose[Show more output]' \ + "--compatibility[If set, Compose will attempt to convert keys in v3 files to their non-Swarm equivalent]" \ '(- :)'{-v,--version}'[Print version and exit]' \ + '--verbose[Show more output]' \ + '--log-level=[Set log level]:level:(DEBUG INFO WARNING ERROR CRITICAL)' \ + '--no-ansi[Do not print ANSI control characters]' \ '(-H --host)'{-H,--host}'[Daemon socket to connect to]:host:' \ '--tls[Use TLS; implied by --tlsverify]' \ '--tlscacert=[Trust certs signed only by this CA]:ca path:' \ @@ -421,7 +356,7 @@ _docker-compose() { '(-): :->command' \ '(-)*:: :->option-or-argument' && ret=0 - local -a relevant_compose_flags relevant_docker_flags compose_options docker_options + local -a relevant_compose_flags relevant_compose_repeatable_flags relevant_docker_flags compose_options docker_options relevant_compose_flags=( "--file" "-f" @@ -435,6 +370,10 @@ _docker-compose() { "--skip-hostname-check" ) + relevant_compose_repeatable_flags=( + "--file" "-f" + ) + relevant_docker_flags=( "--host" "-H" "--tls" @@ -452,9 +391,18 @@ _docker-compose() { fi fi if [[ -n "${relevant_compose_flags[(r)$k]}" ]]; then - compose_options+=$k - if [[ -n "$opt_args[$k]" ]]; then - compose_options+=$opt_args[$k] + if [[ -n "${relevant_compose_repeatable_flags[(r)$k]}" ]]; then + values=("${(@s/:/)opt_args[$k]}") + for value in $values + do + compose_options+=$k + compose_options+=$value + done + else + compose_options+=$k + if [[ -n "$opt_args[$k]" ]]; then + compose_options+=$opt_args[$k] + fi fi fi done diff --git a/plugins/docker/README.md b/plugins/docker/README.md index e917984..241a6a4 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -1,5 +1,12 @@ -## Docker autocomplete plugin +# Docker plugin -A copy of the completion script from the -[docker/cli](https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker) -git repo. +This plugin adds auto-completion for [docker](https://www.docker.com/). + +To use it add `docker` to the plugins array in your zshrc file. + +```zsh +plugins=(... docker) +``` + +A copy of the completion script from the docker/cli git repo: +https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker diff --git a/plugins/docker/_docker b/plugins/docker/_docker index 54b5e59..10c19e2 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -9,6 +9,7 @@ # - Felix Riedel # - Steve Durrheimer # - Vincent Bernat +# - Rohan Verma # # license: # @@ -604,6 +605,7 @@ __docker_container_subcommand() { "($help)*--blkio-weight-device=[Block IO (relative device weight)]:device:Block IO weight: " "($help)*--cap-add=[Add Linux capabilities]:capability: " "($help)*--cap-drop=[Drop Linux capabilities]:capability: " + "($help)--cgroupns=[Cgroup namespace mode to use]:cgroup namespace mode: " "($help)--cgroup-parent=[Parent cgroup for the container]:cgroup: " "($help)--cidfile=[Write the container ID to the file]:CID file:_files" "($help)--cpus=[Number of CPUs (default 0.000)]:cpus: " @@ -676,6 +678,7 @@ __docker_container_subcommand() { "($help -m --memory)"{-m=,--memory=}"[Memory limit]:Memory limit: " "($help)--memory-reservation=[Memory soft limit]:Memory limit: " "($help)--memory-swap=[Total memory limit with swap]:Memory limit: " + "($help)--pids-limit[Tune container pids limit (set -1 for unlimited)]" "($help)--restart=[Restart policy]:restart policy:(no on-failure always unless-stopped)" ) opts_help=("(: -)--help[Print usage]") @@ -801,7 +804,7 @@ __docker_container_subcommand() { "($help -l --latest)"{-l,--latest}"[Show only the latest created container]" \ "($help -n --last)"{-n=,--last=}"[Show n last created containers (includes all states)]:n:(1 5 10 25 50)" \ "($help)--no-trunc[Do not truncate output]" \ - "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \ + "($help -q --quiet)"{-q,--quiet}"[Only show container IDs]" \ "($help -s --size)"{-s,--size}"[Display total file sizes]" \ "($help)--since=[Show only containers created since...]:containers:__docker_complete_containers" && ret=0 ;; @@ -832,7 +835,7 @@ __docker_container_subcommand() { _arguments $(__docker_arguments) \ $opts_help \ "($help -t --time)"{-t=,--time=}"[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)" \ - "($help -)*:containers:__docker_complete_containers_ids" && ret=0 + "($help -)*:containers:__docker_complete_containers" && ret=0 ;; (rm) local state @@ -1024,7 +1027,7 @@ __docker_image_subcommand() { $opts_help \ "($help -H --human)"{-H,--human}"[Print sizes and dates in human readable format]" \ "($help)--no-trunc[Do not truncate output]" \ - "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \ + "($help -q --quiet)"{-q,--quiet}"[Only show image IDs]" \ "($help -)*: :__docker_complete_images" && ret=0 ;; (import) @@ -1056,7 +1059,7 @@ __docker_image_subcommand() { "($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_images_filters" \ "($help)--format=[Pretty-print images using a Go template]:template: " \ "($help)--no-trunc[Do not truncate output]" \ - "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \ + "($help -q --quiet)"{-q,--quiet}"[Only show image IDs]" \ "($help -): :__docker_complete_repositories" && ret=0 ;; (prune) @@ -1076,6 +1079,7 @@ __docker_image_subcommand() { (push) _arguments $(__docker_arguments) \ $opts_help \ + "($help -a --all-tags)"{-a,--all-tags}"[Push all tagged images in the repository]" \ "($help)--disable-content-trust[Skip image signing]" \ "($help -): :__docker_complete_images" && ret=0 ;; @@ -1286,7 +1290,7 @@ __docker_network_subcommand() { "($help)--no-trunc[Do not truncate the output]" \ "($help)*"{-f=,--filter=}"[Provide filter values]:filter:__docker_network_complete_ls_filters" \ "($help)--format=[Pretty-print networks using a Go template]:template: " \ - "($help -q --quiet)"{-q,--quiet}"[Only display numeric IDs]" && ret=0 + "($help -q --quiet)"{-q,--quiet}"[Only display network IDs]" && ret=0 ;; (prune) _arguments $(__docker_arguments) \ @@ -2214,7 +2218,6 @@ __docker_stack_subcommand() { (deploy|up) _arguments $(__docker_arguments) \ $opts_help \ - "($help)--bundle-file=[Path to a Distributed Application Bundle file]:dab:_files -g \"*.dab\"" \ "($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file, or '-' to read from stdin]:compose file:_files -g \"*.(yml|yaml)\"" \ "($help)--with-registry-auth[Send registry authentication details to Swarm agents]" \ "($help -):stack:__docker_complete_stacks" && ret=0 @@ -2668,6 +2671,7 @@ __docker_subcommand() { "($help)*--log-opt=[Default log driver options for containers]:log driver options:__docker_complete_log_options" \ "($help)--max-concurrent-downloads[Set the max concurrent downloads for each pull]" \ "($help)--max-concurrent-uploads[Set the max concurrent uploads for each push]" \ + "($help)--max-download-attempts[Set the max download attempts for each pull]" \ "($help)--mtu=[Network MTU]:mtu:(0 576 1420 1500 9000)" \ "($help)--oom-score-adjust=[Set the oom_score_adj for the daemon]:oom-score:(-500)" \ "($help -p --pidfile)"{-p=,--pidfile=}"[Path to use for daemon PID file]:PID file:_files" \ @@ -2783,7 +2787,7 @@ __docker_subcommand() { $opts_help \ "($help -p --password)"{-p=,--password=}"[Password]:password: " \ "($help)--password-stdin[Read password from stdin]" \ - "($help -u --user)"{-u=,--user=}"[Username]:username: " \ + "($help -u --username)"{-u=,--username=}"[Username]:username: " \ "($help -)1:server: " && ret=0 ;; (logout) diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md index e880e9d..f661247 100644 --- a/plugins/dotenv/README.md +++ b/plugins/dotenv/README.md @@ -4,9 +4,7 @@ Automatically load your project ENV variables from `.env` file when you `cd` int Storing configuration in the environment is one of the tenets of a [twelve-factor app](https://www.12factor.net). Anything that is likely to change between deployment environments, such as resource handles for databases or credentials for external services, should be extracted from the code into environment variables. -## Installation - -Just add the plugin to your `.zshrc`: +To use it, add `dotenv` to the plugins array in your zshrc file: ```sh plugins=(... dotenv) @@ -17,21 +15,63 @@ plugins=(... dotenv) Create `.env` file inside your project root directory and put your ENV variables there. For example: + ```sh export AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a export SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f export MONGO_URI=mongodb://127.0.0.1:27017 export PORT=3001 ``` + `export` is optional. This format works as well: + ```sh AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f MONGO_URI=mongodb://127.0.0.1:27017 PORT=3001 ``` + You can even mix both formats, although it's probably a bad idea. +## Settings + +### ZSH_DOTENV_FILE + +You can also modify the name of the file to be loaded with the variable `ZSH_DOTENV_FILE`. +If the variable isn't set, the plugin will default to use `.env`. +For example, this will make the plugin look for files named `.dotenv` and load them: + +```zsh +# in ~/.zshrc, before Oh My Zsh is sourced: +ZSH_DOTENV_FILE=.dotenv +``` + +### ZSH_DOTENV_PROMPT + +Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmation message. +You can also choose the `Always` option when prompted to always allow sourcing the .env file +in that directory. See the next section for more details. + +### ZSH_DOTENV_ALLOWED_LIST + +The default behavior of the plugin is to always ask whether to source a dotenv file. There's +a **Y**es, **N**o, and **A**lways option. If you choose Always, the directory of the .env file +will be added to an allowed list. If a directory is found in this list, the plugin won't ask +for confirmation and will instead source the .env file directly. + +This allowed list is saved by default in `$ZSH_CACHE_DIR/dotenv-allowed.list`. If you want +to change that location, change the `$ZSH_DOTENV_ALLOWED_LIST` variable, like so: + +```zsh +# in ~/.zshrc, before Oh My Zsh is sourced: +ZSH_DOTENV_ALLOWED_LIST=/path/to/dotenv/allowed/list +``` + +This file is just a list of directories allowed, separated by a newline character. If you want +to disallow a directory, just edit this file and remove the line for the directory you want to +disallow. + ## Version Control **It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only. @@ -41,5 +81,6 @@ You can even mix both formats, although it's probably a bad idea. This plugin only sources the `.env` file. Nothing less, nothing more. It doesn't do any checks. It's designed to be the fastest and simplest option. You're responsible for the `.env` file content. You can put some code (or weird symbols) there, but do it on your own risk. `dotenv` is the basic tool, yet it does the job. If you need more advanced and feature-rich ENV management, check out these awesome projects: + * [direnv](https://github.com/direnv/direnv) * [zsh-autoenv](https://github.com/Tarrasch/zsh-autoenv) diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index b701b55..ac3210d 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -1,15 +1,42 @@ +## Settings + +# Filename of the dotenv file to look for +: ${ZSH_DOTENV_FILE:=.env} + +# Path to the file containing allowed paths +: ${ZSH_DOTENV_ALLOWED_LIST:="${ZSH_CACHE_DIR:-$ZSH/cache}/dotenv-allowed.list"} + + +## Functions + source_env() { - if [[ -f .env ]]; then - # test .env syntax - zsh -fn .env || echo 'dotenv: error when sourcing `.env` file' >&2 - - if [[ -o a ]]; then - source .env - else - set -a - source .env - set +a + if [[ -f $ZSH_DOTENV_FILE ]]; then + if [[ "$ZSH_DOTENV_PROMPT" != false ]]; then + local confirmation dirpath="${PWD:A}" + + # make sure there is an allowed file + touch "$ZSH_DOTENV_ALLOWED_LIST" + + # check if current directory's .env file is allowed or ask for confirmation + if ! grep -q "$dirpath" "$ZSH_DOTENV_ALLOWED_LIST" &>/dev/null; then + # print same-line prompt and output newline character if necessary + echo -n "dotenv: found '$ZSH_DOTENV_FILE' file. Source it? ([Y]es/[n]o/[a]lways) " + read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo + + # check input + case "$confirmation" in + [nN]) return ;; + [aA]) echo "$dirpath" >> "$ZSH_DOTENV_ALLOWED_LIST" ;; + *) ;; # interpret anything else as a yes + esac + fi fi + + # test .env syntax + zsh -fn $ZSH_DOTENV_FILE || echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2 + + setopt localoptions allexport + source $ZSH_DOTENV_FILE fi } diff --git a/plugins/dotnet/README.md b/plugins/dotnet/README.md new file mode 100644 index 0000000..7554b4e --- /dev/null +++ b/plugins/dotnet/README.md @@ -0,0 +1,23 @@ +# .NET Core CLI plugin + +This plugin provides completion and useful aliases for [.NET Core CLI](https://dotnet.microsoft.com/). + +To use it, add `dotnet` to the plugins array in your zshrc file. + +``` +plugins=(... dotnet) +``` + +## Aliases + +| Alias | Command | Description | +|-------|------------------|-------------------------------------------------------------------| +| dn | dotnet new | Create a new .NET project or file. | +| dr | dotnet run | Build and run a .NET project output. | +| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. | +| dw | dotnet watch | Watch for source file changes and restart the dotnet command. | +| dwr | dotnet watch run | Watch for source file changes and restart the `run` command. | +| ds | dotnet sln | Modify Visual Studio solution files. | +| da | dotnet add | Add a package or reference to a .NET project. | +| dp | dotnet pack | Create a NuGet package. | +| dng | dotnet nuget | Provides additional NuGet commands. | diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh new file mode 100644 index 0000000..6bd4b7a --- /dev/null +++ b/plugins/dotnet/dotnet.plugin.zsh @@ -0,0 +1,32 @@ +# This scripts is copied from (MIT License): +# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh + +_dotnet_zsh_complete() +{ + local completions=("$(dotnet complete "$words")") + + # If the completion list is empty, just continue with filename selection + if [ -z "$completions" ] + then + _arguments '*::arguments: _normal' + return + fi + + # This is not a variable assigment, don't remove spaces! + _values = "${(ps:\n:)completions}" +} + +compdef _dotnet_zsh_complete dotnet + +# Aliases bellow are here for backwards compatibility +# added by Shaun Tabone (https://github.com/xontab) + +alias dn='dotnet new' +alias dr='dotnet run' +alias dt='dotnet test' +alias dw='dotnet watch' +alias dwr='dotnet watch run' +alias ds='dotnet sln' +alias da='dotnet add' +alias dp='dotnet pack' +alias dng='dotnet nuget' diff --git a/plugins/drush/README.md b/plugins/drush/README.md new file mode 100644 index 0000000..df7b82b --- /dev/null +++ b/plugins/drush/README.md @@ -0,0 +1,83 @@ +# Drush + +## Description +This plugin offers aliases and functions to make the work with drush easier and more productive. + +To enable it, add the `drush` to your `plugins` array in `~/.zshrc`: + +``` +plugins=(... drush) +``` + +## Aliases +| Alias | Description | Command | +|-------|-----------------------------------------------------------------------|-----------------------------| +| dr | Display drush help | drush | +| drca | Clear all drupal caches. | drush cc all | +| drcb | Clear block cache. | drush cc block | +| drcg | Clear registry cache. | drush cc registry | +| drcj | Clear css-js cache. | drush cc css-js | +| drcm | Clear menu cache. | drush cc menu | +| drcml | Clear module-list cache. | drush cc module-list | +| drcr | Run all cron hooks in all active modules for specified site. | drush core-cron | +| drct | Clear theme-registry cache. | drush cc theme-registry | +| drcv | Clear views cache. (Make sure that the views module is enabled) | drush cc views | +| drdmp | Backup database in a new dump.sql file | drush drush sql-dump --ordered-dump --result-file=dump.sql| +| drf | Display features status | drush features | +| drfr | Revert a feature module on your site. | drush features-revert -y | +| drfu | Update a feature module on your site. | drush features-update -y | +| drfra | Revert all enabled feature module on your site. | drush features-revert-all | +| drif | Flush all derived images. | drush image-flush --all | +| drpm | Show a list of available modules. | drush pm-list --type=module | +| drst | Provides a birds-eye view of the current Drupal installation, if any. | drush core-status | +| drup | Apply any database updates required (as with running update.php). | drush updatedb | +| drups | List any pending database updates. | drush updatedb-status | +| drv | Show drush version. | drush version | +| drvd | Delete a variable. | drush variable-del | +| drvg | Get a list of some or all site variables and values. | drush variable-get | +| drvs | Set a variable. | drush variable-set | + +## Functions + +### dren +Download and enable one or more extensions (modules or themes). +Must be invoked with one or more parameters. e.g.: +`dren devel` or `dren devel module_filter views` + +### drf +Edit drushrc, site alias, and Drupal settings.php files. +Can be invoked with one or without parameters. e.g.: +`drf 1` + +### dris +Disable one or more extensions (modules or themes) +Must be invoked with one or more parameters. e.g.: +`dris devel` or `dris devel module_filter views` + +### drpu +Uninstall one or more modules. +Must be invoked with one or more parameters. e.g.: +`drpu devel` or `drpu devel module_filter views` + +### drnew +Creates a brand new drupal website. +Note: As soon as the installation is complete, drush will print a username and a random password into the terminal: +``` +Installation complete. User name: admin User password: cf7t8yqNEm +``` + +## Additional features + +### Autocomplete +The [completion script for drush](https://github.com/drush-ops/drush/blob/8.0.1/drush.complete.sh) comes enabled with this plugin. +So, it is possible to type a command: +``` +drush sql +``` + +And as soon as the tab key is pressed, the script will display the available commands: +``` +drush sql +sqlc sql-conf sql-create sql-dump sql-query sql-sanitize +sql-cli sql-connect sql-drop sqlq sqlsan sql-sync +``` diff --git a/plugins/drush/drush.complete.sh b/plugins/drush/drush.complete.sh new file mode 100644 index 0000000..38b882e --- /dev/null +++ b/plugins/drush/drush.complete.sh @@ -0,0 +1,50 @@ +# BASH completion script for Drush. +# +# Place this in your /etc/bash_completion.d/ directory or source it from your +# ~/.bash_completion or ~/.bash_profile files. Alternatively, source +# examples/example.bashrc instead, as it will automatically find and source +# this file. +# +# If you're using ZSH instead of BASH, add the following to your ~/.zshrc file +# and source it. +# +# autoload bashcompinit +# bashcompinit +# source /path/to/your/drush.complete.sh + +# Ensure drush is available. +which drush > /dev/null || alias drush &> /dev/null || return + +__drush_ps1() { + f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$" + if [ -f $f ] + then + __DRUPAL_SITE=$(cat "$f") + else + __DRUPAL_SITE="$DRUPAL_SITE" + fi + + # Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a + # __drush_ps1_colorize_alias() function for color hints in your Drush PS1 + # prompt. See example.prompt.sh for an example implementation. + if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then + __drush_ps1_colorize_alias + fi + + [[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE" +} + +# Completion function, uses the "drush complete" command to retrieve +# completions for a specific command line COMP_WORDS. +_drush_completion() { + # Set IFS to newline (locally), since we only use newline separators, and + # need to retain spaces (or not) after completions. + local IFS=$'\n' + # The '< /dev/null' is a work around for a bug in php libedit stdin handling. + # Note that libedit in place of libreadline in some distributions. See: + # https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214 + COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) ) +} + +# Register our completion function. We include common short aliases for Drush. +complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush7 drush8 drush.php diff --git a/plugins/drush/drush.plugin.zsh b/plugins/drush/drush.plugin.zsh new file mode 100644 index 0000000..8a20d79 --- /dev/null +++ b/plugins/drush/drush.plugin.zsh @@ -0,0 +1,104 @@ +# Drush support. + +function dren() { + drush en $@ -y +} + +function dris() { + drush pm-disable $@ -y +} + +function drpu() { + drush pm-uninstall $@ -y +} + +function drf() { + if [[ $1 == "" ]] then + drush core-config + else + drush core-config --choice=$1 + fi +} + +function drfi() { + if [[ $1 == "fields" ]]; then + drush field-info fields + elif [[ $1 == "types" ]]; then + drush field-info types + else + drush field-info + fi +} + +function drnew() { + + cd ~ + echo "Website's name: " + read WEBSITE_NAME + + HOST=http://$(hostname -i)/ + + if [[ $WEBSITE_NAME == "" ]] then + MINUTES=$(date +%M:%S) + WEBSITE_NAME="Drupal-$MINUTES" + echo "Your website will be named: $WEBSITE_NAME" + fi + + drush dl drupal --drupal-project-rename=$WEBSITE_NAME + + echo "Type your localhost directory: (Leave empty for /var/www/html/)" + read DIRECTORY + + if [[ $DIRECTORY == "" ]] then + DIRECTORY="/var/www/html/" + fi + + echo "Moving to $DIRECTORY$WEBSITE_NAME" + sudo mv $WEBSITE_NAME $DIRECTORY + cd $DIRECTORY$WEBSITE_NAME + + echo "Database's user: " + read DATABASE_USR + echo "Database's password: " + read -s DATABASE_PWD + echo "Database's name for your project: " + read DATABASE + + DB_URL="mysql://$DATABASE_USR:$DATABASE_PWD@localhost/$DATABASE" + drush site-install standard --db-url=$DB_URL --site-name=$WEBSITE_NAME + + open_command $HOST$WEBSITE_NAME + echo "Done" + +} + +# Aliases, sorted alphabetically. +alias dr="drush" +alias drca="drush cc all" # Deprecated for Drush 8 +alias drcb="drush cc block" # Deprecated for Drush 8 +alias drcg="drush cc registry" # Deprecated for Drush 8 +alias drcj="drush cc css-js" +alias drcm="drush cc menu" +alias drcml="drush cc module-list" +alias drcr="drush core-cron" +alias drct="drush cc theme-registry" +alias drcv="drush cc views" +alias drdmp="drush sql-dump --ordered-dump --result-file=dump.sql" +alias drf="drush features" +alias drfr="drush features-revert -y" +alias drfu="drush features-update -y" +alias drfra="drush features-revert-all" +alias drif="drush image-flush --all" +alias drpm="drush pm-list --type=module" +alias drst="drush core-status" +alias drup="drush updatedb" +alias drups="drush updatedb-status" +alias drv="drush version" +alias drvd="drush variable-del" +alias drvg="drush variable-get" +alias drvs="drush variable-set" + +# Enable drush autocomplete support +autoload bashcompinit +bashcompinit +source $(dirname $0)/drush.complete.sh diff --git a/plugins/eecms/README.md b/plugins/eecms/README.md new file mode 100644 index 0000000..c538355 --- /dev/null +++ b/plugins/eecms/README.md @@ -0,0 +1,11 @@ +# eecms plugin + +This plugin adds auto-completion of console commands for [`eecms`](https://github.com/ExpressionEngine/ExpressionEngine). + +To use it, add `eecms` to the plugins array of your `.zshrc` file: +``` +plugins=(... eecms) +``` + +It also adds the alias `eecms` which finds the eecms file in the current project +and runs it with php. diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 26b28d4..0aa8d6f 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -20,7 +20,8 @@ _emacsfun() # tempfile. (first argument will be `--no-wait` passed in by the plugin.zsh) if [ "$#" -ge "2" -a "$2" = "-" ] then - tempfile="$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)" + tempfile="$(mktemp --tmpdir emacs-stdin-$USER.XXXXXXX 2>/dev/null \ + || mktemp -t emacs-stdin-$USER)" # support BSD mktemp cat - > "$tempfile" _emacsfun --no-wait $tempfile else diff --git a/plugins/emoji-clock/emoji-clock.plugin.zsh b/plugins/emoji-clock/emoji-clock.plugin.zsh index 0a55528..bdd606f 100644 --- a/plugins/emoji-clock/emoji-clock.plugin.zsh +++ b/plugins/emoji-clock/emoji-clock.plugin.zsh @@ -2,7 +2,7 @@ # FILE: emoji-clock.plugin.zsh # DESCRIPTION: The current time with half hour accuracy as an emoji symbol. # Inspired by Andre Torrez' "Put A Burger In Your Shell" -# http://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html +# https://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html # AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net) # VERSION: 1.0.0 # ----------------------------------------------------------------------------- diff --git a/plugins/emotty/README.md b/plugins/emotty/README.md new file mode 100644 index 0000000..ee57170 --- /dev/null +++ b/plugins/emotty/README.md @@ -0,0 +1,39 @@ +# emotty plugin + +This plugin returns an emoji for the current $TTY number so it can be used +in a prompt. + +To use it, add emotty to the plugins array in your zshrc file: +``` +plugins=(... emotty) +``` + +**NOTE:** it requires the [emoji plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/emoji). + +## Usage + +The function `emotty` displays an emoji from the current character set (default: `emoji`), based +on the number associated to the `$TTY`. + +There are different sets of emoji characters available, to choose a different +set, set `$emotty_set` to the name of the set you would like to use, e.g.: +``` +emotty_set=nature +``` + +### Character Sets + +- emoji +- loral +- love +- nature +- stellar +- zodiac + +Use the `display_emotty` function to list the emojis in the current character set, or +the character set passed as the first argument. For example: + +``` +$ display_emotty zodiac + +``` diff --git a/plugins/emotty/emotty.plugin.zsh b/plugins/emotty/emotty.plugin.zsh index b0d24c3..e288b5c 100644 --- a/plugins/emotty/emotty.plugin.zsh +++ b/plugins/emotty/emotty.plugin.zsh @@ -25,8 +25,14 @@ emotty_default_set=emoji function emotty() { # Use emotty set defined by user, fallback to default local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]} - # Parse $TTY number, normalizing it to an emotty set index - (( tty = (${TTY##/dev/tty} % ${#${=emotty}}) + 1 )) + + # Parse tty number via prompt expansion. %l equals: + # - N if tty = /dev/ttyN + # - pts/N if tty = /dev/pts/N + local tty = ${${(%):-%l}##pts/} + # Normalize it to an emotty set index + (( tty = (tty % ${#${=emotty}}) + 1 )) + local character_name=${${=emotty}[tty]} echo "${emoji[${character_name}]}${emoji2[emoji_style]}" } diff --git a/plugins/encode64/README.md b/plugins/encode64/README.md index 9850da8..a83a3d3 100644 --- a/plugins/encode64/README.md +++ b/plugins/encode64/README.md @@ -1,6 +1,12 @@ # encode64 -Alias plugin for encoding or decoding using `base64` command +Alias plugin for encoding or decoding using `base64` command. + +To use it, add `encode64` to the plugins array in your zshrc file: + +```zsh +plugins=(... encode64) +``` ## Functions and Aliases @@ -9,23 +15,6 @@ Alias plugin for encoding or decoding using `base64` command | `encode64` | `e64` | Encodes given data to base64 | | `decode64` | `d64` | Decodes given data from base64 | -## Enabling plugin - -1. Edit your `.zshrc` file and add `encode64` to the list of plugins: - - ```sh - plugins=( - # ...other enabled plugins - encode64 - ) - ``` - -2. Restart your terminal session or reload configuration by running: - - ```sh - source ~/.zshrc - ``` - ## Usage and examples ### Encoding diff --git a/plugins/extract/README.md b/plugins/extract/README.md index 83b878c..81e8e1d 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -25,23 +25,32 @@ plugins=(... extract) | `gz` | Gzip file | | `ipsw` | iOS firmware file | | `jar` | Java Archive | +| `lrz` | LRZ archive | +| `lz4` | LZ4 archive | | `lzma` | LZMA archive | | `rar` | WinRAR archive | +| `rpm` | RPM package | | `sublime-package` | Sublime Text package | | `tar` | Tarball | | `tar.bz2` | Tarball with bzip2 compression | | `tar.gz` | Tarball with gzip compression | +| `tar.lrz` | Tarball with lrzip compression | +| `tar.lz` | Tarball with lzip compression | +| `tar.lz4` | Tarball with lz4 compression | | `tar.xz` | Tarball with lzma2 compression | | `tar.zma` | Tarball with lzma compression | +| `tar.zst` | Tarball with zstd compression | | `tbz` | Tarball with bzip compression | | `tbz2` | Tarball with bzip2 compression | | `tgz` | Tarball with gzip compression | | `tlz` | Tarball with lzma compression | | `txz` | Tarball with lzma2 compression | +| `tzst` | Tarball with zstd compression | | `war` | Web Application archive (Java-based) | | `xpi` | Mozilla XPI module file | | `xz` | LZMA2 archive | | `zip` | Zip archive | +| `zst` | Zstandard file (zstd) | See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for more information regarding archive formats. diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 33d49fc..1a263a7 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 5e9b9ff..a5594b8 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -40,14 +40,24 @@ extract() { tar --lzma --help &> /dev/null \ && tar --lzma -xvf "$1" \ || lzcat "$1" | tar xvf - ;; + (*.tar.zst|*.tzst) + tar --zstd --help &> /dev/null \ + && tar --zstd -xvf "$1" \ + || zstdcat "$1" | tar xvf - ;; (*.tar) tar xvf "$1" ;; - (*.gz) (( $+commands[pigz] )) && pigz -d "$1" || gunzip "$1" ;; + (*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;; + (*.tar.lz4) lz4 -c -d "$1" | tar xvf - ;; + (*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;; + (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;; (*.bz2) bunzip2 "$1" ;; (*.xz) unxz "$1" ;; + (*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;; + (*.lz4) lz4 -d "$1" ;; (*.lzma) unlzma "$1" ;; (*.z) uncompress "$1" ;; (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; + (*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;; (*.7z) 7za x "$1" ;; (*.deb) mkdir -p "$extract_dir/control" @@ -58,6 +68,7 @@ extract() { cd ..; rm *.tar.* debian-binary cd .. ;; + (*.zst) unzstd "$1" ;; (*) echo "extract: '$1' cannot be extracted" >&2 success=1 diff --git a/plugins/fabric/README.md b/plugins/fabric/README.md index cf0fa81..f121d2e 100644 --- a/plugins/fabric/README.md +++ b/plugins/fabric/README.md @@ -4,6 +4,6 @@ This plugin provides completion for [Fabric](https://www.fabfile.org/). To use it add fabric to the plugins array in your zshrc file. -```bash +```zsh plugins=(... fabric) ``` diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 9628e12..9102dad 100644 --- a/plugins/fabric/_fab +++ b/plugins/fabric/_fab @@ -4,10 +4,19 @@ local curcontext=$curcontext state line declare -A opt_args -declare target_list -target_list=(`fab --shortlist 2>/dev/null`) +declare -a target_list +target_list=("${(@f)$(fab -l 2>/dev/null | awk '{ + if (NF == 0 || NR == 1) next + if (NF < 2) print $1 + else { + docstring=substr($0, index($0,$2)) + gsub(":", "\\:", docstring) + print $1":"docstring + } +}')}") -_targets() { +_fab_targets() { + [[ -n "$target_list" ]] || return _describe -t commands "fabric targets" target_list } @@ -28,7 +37,7 @@ _arguments -w -S -C \ '(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \ '(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \ '(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \ - "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \ + "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_fab_targets" \ '(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \ '(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \ '(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \ @@ -53,7 +62,7 @@ if [[ CURRENT -ge 1 ]]; then levels) _describe -t commands "output levels" output_levels;; *) - _targets;; + _fab_targets;; esac return diff --git a/plugins/fancy-ctrl-z/README.md b/plugins/fancy-ctrl-z/README.md index a7670fa..f1b1dfa 100644 --- a/plugins/fancy-ctrl-z/README.md +++ b/plugins/fancy-ctrl-z/README.md @@ -1,10 +1,10 @@ # Use Ctrl-Z to switch back to Vim -I frequently need to execute random command in my shell. To achieve it I pause +I frequently need to execute random commands in my shell. To achieve it I pause Vim by pressing Ctrl-z, type command and press fg to switch back to Vim. -The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back +The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back to Vim. I could not find a solution, so I developed one on my own that -works wonderfully with ZSH +works wonderfully with ZSH. Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/ diff --git a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh index 8ab2979..82b9688 100644 --- a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh +++ b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh @@ -1,10 +1,10 @@ fancy-ctrl-z () { if [[ $#BUFFER -eq 0 ]]; then BUFFER="fg" - zle accept-line + zle accept-line -w else - zle push-input - zle clear-screen + zle push-input -w + zle clear-screen -w fi } zle -N fancy-ctrl-z diff --git a/plugins/fasd/README.md b/plugins/fasd/README.md new file mode 100644 index 0000000..a5c74e5 --- /dev/null +++ b/plugins/fasd/README.md @@ -0,0 +1,21 @@ +# fasd + +[`Fasd`](https://github.com/clvv/fasd) (pronounced similar to "fast") is a command-line productivity booster. Fasd offers quick access to files and directories for POSIX shells. + +To use it, add `fasd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fasd) +``` + +## Installation + +Please find detailed installation guide [`here`](https://github.com/clvv/fasd#install) + +## Aliases + +| Alias | Command | Description | +|-------|-------------------------------------------|-------------------------------------------------------------| +| v | `fasd -f -e "$EDITOR"` | List frequent/recent files matching the given filename. | +| o | `fasd -a -e xdg-open` | List frequent/recent files and directories matching. | +| j | `fasd_cd -d -i` | cd with interactive selection | diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh index 36a0428..6538d09 100644 --- a/plugins/fasd/fasd.plugin.zsh +++ b/plugins/fasd/fasd.plugin.zsh @@ -1,12 +1,16 @@ -if [ $commands[fasd] ]; then # check if fasd is installed - fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache" - if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then - fasd --init auto >| "$fasd_cache" - fi - source "$fasd_cache" - unset fasd_cache +# check if fasd is installed +if (( ! ${+commands[fasd]} )); then + return +fi - alias v="f -e \"$EDITOR\"" - alias o='a -e xdg-open' - alias j='zz' +fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache" +if [[ "$commands[fasd]" -nt "$fasd_cache" || ! -s "$fasd_cache" ]]; then + fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \ + zsh-wcomp zsh-wcomp-install >| "$fasd_cache" fi +source "$fasd_cache" +unset fasd_cache + +alias v='f -e "$EDITOR"' +alias o='a -e xdg-open' +alias j='zz' diff --git a/plugins/fastfile/README.md b/plugins/fastfile/README.md new file mode 100644 index 0000000..37f5b2f --- /dev/null +++ b/plugins/fastfile/README.md @@ -0,0 +1,84 @@ +# Fastfile plugin + +This plugin adds a way to reference certain files or folders used frequently using +a global alias or shortcut. + +To use it, add `fastfile` to the plugins array in your zshrc file: +```zsh +plugins=(... fastfile) +``` + +## Usage + +Example: you access folder `/code/project/backend/database` very frequently. + +First, generate a shortcut with the name `pjdb`: +```zsh +$ fastfile pjdb /code/project/backend/database +``` + +Next time you want to access it, use `§pjdb`. For example: +```zsh +$ cd §pjdb +$ subl §pjdb +``` +where § is the fastfile prefix (see [below](#options) for how to change). + +**Note:** shortcuts with spaces in the name are assigned a global alias +where the spaces have been substituted with underscores (`_`). For example: +a shortcut named `"hello world"` corresponds with `§hello_world`. + + +## Functions + +- `fastfile `: generate a shortcut. + +- `fastfile_print `: prints a shortcut, with the format + ` -> `. + +- `fastfile_ls`: lists all shortcuts. + +- `fastfile_rm `: remove a shortcut. + +- `fastfile_sync`: generates the global aliases for the shortcuts. + + +### Internal functions + +- `fastfile_resolv `: resolves the location of the shortcut + file, i.e., the file in the fastfile directory where the shortcut path + is stored. + +- `fastfile_get `: get the real path of the shortcut. + + +## Aliases + +| Alias | Function | +|--------|------------------| +| ff | `fastfile` | +| ffp | `fastfile_print` | +| ffrm | `fastfile_rm` | +| ffls | `fastfile_ls` | +| ffsync | `fastfile_sync` | + + +## Options + +These are options you can set to change certain parts of the plugin. To change +them, add `=` to your zshrc file, before Oh My Zsh is sourced. +For example: `fastfile_var_prefix='@'`. + +- `fastfile_var_prefix`: prefix for the global aliases created. Controls the prefix of the + created global aliases. + **Default:** `§` (section sign), easy to type in a german keyboard via the combination + [`⇧ Shift`+`3`](https://en.wikipedia.org/wiki/German_keyboard_layout#/media/File:KB_Germany.svg), + or using `⌥ Option`+`6` in macOS. + +- `fastfile_dir`: directory where the fastfile shortcuts are stored. Needs to end + with a trailing slash. + **Default:** `$HOME/.fastfile/`. + +## Author + +- [Karolin Varner](https://github.com/koraa) diff --git a/plugins/fastfile/fastfile.plugin.zsh b/plugins/fastfile/fastfile.plugin.zsh index 775e948..ccbbce3 100644 --- a/plugins/fastfile/fastfile.plugin.zsh +++ b/plugins/fastfile/fastfile.plugin.zsh @@ -1,21 +1,11 @@ -################################################################################ -# FILE: fastfile.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Michael Varner (musikmichael@web.de) -# VERSION: 1.0.0 -# -# This plugin adds the ability to on the fly generate and access file shortcuts. -# -################################################################################ - ########################### -# Settings +# Settings # These can be overwritten any time. # If they are not set yet, they will be # overwritten with their default values -default fastfile_dir "${HOME}/.fastfile/" +default fastfile_dir "${HOME}/.fastfile" default fastfile_var_prefix "§" ########################### @@ -33,7 +23,7 @@ default fastfile_var_prefix "§" function fastfile() { test "$2" || 2="." file=$(readlink -f "$2") - + test "$1" || 1="$(basename "$file")" name=$(echo "$1" | tr " " "_") @@ -51,7 +41,7 @@ function fastfile() { # Arguments: # 1. name - The name of the shortcut # STDOUT: -# The path +# The path to the shortcut file # function fastfile_resolv() { echo "${fastfile_dir}${1}" @@ -88,12 +78,12 @@ function fastfile_print() { # (=> fastfle_print) for each shortcut # function fastfile_ls() { - for f in "${fastfile_dir}"/*; do - file=`basename "$f"` # To enable simpler handeling of spaces in file names - varkey=`echo "$file" | tr " " "_"` + for f in "${fastfile_dir}"/*(NF); do + file=`basename "$f"` # To enable simpler handeling of spaces in file names + varkey=`echo "$file" | tr " " "_"` - # Special format for colums - echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")" + # Special format for colums + echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")" done | column -t -s "|" } @@ -102,7 +92,6 @@ function fastfile_ls() { # # Arguments: # 1. name - The name of the shortcut (default: name of the file) -# 2. file - The file or directory to make the shortcut for # STDOUT: # => fastfle_print # @@ -115,11 +104,11 @@ function fastfile_rm() { # Generate the aliases for the shortcuts # function fastfile_sync() { - for f in "${fastfile_dir}"/*; do - file=`basename "$f"` # To enable simpler handeling of spaces in file names - varkey=`echo "$file" | tr " " "_"` + for f in "${fastfile_dir}"/*(NF); do + file=`basename "$f"` # To enable simpler handeling of spaces in file names + varkey=`echo "$file" | tr " " "_"` - alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'" + alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'" done } @@ -133,6 +122,6 @@ alias ffls=fastfile_ls alias ffsync=fastfile_sync ################################## -# Init +# Init -fastfile_sync \ No newline at end of file +fastfile_sync diff --git a/plugins/fbterm/README.md b/plugins/fbterm/README.md new file mode 100644 index 0000000..70ce56d --- /dev/null +++ b/plugins/fbterm/README.md @@ -0,0 +1,10 @@ +# fbterm + +This plugin automatically starts [fbterm](https://github.com/zhangyuanwei/fbterm) +if on a real TTY (`/dev/tty*`). + +To use it, add `fbterm` to the plugins array of your zshrc file: + +```zsh +plugins=(... fbterm) +``` diff --git a/plugins/fd/README.md b/plugins/fd/README.md new file mode 100644 index 0000000..aabd624 --- /dev/null +++ b/plugins/fd/README.md @@ -0,0 +1,13 @@ +# fd + +This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`. + +To use it, add `fd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fd) +``` + +Completion is taken from the fd release [`7.3.0`](https://github.com/sharkdp/fd/releases/tag/v7.3.0). + +Updated on Febrary 13th, 2019. diff --git a/plugins/fd/_fd b/plugins/fd/_fd new file mode 100644 index 0000000..7a4c387 --- /dev/null +++ b/plugins/fd/_fd @@ -0,0 +1,83 @@ +#compdef fd fdfind + +autoload -U is-at-least + +_fd() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" \ +'-d+[Set maximum search depth (default: none)]' \ +'--max-depth=[Set maximum search depth (default: none)]' \ +'--maxdepth=[See --max-depth]' \ +'*-t+[Filter by type: file (f), directory (d), symlink (l), +executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \ +'*--type=[Filter by type: file (f), directory (d), symlink (l), +executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \ +'*-e+[Filter by file extension]' \ +'*--extension=[Filter by file extension]' \ +'-x+[Execute a command for each search result]' \ +'--exec=[Execute a command for each search result]' \ +'(-x --exec)-X+[Execute a command with all search results at once]' \ +'(-x --exec)--exec-batch=[Execute a command with all search results at once]' \ +'*-E+[Exclude entries that match the given glob pattern]' \ +'*--exclude=[Exclude entries that match the given glob pattern]' \ +'*--ignore-file=[Add a custom ignore-file in .gitignore format]' \ +'-c+[When to use colors: never, *auto*, always]: :(never auto always)' \ +'--color=[When to use colors: never, *auto*, always]: :(never auto always)' \ +'-j+[Set number of threads to use for searching & executing]' \ +'--threads=[Set number of threads to use for searching & executing]' \ +'*-S+[Limit results based on the size of files.]' \ +'*--size=[Limit results based on the size of files.]' \ +'--max-buffer-time=[the time (in ms) to buffer, before streaming to the console]' \ +'--changed-within=[Filter by file modification time (newer than)]' \ +'--changed-before=[Filter by file modification time (older than)]' \ +'*--search-path=[(hidden)]' \ +'-H[Search hidden files and directories]' \ +'--hidden[Search hidden files and directories]' \ +'-I[Do not respect .(git|fd)ignore files]' \ +'--no-ignore[Do not respect .(git|fd)ignore files]' \ +'--no-ignore-vcs[Do not respect .gitignore files]' \ +'*-u[Alias for no-ignore and/or hidden]' \ +'-s[Case-sensitive search (default: smart case)]' \ +'--case-sensitive[Case-sensitive search (default: smart case)]' \ +'-i[Case-insensitive search (default: smart case)]' \ +'--ignore-case[Case-insensitive search (default: smart case)]' \ +'-F[Treat the pattern as a literal string]' \ +'--fixed-strings[Treat the pattern as a literal string]' \ +'-a[Show absolute instead of relative paths]' \ +'--absolute-path[Show absolute instead of relative paths]' \ +'-L[Follow symbolic links]' \ +'--follow[Follow symbolic links]' \ +'-p[Search full path (default: file-/dirname only)]' \ +'--full-path[Search full path (default: file-/dirname only)]' \ +'-0[Separate results by the null character]' \ +'--print0[Separate results by the null character]' \ +'--show-errors[Enable display of filesystem errors]' \ +'-h[Prints help information]' \ +'--help[Prints help information]' \ +'-V[Prints version information]' \ +'--version[Prints version information]' \ +'::pattern -- the search pattern, a regular expression (optional):_files' \ +'::path -- the root directory for the filesystem search (optional):_files' \ +&& ret=0 + +} + +(( $+functions[_fd_commands] )) || +_fd_commands() { + local commands; commands=( + + ) + _describe -t commands 'fd commands' commands "$@" +} + +_fd "$@" diff --git a/plugins/fedora/README.md b/plugins/fedora/README.md index 6594799..85d8d7d 100644 --- a/plugins/fedora/README.md +++ b/plugins/fedora/README.md @@ -1 +1 @@ -The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dnf) instead. +The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dnf) instead. diff --git a/plugins/fedora/fedora.plugin.zsh b/plugins/fedora/fedora.plugin.zsh deleted file mode 120000 index 16a2143..0000000 --- a/plugins/fedora/fedora.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -../dnf/dnf.plugin.zsh \ No newline at end of file diff --git a/plugins/fedora/fedora.plugin.zsh b/plugins/fedora/fedora.plugin.zsh new file mode 100644 index 0000000..226506c --- /dev/null +++ b/plugins/fedora/fedora.plugin.zsh @@ -0,0 +1,3 @@ +print -P "%F{yellow}The 'fedora' plugin is deprecated. Use the '%Udnf%u' plugin instead.%f" + +source "$ZSH/plugins/dnf/dnf.plugin.zsh" diff --git a/plugins/firewalld/readme.md b/plugins/firewalld/README.md similarity index 100% rename from plugins/firewalld/readme.md rename to plugins/firewalld/README.md diff --git a/plugins/flutter/README.md b/plugins/flutter/README.md new file mode 100644 index 0000000..be41914 --- /dev/null +++ b/plugins/flutter/README.md @@ -0,0 +1,21 @@ +## Flutter plugin + +The Flutter plugin provides completion and useful aliases + +To use it, add flutter to the plugins array of your zshrc file: + +``` +plugins=(... flutter) +``` + +## Aliases + +| Alias | Command | Description | +| :--------- | :--------------------- | :------------------------------------------------------------------------- | +| `fl` | `flutter` | Shorthand for flutter command | +| `flr` | `flutter run` | Runs flutter app | +| `fldoc` | `flutter doctor` | Runs flutter doctor | +| `flb` | `flutter build` | Build flutter application | +| `flattach` | `flutter attach` | Attaches flutter to a running flutter application with enabled observatory | +| `flget` | `flutter packages get` | Installs dependencies | +| `flc` | `flutter clean` | Cleans flutter porject | diff --git a/plugins/flutter/_flutter b/plugins/flutter/_flutter new file mode 100644 index 0000000..ab6ce42 --- /dev/null +++ b/plugins/flutter/_flutter @@ -0,0 +1,37 @@ +#compdef flutter +#autoload + +local -a _1st_arguments +_1st_arguments=( + "analyze":"Analyze the project's Dart code." + "assemble":"Assemble and build flutter resources." + "attach":"Attach to a running application." + "build":"Flutter build commands." + "channel":"List or switch flutter channels." + "clean":"Delete the build/ and .dart_tool/ directories." + "config":"Configure Flutter settings." + "create":"Create a new Flutter project." + "devices":"List all connected devices." + "doctor":"Show information about the installed tooling." + "drive":"Runs Flutter Driver tests for the current project." + "emulators":"List, launch and create emulators." + "format":" Format one or more dart files." + "help":"Display help information for flutter." + "install":"Install a Flutter app on an attached device." + "logs":"Show log output for running Flutter apps." + "make-host-app-editable":"Moves host apps from generated directories to non-generated directories so that they can be edited by developers." + "precache":"Populates the Flutter tool's cache of binary artifacts." + "pub":"Commands for managing Flutter packages." + "run":"Run your Flutter app on an attached device." + "screenshot":"Take a screenshot from a connected device." + "test":"Run Flutter unit tests for the current project." + "upgrade":"Upgrade your copy of Flutter." + "version":"List or switch flutter versions." +) + +_arguments -C '*:: :->subcmds' + +if (( CURRENT == 1 )); then + _describe -t commands "flutter command" _1st_arguments + return +fi diff --git a/plugins/flutter/flutter.plugin.zsh b/plugins/flutter/flutter.plugin.zsh new file mode 100644 index 0000000..01c4c9f --- /dev/null +++ b/plugins/flutter/flutter.plugin.zsh @@ -0,0 +1,7 @@ +alias fl="flutter" +alias flr="flutter run" +alias fldoc="flutter doctor" +alias flb="flutter build" +alias flattach="flutter attach" +alias flget="flutter packages get" +alias flc="flutter clean" diff --git a/plugins/forklift/README.md b/plugins/forklift/README.md index 6c4ce1e..7dfd8bf 100644 --- a/plugins/forklift/README.md +++ b/plugins/forklift/README.md @@ -1,15 +1,23 @@ -## forklift +# forklift Plugin for ForkLift, an FTP application for OS X. -### Requirements +To use it, add `forklift` to the plugins array in your zshrc file: + +```zsh +plugins=(... forklift) +``` + +## Requirements * [ForkLift](https://binarynights.com/) -### Usage +## Usage -fl [*file_or_folder*] +`fl []` * If `fl` is called without arguments then the current folder is opened in ForkLift. This is equivalent to `fl .`. -* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift. If called with a non-directory file as the argument, then the file's parent directory is opened. +* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift + +* If `fl` is called with a non-directory file as the argument, then the file's parent directory is opened. diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh index 274c4a8..8588948 100644 --- a/plugins/forklift/forklift.plugin.zsh +++ b/plugins/forklift/forklift.plugin.zsh @@ -1,6 +1,7 @@ # Open folder in ForkLift.app or ForkLift2.app from console # Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de # Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving +# Updated to support ForkLift from Setapp by Paul Rudkin # # Usage: # fl [] @@ -24,6 +25,13 @@ function fl { fi osascript 2>&1 1>/dev/null < Searches for your frontend web development made easier - -## Installation ## +## Installation Open your `~/.zshrc` file and enable the `frontend-search` plugin: @@ -13,53 +12,64 @@ plugins=( ... frontend-search) ``` - -## Usage ## +## Usage You can use the frontend-search plugin in these two forms: -* `frontend [more terms if you want]` -* ` [more terms if you want]` +- `frontend [more terms if you want]` +- ` [more terms if you want]` For example, these two are equivalent: ```zsh -$ frontend angularjs dependency injection -$ angularjs dependency injection +$ angular dependency injection +# Will turn into ... +$ frontend angular dependency injection ``` Available search contexts are: -| context | URL | -|---------------|--------------------------------------------------------------------------| -| angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` | -| aurajs | `http://aurajs.com/api/#stq=` | -| bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` | -| bootsnipp | `https://bootsnipp.com/search?q=` | -| caniuse | `https://caniuse.com/#search=` | -| codepen | `https://codepen.io/search?q=` | -| compassdoc | `http://compass-style.org/search?q=` | -| cssflow | `http://www.cssflow.com/search?q=` | -| dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` | -| emberjs | `https://emberjs.com/api/#stp=1&stq=` | -| fontello | `http://fontello.com/#search=` | -| html5please | `http://html5please.com/#` | -| jquery | `https://api.jquery.com/?s=` | -| lodash | `https://devdocs.io/lodash/index#` | -| mdn | `https://developer.mozilla.org/search?q=` | -| npmjs | `https://www.npmjs.com/search?q=` | -| qunit | `https://api.qunitjs.com/?s=` | -| reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` | -| smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` | -| stackoverflow | `https://stackoverflow.com/search?q=` | -| unheap | `http://www.unheap.com/?s=` | +| context | URL | +| ------------- | --------------------------------------------------------------------------- | +| angular | `https://angular.io/?search=` | +| angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` | +| bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` | +| bootsnipp | `https://bootsnipp.com/search?q=` | +| bundlephobia | `https://bundlephobia.com/result?p=` | +| caniuse | `https://caniuse.com/#search=` | +| codepen | `https://codepen.io/search?q=` | +| compassdoc | `http://compass-style.org/search?q=` | +| cssflow | `http://www.cssflow.com/search?q=` | +| dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` | +| emberjs | `https://www.google.com/search?as_sitesearch=emberjs.com/&as_q=` | +| flowtype | `https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q=` | +| fontello | `http://fontello.com/#search=` | +| github | `https://github.com/search?q=` | +| html5please | `https://html5please.com/#` | +| jestjs | `https://www.google.com/search?as_sitesearch=jestjs.io&as_q=` | +| jquery | `https://api.jquery.com/?s=` | +| lodash | `https://devdocs.io/lodash/index#` | +| mdn | `https://developer.mozilla.org/search?q=` | +| nodejs | `https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q=` | +| npmjs | `https://www.npmjs.com/search?q=` | +| packagephobia | `https://packagephobia.now.sh/result?p=` | +| qunit | `https://api.qunitjs.com/?s=` | +| reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` | +| smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` | +| stackoverflow | `https://stackoverflow.com/search?q=` | +| typescript | `https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q=` | +| unheap | `http://www.unheap.com/?s=` | +| vuejs | `https://www.google.com/search?as_sitesearch=vuejs.org&as_q=` | If you want to have another context, open an Issue and tell us! +## Fallback search behaviour + +The plugin will use Google as a fallback if the docs site for a search context does not have a search function. You can set the fallback search engine to DuckDuckGo by setting `FRONTEND_SEARCH_FALLBACK='duckduckgo'` in your `~/.zshrc` file before Oh My Zsh is sourced. ## Author **Wilson Mendes (willmendesneto)** -+ -+ -+ + +- +- diff --git a/plugins/frontend-search/_frontend-search.sh b/plugins/frontend-search/_frontend-search.sh index 9aad76f..15f8d23 100644 --- a/plugins/frontend-search/_frontend-search.sh +++ b/plugins/frontend-search/_frontend-search.sh @@ -17,27 +17,35 @@ function _frontend() { frontend_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" ) commands=( - 'jquery: Search in jQuery website' - 'mdn: Search in MDN website' - 'compassdoc: Search in COMPASS website' - 'html5please: Search in HTML5 Please website' + 'angular: Search in Angular.io website' + 'angularjs: Search in docs.angularjs.org website' + 'bem: Search in BEM website' + 'bootsnipp: Search in bootsnipp website' + 'bundlephobia: Search in Bundlephobia website' 'caniuse: Search in Can I Use website' - 'aurajs: Search in AuraJs website' + 'codepen: Search in codepen website' + 'compassdoc: Search in COMPASS website' + 'cssflow: Search in cssflow website' 'dartlang: Search in Dart website' + 'emberjs: Search in Ember website' + 'flowtype: Search in Flowtype website' + 'fontello: Search in fontello website' + 'github: Search in GitHub website' + 'html5please: Search in HTML5 Please website' + 'jestjs: Search in Jest website' + 'jquery: Search in jQuery website' 'lodash: Search in Lo-Dash website' + 'mdn: Search in MDN website' + 'nodejs: Search in NodeJS website' + 'npmjs: Search in NPMJS website' + 'packagephobia: Search in Packagephobia website' 'qunit: Search in Qunit website' - 'fontello: Search in fontello website' - 'bootsnipp: Search in bootsnipp website' - 'cssflow: Search in cssflow website' - 'codepen: Search in codepen website' - 'unheap: Search in unheap website' - 'bem: Search in BEM website' - 'smacss: Search in SMACSS website' - 'angularjs: Search in Angular website' 'reactjs: Search in React website' - 'emberjs: Search in Ember website' + 'smacss: Search in SMACSS website' 'stackoverflow: Search in StackOverflow website' - 'npmjs: Search in NPMJS website' + 'typescript: Search in TypeScript website' + 'unheap: Search in unheap website' + 'vuejs: Search in VueJS website' ) _arguments -C \ @@ -66,9 +74,6 @@ function _frontend() { caniuse) _describe -t points "Warp points" frontend_points && ret=0 ;; - aurajs) - _describe -t points "Warp points" frontend_points && ret=0 - ;; dartlang) _describe -t points "Warp points" frontend_points && ret=0 ;; @@ -81,6 +86,9 @@ function _frontend() { fontello) _describe -t points "Warp points" frontend_points && ret=0 ;; + github) + _describe -t points "Warp points" frontend_points && ret=0 + ;; bootsnipp) _describe -t points "Warp points" frontend_points && ret=0 ;; @@ -114,6 +122,27 @@ function _frontend() { npmjs) _describe -t points "Warp points" frontend_points && ret=0 ;; + bundlephobia) + _describe -t points "Warp points" frontend_points && ret=0 + ;; + packagephobia) + _describe -t points "Warp points" frontend_points && ret=0 + ;; + flowtype) + _describe -t points "Warp points" frontend_points && ret=0 + ;; + typescript) + _describe -t points "Warp points" frontend_points && ret=0 + ;; + vuejs) + _describe -t points "Warp points" frontend_points && ret=0 + ;; + nodejs) + _describe -t points "Warp points" frontend_points && ret=0 + ;; + jestjs) + _describe -t points "Warp points" frontend_points && ret=0 + ;; esac ;; esac diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh index 14877fb..4517e21 100644 --- a/plugins/frontend-search/frontend-search.plugin.zsh +++ b/plugins/frontend-search/frontend-search.plugin.zsh @@ -1,24 +1,43 @@ +alias angular='frontend angular' alias angularjs='frontend angularjs' -alias aurajs='frontend aurajs' alias bem='frontend bem' alias bootsnipp='frontend bootsnipp' +alias bundlephobia='frontend bundlephobia' alias caniuse='frontend caniuse' alias codepen='frontend codepen' alias compassdoc='frontend compassdoc' alias cssflow='frontend cssflow' alias dartlang='frontend dartlang' alias emberjs='frontend emberjs' +alias flowtype='frontend flowtype' alias fontello='frontend fontello' +alias github='frontend github' alias html5please='frontend html5please' +alias jestjs='frontend jestjs' alias jquery='frontend jquery' alias lodash='frontend lodash' alias mdn='frontend mdn' +alias nodejs='frontend nodejs' alias npmjs='frontend npmjs' +alias packagephobia='frontend packagephobia' alias qunit='frontend qunit' alias reactjs='frontend reactjs' alias smacss='frontend smacss' alias stackoverflow='frontend stackoverflow' +alias typescript='frontend typescript' alias unheap='frontend unheap' +alias vuejs='frontend vuejs' + +function _frontend_fallback() { + local url + if [[ "$FRONTEND_SEARCH_FALLBACK" == duckduckgo ]]; then + url="https://duckduckgo.com/?sites=$1&q=" + else + url="https://google.com/search?as_sitesearch=$1&as_q=" + fi + + echo "$url" +} function frontend() { emulate -L zsh @@ -26,27 +45,35 @@ function frontend() { # define search context URLS typeset -A urls urls=( - angularjs 'https://google.com/search?as_sitesearch=angularjs.org&as_q=' - aurajs 'http://aurajs.com/api/#stq=' - bem 'https://google.com/search?as_sitesearch=bem.info&as_q=' + angular 'https://angular.io/?search=' + angularjs $(_frontend_fallback 'angularjs.org') + bem $(_frontend_fallback 'bem.info') bootsnipp 'https://bootsnipp.com/search?q=' + bundlephobia 'https://bundlephobia.com/result?p=' caniuse 'https://caniuse.com/#search=' codepen 'https://codepen.io/search?q=' compassdoc 'http://compass-style.org/search?q=' cssflow 'http://www.cssflow.com/search?q=' dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:' - emberjs 'https://emberjs.com/api/#stp=1&stq=' + emberjs $(_frontend_fallback 'emberjs.com/') + flowtype $(_frontend_fallback 'flow.org/en/docs/') fontello 'http://fontello.com/#search=' - html5please 'http://html5please.com/#' + github 'https://github.com/search?q=' + html5please 'https://html5please.com/#' + jestjs $(_frontend_fallback 'jestjs.io') jquery 'https://api.jquery.com/?s=' lodash 'https://devdocs.io/lodash/index#' mdn 'https://developer.mozilla.org/search?q=' + nodejs $(_frontend_fallback 'nodejs.org/en/docs/') npmjs 'https://www.npmjs.com/search?q=' + packagephobia 'https://packagephobia.now.sh/result?p=' qunit 'https://api.qunitjs.com/?s=' - reactjs 'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=' - smacss 'https://google.com/search?as_sitesearch=smacss.com&as_q=' + reactjs $(_frontend_fallback 'reactjs.org/') + smacss $(_frontend_fallback 'smacss.com') stackoverflow 'https://stackoverflow.com/search?q=' + typescript $(_frontend_fallback 'www.typescriptlang.org/docs') unheap 'http://www.unheap.com/?s=' + vuejs $(_frontend_fallback 'vuejs.org') ) # show help for command list @@ -57,9 +84,9 @@ function frontend() { print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website," print -P "and %Ucontext%u is one of the following:" print -P "" - print -P " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow," - print -P " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs," - print -P " qunit, reactjs, smacss, stackoverflow, unheap" + print -P " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, packagephobia" + print -P " dartlang, emberjs, fontello, flowtype, github, html5please, jestjs, jquery, lodash," + print -P " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia" print -P "" print -P "For example: frontend npmjs mocha (or just: npmjs mocha)." print -P "" @@ -73,17 +100,17 @@ function frontend() { echo "" echo "Valid contexts are:" echo "" - echo " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, " - echo " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs, " - echo " qunit, reactjs, smacss, stackoverflow, unheap" + echo " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, packagephobia" + echo " dartlang, emberjs, fontello, github, html5please, jest, jquery, lodash," + echo " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia" echo "" return 1 fi # build search url: - # join arguments passed with '+', then append to search context URL + # join arguments passed with '%20', then append to search context URL # TODO substitute for proper urlencode method - url="${urls[$1]}${(j:+:)@[2,-1]}" + url="${urls[$1]}${(j:%20:)@[2,-1]}" echo "Opening $url ..." diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 27e2d92..53bdcbc 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -1,57 +1,100 @@ -test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}" - -if [[ -z "${fzf_base}" ]]; then - fzfdirs=( - "${HOME}/.fzf" - "/usr/local/opt/fzf" - "/usr/share/fzf" - ) - for dir in ${fzfdirs}; do - if [[ -d "${dir}" ]]; then - fzf_base="${dir}" - break - fi - done - - if [[ -z "${fzf_base}" ]]; then - if (( ${+commands[brew]} )) && dir="$(brew --prefix fzf 2>/dev/null)"; then - if [[ -d "${dir}" ]]; then - fzf_base="${dir}" - fi - fi - fi -fi - -if [[ -n "${fzf_base}" ]]; then - - # Fix fzf shell directory for Archlinux package - if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then - fzf_shell="${fzf_base}" - else - fzf_shell="${fzf_base}/shell" - fi - - # Setup fzf - # --------- - if ! (( ${+commands[fzf]} )) && [[ ! "$PATH" == *$fzf_base/bin* ]]; then - export PATH="$PATH:$fzf_base/bin" - fi - - # Auto-completion - # --------------- - if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then - [[ $- == *i* ]] && source "${fzf_shell}/completion.zsh" 2> /dev/null - fi - - # Key bindings - # ------------ - if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then - source "${fzf_shell}/key-bindings.zsh" - fi - -else - print "[oh-my-zsh] fzf plugin: Cannot find fzf installation directory.\n"\ - "Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2 -fi - -unset fzf_base fzf_shell dir fzfdirs +function setup_using_base_dir() { + # Declare all variables local not no mess with outside env in any way + local fzf_base + local fzf_shell + local fzfdirs + local dir + + test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}" + + if [[ -z "${fzf_base}" ]]; then + fzfdirs=( + "${HOME}/.fzf" + "${HOME}/.nix-profile/share/fzf" + "/usr/local/opt/fzf" + "/usr/share/fzf" + "/usr/local/share/examples/fzf" + ) + for dir in ${fzfdirs}; do + if [[ -d "${dir}" ]]; then + fzf_base="${dir}" + break + fi + done + + if [[ -z "${fzf_base}" ]]; then + if (( ${+commands[brew]} )) && dir="$(brew --prefix fzf 2>/dev/null)"; then + if [[ -d "${dir}" ]]; then + fzf_base="${dir}" + fi + fi + fi + fi + + if [[ -d "${fzf_base}" ]]; then + # Fix fzf shell directory for Arch Linux, NixOS or Void Linux packages + if [[ ! -d "${fzf_base}/shell" ]]; then + fzf_shell="${fzf_base}" + else + fzf_shell="${fzf_base}/shell" + fi + + # Setup fzf binary path + if ! (( ${+commands[fzf]} )) && [[ ! "$PATH" == *$fzf_base/bin* ]]; then + export PATH="$PATH:$fzf_base/bin" + fi + + # Auto-completion + if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then + [[ $- == *i* ]] && source "${fzf_shell}/completion.zsh" 2> /dev/null + fi + + # Key bindings + if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then + source "${fzf_shell}/key-bindings.zsh" + fi + else + return 1 + fi +} + + +function setup_using_debian_package() { + (( $+commands[dpkg] )) && dpkg -s fzf &> /dev/null + if (( $? )); then + # Either not a debian based distro, or no fzf installed. In any case skip ahead + return 1 + fi + + # NOTE: There is no need to configure PATH for debian package, all binaries + # are installed to /usr/bin by default + + # Determine completion file path: first bullseye/sid, then buster/stretch + local completions="/usr/share/doc/fzf/examples/completion.zsh" + [[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf" + + local key_bindings="/usr/share/doc/fzf/examples/key-bindings.zsh" + + # Auto-completion + if [[ $- == *i* ]] && [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then + source $completions 2> /dev/null + fi + + # Key bindings + if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then + source $key_bindings + fi + + return 0 +} + +function indicate_error() { + print "[oh-my-zsh] fzf plugin: Cannot find fzf installation directory.\n"\ + "Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2 +} + +# Check for debian package first, because it easy to short cut +# Indicate to user that fzf installation not found if nothing worked +setup_using_debian_package || setup_using_base_dir || indicate_error + +unset -f setup_using_debian_package setup_using_base_dir indicate_error diff --git a/plugins/gas/README.md b/plugins/gas/README.md new file mode 100644 index 0000000..47b3fb9 --- /dev/null +++ b/plugins/gas/README.md @@ -0,0 +1,10 @@ +# Gas plugin + +This plugin adds autocompletion for the [gas](http://walle.github.com/gas) command, +a utility to manage Git authors. + +To use it, add `gas` to the plugins array of your zshrc file: + +```zsh +plugins=(... gas) +``` diff --git a/plugins/gatsby/README.md b/plugins/gatsby/README.md new file mode 100644 index 0000000..36846a2 --- /dev/null +++ b/plugins/gatsby/README.md @@ -0,0 +1,7 @@ +# gatsby autocomplete plugin + +* Adds autocomplete options for all gatsby commands. + +## Requirements + +In order to make this work, you will need to have gatsby set up in your path. diff --git a/plugins/gatsby/_gatsby b/plugins/gatsby/_gatsby new file mode 100644 index 0000000..66eb02f --- /dev/null +++ b/plugins/gatsby/_gatsby @@ -0,0 +1,24 @@ +#compdef gatsby +#autoload + +# in order to make this work, you will need to have gatsby +# https://www.gatsbyjs.org/ + +local -a _1st_arguments +_1st_arguments=( +'develop:Start development server. Watches files, rebuilds, and hot reloads if something changes' +'build:Build a Gatsby project.' +'serve:Serve previously built Gatsby site.' +'info:Get environment information for debugging and issue reporting' +'clean:Wipe the local gatsby environment including built assets and cache' +'repl:Get a node repl with context of Gatsby environment, see (add docs link here)' +'new: [rootPath] [starter] Create new Gatsby project.' +'telemetry:Enable or disable Gatsby anonymous analytics collection.' +) + +_arguments -C '*:: :->subcmds' && return 0 + +if (( CURRENT == 1 )); then + _describe -t commands "gatsby subcommand" _1st_arguments + return +fi diff --git a/plugins/gcloud/README.md b/plugins/gcloud/README.md new file mode 100644 index 0000000..e7ce0e0 --- /dev/null +++ b/plugins/gcloud/README.md @@ -0,0 +1,24 @@ +# gcloud + +This plugin provides completion support for the +[Google Cloud SDK CLI](https://cloud.google.com/sdk/gcloud/). + +To use it, add `gcloud` to the plugins array in your zshrc file. + +```zsh +plugins=(... gcloud) +``` + +It relies on you having installed the SDK using one of the supported options +listed [here](https://cloud.google.com/sdk/install). + +## Plugin Options + +* Set `CLOUDSDK_HOME` in your `zshrc` file before you load oh-my-zsh if you have +your GCloud SDK installed in a non-standard location. The plugin will use this +as the base for your SDK if it finds it set already. + +* If you do not have a `python2` in your `PATH` you'll also need to set the +`CLOUDSDK_PYTHON` environment variable at the end of your `.zshrc`. This is +used by the SDK to call a compatible interpreter when you run one of the +SDK commands. diff --git a/plugins/gcloud/gcloud.plugin.zsh b/plugins/gcloud/gcloud.plugin.zsh new file mode 100644 index 0000000..c7aebe6 --- /dev/null +++ b/plugins/gcloud/gcloud.plugin.zsh @@ -0,0 +1,33 @@ +##################################################### +# gcloud plugin for oh-my-zsh # +# Author: Ian Chesal (github.com/ianchesal) # +##################################################### + +if [[ -z "${CLOUDSDK_HOME}" ]]; then + search_locations=( + "$HOME/google-cloud-sdk" + "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk" + "/usr/share/google-cloud-sdk" + "/snap/google-cloud-sdk/current" + "/usr/lib64/google-cloud-sdk/" + "/opt/google-cloud-sdk" + ) + + for gcloud_sdk_location in $search_locations; do + if [[ -d "${gcloud_sdk_location}" ]]; then + CLOUDSDK_HOME="${gcloud_sdk_location}" + break + fi + done +fi + +if (( ${+CLOUDSDK_HOME} )); then + if (( ! $+commands[gcloud] )); then + # Only source this if GCloud isn't already on the path + if [[ -f "${CLOUDSDK_HOME}/path.zsh.inc" ]]; then + source "${CLOUDSDK_HOME}/path.zsh.inc" + fi + fi + source "${CLOUDSDK_HOME}/completion.zsh.inc" + export CLOUDSDK_HOME +fi diff --git a/plugins/geeknote/README.md b/plugins/geeknote/README.md index 3f23531..95b3aa7 100644 --- a/plugins/geeknote/README.md +++ b/plugins/geeknote/README.md @@ -1,12 +1,10 @@ -## ZSH-Geeknote +# Geeknote plugin -[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for oh-my-zsh. +This plugin provides autocompletion for [Geeknote](https://github.com/VitaliyRodnenko/geeknote) +and an alias for `geeknote` called `gn`. -Plugins provides: +To use it, add `geeknote` to the plugins array in your zshrc file: -- auto completion of commands and their options -- alias `gn` - -You can find information how to install Geeknote and it's available commands on the [project website](http://www.geeknote.me/). - -Maintainer : Ján Koščo ([@s7anley](https://twitter.com/s7anley)) +```zsh +plugins=( ... geeknote ...) +``` diff --git a/plugins/geeknote/_geeknote b/plugins/geeknote/_geeknote index cf1a187..a34be59 100644 --- a/plugins/geeknote/_geeknote +++ b/plugins/geeknote/_geeknote @@ -1,136 +1,157 @@ #compdef geeknote -# --------------- ------------------------------------------------------------ -# Name : _geeknote -# Synopsis : zsh completion for geeknote -# Author : Ján Koščo <3k.stanley@gmail.com> -# HomePage : http://www.geeknote.me -# Version : 0.1 -# Tag : [ shell, zsh, completion, evernote ] -# Copyright : © 2014 by Ján Koščo, -# Released under current GPL license. -# --------------- ------------------------------------------------------------ + +# Geeknote Autocomplete plugin for Zsh +# Requires: Geeknote installed +# Author : Ján Koščo (@s7anley) + +__login() { + # no arguments +} + +__logout() { + _arguments \ + '--force[Do not ask about logging out.]' +} + +__settings() { + _arguments \ + "--editor+[Set the editor, which use to edit and create notes.]::" +} + +__create() { + _arguments \ + '--title+[The note title.]::' \ + '--content+[The note content.]::' \ + '--tags+[One tag or the list of tags which will be added to the note.]::' \ + '--notebook+[Set the notebook where to save note.]::' \ + '--resource+[Add a resource to the note.]::' +} + +__edit() { + _arguments \ + '--note+[The name or ID from the previous search of a note to edit.]::' \ + '--title+[Set new title of the note.]::' \ + '--content+[Set new content of the note.]::' \ + '--tags+[Set new list o tags for the note.]::' \ + '--notebook+[Assign new notebook for the note.]::' \ + '--resource+[Add a resource to the note.]::' +} + +__find() { + _arguments \ + '--search+[Text to search.]::' \ + '--tags+[Notes with which tag/tags to search.]::' \ + '--notebook+[In which notebook search the note.]::' \ + '--date+[Set date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy.]::' \ + '--count+[How many notes show in the result list.]::' \ + '--with-url[Add direct url of each note in results to Evernote web-version.]' \ + '--content-search[Search by content, not by title.]' \ + '--exact-entry[Search for exact entry of the request.]' +} + +__show() { + _arguments \ + '--note+[The name or ID from the previous search of a note to show.]::' \ + '--raw[Show the raw note body.]' +} + +__remove() { + _arguments \ + '--note+[The name or ID from the previous search of a note to remove.]::' \ + '--force[Do not ask about removing.]' +} + +__notebook-list() { + # no arguments +} + +__notebook-create() { + _arguments \ + '--title+[Set the title of new notebook.]::' +} + +__notebook-edit() { + _arguments \ + '--title+[Set the title of new notebook.]::' \ + '--notebook+[The name of a notebook to rename.]::' +} + +__tag-list() { + # no arguments +} + +__tag-create() { + _arguments \ + '--title+[Set the title of new tag.]::' +} + +__tag-edit() { + _arguments \ + '--tagname+[The name of a tag to rename.]::' \ + '--title+[Set the new name of tag.]::' +} + +__user() { + _arguments \ + '--full[Show full information.]' +} local -a _1st_arguments _1st_arguments=( - 'login' - 'logout' - 'settings' - 'create' - 'edit' - 'find' - 'show' - 'remove' - 'notebook-list' - 'notebook-create' - 'notebook-edit' - 'tag-list' - 'tag-create' - 'tag-edit' - 'tag-remove' - 'gnsync' - 'user' + 'login':'Authorize in Evernote.' + 'logout':'Logout from Evernote.' + 'settings':'Show and edit current settings.' + 'create':'Create note in Evernote.' + 'edit':'Edit note in Evernote.' + 'find':'Search notes in Evernote.' + 'show':'Output note in the terminal.' + 'remove':'Remove note from Evernote.' + 'notebook-list':'Show the list of existing notebooks in your Evernote.' + 'notebook-create':'Create new notebook.' + 'notebook-edit':'Edit/rename notebook.' + 'tag-list':'Show the list of existing tags in your Evernote.' + 'tag-create':'Create new tag.' + 'tag-edit':'Edit/rename tag.' + 'user':'Show information about active user.' ) _arguments '*:: :->command' if (( CURRENT == 1 )); then - _describe -t commands "geeknote command" _1st_arguments - return + _describe -t commands "geeknote command" _1st_arguments + return fi local -a _command_args case "$words[1]" in - user) - _command_args=( - '(--full)--full' \ - ) - ;; - logout) - _command_args=( - '(--force)--force' \ - ) - ;; - settings) - _command_args=( - '(--editor)--editor' \ - ) - ;; - create) - _command_args=( - '(-t|--title)'{-t,--title}'[note title]' \ - '(-c|--content)'{-c,--content}'[note content]' \ - '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \ - '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \ - ) - ;; - edit) - _command_args=( - '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ - '(-t|--title)'{-t,--title}'[note title]' \ - '(-c|--content)'{-c,--content}'[note content]' \ - '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \ - '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \ - ) - ;; - remove) - _command_args=( - '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ - '(--force)--force' \ - ) - ;; - show) - _command_args=( - '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ - ) - ;; - find) - _command_args=( - '(-s|--search)'{-s,--search}'[text to search]' \ - '(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \ - '(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \ - '(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \ - '(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \ - '(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \ - '(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \ - '(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \ - ) - ;; - notebook-create) - _command_args=( - '(-t|--title)'{-t,--title}'[notebook title]' \ - ) - ;; - notebook-edit) - _command_args=( - '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \ - '(-t|--title)'{-t,--title}'[new notebook title]' \ - ) - ;; - notebook-remove) - _command_args=( - '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \ - '(--force)--force' \ - ) - ;; - tag-create) - _command_args=( - '(-t|--title)'{-t,--title}'[title of tag]' \ - ) - ;; - tag-edit) - _command_args=( - '(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \ - '(-t|--title)'{-t,--title}'[new tag name]' \ - ) - ;; - tag-remove) - _command_args=( - '(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \ - '(--force)--force' \ - ) - ;; - esac - -_arguments \ - $_command_args \ - && return 0 + login) + __login ;; + logout) + __logout ;; + settings) + __settings ;; + create) + __create ;; + edit) + __edit ;; + find) + __find ;; + show) + __show ;; + remove) + __remove ;; + notebook-list) + __notebook-list ;; + notebook-create) + __notebook-create ;; + notebook-edit) + __notebook-edit ;; + tag-list) + __tag-list ;; + tag-create) + __tag-create ;; + tag-edit) + __tag-edit ;; + user) + __user ;; +esac diff --git a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh index 1d20bc0..5c42c21 100644 --- a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh +++ b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh @@ -1,16 +1,17 @@ GIT_AUTO_FETCH_INTERVAL=${GIT_AUTO_FETCH_INTERVAL:=60} function git-fetch-all { - (`git rev-parse --is-inside-work-tree 2>/dev/null` && - dir=`git rev-parse --git-dir` && + (`command git rev-parse --is-inside-work-tree 2>/dev/null` && + dir=`command git rev-parse --git-dir` && [[ ! -f $dir/NO_AUTO_FETCH ]] && (( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $GIT_AUTO_FETCH_INTERVAL )) && - git fetch --all &>! $dir/FETCH_LOG &) + GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \ + command git fetch --all 2>/dev/null &>! $dir/FETCH_LOG &) } function git-auto-fetch { - `git rev-parse --is-inside-work-tree 2>/dev/null` || return - guard="`git rev-parse --git-dir`/NO_AUTO_FETCH" + `command git rev-parse --is-inside-work-tree 2>/dev/null` || return + guard="`command git rev-parse --git-dir`/NO_AUTO_FETCH" (rm $guard 2>/dev/null && echo "${fg_bold[green]}enabled${reset_color}") || @@ -18,10 +19,18 @@ function git-auto-fetch { echo "${fg_bold[red]}disabled${reset_color}") } -eval "override-git-auto-fetch-$(declare -f zle-line-init)" - -function zle-line-init () { - git-fetch-all - override-git-auto-fetch-zle-line-init -} +# Override zle-line-init if it exists +if (( $+functions[zle-line-init] )); then + eval "override-git-auto-fetch-$(declare -f zle-line-init)" + + function zle-line-init () { + git-fetch-all + override-git-auto-fetch-zle-line-init + } +else + function zle-line-init () { + git-fetch-all + } +fi + zle -N zle-line-init diff --git a/plugins/git-escape-magic/README.md b/plugins/git-escape-magic/README.md new file mode 100644 index 0000000..7fefed3 --- /dev/null +++ b/plugins/git-escape-magic/README.md @@ -0,0 +1,16 @@ +# Git Escape Magic + +This plugin is copied from the original at +https://github.com/knu/zsh-git-escape-magic. All credit for the +functionality enabled by this plugin should go to @knu. + +An excerpt from that project's readme explains its purpose. + +> It eliminates the need for manually escaping those meta-characters. The zle function it provides is context aware and recognizes the characteristics of each subcommand of git. Every time you type one of these meta-characters on a git command line, it automatically escapes the meta-character with a backslash as necessary and as appropriate. + +## Usage + +To use this plugin, add it to your list of plugins in your `.zshrc` file. + +**NOTE**: If you use url-quote-magic, it must be included before this +plugin runs to prevent any conflicts. diff --git a/plugins/git-escape-magic/git-escape-magic b/plugins/git-escape-magic/git-escape-magic new file mode 100644 index 0000000..94a8d7b --- /dev/null +++ b/plugins/git-escape-magic/git-escape-magic @@ -0,0 +1,135 @@ +# -*- mode: sh -*- +# +# git-escape-magic - zle tweak for git command line arguments +# +# Copyright (c) 2011, 2012, 2014 Akinori MUSHA +# Licensed under the 2-clause BSD license. +# +# This tweak eliminates the need for manually escaping shell +# meta-characters such as [~^{}] that are used for specifying a git +# object (commit or tree). Every time you type one of these +# characters on a git command line, it is automatically escaped with a +# backslash as necessary and as appropriate. +# +# If you want to use this with url-quote-magic, make sure to enable it +# first. +# +# Usage: +# autoload -Uz git-escape-magic +# git-escape-magic +# + +git-escape-magic.self-insert() { + emulate -L zsh + setopt extendedglob + local self_insert_function + zstyle -s ':git-escape-magic' self-insert-function self_insert_function + + if [[ "$KEYS" == [{}~^]* ]] && { + local qkey="${(q)KEYS}" + [[ "$KEYS" != "$qkey" ]] + } && { + local lbuf="$LBUFFER$qkey" + [[ "${(Q)LBUFFER}$KEYS" == "${(Q)lbuf}" ]] + } && { + local -a words + words=("${(@Q)${(z)lbuf}}") + [[ "$words[(i)(*/|)git(|-[^/]##)]" -le $#words ]] + } + then + local i + i="$words[(I)([;(){\&]|\&[\&\!]|\|\||[=<>]\(*)]" + if [[ $i -gt 0 ]]; then + shift $((i-1)) words + if [[ "$words[1]" == [\=\<\>]\(* ]]; then + words[1]="${words[1]#[=<>]\(}" + else + [[ "$words[1]" == \; && $words[2] == (then|else|elif|do) ]] && shift words + shift words + fi + fi + while [[ "$words[1]" == (if|while|until|\!) ]]; do + shift words + done + while [[ "$words[1]" == [A-Za-z_][A-Za-z0-9_]#=* ]]; do + shift words + done + [[ "$words[1]" == (*/|)git(|-[^/]##) ]] && { + local subcommand + subcommand="${words[1]##*/git-}" + if [[ -z "$subcommand" ]]; then + shift words + subcommand="$words[1]" + fi + [[ $#words -ge 2 ]] + } && + case "$subcommand" in + # commands that may take pathspec but never take refspec with [{}~^] + (add|rm|am|apply|check-attr|checkout-index|clean|clone|config|diff-files|hash-object|help|index-pack|mailinfo|mailsplit|merge-file|merge-index|mergetool|mktag|mv|pack-objects|pack-redundant|relink|send-email|show-index|show-ref|stage|status|verify-pack) + false ;; + # commands that may take pathspec but rarely take refspec with [{}~^] + (for-each-ref|grep|ls-files|update-index) + false ;; + (archive|ls-tree) + ! [[ $#words -ge 3 && + "$words[-2]" == [^-]* ]] ;; + (diff-tree) + ! [[ $#words -ge 4 && + "$words[-2]" == [^-]* && + "$words[-3]" == [^-]* ]] ;; + (*) + [[ $words[(i)--] -gt $#words ]] ;; + esac && + case "${words[-1]%%"$KEYS"}" in + (*[@^]) + [[ "$KEYS" == [{~^]* ]] ;; + (*[@^]\{[^}]##) + [[ "$KEYS" == \}* ]] ;; + (?*) + [[ "$KEYS" == [~^]* ]] ;; + (*) + false ;; + esac && + LBUFFER="$LBUFFER\\" + fi + + zle "$self_insert_function" +} + +git-escape-magic.on() { + emulate -L zsh + local self_insert_function="${$(zle -lL | awk \ + '$1=="zle"&&$2=="-N"&&$3=="self-insert"{print $4;exit}'):-.self-insert}" + + [[ "$self_insert_function" == git-escape-magic.self-insert ]] && + return 0 + + # For url-quote-magic which does not zle -N itself + zle -la "$self_insert_function" || zle -N "$self_insert_function" + + zstyle ':git-escape-magic' self-insert-function "$self_insert_function" + + zle -A git-escape-magic.self-insert self-insert + return 0 +} + +git-escape-magic.off() { + emulate -L zsh + local self_insert_function + zstyle -s ':git-escape-magic' self-insert-function self_insert_function + + [[ -n "$self_insert_function" ]] && + zle -A "$self_insert_function" self-insert + return 0 +} + +zle -N git-escape-magic.self-insert +zle -N git-escape-magic.on +zle -N git-escape-magic.off + +git-escape-magic() { + git-escape-magic.on +} + +[[ -o kshautoload ]] || git-escape-magic "$@" + diff --git a/plugins/git-escape-magic/git-escape-magic.plugin.zsh b/plugins/git-escape-magic/git-escape-magic.plugin.zsh new file mode 100644 index 0000000..c021ea7 --- /dev/null +++ b/plugins/git-escape-magic/git-escape-magic.plugin.zsh @@ -0,0 +1,9 @@ +# Automatically detect and escape zsh globbing meta-characters when used with +# git refspec characters like `[^~{}]`. NOTE: This must be loaded _after_ +# url-quote-magic. +# +# This trick is detailed at https://github.com/knu/zsh-git-escape-magic and is +# what allowed this plugin to exist. + +autoload -Uz git-escape-magic +git-escape-magic diff --git a/plugins/git-extras/README.md b/plugins/git-extras/README.md index 987f0d8..2adc9d4 100644 --- a/plugins/git-extras/README.md +++ b/plugins/git-extras/README.md @@ -2,10 +2,16 @@ This plugin provides completion definitions for some of the commands defined by [git-extras](https://github.com/tj/git-extras). -## Setup notes +To use it, add `git-extras` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-extras) +``` + +## Setup notes The completions work by augmenting the `_git` completion provided by `zsh`. This only works with the `zsh`-provided `_git`, not the `_git` provided by `git` itself. If you have both `zsh` and `git` installed, you need to make sure that the `zsh`-provided `_git` takes precedence. ### OS X Homebrew Setup -On OS X with Homebrew, you need to install `git` with `brew install git --without-completions`. Otherwise, `git`'s `_git` will take precedence, and you won't see the completions for `git-extras` commands. +**NOTE:** this no longer works on current Homebrew distributions of git. ~~On OS X with Homebrew, you need to install `git` with `brew install git --without-completions`. Otherwise, `git`'s `_git` will take precedence, and you won't see the completions for `git-extras` commands.~~ diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh index ef6c359..b86d7c5 100644 --- a/plugins/git-extras/git-extras.plugin.zsh +++ b/plugins/git-extras/git-extras.plugin.zsh @@ -454,9 +454,9 @@ zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \ extras:'awesome git utilities' \ feature:'create/merge feature branch' \ force-clone:'overwrite local repositories with clone' \ - fork:'fork a repo on github' \ + fork:'fork a repo on GitHub' \ fresh-branch:'create fresh branches' \ - gh-pages:'create the github pages branch' \ + gh-pages:'create the GitHub pages branch' \ graft:'merge and destroy a given branch' \ guilt:'calculate change between two revisions' \ ignore-io:'get sample gitignore file' \ diff --git a/plugins/git-flow/README.md b/plugins/git-flow/README.md index 5d8049e..9c25dec 100644 --- a/plugins/git-flow/README.md +++ b/plugins/git-flow/README.md @@ -1,18 +1,15 @@ # Git-Flow plugin -This plugin adds completion and aliases for the `git-flow` command. More information -at https://github.com/nvie/gitflow. +This plugin adds completion and aliases for the [`git-flow` command](https://github.com/nvie/gitflow). -Enable git-flow plugin in your zshrc file: -``` +To use it, add `git-flow` to the plugins array in your zshrc file: + +```zsh plugins=(... git-flow) ``` ## Aliases -More information about `git-flow` commands: -https://github.com/nvie/gitflow/wiki/Command-Line-Arguments - | Alias | Command | Description | |---------|----------------------------|----------------------------------------| | `gfl` | `git flow` | Git-Flow command | @@ -30,3 +27,5 @@ https://github.com/nvie/gitflow/wiki/Command-Line-Arguments | `gflfp` | `git flow feature publish` | Publish feature: `gflfp ` | | `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf ` | | `gflrf` | `git flow release finish` | Finish release: `gflrf ` | + +[More information about `git-flow` commands](https://github.com/nvie/gitflow/wiki/Command-Line-Arguments). diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh index 05479f7..50d7b23 100644 --- a/plugins/git-hubflow/git-hubflow.plugin.zsh +++ b/plugins/git-hubflow/git-hubflow.plugin.zsh @@ -75,8 +75,8 @@ __git-hf-release () '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' + 'push:Push release to GitHub' + 'pull:Pull release from GitHub' 'track:Track release' ) _describe -t commands 'git hf release' subcommands @@ -133,8 +133,8 @@ __git-hf-hotfix () '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.' + 'pull:Pull the hotfix from GitHub.' + 'push:Push the hotfix to GitHub.' 'cancel:Cancel the hotfix.' ) _describe -t commands 'git hf hotfix' subcommands @@ -195,8 +195,8 @@ __git-hf-feature () 'diff:Diff' 'rebase:Rebase feature branch against develop' 'checkout:Checkout feature' - 'pull:Pull feature branch from github' - 'push:Push feature branch to github' + 'pull:Pull feature branch from GitHub' + 'push:Push feature branch to GitHub' 'cancel:Cancel feature' ) _describe -t commands 'git hf feature' subcommands diff --git a/plugins/git-prompt/README.md b/plugins/git-prompt/README.md new file mode 100644 index 0000000..e3b2d62 --- /dev/null +++ b/plugins/git-prompt/README.md @@ -0,0 +1,61 @@ +# git-prompt plugin + +A `zsh` prompt that displays information about the current git repository. In particular: +the branch name, difference with remote branch, number of files staged or changed, etc. + +To use it, add `git-prompt` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-prompt) +``` + +See the [original repository](https://github.com/olivierverdier/zsh-git-prompt). + +## Examples + +The prompt may look like the following: + +- `(master↑3|✚1)`: on branch `master`, ahead of remote by 3 commits, 1 file changed but not staged +- `(status|●2)`: on branch `status`, 2 files staged +- `(master|✚7…)`: on branch `master`, 7 files changed, some files untracked +- `(master|✖2✚3)`: on branch `master`, 2 conflicts, 3 files changed +- `(experimental↓2↑3|✔)`: on branch `experimental`; your branch has diverged by 3 commits, remote by 2 commits; the repository is otherwise clean +- `(:70c2952|✔)`: not on any branch; parent commit has hash `70c2952`; the repository is otherwise clean + +## Prompt Structure + +By default, the general appearance of the prompt is: + +``` +(|) +``` + +The symbols are as follows: + +### Local Status Symbols + +| Symbol | Meaning | +|--------|--------------------------------| +| ✔ | repository clean | +| ●n | there are `n` staged files | +| ✖n | there are `n` unmerged files | +| ✚n | there are `n` unstaged files | +| … | there are some untracked files | + +### Branch Tracking Symbols + +| Symbol | Meaning | +|--------|---------------------------------------------------------------| +| ↑n | ahead of remote by `n` commits | +| ↓n | behind remote by `n` commits | +| ↓m↑n | branches diverged: other by `m` commits, yours by `n` commits | + +## Customisation + +- Set the variable `ZSH_THEME_GIT_PROMPT_CACHE` to any value in order to enable caching. +- You may also change a number of variables (whose name start with `ZSH_THEME_GIT_PROMPT_`) + to change the appearance of the prompt. Take a look at the bottom of the [plugin file](git-prompt.plugin.zsh)` + to see what variables are available. + + +**Enjoy!** diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh index 2776f29..da674af 100644 --- a/plugins/git-prompt/git-prompt.plugin.zsh +++ b/plugins/git-prompt/git-prompt.plugin.zsh @@ -1,6 +1,3 @@ -# ZSH Git Prompt Plugin from: -# https://github.com/olivierverdier/zsh-git-prompt - __GIT_PROMPT_DIR="${0:A:h}" ## Hook function definitions @@ -23,9 +20,10 @@ function precmd_update_git_vars() { fi } -chpwd_functions+=(chpwd_update_git_vars) -precmd_functions+=(precmd_update_git_vars) -preexec_functions+=(preexec_update_git_vars) +autoload -U add-zsh-hook +add-zsh-hook chpwd chpwd_update_git_vars +add-zsh-hook precmd precmd_update_git_vars +add-zsh-hook preexec preexec_update_git_vars ## Function definitions diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index a4d07cd..300365d 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -1,28 +1,24 @@ #!/usr/bin/env python from __future__ import print_function +import os import sys import re -import shlex from subprocess import Popen, PIPE, check_output def get_tagname_or_hash(): """return tagname if exists else hash""" - cmd = 'git log -1 --format="%h%d"' - output = check_output(shlex.split(cmd)).decode('utf-8').strip() - hash_, tagname = None, None # get hash - m = re.search('\(.*\)$', output) - if m: - hash_ = output[:m.start()-1] + hash_cmd = ['git', 'rev-parse', '--short', 'HEAD'] + hash_ = check_output(hash_cmd).strip() + # get tagname - m = re.search('tag: .*[,\)]', output) - if m: - tagname = 'tags/' + output[m.start()+len('tag: '): m.end()-1] + tags_cmd = ['git', 'for-each-ref', '--points-at=HEAD', '--count=2', '--sort=-version:refname', '--format=%(refname:short)', 'refs/tags'] + tags = check_output(tags_cmd).split() - if tagname: - return tagname.replace(' ', '') + if tags: + return tags[0] + ('+' if len(tags) > 1 else '') elif hash_: return hash_ return None @@ -30,7 +26,7 @@ def get_tagname_or_hash(): # `git status --porcelain --branch` can collect all information # branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind -po = Popen(['git', 'status', '--porcelain', '--branch'], stdout=PIPE, stderr=PIPE) +po = Popen(['git', 'status', '--porcelain', '--branch'], env=dict(os.environ, LANG="C"), stdout=PIPE, stderr=PIPE) stdout, sterr = po.communicate() if po.returncode != 0: sys.exit(0) # Not a git repository diff --git a/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/plugins/git-remote-branch/git-remote-branch.plugin.zsh deleted file mode 100644 index 6c5ab8f..0000000 --- a/plugins/git-remote-branch/git-remote-branch.plugin.zsh +++ /dev/null @@ -1,19 +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 - remotes=`git remote | tr '\n' '|' | sed "s/\|$//g"` - compadd `git branch -r | grep -v HEAD | sed "s/$remotes\///" | 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/plugins/git/README.md b/plugins/git/README.md index 76da2a8..8642dd0 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -1,10 +1,225 @@ -## git +# git plugin -**Maintainer:** [@ncanceill](https://github.com/ncanceill) +The git plugin provides many [aliases](#aliases) and a few useful [functions](#functions). -This plugin adds many useful aliases and functions. +To use it, add `git` to the plugins array in your zshrc file: -### Usage +```zsh +plugins=(... git) +``` -See the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugin:git) for a list of aliases and functions provided by the plugin. +## Aliases +| Alias | Command | +|:---------------------|:---------------------------------------------------------------------------------------------------------------------------------| +| g | git | +| ga | git add | +| gaa | git add --all | +| gapa | git add --patch | +| gau | git add --update | +| gav | git add --verbose | +| gap | git apply | +| gapt | git apply --3way | +| gb | git branch | +| gba | git branch -a | +| gbd | git branch -d | +| gbda | git branch --no-color --merged \| command grep -vE "^(\+\|\*\|\s*(master\|development\|develop\|devel\|dev)\s*$)" \| command xargs -n 1 git branch -d | +| gbD | git branch -D | +| gbl | git blame -b -w | +| gbnm | git branch --no-merged | +| gbr | git branch --remote | +| gbs | git bisect | +| gbsb | git bisect bad | +| gbsg | git bisect good | +| gbsr | git bisect reset | +| gbss | git bisect start | +| gc | git commit -v | +| gc! | git commit -v --amend | +| gcn! | git commit -v --no-edit --amend | +| gca | git commit -v -a | +| gca! | git commit -v -a --amend | +| gcan! | git commit -v -a --no-edit --amend | +| gcans! | git commit -v -a -s --no-edit --amend | +| gcam | git commit -a -m | +| gcsm | git commit -s -m | +| gcb | git checkout -b | +| gcf | git config --list | +| gcl | git clone --recurse-submodules | +| gclean | git clean -id | +| gpristine | git reset --hard && git clean -dffx | +| gcm | git checkout master | +| gcd | git checkout develop | +| gcmsg | git commit -m | +| gco | git checkout | +| gcount | git shortlog -sn | +| gcp | git cherry-pick | +| gcpa | git cherry-pick --abort | +| gcpc | git cherry-pick --continue | +| gcs | git commit -S | +| gd | git diff | +| gdca | git diff --cached | +| gdcw | git diff --cached --word-diff | +| gdct | git describe --tags $(git rev-list --tags --max-count=1) | +| gds | git diff --staged | +| gdt | git diff-tree --no-commit-id --name-only -r | +| gdnolock | git diff $@ ":(exclude)package-lock.json" ":(exclude)*.lock" | +| gdv | git diff -w $@ \| view - | +| gdw | git diff --word-diff | +| gf | git fetch | +| gfa | git fetch --all --prune | +| gfg | git ls-files \| grep | +| gfo | git fetch origin | +| gg | git gui citool | +| gga | git gui citool --amend | +| ggf | git push --force origin $(current_branch) | +| ggfl | git push --force-with-lease origin $(current_branch) | +| ggl | git pull origin $(current_branch) | +| ggp | git push origin $(current_branch) | +| ggpnp | ggl && ggp | +| ggpull | git pull origin "$(git_current_branch)" | +| ggpur | ggu | +| ggpush | git push origin "$(git_current_branch)" | +| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) | +| ggu | git pull --rebase origin $(current_branch) | +| gpsup | git push --set-upstream origin $(git_current_branch) | +| ghh | git help | +| gignore | git update-index --assume-unchanged | +| gignored | git ls-files -v \| grep "^[[:lower:]]" | +| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk | +| gk | gitk --all --branches | +| gke | gitk --all $(git log -g --pretty=%h) | +| gl | git pull | +| glg | git log --stat | +| glgp | git log --stat -p | +| glgg | git log --graph | +| glgga | git log --graph --decorate --all | +| glgm | git log --graph --max-count=10 | +| glo | git log --oneline --decorate | +| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' | +| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat | +| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' | +| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short | +| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all | +| glog | git log --oneline --decorate --graph | +| gloga | git log --oneline --decorate --graph --all | +| glp | git log --pretty=\ | +| gm | git merge | +| gmom | git merge origin/master | +| gmt | git mergetool --no-prompt | +| gmtvim | git mergetool --no-prompt --tool=vimdiff | +| gmum | git merge upstream/master | +| gma | git merge --abort | +| gp | git push | +| gpd | git push --dry-run | +| gpf | git push --force-with-lease | +| gpf! | git push --force | +| gpoat | git push origin --all && git push origin --tags | +| gpu | git push upstream | +| gpv | git push -v | +| gr | git remote | +| gra | git remote add | +| grb | git rebase | +| grba | git rebase --abort | +| grbc | git rebase --continue | +| grbd | git rebase develop | +| grbi | git rebase -i | +| grbm | git rebase master | +| grbs | git rebase --skip | +| grev | git revert | +| grh | git reset | +| grhh | git reset --hard | +| groh | git reset origin/$(git_current_branch) --hard | +| grm | git rm | +| grmc | git rm --cached | +| grmv | git remote rename | +| grrm | git remote remove | +| grs | git restore | +| grset | git remote set-url | +| grss | git restore --source | +| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" | +| gru | git reset -- | +| grup | git remote update | +| grv | git remote -v | +| gsb | git status -sb | +| gsd | git svn dcommit | +| gsh | git show | +| gsi | git submodule init | +| gsps | git show --pretty=short --show-signature | +| gsr | git svn rebase | +| gss | git status -s | +| gst | git status | +| gsta | git stash push | +| gsta | git stash save | +| gstaa | git stash apply | +| gstc | git stash clear | +| gstd | git stash drop | +| gstl | git stash list | +| gstp | git stash pop | +| gsts | git stash show --text | +| gstu | git stash --include-untracked | +| gstall | git stash --all | +| gsu | git submodule update | +| gsw | git switch | +| gswc | git switch -c | +| gts | git tag -s | +| gtv | git tag \| sort -V | +| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl | +| gunignore | git update-index --no-assume-unchanged | +| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 | +| gup | git pull --rebase | +| gupv | git pull --rebase -v | +| gupa | git pull --rebase --autostash | +| gupav | git pull --rebase --autostash -v | +| glum | git pull upstream master | +| gwch | git whatchanged -p --abbrev-commit --pretty=medium | +| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" | +| gam | git am | +| gamc | git am --continue | +| gams | git am --skip | +| gama | git am --abort | +| gamscp | git am --show-current-patch | + +### Deprecated aliases + +These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not, receive further support. + +| Alias | Command | Modification | +| :----- | :----------------------------------------------------- | :----------------------------------------------------- | +| gap | `git add --patch` | new alias `gapa` | +| gcl | `git config --list` | new alias `gcf` | +| gdc | `git diff --cached` | new alias `gdca` | +| gdt | `git difftool` | no replacement | +| ggpull | `git pull origin $(current_branch)` | new alias `ggl` (`ggpull` still exists for now though) | +| ggpur | `git pull --rebase origin $(current_branch)` | new alias `ggu` (`ggpur` still exists for now though) | +| ggpush | `git push origin $(current_branch)` | new alias `ggp` (`ggpush` still exists for now though) | +| gk | `gitk --all --branches` | now aliased to `gitk --all --branches` | +| glg | `git log --stat --max-count = 10` | now aliased to `git log --stat --color` | +| glgg | `git log --graph --max-count = 10` | now aliased to `git log --graph --color` | +| gwc | `git whatchanged -p --abbrev-commit --pretty = medium` | new alias `gwch` | + +## Functions + +### Current + +| Command | Description | +|:-----------------------|:---------------------------------------------------------| +| `grename ` | Rename `old` branch to `new`, including in origin remote | +| current_branch | Return the name of the current branch | +| git_current_user_name | Returns the `user.name` config value | +| git_current_user_email | Returns the `user.email` config value | + +### Work in Progress (WIP) + +These features allow to pause a branch development and switch to another one (_"Work in Progress"_, or wip). When you want to go back to work, just unwip it. + +| Command | Description | +|:-----------------|:------------------------------------------------| +| work_in_progress | Echoes a warning if the current branch is a wip | +| gwip | Commit wip branch | +| gunwip | Uncommit wip branch | + +### Deprecated functions + +| Command | Description | Reason | +|:-----------------------|:----------------------------------------|:----------------------------------------------------------------| +| current_repository | Return the names of the current remotes | Didn't work properly. Use `git remote -v` instead (`grv` alias) | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 12400ed..1112421 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,7 +1,3 @@ -# Query/use custom command for `git`. -zstyle -s ":vcs_info:git:*:-all-" "command" _omz_git_git_cmd -: ${_omz_git_git_cmd:=git} - # # Functions # @@ -13,19 +9,15 @@ zstyle -s ":vcs_info:git:*:-all-" "command" _omz_git_git_cmd function current_branch() { git_current_branch } -# The list of remotes -function current_repository() { - if ! $_omz_git_git_cmd rev-parse --is-inside-work-tree &> /dev/null; then - return - fi - echo $($_omz_git_git_cmd remote -v | cut -d':' -f 2) -} + # Pretty log messages function _git_log_prettily(){ if ! [ -z $1 ]; then git log --pretty=$1 fi } +compdef _git _git_log_prettily=git-log + # Warn if the current branch is a WIP function work_in_progress() { if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then @@ -46,11 +38,12 @@ alias gapa='git add --patch' alias gau='git add --update' alias gav='git add --verbose' alias gap='git apply' +alias gapt='git apply --3way' alias gb='git branch' alias gba='git branch -a' alias gbd='git branch -d' -alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d' +alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|development|develop|devel|dev)\s*$)" | command xargs -n 1 git branch -d' alias gbD='git branch -D' alias gbl='git blame -b -w' alias gbnm='git branch --no-merged' @@ -73,14 +66,13 @@ alias gcsm='git commit -s -m' alias gcb='git checkout -b' alias gcf='git config --list' alias gcl='git clone --recurse-submodules' -alias gclean='git clean -fd' -alias gpristine='git reset --hard && git clean -dfx' +alias gclean='git clean -id' +alias gpristine='git reset --hard && git clean -dffx' alias gcm='git checkout master' alias gcd='git checkout develop' alias gcmsg='git commit -m' alias gco='git checkout' alias gcount='git shortlog -sn' -compdef _git gcount alias gcp='git cherry-pick' alias gcpa='git cherry-pick --abort' alias gcpc='git cherry-pick --continue' @@ -89,35 +81,40 @@ alias gcs='git commit -S' alias gd='git diff' alias gdca='git diff --cached' alias gdcw='git diff --cached --word-diff' -alias gdct='git describe --tags `git rev-list --tags --max-count=1`' +alias gdct='git describe --tags $(git rev-list --tags --max-count=1)' alias gds='git diff --staged' alias gdt='git diff-tree --no-commit-id --name-only -r' alias gdw='git diff --word-diff' -gdv() { git diff -w "$@" | view - } +function gdnolock() { + git diff "$@" ":(exclude)package-lock.json" ":(exclude)*.lock" +} +compdef _git gdnolock=git-diff + +function gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff alias gf='git fetch' alias gfa='git fetch --all --prune' alias gfo='git fetch origin' -function gfg() { git ls-files | grep $@ } -compdef _grep gfg +alias gfg='git ls-files | grep' alias gg='git gui citool' alias gga='git gui citool --amend' -ggf() { +function ggf() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" git push --force origin "${b:=$1}" } -ggfl() { +compdef _git ggf=git-checkout +function ggfl() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" git push --force-with-lease origin "${b:=$1}" } -compdef _git ggf=git-checkout +compdef _git ggfl=git-checkout -ggl() { +function ggl() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then git pull origin "${*}" else @@ -127,7 +124,7 @@ ggl() { } compdef _git ggl=git-checkout -ggp() { +function ggp() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then git push origin "${*}" else @@ -137,7 +134,7 @@ ggp() { } compdef _git ggp=git-checkout -ggpnp() { +function ggpnp() { if [[ "$#" == 0 ]]; then ggl && ggp else @@ -146,20 +143,15 @@ ggpnp() { } compdef _git ggpnp=git-checkout -ggu() { +function ggu() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" git pull --rebase origin "${b:=$1}" } compdef _git ggu=git-checkout alias ggpur='ggu' -compdef _git ggpur=git-checkout - alias ggpull='git pull origin "$(git_current_branch)"' -compdef _git ggpull=git-checkout - alias ggpush='git push origin "$(git_current_branch)"' -compdef _git ggpush=git-checkout alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)' alias gpsup='git push --set-upstream origin $(git_current_branch)' @@ -169,12 +161,9 @@ alias ghh='git help' alias gignore='git update-index --assume-unchanged' alias gignored='git ls-files -v | grep "^[[:lower:]]"' alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' -compdef _git git-svn-dcommit-push=git alias gk='\gitk --all --branches' -compdef _git gk='gitk' alias gke='\gitk --all $(git log -g --pretty=%h)' -compdef _git gke='gitk' alias gl='git pull' alias glg='git log --stat' @@ -191,7 +180,6 @@ alias glola="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgr alias glog='git log --oneline --decorate --graph' alias gloga='git log --oneline --decorate --graph --all' alias glp="_git_log_prettily" -compdef _git glp=git-log alias gm='git merge' alias gmom='git merge origin/master' @@ -205,7 +193,6 @@ alias gpd='git push --dry-run' alias gpf='git push --force-with-lease' alias gpf!='git push --force' alias gpoat='git push origin --all && git push origin --tags' -compdef _git gpoat=git-push alias gpu='git push upstream' alias gpv='git push -v' @@ -218,14 +205,18 @@ alias grbd='git rebase develop' alias grbi='git rebase -i' alias grbm='git rebase master' alias grbs='git rebase --skip' +alias grev='git revert' alias grh='git reset' alias grhh='git reset --hard' +alias groh='git reset origin/$(git_current_branch) --hard' alias grm='git rm' alias grmc='git rm --cached' alias grmv='git remote rename' alias grrm='git remote remove' +alias grs='git restore' alias grset='git remote set-url' -alias grt='cd $(git rev-parse --show-toplevel || echo ".")' +alias grss='git restore --source' +alias grt='cd "$(git rev-parse --show-toplevel || echo .)"' alias gru='git reset --' alias grup='git remote update' alias grv='git remote -v' @@ -238,18 +229,28 @@ alias gsps='git show --pretty=short --show-signature' alias gsr='git svn rebase' alias gss='git status -s' alias gst='git status' -alias gsta='git stash save' + +# use the default stash push on git 2.13 and newer +autoload -Uz is-at-least +is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')" \ + && alias gsta='git stash push' \ + || alias gsta='git stash save' + alias gstaa='git stash apply' alias gstc='git stash clear' alias gstd='git stash drop' alias gstl='git stash list' alias gstp='git stash pop' alias gsts='git stash show --text' +alias gstu='git stash --include-untracked' alias gstall='git stash --all' alias gsu='git submodule update' +alias gsw='git switch' +alias gswc='git switch -c' alias gts='git tag -s' alias gtv='git tag | sort -V' +alias gtl='gtl(){ git tag --sort=-v:refname -n -l "${1}*" }; noglob gtl' alias gunignore='git update-index --no-assume-unchanged' alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' @@ -260,4 +261,24 @@ alias gupav='git pull --rebase --autostash -v' alias glum='git pull upstream master' alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' -alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip-- [skip ci]"' +alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"' + +alias gam='git am' +alias gamc='git am --continue' +alias gams='git am --skip' +alias gama='git am --abort' +alias gamscp='git am --show-current-patch' + +function grename() { + if [[ -z "$1" || -z "$2" ]]; then + echo "Usage: $0 old_branch new_branch" + return 1 + fi + + # Rename branch locally + git branch -m "$1" "$2" + # Rename branch in origin remote + if git push origin :"$1"; then + git push --set-upstream origin "$2" + fi +} diff --git a/plugins/gitfast/README.md b/plugins/gitfast/README.md index c307370..fed4b12 100644 --- a/plugins/gitfast/README.md +++ b/plugins/gitfast/README.md @@ -1,6 +1,6 @@ # Gitfast plugin -This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version.. +This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version. To use it, add `gitfast` to the plugins array in your zshrc file: @@ -10,129 +10,6 @@ plugins=(... gitfast) ## Aliases -| Alias | Command | -| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| g | `git` | -| ga | `git add` | -| gaa | `git add --all` | -| gapa | `git add --patch` | -| gau | `git add --update` | -| gb | `git branch` | -| gba | `git branch -a` | -| gbd | `git branch -d` | -| gbda | `git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d` | -| gbl | `git blame -b -w` | -| gbnm | `git branch --no-merged` | -| gbr | `git branch --remote` | -| gbs | `git bisect` | -| gbsb | `git bisect bad` | -| gbsg | `git bisect good` | -| gbsr | `git bisect reset` | -| gbss | `git bisect start` | -| gc | `git commit -v` | -| gc! | `git commit -v --amend` | -| gca | `git commit -v -a` | -| gca! | `git commit -v -a --amend` | -| gcam | `git commit -a -m` | -| gcan! | `git commit -v -a --no-edit --amend` | -| gcans! | `git commit -v -a -s --no-edit --amend` | -| gcb | `git checkout -b` | -| gcd | `git checkout develop` | -| gcf | `git config --list` | -| gcl | `git clone --recursive` | -| gclean | `git clean -fd` | -| gcm | `git checkout master` | -| gcmsg | `git commit -m` | -| gcn! | `git commit -v --no-edit --amend` | -| gco | `git checkout` | -| gcount | `git shortlog -sn` | -| gcp | `git cherry-pick` | -| gcpa | `git cherry-pick --abort` | -| gcpc | `git cherry-pick --continue` | -| gcs | `git commit -S` | -| gcsm | `git commit -s -m` | -| gd | `git diff` | -| gdca | `git diff --cached` | -| gdct | `` git describe --tags `git rev-list --tags --max-count=1` `` | -| gdt | `git diff-tree --no-commit-id --name-only -r` | -| gdw | `git diff --word-diff` | -| gf | `git fetch` | -| gfa | `git fetch --all --prune` | -| gfo | `git fetch origin` | -| gg | `git gui citool` | -| gga | `git gui citool --amend` | -| ggpull | `git pull origin $(git_current_branch)` | -| ggpur | `ggu` | -| ggpush | `git push origin $(git_current_branch)` | -| ggsup | `git branch --set-upstream-to=origin/$(git_current_branch)` | -| ghh | `git help` | -| gignore | `git update-index --assume-unchanged` | -| gignored | `git ls-files -v | grep "^[[:lower:]]"` | -| git-svn-dcommit-push | `git svn dcommit && git push github master:svntrunk` | -| gk | `\gitk --all --branches` | -| gke | `\gitk --all $(git log -g --pretty=%h)` | -| gl | `git pull` | -| glg | `git log --stat` | -| glgg | `git log --graph` | -| glgga | `git log --graph --decorate --all` | -| glgm | `git log --graph --max-count=10` | -| glgp | `git log --stat -p` | -| glo | `git log --oneline --decorate` | -| glog | `git log --oneline --decorate --graph` | -| gloga | `git log --oneline --decorate --graph --all` | -| glol | `git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit` | -| glola | `git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --all` | -| glp | `_git_log_prettily` | -| glum | `git pull upstream master` | -| gm | `git merge` | -| gmom | `git merge origin/master` | -| gmt | `git mergetool --no-prompt` | -| gmtvim | `git mergetool --no-prompt --tool=vimdiff` | -| gmum | `git merge upstream/master` | -| gp | `git push` | -| gpd | `git push --dry-run` | -| gpoat | `git push origin --all && git push origin --tags` | -| gpristine | `git reset --hard && git clean -dfx` | -| gpsup | `git push --set-upstream origin $(git_current_branch)` | -| gpu | `git push upstream` | -| gpv | `git push -v` | -| gr | `git remote` | -| gra | `git remote add` | -| grb | `git rebase` | -| grba | `git rebase --abort` | -| grbc | `git rebase --continue` | -| grbi | `git rebase -i` | -| grbm | `git rebase master` | -| grbs | `git rebase --skip` | -| grh | `git reset HEAD` | -| grhh | `git reset HEAD --hard` | -| grmv | `git remote rename` | -| grrm | `git remote remove` | -| grset | `git remote set-url` | -| grt | `cd $(git rev-parse --show-toplevel || echo ".")` | -| gru | `git reset --` | -| grup | `git remote update` | -| grv | `git remote -v` | -| gsb | `git status -sb` | -| gsd | `git svn dcommit` | -| gsi | `git submodule init` | -| gsps | `git show --pretty=short --show-signature` | -| gsr | `git svn rebase` | -| gss | `git status -s` | -| gst | `git status` | -| gsta | `git stash save` | -| gstaa | `git stash apply` | -| gstc | `git stash clear` | -| gstd | `git stash drop` | -| gstl | `git stash list` | -| gstp | `git stash pop` | -| gsts | `git stash show --text` | -| gsu | `git submodule update` | -| gts | `git tag -s` | -| gtv | `git tag | sort -V` | -| gunignore | `git update-index --no-assume-unchanged` | -| gunwip | `git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1` | -| gup | `git pull --rebase` | -| gupv | `git pull --rebase -v` | -| gwch | `git whatchanged -p --abbrev-commit --pretty=medium` | -| gwip | `git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip-- [skip ci]"` | +An earlier version of the plugin also loaded the git plugin. If you want to keep those +aliases enable the [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git) +as well. diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index 6d1b4ec..78a6dbb 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -9,7 +9,7 @@ # # If your script is somewhere else, you can configure it on your ~/.zshrc: # -# zstyle ':completion:*:*:git:*' script ~/.git-completion.sh +# zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh # # The recommended way to install this script is to copy to '~/.zsh/_git', and # then add the following to your ~/.zshrc file: @@ -67,6 +67,15 @@ __gitcomp () esac } +__gitcomp_direct () +{ + emulate -L zsh + + local IFS=$'\n' + compset -P '*[=:]' + compadd -Q -- ${=1} && _ret=0 +} + __gitcomp_nl () { emulate -L zsh diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash index 8ce6b5c..b6ff5dc 100644 --- a/plugins/gitfast/git-completion.bash +++ b/plugins/gitfast/git-completion.bash @@ -28,27 +28,55 @@ # completion style. For example '!f() { : git commit ; ... }; f' will # tell the completion to use commit completion. This also works with aliases # of form "!sh -c '...'". For example, "!sh -c ': git commit ; ... '". +# +# You can set the following environment variables to influence the behavior of +# the completion routines: +# +# GIT_COMPLETION_CHECKOUT_NO_GUESS +# +# When set to "1", do not include "DWIM" suggestions in git-checkout +# completion (e.g., completing "foo" when "origin/foo" exists). case "$COMP_WORDBREAKS" in *:*) : great ;; *) COMP_WORDBREAKS="$COMP_WORDBREAKS:" esac +# Discovers the path to the git repository taking any '--git-dir=' and +# '-C ' options into account and stores it in the $__git_repo_path +# variable. +__git_find_repo_path () +{ + if [ -n "$__git_repo_path" ]; then + # we already know where it is + return + fi + + if [ -n "${__git_C_args-}" ]; then + __git_repo_path="$(git "${__git_C_args[@]}" \ + ${__git_dir:+--git-dir="$__git_dir"} \ + rev-parse --absolute-git-dir 2>/dev/null)" + elif [ -n "${__git_dir-}" ]; then + test -d "$__git_dir" && + __git_repo_path="$__git_dir" + elif [ -n "${GIT_DIR-}" ]; then + test -d "${GIT_DIR-}" && + __git_repo_path="$GIT_DIR" + elif [ -d .git ]; then + __git_repo_path=.git + else + __git_repo_path="$(git rev-parse --git-dir 2>/dev/null)" + fi +} + +# Deprecated: use __git_find_repo_path() and $__git_repo_path instead # __gitdir accepts 0 or 1 arguments (i.e., location) # returns location of .git repo __gitdir () { 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 + __git_find_repo_path || return 1 + echo "$__git_repo_path" elif [ -d "$1/.git" ]; then echo "$1/.git" else @@ -56,6 +84,14 @@ __gitdir () fi } +# Runs git with all the options given as argument, respecting any +# '--git-dir=' and '-C ' options present on the command line +__git () +{ + git ${__git_C_args:+"${__git_C_args[@]}"} \ + ${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null +} + # The following function is based on code from: # # bash_completion - programmable completion functions for bash 3.2+ @@ -75,8 +111,7 @@ __gitdir () # 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. +# along with this program; if not, see . # # The latest version of this software can be obtained here: # @@ -185,6 +220,20 @@ _get_comp_words_by_ref () } fi +# Fills the COMPREPLY array with prefiltered words without any additional +# processing. +# Callers must take care of providing only words that match the current word +# to be completed and adding any prefix and/or suffix (trailing space!), if +# necessary. +# 1: List of newline-separated matching completion words, complete with +# prefix and suffix. +__gitcomp_direct () +{ + local IFS=$'\n' + + COMPREPLY=($1) +} + __gitcompappend () { local x i=${#COMPREPLY[@]} @@ -283,11 +332,11 @@ __gitcomp_file () __git_ls_files_helper () { if [ "$2" == "--committable" ]; then - git -C "$1" diff-index --name-only --relative HEAD + __git -C "$1" diff-index --name-only --relative HEAD else # NOTE: $2 is not quoted in order to support multiple options - git -C "$1" ls-files --exclude-standard $2 - fi 2>/dev/null + __git -C "$1" ls-files --exclude-standard $2 + fi } @@ -299,99 +348,195 @@ __git_ls_files_helper () # slash. __git_index_files () { - local dir="$(__gitdir)" root="${2-.}" file + local root="${2-.}" file - if [ -d "$dir" ]; then - __git_ls_files_helper "$root" "$1" | - while read -r file; do - case "$file" in - ?*/*) echo "${file%%/*}" ;; - *) echo "$file" ;; - esac - done | sort | uniq - fi + __git_ls_files_helper "$root" "$1" | + while read -r file; do + case "$file" in + ?*/*) echo "${file%%/*}" ;; + *) echo "$file" ;; + esac + done | sort | uniq } +# Lists branches from the local repository. +# 1: A prefix to be added to each listed branch (optional). +# 2: List only branches matching this word (optional; list all branches if +# unset or empty). +# 3: A suffix to be appended to each listed branch (optional). __git_heads () { - local dir="$(__gitdir)" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/heads - return - fi + local pfx="${1-}" cur_="${2-}" sfx="${3-}" + + __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ + "refs/heads/$cur_*" "refs/heads/$cur_*/**" } +# Lists tags from the local repository. +# Accepts the same positional parameters as __git_heads() above. __git_tags () { - local dir="$(__gitdir)" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/tags - return - fi + local pfx="${1-}" cur_="${2-}" sfx="${3-}" + + __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ + "refs/tags/$cur_*" "refs/tags/$cur_*/**" } -# __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 +# Lists refs from the local (by default) or from a remote repository. +# It accepts 0, 1 or 2 arguments: +# 1: The remote to list refs from (optional; ignored, if set but empty). +# Can be the name of a configured remote, a path, or a URL. +# 2: In addition to local refs, list unique branches from refs/remotes/ for +# 'git checkout's tracking DWIMery (optional; ignored, if set but empty). +# 3: A prefix to be added to each listed ref (optional). +# 4: List only refs matching this word (optional; list all refs if unset or +# empty). +# 5: A suffix to be appended to each listed ref (optional; ignored, if set +# but empty). +# +# Use __git_complete_refs() instead. __git_refs () { - local i hash dir="$(__gitdir "${1-}")" track="${2-}" + local i hash dir track="${2-}" + local list_refs_from=path remote="${1-}" local format refs - if [ -d "$dir" ]; then - case "$cur" in + local pfx="${3-}" cur_="${4-$cur}" sfx="${5-}" + local match="${4-}" + local fer_pfx="${pfx//\%/%%}" # "escape" for-each-ref format specifiers + + __git_find_repo_path + dir="$__git_repo_path" + + if [ -z "$remote" ]; then + if [ -z "$dir" ]; then + return + fi + else + if __git_is_configured_remote "$remote"; then + # configured remote takes precedence over a + # local directory with the same name + list_refs_from=remote + elif [ -d "$remote/.git" ]; then + dir="$remote/.git" + elif [ -d "$remote" ]; then + dir="$remote" + else + list_refs_from=url + fi + fi + + if [ "$list_refs_from" = path ]; then + if [[ "$cur_" == ^* ]]; then + pfx="$pfx^" + fer_pfx="$fer_pfx^" + cur_=${cur_#^} + match=${match#^} + fi + case "$cur_" in refs|refs/*) format="refname" - refs="${cur%/*}" + refs=("$match*" "$match*/**") track="" ;; *) for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do - if [ -e "$dir/$i" ]; then echo $i; fi + case "$i" in + $match*) + if [ -e "$dir/$i" ]; then + echo "$pfx$i$sfx" + fi + ;; + esac done - format="refname:short" - refs="refs/tags refs/heads refs/remotes" + format="refname:strip=2" + refs=("refs/tags/$match*" "refs/tags/$match*/**" + "refs/heads/$match*" "refs/heads/$match*/**" + "refs/remotes/$match*" "refs/remotes/$match*/**") ;; esac - git --git-dir="$dir" for-each-ref --format="%($format)" \ - $refs + __git_dir="$dir" __git for-each-ref --format="$fer_pfx%($format)$sfx" \ + "${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 | sort | uniq -u + __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ + --sort="refname:strip=3" \ + "refs/remotes/*/$match*" "refs/remotes/*/$match*/**" | \ + uniq -u fi return fi - case "$cur" in + case "$cur_" in refs|refs/*) - git ls-remote "$dir" "$cur*" 2>/dev/null | \ + __git ls-remote "$remote" "$match*" | \ while read -r hash i; do case "$i" in *^{}) ;; - *) echo "$i" ;; + *) echo "$pfx$i$sfx" ;; esac done ;; *) - echo "HEAD" - git for-each-ref --format="%(refname:short)" -- \ - "refs/remotes/$dir/" 2>/dev/null | sed -e "s#^$dir/##" + if [ "$list_refs_from" = remote ]; then + case "HEAD" in + $match*) echo "${pfx}HEAD$sfx" ;; + esac + __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ + "refs/remotes/$remote/$match*" \ + "refs/remotes/$remote/$match*/**" + else + local query_symref + case "HEAD" in + $match*) query_symref="HEAD" ;; + esac + __git ls-remote "$remote" $query_symref \ + "refs/tags/$match*" "refs/heads/$match*" \ + "refs/remotes/$match*" | + while read -r hash i; do + case "$i" in + *^{}) ;; + refs/*) echo "$pfx${i#refs/*/}$sfx" ;; + *) echo "$pfx$i$sfx" ;; # symbolic refs + esac + done + fi ;; esac } +# Completes refs, short and long, local and remote, symbolic and pseudo. +# +# Usage: __git_complete_refs [