Lines Matching refs:indent
1 " Vim indent script for HTML
6 " Description: HTML indent script with cached state for faster indenting on a
12 " indent/html.vim (2006 Jun 05) from J. Zellner
13 " indent/css.vim (2006 Dec 20) from N. Weibull
28 " Load the Javascript indent script first, it defines GetJavascriptIndent().
30 " Load base python indent.
32 runtime! indent/javascript.vim
118 \,"auto": "indent(prevnonblank(v:lnum-1))"
283 let s:curind = 0 " relative indent steps for current line [unit &sw]:
284 let s:nextrel = 0 " relative indent steps for next line [unit &sw]:
295 let s:curind = 0 " relative indent steps for current line [unit &sw]:
296 let s:nextrel = 0 " relative indent steps for next line [unit &sw]:
335 " else ind==0 (other tag found): keep indent
355 " save allover indent for the endtag
416 " indent for the block type, so that when we do not know the indent we do
422 " baseindent use this indent for line a:lnum as a start - kind of
425 " blocktagind indent for current opening (get) and closing (set)
456 " look back to get indent of comment opener
478 let state.blocktagind = indent(stopline) + (s:curind + s:nextrel) * shiftwidth()
488 let state.baseindent = indent(bline) + (s:curind + s:nextrel) * shiftwidth()
509 let state.blocktagind = indent(comlnum) + (s:curind + s:nextrel) * shiftwidth()
516 " Check a:lnum-1 for closing comment (we need indent from the opening line).
528 let state.baseindent = indent(comlnum) + (s:curind + s:nextrel) * shiftwidth()
542 let state.baseindent = indent(start_lnum)
563 let state.baseindent = indent(state.lnum) + s:nextrel * shiftwidth()
570 " Indent inside a <pre> block: Keep indent as-is.
576 " Return the indent inside a <script> block for javascript.
585 " indent for <script> itself
589 " indent for the first line after <script>
593 " indent for further lines
600 " Return the indent inside a <style> block.
604 " indent for first content line
610 " Indending inside a <style> block. Returns the indent.
617 " Adopted $VIMRUNTIME/indent/css.vim
629 " Just below the <style> tag, indent for first content line after comments.
640 return indent(align_lnum)
647 " add indent after {
664 " systems) reduce indent if previous line is a continuation line
672 " Continuation line has extra indent if the previous line was not a
680 " less indent below a continuation line
700 " do not reduce indent below @{ ... }
709 " if no extra indent yet...
720 return indent(align_lnum) + extra
757 if indent(".") == virtcol(".") - 1
801 " Return the indent for a comment: <!-- -->
811 return indent(lnum)
823 return indent(prevlnum) + shiftwidth()
830 return indent(prevlnum)
833 " Return the indent for conditional comment: <!--[ ![endif]-->
841 return indent(lnum)
850 " Avoids using the indent of a continuation line.
904 " Indenting inside a start tag. Return the correct indent or -1 if unknown.
915 " If there is a double quote in the previous line, indent with the
922 return indent(lnum)
949 " after just "<tag" indent two levels more
965 " THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum.
969 " First non-blank line has no indent.
992 let indent = s:InsideTag(foundHtmlString)
993 if indent >= 0
996 return indent
1019 " calc indent for REST OF LINE (may start more blocks):
1022 let indent = b:hi_indent.blocktagind + s:curind * indentunit
1023 let b:hi_newstate.baseindent = indent + s:nextrel * indentunit
1025 let indent = s:Alien{b:hi_indent.block}()
1030 " indent this line with alien method
1031 let indent = s:Alien{b:hi_indent.block}()
1053 let indent = indent(start_lnum)
1057 let indent += s:nextrel * shiftwidth()
1059 let indent += s:curind * shiftwidth()
1064 let indent = b:hi_indent.baseindent
1066 let b:hi_newstate.baseindent = indent
1069 let indent = b:hi_indent.baseindent
1070 let b:hi_newstate.baseindent = indent + (s:curind + s:nextrel) * indentunit
1076 return indent