问题
I am setting up fonts ligatures for my VSCode using these two lines.
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
But it still looks the same as before.
I have tried to disable all of my installed extensions but it didn't work.
Here is my full settings:
{
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Material Theme Darker High Contrast",
"editor.formatOnSave": true,
"explorer.confirmDelete": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"window.zoomLevel": 0,
"editor.fontSize": 16, //!=
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
"explorer.confirmDragAndDrop": false
}
I want fully functional font ligatures as on this page: How i want it to look. Instead I am getting basic text with some font.
回答1:
It doesn't seem you didn't have the Fira font installed in your PC. Please follow this step if you are using MacOS.
Open terminal and run these commands.
brew tap homebrew/cask-fonts
brew cask install font-fira-code
And try to restart VsCode.
Or if you are on other OS (Windows or Linux) follow this step. https://github.com/tonsky/FiraCode/wiki/Installing
Hopefully, this might be helpful.
回答2:
If you are using a macOS sometimes you will need to restart the computer before the ligatures for Visual Studio Code to take effect.
回答3:
Step #1: Install Fira Code.
Step #2: Set the font in VSCode settings:
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
Step #3: Restart/reload VSCode.
That's about it.
来源:https://stackoverflow.com/questions/56209769/how-do-i-setup-font-ligatures-for-visual-studio-code