summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-04-15 12:45:17 -0700
committerSean Whitton <spwhitton@spwhitton.name>2018-04-15 12:45:17 -0700
commit0446209c8cf486fc5010f800c46ab007bc048101 (patch)
treeeb80fafa6c9ac02f2c742bb7b1cc80510ed4e73b
parentcb4547c5cca9b32c7c6b1c260ef7f55a65d767ba (diff)
downloaddotfiles-0446209c8cf486fc5010f800c46ab007bc048101.tar.gz
tidy up tmux config
-rw-r--r--.tmux.conf142
1 files changed, 82 insertions, 60 deletions
diff --git a/.tmux.conf b/.tmux.conf
index 534c3db4..ca7cb9a2 100644
--- a/.tmux.conf
+++ b/.tmux.conf
@@ -1,80 +1,102 @@
-# start a new session: means "tmux attach" will always do something
-# sensible
+# ---- startup ----
+# having this here means that `tmux attach` will start a new session
+# and attach to it, if no session exists yet
new-session
-# --- preferencs
+# ---- preferences ----
+set -g set-titles on
+set -g set-titles-string "#(whoami)@#h"
+# set -g set-titles-string "tmux #I:#W"
set -g base-index 1
set -g pane-base-index 1
-set -g history-limit 10000
+set -g history-limit 5000
set -sg escape-time 1
-set -g set-titles on
-# set -g set-titles-string "tmux #I:#W"
-set -g set-titles-string "#(whoami)@#h"
-setw -g mode-keys emacs
-set -g status-keys emacs
-set-window-option -g xterm-keys on
-set -g default-terminal "screen-256color"
-# --- status bar
+set -g default-terminal "screen-256color"
-set -g status-justify centre
-setw -g monitor-activity on
+set -wg monitor-activity on
set -g visual-activity on
-set -g status-left-length 70
-set -g status-left "#[fg=green]: #h"
-set -g status-right-length 60
-set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::"
-# --- key bindings
+# ---- bindings ----
-# - C-\ \ to send C-\ to e.g. Emacs or nested tmux;
-# - C-\ C-\ to bounce between windows
+set -wg mode-keys emacs
+set -g status-keys emacs
+# set -wg xterm-keys on
+
+# same as dtach and GNU screen
set -g prefix "C-\\"
+
+# C-\ \ to send C-\ to Emacs, nested tmux, dtach etc.
bind "\\" send-prefix
+
+# C-\ C-\ to bounce between windows
# unbind C-\\
-bind-key "C-\\" last-window
-
-# splitting should maintain current working directory
-bind '"' split-window -c "#{pane_current_path}"
-bind % split-window -h -c "#{pane_current_path}"
-bind c new-window -c "#{pane_current_path}"
-
-# my launcher shortcuts: mnemonic is h for host and e for emacs/editor
-# E for e-mail
-bind-key M command-prompt -p "man" "split-window 'exec man %%'"
-bind-key m new-window -n mail mutt
-bind-key H command-prompt -p "mosh to host" "split-window 'mosh %1'"
-bind-key h command-prompt -p "mosh to host" "new-window -n %1 'mosh %1'"
-bind-key R command-prompt -p "ssh to host" "split-window 'ssh %1'"
-bind-key r command-prompt -p "ssh to host" "new-window -n %1 'ssh %1'"
-bind-key E split-window 'emacsclient -amg -t'
-bind-key e new-window -n emacs 'emacsclient -amg -t'
-bind-key t new-window -n irssi 'ii'
-
-# --- zenburn from https://github.com/plathrop/dotfiles/blob/master/tmux/zenburn.conf
-
-setw -g clock-mode-colour colour117
-setw -g mode-attr bold
-setw -g mode-fg colour117
-setw -g mode-bg colour238
-set -g status-bg colour235
-set -g status-fg colour248
+bind "C-\\" last-window
+
+# # splitting should maintain current working directory
+# bind '"' split-window -c "#{pane_current_path}"
+# bind % split-window -h -c "#{pane_current_path}"
+# bind c new-window -c "#{pane_current_path}"
+
+# # my launcher shortcuts: mnemonic is h for host and e for emacs/editor
+# # E for e-mail
+# bind M command-prompt -p "man" "split-window 'exec man %%'"
+# bind m new-window -n mail mutt
+# bind H command-prompt -p "mosh to host" "split-window 'mosh %1'"
+# bind h command-prompt -p "mosh to host" "new-window -n %1 'mosh %1'"
+# bind R command-prompt -p "ssh to host" "split-window 'ssh %1'"
+# bind r command-prompt -p "ssh to host" "new-window -n %1 'ssh %1'"
+# bind E split-window 'emacsclient -amg -t'
+# bind e new-window -n emacs 'emacsclient -amg -t'
+# bind t new-window -n irssi 'ii'
+
+# ---- status bar ----
+
+set -g status-position top
+set -g status-justify centre
set -g status-attr dim
-set -g status-left ' #[fg=colour174][ #[fg=colour187,bold]#(whoami)@#h #[fg=colour174]]'
-set -g status-right '#[fg=colour174][ #[fg=colour187,bold]%d %h %H:%M #[fg=colour174]] '
-set -g status-right-length 80
-setw -g window-status-current-fg colour223
-setw -g window-status-current-bg colour237
-setw -g window-status-current-attr bold
-set -g message-attr bold
-set -g message-fg colour117
-set -g message-bg colour235
-set-option -g status-position top
-
-# --- terminal keycode fixes
+
+# invert current window so easier to pick out
+set -wg window-status-current-fg white
+set -wg window-status-current-bg black
+
+# ---- terminal keycode fixes ----
# set -g terminal-overrides "xterm*:kf1=\e[11~:kf2=\e[12~:kf3=\e[13~:kf4=\e[14~:kf5=\e[15~:kf6=\e[17~:kf7=\e[18~:kf8=\e[19~"
# set -g terminal-overrides "xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@"
+
+# ---- old theming code ----
+
+# # --- status bar
+
+# set -g status-justify centre
+# setw -g monitor-activity on
+# set -g visual-activity on
+# set -g status-left-length 70
+# set -g status-left "#[fg=green]: #h"
+# set -g status-right-length 60
+# set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::"
+
+# # --- zenburn from
+# # --- https://github.com/plathrop/dotfiles/blob/master/tmux/zenburn.conf
+
+# setw -g clock-mode-colour colour117
+# setw -g mode-attr bold
+# setw -g mode-fg colour117
+# setw -g mode-bg colour238
+# set -g status-bg colour235
+# set -g status-fg colour248
+# set -g status-attr dim
+# set -g status-left ' #[fg=colour174][ #[fg=colour187,bold]#(whoami)@#h #[fg=colour174]]'
+# set -g status-right '#[fg=colour174][ #[fg=colour187,bold]%d %h %H:%M #[fg=colour174]] '
+# set -g status-right-length 80
+# setw -g window-status-current-fg colour223
+# setw -g window-status-current-bg colour237
+# setw -g window-status-current-attr bold
+# set -g message-attr bold
+# set -g message-fg colour117
+# set -g message-bg colour235
+# set-option -g status-position top