Hacker News new | ask | show | jobs
by SteveDeFacto 3579 days ago
I see no reason to ever run vim as sudo. The best option in my opinion is to save files using ":w ! sudo tee %" This way you are not opening your system up to potential exploits within vim plugins. It also avoids issues such as this one.
1 comments

It makes no difference. If you got a plugin injected, you lost already - it can create a local sudo alias which either captures your password, or hijacks the next sudo command you run.