Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anki-code/xontrib-back2dir
Return to the most recently used directory when starting the xonsh shell.
https://github.com/anki-code/xontrib-back2dir
xonsh xontrib
Last synced: 13 days ago
JSON representation
Return to the most recently used directory when starting the xonsh shell.
- Host: GitHub
- URL: https://github.com/anki-code/xontrib-back2dir
- Owner: anki-code
- License: mit
- Created: 2020-10-17T17:57:54.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-01T18:46:52.000Z (4 months ago)
- Last Synced: 2024-10-12T15:56:38.184Z (27 days ago)
- Topics: xonsh, xontrib
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-xontribs - back2dir - Return to the most recently used directory when starting the xonsh shell. For example, if you were in the '/work' directory when you last exited xonsh, then your next xonsh session will start in the '/work' directory, instead of your home directory. (Directory Navigation)
README
Return to the most recently used directory when starting the xonsh shell.
If you like the idea click ⭐ on the repo and and tweet.## Installation
To install use pip:
```bash
xpip install xontrib-back2dir
# or: xpip install -U git+https://github.com/anki-code/xontrib-back2dir
echo "xontrib load back2dir" > ~/.xonshrc
```## Usage
No additional actions needed. The xontrib just saves the latest directory and uses it when
xonsh starts:```bash
bash ~ $ xonsh
xonsh ~ $ cd /etc
xonsh /etc $ exit # the latest directory is /etcbash ~ $ xonsh
xonsh /etc $ # the latest directory
```If you run xonsh not from the `$HOME` directory the latest directory will be ignored:
```bash
bash ~ $ cd /tmp
bash /tmp $ xonsh
xonsh /tmp $ # latest directory ignored
```## Links
* This package is the part of [rc-awesome](https://github.com/anki-code/xontrib-rc-awesome) - awesome snippets of code for xonshrc in xonsh shell.
* This package is the part of [ergopack](https://github.com/anki-code/xontrib-ergopack) - the pack of ergonomic xontribs.
* This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).