From cf9a69eede8b5a17c914dfe0c8ebb0f079a195c9 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Tue, 29 Oct 2019 12:33:08 -0700 Subject: [PATCH] Install and configure new text linters --- install-language-servers.sh | 5 +++++ vim/rc/plugins.rc.vim | 33 +++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/install-language-servers.sh b/install-language-servers.sh index 7ef6dce..9c79994 100755 --- a/install-language-servers.sh +++ b/install-language-servers.sh @@ -31,6 +31,11 @@ pip3 install --user vim-vint pip install --user yamllint pip3 install --user yamllint +# Text / Markdown +npm install -g alex +pip install --user proselint +pip3 install --user proselint + # Makefile # https://github.com/mrtazz/checkmake diff --git a/vim/rc/plugins.rc.vim b/vim/rc/plugins.rc.vim index 58cbcc9..f642d78 100644 --- a/vim/rc/plugins.rc.vim +++ b/vim/rc/plugins.rc.vim @@ -62,29 +62,34 @@ elseif has('nvim') || v:version >= 800 " NOTE: Some of these are installed when bootstrapping environment, " outside of vim setup let g:ale_linters = { - \ 'go': ['gopls', 'golint', 'gometalinter'], - \ 'python': ['pyls', 'flake8', 'mypy', 'pylint'], - \ 'rust': ['rls', 'cargo'], - \ 'sh': ['language_server', 'shell', 'shellcheck'], + \ 'go': ['gopls', 'golint', 'gometalinter'], + \ 'python': ['pyls', 'flake8', 'mypy', 'pylint'], + \ 'rust': ['rls', 'cargo'], + \ 'sh': ['language_server', 'shell', 'shellcheck'], + \ 'text': ['proselint', 'alex'], \} + let g:ale_linter_aliases = { + \ 'markdown': ['text'], + \} + " More than a few languages use the same fixers + let s:ale_pretty_trim_fixer = ['prettier', 'trim_whitespace', 'remove_trailing_lines'] let g:ale_fixers = { - \ 'go': ['gofmt', 'goimports'], - \ 'json': ['prettier', 'remove_trailing_lines'], - \ 'markdown': ['trim_whitespace', 'remove_trailing_lines'], - \ 'rust': ['rustfmt'], - \ 'yaml': ['prettier', 'remove_trailing_lines'], + \ 'go': ['gofmt', 'goimports'], + \ 'json': s:ale_pretty_trim_fixer, + \ 'rust': ['rustfmt'], + \ 'markdown': s:ale_pretty_trim_fixer, + \ 'yaml': ['prettier', 'remove_trailing_lines'], + \ 'css': s:ale_pretty_trim_fixer, + \ 'javascript': s:ale_pretty_trim_fixer, \} - " Auto-complete from ALE, possible alternative to asyncomplete - " let g:ale_completion_enabled = 1 - " Enable asyncomplete Plug 'prabirshrestha/asyncomplete.vim' " Add ALE to asyncomplete augroup acomp_setup au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#ale#get_source_options({ - \ 'priority': 10, - \ })) + \ 'priority': 10, + \ })) augroup end " let g:asyncomplete_auto_popup = 0