-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
129 lines (104 loc) · 3.73 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
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
setw -g set-clipboard external
# vim
setw -g mode-keys vi
# Select pane when clicked (also passes through)
set-option -g mouse on
setw -g mouse on
# esc to copy mode
bind Escape copy-mode
unbind K
bind K confirm-before "kill-window"
setw -g automatic-rename
# status bar
#set-option -g status-utf8 on
set-option -g status-justify centre
set-option -g status-bg default
set-option -g status-fg cyan
set-option -sg status-left-length 0
# cool: can use #T to show current directory
set-option -g status-left '#[fg=green][ ###S ] ['
set-option -g status-right '#[fg=green]] [ #[fg=blue]%F #[fg=white]%I:%M%P #[fg=green]]#[default]'
set-window-option -g window-status-current-style fg=white
set-window-option -g window-status-format '#I:#W#F'
set-window-option -g window-status-current-format '#[fg=red](#[fg=white]#I:#W#F#[fg=red])#[default]'
# clock
set-window-option -g clock-mode-colour cyan
set-window-option -g clock-mode-style 12
# pane borders
set-option -g pane-border-style fg=white
set-option -g pane-active-border-style fg=magenta
# Set window notifications
setw -g monitor-activity on # changes tab color when activity seen
set -g visual-activity off # don't send message when activity seen
# Note to self:
# to monitor for 30s of silence:
# setw monitor-activity off
# setw monitor-silence 30
# Open panes in #{pane_current_path}
unbind-key c
bind-key c new-window -c "#{pane_current_path}"
# splitting panes
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# moving between panes
bind h select-pane -L
bind C-h select-pane -L
bind j select-pane -D
bind C-j select-pane -D
bind k select-pane -U
bind C-k select-pane -U
bind l select-pane -R
bind C-l select-pane -R
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\\\" "select-pane -l"
# resizing panes
bind Down resize-pane -D 10
bind Up resize-pane -U 10
bind Left resize-pane -L 10
bind Right resize-pane -R 10
# resource
bind r source-file ~/.tmux.conf
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'C-v' send -X rectangle-toggle
# provided by tmux-yank
#bind-key -Tcopy-mode-vi 'y' send -X copy-selection-and-cancel
# Override 256 with true colour
set-option -ga terminal-overrides ",*256col*:Tc"
# List of plugins
setenv -g TMUX_PLUGIN_MANAGER_PATH "~/.tmux/plugins/"
set -g @tpm_plugins ' \
laktak/extrakto \
tmux-plugins/tpm \
tmux-plugins/tmux-copycat \
tmux-plugins/tmux-fpp \
tmux-plugins/tmux-open \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-yank \
NHDaly/tmux-scroll-copy-mode \
'
# tmux-open gives 'o' to open in default program, <C-o> to open in editor
# tmux-copycat gives:
# - prefix-/ for search,
# - pf-<C-f> for file search,
# - pf-<C-g> for git status,
# - pf-<C-u> for url search
# tmux-sensible sets a bunch of sensible defaults
# tmux-yank gives <y> to copy to clipboard, <S-Y> to copy then paste
# tmux-fpp runs Facebook PathPicker on the tty with pf-<f>
if 'test ! -d ~/.tmux/plugins/tmux-yank' \
"run '~/.tmux/plugins/tpm/bin/install_plugins'"
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run '~/.tmux/plugins/tpm/tpm'
run-shell '~/.tmux/plugins/extrakto/extrakto.tmux'
run-shell '~/.tmux/plugins/tmux-sensible/sensible.tmux'