Skip to main content
Remove "not my answer" because it isn't and never was.
Source Link
Friedrich
  • 3.3k
  • 1
  • 13
  • 26

Not my answer butThe following mappings were adapted from Drew Neil's in his Practical Vim is to create the following mappings:

:nnoremap <Leader>n nzz
:nnoremap <Leader>N Nzz

So,They will make n will go to the next match as usual and <Leader>n will go to the next match, centering the screen. You could also drop <Leader> from the mapping to change the defaults and have (next) searches also centered.

Not my answer but Drew Neil's in his Practical Vim is to create the following mappings:

:nnoremap <Leader>n nzz
:nnoremap <Leader>N Nzz

So, n will go to the next match as usual and <Leader>n will go to the next match, centering the screen. You could also drop <Leader> from the mapping to change the defaults and have (next) searches also centered.

The following mappings were adapted from Drew Neil's Practical Vim:

:nnoremap <Leader>n nzz
:nnoremap <Leader>N Nzz

They will make n go to the next match as usual and <Leader>n will go to the next match, centering the screen. You could also drop <Leader> from the mapping to change the defaults and have (next) searches also centered.

added 2 characters in body
Source Link
Vivian De Smedt
  • 21.1k
  • 5
  • 22
  • 40

Not my answer but Drew Neil's in his Practical Vim is to create the following mappings:

:noremapnnoremap <Leader>n nzz
:noremapnnoremap <Leader>N Nzz

So, n will go to the next match as usual and <Leader>n will go to the next match, centering the screen. You could also drop <Leader> from the mapping to change the defaults and have (next) searches also centered.

Not my answer but Drew Neil's in his Practical Vim is to create the following mappings:

:noremap <Leader>n nzz
:noremap <Leader>N Nzz

So, n will go to the next match as usual and <Leader>n will go to the next match, centering the screen. You could also drop <Leader> from the mapping to change the defaults and have (next) searches also centered.

Not my answer but Drew Neil's in his Practical Vim is to create the following mappings:

:nnoremap <Leader>n nzz
:nnoremap <Leader>N Nzz

So, n will go to the next match as usual and <Leader>n will go to the next match, centering the screen. You could also drop <Leader> from the mapping to change the defaults and have (next) searches also centered.

Source Link
Friedrich
  • 3.3k
  • 1
  • 13
  • 26

Not my answer but Drew Neil's in his Practical Vim is to create the following mappings:

:noremap <Leader>n nzz
:noremap <Leader>N Nzz

So, n will go to the next match as usual and <Leader>n will go to the next match, centering the screen. You could also drop <Leader> from the mapping to change the defaults and have (next) searches also centered.

Post Made Community Wiki by Friedrich