rwx/sh/tmux.sh

78 lines
1.9 KiB
Bash
Raw Normal View History

2025-01-17 09:27:59 +00:00
# ╭──────┬───────╮
# │ tmux │ setup │
# ╰──────┴───────╯
rwx_tmux_setup() {
rwx_file_write "${HOME}/.tmux.conf" "\
2025-01-17 11:15:11 +00:00
# reload configuration
2025-01-17 09:27:59 +00:00
bind-key r source-file ~/.tmux.conf \\; display-message '↑ .tmux.conf'
2025-01-17 09:30:48 +00:00
#set -g automatic-rename on
#set -g automatic-rename-format ''
2025-01-17 11:15:11 +00:00
# enable mouse actions
set -g mouse on
# renumber windows after closing one
set -g renumber-windows on
2025-01-17 09:27:59 +00:00
2025-01-17 13:33:35 +00:00
# enable title
set -g set-titles on
# set title to working directory
set -g set-titles-string '#(pwd)'
2025-01-17 09:27:59 +00:00
2025-01-17 11:35:21 +00:00
# status bar
set -g status-bg black
set -g status-fg gray
set -g status-interval 1
set -g status-left ''
set -g status-position top
set -g status-right '| #{session_name} | %Y/%m/%d %H:%M:%S'
2025-01-17 09:27:59 +00:00
2025-01-17 12:50:06 +00:00
# windows separator
set -g window-status-separator ' | '
2025-01-17 09:27:59 +00:00
2025-01-17 11:40:51 +00:00
# style for messages
set-option -g message-style bg=red,fg=white
# style for pane borders
set-option -g pane-active-border-style bg=black,fg=green
set-option -g pane-border-style bg=black,fg=gray
2025-01-17 09:27:59 +00:00
2025-01-17 11:21:37 +00:00
# prefix with ^B or F12
set-option -g prefix C-b
set-option -g prefix2 F12
2025-01-17 09:27:59 +00:00
2025-01-17 12:50:06 +00:00
# enable activity monitoring
setw -g monitor-activity on
# activity style
set -g window-status-activity-style bg=black,fg=red
# disable silence monitoring
setw -g monitor-silence 0
2025-01-17 09:27:59 +00:00
2025-01-17 13:19:50 +00:00
# windows style
set-window-option -g window-status-current-style bg=black,fg=green
set-window-option -g window-status-style bg=black,fg=gray
2025-01-17 09:27:59 +00:00
2025-01-17 11:17:51 +00:00
# bind key to detach client
bind -n F6 detach-client
2025-01-17 09:27:59 +00:00
2025-01-17 09:30:48 +00:00
#bind-key -n C-S-Left swap-window -t -1
#bind-key -n C-S-Right swap-window -t +1
2025-01-17 09:27:59 +00:00
2025-01-17 11:27:55 +00:00
# create new window with F2
bind -n F2 new-window
# previous or next window with Alt & ← | →
bind -n M-Left previous-window
bind -n M-Right next-window
2025-01-17 09:27:59 +00:00
2025-01-17 13:25:25 +00:00
# select panes with Ctrl & Shift & ←↑↓→
bind -n C-S-Down select-pane -D
bind -n C-S-Left select-pane -L
bind -n C-S-Right select-pane -R
bind -n C-S-Up select-pane -U
2025-01-17 09:27:59 +00:00
2025-01-17 12:53:35 +00:00
# horizontal split with H
bind-key h split-window -h
# vertical split with V
bind-key v split-window -v
2025-01-17 09:27:59 +00:00
"
}