- Left (L) and right (R) are two vertically split windows displaying the same file.
- No other windows exist in the tab.
- The uppermost displayed line in L is x (
Lx) and the uppermost line in R is y (
- The focused window is denoted by an asterisk (
I am looking for a normal mode map to do this:
- If L has focus: Change
- If R has focus: Change
I.e., I want the offset between the windows to be zero.
syncbind almost solves the problem, but since it requires both windows
scrollbind set, and I rarely have it set, things get more complicated.
windo would apparently solve it:
noremap <F11> :windo set scb<bar>syncbind<CR>:windo set noscb<CR>
But although it works properly for case 2, it fails for case 1 because it shifts focus to the right window.