2017-02-07 16:16:45 -06:00
|
|
|
# ^s as prefix
|
|
|
|
unbind C-b
|
|
|
|
set -g prefix C-s
|
|
|
|
bind-key s send-prefix
|
|
|
|
|
2017-02-28 10:56:23 -06:00
|
|
|
set-option -g mouse on
|
2017-02-07 16:16:45 -06:00
|
|
|
|
|
|
|
# honestly not sure
|
|
|
|
set -g escape-time 10
|
|
|
|
setw -g monitor-activity on
|
|
|
|
|
|
|
|
bind-key W resize-pane -x 100
|
|
|
|
|
|
|
|
# splitting
|
|
|
|
bind-key v split-window -h
|
|
|
|
bind-key b split-window
|
|
|
|
|
2017-07-29 19:05:26 -05:00
|
|
|
set -g default-terminal "tmux-256color"
|
2017-02-07 16:16:45 -06:00
|
|
|
|
|
|
|
# iterating
|
2017-04-23 06:47:00 -05:00
|
|
|
unbind r
|
2017-02-07 16:16:45 -06:00
|
|
|
bind r source-file ~/.tmux.conf
|
|
|
|
|
2018-04-06 17:28:31 -05:00
|
|
|
# show tmux status bar by default (prefix H toggles)
|
|
|
|
set -g status on
|
2017-02-07 16:16:45 -06:00
|
|
|
bind-key H set status
|
|
|
|
|
2018-04-06 17:28:31 -05:00
|
|
|
bind-key j switch-client -p
|
|
|
|
bind-key h switch-client -p
|
|
|
|
bind-key k switch-client -n
|
|
|
|
bind-key l switch-client -n
|
|
|
|
|
2018-06-05 11:05:20 -05:00
|
|
|
bind-key T set-option -g mouse off
|
|
|
|
bind-key G set-option -g mouse on
|
|
|
|
|
|
|
|
bind -n C-y run "tmux save-buffer - | /mnt/c/Windows/System32/clip.exe" \; display-message "Clipboard copied"
|
|
|
|
|
2017-04-23 06:47:00 -05:00
|
|
|
# message colors
|
2018-04-06 17:28:31 -05:00
|
|
|
set -g message-bg colour0
|
2017-04-23 06:47:00 -05:00
|
|
|
set -g message-fg colour7
|
|
|
|
|
|
|
|
# status bar configuration
|
2018-06-06 15:55:34 -05:00
|
|
|
set-option -g status-position top
|
2017-04-23 06:47:00 -05:00
|
|
|
# set -g status-utf8 on
|
2018-06-06 15:55:34 -05:00
|
|
|
# set -g status-justify right
|
2017-04-23 06:47:00 -05:00
|
|
|
|
|
|
|
# status bar colors
|
2018-04-06 17:28:31 -05:00
|
|
|
set -g status-bg colour0
|
|
|
|
set -g status-fg colour8
|
2017-04-23 06:47:00 -05:00
|
|
|
|
|
|
|
setw -g window-status-current-fg colour7
|
2018-04-06 17:28:31 -05:00
|
|
|
setw -g window-status-current-bg colour2
|
2017-04-23 06:47:00 -05:00
|
|
|
# setw -g window-status-current-attr bold
|
|
|
|
setw -g window-status-current-format ''
|
|
|
|
|
2018-06-06 15:55:34 -05:00
|
|
|
set -g status-interval 5
|
2018-09-25 14:19:35 -05:00
|
|
|
set -g status-left-length 80
|
|
|
|
set -g status-left "#[fg=colour4]#W#[fg=default]#[bg=default]"
|
2018-06-06 15:55:34 -05:00
|
|
|
set -g status-right-length 200
|
2018-09-25 14:19:35 -05:00
|
|
|
set -g status-right "#[fg=colour7] #(~/.config/dotfiles/scripts/bin/tmux-session-list #S)"
|
2018-06-06 15:55:34 -05:00
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
# vim copying
|
2017-04-27 15:49:57 -05:00
|
|
|
setw -g mode-keys vi
|
2017-02-07 16:16:45 -06:00
|
|
|
|
|
|
|
# 1-based indexing for keystroke simplicity
|
|
|
|
set -g base-index 1
|
|
|
|
set -g pane-base-index 1
|
|
|
|
|
|
|
|
# custom predefined layouts
|
|
|
|
bind M-l source-file ~/.tmux/layouts/dev.tmux
|
|
|
|
|
2017-04-27 15:49:57 -05:00
|
|
|
set -g pane-border-fg colour18
|
|
|
|
set -g pane-active-border-fg blue
|
|
|
|
set -g pane-active-border-bg default
|
|
|
|
|
2018-04-06 17:28:31 -05:00
|
|
|
bind-key s run "tmux new-window 'bash -ci tmuxswitcher'"
|
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
# present a menu of urls to open from the visible pane
|
|
|
|
bind-key u capture-pane \;\
|
2018-04-06 17:28:31 -05:00
|
|
|
save-buffer /tmp/tmux-buffer \;\
|
|
|
|
split-window -l 10 "urlview /tmp/tmux-buffer"
|
2017-02-07 16:16:45 -06:00
|
|
|
|
2017-04-28 21:43:23 -05:00
|
|
|
# mimic pane switching in and out of vim
|
|
|
|
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
2018-04-06 17:28:31 -05:00
|
|
|
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
2017-04-28 21:43:23 -05:00
|
|
|
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"
|
2018-06-05 11:05:20 -05:00
|
|
|
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
2017-04-28 21:43:23 -05:00
|
|
|
|
|
|
|
bind-key -Tcopy-mode-vi 'C-h' send -X "cancel select-pane -L"
|
|
|
|
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
|
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
# list of plugins
|
|
|
|
set -g @plugin 'tmux-plugins/tpm'
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-sensible'
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-continuum'
|
2017-02-28 10:56:23 -06:00
|
|
|
|
2017-11-13 15:57:25 -06:00
|
|
|
# prefix+[ for select mode
|
|
|
|
# v for visual mode
|
|
|
|
# yank to clipboard with y
|
|
|
|
# paste with prefix+]
|
2017-02-07 16:16:45 -06:00
|
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
2017-02-28 10:56:23 -06:00
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
set -g @plugin 'tmux-plugins/tmux-copycat'
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-sessionist'
|
2017-04-28 21:43:23 -05:00
|
|
|
set -g @plugin 'christoomey/vim-tmux-navigator'
|
2017-02-07 16:16:45 -06:00
|
|
|
|
|
|
|
# plugin options
|
|
|
|
|
|
|
|
# enable continuum
|
2018-04-09 08:34:38 -05:00
|
|
|
set -g @continuum-restore 'on'
|
2017-02-07 16:16:45 -06:00
|
|
|
|
|
|
|
# let continuum startup on boot
|
|
|
|
set -g @continuum-boot 'on'
|
|
|
|
|
2018-04-09 08:34:38 -05:00
|
|
|
set -g @resurrect-save 'C-v'
|
|
|
|
# unbind C-s
|
|
|
|
set -g @resurrect-restore 'R'
|
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
# initialize tmux plugin manager
|
|
|
|
run '~/.tmux/plugins/tpm/tpm'
|
|
|
|
|
|
|
|
unbind-key C-p
|
2018-04-06 17:28:31 -05:00
|
|
|
|