Visual Studio Code 安装插件等使用问题

1.安装

vscode 官网下载安装包安装即可

2.插件

点击左侧栏extensions,输入插件名,点击install

  1. Chinese (Simplified) Language Pack for Visual Studio Code — (简体中文的语言包)
  2. Php Debug — (php配合x-debug扩展的调试工具)
  3. PHP DocBlocker — (php写注释比较好)
  4. PHP Extension Pack (和5,6一样是php自动提示工具)
  5. PHP IntelliSense
  6. PHP Intellisense – Crane
  7. PHP Namespace Resolver (自动use命名空间)
  8. PHP Server (启动一个简易的PHP server)
  9. Project Manager (项目包扩展)
  10. sftp (远程同步工具)
  11. vetur (vue必选的插件)
  12. vscode-icons (vscode目录图表的插件)
  13. Python (python支持插件)

3.常用的开发环境配置

所以有三种方式更改默认的设置:
– 使用编辑器直接打开setting.json文件;
– 点击 VS Code 的 文件 > 首选项 > 设置 ,可以打开设置面板;
– 在 VS Code 中使用 Ctrl+Shift+P打开命令面板,输入Preferences: Open User Settings或Preferences: Open Workspace Settings。

setting.json

{
    // 工作台使用的图标主题
    "workbench.iconTheme": "vscode-icons",
    // 工作台主题
    "workbench.colorTheme": "GitHub Plus",
    // 控制台是否可见
    "workbench.activityBar.visible": false,
    // 设置行尾字符
    "files.eol": "\n",
    // 删除文件是否需要确定
    "explorer.confirmDelete": false,
    // 资源管理器拖动文件是否需要确定
    "explorer.confirmDragAndDrop": false,
    // 编辑区的字体大小
    "editor.fontSize": 18,
    // 自动换行
    "editor.wordWrap": "on",
    // 控制是否在打开文件时,基于文件内容自动检测 `editor.tabSize#` 和 `#editor.insertSpaces`。
    "editor.detectIndentation": true,
    // 按 `Tab` 键时插入空格。该设置在 `editor.detectIndentation` 启用时根据文件内容可能会被覆盖。
    "editor.insertSpaces": true,
    // 一个制表符等于的空格数。在 `editor.detectIndentation` 启用时,根据文件内容,该设置可能会被覆盖。
    "editor.tabSize": 4,
    // 控制是否显示小地图
    "editor.minimap.enabled": false,
    // 按住 `Ctrl` 键并滚动鼠标滚轮时对编辑器字体大小进行缩放。
    "editor.mouseWheelZoom": true,
    // 配置默认使用的设置编辑器。
    //  - ui: 使用设置 ui 编辑器。
    //  - json: 使用 json 文件编辑器。
    "workbench.settings.editor": "json",
    // 资源管理区不显示
    "files.exclude": {
        "**/*.pyc": true
    },
    "search.exclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/vendor": true,
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true
    },
    // 控制终端的字体系列,默认为 `editor.fontFamily` 的值。
    "terminal.integrated.fontFamily": "",
    // 设置默认终端
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe",
}

4.常用的sftp插件配置:

快捷键 ctrl+shift+P 打开指令窗口,输入sftp:config,回车,生成sftp.json的配置文件

{
    "host": "ip地址",
    "port": 22,
    "username": "登录名",
    "password": "登录密码",
    "protocol": "sftp", 
    "agent": null,
    "privateKeyPath": null, 
    "passphrase": null, 
    "passive": false, 
    "interactiveAuth": true,
    "remotePath": "需要打到的远程的文件夹地址",
    "uploadOnSave": true, // 保存的时候是否自动上传
    "syncMode": "update",
    "ignore": [
        // 忽略文件
        "**/.vscode/**",
        "**/.git/**",
        "**/.DS_Store"
    ],
    "watcher": { //监听外部文件
        "files": "glob",
        "autoUpload": true,
        "autoDelete": true
    },
    "profiles": {
        // 配置不同的环境
        "dev": {
            "host": "ip地址",
            "port": 22,
            "username": "登录名",
            "password": "登录密码",
        },
        "prod": {
            "host": "ip地址",
            "port": 22,
            "username": "登录名",
            "password": "登录密码",
        }
    },
    // 默认选择的环境
    "defaultProfile": "dev"

}


4.常用的编辑器配置:

显示tab和空格字符
  a 打开setting,在搜索框中输入renderControlCharacters,选中勾选框,即可显示tab.
  b 在搜索框中输入renderWhitespace,选择all,即可显示空格.


5.pylint配置:

“python.linting.pylintPath”: “D:/Python27/Scripts/pylint.exe”,
“python.pythonPath”: “D:/Python27/python.exe”,
// 默认使用pylint对Python文件进行静态检查
“python.linting.pylintEnabled”: true,
// 默认对Python文件进行静态检查
“python.linting.enabled”: true,
// 默认在Python文件保存时进行静态检查
“python.linting.lintOnSave”: true,
“python.linting.pylintArgs”:
[
“–disable=E1601″//允许print
],

You May Also Like

About the Author: daidai5771

发表评论

电子邮件地址不会被公开。 必填项已用*标注