new <prefix> m binding: toggles mouse on or off
This commit is contained in:
parent
dcc734f6f7
commit
5c8b9f921f
27
.tmux.conf
27
.tmux.conf
|
@ -49,9 +49,6 @@ set -g status-interval 10 # redraw status line every 10 seconds
|
||||||
# 24 hour clock
|
# 24 hour clock
|
||||||
setw -g clock-mode-style 24
|
setw -g clock-mode-style 24
|
||||||
|
|
||||||
# easier show-messages binding, when ~ is a dead key
|
|
||||||
bind m show-messages
|
|
||||||
|
|
||||||
# clear both screen and history
|
# clear both screen and history
|
||||||
bind -n C-l send-keys C-l \; run 'tmux clear-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 -D # swap current pane with the next one
|
||||||
bind < swap-pane -U # swap current pane with the previous 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
|
# maximize current pane
|
||||||
bind + run 'cut -c3- ~/.tmux.conf | sh -s maximize_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 J resize-pane -D 2
|
||||||
bind -r K resize-pane -U 2
|
bind -r K resize-pane -U 2
|
||||||
bind -r L resize-pane -R 2
|
bind -r L resize-pane -R 2
|
||||||
#set -g mouse-resize-pane on # mouse can be used to resize panes
|
|
||||||
|
|
||||||
# window navigation
|
# window navigation
|
||||||
bind -r C-h previous-window # select previous window
|
bind -r C-h previous-window # select previous window
|
||||||
bind -r C-l next-window # select next window
|
bind -r C-l next-window # select next window
|
||||||
bind Space last-window # move to last active 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 -----------------------------------------------------------------
|
# -- copy mode -----------------------------------------------------------------
|
||||||
|
@ -250,4 +246,21 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
|
||||||
# fi
|
# 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"
|
||||||
|
# }
|
||||||
|
#
|
||||||
# $@
|
# $@
|
||||||
|
|
Loading…
Reference in New Issue