-
Notifications
You must be signed in to change notification settings - Fork 5
/
tmux.conf
123 lines (95 loc) · 3.2 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
# no command delay
set -sg escape-time 50
#set -g status-position top
set -g base-index 1
set -g pane-base-index 2
set -g renumber-windows on
bind-key -n C-t new-window
bind-key -n C-T new-window -c "#{pane_current_path}"
#bind k kill-pane
bind K kill-window
# I use this to toggle a split,
# which usually is a mix between nvim and the terminal
bind-key -n 'C-_' resize-pane -Z
# Don't rename windows automatically
set-option -g allow-rename off
# upgrade $TERM
# This requires to tic the tmux.terminfo file
set -g default-terminal "xterm-256color"
set-option -sa terminal-overrides ",xterm*:Tc"
# super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# increase scrollback buffer size
set -g history-limit 50000
# change leader to ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# resize of panes
bind-key -n C-S-Up resize-pane -U 10
bind-key -n C-S-Down resize-pane -D 10
bind-key -n C-S-Left resize-pane -L 10
bind-key -n C-S-Right resize-pane -R 10
# split
bind | split-window -h
bind \\ split-window -h -c '#{pane_current_path}'
bind _ split-window
bind - split-window -c '#{pane_current_path}'
bind , previous-window
bind . next-window
# navigation
# source .tmux.conf as suggested in `man tmux`
bind R source-file '~/.tmux.conf'
# switch panes using Alt-arrow without prefix
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# refresh 'status-left' and 'status-right' more often
set-option -g status-interval 1
# enable mouse
set -g mouse on
# recover focus events
set -g focus-events on
# Reload config
bind R source-file ~/.tmux.conf \; display "Config reloaded"
############################################################################
# Status Bar
############################################################################
# --> Catppuccin (Mocha)
thm_bg="#1e1e2e"
thm_fg="#cdd6f4"
thm_cyan="#89dceb"
thm_black="#181825"
thm_gray="#313244"
thm_magenta="#cba6f7"
thm_pink="#f5c2e7"
thm_red="#f38ba8"
thm_green="#a6e3a1"
thm_yellow="#f9e2af"
thm_blue="#89b4fa"
thm_orange="#fab387"
thm_black4="#585b70"
set -g status-bg "${thm_bg}"
set -g status-justify "left"
set -g status-left-length "100"
set -g status "on"
set -g status-right-length "100"
setw -g window-status-separator ""
set -g pane-border-style "fg=${thm_gray}"
set -g pane-active-border-style "fg=${thm_blue}"
set -g status-left ""
set -g status-right "#[fg=$thm_pink,bg=$thm_bg]#[fg=$thm_bg,bg=$thm_pink]#(cd #{pane_current_path}; git rev-parse --abbrev-ref HEAD) "
setw -g window-status-format "#[fg=${thm_bg},bg=${thm_blue}] #I #[fg=${thm_fg},bg=${thm_gray}] #W "
setw -g window-status-current-format "#[fg=${thm_fg},bg=${thm_orange}]#[fg=${thm_black},bg=${thm_orange}] #I #[fg=${thm_fg},bg=${thm_bg}] #W "
set-option -g visual-activity on
# use folder name as window's name
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
#Use vim keybindings in copy mode
setw -g mode-keys vi
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
set -g default-shell ${SHELL}
# List of plugins
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'