diff options
author | sadbeast <sadbeast@sadbeast.com> | 2022-09-02 15:57:00 -0700 |
---|---|---|
committer | sadbeast <sadbeast@sadbeast.com> | 2022-09-02 15:57:00 -0700 |
commit | 22e74bcebd9bc4984475bcf42984543a163d38b7 (patch) | |
tree | 499e9a05d7303616a197db1a9b210b33916a2127 | |
parent | 7613c12992a0c3a7088277018f5535a26363a8c5 (diff) | |
download | cfg-22e74bcebd9bc4984475bcf42984543a163d38b7.tar.gz cfg-22e74bcebd9bc4984475bcf42984543a163d38b7.tar.bz2 |
get rid of ale
-rw-r--r-- | .vimrc | 44 |
1 files changed, 29 insertions, 15 deletions
@@ -236,24 +236,38 @@ nmap <leader>bq :bp <BAR> bd #<CR> 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 <buffer> gd <plug>(lsp-definition) + nmap <buffer> gs <plug>(lsp-document-symbol-search) + nmap <buffer> gS <plug>(lsp-workspace-symbol-search) + nmap <buffer> gr <plug>(lsp-references) + nmap <buffer> gi <plug>(lsp-implementation) + nmap <buffer> gD <plug>(lsp-type-definition) + nmap <buffer> <leader>rn <plug>(lsp-rename) + nmap <buffer> [g <plug>(lsp-previous-diagnostic) + nmap <buffer> ]g <plug>(lsp-next-diagnostic) + nmap <buffer> K <plug>(lsp-hover) + nnoremap <buffer> <expr><c-f> lsp#scroll(+4) + nnoremap <buffer> <expr><c-d> 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 |