feat(keyboard): Use paste and quote magic

Use both bracketed-paste-magic and url-quote-magic to make pasting urls
into the terminal a little nicer.
NOTE: In rare cases this can break things, and will slow down pasting.
This commit is contained in:
Robert Morrison 2024-02-19 14:59:01 +00:00
parent cd0ec0c563
commit 2ad568db03
Signed by: robert
GPG Key ID: 73E012EB3F4EC696
2 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,8 @@ zle -N history-beginning-search-backward-end \
history-search-end history-search-end
zle -N history-beginning-search-forward-end \ zle -N history-beginning-search-forward-end \
history-search-end history-search-end
zle -N bracketed-paste bracketed-paste-magic
zle -N self-insert url-quote-magic
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line

2
zshrc
View File

@ -14,6 +14,8 @@ autoload -U run-help
autoload -U +X compinit autoload -U +X compinit
autoload -U edit-command-line autoload -U edit-command-line
autoload -U add-zsh-hook autoload -U add-zsh-hook
autoload -U url-quote-magic
autoload -U bracketed-paste-magic
## zmodload Modules ## zmodload Modules
zmodload zsh/complist zmodload zsh/complist