Main page

Autoindenting ruby code

12:12, 2008-02-27 [ ru | en ]

I adopted a bit Ruby Script Beautifier to feet my needs and published it as a gem on rubyforge.org:

sudo gem install kode
ruby-code-indenter my-source.rb

This script can be integrated with vim, gedit, textmate, emacs or any other (clever enough) editor. If you are vim fanboy you can add this line to your ~/.vimrc

nmap <leader>rci :%!ruby-code-indenter<cr>

and use \rci in normal mode to indent ruby code.

See screencast:

Автоотступы в ruby
OGG ~1.5Mb

Suggestions, patches and integration tips are welcome.

No comments yet...

Bonvolu ensaluti per OpenID por publicii komentojn.
Strio