Search code examples
intellij-ideaidecode-formatting

Enabling/Disabling IntelliJ's fancy ≠ (not equal to) operator


I witnessed this in the GOTO 2016 • Kotlin - Ready for Production conference by Hadi Hariri.

In some of his code, what would normally look like:

if (x != y) { /* do some stuff */ }

Renders as:

if (x ≠ y) { /* do some stuff */ }

Screen-shot from the live coding session

The code uses the regular != operator, and the IDEA takes care of the rest.

So, how can I enable/disable this?


Solution

  • To enable ligatures, go to the Settings → Editor → Colors & Fonts → Font, choose a font that supports ligatures, e.g. FiraCode, Hasklig, Monoid or PragmataPro (the font has to be installed) and select the Enable font ligatures option.

    Source: link.

    To preview some fonts, including several with ligatures: https://app.programmingfonts.org/