visual-studio-code - VS Code - 键盘滚动后将光标移动到当前屏幕中心的键盘快捷键

标签 visual-studio-code keyboard-shortcuts

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

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

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

最佳答案

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

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

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

关于visual-studio-code - VS Code - 键盘滚动后将光标移动到当前屏幕中心的键盘快捷键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57436122/

相关文章:

delphi - 捕获 CTRL + S 时如何摆脱 Windows 声音?

R Shiny -启用键盘快捷键?

keyboard-shortcuts - 如何更改 ReSharper 中给定命令的快捷键?

vscode 和 Visual Studio 之间的正则表达式差异

azure - VSCode 中的 Python Azure Function (HTTPTrigger) 调试未正确启动 Func Host Start

visual-studio-code - Visual Studio Code - 灯泡未出现

c# - 当应用程序未获得焦点时监听键

javascript - Electron 需要模块 : due to diffrent working directory while runtime intellisense is not working

rust - 如何让 VS Code 构建和运行 Rust 程序?

visual-studio-2013 - 新文件模板的 Resharper 快捷方式