&是什么QUOT;设置键盘映射六"做? [英] What does "set keymap vi" do?
问题描述
我想VIM般的导航为我的终端,所以我说:
组编辑模式VI
设置键盘映射六
要我 .inputrc文件
根据这个文件。 编辑模式VI
补充六导航。这是什么键盘映射VI
做的,为什么我需要它?
从男人的readline
(我的重点):
因此,在你的 INPUTRC
您可以指定不同的模式不同keybinds,因此,例如,命令
模式下,你可以抽出从previous命令<大骨节病>替代骨节病> <大骨节病> p 骨节病>,但这个热键绑定会在插入最后一个参数code>模式(在这个简单的设置反正):
组编辑模式VI一套键盘映射VI-命令
#这些都为VI命令模式
\\ E [A:历史记录的搜索向后
\\ E [B:历史记录的搜索前进
\\ EP:使劲-最后ARG一套键盘映射VI插入
#这些都为VI-插入模式
\\ E [A:历史记录的搜索向后
\\ E [B:历史记录的搜索前进
控制-L:清屏
I wanted vim-like navigation for my terminal, so I added:
set editing-mode vi
set keymap vi
To my .inputrc
file based on this. editing-mode vi
adds vi navigation. What does keymap vi
do, and why do I need it?
From man readline
(my emphasis):
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
Thus, in your inputrc
you can specify different keybinds for the different modes, so, for example, in command
mode you could yank the last argument from the previous command with Altp, but this keybind would have no effect in insert
mode (in this simple setup anyway):
set editing-mode vi
set keymap vi-command
# these are for vi-command mode
"\e[A": history-search-backward
"\e[B": history-search-forward
"\ep": yank-last-arg
set keymap vi-insert
# these are for vi-insert mode
"\e[A": history-search-backward
"\e[B": history-search-forward
Control-l: clear-screen
这篇关于&是什么QUOT;设置键盘映射六&QUOT;做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!