mirror of
https://github.com/tpope/vim-haml.git
synced 2025-12-08 10:04:47 +08:00
Compare commits
6 Commits
vim9.0
...
8b526e7e1b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b526e7e1b | ||
|
|
c30ee7d885 | ||
|
|
95a095a4d2 | ||
|
|
2824214c61 | ||
|
|
98d9d7d170 | ||
|
|
5b68e31c8b |
@@ -16,13 +16,18 @@ setlocal commentstring=//\ %s
|
|||||||
setlocal includeexpr=SassIncludeExpr(v:fname)
|
setlocal includeexpr=SassIncludeExpr(v:fname)
|
||||||
setlocal omnifunc=csscomplete#CompleteCSS
|
setlocal omnifunc=csscomplete#CompleteCSS
|
||||||
setlocal suffixesadd=.sass,.scss,.css
|
setlocal suffixesadd=.sass,.scss,.css
|
||||||
if &filetype =~# '\<s[ac]ss]\>'
|
if &filetype =~# '\<s[ac]ss\>'
|
||||||
setlocal iskeyword+=-
|
setlocal iskeyword+=-
|
||||||
setlocal iskeyword+=$
|
setlocal iskeyword+=$
|
||||||
setlocal iskeyword+=%
|
setlocal iskeyword+=%
|
||||||
let b:undo_ftplugin .= ' isk<'
|
let b:undo_ftplugin .= ' isk<'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if get(g:, 'sass_recommended_style', 1)
|
||||||
|
setlocal shiftwidth=2 softtabstop=2 expandtab
|
||||||
|
let b:undo_ftplugin .= ' sw< sts< et<'
|
||||||
|
endif
|
||||||
|
|
||||||
let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@='
|
let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@='
|
||||||
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if exists("b:did_indent")
|
|||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
setlocal autoindent sw=2 et
|
setlocal autoindent
|
||||||
setlocal indentexpr=GetSassIndent()
|
setlocal indentexpr=GetSassIndent()
|
||||||
setlocal indentkeys=o,O,*<Return>,<:>,!^F
|
setlocal indentkeys=o,O,*<Return>,<:>,!^F
|
||||||
|
|
||||||
@@ -26,10 +26,8 @@ function! GetSassIndent()
|
|||||||
let lnum = prevnonblank(v:lnum-1)
|
let lnum = prevnonblank(v:lnum-1)
|
||||||
let line = substitute(getline(lnum),'\s\+$','','')
|
let line = substitute(getline(lnum),'\s\+$','','')
|
||||||
let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
|
let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
|
||||||
let lastcol = strlen(line)
|
|
||||||
let line = substitute(line,'^\s\+','','')
|
let line = substitute(line,'^\s\+','','')
|
||||||
let indent = indent(lnum)
|
let indent = indent(lnum)
|
||||||
let cindent = indent(v:lnum)
|
|
||||||
if line !~ s:property && line !~ s:extend && cline =~ s:property
|
if line !~ s:property && line !~ s:extend && cline =~ s:property
|
||||||
return indent + shiftwidth()
|
return indent + shiftwidth()
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -59,13 +59,14 @@ syn match hamlHelper "\<action_view?\|\<block_is_haml?\|\<is_haml?\|\.\@<!\<f
|
|||||||
syn keyword hamlHelper capture_haml escape_once find_and_preserve haml_concat haml_indent haml_tag html_attrs html_esape init_haml_helpers list_of non_haml precede preserve succeed surround tab_down tab_up page_class contained containedin=@hamlEmbeddedRuby,@hamlRubyTop
|
syn keyword hamlHelper capture_haml escape_once find_and_preserve haml_concat haml_indent haml_tag html_attrs html_esape init_haml_helpers list_of non_haml precede preserve succeed surround tab_down tab_up page_class contained containedin=@hamlEmbeddedRuby,@hamlRubyTop
|
||||||
|
|
||||||
syn cluster hamlHtmlTop contains=@htmlTop,htmlBold,htmlItalic,htmlUnderline
|
syn cluster hamlHtmlTop contains=@htmlTop,htmlBold,htmlItalic,htmlUnderline
|
||||||
syn region hamlPlainFilter matchgroup=hamlFilter start="^\z(\s*\):\%(plain\|preserve\|redcloth\|textile\|markdown\|maruku\)\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlInterpolation
|
syn region hamlPlainFilter matchgroup=hamlFilter start="^\z(\s*\):\%(plain\|preserve\|redcloth\|textile\|markdown\|maruku\)\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlInterpolation
|
||||||
syn region hamlEscapedFilter matchgroup=hamlFilter start="^\z(\s*\):\%(escaped\|cdata\)\s*$" end="^\%(\z1 \| *$\)\@!" contains=hamlInterpolation
|
syn region hamlEscapedFilter matchgroup=hamlFilter start="^\z(\s*\):\%(escaped\|cdata\)\s*$" end="^\%(\z1 \| *$\)\@!" contains=hamlInterpolation
|
||||||
syn region hamlErbFilter matchgroup=hamlFilter start="^\z(\s*\):erb\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlErbInterpolation
|
syn region hamlErbFilter matchgroup=hamlFilter start="^\z(\s*\):erb\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlErbInterpolation
|
||||||
syn region hamlRubyFilter matchgroup=hamlFilter start="^\z(\s*\):ruby\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlRubyTop
|
syn region hamlRubyFilter matchgroup=hamlFilter start="^\z(\s*\):ruby\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlRubyTop
|
||||||
syn region hamlJavascriptFilter matchgroup=hamlFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlJavaScript,hamlInterpolation keepend
|
syn region hamlJavascriptFilter matchgroup=hamlFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlJavaScript,hamlInterpolation keepend
|
||||||
syn region hamlCSSFilter matchgroup=hamlFilter start="^\z(\s*\):css\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,hamlInterpolation keepend
|
syn region hamlCSSFilter matchgroup=hamlFilter start="^\z(\s*\):css\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,hamlInterpolation keepend
|
||||||
syn region hamlSassFilter matchgroup=hamlFilter start="^\z(\s*\):sass\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
|
syn region hamlSassFilter matchgroup=hamlFilter start="^\z(\s*\):sass\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
|
||||||
|
syn region hamlCoffeescriptFilter matchgroup=hamlFilter start="^\z(\s*\):coffeescript\s*$" end="^\%(\z1 \| *$\)\@!" contains=@coffee
|
||||||
|
|
||||||
syn region hamlJavascriptBlock start="^\z(\s*\)%script\%((type=[\"']text/javascript[\"'])\)\=\s*$" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlJavaScript keepend
|
syn region hamlJavascriptBlock start="^\z(\s*\)%script\%((type=[\"']text/javascript[\"'])\)\=\s*$" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlJavaScript keepend
|
||||||
syn region hamlCssBlock start="^\z(\s*\)%style" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlCss keepend
|
syn region hamlCssBlock start="^\z(\s*\)%style" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlCss keepend
|
||||||
|
|||||||
Reference in New Issue
Block a user