Created
March 8, 2025 10:22
-
-
Save Rutzmoser/130e585859f250cf650deb0bcdd62318 to your computer and use it in GitHub Desktop.
Multi-cd functionality pimped a little bit - a shameless rip-off from the fish website video
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified string matching regex from fish website video | |
function multicd | |
set --local length (math (string length -- (string match --regex '\.\.+$' $argv)) - 1) | |
echo (string repeat -n $length ../) | |
end | |
abbr --add dotdot --regex '^\.\.+$' --function multicd | |
abbr --add cddotdot --command cd --regex '\.\.+$' --function multicd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment