sponsor Vim development Vim logo Vim Book Ad

basic Tip #131: Scroll alternate window

 tip karma   Rating 4/4, Viewed by 786 

created:   October 11, 2001 7:53      complexity:   basic
author:   Max Ischenko      as of Vim:   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

PS: Original idea and discussion of this tip appeared on [email protected] mailing list, I'm just prettified it a little.

 rate this tip  Life Changing Helpful Unfulfilling 

<<disabling default ftplugins | window zooming convenience >>

Additional Notes

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo