私はreadlineのhistory-search-forward
とhistory-search-backward
をbashで使うのが大好きです。私は私の.inpurc
に次のようにありますreadline/bashでviモードを使用するとhistory-searchが破損するように見える
# Scroll through matching history with up and down keys
"\e[A":history-search-backward
"\e[B":history-search-forward
と私の歴史の中で一致するコマンドをスクロールするには、上下キーを使用します。
しかし、私がviモードを有効にすると、履歴検索の動作が停止しているようです。私はviのモードは(も.inputrc
に)thusly設定している:私は私の.inputrc
からのviモードに関連する行を削除すると、履歴検索が正常に動作します
# Enable vi mode
set editing-mode vi
set keymap vi-command
# insert/command mode indicator:
set show-mode-in-prompt on
# Indicator formatting in prompt:
set vi-cmd-mode-string "\1\e[0;34m\2[\1\e[0m\2C\1\e[0;34m\2]\1\e[0m\2 "
set vi-ins-mode-string "\1\e[0;34m\2[\1\e[0m\2I\1\e[0;34m\2]\1\e[0m\2 "
。私はそれらを戻すとき、それは壊れます。
両方の機能を同時に有効にする方法はありますか?
私は、OSB Sierraでhomebrewを通じてインストールされたGNU Bash 4.4.12を使用しています。
:
それとも、
bashrc
でこれを書くことができますプログラミングの質問などがありますので、[U&L](http://unix.stackexchange.com/) –