| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Vim/Neovim ruby autocompletion with help of solargraph and vim language server
This plugin is based on following blog post by Jamie Schembri.
Tested on:
This plugin supports linux only
Add gem bins to PATH in your .bashrc:
By default the plugin will start solargraph each time if vim is opened.
Additional you can add/modify this hotkeys to refactor and go to definition:
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>You can also add a .solargraph.yml to your project root folder to include/exclude ruby files or require additional gems:
---
include:
- "**/*.rb"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
require:
- rails
reporters: []
domains: []
plugins: []By default completion can be triggered with CTRL-X + CTRL-O
Follwing optional variables are available for your .vimrc
let g:ruby_autocomplete_solargraph = '<path to solragraph bin>'
" If you dont use rvm the path should be like:
" ~/.gem/ruby/<ruby version>/bin/solargraph
Add following in your .vimrc:
let g:completor_ruby_omni_trigger = '([$\w]{1,}|\.[\w]*|::[$\w]*)$'On default configuration pushich TAB should do the trick.
let g:neocomplete#sources#omni#input_patterns = {
\ "ruby" : '[^. *\t]\.\w*\|\h\w*::',
\}
For additional information write follwing in Vim:
:help ruby-autocomplete
Sometimes the solargraph socket server will not start by default than you need to restart vim.
There are similiar plugins to vim-ruby-autocomplete but I couldn't get them to work on my systems. That was the initial idea to write this small plugin.
| Back | FazBrowse Home | New Git URL |