You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.1 KiB

1 year ago
set -g default-terminal "tmux-256color"
2 months ago
# seems to mess w/the bottom prompt
# set -g allow-passthrough on
# RGB color: https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
set -as terminal-features ",gnome*:RGB"
11 years ago
## messages
set-option -g display-time 3000
## scrollback buffer
set-option -g history-limit 10000
11 years ago
## window notifications
set-option -g visual-activity on
set-window-option -g monitor-activity off
## title
set-option -g set-titles on
set-option -g set-titles-string "[#S] #I:#W"
set-option -g automatic-rename on
## mouse
# set -g mouse on
11 years ago
# copy and paste
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
2 years ago
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel pbcopy
bind-key -T copy-mode-vi 'H' send -X start-of-line
bind-key -T copy-mode-vi 'L' send -X end-of-line
11 years ago
# colors
set -g pane-active-border-style fg=brightred
set -g pane-border-status top
set -g pane-border-format ' #{pane_current_command} '
# statusline (shamelessly stolen from powerline)
set-option -g status-interval 2
2 months ago
set-option -g status-left "#{?client_prefix,#[fg=color254]#[bg=color31]#[bold]#[noitalics]#[nounderscore],#[fg=color232]#[bg=color254]#[bold]#[noitalics]#[nounderscore]} #S #{?client_prefix,#[fg=color31],#[fg=color254]}#[bg=color00]#[nobold] "
set-option -g status-left-length 20
set-option -g status-right ""
2 months ago
set-option -g status-style fg=color231,bg=color00
set-option -g window-status-activity-style fg=color11,bg=color00
set-option -g window-status-bell-style fg=color1,bg=color00
set-option -g window-status-current-format "#[fg=color0,bg=color31,nobold,noitalics,nounderscore] #[fg=color117,bg=color31,nobold,noitalics,nounderscore]#F#[fg=color231,bg=color31,bold,noitalics,nounderscore] #W #[fg=color31,bg=color00,nobold,noitalics,nounderscore]"
set-option -g window-status-format "#[fg=color244,bg=color00,nobold,noitalics,nounderscore] #{?window_flags,#F, } #[fg=color240,bg=color0,nobold,noitalics,nounderscore]#[default]#W "
set-option -g window-status-last-style fg=color31,bg=color00
set-option -g window-status-style fg=color249,bg=color00
11 years ago
## etc
set-window-option -g mode-keys vi
set-option -sg escape-time 1 # increase vim responsiveness
set-option -g base-index 1
9 months ago
set-option -ga terminal-features "*:hyperlinks" # osc 8
11 years ago
## screen bindings
bind a send-prefix
bind c new-window
bind C-c new-window
11 years ago
bind d detach
bind C-d detach
bind n next-window
bind C-n next-window
bind p previous-window
bind C-p previous-window
bind C-a last-window
set-option -g renumber-windows on;
bind c new-window -c '#{pane_current_path}';
bind C-c new-window -c '#{pane_current_path}';
bind v split-window -h -c '#{pane_current_path}';
bind s split-window -v -c '#{pane_current_path}';
11 years ago
10 months ago
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
11 months ago
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
bind-key -n 'C-\' if-shell "$is_vim" 'send-keys C-\\' 'select-pane -l'
11 years ago
10 months ago
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
11 years ago
bind -r < resize-pane -L 3
bind -r > resize-pane -R 3
bind -r - resize-pane -D 3
bind -r + resize-pane -U 3
bind -r = resize-pane -U 3
## fzf-git
# C-b will always switch to the prefix table, so use g for branches
bind -Tfzf-git C-f send-keys C-g f
2 months ago
bind -Tfzf-git C-g send-keys C-g b
bind -Tfzf-git C-h send-keys C-g h
bind -Troot C-g switch-client -Tfzf-git
8 months ago
bind C-y run-shell -b ~/.dotfiles/bin/,tmux-copy
11 years ago
bind r source-file ~/.tmux.conf \; display 'Reloaded tmux.conf'
if-shell "[[ -e ~/.tmux.conf.local ]]" "source-file ~/.tmux.conf.local"