8 years ago
Whenever you open up a read only file you have to either reopen vim with sudo or remember a vim command to write out to a new file with sudo. This mapping expands
:w !sudo tee % > /dev/null
cnoremap w!! w !sudo tee % >/dev/null
Martínez Ortiz Saúl Axel 4 years ago
It's useful to maintain your configs when editing sudo files.