Migrating to Vim from RubyMine - Interpreted Auto completion

主宰稳场 提交于 2019-12-03 08:31:35

Important Note This solution only works for Ruby 1.9+

I forked 'vim-ruby' at https://github.com/zxiest/vim-ruby and modified it as such:

  • Method signatures now appear in completion.
  • I disabled sorting by name for methods.

Plugins and Settings

vim-rails I'm using vim-rails https://github.com/tpope/vim-rails

supertab I'm using supertab https://github.com/ervandew/supertab instead of YouCompleteMe (mentioned in my question) although YouCompleteMe is super fast and automatic but there are currently some compatibility issues between my it and my vim-ruby fork.

vim-easytags I'm using vim-easytags https://github.com/xolox/vim-easytags

Add this to your ~/.vimrc

:set tags=./tags;
:let g:easytags_dynamic_files = 1

Make sure to touch ./tags in your project directory.

Issue :UpdateTags -R **/*.* from vim in order for easytags to generate your tags file.

Remap omnicomplete

In order for omnicomplete to pop up, by default, we have to hit <C-X><C-O>. I remapped this to <C-Space> by inserting the following in my ~/.vimrc:

inoremap <C-@> <C-x><C-o>

I now press tab when I want supertab to complete my code and Ctrl+Space when I want omnicomplete to trigger and show method signatures for me. There's definitely a better way to integrate this (i.e. getting supertab to call omnicomplete after a dot)

And here goes the screenshot! Notice that method sorting being off allowed my custom resize method to appear on top and the signatures now appear in the completion (as well as in the editor when enter is pressed!)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!