Go up till you get to a directory that contains the folder name that you've specified.
Using just up
results in cd ..
.
If you have a dir structure like:
work/
└── project-name
├── .git
└── src
├── backend
└── frontend
└── src
└── components
└── App
and you are in work/project-name/src/frontend/src/components/App/
, then
- doing
up src
will change your CWD towork/project-name/src/frontend/
, or - doing
up .git
will change your CWD towork/project-name/
And you can go back to work/.../components/App
using cd -
.
- This script doesn't give any completion. If you have an idea or an implementation, please reply back in the comments.
- This isn't published as a plugin yet.
- Improvements are always welcome!
But my usecase is opposite, I need to cd into a nested directory!
Use autojump's jc
command. (Or use fd-find+FZF)