From e9a89ded251e31a5486784e3f033cfb14ee0c2d4 Mon Sep 17 00:00:00 2001 From: gurkenhabicht Date: Sun, 12 Nov 2023 19:53:07 +0100 Subject: [PATCH] added rust lsp support --- vim/.vim/after/ftplugin/rust.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 vim/.vim/after/ftplugin/rust.vim diff --git a/vim/.vim/after/ftplugin/rust.vim b/vim/.vim/after/ftplugin/rust.vim new file mode 100644 index 0000000..2e0bcd5 --- /dev/null +++ b/vim/.vim/after/ftplugin/rust.vim @@ -0,0 +1,17 @@ +syntax enable +filetype plugin indent on +set omnifunc=ale#completion#OmniFunc +" set omnifunc+=syntaxcomplete#Complete +" set omnifunc=ale#completion#Complete + +let g:ale_completion_enabled = 1 +let g:ale_completion_autoimport = 1 +let g:ale_sign_column_always = 1 +let g:ale_fix_on_save = 1 + +" The following lines are needed to provide compatibility between +" rust-analyzer and ALE. When this is not included ALE omnifunc completion +" locks up completely at autocomplete +let g:ale_fixers = { 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines'] } +let g:ale_rust_rls_executable = 'rust-analyzer' +let g:ale_rust_rls_toolchain = ''