Mark Szymanski
Mark Szymanski

Reputation: 58170

vim auto indenting lines without semicolons in Ruby

For some reason, in vim whenever there is a line of ruby code with a function including parentheses, eg: string = gets() without a semicolon the next line is indented a level. When there is a semicolon, it works fine. Any ideas as to why this is happening and how to fix it? Also, since it will probably be requested, here is my ~/.vimrc

Upvotes: 4

Views: 993

Answers (1)

alternative
alternative

Reputation: 13042

You probably don't want set cindent on ruby files.

Use au FileType ruby setlocal nocindent

At the top (before any other au's) for other languages to work properly you need

instead of their respective lines.

Upvotes: 3

Related Questions