LoginSignup
1
2

More than 5 years have passed since last update.

zshの履歴補完を前方一致にして引数を補完する

Last updated at Posted at 2013-11-18

.zshrc

bindkey ${key[Up]} history-beginning-search-backward
bindkey ${key[Down]} history-beginning-search-forward

zshにはhistory-beginning-search*という前方一致で履歴をたどる機能がある.
コレを使うと例えば

emacs [ここで補完]

emacs hoge
emacs fuga
emacs ...

のように直近に編集したファイルを辿れたりするので便利.
プレフィックスを何も入れないで使うとただの直近の履歴なのでデフォルトをこちらにしても良い.
ということで上の設定.

$keyの中にはキーマップが入っているらしい

1
2
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
1
2