快捷键
Expand Selection / Shrink Selection
Shift+Alt+Right
Shift+Alt+Left
https://code.visualstudio.com/updates/v1_33#_smart-select-api
折叠/展开区域
ctrl shift [
ctrl shift ]
调试
https://code.visualstudio.com/Docs/editor/debugging
VSCode launch.json中的各种替换变量的意思 ${workspaceFolder} ${file} ${fileBasename} ${fileDirname}等
https://blog.csdn.net/bat67/article/details/78302871
https://code.visualstudio.com/docs/editor/variables-reference
插件
- Beautify ( 代码格式化 )
https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify
https://gist.github.com/wzup/fc3254562236c1ec3f69
https://github.com/HookyQR/VSCodeBeautify/blob/master/Settings.md
{
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"],
"brace_style": "collapse,preserve-inline",
"end_with_newline": true,
"indent_char": " ",
"indent_handlebars": true,
"indent_inner_html": false,
"indent_scripts": "keep",
"indent_size": 2,
"max_preserve_newlines": 10,
"preserve_newlines": true,
"unformatted": ["a", "span", "img", "code", "pre", "sub", "sup", "em", "strong", "b", "i", "u", "strike", "big", "small", "pre", "h1",
"h2", "h3", "h4", "h5", "h6"
],
"wrap_attributes":"align-multiple",
"wrap_line_length": 0
},
"css": {
"allowed_file_extensions": ["css", "scss", "sass", "less"],
"end_with_newline": true,
"indent_char": " ",
"indent_size": 2,
"newline_between_rules": true,
"selector_separator": " ",
"selector_separator_newline": true,
"preserve_newlines": true,
"max_preserve_newlines": 10
},
"js": {
"allowed_file_extensions": ["js", "json", "jshintrc", "jsbeautifyrc"],
"brace_style": "collapse,preserve-inline",
"break_chained_methods": false,
"e4x": false,
"end_with_newline": false,
"indent_char": " ",
"indent_level": 0,
"indent_size": 2,
"indent_with_tabs": false,
"jslint_happy": false,
"keep_array_indentation": false,
"keep_function_indentation": false,
"max_preserve_newlines": 0,
"preserve_newlines": true,
"space_after_anon_function": true,
"space_before_conditional": true,
"space_in_empty_paren": false,
"space_in_paren": false,
"unescape_strings": false,
"wrap_line_length": 0
}
}
- GitLens ( 版本管理 )
https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
- VS Code JavaScript (ES6) snippets
https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets
Supported languages (file extensions)
• JavaScript (.js)
• TypeScript (.ts)
• JavaScript React (.jsx)
• TypeScript React (.tsx)
• Html (.html)
• Vue (.vue)
imp clg ….
- live server
.vscode/setting.json
{
"liveServer.settings.root": "/dist/"
}
路径搜索
https://code.visualstudio.com/docs/languages/jsconfig
根文件夹 jsconfig.json
{
"include": ["./src"],
"compilerOptions": {
"target": "es2016",
"sourceMap": true,
"baseUrl": ".",
"jsx": "react",
"moduleResolution": "node",
"paths": {
"*": ["src/*"]
}
},
"exclude": ["node_modules", "build"]
}
{
"compilerOptions": {
"target": "es6",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"components/*":["src/components/*"],
"common/*":["src/common/*"],
"modules/*":["src/modules/*"],
"assets/*":["src/assets/*"]
}
},
"exclude": ["node_modules", "dist"],
// "include": ["src/**/*"]
}
paths里面的路径对应webpack alias的路径, 写法和webpack alias稍微不一样
vue配置
https://github.com/vuejs/vetur/blob/master/docs/setup.md
https://github.com/vuejs/vetur/blob/master/docs/FAQ.md#vetur-cant-recognize-components-imported-using-webpacks-alias
编写插件
https://code.visualstudio.com/api
C / C++
一篇挺详细的教程, 照着配完就能用
https://www.zhihu.com/question/30315894/answer/154979413
关于调试配置等, 都有
以下两个都要装:
MinGW是将GCC编译器和GNU Binutils移植到Win32平台下的产物,包括一系列头文件(Win32API)、库和可执行文件。简而言之,MinGW是Windows下的GCC。
Clang是一个C、C++、Objective-C和Objective-C++编程语言的编译器前端。它采用了底层虚拟机(LLVM)作为其后端。它的目标是提供一个GNU编译器套装(GCC)的替代品。Clang性能优异,还能针对用户发生的编译错误准确地给出建议。
安装 MinGW-w64
解压后将 MinGW 文件夹复制到 C: 盘根目录。
添加 PATH 搜索路径 C:\MinGW\bin。
启动命令窗口,执行 gcc —version,看到 gcc 版本信息,则安装成功。
注 MinGW没更新了, 不要用MinGW, 要用MinGW-w64
MinGW-w64下载
http://mingw-w64.org/doku.php/download/win-builds (安装器, 还需要再下一堆东西, 很慢)
https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/ (直接下载解压)
安装 Clang
执行 LLVM 安装程序,并选择将 LLVM 添加到 PATH。
启动命令窗口,执行 clang -v,看到 clang 版本号,则安装成功。
https://github.com/zhuangbo/MinGW-and-Clang