summaryrefslogtreecommitdiffstats
path: root/indent/jade.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-05-02 10:42:37 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2016-05-02 10:42:37 +0200
commit5dd1a7e83966c92d220073185f1738dfe441f59e (patch)
tree9c4bee389a51a9bb111dcc894c9db0f6d1809d81 /indent/jade.vim
parentbc098370c1bb81840734f5764f431dee270e75ce (diff)
downloadvim-polyglot-5dd1a7e83966c92d220073185f1738dfe441f59e.tar.gz
vim-polyglot-5dd1a7e83966c92d220073185f1738dfe441f59e.zip
Update
Diffstat (limited to 'indent/jade.vim')
-rw-r--r--indent/jade.vim74
1 files changed, 0 insertions, 74 deletions
diff --git a/indent/jade.vim b/indent/jade.vim
deleted file mode 100644
index da29e0cf..00000000
--- a/indent/jade.vim
+++ /dev/null
@@ -1,74 +0,0 @@
-if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jade') == -1
-
-" Vim indent file
-" Language: Jade
-" Maintainer: Joshua Borton
-" Credits: Tim Pope (vim-jade)
-" Last Change: 2010 Sep 22
-
-if exists("b:did_indent")
- finish
-endif
-
-unlet! b:did_indent
-let b:did_indent = 1
-
-setlocal autoindent
-setlocal indentexpr=GetJadeIndent()
-setlocal indentkeys=o,O,*<Return>,},],0),!^F
-
-" Only define the function once.
-if exists("*GetJadeIndent")
- finish
-endif
-
-let s:attributes = '\%((.\{-\})\)'
-let s:tag = '\([%.#][[:alnum:]_-]\+\|'.s:attributes.'\)*[<>]*'
-
-if !exists('g:jade_self_closing_tags')
- let g:jade_self_closing_tags = 'meta|link|img|hr|br|input'
-endif
-
-setlocal formatoptions+=r
-setlocal comments+=n:\|
-
-function! GetJadeIndent()
- let lnum = prevnonblank(v:lnum-1)
- if lnum == 0
- return 0
- endif
- 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)
- let increase = indent + &sw
- if indent == indent(lnum)
- let indent = cindent <= indent ? -1 : increase
- endif
-
- let group = synIDattr(synID(lnum,lastcol,1),'name')
-
- if line =~ '^!!!'
- return indent
- elseif line =~ '^/\%(\[[^]]*\]\)\=$'
- return increase
- elseif line =~ '^\%(if\|else\|unless\|for\|each\|block\|mixin\|append\|case\|when\)'
- return increase
- elseif line =~ '^'.s:tag.'[&!]\=[=~-].*,\s*$'
- return increase
- elseif line == '-#'
- return increase
- elseif line =~? '^\v%('.g:jade_self_closing_tags.')>'
- return indent
- elseif group =~? '\v^%(jadeAttributesDelimiter|jadeClass|jadeId|htmlTagName|htmlSpecialTagName|jadeFilter|jadeTagBlockChar)$'
- return increase
- else
- return indent
- endif
-endfunction
-
-" vim:set sw=2:
-
-endif