change emacs ruby-mode indent to 4 spaces

前端 未结 3 1172
被撕碎了的回忆
被撕碎了的回忆 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

    There's a way to do it without touching .emacs. You can put a special comment block at the end of every Ruby file that sets "file variables" specific to that file. Any emacs or xemacs editing that file will use the mode, tab settings, & etc in that comment block.

    As an example, here is the "file variables" block we use for Ruby development:

    # Local Variables:
    # mode: ruby
    # tab-width: 2
    # ruby-indent-level: 2
    # indent-tabs-mode: nil
    # End:
    

提交回复
热议问题