1. 5
  1.  

  2. 2

    Here another great tip: it’s possible to edit the current command line in $EDITOR using <C-x><C-e>.

    1. 2

      Or do it right with a ‘set -o vi’ :P

      1. 1

        Some of these tricks definitely rely on having emacs keybindings (those infidels!)

    2. 1

      A few note: ^R only works if you’re using emacs keybindings.

      A complement to the bang history (i.e. !2) is relative history – !-2 will run the command two commands previous; !-1 runs the last command and is the same as !!. You can also use the carets to replace elements from the last command; for example:

      $ ls code/bitbucket.com/ ... $ ^bitbucket^github^ ls code/github.com/