From 999c60c0991d30bc3cdfb2e185cae1770bc1a24c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 13 Oct 2019 18:34:55 -0700 Subject: [PATCH] Added support for shift-home and shift-end, as well as a default binding to +spread using them. --- bindings.bb | 4 ++++ bterm.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/bindings.bb b/bindings.bb index 312ff8f..132efa0 100644 --- a/bindings.bb +++ b/bindings.bb @@ -78,6 +78,10 @@ J: # Spread selection down bb +spread:+1 K: # Spread selection up bb +spread:-1 +Shift-Home: # Spread the selection to the top + bb +spread:0 +Shift-End: # Spread the selection to the bottom + bb +spread:100%n Ctrl-a: # Select all files here if [ $BBDOTFILES ]; then find -mindepth 1 -maxdepth 1 -print0; else find -mindepth 1 -maxdepth 1 ! -path '*/.*' -print0; fi | bb +sel: diff --git a/bterm.h b/bterm.h index 037ec62..c61d465 100644 --- a/bterm.h +++ b/bterm.h @@ -179,6 +179,8 @@ int bgetkey(FILE *in, int *mouse_x, int *mouse_y) case 'D': return modifiers | KEY_ARROW_LEFT; case 'F': return modifiers | KEY_END; case 'H': return modifiers | KEY_HOME; + case 'J': return numcode == 2 ? (MOD_SHIFT | KEY_HOME) : -1; + case 'K': return MOD_SHIFT | KEY_END; case 'M': return MOD_CTRL | KEY_DELETE; case 'P': return modifiers | (numcode == 1 ? KEY_F1 : KEY_DELETE); case 'Q': return numcode == 1 ? (modifiers | KEY_F2) : -1;