我的 VS Code Web 开发设置

2025-05-25

我的 VS Code Web 开发设置

过去我用过很多编辑器,
现在我只用 Visual Studio Code,什么都用。

我分享了针对 Web 开发优化的设置。

主题

目前我使用的主题是:Noctis。更具体地说,我使用的是Noctis Obscuro
版本

我喜欢这个主题的良好对比度和色彩。

图标

我不使用 VS Code 的默认图标,但我安装了VS Code Icons

市场上有很多图标集,但我喜欢这个包,因为我可以一眼识别解决方案中的每种文件。

字体

我使用Fira Code 字体,而不是 Visual Studio Code 的默认字体。
我使用 Fira Code 是因为它支持字体连字。
字体连字是一种“新”的字体格式,它支持使用符号修饰,而不是像 =>、<= 这样的普通字符。
您可以在下图中看到许多示例。

安装完成后,您需要更改字体的默认设置。
这是我的字体设置。

   "editor.fontFamily": "Fira Code",
   "editor.fontLigatures": true,
   "editor.fontSize": 15
~~~~
### The cursor
The first line makes your cursor blink more smooth with a fade-in/fade-out slow animation.
In the third line, I define the cursors style as a "line" because I don't like a "big" cursor when I type the code.
Enter fullscreen mode Exit fullscreen mode
"editor.cursorBlinking": "smooth",
"editor.cursorSmoothCaretAnimation": true,
"editor.cursorStyle": "line"
Enter fullscreen mode Exit fullscreen mode

~~~~

缩进指引可见

     "editor.renderIndentGuides": true
~~~~
### Unsaved Tabs
With the following settings, the unsaved files have a dot symbol before the file name and a line at the top of the tab.
You can see easily the unsaved files, better than before.
Enter fullscreen mode Exit fullscreen mode
 "workbench.editor.highlightModifiedTabs": true
Enter fullscreen mode Exit fullscreen mode

~~~~

自动保存

没什么可解释的。延迟后自动保存文件。
我设置了 5000 毫秒,因为我经常使用“实时”服务器来调试我的应用程序,这样可以避免多次重新编译项目。
我禁用了保存时的格式化功能,因为如果你编辑文件时文件在你眼前发生变化,你就会浪费一些时间来查找正确的行号。

     "files.autoSave": "afterDelay",
     "files.autoSaveDelay": 5000,
     "editor.formatOnSave": false
~~~~
## Extensions
- [Visual Studio Intellicode](https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode)

The normal intellisense shows functions, methods or parameters in alphabetical orders.
With this extension, Microsoft has added some AI to the intellisense and the functions, methods, and parameters are shown with the most used order.
With this you more productive.

- [Indent Rainbow](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow)

This extension adds several colors to every indent tab in the code.
It helps to navigate your code with your eyes.

![](https://raw.githubusercontent.com/oderwat/vscode-indent-rainbow/master/assets/example.png)

- [Import Cost](https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost)

This extension will display inline in the editor the size of the imported package.

![](https://file-wkbcnlcvbn.now.sh/import-cost.gif)

## Conclusion
I use other extensions specific for every frontend technologies, but these extensions are technology independent.
Enter fullscreen mode Exit fullscreen mode
文章来源:https://dev.to/kasuken/my-vs-code-settings-for-web-development-20f4
PREV
不要重构代码
NEXT
Cascadia Code:Visual Studio Code 和 Terminal 的新字体