Browse Source

add scroll wheel script for tmux

master
dummy 8 years ago
parent
commit
bec9b3feeb
  1. 19
      .tmux.conf
  2. 1
      .vimrc

19
.tmux.conf

@ -6,9 +6,28 @@ bind-key C-a last-window
set-window-option -g mode-keys vi
set -s escape-time 50
#######################################
# MOUSE SCROLL WHEEL
# Make mouse useful in copy mode
setw -g mouse on
# https://github.com/tmux/tmux/issues/1320#issuecomment-381952082
# Emulate scrolling by sending up and down keys if these commands are running in the pane
tmux_commands_with_legacy_scroll="nano less more man git"
bind-key -T root WheelUpPane \
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
'send -Mt=' \
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
"send -t= Up Up Up" "copy-mode -et="'
bind-key -T root WheelDownPane \
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
'send -Mt=' \
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
"send -t= Down Down Down" "send -Mt="'
# copy selection to X windows clipboard
#set -g set-clipboard off
bind-key -T copy-mode-vi v send -X begin-selection

1
.vimrc

@ -88,6 +88,7 @@ nmap <F4> :bp\|bd #<CR>
" AsyncRun
" https://github.com/skywind3000/asyncrun.vim
" map <F5> :AsyncRun -cwd=<root> -save=2 make<CR>
map <F5> :AsyncRun -cwd=<root> -save=2 make<CR>
augroup vimrc

Loading…
Cancel
Save