vscode配置php php-cs,VSCode常用插件和快捷键总结

本文详细列举了Visual Studio Code的常用快捷键和插件配置,包括文件切换、代码格式化、侧边栏操作、代码追踪、代码注释等功能。此外,还介绍了如TodoTree、CodeSpellChecker、GitLens等实用插件的设置,以及如何配置代码运行环境、调试器和代码风格。通过这些设置,可以显著提升开发效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

快捷键

切换打开的文件:Ctrl + 数字键

format格式化代码:Ctrl + Shit + L

打开/关闭侧边栏:Ctrl + B

打开终端等面板: command + J

搜索配置、插件、编辑器相关:F1(command + t后,去掉#,改成>)

搜索:F1/command+T,带箭头搜索编辑器,去掉小箭头后搜索代码文件

跳转到指定行:Ctrl + G,输入框输入指定行数,自动跳转

代码追踪:command + 鼠标左键

代码追踪返回:Ctrl + -

代码追踪前进:Ctrl + shift + -

调整代码大小:command + -/+

打开快捷键配置:按下command + k后,再按command + s

关闭当前文件:command + w

选中代码左移动:command + [

选中代码右移:command + ]

全部折叠:command + k + command +0

全部打开:command + k + command + j

切换当前折叠:command + k + command + l

代码注释:command + / (更改后)

koroFileHeader文件注释:ctrl + command + i

koroFileHeader函数注释:ctrl + command + t

跳转顶/底部:command + ⬆️/⬇️

扩展

Chinese (Simplified) Language Pack for Visual Studio Code:编辑器中文

Todo Tree:配置勾选Show Badges(文件图标类型区分), Show In Explorer(工作区显示),Show Counts In Tree(目录显示总数)

Todo Highlight:代码中高亮显示

代码和背景:Flatland Monkai

目录图标:VSCode Icons Mac

Code Runner:多种语言运行环境

Go

C/C++

Python

PHP Extension Pack:(扩展)

PHP IntelliSense:(变量和语法错误提示)

PHP Intelephense:语法和未定义变量

PHP Tools for VS Code(php工具包)

php cs fixer(需要brew install php-cs-fixer)

PHP Formatter(格式化代码PSR2)

PHP Snippets 输入p. 联想php方法和变量等

PHP Debug:PHP调试

JavaScript (ES6) code snippets:JS支持

HTML CSS Support:HTML/CSS支持

IntelliSense for CSS class names in HTML:CSS/HTML代码提示

Visual Studio Intellicode:代码提示

php-lint:PHP错误检测

Code Spell Checker:单词拼写检查

注释:koroFileHeader

GitLens:点击某一行显示上次提交人和备注

Git History:右键某个文件,看历史提交

代码DEBUG配置举例

{

// Use IntelliSense to learn about possible attributes.

// Hover to view descriptions of existing attributes.

// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

"version": "0.2.0",

"configurations": [

{

"name": "Launch",

"type": "go",

"request": "launch",

"mode": "debug",

"program": "/Users/why/Desktop/go/gin-frame/main.go",

"env": {},

"args": []

}

]

}

settings

{

"phpformatter.pharPath": "/usr/local/bin/php-cs-fixer", //本机的php-cs-fixer执行文件路径

"phpformatter.arguments": ["--rules=@PSR2"],

"editor.formatOnPaste": false,

"editor.formatOnSave": false,

"editor.formatOnType": true,

"window.zoomLevel": 0,

"editor.fontWeight": "300",

"editor.parameterHints": true,

"editor.quickSuggestions": {

"other": true,

"comments": true,

"strings": true

},

"errorSquiggles": true,

"window.openFilesInNewWindow": "on",

"window.openFoldersInNewWindow": "on",

"workbench.colorTheme": "Flatland Monokai",

"workbench.iconTheme": "vscode-icons-mac",

"workbench.editor.enablePreview": false, //关闭预览模式,打开新文件新开窗口

"emmet.includeLanguages": {},

"todo-tree.tree.showCountsInTree": true,

"go.formatTool": "goimports",

"window.openWithoutArgumentsInNewWindow": "on",

"[json]": {},

"launch": {},

"css.remoteStyleSheets": [],

"php.validate.executablePath": "/usr/bin/php",

"php.validate.enable": false,

"php.executablePath": "/usr/bin/php",

"code-runner.runInTerminal": true,

//文件注释

"fileheader.customMade": {

//"Descripttion": "",

"Author": "weihaoyu"

//"CreatedTime": "Do not edit"

//"LastEditTime": "Do not Edit"

},

//函数注释

"fileheader.cursorMode": {

//"description": "",

//"param": "",

"author": "weihaoyu"

//"return": ""

},

//注释配置项

"fileheader.configObj": {

"autoAdd": false, // 检测文件没有头部注释,自动添加文件头部注释

"autoAddLine": 100, // 文件超过多少行数 不再自动添加头部注释

"autoAlready": true, // 只添加插件支持的语言以及用户通过`language`选项自定义的注释

// 自动添加头部注释黑名单

"prohibitAutoAdd": ["json"],

"prohibitItemAutoAdd": [

"项目的全称禁止项目自动添加头部注释, 使用快捷键自行添加"

],

"wideSame": false, // 头部注释等宽设置

"wideNum": 13, // 头部注释字段长度 默认为13

// 头部注释第几行插入

"headInsertLine": {

"php": 2 // php文件 插入到第二行

},

"beforeAnnotation": {}, // 头部注释之前插入内容

"afterAnnotation": {}, // 头部注释之后插入内容

"specialOptions": {}, // 特殊字段自定义

"switch": {

"newlineAddAnnotation": true // 默认遇到换行符(\r\n \n \r)添加注释符号

},

"moveCursor": true, // 自动移动光标到Description所在行

"dateFormat": "YYYY-MM-DD HH:mm:ss",

"atSymbol": "@", // 更改所有文件的自定义注释中的@符号

"atSymbolObj": {}, // 更改单独语言/文件的@

"colon": ": ", // 更改所有文件的注释冒号

"colonObj": {}, // 更改单独语言/文件的冒号

"filePathColon": "路径分隔符替换", // 默认值: mac: / window是: \

"showErrorMessage": false, // 是否显示插件错误通知 用于debugger

"CheckFileChange": false, // 单个文件保存时进行diff检查

"createHeader": true, // 新建文件自动添加头部注释

"useWorker": false, // 是否使用工作区设置

"designAddHead": false, // 添加注释图案时添加头部注释

// 自定义语言注释符号,覆盖插件的注释格式

"language": {

"java": {

"head": "/$$",

"middle": " $ @",

"end": " $/"

},

// 一次匹配多种文件后缀文件 不用重复设置

"h/hpp/cpp": {

"head": "/*** ", // 统一增加几个*号

"middle": " * @",

"end": " */"

},

// 针对有特殊要求的文件如:test.blade.php

"blade.php": {

"head": ""

}

},

// 默认注释 没有匹配到注释符号的时候使用。

"annotationStr": {

"head": "/*",

"middle": " * @",

"end": " */",

"use": false

}

},

"C_Cpp.errorSquiggles": "Enabled",

"editor.suggestSelection": "first",

"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",

"breadcrumbs.enabled": true,

"editor.renderWhitespace": "all",

"editor.minimap.enabled": false,

"editor.showUnused": true,

"workbench.colorCustomizations": {

"editorUnnecessaryCode.border": "#DCDCDC"

},

"[php]": {

"editor.defaultFormatter": "Sophisticode.php-formatter"

},

"[go]": {

"editor.snippetSuggestions": "none",

"editor.formatOnSave": true,

"editor.codeActionsOnSave": {

"source.organizeImports": true

}

},

"files.eol": "\n", // formatting only supports LF line endings

"go.languageServerExperimentalFeatures": {

"format": true,

"autoComplete": true,

"rename": true,

"goToDefinition": true,

"hover": true,

"signatureHelp": true,

"goToTypeDefinition": true,

"goToImplementation": true,

"documentSymbols": true,

"workspaceSymbols": true,

"findReferences": true,

"diagnostics": false

},

"emmet.excludeLanguages": ["markdown"],

"[jsonc]": {

"editor.defaultFormatter": "esbenp.prettier-vscode"

}

}

本文地址:https://blog.csdn.net/why444216978/article/details/106933095

希望与广大网友互动??

点此进行留言吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值