vscode常用指令

作者: Nenezsnp | 来源:发表于2025-02-28 16:29 被阅读0次

目的:旨在操作舒适,适合自我,自由搭配

如何替换快捷键

操作路径
左下角设置 -> 键盘快捷键方式 -> 搜索(如 editor.action.changeAll


常用快捷键

  1. 替换相同变量(会全局替换)
{
  "key": "shift+f6",
  "command": "editor.action.changeAll",
  "when": "editorTextFocus && !editorReadonly"
}
同步修改变量
  1. 重构-替换方法名
{
  "key": "f2",
  "command": "editor.action.rename",
  "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
}
替换方法名
  1. 转大写
{
  "key": "shift+cmd+u",
  "command": "editor.action.transformToUppercase"
}
  1. 转小写
{
  "key": "shift+cmd+d",
  "command": "editor.action.transformToLowercase"
}
  1. 转驼峰命名
{
  "key": "shift+cmd+j shift+cmd+u",
  "command": "editor.action.transformToCamelcase"
}
  1. 转首字母大写
{
  "key": "shift+cmd+g shift+cmd+u",
  "command": "editor.action.transformToTitlecase"
}
  1. 多光标修改

option+鼠标左键 点点点

  1. 快速切换已打开文件
    Ctrl+Tab

  2. 文件行跳转
    Ctrl + g

行跳转
  1. 符号跳转-内部方法名+参数
{
  "key": "cmd+k shift+o",
  "command": "workbench.action.compareEditor.openSide",
  "when": "inDiffEditor"
}
  1. 定义和实现间跳转
{
  "key": "cmd+f12",
  "command": "editor.action.revealDefinition",
  "when": "editorHasDefinitionProvider && editorTextFocus && isWeb"
}
{
  "key": "cmd+f12",
  "command": "editor.action.goToImplementation",
  "when": "editorHasImplementationProvider && editorTextFocus"
}
  1. 跳转引用
{
  "key": "shift+f12",
  "command": "editor.action.goToReferences",
  "when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
}
跳转到引用
  1. 折叠代码
{
  "key": "alt+cmd+[",
  "command": "notebook.fold",
  "when": "notebookEditorFocused && !inputFocus && activeEditor == 'workbench.editor.notebook'"
}
{
  "key": "alt+cmd+[",
  "command": "editor.fold",
  "when": "editorTextFocus && foldingEnabled"
}
  1. 展开折叠代码
{
  "key": "alt+cmd+]",
  "command": "notebook.unfold",
  "when": "notebookEditorFocused && !inputFocus && activeEditor == 'workbench.editor.notebook'"
}
{
  "key": "alt+cmd+]",
  "command": "editor.unfold",
  "when": "editorTextFocus && foldingEnabled"
}
  1. 减少缩进
{
  "key": "cmd+[",
  "command": "editor.action.outdentLines",
  "when": "editorTextFocus && !editorReadonly"
}
  1. 增加缩进
{
  "key": "cmd+]",
  "command": "editor.action.indentLines",
  "when": "editorTextFocus && !editorReadonly"
}
  1. 分屏快捷键

快捷键:
cmd + \

  1. 分屏后切换 Tab

快捷键:
cmd + 1、cmd + 2、cmd + 3

相关文章

网友评论

    本文标题:vscode常用指令

    本文链接:https://www.haomeiwen.com/subject/vcctmjtx.html