After opening a file created by root in vim
, how to change the current user to superuser mode without quitting or before saving?
This should do the trick.
:w !sudo tee %
More tricks like that here: http://vim.wikia.com/wiki/Su-write
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With