Skip to content

Latest commit

 

History

History
135 lines (120 loc) · 4.43 KB

tmux.org

File metadata and controls

135 lines (120 loc) · 4.43 KB

Setup

Turn on mouse

set -g mouse on

Start windows and panes at 1, not 0

set -g base-index 1
setw -g pane-base-index 1

Set up proper colors, using either screen or tmux-256-color depending on the terminal

## set the default TERM
set -g default-terminal screen
## update the TERM variable of terminal emulator when creating a new session or attaching a existing session
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
## determine if we should enable 256-colour support
if "[[ ${TERM} =~ 256color ]]" 'set -g default-terminal screen-256color'

Keys

Set the prefix key to be C-a instead of the default, C-b

# unbind C-b
# set -g prefix C-a
# bind C-b send-prefix

Split windows using o and u

# More friendly split pane
bind-key o split-window -h
bind-key u split-window -v

vim window movement

bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R

reload this file

bind r source-file ~/.tmux.conf

Status Bar

modified from https://github.com/sei40kr/tmux-airline-dracula/blob/master/airline-dracula.tmux

get colours using:

for i in {0..255}; do printf "\x1b[38;5;${i}mcolour%-5i\x1b[0m" $i ; if ! (( ($i + 1 ) % 8 )); then echo ; fi ; done

Set up the colors

black='colour0'
white='colour255'
gray='colour7'
dark_gray='colour8'
yellow='colour215'
light_purple='colour141'
dark_purple='colour61'
# black='colour233'
# white='colour255'
# gray='colour246'
# dark_gray='colour234'
# cyan='colour159'
# light_blue='colour75'
# dark_blue='colour31'
blue=color4

Example of powerline separators (not using these at the moment)

left_sep=''
right_sep=''
right_alt_sep=''

Set up what is displayed on the status bar

set-option -g status on
# set-option -g status-left-length 100
# set-option -g status-right-length 100
set-option -g status-bg "${black}"
set-option -g status-fg "${blue}"
# set-option -g pane-active-border-fg "${dark_blue}"
# set-option -g pane-border-fg "${gray}"
# set-option -g message-bg "${gray}"
# set-option -g message-fg "${white}"
# set-option -g message-command-bg "${gray}"
# set-option -g message-command-fg "${white}"
# set-option -g status-left " #I #[fg=${dark_gray},reverse] "
# set-option -g status-left-style "fg=${white},bg=${dark_blue},bold"
# set-option -g status-right "#[bg=${black},reverse] %Y-%m-%d %H:%M "
# set-option -g status-right-style "fg=${light_blue},bg=${dark_gray}"
# set-window-option -g window-status-activity-style "fg=${white},bg=${gray}"
# set-window-option -g window-status-separator ''
# set-window-option -g window-status-format ' #I:#W '
# set-window-option -g window-status-style "fg=${cyan},bg=${dark_gray}"
# set-window-option -g window-status-current-format "#[fg=${white}] #I:#W #[fg=${dark_gray},reverse]"
# set-window-option -g window-status-current-style "fg=${dark_gray},bg=${light_blue}"
# set -g status-left " #I "
set -g status-left ""
set-window-option -g window-status-activity-style "fg=${white},bg=${gray}"
set-window-option -g window-status-separator "  "
set-window-option -g window-status-format " #I:#W "
set-window-option -g window-status-style "fg=${black},bg=${dark_gray}"
set-window-option -g window-status-current-style "fg=${black},bg=${blue}"
set-window-option -g window-status-current-format " #I:#W "
set -g status-justify centre

Plugins

tpm

Tmux Plugin Manager

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'