Skip to content

Instantly share code, notes, and snippets.

@johnwook
Forked from premek/mv.sh
Last active April 15, 2020 09:06
Show Gist options
  • Save johnwook/39465754eb22f429108a6b183fd36aea to your computer and use it in GitHub Desktop.
Save johnwook/39465754eb22f429108a6b183fd36aea to your computer and use it in GitHub Desktop.
Rename files in fish using mv command without typing the full name two times
function rename
if test (count $argv) -ne 1
or test ! -f $argv[1]
command mv $argv
return
end
set newfilename $argv[1]
vared newfilename
command mv -v -- $argv[1] $newfilename
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment