From 6a12aa87f41b02a68cd8e6b494e5400367c2b028 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 27 Sep 2017 20:46:39 +0200 Subject: Add jenkinsfile syntax supports, closes #225 --- README.md | 1 + build | 1 + ftdetect/polyglot.vim | 9 +++++++++ indent/Jenkinsfile.vim | 5 +++++ syntax/Jenkinsfile.vim | 27 +++++++++++++++++++++++++++ 5 files changed, 43 insertions(+) create mode 100644 indent/Jenkinsfile.vim create mode 100644 syntax/Jenkinsfile.vim diff --git a/README.md b/README.md index 4397cfad..bb1239ee 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ Most importantly, vim-polyglot contains all runtime syntax files from upstream [ - [i3](https://github.com/PotatoesMaster/i3-vim-syntax) (syntax, ftplugin) - [jasmine](https://github.com/glanotte/vim-jasmine) (syntax) - [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras) +- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent) - [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin) - [jst](https://github.com/briancollins/vim-jst) (syntax, indent) - [jsx](https://github.com/mxw/vim-jsx) (after) diff --git a/build b/build index ee0e4674..376c194a 100755 --- a/build +++ b/build @@ -151,6 +151,7 @@ PACKS=" i3:PotatoesMaster/i3-vim-syntax jasmine:glanotte/vim-jasmine javascript:pangloss/vim-javascript:_JAVASCRIPT + jenkins:martinda/Jenkinsfile-vim-syntax json:elzr/vim-json jst:briancollins/vim-jst jsx:mxw/vim-jsx:_ALL diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 56e1d6a6..6c8553e2 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -427,6 +427,15 @@ endfun au BufNewFile,BufRead * call s:SelectJavascript() augroup END +augroup filetypedetect +" jenkins:martinda/Jenkinsfile-vim-syntax +" Jenkinsfile +autocmd BufRead,BufNewFile Jenkinsfile set ft=Jenkinsfile +autocmd BufRead,BufNewFile Jenkinsfile* setf Jenkinsfile +autocmd BufRead,BufNewFile *.jenkinsfile set ft=Jenkinsfile +autocmd BufRead,BufNewFile *.jenkinsfile setf Jenkinsfile +augroup END + augroup filetypedetect " json:elzr/vim-json autocmd BufNewFile,BufRead *.json setlocal filetype=json diff --git a/indent/Jenkinsfile.vim b/indent/Jenkinsfile.vim new file mode 100644 index 00000000..07fdbf3b --- /dev/null +++ b/indent/Jenkinsfile.vim @@ -0,0 +1,5 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jenkins') == -1 + +runtime indent/groovy.vim + +endif diff --git a/syntax/Jenkinsfile.vim b/syntax/Jenkinsfile.vim new file mode 100644 index 00000000..6639b862 --- /dev/null +++ b/syntax/Jenkinsfile.vim @@ -0,0 +1,27 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jenkins') == -1 + +runtime syntax/groovy.vim +syn keyword jenkinsfileBuiltInVariable currentBuild + +syn keyword jenkinsfileCoreStep checkout +syn keyword jenkinsfileCoreStep node +syn keyword jenkinsfileCoreStep scm +syn keyword jenkinsfileCoreStep sh +syn keyword jenkinsfileCoreStep stage +syn keyword jenkinsfileCoreStep step +syn keyword jenkinsfileCoreStep tool + +syn keyword jenkinsfilePluginStep docker +syn keyword jenkinsfilePluginStep emailext +syn keyword jenkinsfilePluginStep exwsAllocate +syn keyword jenkinsfilePluginStep exws +syn keyword jenkinsfilePluginStep httpRequest +syn keyword jenkinsfilePluginStep junit + +hi link jenkinsfileCoreStep Function +hi link jenkinsfilePluginStep Include +hi link jenkinsfileBuiltInVariable Identifier + +let b:current_syntax = "Jenkinsfile" + +endif -- cgit v1.2.3