Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

toc-local

Introduction

The following provide setups for syntax highlighting for various editors/viewers to highlight the different components in the jobgen configuration files.

Info

The most up to date versions are in the repository.

Confluence

Code Block
/*
** name: JobgenConf
** maintainer: John Marshall
**
** See also: http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/custom.html
*/

SyntaxHighlighter.brushes.JobgenConf = function()
{
    this.regexList = [
        // comment
        { regex: /^\#.*/gm, css: 'comments' },

        // section
        { regex: /^\[.+\]/gm, css: 'constants' },

        // meta setting
        { regex: /^(meta\.[^.]+\.)/gm, css: 'variable bold' },

        // value
        { regex: /=(.+)$/gm, css: 'value' },
    ];
};
SyntaxHighlighter.brushes.JobgenConf.prototype  = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.JobgenConf.aliases = ['jobgenconf'];

Sublime Text 3

Code Block
languageyml
titleJobgenConf.sublime-syntax
%YAML 1.2
---
name: JobgenConf
first_line_match: ^\# *syntax=jobgenconf
scope: source.c

contexts:
  main:
    # comment
    - match: \#.*
      scope: comment.line
    # section
    - match: \[.+\]
      scope: entity.name
    # meta setting
    - match: (meta)\.([^.]+)\.(.*)=(.+)
      captures:
        1: keyword
        2: keyword.declaration
        3: variable.function
        4: variable.parameter
    # setting
    - match: (.+)=(.+)
      captures:
        1: variable.function
        2: variable.parameter
    # setting name only
    - match: .+
      scope: variable.function
    # everything else?
    - match: .*
      scope:

vim

Code Block
titlefiletype.vim
autocmd BufNewFile,BufRead * if getline(1) =~ '# syntax=jobgenconf' | set ft=jobgenconf | endif
Code Block
titlejobgenconf.vim
" Vim syntax file
" Language:     JobgenConf
" Maintainer:   John Marshall
"
" Last Change:  2019-07-11

if version <600
    syntax clear
elsif exists("b:current_syntax")
    finish
endif

syn clear
hi clear

syn match	jobgenconfSetting		"^[^:=]\{-1,}="
syn match	jobgenconfSettingOnly		"^[^:=]\{-1,}$"
syn match	jobgenconfMeta			"^meta\.[^:=.]\{-1,}\."
syn match	jobgenconfSection skipwhite	"^\[.\+\]$"
syn match       jobgenconfComment skipwhite	"^[#;].*"

if version >= 508 || !exists("did_acedb_syn_inits")
    if version < 508
        let did_acedb_syn_inits = 1
        command -nargs=+ HiLink hi link <args>
    else
        command -nargs=+ HiLink hi def link <args>
    endif

    HiLink      jobgenconfComment		Comment

    HiLink      jobgenconfSection		Statement
    HiLink      jobgenconfMeta			Define
    HiLink      jobgenconfSetting		Identifier
    HiLink      jobgenconfSettingOnly		Identifier
  delcommand HiLink
endif