4
4

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.

Bash/Zshでviキーバインディング

Posted at

出典:Use vi shortcuts in terminal

まとめ

  • Bashの場合、~/.inputrc に以下を追記
~/.inputrc
set editing-mode vi
set keymap vi-command

しかしこれ、readlineにリンクしてるバイナリだと全面的に効いちゃう(editline環境だとどうなるんだろう)。Bash限定なら下記。

~/.bashrc
set -o vi
  • Zshの場合、~/.zshrc に以下を追記
~/.zshrc
bindkey -v 

書き換えたらexec $0でシェル再起動。

チートシート

Bash(Readline)の場合のチートシートはある。

TODO

  • Zsh用のチートシートはどこかにあるか?
  • 画面中にモード表示できる方法を探す。見た目でわからないと結構つらい。
4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?