1
0
Fork 0

.bashrc: update

main
urosm 2024-07-07 22:13:55 +02:00
parent 81df236bd8
commit cf1bc18614
1 changed files with 24 additions and 24 deletions

48
.bashrc
View File

@ -3,27 +3,33 @@
# if not running interactively, don't do anything # if not running interactively, don't do anything
[ -z "$PS1" ] && return [ -z "$PS1" ] && return
# history
HISTFILESIZE=-1
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 # readline
bind "set editing-mode vi" set -o vi
bind "set keyseq-timeout 0" bind 'set show-mode-in-prompt on'
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-ins-mode-string \1\e[01;35m\2+\1\e[0m\2" bind 'set vi-cmd-mode-string :'
bind "set vi-cmd-mode-string :" bind 'set keyseq-timeout 0'
bind "set keymap vi-command" bind 'set keymap vi-command'
bind "j:history-substring-search-forward" bind 'j:history-search-forward'
bind "k:history-substring-search-backward" bind 'k:history-search-backward'
bind "set keymap vi-insert" bind 'set keymap vi-insert'
bind '"\e[A":history-substring-search-backward' bind '"\e[A":history-search-backward'
bind '"\e[B":history-substring-search-forward' bind '"\e[B":history-search-forward'
bind "set show-all-if-ambiguous on" bind 'set show-all-if-ambiguous on'
bind "set completion-display-width 0" bind 'set completion-display-width 0'
bind "set colored-stats on" bind 'set colored-stats on'
bind "set visible-stats on" bind 'set visible-stats on'
# prompt # prompt
PS1="\[\e[1m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\[\e[1m\]\$\[\e[0m\] " PS1="\[\033[01m\]\u@\h:\[\e[01;34m\]\w\[\e[37m\]\$\[\e[00m\] "
# title # title
PS1="\[\e]0;\u@\h:\w\a\]$PS1" PS1="\[\e]0;\u@\h:\w\a\]$PS1"
@ -35,13 +41,7 @@ alias grep="grep --color=auto"
alias ls="ls --color=auto" alias ls="ls --color=auto"
alias ll="ls -AF1" alias ll="ls -AF1"
alias lll="ls -AFlh" alias lll="ls -AFlh"
alias ff="find 2>/dev/null"
# history
shopt -u histappend
HISTSIZE=-1
HISTFILESIZE=-1
HISTIGNORE='exit:q:ls:ll:lll'
HISTCONTROL='ignoreboth:erasedups'
# bash completion # bash completion
if ! shopt -oq posix; then if ! shopt -oq posix; then
@ -67,4 +67,4 @@ osc7_cwd() {
done done
printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}" printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}"
} }
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }osc7_cwd PROMPT_COMMAND="osc7_cwd; $PROMPT_COMMAND"