summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-04-06 17:31:43 +0200
committerrabite <rabite@posteo.de>2019-04-06 17:37:06 +0200
commit6d879a6cee2a3831eb292063d32854b1d080c1af (patch)
treebffd552859c8c88960d802c77ce10dfcfcbd54f0
parent405b3d1ecca8a7e688eeb9c2dc1ff5091455c934 (diff)
add hunter_cd.sh
-rw-r--r--README.md2
-rw-r--r--extra/hunter_cd.sh6
2 files changed, 8 insertions, 0 deletions
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
+}