X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/ale_linters/markdown/markdownlint.vim?ds=sidebyside diff --git a/.vim/bundle/ale/ale_linters/markdown/markdownlint.vim b/.vim/bundle/ale/ale_linters/markdown/markdownlint.vim new file mode 100644 index 00000000..424c9f24 --- /dev/null +++ b/.vim/bundle/ale/ale_linters/markdown/markdownlint.vim @@ -0,0 +1,27 @@ +" Author: Ty-Lucas Kelley +" Description: Adds support for markdownlint + +call ale#Set('markdown_markdownlint_executable', 'markdownlint') +call ale#Set('markdown_markdownlint_options', '') + +function! ale_linters#markdown#markdownlint#GetExecutable(buffer) abort + return ale#Var(a:buffer, 'markdown_markdownlint_executable') +endfunction + +function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort + let l:executable = ale_linters#markdown#markdownlint#GetExecutable(a:buffer) + + let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options') + + return ale#Escape(l:executable) + \ . (!empty(l:options) ? ' ' . l:options : '') . ' %s' +endfunction + +call ale#linter#Define('markdown', { +\ 'name': 'markdownlint', +\ 'executable': function('ale_linters#markdown#markdownlint#GetExecutable'), +\ 'lint_file': 1, +\ 'output_stream': 'both', +\ 'command': function('ale_linters#markdown#markdownlint#GetCommand'), +\ 'callback': 'ale#handlers#markdownlint#Handle' +\})