Reputation: 1577
The Unicode operator \u21D2
"⇒
" (sometimes writtten as =>
) is a common lexical identifier prevalent in the Scala programming language used in functional combinators, function definitions, case-match statements, etc. I normally have to copy-and-paste this operator into my code from someplace else, but that can get really annoying.
Does anyone know of shortcuts to produce this symbol in your IDE of choice? I typically use programs like JetBrains IntelliJ, SublimeText, and VIM.
Upvotes: 5
Views: 2252
Reputation: 21730
For emacs, there's (global-prettify-symbols-mode)
, which just displays ⇒
over =>
. It still writes =>
to the file in the end.
Upvotes: 0
Reputation: 7162
In IntelliJ IDEA under
Preferences -> Editor -> CodeStyle -> Scala
In the Tab 'Other' are options to automatically insert several unicode characters.
Upvotes: 11
Reputation: 13346
In IntelliJ, I've created a live template of the form $PARAMS$ ⇒ $BODY$
. This lets you easily insert the ⇒
character.
Upvotes: 0