From 22e74bcebd9bc4984475bcf42984543a163d38b7 Mon Sep 17 00:00:00 2001 From: sadbeast Date: Fri, 2 Sep 2022 15:57:00 -0700 Subject: get rid of ale --- .vimrc | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/.vimrc b/.vimrc index 3fd2ba5..a3db86d 100644 --- a/.vimrc +++ b/.vimrc @@ -236,24 +236,38 @@ nmap bq :bp bd # colorscheme base16-tomorrow-night -" ALE -let g:ale_fixers = { -\ '*': ['remove_trailing_lines', 'trim_whitespace'], -\ 'javascript': ['eslint'], -\ 'ruby': ['rubocop'], -\} -let g:ale_set_balloons=1 - -" 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 - " Load all plugins now. " Plugins need to be added to runtimepath before helptags can be generated. packloadall " Load all of the helptags now, after plugins have been loaded. " All messages and errors will be ignored. silent! helptags ALL + +function! s:on_lsp_buffer_enabled() abort + setlocal omnifunc=lsp#complete + setlocal signcolumn=yes + if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif + nmap gd (lsp-definition) + nmap gs (lsp-document-symbol-search) + nmap gS (lsp-workspace-symbol-search) + nmap gr (lsp-references) + nmap gi (lsp-implementation) + nmap gD (lsp-type-definition) + nmap rn (lsp-rename) + nmap [g (lsp-previous-diagnostic) + nmap ]g (lsp-next-diagnostic) + nmap K (lsp-hover) + nnoremap lsp#scroll(+4) + nnoremap lsp#scroll(-4) + + let g:lsp_format_sync_timeout = 1000 + autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync') + + " refer to doc to add more commands +endfunction + +augroup lsp_install + au! + " call s:on_lsp_buffer_enabled only for languages that has the server registered. + autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() +augroup END -- cgit v1.2.3