.tmux.conf 1.5 KB
Newer Older
Nelso Jost's avatar
Nelso Jost committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b

# http://stackoverflow.com/questions/18600188/home-end-keys-do-not-work-in-tmux
set -g default-terminal "screen-256color"

# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1

# https://github.com/neovim/neovim/issues/2035
set -sg escape-time 0

17 18 19 20 21 22 23 24
# enter scroll/copy-mode with pageup
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n Pageup if-shell "$is_vim" "send-keys Pageup" "copy-mode -u"
bind -n S-Pageup if-shell "$is_vim" "send-keys Pageup" "copy-mode -u"
bind -n S-Pagedown send-keys Pagedown

# send xterm keys to apps like vim
Nelso Jost's avatar
Nelso Jost committed
25 26 27 28
set-window-option -g xterm-keys on

bind-key s split-window -h -l 55
bind-key v split-window -v
29 30
bind-key C-q kill-server 
bind-key C-w kill-window
Nelso Jost's avatar
Nelso Jost committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

#run-shell ~/resurrect.tmux
#

# https://github.com/tmux-plugins/tmux-resurrect/blob/master/docs/restoring_vim_and_neovim_sessions.md
set -g @resurrect-strategy-nvim 'session'

set -g @resurrect-processes '~python'


# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'