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

10 lines
304 B
Fish
Raw Normal View History

2020-08-30 22:16:28 +00:00
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])
2021-07-14 20:54:12 +00:00
set_color white
echo -n "File owner: "
set_color --bold brwhite
echo $owner
set_color normal
2020-08-30 22:16:28 +00:00
sudo -u $owner vim $argv
end