如何配置IDEA自动替换=>与 ⇒和->与 →?
如何将 IDEA 配置为自动将 =>
替换为 ⇒
并将 ->
替换为 → ?
How can I configure IDEA to automatically replace =>
with ⇒
and ->
with →
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看看 这个问题和答案使用了 IntelliJ 的“实时模板”,在本例中,scalaz 映射以 XML 形式保存为文件,而不是从 GUI 输入。我想这对于 scalaz 来说没问题,因为所有 unicode 别名函数和方法都已经存在。
Take a look at this question and answer which makes use of IntelliJ's "Live Templates", in this case scalaz mappings in XML form saved as a file rather than entered from the GUI. This, I guess, is fine with scalaz as all the unicode aliased functions and methods are already present.
Scalariform 将为您执行此操作(如果配置适当)。我想您想要的是能够在您输入时将这些序列自动扩展为相关的 unicode 字符。老实说,我不知道这在 IDEA 中是否可行。
Scalariform will do this for you (if appropriately configured). I would imagine that what you want is something that can auto-expand those sequences into the relevant unicode characters though as you type. I honestly don't know whether or not this is possible in IDEA.
有了我正在使用的 IntelliJ 2016.1.4,事情变得更容易了。
文件 -> (其他设置->默认设置)|设置->编辑->代码风格-> Scala
选择选项卡
Other
Replace =>使用 unicode 符号
替换 ->带有unicode符号
With IntelliJ 2016.1.4, which I am using, things has become easier.
File -> (Other Settings-> Default Settings) |Settings -> Editor -> Code Style -> Scala
Select tab
Other
Replace => with unicode symbol
Replace -> with unicode symbol
请按照图像中的步骤操作:
Please follow the steps in the image: