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:
parent
825a887d08
commit
2d0afe54a7
2 changed files with 32 additions and 0 deletions
3
functions/paru.fish
Normal file
3
functions/paru.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function paru --description 'alias paru paru --sudoloop'
|
||||||
|
command paru --sudoloop $argv;
|
||||||
|
end
|
29
functions/regex_mv.fish
Normal file
29
functions/regex_mv.fish
Normal 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
|
Loading…
Reference in a new issue