16
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

zshのviキーバインドでコマンドラインスタック+α

Posted at
  • デフォルトのviキーバインドだとEsc-qで動作しない
  • スタックしたものが見えない
  • Esc-qは押しにくい(個人的に)

というわけで、viキーバインドでC-qでスタックし、その内容を表示しておくようにしてみた。

~/.zshrc
show_buffer_stack() {
  POSTDISPLAY="
stack: $LBUFFER"
  zle push-line-or-edit
}
zle -N show_buffer_stack
setopt noflowcontrol
bindkey '^Q' show_buffer_stack

noflowcontrolはC-s/C-qを使ったflowcontrolを無効にするものらしい。使ってないのでここではオフにした上でC-qにマッピングしている。

参考にしたもの:

16
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?