快捷键
打开命令面板
CTRL+SHIFT+P
搜索
CMD + P: 搜索文件名
选中
CMD + D: 选中鼠标所在词汇,多次按下后可选择其他行内的当前词汇
行操作
Alt(option) + Shift + arrow up/down: 向上或者向下复制一行
Option + arrow up/down: 将当前行向上或者向下移动一行
CMD + Shift + K: 删除当前一行
CMD + B: 控制左侧栏的显示与隐藏
Alt + ←:往前或往后跳到上一次的编辑位置
选择光标右侧或左侧的所有内容
分组:Ctrl + Alt +右箭头(Mac:Control + Option +右箭头)
选中:Windows: Ctrl + Shift + Home/End | Mac: command + Shift + Home/End
fn键+左方向键是HOME
fn键+右方向键是END
fn+上方向键是page up
fn+下方向键是page down
批量替换
Ctrl + F2 (Mac: command + F2)
跳转
Windows: Alt + ←
Mac: Ctrl + - ;Ctrl + Shift + -
左右括号之间跳转:
ctrl + shift + \
配制
- 用户设置(全局)工作区设置(项目)
提示显示
控制显示悬停等待时间
Hover:Delay
搜索:Delay,可更改许多提示时间
自动保存和自动格式化
"files.autoSaveDelay": 100,
"editor.formatOnSaveTimeout": 100,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
代码缩略图开、关
"editor.minimap.enabled": false,
代码长度提示线
"editor.rulers": [100],
双击选中变量,包含其$符
去掉$符后就可选中,加上就不会被选中
// 执行文字相关的导航或操作时将用作文字分隔符的字符
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",
排除文件
"files.exclude": {
"**/.idea": true,
"**/.vscode": true,
"**/.svn": true,
"**/.factorypath": true
}
插件
本地历史
Local History
"search.exclude": {
"**/.history": true
}
智能提示
PHP IntelliSense
// PHP基本设置与PHP智能感知
"php.suggest.basic": false,
"intelephense.completion.insertUseDeclaration": true,
调试
PHP Debug
Live Server
PHP 规范
vscode-phpcs,用于项目开发中 PHP 代码的编码规范。
系统需要安装 PHP_CodeSniffer
#安装
composer global require squizlabs/php_codesniffer
cd /Users/Macbook/.composer/vendor/bin
./phpcs --version
PHP_CodeSniffer version 3.5.4 (stable) by Squiz (http://www.squiz.net)
svn
安装后,
提交:结合自带的版本管理直接提交,第一次会让输入账号密码。
sftp
CTRL+SHIFT+P,输入sftp
{
"name": "dangjian_ipuxin_com",
"host": "19.23.38.14",
"protocol": "ftp",
"port": 21,
"username": "ian_ipuxin_com",
"password": "zxnYifBp3znTSDyf",
"remotePath": "/",
"syncMode": "update",
"uploadOnSave": true,
"ignore": [
".vscode",
".git",
".DS_Store"
],
"watcher": {
"files": "**/*",
"autoUpload": true,
"autoDelete": false
}
}
{
"name": "119.111.111.111",
"host": "119.111.111.111",
"protocol": "sftp",
"port": 22,
"username": "root",
"remotePath": "/www/wwwroot/simps.ipuxin.com",
"password": "123456",
"syncMode": "update",
"uploadOnSave": true,
"ignore": [
".vscode",
".git",
".DS_Store"
],
"watcher": {
"files": "**/*",
"autoUpload": true,
"autoDelete": false
}
}
高亮ENV
DotENV
PHP注释插件:PHP DocBlocker
??? 不会用,欢迎补充
css peek
html 内CSS跳转到CSS 对应的地方。
Auto Rename Tag
自动重命名标签
Code Spell Checker
拼写检查
让括号拥有独立的颜色,易于区分
Bracket Pair Colorizer
彩色括号
Rainbow Brackets
代码快照
Polacode-2019
Project Manager
多个项目之间切换的工具
TabNine
当然首推还是这一款基于GPT-2语言模型的自动补全工具,我在前面一篇文章中花了一篇文章对这款插件进行了介绍。在这里,我再次强烈推荐TabNine这款插件,哪怕你使用的不是vs code也可以尝试一下这款插件。
TabNine和我认识中的自动补全工具有很大的不同,传统的补全工具更多的是根据上下文信息和第三方库进行补全,换句话说就是基于既有的内容进行补全。而TabNine更多的是偏向推理,它能够根据开发者前面输入的内容快速推理接下来要输入的代码,甚至参数、字符串、符号它都能够准确的推理并补全。
TabOut
跳出右括号
Bookmarks
我们在开发过程中会经常进行跳转或者翻页,当经过一系列的跳转之后想回到最初的位置却发现无从下手了。在使用Pycharm时,可以通过快捷键给代码添加上标签,当我们想回到某一个位置时能够使用快捷键或者搜索的方式快速定位到准确的位置,这也是Pycharm吸引我的地方之一,它也养成了我喜欢打标签的习惯。
刚从Pycharm迁移到vs code在标签这一块会很不习惯,发现总是忘记之前所在代码片段。最后发现,vs code也可以通过配置插件实现强大的标签功能,这款插件就是Bookmarks。我们能够使用Ctrl+Alt+K、Ctrl+Alt+J、Ctrl+Alt+L快捷键添加标签,并且可以快速调整到指定标签位置。
GitLens
多人开始过程中,版本管理工具是必不可少的,其中使用较多的就是Git。它在日常开发中占据着非常重要的地位,因此版本管理在大多数开发工具中都是必备的功能之一。我之前一直使用Pycharm,我认为它在版本管理方面已经做的很好了,但是,经过一段时间试用GitLens之后才发现,Pycharm在Git版本管理方面对比于GitLens真的是相差甚远。
它能够清晰的显示当前文件 的修改时间、修改历史,能够可视化分支、作者、commit等信息,提供便捷而强大的对比功能。
TODO Highlight
我们在开发过程中,有时会为了测试或某种原因,某段代码需要之后进行修改和完善。如果就不做一些标记,时间久了、需要修改的多了,就很难区分出哪些是需要修改的、哪些是不需要修改的。因此养成做标记的好习惯对提升开发效率具有很大的帮助。
在开发过程中常用的待办标记有TODO和FIXME,在Pycharm中当我们使用这两个标记时它能够自动对其进行高亮显示,这样对于我们找到标记处非常方便。vs code可以通过安装TODO Highlight插件来实现,这样能够突出显示我们还有哪些内容有待完善,能够避免我们检查代码过程中遇到的麻烦。
Code Runner
这是一款支持C、C++、Java、Python等主流编程语言快速运行的插件,它能够便捷的运行当前活动页代码文件、能够运行选定代码段、运行自定义命令,对于调试代码具有很大的帮助。
问题
提示,格式化失效
F1,Restart XX
作者的配制:
{
"php.suggest.basic": false,
"python.pythonPath": "/usr/local/bin/python3.7",
"php.executablePath": "/usr/bin/php",
"php.validate.executablePath": "/usr/bin/php",
"java.errors.incompleteClasspath.severity": "ignore",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.idea": true,
"**/.vscode": true,
"**/.factorypath": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/tmp": true,
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/tmp/**": true,
"**/bower_components/**": true,
"**/dist/**": true
},
// 搜索排除的文件夹
"search.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.idea": true,
"**/.vscode": true,
"**/.svn": true,
"**/.factorypath": true,
"**/.history": true,
"**/application/index": true
},
// 控制是否在搜索中跟踪符号链接。
// 修复编辑器内存占用过大的问题
"search.followSymlinks": false,
"diffEditor.ignoreTrimWhitespace": false,
"remote.SSH.showLoginTerminal": true,
"window.zoomLevel": 0,
"files.autoSave": "afterDelay",
"gitlens.gitCommands.skipConfirmations": [
"fetch:command",
"stash-push:command",
"switch:command",
"push:command"
],
"gitee.access_token": "576905a50f6e0681545c0324c9c1b05a",
"git.enabled": true,
"git.path": "/usr/bin/git",
"files.autoSaveDelay": 300,
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
"files.maxMemoryForLargeFilesMB": 8096,
"editor.rulers": [
100
],
"git.autofetch": true,
"polacode.transparentBackground": true,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.find.autoFindInSelection": "multiline",
"explorer.confirmDragAndDrop": false,
"git.enableSmartCommit": true,
"files.autoGuessEncoding": true,
"explorer.confirmDelete": false,
// 文件头部注释
"fileheader.customMade": {
"Descripttion": "",
"version": "",
"Author": "sueRimn",
"Date": "Do not edit",
"LastEditors": "sueRimn",
"LastEditTime": "Do not Edit"
},
//函数注释
"fileheader.cursorMode": {
"name": "",
"test": "test font",
"msg": "",
"param": "",
"return": ""
},
// 执行文字相关的导航或操作时将用作文字分隔符的字符
"editor.wordSeparators": "`~!@#%^&*()()-=+[{]}\\|;::'\",.。<>/?",
"editor.fontSize": 14,
"editor.hover.delay": 1,
"go.formatTool": "goimports",
"go.useLanguageServer": true,
"go.goroot": "/usr/local/go",
"go.gopath": "/Users/Macbook/go",
"editor.hover.sticky": false,
"editor.hover.enabled": false,
"editor.smoothScrolling": true,
"editor.minimap.enabled": false,
"editor.quickSuggestionsDelay": 1,
"cSpell.spellCheckDelayMs": 1,
"C_Cpp.updateChannel": "Insiders",
"search.showLineNumbers": true,
"editor.lineNumbers": "off",
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"clang.diagnostic.delay": 100,
"python.analysis.diagnosticPublishDelay": 100,
"bookmarks.navigateThroughAllFiles": true,
"php.memoryLimit": "8000",
"workbench.activityBar.visible": true,
}