Textmate中的自动完成 [英] Autocomplete in Textmate
问题描述
有时我会在有人正在使用文本伴侣的地方观看屏幕投射.
Sometimes I watch screen casts where someone is using text mate.
我是Rails开发人员,所以这些是Rails屏幕上的演员.
I'm a rails developer, so these are rails screen casts.
他们会输入类似的内容:
They'll type something like:
def
例如
和结束"将自动显示在下方.
and "end" will automatically appear underneath.
我确实启用了Rails捆绑软件-为什么这对我没有发生?
I do have the bundle for Rails enabled - why doesn't this happen for me?
谢谢!
推荐答案
您正在编辑的文件需要正确的扩展名(在您的情况下为.rb
),以使Textmate理解要使用的正确捆绑软件.
The file you're editing needs the right extension (.rb
in your case) to make Textmate understand the right bundle to use.
您在TM窗口底部看到的是什么? (在行号和列号之后)?
What do you see down at the bottom of your TM window? (After Line# and Column#)?
是"Plain Text"
吗?
如果您看到与Ruby
或Ruby on Rails
不同的内容,请单击它右侧的向上/向下小箭头以打开捆绑包的下拉列表,然后选择:Ruby
或Ruby on Rails
.
If you see something different from Ruby
or Ruby on Rails
click on the little up/down arrows on the right of It to open the dropdown list of bundles and select: Ruby
or Ruby on Rails
.
这样,当您在编写"def
" 后点击 TAB 时,它将自动为您完成方法的创建.
This way, when you hit TAB after writing "def
" It will auto-complete the method creation for you.
您还可以检查Bundles> Bundle编辑器> Edit snippets ...(然后选择Ruby),查看是否在按下TAB时将代码段"def"配置为被触发(请参见声明">方法"下).
You can also check Bundles > Bundle editor > Edit snippets... (then choose Ruby) to see if you have the snippet "def" configured to being fired when you hit TAB (see under Declaration > Methods).
这篇关于Textmate中的自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!