aboutsummaryrefslogtreecommitdiff
path: root/.zrc
diff options
context:
space:
mode:
Diffstat (limited to '.zrc')
-rwxr-xr-x.zrc16
1 files changed, 16 insertions, 0 deletions
diff --git a/.zrc b/.zrc
new file mode 100755
index 0000000..6b289fa
--- /dev/null
+++ b/.zrc
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+if [ ! -f /usr/share/z/z.sh -a ! -f /usr/local/etc/profile.d/z.sh ]; then
+ return
+fi
+
+if command -v fzf &> /dev/null; then
+ unalias j 2> /dev/null
+
+ j () {
+ [ $# -gt 0 ] && _z "$*" && return
+ cd "$(_z -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
+ }
+else
+ export _Z_CMD='j'
+fi