【问题标题】:Stash a command in zsh with key command使用 key 命令在 zsh 中存储命令
【发布时间】:2017-09-15 19:35:00
【问题描述】:

我正在使用 oh-my-zsh 运行。我在命令行上写了一个相当长的提交消息,我在键盘上敲了一些东西,导致它消失了。我按下了向上键,希望它会留在历史中,但它并不存在。

所以,我发牢骚,重写了提交消息,并且在我执行该命令后,我之前编写的命令填充了命令行,准备进行编辑。

有时这似乎是一个方便的功能,可以存储命令以先运行其他内容。我该如何故意这样做?

【问题讨论】:

    标签: zsh oh-my-zsh


    【解决方案1】:

    您可能键入了 Esc-q,它默认绑定到 man zshzle 中记录的 push-line 命令:

    push-line (^Q ESC-Q ESC-q) (unbound) (unbound)
           Push the current buffer onto the  buffer  stack  and  clear  the
           buffer.   Next  time  the  editor  starts up, the buffer will be
           popped off the top of the buffer stack and loaded into the edit-
           ing buffer.
    

    【讨论】:

      猜你喜欢
      • 2012-11-19
      • 2020-01-08
      • 2020-05-30
      • 2016-09-07
      • 1970-01-01
      • 2021-01-01
      • 2019-11-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多