From: "Mauricio Fernández" Date: 2003-06-14T23:51:08+09:00 Subject: Re: I need a code beautifier or formatter On Sat, Jun 14, 2003 at 11:33:43PM +0900, Joao Pedrosa wrote: > Hi, > > --- Michael Neumann wrote: > > On Sat, Jun 14, 2003 at 10:01:36PM +0900, Joao > > Pedrosa wrote: > > > Hello, > > > > > > I have some source code that is terribly > > formatted. It needs some good > > > indentation at least. But I am too lazy to do it > > all by hand. > > > > > > Does anyone know a tool to do the job ? > > > > Vim can format Ruby code (visual select then press > > '='). > > > > Regards, > > > > Michael > > Vim did format it, but not as expected. It doesn't even indent > correctly for me. Anyone can confirm that it doesn't work properly ? You can try to update your indent file: http://www.soyabean.com.au/gavin/vim/index.html Works for me most of the time, but sometimes there's problems w/ def foo class << anObject; self end # thinks def foo is closed now and colors are wrong from now on and bla do |x| #sometimes indentation fails here??? #and 'end' is mistakenly aligned with the outer scope, e.g. def foo -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Are Linux users lemmings collectively jumping off of the cliff of reliable, well-engineered commercial software? -- Matt Welsh