Tmux configuration

Tmux is a terminal multiplexer, the main feature of it for me is to split window side by side, one for doing debugging, the other for coding. I know there are some substitutions available, such as konsole and terminator but I find tmux handy.

I’ve customed some configuration that happens to be useful for me. I will add comments about them below it.

unbind C-b
set -g prefix C-w

I have removed the default Ctrl+b key binding and made it to ctrl+w.

set -g default-terminal "screen-256color"
set -g status-utf8 on
set-option -g default-shell /bin/zsh

Charset and terminal colour setting.

#up
bind-key k select-pane -U
#down
bind-key j select-pane -D
#left
bind-key h select-pane -L
#right
bind-key l select-pane -R

With these settings done, when switching window, all I should do is ctrl+w+[kjhl]. Vim user, sound familiar?

Of course I’ve already set the vim keys to ctrl+[kjhl] so it’s not “conflicted” with the tmux key combination.

setw -g mode-keys vi

Enable vim mode.

bind '"' split-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"

When split window, create a shell session under the folder of the split session.

Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.