`.bashrc`, `readline`: add `readline` config
parent
9a9eef9224
commit
e8d366bd61
19
.bashrc
19
.bashrc
|
@ -9,25 +9,6 @@ HISTCONTROL=ignoredups:erasedups
|
|||
trap "history -n; history -w; history -c; history -r;" EXIT
|
||||
PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
|
||||
|
||||
# readline
|
||||
set -o vi
|
||||
bind 'set show-mode-in-prompt on'
|
||||
bind 'set vi-ins-mode-string \1\e[01;35m\2+\1\e[0m\2'
|
||||
bind 'set vi-cmd-mode-string :'
|
||||
bind 'set keyseq-timeout 0'
|
||||
|
||||
bind 'set keymap vi-command'
|
||||
bind 'j:history-search-forward'
|
||||
bind 'k:history-search-backward'
|
||||
bind 'set keymap vi-insert'
|
||||
bind '"\e[A":history-search-backward'
|
||||
bind '"\e[B":history-search-forward'
|
||||
|
||||
bind 'set show-all-if-ambiguous on'
|
||||
bind 'set completion-display-width 0'
|
||||
bind 'set colored-stats on'
|
||||
bind 'set visible-stats on'
|
||||
|
||||
# prompt
|
||||
PS1="\[\033[01m\]\u@\h:\[\e[01;34m\]\w\[\e[37m\]\$\[\e[00m\] "
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
$include /etc/inputrc
|
||||
|
||||
set editing-mode vi
|
||||
set show-mode-in-prompt on
|
||||
set vi-ins-mode-string \1\e[01;35m\2+\1\e[0m\2
|
||||
set vi-cmd-mode-string \1\e[01;34m\2:\1\e[0m\2
|
||||
set keyseq-timeout 0
|
||||
|
||||
set keymap vi-command
|
||||
j:history-search-forward
|
||||
k:history-search-backward
|
||||
"\e[A":history-search-backward
|
||||
"\e[B":history-search-forward
|
||||
set keymap vi-insert
|
||||
"\e[A":history-search-backward
|
||||
"\e[B":history-search-forward
|
||||
control-l:clear-screen
|
||||
|
||||
set show-all-if-ambiguous on
|
||||
set completion-display-width 0
|
||||
set colored-stats on
|
||||
set visible-stats on
|
Loading…
Reference in New Issue