-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdot_tmux.conf
149 lines (119 loc) · 5.12 KB
/
dot_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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Configuration
# =============
# Mouse on
set -g mouse on
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
set -g default-terminal "tmux-256color"
# Use vim key bindings in copy mode
set -g mode-keys vi
# Bindings
# ========
# Change prefix from 'C-b' to 'M-Space'
unbind C-b
set-option -g prefix M-Space
bind-key M-Space send-prefix
# Split panes using i and v defaulting to current path
bind-key i split-window -v -c '#{pane_current_path}'
bind-key v split-window -h -c '#{pane_current_path}'
unbind '"' # Liberate default bindings
unbind % # Liberate default bindings
# Kill window/pane without confirmation
bind-key & kill-window
bind-key x kill-pane
# Create new window defaulting to current path
bind c new-window -c '#{pane_current_path}'
# Break pane on a new window
bind-key b break-pane -d
# Show all the sessions
bind-key t choose-tree
# Zoom
bind-key Space resize-pane -Z
# Reload config file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# 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'
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# 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 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
bind-key -T copy-mode-vi 'M-h' select-pane -L
bind-key -T copy-mode-vi 'M-j' select-pane -D
bind-key -T copy-mode-vi 'M-k' select-pane -U
bind-key -T copy-mode-vi 'M-l' select-pane -R
# Personalization
# ===============
# Disable notifications
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
# nvim :checkhealth recommend this settings
set-option -sg escape-time 10
set-option -g focus-events on
# Catppuccin configuration
# ========================
# NOTE: you can use vars with $<var> and ${<var>} as long as the str is double quoted: ""
# WARNING: hex colors can't contain capital letters
# --> Catppuccin
thm_bg="#1e1e28"
thm_fg="#dadae8"
thm_cyan="#c2e7f0"
thm_black="#15121c"
thm_gray="#332e41"
thm_magenta="#c6aae8"
thm_pink="#e5b4e2"
thm_red="#e38c8f"
thm_green="#b1e3ad"
thm_yellow="#ebddaa"
thm_blue="#a4b9ef"
thm_orange="#f9c096"
thm_black4="#575268"
# ----------------------------=== Theme ===--------------------------
# status
set -g status-position bottom
set -g status "on"
set -g status-bg "${thm_bg}"
set -g status-justify "left"
set -g status-left-length "100"
set -g status-right-length "100"
# messages
set -g message-style fg="${thm_cyan}",bg="${thm_gray}",align="centre"
set -g message-command-style fg="${thm_cyan}",bg="${thm_gray}",align="centre"
# panes
set -g pane-border-style fg="${thm_gray}"
set -g pane-active-border-style fg="${thm_blue}"
# windows
setw -g window-status-activity-style fg="${thm_fg}",bg="${thm_bg}",none
setw -g window-status-separator ""
setw -g window-status-style fg="${thm_fg}",bg="${thm_bg}",none
# --------=== Statusline
set -g status-left ""
set -g status-right "#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #W #{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S "
# current_dir
setw -g window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} "
setw -g window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} "
# parent_dir/current_dir
# setw -g window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) "
# setw -g window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) "
# --------=== Modes
setw -g clock-mode-colour "${thm_blue}"
setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold"
# List of plugins
# =================
# set -g @plugin 'tmux-plugins/tpm' # Tmux plugin manager
# set -g @plugin 'tmux-plugins/tmux-sensible' # TODO: Document
# set -g @plugin 'christoomey/vim-tmux-navigator' # Awesome navigation between vim and tmux
# set -g @plugin 'tmux-plugins/tmux-copycat' # Search using `prefix + /`
# set -g @plugin 'tmux-plugins/tmux-open' # Opens files highlighted using `o`
# set -g @plugin 'tmux-plugins/tmux-yank' # Yanks with `y`
# run -b '~/.tmux/plugins/tpm/tpm'