Skip to content

Commit

Permalink
zshrc: url-quote-magic depends on bracketed-paste-magic since zsh 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mika committed Jun 3, 2020
1 parent 9615015 commit 7c3f61b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion etc/zsh/zshrc
Expand Up @@ -113,6 +113,11 @@ fi

# check for version/system
# check for versions (compatibility reasons)
function is51 () {
[[ $ZSH_VERSION == 5.<1->* ]] && return 0
return 1
}

function is4 () {
[[ $ZSH_VERSION == <4->* ]] && return 0
return 1
Expand Down Expand Up @@ -1584,7 +1589,13 @@ zrcautoload zed
# else
# print 'Notice: no url-quote-magic available :('
# fi
alias url-quote='autoload -U url-quote-magic ; zle -N self-insert url-quote-magic'
if is51 ; then
# url-quote doesn't work without bracketed-paste-magic since Zsh 5.1
alias url-quote='autoload -U bracketed-paste-magic url-quote-magic;
zle -N bracketed-paste bracketed-paste-magic; zle -N self-insert url-quote-magic'
else
alias url-quote='autoload -U url-quote-magic ; zle -N self-insert url-quote-magic'
fi

#m# k ESC-h Call \kbd{run-help} for the 1st word on the command line
alias run-help >&/dev/null && unalias run-help
Expand Down

0 comments on commit 7c3f61b

Please sign in to comment.