Emacs,ruby:将end block转换成花括号,反之亦然 [英] Emacs, ruby: convert do end block to curly braces and vice versa

查看:101
本文介绍了Emacs,ruby:将end block转换成花括号,反之亦然的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常发现自己正在转换这样的代码:

I often find myself converting code like this:

before do 
  :something
end

before { :something }

有没有办法在emacs中自动执行此任务?我使用红宝石模式和rinary,但是在这里并不太有用。

Is there a way to automate this task in emacs? I use ruby-mode and rinary, but they're not too helpful here.

推荐答案

ruby​​- Emacs 24.3中的模式和更新的命令 ruby​​-toggle-block

默认绑定是 Cc {

这篇关于Emacs,ruby:将end block转换成花括号,反之亦然的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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