├── .gitignore ├── LICENSE ├── README.md ├── ftdetect └── Jenkinsfile.vim ├── indent └── Jenkinsfile.vim └── syntax └── Jenkinsfile.vim /.gitignore: -------------------------------------------------------------------------------- 1 | # Vim 2 | Session.vim 3 | *.swp 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Martin d'Anjou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jenkinsfile-vim-syntax 2 | A plugin that enables Jenkins DSL job syntax coloring + indentation. 3 | 4 | ## Under the hood 5 | Simply recognises your project's `Jenkinsfile` as a [Groovy](http://groovy-lang.org/) script. 6 | See [this Jenkins documentation](https://jenkins.io/doc/book/pipeline/jenkinsfile/) for details. 7 | 8 | ## Installation 9 | Installing the plugin's easy. 10 | First, make sure you've got [pathogen](https://github.com/tpope/vim-pathogen) installed. 11 | Then, just clone this repo: 12 | 13 | ```bash 14 | git clone https://github.com/martinda/Jenkinsfile-vim-syntax.git ~/.vim/bundle/Jenkinsfile-vim-syntax 15 | ``` 16 | 17 | Then fire up Vim and you're good to go. 18 | 19 | Alternatively, this is included in the [vim-polyglot package](https://github.com/sheerun/vim-polyglot), 20 | though polyglot may lag behind this repo by a version or two. 21 | -------------------------------------------------------------------------------- /ftdetect/Jenkinsfile.vim: -------------------------------------------------------------------------------- 1 | " Jenkinsfile 2 | autocmd BufRead,BufNewFile Jenkinsfile set ft=Jenkinsfile 3 | autocmd BufRead,BufNewFile Jenkinsfile* setf Jenkinsfile 4 | autocmd BufRead,BufNewFile *.jenkinsfile set ft=Jenkinsfile 5 | autocmd BufRead,BufNewFile *.jenkinsfile setf Jenkinsfile 6 | autocmd BufRead,BufNewFile *.Jenkinsfile setf Jenkinsfile 7 | -------------------------------------------------------------------------------- /indent/Jenkinsfile.vim: -------------------------------------------------------------------------------- 1 | runtime indent/groovy.vim 2 | -------------------------------------------------------------------------------- /syntax/Jenkinsfile.vim: -------------------------------------------------------------------------------- 1 | runtime syntax/groovy.vim 2 | syn keyword jenkinsfileBuiltInVariable currentBuild 3 | 4 | syn keyword jenkinsfileSection pipeline agent stages steps post 5 | 6 | syn keyword jenkinsfileDirective environment options parameters triggers stage tools input when libraries 7 | 8 | syn keyword jenkinsfileOption contained buildDiscarder disableConcurrentBuilds overrideIndexTriggers skipDefaultCheckout nextgroup=jenkinsfileOptionParams 9 | syn keyword jenkinsfileOption contained skipStagesAfterUnstable checkoutToSubdirectory timeout retry timestamps nextgroup=jenkinsfileOptionParams 10 | syn keyword jenkinsfileOption contained disableResume newContainerPerStage preserveStashes quietPeriod parallelsAlwaysFailFast nextgroup=jenkinsfileOptionParams 11 | syn region jenkinsfileOptionParams contained start='(' end=')' transparent contains=@groovyTop 12 | syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1 13 | 14 | syn keyword jenkinsfileCoreStep checkout 15 | syn keyword jenkinsfileCoreStep docker dockerfile skipwhite nextgroup=jenkinsFileDockerConfigBlock 16 | syn keyword jenkinsfileCoreStep node 17 | syn keyword jenkinsfileCoreStep scm 18 | syn keyword jenkinsfileCoreStep sh 19 | syn keyword jenkinsfileCoreStep stage 20 | syn keyword jenkinsfileCoreStep parallel 21 | syn keyword jenkinsfileCoreStep steps 22 | syn keyword jenkinsfileCoreStep step 23 | syn keyword jenkinsfileCoreStep tool 24 | 25 | " TODO: These should probably be broken out. 26 | syn keyword jenkinsfileCoreStep always changed failure success unstable aborted unsuccessful regression fixed cleanup 27 | 28 | syn region jenkinsFileDockerConfigBlock contained start='{' end='}' contains=groovyString,jenkinsfileDockerKeyword transparent 29 | syn keyword jenkinsFileDockerKeyword contained image args additionalBuildArgs label registryUrl registryCredentialsId alwaysPull filename dir 30 | 31 | syn keyword jenkinsfilePipelineStep Applitools ArtifactoryGradleBuild Consul MavenDescriptorStep OneSky VersionNumber 32 | syn keyword jenkinsfilePipelineStep ViolationsToBitbucketServer ViolationsToGitHub ViolationsToGitLab _OcAction _OcContextInit 33 | syn keyword jenkinsfilePipelineStep _OcWatch acceptGitLabMR acsDeploy activateDTConfiguration addBadge addErrorBadge 34 | syn keyword jenkinsfilePipelineStep addGitLabMRComment addInfoBadge addInteractivePromotion addShortText addWarningBadge 35 | syn keyword jenkinsfilePipelineStep allure anchore androidApkMove androidApkUpload androidLint ansiColor ansiblePlaybook 36 | syn keyword jenkinsfilePipelineStep ansibleTower ansibleVault appMonBuildEnvironment appMonPublishTestResults appMonRegisterTestRun 37 | syn keyword jenkinsfilePipelineStep applatix approveReceivedEvent approveRequestedEvent aqua archive archiveArtifacts 38 | syn keyword jenkinsfilePipelineStep arestocats artifactResolver artifactoryDistributeBuild artifactoryDownload artifactoryMavenBuild 39 | syn keyword jenkinsfilePipelineStep artifactoryPromoteBuild artifactoryUpload awaitDeployment awaitDeploymentCompletion 40 | syn keyword jenkinsfilePipelineStep awsCodeBuild awsIdentity azureCLI azureDownload azureFunctionAppPublish azureUpload 41 | syn keyword jenkinsfilePipelineStep azureVMSSUpdate azureVMSSUpdateInstances azureWebAppPublish backlogPullRequest bat 42 | syn keyword jenkinsfilePipelineStep bearychatSend benchmark bitbucketStatusNotify blazeMeterTest build buildBamboo buildImage 43 | syn keyword jenkinsfilePipelineStep bzt cache catchError cbt cbtScreenshotsTest cbtSeleniumTest cfInvalidate cfnCreateChangeSet 44 | syn keyword jenkinsfilePipelineStep cfnDelete cfnDeleteStackSet cfnDescribe cfnExecuteChangeSet cfnExports cfnUpdate 45 | syn keyword jenkinsfilePipelineStep cfnUpdateStackSet cfnValidate changeAsmVer checkstyle chefSinatraStep cifsPublisher 46 | syn keyword jenkinsfilePipelineStep cleanWs cleanup cloudshareDockerMachine cm cmake cmakeBuild cobertura codefreshLaunch 47 | syn keyword jenkinsfilePipelineStep codefreshRun codescene codesonar collectEnv conanAddRemote conanAddUser configFileProvider 48 | syn keyword jenkinsfilePipelineStep container containerLog contrastAgent contrastVerification copy copyArtifacts coverityResults 49 | syn keyword jenkinsfilePipelineStep cpack createDeploymentEvent createEnvironment createEvent createMemoryDump createSummary 50 | syn keyword jenkinsfilePipelineStep createThreadDump crxBuild crxDeploy crxDownload crxReplicate crxValidate ctest ctmInitiatePipeline 51 | syn keyword jenkinsfilePipelineStep ctmPostPiData ctmSetPiData cucumber cucumberSlackSend currentNamespace debianPbuilder 52 | syn keyword jenkinsfilePipelineStep deleteDir dependencyCheckAnalyzer dependencyCheckPublisher dependencyCheckUpdateOnly 53 | syn keyword jenkinsfilePipelineStep dependencyTrackPublisher deployAPI deployArtifacts deployLambda dingding dir disk 54 | syn keyword jenkinsfilePipelineStep dockerFingerprintFrom dockerFingerprintRun dockerNode dockerPullStep dockerPushStep 55 | syn keyword jenkinsfilePipelineStep dockerPushWithProxyStep doktor downloadProgetPackage downstreamPublisher dropbox 56 | syn keyword jenkinsfilePipelineStep dry ec2 ec2ShareAmi echo ecrLogin emailext emailextrecipients envVarsForTool error 57 | syn keyword jenkinsfilePipelineStep evaluateGate eventSourceLambda executeCerberusCampaign exportPackages exportProjects 58 | syn keyword jenkinsfilePipelineStep exws exwsAllocate figlet fileExists fileOperations findFiles findbugs fingerprint 59 | syn keyword jenkinsfilePipelineStep flywayrunner ftp ftpPublisher gatlingArchive getArtifactoryServer getContext getLastChangesPublisher 60 | syn keyword jenkinsfilePipelineStep git gitbisect githubNotify gitlabBuilds gitlabCommitStatus googleCloudBuild googleStorageDownload 61 | syn keyword jenkinsfilePipelineStep googleStorageUpload gprbuild greet hipchatSend http httpRequest hub_detect hub_scan 62 | syn keyword jenkinsfilePipelineStep hub_scan_failure hubotApprove hubotSend importPackages importProjects inNamespace 63 | syn keyword jenkinsfilePipelineStep inSession initConanClient input invokeLambda isUnix ispwOperation ispwRegisterWebhook 64 | syn keyword jenkinsfilePipelineStep ispwWaitForWebhook jacoco jdbc jiraAddComment jiraAddWatcher jiraAssignIssue jiraAssignableUserSearch 65 | syn keyword jenkinsfilePipelineStep jiraComment jiraDeleteAttachment jiraDeleteIssueLink jiraDeleteIssueRemoteLink jiraDeleteIssueRemoteLinks 66 | syn keyword jenkinsfilePipelineStep jiraDownloadAttachment jiraEditComment jiraEditComponent jiraEditIssue jiraEditVersion 67 | syn keyword jenkinsfilePipelineStep jiraGetAttachmentInfo jiraGetComment jiraGetComments jiraGetComponent jiraGetComponentIssueCount 68 | syn keyword jenkinsfilePipelineStep jiraGetFields jiraGetIssue jiraGetIssueLink jiraGetIssueLinkTypes jiraGetIssueRemoteLink 69 | syn keyword jenkinsfilePipelineStep jiraGetIssueRemoteLinks jiraGetIssueTransitions jiraGetIssueWatches jiraGetProject 70 | syn keyword jenkinsfilePipelineStep jiraGetProjectComponents jiraGetProjectStatuses jiraGetProjectVersions jiraGetProjects 71 | syn keyword jenkinsfilePipelineStep jiraGetVersion jiraIssueSelector jiraJqlSearch jiraLinkIssues jiraNewComponent jiraNewIssue 72 | syn keyword jenkinsfilePipelineStep jiraNewIssueRemoteLink jiraNewIssues jiraNewVersion jiraNotifyIssue jiraSearch jiraTransitionIssue 73 | syn keyword jenkinsfilePipelineStep jiraUploadAttachment jiraUserSearch jmhReport jobDsl junit klocworkBuildSpecGeneration 74 | syn keyword jenkinsfilePipelineStep klocworkIncremental klocworkIntegrationStep1 klocworkIntegrationStep2 klocworkIssueSync 75 | syn keyword jenkinsfilePipelineStep klocworkQualityGateway klocworkWrapper kubernetesApply kubernetesDeploy lastChanges 76 | syn keyword jenkinsfilePipelineStep library libraryResource liquibaseDbDoc liquibaseRollback liquibaseUpdate listAWSAccounts 77 | syn keyword jenkinsfilePipelineStep livingDocs loadRunnerTest lock logstashSend mail marathon mattermostSend memoryMap 78 | syn keyword jenkinsfilePipelineStep milestone mockLoad newArtifactoryServer newBuildInfo newGradleBuild newMavenBuild 79 | syn keyword jenkinsfilePipelineStep nexusArtifactUploader nexusPolicyEvaluation nexusPublisher node nodejs nodesByLabel 80 | syn keyword jenkinsfilePipelineStep notifyBitbucket notifyDeploymon notifyOTC nunit nvm octoPerfTest office365ConnectorSend 81 | syn keyword jenkinsfilePipelineStep openTasks openshiftBuild openshiftCreateResource openshiftDeleteResourceByJsonYaml 82 | syn keyword jenkinsfilePipelineStep openshiftDeleteResourceByKey openshiftDeleteResourceByLabels openshiftDeploy openshiftExec 83 | syn keyword jenkinsfilePipelineStep openshiftImageStream openshiftScale openshiftTag openshiftVerifyBuild openshiftVerifyDeployment 84 | syn keyword jenkinsfilePipelineStep openshiftVerifyService openstackMachine osfBuilderSuiteForSFCCDeploy p4 p4approve 85 | syn keyword jenkinsfilePipelineStep p4publish p4sync p4tag p4unshelve pagerduty parasoftFindings pcBuild pdrone perfReport 86 | syn keyword jenkinsfilePipelineStep perfSigReports perfpublisher plot pmd podTemplate powershell pragprog pretestedIntegrationPublisher 87 | syn keyword jenkinsfilePipelineStep properties protecodesc publishATX publishBrakeman publishBuildInfo publishBuildRecord 88 | syn keyword jenkinsfilePipelineStep publishConfluence publishDeployRecord publishETLogs publishEventQ publishGenerators 89 | syn keyword jenkinsfilePipelineStep publishHTML publishLambda publishLastChanges publishSQResults publishStoplight publishTMS 90 | syn keyword jenkinsfilePipelineStep publishTRF publishTestResult publishTraceAnalysis publishUNIT publishValgrind pullPerfSigReports 91 | syn keyword jenkinsfilePipelineStep puppetCode puppetHiera puppetJob puppetQuery pushImage pushToCloudFoundry pwd pybat 92 | syn keyword jenkinsfilePipelineStep pysh qc queryModuleBuildRequest questavrm r radargunreporting rancher readFile readJSON 93 | syn keyword jenkinsfilePipelineStep readManifest readMavenPom readProperties readTrusted readXml readYaml realtimeJUnit 94 | syn keyword jenkinsfilePipelineStep registerWebhook release resolveScm retry rocketSend rtp runConanCommand runFromAlmBuilder 95 | syn keyword jenkinsfilePipelineStep runLoadRunnerScript runValgrind s3CopyArtifact s3Delete s3Download s3FindFiles s3Upload 96 | syn keyword jenkinsfilePipelineStep salt sauce saucePublisher sauceconnect script selectRun sendCIMessage sendDeployableMessage 97 | syn keyword jenkinsfilePipelineStep serviceNow_attachFile serviceNow_attachZip serviceNow_createChange serviceNow_getCTask 98 | syn keyword jenkinsfilePipelineStep serviceNow_getChangeState serviceNow_updateChangeItem setAccountAlias setGerritReview 99 | syn keyword jenkinsfilePipelineStep setGitHubPullRequestStatus sh sha1 signAndroidApks silkcentral silkcentralCollectResults 100 | syn keyword jenkinsfilePipelineStep slackSend sleep sloccountPublish snsPublish snykSecurity sonarToGerrit sparkSend 101 | syn keyword jenkinsfilePipelineStep splitTests springBoot sscm sseBuild sseBuildAndPublish sshPublisher sshagent stage 102 | syn keyword jenkinsfilePipelineStep startET startSandbox startSession startTS stash step stepcounter stopET stopSandbox 103 | syn keyword jenkinsfilePipelineStep stopSession stopTS submitJUnitTestResultsToqTest submitModuleBuildRequest svChangeModeStep 104 | syn keyword jenkinsfilePipelineStep svDeployStep svExportStep svUndeployStep svn tagImage task teamconcert tee testFolder 105 | syn keyword jenkinsfilePipelineStep testPackage testProject testiniumExecution themisRefresh themisReport throttle time 106 | syn keyword jenkinsfilePipelineStep timeout timestamps tm tool touch triggerInputStep triggerJob typetalkSend uftScenarioLoad 107 | syn keyword jenkinsfilePipelineStep unarchive unstash unzip updateBotPush updateGitlabCommitStatus updateIdP updateTrustPolicy 108 | syn keyword jenkinsfilePipelineStep upload-pgyer uploadProgetPackage uploadToIncappticConnect vSphere validateDeclarativePipeline 109 | syn keyword jenkinsfilePipelineStep vmanagerLaunch waitForCIMessage waitForJob waitForQualityGate waitForWebhook waitUntil 110 | syn keyword jenkinsfilePipelineStep walk waptProReport warnings whitesource winRMClient withAWS withAnt withContext withCoverityEnv 111 | syn keyword jenkinsfilePipelineStep withCredentials withDockerContainer withDockerRegistry withDockerServer withEnv withKafkaLog 112 | syn keyword jenkinsfilePipelineStep withKubeConfig withMaven withNPM withPod withPythonEnv withSCM withSandbox withSonarQubeEnv 113 | syn keyword jenkinsfilePipelineStep withTypetalk wrap writeFile writeJSON writeMavenPom writeProperties writeXml writeYaml 114 | syn keyword jenkinsfilePipelineStep ws xUnitImporter xUnitUploader xunit xldCreatePackage xldDeploy xldPublishPackage 115 | syn keyword jenkinsfilePipelineStep xlrCreateRelease xrayScanBuild zip 116 | 117 | hi link jenkinsfileSection Statement 118 | hi link jenkinsfileDirective jenkinsfileSection 119 | hi link jenkinsfileOption Function 120 | hi link jenkinsfileCoreStep Function 121 | hi link jenkinsfilePipelineStep Include 122 | hi link jenkinsfileBuiltInVariable Identifier 123 | hi link jenkinsFileDockerKeyword jenkinsfilePipelineStep 124 | 125 | let b:current_syntax = 'Jenkinsfile' 126 | 127 | " vim:set et sw=0 ts=2 ft=vim tw=78: 128 | --------------------------------------------------------------------------------