✨ feat(fish): cd up on steriods
This commit is contained in:
parent
5c41ca170f
commit
91cc7ea6e1
1 changed files with 17 additions and 0 deletions
|
@ -10,6 +10,23 @@ 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.
|
||||
|
||||
abbr -a cp --position command "cp -iv"
|
||||
|
|
Loading…
Reference in a new issue