diff options
author | Guangxiong Lin <[email protected]> | 2022-03-26 18:46:35 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-03-26 18:46:35 +0800 |
commit | 964332d61e6dc9f6c42050cfacafb830fbead1e6 (patch) | |
tree | 660c0982e2264f640b13d3ea580c5ded48088619 /.zrc | |
parent | 9892efdeb78273f72b2987f72673dd38eecec5d7 (diff) | |
download | dotfiles-964332d61e6dc9f6c42050cfacafb830fbead1e6.tar.gz dotfiles-964332d61e6dc9f6c42050cfacafb830fbead1e6.tar.bz2 dotfiles-964332d61e6dc9f6c42050cfacafb830fbead1e6.zip |
Update the config of z
Diffstat (limited to '.zrc')
-rwxr-xr-x | .zrc | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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 |