From edfcded9fd50cbdef430420d818f1e19b82cc6c1 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 4 Mar 2019 09:37:07 +0100 Subject: [PATCH] Add cuesheet support, closes #366 --- README.md | 3 ++- build | 1 + ftdetect/polyglot.vim | 7 +++++++ syntax/cuesheet.vim | 30 ++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 syntax/cuesheet.vim diff --git a/README.md b/README.md index 68e42b4..9dd04a4 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A collection of language packs for Vim. > One to rule them all, one to find them, one to bring them all and in the darkness bind them. - It **won't affect your startup time**, as scripts are loaded only on demand\*. -- It **installs and updates 100+ times faster** than the 117 packages it consists of. +- It **installs and updates 100+ times faster** than the 118 packages it consists of. - Solid syntax and indentation support (other features skipped). Only the best language packs. - All unnecessary files are ignored (like enormous documentation from php support). - No support for esoteric languages, only most popular ones (modern too, like `slim`). @@ -62,6 +62,7 @@ If you need full functionality of any plugin, please use it directly with your p - [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (syntax, compiler, ftplugin) - [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin) - [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin) +- [cue](https://github.com/mgrabovsky/vim-cuesheet) (syntax) - [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin) - [dockerfile](https://github.com/ekalinin/Dockerfile.vim) (syntax, indent, ftplugin) - [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin) diff --git a/build b/build index 9e00e4b..c879a74 100755 --- a/build +++ b/build @@ -170,6 +170,7 @@ PACKS=" cryptol:victoredwardocallaghan/cryptol.vim crystal:rhysd/vim-crystal cucumber:tpope/vim-cucumber + cue:mgrabovsky/vim-cuesheet dart:dart-lang/dart-vim-plugin dockerfile:ekalinin/Dockerfile.vim elixir:elixir-lang/vim-elixir diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 1448194..c61fa08 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -242,6 +242,13 @@ autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber augroup end endif +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cue') == -1 + augroup filetypedetect + " cue, from cuesheet.vim in mgrabovsky/vim-cuesheet +autocmd BufRead,BufNewFile *.cue set filetype=cuesheet + augroup end +endif + if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1 augroup filetypedetect " dart, from dart.vim in dart-lang/dart-vim-plugin diff --git a/syntax/cuesheet.vim b/syntax/cuesheet.vim new file mode 100644 index 0000000..6c615eb --- /dev/null +++ b/syntax/cuesheet.vim @@ -0,0 +1,30 @@ +if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'cue') != -1 + finish +endif + +" Language: Cue sheet +" Maintainer: Matěj Grabovský +" URL: http://github.com/mgrabovsky +" License: MIT + +" Bail if our syntax is already loaded. +if exists('b:current_syntax') && b:current_syntax == 'cuesheet' + finish +endif + +syn case match +setl conceallevel=2 + +syn region String matchgroup=cueString start=/"/ skip=/\\"/ end=/"/ + \ transparent contains=NONE +syn region Comment start=/^\s*REM / end=/$/ contains=specialComment +syn keyword SpecialComment COMMENT DATE DISCID GENRE +syn keyword Function CATALOG CDTEXTFILE FILE FLAGS INDEX ISRC PERFORMER POSTGAP + \ PREGAP SONGWRITER TITLE TRACK +syn keyword StorageClass AIFF AUDIO MP3 WAVE +syn match Number /[+-]\=\<\d\+\%(\.\d\+\)\=\>/ +syn match Number /\<\d\+\%(:\d\{2}\)\{2}\>/ + +let b:current_syntax='cuesheet' + +" vim: nowrap sw=2 sts=2 ts=8: