Bash 设置 vi mode

Bash 设置 vi mode

bash shell在行模式编辑内容时,模式为emacs的操作模式

查看 readline 的 man 手册内容如下

$ man readline
...
editing-mode (emacs)
Controls whether readline begins with a set of key bindings similar to Emacs or vi.
editing-mode can be set to either emacs or vi.
keymap (emacs)
Set the current readline keymap.
The set of legal keymap names is emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command, and vi-insert.
vi is equivalent to vi-command; emacs is equivalent to emacs-standard.
The default value is emacs. The value of editing-mode also affects the default keymap.

编辑 $HOME/.inputrc

vim $HOME/.inputrc
## author: colinx
#
$include /etc/inputrc
set editing-mode vi
set keymap vi
posted @   蟹蟹你哦  阅读(18)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示