3 ms·
Wait. You can jump to the directory `~/projects/foo/python/bar` by typing `<some_cmd> foo bar` in POB (plain ole' bash)?! That's the main feature I love about z
by jackthetab 3y ago
Wait. You can jump to the directory `~/projects/foo/python/bar` by typing `<some_cmd> foo bar` in POB (plain ole' bash)?! That's the main feature I love about zoxide; it's be great if I could do it natively.
- reaperman 3y agoBest I can come up with is adding the following to .bashrc: function jump() { local current_dir=$(pwd) local search_pattern="*" for arg in "$@"; do search_pattern+="$arg*" done local path_found=$(find "$current_dir" -type d -path "$search_pattern" -print -quit) if [[ -n $path_found ]]; then cd "$path_found" || return else echo "Directory not found from here." fi } Then jump foo bar {baz ...} does what you'd like here. e.g. me@myhost ~ % jump CMake doc guide will go to /Users/me/Qt/Tools/CMake/CMake.app/Contents/doc/cmake/html/guide/
- jvanderbot 3y agoI used to use this https://github.com/jodavaho/smartcd https://github.com/jodavaho/smartcd 'scd journal' 'scd logs personal' Now I tab complete using fzf, but the above is what you want. Bash is Turing complete. You "need" nothing else. You may want it for various reasons.