1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-16 06:47:52 +01:00
vim/runtime/ftplugin/sass.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
VimL
Raw Permalink Normal View History

2008-07-13 17:41:49 +00:00
" Vim filetype plugin
2010-07-26 22:21:27 +02:00
" Language: Sass
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2023 Dec 28
2008-07-13 17:41:49 +00:00
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
2008-07-13 17:41:49 +00:00
setlocal comments=://
2008-07-13 17:41:49 +00:00
setlocal commentstring=//\ %s
2019-12-05 22:47:25 +01:00
setlocal includeexpr=SassIncludeExpr(v:fname)
2008-07-13 17:41:49 +00:00
setlocal omnifunc=csscomplete#CompleteCSS
2010-07-26 22:21:27 +02:00
setlocal suffixesadd=.sass,.scss,.css
2019-12-05 22:47:25 +01:00
if &filetype =~# '\<s[ac]ss]\>'
setlocal iskeyword+=-
setlocal iskeyword+=$
setlocal iskeyword+=%
let b:undo_ftplugin .= ' isk<'
endif
2008-07-13 17:41:49 +00:00
if get(g:, 'sass_recommended_style', 1)
setlocal shiftwidth=2 softtabstop=2 expandtab
let b:undo_ftplugin .= ' sw< sts< et<'
endif
2019-12-05 22:47:25 +01:00
let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@='
2010-07-26 22:21:27 +02:00
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
2008-07-13 17:41:49 +00:00
2019-12-05 22:47:25 +01:00
function! SassIncludeExpr(file) abort
let partial = substitute(a:file, '\%(.*/\|^\)\zs', '_', '')
if !empty(findfile(partial))
return partial
endif
return a:file
endfunction
2008-07-13 17:41:49 +00:00
" vim:set sw=2: