4 Commits

Author SHA1 Message Date
Ivan Kuznetsov
de14ad9da4 Merge 49ad9bb77f into 95a095a4d2 2023-03-24 13:00:34 +02:00
Tim Pope
95a095a4d2 Use recommended_style pattern for indenting defaults 2022-08-22 15:15:04 -04:00
Tim Pope
2824214c61 Remove unused variables 2022-08-22 15:11:53 -04:00
Fahrenhei7
49ad9bb77f :scss syntax highlight into .hamll file 2016-05-12 21:41:53 +03:00
3 changed files with 7 additions and 3 deletions

View File

@@ -23,6 +23,11 @@ if &filetype =~# '\<s[ac]ss]\>'
let b:undo_ftplugin .= ' isk<'
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:include = '^\s*@import\s\+\%(url(\)\=["'']\='

View File

@@ -8,7 +8,7 @@ if exists("b:did_indent")
endif
let b:did_indent = 1
setlocal autoindent sw=2 et
setlocal autoindent
setlocal indentexpr=GetSassIndent()
setlocal indentkeys=o,O,*<Return>,<:>,!^F
@@ -26,10 +26,8 @@ function! GetSassIndent()
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 && line !~ s:extend && cline =~ s:property
return indent + shiftwidth()
else

View File

@@ -65,6 +65,7 @@ syn region hamlErbFilter matchgroup=hamlFilter start="^\z(\s*\):erb\s*$"
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 hamlCSSFilter matchgroup=hamlFilter start="^\z(\s*\):css\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,hamlInterpolation keepend
syn region hamlScssFilter matchgroup=hamlFilter start="^\z(\s*\):scss\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,hamlInterpolation keepend
syn region hamlSassFilter matchgroup=hamlFilter start="^\z(\s*\):sass\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
syn region hamlJavascriptBlock start="^\z(\s*\)%script\%((type=[\"']text/javascript[\"'])\)\=\s*$" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlJavaScript keepend