On Fri, Feb 20, 2009 at 13:28, Tony Mechelynck <antoine.mechely...@gmail.com> wrote: > > On 20/02/09 12:38, ssiza...@gmail.com wrote: >> On Fri, Feb 20, 2009 at 11:51, David Liang<bmda...@gmail.com> wrote: >>> I had this same problem a couple days ago and like Tom, I tried a >>> functional approach at first, but the windows would somehow get de- >>> synced. I ended up writing a macro to do it--see the wiki page for >>> details. It uses @z and marks a and z, which I have set aside as temps >>> by convention. >>> >>> On Feb 19, 11:10 pm, "John Beckett"<johnb.beck...@gmail.com> wrote: >>>> On the Vim Tips wiki, a new contributor called Nsg >>>> has created a tip on >>>> this:http://vim.wikia.com/wiki/View_text_file_in_two_columns >>>> >>>> I'd really like someone to look at the tip and report: >>>> 1. Is it the same as was posted here? >>>> 2. Does it work? >>>> 3. Is it worth keeping on the wiki? >>>> >>>> John >>>> >> >> I really like this idea of splitting, and would like it to adjust to >> my three-pane setup. >> I don't understand everything that's going on here, my most basic >> guess is that it needs another :vs. But modified how? All it gets me >> is two windows looking the same and the third one acting as expected. >> >> >> noremap<silent> ZC :<C-U>let @z=&so<CR>:set so=0<CR>maHmz:set noscb<CR> >> \:vs<CR><C-W>wLzt:set scb<CR><C-W>p:set scb<CR> >> \`zzt`a:let&s...@z<CR> >> " \:vs<CR><C-W>wLzt:set scb<CR><C-W>p:set scb<CR> >> " \`zzt`a:let&s...@z<CR> >> > > Well, let's set out the workflow (from top to bottom, and looks best in > a fixed-width font): > | > +------<----+----->-----+ > | | > | (split off) > | (window 2 ) > | | > | +-------->--------+ > | | | > | | (split off) > | | (window 3 ) > | | | > (make sure window 1 ) (make sure window 2 ) (make sure window 3 ) > (is scrolled the way) (is scrolled the way) (is scrolled the way) > ( you want it ) ( you want it ) ( you want it ) > | | | > (setlocal scb in) (setlocal scb in) (setlocal scb in) > ( window 1 ) ( window 2 ) ( window 3 ) > | | | > +------>----+-----<-----+--------<--------+ > | > > The vertical lines show the "leeway" in executing each task or set of > tasks. There may be additional constraints if you define "the way you > want it" by comparison with another window whose scroll position you > have to set first (if only by deciding that "that"'s your reference) -- > and remember that you can never scroll higher than the top or lower than > the bottom. > > You may want to do it first by hand, either writing down your keystrokes > or "recording" them in a register by means of the q Normal-mode command, > then putting that into the {rhs} of your mapping (by means of CTRL-R if > you used q). > > See > :help q > :help i_CTRL-R > :help c_CTRL-R > in addition to the help for the commands you used. >
Thanks for explaining, I'll use that as a starting point for future changes to the macro. - melisizwe --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---