加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bash – map jj to Esc in inputrc(readline)

发布时间:2020-12-15 09:07:11 所属栏目:安全 来源:网络整理
导读:我如何映射jj到Esc在inputrc中,所以它被应用程序使用GNU Readline(python,mongoshell,…) 所有工作在zsh使用: bindkey -M viins 'jj' vi-cmd-mode 这是我当前的inputrc: set editing-mode viset keymap vi# turn off the stupid bellset bell-style non
我如何映射jj到Esc在inputrc中,所以它被应用程序使用GNU Readline(python,mongoshell,…)

所有工作在zsh使用:

bindkey -M viins 'jj' vi-cmd-mode

这是我当前的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
您应该重新排列inputrc,以便注释的行在set keymap vi-insert之后。

喜欢这个:

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读