-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
93 lines (72 loc) · 2.88 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
##### Global settings
# reset prefix
set -g prefix C-a
bind-key a send-prefix # for nested tmux sessions
# improve color
# set -g default-terminal "screen-256color"
# utf8 support
set-window-option -g utf8 on
# rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size
# of any client connected to *that window*. Much more reasonable.
set-window-option -g aggressive-resize on
# automatically set window title
setw -g automatic-rename
# dynamic window title
set-option -g set-titles on
# scrolling with S-PageUp/S-PageDown
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@"
# increase scrollback lines
set -g history-limit 10000
# make shift+arrows, ctrl+arrows etc work in Vim.
set-window-option -g xterm-keys on
# set window notifications
set-window-option -g monitor-activity on
set -g visual-activity on
# reload tmux conf.
unbind r
bind r source-file ~/.tmux.conf\; display "Reloaded conf."
# fixes slow ESC issues.
set -s escape-time 0
# use mouse
# setw -g mode-mouse on
# setw -g mouse-resize-pane on
# set -g mouse-select-window on
set -g mouse-select-pane on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
# move tmux copy buffer into x clipboard
bind C-y run "tmux save-buffer - | xclip -i -selection clipboard"
##### Statusbar options
set-option -g status on
set-option -g status-interval 2
set-option -g status-utf8 on
#### Vim keys
# split windows like vim
bind s split-window -v
bind v split-window -h
# move around panes with hjkl
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l"
# resize panes like vim
# bind < resize-pane -L 5
# bind > resize-pane -R 5
# bind - resize-pane -D 5
# bind + resize-pane -U 5
# bind : to command-prompt like vim
bind : command-prompt
# vi-style controls for copy mode
setw -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection