URI:
       tmux.conf - dotfiles - dark dots
  HTML git clone https://git.drkhsh.at/dotfiles
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
   DIR README
   DIR LICENSE
       ---
       tmux.conf (4234B)
       ---
            1 # ████████╗███╗   ███╗██╗   ██╗██╗  ██╗
            2 # ╚══██╔══╝████╗ ████║██║   ██║╚██╗██╔╝
            3 #    ██║   ██╔████╔██║██║   ██║ ╚███╔╝
            4 #    ██║   ██║╚██╔╝██║██║   ██║ ██╔██╗
            5 #    ██║   ██║ ╚═╝ ██║╚██████╔╝██╔╝ ██╗
            6 #    ╚═╝   ╚═╝     ╚═╝ ╚═════╝ ╚═╝  ╚═╝
            7 #                drkhsh <me@drkhsh.at>
            8 
            9 set -g default-terminal "tmux-256color"
           10 
           11 # expect UTF-8 (tmux < 2.2)
           12 set -gq status-utf8 on
           13 setw -gq utf8 on
           14 
           15 # true 256 colors
           16 set -ga terminal-overrides ",*256col*:Tc"
           17 set-option -sa terminal-features ',xterm-256color:RGB'
           18 
           19 # enable mouse
           20 set -g mouse on
           21 
           22 # terminal scrolling
           23 set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
           24 
           25 # vi mode
           26 setw -g mode-keys vi
           27 
           28 # history
           29 set-option -g history-limit 20000 # default 2k
           30 
           31 # numbering
           32 set -g renumber-windows on
           33 set -g base-index 1 # start window index from 1
           34 setw -g pane-base-index 1 # start pane index from 1
           35 
           36 # well, shut up
           37 set-option -g visual-bell off
           38 set-option -g visual-silence off
           39 set-window-option -g monitor-activity off
           40 
           41 # notifications
           42 set-option -g bell-action any
           43 
           44 # neovim recommends the below `escape` time setting
           45 set -sg escape-time 10
           46 
           47 # image.nvim
           48 set -gq allow-passthrough on
           49 set -g visual-activity off
           50 
           51 # █▓▒░ status line
           52 set -g status on
           53 set -g status-left ''
           54 set -g status-style "bg=colour0,fg=colour1"
           55 set -g status-right '#{?window_zoomed_flag, #[fg=colour11]ZOOM ,}#[bg=default,fg=colour237]░▓#[bg=colour239,fg=colour10] #S #[fg=colour14]#h #[bg=colour243,fg=colour237]▓#[default]'
           56 set -g status-right-length 128
           57 set -g status-interval 10
           58 setw -g window-status-format "#[bg=colour239,fg=white,noreverse] #F#I:#W #[fg=color0]░▒▓#[bg=default,fg=colour241] "
           59 setw -g window-status-current-format "#[bg=colour10,fg=colour0,noreverse] #F#I:#W #[bg=colour10,fg=colour0,noreverse]░▒▓#[bg=default,fg=colour10] "
           60 
           61 # emacs key bindings in tmux command prompt (prefix + :) are better than
           62 # vi keys, even for vim users
           63 set-option -g status-keys emacs
           64 
           65 # focus events enabled for terminals that support them
           66 set-option -g focus-events on
           67 
           68 # theme
           69 setw -g mode-style "bg=colour1,fg=colour0"
           70 set-option -g pane-active-border-style fg=colour250
           71 set-option -g pane-border-style fg=colour237
           72 set-option -g message-style bg=colour239,fg=colour223
           73 set-option -g message-command-style bg=colour239,fg=colour223
           74 
           75 # keybindings
           76 bind x kill-pane
           77 bind r source-file ~/.config/tmux/tmux.conf \; display-message "█▓░ reloaded"
           78 bind e display-popup -b "heavy" -S 'bg=color0,fg=color4' -w 70% -h 70% -E "emoji"
           79 
           80 # splits in current directory
           81 bind '"' split-window -c "#{pane_current_path}"
           82 bind % split-window -h -c "#{pane_current_path}"
           83 bind-key | split-window -h -c '#{pane_current_path}'
           84 bind-key '\' split-window -h -c '#{pane_current_path}'
           85 bind-key - split-window -v -c '#{pane_current_path}'
           86 
           87 # kill!
           88 unbind-key x
           89 bind-key x kill-pane
           90 bind-key X kill-session
           91 
           92 # break pane into its own window
           93 bind-key m break-pane -d
           94 
           95 # clear with prefix + ctrl l and fix SIGQUIT
           96 bind C-l send-keys C-l \; run 'sleep 0.2' \; clear-history
           97 bind C-\\ send-keys 'C-\' #'
           98 
           99 # toggle statusbar
          100 bind b set-option -g status
          101 
          102 # vim copy/paste
          103 unbind [
          104 bind escape copy-mode
          105 bind-key -T copy-mode-vi 'v' send -X begin-selection
          106 bind-key -T copy-mode-vi 'y' send -X copy-selection
          107 bind     -T copy-mode-vi C-v send -X rectangle-toggle
          108 bind  -T copy-mode-vi Escape send -X cancel
          109 
          110 # enable OSC 52 clipboard
          111 set -g set-clipboard on
          112 # Ms modifies OSC 52 clipboard handling to work with mosh, see
          113 # https://gist.github.com/yudai/95b20e3da66df1b066531997f982b57b
          114 set -ag terminal-overrides "vte*:XT:Ms=\\E]52;c;%p2%s\\7,xterm*:XT:Ms=\\E]52;c;%p2%s\\7"
          115 unbind p
          116 bind p paste-buffer -p
          117 
          118 # titles
          119 set -g set-titles on
          120 set -g set-titles-string "tmux@#H:#S:#W:#T"
          121 
          122 # set version
          123 run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
          124 
          125 # machine-specific tmux config
          126 if-shell 'test -f "$HOME/.config/tmux/tmux.conf.local"' 'source ~/.config/tmux/tmux.conf.local'