Skip navigation

I had thought most folks likely knew this already, but if you are a user of RStudio dailies (this may apply to regular RStudio, but I only use the dailies) and are missing ligatures in the editor (for some fonts), the “fix” is pretty simple (some misguided folks think ligatures are daft).

RStudio, like VS Code and many other editors/apps, is just a special purpose web browser. That means ligatures are controlled via CSS. RStudio also supports themes. There are many built-in themes. I use this third-party one. We can use these themes to sneak in some CSS that gives you granular control over ligatures.

The CSS class we need to target is .ace_scroller. That’s the contents of the editor pane, console, and any other monospaced “scrolled text” components. If you’re wondering, “Why …ace…?”_, that’s die to RStudio’s use of the Ace editor component. Say all the nice things you want to about the Monaco editor component used by VS Code (et al.), but the wizards at Posit wield Ace better than I’ve seen any other app dev team.

You can start here to learn about all the ways you can, and, may need to customize ligatures, but the following worked for my new fav font family:

.ace_scroller {
  font-variant-ligatures: discretionary-ligatures;
  font-feature-settings: "dlig" 1;
}

There are many possible values for font-variant-ligatures, and you can fully customize the font-feature-settings to target only the ligatures you want (for example, the previous linked font has eight stylistic sets).

UPDATE

sailm-b has forked and is maintaining a more updated version of rscodeio.

FIN

If you were missing out before, hopefully this brings you back into the ligature fold.

2 Comments

  1. Just discovered your blog, I like it.

    Since you’re using the rscodeio RStudio theme, I thought you might be interested in my fork (use the interim-merge branch!): https://github.com/salim-b/rscodeio/tree/interim-merge

    The original rscodeio has unfortunately been unmaintained for several years now.


3 Trackbacks/Pingbacks

  1. By Ligatures In RStudio Dailies - Ciberdefensa on 12 Nov 2023 at 6:32 am

    […] I had thought most folks likely knew this already, but if you are user of RStudio dailies (this may apply to regular RStudio, but I only use the dailies) and are missing ligatures in the editor (for some fonts), the “fix” is pretty simple (some misguided folks think ligatures are daft). RStudio, like VS Code… Continue reading → […]

  2. […] I had thought most folks likely knew this already, but if you are user of RStudio dailies (this may apply to regular RStudio, but I only use the dailies) and are missing ligatures in the editor (for some fonts), the “fix” is pretty simple (some misguided folks think ligatures are daft). RStudio, like VS Code… Continue reading → […]

  3. […] article was first published on R Archives – rud.is, and kindly contributed to R-bloggers]. (You can report issue about the content on this page […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.