Browse Source

automatic lsp installation

master
Juni Kim 2 years ago
parent
commit
c3c3d41364
  1. 49
      lsp.vimrc
  2. 1
      noplug.vimrc

49
lsp.vimrc

@ -57,8 +57,9 @@ else
Plug 'junegunn/seoul256.vim' Plug 'junegunn/seoul256.vim'
endif endif
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/vim-lsp' Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim' Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'Townk/vim-autoclose' 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> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>" inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>"
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif 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

1
noplug.vimrc

@ -94,7 +94,6 @@ let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
"===================COLORSCHEME====================================== "===================COLORSCHEME======================================
" " _____ _ ___ ___ ___ " " " _____ _ ___ ___ ___ "

Loading…
Cancel
Save