change emacs ruby-mode indent to 4 spaces

前端 未结 3 1207
被撕碎了的回忆
被撕碎了的回忆 2021-01-17 20:31

From a previous post I got Ruby mode working in emacs. This is working great.

Setting up .emacs file for mac ruby development

Our company uses 4 spaces for in

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-17 21:26

    The tab-width setting only controls the width of a tab character, i.e. how many spaces a tab character is equivalent to when displayed in your buffer. It does not affect the number of spaces (or tabs) used for indenting your code.

    For Ruby code, the indentation is controlled by the ruby-indent-level variable:

    (setq ruby-indent-level 4)
    

提交回复
热议问题