-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.tmux.conf
More file actions
144 lines (103 loc) · 4.94 KB
/
.tmux.conf
File metadata and controls
144 lines (103 loc) · 4.94 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
##################### GENERAL
# assume 256 colors
set -g default-terminal "screen-256color"
# Display all colors
# /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/gawin/bash-colors-256/master/colors)"
# index bases
set-option -g base-index 0
set-window-option -g pane-base-index 1
# Enable mouse
set-window-option -g mouse on
# Lower escape timing for quicker response to scroll-buffer access
set -s escape-time 25
# display times
set -g display-panes-time 1500
set -g display-time 1000
# rename window to reflect current program
set-window-option -g automatic-rename on
##################### BINDING
# main prefix Alt-x
unbind C-b
set -g prefix M-x
bind M-d send-prefix
# reload ~/.tmux.conf
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# edit configuration
bind e new-window -n 'TMUX CONFIG' "sh -c '\${EDITOR:-vim} ~/.tmux.conf'"
bind v new-window -n 'VIM CONFIG' "sh -c '\${EDITOR:-vim} ~/.vimrc'"
bind b new-window -n 'BASH CONFIG' "sh -c '\${EDITOR:-vim} ~/.bashrc'"
bind g new-window -n 'BASH CONFIG' "sh -c '\${EDITOR:-vim} ~/.gmailctl/config.jsonnet'"
# split window horizontaly
bind | split-window -h
# split window horizontaly
bind - split-window -v
# kill settion
bind-key M-q kill-session
# sync panes
bind-key \\ set-window-option synchronize-panes
##################### UI
# statusline setup
set -g status on
# this is based-off of https://github.com/jimeh/tmux-themepack/blob/7bb2aa5/powerline/double/yellow.tmuxtheme
# Status update interval
set -g status-interval 60
# Basic status bar colors
set -g status-style fg=colour240,bg=colour233
# Variables
%if "#{==:#(echo \$ISSERVER),1}" io_color_main_bg=colour81 %else io_color_main_bg=colour78 %endif
# Left side of status bar
set -g status-left-style bg=colour233,fg=colour243
set -g status-left-length 40
set -g status-left "#[fg=colour233,bg=#{io_color_main_bg},bold] #{session_name} #[fg=#{io_color_main_bg},bg=colour240,nobold]"
set -ag status-left "#[fg=colour233,bg=colour240] #{host} #[fg=colour240,bg=colour235]"
set -ag status-left "#[fg=colour240,bg=colour235] #{window_index}:#{pane_index} #[fg=colour235,bg=colour233,nobold]"
# Right side of status bar
set -g status-right-style bg=colour233,fg=colour243
set -g status-right-length 150
set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] ↑ #(uptime | sed -re 's/.*up//' -e 's/,.*//' -e 's/^ *//') "
set -ag status-right "#[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] #(uptime | sed -e 's/.*load average: //' -e 's/,//g') "
# set -ag status-right "#[fg=colour88]#[fg=colour78,bg=colour88] #(curl -sSL https://api.thevirustracker.com/free-api?countryTotal=DZ|jq -r '.countrydata|.[]|\"Today \"+(.total_new_deaths_today|tostring)+\"/\"+(.total_new_cases_today|tostring)+\" All \"+(.total_deaths|tostring)+\"/\"+(.total_cases|tostring)' 2>/dev/null) "
set -ag status-right "#[fg=colour215]#[fg=colour196,bg=colour215] #(curl -sSL https://www.worldometers.info/coronavirus/country/\$COVID_LOCATION/ | pup \"#newsdate`date --date='yesterday' '+%Y-%m-%d'` div.news_post div.news_body ul.news_ul li.news_li strong:nth-child(1) text{}\" 2>/dev/null) "
set -ag status-right "#[fg=#{io_color_main_bg}]#[fg=colour233,bg=#{io_color_main_bg}] #(curl https://wttr.in/\$WEATHER_LOCATIONS?format=3 2>/dev/null) %b-%d-%Y %H:%M "
# Window status
set -g window-status-format " #I:#W#F "
set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=#{io_color_main_bg},bold] #I:#W#F #[fg=colour233,bg=black,nobold]"
# Current window status
set -g window-status-current-style bg="#{io_color_main_bg}",fg=colour235
# Window with activity status
set -g window-status-activity-style bg=colour233,fg=colour245
# Window separator
set -g window-status-separator ""
# Window status alignment
set -g status-justify centre
# Pane border
set -g pane-border-style bg=default,fg=colour238
# Active pane border
set -g pane-active-border-style bg=default,fg="#{io_color_main_bg}"
# Pane number indicator
set -g display-panes-colour colour233
set -g display-panes-active-colour colour78
# Clock mode
set -g clock-mode-colour colour78
set -g clock-mode-style 24
# Message
set -g message-style bg="#{io_color_main_bg}",fg=black
# Command message
set -g message-command-style bg=colour233,fg=black
# Mode
set -g mode-style bg="#{io_color_main_bg}",fg=colour235
##################### PLUGINS
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'wfxr/tmux-fzf-url'
# set -g @plugin 'jimeh/tmux-themepack'
# plugins setup
set -g @continuum-boot 'off'
set -g @continuum-restore 'on' # auto-restore last laved env
set -g focus-events on # to better support vim https://github.com/tmux-plugins/vim-tmux-focus-events
# must always at the bottom
run '~/.tmux/plugins/tpm/tpm'