-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
108 lines (77 loc) · 2.92 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
set -g default-shell $SHELL
# Do not execute zsh as login shell, avoid reading .zprofile
# which is already loaded
set-option -g default-command zsh
set -g prefix C-a
unbind C-b
set -g renumber-windows on
set-option -g allow-rename off
# Let the window indexes start with 1
set -g base-index 1
# set also pane indexes
# setw is just shortcut for set-window-option
setw -g pane-base-index 1
# bind r to reloading configuration file of tmux session
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# let tmux send the prefix to current application by pressing the prefix twice
bind C-a send-prefix
# easier shortcuts for splitting the panes
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Create a new window and prompt for name
bind N command-prompt "new-window -n '%%' -c '#{pane_current_path}'"
# Move aroud buffer with vim key bindings
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
# vim-like selecting panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# make resizing panes less awkward, also -r makes it repeatable
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# https://ryanfb.github.io/etc/2015/10/19/tmux_mouse_mode_on_el_capitan.html
# listen to the mouse
set -g mouse on
bind-key -r < swap-window -t -1
bind-key -r > swap-window -t +1
# clear history
bind -n C-p send-keys C-l \; clear-history
# choose 256 color variant
set-option -ga terminal-overrides ",xterm-256color:Tc"
bind D source-file ~/.tmux.2.layout
bind S source-file ~/.tmux.3.layout
# -------------------
# CUSTOMIZE COLORS
# let the windows notify tmux when they have some activity
setw -g monitor-activity on
set -g visual-activity on
set -g visual-bell on
# Rerun all commands when resurrect is reloaded
set -g @resurrect-capture-pane-contents 'on'
# Store vim sessions as well
set -g @resurrect-strategy-nvim 'session'
# Restore tmux server state when starting a new one
set -g @continuum-restore 'on'
# set -g @plugin 'egel/tmux-gruvbox'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Be able to save current Tmux state - opened windows, panes and working directories
set -g @plugin 'tmux-plugins/tmux-resurrect'
# And do it automatically
set -g @plugin 'tmux-plugins/tmux-continuum'
# Be able to copy faster from commands' outputs
set -g @plugin 'tmux-plugins/tmux-copycat'
# Also, copy to the system clipboard
set -g @plugin 'tmux-plugins/tmux-yank'
# Move in Tmux with vim shortcuts
set -g @plugin 'christoomey/vim-tmux-navigator'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
source-file ~/.tmux.rose-pine