I'm using irb on OS X, and when I press option left/right (or META+B/F) the cursor moves to the next/previous word. But irb doesn't wont to treat dot (.) character as a word separator.
I've tried to add the (.) to the .irbrc, so it looks like this now:
Readline.basic_word_break_characters = " \t\n`><=.;|&{("
But that has no effect.
I'm using the stock Mountain Lion ruby, and a manually compiled 1.9.3, both versions of irb behave similar. Also dot is treated as a separator in bash and in pry, so the system wide settings are probably fine.
Any help appreciated,
Thanks
Ok, it seems that the problem was that there were no libreadline installed in my system at all. Installing the latest readline and recompiling ruby fixed the problem.
I've used readline 6.2 from ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz
, which was installed used the basic ./configure && make && make install
.
And I've installed ruby 1.9.3-p194 using ruby-build with the following options
sudo ruby-build 1.9.3-p194 /opt/ruby-1.9.3-p194 CONFIGURE_OPTS="--with-readline-dir=/usr/local"
After that IRB started treating dots, underscores and a bunch of other characters as word separators.
Also the properly working readline should return something like:
Readline::VERSION => "6.2"
and the misbehaving one says:
Readline::VERSION => "EditLine wrapper"