gpt4 book ai didi

visual-studio-code - Visual Studio Code : How to define key bindings for page-home and page-end

转载 作者:行者123 更新时间:2023-12-05 06:33:10 25 4
gpt4 key购买 nike

在编写代码时,我经常发现自己需要跳转到文件的顶部或底部,但我找不到通过一次按键即可快速完成此操作的方法。我试图在键绑定(bind)中定义一个快捷方式,但我找不到像“page-home”和“page-end”这样的功能。我打算使用带有主页按钮的 alt 键跳转到页面顶部,并使用 alt+end 跳转到底部。

即我期望能够定义说:

{ "key": "alt+home", "command": "[what is page home command]", "when": "terminalFocus"}

那么,是否有这样的函数 page-home/page-end (我可能有这个错误,也许它被定义为其他东西)。

我发现了一个绑定(bind)到“workbench.action.terminal.scrollToTop”的“cmd+home”绑定(bind),这听起来像是正确的函数(和“cmd+end”的类似函数),但它们不是工作。

更新:我已经尝试通过键绑定(bind)页面,通过定义我之前提到的击键来对键绑定(bind)应用更改,但它仍然不起作用。除非我做错了什么,否则我 .认为有一个错误需要报告,除非有人另有说明。

谢谢。

最佳答案

答案在this GitHub post中.您要查找的命令是 cursorTopcursorBottom

打开命令选项板(CTRL + SHIFT + P 在 Windows 上)并选择 Preferences: Open Keyboard Shortcuts File

keybindings.json 中添加以下设置:

{
"key": "ctrl+home",
"command": "cursorTop",
"when": "editorTextFocus"
},
{
"key": "ctrl+end",
"command": "cursorBottom",
"when": "editorTextFocus"
}

用您喜欢的任何快捷方式替换该键。

关于visual-studio-code - Visual Studio Code : How to define key bindings for page-home and page-end,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50887550/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com