mihaifm / vimpanel

A modern side panel for Vim
106 stars 9 forks source link

open file with sudo #11

Closed Devric closed 10 years ago

Devric commented 10 years ago

is it possible to open and edit files like /etc/hosts

mihaifm commented 10 years ago

It is possible only if you open vim itself with sudo There is also an old vi trick that allows you to save a file even if you didn't open it with sudo:

:w !sudo tee %

http://stackoverflow.com/questions/1005/getting-root-permissions-on-a-file-inside-of-vi http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work