aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--_tmux.conf22
1 files changed, 11 insertions, 11 deletions
diff --git a/_tmux.conf b/_tmux.conf
index 839f3ec..90d8099 100644
--- a/_tmux.conf
+++ b/_tmux.conf
@@ -33,7 +33,7 @@
# Aaron LI
# 2015-01-22
#
-# 2017-09-04 : Tweak and fix several mistakes
+# 2017-09-04 : Tweak and fix several mistakes; more tweaks
# 2017-09-03 : Rewrite; drop plugins (with TPM)...
#
@@ -73,10 +73,6 @@ set -g history-limit 1000
# Turn on xterm-keys so that additional function keys get escape sequences
set -g xterm-keys on
-# Turn the mouse on, but without copy mode dragging
-set -g mouse on
-unbind -n MouseDrag1Pane
-
# Change the default $TERM to screen-256color
# * xterm-256color for tmux may have problem with special keys in zsh
# * tmux-256color may not be recognized, e.g., DragonFlyBSD
@@ -110,6 +106,7 @@ bind -n C-d detach
unbind '"'
unbind %
bind | split-window -h -c '#{pane_current_path}'
+bind \ split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# Pane switching
@@ -138,8 +135,8 @@ bind -n C-Left swap-window -t -1
bind -n C-Right swap-window -t +1
# Enable/disable mouse mode
-bind m set -g mouse on\; display "Mouse: ON"
-bind M set -g mouse off\; display "Mouse: OFF"
+bind m set mouse\; display 'Toggled mouse #{?mouse,on,off} (this session)'
+bind M set -g mouse\; display 'Globally toggled mouse #{?mouse,on,off}'
# Keys to toggle monitoring activity in a window, and synchronize-panes
#bind m set monitor-activity
@@ -153,6 +150,10 @@ bind , command-prompt -p "(rename-window '#W')" "rename-window '%%'"
# Do the same for session renaming
bind '$' command-prompt -p "(rename-session '#S')" "rename-session '%%'"
+# Copy & paste
+bind Escape copy-mode
+bind p paste-buffer
+
##
## Appearance
@@ -167,7 +168,7 @@ set -g status-left " #[fg=yellow]#h:#[fg=blue]#S #[fg=magenta]>>#[defaul
set -g status-right "#[fg=magenta]<< #[fg=yellow]%a %m/%d #[fg=blue]%H:%M "
# If running inside tmux ($TMUX is set), then change the status line to red
-if-shell -b '[ -n "$TMUX" ]' "set -g status-bg red"
+#if-shell -b '[ -n "$TMUX" ]' "set -g status-bg red"
# Window status
setw -g window-status-separator " "
@@ -216,15 +217,14 @@ if-shell -b '[ "$(echo "$TMUX_VERSION < 2.2" | bc)" = 1 ]' \
# Credit: https://shapeshed.com/custom-vim-bindings-in-tmux-2-4/
# See also: https://github.com/tmux/tmux/issues/754
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
- "unbind -T copy-mode MouseDrag1Pane; \
+ "unbind -T copy-mode-vi MouseDragEnd1Pane; \
bind -T copy-mode-vi 'v' send -X begin-selection; \
bind -T copy-mode-vi 'V' send -X select-line; \
bind -T copy-mode-vi 'r' send -X rectangle-toggle; \
bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel \
'xclip -in -selection clipboard'"
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
- "bind Escape copy-mode; \
- bind p paste-buffer; \
+ "unbind -t vi-copy MouseDragEnd1Pane; \
bind -t vi-copy Escape cancel; \
bind -t vi-copy v begin-selection; \
bind -t vi-copy V select-line; \