this tmux configuration will change how you write code. tmux and vim are amazing together and this is how I configured tmux on my mac
if you don’t already have tmux, run brew install tmux
. This will install the latest version of tmux.
next, create a ~/.tmux.conf
file. This is where all your configuration lives for tmux.
start with setting up more comfortable and ergonomic key bindings and settings. Especially the vim keymaps, because we’re vim users now and there’s no looking back.
unbind r
bind r source-file ~/.tmux.conf
set -g prefix C-s
# act like vim
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
next up, install tpm
the tmux plugin manager. We’re going to make this config look amazing, and tpm
helps us get there quick.
git clone <https://github.com/tmux-plugins/tpm> ~/.tmux/plugins/tpm
then, put this at the bottom of your tmux config:
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
source tmux by running <C-s> + r. we set this up earlier because we are amazing cool programmers now. if you didn’t do this, run tmux source ~/.tmux.conf
in your terminal, you heathen.
next whenever you have tmux open, you can run <PREFIX>+I to install packages.
The first package I like to install is chris toomey’s vim tmux navigator. To install, add the plugin through tpm, and press CTRL-s + I. If you have this installed through TPM in tmux, AND in your neovim or vim configuration, you can navigate between both vim and tmux panes seamlessly using vim keybindings. With this setup, you’ll totally be the coolest kid in school, guaranteed.
set -g @plugin 'christoomey/vim-tmux-navigator'
now to set up the most beautiful part. THE STATUS BAR