Wikia

Vim Tips Wiki

Scroll alternate window

Talk0
1,613pages on
this wiki
Tip 131 Printable Monobook Previous Next

created October 11, 2001 · complexity basic · author Max Ischenko · version 6.0


This mapping allow you to quickly scroll inactive window when displaying several windows concurrently.

nmap <silent> <M-Down> :call ScrollOtherWindow("down")<CR>
nmap <silent> <M-Up> :call ScrollOtherWindow("up")<CR>

fun! ScrollOtherWindow(dir)
  if a:dir == "down"
    let move = "\<C-E>"
    elseif a:dir == "up"
    let move = "\<C-Y>"
  endif
  exec "normal \<C-W>p" . move . "\<C-W>p"
endfun

CommentsEdit

Around Wikia's network

Random Wiki