diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2017-03-23 11:28:19 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2017-03-23 11:28:28 +0100 |
commit | 0801eac01aab5940fc1e4409ba749383cc353bc2 (patch) | |
tree | 9034c9f6cd0c7592a09e6c65521c6948c3a983af /syntax/litcoffee.vim | |
parent | 9f735b1fe77072e001a593f7f6660703bf4a8c9c (diff) | |
download | vim-polyglot-0801eac01aab5940fc1e4409ba749383cc353bc2.tar.gz vim-polyglot-0801eac01aab5940fc1e4409ba749383cc353bc2.zip |
Update
Diffstat (limited to '')
-rw-r--r-- | syntax/litcoffee.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/syntax/litcoffee.vim b/syntax/litcoffee.vim new file mode 100644 index 00000000..555518fa --- /dev/null +++ b/syntax/litcoffee.vim @@ -0,0 +1,27 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1 + +" Language: Literate CoffeeScript +" Maintainer: Michael Smith <michael@diglumi.com> +" URL: https://github.com/mintplant/vim-literate-coffeescript +" License: MIT + +if exists('b:current_syntax') && b:current_syntax == 'litcoffee' + finish +endif + +syn include @markdown syntax/markdown.vim +syn include @coffee syntax/coffee.vim + +" Partition the file into notCoffee and inlineCoffee. Each line will match +" exactly one of these regions. notCoffee matches with a zero-width +" look-behind. +syn region notCoffee start='^\%( \|\t\)\@<!' end='$' contains=@markdown +syn region inlineCoffee start='^ \|\t' end='$' contains=@coffee + +" We defined notCoffee as a region so we can highlight every element in it +" that doesn't have it's own explicit rule. +highlight default link notCoffee Comment + +let b:current_syntax = "litcoffee" + +endif |