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
You can achieve this by advising evil-ex-search
as follows:
(advice-add 'evil-ex-search :after #'recenter)