summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-01-14 19:18:30 +0200
committerDylan Araps <dylan.araps@gmail.com>2019-01-14 19:18:30 +0200
commit2d597ce0e4f9b84cbbceb41d11d3225b5227f414 (patch)
treed7b01bba8d363d73dccf101d05f4be5e0a1bb59f
parent58e6262be707868f77a01cf0d22bcef1e3b21606 (diff)
general: Added initial key-bind support.
-rwxr-xr-xfff14
1 files changed, 12 insertions, 2 deletions
diff --git a/fff b/fff
index 47cf997..a5cd8d2 100755
--- a/fff
+++ b/fff
@@ -443,7 +443,17 @@ cmd_line() {
}
key() {
- case "$1" in
+ local key="$1"
+
+ # If user has rebound '-'
+ [[ $1 == "${FFF_PREV_DIR_KEY:-null}" ]] &&
+ key="-"
+
+ # If user has rebound 'h'
+ [[ $1 == "${FFF_PARENT_DIR_KEY:-null}" ]] &&
+ key="h"
+
+ case "$key" in
# Open list item.
# 'C' is what bash sees when the right arrow is pressed ('\e[C').
# '' is what bash sees when the enter/return key is pressed.
@@ -555,7 +565,7 @@ key() {
# Mark files for operation.
y|m|d)
- mark "$scroll" "$1"
+ mark "$scroll" "$key"
;;
# Do the file operation.