On 9/19/06, Meino Christian Cramer <[EMAIL PROTECTED]> wrote:
Hi,
I would like to accomplish three "tricks":
1.) Suppose you have a source code and have started an new search
task recently. With "n" you are jumping from match to
match. Sometimes the "next match" is right on the last line
currently visible. Pressing "n" let the cursor jump there. The
screen is not scrolled, cause the target is still on the screen --
but the context is not.
Is it possible to always scroll the screen that way, that pressing
"n" wll always take you to the middle of the screen (or in other
words: The cursor is glued to the middle of the screen and the text
jumps "under" the cursor)?
2.) This is similiar: I want to scroll through text and keep the
cursor glued to a certain position on the screen.
3.) Last "glued cursor" thingy: I want to glue the cursor on the text
and using "up" and "down" will not move the cursor on the text but
the text on the screen.
I am sure these are little steps for a vim guru to accomplish but
would be big steps for me. :)
Thank you very much for any hint and/or help in advance !
Keep hacking!
mcc
1) I use Tim's suggestions of
:nnoremap n nzz
:nnoremap N Nzz
2) help CTRL-D
help CTRL-U
3) help CTRL-E
help CTRL-Y
for 2 and 3, I have them mapped so the count is always 1:
:nnoremap <C-D> 1<C-D>
:nnoremap <C-U> 1<C-U>
:nnoremap <C-E> 1<C-E>
:nnoremap <C-Y> 1<C-Y>