diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2020-08-16 14:53:06 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2020-08-16 14:53:06 -0600 |
commit | f672613e98ba6b30728517b22c0e378557d7fb81 (patch) | |
tree | 40f71cbf5809d181129f812e6466eac0b7cb2509 /plugins | |
parent | 1edd2c43b12f9f2c2ef04cfa0428db0f7fc0aa7c (diff) | |
parent | 079e7bb5e0a79171f3356d55d3f6302a82645a39 (diff) | |
download | zsh-f672613e98ba6b30728517b22c0e378557d7fb81.tar.gz zsh-f672613e98ba6b30728517b22c0e378557d7fb81.tar.bz2 zsh-f672613e98ba6b30728517b22c0e378557d7fb81.zip |
Merge remote-tracking branch 'origin/master' into master
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/colorize/README.md | 8 | ||||
-rw-r--r-- | plugins/colorize/colorize.plugin.zsh | 4 | ||||
-rw-r--r-- | plugins/pipenv/pipenv.plugin.zsh | 3 | ||||
-rw-r--r-- | plugins/pyenv/pyenv.plugin.zsh | 6 | ||||
-rw-r--r-- | plugins/rbenv/rbenv.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/wd/wd.sh | 14 |
6 files changed, 29 insertions, 8 deletions
diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md index ee4ab8036..405bb6d39 100644 --- a/plugins/colorize/README.md +++ b/plugins/colorize/README.md @@ -38,6 +38,14 @@ Pygments offers multiple styles. By default, the `default` style is used, but yo ZSH_COLORIZE_STYLE="colorful" ``` +### Chroma Formatter Settings + +Chroma supports terminal output in 8 color, 256 color, and true-color. If you need to change the default terminal output style from the standard 8 color output, set the `ZSH_COLORIZE_CHROMA_FORMATTER` environment variable: + +``` +ZSH_COLORIZE_CHROMA_FORMATTER=terminal256 +``` + ## Usage * `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided). diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index 6ed9739fa..80b69190f 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -46,7 +46,7 @@ colorize_cat() { if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then pygmentize -O style="$ZSH_COLORIZE_STYLE" -g else - chroma --style="$ZSH_COLORIZE_STYLE" + chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}" fi return $? fi @@ -62,7 +62,7 @@ colorize_cat() { pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME" fi else - chroma --style="$ZSH_COLORIZE_STYLE" "$FNAME" + chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}" "$FNAME" fi done } diff --git a/plugins/pipenv/pipenv.plugin.zsh b/plugins/pipenv/pipenv.plugin.zsh index e7a9e6b3c..4be61a920 100644 --- a/plugins/pipenv/pipenv.plugin.zsh +++ b/plugins/pipenv/pipenv.plugin.zsh @@ -1,6 +1,6 @@ # Pipenv completion _pipenv() { - eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv) + eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv) } compdef _pipenv pipenv @@ -25,6 +25,7 @@ _togglePipenvShell() { } autoload -U add-zsh-hook add-zsh-hook chpwd _togglePipenvShell +_togglePipenvShell # Aliases alias pch="pipenv check" diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index 4c75156bd..b7ae2046f 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -2,7 +2,11 @@ # the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available. # Load pyenv only if command not already available -command -v pyenv &> /dev/null && FOUND_PYENV=1 || FOUND_PYENV=0 +if command -v pyenv &> /dev/null && [[ "$(uname -r)" != *icrosoft* ]]; then + FOUND_PYENV=1 +else + FOUND_PYENV=0 +fi if [[ $FOUND_PYENV -ne 1 ]]; then pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv") diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index 3c964320a..0f2d366e2 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -34,7 +34,7 @@ if [[ $FOUND_RBENV -eq 1 ]]; then } function current_gemset() { - echo "$(rbenv gemset active 2>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)" + echo "$(rbenv gemset active 2>/dev/null)" | tr ' ' '+' } function gems() { diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 802ed10ee..618995c63 100644 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -183,6 +183,11 @@ wd_add() then wd_remove $point > /dev/null printf "%q:%s\n" "${point}" "${PWD/#$HOME/~}" >> $WD_CONFIG + if (whence sort >/dev/null); then + local config_tmp=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX") + # use 'cat' below to ensure we respect $WD_CONFIG as a symlink + sort -o "${config_tmp}" $WD_CONFIG && cat "${config_tmp}" > $WD_CONFIG && rm "${config_tmp}" + fi wd_export_static_named_directories @@ -342,8 +347,8 @@ wd_clean() { wd_export_static_named_directories() { if [[ -z $WD_SKIP_EXPORT ]] then - grep '^[0-9a-zA-Z_-]\+:' "$WD_CONFIG" | sed -e "s,~,$HOME," -e 's/:/=/' | while read warpdir ; do - hash -d "$warpdir" + command grep '^[0-9a-zA-Z_-]\+:' "$WD_CONFIG" | sed -e "s,~,$HOME," -e 's/:/=/' | while read warpdir ; do + hash -d "$warpdir" done fi } @@ -430,7 +435,10 @@ else break ;; "-r"|"--remove"|"rm") - wd_remove $2 + # Loop over all arguments after "rm", separated by whitespace + for pointname in "${@:2}" ; do + wd_remove $pointname + done break ;; "-l"|"list") |