Terminal: Use last command

The terminal command !$ allows us to to retrieve the previous command in a terminal session. This allows us to reference the previous commands and append/ prepend if to a new command instead of using ↑ and ↓ arrow keys.

For example, this can be used to solve a common elixir mini-problem: Prepending iex -S in front of a command to pry open an elixir process in iex session.

$ mix phx.server
$ iex -S !$ # Pressing return returns the following
$ iex -S mix phx.server

There are many other ways !$ can be used to make our lives easier!

Tip: Binding !$ to a tmux key is super helpful, instead of having to type it every time