Find file
Fetching contributors…
Cannot retrieve contributors at this time
117 lines (90 sloc) 3.35 KB
# fixes copy & paste issue w/ tmux
set-option -g default-command "zsh"
# pretty colors
set -g default-terminal "screen-256color"
# I don't care about matching screen's C-a. It's awkward for my vi hands. Also
# I don't like the defalt C-b. C-space doesn't conflict with any vim bindings,
# and it's also the same between dvorak/qwerty.
unbind C-b
set-option -g prefix C-"space"
# speaking of being a vi guy
set-window-option -g mode-keys vi
# Allows for faster key repetition
set -sg escape-time 0
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# reload config, useful while hacking on config
bind r source-file ~/.tmux.conf
# window counts start from 1, instead of 0
set -g base-index 1
# for nested tmuxes, I'm not sure I really need this
# bind-key z send-prefix
# windows with activity are not highlighted in status line
set-window-option -g monitor-activity off
set-option -g visual-activity off
### status line
set -g status-left-length 52
set -g status-right-length 451
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
set -g message-fg colour16
set -g message-bg colour221
set -g message-attr bold
set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #I #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]⮀'
set -g window-status-format "#[fg=white,bg=colour234] #I.#P #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour25,bg=colour39,noreverse,bold] #I.#P ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀"
### key bindings for window/pane handling
# splitting with v and h
unbind %
bind C-s split-window -v
bind C-v split-window -h
# switching between windows (like tabs)
bind -r C-n select-window -t :+
bind -r C-p select-window -t :-
# convenient moving around using hjkl keys
bind -r C-k select-pane -U
bind -r C-j select-pane -D
bind -r C-h select-pane -L
bind -r C-l select-pane -R
# convenient moving around using hjkl keys
bind -r C-k select-pane -U
bind -r C-j select-pane -D
bind -r C-h select-pane -L
bind -r C-l select-pane -R
# resizing panes
bind -r "left" resize-pane -L 5
bind -r "down" resize-pane -D 5
bind -r "up" resize-pane -U 5
bind -r "right" resize-pane -R 5
# double tap the prefix to go to last-pane is convenient.
bind -r C-"space" last-pane
# create new window (like tabs)
bind -r C-t new-window
# using one of the main-* layouts, this is handy for cycling which pane has the
# main spot in the layout.
bind -r C-r rotate-window
# Zoom pane in by breaking it out into it's own window
bind C-z break-pane
# easily kill pane
bind C-q kill-pane
# useful layouts
bind F1 select-layout main-horizontal
bind F2 select-layout main-vertical
### key bindings for copy mode
# enter copy mode kinda like we enter visual mode in vi
bind v copy-mode
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel
bind p paste-buffer
# export the yanked selection to system
bind y run "tmux show-buffer | reattach-to-user-namespace pbcopy"
# make mouse useable
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on