Vim滚动而不改变游标在屏幕上的位置(Vim scrolling without changing cursors on

系统教程 行业动态 更新时间:2024-06-14 17:02:18
Vim滚动而不改变游标在屏幕上的位置(Vim scrolling without changing cursors on-screen position)

当光标在屏幕中间时,向下滚动,光标在屏幕上向上移动。 我不希望它那样做。

如何在不改变游标屏幕位置的情况下滚动?

解决方法,回答后添加:

noremap <C-k> 14j14<C-e> noremap <C-l> 14k14<C-y>

When cursor is at middle of screen and i scroll down, the cursor moves upwards on the screen. I don't want it to do that.

How can i scroll without changing cursors on-screen position?

Solution, added after answer:

noremap <C-k> 14j14<C-e> noremap <C-l> 14k14<C-y>

最满意答案

如果你想同时在屏幕上的任何位置移动光标和视口,也许你应该设置一些自定义的键绑定来同时执行这两个操作。

如:

:nnoremap <C-M-u> j<C-e>

这将使光标向下移动( j )并移动视口( Ctrl-e ),只要按Ctrl-Alt-u (仅在正常模式下)。

If you want to both move the cursor and the viewport with the cursor anywhere in the screen, perhaps you should set up some custom key bindings to do both at once.

Such as:

:nnoremap <C-M-u> j<C-e>

This will move the cursor down (j) and move the viewport (Ctrl-e) whenever you press Ctrl-Alt-u (only in normal mode).

更多推荐

本文发布于:2023-04-21 18:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/c7ae81f5e4faee0f720e050b73341e80.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:游标   而不   位置   屏幕上   Vim

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!