如何在IntelliJ Mac OS中键入右箭头(即⇒,而不是=>)? [英] How to type the right arrow (i.e., ⇒, not =>) in IntelliJ Mac OS?

查看:488
本文介绍了如何在IntelliJ Mac OS中键入右箭头(即⇒,而不是=>)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Scala模式匹配中使用的常见符号是⇒或=>的右箭头.因此,我的问题是键入整洁的向右箭头⇒的快捷方式是什么?我在Mac OS上使用IntelliJ.

A common symbol to use in Scala pattern matching is the right arrow, either ⇒ or =>. So my question is what is the shortcut to type the neat looking right arrow ⇒? I use IntelliJ on Mac OS.

是使用 https://的⇒的示例代码doc.akka.io/docs/akka/current/guide/tutorial_1.html

package com.lightbend.akka.sample

import akka.actor.{ Actor, Props, ActorSystem }
import scala.io.StdIn

class PrintMyActorRefActor extends Actor {
  override def receive: Receive = {
    case "printit" ⇒
      val secondRef = context.actorOf(Props.empty, "second-actor")
      println(s"Second: $secondRef")
  }
}

object ActorHierarchyExperiments extends App {
  val system = ActorSystem("testSystem")

  val firstRef = system.actorOf(Props[PrintMyActorRefActor], "first-actor")
  println(s"First: $firstRef")
  firstRef ! "printit"

  println(">>> Press ENTER to exit <<<")
  try StdIn.readLine()
  finally system.terminate()
}

推荐答案

大多数使用此符号的项目都使用

Most projects that use this symbol, use a tool like Scalariform to automatically change => into after you've written it.

不过,个人而言,我更喜欢使用带有连字的字体(例如 Fira代码)进行渲染漂亮的箭头之类的.

Personally though, I prefer to use a font with ligatures (such as Fira Code) to render nice arrows and such.

这篇关于如何在IntelliJ Mac OS中键入右箭头(即⇒,而不是=&gt;)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆