-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
120 lines (98 loc) · 3.62 KB
/
.tmux.conf
File metadata and controls
120 lines (98 loc) · 3.62 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
unbind C-b
set -g prefix C-a
set -g mode-keys vi
# set -g mode-keys emacs
# use prefix-r reload conf file
bind r source-file ~/.tmux.conf \; display "Reloaded!"
#dealy
set -sg escape-time 1
# I use 0 to the first
# set -g base-index 1
# setw -g pane-base-index 1
set -g base-index 0
setw -g pane-base-index 0
# 终于可以在tmux的shell里用ctrl A了
# send Ctrl-a to an application running within tmux simply by pressing Ctrl-a twice.
bind C-a send-prefix
# split window like vim
# vim's defination of a horizontal/vertical split is revised from tumx's
# move arount panes wiht hjkl, as one would in vim after C-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by,
# only one at a time can be slow
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
# bind : to command-prompt like vim
# this is the default in tmux already
bind : command-prompt
# scrollback buffer size increase (this eats up memory, sometimes)
set -g history-limit 500000
# set-window-option -g window-status-current-bg white
# you should not use mouse
# setw -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window on
# toggle mouse mode to allow mouse copy/paste
# set mouse on with prefix m
bind m \
set-option -g mouse on \; display-message 'Mouse: ON'
# set-option -g mouse-resize-pane on \;\
# set-opton -g mouse-select-pane on \;\
# set-option -g mouse-select-window on \;\
# set mouse off with prefix M
bind M \
set-option -g mouse off \; display-message 'Mouse: OFF'
# set-option -g mouse-resize-pane off \;\
# set-option -g mouse-select-pane off \;\
# set-option -g mouse-select-window off \;\
#
#??
# 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
# zoom this pane to full screen
# bind + \
# new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \;\
# swap-pane -s tmux-zoom.0 \;\
# select-window -t tmux-zoom
# restore this pane
# bind - \
# last-window \;\
# swap-pane -s tmux-zoom.0 \;\
# kill-window -t tmux-zoom
#added for mac
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# like vim
bind v split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind s split-window -v -c '#{pane_current_path}' # Split panes vertically
# bind -n C-g split-window -h -c "#{pane_current_path}" \; resize-pane -x 80 \; select-pane -t 0
unbind -n c-g
#color and font
set -g default-terminal "screen-256color"
# 配合iterm的torrow night用, cool!
# set -g status-fg white
# set -g status-bg black
#
# setw -g window-status-fg cyan
# setw -g window-status-bg default
# setw -g window-status-attr dim
#shortcuts
#https://gist.github.com/mohamedalaa/2961058
#prefix : resize-pane -d (resizes the current pane down)
set-option -g allow-rename off
# #w for window name
# bind p pipe-pane -o "cat >>~/logs/tmux/#w.log" \; display "toggled logging to ~/logs/tmux/#w.log"
# set-option -g default-command "reattach-to-user-namespace -l zsh"
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle