-
Notifications
You must be signed in to change notification settings - Fork 5
/
tmux.conf
105 lines (89 loc) · 3.79 KB
/
tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# General setting
set -g default-terminal "screen-256color" # use 256 colors
set -g display-time 1000 # status line messages display
set -g status-utf8 on # enable utf-8
set -g history-limit 100000 # scrollback buffer n lines
set -sg escape-time 1 # changing the default delay may influence vim
set -g base-index 1 # window base index start at 1
setw -g pane-base-index 1 # panes index start at 1, setw means set-window-option
# bind to reload config : PREFIX + r or CRTL+r
bind r source-file ~/.tmux.conf \; display "Reloaded .tmux.conf!"
bind -n ^r source-file ~/.tmux.conf
# Set the prefix to Ctrl+b, just test
# Linux
# set-option -g prefix C-b
# bind-key C-b send-prefix
# copy mode in Tmux only,but can't communicate with system clipboard.
# I recommended the way below.
bind-key -t vi-copy 'v' begin-selection # Begin selection in copy mode.
bind-key -t vi-copy 'C-v' rectangle-toggle # Begin selection in copy mode.
bind-key -t vi-copy 'y' copy-selection # Yank selection in copy mode.
# tmux Copy & Paste on OS X: A Better Future
# https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future
# you should setup `reattach-to-user-namespace` firtly, like `brew install reattach-to-user-namespace`
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Mac OS X
set -g prefix ^b # set mac prefix is Ctrl + b
bind ^b send-prefix # send Ctrl + b twice to application
# status bar infomation
set -g status on
set -g status-bg '#4e4e4e'
set -g status-fg '#bbbbbb'
set -g status-left-fg '#bbbbbb'
set -g status-left-bg '#4e4e4e'
set -g status-right-fg '#bbbbbb'
set -g status-right-bg '#4e4e4e'
set -g status-left-length 90
set -g status-right-length 90
set -g status-left "session#S:window#I.pane#P"
set -g status-right "#{prefix_highlight} %Y-%m-%d %a %H:%M"
set -g status-justify "centre"
# pane border colors
set -g pane-active-border-fg '#55ff55'
set -g pane-border-fg '#555555'
# splitting panes
bind | split-window -h
bind - split-window -v
# handling the mouse
# http://stackoverflow.com/questions/30185210/ubuntu-change-tmux-1-8-to-tmux-next-1-9
set -g mouse-utf8 on
set -g mouse on
bind -n WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -n WheelDownPane select-pane -t= \; send-keys -M
# from http://endot.org/2011/12/06/my-tmux-configuration/
# keybindings to make resizing easier
bind -r C-h resize-pane -L
bind -r C-j resize-pane -D
bind -r C-k resize-pane -U
bind -r C-l resize-pane -R
# Highlight active window
set -g window-status-current-fg '#55ff55'
# tmux-logging
# set -g @screen-capture-key 'M'
# List of plugins
set -g @continuum-restore 'on'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-battery \
tmux-plugins/tmux-copycat \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-continuum \
tmux-plugins/tmux-logging \
'
# Other examples:
# github_username/plugin_name \
# git@github.com/user/plugin \
# git@bitbucket.com/user/plugin \
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'