Joined February 2013

Thameera Senanayaka

Sri Lanka

Posted to Add sudo after opening a file in vim over 1 year ago

Add this to the .vimrc:

cmap w!! w !sudo tee > /dev/null %

Now typing w!! will save it with sudo. No need to remember the whole thing.

That and the following are my favorite bash functions:

mcd() { mkdir -p "$@" && cd $_; }

This creates a new directory (if it does not exist) and cd's to it.

103 Karma
822 Total ProTip Views