Categories
Debian

sudo vim AFTER you typed

I was looking up how to goto a line in VIM, and found a great article that had the method of going to a line (:1322 if you wanted to go to link 1322), and I found a gem:

Ever typed something in vi or vim and minutes later, realized you don’t have permission to save what you typed?
I was looking up how to goto a line in VIM, and found a great article that had the method of going to a line (:1322 if you wanted to go to link 1322), and I found a gem:

How to sudo vim AFTER you’ve already typed

http://vim.wikia.com/wiki/Su-write says:


:w !sudo tee % > /dev/null

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.