地图JJ以Esc键在INPUTRC(readline的) [英] map jj to Esc in inputrc (readline)
本文介绍了地图JJ以Esc键在INPUTRC(readline的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我该如何映射<大骨节病> JJ 骨节病>到<大骨节病> ESC 骨节病>在INPUTRC所以它被用GNU Readline的应用程序回升(蟒蛇,mongoshell,...)
全部采用上zsh中正常工作:
bindkey -M viinsJJVI-CMD模式
这是我目前的INPUTRC:
组编辑模式VI
设置键盘映射六#关闭笨钟
设置钟式无
如果$ MODE = VI
一套键盘映射VI-命令
GG:开始 - - 历史
G:结束历史
#JJ:VI-运动模式
一套键盘映射VI插入
\\ C-W:向后杀字
\\ C-P:历史记录的搜索向后
$ ENDIF
解决方案
您应该使注释行来设置键盘映射VI插入
之后重新排列INPUTRC。
这样的:
组门铃式无
如果$ MODE = VI
一套键盘映射VI-命令
GG:开始 - - 历史
G:结束历史
一套键盘映射VI插入#notice的JJ运动是怎么
JJ:VI-运动模式#after设置键盘布局VI插入?
\\ C-W:向后杀字
\\ C-P:历史记录的搜索向后
$ ENDIF
How can I map jj to Esc in inputrc so it gets picked up by apps using GNU Readline (python, mongoshell, ...)
all works fine on zsh using:
bindkey -M viins 'jj' vi-cmd-mode
this is my current inputrc:
set editing-mode vi
set keymap vi
# turn off the stupid bell
set bell-style none
$if mode=vi
set keymap vi-command
"gg": beginning-of-history
"G": end-of-history
#"jj": vi-movement-mode
set keymap vi-insert
"\C-w": backward-kill-word
"\C-p": history-search-backward
$endif
解决方案
You should rearrange the inputrc so the commented line comes after set keymap vi-insert
.
Like this:
set bell-style none
$if mode=vi
set keymap vi-command
"gg": beginning-of-history
"G": end-of-history
set keymap vi-insert #notice how the "jj" movement is
"jj": vi-movement-mode #after 'set keymap vi-insert'?
"\C-w": backward-kill-word
"\C-p": history-search-backward
$endif
这篇关于地图JJ以Esc键在INPUTRC(readline的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文