# how to make n always moves to the middle

5 messages
Open this post in threaded view
|

## how to make n always moves to the middle

 Greetings! When I do a, /search-string I would then hit n for the next found string.  however, sometimes, the next string is found at the last line and I would like to see the a few lines below it.  And here is the question: Is there a way that I can have the next n be in the middle, if it is X line or lower?  Or even better, if it is X line or lower, set n to be at line Y.  Is this possible? thanks. jic
Open this post in threaded view
|

## Re: how to make n always moves to the middle

 Am Friday 22 July 2005 17:58 schrieb jose isaias cabrera: > When I do a, > > /search-string > > I would then hit n for the next found string.  however, sometimes, the > next string is found at the last line and I would like to see the a few > lines below it.  And here is the question: Is there a way that I can > have the next n be in the middle, if it is X line or lower?  Or even > better, if it is X line or lower, set n to be at line Y.  Is this > possible? Take a look at the 'scrolloff' option. :h scrolloff Thomas
Open this post in threaded view
|

## Re: how to make n always moves to the middle

 In reply to this post by jose isaias cabrera-2 ----- Original Message ----- From: "jose isaias cabrera" <[hidden email]> To: <[hidden email]> Sent: Friday, July 22, 2005 5:58 PM Subject: how to make n always moves to the middle > > Greetings! > > When I do a, > > /search-string > > I would then hit n for the next found string.  however, sometimes, the > next string is found at the last line and I would like to see the a few > lines below it.  And here is the question: Is there a way that I can > have the next n be in the middle, if it is X line or lower?  Or even > better, if it is X line or lower, set n to be at line Y.  Is this > possible? > > thanks. > > jic To scroll the match (found by n or N, not the first match found by / or ?) to center of window:     :map n nzz     :map N Nzz See also     :help scroll-up     :help scroll-down     :help scroll-cursor For instance, noremap to nzb5 and Nzb5 to move it to 5 lines above the bottom. HTH, Tony.