Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Disable WAI-ARIA attribute support:

let g:html5_aria_attributes_complete = 0

Align attributes on the first attribute (instead of the last) inside HTML tags:

let g:html5_align_on_first_attribute = 1

## Change Log

### Version 0.27
Expand Down
6 changes: 5 additions & 1 deletion indent/html.vim
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ if exists("*HtmlIndent") && !exists('g:force_reload_html')
finish
endif

if !exists('g:html5_align_on_first_attribute')
let g:html5_align_on_first_attribute = 0
endif

" Allow for line continuation below.
let s:cpo_save = &cpo
set cpo-=C
Expand Down Expand Up @@ -915,7 +919,7 @@ func! s:InsideTag(foundHtmlString)
" <tag>text</tag>text<tag attr=
" For long lines search for the first match, finding the last match
" gets very slow.
if len(text) < 300
if g:html5_align_on_first_attribute == 0 && len(text) < 300
let idx = match(text, '.*\s\zs[_a-zA-Z0-9-]\+="')
else
let idx = match(text, '\s\zs[_a-zA-Z0-9-]\+="')
Expand Down