Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

auto-scrollable pagination with vim using vertical split

Tags:

vim

pagination

I want to achieve the following: I want to split a vim session into two (or more) vertical windows (with the :vsplit command). Then, I want to have each window contents vertically offsetted so that the line after the last visible one of the first window becomes the first line of the second window. Then, when I use the arrows to scroll around, the vertical windows are scrollbound so that text flows from the second window into the first. How can I achieve this?

like image 410
Stefano Borini Avatar asked Jul 29 '11 12:07

Stefano Borini


1 Answers

There are plugins for that: MultiPage

You can also use a oneliner described in this post by Chip Campbell:

 :nmap <silent> <Leader>ef :vsplit<bar>wincmd l<bar>exe "norm! Ljz<c-v><cr>"<cr>:set scb<cr>:wincmd h<cr> :set scb<cr>

This will bind <Leader>ef to open a vsplit and make the splits continuous.

like image 154
mike3996 Avatar answered Nov 09 '22 18:11

mike3996