When turning pages (scrolling) in vim, the default cursor moves up to the top of the screen or down to the bottom of the screen. I hope to keep the position on the screen unchanged, that is, only move the text, but not the cursor (relative to screen) position.
How to achieve this? Please advise, thanks in advance!
You mean these?
ctrl + y goes up one line
ctrl + e goes down one line
ctrl + u goes up half the screen
ctrl + d goes down half the screen
ctrl + b goes up one screen
ctrl + f goes down the screen
You can check out this stackoverflow answer
http://stackoverflow.com/questions/3458689/how-to-move-screen-without-moving-cursor-in-vim
The ToggleScrollMode function below is good, I guess it should meet your needs
If you cannot install the plug-in, you can try to turn on the relative line number display of vim, and jump quickly based on the relative line number after turning the page.
Added to
.vimrc
This 7 you set yourself
You can zz to align the line to the center after scrolling, similar to emacs' <C-l>
ctrl-d scrolls down half the screen, the cursor will not move
ctrl-f Scroll down one screen and the monogram will move.
shift-m moves the cursor to the middle of the screen and can be used after ctrl-f to flip the screen