diff --git a/functions/paru.fish b/functions/paru.fish new file mode 100644 index 0000000..eadcf03 --- /dev/null +++ b/functions/paru.fish @@ -0,0 +1,3 @@ +function paru --description 'alias paru paru --sudoloop' + command paru --sudoloop $argv; +end diff --git a/functions/regex_mv.fish b/functions/regex_mv.fish new file mode 100644 index 0000000..caaebee --- /dev/null +++ b/functions/regex_mv.fish @@ -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