Re: How to scroll up and down without changing horizontal pos
[snip] nmap silentPageDown :exe norm .winheight(0).jcr nmap silentPageUp :exe norm .winheight(0).kcr nmap silentc-home :let x=col('.')bar1barexe norm .x.barcr nmap silentc-end:let x=col('.')bar$barexe norm .x.barcr [snip] This works great. I'm trying to map them also to visaul-mode but then I get the error: no range allowed Why is that? I have: vmap silentc-s-PageDown :exe norm .winheight(0).jcr vmap silentc-s-PageUp :exe norm .winheight(0).kcr vmap silentc-s-home :let x=col('.')bar1barexe norm .x.barcr vmap silentc-s-end:let x=col('.')bar$barexe norm .x.barcr Rgds, Eric _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Re: How to scroll up and down without changing horizontal pos
Eric Leenman wrote: [snip] nmap silentPageDown :exe norm .winheight(0).jcr nmap silentPageUp :exe norm .winheight(0).kcr nmap silentc-home :let x=col('.')bar1barexe norm .x.barcr nmap silentc-end:let x=col('.')bar$barexe norm .x.barcr [snip] This works great. I'm trying to map them also to visaul-mode but then I get the error: no range allowed Why is that? I have: vmap silentc-s-PageDown :exe norm .winheight(0).jcr vmap silentc-s-PageUp :exe norm .winheight(0).kcr vmap silentc-s-home :let x=col('.')bar1barexe norm .x.barcr vmap silentc-s-end:let x=col('.')bar$barexe norm .x.barcr Rgds, Eric Hitting the : key in Visual mode causes the visual highlight to disappear, and Vim adds a range as :',' which means from the first to the last line of the latest Visual highlight. In this case you will want to clear the range before the Ex-command (e.g. by means of C-U, see :help c_CTRL-U); but restoring the highlight after scrolling (with gv q.v.) will move the cursor back to one end of the visual area, possibly canceling the scroll... You might prefer to set 'nostartofline' and then use PageUp and PageDown Best regards, Tony.
Re: How to scroll up and down without changing horizontal pos
Eric Leenman wrote: I'm using page-up and page-down to scroll. Also ctrl-home and ctrl-end. This moves the cursor to the beginning of the line. How can this be avoided. I need to the cursor to stay where it is, as the lines are 1000+ characters long Hello! Perhaps:set ve=all nosol will get you the behavior you want. Regards, Chip Campbell