vscode:如何设置当我按 CTRL + 向上或向下箭头时,光标随页面移动?

Luc*_*uca 7 visual-studio-code vscode-settings

我的问题是,当我按下CTRL+updown箭头时,光标到达页面边框时不会移动,因此当我松开CTRL按钮时,页面会“撞击”到光标所在的位置。

是否有可能改变这种行为?例如,在 Visual Studio 中,如果按CTRL+down箭头,光标将“锚定”到页面顶部。

提前致谢

小智 10

有一个解决方法。编辑你的 keybinding.json 并添加这个...

{
    "key": "ctrl+up",
    "command": "editorScroll",
    "when": "editorTextFocus",
    "args": 
    {
        "to": "up",
        "by": "line",
        "revealCursor": true
    }
},
{
    "key": "ctrl+down",
    "command": "editorScroll",
    "when": "editorTextFocus",
    "args": 
    {
        "to": "down",
        "by": "line",
        "revealCursor": true
    }
}
Run Code Online (Sandbox Code Playgroud)