dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

tmux.conf (6253B)


      1 # ░▀█▀░█▄█░█░█░█░█░░
      2 # ░░█░░█░█░█░█░▄▀▄░░
      3 # ░░▀░░▀░▀░▀▀▀░▀░▀░░
      4 
      5 # change prefix to backtick
      6 unbind C-b
      7 set-option -g prefix `
      8 bind ` send-prefix
      9 
     10 # unbind detach
     11 # can still use D to select
     12 # a client to detach
     13 unbind d
     14 
     15 # shell
     16 set -g default-command /usr/bin/zsh
     17 set -g default-shell /usr/bin/zsh
     18 
     19 # start with window 1 (instead of 0)
     20 set -g base-index 1
     21 
     22 # start with pane 1
     23 set -g pane-base-index 1
     24 
     25 # keep window names fixed
     26 set-option -g allow-rename off
     27 
     28 # rename window on creation
     29 ## these break tmuxp, but i like them
     30 ## instead run ad-hoc command on last opened pane in tmuxp config
     31 ## see dotfiles/tmux/.config/tmux/main.yaml
     32 #set-hook -g after-new-window 'command-prompt -I "" "rename-window '%%'"'
     33 #set-hook -g after-new-session 'command-prompt -I "" "rename-window '%%'"'
     34 
     35 # screen mode
     36 set -g default-terminal "screen-256color"
     37 
     38 # source config file
     39 bind r source-file ~/.tmux.conf
     40 
     41 # history
     42 set -g history-limit 4096
     43 
     44 # allow terminal scrolling
     45 set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
     46 
     47 # vim style copy paste mode
     48 #unbind [
     49 #bind Escape copy-mode
     50 #bind-key -T copy-mode-vi 'v' send -X begin-selection
     51 #bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel \
     52 #  "/usr/bin/xsel -i -p > /dev/null"\; \
     53 #  display-message "copied selection to primary clipboard"
     54 unbind [
     55 bind Escape copy-mode
     56 unbind i
     57 bind i paste-buffer
     58 bind-key -Tcopy-mode-vi 'v' send -X begin-selection
     59 #bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection primary'
     60 bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel 'xsel -i >/dev/null'
     61 
     62 # use vi mode
     63 setw -g mode-keys vi
     64 set -g status-keys vi
     65 
     66 # splitting
     67 unbind %
     68 bind b split-window -h
     69 unbind '"'
     70 bind v split-window -v
     71 
     72 # window switching
     73 # urxvt tab like window switching (-n: no prior escape seq)
     74 bind-key -n S-left prev
     75 bind-key -n S-right next
     76 bind-key -n C-left swap-window -t -1
     77 bind-key -n C-right swap-window -t +1
     78 
     79 # pane switching
     80 unbind h
     81 bind h select-pane -L
     82 unbind j
     83 bind j select-pane -D
     84 unbind k
     85 bind k select-pane -U
     86 unbind l
     87 bind l select-pane -R
     88 
     89 # colon :
     90 bind : command-prompt
     91 
     92 # pomodoro
     93 bind-key g run-shell "~/.tmux/plugins/tmux-golden-apple/golden_apple.tmux start"
     94 bind-key G run-shell "~/.tmux/plugins/tmux-golden-apple/golden_apple.tmux stop"
     95 
     96 # panes
     97 set -g pane-border-style fg=black
     98 set -g pane-active-border-style fg=colour244
     99 
    100 # messaging
    101 set -g message-style fg=colour7,bg=colour8
    102 set -g message-command-style fg=colour0,bg=colour1
    103 set-option -g display-time 4000
    104 
    105 # window mode
    106 setw -g mode-style fg=colour7,bg=colour5
    107 
    108 # resizing
    109 setw -g aggressive-resize on
    110 
    111 # status bar
    112 set -g status-justify right
    113 set -g status-style bg=terminal
    114 set -g status-fg colour7
    115 set -g status-interval 5
    116 set -g status-right-length 100
    117 setw -g window-status-separator " "
    118 
    119 setw -g window-status-format "#[bg=colour241,fg=colour0] #I #[bg=colour241,fg=colour0]#W #[bg=default,fg=colour241]▓░"
    120 setw -g window-status-current-format "#[bg=colour10,fg=colour0] #I #[bg=colour10,fg=colour0]#W #[bg=default,fg=colour10]▓░"
    121 set -g status-justify left
    122 set-option -g status-right '#[bg=default,fg=colour237]░▓#[bg=colour237,fg=colour15]#{goldenapple}#{muted_state}#{bond_device}#{online_status}#[bg=colour237,fg=colour243] %Y%m#[bg=colour237,fg=colour7]%d#[fg=colour243]-#[fg=colour15]%u #[fg=colour7]%H%M #[bg=colour243,fg=colour237]▓#[default]'
    123 #set-option -g status-right '#[bg=default,fg=colour237]░▓#[bg=colour237,fg=colour15]#(~/bin/tmux-status) #{goldenapple}#{muted_state}#{bond_device}#{online_status}#[bg=colour237,fg=colour243] %Y%m#[bg=colour237,fg=colour7]%d#[fg=colour243]-#[fg=colour15]%u #[fg=colour7]%H%M #[bg=colour243,fg=colour237]▓#[default]'
    124 set-option -g status-left ''
    125 
    126 # online and offline icon for tmux-online-status
    127 set -g @online_icon "#[bg=colour237,fg=colour241]░▓█#[bg=colour241,fg=black]online#[bg=colour237,fg=colour241]█▓░#[default]"
    128 set -g @offline_icon "#[bg=colour237,fg=colour1]░▓█#[bg=colour1,fg=white]offline#[bg=colour237,fg=colour1]█▓░#[default]"
    129 
    130 # device names for tmux-bond-device
    131 set -g @ethernet "#[bg=colour237,fg=colour7] hardwire #[default]"
    132 set -g @wifi "#[bg=colour237,fg=colour7] airborne #[default]"
    133 
    134 # device names for tmux-muted
    135 set -g @muted "#[bg=colour237,fg=colour241]░▓█#[bg=colour241,fg=black]mute#[bg=colour237,fg=colour241]█▓░#[default]"
    136 set -g @unmuted "#[bg=colour237,fg=colour1]░▓█#[bg=colour1,fg=white]on air#[bg=colour237,fg=colour1]█▓░#[default]"
    137 
    138 # work minutes for pomodoro
    139 set -g @work 15
    140 
    141 # loud or quiet?
    142 set-option -g visual-activity on
    143 set-option -g visual-bell off
    144 set-option -g visual-silence off
    145 set-window-option -g monitor-activity off
    146 set-option -g bell-action none
    147 
    148 # tmux clock
    149 set -g clock-mode-colour colour6
    150 
    151 # escape time (for vim)
    152 set -sg escape-time 0
    153 
    154 # some key-binding changes
    155 #bind x kill-pane
    156 bind X next-layout
    157 bind Z previous-layout
    158 
    159 # toggle status bar visibility
    160 #bind t set status
    161 
    162 # toggle todo list popup
    163 ## http://git.z3bra.org/scripts/file/todo.html
    164 unbind t
    165 bind t display-popup -w 75 ~/.local/bin/todo
    166 
    167 unbind T
    168 bind T command-prompt -I "run-shell 'todo "
    169 
    170 # plugins
    171 # `mkdir -p ~/.tmux/plugins/ ; git clone 'https://github.com/tmux-plugins/tpm' ~/.tmux/plugins/tpm`
    172 set -g @plugin 'tmux-plugins/tpm'
    173 set -g @plugin 'tmux-plugins/tmux-online-status'
    174 set -g @plugin 'https://gitlab.com/pyratebeard/tmux-bond-device.git'
    175 set -g @plugin 'tmux-plugins/tmux-muted'
    176 
    177 # see: toggle on/off all keybindings · Issue #237 · tmux/tmux - https://github.com/tmux/tmux/issues/237
    178 # Also, change some visual styles when window keys are off
    179 bind-key -T root F12  \
    180 	set-option -g prefix None \;\
    181 	setw -g window-status-current-format "#[bg=colour1,fg=colour0] #I #[bg=colour1,fg=colour0]#W #[bg=colour0,fg=colour1]▓░" \;\
    182 	refresh-client -S
    183 
    184 bind-key -T root F11 \
    185 	set-option -g prefix ` \;\
    186 	bind ` send-prefix \;\
    187 	setw -g window-status-current-format "#[bg=colour10,fg=colour0] #I #[bg=colour10,fg=colour0]#W #[bg=colour0,fg=colour10]▓░" \;\
    188 	refresh-client -S
    189 
    190 # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
    191 run -b '~/.tmux/plugins/tpm/tpm'