Skip to content

Instantly share code, notes, and snippets.

@noecker
Last active June 4, 2021 10:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noecker/a9234a9e849d428c68c41a21084ded29 to your computer and use it in GitHub Desktop.
Save noecker/a9234a9e849d428c68c41a21084ded29 to your computer and use it in GitHub Desktop.
ALE + Solargraph autocomplete
" I believe this to be the minimum necessary config
" to get ALE + Solargraph running with autocomplete.
"
" You must install the solargraph gem. Ideally you'll
" install to system gems so that solargraph is available
" everywhere.
"
" You may also want to run `solargraph config` from the
" root directory of any project where you want to use
" solargraph.
"
" After opening your first Ruby file in a fresh vim session,
" you'll need to wait a few seconds for Solargraph to
" start and be indexed.
" This assumes vim-plug is installed
call plug#begin('~/.vim/plugged')
Plug 'w0rp/ale' " Linting & autocomplete
call plug#end()
" ALE Settings
" Specify ruby linters, you'll likely want others enabled
let g:ale_linters = {'ruby': ['solargraph']}
" Set the executable for ALE to call to get Solargraph
" up and running in a given session
let g:ale_ruby_solargraph_executable = 'solargraph'
let g:ale_ruby_solargraph_options = {}
let g:ale_completion_enabled = 1
" Fixes the bug identified in this issue:
" https://github.com/w0rp/ale/issues/1700
set completeopt=menu,menuone,preview,noselect,noinsert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment