Repository navigation
Expand file tree
/
Copy path.tmux.conf
More file actions
122 lines (101 loc) · 4.49 KB
/
Copy path.tmux.conf
File metadata and controls
122 lines (101 loc) · 4.49 KB
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
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'soyuka/tmux-current-pane-hostname'
# See: https://jdhao.github.io/2018/10/19/tmux_nvim_true_color/
set -g default-terminal "tmux-256color"
set -as terminal-features ",xterm-256color:RGB"
set -as terminal-features ',xterm-kitty:RGB'
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # undercurl color support
unbind-key C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Some motion keys to make switching windows faster
bind -n S-Right next-window
bind -n S-Left previous-window
# Bind Shift-k to killing current session
bind K confirm kill-session
# Bind r to reloading the configuration
bind r source-file ~/.tmux.conf \; display "~/.tmux.conf sourced"
set -g mouse on
# Index at 1 instead of 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
# No bells at all
set-option -g bell-action none
set-option -g display-time 2000
# Scroll History
set-option -g history-limit 10000
set-option -g renumber-windows on
# Status bar at top
set-option -g status-position top
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
# Start new pans in the same working directory
bind c new-window -c "#{pane_current_path}"
# Some binds for easier splits
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# Easy resizing of panes
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
# Move panes around
#bind -n S-Up move-pane -h -t '.{up-of}'
#bind -n S-Right move-pane -h -t '.{right-of}'
#bind -n S-Left move-pane -h -t '.{left-of}'
#bind -n S-Down move-pane -h -t '.{down-of}'
# Nice window behavior
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g status-interval 1 # redraw status line every 1 second for more responsive updates
# theme
set-option -g status-style 'bg=#073642,fg=#93a1a1'
set-option -g status-left-length 40
set-option -g status-left '#[bg=#4c50ab,fg=#93a1a1] #(whoami)@#H #[bg=#073642,fg=#4c50ab]⡿⠋#[bg=#073642] '
set-option -g status-right-length 40
set-option -g status-right '#[bg=#073642,fg=#4c50ab]⠈⠻⣿#[bg=#4c50ab,fg=#93a1a1] %b %d @ %H:%M '
set-option -g window-status-format '#[bg=#073642,fg=#e66f3c]⠈⠻⣿#[bg=#e66f3c,fg=#002b36] [#I] #W #[bg=#073642,fg=#e66f3c]⡿⠋'
set-option -g window-status-separator ' '
set-option -g window-status-current-format '#[bg=#073642,fg=#fe9569]⠈⠻⣿#[bg=#fe9569,fg=#002b36] [#I] #W #[bg=#073642,fg=#fe9569]⡿⠋'
set-option -g message-style 'bg=#5a5143,fg=#93a1a1'
set-option -g message-command-style 'bg=#5a5143,fg=#93a1a1'
# POPUP WINDOWS
# These two shortcuts provide popup windows in tmux. The lowercase version
# makes a popup that named uniquely to the working directory. This is great
# for making a popup window in a coding project.
#
# The uppercase version makes a "global" popup window. Great for persisting
# things globally for a long period of time.
bind g run-shell '\
POPUP_NAME="popup-$(basename "#{pane_current_path}" | tr -cd "a-zA-Z0-9-")"; \
if [ "#{session_name}" = "$POPUP_NAME" ]; then \
tmux detach-client; \
else \
tmux display-popup -d "#{pane_current_path}" -xC -yC -w 80% -h 75% -E "tmux attach-session -t $POPUP_NAME || tmux new-session -s $POPUP_NAME"; \
fi \
'
bind G run-shell '\
POPUP_NAME="popup-global"; \
if [ "#{session_name}" = "$POPUP_NAME" ]; then \
tmux detach-client; \
else \
tmux display-popup -xC -yC -w 80% -h 75% -E "tmux attach-session -t $POPUP_NAME || tmux new-session -s $POPUP_NAME"; \
fi \
'
# Initialize the session
# If "archon" session already exists, just attach
# When a session is created, if it's named "archon", build the layout.
set-hook -g session-created 'if-shell -F "#{==:#{session_name},admin}" "\
rename-window -t admin:1 eud \; \
send-keys -t admin:1.1 \"cd ~/\" C-m \; \
split-window -h -p 50 -t admin:1 -c ~/ \; \
select-window -t admin:1"'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'