vim - 如何在Vim中不移动光标的情况下左右移动屏幕或使其水平居中?

标签 vim

之后在线粘贴时,我的窗口显示文档的最右边部分(列> 80)。

将光标留在当前位置后,如何将屏幕水平居中放置。或者,我可以将屏幕向左移动一半屏幕宽度,避免像例如44zh

虽然标题不是特定的,但所有答案只能向上/向下移动:
How to move screen without moving cursor in Vim?

最佳答案

我不知道将屏幕围绕光标水平居中,但只要将屏幕向左/向右移动半个屏幕,就可以尝试这样做(来自:help scroll-horizontal)

zL          Move the view on the text half a screenwidth to the
            right, thus scroll the text half a screenwidth to the
            left.  This only works when 'wrap' is off.  {not in
            Vi}


zH          Move the view on the text half a screenwidth to the
            left, thus scroll the text half a screenwidth to the
            right.  This only works when 'wrap' is off.  {not in
            Vi}

关于vim - 如何在Vim中不移动光标的情况下左右移动屏幕或使其水平居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43915661/

相关文章:

linux - VIM 中的交互式终端

Vim 问题,在选定的行上应用了复制粘贴宏

Vim 和带括号/大括号的缩进

Vim 快速修复和远程编译

vim - 将键映射到自身和另一个键而不覆盖键的先前映射

vim - 例如从 vim 复制到 stackoverflow

objective-c - 使用 Objective-c 替代 Ctags/Cscope?

ubuntu - Vim 映射错误。 <A-j> 的映射导致在 ë 中的映射在 ubuntu 19.10 eoan

vim - 如何在 Windows 7 中关闭 gvim 中的所有字体提示?

vim - 添加行的快捷方式