From 9e4e0ee314e6d29538eddf3da9b7ee9704287f3f Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 12 Oct 2019 16:04:19 -0700 Subject: verhaul of terminal keypress handling and labeling to support more functionality for mouse clicking/dragging/left clicking/middle clicking/double clicking and to have more standardized behavior for key names and better handling of key modifiers (Ctrl, Alt, Meta, Shift). Also moved Ctrl-c and Ctrl-z to custom key bindings with (bb +kill and bb +suspend). Mouse clicking is now also handled in key bindings. --- bindings.bb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bindings.bb') diff --git a/bindings.bb b/bindings.bb index 83b6de3..312ff8f 100644 --- a/bindings.bb +++ b/bindings.bb @@ -5,6 +5,10 @@ Section: BB Commands bb +help q,Q: # Quit bb +quit +Ctrl-c: # Exit with failure + bb +kill +Ctrl-z: # Suspend + bb +suspend Section: File Navigation j,Down: # Next file @@ -79,6 +83,14 @@ Ctrl-a: # Select all files here else find -mindepth 1 -maxdepth 1 ! -path '*/.*' -print0; fi | bb +sel: Section: File Actions +Left click: # Move cursor to file + if [ "$BBCLICKED" = "" ]; then + bb +sort:"~$BBMOUSECOL" + elif [ "$BBCLICKED" -a "$BBMOUSECOL" = "*" ]; then + bb +toggle:"$BBCLICKED" + elif [ "$BBCLICKED" ]; then + bb +goto:"$BBCLICKED" + fi Enter,Double left click: # Open file/directory if [ "$(uname)" = "Darwin" ]; then if [ -d "$BBCURSOR" ]; then bb +cd:"$BBCURSOR"; @@ -91,7 +103,7 @@ Enter,Double left click: # Open file/directory fi e: # Edit file in $EDITOR $EDITOR "$BBCURSOR" || pause -d: # Delete a file +d,Delete: # Delete a file printf "\033[1mDeleting \033[33m$BBCURSOR\033[0;1m...\033[0m " && confirm && rm -rf "$BBCURSOR" && bb +deselect:"$BBCURSOR" +refresh D: # Delete all selected files -- cgit v1.2.3