本文介绍了vscode:如何设置当我按 CTRL + 向上或向下箭头时,光标随页面移动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,当我按 + 或 箭头时,光标到达页面,因此当我释放 按钮时,页面会碰撞"到光标所在的位置.

my problem is that when I press + or arrow, the cursor doesn't move when it reaches the border of the page, and therefore when I release the button, the page "bumps" to where the cursor is.

是否可以改变这种行为?例如,在 Visual Studio 中,如果按 + 箭头,光标将锚定"到页面顶部.

Is it possible to change this behaviour? For example in Visual Studio, the cursor is "anchored" to the top of the page if you press + arrow.

提前致谢

推荐答案

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

There is a workaround. Edit your keybinding.json and add this...

{
    "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
    }
}

这篇关于vscode:如何设置当我按 CTRL + 向上或向下箭头时,光标随页面移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 03:41