VS Code 常用设置

记录宇宙最强编辑器之精简版 VS Code 的常用设置和插件配置。

VS Code 常用设置

自定义设置

{
    "team.showWelcomeMessage": false,
    "workbench.colorTheme": "Dracula",
    "window.zoomLevel": 1,
    // "editor.fontFamily": "Consolas, monospace",
    "editor.fontFamily": "YaHei Consolas Hybrid",
    "git.autofetch": true,
    "terminal.external.windowsExec": "D:\\cygwin64\\bin\\mintty.exe",
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    "git.enableSmartCommit": true,
    "editor.wordSeparators": "`[email protected]#$%^&*()=+[{]}\\|;:'\",<>?",
    "explorer.confirmDelete": false,
    "git.confirmSync": false,
    "editor.fontSize": 16,
    "editor.renderWhitespace": "all",
    "files.eol": "\n",
    "explorer.confirmDragAndDrop": false,
    "editor.renderControlCharacters": true,
    "workbench.sideBar.location": "left",
    "http.proxy": "http://172.17.20.160:44443",
}

使用技巧

https://code.visualstudio.com/docs/getstarted/tips-and-tricks

  • Command Palette

    Access all available commands based on your current context.

    Keyboard Shortcut: Ctrl+Shift+P

  • Quick Open

    Quickly open files.

    Keyboard Shortcut: Ctrl+P

  • Status Bar

    Errors and Warnings

    Keyboard Shortcut: Ctrl+Shift+M

  • Change language mode#
    Keyboard Shortcut: Ctrl+K M

  • Change your theme

    Keyboard Shortcut: Ctrl+K Ctrl+T

  • Customize your keyboard shortcuts

    Keyboard Shortcut: Ctrl+K Ctrl+S

  • Tune your settings

    Open User Settings settings.json

    Keyboard Shortcut: Ctrl+,

  • Extensions

    Keyboard Shortcut: Ctrl+Shift+X

  • Files and Folders

    Integrated Terminal

    Keyboard Shortcut: Ctrl+`

  • Toggle Sidebar

    Keyboard Shortcut: Ctrl+B

  • Zen Mode

    Keyboard Shortcut: Ctrl+K Z

快捷键大全

https://code.visualstudio.com/docs/getstarted/keybindings

代理

有时候我们可能出在防火墙后面,要访问vscode 的官方网站就需要设置代理:

快捷键Ctrl+,呼出用户设置,在USER SETTINGS下这样添加:

  "http.proxy": "http://127.0.0.1:1080",

可能需要代理访问的网站(包括但不限于):

vscode-update.azurewebsites.net
vscode.blob.core.windows.net
marketplace.visualstudio.com
*.gallerycdn.vsassets.io
rink.hockeyapp.net
vscode.search.windows.net
raw.githubusercontent.com
vsmarketplacebadge.apphb.com

参考:https://code.visualstudio.com/docs/setup/network

go get 代理设置

我们在初始使用vscode编写go代码时,它会默认使用go get为我们从github下载需要的依赖,原本以为它会使用vscode的代理,而实际上是使用的git代理,因为下载过程是使用git clone完成的。

下面是设置git代理的方法:

git config --global http.proxy "http://127.0.0.1:1080"

使用结束不再需要时可取消:

git config --global --unset http.proxy

参考:https://stackoverflow.com/a/11265487/5723841

插件列表