Files
dots/files/tmux/.tmux.conf
2023-12-20 23:27:19 +01:00

178 lines
6.2 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# tmux.conf
# ~ M. Thomas
######### Terminal Setup ##########
# set default terminal
set -g default-terminal "tmux-256color"
# enable true color terminal
set -ga terminal-overrides ",*256col*:Tc,alacritty:Tc"
######### Keybinds ##########
# new panes (open with current path)
bind-key -n M-v split-window -h -c "#{pane_current_path}"
bind-key -n M-s split-window -v -c "#{pane_current_path}"
# pane selection
bind-key -n M-h select-pane -L
bind-key -n M-j select-pane -D
bind-key -n M-k select-pane -U
bind-key -n M-l select-pane -R
# pane / window modifications
bind-key -n M-z resize-pane -Z
# use `set automatic-rename on` to reset
bind-key -n M-, command-prompt -p "Rename window:" "rename-window '%%'"
bind-key -n M-< set automatic-rename on
# new windows
bind-key -n M-c new-window -c "#{pane_current_path}"
# navigate windows
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
# swap panes
bind-key -n 'M-H' swap-pane -D
bind-key -n 'M-L' swap-pane -U
# move panes to and from windows
bind-key -n 'M-t' command-prompt -p "Send pane to:" "join-pane -t :'%%'"
bind-key -n 'M-!' select-layout even-horizontal
bind-key -n 'M-@' select-layout even-vertical
# resize panes
bind-key -n 'M-Left' resize-pane -L 20
bind-key -n 'M-Right' resize-pane -R 20
bind-key -n 'M-Up' resize-pane -U 20
bind-key -n 'M-Down' resize-pane -D 20
########## General ##########
# alias
set -s command-alias[1] respawn='respawn-pane -k'
# make escape bindings of programs work in tmux
set -s escape-time 5
# renumber windows, when one gets closed
set-option -g renumber-windows on
# enable mouse
set-option -g mouse on
# start pane index at 1
set -g base-index 1
setw -g pane-base-index 1
# set terminal window title (update every second)
set-option -g status-interval 1
set-option -g set-titles on
set-option -g set-titles-string "#H: #W"
########## Styling ##########
# set -g status-position top
# set -g status-justify "left"
# set -g status "on"
# set -g message-command-style "fg=#829181,bg=#e6e2cc"
# set -g pane-active-border-style "fg=#93b259"
# set -g status-style "none,bg=#e6e2cc"
# set -g message-style "fg=#829181,bg=#e6e2cc"
# set -g pane-border-style "fg=#e9e8d2"
# set -g status-right-length "100"
# set -g status-left-length "100"
# setw -g window-status-activity-style "none,fg=#93b259,bg=#e6e2cc"
# setw -g window-status-style "none,fg=#939f91,bg=#e6e2cc"
# set -g status-left ""
# set -g status-right "#[fg=#939f91,bg=#e6e2cc] #H "
# setw -g window-status-format " #I#W#{?window_zoomed_flag,  , }"
# setw -g window-status-current-format "#[fg=#93b259,bold] #I#W#{?window_zoomed_flag,  , }"
# https://github.com/bobcats/everforest-tmux
thm_bg_dim="#efebd4"
thm_bg0="#fdf6e3"
thm_bg1="#f4f0d9"
thm_bg2="#efebd4"
thm_bg3="#e6e2cc"
thm_bg4="#e0dcc7"
thm_bg5="#bdc3af"
thm_bg_visual="#eaedc8"
thm_bg_red="#fbe3da"
thm_bg_green="#f0f1d2"
thm_bg_blue="#e9f0e9"
thm_bg_yellow="#faedcd"
thm_fg="#5c6a72"
thm_red="#f85552"
thm_orange="#f57d26"
thm_yellow="#dfa000"
thm_green="#8da101"
thm_aqua="#35a77c"
thm_blue="#3a94c5"
thm_purple="#df69ba"
thm_grey0="#a6b0a0"
thm_grey1="#939f91"
thm_grey2="#829181"
thm_statusline1="#93b259"
thm_statusline2="#708089"
thm_statusline3="#e66868"
# messages
set -g message-style "fg=${thm_aqua},bg=${thm_bg2},align=centre"
set -g message-command-style "fg=${thm_aqua},bg=${thm_bg2},align=centre"
# panes
set -g pane-border-style "fg=${thm_bg2}"
set -g pane-active-border-style "fg=${thm_green}"
# windows
setw -g window-status-activity-style "fg=${thm_fg},bg=${thm_bg0},none"
setw -g window-status-separator ""
setw -g window-status-style "fg=${thm_fg},bg=${thm_bg0},none"
# --------=== Statusline
set -g status-bg $thm_bg0
# These variables are the defaults so that the setw and set calls are easier to parse.
show_directory="#[fg=$thm_blue,bg=$thm_bg0,nobold,nounderscore,noitalics]#[fg=$thm_bg0,bg=$thm_blue,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_bg2] #{b:pane_current_path} #{?client_prefix,#[fg=$thm_red]"
show_window="#[fg=$thm_purple,bg=$thm_bg0,nobold,nounderscore,noitalics]#[fg=$thm_bg0,bg=$thm_purple,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_bg2] #W #{?client_prefix,#[fg=$thm_red]"
show_session="#[fg=$thm_green]}#[bg=$thm_bg2]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg0] #[fg=$thm_fg,bg=$thm_bg2] #S "
show_directory_in_window_status="#[fg=$thm_bg0,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_bg2] #{b:pane_current_path} "
show_directory_in_window_status_current="#[fg=$thm_bg0,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg0] #{b:pane_current_path} "
color_zoomed="#{?window_zoomed_flag,$thm_yellow,$thm_bg5}"
show_window_in_window_status="#[fg=$thm_fg,bg=$thm_bg0] #W #[fg=$thm_bg0,bg=$color_zoomed] #I#[fg=$color_zoomed,bg=$thm_bg0]#[fg=$thm_fg,bg=$thm_bg0,nobold,nounderscore,noitalics] "
color_zoomed="#{?window_zoomed_flag,$thm_orange,$thm_green}"
show_window_in_window_status_current="#[fg=$thm_fg,bg=$thm_bg2] #W #[fg=$thm_bg0,bg=$color_zoomed] #I#[fg=$color_zoomed,bg=$thm_bg0]#[fg=$thm_fg,bg=$thm_bg0,nobold,nounderscore,noitalics] "
# Right column 1 by default shows the Window name.
right_column1=$show_window
# Right column 2 by default shows the current Session name.
right_column2=$show_session
# Window status by default shows the current directory basename.
window_status_format=$show_directory_in_window_status
window_status_current_format=$show_directory_in_window_status_current
# NOTE: With the @everforest_window_tabs_enabled set to on, we're going to
# update the right_column1 and the window_status_* variables.
right_column1=$show_directory
window_status_format=$show_window_in_window_status
window_status_current_format=$show_window_in_window_status_current
set -g status-left ""
set -g status-right "${right_column1},${right_column2}"
setw -g window-status-format "${window_status_format}"
setw -g window-status-current-format "${window_status_current_format}"
# --------=== Modes
setw -g clock-mode-colour "${thm_blue}"
setw -g mode-style "fg=${thm_purple} bg=${thm_bg3} bold"