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.

Achievements
103 Karma
900 Total ProTip Views