[英]VSCode jump to the middle of current line
Visual Studio Code 中有许多键盘快捷键和编辑选项,我可以将 cursor:按字符、按单词、移至行首/行尾。 但是,如果我正在编辑一长行文本,如何更快地跳转到这一行的中间?
在这里找到了类似的问题,但对于 vim 用户 - 视觉上 select 到行的中间
可能,可以使用Vim扩展来实现此选项(跳转到中间)。 如果是这样,那该怎么做?
有没有办法在没有任何扩展的情况下原生地做出这种行为?
实际上,这是 vscode 内置的,使用cursorMove
命令。 在您的keybindings.json
中设置此键绑定:
{
"key": "alt+c",
"command": "cursorMove",
"args": {
"to": "wrappedLineColumnCenter",
"select": true // default is false
}
}
您可以创建一个键绑定来计算新的 cursor position
{
"key": "ctrl+i ctrl+m", // or any other key binding
"when": "editorTextFocus",
"command": "moveby.calculation",
"args": {
"charNrEx": "currentLine.length / 2"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.