61 lines
1.7 KiB
Bash
61 lines
1.7 KiB
Bash
# ^s as prefix
|
|
unbind C-b
|
|
set -g prefix C-s
|
|
bind-key s send-prefix
|
|
|
|
# statusbar on bottom
|
|
set-option -g status-position bottom
|
|
|
|
set -g escape-time 10
|
|
setw -g monitor-activity on
|
|
|
|
set -g status off
|
|
|
|
bind-key W resize-pane -x 100
|
|
|
|
# splitting
|
|
bind-key v split-window -h
|
|
bind-key b split-window
|
|
|
|
# iterating
|
|
bind-key H set status
|
|
bind r source-file ~/.tmux.conf
|
|
|
|
# vim copying
|
|
setw -g mode-keys vi
|
|
bind-key -t vi-copy 'v' begin-selection
|
|
bind-key -t vi-copy 'y' copy-selection
|
|
|
|
set -g base-index 1
|
|
set -g pane-base-index 1
|
|
|
|
# use tmux-resurrect to manage saving/restoring sessions
|
|
set -g @resurrect-save 'S'
|
|
set -g @resurrect-restore 'R'
|
|
|
|
bind M-l source-file ~/.tmux/layouts/dev.tmux
|
|
|
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
|
|
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
|
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
|
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
|
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
|
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
|
|
|
# present a menu of URLs to open from the visible pane. sweet.
|
|
bind-key u capture-pane \;\
|
|
save-buffer /tmp/tmux-buffer \;\
|
|
split-window -l 10 "urlview /tmp/tmux-buffer"
|
|
|
|
# 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'
|
|
set -g @plugin 'tmux-plugins/tmux-copycat'
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
|
set -g @plugin 'tmux-plugins/tmux-sessionist'
|
|
|
|
# initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
|
run '~/.tmux/plugins/tpm/tpm'
|
|
|