On Nov 8, 12:04 pm, Marcus Gartner <[email protected]> wrote:
> I've been trying for the life of me to get ruby code to auto-indent,
> but I've had no luck. It looks like ruby auto-indenting should work
> jsut by turning on autoindent and smartindent.
>
> My .vimrc file can be seen here:https://gist.github.com/1348562
>
> Auto-indenting seems to be working fine with other languages, such as
> javascript. Any ideas why its not working for Ruby?

You don't want autoindent or smartindent for Ruby, you want the
filetype-specific indentation rules. See

http://vim.wikia.com/wiki/Indenting_source_code#Methods_for_automatic_indentation

In summary:
'autoindent' is simplistic, it just copies indent from the previous
line
'smartindent' overrides 'autoindent', but isn't really all that smart
'cindent' overrides both, but is meant for C-like languages like C, C+
+, and Java
:filetype indent on in your .vimrc is how to get powerful filetype-
dependent indentation

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to