diff --git a/home/dot_config/nvim/coc-settings.json b/home/dot_config/nvim/coc-settings.json new file mode 100644 index 00000000..4c7fb31e --- /dev/null +++ b/home/dot_config/nvim/coc-settings.json @@ -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": {} + } + } +} diff --git a/home/dot_config/shell/exports.sh.tmpl b/home/dot_config/shell/exports.sh.tmpl index 61311cb6..0262068f 100644 --- a/home/dot_config/shell/exports.sh.tmpl +++ b/home/dot_config/shell/exports.sh.tmpl @@ -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 diff --git a/home/dot_config/vim/vimrc b/home/dot_config/vim/vimrc index 5182328f..d40b9069 100644 --- a/home/dot_config/vim/vimrc +++ b/home/dot_config/vim/vimrc @@ -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 diff --git a/software.yml b/software.yml index 45ea1899..1a66e1af 100644 --- a/software.yml +++ b/software.yml @@ -1237,6 +1237,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 @@ -4881,6 +4895,7 @@ softwarePackages: _home: null _name: nativefier npm: nativefier + _service: false _type: nautilus-brasero: apt: nautilus-extension-brasero @@ -4973,6 +4988,9 @@ softwarePackages: _github: https://github.com/neovim/neovim _home: https://neovim.io/ _name: neovim + _deps: + - clangd + - terraform-ls apk: neovim apt: - neovim @@ -7332,6 +7350,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.'