-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
115 lines (81 loc) · 4.01 KB
/
Copy path.tmux.conf
File metadata and controls
115 lines (81 loc) · 4.01 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
# -- general -------------------------------------------------------------------
# Reassign prefix key
set -g prefix C-a
# Clear screen
bind -n C-k send-keys -R \; clear-history
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# enable vi mode keys
set-window-option -g mode-keys vi
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
set -s escape-time 0
# pane border
set -g pane-border-style fg='#6272a4'
set -g pane-active-border-style fg='#c35f75'
# message text
set -g message-style bg='#111111',fg='#8be9fd'
set -g status-style bg='#111111',fg='#bd93f9'
set -g status-interval 1
# status left
# are we controlling tmux or the content of the panes?
set -g status-left '#[bg=#f8f8f2]#[fg=#282a36]#{?client_prefix,#[bg=#4e93a6],} Ω '
# are we zoomed into a pane?
set -ga status-left '#[bg=#111111]#[fg=#ff79c6] #{?window_zoomed_flag, ⭕️ , }'
# window status
set-window-option -g window-status-style fg='#bd93f9',bg=default
set-window-option -g window-status-current-style fg='#ff79c6',bg='#282a36'
BLUE='#4e93a6'
RED='#c35f75'
PURPLE='#a076b7'
set -g window-status-current-format '#[fg=#111111]#[bg=#4e93a6]#[fg=#111111]#[bg=#4e93a6] #I #W #[fg=#111111]#[bg=#4e93a6]'
set -g window-status-format "#[fg=#f8f8f2]#[bg=#111111]#I #W #[fg=#111111]"
# status right
set -g status-right '#[fg=#4e93a6,bg=#111111#[fg=#111111,bg=#111111] #(tmux-mem-cpu-load -g 5 --interval 2) '
set -ga status-right '#[fg=#c35f75,bg=#111111]#[fg=#c35f75,bg=#111111] #(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") '
set -g status-right-length 60
set -g status-interval 2
# -- display -------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
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 set-titles on # set terminal title
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history
# activity
set -g monitor-activity on
set -g visual-activity off
set -g terminal-overrides ',xterm-256color:Tc'
set -g default-terminal "screen-256color"
set -as terminal-overrides ',xterm*:sitm=\E[3m'
set -g status-left-length 50
# -- navigation ----------------------------------------------------------------
bind l split-window -h -c "#{pane_current_path}"
bind j split-window -v -c "#{pane_current_path}"
bind b select-window -l
# unbind '"'
# unbind %
# pane navigation
bind J resize-pane -D 5
bind K resize-pane -U 5
bind H resize-pane -L 5
bind L resize-pane -R 5
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind-key -n M-x confirm-before "kill-pane"
# -- copy ----------------------------------------------------------------------
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
unbind -T copy-mode-vi Enter
# Drag to also use copy-pipe
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "pbcopy"