I regularly switch between exactly two things while working, a "current" and an "alternate" item; a lot of tools I use seem to support this flow. #### git Pass `-` to `git-checkout` to switch to the previously active branch: ```bash $ git branch * foo bar $ git checkout bar $ git branch foo * bar $ git checkout - $ git branch * foo bar ``` #### bash - cd This may not be exclusive to `bash`: ```bash ~/foo $ cd ~/bar ~/bar $ cd - ~/foo $ ``` This is especially handy in combination with my [git-worktree flow](../curing_a_case_of_git-UX/): ```bash ~/main-branch $ gwj feature ~/feat-branch $ cd - ~/main-branch $ ``` #### bash - jobs I often suspend multiple `vim` sessions with `Ctrl-Z`: ```bash $ jobs [1]+ Stopped vim transpiler/src/transform.rs [2]- Stopped git commit --verbose ``` In the above example: I suspended `vim` when working on `transform.rs`, and then began working on a commit by running `git commit` without a message flag (lets you craft a message in `$EDITOR`). To bring the current job to the foreground, you can use `fg`: ```bash $ fg ``` With a job identifier: ```bash $ fg %2 # resumes interactive git commit ``` Or switch to "last" job, or the second-most-recently-resumed job: ```bash $ fg %- $ %- # shorthand ``` #### vim Switch to the last active buffer with `Ctrl+^`. In command-mode, `#` refers to the last active buffer, you can use this as an argument to a few commands: ```vimscript :b# " switch to alternate buffer (same as Ctrl+^) :vsp# " create a vertical split with the alternate buffer :read# " read contents of alternate buffer into current buffer :!wc # " pass file name of alternate buffer to the command `wc` ``` See `:help c_#` for more. #### tmux Switch to the last active tmux session with `+shift+L`. #### qutebrowser Switch to the last active tab with `g$`.