vsCode 常用快捷键
多光标编辑
- 选择块:
Shift+directionArrow
- 添加多个光标:
Alt+Click
行操作
- 复制粘贴行:
Shift+Alt+Down/UpArrow
- 移动行:
Alt+Down/UpArrow
- 删除行:
Ctrl+Shift+K
在整个项目中重命名变量或函数名
光标处于要修改的变量中,F2
格式化文件
Shift+Alt+F
代码折叠展开
- 折叠:
Ctrl+Shift+[
- 展开:
Ctrl+Shift+]
- 全部折叠:
Ctrl+K Ctrl+0
- 全部展开:
Ctrl+K Ctrl+J
预览整个文件的错误
F8
代码片段
- 使用:输入关键词,出现提示后选择
- 除了内置的代码片段,还可 自定义代码片段
注意:若要 markdown 代码片段生效,需在setting.json
中添加editor.quickSuggestions: true
全局作用域 vue3.js.store.modules.code-snippets
{
"Create Vue3 store modules": {
"scope": "javascript,typescript",
"prefix": "mod",
"body": [
"const state = {}",
"const getters = {}",
"const mutations = {}",
"const actions = {}",
"",
"export default {",
"\tnamespaced: true,",
"\tstate,",
"\tgetters,",
"\tmutations,",
"\tactions",
"}",
"",
],
"description": "Create Vue3 store modules"
}
}
特定文件作用域 markdown.json
{
"Create code block": {
"prefix": "code block",
"body": [
"```${1:html}",
"${2:code content}",
"```",
],
"description": "Create code block"
},
"Create fold code block": {
"prefix": "code fold",
"body": [
"",
"\t${1:Click me}
",
"\t",
"\t\t",
"\t\t\t${2:code content}",
"\t\t
",
"\t
",
"",
],
"description": "Create code fold"
},
"Create hyperlink": {
"prefix": "link",
"body": [
"[${1:showText}](${2:linkURL}\t'${3:hoverText}')"
],
"description": "Create hyperlink"
}
}
Emmet
JS 类型检查
- javascript 类型检查
- 检查某个文件:在文件头部添加
// @ts-check
- 在 workspace 或设置中检查:添加
"js/ts.implicitProjectConfig.checkJs": true
- 忽略某个文件:
// @ts-nocheck
添加注释
Ctrl+/
打开终端
Ctrl+`
版本管理
- 打开源代码管理:
Ctrl+Shift+G
- 源代码管理文档
参考来源:vsCode PlayGround
本文来自博客园,作者:shayloyuki,转载请注明原文链接:https://www.cnblogs.com/shayloyuki/p/17072897.html
posted on 2023-01-29 15:52 shayloyuki 阅读(83) 评论(0) 编辑 收藏 举报