1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-12-22 23:04:22 +00:00

Add regex_mv and paru alias

This commit is contained in:
Steffo 2021-09-18 00:42:20 +02:00
parent 825a887d08
commit 2d0afe54a7
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 32 additions and 0 deletions

3
functions/paru.fish Normal file
View file

@ -0,0 +1,3 @@
function paru --description 'alias paru paru --sudoloop'
command paru --sudoloop $argv;
end

29
functions/regex_mv.fish Normal file
View file

@ -0,0 +1,29 @@
function regex_mv
echo_progress "Find: "
echo_highlight "$argv[1]"
echo
echo_progress "Replace with: "
echo_highlight "$argv[2]"
echo
echo
for old in (ls)
set new (echo $old | sed -r "s/$argv[1]/$argv[2]/g")
echo_progress "$old"
echo_highlight "$new"
echo
end
if not confirm
return 1
end
for old in (ls)
set new (echo $old | sed -r "s/$argv[1]/$argv[2]/g")
mv "$old" "$new"
end
end