This is something that seems to be the case on vi and emacs too, I have never seen a unix program which prompts me for sudo password at the moment that it needs to do a privileged operation rather than requiring running via sudo.
"/etc/mail/aliases" [Read only] 36 lines, 1023 characters
Its simply a matter of remaining keen when doing admin tasks. Sure I have to close/re-open with sudo but its prompting me up front that I won't be able to save it. :w !sudo tee % > /dev/null
It's a bit of a hack, but it works.No, you don't, and yes, you will:
:w !sudo tee %I think there's a sense, which I generally agree with, that random applications asking for your password is something we don't want users to get used to.