Currently, when I using vim searching "/searchforsth" with "n" to search for words. After navigating through the words on this page, the next word that is not on the current page will appear at the bottom. But I am used to the behavior that this word will display on top or middle of this page, just like pressing "zt" or "zz". So I can see the following code of this searched pattern. Is there a way to define this behavior by myself? Thanks in advance.

1 Answer 1


You can achieve this by advising evil-ex-search as follows:

  (advice-add 'evil-ex-search :after #'recenter)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.