用户工具

站点工具


tools:vscode
  • 常用快捷键
    • 列编辑:alt+shift+鼠标左键选择
    • 删除行:ctrl+shift+k;移动行:alt+up/down;复制行:shift+alt+up/down
    • 自动导入:alt+shift+o,显示大纲:ctrl+shift+o
    • 快速打开文件:ctrl+p,打开依赖类,#System,以#开头即可
    • 重命名:F2重构,ctrl+shift+L批量替换
    • 下面插入行:ctrl+enter;上面插入行:shift+ctrl+enter
    • 全局查找:ctrl+shift+f;查找替换:ctrl+h
    • 侧边栏:ctrl+b,面板ctrl+j,全屏F11,禅模式ctrl+K Z
  • 常用插件
    • Chinese (Simplified) Language Pack for Visual Studio Code:中文语言包
    • Language Support for Java:java开发
    • Debugger for Java:调试
    • Java Test Runner:测试 wiki
    • Lombok Annotations Support for VS Code:lombok注解
    • MySQL:有两个,一个在Explorer,另一个在Primary Sidebar(最后免费版本4.5.12)
    • Live Server:静态服务器
    • JSON Escaper:转义json字符串的引号
    • mybatis-log:复制=⇒字符串,生成sql语句
    • rest client:替代postman,rest.http,支持根据请求生成代码片段ctrl+alt+c
    • Diff & Merge:比较并移动
    • draw.io integration
    • Alibaba P3C Checker
    • OpenAPI (Swagger) Editor
@host=http://localhost:9881
### 分隔多个请求,GET时只写URL即可,{{$timestamp -1 d}}
{{host}}/get?param1=value1&param2=value2
### 表单提交,变量:{{$guid}} {{$randomInt min max}} {{$datetime "DD-MM-YYYY" 1 y}} YMdhms ms w
POST {{host}}/formPost
Content-Type:application/x-www-form-urlencoded;charset=UTF-8

key1=value1&key2=value2
### json正文,或application/xml
POST {{host}}/jsonPost
content-type: application/json

{"jsonKey":"jsonValue"}
### file上传,Authorization: Basic username:password,也支持Digest username password,也可以直接写base64值
POST {{host}}/fileUpload
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="text"

title
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="1.png"
Content-Type: image/png

< ./1.png
------WebKitFormBoundary7MA4YWxkTrZu0gW--
  • 修改配置
    • 快捷方式目标:--extensions-dir "D:\Program Files\.vscode\extensions" --user-data-dir "F:\data\Code"
    • 设置:terminal.integrated.shell.windows,添加git\bin\bash.exe
    • 自动格式化:ctrl+,文本编辑器》正在格式化,Format On Save Mode=modification仅格式化编辑行
    • 热加载:hotCodeReplace=auto|manual|never,需要勾选autobuild
    • pom.xml提示:XML扩展Red Hat,
  • launch.json
    • cwd:当前工作目录,默认${workspaceFolder}
  • pom.xml
    • 未找到java项目:maven.compiler.source+target=1.8
    • Maven Dependencies:.classpath
    • access restriction:.settings/org.eclipse.jdt.core.prefs:org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
  • java11
复制快捷方式,修改目标
--extensions-dir "C:\Users\86188\.vscode\extensions11" --user-data-dir "C:\Users\86188\AppData\Roaming\Code11"
打开settings.json文件,使用Java11、GItBash,指定PATH变量等
"java.configuration.runtimes": [
        {
            "name": "JavaSE-1.8",
            "path": "D:\\Programs\\AdoptOpenJDK\\jdk-8.0.292.10-hotspot",
            "default": false
        },
        {
            "name": "JavaSE-11",
            "path": "D:\\Programs\\AdoptOpenJDK\\jdk-11.0.11.9-hotspot",
            "default": true
        }
    ],
    "terminal.integrated.defaultProfile.windows": "Bash",
    "terminal.integrated.profiles.windows": {
        "PowerShell": null,
        "Command Prompt": null,
        "Bash": {
            "path": "D:\\Programs\\Git\\bin\\bash.exe",
            "env": {
                "JAVA_HOME": "/D/Programs/AdoptOpenJDK/jdk-11.0.11.9-hotspot",
                "PATH":"/D/Programs/AdoptOpenJDK/jdk-11.0.11.9-hotspot/bin:/d/Programs/Python/Python39/Scripts:/d/Programs/Python/Python39:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/d/Programs/TortoiseSVN/bin:/d/Programs/apache-maven-3.8.1/bin:/d/Programs/AdoptOpenJDK/jdk-8.0.292.10-hotspot/bin:/d/Programs/TortoiseGit/bin:/cmd:/d/Programs/Go/bin:/d/Programs/nodejs:/c/Users/86188/AppData/Local/Microsoft/WindowsApps:/c/Users/86188/go/bin:/c/Users/86188/AppData/Roaming/npm:/d/Programs/redis:/d/Programs/MySQL-5.6.24/bin:/d/Programs/http_load:/d/Programs/nginx-1.20.1:/d/Programs/PostgreSQL/12/bin"
            }
        }
    },
  • lib
{
    "java.project.referencedLibraries": [
        "lib/**/*.jar",
        "c:\\path\\to\\jarfile\\commons-logging-1.1.1.jar"
    ]
}
tools/vscode.txt · 最后更改: 2022/05/18 09:19 由 admin