2017-04-12 10:07:35 +02:00
|
|
|
set -g default-terminal "screen-256color"
|
|
|
|
|
|
|
|
|
|
set -g history-limit 999999999
|
|
|
|
|
|
|
|
|
|
# Remap prefix
|
|
|
|
|
unbind C-b
|
|
|
|
|
set-option -g prefix C-a
|
|
|
|
|
bind-key C-a send-prefix
|
|
|
|
|
bind-key -n C-b send-prefix
|
|
|
|
|
|
|
|
|
|
setw -g mode-keys vi
|
|
|
|
|
set-option -g status-keys vi
|
|
|
|
|
|
|
|
|
|
bind-key -n C-E split-window -h
|
|
|
|
|
bind-key -n C-O split-window -v
|
|
|
|
|
bind | split-window -h -c '#{pane_current_path}'
|
|
|
|
|
bind - split-window -v -c '#{pane_current_path}'
|
|
|
|
|
|
|
|
|
|
# Switch windows
|
|
|
|
|
bind-key -n M-Left select-window -t -1
|
|
|
|
|
bind-key -n M-Right select-window -t +1
|
|
|
|
|
|
|
|
|
|
unbind '"'
|
|
|
|
|
unbind '%'
|
|
|
|
|
#bind-key -n M-left select-pane -L
|
|
|
|
|
#bind-key -n M-right select-pane -R
|
|
|
|
|
#bind-key -n M-up select-pane -U
|
|
|
|
|
#bind-key -n M-down select-pane -D
|
|
|
|
|
bind-key -n C-x resize-pane -Z
|
|
|
|
|
|
|
|
|
|
bind k clear-history
|
|
|
|
|
|
|
|
|
|
bind-key a set-window-option synchronize-panes
|
|
|
|
|
|
|
|
|
|
bind r source-file ~/.tmux.conf\; display "Conf reloaded!"
|
|
|
|
|
|
|
|
|
|
set -g mouse on
|
|
|
|
|
|
|
|
|
|
# Vi copypaste mode
|
|
|
|
|
set-window-option -g mode-keys vi
|
2017-05-12 11:29:03 +02:00
|
|
|
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
|
|
|
|
|
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
|
|
|
|
|
bind -Tcopy-mode-vi y send -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c" \; display-message "copied to system clipboard"
|
2017-04-12 10:07:35 +02:00
|
|
|
|
|
|
|
|
# Smart pane switching with awareness of vim splits
|
|
|
|
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
|
|
|
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(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"
|
|
|
|
|
|
|
|
|
|
# Copying
|
|
|
|
|
# move x clipboard into tmux paste buffer
|
|
|
|
|
bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
|
|
|
|
|
# move tmux copy buffer into x clipboard
|
2017-05-12 11:29:03 +02:00
|
|
|
set-option -s set-clipboard off
|
2017-04-12 10:07:35 +02:00
|
|
|
|
2018-07-29 16:26:51 +02:00
|
|
|
if '[ `uname` == Darwin ]' \
|
|
|
|
|
'source-file ~/.tmux/.mac_config'
|
2017-04-12 10:07:35 +02:00
|
|
|
source-file ~/.tmux/.tmux_config_powerline
|
|
|
|
|
|
2018-07-29 16:26:51 +02:00
|
|
|
|
|
|
|
|
# Escape timeout for nvim
|
|
|
|
|
set -sg escape-time 10
|
|
|
|
|
|
|
|
|
|
|
2017-04-12 10:07:35 +02:00
|
|
|
# List of plugins
|
|
|
|
|
set -g @plugin 'tmux-plugins/tpm'
|
2018-07-29 16:26:51 +02:00
|
|
|
#set -g @plugin 'tmux-plugins/tmux-sensible'
|
2017-04-12 10:07:35 +02:00
|
|
|
set -g @plugin 'tmux-plugins/tmux-sidebar'
|
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-open'
|
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
2018-07-29 16:26:51 +02:00
|
|
|
set -g @plugin 'jimeh/tmux-themepack'
|
|
|
|
|
set -g @themepack 'powerline/double/red'
|
2017-04-12 10:07:35 +02:00
|
|
|
|
|
|
|
|
# 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)
|
2018-07-29 16:26:51 +02:00
|
|
|
run '~/.tmux/plugins/tpm/tpm >> /tmp/tpm_out 2>&1 >> /tmp/tpm_out'
|