-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change scss provider to cakebaker, closes #173
- Loading branch information
Showing
11 changed files
with
277 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.