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.


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Bob says

    markup fail?

  2. bryanl says

    more like blog conversion fail. fixing it now.

blog comments powered by Disqus


Blog WebMastered by All in One Webmaster.