A smarter CD command. Supports all major shells
github.com
github.com
I instead use aliases. This allows my shell history to stay clean and legible. It's also much more customizable.
alias c='cd'
alias b='c ..'
alias bb='c ../..'
...
alias bbbbbbb='c ../../../../../../..'
alias B='bb'
alias Bb='bbb'
...
alias BBBb='bbbbbbb'
...
alias L='eza -la --time-style long-iso --color-scale --color-scale-mode=gradient --hyperlink --no-quotes -FX'
alias Lg='L | rg'
alias Lt='L -T'
alias Ltg='L -T | rg'
alias Ld='L -D'
alias Ldg='L -D | rg'
alias Ltd='Lt -D'
alias Lldg='Ll -D | rg'
alias Ls='L --sort newest'
alias LS='L --sort oldest'
...
alias Lorg='L | sort --key 2 -h --reverse | rg'
alias Lotg='Lt | sort --key 2 -h | rg'
alias Lotrg='Lt | sort --key 2 -h --reverse | rg'
etc.My bash history is unrestricted. I use FZF to quickly select older commands. This takes the "magic" out of the selection process and lets me know exactly what directory I'll go to.
do you have an alternative, it repeats inline the result found and loses the hyperlink ability, any ideas?
z foo # cd into highest ranked directory matching foo
z foo bar # cd into highest ranked directory matching foo and bar
z foo / # cd into a subdirectory starting with foo
z ~/foo # z also works like a regular cd command
z foo/ # cd into relative path
z .. # cd one level up
z - # cd into previous directory
zi foo # cd with interactive selection (using fzf)
z foo<SPACE><TAB> # show interactive completions (zoxide v0.8.0+, bash 4.4+/fish/zsh only)The commands are written in rust, presumably because they're part of this warp shell advertised on readme?
I am using zoxide fine without Warp. (Windows + git-bash.)
(And my shell prompt is just the full path + git-branch ^^)
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/'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.
No, warp appears to be a sponsor, nothing more.
For example
kn pho/eutri
to enter photos/europe_trip. It doesn't track frecency or anything, just matches strings. My algorithm is also used in nushell's cd command.kn also supports multiple dots:
kn .. # enters parent
kn ... # enters grandparent
etc.