diff --git a/functions/svim.fish b/functions/svim.fish new file mode 100644 index 0000000..f1199ac --- /dev/null +++ b/functions/svim.fish @@ -0,0 +1,5 @@ +function svim --wraps='sudo -u (stat -c "%U" $1) vim $1' --description 'alias svim sudo -u (stat -c "%U" $1) vim $1' + set -l owner (stat -c "%U" $argv[1]) + echo "File owner: $owner" + sudo -u $owner vim $argv +end