When I use Merb's built in console, I get tab auto-completion similar to a standard bash prompt. I find this useful and would like to enable it in non-merb IRB sessions. How do I get auto-completion in IRB?
相关问题
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
- reference to a method?
- ruby 1.9 wrong file encoding on windows
- gem cleanup shows error: Unable to uninstall bundl
相关文章
- Ruby using wrong version of openssl
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- “No explicit conversion of Symbol into String” for
- Segmentation fault with ruby 2.0.0p247 leading to
- How to detect if an element exists in Watir
- uninitialized constant Mysql2::Client::SECURE_CONN
- ruby - simplify string multiply concatenation
This is just repeating the information on Cody Caughlan's comment above so it is easier to find:
either
require 'irb/completion'
or add the following to~/.irbrc
Just drop
require 'irb/completion'
in your irbrc.If that doesn't work try bond, http://tagaholic.me/bond/:
Bond not only improves irb's completion, http://tagaholic.me/2009/07/22/better-irb-completion-with-bond.html, but also offers an easy dsl for making custom autocompletions.
This is what worked for me on Mac OS 10.11.5. using rvm. Do the following :
sudo gem install bond
.irbrc
in your home directory.vi ~/.irbrc
Add the following lines in the
.irbrc
filerequire 'bond' Bond.start
Save and close the file
irb
and usetab
key to autocomplete