vim save sudo
xxxxxxxxxx
:w !sudo tee %
// then Press L and Enter
What the vim and shell command does:
:w – Write a file (actually buffer).
!sudo – Call shell with sudo command.
tee – The output of write (vim :w) command redirected using tee.
% – The % is nothing but current file name.