Skip to content

Instantly share code, notes, and snippets.

@tlockney
Last active May 18, 2017 13:53
Show Gist options
  • Save tlockney/a48000dec8c446af54c2354bb6f0899b to your computer and use it in GitHub Desktop.
Save tlockney/a48000dec8c446af54c2354bb6f0899b to your computer and use it in GitHub Desktop.
Make tmux awesome (probably not nearly as awesome as it *could* be)
# set the command prefix to `
set -g prefix "`"
unbind C-b
bind "`" send-prefix
# listen to alerts from all windows
set -g bell-action any
set -g default-shell /usr/local/bin/fish
set -g default-command fish
# border coloring for panes
set -g pane-active-border-fg colour166
# start window indexing at 1 (not 0)
set -g base-index 1
set -g renumber-windows on
# don't rename windows automatically
set -g allow-rename off
# open a man page in a new split window
bind / command-prompt "split-window 'exec man %%'"
# quick view of processes
bind "~" split-window "exec htop"
# ctrl+left/right cycles thru windows
bind -n C-right next
bind -n C-left prev
# more straightforward bindings to split windows
unbind %
bind | split-window -h
unbind '"'
bind - split-window -v
# quickly cycle through window panes
bind o select-pane -t :.+
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-p select-pane -U
bind -n M-Down select-pane -D
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
# Notifying if other windows has activities
setw -g monitor-activity on
set -g visual-activity on
set -g -q mouse on
bind -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
bind -T copy-mode PPage send -X page-up
bind -T copy-mode NPage send -X page-down
bind -T copy-mode WheelUpPane send -X halfpage-up
bind -T copy-mode WheelDownPane send -X halfpage-down
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
# bind resize commands to keys
bind = resize-pane -D 5
bind + resize-pane -U 5
bind < resize-pane -L 5
bind > resize-pane -R 5
bind z resize-pane -Z
# quit
bind \ confirm-before kill-server
# list-clients
bind * list-clients
# refresh-client
bind R refresh-client
unbind -T copy-mode M-w
bind -T copy-mode c send -X copy-selection
bind -T copy-mode M-w send -X copy-pipe "reattach-to-user-namespace pbcopy"
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment