强制bash在vi模式下使用的.vimrc [英] Force bash to use .vimrc in vi mode

查看:106
本文介绍了强制bash在vi模式下使用的.vimrc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

猛砸可以设置在vim模式操作。然而,我的的.vimrc 不再使用。具体来说,我的<大骨节病> j的映射 <大骨节病>Ĵ到<大骨节病> ESC 不再起作用。我不得不preSS <大骨节病> ESC 退出插入模式。我如何告诉Bash使用我的的.vimrc 文件?

Bash can be set to operate in vim mode . However, my .vimrc is no longer used. Specifically, my mapping of jj to Esc no longer works. I have to press Esc to exit to insert mode. How do I tell bash to use my .vimrc file?

推荐答案

您正在寻找的bash-的vi模式(这就是:对于bash的VI输入模式,并拥有什么都没有用vi做或VIM)。

You are looking for bash-'s vi mode (which is just that: a vi input mode for bash, and has nothing at all to do with vi or vim).

它的确实的必须做的readline / INPUTRC据我知道,所以你可以看到你是否能

It does have to do with readline/inputrc as far as I know so you could see whether you can


  • 键绑定在bash的方式

  • 从〜/ .inputrc文件

链接:

  • bash vi editing mode
  • .inputrc to make bash command-line editing like ksh
  • [Wikia:]Use vi shortcuts in terminal

最后一个链接中包含的一个较为复杂的例子 .inputrc文件与bash的使用:

The last link contains a somewhat more advanced example of a .inputrc for use with bash:

# Edit options before rerunning previous command, eg: ls a b c -> ls -al a b c
"\e-": "\C-p\C-a\M-f "

# Cycle thru completions.
"\e/": menu-complete

# glob patterns without executing, eg: 'rm *x'
"\ee": glob-expand-word

# Vim style history search
"\e[A": history-search-backward
"\e[B": history-search-forward

"\e[C": forward-char
"\e[D": backward-char

# Two escapes clear command line.
"\e\e": "\C-a\C-k"

这篇关于强制bash在vi模式下使用的.vimrc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆