基本设置 🔗
0.使用快捷键组合【Ctrl+Shift+p】,在搜索框中输入“configure display language”,选择install
安装简体中文
- Auto Close Tag ,自动添加 HTML/XML 的闭合标签,像 Visual Studio IDE 或 Sublime Text 一样。
- Beautify,在 Visual Studio Code 中格式化 javascript 、JSON 、 CSS 、Sass,以及 HTML。
- GitLens 可以增强 VSCode 内置 Git 的功能。例如 commits 搜索,历史记录和显示的代码作者身份具体功能可以查看Feature list
- Git History - 显示提交历史记录的美丽图表等等
PHP环境 🔗
- php intelephense,PHP 的代码提示、补全、跳转定义、格式化插件,功能强大,无需配置;优秀,必装。
setting.json
添加如下配置
"php.suggest.basic": false, //禁用基本建议
"editor.quickSuggestions": { //在评论/注释中启用自动完成功能
"comments": true
},
- PHP DocBlocker,注释插件
- PHP Snippets from PHPStrom,使用和 PHPStrom 一样的快捷代码片段,pubf + tab?
- PHP Namespace Resolver,PHP 命名空间解析器;可以导入和扩展类;还可以排序。优秀,必装。
- Better Align,可以实现变量和数组的等号对齐。优秀,必装。
- php.validate.executablepath,配置成docker 容器中的php路径,办法
- 新建文件 Create a file named php in
你自己的路径
- 写入内容
#!/bin/bash docker exec -i --user=1000:1000 php7-vscode php "$@"
- 修改可执行
sudo chmod +x php
- php.validate.executablepath=
你自己的路径
/php
- 新建文件 Create a file named php in
go环境 🔗
- 设置代理 set GOPROXY=“https://goproxy.cn”
- vscode添加go插件
- 安装go-tools,command+shift+p,输入 go:install 选择 install/update tools
- Code Runer,运行代码
setting.json 🔗
{
"security.workspace.trust.untrustedFiles": "open",
//工作台
"workbench.iconTheme": "material-icon-theme",
"workbench.tree.indent": 22,
"workbench.tree.renderIndentGuides": "always",
"workbench.tree.expandMode": "doubleClick",
"workbench.preferredHighContrastColorTheme": "Monokai",
"workbench.preferredDarkColorTheme": "Monokai",
"workbench.preferredLightColorTheme": "Monokai",
"workbench.startupEditor": "none",
"workbench.editor.untitled.hint": "hidden",
"workbench.colorTheme": "Monokai",
"workbench.tree.horizontalScrolling": true,
"workbench.editor.enablePreview": false,
"workbench.editorAssociations": {
"*.html": "default"
},
//git
"git.autofetch": true,
"git.confirmSync": false,
"git.ignoreMissingGitWarning": true,
//终端
"terminal.integrated.fontSize": 16,
"terminal.integrated.tabs.enabled": true,
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.fontFamily": "Monaco",
"terminal.integrated.gpuAcceleration": "off",
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.snippetSuggestions": "top",
"editor.renderControlCharacters": true,
"editor.rename.enablePreview": false,
"editor.wordWrap": "on",
"editor.quickSuggestions": {
//注释中启用自动完成功能
"comments": true
},
"editor.minimap.renderCharacters": false,
"editor.mouseWheelZoom": true,
"editor.minimap.size": "fit",
"diffEditor.wordWrap": "on",
"alignment.operatorPadding": "right",
"alignment.indentBase": "dontchange",
"intelephense.telemetry.enabled": true,
"debug.console.lineHeight": 18,
"debug.console.fontSize": 14,
//php
"[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
},
"php.suggest.basic": false,
"intelephense.compatibility.correctForBaseClassStaticUnionTypes": false,
"php-docblocker.gap": false,
"php-docblocker.qualifyClassNames": true,
"php-docblocker.author": {
"name": "abner",
"email": "abnerxc666@gmail.com"
},
//go
"go.autocompleteUnimportedPackages": true,
"go.docsTool": "gogetdoc",
"go.testFlags": [
"-v",
"-count=1"
],
"go.languageServerFlags": [
"-remote=auto", "-logfile=auto", "-debug=:0", "-rpc.trace",
],
"go.buildTags": "",
"go.buildFlags": [],
"go.lintFlags": [],
"go.vetFlags": [],
"go.coverOnSave": false,
"go.useCodeSnippetsOnFunctionSuggest": false,
"go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
"go.useLanguageServer": true,
"go.formatTool": "goreturns",
"go.gocodeAutoBuild": false,
"go.gocodePackageLookupMode": "go",
"go.gotoSymbol.includeImports": true,
"go.formatOnSave": true,
"go.trace.server": "verbose",
"gopls": {
"analyses": {
"composites": false
},
"usePlaceholders": false,
},
"go.testTimeout": "1800s",
"go.toolsManagement.autoUpdate": true,
"go.alternateTools": { //禁用基本建议
},
"go.inferGopath": true,
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},
},
"[go.mod]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},
},
"explorer.confirmDelete": false,
"explorer.compactFolders": false,
//排除文件
"files.exclude": {
"/.classpath": true,
"/.project": true,
"/.settings": true,
"/.factorypath": true,
"/.idea": true,
"/.metadata": true,
"/.vscode": true,
"/.svn": true
},
"search.exclude": {
"/idea": true,
"/svn": true,
"/node_modules": true,
"/bower_components": true,
"/env": true,
"/venv": true
},
"files.autoSave": "afterDelay",
"files.associations": {
"*.vue": "html",
"*.module": "php"
},
"files.watcherExclude": {
"/.idea/": true,
"/.svn/": true,
"/.git/objects/": true,
"/.git/subtree-cache/": true,
"/node_modules/": true,
"/env/": true,
"/venv/": true,
"env-*": true
},
"editor.inlineSuggest.enabled": true,
"auto-rename-tag.activationOnLanguage": [
"html",
"xml",
"php",
"javascript"
],
"editor.minimap.enabled": false,
"window.zoomLevel": -1,
"editor.fontSize": 16,
"editor.bracketPairColorization.enabled": true,
}