Vim formatting goodness

Posted on Wed 20 June 2012 in misc • Tagged with vim

So I wanted to paste this licence into my piece of code

But I wanted it be wrapped to no more than  79 characters a line and before each sentence I wanted to insert a "# "

This is how

:set paste (paste text from …

Continue reading

Writing files as root in vim

Posted on Wed 10 August 2011 in misc • Tagged with vim

I do this at least once a day; open a file in vim, make changes, then get reminded that I didn't do it using sudo.

simple one-liner fixes this.

:w !sudo tee %

Thanks to for that one.

Continue reading