-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot.tmux.conf
More file actions
110 lines (89 loc) · 4.21 KB
/
dot.tmux.conf
File metadata and controls
110 lines (89 loc) · 4.21 KB
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
# act like the GNU screen
unbind C-b
set -g prefix C-a
# ensure that we can send Ctrl-A to other apps
bind C-a send-prefix
# bind "r" to soft reload of configuration file
unbind r
bind-key r source-file ~/.tmux.conf \; display-message "tmux configuration reloaded!"
# prevent tmux starting a shell in login mode by default, to avoid macOS's
# /usr/libexec/path_helper (or something else) mess up with our PATH variable
# https://wiki.archlinux.org/title/tmux#Start_a_non-login_shell
set -g default-command "${SHELL}"
# set delay between prefix and command, eliminate ESC key delay
set -s escape-time 0
# set first window, first pane indexes to 1, and auto-renumber windows
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
# scrollback buffer
set -g history-limit 50000
# enable vi keys (in visual mode, for example)
set -g mode-keys vi
# enable mouse, and leave an option to disable/enable
set -g mouse on
bind-key m set-option -g mouse \; display "Mouse: #{?mouse,ON,OFF}"
# pass through focus-events from terminal to the running app
set -g focus-events on
# set the default terminal mode (overrides needed for Vim colors issue inside Alacritty)
set -g default-terminal "$TERM"
set -as terminal-features ",$TERM*:RGB" # https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
# enable activity alerts
set -g monitor-activity on
# status line nuts and bolts
set -g status-interval 10
# set-option -g status-position top # wanna feel iTerm-ish?
set -g status-style fg=white,bg=default
set -g status-left-length 32
set -g status-left "#[fg=gray,dim]#S #(uname | grep -iq Darwin && printf '\uf179' || printf '\uf17c') "
set -g status-right-length 64
set -g status-right '#[fg=gray,dim]#(printf '\uea83') #{pane_current_path}'
set -g window-status-format "#[fg=default,dim]#I:#W"
set -g window-status-current-format "#[fg=blue]#I:#W"
set -g pane-active-border-style fg=blue,dim
# split panes (f-option uses full height/widht of the window; try it!)
bind \\ split-window -h -c "#{pane_current_path}"
bind | split-window -fh -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind _ split-window -fv -c "#{pane_current_path}"
# move between panes with prefix+h/j/k/l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# move between panes with ALT/OPT+h/j/k/l (also, configure your terminal!)
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# resize panes
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
bind -r M run-shell "~/.dotfiles/littles/tmux-resize.sh -l main-horizontal -p 75"
bind -r m run-shell "~/.dotfiles/littles/tmux-resize.sh -l main-vertical -p 62"
bind -r n run-shell "~/.dotfiles/littles/tmux-resize.sh -l main-vertical -p 75"
bind -r = run-shell "~/.dotfiles/littles/tmux-resize.sh -l main-vertical -p 50"
# windows
bind -n C-t new-window
bind -n C-l send-keys 'C-l'\; clear-history
bind -n C-S-Left swap-window -t -1\; select-window -t -1
bind -n C-S-Right swap-window -t +1\; select-window -t +1
# close panes and windows
bind -n C-x kill-pane
bind -n C-X confirm-before -p 'Kill window #W? (y/n)' kill-window
# bind -n C-q confirm-before -p "Kill session #S? (y/n)" kill-session # it conflicts with Neovim Telescope's C-q shortcut
# popups
bind i display-popup -d "#{pane_current_path}" -E "iex"
bind t display-popup -d "#{pane_current_path}" -E "fish"
# saving logs to a file
bind-key p command-prompt -p "Save current pane's history to filename:" -I '~/tmux-#{pane_current_command}.history' 'capture-pane -S -50000; save-buffer %1; delete-buffer'
# PLUGINS: see https://github.com/tmux-plugins/tpm for details.
#set -g @plugin 'tmux-plugins/tpm' # press <prefix + I> when inside tmux to install the plugins!
#set -g @plugin 'tmux-plugins/tmux-resurrect' # use <prefix + CTRL-S> to save, and <prefix + CTRL-R> to restore sessions
#set -g @plugin 'tmux-plugins/tmux-continuum' # automatic save/restore sessions (with the resurrect help)
#set -g @resurrect-strategy-nvim 'session' # don't forget to run :Obsession command in Vim!
#set -g @continuum-restore 'on'
set -g @plugin 'niqodea/tmux-matryoshka' # nested tmux sessions (F1, F2, F3)
run '~/.tmux/plugins/tpm/tpm'