wting / autojump

A cd command that learns - easily navigate directories from the command line
Other
16.06k stars 702 forks source link

Suggestion: cd into typed dir if available #657

Closed indeedwatson closed 4 months ago

indeedwatson commented 1 year ago

Example:

If I do j my_dir when there is no my_dir in the jump list, but there is ./my_dir, then automatically cd into it.

dragonfly1033 commented 5 months ago

I would also find this useful as it would allow me to just use j for everything. If implementing the feature is not possible then perhaps exit with an error so we can do something like alias j='temp_func(){ j "$1" || cd "$1"; unset -f temp_func; }; temp_func'

which is just an alias that runs your argument on j and then cd if j fails.

adelowo commented 5 months ago

Do not alias j command. Fixed mine.

wting commented 4 months ago

While I understand it would be helpful to change directory based on the current path if it hasn't already been indexed, I don't want to overlap features between autojump and cd.

From Unix philosophy:

Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features".