commit d37a3a400aade93e2215eff3fcbc2be38cc37467
parent 7d748fecccd4209b3412fa32eb25dde3a83ceffb
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Fri, 1 Nov 2019 12:32:52 -0400
tmux: config update
Former-commit-id: 9af46581b201fb3afaa122f8770d4bc95186e930
Diffstat:
M | tmux/tmux.conf | | | 157 | +++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------- |
1 file changed, 105 insertions(+), 52 deletions(-)
diff --git a/tmux/tmux.conf b/tmux/tmux.conf
@@ -1,61 +1,114 @@
-#bind-key C-a last-window # C-a C-a for last active window
-unbind % # unbind vertical split
-unbind '"' # unbind horizontal split
-unbind C-b # unbind default leader key
-unbind C-o
-unbind j
-bind A command-prompt "rename-window %%"
-bind C-j previous-window
-bind C-k next-window
-bind M-- select-layout "even-vertical"
-bind M-r rotate-window
-bind M-| select-layout "even-horizontal"
-bind-key -n C-down next
-bind-key -n C-left prev
-bind-key -n C-right next
-bind-key -n C-up prev
-bind-key -r C-h resize-pane -L
-bind-key -r C-j resize-pane -D
-bind-key -r C-k resize-pane -U
-bind-key -r C-l resize-pane -R
-bind-key C-d detach-client
-bind-key Enter break-pane
-bind-key a send-prefix
-bind-key J command-prompt -p "join pane from:" "join-pane -s '%%'"
-bind-key Space list-panes
-bind-key s split-window -v # split pane horizontally
-bind-key S choose-tree -Zs
-bind-key h select-pane -L
-bind-key j select-pane -D
-bind-key k select-pane -U
-bind-key l select-pane -R
-bind-key r source-file ~/.tmux.conf
-bind-key v split-window -h # split pane vertically
+# vim: foldmethod=marker foldlevel=0
+# Global options {{{
+# "set" == "set-option"
set -g history-limit 30000
set -g mouse on
-set -g prefix C-a
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
-set -g default-command /usr/bin/zsh
+set -g default-command $SHELL
set -g default-shell $SHELL
-set-option -g default-terminal "xterm-256color"
-set-option -g pane-active-border-style fg=green
-set-option -g set-titles on
-set-option -g set-titles-string '#H:#S.#I.#P #W #T'
-set-option -g status-bg black # colour213 # pink
-set-option -g status-fg cyan
-set-option -g status-interval 5
-set-option -g status-justify right
-set-option -g status-left '#[fg=magenta]» #[fg=blue,bold]#T#[default]'
-set-option -g status-left-length 30
-set-option -g status-right '#[fg=red,bold] #[fg=cyan]»» #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]'
-set-option -g visual-activity on
-set-window-option -g mode-keys vi # vi key
-set-window-option -g monitor-activity on
-set-window-option -g window-status-current-style bg=red
-set-window-option -g window-status-current-style fg=white
-set-window-option -g xterm-keys on # for vim
+set -g default-terminal "xterm-256color"
+set -g pane-active-border-style fg=green
+set -g set-titles on
+set -g set-titles-string '#H:#S.#I.#P #W #T'
+set -g status-bg black
+set -g status-fg cyan
+set -g status-interval 5
+set -g status-justify right
+set -g status-left '#[fg=magenta]» #[fg=blue,bold]#T#[default]'
+set -g status-left-length 30
+set -g status-right '#[fg=red,bold] #[fg=cyan]»» #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]'
+set -g visual-activity on
+# }}}
+# Window options {{{
+setw -g mode-keys vi
+setw -g monitor-activity on
+setw -g window-status-current-style bg=red
+setw -g window-status-current-style fg=white
+setw -g xterm-keys on # for vim
setw -g aggressive-resize on
setw -g automatic-rename
setw -g mode-keys vi
setw -g mode-style bg='#222222'
setw -g window-status-current-style reverse
+# }}}
+# Key bindings {{{
+# General {{{
+
+# Set the prefix
+unbind C-b # unbind default leader key
+set -g prefix C-a
+bind a send-prefix
+
+# Reload the config file
+unbind r
+bind r source-file ~/.tmux.conf \; display-message "Reloaded config"
+
+# Allow c-a c-d to detach
+bind C-d detach-client
+
+# }}}
+# Windows {{{
+
+# Vertical split
+unbind %
+bind v split-window -h
+
+# Horizontal split
+unbind '"' # unbind horizontal split
+bind s split-window -v # split pane horizontally
+
+# Window navigation
+unbind C-j
+unbind C-k
+bind C-j previous-window
+bind C-k next-window
+
+# Rotate the layout of panes
+unbind C-o
+bind M-r rotate-window
+
+# Switch layouts
+unbind M--
+unbind M-|
+bind M-- select-layout "even-vertical"
+bind M-| select-layout "even-horizontal"
+
+# Screen-like rename binding
+unbind A
+bind A command-prompt "rename-window %%"
+
+# }}}
+# Panes {{{
+# Pane navigation
+unbind j
+unbind h
+unbind k
+unbind l
+bind j select-pane -D
+bind h select-pane -L
+bind k select-pane -U
+bind l select-pane -R
+
+# Pane resizing
+unbind C-h
+unbind C-j
+unbind C-k
+unbind C-l
+bind -r C-h resize-pane -L # "-r" means key may repeat
+bind -r C-j resize-pane -D
+bind -r C-k resize-pane -U
+bind -r C-l resize-pane -R
+
+# Split & join panes
+bind Enter break-pane
+bind J command-prompt -p "join pane from:" "join-pane -s '%%'"
+
+# Listing panes
+bind Space list-panes
+bind S choose-tree -Zs
+
+# Synchronize panes
+unbind @
+bind @ setw synchronize-panes \; display-message "Toggle sync panes"
+# }}}
+# }}}