From: Colin P. McCabe Date: Wed, 25 Sep 2024 18:26:54 +0000 (-0700) Subject: tmux: set some better movement keys (and disable F-keys) X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=272ee03b116b02519b12b58b7fbfe9d1d3c2ca63;p=cmccabe-etc tmux: set some better movement keys (and disable F-keys) --- diff --git a/.tmux.conf b/.tmux.conf index 391bdf8..19617d7 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,49 +1,70 @@ -# turn off esc-wait so that vi works correctly +# +# ████████ ███ ███ ██ ██ ██ ██ +# ██ ████ ████ ██ ██ ██ ██ +# ██ ██ ████ ██ ██ ██ ███ +# ██ ██ ██ ██ ██ ██ ██ ██ +# ██ ██ ██ ██████ ██ ██ +# + +# Global key options. +# Turn off esc-wait so that vi works correctly. set-option -sg escape-time 0 -# use control-K as the prefix +# Use control-K as the prefix. set -g prefix C-k unbind C-b bind C-k send-prefix -set-option -g history-limit 100000 -set-window-option -g xterm-keys on - +# Use vi keys everywhere. set-window-option -g mode-keys vi set-option -g status-keys vi + +# History settings. +set-option -g history-limit 100000 + +# Scary global settings. +# The UTF8 stuff doesn't seem to be recognized any more? +set-window-option -g xterm-keys on #set-window-option -g utf8 on +#set-option -g status-utf8 on #set-window-option -g mode-mouse off # disable mouse #set -g mouse-select-pane off set -g default-terminal "screen-256color" set -as terminal-overrides ",*:Tc" - set -g visual-bell off -bind-key -n F5 prev -bind-key -n F6 select-pane -t :.+ -bind-key -n F7 select-pane -t :.- -bind-key -n F8 next - +# Appearance. set-window-option -g window-status-current-style "fg=black bg=cyan" -#set-option -g status-utf8 on set-option -g status-bg blue set-option -g status-fg white -set-option -g status-interval 5 +set-option -g status-interval 10 set-option -g visual-activity off set-window-option -g monitor-activity off -# moving between panes with vim movement +# Require the prefix before each command for moving around. +set-option -g repeat-time 0 + +# Moving between panes and windows with the F-keys. +#bind-key -n F5 prev +#bind-key -n F6 select-pane -t :.+ +#bind-key -n F7 select-pane -t :.- +#bind-key -n F8 next + +# Moving between panes and windows with vim movement. +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ +bind -r C-j select-pane -t :.+ +bind -r C-k select-pane -t :.- + +# Moving between panes with vim movement. +# This is kind of redundant with the above but maybe it's still useful. bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R -# moving between windows with vim movement -bind -r C-h select-window -t :- -bind -r C-l select-window -t :+ - -# resize panes with vim movement keys -bind -r H resize-pane -L 5 -bind -r J resize-pane -D 5 -bind -r K resize-pane -U 5 -bind -r L resize-pane -R 5 +# Resizing panes with the vim movement keys. +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