83 lines
2.1 KiB
Bash
83 lines
2.1 KiB
Bash
# ╭──────┬───────╮
|
|
# │ tmux │ setup │
|
|
# ╰──────┴───────╯
|
|
|
|
rwx_tmux_setup() {
|
|
rwx_file_write "${HOME}/.tmux.conf" "\
|
|
# reload configuration
|
|
bind-key r source-file ~/.tmux.conf \\; display-message '↑ .tmux.conf'
|
|
|
|
# select sessions with Alt & ↑ | ↓
|
|
bind -n M-Down switch-client -n
|
|
bind -n M-Up switch-client -p
|
|
|
|
# empty name for windows
|
|
set -g automatic-rename on
|
|
set -g automatic-rename-format ''
|
|
# enable mouse actions
|
|
set -g mouse on
|
|
# renumber windows after closing one
|
|
set -g renumber-windows on
|
|
|
|
# enable title
|
|
set -g set-titles on
|
|
# set title to working directory
|
|
set -g set-titles-string '#(pwd)'
|
|
|
|
# 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'
|
|
|
|
# windows separator
|
|
set -g window-status-separator ' | '
|
|
|
|
# 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
|
|
|
|
# prefix with ^B or F12
|
|
set-option -g prefix C-b
|
|
set-option -g prefix2 F12
|
|
|
|
# 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
|
|
|
|
# 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
|
|
|
|
# bind key to detach client
|
|
bind -n F6 detach-client
|
|
|
|
# swap window with next or previous
|
|
bind-key M-Left swap-window -t -1
|
|
bind-key M-Right swap-window -t +1
|
|
|
|
# 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
|
|
|
|
# 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
|
|
|
|
# horizontal split with H
|
|
bind-key h split-window -h
|
|
# vertical split with V
|
|
bind-key v split-window -v
|
|
"
|
|
}
|