diff options
| author | Adam Stankiewicz <sheerun@sher.pl> | 2013-12-13 01:37:01 +0100 | 
|---|---|---|
| committer | Adam Stankiewicz <sheerun@sher.pl> | 2013-12-13 01:37:01 +0100 | 
| commit | edd5ee63e66d9ef166034d9ac5bed132f501ecb9 (patch) | |
| tree | fba293d90821eea5e067c7b5eea3526df0f26254 /indent | |
| parent | 8a255002df1f6d02ef7ca9503be1a7d7234acef8 (diff) | |
| download | vim-polyglot-edd5ee63e66d9ef166034d9ac5bed132f501ecb9.tar.gz vim-polyglot-edd5ee63e66d9ef166034d9ac5bed132f501ecb9.zip | |
Updatev1.4.2
Diffstat (limited to 'indent')
| -rw-r--r-- | indent/html.vim | 4 | ||||
| -rw-r--r-- | indent/less.vim | 32 | 
2 files changed, 34 insertions, 2 deletions
| diff --git a/indent/html.vim b/indent/html.vim index 466c6bd8..1c34cf68 100644 --- a/indent/html.vim +++ b/indent/html.vim @@ -130,12 +130,14 @@ call add(s:tags, 'rt')  call add(s:tags, 'ruby')  call add(s:tags, 'section')  call add(s:tags, 'summary') -call add(s:tags, 'template')  call add(s:tags, 'time')  call add(s:tags, 'video')  call add(s:tags, 'bdi')  call add(s:tags, 'data') +" Web Component +call add(s:tags, 'template') +  " Common inline used SVG elements  call add(s:tags, 'clipPath')  call add(s:tags, 'defs') diff --git a/indent/less.vim b/indent/less.vim index fea8846d..6161c93c 100644 --- a/indent/less.vim +++ b/indent/less.vim @@ -6,6 +6,36 @@  if exists("b:did_indent")    finish  endif +let b:did_indent = 1 + +setlocal autoindent sw=2 et +setlocal indentexpr=GetLessIndent() +setlocal indentkeys=o,O,*<Return>,<:>,!^F + +" Only define the function once. +if exists("*GetLessIndent") +  finish +endif + +let s:property = '^\s*:\|^\s*[[:alnum:]#{}-]\+\%(:\|\s*=\)' + +function! GetLessIndent() +  let lnum = prevnonblank(v:lnum-1) +  let line = substitute(getline(lnum),'\s\+$','','') +  let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') +  let lastcol = strlen(line) +  let line = substitute(line,'^\s\+','','') +  let indent = indent(lnum) +  let cindent = indent(v:lnum) +  if line !~ s:property && cline =~ s:property +    return indent + &sw +  "elseif line =~ s:property && cline !~ s:property +    "return indent - &sw +  else +    return -1 +  endif +endfunction + +" vim:set sw=2: -runtime! indent/css.vim | 
