目的:旨在操作舒适,适合自我,自由搭配
如何替换快捷键
操作路径:
左下角设置 -> 键盘快捷键方式 -> 搜索(如 editor.action.changeAll
)
常用快捷键
- 替换相同变量(会全局替换)
{
"key": "shift+f6",
"command": "editor.action.changeAll",
"when": "editorTextFocus && !editorReadonly"
}
同步修改变量
- 重构-替换方法名
{
"key": "f2",
"command": "editor.action.rename",
"when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
}
替换方法名
- 转大写
{
"key": "shift+cmd+u",
"command": "editor.action.transformToUppercase"
}
- 转小写
{
"key": "shift+cmd+d",
"command": "editor.action.transformToLowercase"
}
- 转驼峰命名
{
"key": "shift+cmd+j shift+cmd+u",
"command": "editor.action.transformToCamelcase"
}
- 转首字母大写
{
"key": "shift+cmd+g shift+cmd+u",
"command": "editor.action.transformToTitlecase"
}
- 多光标修改
option+鼠标左键 点点点
快速切换已打开文件
Ctrl+Tab文件行跳转
Ctrl + g
行跳转
- 符号跳转-内部方法名+参数
{
"key": "cmd+k shift+o",
"command": "workbench.action.compareEditor.openSide",
"when": "inDiffEditor"
}
- 定义和实现间跳转
{
"key": "cmd+f12",
"command": "editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && isWeb"
}
{
"key": "cmd+f12",
"command": "editor.action.goToImplementation",
"when": "editorHasImplementationProvider && editorTextFocus"
}
- 跳转引用
{
"key": "shift+f12",
"command": "editor.action.goToReferences",
"when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
}
跳转到引用
- 折叠代码
{
"key": "alt+cmd+[",
"command": "notebook.fold",
"when": "notebookEditorFocused && !inputFocus && activeEditor == 'workbench.editor.notebook'"
}
{
"key": "alt+cmd+[",
"command": "editor.fold",
"when": "editorTextFocus && foldingEnabled"
}
- 展开折叠代码
{
"key": "alt+cmd+]",
"command": "notebook.unfold",
"when": "notebookEditorFocused && !inputFocus && activeEditor == 'workbench.editor.notebook'"
}
{
"key": "alt+cmd+]",
"command": "editor.unfold",
"when": "editorTextFocus && foldingEnabled"
}
- 减少缩进
{
"key": "cmd+[",
"command": "editor.action.outdentLines",
"when": "editorTextFocus && !editorReadonly"
}
- 增加缩进
{
"key": "cmd+]",
"command": "editor.action.indentLines",
"when": "editorTextFocus && !editorReadonly"
}
- 分屏快捷键
快捷键:
cmd + \
- 分屏后切换 Tab
快捷键:
cmd + 1、cmd + 2、cmd + 3
19.往后切换修改位置
{
"key": "alt+cmd+left",
"command": "workbench.action.navigateBack",
"when": "canNavigateBack"
}
20.向后切换修改位置
{
"key": "alt+cmd+right",
"command": "workbench.action.navigateForward",
"when": "canNavigateForward"
}