-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
111 lines (85 loc) · 3.27 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
set -g history-limit 10000
# Setting the prefix from C-b to C-f
set -g prefix C-f
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
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
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Prevent window rename
set-option -g allow-rename off
# 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}"
# moving 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 selection
bind -r p select-window -t :-
bind -r n select-window -t :+
# Pane resizing panes with Prefix H,J,K,L
bind -r H resize-pane -L 6
bind -r J resize-pane -D 6
bind -r K resize-pane -U 6
bind -r L resize-pane -R 6
# mouse support
set -g mouse off
# set the status line's colors
set -g status-style fg=white,bg=default
# set the color of the window list
setw -g window-status-style fg=blue,bg=blue
# set colors for the active window
setw -g window-status-current-style fg=colour8,bg=colour4
# set the color of activity monitor | include changed windows
set-option -gw window-status-activity-style fg=black,bg=yellow
# colors for pane borders
setw -g pane-border-style fg=colour10,bg=default
setw -g pane-border-status off
setw -g pane-active-border-style fg=colour10,bg=default
# Command / message line
set -g message-style fg=black,bg=yellow
# format of window labels
set -g window-status-format "#[bg=black]#[fg=gray] #I: #W "
set -g window-status-current-format "#[bg=black]#[fg=green] #F.#P: #W "
set -g window-status-separator ""
# Status line left side
set -g status-left-length 60
set -g status-left "#[fg=white]#[bg=blue] ♠ #S #[bg=black]#[fg=blue]▓▒░ "
# Status line right side - 31-Oct 13:37
set -g status-right-length 0
set -g status-right ""
# Center the window list in the status line
set -g status-justify left
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# enable vi keys.
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -Tcopy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel '"xsel -i --clipboar'
#Plugins
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-logging' #save panel history to a file
set -g @plugin 'tmux-plugins/tmux-resurrect' #save and restore sessions
set -g @plugin 'tmux-plugins/tpm'
run '~/.tmux/plugins/tpm/tpm'
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
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"
# use prefix C-l to clear the screen
bind C-l send-keys 'C-l'
# do not resurrect cli programs
set -g @resurrect-processes 'false'