Skip to content

Commit

Permalink
Changed some readline �behavior, bashrc settings for history searchin…
Browse files Browse the repository at this point in the history
…g ang completion behavior
  • Loading branch information
rsherstnev committed Aug 28, 2024
1 parent b264105 commit 422e86e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
35 changes: 28 additions & 7 deletions bash/.bashrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
stty -ixon

HISTCONTROL=ignoreboth
HISTSIZE=10000
HISTFILESIZE=10000
Expand Down Expand Up @@ -26,7 +28,17 @@ if [ -n "$force_color_prompt" ]; then
fi

if [ "$color_prompt" = yes ]; then
PS1="[\[\e[01;38;5;167m\]\u\[\e[01;38;5;144m\]㉿\[\e[01;38;5;216m\]\h \[\e[01;38;5;109m\]\w\[\033[0m\]]$ "
_COLOR1="\[\e[01;38;5;167m\]"
_COLOR2="\[\e[01;38;5;144m\]"
_COLOR3="\[\e[01;38;5;216m\]"
_COLOR4="\[\e[01;38;5;109m\]"
_COLOR_RESET="\[\e[0m\]"
if [ "$(id -u)" != "0" ]; then
PS1="[${_COLOR1}\u${_COLOR2}${_COLOR3}\H ${_COLOR4}\w${_COLOR_RESET}]\n\\$ "
else
_ROOT_WARNING="\[\e[01;38;5;160m\]"
PS1="${_ROOT_WARNING}!!! ROOT !!! ${_COLOR_RESET}[${_COLOR1}\u${_COLOR2}${_COLOR3}\H ${_COLOR4}\w${_COLOR_RESET}]\n\\$ "
fi
else
PS1='[\u@\H \w]\$ '
fi
Expand All @@ -45,17 +57,26 @@ if [ -f ~/.bash_aliases ]; then
fi

if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
source /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
source /etc/bash_completion
fi
if [[ -f /usr/share/bash-completion/bash_completion ]]; then
source /usr/share/bash-completion/bash_completion
elif [[ -f /etc/bash_completion ]]; then
source /etc/bash_completion
elif [[ -f /usr/local/etc/bash_completion ]]; then
source /usr/local/etc/bash_completion
fi
fi

if [[ -d /etc/bash_completion.d/ ]]; then
for file in /etc/bash_completion.d/* ; do
source "$file"
done
fi

export VISUAL=vim
export EDITOR=vim

[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
[ -x /usr/bin/lesspipe ] && export LESSOPEN="|lesspipe %s"

export GREP_COLORS='ms=01;33'

Expand Down
10 changes: 6 additions & 4 deletions bash/.inputrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set completion-ignore-case
"\eOP": menu-complete-backward
"\eOQ": menu-complete
"\e[5~": history-search-backward
"\e[6~": history-search-forward
set echo-control-characters off

"\e[Z": menu-complete
"\e[A": history-search-backward
"\e[B": history-search-forward
"\es": "\C-asudo \C-e"

0 comments on commit 422e86e

Please sign in to comment.