Unix

tmux conf, byobu 처럼 세팅

ForceCore 2024. 4. 18. 15:48
# List of plugins
set -g @plugin 'tmux-plugins/tpm'

# sensible defaults
set -g @plugin 'tmux-plugins/tmux-sensible'

# sessions control
set -g @plugin 'tmux-plugins/tmux-sessionist'

# indicator that prefix key has been pressed
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'

# rebind prefix to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
unbind K
bind K confirm-before "kill-window"
bind-key C-a last-window

# Byobu like shortcuts
bind-key -n F4 next-window
bind-key -n F3 previous-window
bind-key -n F2 new-window -c "#{pane_current_path}"
bind-key -n F8 command-prompt -I "#W" "rename-window '%%'"

# force 256 colors support
set -g default-terminal "screen-256color"
#set -ga terminal-overrides ",screen-256color:Tc"

# NOTE about colors - you can see them by running
#
# for i in {0..255} ; do
#     printf "\x1b[38;5;${i}mcolour${i}\n"
# done
#
# in console.
# Source: http://superuser.com/a/285400

# don't wait for esc/meta-key sequence
set -sg escape-time 0

# autorename windows
set -g automatic-rename on

# prefix hightlight colors
set -g @prefix_highlight_fg 'blue'
set -g @prefix_highlight_bg default

# status bar content
set -g status-interval 1
set -g status-left "#[fg=colour222] #S #[fg=default]"
set -g status-right " #{prefix_highlight} %Y-%m-%d %H:%M:%S"
set -g status-left-length 50
set -g status-right-length 50
set -g status-justify left

# status bar styling
set -g status-style bg=colour235
set -g status-style fg=colour7 
set -g window-status-current-style fg=colour81 

set -g window-status-format "#[fg=colour7,bg=default] #I: #W "
set -g window-status-current-format "#[fg=colour7,bg=colour23] #I: #W "

# show activity in other windows
setw -g monitor-activity on
set -g visual-activity on

# messages
set -g display-time 800
set -g message-style bg=colour235 # orange
set -g message-style fg=colour80

# panes
set -g pane-border-style fg=colour8 # dark grey
set -g pane-active-border-style fg=colour7 # light grey

# pane number display
set-option -g display-panes-active-colour colour166 #orange
set-option -g display-panes-colour colour7 # light grey

# source panes config (if exists)
source-file -q ~/.tmux-panes.conf

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

bind c new-window -c "#{pane_current_path}"

 

Synology NAS 에는 tmux까진 실행할 수 있다. byobu는... byobu 만든 사람도 본인이 Synology NAS 를 몇 대 갖고 있음에도 실행을 못 했다. ㄱ-;;;

 

Byobu의 가장 편한 단축키인 F2 (new window) F3 (next window), F4 (prev window), F8 (rename window) 세팅을 하고 테마도 좀 잡은 세팅이다.