要设置这些漂亮的字体,请按照以下步骤进行操作。
从这里下载字体
解压缩并在ttf文件夹中双击每个文件,然后从弹出的对话框中选择“安装”
设置VSCode:
- 打开“文件 -> 首选项 -> 设置”
- 右上角点击
{}
,将打开用户设置(settings.json)
添加以下行:
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
- 注意:我必须注释掉正常的字体族输入,以便可以通过反转过程切换回去。
要更改字体粗细,请添加以下任意一行,但不要全部添加
"editor.fontWeight": "300" // 轻
"editor.fontWeight": "400" // 常规
"editor.fontWeight": "500" // 中等
"editor.fontWeight": "600" // 粗体
重新启动并享受。
![enter image description here](https://istack.dev59.com/71eSL.webp)
我的示例用户settings.json
{
"files.autoSave": "onFocusChange",
"editor.minimap.enabled": false,
"workbench.iconTheme": "material-icon-theme",
"vsicons.projectDetection.autoReload": true,
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
// "editor.fontFamily": "'Noto Mono', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"breadcrumbs.enabled": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"git.enableSmartCommit": true,
"java.home": "/usr/lib/jvm/java-8-oracle",
// "editor.fontLigatures": true,
"editor.fontFamily": "'Fira Code', 'Noto Mono', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
// "editor.fontWeight": "300", // Light
// "editor.fontWeight": "400", // Regular
// "editor.fontWeight": "500", // Medium
// "editor.fontWeight": "600" // Bold
}