From 997cb69f102044cc96690b315f639c6890c0987d Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Wed, 6 Dec 2023 14:18:29 +0100 Subject: Use asyncomplete and lsp for autocomplete --- .vimrc | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index b9c5411..b3f4b60 100644 --- a/.vimrc +++ b/.vimrc @@ -3,7 +3,12 @@ set nocompatible filetype off call plug#begin('~/.vim/bundle') " Auto completion +Plug 'prabirshrestha/vim-lsp' +Plug 'mattn/vim-lsp-settings' +Plug 'prabirshrestha/asyncomplete.vim' +Plug 'prabirshrestha/asyncomplete-lsp.vim' Plug 'dense-analysis/ale' +Plug 'andreypopp/asyncomplete-ale.vim' " Essential plugins Plug 'editorconfig/editorconfig-vim' @@ -177,9 +182,32 @@ let g:ale_linters = { let g:go_gopls_gofumpt=1 let g:ale_completion_enabled = 1 let g:ale_disable_lsp = 0 - -inoremap pumvisible() ? '' : '' -inoremap pumvisible() ? '' : '' +nmap :ALEHover + +"Asyncomplete +"============ +" inoremap pumvisible() ? "\" : "\" +" inoremap pumvisible() ? "\" : "\" +" inoremap pumvisible() ? asyncomplete#close_popup() : "\" +let g:asyncomplete_auto_popup = 0 + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' +endfunction + +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ asyncomplete#force_refresh() +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? asyncomplete#close_popup() : "\" + +"vim-lsp +"======= +let g:lsp_diagnostics_enabled = 0 +let g:lsp_document_highlight_enabled = 0 +let g:lsp_document_code_action_signs_enabled = 0 "polyglot" "============= -- cgit v1.2.3