-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
160 lines (122 loc) · 5.04 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# ==============================================================================
# title : tmux.conf
# description : This file contains some effecient tmux configurations
# author : Adi Iyengar
# username : aditya7iyengar
# date : 2016-05-20
# version : 0.7
# usage : link/move to ~/.tmux.conf
# notes : These configurations are to effeciently use tmux.
# versions : Tmux 2.6
# ==============================================================================
#########################
## BASIC TMUX SETTINGS ##
#########################
# Set default shell to zsh
set-option -g default-shell $SHELL
# Ring the bell if any background window rang a bell
set -g bell-action any
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal "screen-256color"
# Escape time value defaults to 1. Override it for faster tmux usage
set -sg escape-time 0
# Vi style key bindings
setw -g mode-keys vi
# Bigger history
set -g history-limit 10000
# Last saved environment is automatically restored when tmux is started
# set -g @continuum-restore 'on'
# tmux-highlight will show 'Copy' on copy mode
set -g @prefix_highlight_show_copy_mode 'on'
#########################
## COLOR SCHEME/THEME ##
#########################
set -g status-left-length 52
set -g status-right-length 150
set -g status-style fg=white,bg=colour234
set -g window-status-activity-style bold
set -g pane-border-style fg=colour245
set -g pane-active-border-style fg=colour42
set -g message-style fg=colour16,bg=colour221,bold
# Set window status bar
set-option -g status-interval 60
set -g status-left '#[fg=colour235,bg=colour246,bold] #S #[fg=colour252,bg=colour240,nobold] #[fg=colour245,bg=colour240,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]'
set -g status-right '#{prefix_highlight} #[fg=colour235,bg=colour246,bold] CPU:#{cpu_percentage} #[fg=colour245,bg=colour0,nobold]'
set -g window-status-format "#[fg=white,bg=colour0] #I #W "
set -g window-status-current-format "#[fg=colour237,bg=colour28]#[fg=colour245,bg=colour235,noreverse,bold] #I #W #[fg=colour39,bg=colour234,nobold]"
# Set first window to index 1
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Enable mouse switching
set-window-option -g mouse on
#########################
## COOL TMUX PLUGINS ##
#########################
# Tmux Plugin Manager
set -g @plugin 'tmux-plugins/tpm'
# Tmux Sensible (Some overridable, sensible tmux configurations)
set -g @plugin 'tmux-plugins/tmux-sensible'
# Regex searches, result highlighting and predefined searches
set -g @plugin 'tmux-plugins/tmux-copycat'
# Copy to system clipboard for tmux
set -g @plugin 'tmux-plugins/tmux-yank'
# Open highlighted selection directly from tmux
set -g @plugin 'tmux-plugins/tmux-open'
# Navigate seemlessly between vim and tmux
set -g @plugin 'christoomey/vim-tmux-navigator'
# Saving and restore of tmux environment
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Continuous saving and auto restore of tmux environment using tmux-resurrect
# set -g @plugin 'tmux-plugins/tmux-continuum'
# Quickly open any url on your terminal window
set -g @plugin 'tmux-plugins/tmux-urlview'
# Opens a tree directory listing for the current path
set -g @plugin 'tmux-plugins/tmux-sidebar'
# Highlights when you press tmux prefix key
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# Display CPU % and status icon
set -g @plugin 'tmux-plugins/tmux-cpu'
#########################
## DEFAULT BIND KEY ##
#########################
# Change default binding key to Ctrl-a
unbind C-b
set -g prefix C-a
bind a send-prefix
#########################
## KEY CONFIGURATIONS ##
#########################
# Keep your finger on ctrl, or don't
bind-key ^D detach-client
# Create horizontal and vertical splits with different ratios
bind-key v split-window -h -p 33 -c "#{pane_current_path}"
bind-key ^V split-window -h -p 50 -c "#{pane_current_path}"
bind-key h split-window -p 33 -c "#{pane_current_path}"
bind-key ^H split-window -p 50 -c "#{pane_current_path}"
bind-key C-Left swap-window -t -1
bind-key C-Right swap-window -t +1
# Pane resize in all four directions using vi bindings.
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
# Management
bind-key s choose-session
# Vim style
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key p run "(tmux show-buffer | pbcopy) && tmux load-buffer - ; tmux paste-buffer"
# Switch back and forth between last windows
unbind l
bind C-a last-window
# Force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Tmux conf reloaded"
# New windows/pane should open in in pwd
bind c new-window -c "#{pane_current_path}"
# easily toggle synchronization sends input to all panes in a given window.
bind E setw synchronize-panes off
#########################
## TPM INIT ##
#########################
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'