about summary refs log tree commit diff
path: root/configs/shared/.tmux.conf
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-09-26T19·30-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-09-26T19·30-0400
commitd996d8e814f528f14f9de7570b847ab1fad283d7 (patch)
treeb3505986dc2b77e44df159d16f2d1227fdd6afbc /configs/shared/.tmux.conf
parenta1a8a73b2da9226c143c5c38a4636666db55bb70 (diff)
Adds preferable Tmux kbds
Diffstat (limited to 'configs/shared/.tmux.conf')
-rw-r--r--configs/shared/.tmux.conf48
1 files changed, 32 insertions, 16 deletions
diff --git a/configs/shared/.tmux.conf b/configs/shared/.tmux.conf
index f56c6b503713..76ca5f20055a 100644
--- a/configs/shared/.tmux.conf
+++ b/configs/shared/.tmux.conf
@@ -1,3 +1,8 @@
+# Convenience defn for creating vim-specific kbd behavior
+is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
+    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
+
+
 # change tmux leader
 unbind C-b
 set -g prefix C-q
@@ -9,15 +14,30 @@ set -g default-terminal "screen-256color"
 set-option -sa terminal-overrides ",xterm*:Tc"
 
 
-#copy-paste fixes: http://evertpot.com/osx-tmux-vim-copy-paste-clipboard/
 # Copy-paste integration
 set-option -g default-command "reattach-to-user-namespace -l zsh"
 
 
+# copy text like it's Vim
+bind-key -n Escape if-shell "${is_vim}" "send-keys Escape" copy-mode
+
+
+# Transpose window layouts
+bind-key -n M-r rotate-window -D
+
+
+# Maximize current pane
+bind-key -n M-z resize-pane -Z
+
+
 # Use vim keybindings in copy mode
 setw -g mode-keys vi
 
 
+# kbds to create and delete tmux panes and windows (without confirmation)
+bind-key -n M-q if-shell "${is_vim}" "send-keys M-q" kill-pane
+
+
 # Setup 'v' to begin selection as in Vim
 bind-key -t vi-copy v begin-selection
 bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
@@ -51,10 +71,6 @@ bind c new-window -c '#{pane_current_path}'
 
 # Make tmux work like vi
 set-window-option -g mode-keys vi
-bind h select-pane -L
-bind j select-pane -D
-bind k select-pane -U
-bind l select-pane -R
 
 
 # Easier window swaps
@@ -93,10 +109,9 @@ bind -n m-s choose-session
 
 
 # split window shortcuts, maintaing the working directory
-bind | split-window -h -c '#{pane_current_path}'
-bind \ split-window -h -c '#{pane_current_path}'
-bind - split-window -v -c '#{pane_current_path}'
-bind _ split-window -v -c '#{pane_current_path}'
+bind-key -n M-\ split-window -h -c '#{pane_current_path}'
+bind-key -n M-- split-window -v -c '#{pane_current_path}'
+
 
 bind '"' split-window -c "#{pane_current_path}"
 bind % split-window -h -c "#{pane_current_path}"
@@ -119,10 +134,11 @@ set-option -g status-right-length 90
 
 
 # Bindings for "christoomey/vim-tmux-navigator"
-is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
-    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
-bind-key -n C-h if-shell "$is_vim" "send-keys C-h"  "select-pane -L"
-bind-key -n C-j if-shell "$is_vim" "send-keys C-j"  "select-pane -D"
-bind-key -n C-k if-shell "$is_vim" "send-keys C-k"  "select-pane -U"
-bind-key -n C-l if-shell "$is_vim" "send-keys C-l"  "select-pane -R"
-bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
+bind-key -n M-h if-shell "${is_vim}" "send-keys M-h" "select-pane -L"
+bind-key -n M-j if-shell "${is_vim}" "send-keys M-j" "select-pane -D"
+bind-key -n M-k if-shell "${is_vim}" "send-keys M-k" "select-pane -U"
+bind-key -n M-l if-shell "${is_vim}" "send-keys M-l" "select-pane -R"
+
+
+# Configuration for a Pomodoro timer available at 'tj/pomo'
+set-option -g status-right '#(cat ~/.pomo_stat)'