-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
executable file
·94 lines (79 loc) · 3.21 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
set -g default-terminal "screen-256color"
set -g mouse on
set -g set-clipboard external
set -g escape-time 10 # https://www.johnhawthorn.com/2012/09/vi-escape-delays/
set -g history-limit 10000
set-option -g status-position top
set-window-option -g allow-rename off
set -g allow-rename off
# remap prefix from 'C-b' to 'C-x', 0x18 hex code for iterm2
unbind C-b
set-option -g prefix C-x
bind-key C-x send-prefix
unbind C-z # https://superuser.com/questions/1291278/accidentally-stop-the-tmux-job-via-remote-shell
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# switching and creating windows using Shift-arrow without prefix
bind -n S-down new-window
bind -n S-left prev
bind -n S-right next
# and for split-keyboard
bind -n C-down new-window
bind -n C-left prev
bind -n C-right next
# resizing panes using Ctrl-Alt-arrows without prefix
bind -n C-M-Up resize-pane -U 2
bind -n C-M-Down resize-pane -D 2
bind -n C-M-Left resize-pane -L 10
bind -n C-M-Right resize-pane -R 10
bind -n C-M-k resize-pane -U 2
bind -n C-M-j resize-pane -D 2
bind -n C-M-h resize-pane -L 10
bind -n C-M-l resize-pane -R 10
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
###########################
# Colors
###########################
# color status bar
set -g status-style fg=white,bg=colour235
# color of message bar
set -g message-style fg=white,bold,bg=green
# highlight current window
setw -g window-status-style fg=cyan,bg=colour235
setw -g window-status-current-style fg=black,bold,bg=cyan
# set color of active pane
set -g pane-border-style fg=colour240,bg=default
set -g pane-active-border-style fg=green,bg=default
# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
if-shell '[[ $(uname -s) = Linux ]]' {
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
} {
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
}