diff options
| author | Ahmed Abdelhalim <[email protected]> | 2023-12-06 14:18:29 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2023-12-06 14:18:29 +0100 |
| commit | 997cb69f102044cc96690b315f639c6890c0987d (patch) | |
| tree | 06f1ffdbc537929f07c5cf3fda2c2aa82d76435f /.vimrc | |
| parent | cdaf40a090ca92b1d840fad4e6a705d66b0042f1 (diff) | |
Use asyncomplete and lsp for autocomplete
Diffstat (limited to '.vimrc')
| -rw-r--r-- | .vimrc | 34 |
1 files changed, 31 insertions, 3 deletions
@@ -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 <expr> <TAB> pumvisible() ? '<C-n>' : '<TAB>' -inoremap <expr> <S-TAB> pumvisible() ? '<C-p>' : '<C-h>' +nmap <C-@> :ALEHover<cr> + +"Asyncomplete +"============ +" inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" +" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" +" inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>" +let g:asyncomplete_auto_popup = 0 + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' +endfunction + +inoremap <silent><expr> <TAB> + \ pumvisible() ? "\<C-n>" : + \ <SID>check_back_space() ? "\<TAB>" : + \ asyncomplete#force_refresh() +inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" +inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>" + +"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" "============= |
