【问题标题】:How to configure emacs tabbing behavior如何配置 emacs 选项卡行为
【发布时间】:2014-08-08 03:13:01
【问题描述】:

我已经与 emacs 选项卡搏斗了很多,但一直无法弄清楚这一点。

在红宝石模式下:

SomeClass.create(
  this_is: where_i_want_to_tab,
  because: that_is_how_we_do_it
)

SomeClass.create(
                 this_is: where_emacs_wants_to_put_it,
                 but: my_pull_request_aint_gonna_be_merged_like_this
)

这可能是 ruby​​ 模式设计者做出的代码风格决定,但是否可以配置它?

【问题讨论】:

标签: emacs tabs ruby-mode


【解决方案1】:

ruby-mode 的这种行为无法配置,但在 Emacs 24.4(即将发布)中进行了更改。有这样的代码:

SomeClass.create(
                 this_is: where_emacs_wants_to_put_it,
                 but: my_pull_request_aint_gonna_be_merged_like_this
)

将像这样缩进:

SomeClass.create(
  this_is: where_i_want_to_tab,
  because: that_is_how_we_do_it
)

与现有good practices一致。

【讨论】:

  • 当前使用 emacs 的 ruby​​ 开发人员是做什么的?按空格键?我主要使用 Sublime Text,但我一直在涉足 emacs。这是最后一个痛点。希望 24.4 尽快发布 :)
  • @harumph @h 他们可能已经使用 Emacs 24.4 pretest 或 Emacs trunk。它很容易在 OS X 和 Ubuntu 上安装,也有适用于 Windows 的构建,iirc。在 OS X 上,它通常是值得推荐的,因为它还包含大量针对 OS X 的改进。
【解决方案2】:

原来你可以在 24.3 中配置这个:

(setq ruby-deep-indent-paren nil)

【讨论】:

    猜你喜欢
    • 2011-03-11
    • 1970-01-01
    • 1970-01-01
    • 2018-04-19
    • 2012-03-04
    • 1970-01-01
    • 1970-01-01
    • 2011-09-22
    • 1970-01-01
    相关资源
    最近更新 更多