From 66e10dc4cc7a597903c86af41d1cffc46b07800a Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Thu, 24 Jun 2021 15:30:40 -0700 Subject: [PATCH] Zoxide --- fish/apps/autojump.fish | 7 ------- fish/apps/zoxide.fish | 3 +++ xonsh/rc.xsh | 3 +++ 3 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 fish/apps/autojump.fish create mode 100644 fish/apps/zoxide.fish diff --git a/fish/apps/autojump.fish b/fish/apps/autojump.fish deleted file mode 100644 index 60fd75a..0000000 --- a/fish/apps/autojump.fish +++ /dev/null @@ -1,7 +0,0 @@ -# ======== -# Autojump -# https://github.com/wting/autojump -# ======== - -[ -f /usr/local/share/autojump/autojump.fish ]; and . /usr/local/share/autojump/autojump.fish -[ -f /usr/share/autojump/autojump.fish ]; and . /usr/share/autojump/autojump.fish diff --git a/fish/apps/zoxide.fish b/fish/apps/zoxide.fish new file mode 100644 index 0000000..b836d62 --- /dev/null +++ b/fish/apps/zoxide.fish @@ -0,0 +1,3 @@ +if which zoxide &> /dev/null + zoxide init fish --cmd j --hook pwd | source +end diff --git a/xonsh/rc.xsh b/xonsh/rc.xsh index 3d7308a..aaeee99 100644 --- a/xonsh/rc.xsh +++ b/xonsh/rc.xsh @@ -10,6 +10,7 @@ _xontribs = [ if _xontribs: xontrib load @(_xontribs) +$UPDATE_OS_ENVIRON = True $XONSH_HISTORY_BACKEND = "sqlite" $HISTCONTROL = "ignoredups" $MULTILINE_PROMPT = " " @@ -86,3 +87,5 @@ aliases["vv"] = find_venv # end # autojump equivalent +if shutil.which("zoxide"): + execx($(zoxide init xonsh --cmd j --hook prompt), 'exec', __xonsh__.ctx, filename='zoxide')