bashctrl/plugins/bindings
Alex A. Naanou ce22eb7339 initial commit...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2022-03-23 16:04:39 +03:00

34 lines
1.3 KiB
Plaintext

#======================================================================
# File: bindings.sh
# Written By: Alex A. Naanou <alex_nanou@yahoo.com>
#======================================================================
#===============================================================START==
# internal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#bind -x '"\C-b": SAVE="no";logout'
#mapping management:
alias bind_save="bind -p > ~/.bash/bind_lst"
alias bind_save_bak="bind -p > ~/.bash/bind_lst.bak"
alias bind_clear="read -p 'This may render your shell unusable! are you shure? (yes/no): ' -n 4 answer;test $answer='yes'&&echo boo"
alias bind_revert="bind -f ~/.bash/bind_lst.bak;cp ~/.bash/bind_lst.bak ~/.bash/bind_lst"
# external - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ -a ~/.bash/bind_lst ] ; then
bind -f ~/.bash/bind_lst
else
echo "loading backup bindings..."
if [ -a ~/.bash/bind_lst.bak ] ; then
bind -f ~/.bash/bind_lst.bak
else
echo "loading default bindings..."
# put your default bindings here...
#
cp ~/.bash/bind_lst ~/.bash/bind_lst.bak
fi
fi
#=================================================================END==
true