2014-07-10 21:05:51 -07:00
|
|
|
" Vim filetype plugin
|
|
|
|
" Language: Sass
|
|
|
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
2021-04-24 15:38:10 -07:00
|
|
|
" Last Change: 2019 Dec 05
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
" Only do this when not done yet for this buffer
|
|
|
|
if exists("b:did_ftplugin")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let b:did_ftplugin = 1
|
|
|
|
|
2017-04-28 12:06:44 -07:00
|
|
|
let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2017-04-28 12:06:44 -07:00
|
|
|
setlocal comments=://
|
2014-07-10 21:05:51 -07:00
|
|
|
setlocal commentstring=//\ %s
|
2021-04-24 15:38:10 -07:00
|
|
|
setlocal includeexpr=SassIncludeExpr(v:fname)
|
2014-07-10 21:05:51 -07:00
|
|
|
setlocal omnifunc=csscomplete#CompleteCSS
|
|
|
|
setlocal suffixesadd=.sass,.scss,.css
|
2021-04-24 15:38:10 -07:00
|
|
|
if &filetype =~# '\<s[ac]ss]\>'
|
|
|
|
setlocal iskeyword+=-
|
|
|
|
setlocal iskeyword+=$
|
|
|
|
setlocal iskeyword+=%
|
|
|
|
let b:undo_ftplugin .= ' isk<'
|
|
|
|
endif
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2021-04-24 15:38:10 -07:00
|
|
|
let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@='
|
2014-07-10 21:05:51 -07:00
|
|
|
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
|
|
|
|
2021-04-24 15:38:10 -07:00
|
|
|
function! SassIncludeExpr(file) abort
|
|
|
|
let partial = substitute(a:file, '\%(.*/\|^\)\zs', '_', '')
|
|
|
|
if !empty(findfile(partial))
|
|
|
|
return partial
|
|
|
|
endif
|
|
|
|
return a:file
|
|
|
|
endfunction
|
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
" vim:set sw=2:
|