Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling 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 */ } 

Is being displayed in an elegant style:

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

Here's a screen-shot from the live coding session, marked up to underle the operator:

Java code displayed using ≠

He's using the regular != operator, the IDEA is taking care of the rest.

I've been playing with my IntelliJ's configuration but couldn't enable this new fancy feature. Any help?

like image 596
Anis LOUNIS Avatar asked Jan 20 '17 23:01

Anis LOUNIS


People also ask

How do you write not equal to in Visual Studio code?

You can also type Alt+8800 , and this will type the does not equal sign in any of the Suite Office apps.


2 Answers

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/

like image 154
Grzegorz Górkiewicz Avatar answered Sep 22 '22 09:09

Grzegorz Górkiewicz


This is the "font ligatures" feature, which uses ligatures to combine the characters in fonts that support them. This feature is disabled by default in the standard editor, and enabled by default in the Reader mode introduced in 2020.3.

This feature can be enabled & disabled for the current project in the project settings window (File | Settings… in Windows and Linux or IntelliJ IDEA | Preferences… in macOS).

The settings are located in the settings window at:

  • Editor: Editor | Font -> "Enable font ligatures" checkbox
  • Reader Mode: Editor | Reader Mode -> "Font ligatures" checkbox
like image 28
M. Justin Avatar answered Sep 22 '22 09:09

M. Justin