Migrating to Vim from RubyMine - Interpreted Auto completion

后端 未结 1 635
梦毁少年i
梦毁少年i 2021-02-10 19:51

Up until last week, I had been using RubyMine for my Rails development. I know it has a vim plugin but I have been working on migrating my development to vim and tmux. I don\'t

相关标签:
1条回答
  • 2021-02-10 20:27

    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!)

    enter image description here

    0 讨论(0)
提交回复
热议问题