2024-01-14 20:23:41 +09:00
|
|
|
# 256 color
|
2024-01-17 11:18:44 +09:00
|
|
|
{{- if eq .hosttype "desktop" "laptop" }}
|
2024-03-06 16:45:07 +09:00
|
|
|
set -g default-terminal "alacritty"
|
2024-01-14 20:28:02 +09:00
|
|
|
{{- else }}
|
|
|
|
set -g default-terminal "tmux-256color"
|
|
|
|
{{- end }}
|
2024-03-06 16:45:07 +09:00
|
|
|
#set -ga terminal-overrides ',xterm-256color:RGB'
|
2024-01-14 20:23:41 +09:00
|
|
|
|
|
|
|
# increase limit of "scrollback buffer"
|
|
|
|
set -g history-limit 1000000
|
|
|
|
|
|
|
|
# reduce dely
|
|
|
|
set -sg escape-time 1
|
|
|
|
|
|
|
|
# enable mouse
|
|
|
|
setw -g mouse
|
|
|
|
|
|
|
|
# for neovim (adviced when running the :checkhealth command)
|
|
|
|
set-option -g focus-events on
|
|
|
|
|
|
|
|
|
|
|
|
#################
|
|
|
|
# keybindings
|
|
|
|
#################
|
|
|
|
|
|
|
|
# Prefix
|
|
|
|
set-option -g prefix C-t
|
|
|
|
bind-key t send-prefix
|
|
|
|
|
|
|
|
# Reload config
|
|
|
|
bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display-message "Config Reloaded!!"
|
|
|
|
|
|
|
|
# Split pane
|
|
|
|
bind C-l split-window -h -c '#{pane_current_path}'
|
|
|
|
bind C-j split-window -v -c '#{pane_current_path}'
|
|
|
|
|
|
|
|
# Session control
|
|
|
|
bind C-c new-session
|
2024-01-14 20:41:09 +09:00
|
|
|
{{- if eq .chezmoi.hostname "arch" }}
|
2024-01-14 20:23:41 +09:00
|
|
|
bind C-t run "tmuxsh >/dev/null"
|
2025-01-14 15:28:10 +09:00
|
|
|
bind C-y run "tmuxsh remote >/dev/null"
|
|
|
|
bind C-u run "tmuxsh dev >/dev/null"
|
2024-01-14 20:23:41 +09:00
|
|
|
bind 0 run "tmuxsh wiki >/dev/null"
|
|
|
|
bind 1 run "tmuxsh blog >/dev/null"
|
|
|
|
bind 3 run "tmuxsh tessoku >/dev/null"
|
|
|
|
bind 8 run "tmuxsh music >/dev/null"
|
|
|
|
bind 9 run "tmuxsh util >/dev/null"
|
2024-01-14 20:41:09 +09:00
|
|
|
{{- end }}
|
2024-01-14 20:23:41 +09:00
|
|
|
|
|
|
|
|
|
|
|
# Show pane number (can move to the pane by hit a num while it's displayed)
|
|
|
|
bind-key C-g display-panes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#########################
|
|
|
|
# vim-like keybindings
|
|
|
|
#########################
|
|
|
|
|
|
|
|
# select pane
|
|
|
|
bind h select-pane -L
|
|
|
|
bind j select-pane -D
|
|
|
|
bind k select-pane -U
|
|
|
|
bind l select-pane -R
|
|
|
|
|
|
|
|
# resize pane
|
|
|
|
bind -r H resize-pane -L 1
|
|
|
|
bind -r J resize-pane -D 1
|
|
|
|
bind -r K resize-pane -U 1
|
|
|
|
bind -r L resize-pane -R 1
|
|
|
|
|
|
|
|
# Copy mode
|
|
|
|
setw -g mode-keys vi
|
|
|
|
bind-key Escape copy-mode
|
|
|
|
bind-key -T copy-mode-vi Escape send-keys -X cancel
|
|
|
|
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
|
|
|
bind-key -T copy-mode-vi V send-keys -X select-line
|
|
|
|
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
|
|
|
|
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
|
|
|
|
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###########################
|
|
|
|
# Aesthetic
|
|
|
|
###########################
|
|
|
|
|
2024-01-17 11:18:44 +09:00
|
|
|
{{- if eq .hosttype "desktop" "laptop" }}
|
2024-01-14 20:23:41 +09:00
|
|
|
set -g pane-active-border-style fg=yellow
|
2024-01-16 18:48:08 +09:00
|
|
|
set -g message-command-style 'fg=#eeeeee bg=#333333 bold'
|
|
|
|
set -g message-style 'fg=#eeeeee bg=#333333 bold'
|
2024-01-14 20:23:41 +09:00
|
|
|
set -g status off
|
2024-01-16 18:48:08 +09:00
|
|
|
set -g status-position top
|
2024-01-14 20:23:41 +09:00
|
|
|
set -g status-bg '#333333'
|
2024-01-16 18:48:08 +09:00
|
|
|
set -g status-fg '#eeeeee'
|
2024-01-14 20:23:41 +09:00
|
|
|
set -g status-left ''
|
|
|
|
set -g status-right ''
|
|
|
|
set -g window-status-format ''
|
|
|
|
set -g window-status-current-format ''
|
2024-01-16 18:48:08 +09:00
|
|
|
{{- else }}
|
|
|
|
set -g pane-active-border-style fg=red
|
|
|
|
set -g message-command-style 'fg=black bg=red bold'
|
|
|
|
set -g message-style 'fg=black bg=red bold'
|
|
|
|
set -g status on
|
|
|
|
set -g status-position top
|
2024-01-17 07:50:06 +09:00
|
|
|
set -g status-bg red
|
|
|
|
set -g status-fg black
|
2024-01-19 15:46:55 +09:00
|
|
|
set -g status-left " #[bold]#I:#P #W"
|
2024-01-19 15:47:37 +09:00
|
|
|
set -g status-left-length 40
|
2024-01-16 18:48:08 +09:00
|
|
|
set -g status-right "#[bold][#(whoami)@#H]"
|
|
|
|
set -g status-right-length 20
|
|
|
|
set -g window-status-format ''
|
|
|
|
set -g window-status-current-format ''
|
|
|
|
{{- end }}
|
2024-01-14 20:23:41 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-16 18:48:08 +09:00
|
|
|
|
2024-01-17 11:18:44 +09:00
|
|
|
{{- if eq .hosttype "desktop" "laptop" }}
|
2024-01-14 20:23:41 +09:00
|
|
|
###############################################
|
2024-01-14 20:33:45 +09:00
|
|
|
# local and nested remote tmux sessions
|
2024-01-14 20:23:41 +09:00
|
|
|
# - https://www.freecodecamp.org/news/tmux-in-practice-local-and-nested-remote-tmux-sessions-4f7ba5db8795/
|
|
|
|
# - https://gist.github.com/samoshkin/05e65f7f1c9b55d3fc7690b59d678734
|
|
|
|
|
|
|
|
bind -T root M-q \
|
|
|
|
set prefix None \;\
|
|
|
|
set key-table off \;\
|
|
|
|
set status on \;\
|
2024-01-16 18:48:08 +09:00
|
|
|
set status-right '#[bold align=centre]*LOCKED*'
|
2024-01-14 20:23:41 +09:00
|
|
|
|
|
|
|
bind -T off M-q \
|
2024-01-16 18:48:08 +09:00
|
|
|
set -u prefix \;\
|
|
|
|
set -u key-table \;\
|
|
|
|
set -u status off \;\
|
|
|
|
set status-right ''
|
2024-01-14 20:23:41 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-14 19:10:33 +09:00
|
|
|
########################
|
|
|
|
## Plugins
|
|
|
|
########################
|
|
|
|
#
|
|
|
|
### List of plugins
|
|
|
|
#set-environment -g TMUX_PLUGIN_MANAGER_PATH "$XDG_CACHE_HOME/tmux/plugins"
|
|
|
|
#
|
|
|
|
## Tmux Plugin Manager
|
|
|
|
#set -g @plugin 'tmux-plugins/tpm'
|
|
|
|
#
|
|
|
|
#set -g @plugin 'wfxr/tmux-fzf-url'
|
|
|
|
#
|
|
|
|
#set -g @plugin 'fcsonline/tmux-thumbs'
|
|
|
|
#set -g @thumbs-contrast 4
|
|
|
|
#set -g @thumbs-bg-color 'black'
|
|
|
|
#set -g @thumbs-fg-color 'yellow'
|
|
|
|
#set -g @thumbs-hint-fg-color 'red'
|
|
|
|
#set -g @thumbs-hint-bg-color 'black'
|
|
|
|
#set -g @thumbs-position 'right'
|
|
|
|
#set -g @thumbs-command 'echo -n {} | xsel -ib'
|
|
|
|
#
|
|
|
|
## Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
|
|
|
#run -b "$XDG_CACHE_HOME/tmux/plugins/tpm/tpm"
|
2024-01-14 20:29:25 +09:00
|
|
|
{{- end }}
|