new <prefix> m binding: toggles mouse on or off

This commit is contained in:
Gregory Pakosz 2012-10-06 00:31:08 +02:00
parent dcc734f6f7
commit 5c8b9f921f
1 changed files with 20 additions and 7 deletions

View File

@ -49,9 +49,6 @@ set -g status-interval 10 # redraw status line every 10 seconds
# 24 hour clock
setw -g clock-mode-style 24
# easier show-messages binding, when ~ is a dead key
bind m show-messages
# clear both screen and history
bind -n C-l send-keys C-l \; run 'tmux clear-history'
@ -84,8 +81,6 @@ bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
#set -g mouse-select-pane on # mouse can be used to select a pane
# maximize current pane
bind + run 'cut -c3- ~/.tmux.conf | sh -s maximize_pane'
@ -94,13 +89,14 @@ bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
#set -g mouse-resize-pane on # mouse can be used to resize panes
# window navigation
bind -r C-h previous-window # select previous window
bind -r C-l next-window # select next window
bind Space last-window # move to last active window
#set -g mouse-select-window on # mouse can be used to select a window
# toggle mouse
bind m run "cut -c3- ~/.tmux.conf | sh -s toggle_mouse"
# -- copy mode -----------------------------------------------------------------
@ -250,4 +246,21 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# fi
# }
#
# toggle_mouse() {
# old=$(tmux show -g -w | grep mode-mouse | cut -d' ' -f2)
# new=""
#
# if [ "$old" = "on" ] ; then
# new="off"
# else
# new="on"
# fi
#
# tmux set -g mode-mouse $new \;\
# set -g mouse-resize-pane $new \;\
# set -g mouse-select-pane $new \;\
# set -g mouse-select-window $new \;\
# display "mouse: $new"
# }
#
# $@