Popup history with tmux and fzf hero

Popup history with tmux and fzf

Many times a minute I use the ctrl-r keyboard shortcut in my terminal to pull up my history. The 80/20 rule states that 80% of the input comes from 20% of the output. Applying that principle to my activity in the terminal means the majority of commands I want to run I

Thankfully fzf wrote a fzf-tmux script that makes it easy to integrate fzf with tmux.

Make sure you have installed the keybindings for your shell (you’ll run something like /usr/local/opt/fzf/install in macOS). After running that command your <ctrl-r> command will be bound to your history.

Going one step further, tmux has floating window support. To set your history to popup, add the following variables to your shell.

Here’s how to configure it depending on your shell:

Fish

~/.config/fish/config.fish
set -U FZF_CTRL_R_OPTS "--reverse"
set -U FZF_TMUX_OPTS "-p"

Bash/Zsh

~/.bashrc or ~/.zshrc
export FZF_CTRL_R_OPTS="--reverse"
export FZF_TMUX_OPTS="-p"

The -p flag will now change all fzf_tmux behavior to pop up instead of creating a separate pane.

I chose to use --reverse on the ctrl-r options because I like the way it looks. I also added an optional preview flag bound to ? as described in the fzf key binding wiki.

I hope you like it! fzf-tmux with popup support has been a game-changer. I had some hesitations moving away from Visual Studio Code, mostly that tmux and neovim felt outdated when it came to visuals. But now, I’m liking this setup MORE than vscode and am excited to continue to tweak the system to be even more stylish and functional than any other IDE out there.

This is a simple change, but having a polish balanced screen makes all the difference for me, here it is one more time:

preview of history using fzf

Thanks for reading, I will continue to post tips and tricks for how to be more productive in the terminal and macOS.

Sign-Up for New Posts

Stay in the loop and get the latest blog posts about dotfiles sent to your inbox.

Or use the

RSS Feed
man sitting at desk in front of a landscape of rivers leading to a mountain range

Dev Workflow Intro

Your guide to creating a powerful and intuitive development workflow in the terminal.

The terminal is a powerful tool for developers, but it can be overwhelming to know where to start. This guide will help you create a powerful development environment in the terminal. Here are some of the things you'll learn.

  • Install packages and keep them up-to-date
  • Design a minimalist, distraction-free, user-interface
  • Use familiar keyboard shortcuts
  • Manage multiple projects with ease
  • Integrate with Git and GitHub
Get Started