admin管理员组文章数量:1311801
When I move my cursor down, first it reaches the last line on the page, then the page starts scrolling. I remember seeing someone doing this, but instead of reaching the end of the page, it would start scrolling down when the cursor reached half the page length. How can I set this up?
When I move my cursor down, first it reaches the last line on the page, then the page starts scrolling. I remember seeing someone doing this, but instead of reaching the end of the page, it would start scrolling down when the cursor reached half the page length. How can I set this up?
Share Improve this question asked Feb 1 at 13:14 khebratikhebrati 685 bronze badges 01 Answer
Reset to default 3What you saw was probably caused by setting the 'scrolloff'
option to a large number:
:set scrolloff=999
Using it like this is suggested in Vim's own :help 'scrolloff'
:
Minimal number of screen lines to keep above and below the cursor. This will make some context visible around where you are working. If you set it to a very large value (999) the cursor line will always be in the middle of the window (except at the start or end of the file or when long lines wrap).
Of course, any number larger than half your screen lines will do, it doesn't have to be 999.
You can put it in your vimrc
to have it enabled by default.
If you don't always want to center the current line but only do so once, use zz
(see :help zz
)
For more ways to scroll, read :help scrolling
.
本文标签: vimPage starts scrolling when cursor reaches half pageStack Overflow
版权声明:本文标题:vim - Page starts scrolling when cursor reaches half page - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741874921a2402406.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论