Skip to content

Instantly share code, notes, and snippets.

@Rutzmoser
Created March 8, 2025 10:22
Show Gist options
  • Save Rutzmoser/130e585859f250cf650deb0bcdd62318 to your computer and use it in GitHub Desktop.
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
# 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