mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-19 12:12:42 +02:00
Update README.md
This commit is contained in:
parent
cbc82cd3c1
commit
945edb253b
18
README.md
18
README.md
@ -119,6 +119,24 @@ whichever rc file you're using).
|
|||||||
- List of keybindings
|
- List of keybindings
|
||||||
[here](/docs/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
|
## Cool features
|
||||||
|
|
||||||
- Adding files easily
|
- Adding files easily
|
||||||
|
Loading…
x
Reference in New Issue
Block a user