summaryrefslogtreecommitdiff
path: root/tmux
diff options
context:
space:
mode:
Diffstat (limited to 'tmux')
-rw-r--r--tmux/.tmux.conf50
1 files changed, 50 insertions, 0 deletions
diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf
new file mode 100644
index 0000000..b06c890
--- /dev/null
+++ b/tmux/.tmux.conf
@@ -0,0 +1,50 @@
+# Tmux configuration for vim-like keybindings
+
+setw -g mode-keys vi
+
+unbind [
+bind Escape copy-mode
+unbind p
+bind p paste-buffer
+bind-key -t vi-copy 'v' begin-selection
+bind-key -t vi-copy 'y' copy-selection
+
+
+# splitting windows: tmux definition of vertical/horizontal split is reversed
+# to vim's
+bind s split-window -v
+bind v split-window -h
+
+# vim-like resizing
+bind < resize-pane -L 10
+bind > resize-pane -R 10
+bind + resize-pane -U 10
+bind - resize-pane -D 10
+
+# vim-like command prompt
+bind : command-prompt
+
+# Smart pane switching with awareness of vim splits
+is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
+bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
+bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
+bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
+bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
+bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
+
+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=colour187,bold]#H'
+set -g status-right '#[fg=colour174]#(mpc) #[fg=colour187,bold]%H:%M:%S'
+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