5 Commits

Author SHA1 Message Date
Jay Sitter
9a609f7c69 Merge 683ad59e5e into c30ee7d885 2024-09-26 05:07:29 +00:00
Dan Church
c30ee7d885 Fix &isk not applying when editing SASS/SCSS 2024-09-08 18:35:07 -04: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
Jay Sitter
683ad59e5e Add sassMixinName highlight link
Closes #87
2018-11-19 12:46:10 -05:00
3 changed files with 8 additions and 4 deletions

View File

@@ -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(\)\=["'']\='

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

@@ -100,6 +100,7 @@ hi def link sassInterpolationDelimiter Delimiter
hi def link sassAmpersand Character
hi def link sassId Identifier
hi def link sassClass Type
hi def link sassMixinName Function
let b:current_syntax = "sass"