[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: Scrolling another window from current window - How ?
From:       "Antoine J. Mechelynck" <antoine.mechelynck () belgacom ! net>
Date:       2005-02-19 17:11:08
Message-ID: 4217732C.1070600 () belgacom ! net
[Download RAW message or body]

Raja Koduru wrote:
> Hello Everybody,
> 
> I have two windows (vertically split) with two different files. I have 
> to type in one window(wnd_1) referring the adjacent one(wnd_2). Many a 
> times I have to switch to wnd_2 scroll up/down looking for some needed 
> info and then switch back to wnd_1 and continue typing.
> 
> I feel that there should be some easy and better way of scrolling the 
> other windows without manually typing the C-W W and back. Even a nmap 
> would suffice.
> 
> I browsed windows.txt and motion.txt but couldn't get the needed info.
> 
> I look forward to your help in this regard.
> 
> My development environment: gvim-6.3-062 on win-XP.
> 
> with regards
> raja koduru
> 
> 
> 
If your Vim version recognises the mouse, you can scroll any window by 
means of its scrollbar: that doesn't move the cursor.

Or you can map the whole sequence:

	:map	<F11>	<C-W>w<PageDown><C-W>W
	:map!	<F11>	<C-O><C-W>w<PageDown><C-O><C-W>W
	:map	<C-F11>	<C-W>w<PageUp><C-W>W
	:map!	<C-F11>	<C-O><C-W>w<PageUp><C-O><C-W>W
	:map	<F12>	<C-W>W<PageDown><C-W>w
	:map!	<F12>	<C-O><C-W>W<PageDown><C-O><C-W>w
	:map	<C-F12>	<C-W>W<PageUp><C-W>w
	:map!	<C-F12>	<C-O><C-W>W<PageUp><C-O><C-W>w

(Replace the {lhs} by whatever suits you.) With the above mappings, use 
F11 and Ctrl-F11 to scroll by one page the window immediately below or 
to the right of the current one (round-robin), F12 and Ctrl-F12 for the 
one above it or to its left. If there are only two windows, both sets 
become equivalent. If there are more than three window and you want to 
scroll a nonadjacent one, then it becomes more complicated because of 
the need to repeat the count (before <C-W>w and before <C-W>W). In that 
case IMO using the mouse is simpler.

HTH,
Tony.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic