From b0a149076fc39ff2707279c2246744378643c0d5 Mon Sep 17 00:00:00 2001 From: Ben Klein Date: Sat, 16 Jun 2018 20:35:41 -0400 Subject: Allow arguments to `d` to be passed to dirs Replace the alias with a function. Call `dirs` if arguments are given to `d`. --- lib/directories.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/directories.zsh b/lib/directories.zsh index 14064b86f..355c442d2 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -21,7 +21,14 @@ 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' -- cgit v1.2.3-70-g09d2 From 55575b88f9e47d88fab02c26fc69e4af48af1cd9 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 25 Feb 2019 23:20:47 +0100 Subject: lib: optimize default and env_default --- lib/functions.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/functions.zsh b/lib/functions.zsh index 4ef8920f6..9f8736bd7 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -79,7 +79,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 +93,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 + (( ${${(@f):-$(typeset +xg)}[(I)$1]} )) && return 0 + export "$1=$2" && return 3 } -- cgit v1.2.3-70-g09d2 From de2395c678228a5bc6b22711d2bc1b17797d639d Mon Sep 17 00:00:00 2001 From: Konstantin Gizdov Date: Thu, 21 Mar 2019 21:35:00 +0200 Subject: compfix: fix check for empty string (#7674) --- lib/compfix.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/compfix.zsh b/lib/compfix.zsh index 68decc1ed..b09b283f2 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:" -- cgit v1.2.3-70-g09d2 From 8aa8405ea25f768a9bfb9a54d9a0dc05efb4efad Mon Sep 17 00:00:00 2001 From: Jeremy Armstrong Date: Thu, 21 Mar 2019 14:41:55 -0500 Subject: termsupport: add support for tmux* $TERM values (#7622) --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 87d55ee89..aa14f3f07 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -21,7 +21,7 @@ function title { 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 ;; *) -- cgit v1.2.3-70-g09d2 From 30594886bfebefa0c7706dc82f533735d3a58e4b Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 8 Apr 2019 23:01:55 +0200 Subject: lib: delete PS1 default A default PS1 doesn't make sense: the user will either choose a theme or not care about a default prompt since they can set it themselves. Fixes #7054 --- lib/theme-and-appearance.zsh | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib') diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 96f34aa81..773b5972a 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -45,9 +45,6 @@ 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 -- cgit v1.2.3-70-g09d2 From 62abacebea3f93514e41720c689399bcdc74ff39 Mon Sep 17 00:00:00 2001 From: David Remy <19895637+dpremy@users.noreply.github.com> Date: Tue, 9 Apr 2019 04:58:45 -0600 Subject: lib: fix issues with nounset and parameters used before defined (#7433) --- lib/history.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/history.zsh b/lib/history.zsh index d8bbd41c4..52e45bf4c 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' ;; -- cgit v1.2.3-70-g09d2 From 5911aea46c71a2bcc6e7c92e5bebebf77b962233 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 9 Apr 2019 20:38:13 +0200 Subject: lib: stop detecting git versions prior to 1.7.2 The 1.7.2 release was published in July 2010 [1]. It's about time to stop supporting older versions. Fixes #4583 [1] https://github.com/git/git/releases/tag/v1.7.2 --- lib/git.zsh | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'lib') diff --git a/lib/git.zsh b/lib/git.zsh index b92373153..640561e97 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -10,13 +10,10 @@ function git_prompt_info() { # Checks if working tree is dirty function parse_git_dirty() { - local STATUS='' + local STATUS local -a FLAGS - FLAGS=('--porcelain') + FLAGS=('--porcelain' '--ignore-submodules=dirty') 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 @@ -181,28 +178,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() { @@ -214,8 +189,3 @@ function git_current_user_name() { 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 -- cgit v1.2.3-70-g09d2 From cfd30e9e5cfbc26ba838e61ed5b93ce116ed5f4a Mon Sep 17 00:00:00 2001 From: Yannis Mitsos Date: Mon, 22 Apr 2019 17:24:48 +0300 Subject: Colored ls output in FreeBSD #7565 --- lib/theme-and-appearance.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 773b5972a..6b6528273 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' -- cgit v1.2.3-70-g09d2 From ea3e666e04bfae31b37ef42dfe54801484341e46 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 7 May 2019 21:29:10 +0200 Subject: init: run compinit before loading lib/ files --- lib/directories.zsh | 1 + oh-my-zsh.sh | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/directories.zsh b/lib/directories.zsh index 355c442d2..cf87bd7e4 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -21,6 +21,7 @@ alias 9='cd -9' alias md='mkdir -p' alias rd=rmdir + function d () { if [[ -n $1 ]]; then dirs "$@" diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index b1460b1d7..6b2662d5e 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -29,15 +29,6 @@ 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 @@ -71,6 +62,7 @@ if [ -z "$ZSH_COMPDUMP" ]; then fi if [[ $ZSH_DISABLE_COMPFIX != true ]]; then + source $ZSH/lib/compfix.zsh # If completion insecurities exist, warn the user handle_completion_insecurities # Load only from secure directories @@ -80,6 +72,15 @@ else compinit -u -C -d "${ZSH_COMPDUMP}" 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 + # Load all of the plugins that were defined in ~/.zshrc for plugin ($plugins); do if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then -- cgit v1.2.3-70-g09d2 From 299cd4777a8b9da1934a1ed0c80767eea6691a70 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Fri, 6 Nov 2015 17:20:11 -0500 Subject: Themes: switch to using ruby_prompt_info() Changes themes displaying RVM or other Ruby version info to use the central ruby_prompt_info function. This supports more Ruby versioning mechanisms, reduces copy-and-paste code, and avoids "zsh: no such file or directory: rvm-prompt" when run on machines that do not have RVM installed. Changes the prefix/suffix variable names to ZSH_THEME_RUBY_PROMPT_PREFIX and ZSH_THEME_RUBY_PROMPT_SUFFIX, since they apply to all Ruby versioning mechanisms, not just RVM. Allows empty ZSH_THEME_RUBY_PROMPT_PREFIX and ZSH_THEME_RUBY_PROMPT_SUFFIX. --- lib/prompt_info_functions.zsh | 19 ++++++++++++++----- lib/theme-and-appearance.zsh | 2 ++ themes/3den.zsh-theme | 2 +- themes/alanpeabody.zsh-theme | 14 +++++--------- themes/amuse.zsh-theme | 27 ++++++++------------------- themes/bira.zsh-theme | 18 +++++++----------- themes/crunch.zsh-theme | 10 +++------- themes/dallas.zsh-theme | 13 ++++--------- themes/fino-time.zsh-theme | 8 +++----- themes/fino.zsh-theme | 12 +++--------- themes/frontcube.zsh-theme | 5 +++-- themes/gallois.zsh-theme | 4 ++-- themes/gnzh.zsh-theme | 12 +++--------- themes/itchy.zsh-theme | 4 +++- themes/jaischeema.zsh-theme | 10 +++------- themes/macovsky-ruby.zsh-theme | 16 +--------------- themes/macovsky.zsh-theme | 14 ++++++-------- themes/mira.zsh-theme | 20 +++++++------------- themes/simonoff.zsh-theme | 6 +++--- themes/suvash.zsh-theme | 15 +-------------- themes/wedisagree.zsh-theme | 5 ++++- 21 files changed, 86 insertions(+), 150 deletions(-) mode change 100644 => 120000 themes/macovsky-ruby.zsh-theme (limited to 'lib') diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh index 1d5c23e41..5069c4b21 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/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 6b6528273..5016d86ca 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -50,3 +50,5 @@ ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of th 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/themes/3den.zsh-theme b/themes/3den.zsh-theme index 1d2c7db7f..ae3a88659 100644 --- a/themes/3den.zsh-theme +++ b/themes/3den.zsh-theme @@ -1,4 +1,4 @@ -PROMPT=$'%{$fg[white]%}$(~/.rvm/bin/rvm-prompt) %{$fg_bold[cyan]%}%~%{$reset_color%}$(git_prompt_info) %{$fg[cyan]%}%D{[%I:%M:%S]}\ +PROMPT=$'%{$fg[white]%}$(ruby_prompt_info) %{$fg_bold[cyan]%}%~%{$reset_color%}$(git_prompt_info) %{$fg[cyan]%}%D{[%I:%M:%S]}\ %{$fg_bold[green]%}%n$%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}(" diff --git a/themes/alanpeabody.zsh-theme b/themes/alanpeabody.zsh-theme index 4a1b1b386..1de90e57b 100644 --- a/themes/alanpeabody.zsh-theme +++ b/themes/alanpeabody.zsh-theme @@ -1,17 +1,10 @@ local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}' local pwd='%{$fg[blue]%}%~%{$reset_color%}' -local rvm='' -if which rvm-prompt &> /dev/null; then - rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -else - if which rbenv &> /dev/null; then - rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' - fi -fi local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})' local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' +ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="" @@ -24,5 +17,8 @@ ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[green]%}‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" + PROMPT="${user} ${pwd}$ " -RPROMPT="${return_code} ${git_branch} ${rvm}" +RPROMPT="${return_code} ${git_branch} \$(ruby_prompt_info)" diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme index d3f15ace5..3f7ec0bc5 100644 --- a/themes/amuse.zsh-theme +++ b/themes/amuse.zsh-theme @@ -1,17 +1,5 @@ # vim:ft=zsh ts=2 sw=2 sts=2 -rvm_current() { - rvm current 2>/dev/null -} - -rbenv_version() { - rbenv version 2>/dev/null | awk '{print $1}' -} - -PROMPT=' -%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%} -$ ' - # Must use Powerline font, for \uE0A0 to render. ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}\uE0A0 " ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" @@ -19,11 +7,12 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" ZSH_THEME_GIT_PROMPT_CLEAN="" -if [ -e ~/.rvm/bin/rvm-prompt ]; then - RPROMPT='%{$fg_bold[red]%}‹$(rvm_current)›%{$reset_color%}' -else - if which rbenv &> /dev/null; then - RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}' - fi -fi +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg_bold[red]%}‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" + +PROMPT=' +%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%} +$ ' + +RPROMPT='$(ruby_prompt_info)' diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index f73492422..d00f72f5d 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -1,7 +1,6 @@ # ZSH Theme - Preview: https://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - if [[ $UID -eq 0 ]]; then local user_host='%{$terminfo[bold]$fg[red]%}%n@%m %{$reset_color%}' local user_symbol='#' @@ -11,26 +10,23 @@ else fi local current_dir='%{$terminfo[bold]$fg[blue]%}%~ %{$reset_color%}' -local rvm_ruby='' -if which rvm-prompt &> /dev/null; then - rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)› %{$reset_color%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%}' - fi -fi local git_branch='$(git_prompt_info)' +local rvm_ruby='$(ruby_prompt_info)' local venv_prompt='$(virtualenv_prompt_info)' +ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" + PROMPT="╭─${venv_prompt}${user_host}${current_dir}${rvm_ruby}${git_branch} ╰─%B${user_symbol}%b " -RPS1="%B${return_code}%b" +RPROMPT="%B${return_code}%b" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="› %{$reset_color%}" + ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX="%{$fg[green]%}‹" ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="› %{$reset_color%}" - ZSH_THEME_VIRTUALENV_PREFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX ZSH_THEME_VIRTUALENV_SUFFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme index 2fc066381..8278661ab 100644 --- a/themes/crunch.zsh-theme +++ b/themes/crunch.zsh-theme @@ -29,13 +29,9 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" # Our elements: CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" -if [ -e ~/.rvm/bin/rvm-prompt ]; then - CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" -else - if which rbenv &> /dev/null; then - CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" - fi -fi +ZSH_THEME_RUBY_PROMPT_PREFIX="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR" +ZSH_THEME_RUBY_PROMPT_SUFFIX="$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" +CRUNCH_RVM_='$(ruby_prompt_info)' CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) " CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ " diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme index e9e86177b..d6c417fc3 100644 --- a/themes/dallas.zsh-theme +++ b/themes/dallas.zsh-theme @@ -2,14 +2,6 @@ # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}" -# Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -if [ -e ~/.rvm/bin/rvm-prompt ]; then - DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" -else - if which rbenv &> /dev/null; then - DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}" - fi -fi # Grab the current machine name: muscato DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" # Grab the current filepath, use shortcuts: ~/Desktop @@ -28,5 +20,8 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}✗✗✗" +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[white]%}[%{$fg[magenta]%}" +ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$fg[white]%}]%{$reset_color%}" + # Put it all together! -PROMPT="$DALLAS_CURRENT_TIME_$DALLAS_CURRENT_RUBY_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ " +PROMPT="$DALLAS_CURRENT_TIME_\$(ruby_prompt_info)$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ " diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme index 9caebc69e..5679e9f37 100644 --- a/themes/fino-time.zsh-theme +++ b/themes/fino-time.zsh-theme @@ -25,11 +25,7 @@ function box_name { } -rvm_ruby='' -if type rvm-prompt &>/dev/null; then - rvm_ruby='using%{$FG[243]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -fi - +local rvm_ruby='using%{$FG[243]%}$(ruby_prompt_info)' local git_info='$(git_prompt_info)' @@ -40,3 +36,5 @@ ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" +ZSH_THEME_RUBY_PROMPT_PREFIX="‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 28d6cc2ec..1d8bb30e1 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -20,15 +20,7 @@ function box_name { [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} } -local ruby_env='' -if which rvm-prompt &> /dev/null; then - ruby_env='using%{$FG[243]%} ‹$(rvm-prompt i v g)›%{$reset_color%}' -else - if which rbenv &> /dev/null; then - ruby_env='using%{$FG[243]%} ‹$(rbenv version-name)›%{$reset_color%}' - fi -fi - +local ruby_env='using%{$FG[243]%} $(ruby_prompt_info)' local git_info='$(git_prompt_info)' local prompt_char='$(prompt_char)' @@ -40,3 +32,5 @@ ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" +ZSH_THEME_RUBY_PROMPT_PREFIX="‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" diff --git a/themes/frontcube.zsh-theme b/themes/frontcube.zsh-theme index 539e744f8..f9488d0ac 100644 --- a/themes/frontcube.zsh-theme +++ b/themes/frontcube.zsh-theme @@ -1,12 +1,13 @@ -local rvm="%{$fg[green]%}[$(rvm-prompt i v g)]%{$reset_color%}" PROMPT=' %{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%} %{$fg[green]%}➞ %{$reset_color%' -RPROMPT='$(git_prompt_info) ${rvm}' +RPROMPT='$(git_prompt_info) $(ruby_prompt_info)' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[red]%}✖ %{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}] %{$fg[green]%}✔%{$reset_color%}" +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[green]%}[" +ZSH_THEME_RUBY_PROMPT_SUFFIX="]%{$reset_color%}" diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index 515325e38..e6c2d8142 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -14,8 +14,8 @@ git_custom_status() { } # RVM component of prompt -ZSH_THEME_RVM_PROMPT_PREFIX="%{$fg[red]%}[" -ZSH_THEME_RVM_PROMPT_SUFFIX="]%{$reset_color%}" +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}[" +ZSH_THEME_RUBY_PROMPT_SUFFIX="]%{$reset_color%}" # Combine it all into a final right-side prompt RPS1='$(git_custom_status)$(ruby_prompt_info) $EPS1' diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index c763ef3c6..1e6c4e93b 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -29,21 +29,15 @@ local return_code="%(?..%F{red}%? ↵%f)" local user_host="${PR_USER}%F{cyan}@${PR_HOST}" local current_dir="%B%F{blue}%~%f%b" -local rvm_ruby='' -if ${HOME}/.rvm/bin/rvm-prompt &> /dev/null; then # detect user-local rvm installation - rvm_ruby='%F{red}‹$(${HOME}/.rvm/bin/rvm-prompt i v g s)›%f' -elif which rvm-prompt &> /dev/null; then # detect system-wide rvm installation - rvm_ruby='%F{red}‹$(rvm-prompt i v g s)›%f' -elif which rbenv &> /dev/null; then # detect Simple Ruby Version Management - rvm_ruby='%F{red}‹$(rbenv version | sed -e "s/ (set.*$//")›%f' -fi local git_branch='$(git_prompt_info)' -PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} +PROMPT="╭─${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch} ╰─$PR_PROMPT " RPROMPT="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="› %f" +ZSH_THEME_RUBY_PROMPT_PREFIX="%F{red}‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="›%f" } diff --git a/themes/itchy.zsh-theme b/themes/itchy.zsh-theme index e1f2d56e2..41a42e88c 100644 --- a/themes/itchy.zsh-theme +++ b/themes/itchy.zsh-theme @@ -7,10 +7,12 @@ local pwd="%{$fg[yellow]%}%~%{$reset_color%}" PROMPT='${user}${host} ${pwd} ${smiley} ' -RPROMPT='$(rvm-prompt || rbenv version) %{$fg[white]%}$(git_prompt_info)%{$reset_color%}' +RPROMPT='$(ruby_prompt_info) %{$fg[white]%}$(git_prompt_info)%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX="" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✗%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔%{$reset_color%}" +ZSH_THEME_RUBY_PROMPT_PREFIX="" +ZSH_THEME_RUBY_PROMPT_SUFFIX="" diff --git a/themes/jaischeema.zsh-theme b/themes/jaischeema.zsh-theme index da1dd1e5d..50d2bc4a5 100644 --- a/themes/jaischeema.zsh-theme +++ b/themes/jaischeema.zsh-theme @@ -1,16 +1,12 @@ # jaischeema.zsh-theme PROMPT='%{$fg_bold[magenta]%}%m%{$reset_color%} at %{$fg_bold[green]%}%~%{$reset_color%} %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}%{$fg[red]%}❯%{$reset_color%} ' +RPROMPT='$(ruby_prompt_info)' ZSH_THEME_GIT_PROMPT_PREFIX="±(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " -if which rbenv &> /dev/null; then - RPROMPT='%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%}' -else - if which rvm-prompt &> /dev/null; then - RPROMPT='%{$fg[red]%}$(rvm-prompt)%{$reset_color%}' - fi -fi +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}" +ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$reset_color%}" diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme deleted file mode 100644 index abda6232c..000000000 --- a/themes/macovsky-ruby.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -# ZSH Theme - Preview: https://i.gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -if [ -e ~/.rvm/bin/rvm-prompt ]; then - PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' -else - if which rbenv &> /dev/null; then - PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' - fi -fi - -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme new file mode 120000 index 000000000..d3ee200a9 --- /dev/null +++ b/themes/macovsky-ruby.zsh-theme @@ -0,0 +1 @@ +macovsky.zsh-theme \ No newline at end of file diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme index d3f7d16b4..f527e5861 100644 --- a/themes/macovsky.zsh-theme +++ b/themes/macovsky.zsh-theme @@ -1,14 +1,12 @@ # ZSH Theme - Preview: https://i.gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -if [ -e ~/.rvm/bin/rvm-prompt ]; then - PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' -else - if which rbenv &> /dev/null; then - PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' - fi -fi -RPS1="${return_code}" +PROMPT='%{$fg[green]%}%~%{$reset_color%} $(ruby_prompt_info) $(git_prompt_info)%{$reset_color%}%B$%b ' +RPROMPT="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" + + +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/mira.zsh-theme b/themes/mira.zsh-theme index e6c952998..a7c60359c 100644 --- a/themes/mira.zsh-theme +++ b/themes/mira.zsh-theme @@ -4,22 +4,13 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' -local rvm_ruby='' -if which rvm-prompt &> /dev/null; then - rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' - fi -fi +local nvm_node='%{$fg[green]%}‹node-$(nvm_prompt_info)›%{$reset_color%}' -local nvm_node='' -nvm_node='%{$fg[green]%}‹node-$(nvm_prompt_info)›%{$reset_color%}' +local jenv_java='%{$fg[blue]%}‹$(jenv_prompt_info)›%{$reset_color%}' -local jenv_java='' -jenv_java='%{$fg[blue]%}‹$(jenv_prompt_info)›%{$reset_color%}' +local git_branch='$(git_prompt_info)' -local git_branch='$(git_prompt_info)%{$reset_color%}' +local rvm_ruby='$(ruby_prompt_info)' PROMPT="╭─${user_host} ${current_dir} ${nvm_node} ${rvm_ruby} ${jenv_java} ${git_branch} ╰─%B$%b " @@ -27,3 +18,6 @@ RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" + +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" diff --git a/themes/simonoff.zsh-theme b/themes/simonoff.zsh-theme index 63ce4261b..ef91c5ee3 100644 --- a/themes/simonoff.zsh-theme +++ b/themes/simonoff.zsh-theme @@ -23,7 +23,7 @@ function precmd { local promptsize=${#${(%):---(%n@%M:%l)---()}} local pwdsize=${#${(%):-%~}} local gitbranch="$(git_prompt_info)" - local rvmprompt="$(rvm_prompt_info)" + local rvmprompt="$(ruby_prompt_info)" local gitbranchsize=${#${gitbranch:-''}} local rvmpromptsize=${#${rvmprompt:-''}} @@ -90,8 +90,8 @@ setprompt () { ZSH_THEME_GIT_PROMPT_SUFFIX="]" ### # Modify RVM prompt - ZSH_THEME_RVM_PROMPT_PREFIX=" [" - ZSH_THEME_RVM_PROMPT_SUFFIX="]" + ZSH_THEME_RUBY_PROMPT_PREFIX=" [" + ZSH_THEME_RUBY_PROMPT_SUFFIX="]" ### diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme index 1680973df..850476cdf 100644 --- a/themes/suvash.zsh-theme +++ b/themes/suvash.zsh-theme @@ -8,20 +8,7 @@ function virtualenv_info { [[ -n "$VIRTUAL_ENV" ]] && echo '('${VIRTUAL_ENV:t}') ' } -function ruby_prompt { - if (( $+commands[rvm-prompt] )); then - print -n $ZSH_THEME_RUBY_PROMPT_PREFIX - print -n $(~/.rvm/bin/rvm-prompt) - print -n $ZSH_THEME_RUBY_PROMPT_SUFFIX - elif (( $+commands[rbenv] )); then - print -n $ZSH_THEME_RUBY_PROMPT_PREFIX - print -n $(rbenv version | sed -e "s/ (set.*$//") - print -n $ZSH_THEME_RUBY_PROMPT_SUFFIX - fi - return 0 -} - -PROMPT='%F{magenta}%n%f at %F{yellow}%m%f in %B%F{green}%~%f%b$(git_prompt_info)$(ruby_prompt) +PROMPT='%F{magenta}%n%f at %F{yellow}%m%f in %B%F{green}%~%f%b$(git_prompt_info)$(ruby_prompt_info) $(virtualenv_info) $(prompt_char) ' ZSH_THEME_GIT_PROMPT_PREFIX=' on %F{magenta}' diff --git a/themes/wedisagree.zsh-theme b/themes/wedisagree.zsh-theme index 9bdbce40d..07006ecd9 100644 --- a/themes/wedisagree.zsh-theme +++ b/themes/wedisagree.zsh-theme @@ -28,7 +28,7 @@ PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}$(git_prompt_ahead)%{$reset_color%}' # Add this at the start of RPROMPT to include rvm info showing ruby-version@gemset-name -# %{$fg[yellow]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} +# $(ruby_prompt_info) # local time, color coded by last return code time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}" @@ -48,6 +48,9 @@ ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➜" # ⓡ ⑄ ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ♒" # ⓤ ⑊ ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%} 𝝙" +ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[yellow]%}" +ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$reset_color%}" + # More symbols to choose from: # ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ # ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠ -- cgit v1.2.3-70-g09d2 From 486fa1010df847bfd8823b4492623afc7c935709 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 11 May 2019 13:42:38 +0200 Subject: lib: add ability to disable magic functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #5499 Fixes #5569 Fixes #6338 Fixes #6654 Fixes #6255 Fixes #7632 Closes #7763 Co-authored-by: Daniel Galán y Martins --- lib/misc.zsh | 6 +++--- templates/zshrc.zsh-template | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/misc.zsh b/lib/misc.zsh index b30822b50..40ffa479d 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -1,7 +1,7 @@ -## 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 diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 453daf8a2..3cc5ad46c 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -32,6 +32,9 @@ ZSH_THEME="robbyrussell" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS=true + # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" -- cgit v1.2.3-70-g09d2 From e604eaf55e1c5b19035778c0e0adb0dd6e344b94 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 19 Aug 2019 18:17:17 +0200 Subject: lib: delete LC_CTYPE locale setting which causes problems Fixes #7942 --- lib/misc.zsh | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib') diff --git a/lib/misc.zsh b/lib/misc.zsh index 40ffa479d..36c3ae2e5 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -31,10 +31,5 @@ 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 -- cgit v1.2.3-70-g09d2