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).
更多推荐
发布评论