A.J.Mechelynck wrote:
shawn bright wrote:
lo there,
i have two quick questions.
first, is there a way i can scroll text under the cursor ( so that the
cursor stays on the same place in the terminal, but the text scrolls
anyway )
i just think that would be really cool.
see thread "Keep cursor fixed when scrolling the mouse" started
yesterday at 20:24 UTC by "Some user" in this same list.
second. i do a lot of rails stuff, so i open and close a lot of rails
tags.
<% stuff here %>
<%= output stuff here %>
does someone have a suggestion to automate some of this ?
thanks
It all depends what you want to do. To add <%%> at the cursor and place
the cursor in the middle:
:inoremap <F2> <lt>%%><Left><Left>
To duplicate the current line and open insert in between
:nnoremap <F2> yypO
To duplicate the visual selection linewise and place the cursor at the
start of the copy:
:vnoremap <F2> :yank <Bar> '>put <Bar> norm '<lt><CR>
Oops!
:vnoremap <F2> :yank <Bar> '>put <Bar> '>+1<CR>
etc.
Best regards,
Tony.