zsh - ZSH 一直在我粘贴的 URLS 中添加反斜杠
问题描述
我已经尝试过如何使用 URL 和反斜杠禁用 zsh 替换/自动完成的解决方案,但这不再有效。
如果我粘贴一个 URL,它会一直加上反斜杠。很烦人。
例如:
https://www.google.com?test=sample1&test2=sample3
会变成:
curl -X POST "https://www.google.com\?test\=sample1\&test2\=sample3"
~/.zshrc
这是我文件的顶部:
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
DISABLE_MAGIC_FUNCTIONS=true
export ZSH=/Users/myuser/.oh-my-zsh
我已经尝试重新调用源,没有运气。我能够解决这个问题的唯一方法是打开一个 bash shell,这可能非常不方便。
解决方案
搜索后这对我有用
- 打开文件
~/.oh-my-zsh/lib/misc.zsh
- 在下面评论这些行
if [[ $ZSH_VERSION != 5.1.1 ]]; then
for d in $fpath; do
if [[ -e "$d/url-quote-magic" ]]; then
if is-at-least 5.1; then
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
fi
autoload -Uz url-quote-magic
zle -N self-insert url-quote-magic
break
fi
done
fi
最终结果是
autoload -Uz is-at-least
# *-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
# autoload -Uz bracketed-paste-magic
# zle -N bracketed-paste bracketed-paste-magic
# fi
# autoload -Uz url-quote-magic
# zle -N self-insert url-quote-magic
# break
# fi
# done
# fi
## jobs
setopt long_list_jobs
env_default 'PAGER' 'less'
env_default 'LESS' '-R'
## super user alias
alias _='sudo '
## more intelligent acking for ubuntu users
if (( $+commands[ack-grep] )); then
alias afind='ack-grep -il'
else
alias afind='ack -il'
fi
# recognize comments
setopt interactivecomments
相对链接
推荐阅读
- java - 当组合框不是唯一标识时,如何将组合框值设置为数组值?
- c# - 不要纠正在 C# 中的输出
- android - 来自未发布版本的错误报告——我被黑了吗?
- javascript - 添加到数组的对象是按值传递的?
- laravel - 如何修复 Laravel 信息上的 Vue 安装错误
- java - 如何修复糟糕的基本解码?
- html - Text moving during the transition animation
- html - 我的文字
标签在我的 标签,无法弄清楚如何在我的页眉和页脚之间获取它 - python - Python import service_identity 错误:无法导入名称 DNSName
- java - ClassDiagramm 0..1 到 0..1 关系缺少转换成java代码的步骤