【问题标题】:VS Code - keyboard shortcut to Move Cursor to the center of current screen After Keyboard ScrollingVS Code - 键盘滚动后将光标移动到当前屏幕中心的键盘快捷键
【发布时间】:2019-08-09 19:33:32
【问题描述】:

使用键盘 (Ctrl+UpArrow/DownArrow) 在编辑器中滚动后,光标可能会停留在原来的位置5-10个屏幕回来。

是否有命令将光标移动到我正在查看的当前屏幕的中心,以便我可以编辑我正在查看的任何内容?

我可以执行“Go To Line”(Ctrl+G,然后输入行号),但我正在寻找单键键盘快捷键。

【问题讨论】:

    标签: visual-studio-code keyboard-shortcuts


    【解决方案1】:

    在你的 keybindings.json 中试试这个:

    {
      "key": "alt+m",           // or whatever binding you choose
      "command": "cursorMove",
      "args": {
          "to": "viewPortCenter"
      }
    }
    

    如果需要,另请参阅:to automatically move cursor as you scroll

    【讨论】:

    • 顺便说一下,我已将其设置为 Ctrl+Shift+Insert - 接近 Ctrl+Up/Down。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-10-13
    • 2017-08-28
    • 1970-01-01
    • 1970-01-01
    • 2021-04-29
    • 1970-01-01
    • 2012-08-08
    相关资源
    最近更新 更多