目前见过最快的编辑器是vim,看到大佬使用vim的输入速度,瞬间献下膝盖。
然后在vscode里找到了,vim插件,经过一番折腾,在入门之后,果断放弃。
原因是和现在的编辑习惯相差太大,且经常造成编辑器卡顿。所以,编辑器不是目的,快速输入才是目的,那通过设置快捷键,能不能达到类似vim的输入速度,经过一番尝试,不能达到,但是可以基本接近。
下面的快捷键设置,保留了编辑器原有快捷键,配合alt键的使用,可以让大部分操作手腕移动距离很小,就能实现方向切换,复制粘贴剪切,回到上一个编辑位置,选中上/下一个匹配项,选中行,删除行,代码折叠,智能选择,选中到行首/尾,插入上/下一行,单词键切换/选中等等。
// Place your key bindings in this file to override the defaultsauto[]
[
// {
// "key": "enter",
// "command": "type",
// "args": { "text": "Hello World" },
// "when": "editorTextFocus"
// },Hello World
{
"key": "ctrl+'",
"command": "editor.action.insertSnippet",
"args": {
"snippet": "<body>【$TM_SELECTED_TEXT$0】</body>",
},
"when": "editorTextFocus"
},
{
"key": "alt+'",
"command": "editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+shift+backspace",
"command": "editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+a",
"command": "editor.action.selectToBracket"
},
{
"key": "alt+i",
"command": "cursorUp",
"when": "textInputFocus"
},
{
"key": "alt+j",
"command": "cursorLeft",
"when": "textInputFocus"
},
{
"key": "shift+alt+j",
"command": "cursorColumnSelectLeft",
"when": "textInputFocus && editorColumnSelection"
},
{
"key": "shift+alt+j",
"command": "cursorLeftSelect",
"when": "textInputFocus"
},
{
"key": "shift+alt+l",
"command": "cursorRightSelect",
"when": "textInputFocus"
},
{
"key": "shift+alt+l",
"command": "cursorColumnSelectRight",
"when": "textInputFocus && editorColumnSelection"
},
{
"key": "shift+alt+k",
"command": "cursorDownSelect",
"when": "textInputFocus"
},
{
"key": "shift+alt+n",
"command": "cursorUpSelect",
"when": "textInputFocus"
},
{
"key": "alt+y",
"command": "editor.action.clipboardCopyAction"
},
{
"key": "alt+p",
"command": "editor.action.clipboardPasteAction"
},
{
"key": "shift+alt+d",
"command": "editor.action.copyLinesDownAction",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+d",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+m",
"command": "editor.action.clipboardCutAction"
},
{
"key": "alt+n",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "alt+u",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+alt+l",
"command": "cursorWordEndRightSelect",
"when": "textInputFocus"
},
{
"key": "alt+q",
"command": "cursorWordLeft",
"when": "textInputFocus"
},
{
"key": "alt+w",
"command": "cursorWordRight",
"when": "textInputFocus"
},
{
"key": "alt+enter",
"command": "editor.action.insertLineAfter",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+shift+enter",
"command": "editor.action.insertLineBefore",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+alt+j",
"command": "cursorWordLeftSelect",
"when": "textInputFocus"
},
{
"key": "alt+l",
"command": "cursorRight",
"when": "textInputFocus"
},
{
"key": "alt+backspace",
"command": "deleteWordLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+shift+[",
"command": "editor.fold",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "alt+shift+]",
"command": "editor.unfold",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "alt+k",
"command": "cursorDown",
"when": "textInputFocus"
},
{
"key": "ctrl+shift+alt+left",
"command": "-cursorColumnSelectLeft",
"when": "textInputFocus"
},
{
"key": "alt+o",
"command": "editor.action.moveSelectionToPreviousFindMatch"
},
{
"key": "alt+b",
"command": "editor.action.moveSelectionToNextFindMatch"
},
{
"key": "alt+oem_3",
"command": "workbench.action.navigateBack"
},
{
"key": "alt+left",
"command": "workbench.action.navigateBack"
},
{
"key": "shift+alt+right",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "alt+[",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "alt+]",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
{
"key": "shift+alt+left",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
}
]