Vim is a really useful text editor. Its based on commands interface may frighten you but don't worry, it's easy to start playing and you'll start to see its power soon.
In Ubuntu, install the vim-full package:
sudo aptitude install vim-full
Download it here for Windows or see this for other operation systems.
You also could install gvim which is a graphical interface for vim:
sudo aptitude install gvim
And just start the play:
vim args.rb # (or gvim args.rb if you want the graphical interface)
Pulse the a key (<a> afterwards)
$*.each{|n| puts n}
<Esc>
:wq
ruby args.rb arg1 arg2 arg3
>arg1
>arg2
>arg3
vim upcase.rb
Pulse the a key (<a> afterwards)
puts $*[0].upcase
<Esc>
:wq
ruby upcase.rb "hello"
=>HELLO
echo "hello" | ruby upcase.rb
=>
vim upcase.rb
<a>
<use the arrows for moving the cursor>
arg0_or_stdin = $* == [] ? $stdin.read : $*[0]
puts arg0_or_stdin.upcase
<Esc>
:wq
echo "hello" | ruby upcase.rb
=>HELLO
June 29, 2008 at 12:27 am
[...] - vim and ruby scripts step by step [...]