new feature: fzf
[distro-setup] / brc
diff --git a/brc b/brc
index 7d58392d65fe59e5870d862232690bb74a527291..d17c1a132e70ee4b7bc0f3f01bc39210ccf7f6bb 100644 (file)
--- a/brc
+++ b/brc
@@ -279,6 +279,15 @@ mysrc() {
 mysrc /a/bin/small-misc-bash/ll-function
 mysrc /a/bin/distro-functions/src/package-manager-abstractions
 
+# things to remember:
+# ALT-C - cd into the selected directory
+# CTRL-T - Paste the selected file path into the command line
+#
+# good guide to some of its basic features is the readme file
+# https://github.com/junegunn/fzf
+if [[ -s /usr/share/doc/fzf/examples/key-bindings.bash ]]; then
+  source /usr/share/doc/fzf/examples/key-bindings.bash
+fi
 
 # * functions
 
@@ -1013,7 +1022,7 @@ ccomp tail etail etail2
 
 showkeys() {
   ssh "$@" cat .ssh/authorized_keys{,2}
-  }
+}
 
 
 # print exim old pids
@@ -2573,6 +2582,10 @@ if [[ $- == *i* ]]; then
     if [[ $MAIL_HOST && $MAIL_HOST != "$HOSTNAME" ]]; then
       ps_char="@ $ps_char"
     fi
+    jobs_char=
+    if [[ $(jobs -p) ]]; then
+      jobs_char='\j '
+    fi
     # We could test if sudo is active with sudo -nv
     # but then we get an email and log of lots of failed sudo commands.
     # We could turn those off, but seems better not to.
@@ -2582,7 +2595,7 @@ if [[ $- == *i* ]]; then
     if [[ ! $HISTFILE ]]; then
       ps_char="NOHIST $ps_char"
     fi
-    PS1="${PS1%"${PS1#*[wW]}"} $psudo\[$ps_color\]$ps_char\[$term_nocolor\] "
+    PS1="${PS1%"${PS1#*[wW]}"} $jobs_char$psudo\[$ps_color\]$ps_char\[$term_nocolor\] "
 
     # set titlebar. instead, using more advanced
     # titelbar below