命令行Zsh中的注释 [英] Comments in command-line Zsh
问题描述
我最近在Ubuntu上从Bash切换到Zsh,对此我感到非常高兴.但是,有些事情我真的很想念,但我没有找到如何实现同一目标的方法.
I switched quite recently from Bash to Zsh on Ubuntu and I'm quite happy about it. However, there is something I really miss and I did not find how to achieve the same thing.
在Bash中,每当我键入一个长命令并发现必须先运行其他命令时,我都必须将其注释掉,如下所示:
In Bash, whenever I was typing a long command and noticed I had to run something else before, I just had to comment it out like in the following:
me@home> #mysuperlongcommand with some arguments
me@home> thecommandIhavetorunfirst #and then: then up up
me@home> #mysuperlongcommand with some arguments #I just need to uncomment it!
但是,这种给定的情况并不像使用 zsh
那样容易解决,因为 #mysuperlongcommand
将像这样运行(并导致: zsh:找不到命令:#mysuperlongcommand
.
However, this quite recurrent situation is not as easy to address as with zsh
, given #mysuperlongcommand
will be run as such (and resulting in: zsh: command not found: #mysuperlongcommand
.
推荐答案
刚开始尝试zsh,我也遇到了这个问题.您可以执行 setopt交互式注释
来激活bash样式的注释.
Having just started trying out zsh, I ran into this problem too. You can do setopt interactivecomments
to activate the bash-style comments.
这篇关于命令行Zsh中的注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!