Permission denied in VIM
You know the problem: You are working on your system, edit a long config file and at the end you notice, that you have you didn´t acquired the necessary privileges to save the command. Dammed, saving to a temp file and copying it to a file would be a natural choice. But there is an easier way using pfexec
. You find this trick at commandlinefu.com:
:w !pfexec tee %
There is an alternative for friends of sudo
on the page.
(via @commandlinefu)