Earlier quoted context omitted.
I've been using "sudo !!" (which I pronounce as sudo bangbang in my head) for a while now, mostly with vim for editing stuff in /etc. It's very nifty. Another nifty tool is vi editing mode. You run "set -o vi", and now your shell takes vi modal editing commands. That along with Ctrl-r for reverse history search has made life in the shell so much easier. Bash has a ton of little stuff like that built in. Zsh has a few…
Probably my biggest overall timesaver has been: :w !sudo tee % If you neglected to sudo before making your changes.
" Let :w!! gain sudo privileges without closing and reopening vim
cmap w!! w !sudo tee % >/dev/null