Coc extensions and language servers
This commit is contained in:
parent
28d6f80855
commit
5eb80fabcc
4 changed files with 104 additions and 1 deletions
24
home/dot_config/nvim/coc-settings.json
Normal file
24
home/dot_config/nvim/coc-settings.json
Normal 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": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -368,6 +368,7 @@ fi
|
||||||
export EDITOR='vi -e'
|
export EDITOR='vi -e'
|
||||||
if command -v nvim > /dev/null; then
|
if command -v nvim > /dev/null; then
|
||||||
export VISUAL='nvim -e'
|
export VISUAL='nvim -e'
|
||||||
|
export PATH="$PATH:$HOME/.local/share/nvim/bin"
|
||||||
else
|
else
|
||||||
export VISUAL="$EDITOR"
|
export VISUAL="$EDITOR"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -31,6 +31,56 @@ Plug '~/.vim/plugged/ansible-vim', {'do': './UltiSnips/generate.sh'}
|
||||||
call plug#end()
|
call plug#end()
|
||||||
" TODO -- add executable checks around plugins
|
" 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
|
syntax enable
|
||||||
set background=dark
|
set background=dark
|
||||||
colorscheme Betelgeuse
|
colorscheme Betelgeuse
|
||||||
|
|
28
software.yml
28
software.yml
|
@ -1175,6 +1175,20 @@ softwarePackages:
|
||||||
- clamav
|
- clamav
|
||||||
- clamav-update
|
- clamav-update
|
||||||
pacman: clamav
|
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:
|
clocker:
|
||||||
_when: '! test -d /Applications/Clocker.app'
|
_when: '! test -d /Applications/Clocker.app'
|
||||||
_bin: null
|
_bin: null
|
||||||
|
@ -4803,6 +4817,7 @@ softwarePackages:
|
||||||
_home: null
|
_home: null
|
||||||
_name: nativefier
|
_name: nativefier
|
||||||
npm: nativefier
|
npm: nativefier
|
||||||
|
_service: false
|
||||||
_type:
|
_type:
|
||||||
nautilus-brasero:
|
nautilus-brasero:
|
||||||
apt: nautilus-extension-brasero
|
apt: nautilus-extension-brasero
|
||||||
|
@ -4895,6 +4910,9 @@ softwarePackages:
|
||||||
_github: https://github.com/neovim/neovim
|
_github: https://github.com/neovim/neovim
|
||||||
_home: https://neovim.io/
|
_home: https://neovim.io/
|
||||||
_name: neovim
|
_name: neovim
|
||||||
|
_deps:
|
||||||
|
- clangd
|
||||||
|
- terraform-ls
|
||||||
apk: neovim
|
apk: neovim
|
||||||
apt:
|
apt:
|
||||||
- neovim
|
- neovim
|
||||||
|
@ -7233,6 +7251,16 @@ softwarePackages:
|
||||||
terraform:
|
terraform:
|
||||||
_deps:
|
_deps:
|
||||||
- tfenv
|
- 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:
|
tfenv:
|
||||||
_bin: 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.'
|
_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.'
|
||||||
|
|
Loading…
Reference in a new issue