File: html_beautify.vim

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (20 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" Author: WhyNotHugo <hugo@barrera.io>
" Description: Format HTML files with html-beautify.

call ale#Set('html_beautify_executable', 'html-beautify')
call ale#Set('html_beautify_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('html_beautify_options', '')

function! ale#fixers#html_beautify#Fix(buffer) abort
    let l:executable = ale#python#FindExecutable(
    \   a:buffer,
    \   'html_beautify',
    \   ['html-beautify']
    \)

    let l:options = ale#Var(a:buffer, 'html_beautify_options')

    return {
    \   'command': ale#Escape(l:executable) . ' ' . l:options . ' -',
    \}
endfunction