Hi Tom!

On Fri, 20 Feb 2009, Tom Link wrote:

> But this doesn't work (for me) when being executed from a function 
> or if you source those lines from a file. So you'd have to enter the
> commands on the command line which isn't really practical. I also
> noticed minor "line shifts" so 2<pagedown> doesn't always get you to
> the next book page -- but maybe there is an option I forgot/don't 
> know about controlling the behaviour of pagedown.

How about this "hackish" solution

function! Reader(nr)
        if a:nr==0
                return ''
        else
                :ka
                :1
                setl noscrollbind scrolloff=0
                let a=''
                let i=a:nr
                let a .= repeat(':bo vsp\<CR>', i)
                let a .= repeat(':normal Ljzt\<CR>',i)
                let a .= ':setl scb\<CR>'
                while i>1
                        let a .= ':wincmd h\<CR>'
                        let a .= repeat(':normal Ljzt\<CR>',i-1)
                        let a .= ':setl scb\<CR>'
                        let i-=1
                endwhile
                let a .= ':wincmd h\<CR>'
                let a .= ':setl scb\<CR>'
                let a .= ':normal `a\<CR>'
                return a
        endif
endfu

and then call this function via
:exe ':call feedkeys("' . Read(2) . '","t")'

If you want to open 2 new scrollbinded windows. Adjust the number to 
the number of windows you like to open.

Mit freundlichen Grüßen
Christian
-- 
Wer viel Freude hat, muß ein guter Mensch sein: aber vielleicht ist
er nicht der Klügste, obwohl er gerade das erreicht, was der Klügste
mit all seiner Klugheit erstrebt.
                -- Friedrich Wilhelm Nietzsche

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to