feat(fish): cd up on steriods

This commit is contained in:
punkfairie 2024-04-14 20:14:07 -07:00
parent 5c41ca170f
commit 91cc7ea6e1
No known key found for this signature in database
GPG key ID: 284B78B49C058673

View file

@ -8,6 +8,23 @@ abbr -a c --position command clear
abbr -a e --position command "$EDITOR"
abbr -a v --position command "$EDITOR"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# CD up on steriods.
function _cd_up_func --argument-names dots
set -f dots (string sub --start 3 "$dots")
set -f cmd "cd .."
while string length -q "$dots"
set cmd "$cmd/.."
set dots (string sub --start 2 "$dots")
end
echo "$cmd"
end
abbr -a _cd_up --position command --regex "\.{2,}" --function _cd_up_func
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Default command options.