5 Commits
3 changed files with 8 additions and 4 deletions
+6 -1
View File
@@ -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(\)\=["'']\='
+1 -3
View File
@@ -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
+1
View File
@@ -100,6 +100,7 @@ hi def link sassInterpolationDelimiter Delimiter
hi def link sassAmpersand Character hi def link sassAmpersand Character
hi def link sassId Identifier hi def link sassId Identifier
hi def link sassClass Type hi def link sassClass Type
hi def link sassMixinName Function
let b:current_syntax = "sass" let b:current_syntax = "sass"