1
0
Fork 0

Compare commits

...

2 Commits

3 changed files with 25 additions and 19 deletions

19
.bashrc
View File

@ -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\] "

View File

@ -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

View File

@ -32,6 +32,9 @@ if [ ! -d "$(dirname "${HISTFILE}")" ]; then
mkdir -p "$(dirname "${HISTFILE}")"
fi
# .inputrc
export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc
# editor
export EDITOR=vi