This repository has been archived by the owner on Jan 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
tmux.conf
executable file
·124 lines (98 loc) · 3.74 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
#----------------------------------
#
# General settings
#
#----------------------------------
if-shell "uname | grep -q Darwin" "source ~/.tmux.darwin.conf"
if-shell "uname | grep -q Linux" "source ~/.tmux.linux.conf"
set -g default-terminal "screen-256color"
# Use ctrl-a as prefix
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# UTF is great, let us use that
set -gq utf8
set-window-option -gq utf8 on
# command delay? We don't want that, make it short
set -sg escape-time 1
# Set the numbering of windows to go from 0
set-option -g base-index 0
setw -g pane-base-index 0
# Use xterm keys
set-window-option -g xterm-keys on
#----------------------------------
#
# Visual settings
#
#----------------------------------
# Status bar positioning
set-option -g status-position top
set -g status-justify centre
set -g status-bg colour235
set -g status-fg white
set -g window-status-format ' #I:#W#F '
set -g window-status-current-format ' #I:#W '
set-window-option -g mode-style bg=colour91,fg=white
set-window-option -g window-status-bg colour235
set-window-option -g window-status-fg colour244
set-window-option -g window-status-current-bg colour235
set-window-option -g window-status-current-fg white
set-window-option -g window-status-attr dim
set -g status-interval 1 # reload every 1s
set -g status-left '#[bg=colour235,fg=colour244] #S '
set -g @cpu_low_bg_color "#[bg=#2aa198]"
set -g @cpu_medium_bg_color "#[bg=#b58900]"
set -g @cpu_high_bg_color "#[bg=#dc322f]"
set -g @prefix_highlight_bg '#6c71c4'
set -g status-right "#{prefix_highlight} | #{cpu_bg_color} CPU:#{cpu_percentage} #[bg=colour235,fg=white] | %Y-%m-%d | #[bg=#268bd2,fg=white] #(TZ=America/Denver date +%%H):%M:%S "
#set -g status-right "%Y-%m-%d | #[fg=white]#(TZ=Europe/Stockholm date +%%H):%M:%S "
set -g status-left-length 30
set -g status-right-length 50
set-option -g message-bg colour235
set-option -g message-fg colour166
set-option -g pane-border-fg colour172
set-option -g pane-active-border-fg colour172
# Allow us to reload our tmux configuration while using tmux.
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Getting interesting now, we use the vertical and horizontal symbols to split
# the screen
bind | split-window -h
bind - split-window -v
# Killing windows and panes
bind w kill-pane
bind q kill-window
#---------------------------------
# mouse settings
#---------------------------------
set -g mouse on
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
# set -g mouse-select-window on
#----------------------------------
# Vim integration
#----------------------------------
# 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 C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
#---------------------------------
# tmux plugins
#---------------------------------
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
#---------------------------------
# resurrect settings
#---------------------------------
set -g @resurrect-capture-pane-contents 'on'
# Resurrect neovim sessions
set -g @resurrect-strategy-nvim 'session'
# Run the plugin manager, should be the last line of the tmux.conf
run '~/.tmux/plugins/tpm/tpm'