-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
70 lines (62 loc) · 2.12 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
################
# KEYBINDINGS: #
################
# escape key
unbind C-b
set -g prefix F12
set -g prefix2 `
bind-key ` send-prefix -2
# window splitting
unbind %
bind | split-window -h
bind _ split-window -v
# swap M-<DIR> and S-D<DIR> to be more in line with emacs:
unbind-key -n S-Left
unbind-key -n S-Right
unbind-key -n S-Up
unbind-key -n S-Down
unbind-key -n M-Left
unbind-key -n M-Right
unbind-key -n M-Up
unbind-key -n M-Down
bind -n S-Left previous-window
bind -n S-Right next-window
bind -n S-Up switch-client -p
bind -n S-Down switch-client -n
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
# increase display panes time so that I can select pane by number (like
# switch-windows in emacs)
set -g display-panes-time 2000
##################
# MOUSE SUPPORT: #
##################
setw -g mode-mouse copy-mode
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
##########################
# MISCELLANEOUS SETTINGS #
##########################
# use emacs mode keys in scrollback
setw -g mode-keys emacs
# renumber windows when one is closed:
set-option -g renumber-windows on
############################
# ENABLE COPY TO CLIPBOARD #
############################
# copy tmux paste buffer to CLIPBOARD
# bind C-c run "tmux show-buffer | xclip -i -selection clipboard"
bind C-c run "tmux save-buffer - | xclip -i -selection clipboard > /dev/null; tmux display-message \"tmux buffer saved to clipboard\" "
# bind C-c run "tmux show-buffer | xsel -i -b"
# copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer
bind C-v run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
# bind C-v run "tmux set-buffer -- \"$(xsel -o -b)\"; tmux paste-buffer"
#################################################
# FUNCTION FOR SENDING A COMMAND TO ALL WINDOWS #
#################################################
bind C-e command-prompt -p "Command:" \
"run \"tmux list-panes -s -F '##{session_name}:##{window_index}.##{pane_index}' \
| xargs -I PANE tmux send-keys -t PANE '%1' Enter\""