Search on history using inputrc

This commit is contained in:
Gerardo J. Puerta 2022-09-07 09:33:01 -05:00
parent d948b4a4d1
commit 01c6c74357
3 changed files with 24 additions and 7 deletions

View File

@ -85,7 +85,7 @@ if [ -x /usr/bin/dircolors ]; then
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
@ -116,25 +116,37 @@ if ! shopt -oq posix; then
fi
fi
for f in ~/.dotfiles/bash/functions/*/*;
# Colors
red='\033[0;31m'
green='\033[0;32m'
nc='\033[0m'
for f in ~/.dotfiles/bash/functions/*/*;
do
echo "Sourcing $f ..."
echo -e "${green} * ${nc} Sourcing $f ..."
. $f
done
if [ -f /usr/share/bash-completion/completions/git ]
then
echo "Adding git completion ..."
echo -e "${green} * ${nc} Adding git completion ..."
source /usr/share/bash-completion/completions/git
fi
echo "Adding local path folders ... ~/.local/bin"
echo -e "${green} * ${nc} Adding local path folders ... ~/.local/bin"
export PATH="$PATH:~/.local/bin"
echo "Setting vim as editor ..."
echo -e "${green} * ${nc} Setting vim as editor ..."
export EDITOR=vim
echo "Initializing starship ..."
echo -e "${green} * ${nc} Initializing starship ..."
eval "$(starship init bash)"
if grep -qEi "(Microsoft|WSL)" /proc/version &> /dev/null
then
echo -e "${green} * ${nc} WSL env detected ..."
export DISPLAY=:0.0
fi
echo -e "Ready${green}!${nc}"

View File

@ -1,2 +1,5 @@
set bell-style none
# map "page up" and "page down" to search history based on current cmdline
"\e[5~": history-search-backward
"\e[6~": history-search-forward

View File

@ -121,3 +121,5 @@ set cuc
" write with superpowers
cmap w!! %!sudo tee > /dev/null %
" highlight search matchs
set hlsearch