在VIM更好的自动完成 [英] Better autocomplete in VIM

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

问题描述

所有,

我一直用vim有一段时间了,爱它的一切 - 有只有一件事我真的很喜欢从集成开发环境的RubyMine错过,那就是先进的自动完成

I have been working with vim for some time now, and love everything about it - there is only one thing I really miss from IDEs like RubyMine, and that is advanced autocompletion.

有关参考,在这里是我的标准VIM设置: https://github.com/wrwright/.vim

For reference, here is my standard VIM setup: https://github.com/wrwright/.vim

我曾尝试与omnicomplete + SUPERTAB CTAGS,我错过了一个主要因素是,弹出属性/常量/方法的上下文敏感列表的功能。例如,我学到RubyMotion,我很想有一些帮助记忆的iOS SDK常量/属性/方法,但我的VIM自动完成与建议类停止names..or如果它确实表明的方法/属性,它会列出一吨方法/甚至不适用于我的工作类属性。

I have tried ctags with omnicomplete + supertab, and the one major element I miss is the ability to bring up a context sensitive list of attributes/constants/methods. For example, as I learn RubyMotion, I'd love to have some help remembering iOS SDK constants/attributes/methods, but my VIM autocomplete stops with suggesting class names..or if it does suggest methods/attributes, it lists a ton of methods/attributes that don't even apply to the class I'm working with.

我想(简单的例子),可以输入UIColor.bl并将它与UIColor.blueColor自动完成(或建议是否有与基本法是的UIColor属性启动多个选项。

I'd like to (simple example) be able to type UIColor.bl and have it autocomplete with UIColor.blueColor (or suggest if there are multiple options that start with "bl" that are properties of UIColor.

的RubyMine做到这一点非常好,如果我能得到VIM能与自动完成同样的聪明那将是天上的(并且是一大福音,同时学习RubyMotion / iOS开发。

RubyMine does this very well, and if I can get VIM to be similarly smart with autocomplete it would be heavenly (and a great boon while learning RubyMotion/iOS Development.

我自己也尝试SnipMate(甚至RubyMotion量身定制的变化在<一个href=\"https://github.com/rcyrus/snipmate-snippets-rubymotion\">https://github.com/rcyrus/snipmate-snippets-rubymotion),但是这似乎并没有提供我正在寻找任何功能。

I have also tried SnipMate (and even a RubyMotion tailored variation at https://github.com/rcyrus/snipmate-snippets-rubymotion), but that doesn't seem to offer the features I'm looking for either.

推荐答案

比较满意股票Vim的omnicomplete +的 VIM-红宝石 VIM护栏的有看齐完成能力与NetBeans但所有的钟声和放大器;的Vim口哨声和低得多的资源需求,当然

Relatively satisfied with stock Vim's omnicomplete + vim-ruby and vim-rails having completion abilities on par with NetBeans but with all the bells&whistles of Vim and much lower resource requirements, of course.

从我的.vimrc关于完成选项:

From my .vimrc concerning completion options :

autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1

这篇关于在VIM更好的自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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