From ac2fa41326e167a1a825f5f9de841848efb70b03 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 31 Aug 2020 00:16:28 +0200 Subject: [PATCH] Create svim --- functions/svim.fish | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 functions/svim.fish 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