If I search forward or backwards (via / and ?) in VIM it will show results at the last line of the screen (when searched forward) or first line of the screen (when searched backwards).
The problem is that in this case I can't see the lines before or after the search result without moving the cursor up/down.
How can I force VIM to scroll the search result to the middle of the screen or alternatively scroll it in such way that always X lines before and after the search result are visible in the terminal screen?
Thanks
set scrolloff=10will force vim to keep 10 min lines above and below the cursorlineYou can force vim to keep cursor in the middle of the screen when navigating to the next & prev search results by remapping n and N keys