|
|
@ -57,8 +57,9 @@ else |
|
|
|
Plug 'junegunn/seoul256.vim' |
|
|
|
endif |
|
|
|
|
|
|
|
Plug 'prabirshrestha/asyncomplete.vim' |
|
|
|
Plug 'prabirshrestha/vim-lsp' |
|
|
|
Plug 'mattn/vim-lsp-settings' |
|
|
|
Plug 'prabirshrestha/asyncomplete.vim' |
|
|
|
Plug 'prabirshrestha/asyncomplete-lsp.vim' |
|
|
|
|
|
|
|
Plug 'Townk/vim-autoclose' |
|
|
@ -232,49 +233,3 @@ inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" |
|
|
|
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" |
|
|
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>" |
|
|
|
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif |
|
|
|
|
|
|
|
" register language servers below. |
|
|
|
" |
|
|
|
if executable('clangd') |
|
|
|
au User lsp_setup call lsp#register_server({ |
|
|
|
\ 'name': 'clangd', |
|
|
|
\ 'cmd': {server_info->['clangd', '-background-index']}, |
|
|
|
\ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'], |
|
|
|
\ }) |
|
|
|
endif |
|
|
|
|
|
|
|
if executable('pyls') |
|
|
|
au User lsp_setup call lsp#register_server({ |
|
|
|
\ 'name': 'pyls', |
|
|
|
\ 'cmd': {server_info->['pyls']}, |
|
|
|
\ 'whitelist': ['python'], |
|
|
|
\ }) |
|
|
|
endif |
|
|
|
|
|
|
|
if executable('texlab') |
|
|
|
autocmd User lsp_setup call lsp#register_server({ |
|
|
|
\'name': 'texlab', |
|
|
|
\'cmd': {server_info->['texlab']}, |
|
|
|
\'whitelist': ['tex', 'bib'] |
|
|
|
\}) |
|
|
|
endif |
|
|
|
|
|
|
|
if executable('gopls') |
|
|
|
au User lsp_setup call lsp#register_server({ |
|
|
|
\ 'name': 'gopls', |
|
|
|
\ 'cmd': {server_info->['gopls', '-remote=auto']}, |
|
|
|
\ 'allowlist': ['go', 'gomod', 'gohtmltmpl', 'gotexttmpl'], |
|
|
|
\ }) |
|
|
|
autocmd BufWritePre *.go |
|
|
|
\ call execute('LspDocumentFormatSync') | |
|
|
|
\ call execute('LspCodeActionSync source.organizeImports') |
|
|
|
endif |
|
|
|
|
|
|
|
if executable('typescript-language-server') |
|
|
|
au User lsp_setup call lsp#register_server({ |
|
|
|
\ 'name': 'javascript support using typescript-language-server', |
|
|
|
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']}, |
|
|
|
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'package.json'))}, |
|
|
|
\ 'whitelist': ['javascript', 'javascript.jsx', 'javascriptreact', 'typescript', 'typescriptreact'], |
|
|
|
\ }) |
|
|
|
endif |