dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

tmux-light.conf (4797B)


      1 # vim: foldmethod=marker foldlevel=0
      2 # Global options {{{
      3 # "set" == "set-option"
      4 set -g history-limit 30000
      5 set -g mouse on
      6 # terminal-overrides works based on $TERM outside of tmux
      7 set -g terminal-overrides 'xterm-256color:Tc:smcup@:rmcup@,st-256color:Tc:smcup@:rmcup@,alacritty:Tc:smcup@:rmcup@*:Ss=\E[%p1%d q:Se=\E[ q'
      8 set -g allow-passthrough on # allow escape sequence passthrough
      9 set -g default-command $SHELL
     10 set -g default-shell $SHELL
     11 set -g default-terminal $TERM
     12 set -g set-titles on
     13 set -g set-titles-string '#H:#S.#I.#P #W #T'
     14 set -g status-interval 1
     15 set -g status-justify right
     16 set -g status-left-length 60
     17 set -g status-right-length 60
     18 set -g visual-activity on
     19 set -g base-index 1   # start numbering windows at 1, easier to reach
     20 set -g renumber-windows on
     21 set -s escape-time 0
     22 set -g set-clipboard off
     23 setw -g mode-keys vi
     24 set -g status-keys emacs
     25 # }}}
     26 # Visuals {{{
     27 set -g pane-active-border-style fg=#ff5500
     28 set -g pane-border-style fg=#a4a4a4
     29 set -g status-bg '#e4e4e4'
     30 set -g status-fg '#2c2625'
     31 set -g status-left '#[fg=#228822]» #[fg=#4477ff,bold]#T#{?pane_synchronized, #[fg=#cc5500#,bold][SYNC],} #[default,align=centre,italics]#(mpc | grep -i "^\[paused\]" >/dev/null && printf "⏸  ")#(mpc current)#[default]'
     32 set -g status-right "#[fg=#4477ff,bold] »» Sesh #S | #(battery -p)%% | %R (%b %d, %a)#[default]"
     33 setw -g mode-style bg='#d0d0d0'
     34 setw -g window-status-activity-style bg='#e9cddf'
     35 setw -g window-status-current-style bg='#99ddff,bold'
     36 #}}}
     37 # Window options {{{
     38 setw -g monitor-activity on
     39 setw -g xterm-keys on # for vim
     40 setw -g aggressive-resize on
     41 setw -g automatic-rename
     42 setw -g pane-base-index 1   # start numbering panes at 1, easier to reach
     43 # }}}
     44 # Key bindings {{{
     45 # General {{{
     46 
     47 # Set the prefix
     48 unbind C-b # unbind default leader key
     49 set -g prefix C-a
     50 bind a send-prefix
     51 bind C-a send-prefix
     52 
     53 # Switch ; and :
     54 bind \; command-prompt
     55 bind : last-pane
     56 
     57 # Use vi-like keybindings in command prompt mode
     58 set -g status-keys vi
     59 
     60 # Reload the config file
     61 unbind r
     62 bind r source-file ~/.config/tmux/tmux.conf \; display-message "Reloaded config"
     63 
     64 # Allow c-a c-d to detach
     65 bind C-d detach-client
     66 
     67 # Create a new session
     68 bind C new-session
     69 bind c new-window -c "#{pane_current_path}"
     70 
     71 # Tmux clipboard to system clipboard
     72 bind Y run-shell "tmux show-buffer | clc" \; display-message "Tmux clipboard -> System clipboard"
     73 bind -T copy-mode-vi 'Y' send -X copy-pipe-and-cancel "clc"
     74 
     75 # Search youtube
     76 bind-key -T copy-mode-vi 'u' send-keys -X copy-selection \; new-window -n youtube \; send-keys -t youtube 'pipe-viewer "$(tmux show-buffer)" && tmux kill-window' 'Enter'
     77 
     78 # Translate to english
     79 bind-key -T copy-mode-vi 'T' send -X copy-selection-and-cancel \; display-popup -E 'trans "$(tmux show-buffer)" | LESS=-RiX less'
     80 
     81 # Cancel
     82 bind-key -T copy-mode-vi 'i' send-keys -X cancel
     83 
     84 # Copy
     85 bind-key -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel
     86 
     87 # Don't cancel mouse selection when letting go
     88 unbind -T copy-mode-vi MouseDragEnd1Pane
     89 
     90 # Allow switching sessions with repeat (-r)
     91 bind-key -r ( switch-client -p
     92 bind-key -r ) switch-client -n
     93 # }}}
     94 # Windows {{{
     95 
     96 # Vertical split
     97 unbind %
     98 bind v split-window -h -c "#{pane_current_path}"
     99 
    100 # Horizontal split
    101 unbind '"' # unbind horizontal split
    102 bind s split-window -v -c "#{pane_current_path}" # split pane horizontally
    103 
    104 # Window navigation
    105 unbind C-j
    106 unbind C-k
    107 bind C-j previous-window
    108 bind C-k next-window
    109 
    110 # Moving windows
    111 unbind H
    112 unbind L
    113 bind -r L swap-window -t +1 \; next-window
    114 bind -r H swap-window -t -1 \; previous-window
    115 
    116 # Rotate the layout of panes
    117 unbind C-o
    118 bind M-v rotate-window
    119 
    120 # Switch layouts
    121 unbind M--
    122 unbind M-|
    123 bind M-- select-layout "even-vertical"
    124 bind M-| select-layout "even-horizontal"
    125 
    126 # Screen-like rename binding
    127 unbind A
    128 bind A command-prompt "rename-window %%"
    129 unbind M-a
    130 bind M-a command-prompt -I "#S" "rename-session -- '%%'"
    131 
    132 # Watch/unwatch for activity
    133 unbind !
    134 bind ! setw monitor-activity \; display-message "#{?monitor-activity,M,Not m}onitoring activity"
    135 
    136 # Open a popup window
    137 bind ` display-popup -E
    138 # }}}
    139 # Panes {{{
    140 # Pane navigation
    141 unbind j
    142 unbind h
    143 unbind k
    144 unbind l
    145 bind j select-pane -D
    146 bind h select-pane -L
    147 bind k select-pane -U
    148 bind l select-pane -R
    149 
    150 # Pane resizing
    151 unbind C-h
    152 unbind C-j
    153 unbind C-k
    154 unbind C-l
    155 bind -r C-h resize-pane -L # "-r" means key may repeat
    156 bind -r C-j resize-pane -D
    157 bind -r C-k resize-pane -U
    158 bind -r C-l resize-pane -R
    159 
    160 # Split & join panes
    161 bind T break-pane
    162 bind J command-prompt -p "join pane from:"  "join-pane -s '%%'"
    163 
    164 # Listing panes
    165 unbind Space
    166 unbind S
    167 unbind W
    168 bind Space list-panes
    169 bind S choose-tree -Zs
    170 bind W choose-tree -Zw
    171 
    172 # Synchronize panes
    173 unbind @
    174 bind @ setw synchronize-panes \; display-message "Toggle sync panes"
    175 
    176 # Clear pane
    177 bind C-r send-keys -R \; clear-history
    178 # }}}
    179 # }}}