mirror of
https://github.com/tpope/vim-haml.git
synced 2025-12-06 17:24:24 +08:00
Compare commits
7 Commits
vim9.0
...
d671c5ac45
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d671c5ac45 | ||
|
|
c30ee7d885 | ||
|
|
95a095a4d2 | ||
|
|
2824214c61 | ||
|
|
541e5ae6d5 | ||
|
|
c9b3c2f1cc | ||
|
|
f65ff3f0a2 |
@@ -16,13 +16,18 @@ setlocal commentstring=//\ %s
|
||||
setlocal includeexpr=SassIncludeExpr(v:fname)
|
||||
setlocal omnifunc=csscomplete#CompleteCSS
|
||||
setlocal suffixesadd=.sass,.scss,.css
|
||||
if &filetype =~# '\<s[ac]ss]\>'
|
||||
if &filetype =~# '\<s[ac]ss\>'
|
||||
setlocal iskeyword+=-
|
||||
setlocal iskeyword+=$
|
||||
setlocal iskeyword+=%
|
||||
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(\)\=["'']\='
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -57,7 +57,7 @@ syn match sassAmpersand "&"
|
||||
" TODO: Attribute namespaces
|
||||
" TODO: Arithmetic (including strings and concatenation)
|
||||
|
||||
syn region sassMediaQuery matchgroup=sassMedia start="@media" end="[{};]\@=\|$" contains=sassMediaOperators
|
||||
syn region sassMediaQuery matchgroup=sassMedia start="@media" end="[{};]\@=\|$" contains=sassMediaOperators,sassVariable,sassInterpolation,cssMediaProp,cssValueLength,cssAtRuleLogical,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssComment,cssCustomProp,cssFunctionName
|
||||
syn region sassKeyframe matchgroup=cssAtKeyword start=/@\(-[a-z]\+-\)\=keyframes\>/ end=";\|$" contains=cssVendor,cssComment nextgroup=cssDefinition
|
||||
syn keyword sassMediaOperators and not only contained
|
||||
syn region sassCharset start="@charset" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType
|
||||
|
||||
Reference in New Issue
Block a user