From: Morten Liebach Date: 2002-11-20T00:07:25+09:00 Subject: Re: identing ruby in vim On 2002-11-19 00:36:25 +0900, Michael Brailsford wrote: > > I'm new to ruby and vim. Is it possible to ask vim to ident a piece > > of ruby code? I know it does syntax highlighting, so, I suppose it may > > be able to format the code. > > The best way is to include the following in your .vimrc: > > filetype plugin on "Turn ftplugins on > filetype indent on "Turn ftindent on My VIM won't eat those commands (version 6.1.213) ... ftplugins are incredibly nice. read ':help ftplugin'. My $VIM/ftplugin/ruby.vim: ==== cut ==== setlocal expandtab setlocal shiftwidth=2 setlocal softtabstop=2 setlocal tabstop=2 setlocal indentexpr=GetRubyIndent() setlocal tw=0 setlocal foldmethod=marker " when writing a buffer chmod it executable autocmd BufWritePost,FileWritePost * :silent !chmod 755 ==== cut ==== Just read VIMs on-line help on those commands, it's very good. :) Happy VIMing, Have a nice day Morten -- OpenPGP: 0xF1360CA9 -- 8CF5 32EE A5EC 36B2 4E3F ACDF 6D86 BEB3 F136 0CA9 Morten Liebach -- http://m.mongers.org/