:autocmd CursorMoved * silent exe '!tmux send-keys Escape :' line("w0")-16: 'Enter' 'z Enter'
CursorMoved events (vim lacks scroll events; we could
map explicit scrolls commands, like
get the line at the top of the window
tell vim in the tmux session to move one screen higher than that (
-16), by putting the cursor there (
Escape :n Enter, where
n is the line, and tmux accepts special keys by their names,
Enter), then scrolling to put the cursor at the top of the screen (
To use this, edit a file in one window - this is where you control it from. In second window, start tmux, then edit the same file (readonly). Enter the above
autocmd in the first window. You can check that vim in the second window is now "remote scrollbound" to the first window.
Now, on the other phone, ssh into the first phone, and attach to the tmux session. You will get a duplicate of the second window above. Place this phone above the other phone. BTW here's how I connected androids over bluetooth, which had lower latency for me.
There's 250ms latency or so before the other window scrolls, but it's OK.
There are practical problems, putting one smartphone above another in a secure way. It's important for usability to have the screens at the same angle, to avoid glare from ceiling lights. If the screens are different dimensions, the text won't line up.