一般情况下,bash对命令是区分大小写的,当按“上键”时,能够显示前一个历史命令。但是,这还 不太方便,下面的这个配置,可以让bash忽略大小写,而且,能根据输入的命令头按“上“键显示该命令的历史,比如:输入 vim ,然后按”上“键,此时,可以显示上一次运行vim时的那条命令,非常的方便!
下面是该配置的内容,放在用户的home目录下面:
shibo@iZ94wlxkhx8Z:~$ cat .inputrc
set completion-ignore-case on
#For single press Tab results for when a partial or no completion is possible
set show-all-if-ambiguous on
#For results when no completion is possible
set show-all-if-unmodified on
#History completion bound to arrow keys (down, up)
"\e[A": history-search-backward
"\e[B": history-search-forward
#Bash allows to quickly move between words with Ctrl+Left and Ctrl+Right
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word"