Michal Przysucha
Michal Przysucha

Reputation: 1061

Is it possible to write lambda letter (λ) in IntelliJ IDEA?

I would like to use this interface: http://javaslang.com/javadoc/2.0.0-RC2/javaslang/%CE%BB.html

Fortunately auto completion works, if I start from package name. But is it possible to write lamda greek letter in IntelliJ IDEA or generally in any editor?

Upvotes: 6

Views: 6276

Answers (2)

John Bollinger
John Bollinger

Reputation: 180286

You can express any Unicode character anywhere in Java source code via the \udddd form. It is not just for Strings and chars. (For characters outside the BMP, you need two of those, forming a surrogate pair.) Inasmuch as there sometimes are multiple characters with similar glyphs, Unicode escapes have the advantage of being totally unambiguous.

Presumably the character wanted in this case is the one Unicode names "Greek small letter lamda", U+03BB, which you can express anywhere in Java source code as \u03bb.

Upvotes: 3

Nick Fortescue
Nick Fortescue

Reputation: 44173

This is all about your keyboard and OS, and not specific to Intellij IDEA. You can create one by copy and pasting, which is pretty easy. If you want to insert it directly then use the way of typing special characters specific to your platform (Windows, Mac, Linux, ...).

So for example on Mac you could:

  • Do Edit > Special Characters and click on the gear wheel at the top left, select Customize and check the box for Greek. Double click or drag drop to input.
  • Go to system prefs/language & text/input sources and check the box for Greek, plus the box for Show Input Menu in Finder. Then select Greek from the "flag" menu at the top right of the screen and type.

There are also some suggestions on the Wikipedia article on entering special characters, though IntelliJ may intercept some of these.

I have to admit, I always just copy and paste.

Upvotes: 4

Related Questions