From 703a145d6b9a4484b488ba99f7d289a3f1a2a84c Mon Sep 17 00:00:00 2001 From: surtur Date: Sun, 30 Oct 2022 02:44:44 +0100 Subject: [PATCH] vimrc: update ALE linter/fixer settings --- .vim/vimrc | 55 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/.vim/vimrc b/.vim/vimrc index 50bc9af..33c2b9b 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -213,21 +213,52 @@ let g:ale_hover_to_preview = 1 let g:ale_lsp_suggestions = 1 let g:ale_open_list = 0 -let g:ale_keep_list_window_open = 0 -let g:ale_list_window_size = 5 -let g:ale_lint_on_text_changed = 'normal' +let g:ale_list_vertical = 0 +let g:ale_keep_list_window_open = 0 " no +" Show 5 lines of errors (default: 10) +let g:ale_list_window_size = 7 +" Run ale upon opening a file. +let g:ale_lint_on_enter = 1 +" Do not run ale upon changes to the file. +" let g:ale_lint_on_text_changed = 'never' +let g:ale_lint_on_text_changed = 'always' +" Run ale after leaving insert mode. let g:ale_lint_on_insert_leave = 1 -let g:ale_lint_delay = 1000| " the default being 200 -let g:ale_completion_autoimport = 1 -let g:ale_linters = { 'go': ['gopls', 'govet', 'golint'], +let g:ale_lint_delay = 300| " the default being 200 + +let g:ale_linters = { + \ 'go': ['gofumpt', 'govet', 'gofmt', 'golangci-lint', 'gopls'], \ 'dockerfile': ['hadolint'], + \ 'c': ['clang-format', 'clangd', 'clangtidy', 'cppcheck', 'cquery', 'flawfinder'], + \ 'cpp': ['clang-format', 'g++', 'clang', 'clangd', 'clangtidy', 'cppcheck', 'flawfinder'], \ 'cs': ['OmniSharp'], - \ 'c': ['clang-format', 'ccls', 'clangd', 'clangtidy', 'cppcheck', 'cquery', 'flawfinder'], - \ 'cpp': ['clang-format','ccls', 'clangd', 'clangtidy', 'cppcheck', 'flawfinder'], - \ 'tf': ['tflint', 'terraform', 'tfsec', 'checkov'] } -let g:ale_fixers = { 'c': ['ccls', 'clang-format', 'clangtidy', 'cppcheck', 'cquery', 'flawfinder'], - \ 'cpp': ['clang-format', 'clangtidy', 'cppcheck', 'flawfinder'], - \ 'go': ['gopls'] } + \ 'hare': ['hare', 'vimls', 'vim-lsp'], + \ 'lua': ['vimls'], + \ 'nix': ['rnix_lsp', 'statix', 'nixpkgs-fmt', 'vimls'], + \ 'python': ['vim-lsp', 'pylint', 'yapf', 'isort'], + \ 'rust': ['analyzer', 'cargo', 'rls', 'vimls'], + \ 'sh': ['shellcheck', 'shfmt', 'shell', 'vimls'], + \ 'bash': ['shellcheck', 'shfmt', 'shell', 'vimls'], + \ 'systemd': ['systemd_analyze', 'systemdlint'], + \ 'vim': ['vint', 'vimls', 'vim-lsp'], + \ 'tex': ['chktex', 'vimls'], + \ 'tf': ['vimls', 'vim-lsp', 'tflint', 'terraform', 'tfsec', 'checkov'], + \ 'terraform': ['vimls', 'vim-lsp', 'tflint', 'terraform', 'tfsec', 'checkov'], + \ 'yaml': ['yaml-language-server', 'spectral', 'swaglint','yamllint'], + \ 'zsh': ['shellcheck', 'shell', 'vimls'], + \ } +let g:ale_fixers = { 'c': ['clang-format', 'clangd', 'clangtidy', 'cquery', 'flawfinder'], + \ 'cpp': ['clang-format', 'clangtidy'], + \ 'python': ['nayvy#ale_fixer', 'isort', 'yapf'], + \ 'go': ['gofumpt'], + \ 'nix': ['nixpkgs-fmt'], + \ 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines'], + \ 'vim': ['vint', 'vimls', 'generic'], + \ 'sh': ['shfmt'], + \ 'bash': ['shfmt'], + \ 'yaml': ['yamlfix'], + \ } + if has('patch-8.1.1880') " set completeopt=longest,menuone,popuphidden