commit 33e95c1902b1709a3db0477002d2544bec236f2a
parent c3956cd8059cd033f1e9b27ac0e2baf3dbff8f9d
Author: William Casarin <jb55@jb55.com>
Date: Tue, 17 Nov 2020 09:15:50 -0800
fzf: default -e and no-sort
Diffstat:
7 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/bin/fuzz-compile b/bin/fuzz-compile
@@ -2,5 +2,5 @@
set -eou pipefail
-make_cmd=$(fuzz-make "$@")
-echo $make_cmd \2\>\&\1\| tee .build-result
+#make_cmd=$(fuzz-make "$@")
+echo make \2\>\&\1\| tee .build-result
diff --git a/bin/fuzz-edit-file b/bin/fuzz-edit-file
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -e
-file=$(rg --files "${1:-.}" | fuzzer)
+file=$(rg --files | fuzzer "$@")
echo $EDITOR \"$(readlink -f $file)\"
diff --git a/bin/fuzz-make b/bin/fuzz-make
@@ -2,6 +2,7 @@
set -eou pipefail
-cmd=$(grep '^[^#[:space:]].*:' Makefile | grep -v PHONY | cut -d: -f1 | sort | fuzzer "$@")
+cmd=$(grep '^[^#[:space:]].*:' Makefile | grep -v PHONY | cut -d: -f1 | sort |
+ env FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --select-1 --exit-0" fuzzer "$@")
echo make $cmd
diff --git a/bin/fuzz-run-hist b/bin/fuzz-run-hist
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
fuzz-compress-hist
-cmd=$(<$HOME/.fuzzhist $FUZZER --tac)
+cmd=$(<$HOME/.fuzzhist $FUZZER --tac --no-sort)
echo $cmd
diff --git a/bin/lessr b/bin/lessr
@@ -4,9 +4,10 @@ dir=$(dirname "$1")
base=$(basename "$1")
export LESSHISTFILE="$dir/.$base.hst"
+touch $ESSHISTFILE || :
# use a fallback dir if it's not writable
-if [[ ! -w "$LESSHISTFILE" ]]
+if [ ! -w "$LESSHISTFILE" ]
then
dir="$HOME/var/marks"
mkdir -p "$dir"
diff --git a/dotfiles/.fzf.zsh b/dotfiles/.fzf.zsh
@@ -1,5 +1,7 @@
# Setup fzf
# ---------
+export FZF_DEFAULT_OPTS="-e --no-sort"
+
if [[ ! "$PATH" == */home/jb55/.fzf/bin* ]]; then
export PATH="$PATH:/home/jb55/.fzf/bin"
fi
diff --git a/dotfiles/commands b/dotfiles/commands
@@ -26,3 +26,4 @@ nt notmuch threads fuzz-notmuch-threads
na notmuch archive fuzz-notmuch-archive
nai notmuch archive inbox fuzz-notmuch-archive-inbox
nq notmuch query fuzz-notmuch-query
+z fz echo fz