Coc extensions and language servers

This commit is contained in:
Aathavan 2023-05-07 01:41:52 +00:00 committed by Brian Zalewski
parent 28d6f80855
commit 5eb80fabcc
4 changed files with 104 additions and 1 deletions

View file

@ -0,0 +1,24 @@
{
"sh.enable": true,
"dockerfile": {
"command": "docker-langserver",
"filetypes": ["Dockerfile"],
"args": ["--stdio"]
},
"sql": {
"module": "$HOME/.local/share/nvim/lib/node_modules/sql-language-server/npm_bin/cli.js",
"args": ["up", "--method", "node-ipc"],
"filetypes": ["sql", "mysql"]
},
"terraform": {
"command": "terraform-ls",
"args": ["serve"],
"filetypes": [
"terraform",
"tf"
],
"initializationOptions": {},
"settings": {}
}
}
}

View file

@ -134,7 +134,7 @@ fi
### BitWarden
# https://bitwarden.com/help/cli/#using-an-api-key
# BW_CLIENTID client_id
# BW_CLIENTID client_id
# BW_CLIENTSECRET
### Deta
@ -368,6 +368,7 @@ fi
export EDITOR='vi -e'
if command -v nvim > /dev/null; then
export VISUAL='nvim -e'
export PATH="$PATH:$HOME/.local/share/nvim/bin"
else
export VISUAL="$EDITOR"
fi

View file

@ -31,6 +31,56 @@ Plug '~/.vim/plugged/ansible-vim', {'do': './UltiSnips/generate.sh'}
call plug#end()
" TODO -- add executable checks around plugins
" Install Coc extensions
if executable('node')
let g:coc_global_extensions = [
\ 'coc-angular',
\ '@yaegassy/coc-ansible',
\ 'coc-calc',
\ 'coc-copilot',
\ 'coc-htmlhint',
\ 'coc-html-css-support',
\ 'coc-markdownlint',
\ 'coc-markdown-preview-enhanced',
\ '@yaegassy/coc-nginx',
\ 'coc-powershell',
\ 'coc-prettier',
\ 'coc-stylelint',
\ 'coc-spell-checker',
\ 'coc-yaml',
\ 'coc-xml',
\ 'coc-sh',
\ 'coc-css',
\ 'coc-deno',
\ 'coc-go',
\ 'coc-html',
\ 'coc-tsserver',
\ 'coc-json',
\ 'coc-markdownlint',
\ 'coc-phpls',
\ 'coc-pyright',
\ 'coc-solargraph',
\ 'coc-rls',
\ 'coc-solidity'
\]
if !executable('docker-langserver')
call system('npm install --prefix $HOME/.local/share/nvim -g dockerfile-language-server-nodejs')
endif
if !executable('sql-language-server')
call system('npm install --prefix $HOME/.local/share/nvim -g sql-language-server')
endif
if !executable('solargraph')
call system('gem install solargraph -n $HOME/.local/share/nvim/bin')
endif
endif
" Settings for coc-css extension
autocmd FileType scss setl iskeyword+=@-@
" Settings for coc-go extension, to add missing imports on save
autocmd BufWritePre *.go :silent call CocAction('runCommand', 'editor.action.organizeImport')
syntax enable
set background=dark
colorscheme Betelgeuse

View file

@ -1175,6 +1175,20 @@ softwarePackages:
- clamav
- clamav-update
pacman: clamav
clangd:
_bin: clangd
_desc: '[clangd](https://clangd.llvm.org/) is an language server that understands your C++ code and adds smart features to your editor'
_docs: https://clangd.llvm.org/guides/
_github: https://github.com/llvm/llvm-project/tree/main/clang-tools-extra/clangd
_home: https://clangd.llvm.org/
_name: clangd
_type: cli
apt: clangd
brew: llvm
choco: llvm
dnf: clang-tools-extra
pacman: clang
scoop: llvm
clocker:
_when: '! test -d /Applications/Clocker.app'
_bin: null
@ -4803,6 +4817,7 @@ softwarePackages:
_home: null
_name: nativefier
npm: nativefier
_service: false
_type:
nautilus-brasero:
apt: nautilus-extension-brasero
@ -4895,6 +4910,9 @@ softwarePackages:
_github: https://github.com/neovim/neovim
_home: https://neovim.io/
_name: neovim
_deps:
- clangd
- terraform-ls
apk: neovim
apt:
- neovim
@ -7233,6 +7251,16 @@ softwarePackages:
terraform:
_deps:
- tfenv
terraform-ls:
_bin: terraform-ls
_desc: '[terraform-ls](https://github.com/tfutils/tfenv) is the official Terraform language server maintained by HashiCorp that provides IDE features to any LSP-compatible editor.'
_docs: https://github.com/hashicorp/terraform-ls
_github: https://github.com/hashicorp/terraform-ls
_home: https://github.com/hashicorp/terraform-ls
_name: terraform-ls
brew: terraform-ls
_service: false
_type: cli
tfenv:
_bin: tfenv
_desc: '[tfenv](https://github.com/tfutils/tfenv) is a Terraform version manager inspired by [rbenv](https://github.com/rbenv/rbenv). It supports macOS, Linux, and Windows.'