-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
89 lines (69 loc) · 2.75 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
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
unbind r
bind r source-file ~/.config/tmux/tmux.conf
# Start windows and panes 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
# set vi-mode
set-window-option -g mode-keys vi
# keybinding
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
unbind -T copy-mode-vi MouseDragEnd1Pane
# Open panes in current directory
unbind %
bind \\ split-window -h -c "#{pane_current_path}"
unbind '"'
bind - split-window -v -c "#{pane_current_path}"
# Set prefix
unbind C-b
set -g prefix C-s
bind C-s send-prefix
# Act like vim
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Pane resize
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
bind m resize-pane -Z # In order to maximize
# Swap tmux windows with ctrl+shift and the direction key
# The -n means that you don't need to press the prefix key to execute this keybinding
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
# Switch to next/previous sessions
bind-key ')' switch-client -n
bind-key '(' switch-client -p
# Switch to window named "k9s" in the first session
bind-key '.' switch-client -t terminals:="k9s" # Press prefix followed by .
bind-key '0' switch-client -t terminals:="oci-boat" # Press prefix followed by 0
# Kill the current window and all its open panes. Default keybinding was Prefix + &
bind q killw
# tpm plugin
set -g @plugin 'tmux-plugins/tpm'
# List of plugins
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'christoomey/vim-tmux-navigator'
# set -g @plugin 'tmux-plugins/tmux-resurrect' # persist tmux sessions after computer restart
# set -g @plugin 'tmux-plugins/tmux-continuum' # automatically saves sessions for you every 15 minutes
set -g @plugin 'dreamsofcode-io/catppuccin-tmux' # Fork of the theme below
# set -g @plugin 'catppuccin/tmux#v2.1.0' # See https://github.com/catppuccin/tmux/tags for additional tags
set -g @plugin 'tmux-plugins/tmux-urlview'
# These are commented out because they caused an error opening anything in tmux after a reboot
# set -g @resurrect-capture-pane-contents 'on'
# set -g @continuum-restore 'on'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'