vim-lsp設定

よく使うやつ

perl

cpan i PLS

if executable('pls')
    au User lsp_setup call lsp#register_server({
                \ 'name': 'perl',
                \ 'cmd': ['pls'],
                \ 'allowlist': ['perl'],
                \ })
endif

bash

npm i -g bash-language-server

if executable('bash-language-server')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'bash-language-server',
        \ 'cmd': ['bash-language-server', 'start'],
        \ 'allowlist': ['sh', 'bash'],
        \ })
endif

vim

npm i -g vim-language-server

if executable('vim-language-server')
  au User lsp_setup call lsp#register_server({
        \ 'name': 'vm-ls',
        \ 'cmd': ['vim-language-server', '--stdio'],
        \ 'allowlist': ['vim'],
        \ })
endif

terraform

https://www.hashicorp.com/official-packaging-guide
この公式レポジトリからterraform-lsをapt install

if executable('terraform-ls')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'terraform-ls',
        \ 'cmd': ['terraform-ls', 'serve'],
        \ 'allowlist': ['terraform'],
        \ })
endif

python

pip install python-lsp-server

if executable('pylsp')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pylsp',
        \ 'cmd': {server_info->['pylsp']},
        \ 'allowlist': ['python'],
        \ })
endif