From a281e8eebc56f99c3ea9223866a45643c79548e2 Mon Sep 17 00:00:00 2001 From: Tony Blyler Date: Fri, 22 Apr 2022 16:21:40 -0400 Subject: [PATCH] Add tmux.conf --- chezmoi/dot_tmux.conf | 89 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 chezmoi/dot_tmux.conf diff --git a/chezmoi/dot_tmux.conf b/chezmoi/dot_tmux.conf new file mode 100644 index 0000000..c5b369f --- /dev/null +++ b/chezmoi/dot_tmux.conf @@ -0,0 +1,89 @@ +## General configuration { + +set -g default-terminal "xterm-256color" +if 'infocmp -x tmux-256color > /dev/null 2>&1' 'set -g default-terminal "tmux-256color"' + +setw -g xterm-keys on # tmux will generate xterm(1) -style function key sequences; these have a number included to indicate modifiers such as Shift, Alt or Ctrl. +set -s escape-time 10 # (default 500ms) Set the time in milliseconds for which tmux waits after an escape is input to determine if it is part of a function or meta key sequences. +set -sg repeat-time 600 # (default 500ms) Allow multiple commands to be entered without pressing the prefix-key again in the specified time milliseconds. Whether a key repeats may be set when it is bound using the -r flag to bind-key. Repeat is enabled for the default keys bound to the resize-pane command. +set -s focus-events on # When enabled, focus events are requested from the terminal if supported and passed through to applications running in tmux. Attached clients should be detached and attached again after changing this option. + +setw -q -g utf8 on + +set -g history-limit 100000 # increate the history + +# edit config +bind e new-window -n "~/.tmux.conf" "\"\${EDITOR:-vim}\" ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"" + +# reload config +bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' + +## } General configuration + +## Display { + +set -g base-index 1 # start window numbering at 1 -- easier on the hands +setw -g pane-base-index 1 # make pane numbering consistent with windows + +setw -g automatic-rename on # rename window to reflect current program +set -g renumber-windows on # renumber windows when a window is closed + +set -g set-titles on # set terminal title + +set -g display-panes-time 800 # slightly longer pane indicators display time +set -g display-time 1000 # slightly longer status messages display time + +# clear both screen and history +bind -n C-l send-keys C-l \; run 'sleep 0.2' \; clear-history + +# activity +set -g monitor-activity on +set -g visual-activity off + +## Status line { + +# move status line to the top +set -q -g status-utf8 on # expect UTF-8 on tmux < 2.2 +set -g status-position top +set -g status-interval 10 # redraw status line every 10 seconds +set -g status-style 'bg=terminal, fg=terminal' +set -g window-status-style 'bg=terminal, fg=green' +set -g window-status-current-style 'bg=terminal, fg=green bright' + +set -g status-left-length 20 +set -g status-left-style 'bg=terminal, fg=white dim' +set -g status-left "[#S] > #(awk '{uptime=$1; days=int(uptime/86400); uptime-=86400*days; hours=int(uptime/3600); uptime-=hours*3600; minutes=int(uptime/60); printf \"%%dd %%dh %%dm\", days, hours, minutes}' /proc/uptime) > " + +set -g status-right-length 100 +set -g status-right-style 'bg=terminal, fg=green' +set -g status-right "#(acpi | tr -d , | awk '/[0-9]+%/{printf \"%%s %%s < \", $3, $4}')%R < %F < #(echo \"$USER\") < #h" + +## } Status line + +## } Display + +## Navigation { + +# create session +bind C-c new-session + +# find session +bind C-f command-prompt -p find-session 'switch-client -t %%' + +# pane navigation +bind -r h select-pane -L # move left +bind -r j select-pane -D # move down +bind -r k select-pane -U # move up +bind -r l select-pane -R # move right +bind > swap-pane -D # swap current pane with the next one +bind < swap-pane -U # swap current pane with the previous one + +# pane resizing +bind -r H resize-pane -L 2 +bind -r J resize-pane -D 2 +bind -r K resize-pane -U 2 +bind -r L resize-pane -R 2 + +bind P paste + +## } Navigation