In vim, often I will jump to a mark I made, or a search result, and the cursor will be at the very bottom or very top of the screen. At this point, in order for the screen to be easier to read, I want to scroll the buffer so that the text under the cursor is in the middle of the screen.
Is this possible in vim? How do you do it?
This will center the current line
Optionally you could set
scrolloffto something large like999and the working line will always be in the center, except when you are towards the start or end of the file.