summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-11 21:45:37 +1100
committerGitHub <noreply@github.com>2019-11-11 21:45:37 +1100
commit945edb253b69900193bbab4ce79f9aefa4ad36dc (patch)
treea7a433ad9550c60384d81bc658171d5dc3ae18a0
parentcbc82cd3c1e8668d37aad049401222a382613f98 (diff)
Update README.mdv0.10.3
-rw-r--r--README.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/README.md b/README.md
index bdc2c9f2d..cc4a05e34 100644
--- a/README.md
+++ b/README.md
@@ -118,6 +118,24 @@ whichever rc file you're using).
- Rebase Magic tutorial [here](https://youtu.be/4XaToVut_hs)
- List of keybindings
[here](/docs/keybindings).
+
+## Changing Directory On Exit
+
+If you change repos in lazygit and want your shell to change directory into that repo on exiting lazygit, add this to your `~./zhsrc` (or other rc file):
+```
+lg()
+{
+ export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
+
+ lazygit "$@"
+
+ if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
+ cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
+ rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
+ fi
+}
+```
+Then `source ~/.zshrc` and from now on when you call `lg` and exit you'll switch directories to whatever you were in inside lazyigt. To override this behaviour you can exit using `shift+Q` rather than just `q`.
## Cool features