Write to read-only file from within VIM
:w !sudo tee %
Written by Pierre-Antoine LaFayette
Related protips
1 Response

I usually map it, eg
cmap w!! w !sudo tee % >/dev/null<CR>
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#