Permalink
Switch branches/tags
Nothing to show
Find file Copy path
497b37a Feb 27, 2018
Woong Bin Kang refresh DISPLAY
1 contributor

Users who have contributed to this file

92 lines (73 sloc) 3.1 KB
# vi mode
set-window-option -g mode-keys vi
set -g default-terminal "screen-256color"
set -g default-shell "$SHELL"
# resize shortcuts
bind-key -r < resize-pane -L 3
bind-key -r > resize-pane -R 3
bind-key -r + resize-pane -U 1
bind-key -r - resize-pane -D 1
# when splitting window, use the current path
bind-key % split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -v -c "#{pane_current_path}"
# reload config shortcut
bind-key r source-file ~/.tmux.conf \; display "Config reloaded"
# fix messed up window numbering
set-option -g renumber-windows on
set -g base-index 1
setw -g pane-base-index 1
# colours that i like
set -g status-style fg=colour15,bg=blue
setw -g window-status-style fg=colour11,bg=blue
setw -g window-status-current-style fg=blue,bg=colour229
setw -g pane-border-style fg=colour242,bg=black
setw -g pane-active-border-style fg=colour231,bg=black
set -g message-style fg=colour228,bg=colour96
# dimming inactive windows
setw -g window-active-style fg=colour7,bg=black
setw -g window-style fg=colour248,bg=colour235
# move the status bar to top
set-option -g status-position top
# status bar messages
set -g status-left-length 32
set -g status-left "[S:#S|W:#I|P:#P] ["
# display host, cpu and ping on the right side
set -g status-right-length 50
set -g status-right "] Host[#h] CPU[#(mpstat 1 1 | grep "Average:" | awk '$12 ~ /[0-9.]+/ { print 100.0-$12 }')] Ping[#(ping www.google.com -c 1 | awk ' /time=/ {print substr($8, 6)}')ms]"
# enable activity alerts
setw -g monitor-activity on
# generous history limit
set-option -g history-limit 50000
# show messages for 4 seconds instead
set -g display-time 4000
# new window should use the current path
unbind-key c
bind-key c new-window -c '#{pane_current_path}'
# mouse
set -g mouse on
# middle click to kill a window
bind-key -n MouseUp2Status kill-window -t=
# drag to re-order windows
bind-key -n MouseDrag1Status swap-window -t=
# double click to open a new tab
bind-key -n DoubleClick1Status new-window -c '#{pane_current_path}'
## Clipboard integration
# ctrl+c to send to clipboard
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
# ctrl+v to paste from clipboard
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# right click to paste from clipboard
unbind-key MouseDown3Pane
bind-key -n MouseDown3Pane run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# Selection with mouse should copy to clipboard right away
unbind -n -Tcopy-mode-vi MouseDragEnd1Pane
bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel clipboard > /dev/null"
# Copy directly into clipboard in copy mode
unbind -Tcopy-mode-vi Enter
bind -Tcopy-mode-vi Enter send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel clipboard > /dev/null"
set -g automatic-rename off
#set -g automatic-rename on
#set -g automatic-rename-format "#{#I}#{pane_current_command} /"
# join pane - from https://unix.stackexchange.com/a/30576/18135
bind-key @ choose-window 'join-pane -t "%%"'
set-option -g update-environment "SSH_AUTH_SOCK SSH_CONNECTION DISPLAY"