//View Tip #630
» Making vim oneliners
» Quickly empty a file in vi
louis vuitton
Similar Tips
» Making shell scripts executable via editor hooks» Making vim oneliners
» Quickly empty a file in vi
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
I often open a file and start editing only to realize later that I don't have write permissions when I get the old "E212: Can't open file for writing" error.
The vim command below can be user to save the file without the need to save it to a temp file and then copy it back again.
The vim command below can be user to save the file without the need to save it to a temp file and then copy it back again.
:w !sudo tee %
Comments
Add your comment
#1
i believe you are a good writer, but have you erver thought to write some special artcals for peopel who likes shopping very much.
Posted 2010-07-15 22:54:11

