From 6d879a6cee2a3831eb292063d32854b1d080c1af Mon Sep 17 00:00:00 2001 From: rabite Date: Sat, 6 Apr 2019 17:31:43 +0200 Subject: [PATCH] add hunter_cd.sh --- README.md | 2 ++ extra/hunter_cd.sh | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 extra/hunter_cd.sh diff --git a/README.md b/README.md index 20aeae2..bb6ae94 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ hunter reads $XDG_CONFIG_HOME/hunter/config at startup. There are two options, w animation=on show_hidden=off +## Drop into hunter cwd on quit +To change the directory of your shell when quitting hunter with Q you need to source extra/hunter_cd.sh, which is a wrapper that runs hunter and checks for ~/.hunter_cwd after hunter exits and cd's into the contained directory if it exists. Keybindings: diff --git a/extra/hunter_cd.sh b/extra/hunter_cd.sh new file mode 100644 index 0000000..6d73be1 --- /dev/null +++ b/extra/hunter_cd.sh @@ -0,0 +1,6 @@ +function hunter() { + env hunter + test -e ~/.hunter_cwd && + source ~/.hunter_cwd && + rm ~/.hunter_cwd && cd $HUNTER_CWD +}