LoginSignup
0

More than 5 years have passed since last update.

fishshellのkey binding modeの切り替え

Last updated at Posted at 2018-01-02

はじめに

fish shell自動補完などが強力ということで、terminal環境を少しでも良くするために試しに使ってみているところです。

fishの環境構築記事こちらなどを参考に環境を整えていました。

詰まったところ

まず、細かいカスタマイズのことはわからないので、
記事の通りにいたのですが、全く書いてある通りに動きません。

CTRL+Rpeco_select_historyが起動するはずなのに起動しない。
直接peco_select_history関数を起動すると、目的の動作をしました。

ということで、key bindingsが一部設定されていないのが原因では?ということで調べてみたら解決しました。

原因と対処

key bindingsが何故かvi modeになっていたせいでした。

fish(2.3以降)には最初からkey bindingsを切り替える機能があり、default(Emacs) modeとvi modeがあります。

以下のコマンドで、default modeに戻せます。

set -U fish_key_bindings fish_default_key_bindings

vi modeにしたい場合は逆に、次のコマンドです。

set -U fish_key_bindings fish_vi_key_bindings

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
0