Skip to content

Commit

Permalink
Change scss provider to cakebaker, closes #173
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Feb 2, 2017
1 parent 462bb76 commit 6e9529b
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 255 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent, ftdetect)
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent, ftdetect)
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin, ftdetect)
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin, ftdetect)
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax, ftdetect)
Expand Down Expand Up @@ -102,6 +102,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect)
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ftdetect)
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, autoload, ftplugin, ftdetect)
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin, ftdetect)
- [solidity](https://github.com/ethereum/vim-solidity) (syntax, indent, ftdetect)
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
Expand Down
41 changes: 41 additions & 0 deletions autoload/scss_indent.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scss') == -1

" usage:
" set indentexpr=scss_indent#GetIndent(v:lnum)
fun! scss_indent#GetIndent(lnum)
" { -> increase indent
" } -> decrease indent
if a:lnum == 1
" start at 0 indentation
return 0
endif

" try to find last line ending with { or }
" ignoring // comments
let regex = '\([{}]\)\%(\/\/.*\)\?$'
let nr = search(regex, 'bnW')
if nr > 0
let last = indent(nr)
let m = matchlist(getline(nr), regex)
let m_curr = matchlist(getline(a:lnum), regex)
echoe string(m).string(m_curr)
if !empty(m_curr) && m_curr[1] == '}' && m[1] == '{'
" last was open, current is close, use same indent
return last
elseif !empty(m_curr) && m_curr[1] == '}' && m[1] == '}'
" } line and last line was }: decrease
return last - &sw
endif
if m[1] == '{'
" line after {: increase indent
return last + &sw
else
" line after } or { - same indent
return last
endif
else
return 0
endif
endfun

endif
3 changes: 2 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ PACKS="
glsl:tikhomirov/vim-glsl
go:fatih/vim-go:_BASIC
groovy:vim-scripts/groovy.vim
haml:tpope/vim-haml
haml:sheerun/vim-haml
handlebars:mustache/vim-mustache-handlebars
haskell:neovimhaskell/haskell-vim
haxe:yaymukund/vim-haxe
Expand Down Expand Up @@ -175,6 +175,7 @@ PACKS="
rust:rust-lang/rust.vim
sbt:derekwyatt/vim-sbt
scala:derekwyatt/vim-scala
scss:cakebaker/scss-syntax.vim
slim:slim-template/vim-slim
solidity:ethereum/vim-solidity
stylus:wavded/vim-stylus
Expand Down
34 changes: 0 additions & 34 deletions compiler/sass.vim

This file was deleted.

9 changes: 8 additions & 1 deletion ftdetect/polyglot.vim
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ endif
" ftdetect/haml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1

autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
autocmd BufNewFile,BufRead *.sass setf sass
autocmd BufNewFile,BufRead *.scss setf scss

Expand Down Expand Up @@ -882,6 +881,14 @@ au BufRead,BufNewFile *.sbt setfiletype sbt.scala

endif

" ftdetect/scss.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scss') == -1

au BufRead,BufNewFile *.scss setfiletype scss
au BufEnter *.scss :syntax sync fromstart

endif

" ftdetect/slim.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1

Expand Down
27 changes: 0 additions & 27 deletions ftplugin/sass.vim

This file was deleted.

20 changes: 10 additions & 10 deletions ftplugin/scss.vim
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scss') == -1

" Vim filetype plugin
" Language: SCSS
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 Jul 26

if exists("b:did_ftplugin")
if exists('b:did_indent') && b:did_indent
" be kind. allow users to override this. Does it work?
finish
endif

runtime! ftplugin/sass.vim
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal indentexpr=scss_indent#GetIndent(v:lnum)

" vim:set sw=2:
" Automatically insert the current comment leader after hitting <Enter>
" in Insert mode respectively after hitting 'o' or 'O' in Normal mode
setlocal formatoptions+=ro

" SCSS comments are either /* */ or //
setlocal comments=s1:/*,mb:*,ex:*/,://

endif
42 changes: 0 additions & 42 deletions indent/sass.vim

This file was deleted.

16 changes: 0 additions & 16 deletions indent/scss.vim

This file was deleted.

110 changes: 0 additions & 110 deletions syntax/sass.vim

This file was deleted.

Loading

0 comments on commit 6e9529b

Please sign in to comment.