robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqMerge pull request #40472 from zeertzjq/vim-1f337327945732ed7

master
1.2 KiB44 linesraw
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
8if exists("b:did_ftplugin")
9  finish
10endif
11let b:did_ftplugin = 1
12
13let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
14
15setlocal comments=://
16setlocal commentstring=//\ %s
17setlocal includeexpr=SassIncludeExpr(v:fname)
18setlocal omnifunc=csscomplete#CompleteCSS
19setlocal suffixesadd=.sass,.scss,.css
20if &filetype =~# '\<s[ac]ss]\>'
21  setlocal iskeyword+=-
22  setlocal iskeyword+=$
23  setlocal iskeyword+=%
24  let b:undo_ftplugin .= ' isk<'
25endif
26
27if 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<'
31endif
32
33let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@='
34let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
35
36function! SassIncludeExpr(file) abort
37  let partial = substitute(a:file, '\%(.*/\|^\)\zs', '_', '')
38  if !empty(findfile(partial))
39    return partial
40  endif
41  return a:file
42endfunction
43
44" vim:set sw=2: