sass.vim (1224B)
1 " Vim filetype plugin 2 " Language: Sass 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> 4 " Last Change: 2023 Dec 28 5 " 2026 Jun 27 by Vim Project normalize recommended style guard 6 7 " Only do this when not done yet for this buffer 8 if exists("b:did_ftplugin") 9 finish 10 endif 11 let b:did_ftplugin = 1 12 13 let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<" 14 15 setlocal comments=:// 16 setlocal commentstring=//\ %s 17 setlocal includeexpr=SassIncludeExpr(v:fname) 18 setlocal omnifunc=csscomplete#CompleteCSS 19 setlocal suffixesadd=.sass,.scss,.css 20 if &filetype =~# '\<s[ac]ss]\>' 21 setlocal iskeyword+=- 22 setlocal iskeyword+=$ 23 setlocal iskeyword+=% 24 let b:undo_ftplugin .= ' isk<' 25 endif 26 27 if get(g:, 'sass_recommended_style', 28 \ get(g:, 'filetype_recommended_style', 1)) 29 setlocal shiftwidth=2 softtabstop=2 expandtab 30 let b:undo_ftplugin .= ' sw< sts< et<' 31 endif 32 33 let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@=' 34 let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\=' 35 36 function! SassIncludeExpr(file) abort 37 let partial = substitute(a:file, '\%(.*/\|^\)\zs', '_', '') 38 if !empty(findfile(partial)) 39 return partial 40 endif 41 return a:file 42 endfunction 43 44 " vim:set sw=2: