aboutsummaryrefslogtreecommitdiff
path: root/bindings.bb
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-10-12 16:04:19 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-10-12 16:04:19 -0700
commit9e4e0ee314e6d29538eddf3da9b7ee9704287f3f (patch)
tree80489672182a27244f39509f51320294f919a61d /bindings.bb
parente9c75a78375cff98bb844d6db8ce15d965cba320 (diff)
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.
Diffstat (limited to 'bindings.bb')
-rw-r--r--bindings.bb14
1 files changed, 13 insertions, 1 deletions
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" = "<column label>" ]; 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