Skip to content


saving with sudo from vim

I had this itch to figure out over the weekend how to save a document with sudo from vim. With help from Tim Pope, I now know how. Here is how:


Relative line numbers in vim from Bryan Liles on Vimeo.

Update For those of you who want to get right to the thick of things, stick the following in your vimrc

command! -bar -nargs=0 SudoW   :silent exe "write !sudo tee % >/dev/null"|silent edit!

Posted in Uncategorized.

  • Bob
    markup fail?
  • more like blog conversion fail. fixing it now.
blog comments powered by Disqus