-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
166 lines (137 loc) · 5.81 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
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'fcsonline/tmux-thumbs'
set -g @plugin 'robhurring/tmux-spotify'
set -g @plugin 'olimorris/tmux-pomodoro-plus'
set -g @plugin 'o0th/tmux-nova'
set -g @plugin 'tmux-plugins/tmux-continuum' # must be last to make sure saving works
set -g @nova-nerdfonts true
set -g @nova-nerdfonts-left "\uE0B4"
set -g @nova-nerdfonts-right "\uE0B6"
set -g @nova-nerdfonts-first
set -g @nova-nerdfonts-last
set -g @nova-padding 1
set -g @nova-pane "#W#{?window_zoomed_flag,-Z,}"
set -g @nova-pane-justify "left"
set -g @nova-pane-active-border-style "color6"
set -g @nova-message-command-style-fg "#2d3540"
set -g @nova-message-command-style-bg "#89c0d0"
set -g @nova-segment-session "#S#{?pane_in_mode, #{pane_mode},}"
set -g @nova-segment-session-colors "#{?pane_in_mode,colour2,colour4} #{?pane_in_mode,colour8,colour8}"
set -g @nova-segment-pomodoro "#(~/.tmux/plugins/tmux-pomodoro-plus/scripts/pomodoro.sh)"
set -g @nova-segment-pomodoro-colors "colour1 colour8"
set -g @nova-segment-battery "#(~/.tmux/plugins/tmux-battery/scripts/battery_percentage.sh)"
set -g @nova-segment-battery-colors "colour11 colour8"
set -g @nova-segment-spotify "#(~/.tmux/plugins/tmux-spotify/scripts/status.sh) #(~/.tmux/plugins/tmux-spotify/scripts/artist.sh): #(~/.tmux/plugins/tmux-spotify/scripts/track.sh)"
set -g @nova-segment-spotify-colors "colour4 colour8"
set -g @nova-segment-time "%d/%m %H:%M"
set -g @nova-segment-time-colors "colour5 colour8"
set -g @nova-rows 0
set -g @nova-segments-0-left "session"
set -g @nova-segments-0-right "pomodoro spotify battery time"
# Enable automatic restore
set -g @continuum-restore 'on'
# Match emails
set -g @thumbs-regexp-1 '[a-z\.\+]+@[a-z]+.com'
# Match files with line numbers and columns, might be interesting to open up files in the correct spot in other panes
set -g @thumbs-regexp-2 '(/?(?:[\w.-]+/)*[\w.-]+:\d+)'
# Copy from thumbs to system clipboard
set -g @thumbs-command 'echo -n {} | pbcopy'
# Set smaller hints closer to the cursor
set -g @thumbs-reverse true
# Set unique hints for same matches
set -g @thumbs-unique true
# Set hint position
set -g @thumbs-position right
# Set FG color of hint
set -g @thumbs-hint-fg-color red
# Customize spotify playing icons (otherwise there is a bug)
set -g @spotify_playing_icon "♫"
set -g @spotify_paused_icon "\uead1"
set -g @pomodoro_on "⏱ "
set -g @pomodoro_start 't'
set -g @pomodoro_mins 90
set -g @pomodoro_break_mins 5
set -g @pomodoro_notifications 'on'
# Load thumbs
run-shell ~/.tmux/plugins/tmux-thumbs/tmux-thumbs.tmux
set-option -g focus-events on
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Bind r to reload this file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf was successfully reloaded!"
# split panes using \ and -
bind \\ split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
unbind '"'
unbind %
# Resize panes
bind right resize-pane -R 7
bind left resize-pane -L 7
bind up resize-pane -U 7
bind down resize-pane -D 7
bind l resize-pane -R 7
bind h resize-pane -L 7
bind k resize-pane -U 7
bind j resize-pane -D 7
# Kill window
bind X confirm-before kill-window
# Redefine zoom for Mac keyboards because orthogonal is better
bind < resize-pane -Z
# Dont kick us out when deleting sessions
set-option -g detach-on-destroy no-detached
# Increase default history limit
set-option -g history-limit 50000
# Set escape time to 0, specially good for Vim
set -s escape-time 0
# Messages are displayed for 5 seconds
set -g display-time 5000
# Enable mouse control (clickable windows, panes, resizable panes)
set-option -g mouse on
# Enable copy to clipboard
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# Enable sane copy-mode keybindings
# Y definition is at the end of the file
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection
bind -T copy-mode-vi _ send-keys -X start-of-line
# Enter copy-mode
bind -n C-Space copy-mode
# Enter Thumbs
bind C-f thumbs-pick
# Mega useful search from terminal errors
bind -T copy-mode-vi s send-keys -X copy-pipe-and-cancel ~/Dev/dotfiles/bin/search_google.sh \; display-message "Let me Google that for you..."
# 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 ˇ if-shell "$is_vim" "send-keys ˇ" "select-pane -L"
bind-key -n ¯ if-shell "$is_vim" "send-keys ¯" "select-pane -D"
bind-key -n „ if-shell "$is_vim" "send-keys „" "select-pane -U"
bind-key -n ‘ if-shell "$is_vim" "send-keys ‘" "select-pane -R"
# no notfications
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
## Use all word separators
set-window-option -g word-separators ' @"=:,.()[]-/\'
## True color support, must be same on iTerm
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g status-position bottom
set -g status-right-length 350
set -g status-left-length 120
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'
# must be after tpm because something is defining Y
unbind-key -T copy-mode-vi Y
bind -T copy-mode-vi Y send-keys -X begin-selection \; send-keys -X end-of-line \; send-keys -X copy-selection-and-cancel