From 90654028f094cfe841fc021ba6f085cad4ae7186 Mon Sep 17 00:00:00 2001 From: bretello Date: Mon, 12 Aug 2024 18:05:51 +0200 Subject: [PATCH] vim: improve yaml handling (ansible/gha) --- vim/plugins_config.vim | 8 +++++--- vim/vimrc | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/vim/plugins_config.vim b/vim/plugins_config.vim index ae32b99..072b7bb 100644 --- a/vim/plugins_config.vim +++ b/vim/plugins_config.vim @@ -40,16 +40,18 @@ let g:ale_python_mypy_options = '--ignore-missing-imports' let g:ale_rust_cargo_use_clippy = 1 let g:ale_linters = { - \ 'bash': ['bash-language-server', 'bashlint', 'shellcheck'], + \ 'bash': ['bash-language-server', 'bashlint', 'shellcheck', 'shell'], \ 'dockerfile': ['hadolint'], - \ 'zsh': ['bashlint', 'shellcheck'], + \ 'zsh': ['bashlint', 'shellcheck', 'shell'], \ 'c': ['ccls', 'clangd'], \ 'cpp': ['clangd'], \ 'qml': ['qmllint'], \ 'python': ['pylsp', 'mypy', 'ruff'], \ 'go': ['gopls', 'gobuild'], \ 'rust': ['analyzer', 'cargo'], - \ 'yaml': ['yamllint'], + \ 'yaml.gha': ['actionlint', 'yamllint', 'yaml-language-server'], + \ 'yaml.ansible': ['yamllint', 'ansible-language-server', 'ansible-lint', 'yaml-language-server'], + \ 'yaml': ['yaml-language-server', 'yamllint'], \ 'javascript': ['yarn lint', 'eslint'], \ 'xml': ['android'], \ 'groovy': ['android'], diff --git a/vim/vimrc b/vim/vimrc index d5c92da..9f8557c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -95,11 +95,13 @@ augroup END augroup ansible au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible + au BufRead,BufNewFile */tasks/*.yml set filetype=yaml.ansible + au BufRead,BufNewFile playbook.yml set filetype=yaml.ansible augroup END augroup githubactions - au BufRead,BufNewFile */.github/*/*.y{,a}ml - \ let b:ale_linters = {'yaml': ['actionlint'] } + au BufRead,BufReadPost,BufNewFile */.github/*/*.y{,a}ml set filetype=yaml.gha + ""|let b:ale_linters = {'yaml': ['actionlint']} augroup END augroup iptables