-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
111 lines (88 loc) · 3.38 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
# Use 24-bit colors
# Actually also set by 'tmux-sensible'
set -g default-terminal 'screen-256color'
set -ag terminal-overrides ',xterm-256color:RGB'
# Enable mouse support
set -g mouse on
# Set prefix
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# SHIFT + ALT vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
unbind C-f
# Pass through CTRL+f if the current pane command is `neovim`, so CTRL-f only works in `Normal` mode
bind -n -r C-f if -F '#{?#{m:*vim*,#{pane_current_command}},0,1}' {run 'tmux neww tmux-sessionizer'} {send C-f}
unbind s
bind -r s if -F '#{==:#{WORKSPACE},#{PERSONAL_WORKSPACE}}' {run 'tmux setenv -g WORKSPACE "$WORK_WORKSPACE"; tmux display-message -d 1500 "Switched to work!"'} {run 'tmux setenv -g WORKSPACE "$PERSONAL_WORKSPACE"; tmux display-message -d 1500 "Switched to personal!"'}
# Switch between the last 2 tmux sessions, similar to 'cd -' in the terminal
unbind Space
bind-key Space switch-client -l
# Splitting panes
unbind %
bind / split-window -h
unbind '"'
bind - split-window -v
# Killing windows/pane
unbind &
bind X kill-window
unbind x
bind x kill-pane
# Start windows/panes indexing at 1 (not 0)
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Resize panes
bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
bind -r h resize-pane -L 5
# Maximize pane
bind -r m resize-pane -Z
# Keep session alive, if even if closing the last window
# Will not detach from tmux, remain in the session
set -g detach-on-destroy off
# Set status bar to the top
set -g status-position top
# Vim-like yank keybinds
unbind C-v
bind -r C-v copy-mode
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# THEME
set -g @catppuccin_flavour 'mocha'
set -g @catppuccin_window_left_separator "█"
set -g @catppuccin_window_right_separator "█"
set -g @catppuccin_window_middle_separator "█"
set -g @catppuccin_window_number_position "left"
set -g @catppuccin_window_status_icon_enable "yes"
set -g @catppuccin_icon_window_last ""
set -g @catppuccin_icon_window_current ""
set -g @catppuccin_icon_window_zoom ""
set -g @catppuccin_icon_window_mark ""
set -g @catppuccin_icon_window_silent ""
set -g @catppuccin_icon_window_activity ""
set -g @catppuccin_icon_window_bell ""
set -g @catppuccin_date_time "%d-%m-%Y %H:%M"
# Options: application, directory, session, user, host, date_time, battery (set -g @plugin 'tmux-plugins/tmux-battery'), cpu (set -g @plugin 'tmux-plugins/tmux-cpu')
set -g @catppuccin_status_modules_right "battery date_time"
set -g @catppuccin_status_modules_left ""
# Set the save interval in minutes, default is 15
set -g @continuum-save-interval '5'
# Turn on automatic restore
set -g @continuum-restore 'on'
# This should be the last line of the configuration
run '~/.config/tmux/plugins/tpm/tpm'