Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Probably my biggest overall timesaver has been:

   :w !sudo tee %
If you neglected to sudo before making your changes.


I've had this in my vimrc for years:

   " Let :w!! gain sudo privileges without closing and reopening vim
   cmap w!! w !sudo tee % >/dev/null


Its much more easier to remember when you know how that actually works. Here is link explaining how that actually works:

http://stackoverflow.com/questions/2600783/how-does-the-vim-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: