Sudo write vi in read-only file

Use tee to make changes to read-only file as root

:w !sudo tee %

where w=write, !=exec, %=current file

 

# Reads: 1400