-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
121 lines (92 loc) · 3.59 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
## TMUX CONFIG
# Credits
# - tmux 2 - Brian Hogan
# Set the prefix from <C-b> to <C-a>
set -g prefix C-a
# Free original Ctrl-b prefix keybinding
unbind C-b
# Remove tmux delay for sending commands especially when
# working with vim
set -s escape-time 1
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
# Bind r to live reload .tmux.conf file
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# If an application uses <C-a>, set it such that pressing it
# twice sends the key-combination to that application
bind C-a send-prefix
# Splitting panes with | and _
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# Enable mouse mode
set -g mouse on
# Set default terminal mode to 256 color mode
set -g default-terminal "xterm-256color"
# Set the status line's colors
set -g status-style fg=white,bg=black
setw -g window-status-style fg=cyan,bg=default
# Set color for the active window
setw -g window-status-current-style fg=white,bold,bg=green
# Set colors for pane borders
setw -g pane-border-style fg=green,bg=black
setw -g pane-active-border-style fg=white,bg=green
# Dim out any panes that are not active
# setw -g window-style fg=white,bg=gray
# setw -g window-active-style fg=white,bg=black
# Customize command/message line
set -g message-style fg=black,bold,bg=yellow
# Enable focus events so that autoread may work
set-option -g focus-events on
# Disable right pane
set -g status-right "---"
# add space for left status
set -g status-left-length 300
# Keep status line info up to date
set -g status-interval 60
setw -g monitor-activity on
set -g visual-activity on
# Vi copypaste mode
set-window-option -g mode-keys vi
# bind-key -t vi-copy 'v' begin-selection
# bind-key -t vi-copy 'y' copy-selection
# starting with tmux version 2.6 this changes to:
bind-key -T copy-mode-vi 'v' send -X begin-selection
# bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# bind-key -Tcopy-mode-vi <C-v> send -X begin-selection
# bind-key -Tcopy-mode-vi <C-y> send -X copy-selection
# Prompt for window name upon creating a new window
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# Toggle status line
bind-key q set-option status
# Add vim-tmux navigation
# Smart pane switching with awareness of Vim splits and fzf.
# See: https://github.com/christoomey/vim-tmux-navigator
not_tmux="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?(g?(view|n?vim?x?)(diff)?|fzf)$'"
bind-key -n C-h if-shell "$not_tmux" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$not_tmux" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$not_tmux" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$not_tmux" "send-keys C-l" "select-pane -R"
bind-key -n 'C-\' if-shell "$not_tmux" "send-keys 'C-\\'" "select-pane -l"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# Move between panes with <prefix> h,j,k,l
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# Quick window select
bind -r C-y select-window -t :-
# bind -r C-u select-window -t :+
# Resizing panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Breaking away a pane
bind -r B break-pane