clean(tmux) doc

This commit is contained in:
Johann Dreo 2022-08-12 12:04:41 +02:00
commit 28558fed96

View file

@ -1,58 +1,96 @@
# reload config file (change file location to your the tmux.conf you want to use) #################################################
bind r source-file ~/.tmux.conf # CONFIG
#################################################
# Very short Escape key delay, to allow using modal editors. # Fix colors in ANSI-based text editors.
set -sg escape-time 20
# Fix colors in text editors
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*col*:Tc" set -ga terminal-overrides ",*col*:Tc"
set -g status-position top
# Update the status bar every seconds (for the clock). # Update the status bar every seconds (for the clock).
set -g status-interval 1 set -g status-interval 1
# Enable mouse control (clickable windows, panes, resizable panes) # Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on set -g mouse on
# remap prefix from 'C-b' to 'C-a'
#################################################
# SHORTCUTS
#################################################
# Very short Escape key delay, to allow using modal editors.
set -sg escape-time 20
# Remap prefix from 'C-b' to 'C-a'.
unbind C-b unbind C-b
set-option -g prefix C-a set-option -g prefix C-a
bind-key C-a send-prefix bind-key C-a send-prefix
# split panes using | and - # Split panes.
bind s split-window -h bind s split-window -h
bind S split-window -v bind S split-window -v
unbind '"' unbind '"'
unbind % unbind %
# Windows switching.
bind Tab next-window bind Tab next-window
bind S-Tab previous-window bind S-Tab previous-window
bind C-a last-window bind C-a last-window
# Reload config file.
# NOTE: change file location to your the tmux.conf you want to use.
bind r source-file ~/.tmux.conf
#################################################
# THEME
#################################################
# Design rationale:
# - Basics: visible windows tabs, active one highlighted.
# - This follows the look-n-feel of my generic theming (vim, kakoune, liquidprompt, etc.).
# - Blue is "insert mode", i.e. what you type is typed.
# - Yellow is "normal mode", i.e. the item is a (potential) target for a command.
# - When entering prefix, the active window tab is in yellow.
# - Tabs structure: <window number>(<activity marker><number of panes>)<window position> <window name>
# - the activity marker is a ‼ if there is a bell alert, a ! if there is a silent notification, a ∘ else.
# - the window position is a dark for the active window, a ⁝ for the last window and a light for others.
# - When entering prefix, a yellow [A] is displayed and the active window tab is yellow, drawing attention to what you are doing next.
# Just like a normal window title bar.
set -g status-position top
# Thick blue border.
set -g pane-active-border-style bg='#6f9dfe',fg='#6f9dfe' set -g pane-active-border-style bg='#6f9dfe',fg='#6f9dfe'
# Default status style.
set -g status-style bg='#3f6dce',fg='#d3d0cc' set -g status-style bg='#3f6dce',fg='#d3d0cc'
# tmux-mode-indicator (mainly displays TMUX or WAIT), then prefix marker.
set -g status-left '#{tmux_mode_indicator}#[bg=#3f6dce]#[fg=#d3d0cc]#{?client_prefix,#[bg=#cf8200]#[fg=#f8f8f8][A],[ ]}#[bg=#3f6dce]##[fg=#2f5dbe]║' set -g status-left '#{tmux_mode_indicator}#[bg=#3f6dce]#[fg=#d3d0cc]#{?client_prefix,#[bg=#cf8200]#[fg=#f8f8f8][A],[ ]}#[bg=#3f6dce]##[fg=#2f5dbe]║'
# Active window tab.
set-window-option -g window-status-format "#[bg=#4f7dde,noreverse,bold] #[fg=#cf8200]#I#[fg=#2f5dbe,none](#[fg=#d3d0cc]#{?window_bell_flag,#[bg=#ffcc00]#[fg=#db4939]‼,#{?window_silence_flag,#[bg=#ffcc00]#[fg=#db4939]!,#[fg=#2f5dbe]∘}}#[bg=#4f7dde]#[fg=#d3d0cc]#{window_panes}#[fg=#2f5dbe])#[fg=#d3d0cc]#{last_window}#{?window_last_flag,⁝,} #[fg=#d3d0cc,bold]#W #[fg=#d3d0cc,none]"
set-window-option -g window-status-current-format "#{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#ffcc00,bold]❰#[fg=#ffcc00]#I#[fg=#2f5dbe,none](∘#{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#f8f8f8]#{window_panes}#{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#2f5dbe]) #[fg=#ffffff,bold]#W#[fg=#f8f8f8,none]#[fg=#ffcc00,bold]❱" set-window-option -g window-status-current-format "#{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#ffcc00,bold]❰#[fg=#ffcc00]#I#[fg=#2f5dbe,none](∘#{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#f8f8f8]#{window_panes}#{?client_prefix,#[bg=#cf8200],#[bg=#6f9dfe]}#[fg=#2f5dbe]) #[fg=#ffffff,bold]#W#[fg=#f8f8f8,none]#[fg=#ffcc00,bold]❱"
# Other windows tabs.
set-window-option -g window-status-format "#[bg=#4f7dde,noreverse,bold] #[fg=#cf8200]#I#[fg=#2f5dbe,none](#[fg=#d3d0cc]#{?window_bell_flag,#[bg=#ffcc00]#[fg=#db4939]‼,#{?window_silence_flag,#[bg=#ffcc00]#[fg=#db4939]!,#[fg=#2f5dbe]∘}}#[bg=#4f7dde]#[fg=#d3d0cc]#{window_panes}#[fg=#2f5dbe])#[fg=#d3d0cc]#{last_window}#{?window_last_flag,⁝,} #[fg=#d3d0cc,bold]#W #[fg=#d3d0cc,none]"
# Tabs separator.
set-window-option -g window-status-separator "#[fg=#2f5dbe]║" #⟭⟬" set-window-option -g window-status-separator "#[fg=#2f5dbe]║" #⟭⟬"
# No reverse on notifications.
set-window-option -g window-status-activity-style none set-window-option -g window-status-activity-style none
# tmux-window-name config # Larger right status section.
# Shell programs, will show dir instead of the program set -g status-right-length 50
# set -g @tmux_window_name_shells "['zsh', 'bash', 'sh']"
# Programs that will show the dir name along with the program name. # download session@host date(week) hour
# set -g @tmux_window_dir_programs "['kak', 'less', 'nvim', 'vim', 'vi', 'git']" set -g status-right '↓#{download_speed}#[fg=#2f5dbe]║#[fg=#ffcc00]#S#[fg=#ffffff]@#[fg=#d3d0cc]#h#[fg=#2f5dbe]║#[fg=#d3d0cc]%Y-%m-%d#[fg=#9390bd](#[fg=#d3d0cc]%W#[fg=#9390bd])#[fg=#2f5dbe]║#[fg=#d3d0cc]%H:%M#[fg=#2f5dbe]'
#################################################
# PLUGINS
#################################################
# Plugins # Plugins
# C-a I to install. # C-a I to install.
@ -66,10 +104,11 @@ set -g @plugin 'tmux-plugins/tmux-net-speed'
set -g @plugin 'MunifTanjim/tmux-mode-indicator' set -g @plugin 'MunifTanjim/tmux-mode-indicator'
# set -g @plugin 'ofirgall/tmux-window-name' # set -g @plugin 'ofirgall/tmux-window-name'
# set -g status-right '[#(tmux-mem-cpu-load --colors --graph-lines 10 --interval 2)] ~#{net_speed}~ _#{keyboard_layout}_ %H:%M:%S %Y-%m-%d(%W)' # tmux-window-name config
set -g status-right-length 50 # Shell programs, will show dir instead of the program
set -g status-right '↓#{download_speed}#[fg=#2f5dbe]║#[fg=#ffcc00]#S#[fg=#ffffff]@#[fg=#d3d0cc]#h#[fg=#2f5dbe]║#[fg=#d3d0cc]%Y-%m-%d#[fg=#9390bd](#[fg=#d3d0cc]%W#[fg=#9390bd])#[fg=#2f5dbe]║#[fg=#d3d0cc]%H:%M#[fg=#2f5dbe]' # set -g @tmux_window_name_shells "['zsh', 'bash', 'sh']"
# Programs that will show the dir name along with the program name.
# set -g @tmux_window_dir_programs "['kak', 'less', 'nvim', 'vim', 'vi', 'git']"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm' run '~/.tmux/plugins/tpm/tpm'