This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/apps/neovim/ftplugin/elixir.vim

32 lines
659 B
VimL
Raw Normal View History

2019-06-25 15:57:42 -05:00
let g:elixirls = {
2020-01-22 08:34:12 -06:00
\ 'path': printf('%s/%s', stdpath('config'), 'bundle/elixir-ls'),
\ }
2019-06-25 15:57:42 -05:00
let g:elixirls.lsp = printf(
2020-01-22 08:34:12 -06:00
\ '%s/%s',
\ g:elixirls.path,
\ 'release/language_server.sh')
2019-06-25 15:57:42 -05:00
function! g:elixirls.compile(...)
2020-01-22 08:34:12 -06:00
let l:commands = join([
\ 'mix local.hex --force',
\ 'mix local.rebar --force',
\ 'mix deps.get',
\ 'mix compile',
\ 'mix elixir_ls.release'
\ ], '&&')
2019-06-25 15:57:42 -05:00
2020-01-22 08:34:12 -06:00
echom '>>> Compiling elixirls'
silent call system(l:commands)
echom '>>> elixirls compiled'
2019-06-25 15:57:42 -05:00
endfunction
call coc#config('languageserver', {
2020-01-22 08:34:12 -06:00
\ 'elixir': {
\ 'command': g:elixirls.lsp,
\ 'trace.server': 'verbose',
\ 'filetypes': ['elixir', 'eelixir']
\ }
\})