home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 640266eb55a77cc2fe41cda6fe39222dd46a8dc6
parent 56af01b7e916007014d6f3def09018935fb44955
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Tue, 18 Aug 2020 17:13:53 +0200

users/vincent: simplify tmux configuration

Only one configuration file (that could become a nix expression) and
less ui customization.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Musers/vincent/core/tmux.nix | 2--
Dusers/vincent/core/tmux/keybindings | 51---------------------------------------------------
Musers/vincent/core/tmux/tmux.conf | 158+++++++++++++++++++++++++++++++++----------------------------------------------
3 files changed, 65 insertions(+), 146 deletions(-)

diff --git a/users/vincent/core/tmux.nix b/users/vincent/core/tmux.nix @@ -13,10 +13,8 @@ terminal = "tmux-256color"; #historyLimit = 30000; extraConfig = '' - source-file ${config.xdg.configHome}/tmux/commons/keybindings source-file ${config.xdg.configHome}/tmux/tmux.conf ''; }; xdg.configFile."tmux/tmux.conf".source = ./tmux/tmux.conf; - xdg.configFile."tmux/commons/keybindings".source = ./tmux/keybindings; } diff --git a/users/vincent/core/tmux/keybindings b/users/vincent/core/tmux/keybindings @@ -1,51 +0,0 @@ -set -g history-limit 500000 -# Be sure to deactive the mode -# set -g mode-mouse off -# By default tmux adds a small delay when sending commands. -# Reducing this delay by setting escape-time. -set -sg escape-time 1 -bind v paste-buffer -# Vim-behavior for moving between panes -bind c select-pane -L -bind t select-pane -D -bind s select-pane -U -bind r select-pane -R -# Re-binding new-window and kill-pane to something more bepo-ish -bind x new-window -unbind c -bind y kill-pane -# Re-binding list-of-session -bind u list-sessions -# Vim-behavior for moving between windows -bind -r C-t select-window -t :- -bind -r C-s select-window -t :+ -# Vim-behavior for resizing panes -bind -r C resize-pane -L 5 -bind -r T resize-pane -D 5 -bind -r S resize-pane -U 5 -bind -r R resize-pane -R 5 -# vi-mode for copy. -set -g mode-key vi -# `PREFIX`-`ESCAPE` for going into copy mode -bind-key ESCAPE copy-mode -bind-key b copy-mode -# Rebinding some vi-copy keys in a more bepoish fashion. -#bind-key -Tvi-copy 'v' begin-selection -#bind-key -Tvi-copy 'y' copy-selection -#bind-key -Tvi-copy 'C' top-line -#bind-key -Tvi-copy 'T' scroll-down -#bind-key -Tvi-copy 'S' scroll-up -#bind-key -Tvi-copy 'R' bottom-line -#bind-key -Tvi-copy 'c' cursor-left -#bind-key -Tvi-copy 't' cursor-down -#bind-key -Tvi-copy 's' cursor-up -#bind-key -Tvi-copy 'r' cursor-right -# Telling childs that this is a 256 terminal multiplexer -set -g default-terminal "screen-256color" -# Maximizing/Restoring panes (useful for *a lot* of workflows) -unbind Up -bind Up new-window -d -n tmp \; swap-pane -s tmp \; select-window -t tmp -unbind Down -bind Down last-window \; swap-pane -s tmp \; kill-window -t tmp -# Recording pane content to a file. (This is crasy !) -bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log" diff --git a/users/vincent/core/tmux/tmux.conf b/users/vincent/core/tmux/tmux.conf @@ -1,10 +1,60 @@ # Tmux configuration file # Documented by Vincent Demeester. -# Note that I am using bepo keyboard (that why key binding might be a +# Note that I am using bepo keyboard (that why key binding might be a # little weird for you). # First thing first, quickly reload $HOME/.tmux.conf #bind o source-file ~/.tmux.conf; display "tmux configuration reloaded." -source-file $HOME/.config/tmux/commons/keybindings +set -g history-limit 500000 +# Be sure to deactive the mode +# set -g mode-mouse off +# By default tmux adds a small delay when sending commands. +# Reducing this delay by setting escape-time. +set -sg escape-time 1 +bind v paste-buffer +# Vim-behavior for moving between panes +bind c select-pane -L +bind t select-pane -D +bind s select-pane -U +bind r select-pane -R +# Re-binding new-window and kill-pane to something more bepo-ish +bind x new-window +unbind c +bind y kill-pane +# Re-binding list-of-session +bind u list-sessions +# Vim-behavior for moving between windows +bind -r C-t select-window -t :- +bind -r C-s select-window -t :+ +# Vim-behavior for resizing panes +bind -r C resize-pane -L 5 +bind -r T resize-pane -D 5 +bind -r S resize-pane -U 5 +bind -r R resize-pane -R 5 +# vi-mode for copy. +set -g mode-key vi +# `PREFIX`-`ESCAPE` for going into copy mode +bind-key ESCAPE copy-mode +bind-key b copy-mode +# Rebinding some vi-copy keys in a more bepoish fashion. +#bind-key -Tvi-copy 'v' begin-selection +#bind-key -Tvi-copy 'y' copy-selection +#bind-key -Tvi-copy 'C' top-line +#bind-key -Tvi-copy 'T' scroll-down +#bind-key -Tvi-copy 'S' scroll-up +#bind-key -Tvi-copy 'R' bottom-line +#bind-key -Tvi-copy 'c' cursor-left +#bind-key -Tvi-copy 't' cursor-down +#bind-key -Tvi-copy 's' cursor-up +#bind-key -Tvi-copy 'r' cursor-right +# Telling childs that this is a 256 terminal multiplexer +set -g default-terminal "screen-256color" +# Maximizing/Restoring panes (useful for *a lot* of workflows) +unbind Up +bind Up new-window -d -n tmp \; swap-pane -s tmp \; select-window -t tmp +unbind Down +bind Down last-window \; swap-pane -s tmp \; kill-window -t tmp +# Recording pane content to a file. (This is crasy !) +bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log" # titles # set -g show -g says @@ -13,8 +63,8 @@ set -g set-titles-string "tmux - #S:#I.#P (#W)" # Set window notifications setw -g monitor-activity on set -g visual-activity on -# Rather than constraining window size to the maximum size of any client -# connected to the *session*, constrain window size to the maximum size of any +# Rather than constraining window size to the maximum size of any client +# connected to the *session*, constrain window size to the maximum size of any # client connected to *that window*. Much more reasonable. setw -g aggressive-resize on # binding @@ -23,45 +73,18 @@ bind-key C-r command-prompt 'rename-window %%' bind-key '"' split-window -v -c '#{pane_current_path}' bind-key '%' split-window -h -c '#{pane_current_path}' -###################### -### DESIGN CHANGES ### -###################### - -# panes -set -g pane-border-fg black -set -g pane-active-border-fg brightred - -## Status bar design -# status line -set -g status-justify left -set -g status-bg default -set -g status-fg colour12 -set -g status-interval 2 - -# messaging -set -g message-fg black -set -g message-bg yellow -set -g message-command-fg blue -set -g message-command-bg black - -#window mode -setw -g mode-bg colour6 -setw -g mode-fg colour0 +# Custom status line +set-option -g status-left '-- #[fg=colour253]#S - ' +set-window-option -g window-status-format '#[fg=colour244]#I/#[fg=colour253] #W ' +set-window-option -g window-status-current-format '#[fg=colour244]#I/#[fg=colour253,bg=colour238] #W ' +set-option -g status-right '#[fg=colour250] %Y-%m-%d #[fg=colour254]%H.%M' +set-option -g status-bg colour234 +set-option -g status-fg colour007 +set-option -g status-position top -# window status -setw -g window-status-format " #F#I:#W#F " -setw -g window-status-current-format " #F#I:#W#F " -setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W " -setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W " -setw -g window-status-current-bg colour0 -setw -g window-status-current-fg colour11 -setw -g window-status-current-attr dim -setw -g window-status-bg green -setw -g window-status-fg black -setw -g window-status-attr reverse - -# Info on left (I don't have a session display for now) -set -g status-left '' +# Custom split colours +set -g pane-active-border-style bg=colour234,fg=colour234 +set -g pane-border-style bg=colour234,fg=colour234 # loud or quiet? set-option -g visual-activity off @@ -69,54 +92,3 @@ set-option -g visual-bell on set-option -g visual-silence off set-window-option -g monitor-activity on set-option -g bell-action none - -set -g default-terminal "screen-256color" - -# The modes { -setw -g clock-mode-colour colour135 -setw -g mode-attr bold -setw -g mode-fg colour196 -setw -g mode-bg colour238 - -# } -# The panes { - -set -g pane-border-bg colour232 -set -g pane-border-fg colour240 -set -g pane-active-border-bg colour232 -set -g pane-active-border-fg colour250 - -# } -# The statusbar { - -set -g status-position bottom -set -g status-bg colour234 -set -g status-fg colour137 -set -g status-attr dim -set -g status-left '#[fg=colour233,bg=colour241,bold]#(hostname)' -set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S ' -set -g status-right-length 50 -set -g status-left-length 20 - -setw -g window-status-current-fg colour81 -setw -g window-status-current-bg colour238 -setw -g window-status-current-attr bold -setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F ' - -setw -g window-status-fg colour138 -setw -g window-status-bg colour235 -setw -g window-status-attr none -setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' - -setw -g window-status-bell-attr bold -setw -g window-status-bell-fg colour255 -setw -g window-status-bell-bg colour1 - -# } -# The messages { - -set -g message-attr bold -set -g message-fg colour232 -set -g message-bg colour166 - -# }