如何在Ruby的IRB中启用自动完成功能 [英] How to enable auto completion in Ruby's IRB

查看:166
本文介绍了如何在Ruby的IRB中启用自动完成功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Merb的内置控制台时,我会得到类似于标准bash提示的选项卡自动完成功能.我觉得这很有用,并希望在非Merb IRB会议上启用它.如何在IRB中获得自动完成功能?

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?

推荐答案

只需将require 'irb/completion'放到irbrc中即可.

Just drop require 'irb/completion' in your irbrc.

如果这不起作用,请尝试绑定, http://tagaholic.me/bond/:

If that doesn't work try bond, http://tagaholic.me/bond/:

   require 'bond'; require 'bond/completion'

债券不仅提高了irb的完成率, http://tagaholic.me/2009/07/22/better-irb-completion-with-bond.html ,但还提供了用于自定义自动填充功能的简单dsl.

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.

这篇关于如何在Ruby的IRB中启用自动完成功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆