This howto should help you follow the [style guide][1].
ruby-mode for Emacs has the defaults right.
Plain vim defaults to Tab characters so it needs adjustments in ~/.vimrc .

[1]: https://github.com/SUSE/style-guides/blob/master/Ruby.md

Rules
-----

1. No Tab Characters

emacs: (setq-default indent-tabs-mode nil)
vim:   set expandtab

2. Existing Tab Characters are 8 Columns Wide

emacs: (setq-default tab-width 8)
vim:   set tabstop=8

A notable offender is GitHub which uses 4. See point 1.
The tab *key* is a different matter, see point 3.

3. Ruby Indentation Level is 2

emacs:  (setq-default ruby-indent-level 2)
vim:    set softtabstop=2
        set shiftwidth=2

If you disagree with this, please read
JWZ's explanation of the concepts first:

  http://www.jwz.org/doc/tabs-vs-spaces.html

Future
------

I have also looked into these things but don't have a recommendation.
If you want me to continue, speak up.

- trailing whitespace:
    lesser impact,
    I haven't nailed down the right config yet
- local configuration:
    file-specific is easy but clutters files
    directory-specific needs a vim plugin; Emacs just works, as usual ;-)
-- 
Martin Vidner, Cloud & Systems Management Team
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu

Attachment: signature.asc
Description: Digital signature

Reply via email to