VSCode配置备忘

Visual Studio Code (VSCode)是微软开源的一款跨平台编辑器,顾名思义,其相当于在Visual Studio 集成开发环境的基础上精简而来的代码编辑器。因为其开源、跨平台的特性,又由于其各种响应速度,而且背靠微软这棵大树,所以我在Ubuntu上选择它作为我的Python程序编辑器。而搭配上Python调试插件,更可以直接进行程序调试,基本上能够满足我的需求。 因为VSCode的各种参数设置与众不同,所以以下简单备忘一下我的VSCode的配置文件(通过File->Preferences->User Settings打开): [python] // Place your settings in this file to overwrite the default settings { // “editor.fontFamily”: “‘DejaVu Sans Mono for Powerline’”, “editor.fontFamily”: “‘Fira Code’”, “editor.fontLigatures”: true, // Controls the font size. “editor.fontSize”: 22, “editor.renderIndentGuides”: true, “editor.occurrencesHighlight”: false, // Columns at which to show vertical rulers “editor.rulers”: [ 100 ], // Arguments passed in. Each argument is a separate item in the array. “python.formatting.autopep8Args”: [ “–max-line-length=100”, “–indent-size=2” ], // Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down. “editor.formatOnSave”: true, // Format the document upon saving. “python.formatting.formatOnSave”: true, “python.linting.pylintArgs”: [ “–include-naming-hint=n”, “–disable=W0311”, “–disable=C0103”, “–disable=E1101” ], “files.trimTrailingWhitespace”: true, // The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on. “editor.tabSize”: 2, “files.exclude”: { “.vs“: true, “.~”: true, “.pyc”: true, “/.pyc”: true }, “files.autoSave”: “onWindowChange”, “git.confirmSync”: false, “window.zoomLevel”: 0, “editor.minimap.enabled”: true, “editor.minimap.maxColumn”: 120, “workbench.welcome.enabled”: false, “workbench.colorTheme”: “Monokai”, “workbench.iconTheme”: “vs-nomo-dark” } [/python]

简单说明一下:

1.配置了字体,我使用了Fira Code这款字体,并将字号设置为了18;

2.设置了最大列数提醒的位置;

3.设置了autopep8自动格式化Python代码的的一些参数;

4.设置保存文件时自动格式化Python代码;

5.设置了pylint一些警告、错误提示的参数;

6.设置保存时,自动将Python代码的一些空格给trim掉;

7.设置Tab Size为2个空格;

8.将一些编译后而不想在编辑器里看到的文件隐藏;

9.将编辑器的自动保存关闭。