|
|
@ -1,15 +1,18 @@ |
|
|
|
set-option -g status-position top |
|
|
|
-option -g status-position top |
|
|
|
bind-key b set-option status |
|
|
|
set -g focus-events on |
|
|
|
set -g aggressive-resize on |
|
|
|
set -s escape-time 0 |
|
|
|
|
|
|
|
set -g prefix C-b |
|
|
|
|
|
|
|
set-option -g default-shell /bin/zsh |
|
|
|
set-option -ga terminal-overrides ",xterm-256color:Tc" |
|
|
|
|
|
|
|
set-window-option -g mode-keys vi |
|
|
|
bind-key -t vi-copy 'v' begin-selection |
|
|
|
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" |
|
|
|
unbind -t vi-copy Enter |
|
|
|
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" |
|
|
|
bind-key -t vi-copy 'y' copy-selection |
|
|
|
|
|
|
|
##bind -n S-down new-window |
|
|
|
bind -n S-left prev |
|
|
|
bind -n S-right next |
|
|
|
|
|
|
@ -41,30 +44,44 @@ set -g message-attr bright |
|
|
|
set-option -gw xterm-keys on |
|
|
|
set-window-option -g xterm-keys on |
|
|
|
|
|
|
|
## set the default TERM |
|
|
|
##set -g default-terminal screen |
|
|
|
|
|
|
|
setw -g aggressive-resize on |
|
|
|
## update the TERM variable of terminal emulator when creating a new session or attaching a existing session |
|
|
|
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM' |
|
|
|
## determine if we should enable 256-colour support |
|
|
|
#if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" ' |
|
|
|
set -g default-terminal screen-256color |
|
|
|
|
|
|
|
setw -g mouse on |
|
|
|
setw -g mouse on |
|
|
|
#set -g mouse-select-pane on |
|
|
|
#set -g mouse-resize-pane on |
|
|
|
#set -g mouse-select-window on |
|
|
|
|
|
|
|
bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage" |
|
|
|
bind-key -t vi-copy PPage page-up |
|
|
|
bind-key -t vi-copy NPage page-down |
|
|
|
set-option -g base-index 1 |
|
|
|
set-window-option -g pane-base-index 1 |
|
|
|
|
|
|
|
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" |
|
|
|
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" |
|
|
|
bind-key -t vi-copy WheelUpPane halfpage-up |
|
|
|
bind-key -t vi-copy WheelDownPane halfpage-down |
|
|
|
|
|
|
|
set-option -g base-index 1 |
|
|
|
set-window-option -g pane-base-index 1 |
|
|
|
# Smart pane switching with awareness of vim splits |
|
|
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' |
|
|
|
bind -n M-Left if-shell "$is_vim" "send-keys M-Left" "select-pane -L" |
|
|
|
bind -n M-Down if-shell "$is_vim" "send-keys M-Down" "select-pane -D" |
|
|
|
bind -n M-Up if-shell "$is_vim" "send-keys M-Up" "select-pane -U" |
|
|
|
bind -n M-Right if-shell "$is_vim" "send-keys M-Right" "select-pane -R" |
|
|
|
bind -n M-\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l" |
|
|
|
|
|
|
|
# Split windows like Vim. |
|
|
|
bind v split-window -h |
|
|
|
bind h split-window -v |
|
|
|
|
|
|
|
set-option -g default-command "reattach-to-user-namespace -l zsh" |
|
|
|
|
|
|
|
# Plugins |
|
|
|
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-battery' |
|
|
|
set -g @plugin 'tmux-plugins/tmux-yank' |
|
|
|
set -g @plugin 'tmux-plugins/tmux-sensible' |
|
|
|
set -g @plugin 'tmux-plugins/tmux-copycat' |
|
|
|
set -g @shell_mode 'vi' |
|
|
|
|
|
|
|
|
|
|
|
## fix copy & paste issue |
|
|
|
set -g default-command "reattach-to-user-namespace -l ${SHELL}" |
|
|
|
source ~/.tmux.powerline.conf |
|
|
|
run '~/.tmux/plugins/tpm/tpm' |