如何在Vim中不移动光标的状况下移动屏幕? - How to move screen without moving cursor in Vim?

问题:

I recently discovered Ctrl + E and Ctrl + Y shortcuts for Vim that respectively move the screen up and down with a one line step, without moving the cursor . 最近,我发现了Vim的Ctrl + E和Ctrl + Y快捷键,它们分别以一个一行的步长上下移动屏幕, 而不移动光标 ide

Do you know any command that leaves the cursor where it is but moves the screen so that the line which has the cursor becomes the first line? 您是否知道有任何命令将光标留在原处但移动屏幕,使具备光标的行成为第一行? (having a command for the last line would be a nice bonus). (在最后一行输入命令会是一个不错的选择)。 this

I can achieve this by manually pressing Ctrl + E (or Ctrl + Y ) the proper number of times, but having a command that somehow does this directly would be nice. 我能够经过手动按Ctrl + E (或Ctrl + Y )适当的次数来实现此目的,可是使用某种能够直接执行此操做的命令会很好。 idea

Any ideas? 有任何想法吗? spa


解决方案:

参考一: https://stackoom.com/question/EVlJ/如何在Vim中不移动光标的状况下移动屏幕
参考二: https://oldbug.net/q/EVlJ/How-to-move-screen-without-moving-cursor-in-Vim
相关文章
相关标签/搜索