-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
173 lines (141 loc) · 5.05 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
161
162
163
164
165
166
167
168
169
170
171
172
# Make C-a the default
unbind C-a
unbind C-b
set -g prefix C-a
# 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
# Watch for activity in background windows
setw -g monitor-activity on
# Keep your finger on ctrl, or don't
bind-key ^D detach-client
bind-key ^C new-window
# Create splits and vertical splits
#bind-key v split-window -h
#bind-key ^V split-window -h
#bind-key s split-window
#bind-key ^S split-window
unbind -
unbind _
unbind '\'
unbind '|'
unbind s
unbind C-s
unbind v
unbind C-v
bind-key - split-window
bind-key _ split-window
bind-key s split-window
bind-key C-s split-window
bind-key \ split-window -h
bind-key | split-window -h
bind-key v split-window -h
bind-key C-v split-window -h
bind-key j previous-window
bind-key h next-window
# Use vi keybindings for tmux commandline input.
# Note that to get command mode you need to hit ESC twice...
set -g status-keys vi
# Use vi keybindings in copy and choice modes
setw -g mode-keys vi
set -g history-limit 10000
setw -g aggressive-resize on
bind R refresh-client
bind a send-key C-a
# Vim-style copy/paste
bind t copy-mode
bind -t vi-copy H start-of-line
bind -t vi-copy L end-of-line
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
bind -t vi-copy q cancel
bind ] paste-buffer
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# set first window to index 1 (not 0) to map more to the keyboard layout...
set -g base-index 1
setw -g pane-base-index 1
# reload tmux config
unbind r
bind r \
source-file ~/.tmux.conf \;\
display 'Reloaded tmux config.'
set -g mouse on
# Toggle mouse on
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# pass through xterm keys
set -g xterm-keys on
# color scheme (style based on vim-powerline)
set -g status-left-length 52
set -g status-right-length 451
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour46
set -g message-fg colour16
set -g message-bg colour221
set -g message-attr bold
set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]⮀'
set -g window-status-format "#[fg=white,bg=colour234] #I #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour25,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀"
set -g status-right '#{prefix_highlight} | Batt: #{battery_icon} #{battery_percentage} #{battery_remain} | %a %h-%d %H:%M '
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# Plugin for scroll copy mode (enabling scroll up/down with your mouse)
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
# Resurrect lets us save and restore our entire tmux state!
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Pain control sets up VIM pane style pane movement control
# prefix + shift + hjkl for resizing
# prefix + | for horizontal split and prefix + - for vertical
# prefix + < moves window one position left and prefix + > moves window one position right
# prefix + hjkl for moving around panes
set -g @plugin 'tmux-plugins/tmux-pain-control'
# Predefined searches
# prefix + ctrl-f - simple file search
# prefix + ctrl-g - jumping over git status files (best used after git status command)
# prefix + alt-h - jumping over SHA-1 hashes (best used after git log command)
# prefix + ctrl-u - url search (http, ftp and git urls)
# prefix + ctrl-d - number search (mnemonic d, as digit)
# prefix + alt-i - ip address search
# These start "copycat mode" and jump to first match.
#"Copycat mode" bindings
# These are enabled when you search with copycat:
# n - jumps to the next match
# N - jumps to the previous match
# To copy a highlighted match:
# Enter - if you're using Tmux vi mode
set -g @plugin 'tmux-plugins/tmux-copycat'
# prefix + y - copies text from the command line to clipboard.
# Works with all popular shells/repls. Tested with:
#
# shells: bash, zsh (with bindkey -e), tcsh
# repls: irb, pry, node, psql, python, php -a, coffee
# remote shells: ssh, mosh
# vim/neovim command line (requires vim-husk or vim-rsi plugin)
# prefix + Y (shift-y) - copy pane current working directory to clipboard.
#
# copy mode bindings:
#
# y - copy selection to system clipboard
# Y (shift-y) - "put" selection - equivalent to copying a selection, and pasting it to the command line
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
run '~/.tmux/plugins/tpm/tpm'