Zsh:如何查看所有缓冲区?

发布于 2024-08-29 05:02:59 字数 140 浏览 0 评论 0原文

您可以使用 ^Q 将内容推送到缓冲区,并使用 ESC-g 弹出它们。 Alt+x vi-set-buffer 以某种方式更改缓冲区。我怎样才能看到所有缓冲区?它们可能是一些需要查看的文件。

You can push things to buffer with ^Q and pop them with ESC-g. Alt+x vi-set-buffer changes buffer somehow. How can I see all the buffers? They are probably some files to look at.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

影子的影子 2024-09-05 05:02:59

^Q (和 Esc-Q)和 Esc-g 使用 emacs 缓冲区,所以我认为它们不会与 vi 交互缓冲区。

这适用于 emacs 模式 (set -o emacs):

function _showbuffers()
{
    local nl=

它,请尝试以下每个步骤,在每个步骤后按 Alt-o(字母“O”)或 Esc-o:

  • 要演示 剪切缓冲区,输入 echo abc 然后按 Ctrl-u
  • 要显示终止环(之前的剪切缓冲区移动到那里),输入 echo def 然后按 Ctrl-u (或 Home Ctrl-K 或 Ctrl-X Ctrl-K)
  • 要显示预缓冲区,请输入 echo 'ghi,按 Enter,输入 jkl'
  • 按 Enter 执行上一个命令,然后清除当前缓冲区(不要忘记按 Alt-o 查看更改)
  • 要显示 L 和 R 缓冲区,请输入 echo "mno pqr" 并按向左箭头几次
\n' kr typeset -T kr KR

它,请尝试以下每个步骤,在每个步骤后按 Alt-o(字母“O”)或 Esc-o:

  • 要演示 剪切缓冲区,输入 echo abc 然后按 Ctrl-u
  • 要显示终止环(之前的剪切缓冲区移动到那里),输入 echo def 然后按 Ctrl-u (或 Home Ctrl-K 或 Ctrl-X Ctrl-K)
  • 要显示预缓冲区,请输入 echo 'ghi,按 Enter,输入 jkl'
  • 按 Enter 执行上一个命令,然后清除当前缓冲区(不要忘记按 Alt-o 查看更改)
  • 要显示 L 和 R 缓冲区,请输入 echo "mno pqr" 并按向左箭头几次
\n' KR=($killring) typeset +g -a buffers buffers+=" Pre: ${PREBUFFER:-$nl}" buffers+=" Buffer: $BUFFER$nl" buffers+=" Cut: $CUTBUFFER$nl" buffers+=" L: $LBUFFER$nl" buffers+=" R: $RBUFFER$nl" buffers+="Killring:$nl$nl$kr" zle -M "$buffers" } zle -N showbuffers _showbuffers bindkey "^[o" showbuffers

它,请尝试以下每个步骤,在每个步骤后按 Alt-o(字母“O”)或 Esc-o:

  • 要演示 剪切缓冲区,输入 echo abc 然后按 Ctrl-u
  • 要显示终止环(之前的剪切缓冲区移动到那里),输入 echo def 然后按 Ctrl-u (或 Home Ctrl-K 或 Ctrl-X Ctrl-K)
  • 要显示预缓冲区,请输入 echo 'ghi,按 Enter,输入 jkl'
  • 按 Enter 执行上一个命令,然后清除当前缓冲区(不要忘记按 Alt-o 查看更改)
  • 要显示 L 和 R 缓冲区,请输入 echo "mno pqr" 并按向左箭头几次

^Q (and Esc-Q) and Esc-g work with an emacs buffer, so I don't think they interact with the vi buffers.

This works in emacs mode (set -o emacs):

function _showbuffers()
{
    local nl=

To demonstrate it, try each of these steps, pressing Alt-o (letter "O") or Esc-o after each one:

  • To show the cut buffer, type echo abc then press Ctrl-u
  • To show the kill ring (the previous cut buffer moves there), type echo def then press Ctrl-u (or Home Ctrl-K or Ctrl-X Ctrl-K)
  • To show the pre buffer, type echo 'ghi, press enter, type jkl'
  • Press enter to execute the previous command and clear the current buffer (don't forget to press Alt-o to see the change)
  • To show the L and R buffers, type echo "mno pqr" and press the left arrow a couple of times
\n' kr typeset -T kr KR

To demonstrate it, try each of these steps, pressing Alt-o (letter "O") or Esc-o after each one:

  • To show the cut buffer, type echo abc then press Ctrl-u
  • To show the kill ring (the previous cut buffer moves there), type echo def then press Ctrl-u (or Home Ctrl-K or Ctrl-X Ctrl-K)
  • To show the pre buffer, type echo 'ghi, press enter, type jkl'
  • Press enter to execute the previous command and clear the current buffer (don't forget to press Alt-o to see the change)
  • To show the L and R buffers, type echo "mno pqr" and press the left arrow a couple of times
\n' KR=($killring) typeset +g -a buffers buffers+=" Pre: ${PREBUFFER:-$nl}" buffers+=" Buffer: $BUFFER$nl" buffers+=" Cut: $CUTBUFFER$nl" buffers+=" L: $LBUFFER$nl" buffers+=" R: $RBUFFER$nl" buffers+="Killring:$nl$nl$kr" zle -M "$buffers" } zle -N showbuffers _showbuffers bindkey "^[o" showbuffers

To demonstrate it, try each of these steps, pressing Alt-o (letter "O") or Esc-o after each one:

  • To show the cut buffer, type echo abc then press Ctrl-u
  • To show the kill ring (the previous cut buffer moves there), type echo def then press Ctrl-u (or Home Ctrl-K or Ctrl-X Ctrl-K)
  • To show the pre buffer, type echo 'ghi, press enter, type jkl'
  • Press enter to execute the previous command and clear the current buffer (don't forget to press Alt-o to see the change)
  • To show the L and R buffers, type echo "mno pqr" and press the left arrow a couple of times
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文