This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
/
.tmux.conf.mac
110 lines (81 loc) · 3.98 KB
/
.tmux.conf.mac
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
# https://www.elmund.io/osx/2015/07/10/open-command-in-osx-tmux/
set -g default-command "reattach-to-user-namespace -l $SHELL"
# This respects the default shell. Use `chsh -s <path-to-shell>` to change.
# Shell must be listed in /etc/shells
# https://github.com/alacritty/alacritty/issues/109#issuecomment-440353106
# This fixes coloring issues, specifically with emacs themes.
set -g default-terminal 'screen-256color'
set -ga terminal-overrides ',*256col*:Tc'
# DO NOT CHANGE
set-option -g default-shell /bin/bash
# If this is not set to bash, then `pane_current_path` is always ~.
# Setting default-command to preferred shell above should be sufficient.
# https://github.com/fish-shell/fish-shell/issues/5699
# split panes using | and -, using the same path.
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
bind e resize-pane -U 10
bind E resize-pane -D 10
# Command to open new pane in current path
bind v new-window -c "#{pane_current_path}"
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf \
# Enable mouse mode (tmux 2.1 and above)
# https://stackoverflow.com/a/40902312/905101
# Version-specific commands [grumble, grumble]
# See: https://github.com/tmux/tmux/blob/master/CHANGES
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.1" | bc)" = 1 ]' \
"set -g mouse-select-pane on; set -g mode-mouse on; \
set -g mouse-resize-pane on; set -g mouse-select-window on"
# In version 2.1 "mouse" replaced the previous 4 mouse options
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.1" | bc)" = 1 ]' \
"set -g mouse on"
# UTF8 is autodetected in 2.2 onwards, but errors if explicitly set
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.2" | bc)" = 1 ]' \
"set -g utf8 on; set -g status-utf8 on; set -g mouse-utf8 on"
# 0 is too far from ` ;)
set -g base-index 1
setw -g pane-base-index 1
# Clock mode 12 hour style (prefix t)
set -g clock-mode-style 12
# Re-number panes after closing.
set-option -g renumber-windows on
## COLORSCHEME: gruvbox dark (medium)
set-option -g status "on"
set -g status-position top
# default statusbar color
set-option -g status-style bg=colour239,fg=colour223 # bg=bg1, fg=fg1
# default window title colors
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
# default window with an activity alert
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
# active window title colors
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
# pane border
set-option -g pane-active-border-style fg=colour250 #fg2
set-option -g pane-border-style fg=colour237 #bg1
# message infos
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
# writing commands inactive
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
# pane number display
set-option -g display-panes-active-colour colour250 #fg2
set-option -g display-panes-colour colour237 #bg1
# clock
set-window-option -g clock-mode-colour colour109 #blue
# bell
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
set-option -g status-justify "left"
set-option -g status-left-style none
set-option -g status-left-length "80"
set-option -g status-right-style none
set-option -g status-right-length "80"
set-window-option -g window-status-separator ""
set -g status-left "#[bg=colour239,fg=colour248,bold][#S] "
set -g status-right '#[bg=colour239,fg=colour248,bold] #(~/.tmux-scripts/battery.sh)#[bg=colour239,fg=colour248,bold] %b %d %l:%M %p#[default]'
set-window-option -g window-status-current-format "#[bg=colour214,fg=colour239,bold] #I:#{b:pane_current_command}:#{b:pane_current_path}#F "
set-window-option -g window-status-format "#[bg=colour239,fg=colour223,nobold] #I:#{b:pane_current_command}:#{b:pane_current_path}#F "