-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
106 lines (79 loc) · 3.13 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
#--------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------
# use vi mode
setw -g mode-keys vi
# start window and pane numbering from 1 for easier switching
set -g base-index 1
setw -g pane-base-index 1
# title
set -g set-titles on
set -g set-titles-string '#T'
# renumber windows when one is removed.
set -g renumber-windows on
# monitor window activity to display in the status bar
setw -g monitor-activity on
# enable undercurl
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
# enable undercurl colors
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
# proper colors
set -g default-terminal "${TERM}"
# disable mouse for scrolling in editor
setw -g mouse off
# a bell in another window should cause a bell in the current window
setw -g bell-action any
# don't show distracting notifications
setw -g visual-bell off
setw -g visual-activity off
#--------------------------------------------------------------------------
# Status line
#--------------------------------------------------------------------------
# status line customisation
setw -g status-left-length 200
setw -g status-left " #{session_name} "
setw -g status-right ""
setw -g status-right-length 200
setw -g status-style "bg=default"
setw -g message-style "default"
setw -g window-status-format "#{window_index}:#{window_name}#{window_flags} " # window_name -> pane_current_command
setw -g window-status-current-format "#{window_index}:#{window_name}#{window_flags} "
setw -g window-status-current-style "fg=#e1a345"
setw -g window-status-last-style "fg=#936a2e"
setw -g window-status-activity-style none
setw -g status-justify left
#--------------------------------------------------------------------------
# Key Bindings
#--------------------------------------------------------------------------
set -g prefix C-a
bind C-a send-prefix
unbind C-b
# break pane out of window
bind B break-pane -d
# put pane back into window
bind E command-prompt -p "join pane from: " "join-pane -h -s '%%'"
# show a promp to kill a window by id with prefix+X
bind X command-prompt -p "kill window: " "kill-window -t '%%'"
# change the path for newly created windows
bind c new-window -c "#{pane_current_path}"
# search sessions
bind e display-popup -E "\
tmux list-sessions -F '#{?session_attached,,#{session_name}}' |\
sed '/^$/d' |\
fzf --reverse --header jump-to-session |\
xargs tmux switch-client -t"
# search panes in current session
bind f display-popup -E "\
tmux list-panes -s -F '#{window_index}.#{pane_index} #{window_name} #{pane_current_command} #{pane_current_path}' |\
sed '/^$/d' |\
fzf --reverse --header jump-to-pane |\
cut -d ' ' -f 1 |\
xargs -I % sh -c 'tmux select-pane -Zt % && tmux select-window -t %'"
# vi mode
bind v copy-mode
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-selection-and-cancel
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
run '~/.tmux/plugins/tpm/tpm'