-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
84 lines (62 loc) · 2.23 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
# Setting the preffix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
# Set the base index for panes to 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
# Vim like navigation
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# 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
# Expand panes
bind -r Z resize-pane -Z
# Splitting panes with | and -
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Remove default patter of split
unbind '"'
unbind %
# Enables the use of the mouse
set -g mouse off
# Set the color of the bottom of the page
set -g status-style fg=white,bold
# Set the color of the window list
setw -g window-status-style fg=white,bold
# Set the color of the active window
setw -g window-status-current-style fg=red
# Command / message line
set -g message-style fg=white,bold,bg=black
# Configuring status line's content left side
set -g status-left-length 100
set -g status-left "Session: #S "
# Configuring status line's content right side
set -g status-right ""
# Define update status line interval
set -g status-interval 60
# Enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# Enable vi keys
setw -g mode-keys vi
# Configure tmux to use same keys to copy and paste as vim editor
bind Escape copy-mode
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-selection-and-cancel
unbind p
bind p paste-buffer
# Split pane and retain the current directory of existing pane
bind _ split-window -v -c "#{pane_current_path}"
bind \\ split-window -h -c "#{pane_current_path}"
# Shortcut for synchronize-panes toggle
bind C-s set-window-option synchronize-panes
bind C-l send-keys 'C-l'