From 8142261261167acc2feba3e57ec50defa08ec936 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Mon, 8 Jun 2015 07:07:45 -0400 Subject: [PATCH 01/40] Hide spectrum.zsh var values to avoid junky "set" output to terminal --- lib/spectrum.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index b683aca2..33e819ca 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -3,7 +3,7 @@ # P.C. Shyamshankar # Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ -typeset -Ag FX FG BG +typeset -AHg FX FG BG FX=( reset "%{%}" From 0bda651dfd04801db573c0fc09aa37041e066ae9 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Mon, 8 Jun 2015 07:19:57 -0400 Subject: [PATCH 02/40] Fix the spectrum_ls implementation in spectrum.zsh --- lib/spectrum.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index b683aca2..77e0dddb 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -25,13 +25,13 @@ ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab o # Show all 256 colors with color number function spectrum_ls() { for code in {000..255}; do - print -P -- "$code: %F{$code}$ZSH_SPECTRUM_TEXT%f" + 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() { for code in {000..255}; do - print -P -- "$BG[$code]$code: $ZSH_SPECTRUM_TEXT %{$reset_color%}" + print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}" done } From 3594e27eeb18179f1762751bf32d1bc9f9757f67 Mon Sep 17 00:00:00 2001 From: Chris McCuller Date: Wed, 8 Jul 2015 09:02:23 -0400 Subject: [PATCH 03/40] Nicer formatting --- plugins/ember-cli/README.md | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/plugins/ember-cli/README.md b/plugins/ember-cli/README.md index d1dedf88..ec33ee21 100644 --- a/plugins/ember-cli/README.md +++ b/plugins/ember-cli/README.md @@ -1,22 +1,24 @@ # Ember-cli -**Maintainer:** [BilalBudhani](http://www.github.com/BilalBudhani) +**Maintainer:*[BilalBudhani](http://www.github.com/BilalBudhani) Ember-cli (http://www.ember-cli.com/) ### List of Aliases -alias es='ember serve' -alias ea='ember addon' -alias eb='ember build' -alias ed='ember destroy' -alias eg='ember generate' -alias eh='ember help' -alias ein='ember init' -alias eia='ember install:addon' -alias eib='ember install:bower' -alias ein='ember install:npm' -alias ei='ember install' -alias et='ember test' -alias eu='ember update' -alias ev='ember version' +Alias | Ember-CLI command +----- | ----------------- +**es** | *ember serve* +**ea** | *ember addon* +**eb** | *ember build* +**ed** | *ember destroy* +**eg** | *ember generate* +**eh** | *ember help* +**ein** | *ember init* +**eia** | *ember install:addon* +**eib** | *ember install:bower* +**ein** | *ember install:npm* +**ei** | *ember install* +**et** | *ember test* +**eu** | *ember update* +**ev** | *ember version* From 30ef85664822595e29acdbc840c45d5772d84b5d Mon Sep 17 00:00:00 2001 From: Chris McCuller Date: Thu, 3 Sep 2015 09:47:02 -0400 Subject: [PATCH 04/40] Fix maintainer line --- plugins/ember-cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ember-cli/README.md b/plugins/ember-cli/README.md index ec33ee21..f5eca1ad 100644 --- a/plugins/ember-cli/README.md +++ b/plugins/ember-cli/README.md @@ -1,6 +1,6 @@ # Ember-cli -**Maintainer:*[BilalBudhani](http://www.github.com/BilalBudhani) +**Maintainer:**[BilalBudhani](http://www.github.com/BilalBudhani) Ember-cli (http://www.ember-cli.com/) From d49cacfb7bb96049185c2edfaf3c330b0bde338e Mon Sep 17 00:00:00 2001 From: Victor Torres Date: Fri, 2 Oct 2015 23:16:56 -0300 Subject: [PATCH 05/40] Add branch plugin --- plugins/branch/README.md | 33 ++++++++++++++++++++++++++++++++ plugins/branch/branch.plugin.zsh | 26 +++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 plugins/branch/README.md create mode 100644 plugins/branch/branch.plugin.zsh diff --git a/plugins/branch/README.md b/plugins/branch/README.md new file mode 100644 index 00000000..f970266a --- /dev/null +++ b/plugins/branch/README.md @@ -0,0 +1,33 @@ +# Branch + +Displays the current Git or Mercurial branch fast. + +## Speed test + +### Mercurial + +```shell +$ time hg branch +0.11s user 0.14s system 70% cpu 0.355 total +``` + +### Branch plugin + +```shell +$ time sh /tmp/branch_prompt_info.sh +0.01s user 0.01s system 81% cpu 0.018 total +``` + +## Usage + +Edit your theme file (eg.: `~/.oh-my-zsh/theme/robbyrussell.zsh-theme`) +adding `$(branch_prompt_info)` in your prompt like this: + +```diff +- PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' ++ PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(branch_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +``` + +## Maintainer + +Victor Torres () diff --git a/plugins/branch/branch.plugin.zsh b/plugins/branch/branch.plugin.zsh new file mode 100644 index 00000000..c918ea2b --- /dev/null +++ b/plugins/branch/branch.plugin.zsh @@ -0,0 +1,26 @@ +# Branch: displays the current Git or Mercurial branch fast. +# Victor Torres +# Oct 2, 2015 + +function branch_prompt_info() { + # Defines path as current directory + path=$(pwd) + # While current path is not root path + while [ $path != '/' ]; + do + # Git repository + if [ -d ${path}/.git ]; + then + echo '±' $(/bin/cat ${path}/.git/HEAD | /usr/bin/cut -d / -f 3-) + return; + fi + # Mercurial repository + if [ -d ${path}/.hg ]; + then + echo '☿' $(/bin/cat ${path}/.hg/branch) + return; + fi + # Defines path as parent directory and keeps looking for :) + path=$(/usr/bin/dirname $path) + done +} From ee8f3771e93c940cd1271dad0a6e9b6ab7cad0c4 Mon Sep 17 00:00:00 2001 From: Giordano Vicari Date: Mon, 5 Oct 2015 19:44:00 +0200 Subject: [PATCH 06/40] Added support to subtask through gulp --tasks-simple command --- plugins/gulp/gulp.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh index f7eaefa8..58754952 100644 --- a/plugins/gulp/gulp.plugin.zsh +++ b/plugins/gulp/gulp.plugin.zsh @@ -2,12 +2,12 @@ # # gulp-autocompletion-zsh -# +# # Autocompletion for your gulp.js tasks # # Copyright(c) 2014 André König # MIT Licensed -# +# # # André König @@ -20,7 +20,7 @@ # in the current directory. # function $$gulp_completion { - compls="$(grep -Eo "gulp.task\((['\"](([a-zA-Z0-9]|-)*)['\"],)" gulpfile.js 2>/dev/null | grep -Eo "['\"](([a-zA-Z0-9]|-)*)['\"]" | sed s/"['\"]"//g | sort)" + compls=$(gulp --tasks-simple >/dev/null | sort) completions=(${=compls}) compadd -- $completions From e5164d7b704d34f1f15c297b18cb90ecd22991a0 Mon Sep 17 00:00:00 2001 From: Gustavo Villa Date: Thu, 15 Oct 2015 16:14:54 -0300 Subject: [PATCH 07/40] Add 'rake stats' alias. --- plugins/rails/rails.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index a390c919..8af1d630 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -61,6 +61,7 @@ alias rr='rake routes' alias rrg='rake routes | grep' alias rt='rake test' alias rmd='rake middleware' +alias rsts='rake stats' # legacy stuff alias sstat='thin --stats "/thin/stats" start' From 67abf0f955551e22335f5912a87e92d278afb669 Mon Sep 17 00:00:00 2001 From: Alexander Golikov Date: Thu, 22 Oct 2015 16:58:44 +0500 Subject: [PATCH 08/40] Update frontcube.zsh-theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix «rvm» variable usage in RPROMPT out --- themes/frontcube.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/frontcube.zsh-theme b/themes/frontcube.zsh-theme index d9f5b6d9..539e744f 100644 --- a/themes/frontcube.zsh-theme +++ b/themes/frontcube.zsh-theme @@ -4,7 +4,7 @@ PROMPT=' %{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%} %{$fg[green]%}➞ %{$reset_color%' -RPROMPT='$(git_prompt_info) $(rvm)' +RPROMPT='$(git_prompt_info) ${rvm}' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" From 9e4aba4c8c59c9fce50590f78e12fdff0b69c792 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 1 Nov 2015 00:21:26 +0100 Subject: [PATCH 09/40] archlinux: use $+commands instead of 'command -v' in a subshell --- plugins/archlinux/archlinux.plugin.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index b83c2456..99de5b93 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -2,7 +2,7 @@ # Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins # Look for yaourt, and add some useful functions if we have it. -if [[ -x `command -v yaourt` ]]; then +if (( $+commands[yaourt] )); then upgrade () { yaourt -Syu } @@ -21,11 +21,11 @@ if [[ -x `command -v yaourt` ]]; then alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local") alias yaorph='yaourt -Qtd' # Remove orphans using yaourt # Additional yaourt alias examples - if [[ -x `command -v abs` && -x `command -v aur` ]]; then + if (( $+commands[abs] && $+commands[aur] )); then alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories - elif [[ -x `command -v abs` ]]; then + elif (( $+commands[abs] )); then alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories - elif [[ -x `command -v aur` ]]; then + elif (( $+commands[aur] )); then alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories else alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories @@ -49,11 +49,11 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori alias pacloc='pacman -Qi' # Display information about a given package in the local database alias paclocs='pacman -Qs' # Search for package(s) in the local database # Additional pacman alias examples -if [[ -x `command -v abs` && -x `command -v aur` ]]; then +if (( $+commands[abs] && $+commands[aur] )); then alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories -elif [[ -x `command -v abs` ]]; then +elif (( $+commands[abs] )); then alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories -elif [[ -x `command -v aur` ]]; then +elif (( $+commands[aur] )); then alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories else alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories From cc116f65d621f25a97beee108cfb8884ef5f3518 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Fri, 6 Nov 2015 19:44:26 -0500 Subject: [PATCH 10/40] agnoster: stronger warning about changing SEGMENT_SEPARATOR character --- themes/agnoster.zsh-theme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index e54346ac..c981213f 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -43,7 +43,8 @@ CURRENT_BG='NONE' # This is defined using a Unicode escape sequence so it is unambiguously readable, regardless of # what font the user is viewing this source code in. Do not replace the # escape sequence with a single literal character. - SEGMENT_SEPARATOR=$'\ue0b0' #  + # Do not change this! Do not make it '\u2b80'; that is the old, wrong code point. + SEGMENT_SEPARATOR=$'\ue0b0' } # Begin a segment From b57ddd6a6798a03e0302811e27edb82735280f67 Mon Sep 17 00:00:00 2001 From: WeeBull Date: Thu, 26 Nov 2015 14:08:53 +0000 Subject: [PATCH 11/40] Use actual `commit --amend` command for Mercurial Rather than trying to emulate `git commit --amend` using mercurial queues (which might have side effects if you're using MQ for other things) use the `commit --amend` command which was introduced in Mercurial 2.2 (2012-05-01). --- plugins/mercurial/mercurial.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index 86200ccf..3ae59496 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -14,8 +14,7 @@ alias hgo='hg outgoing' alias hgp='hg push' alias hgs='hg status' alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" ' -# this is the 'git commit --amend' equivalent -alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' +alias hgca='hg commit --amend' # list unresolved files (since hg does not list unmerged files in the status command) alias hgun='hg resolve --list' From a42a3eead76d2e2d20d135853f3fb0b5efc80ede Mon Sep 17 00:00:00 2001 From: Hugh Wang Date: Wed, 2 Dec 2015 12:05:05 +0800 Subject: [PATCH 12/40] Recognize Firefox addon and Android packages. --- plugins/extract/extract.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 690126ba..5d0809e9 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -52,7 +52,7 @@ function extract() { (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; (*.Z) uncompress "$1" ;; - (*.zip|*.war|*.jar|*.sublime-package|*.ipsw) unzip "$1" -d $extract_dir ;; + (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) From 89205f90e533478f231beebbcf7b889bb085159e Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Thu, 3 Dec 2015 11:07:35 +0100 Subject: [PATCH 13/40] znt: faster startup of tools using colorifying (e.g. n-history) --- plugins/zsh-navigation-tools/README.md | 3 +- plugins/zsh-navigation-tools/n-list | 47 +++++++------------------- 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/plugins/zsh-navigation-tools/README.md b/plugins/zsh-navigation-tools/README.md index 670a85ec..630b2e84 100644 --- a/plugins/zsh-navigation-tools/README.md +++ b/plugins/zsh-navigation-tools/README.md @@ -105,8 +105,7 @@ colorize output of the tools, via their config files (check out e.g. n-cd.conf, it uses this). ## Performance -ZNT are fastest with Zsh before 5.0.8 and starting from 5.2 (the version yet to -be released). +ZNT are fastest with Zsh before 5.0.8 and starting from 5.2 vim:filetype=conf diff --git a/plugins/zsh-navigation-tools/n-list b/plugins/zsh-navigation-tools/n-list index 26431a0d..0a98d86e 100644 --- a/plugins/zsh-navigation-tools/n-list +++ b/plugins/zsh-navigation-tools/n-list @@ -116,15 +116,15 @@ _nlist_setup_user_vars() { fi } -_nlist_coloring_list_into_col_list() { +_nlist_colorify_disp_list() { local col=$'\x1b[00;34m' reset=$'\x1b[0m' [ -n "$NLIST_COLORING_COLOR" ] && col="$NLIST_COLORING_COLOR" [ -n "$NLIST_COLORING_END_COLOR" ] && reset="$NLIST_COLORING_END_COLOR" if [ "$NLIST_COLORING_MATCH_MULTIPLE" -eq 1 ]; then - col_list=( "${(@)list//(#mi)$~NLIST_COLORING_PATTERN/$col${MATCH}$reset}" ) + disp_list=( "${(@)disp_list//(#mi)$~NLIST_COLORING_PATTERN/$col${MATCH}$reset}" ) else - col_list=( "${(@)list/(#mi)$~NLIST_COLORING_PATTERN/$col${MATCH}$reset}" ) + disp_list=( "${(@)disp_list/(#mi)$~NLIST_COLORING_PATTERN/$col${MATCH}$reset}" ) fi } @@ -154,7 +154,7 @@ integer inner_width=term_width-3 integer page_height=inner_height integer page_width=inner_width -typeset -a list col_list disp_list +typeset -a list disp_list integer last_element=$# local action local final_key @@ -227,16 +227,10 @@ keypad="" list=( "$@" ) last_element="$#list" -integer is_colored=0 -if [[ -z "$NLIST_SEARCH_BUFFER" && -n "$NLIST_COLORING_PATTERN" ]]; then - is_colored=1 - _nlist_coloring_list_into_col_list -fi - while (( 1 )); do # Do searching (filtering with string) if [ -n "$NLIST_SEARCH_BUFFER" ]; then - # Compute new list, col_list ? + # Compute new list? if [[ "$NLIST_SEARCH_BUFFER" != "$prev_search_buffer" || "$NLIST_IS_UNIQ_MODE" -ne "$prev_uniq_mode" ]]; then prev_search_buffer="$NLIST_SEARCH_BUFFER" prev_uniq_mode="$NLIST_IS_UNIQ_MODE" @@ -290,7 +284,7 @@ while (( 1 )); do disp_list=( "${(@)disp_list//(#mi)($~colsearch_pattern)/$red${MATCH}$reset}" ) fi - # We have display list, lets replace newlines with "\n" when needed (1/3) + # We have display list, lets replace newlines with "\n" when needed (1/2) [ "$NLIST_REPLACE_NEWLINES" -eq 1 ] && disp_list=( "${(@)disp_list//$'\n'/\\n}" ) fi @@ -302,7 +296,7 @@ while (( 1 )); do # There is no search, but there was in previous loop # OR # Uniq mode was entered or left out - # -> compute new list (maybe also col_list) + # -> compute new list if [[ -n "$prev_search_buffer" || "$NLIST_IS_UNIQ_MODE" -ne "$prev_uniq_mode" ]]; then prev_search_buffer="" prev_uniq_mode="$NLIST_IS_UNIQ_MODE" @@ -322,13 +316,6 @@ while (( 1 )); do # Remove duplicates when in uniq mode [ "$NLIST_IS_UNIQ_MODE" -eq 1 ] && typeset -U list - # Apply coloring pattern (when not with search query) - is_colored=0 - if [ -n "$NLIST_COLORING_PATTERN" ]; then - is_colored=1 - _nlist_coloring_list_into_col_list - fi - last_element="$#list" # Called after processing list _nlist_verify_vars @@ -340,22 +327,14 @@ while (( 1 )); do integer end_idx=$(( NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN + page_height - 1 )) [ "$end_idx" -gt "$last_element" ] && end_idx=last_element - if [ "$is_colored" -eq 0 ]; then - if [ "$prev_start_idx" -ne "$NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN" ]; then - prev_start_idx="$NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN" - disp_list=( "${(@)list[NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN, end_idx]}" ) + if [ "$prev_start_idx" -ne "$NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN" ]; then + prev_start_idx="$NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN" + disp_list=( "${(@)list[NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN, end_idx]}" ) - # We have display list, lets replace newlines with "\n" when needed (2/3) - [ "$NLIST_REPLACE_NEWLINES" -eq 1 ] && disp_list=( "${(@)disp_list//$'\n'/\\n}" ) - fi - else - if [ "$prev_start_idx" -ne "$NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN" ]; then - prev_start_idx="$NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN" - disp_list=( "${(@)col_list[NLIST_FROM_WHAT_IDX_LIST_IS_SHOWN, end_idx]}" ) + [ -n "$NLIST_COLORING_PATTERN" ] && _nlist_colorify_disp_list - # We have display list, lets replace newlines with "\n" when needed (3/3) - [ "$NLIST_REPLACE_NEWLINES" -eq 1 ] && disp_list=( "${(@)disp_list//$'\n'/\\n}" ) - fi + # We have display list, lets replace newlines with "\n" when needed (2/2) + [ "$NLIST_REPLACE_NEWLINES" -eq 1 ] && disp_list=( "${(@)disp_list//$'\n'/\\n}" ) fi # Output the list From 2e3731c5b1f0070a076fa84e9e2c35975a962ee5 Mon Sep 17 00:00:00 2001 From: Danyil Bohdan Date: Fri, 4 Dec 2015 14:16:52 +0200 Subject: [PATCH 14/40] "fishy" theme: Shorten path .foo to .f, not . When the current path is /home/user/.config/doublecmd the prompt now reads "/h/u/.c/doublecmd", not "/h/u/./doublecmd" as was the case. This matches what the Fish shell does. Enclose the Perl snippet in single quotes instead of double quotes. --- themes/fishy.zsh-theme | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme index 8b24172a..5937592d 100644 --- a/themes/fishy.zsh-theme +++ b/themes/fishy.zsh-theme @@ -1,13 +1,13 @@ # ZSH Theme emulating the Fish shell's default prompt. _fishy_collapsed_wd() { - echo $(pwd | perl -pe " + echo $(pwd | perl -pe ' BEGIN { - binmode STDIN, ':encoding(UTF-8)'; - binmode STDOUT, ':encoding(UTF-8)'; - }; s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g -") -} + binmode STDIN, ":encoding(UTF-8)"; + binmode STDOUT, ":encoding(UTF-8)"; + }; s|^$HOME|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g; +') +} local user_color='green'; [ $UID -eq 0 ] && user_color='red' PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) ' From c793baeadd2bd290bf1aba0cf522e79cde51fa7a Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Fri, 4 Dec 2015 19:51:09 +0100 Subject: [PATCH 15/40] znt: optimize heap usage for older Zsh's (e.g. 5.0.8) --- plugins/zsh-navigation-tools/n-list | 6 +++++- plugins/zsh-navigation-tools/n-panelize | 11 +++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/zsh-navigation-tools/n-list b/plugins/zsh-navigation-tools/n-list index 0a98d86e..55c08515 100644 --- a/plugins/zsh-navigation-tools/n-list +++ b/plugins/zsh-navigation-tools/n-list @@ -224,7 +224,11 @@ zcurses timeout main -1 key="" keypad="" -list=( "$@" ) +# This loop makes script faster on some Zsh's (e.g. 5.0.8) +repeat 1; do + list=( "$@" ) +done + last_element="$#list" while (( 1 )); do diff --git a/plugins/zsh-navigation-tools/n-panelize b/plugins/zsh-navigation-tools/n-panelize index a70565c7..01d01cb9 100644 --- a/plugins/zsh-navigation-tools/n-panelize +++ b/plugins/zsh-navigation-tools/n-panelize @@ -32,7 +32,11 @@ if [ -t 0 ]; then return 1 fi - list=( `"$@"` ) + # This loop makes script faster on some Zsh's (e.g. 5.0.8) + repeat 1; do + list=( `"$@"` ) + done + # TODO: $? doesn't reach user [ "$?" -eq 127 ] && return $? else @@ -42,7 +46,10 @@ else return 1 fi - list=( "${(@f)"$(<&0)"}" ) + # This loop makes script faster on some Zsh's (e.g. 5.0.8) + repeat 1; do + list=( "${(@f)"$(<&0)"}" ) + done if [[ ! -c /dev/tty ]]; then exec <&2 From 0d45e771c8d3d1f7c465be465fcbdb4169141347 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Sun, 6 Dec 2015 13:56:10 +0100 Subject: [PATCH 16/40] [Composer] redirect stderr to /dev/null for completion commands --- plugins/composer/composer.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 86f5be3d..07eb1de8 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -7,11 +7,11 @@ # Composer basic command completion _composer_get_command_list () { - $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }' + $_comp_command1 --no-ansi 2>/dev/null | sed "1,/Available commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }' } _composer_get_required_list () { - $_comp_command1 show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }' + $_comp_command1 show -s --no-ansi 2>/dev/null | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }' } _composer () { From 357d57c541970f59dd673df38ce166e9454c6da8 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Mon, 7 Dec 2015 14:15:09 +0100 Subject: [PATCH 17/40] znt: include some status information on top of the window --- plugins/zsh-navigation-tools/n-list | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/zsh-navigation-tools/n-list b/plugins/zsh-navigation-tools/n-list index 55c08515..d13e048b 100644 --- a/plugins/zsh-navigation-tools/n-list +++ b/plugins/zsh-navigation-tools/n-list @@ -363,6 +363,11 @@ while (( 1 )); do fi zcurses border main + + local top_msg="${(C)ZSH_NAME} $ZSH_VERSION, shell level $SHLVL, $USER" + zcurses move main 0 $(( term_width / 2 - $#top_msg / 2 )) + zcurses string main $top_msg + zcurses refresh main inner zcurses move main $(( term_height - 1 - 1 )) $(( status_msg_strlen + 2 )) From fb5effd5d8e08e4f35af9b056e2a0bfa5d0e1c5a Mon Sep 17 00:00:00 2001 From: Gregory McCue Date: Thu, 10 Dec 2015 22:58:53 +0100 Subject: [PATCH 18/40] Add Ecosia to web-search plugin. --- plugins/web-search/web-search.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 369a0e68..d3bf97d7 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -13,6 +13,7 @@ function web_search() { yandex "https://yandex.ru/yandsearch?text=" github "https://github.com/search?q=" baidu "https://www.baidu.com/s?wd=" + ecosia "https://www.ecosia.org/search?q=" ) # check whether the search engine is supported @@ -43,6 +44,7 @@ alias ddg='web_search duckduckgo' alias yandex='web_search yandex' alias github='web_search github' alias baidu='web_search baidu' +alias ecosia='web_search ecosia' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From c52f67746b0992bfdbddc57bcd096a595859558c Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Thu, 10 Dec 2015 20:06:01 -0500 Subject: [PATCH 19/40] common-aliases: handle "dev" versions in version check Uses `is-at-least` instead of a numeric comparison hack, so versions with non-numeric bits like "4.5.0-dev5" don't throw errors. --- plugins/common-aliases/common-aliases.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index fc19d73c..c7aafd8b 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -52,7 +52,7 @@ alias mv='mv -i' # zsh is able to auto-do some kungfoo # depends on the SUFFIX :) -if [ ${ZSH_VERSION//\./} -ge 420 ]; then +if is-at-least 4.2.0; then # open browser on urls _browser_fts=(htm html de org net com at cx nl se dk dk php) for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done From b6997f6972191c64edcb5bcefcd4566a111f2883 Mon Sep 17 00:00:00 2001 From: Kaelig Date: Fri, 11 Dec 2015 15:36:55 -0800 Subject: [PATCH 20/40] Update link to git completion --- plugins/git-flow/git-flow.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index 444440bc..d69fcb1b 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -6,7 +6,7 @@ # To achieve git-flow completion nirvana: # # 0. Update your zsh's git-completion module to the newest version. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD +# From here. http://sourceforge.net/p/zsh/code/ci/master/tree/Completion/Unix/Command/_git?format=raw # # 1. Install this file. Either: # From 4fbfb149d3edcfe18b7b008c3a4a8e7523d4b811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 13 Dec 2015 20:36:31 +0100 Subject: [PATCH 21/40] Add back the `-` alias to go to the previous directory The alias was removed in #3564. A couple of users were using it, so I'm adding it back. --- lib/directories.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/directories.zsh b/lib/directories.zsh index 3bffa9fd..a50a692c 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -8,6 +8,7 @@ alias -g ....='../../..' alias -g .....='../../../..' alias -g ......='../../../../..' +alias -- -='cd -' alias 1='cd -' alias 2='cd -2' alias 3='cd -3' From 45822e85c5b2e131d9898cf90710d7ea82006dea Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Mon, 27 Jul 2015 21:01:21 -0400 Subject: [PATCH 22/40] history-substring-search: bind arrows in both emacs and viins modes This avoids an ordering dependency between this and the vi-mode plugin. --- .../history-substring-search.plugin.zsh | 9 ++++++--- .../history-substring-search/update-from-upstream.zsh | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh index 25fd3a2d..7883a65f 100644 --- a/plugins/history-substring-search/history-substring-search.plugin.zsh +++ b/plugins/history-substring-search/history-substring-search.plugin.zsh @@ -13,11 +13,14 @@ fi # Bind terminal-specific up and down keys - +# Bind in both emacs and vi modes so it works in both, and is not +# sensitive to whether this is loaded before or after the vi-mode plugin if [[ -n "$terminfo[kcuu1]" ]]; then - bindkey "$terminfo[kcuu1]" history-substring-search-up + bindkey -M emacs "$terminfo[kcuu1]" history-substring-search-up + bindkey -M viins "$terminfo[kcuu1]" history-substring-search-up fi if [[ -n "$terminfo[kcud1]" ]]; then - bindkey "$terminfo[kcud1]" history-substring-search-down + bindkey -M emacs "$terminfo[kcud1]" history-substring-search-down + bindkey -M viins "$terminfo[kcud1]" history-substring-search-down fi diff --git a/plugins/history-substring-search/update-from-upstream.zsh b/plugins/history-substring-search/update-from-upstream.zsh index 6e6cca5d..81e1942a 100755 --- a/plugins/history-substring-search/update-from-upstream.zsh +++ b/plugins/history-substring-search/update-from-upstream.zsh @@ -76,10 +76,12 @@ cat >> $plugin_basename.plugin.zsh < Date: Sun, 22 Feb 2015 23:07:51 +0100 Subject: [PATCH 23/40] Better research history with arrow keys This change enables UP-arrow and DOWN-arrow full-line history completion. For example, if you write `git clone` and press UP: - Before this change, it will use the last command that starts with `git`. - After this change, it will use the last command that starts with `git clone`. --- lib/key-bindings.zsh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index eb2b5805..0e056dc7 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -27,11 +27,17 @@ if [[ "${terminfo[knp]}" != "" ]]; then bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history fi +# start typing + [Up-Arrow] - fuzzy find history forward if [[ "${terminfo[kcuu1]}" != "" ]]; then - bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward + autoload -U up-line-or-beginning-search + zle -N up-line-or-beginning-search + bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search fi +# start typing + [Down-Arrow] - fuzzy find history backward if [[ "${terminfo[kcud1]}" != "" ]]; then - bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward + autoload -U down-line-or-beginning-search + zle -N down-line-or-beginning-search + bindkey "${terminfo[kcud1]}" down-line-or-beginning-search fi if [[ "${terminfo[khome]}" != "" ]]; then From 6190d3e8ba487c712e1e85ea9c06a02e0bfb04bb Mon Sep 17 00:00:00 2001 From: Kaelig Date: Sun, 13 Dec 2015 16:49:13 -0800 Subject: [PATCH 24/40] Point to the GitHub repository --- plugins/git-flow/git-flow.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index d69fcb1b..a8386cb1 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -6,7 +6,7 @@ # To achieve git-flow completion nirvana: # # 0. Update your zsh's git-completion module to the newest version. -# From here. http://sourceforge.net/p/zsh/code/ci/master/tree/Completion/Unix/Command/_git?format=raw +# From here. https://raw.githubusercontent.com/zsh-users/zsh/master/Completion/Unix/Command/_git # # 1. Install this file. Either: # From d7797503418422148e84bc06c9e446bdd77c3a01 Mon Sep 17 00:00:00 2001 From: moyamo Date: Thu, 19 Nov 2015 19:03:56 +0200 Subject: [PATCH 25/40] Default to using terminfo to set the terminal title Currently, the title is only set on supported terminals (i.e. xterm, urxvt, screen etc.). Using terminfo entries to set the terminal title adds support for many more terminals. --- lib/termsupport.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 7cf15b0a..84c1e186 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -28,6 +28,14 @@ function title { if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then print -Pn "\e]2;$2:q\a" # set window name print -Pn "\e]1;$1:q\a" # set tab name + else + # 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 fi ;; esac From 71deb74552d54630d99ae1db3647ebed7b3bc735 Mon Sep 17 00:00:00 2001 From: moyamo Date: Mon, 14 Dec 2015 13:05:51 +0200 Subject: [PATCH 26/40] Fix indentation --- lib/termsupport.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 84c1e186..871ab28d 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -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 From b15918d414f255f8d2b36c99a338f930d7431b21 Mon Sep 17 00:00:00 2001 From: Danyil Bohdan Date: Mon, 14 Dec 2015 13:35:44 +0200 Subject: [PATCH 27/40] "fishy" theme: Fix "~" use in prompt Actually replace the value of the environment variable $HOME with "~" instead of appending the tilde in front of the prompt. --- themes/fishy.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme index 5937592d..83bd455b 100644 --- a/themes/fishy.zsh-theme +++ b/themes/fishy.zsh-theme @@ -5,7 +5,7 @@ _fishy_collapsed_wd() { BEGIN { binmode STDIN, ":encoding(UTF-8)"; binmode STDOUT, ":encoding(UTF-8)"; - }; s|^$HOME|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g; + }; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g ') } From cf5db83facf67a27faa2860241f6ddc1d7e27b4f Mon Sep 17 00:00:00 2001 From: Victor Torres Date: Mon, 14 Dec 2015 17:39:26 -0300 Subject: [PATCH 28/40] Implementing mcornella's suggestions in pull request 4451. --- plugins/branch/branch.plugin.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/branch/branch.plugin.zsh b/plugins/branch/branch.plugin.zsh index c918ea2b..a1e9ca31 100644 --- a/plugins/branch/branch.plugin.zsh +++ b/plugins/branch/branch.plugin.zsh @@ -4,23 +4,23 @@ function branch_prompt_info() { # Defines path as current directory - path=$(pwd) + local current_dir=$PWD # While current path is not root path - while [ $path != '/' ]; + while [[ $current_dir != '/' ]] do # Git repository - if [ -d ${path}/.git ]; + if [[ -d "${current_dir}/.git" ]] then - echo '±' $(/bin/cat ${path}/.git/HEAD | /usr/bin/cut -d / -f 3-) + echo '±' ${"$(<"$current_dir/.git/HEAD")"##*/} return; fi # Mercurial repository - if [ -d ${path}/.hg ]; + if [[ -d "${current_dir}/.hg" ]] then - echo '☿' $(/bin/cat ${path}/.hg/branch) + echo '☿' $(<"$current_dir/.hg/branch") return; fi # Defines path as parent directory and keeps looking for :) - path=$(/usr/bin/dirname $path) + current_dir="${current_dir:h}" done } From fe63ed09b7a8d8040dbbe9892f89c1c46d4ff75d Mon Sep 17 00:00:00 2001 From: Victor Torres Date: Mon, 14 Dec 2015 20:58:29 -0300 Subject: [PATCH 29/40] Updating speed test info and using zsh command line. --- plugins/branch/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/branch/README.md b/plugins/branch/README.md index f970266a..56ab8da4 100644 --- a/plugins/branch/README.md +++ b/plugins/branch/README.md @@ -14,13 +14,13 @@ $ time hg branch ### Branch plugin ```shell -$ time sh /tmp/branch_prompt_info.sh -0.01s user 0.01s system 81% cpu 0.018 total +$ time zsh /tmp/branch_prompt_info_test.zsh +0.00s user 0.01s system 78% cpu 0.014 total ``` ## Usage -Edit your theme file (eg.: `~/.oh-my-zsh/theme/robbyrussell.zsh-theme`) +Edit your theme file (eg.: `~/.oh-my-zsh/theme/robbyrussell.zsh-theme`) adding `$(branch_prompt_info)` in your prompt like this: ```diff From 9f552130bd0c390420a51bbfd2933c065a1581d0 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Thu, 25 Jun 2015 15:04:01 -0400 Subject: [PATCH 30/40] Move current_branch() from git plugin to core lib/git.zsh Fixes #4085: core -> plugin dependency issue. Rename it to git_current_branch for clarity that it's git-specific. Update all plugins that were calling it to use new name. Fix variable leaks by making more variables in lib/git.zsh local. Have lib/git.zsh use [[ ]] instead of [ ] everywhere. --- lib/git.zsh | 69 ++++++++++++++++++++-------------- plugins/git/git.plugin.zsh | 31 ++++++--------- themes/eastwood.zsh-theme | 4 +- themes/gallois.zsh-theme | 6 ++- themes/josh.zsh-theme | 4 +- themes/juanghurtado.zsh-theme | 4 +- themes/mortalscumbag.zsh-theme | 4 +- themes/peepcode.zsh-theme | 2 +- themes/sunrise.zsh-theme | 1 - 9 files changed, 64 insertions(+), 61 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 1e203c7c..51e323a7 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -1,5 +1,6 @@ -# get the name of the branch we are on +# Outputs current branch info in prompt format function git_prompt_info() { + local ref if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0 @@ -7,9 +8,8 @@ function git_prompt_info() { fi } - # Checks if working tree is dirty -parse_git_dirty() { +function parse_git_dirty() { local STATUS='' local FLAGS FLAGS=('--porcelain') @@ -29,32 +29,26 @@ parse_git_dirty() { fi } -# get the difference between the local and remote branches -git_remote_status() { +# Gets the difference between the local and remote branches +function git_remote_status() { + local remote ahead behind git_remote_status git_remote_status_detailed remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/} - if [[ -n ${remote} ]] ; then + if [[ -n ${remote} ]]; then ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) - if [ $ahead -eq 0 ] && [ $behind -eq 0 ] - then - git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE" - elif [ $ahead -gt 0 ] && [ $behind -eq 0 ] - then + if [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE" git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}" - elif [ $behind -gt 0 ] && [ $ahead -eq 0 ] - then + elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE" git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" - elif [ $ahead -gt 0 ] && [ $behind -gt 0 ] - then + elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" fi - if [ $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ] - then + if [[ -n $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX" fi @@ -62,31 +56,47 @@ git_remote_status() { fi } +# Outputs the name of the current branch +# Usage example: git pull origin $(git_current_branch) +# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if +# it's not a symbolic ref, but in a Git repo. +function git_current_branch() { + local ref + ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null) + local ret=$? + if [[ $ret != 0 ]]; then + [[ $ret == 128 ]] && return # no git repo. + ref=$(command git rev-parse --short HEAD 2> /dev/null) || return + fi + echo ${ref#refs/heads/} +} + + # Gets the number of commits ahead from remote function git_commits_ahead() { if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then - COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ') + local COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ') echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX" fi } # Outputs if current branch is ahead of remote function git_prompt_ahead() { - if [[ -n "$(command git rev-list origin/$(current_branch)..HEAD 2> /dev/null)" ]]; then + if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi } # Outputs if current branch is behind remote function git_prompt_behind() { - if [[ -n "$(command git rev-list HEAD..origin/$(current_branch) 2> /dev/null)" ]]; then + if [[ -n "$(command git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then echo "$ZSH_THEME_GIT_PROMPT_BEHIND" fi } # Outputs if current branch exists on remote or not function git_prompt_remote() { - if [[ -n "$(command git show-ref origin/$(current_branch) 2> /dev/null)" ]]; then + if [[ -n "$(command git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS" else echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING" @@ -95,16 +105,17 @@ function git_prompt_remote() { # Formats prompt string for current git commit short SHA function git_prompt_short_sha() { - SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" + local SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" } # Formats prompt string for current git commit long SHA function git_prompt_long_sha() { - SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" + local SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" } # Get the status of the working tree -git_prompt_status() { +function git_prompt_status() { + local INDEX STATUS INDEX=$(command git status --porcelain -b 2> /dev/null) STATUS="" if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then @@ -150,9 +161,9 @@ git_prompt_status() { echo $STATUS } -#compare the provided version of git to the version installed and on path -#prints 1 if input version <= installed version -#prints -1 otherwise +# 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=$1; local INSTALLED_GIT_VERSION @@ -173,7 +184,7 @@ function git_compare_version() { echo 0 } -#this is unlikely to change so make it all statically assigned +# 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 +# Clean up the namespace slightly by removing the checker function unset -f git_compare_version diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index d78b82df..b851fb97 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -6,19 +6,12 @@ zstyle -s ":vcs_info:git:*:-all-" "command" _omz_git_git_cmd # Functions # -# The current branch name -# Usage example: git pull origin $(current_branch) -# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if -# it's not a symbolic ref, but in a Git repo. +# The name of the current branch +# Back-compatibility wrapper for when this function was defined here in +# the plugin, before being pulled in to core lib/git.zsh as git_current_branch() +# to fix the core -> git plugin dependency. function current_branch() { - local ref - ref=$($_omz_git_git_cmd symbolic-ref --quiet HEAD 2> /dev/null) - local ret=$? - if [[ $ret != 0 ]]; then - [[ $ret == 128 ]] && return # no git repo. - ref=$($_omz_git_git_cmd rev-parse --short HEAD 2> /dev/null) || return - fi - echo ${ref#refs/heads/} + git_current_branch } # The list of remotes function current_repository() { @@ -99,7 +92,7 @@ alias gfo='git fetch origin' alias gg='git gui citool' alias gga='git gui citool --amend' ggf() { -[[ "$#" != 1 ]] && local b="$(current_branch)" +[[ "$#" != 1 ]] && local b="$(git_current_branch)" git push --force origin "${b:=$1}" } compdef _git ggf=git-checkout @@ -107,23 +100,23 @@ ggl() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then git pull origin "${*}" else -[[ "$#" == 0 ]] && local b="$(current_branch)" +[[ "$#" == 0 ]] && local b="$(git_current_branch)" git pull origin "${b:=$1}" fi } compdef _git ggl=git-checkout -alias ggpull='git pull origin $(current_branch)' +alias ggpull='git pull origin $(git_current_branch)' compdef _git ggpull=git-checkout ggp() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then git push origin "${*}" else -[[ "$#" == 0 ]] && local b="$(current_branch)" +[[ "$#" == 0 ]] && local b="$(git_current_branch)" git push origin "${b:=$1}" fi } compdef _git ggp=git-checkout -alias ggpush='git push origin $(current_branch)' +alias ggpush='git push origin $(git_current_branch)' compdef _git ggpush=git-checkout ggpnp() { if [[ "$#" == 0 ]]; then @@ -133,9 +126,9 @@ ggl "${*}" && ggp "${*}" fi } compdef _git ggpnp=git-checkout -alias ggsup='git branch --set-upstream-to=origin/$(current_branch)' +alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)' ggu() { -[[ "$#" != 1 ]] && local b="$(current_branch)" +[[ "$#" != 1 ]] && local b="$(git_current_branch)" git pull --rebase origin "${b:=$1}" } compdef _git ggu=git-checkout diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme index 1b284cdc..88134f8e 100644 --- a/themes/eastwood.zsh-theme +++ b/themes/eastwood.zsh-theme @@ -14,9 +14,9 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Customized git status, oh-my-zsh currently does not allow render dirty status before branch git_custom_status() { - local cb=$(current_branch) + local cb=$(git_current_branch) if [ -n "$cb" ]; then - echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" + echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" fi } diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index d383ed58..515325e3 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -1,3 +1,5 @@ +# Depends on the git plugin for work_in_progress() + ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" @@ -5,9 +7,9 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" #Customized git status, oh-my-zsh currently does not allow render dirty status before branch git_custom_status() { - local cb=$(current_branch) + local cb=$(git_current_branch) if [ -n "$cb" ]; then - echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" + echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" fi } diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme index 12dfe406..c8f0f4dd 100644 --- a/themes/josh.zsh-theme +++ b/themes/josh.zsh-theme @@ -9,7 +9,7 @@ function josh_prompt { (( spare_width = ${COLUMNS} )) prompt=" " - branch=$(current_branch) + branch=$(git_current_branch) ruby_version=$(rvm_prompt_info || rbenv_prompt_info) path_size=${#PWD} branch_size=${#branch} @@ -31,7 +31,7 @@ function josh_prompt { prompt=" $prompt" done - prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(current_branch)" + prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_current_branch)" echo $prompt } diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme index bc470e83..dbdfde7b 100644 --- a/themes/juanghurtado.zsh-theme +++ b/themes/juanghurtado.zsh-theme @@ -1,5 +1,3 @@ -# Needs Git plugin for current_branch method - # Color shortcuts RED=$fg[red] YELLOW=$fg[yellow] @@ -40,4 +38,4 @@ ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]" PROMPT=' %{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%} %{$BLUE%}>%{$RESET_COLOR%} ' -RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' +RPROMPT='%{$GREEN_BOLD%}$(git_current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' diff --git a/themes/mortalscumbag.zsh-theme b/themes/mortalscumbag.zsh-theme index ccce4197..55ece976 100644 --- a/themes/mortalscumbag.zsh-theme +++ b/themes/mortalscumbag.zsh-theme @@ -5,7 +5,7 @@ function my_git_prompt() { STATUS="" # is branch ahead? - if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then + if $(echo "$(git log origin/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" fi @@ -37,7 +37,7 @@ function my_git_prompt() { } function my_current_branch() { - echo $(current_branch || echo "(no branch)") + echo $(git_current_branch || echo "(no branch)") } function ssh_connection() { diff --git a/themes/peepcode.zsh-theme b/themes/peepcode.zsh-theme index ca2a8862..96e4f119 100644 --- a/themes/peepcode.zsh-theme +++ b/themes/peepcode.zsh-theme @@ -28,7 +28,7 @@ git_dirty() { } git_prompt() { - local cb=$(current_branch) + local cb=$(git_current_branch) if [ -n "$cb" ]; then local repo_path=$(git_repo_path) echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)" diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme index 28befd01..57d2649c 100644 --- a/themes/sunrise.zsh-theme +++ b/themes/sunrise.zsh-theme @@ -1,6 +1,5 @@ # Sunrise theme for oh-my-zsh # Intended to be used with Solarized: http://ethanschoonover.com/solarized -# (Needs Git plugin for current_branch method) # Color shortcuts R=$fg_no_bold[red] From 18ca953f12ef41395536776c9bfb5bc76b40b814 Mon Sep 17 00:00:00 2001 From: Robin Hallabro Date: Mon, 29 Jun 2015 07:48:35 +0200 Subject: [PATCH 31/40] Use consistent wording when updating When the user is asked to update oh-my-zsh it says "[Oh My Zsh] Would you like to check for updates? [Y/n]:". When the user agreed to update the next text would say "Upgrading Oh My Zsh" which is inconsistent with the question. --- tools/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index fe8fbadc..d5e7e8ba 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -20,7 +20,7 @@ else NORMAL="" fi -printf "${BLUE}%s${NORMAL}\n" "Upgrading Oh My Zsh" +printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Zsh" cd "$ZSH" if git pull --rebase --stat origin master then From a8157293a776cdf8bd7c192033ab369a2f7bb9cb Mon Sep 17 00:00:00 2001 From: cknoblauch Date: Tue, 6 Oct 2015 18:22:26 -0300 Subject: [PATCH 32/40] colored-man plugin: Quoted PATH variable Some environments (in my case, cygwin) have PATH variables with directories with spaces in them, breaking colored-man. Adding quotes around the PATH environment variable makes the plugin run OK. --- plugins/colored-man-pages/colored-man-pages.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh index 5c613f49..8ff240bf 100644 --- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -27,6 +27,6 @@ man() { LESS_TERMCAP_us=$(printf "\e[1;32m") \ PAGER=/usr/bin/less \ _NROFF_U=1 \ - PATH=${HOME}/bin:${PATH} \ + PATH="$HOME/bin:$PATH" \ man "$@" } From 09d2a597a588abd69647c37b082009125ae07b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 15 Dec 2015 04:09:31 +0100 Subject: [PATCH 33/40] Fix style of colored-man-pages plugin --- .../colored-man-pages.plugin.zsh | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh index 8ff240bf..dd0f241f 100644 --- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -1,32 +1,32 @@ -if [ "$OSTYPE[0,7]" = "solaris" ] +if [ "$OSTYPE" = solaris* ] then - if [ ! -x ${HOME}/bin/nroff ] + if [ ! -x "$HOME/bin/nroff" ] then - mkdir -p ${HOME}/bin - cat > ${HOME}/bin/nroff < "$HOME/bin/nroff" < Date: Tue, 15 Dec 2015 09:35:29 +0100 Subject: [PATCH 34/40] znt: more optimizing workarounds for 5.0.6 <= zsh < 5.2 --- plugins/zsh-navigation-tools/README.md | 2 +- plugins/zsh-navigation-tools/n-list | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/zsh-navigation-tools/README.md b/plugins/zsh-navigation-tools/README.md index 630b2e84..4420dab8 100644 --- a/plugins/zsh-navigation-tools/README.md +++ b/plugins/zsh-navigation-tools/README.md @@ -105,7 +105,7 @@ colorize output of the tools, via their config files (check out e.g. n-cd.conf, it uses this). ## Performance -ZNT are fastest with Zsh before 5.0.8 and starting from 5.2 +ZNT are fastest with Zsh before 5.0.6 and starting from 5.2 vim:filetype=conf diff --git a/plugins/zsh-navigation-tools/n-list b/plugins/zsh-navigation-tools/n-list index d13e048b..388712bd 100644 --- a/plugins/zsh-navigation-tools/n-list +++ b/plugins/zsh-navigation-tools/n-list @@ -243,7 +243,9 @@ while (( 1 )); do # Take all elements, including duplicates and non-selectables typeset +U list - list=( "$@" ) + repeat 1; do + list=( "$@" ) + done # Remove non-selectable elements [ "$#NLIST_NONSELECTABLE_ELEMENTS" -gt 0 ] && for i in "${(nO)NLIST_NONSELECTABLE_ELEMENTS[@]}"; do @@ -309,7 +311,9 @@ while (( 1 )); do # Take all elements, including duplicates and non-selectables typeset +U list - list=( "$@" ) + repeat 1; do + list=( "$@" ) + done # Remove non-selectable elements only when in uniq mode [ "$NLIST_IS_UNIQ_MODE" -eq 1 ] && [ "$#NLIST_NONSELECTABLE_ELEMENTS" -gt 0 ] && From 8042394c7892b06d08e01907ab5d9887c10a252f Mon Sep 17 00:00:00 2001 From: Giordano Vicari Date: Tue, 15 Dec 2015 11:14:25 +0100 Subject: [PATCH 35/40] Update gulp.plugin.zsh Sort pipe dropped and fix 2>/dev/null --- plugins/gulp/gulp.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh index 58754952..2b310513 100644 --- a/plugins/gulp/gulp.plugin.zsh +++ b/plugins/gulp/gulp.plugin.zsh @@ -20,7 +20,7 @@ # in the current directory. # function $$gulp_completion { - compls=$(gulp --tasks-simple >/dev/null | sort) + compls=$(gulp --tasks-simple 2>/dev/null) completions=(${=compls}) compadd -- $completions From 4f314e2a326a0b0934ed7df214b24c2b91f1c82d Mon Sep 17 00:00:00 2001 From: Giordano Vicari Date: Tue, 15 Dec 2015 11:41:36 +0100 Subject: [PATCH 36/40] Update gulp.plugin.zsh Add local stuff --- plugins/gulp/gulp.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh index 2b310513..e941d5a6 100644 --- a/plugins/gulp/gulp.plugin.zsh +++ b/plugins/gulp/gulp.plugin.zsh @@ -20,9 +20,9 @@ # in the current directory. # function $$gulp_completion { - compls=$(gulp --tasks-simple 2>/dev/null) + local compls=$(gulp --tasks-simple 2>/dev/null) - completions=(${=compls}) + local completions=(${=compls}) compadd -- $completions } From 5e310c530814e80b73b166f215225f7fca8be119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 15 Dec 2015 11:52:48 +0100 Subject: [PATCH 37/40] Fix syntax error in colored-man-pages Commit 09d2a597a5 introduced the bug, which is due to using single brackets conditions at the same time as *. This commit should fix it and use double brackets everywhere else. Fixes #4699 --- plugins/colored-man-pages/colored-man-pages.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh index dd0f241f..44e0c71a 100644 --- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -1,6 +1,6 @@ -if [ "$OSTYPE" = solaris* ] +if [[ "$OSTYPE" = solaris* ]] then - if [ ! -x "$HOME/bin/nroff" ] + if [[ ! -x "$HOME/bin/nroff" ]] then mkdir -p "$HOME/bin" cat > "$HOME/bin/nroff" < Date: Tue, 15 Dec 2015 12:14:41 +0100 Subject: [PATCH 38/40] Update gulp.plugin.zsh Remove `local` stuff that cause an error in shell --- plugins/gulp/gulp.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh index e941d5a6..2b310513 100644 --- a/plugins/gulp/gulp.plugin.zsh +++ b/plugins/gulp/gulp.plugin.zsh @@ -20,9 +20,9 @@ # in the current directory. # function $$gulp_completion { - local compls=$(gulp --tasks-simple 2>/dev/null) + compls=$(gulp --tasks-simple 2>/dev/null) - local completions=(${=compls}) + completions=(${=compls}) compadd -- $completions } From 3ebbb40b31fa1ce9f10040742cdb06ea04fa7c41 Mon Sep 17 00:00:00 2001 From: Pavan Rikhi Date: Tue, 15 Dec 2015 10:53:13 -0500 Subject: [PATCH 39/40] colored-man-pages: Use Portable `less` Path --- plugins/colored-man-pages/colored-man-pages.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh index 44e0c71a..54f0bdda 100644 --- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -25,7 +25,7 @@ man() { LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ LESS_TERMCAP_ue=$(printf "\e[0m") \ LESS_TERMCAP_us=$(printf "\e[1;32m") \ - PAGER=/usr/bin/less \ + PAGER="${commands[less]:-$PAGER}" \ _NROFF_U=1 \ PATH="$HOME/bin:$PATH" \ man "$@" From 247a582d09d4d98d6695c2c88797d893be2f3bbd Mon Sep 17 00:00:00 2001 From: Paul Calabro Date: Tue, 15 Dec 2015 22:52:13 -0700 Subject: [PATCH 40/40] Fixed a typo. --- plugins/git-extras/git-extras.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh index 507bf1b2..0dcd630e 100644 --- a/plugins/git-extras/git-extras.plugin.zsh +++ b/plugins/git-extras/git-extras.plugin.zsh @@ -4,7 +4,7 @@ # # Completion script for git-extras (http://github.com/tj/git-extras). # -# This depends on and reueses some of the internals of the _git completion +# This depends on and reuses some of the internals of the _git completion # function that ships with zsh itself. It will not work with the _git that ships # with git. #