31

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.

Cave Johnson
  • 6,499
  • 5
  • 38
  • 57
Kolobozka6b
  • 436
  • 1
  • 5
  • 7
  • 2
    Try without the inner quotes: `"Fira Code",` (assuming you installed the font properly). – Mark May 19 '19 at 16:55
  • "It doesn't work" is an opinion, not a problem, and certainly not the kind of [detail that others can use to help you figure out what's wrong](/help/how-to-ask), so: what did you expect it to do, and what justifies having that expectation? What did you do to test it, what did you expect _that_ to do, and why, and what did it do instead? – Mike 'Pomax' Kamermans May 19 '19 at 16:56
  • 1
    @Mark i have tryed your opinion ```"Fira Code",``` but it didnt help. – Kolobozka6b May 19 '19 at 17:14
  • 1
    @Mike'Pomax'Kamermans Do i have it right now? I am frst time here so i am realy glad for every help. – Kolobozka6b May 19 '19 at 17:20
  • Is this after you already tried to follow the instructions onhttps://github.com/tonsky/FiraCode/wiki/VS-Code-Instructions ? – Mike 'Pomax' Kamermans May 19 '19 at 21:41
  • @Mike'Pomax'Kamermans yea but it still look like normal font 0 font ligatures – Kolobozka6b May 20 '19 at 17:24
  • I am having the same issue tho with 'Cascadia Code.' – Aero Wang Mar 28 '20 at 17:39
  • 1
    Okay it works now. I realized all I needed to do is to restart the computer...I am using a macOS. – Aero Wang Mar 28 '20 at 17:40
  • install this font first and it will work. https://github.com/microsoft/cascadia-code/releases/download/v2108.26/CascadiaCode-2108.26.zip –  Oct 21 '21 at 04:56

8 Answers8

69

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.

Ahmad Awais
  • 33,440
  • 5
  • 74
  • 56
5

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.

apollo
  • 175
  • 1
  • 5
  • 16
  • 1
    There is no need to use or install brew. Just get the TTF https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-Retina.ttf – Ariel M. Jul 31 '20 at 03:41
  • I too had an issue to first get this working, had to restart by exiting, at least for the font family. FiraCode font is pretty nice and was able to get font ligatures working too (no need to restart for this). Think the issue other might run into , VS Code seems to have a number of places where to specify the font uses. What worked for me was editing my settings file directly: editor.fontFamily": "'fira Code', fall backs..., ... "editor.fontLigatures": true, All good now, hope it helps :) – Dano Jan 27 '22 at 01:39
4

Since VS Code 1.40, editor.fontLigatrues supports string settings, that is useful for fonts that support different stylistic sets:

i.e.:

  • "editor.fontLigatures": "'ss09', 'zero', 'onum'",
  • "editor.fontLigatures": "'ss01'",

You can read more about feature tags here (but the support depends on the font in question):

https://learn.microsoft.com/en-us/typography/opentype/spec/featuretags

GiM
  • 460
  • 4
  • 13
2

I solved my problem put Fira Code without ""

Ray
  • 394
  • 3
  • 11
2

For those with a different version of VS Code you can try to press key combination of control and comma ( Ctrl+, ) to open your settings tab and then after search for font ligatures

Search Results

After this click on Edit in settings.json.

Then set editor.fontLigatures=true.

Final look

After completing this step then you'll be good to go.

Nuwan Alawatta
  • 1,812
  • 21
  • 29
Blessing
  • 2,450
  • 15
  • 22
1

If you are using a macOS sometimes you will need to restart the computer before the ligatures for Visual Studio Code to take effect.

Aero Wang
  • 8,382
  • 14
  • 63
  • 99
1

This is still not fixed in VS Code. But looks like it's close. After 2 years the VS Code Terminal will finally support "Cascadia Code" and other fonts with programming ligatures.

Junaga
  • 292
  • 4
  • 19
0

Install FiraCode font-family for Mac 'Computer' but not 'User'

How to install and remove fonts on your Mac--Apple support

kvsur
  • 1