setup rls

Wed, 15 Aug 2018 20:12:59 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 15 Aug 2018 20:12:59 -0500
changeset 714
ec87c6a8bac5
parent 713
650ca91e3197
child 715
e5da1bdb72b6

setup rls

.vimrc file | annotate | diff | comparison | revisions
--- a/.vimrc
+++ b/.vimrc
@@ -35,6 +35,11 @@ let s:filename   = expand('<sfile>')
   Plugin 'tpope/vim-endwise'
   Plugin 'lifepillar/vim-mucomplete'
 
+  if executable('rls')
+    Plugin 'prabirshrestha/async.vim'
+    Plugin 'prabirshrestha/vim-lsp'
+  end
+
   Plugin 'vimwiki/vimwiki'
 
   Plugin 'tpope/vim-fugitive'
@@ -322,6 +327,20 @@ let g:polyglot_disabled = ['vifm']
 let g:mucomplete#enable_auto_at_startup = 1
 let g:mucomplete#chains = {'default': ['path', 'omni', 'c-n', 'tags', 'dict', 'uspl']}
 
+">> vim-lsp
+augroup vim-lsp
+  autocmd!
+
+  if executable('rls')
+    autocmd FileType rust setlocal omnifunc=lsp#complete
+    au User lsp_setup call lsp#register_server({
+      \ 'name': 'rls',
+      \ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']},
+      \ 'whitelist': ['rust'],
+      \ })
+  endif
+augroup END
+
 ">> Vimwiki
 let g:vimwiki_list = [
   \ {

mercurial