It’s easy
:w !sudo tee %
Why do you do that?
: vim insert model
w Write a file.
!sudo All shell sudo command.
tee The output of the vi/vim write command is redirected using tee.
% Triggers the use of the current filename.
It’s easy
:w !sudo tee %
Why do you do that?
: vim insert model
w Write a file.
!sudo All shell sudo command.
tee The output of the vi/vim write command is redirected using tee.
% Triggers the use of the current filename.