cd - (Go back to previous working directory)
sudo !! (Run the last command as root)
:w !sudo tee % (Save a readonly file in VIM)
> tmp.file (Empty a file)
cmd !$ (Run cmd with previous commands arguments)
They are just some of my favorites.
sudo !! (Run the last command as root)
:w !sudo tee % (Save a readonly file in VIM)
> tmp.file (Empty a file)
cmd !$ (Run cmd with previous commands arguments)
They are just some of my favorites.
Adding :p to the end of a history expansion (like !$:p) will cause it not to be executed, but the expanded command line will be echoed and put in your history so you can check edit it.
I find myself using the first two on an almost hourly basis.