mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-16 22:10:26 +00:00
Use new syntax highlighting engine from zyedidia/highlight
This changes all the syntax files in the runtime directory and also changes how syntax highlighting is done from inside micro.
This commit is contained in:
parent
0adb601f3c
commit
2fcb40d5a9
161 changed files with 2169 additions and 4818 deletions
|
|
@ -1409,7 +1409,6 @@ func (v *View) Quit(usePlugin bool) bool {
|
|||
}
|
||||
if curTab == 0 {
|
||||
CurView().ToggleTabbar()
|
||||
CurView().matches = Match(CurView())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1445,7 +1444,6 @@ func (v *View) QuitAll(usePlugin bool) bool {
|
|||
|
||||
if closeAll {
|
||||
// only quit if all of the buffers can be closed and the user confirms that they actually want to quit everything
|
||||
|
||||
shouldQuit, _ := messenger.YesNoPrompt("Do you want to quit micro (all open files will be closed)?")
|
||||
|
||||
if shouldQuit {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import (
|
|||
"unicode/utf8"
|
||||
|
||||
"github.com/mitchellh/go-homedir"
|
||||
"github.com/zyedidia/highlight"
|
||||
)
|
||||
|
||||
// Buffer stores the text for files that are loaded into the text editor
|
||||
|
|
@ -44,8 +45,8 @@ type Buffer struct {
|
|||
|
||||
NumLines int
|
||||
|
||||
// Syntax highlighting rules
|
||||
rules []SyntaxRule
|
||||
syntaxDef *highlight.Def
|
||||
highlighter *highlight.Highlighter
|
||||
|
||||
// Buffer local settings
|
||||
Settings map[string]interface{}
|
||||
|
|
@ -96,7 +97,6 @@ func NewBuffer(reader io.Reader, path string) *Buffer {
|
|||
b.EventHandler = NewEventHandler(b)
|
||||
|
||||
b.Update()
|
||||
b.FindFileType()
|
||||
b.UpdateRules()
|
||||
|
||||
if _, err := os.Stat(configDir + "/buffers/"); os.IsNotExist(err) {
|
||||
|
|
@ -185,12 +185,11 @@ func (b *Buffer) GetName() string {
|
|||
// UpdateRules updates the syntax rules and filetype for this buffer
|
||||
// This is called when the colorscheme changes
|
||||
func (b *Buffer) UpdateRules() {
|
||||
b.rules = GetRules(b)
|
||||
}
|
||||
|
||||
// FindFileType identifies this buffer's filetype based on the extension or header
|
||||
func (b *Buffer) FindFileType() {
|
||||
b.Settings["filetype"] = FindFileType(b)
|
||||
b.syntaxDef = highlight.DetectFiletype(syntaxDefs, b.Path, []byte(b.Line(0)))
|
||||
if b.highlighter == nil || b.Settings["filetype"].(string) != b.syntaxDef.FileType {
|
||||
b.Settings["filetype"] = b.syntaxDef.FileType
|
||||
b.highlighter = highlight.NewHighlighter(b.syntaxDef)
|
||||
}
|
||||
}
|
||||
|
||||
// FileType returns the buffer's filetype
|
||||
|
|
@ -280,7 +279,6 @@ func (b *Buffer) Serialize() error {
|
|||
|
||||
// SaveAs saves the buffer to a specified path (filename), creating the file if it does not exist
|
||||
func (b *Buffer) SaveAs(filename string) error {
|
||||
b.FindFileType()
|
||||
b.UpdateRules()
|
||||
dir, _ := homedir.Dir()
|
||||
b.Path = strings.Replace(filename, "~", dir, 1)
|
||||
|
|
@ -317,7 +315,6 @@ func (b *Buffer) SaveAs(filename string) error {
|
|||
// SaveAsWithSudo is the same as SaveAs except it uses a neat trick
|
||||
// with tee to use sudo so the user doesn't have to reopen micro with sudo
|
||||
func (b *Buffer) SaveAsWithSudo(filename string) error {
|
||||
b.FindFileType()
|
||||
b.UpdateRules()
|
||||
b.Path = filename
|
||||
|
||||
|
|
|
|||
|
|
@ -45,11 +45,14 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
|
|||
softwrap := buf.Settings["softwrap"].(bool)
|
||||
indentchar := []rune(buf.Settings["indentchar"].(string))[0]
|
||||
|
||||
matches := buf.highlighter.Highlight(buf.String())
|
||||
|
||||
c.lines = make([][]*Char, 0)
|
||||
|
||||
viewLine := 0
|
||||
lineN := top
|
||||
|
||||
curStyle := defStyle
|
||||
for viewLine < height {
|
||||
if lineN >= len(buf.lines) {
|
||||
break
|
||||
|
|
@ -78,17 +81,21 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
|
|||
if colN >= len(line) {
|
||||
break
|
||||
}
|
||||
if group, ok := matches[lineN][colN]; ok {
|
||||
curStyle = GetColor(group)
|
||||
}
|
||||
|
||||
char := line[colN]
|
||||
|
||||
if char == '\t' {
|
||||
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, indentchar, tcell.StyleDefault}
|
||||
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, indentchar, curStyle}
|
||||
// TODO: this always adds 4 spaces but it should really add just the remainder to the next tab location
|
||||
viewCol += tabsize
|
||||
} else if runewidth.RuneWidth(char) > 1 {
|
||||
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, tcell.StyleDefault}
|
||||
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, curStyle}
|
||||
viewCol += runewidth.RuneWidth(char)
|
||||
} else {
|
||||
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, tcell.StyleDefault}
|
||||
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, curStyle}
|
||||
viewCol++
|
||||
}
|
||||
colN++
|
||||
|
|
@ -107,6 +114,10 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
|
|||
|
||||
viewCol = 0
|
||||
}
|
||||
|
||||
}
|
||||
if group, ok := matches[lineN][len(line)]; ok {
|
||||
curStyle = GetColor(group)
|
||||
}
|
||||
|
||||
// newline
|
||||
|
|
|
|||
|
|
@ -15,6 +15,33 @@ type Colorscheme map[string]tcell.Style
|
|||
// The current colorscheme
|
||||
var colorscheme Colorscheme
|
||||
|
||||
// This takes in a syntax group and returns the colorscheme's style for that group
|
||||
func GetColor(color string) tcell.Style {
|
||||
st := defStyle
|
||||
if color == "" {
|
||||
return st
|
||||
}
|
||||
groups := strings.Split(color, ".")
|
||||
if len(groups) > 1 {
|
||||
curGroup := ""
|
||||
for i, g := range groups {
|
||||
if i != 0 {
|
||||
curGroup += "."
|
||||
}
|
||||
curGroup += g
|
||||
if style, ok := colorscheme[curGroup]; ok {
|
||||
st = style
|
||||
}
|
||||
}
|
||||
} else if style, ok := colorscheme[color]; ok {
|
||||
st = style
|
||||
} else {
|
||||
st = StringToStyle(color)
|
||||
}
|
||||
|
||||
return st
|
||||
}
|
||||
|
||||
// ColorschemeExists checks if a given colorscheme exists
|
||||
func ColorschemeExists(colorschemeName string) bool {
|
||||
return FindRuntimeFile(RTColorscheme, colorschemeName) != nil
|
||||
|
|
@ -23,10 +50,11 @@ func ColorschemeExists(colorschemeName string) bool {
|
|||
// InitColorscheme picks and initializes the colorscheme when micro starts
|
||||
func InitColorscheme() {
|
||||
colorscheme = make(Colorscheme)
|
||||
defStyle = tcell.StyleDefault.
|
||||
Foreground(tcell.ColorDefault).
|
||||
Background(tcell.ColorDefault)
|
||||
if screen != nil {
|
||||
screen.SetStyle(tcell.StyleDefault.
|
||||
Foreground(tcell.ColorDefault).
|
||||
Background(tcell.ColorDefault))
|
||||
screen.SetStyle(defStyle)
|
||||
}
|
||||
|
||||
LoadDefaultColorscheme()
|
||||
|
|
@ -47,20 +75,6 @@ func LoadColorscheme(colorschemeName string) {
|
|||
TermMessage("Error loading colorscheme:", err)
|
||||
} else {
|
||||
colorscheme = ParseColorscheme(string(data))
|
||||
|
||||
// Default style
|
||||
defStyle = tcell.StyleDefault.
|
||||
Foreground(tcell.ColorDefault).
|
||||
Background(tcell.ColorDefault)
|
||||
|
||||
// There may be another default style defined in the colorscheme
|
||||
// In that case we should use that one
|
||||
if style, ok := colorscheme["default"]; ok {
|
||||
defStyle = style
|
||||
}
|
||||
if screen != nil {
|
||||
screen.SetStyle(defStyle)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -94,6 +108,9 @@ func ParseColorscheme(text string) Colorscheme {
|
|||
if link == "default" {
|
||||
defStyle = style
|
||||
}
|
||||
if screen != nil {
|
||||
screen.SetStyle(defStyle)
|
||||
}
|
||||
} else {
|
||||
fmt.Println("Color-link statement is not valid:", line)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -485,9 +485,6 @@ func Replace(args []string) {
|
|||
break
|
||||
}
|
||||
view.Relocate()
|
||||
if view.Buf.Settings["syntax"].(bool) {
|
||||
view.matches = Match(view)
|
||||
}
|
||||
RedrawAll()
|
||||
choice, canceled := messenger.YesNoPrompt("Perform replacement? (y,n)")
|
||||
if canceled {
|
||||
|
|
|
|||
|
|
@ -1,368 +1,28 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
import "github.com/zyedidia/highlight"
|
||||
|
||||
"github.com/zyedidia/tcell"
|
||||
)
|
||||
var syntaxDefs []*highlight.Def
|
||||
|
||||
// FileTypeRules represents a complete set of syntax rules for a filetype
|
||||
type FileTypeRules struct {
|
||||
filetype string
|
||||
filename string
|
||||
text string
|
||||
}
|
||||
|
||||
// SyntaxRule represents a regex to highlight in a certain style
|
||||
type SyntaxRule struct {
|
||||
// What to highlight
|
||||
regex *regexp.Regexp
|
||||
// Any flags
|
||||
flags string
|
||||
// Whether this regex is a start=... end=... regex
|
||||
startend bool
|
||||
// How to highlight it
|
||||
style tcell.Style
|
||||
}
|
||||
|
||||
var syntaxKeys [][2]*regexp.Regexp
|
||||
var syntaxFiles map[[2]*regexp.Regexp]FileTypeRules
|
||||
|
||||
// LoadSyntaxFiles loads the syntax files from the default directory (configDir)
|
||||
func LoadSyntaxFiles() {
|
||||
InitColorscheme()
|
||||
syntaxFiles = make(map[[2]*regexp.Regexp]FileTypeRules)
|
||||
for _, f := range ListRuntimeFiles(RTSyntax) {
|
||||
data, err := f.Data()
|
||||
if err != nil {
|
||||
TermMessage("Error loading syntax file " + f.Name() + ": " + err.Error())
|
||||
} else {
|
||||
LoadSyntaxFile(string(data), f.Name())
|
||||
LoadSyntaxFile(data, f.Name())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// JoinRule takes a syntax rule (which can be multiple regular expressions)
|
||||
// and joins it into one regular expression by ORing everything together
|
||||
func JoinRule(rule string) string {
|
||||
split := strings.Split(rule, `" "`)
|
||||
joined := strings.Join(split, ")|(")
|
||||
joined = "(" + joined + ")"
|
||||
return joined
|
||||
}
|
||||
|
||||
// LoadSyntaxFile simply gets the filetype of a the syntax file and the source for the
|
||||
// file and creates FileTypeRules out of it. If this filetype is the one opened by the user
|
||||
// the rules will be loaded and compiled later
|
||||
// In this function we are only concerned with loading the syntax and header regexes
|
||||
func LoadSyntaxFile(text, filename string) {
|
||||
var err error
|
||||
lines := strings.Split(string(text), "\n")
|
||||
|
||||
// Regex for parsing syntax statements
|
||||
syntaxParser := regexp.MustCompile(`syntax "(.*?)"\s+"(.*)"+`)
|
||||
// Regex for parsing header statements
|
||||
headerParser := regexp.MustCompile(`header "(.*)"`)
|
||||
|
||||
// Is there a syntax definition in this file?
|
||||
hasSyntax := syntaxParser.MatchString(text)
|
||||
// Is there a header definition in this file?
|
||||
hasHeader := headerParser.MatchString(text)
|
||||
|
||||
var syntaxRegex *regexp.Regexp
|
||||
var headerRegex *regexp.Regexp
|
||||
var filetype string
|
||||
for lineNum, line := range lines {
|
||||
if (hasSyntax == (syntaxRegex != nil)) && (hasHeader == (headerRegex != nil)) {
|
||||
// We found what we we're supposed to find
|
||||
break
|
||||
}
|
||||
|
||||
if strings.TrimSpace(line) == "" ||
|
||||
strings.TrimSpace(line)[0] == '#' {
|
||||
// Ignore this line
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.HasPrefix(line, "syntax") {
|
||||
// Syntax statement
|
||||
syntaxMatches := syntaxParser.FindSubmatch([]byte(line))
|
||||
if len(syntaxMatches) == 3 {
|
||||
if syntaxRegex != nil {
|
||||
TermError(filename, lineNum, "Syntax statement redeclaration")
|
||||
}
|
||||
|
||||
filetype = string(syntaxMatches[1])
|
||||
extensions := JoinRule(string(syntaxMatches[2]))
|
||||
|
||||
syntaxRegex, err = regexp.Compile(extensions)
|
||||
if err != nil {
|
||||
TermError(filename, lineNum, err.Error())
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
TermError(filename, lineNum, "Syntax statement is not valid: "+line)
|
||||
continue
|
||||
}
|
||||
} else if strings.HasPrefix(line, "header") {
|
||||
// Header statement
|
||||
headerMatches := headerParser.FindSubmatch([]byte(line))
|
||||
if len(headerMatches) == 2 {
|
||||
header := JoinRule(string(headerMatches[1]))
|
||||
|
||||
headerRegex, err = regexp.Compile(header)
|
||||
if err != nil {
|
||||
TermError(filename, lineNum, "Regex error: "+err.Error())
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
TermError(filename, lineNum, "Header statement is not valid: "+line)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if syntaxRegex != nil {
|
||||
// Add the current rules to the syntaxFiles variable
|
||||
regexes := [2]*regexp.Regexp{syntaxRegex, headerRegex}
|
||||
syntaxKeys = append(syntaxKeys, regexes)
|
||||
syntaxFiles[regexes] = FileTypeRules{filetype, filename, text}
|
||||
}
|
||||
}
|
||||
|
||||
// LoadRulesFromFile loads just the syntax rules from a given file
|
||||
// Only the necessary rules are loaded when the buffer is opened.
|
||||
// If we load all the rules for every filetype when micro starts, there's a bit of lag
|
||||
// A rule just explains how to color certain regular expressions
|
||||
// Example: color comment "//.*"
|
||||
// This would color all strings that match the regex "//.*" in the comment color defined
|
||||
// by the colorscheme
|
||||
func LoadRulesFromFile(text, filename string) []SyntaxRule {
|
||||
lines := strings.Split(string(text), "\n")
|
||||
|
||||
// Regex for parsing standard syntax rules
|
||||
ruleParser := regexp.MustCompile(`color (.*?)\s+(?:\((.*?)\)\s+)?"(.*)"`)
|
||||
// Regex for parsing syntax rules with start="..." end="..."
|
||||
ruleStartEndParser := regexp.MustCompile(`color (.*?)\s+(?:\((.*?)\)\s+)?start="(.*)"\s+end="(.*)"`)
|
||||
|
||||
var rules []SyntaxRule
|
||||
for lineNum, line := range lines {
|
||||
if strings.TrimSpace(line) == "" ||
|
||||
strings.TrimSpace(line)[0] == '#' ||
|
||||
strings.HasPrefix(line, "syntax") ||
|
||||
strings.HasPrefix(line, "header") {
|
||||
// Ignore this line
|
||||
continue
|
||||
}
|
||||
|
||||
// Syntax rule, but it could be standard or start-end
|
||||
if ruleParser.MatchString(line) {
|
||||
// Standard syntax rule
|
||||
// Parse the line
|
||||
submatch := ruleParser.FindSubmatch([]byte(line))
|
||||
var color string
|
||||
var regexStr string
|
||||
var flags string
|
||||
if len(submatch) == 4 {
|
||||
// If len is 4 then the user specified some additional flags to use
|
||||
color = string(submatch[1])
|
||||
flags = string(submatch[2])
|
||||
regexStr = "(?" + flags + ")" + JoinRule(string(submatch[3]))
|
||||
} else if len(submatch) == 3 {
|
||||
// If len is 3, no additional flags were given
|
||||
color = string(submatch[1])
|
||||
regexStr = JoinRule(string(submatch[2]))
|
||||
} else {
|
||||
// If len is not 3 or 4 there is a problem
|
||||
TermError(filename, lineNum, "Invalid statement: "+line)
|
||||
continue
|
||||
}
|
||||
// Compile the regex
|
||||
regex, err := regexp.Compile(regexStr)
|
||||
if err != nil {
|
||||
TermError(filename, lineNum, err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
// Get the style
|
||||
// The user could give us a "color" that is really a part of the colorscheme
|
||||
// in which case we should look that up in the colorscheme
|
||||
// They can also just give us a straight up color
|
||||
st := defStyle
|
||||
groups := strings.Split(color, ".")
|
||||
if len(groups) > 1 {
|
||||
curGroup := ""
|
||||
for i, g := range groups {
|
||||
if i != 0 {
|
||||
curGroup += "."
|
||||
}
|
||||
curGroup += g
|
||||
if style, ok := colorscheme[curGroup]; ok {
|
||||
st = style
|
||||
}
|
||||
}
|
||||
} else if style, ok := colorscheme[color]; ok {
|
||||
st = style
|
||||
} else {
|
||||
st = StringToStyle(color)
|
||||
}
|
||||
// Add the regex, flags, and style
|
||||
// False because this is not start-end
|
||||
rules = append(rules, SyntaxRule{regex, flags, false, st})
|
||||
} else if ruleStartEndParser.MatchString(line) {
|
||||
// Start-end syntax rule
|
||||
submatch := ruleStartEndParser.FindSubmatch([]byte(line))
|
||||
var color string
|
||||
var start string
|
||||
var end string
|
||||
// Use m and s flags by default
|
||||
flags := "ms"
|
||||
if len(submatch) == 5 {
|
||||
// If len is 5 the user provided some additional flags
|
||||
color = string(submatch[1])
|
||||
flags += string(submatch[2])
|
||||
start = string(submatch[3])
|
||||
end = string(submatch[4])
|
||||
} else if len(submatch) == 4 {
|
||||
// If len is 4 the user did not provide additional flags
|
||||
color = string(submatch[1])
|
||||
start = string(submatch[2])
|
||||
end = string(submatch[3])
|
||||
} else {
|
||||
// If len is not 4 or 5 there is a problem
|
||||
TermError(filename, lineNum, "Invalid statement: "+line)
|
||||
continue
|
||||
}
|
||||
|
||||
// Compile the regex
|
||||
regex, err := regexp.Compile("(?" + flags + ")" + "(" + start + ").*?(" + end + ")")
|
||||
if err != nil {
|
||||
TermError(filename, lineNum, err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
// Get the style
|
||||
// The user could give us a "color" that is really a part of the colorscheme
|
||||
// in which case we should look that up in the colorscheme
|
||||
// They can also just give us a straight up color
|
||||
st := defStyle
|
||||
if _, ok := colorscheme[color]; ok {
|
||||
st = colorscheme[color]
|
||||
} else {
|
||||
st = StringToStyle(color)
|
||||
}
|
||||
// Add the regex, flags, and style
|
||||
// True because this is start-end
|
||||
rules = append(rules, SyntaxRule{regex, flags, true, st})
|
||||
}
|
||||
}
|
||||
return rules
|
||||
}
|
||||
|
||||
// FindFileType finds the filetype for the given buffer
|
||||
func FindFileType(buf *Buffer) string {
|
||||
for _, r := range syntaxKeys {
|
||||
if r[1] != nil && r[1].MatchString(buf.Line(0)) {
|
||||
// The header statement matches the first line
|
||||
return syntaxFiles[r].filetype
|
||||
}
|
||||
}
|
||||
for _, r := range syntaxKeys {
|
||||
if r[0] != nil && r[0].MatchString(buf.Path) {
|
||||
// The syntax statement matches the extension
|
||||
return syntaxFiles[r].filetype
|
||||
}
|
||||
}
|
||||
return "Unknown"
|
||||
}
|
||||
|
||||
// GetRules finds the syntax rules that should be used for the buffer
|
||||
// and returns them. It also returns the filetype of the file
|
||||
func GetRules(buf *Buffer) []SyntaxRule {
|
||||
for _, r := range syntaxKeys {
|
||||
if syntaxFiles[r].filetype == buf.FileType() {
|
||||
return LoadRulesFromFile(syntaxFiles[r].text, syntaxFiles[r].filename)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SyntaxMatches is an alias to a map from character numbers to styles,
|
||||
// so map[3] represents the style of the third character
|
||||
type SyntaxMatches [][]tcell.Style
|
||||
|
||||
// Match takes a buffer and returns the syntax matches: a 2d array specifying how it should be syntax highlighted
|
||||
// We match the rules from up `synLinesUp` lines and down `synLinesDown` lines
|
||||
func Match(v *View) SyntaxMatches {
|
||||
buf := v.Buf
|
||||
rules := v.Buf.rules
|
||||
|
||||
viewStart := v.Topline
|
||||
viewEnd := v.Topline + v.Height
|
||||
if viewEnd > buf.NumLines {
|
||||
viewEnd = buf.NumLines
|
||||
}
|
||||
|
||||
lines := buf.Lines(viewStart, viewEnd)
|
||||
matches := make(SyntaxMatches, len(lines))
|
||||
|
||||
for i, line := range lines {
|
||||
matches[i] = make([]tcell.Style, len(line)+1)
|
||||
for j := range matches[i] {
|
||||
matches[i][j] = defStyle
|
||||
}
|
||||
}
|
||||
|
||||
// We don't actually check the entire buffer, just from synLinesUp to synLinesDown
|
||||
totalStart := v.Topline - synLinesUp
|
||||
totalEnd := v.Topline + v.Height + synLinesDown
|
||||
if totalStart < 0 {
|
||||
totalStart = 0
|
||||
}
|
||||
if totalEnd > buf.NumLines {
|
||||
totalEnd = buf.NumLines
|
||||
}
|
||||
|
||||
str := strings.Join(buf.Lines(totalStart, totalEnd), "\n")
|
||||
startNum := ToCharPos(Loc{0, totalStart}, v.Buf)
|
||||
|
||||
for _, rule := range rules {
|
||||
if rule.startend {
|
||||
if indicies := rule.regex.FindAllStringIndex(str, -1); indicies != nil {
|
||||
for _, value := range indicies {
|
||||
value[0] = runePos(value[0], str) + startNum
|
||||
value[1] = runePos(value[1], str) + startNum
|
||||
startLoc := FromCharPos(value[0], buf)
|
||||
endLoc := FromCharPos(value[1], buf)
|
||||
for curLoc := startLoc; curLoc.LessThan(endLoc); curLoc = curLoc.Move(1, buf) {
|
||||
if curLoc.Y < v.Topline {
|
||||
continue
|
||||
}
|
||||
colNum, lineNum := curLoc.X, curLoc.Y
|
||||
if lineNum == -1 || colNum == -1 {
|
||||
continue
|
||||
}
|
||||
lineNum -= viewStart
|
||||
if lineNum >= 0 && lineNum < v.Height {
|
||||
matches[lineNum][colNum] = rule.style
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for lineN, line := range lines {
|
||||
if indicies := rule.regex.FindAllStringIndex(line, -1); indicies != nil {
|
||||
for _, value := range indicies {
|
||||
start := runePos(value[0], line)
|
||||
end := runePos(value[1], line)
|
||||
for i := start; i < end; i++ {
|
||||
matches[lineN][i] = rule.style
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return matches
|
||||
func LoadSyntaxFile(text []byte, filename string) {
|
||||
def, err := highlight.ParseDef(text)
|
||||
|
||||
if err != nil {
|
||||
TermMessage("Syntax file error: " + filename + ": " + err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
syntaxDefs = append(syntaxDefs, def)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,9 +228,6 @@ func LoadAll() {
|
|||
for _, tab := range tabs {
|
||||
for _, v := range tab.views {
|
||||
v.Buf.UpdateRules()
|
||||
if v.Buf.Settings["syntax"].(bool) {
|
||||
v.matches = Match(v)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -384,7 +381,6 @@ func main() {
|
|||
|
||||
for _, t := range tabs {
|
||||
for _, v := range t.views {
|
||||
v.Buf.FindFileType()
|
||||
v.Buf.UpdateRules()
|
||||
for pl := range loadedPlugins {
|
||||
_, err := Call(pl+".onViewOpen", v)
|
||||
|
|
@ -393,9 +389,6 @@ func main() {
|
|||
continue
|
||||
}
|
||||
}
|
||||
if v.Buf.Settings["syntax"].(bool) {
|
||||
v.matches = Match(v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ func InitRuntimeFiles() {
|
|||
}
|
||||
|
||||
add(RTColorscheme, "colorschemes", "*.micro")
|
||||
add(RTSyntax, "syntax", "*.micro")
|
||||
add(RTSyntax, "syntax", "*.yaml")
|
||||
add(RTHelp, "help", "*.md")
|
||||
|
||||
// Search configDir for plugin-scripts
|
||||
|
|
|
|||
2239
cmd/micro/runtime.go
2239
cmd/micro/runtime.go
File diff suppressed because one or more lines are too long
|
|
@ -144,8 +144,5 @@ func Search(searchStr string, v *View, down bool) {
|
|||
v.Cursor.SetSelectionStart(FromCharPos(charPos+runePos(match[0], str), v.Buf))
|
||||
v.Cursor.SetSelectionEnd(FromCharPos(charPos+runePos(match[1], str), v.Buf))
|
||||
v.Cursor.Loc = v.Cursor.CurSelection[1]
|
||||
if v.Relocate() {
|
||||
v.matches = Match(v)
|
||||
}
|
||||
lastSearch = searchStr
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,9 +281,6 @@ func SetOption(option, value string) error {
|
|||
for _, tab := range tabs {
|
||||
for _, view := range tab.views {
|
||||
view.Buf.UpdateRules()
|
||||
if view.Buf.Settings["syntax"].(bool) {
|
||||
view.matches = Match(view)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -341,17 +338,11 @@ func SetLocalOption(option, value string, view *View) error {
|
|||
|
||||
if option == "statusline" {
|
||||
view.ToggleStatusLine()
|
||||
if buf.Settings["syntax"].(bool) {
|
||||
view.matches = Match(view)
|
||||
}
|
||||
}
|
||||
|
||||
if option == "filetype" {
|
||||
LoadSyntaxFiles()
|
||||
buf.UpdateRules()
|
||||
if buf.Settings["syntax"].(bool) {
|
||||
view.matches = Match(view)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -255,7 +255,6 @@ func (s *SplitTree) ResizeSplits() {
|
|||
}
|
||||
|
||||
n.view.ToggleTabbar()
|
||||
n.view.matches = Match(n.view)
|
||||
} else if n, ok := node.(*SplitTree); ok {
|
||||
if s.kind == VerticalSplit {
|
||||
if !n.lockWidth {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/mitchellh/go-homedir"
|
||||
"github.com/zyedidia/highlight"
|
||||
"github.com/zyedidia/tcell"
|
||||
)
|
||||
|
||||
|
|
@ -87,7 +88,7 @@ type View struct {
|
|||
tripleClick bool
|
||||
|
||||
// Syntax highlighting matches
|
||||
matches SyntaxMatches
|
||||
matches []highlight.LineMatch
|
||||
|
||||
cellview *CellView
|
||||
|
||||
|
|
@ -235,8 +236,6 @@ func (v *View) OpenBuffer(buf *Buffer) {
|
|||
v.Center(false)
|
||||
v.messages = make(map[string][]GutterMessage)
|
||||
|
||||
v.matches = Match(v)
|
||||
|
||||
// Set mouseReleased to true because we assume the mouse is not being pressed when
|
||||
// the editor is opened
|
||||
v.mouseReleased = true
|
||||
|
|
@ -274,7 +273,6 @@ func (v *View) ReOpen() {
|
|||
screen.Clear()
|
||||
v.Buf.ReOpen()
|
||||
v.Relocate()
|
||||
v.matches = Match(v)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
## Syntax highlighting for Dockerfiles
|
||||
syntax "dockerfile" "Dockerfile[^/]*$" "\.dockerfile$"
|
||||
|
||||
## Keywords
|
||||
color keyword (i) "^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD|ARG|HEALTHCHECK|STOPSIGNAL|SHELL)[[:space:]]"
|
||||
|
||||
## Brackets & parenthesis
|
||||
color statement "(\(|\)|\[|\])"
|
||||
|
||||
## Double ampersand
|
||||
color special "&&"
|
||||
|
||||
## Comments
|
||||
color comment (i) "^[[:space:]]*#.*$"
|
||||
|
||||
## Strings, single-quoted
|
||||
color constant.string "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||
|
||||
## Strings, double-quoted
|
||||
color constant.string ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
micro syntax files
|
||||
Copyright (C) 2016+ Zachary Yedidia et al.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
export
|
||||
:=
|
||||
error
|
||||
|
||||
|
|
@ -1,41 +1,5 @@
|
|||
# Micro syntax highlighting files
|
||||
# Syntax Files
|
||||
|
||||
These are the syntax highlighting files for micro. To install them, just
|
||||
put all the syntax files in `~/.config/micro/syntax`.
|
||||
|
||||
They are taken from Nano, specifically from [this repository](https://github.com/scopatz/nanorc).
|
||||
Micro syntax files are almost identical to Nano's, except for some key differences:
|
||||
|
||||
* Micro does not use `icolor`. Instead, for a case insensitive match, use the case insensitive flag (`i`) in the regular expression
|
||||
* For example, `icolor green ".*"` would become `color green (i) ".*"`
|
||||
|
||||
# Using with colorschemes
|
||||
|
||||
Not all of these files have been converted to use micro's colorscheme feature. Most of them just hardcode the colors, which
|
||||
can be problematic depending on the colorscheme you use.
|
||||
|
||||
Here is a list of the files that have been converted to properly use colorschemes:
|
||||
|
||||
* vi
|
||||
* go
|
||||
* c
|
||||
* d
|
||||
* markdown
|
||||
* html
|
||||
* lua
|
||||
* swift
|
||||
* rust
|
||||
* java
|
||||
* javascript
|
||||
* pascal
|
||||
* python
|
||||
* ruby
|
||||
* sh
|
||||
* git
|
||||
* tex
|
||||
* solidity
|
||||
|
||||
# License
|
||||
|
||||
Because the nano syntax files I have modified are distributed under the GNU GPLv3 license, these files are also distributed
|
||||
under that license. See [LICENSE](LICENSE).
|
||||
Here are highlight's syntax files. If you would like to make a new syntax file, you should first check it
|
||||
with the `syntax_checker.go` program. Just place it in this directory and run the program (`go run syntax_checker.go`)
|
||||
and it will let you know if there are issues with any of the files in the directory.
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
# Apache files
|
||||
syntax "apacheconf" "httpd\.conf|mime\.types|vhosts\.d\\*|\.htaccess"
|
||||
color yellow ".+"
|
||||
color brightcyan "(AcceptMutex|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding)"
|
||||
color brightcyan "(AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch)"
|
||||
color brightcyan "(Allow|AllowCONNECT|AllowEncodedSlashes|AllowOverride|Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID)"
|
||||
color brightcyan "(Anonymous_VerifyEmail|AssignUserID|AuthAuthoritative|AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm)"
|
||||
color brightcyan "(AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)"
|
||||
color brightcyan "(AuthGroupFile|AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases)"
|
||||
color brightcyan "(AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl|AuthName|AuthType|AuthUserFile)"
|
||||
color brightcyan "(BrowserMatch|BrowserMatchNoCase|BS2000Account|BufferedLogs|CacheDefaultExpire|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheExpiryCheck)"
|
||||
color brightcyan "(CacheFile|CacheForceCompletion|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheIgnoreCacheControl|CacheIgnoreHeaders)"
|
||||
color brightcyan "(CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire|CacheMaxFileSize|CacheMinFileSize|CacheNegotiatedDocs|CacheRoot|CacheSize|CacheTimeMargin)"
|
||||
color brightcyan "(CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckSpelling|ChildPerUserID|ContentDigest|CookieDomain|CookieExpires|CookieLog|CookieName)"
|
||||
color brightcyan "(CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavLockDB|DavMinTimeout|DefaultIcon|DefaultLanguage|DefaultType)"
|
||||
color brightcyan "(DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize|Deny|Directory|DirectoryIndex|DirectoryMatch|DirectorySlash)"
|
||||
color brightcyan "(DocumentRoot|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|Example|ExpiresActive|ExpiresByType)"
|
||||
color brightcyan "(ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FileETag|Files|FilesMatch|ForceLanguagePriority|ForceType|ForensicLog|Group|Header)"
|
||||
color brightcyan "(HeaderName|HostnameLookups|IdentityCheck|IfDefine|IfModule|IfVersion|ImapBase|ImapDefault|ImapMenu|Include|IndexIgnore|IndexOptions|IndexOrderDefault)"
|
||||
color brightcyan "(ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout)"
|
||||
color brightcyan "(LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize)"
|
||||
color brightcyan "(LDAPTrustedCA|LDAPTrustedCAType|Limit|LimitExcept|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine)"
|
||||
color brightcyan "(LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|Location|LocationMatch|LockFile|LogFormat|LogLevel|MaxClients|MaxKeepAliveRequests)"
|
||||
color brightcyan "(MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MCacheMaxObjectCount|MCacheMaxObjectSize)"
|
||||
color brightcyan "(MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads)"
|
||||
color brightcyan "(MMapFile|ModMimeUsePathInfo|MultiviewsMatch|NameVirtualHost|NoProxy|NumServers|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|PassEnv|PidFile)"
|
||||
color brightcyan "(ProtocolEcho|Proxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyIOBufferSize|ProxyMatch|ProxyMaxForwards|ProxyPass|ProxyPassReverse)"
|
||||
color brightcyan "(ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia|ReadmeName|Redirect|RedirectMatch)"
|
||||
color brightcyan "(RedirectPermanent|RedirectTemp|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader)"
|
||||
color brightcyan "(Require|RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC)"
|
||||
color brightcyan "(Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen)"
|
||||
color brightcyan "(SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetEnv|SetEnvIf|SetEnvIfNoCase|SetHandler)"
|
||||
color brightcyan "(SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath)"
|
||||
color brightcyan "(SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions)"
|
||||
color brightcyan "(SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite)"
|
||||
color brightcyan "(SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire)"
|
||||
color brightcyan "(SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|SuexecUserGroup|ThreadLimit)"
|
||||
color brightcyan "(ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnsetEnv|UseCanonicalName|User|UserDir|VirtualDocumentRoot)"
|
||||
color brightcyan "(VirtualDocumentRootIP|VirtualHost|VirtualScriptAlias|VirtualScriptAliasIP|Win32DisableAcceptEx|XBitHack)"
|
||||
color yellow "<[^>]+>"
|
||||
color brightcyan "</?[A-Za-z]+"
|
||||
color brightcyan "(<|</|>)"
|
||||
color green "\"(\\.|[^\"])*\""
|
||||
color white "#.*"
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
|
||||
## FILENAME: arduino.nanorc
|
||||
##
|
||||
## DESCRIPTION: The arduino.nanorc syntax files allows syntax highlighting
|
||||
## for Arduino sketch files in the GNU nano text editor.
|
||||
##
|
||||
## Maintainer: Nicholas Wilde
|
||||
## Version: 0.1
|
||||
## DATE: 06/23/2011
|
||||
##
|
||||
## HOMEPAGE: http://code.google.com/p/arduino-nano-editor-syntax/
|
||||
##
|
||||
## COMMENTS: -Most of the code was taken from the c.nanorc code found with
|
||||
## GNU nano 2.2.6.
|
||||
## -Direction was taken from the arduino vim syntax code by johannes
|
||||
## <https://bitbucket.org/johannes/arduino-vim-syntax/>
|
||||
## -Tested on Ubuntu Server 11.04 Natty Narwhal and GNU nano 2.2.6
|
||||
##
|
||||
## DIRECTIONS: For Ubuntu Server 11.04 Natty Narwhal:
|
||||
## -Move this file <arduino.nanorc> to the nano directory
|
||||
## /usr/share/nano/
|
||||
## -Add arduino.nanorc reference to the nanorc settings file
|
||||
## /etc/nanorc
|
||||
## ...
|
||||
## ## Arduino
|
||||
## /usr/share/nano/arduino.nanorc
|
||||
## ...
|
||||
|
||||
syntax "ino" "\.?ino$"
|
||||
|
||||
##
|
||||
color brightred "\<[A-Z_][0-9A-Z_]+\>"
|
||||
|
||||
##
|
||||
color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
|
||||
|
||||
## Constants
|
||||
green (i) "\<(HIGH|LOW|INPUT|OUTPUT)\>"
|
||||
|
||||
## Serial Print
|
||||
red (i) "\<(DEC|BIN|HEX|OCT|BYTE)\>"
|
||||
|
||||
## PI Constants
|
||||
green (i) "\<(PI|HALF_PI|TWO_PI)\>"
|
||||
|
||||
## ShiftOut
|
||||
green (i) "\<(LSBFIRST|MSBFIRST)\>"
|
||||
|
||||
## Attach Interrupt
|
||||
green (i) "\<(CHANGE|FALLING|RISING)\>"
|
||||
|
||||
## Analog Reference
|
||||
green (i) "\<(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\>"
|
||||
|
||||
## === FUNCTIONS === ##
|
||||
|
||||
## Data Types
|
||||
color green "\<(boolean|byte|char|float|int|long|word)\>"
|
||||
|
||||
## Control Structions
|
||||
color brightyellow "\<(case|class|default|do|double|else|false|for|if|new|null|private|protected|public|short|signed|static|String|switch|this|throw|try|true|unsigned|void|while)\>"
|
||||
color magenta "\<(goto|continue|break|return)\>"
|
||||
|
||||
## Math
|
||||
color brightyellow "\<(abs|acos|asin|atan|atan2|ceil|constrain|cos|degrees|exp|floor|log|map|max|min|radians|random|randomSeed|round|sin|sq|sqrt|tan)\>"
|
||||
|
||||
## Bits & Bytes
|
||||
color brightyellow "\<(bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte)\>"
|
||||
|
||||
## Analog I/O
|
||||
color brightyellow "\<(analogReference|analogRead|analogWrite)\>"
|
||||
|
||||
## External Interrupts
|
||||
color brightyellow "\<(attachInterrupt|detachInterrupt)\>"
|
||||
|
||||
## Time
|
||||
color brightyellow "\<(delay|delayMicroseconds|millis|micros)\>"
|
||||
|
||||
## Digital I/O
|
||||
color brightyellow "\<(pinMode|digitalWrite|digitalRead)\>"
|
||||
|
||||
## Interrupts
|
||||
color brightyellow "\<(interrupts|noInterrupts)\>"
|
||||
|
||||
## Advanced I/O
|
||||
color brightyellow "\<(noTone|pulseIn|shiftIn|shiftOut|tone)\>"
|
||||
|
||||
## Serial
|
||||
color magenta "\<(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\>"
|
||||
|
||||
## Structure
|
||||
color brightyellow "\<(setup|loop)\>"
|
||||
|
||||
##
|
||||
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
|
||||
|
||||
##
|
||||
color brightmagenta "'([^']|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
||||
|
||||
## GCC builtins
|
||||
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
|
||||
## String highlighting. You will in general want your comments and
|
||||
## strings to come last, because syntax highlighting rules will be
|
||||
## applied in the order they are read in.
|
||||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||
|
||||
## This string is VERY resource intensive!
|
||||
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
## Comments
|
||||
color brightblue "//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
## Trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
syntax "asciidoc" "\.(asc|asciidoc|adoc)$"
|
||||
|
||||
# main header
|
||||
color red "^====+$"
|
||||
# h1
|
||||
color red "^==[[:space:]].*$"
|
||||
color red "^----+$"
|
||||
# h2
|
||||
color magenta "^===[[:space:]].*$"
|
||||
color magenta "^~~~~+$"
|
||||
# h4
|
||||
color green "^====[[:space:]].*$"
|
||||
color green "^\^\^\^\^+$"
|
||||
# h5
|
||||
color brightblue "^=====[[:space:]].*$"
|
||||
color brightblue "^\+\+\+\++$"
|
||||
|
||||
# attributes
|
||||
color brightgreen ":.*:"
|
||||
color brightred "\{[a-z0-9]*\}"
|
||||
color red "\\\{[a-z0-9]*\}"
|
||||
color red "\+\+\+\{[a-z0-9]*\}\+\+\+"
|
||||
|
||||
# Paragraph Title
|
||||
color yellow "^\..*$"
|
||||
|
||||
# source
|
||||
color magenta "^\[(source,.+|NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]"
|
||||
|
||||
# Other markup
|
||||
color yellow ".*[[:space:]]\+$"
|
||||
color yellow "_[^_]+_"
|
||||
color yellow "\*[^\*]+\*"
|
||||
color yellow "\+[^\+]+\+"
|
||||
color yellow "`[^`]+`"
|
||||
color yellow "\^[^\^]+\^"
|
||||
color yellow "~[^~]+~"
|
||||
color yellow "'[^']+'"
|
||||
|
||||
color cyan "`{1,2}[^']+'{1,2}"
|
||||
|
||||
# bullets
|
||||
color brightmagenta "^[[:space:]]*[\*\.-]{1,5}[[:space:]]"
|
||||
|
||||
# anchors
|
||||
color brightwhite "\[\[.*\]\]"
|
||||
color brightwhite "<<.*>>"
|
||||
33
runtime/syntax/asciidoc.yaml
Normal file
33
runtime/syntax/asciidoc.yaml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
filetype: asciidoc
|
||||
|
||||
detect:
|
||||
filename: "\\.(asc|asciidoc|adoc)$"
|
||||
|
||||
rules:
|
||||
- red: "^====+$"
|
||||
- red: "^==[[:space:]].*$"
|
||||
- red: "^----+$"
|
||||
- magenta: "^===[[:space:]].*$"
|
||||
- magenta: "^~~~~+$"
|
||||
- green: "^====[[:space:]].*$"
|
||||
- green: "^\\^\\^\\^\\^+$"
|
||||
- brightblue: "^=====[[:space:]].*$"
|
||||
- brightblue: "^\\+\\+\\+\\++$"
|
||||
- brightgreen: ":.*:"
|
||||
- brightred: "\\{[a-z0-9]*\\}"
|
||||
- red: "\\\\\\{[a-z0-9]*\\}"
|
||||
- red: "\\+\\+\\+\\{[a-z0-9]*\\}\\+\\+\\+"
|
||||
- yellow: "^\\..*$"
|
||||
- magenta: "^\\[(source,.+|NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\]"
|
||||
- yellow: ".*[[:space:]]\\+$"
|
||||
- yellow: "_[^_]+_"
|
||||
- yellow: "\\*[^\\*]+\\*"
|
||||
- yellow: "\\+[^\\+]+\\+"
|
||||
- yellow: "`[^`]+`"
|
||||
- yellow: "\\^[^\\^]+\\^"
|
||||
- yellow: "~[^~]+~"
|
||||
- yellow: "'[^']+'"
|
||||
- cyan: "`{1,2}[^']+'{1,2}"
|
||||
- brightmagenta: "^[[:space:]]*[\\*\\.-]{1,5}[[:space:]]"
|
||||
- brightwhite: "\\[\\[.*\\]\\]"
|
||||
- brightwhite: "<<.*>>"
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
## Made by Nickolay Ilyushin <nickolay02@inbox.ru>. Next line is from previous (first) version (no need for modifications :P)
|
||||
syntax "asm" "\.(S|s|asm)$"
|
||||
|
||||
# This file is made for NASM assembly
|
||||
|
||||
## Instructions
|
||||
# x86
|
||||
color statement "\b(?i)(mov|aaa|aad|aam|aas|adc|add|and|call|cbw|clc|cld|cli|cmc|cmp|cmpsb|cmpsw|cwd|daa|das|dec|div|esc|hlt|idiv|imul|in|inc|int|into|iret|ja|jae|jb|jbe|jc|je|jg|jge|jl|jle|jna|jnae|jnb|jnbe|jnc|jne|jng|jnge|jnl|jnle|jno|jnp|jns|jnz|jo|jp|jpe|jpo|js|jz|jcxz|jmp|lahf|lds|lea|les|lock|lodsb|lodsw|loop|loope|loopne|loopnz|loopz|movsb|movsw|mul|neg|nop|or|pop|popf|push|pushf|rcl|rcr|rep|repe|repne|repnz|repz|ret|retn|retf|rol|ror|sahf|sal|sar|sbb|scasb|scasw|shl|shr|stc|std|sti|stosb|stosw|sub|test|wait|xchg|xlat|xor)(?-i)\b"
|
||||
color statement "\b(?i)(bound|enter|ins|leave|outs|popa|pusha)(?-i)\b"
|
||||
color statement "\b(?i)(arpl|clts|lar|lgdt|lidt|lldt|lmsw|loadall|lsl|ltr|sgdt|sidt|sldt|smsw|str|verr|verw)(?-i)\b"
|
||||
color statement "\b(?i)(bsf|bsr|bt|btc|btr|bts|cdq|cmpsd|cwde|insd|iret|iretd|iretf|jecxz|lfs|lgs|lss|lodsd|loopw|loopew|loopnew|loopnzw|loopzw|loopd|looped|loopned|loopnzd|loopzd|cr|tr|dr|movsd|movsx|movzx|outsd|popad|popfd|pushad|pushfd|scasd|seta|setae|setb|setbe|setc|sete|setg|setge|setl|setle|setna|setnae|setnb|setnbe|setnc|setne|setng|setnge|setnl|setnle|setno|setnp|setns|setnz|seto|setp|setpe|setpo|sets|setz|shdl|shrd|stosd)(?-i)\b"
|
||||
color statement "\b(?i)(bswap|cmpxcgh|invd|invlpg|wbinvd|xadd)(?-i)\b"
|
||||
color statement "\b(?i)(cpuid|cmpxchg8b|rdmsr|rdtsc|wrmsr|rsm)(?-i)\b"
|
||||
color statement "\b(?i)(rdpmc)(?-i)\b"
|
||||
color statement "\b(?i)(syscall|sysret)(?-i)\b"
|
||||
color statement "\b(?i)(cmova|cmovae|cmovb|cmovbe|cmovc|cmove|cmovg|cmovge|cmovl|cmovle|cmovna|cmovnae|cmovnb|cmovnbe|cmovnc|cmovne|cmovng|cmovnge|cmovnle|cmovno|cmovpn|cmovns|cmovnz|cmovo|cmovp|cmovpe|cmovpo|cmovs|cmovz|sysenter|sysexit|ud2)(?-i)\b"
|
||||
color statement "\b(?i)(maskmovq|movntps|movntq|prefetch0|prefetch1|prefetch2|prefetchnta|sfence)(?-i)\b"
|
||||
color statement "\b(?i)(clflush|lfence|maskmovdqu|mfence|movntdq|movnti|movntpd|pause)(?-i)\b"
|
||||
color statement "\b(?i)(monitor|mwait)(?-i)\b"
|
||||
color statement "\b(?i)(cdqe|cqo|cmpsq|cmpxchg16b|iretq|jrcxz|lodsq|movsdx|popfq|pushfq|rdtscp|scasq|stosq|swapgs)(?-i)\b"
|
||||
color statement "\b(?i)(clgi|invlpga|skinit|stgi|vmload|vmmcall|vmrun|vmsave)(?-i)\b"
|
||||
color statement "\b(?i)(vmptrdl|vmptrst|vmclear|vmread|vmwrite|vmcall|vmlaunch|vmresume|vmxoff|vmxon)(?-i)\b"
|
||||
color statement "\b(?i)(lzcnt|popcnt)(?-i)\b"
|
||||
color statement "\b(?i)(bextr|blcfill|blci|blcic|blcmask|blcs|blsfill|blsic|t1mskc|tzmsk)(?-i)\b"
|
||||
|
||||
# x87
|
||||
color statement "\b(?i)(f2xm1|fabs|fadd|faddp|fbld|fbstp|fchs|fclex|fcom|fcomp|fcompp|fdecstp|fdisi|fdiv|fvidp|fdivr|fdivrp|feni|ffree|fiadd|ficom|ficomp|fidiv|fidivr|fild|fimul|fincstp|finit|fist|fistp|fisub|fisubr|fld|fld1|fldcw|fldenv|fldenvw|fldl2e|fldl2t|fldlg2|fldln2|fldpi|fldz|fmul|fmulp|fnclex|fndisi|fneni|fninit|fnop|fnsave|fnsavenew|fnstcw|fnstenv|fnstenvw|fnstsw|fpatan|fprem|fptan|frndint|frstor|frstorw|fsave|fsavew|fscale|fsqrt|fst|fstcw|fstenv|fstenvw|fstp|fstpsw|fsub|fsubp|fsubr|fsubrp|ftst|fwait|fxam|fxch|fxtract|fyl2x|fyl2xp1)(?-i)\b"
|
||||
color statement "\b(?i)(fsetpm)(?-i)\b"
|
||||
color statement "\b(?i)(fcos|fldenvd|fsaved|fstenvd|fprem1|frstord|fsin|fsincos|fstenvd|fucom|fucomp|fucompp)(?-i)\b"
|
||||
color statement "\b(?i)(fcmovb|fcmovbe|fcmove|fcmove|fcmovnb|fcmovnbe|fcmovne|fcmovnu|fcmovu)(?-i)\b"
|
||||
color statement "\b(?i)(fcomi|fcomip|fucomi|fucomip)(?-i)\b"
|
||||
color statement "\b(?i)(fxrstor|fxsave)(?-i)\b"
|
||||
color statement "\b(?i)(fisttp)(?-i)\b"
|
||||
color statement "\b(?i)(ffreep)(?-i)\b"
|
||||
|
||||
# SIMD
|
||||
color statement "\b(?i)(emms|movd|movq|packssdw|packsswb|packuswb|paddb|paddw|paddd|paddsb|paddsw|paddusb|paddusw|pand|pandn|por|pxor|pcmpeqb|pcmpeqw|pcmpeqd|pcmpgtb|pcmpgtw|pcmpgtd|pmaddwd|pmulhw|pmullw|psllw|pslld|psllq|psrad|psraw|psrlw|psrld|psrlq|psubb|psubw|psubd|psubsb|psubsw|psubusb|punpckhbw|punpckhwd|punpckhdq|punkcklbw|punpckldq|punpcklwd)(?-i)\b"
|
||||
color statement "\b(?i)(paveb|paddsiw|pmagw|pdistib|psubsiw|pmwzb|pmulhrw|pmvnzb|pmvlzb|pmvgezb|pmulhriw|pmachriw)(?-i)\b"
|
||||
color statement "\b(?i)(femms|pavgusb|pf2id|pfacc|pfadd|pfcmpeq|pfcmpge|pfcmpgt|pfmax|pfmin|pfmul|pfrcp|pfrcpit1|pfrcpit2|pfrsqit1|pfrsqrt|pfsub|pfsubr|pi2fd|pmulhrw|prefetch|prefetchw)(?-i)\b"
|
||||
color statement "\b(?i)(pf2iw|pfnacc|pfpnacc|pi2fw|pswapd)(?-i)\b"
|
||||
color statement "\b(?i)(pfrsqrtv|pfrcpv)(?-i)\b"
|
||||
color statement "\b(?i)(addps|addss|cmpps|cmpss|comiss|cvtpi2ps|cvtps2pi|cvtsi2ss|cvtss2si|cvttps2pi|cvttss2si|divps|divss|ldmxcsr|maxps|maxss|minps|minss|movaps|movhlps|movhps|movlhps|movlps|movmskps|movntps|movss|movups|mulps|mulss|rcpps|rcpss|rsqrtps|rsqrtss|shufps|sqrtps|sqrtss|stmxcsr|subps|subss|ucomiss|unpckhps|unpcklps)(?-i)\b"
|
||||
color statement "\b(?i)(andnps|andps|orps|pavgb|pavgw|pextrw|pinsrw|pmaxsw|pmaxub|pminsw|pminub|pmovmskb|pmulhuw|psadbw|pshufw|xorps)(?-i)\b"
|
||||
color statement "\b(?i)(movups|movss|movlps|movhlps|movlps|unpcklps|unpckhps|movhps|movlhps|prefetchnta|prefetch0|prefetch1|prefetch2|nop|movaps|cvtpi2ps|cvtsi2ss|cvtps2pi|cvttss2si|cvtps2pi|cvtss2si|ucomiss|comiss|sqrtps|sqrtss|rsqrtps|rsqrtss|rcpps|andps|orps|xorps|addps|addss|mulps|mulss|subps|subss|minps|minss|divps|divss|maxps|maxss|pshufw|ldmxcsr|stmxcsr|sfence|cmpps|cmpss|pinsrw|pextrw|shufps|pmovmskb|pminub|pmaxub|pavgb|pavgw|pmulhuw|movntq|pminsw|pmaxsw|psadbw|maskmovq)(?-i)\b"
|
||||
color statement "\b(?i)(addpd|addsd|addnpd|cmppd|cmpsd)(?-i)\b"
|
||||
color statement "\b(?i)(addpd|addsd|andnpd|andpd|cmppd|cmpsd|comisd|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtps2dq|cvtps2pd|cvtsd2si|cvtsd2ss|cvtsi2sd|cvtss2sd|cvttpd2dq|cvttpd2pi|cvttps2dq|cvttsd2si|divpd|divsd|maxpd|maxsd|minpd|minsd|movapd|movhpd|movlpd|movmskpd|movsd|movupd|mulpd|mulsd|orpd|shufpd|sqrtpd|sqrtsd|subpd|subsd|ucomisd|unpckhpd|unpcklpd|xorpd)(?-i)\b"
|
||||
color statement "\b(?i)(movdq2q|movdqa|movdqu|movq2dq|paddq|psubq|pmuludq|pshufhw|pshuflw|pshufd|pslldq|psrldq|punpckhqdq|punpcklqdq)(?-i)\b"
|
||||
color statement "\b(?i)(addsubpd|addsubps|haddpd|haddps|hsubpd|hsubps|movddup|movshdup|movsldu)(?-i)\b"
|
||||
color statement "\b(?i)(lddqu)(?-i)\b"
|
||||
color statement "\b(?i)(psignw|psignd|psignb|pshufb|pmulhrsw|pmaddubsw|phsubw|phsubsw|phsubd|phaddw|phaddsw|phaddd|palignr|pabsw|pabsd|pabsb)(?-i)\b"
|
||||
color statement "\b(?i)(dpps|dppd|blendps|blendpd|blendvps|blendvpd|roundps|roundss|roundpd|roundsd|insertps|extractps)(?-i)\b"
|
||||
color statement "\b(?i)(mpsadbw|phminposuw|pmulld|pmuldq|pblendvb|pblendw|pminsb|pmaxsb|pminuw|pmaxuw|pminud|pmaxud|pminsd|pmaxsd|pinsrb|pinsrd/pinsrq|pextrb|pextrw|pextrd/pextrq|pmovsxbw|pmovzxbw|pmovsxbd|pmovzxbd|pmovsxbq|pmovzxbq|pmovsxwd|pmovzxwd|pmovsxwq|pmovzxwq|pmovsxdq|pmovzxdq|ptest|pcmpeqq|packusdw|movntdqa)(?-i)\b"
|
||||
color statement "\b(?i)(extrq|insertq|movntsd|movntss)(?-i)\b"
|
||||
color statement "\b(?i)(crc32|pcmpestri|pcmpestrm|pcmpistri|pcmpistrm|pcmpgtq)(?-i)\b"
|
||||
color statement "\b(?i)(vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfmsubss|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubps|vfnmsubsd|vfnmsubss)(?-i)\b"
|
||||
|
||||
# Crypto
|
||||
color statement "\b(?i)(aesenc|aesenclast|aesdec|aesdeclast|aeskeygenassist|aesimc)(?-i)\b"
|
||||
color statement "\b(?i)(sha1rnds4|sha1nexte|sha1msg1|sha1msg2|sha256rnds2|sha256msg1|sha256msg2)(?-i)\b"
|
||||
|
||||
# Undocumented
|
||||
color statement "\b(?i)(aam|aad|salc|icebp|loadall|loadalld|ud1)(?-i)\b"
|
||||
|
||||
## Registers
|
||||
color identifier "\b(?i)(al|ah|bl|bh|cl|ch|dl|dh|bpl|sil|r8b|r9b|r10b|r11b|dil|spl|r12b|r13b|r14b|r15)(?-i)\b"
|
||||
color identifier "\b(?i)(cw|sw|tw|fp_ds|fp_opc|fp_ip|fp_dp|fp_cs|cs|ss|ds|es|fs|gs|gdtr|idtr|tr|ldtr|ax|bx|cx|dx|bp|si|r8w|r9w|r10w|r11w|di|sp|r12w|r13w|r14w|r15w|ip)(?-i)\b"
|
||||
color identifier "\b(?i)(fp_dp|fp_ip|eax|ebx|ecx|edx|ebp|esi|r8d|r9d|r10d|r11d|edi|esp|r12d|r13d|r14d|r15d|eip|eflags|mxcsr)(?-i)\b"
|
||||
color identifier "\b(?i)(mm0|mm1|mm2|mm3|mm4|mm5|mm6|mm7|rax|rbx|rcx|rdx|rbp|rsi|r8|r9|r10|r11|rdi|rsp|r12|r13|r14|r15|rip|rflags|cr0|cr1|cr2|cr3|cr4|cr5|cr6|cr7|cr8|cr9|cr10|cr11|cr12|cr13|cr14|cr15|msw|dr0|dr1|dr2|dr3|r4|dr5|dr6|dr7|dr8|dr9|dr10|dr11|dr12|dr13|dr14|dr15)(?-i)\b"
|
||||
color identifier "\b(?i)(st0|st1|st2|st3|st4|st5|st6|st7)(?-i)\b"
|
||||
color identifier "\b(?i)(xmm0|xmm1|xmm2|xmm3|xmm4|xmm5|xmm6|xmm7|xmm8|xmm9|xmm10|xmm11|xmm12|xmm13|xmm14|xmm15)(?-i)\b"
|
||||
color identifier "\b(?i)(ymm0|ymm1|ymm2|ymm3|ymm4|ymm5|ymm6|ymm7|ymm8|ymm9|ymm10|ymm11|ymm12|ymm13|ymm14|ymm15)(?-i)\b"
|
||||
color identifier "\b(?i)(zmm0|zmm1|zmm2|zmm3|zmm4|zmm5|zmm6|zmm7|zmm8|zmm9|zmm10|zmm11|zmm12|zmm13|zmm14|zmm15|zmm16|zmm17|zmm18|zmm19|zmm20|zmm21|zmm22|zmm23|zmm24|zmm25|zmm26|zmm27|zmm28|zmm29|zmm30|zmm31)(?-i)\b"
|
||||
|
||||
## Constants
|
||||
# Number - it works
|
||||
color constant.number "\b(|h|A|0x)+[0-9]+(|h|A)+\b"
|
||||
color constant.number "\b0x[0-9 a-f A-F]+\b"
|
||||
|
||||
## Preprocessor (NASM)
|
||||
color preproc "%+(\+|\?|\?\?|)[a-z A-Z 0-9]+"
|
||||
color preproc "%\[[. a-z A-Z 0-9]*\]"
|
||||
|
||||
## Other
|
||||
color statement "\b(?i)(extern|global|section|segment|_start|\.text|\.data|\.bss)(?-i)\b"
|
||||
color statement "\b(?i)(db|dw|dd|dq|dt|ddq|do)(?-i)\b"
|
||||
color identifier "[a-z A-Z 0-9 _]+:"
|
||||
|
||||
# String
|
||||
color constant.string ""(\\.|[^"])*""
|
||||
color constant.string "'(\\.|[^'])*'"
|
||||
|
||||
## Comments
|
||||
color comment ";.*"
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
syntax "awk" "\.awk$"
|
||||
header "^#!.*bin/(env +)?awk( |$)"
|
||||
|
||||
color brightyellow "\$[A-Za-z0-9_!@#$*?-]+"
|
||||
color brightyellow "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>"
|
||||
color brightyellow "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>"
|
||||
color brightyellow "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>"
|
||||
color brightblue "\<(function|extension|BEGIN|END)\>"
|
||||
color red "[-+*/%^|!=&<>?;:]|\\|\[|\]"
|
||||
color cyan "\<(for|if|while|do|else|in|delete|exit)\>"
|
||||
color cyan "\<(break|continue|return)\>"
|
||||
color brightblue "\<(close|getline|next|nextfile|print|printf|system|fflush)\>"
|
||||
color brightblue "\<(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\>"
|
||||
color brightblue "\<(asort|asorti|gensub|gsub|index|length|match)\>"
|
||||
color brightblue "\<(split|sprintf|strtonum|sub|substr|tolower|toupper)\>"
|
||||
color brightblue "\<(mktime|strftime|systime)\>"
|
||||
color brightblue "\<(and|compl|lshift|or|rshift|xor)\>"
|
||||
color brightblue "\<(bindtextdomain|dcgettext|dcngettext)\>"
|
||||
color magenta "/.*[^\\]/"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color magenta "\\."
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color brightwhite,cyan "TODO:?"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
## Here is an example for C++.
|
||||
##
|
||||
syntax "c++" "\.c(c|pp|xx)$" "\.h(h|pp|xx)$" "\.ii?$" "\.(def)$"
|
||||
color identifier "\b[A-Z_][0-9A-Z_]+\b"
|
||||
color type "\b(auto|float|double|bool|char|int|short|long|sizeof|enum|void|static|const|constexpr|struct|union|typedef|extern|(un)?signed|inline)\b"
|
||||
color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
|
||||
color statement "\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\b"
|
||||
color statement "\b(for|if|while|do|else|case|default|switch)\b"
|
||||
color statement "\b(try|throw|catch|operator|new|delete)\b"
|
||||
color statement "\b(goto|continue|break|return)\b"
|
||||
color preproc "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
||||
color constant "'([^'\\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
||||
|
||||
##
|
||||
## GCC builtins
|
||||
color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
|
||||
#Operator Color
|
||||
color statement "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
|
||||
|
||||
#Parenthetical Color
|
||||
# color magenta "[(){}]" "\[" "\]"
|
||||
|
||||
color constant.number "\b[0-9]+\b" "\b0x[0-9A-Fa-f]+\b"
|
||||
color constant.number "\b(true|false)\b" "NULL"
|
||||
|
||||
##
|
||||
## String highlighting. You will in general want your brightblacks and
|
||||
## strings to come last, because syntax highlighting rules will be
|
||||
## applied in the order they are read in.
|
||||
color constant.string ""(\\.|[^"])*""
|
||||
##
|
||||
## This string is VERY resource intensive!
|
||||
#color cyan start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
## Comment highlighting
|
||||
color comment "//.*"
|
||||
color comment start="/\*" end="\*/"
|
||||
|
||||
## Trailing whitespace
|
||||
#color ,green "[[:space:]]+$"
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
## Here is an example for C.
|
||||
##
|
||||
syntax "c" "\.(c|C)$" "\.(h|H)$" "\.ii?$" "\.(def)$"
|
||||
color identifier "\b[A-Z_][0-9A-Z_]+\b"
|
||||
color type "\b(float|double|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\b"
|
||||
color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
|
||||
color statement "\b(typename|mutable|volatile|register|explicit)\b"
|
||||
color statement "\b(for|if|while|do|else|case|default|switch)\b"
|
||||
color statement "\b(try|throw|catch|operator|new|delete)\b"
|
||||
color statement "\b(goto|continue|break|return)\b"
|
||||
color preproc "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
||||
color constant "'([^'\\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
||||
|
||||
##
|
||||
## GCC builtins
|
||||
color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
|
||||
#Operator Color
|
||||
color statement "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
|
||||
|
||||
#Parenthetical Color
|
||||
# color magenta "[(){}]" "\[" "\]"
|
||||
|
||||
color constant.number "\b[0-9]+\b" "\b0x[0-9A-Fa-f]+\b"
|
||||
color constant.number "NULL"
|
||||
|
||||
##
|
||||
## String highlighting. You will in general want your brightblacks and
|
||||
## strings to come last, because syntax highlighting rules will be
|
||||
## applied in the order they are read in.
|
||||
color constant.string ""(\\.|[^"])*""
|
||||
##
|
||||
## This string is VERY resource intensive!
|
||||
#color cyan start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
## Comment highlighting
|
||||
color comment "//.*"
|
||||
color comment start="/\*" end="\*/"
|
||||
|
||||
## Trailing whitespace
|
||||
#color ,green "[[:space:]]+$"
|
||||
47
runtime/syntax/c.yaml
Normal file
47
runtime/syntax/c.yaml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
filetype: c
|
||||
|
||||
detect:
|
||||
filename: "(\\.(c|C)$|\\.(h|H)$|\\.ii?$|\\.(def)$)"
|
||||
|
||||
rules:
|
||||
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
|
||||
- type: "\\b(float|double|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\\b"
|
||||
- type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b"
|
||||
- statement: "\\b(typename|mutable|volatile|register|explicit)\\b"
|
||||
- statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
|
||||
- statement: "\\b(try|throw|catch|operator|new|delete)\\b"
|
||||
- statement: "\\b(goto|continue|break|return)\\b"
|
||||
- preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
||||
- constant: "'([^'\\\\]|(\\\\[\"'abfnrtv\\\\]))'"
|
||||
- constant: "'\\\\(([0-3]?[0-7]{1,2}))'"
|
||||
- constant: "'\\\\x[0-9A-Fa-f]{1,2}'"
|
||||
# GCC builtins
|
||||
- statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)"
|
||||
- statement: "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
# Operator Color
|
||||
- statement: "([.:;,+*|=!\\%]|<|>|/|-|&)"
|
||||
- constant.number: "(\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b)"
|
||||
- constant.number: "NULL"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- preproc: "..+"
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "/\\*"
|
||||
end: "\\*/"
|
||||
rules: []
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
syntax "caddyfile" "Caddyfile"
|
||||
|
||||
color identifier "^\s*\S+(\s|$)"
|
||||
color type "^([\w.:/-]+,? ?)+[,{]$"
|
||||
color constant.specialChar "\s{$"
|
||||
color constant.specialChar "^\s*}$"
|
||||
color constant.string start="\"" end="\""
|
||||
color preproc "\{(\w+|\$\w+|%\w+%)\}"
|
||||
color comment "#.*"
|
||||
|
||||
# extra and trailing spaces
|
||||
color ,red "([[:space:]]{2,}|\t){$"
|
||||
color ,red "[[:space:]]+$"
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
## CMake syntax highlighter for GNU Nano
|
||||
##
|
||||
syntax "cmake" "(CMakeLists\.txt|\.cmake)$"
|
||||
|
||||
green (i) "^[[:space:]]*[A-Z0-9_]+"
|
||||
brightyellow (i) "^[[:space:]]*(include|include_directories|include_external_msproject)\>"
|
||||
|
||||
brightgreen (i) "^[[:space:]]*\<((else|end)?if|else|(end)?while|(end)?foreach|break)\>"
|
||||
color brightgreen "\<(COPY|NOT|COMMAND|PROPERTY|POLICY|TARGET|EXISTS|IS_(DIRECTORY|ABSOLUTE)|DEFINED)\>[[:space:]]"
|
||||
color brightgreen "[[:space:]]\<(OR|AND|IS_NEWER_THAN|MATCHES|(STR|VERSION_)?(LESS|GREATER|EQUAL))\>[[:space:]]"
|
||||
|
||||
brightred (i) "^[[:space:]]*\<((end)?(function|macro)|return)"
|
||||
|
||||
#String Color
|
||||
color cyan "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
|
||||
color cyan "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
|
||||
|
||||
brightred (i) start="\$(\{|ENV\{)" end="\}"
|
||||
color magenta "\<(APPLE|UNIX|WIN32|CYGWIN|BORLAND|MINGW|MSVC(_IDE|60|71|80|90)?)\>"
|
||||
|
||||
brightblue (i) "^([[:space:]]*)?#.*"
|
||||
brightblue (i) "[[:space:]]#.*"
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
syntax "coffeescript" "\.coffee$"
|
||||
header "^#!.*/(env +)?coffee"
|
||||
|
||||
color red "[!&|=/*+-<>]|\<(and|or|is|isnt|not)\>"
|
||||
color brightblue "[A-Za-z_][A-Za-z0-9_]*:[[:space:]]*(->|\()" "->"
|
||||
color brightblue "[()]"
|
||||
color cyan "\<(for|of|continue|break|isnt|null|unless|this|else|if|return)\>"
|
||||
color cyan "\<(try|catch|finally|throw|new|delete|typeof|in|instanceof)\>"
|
||||
color cyan "\<(debugger|switch|while|do|class|extends|super)\>"
|
||||
color cyan "\<(undefined|then|unless|until|loop|of|by|when)\>"
|
||||
color brightcyan "\<(true|false|yes|no|on|off)\>"
|
||||
color brightyellow "@[A-Za-z0-9_]*"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
syntax "colortest" "ColorTest$"
|
||||
|
||||
color black "\<PLAIN\>"
|
||||
|
||||
color red "\<red\>"
|
||||
color green "\<green\>"
|
||||
color yellow "\<yellow\>"
|
||||
color blue "\<blue\>"
|
||||
color magenta "\<magenta\>"
|
||||
color cyan "\<cyan\>"
|
||||
|
||||
color brightred "\<brightred\>"
|
||||
color brightgreen "\<brightgreen\>"
|
||||
color brightyellow "\<brightyellow\>"
|
||||
color brightblue "\<brightblue\>"
|
||||
color brightmagenta "\<brightmagenta\>"
|
||||
color brightcyan "\<brightcyan\>"
|
||||
19
runtime/syntax/colortest.yaml
Normal file
19
runtime/syntax/colortest.yaml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
filetype: colortest
|
||||
|
||||
detect:
|
||||
filename: "ColorTest$"
|
||||
|
||||
rules:
|
||||
- black: "\\bPLAIN\\b"
|
||||
- red: "\\bred\\b"
|
||||
- green: "\\bgreen\\b"
|
||||
- yellow: "\\byellow\\b"
|
||||
- blue: "\\bblue\\b"
|
||||
- magenta: "\\bmagenta\\b"
|
||||
- cyan: "\\bcyan\\b"
|
||||
- brightred: "\\bbrightred\\b"
|
||||
- brightgreen: "\\bbrightgreen\\b"
|
||||
- brightyellow: "\\bbrightyellow\\b"
|
||||
- brightblue: "\\bbrightblue\\b"
|
||||
- brightmagenta: "\\bbrightmagenta\\b"
|
||||
- brightcyan: "\\bbrightcyan\\b"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
## Here is an example for nanorc files.
|
||||
##
|
||||
syntax "conf" "\.c[o]?nf$"
|
||||
## Possible errors and parameters
|
||||
## Strings
|
||||
color constant.string (i) ""(\\.|[^"])*""
|
||||
## Comments
|
||||
color comment (i) "^[[:space:]]*#.*$"
|
||||
color comment (i) "^[[:space:]]*##.*$"
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
##
|
||||
## Syntax highlighting for conkyrc files.
|
||||
##
|
||||
##
|
||||
syntax "conky" "(\.*conkyrc.*$|conky.conf)"
|
||||
|
||||
## Configuration items
|
||||
color green "\<(alignment|append_file|background|border_inner_margin|border_outer_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|colorN|cpu_avg_samples|default_bar_height|default_bar_width|default_color|default_gauge_height|default_gauge_width|default_graph_height|default_graph_width|default_outline_color|default_shade_color|diskio_avg_samples|display|double_buffer|draw_borders|draw_graph_borders|draw_outline|draw_shades|extra_newline|font|format_human_readable|gap_x|gap_y|http_refresh|if_up_strictness|imap|imlib_cache_flush_interval|imlib_cache_size|lua_draw_hook_post|lua_draw_hook_pre|lua_load|lua_shutdown_hook|lua_startup_hook|mail_spool|max_port_monitor_connections|max_text_width|max_user_text|maximum_width|minimum_height|minimum_width|mpd_host|mpd_password|mpd_port|music_player_interval|mysql_host|mysql_port|mysql_user|mysql_password|mysql_db|net_avg_samples|no_buffers|nvidia_display|out_to_console|out_to_http|out_to_ncurses|out_to_stderr|out_to_x|override_utf8_locale|overwrite_file|own_window|own_window_class|own_window_colour|own_window_hints|own_window_title|own_window_transparent|own_window_type|pad_percents|pop3|sensor_device|short_units|show_graph_range|show_graph_scale|stippled_borders|temperature_unit|template|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|text|text_buffer_size|times_in_seconds|top_cpu_separate|top_name_width|total_run_times|update_interval|update_interval_on_battery|uppercase|use_spacer|use_xft|xftalpha|xftfont)\>"
|
||||
|
||||
## Configuration item constants
|
||||
color yellow "\<(above|below|bottom_left|bottom_right|bottom_middle|desktop|dock|no|none|normal|override|skip_pager|skip_taskbar|sticky|top_left|top_right|top_middle|middle_left|middle_right|middle_middle|undecorated|yes)\>"
|
||||
|
||||
## Variables
|
||||
color brightblue "\<(acpiacadapter|acpifan|acpitemp|addr|addrs|alignc|alignr|apcupsd|apcupsd_cable|apcupsd_charge|apcupsd_lastxfer|apcupsd_linev|apcupsd_load|apcupsd_loadbar|apcupsd_loadgauge|apcupsd_loadgraph|apcupsd_model|apcupsd_name|apcupsd_status|apcupsd_temp|apcupsd_timeleft|apcupsd_upsmode|apm_adapter|apm_battery_life|apm_battery_time|audacious_bar|audacious_bitrate|audacious_channels|audacious_filename|audacious_frequency|audacious_length|audacious_length_seconds|audacious_main_volume|audacious_playlist_length|audacious_playlist_position|audacious_position|audacious_position_seconds|audacious_status|audacious_title|battery|battery_bar|battery_percent|battery_short|battery_time|blink|bmpx_album|bmpx_artist|bmpx_bitrate|bmpx_title|bmpx_track|bmpx_uri|buffers|cached|cmdline_to_pid|color|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|combine|conky_build_arch|conky_build_date|conky_version|cpu|cpubar|cpugauge|cpugraph|curl|desktop|desktop_name|desktop_number|disk_protect|diskio|diskio_read|diskio_write|diskiograph|diskiograph_read|diskiograph_write|distribution|downspeed|downspeedf|downspeedgraph|draft_mails|else|endif|entropy_avail|entropy_bar|entropy_perc|entropy_poolsize|eval|eve|exec|execbar|execgauge|execgraph|execi|execibar|execigauge|execigraph|execp|execpi|flagged_mails|font|format_time|forwarded_mails|freq|freq_g|fs_bar|fs_bar_free|fs_free|fs_free_perc|fs_size|fs_type|fs_used|fs_used_perc|goto|gw_iface|gw_ip|hddtemp|head|hr|hwmon|i2c|i8k_ac_status|i8k_bios|i8k_buttons_status|i8k_cpu_temp|i8k_left_fan_rpm|i8k_left_fan_status|i8k_right_fan_rpm|i8k_right_fan_status|i8k_serial|i8k_version|ibm_brightness|ibm_fan|ibm_temps|ibm_volume|ical|iconv_start|iconv_stop|if_empty|if_existing|if_gw|if_match|if_mixer_mute|if_mounted|if_mpd_playing|if_running|if_smapi_bat_installed|if_up|if_updatenr|if_xmms2_connected|image|imap_messages|imap_unseen|ioscheduler|irc|kernel|laptop_mode|lines|loadavg|loadgraph|lua|lua_bar|lua_gauge|lua_graph|lua_parse|machine|mails|mboxscan|mem|memwithbuffers|membar|memwithbuffersbar|memeasyfree|memfree|memgauge|memgraph|memmax|memperc|mixer|mixerbar|mixerl|mixerlbar|mixerr|mixerrbar|moc_album|moc_artist|moc_bitrate|moc_curtime|moc_file|moc_rate|moc_song|moc_state|moc_timeleft|moc_title|moc_totaltime|monitor|monitor_number|mpd_album|mpd_artist|mpd_bar|mpd_bitrate|mpd_elapsed|mpd_file|mpd_length|mpd_name|mpd_percent|mpd_random|mpd_repeat|mpd_smart|mpd_status|mpd_title|mpd_track|mpd_vol|mysql|nameserver|new_mails|nodename|nodename_short|no_update|nvidia|obsd_product|obsd_sensors_fan|obsd_sensors_temp|obsd_sensors_volt|obsd_vendor|offset|outlinecolor|pb_battery|pid_chroot|pid_cmdline|pid_cwd|pid_environ|pid_environ_list|pid_exe|pid_nice|pid_openfiles|pid_parent|pid_priority|pid_state|pid_state_short|pid_stderr|pid_stdin|pid_stdout|pid_threads|pid_thread_list|pid_time_kernelmode|pid_time_usermode|pid_time|pid_uid|pid_euid|pid_suid|pid_fsuid|pid_gid|pid_egid|pid_sgid|pid_fsgid|pid_read|pid_vmpeak|pid_vmsize|pid_vmlck|pid_vmhwm|pid_vmrss|pid_vmdata|pid_vmstk|pid_vmexe|pid_vmlib|pid_vmpte|pid_write|platform|pop3_unseen|pop3_used|processes|read_tcp|read_udp|replied_mails|rss|running_processes|running_threads|scroll|seen_mails|shadecolor|smapi|smapi_bat_bar|smapi_bat_perc|smapi_bat_power|smapi_bat_temp|sony_fanspeed|stippled_hr|stock|swap|swapbar|swapfree|swapmax|swapperc|sysname|tab|tail|tcp_ping|tcp_portmon|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|texeci|texecpi|threads|time|to_bytes|top|top_io|top_mem|top_time|totaldown|totalup|trashed_mails|tztime|gid_name|uid_name|unflagged_mails|unforwarded_mails|unreplied_mails|unseen_mails|updates|upspeed|upspeedf|upspeedgraph|uptime|uptime_short|user_names|user_number|user_terms|user_times|user_time|utime|voffset|voltage_mv|voltage_v|weather|wireless_ap|wireless_bitrate|wireless_essid|wireless_link_bar|wireless_link_qual|wireless_link_qual_max|wireless_link_qual_perc|wireless_mode|words|xmms2_album|xmms2_artist|xmms2_bar|xmms2_bitrate|xmms2_comment|xmms2_date|xmms2_duration|xmms2_elapsed|xmms2_genre|xmms2_id|xmms2_percent|xmms2_playlist|xmms2_size|xmms2_smart|xmms2_status|xmms2_timesplayed|xmms2_title|xmms2_tracknr|xmms2_url)\>"
|
||||
|
||||
color brightblue "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
color cyan "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||
color brightred "^TEXT$"
|
||||
51
runtime/syntax/cpp.yaml
Normal file
51
runtime/syntax/cpp.yaml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
filetype: c++
|
||||
|
||||
detect:
|
||||
filename: "(\\.c(c|pp|xx)$|\\.h(h|pp|xx)$|\\.ii?$|\\.(def)$)"
|
||||
|
||||
rules:
|
||||
|
||||
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
|
||||
- type: "\\b(auto|float|double|bool|char|int|short|long|sizeof|enum|void|static|const|constexpr|struct|union|typedef|extern|(un)?signed|inline)\\b"
|
||||
- type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b"
|
||||
- statement: "\\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\\b"
|
||||
- statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
|
||||
- statement: "\\b(try|throw|catch|operator|new|delete)\\b"
|
||||
- statement: "\\b(goto|continue|break|return)\\b"
|
||||
- preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
||||
- constant: "('([^'\\\\]|(\\\\[\"'abfnrtv\\\\]))'|'\\\\(([0-3]?[0-7]{1,2}))'|'\\\\x[0-9A-Fa-f]{1,2}')"
|
||||
|
||||
##
|
||||
## GCC builtins
|
||||
- statement: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__)"
|
||||
|
||||
#Operator Color
|
||||
- statement: "([.:;,+*|=!\\%]|<|>|/|-|&)"
|
||||
|
||||
- constant.number: "(\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b)"
|
||||
- constant.number: "(\\b(true|false)\\b|NULL)"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- preproc: "..+"
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules:
|
||||
- todo: "(TODO|XXX|FIXME):?"
|
||||
|
||||
- comment:
|
||||
start: "/\\*"
|
||||
end: "\\*/"
|
||||
rules:
|
||||
- todo: "(TODO|XXX|FIXME):?"
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
## Crystal Syntax file.
|
||||
##
|
||||
syntax "crystal" "\.cr$" "Gemfile" "config.ru" "Rakefile" "Capfile" "Vagrantfile"
|
||||
header "^#!.*/(env +)?crystal( |$)"
|
||||
|
||||
## Asciibetical list of reserved words
|
||||
color statement "\b(BEGIN|END|abstract|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|enum|false|for|fun|if|in|include|lib|loop|macro|module|next|nil|not|of|or|pointerof|private|protected|raise|redo|require|rescue|retry|return|self|sizeof|spawn|struct|super|then|true|type|undef|union|uninitialized|unless|until|when|while|yield)\b"
|
||||
## Constants
|
||||
color constant "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*"
|
||||
color constant.number "\b[0-9]+\b"
|
||||
## Crystal "symbols"
|
||||
color constant (i) "([ ]|^):[0-9A-Z_]+\b"
|
||||
## Some unique things we want to stand out
|
||||
color constant "\b(__FILE__|__LINE__)\b"
|
||||
## Regular expressions
|
||||
color constant "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
|
||||
## Shell command expansion is in `backticks` or like %x{this}. These are
|
||||
## "double-quotish" (to use a perlism).
|
||||
color constant.string "`[^`]*`" "%x\{[^}]*\}"
|
||||
## Strings, double-quoted
|
||||
color constant.string ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
|
||||
## Expression substitution. These go inside double-quoted strings,
|
||||
## "like #{this}".
|
||||
color special "#\{[^}]*\}"
|
||||
## Characters are single-quoted
|
||||
color constant.string.char "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||
## Comments
|
||||
color comment "#[^{].*$" "#$"
|
||||
color comment "##[^{].*$" "##$"
|
||||
## "Here" docs
|
||||
color constant start="<<-?'?EOT'?" end="^EOT"
|
||||
## Some common markers
|
||||
color todo "(XXX|TODO|FIXME|\?\?\?)"
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
syntax "c#" "\.cs$"
|
||||
|
||||
# Class
|
||||
color brightmagenta "class +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?"
|
||||
|
||||
# Annotation
|
||||
color magenta "@[A-Za-z]+"
|
||||
|
||||
color brightblue "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]"
|
||||
color green "\<(bool|byte|sbyte|char|decimal|double|float|IntPtr|int|uint|long|ulong|object|short|ushort|string|base|this|var|void)\>"
|
||||
color cyan "\<(alias|as|case|catch|checked|default|do|dynamic|else|finally|fixed|for|foreach|goto|if|is|lock|new|null|return|switch|throw|try|unchecked|while)\>"
|
||||
color cyan "\<(abstract|async|class|const|delegate|enum|event|explicit|extern|get|implicit|in|internal|interface|namespace|operator|out|override|params|partial|private|protected|public|readonly|ref|sealed|set|sizeof|stackalloc|static|struct|typeof|unsafe|using|value|virtual|volatile|yield)\>"
|
||||
# LINQ-only keywords (ones that cannot be used outside of a LINQ query - lots others can)
|
||||
color cyan "\<(from|where|select|group|info|orderby|join|let|in|on|equals|by|ascending|descending)\>"
|
||||
color brightred "\<(break|continue)\>"
|
||||
color brightcyan "\<(true|false)\>"
|
||||
color red "[-+/*=<>?:!~%&|]"
|
||||
color blue "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color magenta "\\([btnfr]|'|\"|\\)"
|
||||
color magenta "\\u[A-Fa-f0-9]{4}"
|
||||
color brightblack "(^|[[:space:]])//.*"
|
||||
color brightblack start="/\*" end="\*/"
|
||||
color brightwhite,cyan "TODO:?"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
File diff suppressed because one or more lines are too long
42
runtime/syntax/css.yaml
Normal file
42
runtime/syntax/css.yaml
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,30 +0,0 @@
|
|||
## Cython nanorc, based off of Python nanorc.
|
||||
##
|
||||
syntax "cython" "\.pyx$" "\.pxd$" "\.pyi$"
|
||||
brightred (i) "def [ 0-9A-Z_]+"
|
||||
brightred (i) "cpdef [0-9A-Z_]+\(.*\):"
|
||||
brightred (i) "cdef cppclass [ 0-9A-Z_]+\(.*\):"
|
||||
|
||||
|
||||
|
||||
# Python Keyword Color
|
||||
color green "\<(and|as|assert|class|def|DEF|del|elif|ELIF|else|ELSE|except|exec|finally|for|from|global|if|IF|import|in|is|lambda|map|not|or|pass|print|raise|try|while|with|yield)\>"
|
||||
color brightmagenta "\<(continue|break|return)\>"
|
||||
|
||||
# Cython Keyword Color
|
||||
color green "\<(cdef|cimport|cpdef|cppclass|ctypedef|extern|include|namespace|property|struct)\>"
|
||||
color red "\<(bint|char|double|int|public|void|unsigned)\>"
|
||||
|
||||
#Operator Color
|
||||
color yellow "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
|
||||
|
||||
#Parenthetical Color
|
||||
color magenta "[(){}]" "\[" "\]"
|
||||
|
||||
#String Color
|
||||
color cyan "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
|
||||
color cyan "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
|
||||
color cyan start=""""[^"]" end=""""" start="'''[^']" end="'''"
|
||||
|
||||
# Comment Color
|
||||
color brightblue "#.*$"
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
## D syntax highlighting for GNU nano
|
||||
##
|
||||
## Author: Andrei Vinokurov
|
||||
## Based on D lexer specification (http://dlang.org/lex)
|
||||
|
||||
syntax "d" "\.(d(i|d)?)$"
|
||||
|
||||
## Operators and punctuation
|
||||
color statement "(\*|/|%|\+|-|>>|<<|>>>|&|\^(\^)?|\||~)?="
|
||||
color statement "\.\.(\.)?|!|\*|&|~|\(|\)|\[|\]|\\|/|\+|-|%|<|>|\?|:|;"
|
||||
|
||||
## Octal integer literals are deprecated
|
||||
color error "(0[0-7_]*)(L[uU]?|[uU]L?)?"
|
||||
|
||||
## Decimal integer literals
|
||||
color constant.number "([0-9]|[1-9][0-9_]*)(L[uU]?|[uU]L?)?"
|
||||
|
||||
## Binary integer literals
|
||||
color constant "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
|
||||
|
||||
## Decimal float literals
|
||||
color constant.number "[0-9][0-9_]*\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
|
||||
color constant.number "[0-9][0-9_]*([eE][+-]?([0-9][0-9_]*))[fFL]?i?"
|
||||
color constant.number "[^.]\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
|
||||
color constant.number "[0-9][0-9_]*([fFL]?i|[fF])"
|
||||
|
||||
## Hexadecimal integer literals
|
||||
color constant.number "(0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F]))(L[uU]?|[uU]L?)?"
|
||||
|
||||
## Hexadecimal float literals
|
||||
color constant.number "0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])(\.[0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])?[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
|
||||
color constant.number "0[xX]\.([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
|
||||
|
||||
|
||||
## Character literals
|
||||
color constant.string "'([^\']|\\(['"?\abfnrtv]|x[[:xdigit:]]{2}|[0-7]{1,3}|u[[:xdigit:]]{4}|U[[:xdigit:]]{8}|&.*;))'"
|
||||
|
||||
## Keywords
|
||||
## a-e
|
||||
color statement "\b(abstract|alias|align|asm|assert|auto|body|break|case|cast|catch|class|const|continue|debug|default|delegate|do|else|enum|export|extern)\b"
|
||||
## f-l
|
||||
color statement "\b(false|final|finally|for|foreach|foreach_reverse|function|goto|if|immutable|import|in|inout|interface|invariant|is|lazy)\b"
|
||||
## m-r
|
||||
color statement "\b(macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|ref|return)\b"
|
||||
## s-w
|
||||
color statement "\b(scope|shared|static|struct|super|switch|synchronized|template|this|throw|true|try|typeid|typeof|union|unittest|version|while|with)\b"
|
||||
## __
|
||||
color statement "\b(__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__|__gshared|__traits|__vector|__parameters)\b"
|
||||
|
||||
## Deprecated keywords
|
||||
color error "\b(delete|deprecated|typedef|volatile)\b"
|
||||
|
||||
## Primitive types
|
||||
color type "\b(bool|byte|cdouble|cent|cfloat|char|creal|dchar|double|float|idouble|ifloat|int|ireal|long|real|short|ubyte|ucent|uint|ulong|ushort|void|wchar)\b"
|
||||
|
||||
## Globally defined symbols
|
||||
color type "\b(string|wstring|dstring|size_t|ptrdiff_t)\b"
|
||||
|
||||
## Special tokens
|
||||
color constant "\b(__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__)\b"
|
||||
|
||||
## String literals
|
||||
## TODO: multiline backtick and doublequote string. (Unlikely possible at all with nano.)
|
||||
### DoubleQuotedString
|
||||
color constant.string ""(\\.|[^"])*""
|
||||
|
||||
### WysiwygString
|
||||
color constant.string start="r"" end="""
|
||||
color constant.string "`[^`]*`"
|
||||
|
||||
### HexString
|
||||
color constant.string "x"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*""
|
||||
|
||||
### DelimitedString
|
||||
color constant.string "q"\(.*\)""
|
||||
color constant.string "q"\{.*\}""
|
||||
color constant.string "q"\[.*\]""
|
||||
color constant.string "q"<.*>""
|
||||
color constant.string start="q"[^({[<"][^"]*$" end="^[^"]+""
|
||||
color constant.string "q"([^({[<"]).*""
|
||||
|
||||
### TokenString
|
||||
### True token strings require nesting, so, again, they can't be implemented accurately here.
|
||||
### At the same time, the intended purpose of token strings makes it questionable to highlight them as strings at all.
|
||||
## color ,magenta start="q\{" end="\}"
|
||||
|
||||
## Comments
|
||||
## NB: true nested brightblacks are impossible to implement with plain regex
|
||||
color comment "//.*"
|
||||
color comment start="/\*" end="\*/"
|
||||
color comment start="/\+" end="\+/"
|
||||
118
runtime/syntax/d.yaml
Normal file
118
runtime/syntax/d.yaml
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
filetype: d
|
||||
|
||||
detect:
|
||||
filename: "\\.(d(i|d)?)$"
|
||||
|
||||
rules:
|
||||
# Operators and punctuation
|
||||
- statement: "(\\*|/|%|\\+|-|>>|<<|>>>|&|\\^(\\^)?|\\||~)?="
|
||||
- statement: "\\.\\.(\\.)?|!|\\*|&|~|\\(|\\)|\\[|\\]|\\\\|/|\\+|-|%|<|>|\\?|:|;"
|
||||
# Octal integer literals are deprecated
|
||||
- error: "(0[0-7_]*)(L[uU]?|[uU]L?)?"
|
||||
# Decimal integer literals
|
||||
- constant.number: "([0-9]|[1-9][0-9_]*)(L[uU]?|[uU]L?)?"
|
||||
# Binary integer literals
|
||||
- constant: "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
|
||||
# Decimal float literals
|
||||
- constant.number: "[0-9][0-9_]*\\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
|
||||
- constant.number: "[0-9][0-9_]*([eE][+-]?([0-9][0-9_]*))[fFL]?i?"
|
||||
- constant.number: "[^.]\\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
|
||||
- constant.number: "[0-9][0-9_]*([fFL]?i|[fF])"
|
||||
# Hexadecimal integer literals
|
||||
- constant.number: "(0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F]))(L[uU]?|[uU]L?)?"
|
||||
# Hexadecimal float literals
|
||||
- constant.number: "0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])(\\.[0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])?[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
|
||||
- constant.number: "0[xX]\\.([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
|
||||
# Character literals
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
# Keywords
|
||||
# a-e
|
||||
- statement: "\\b(abstract|alias|align|asm|assert|auto|body|break|case|cast|catch|class|const|continue|debug|default|delegate|do|else|enum|export|extern)\\b"
|
||||
# f-l
|
||||
- statement: "\\b(false|final|finally|for|foreach|foreach_reverse|function|goto|if|immutable|import|in|inout|interface|invariant|is|lazy)\\b"
|
||||
# m-r
|
||||
- statement: "\\b(macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|ref|return)\\b"
|
||||
# s-w
|
||||
- statement: "\\b(scope|shared|static|struct|super|switch|synchronized|template|this|throw|true|try|typeid|typeof|union|unittest|version|while|with)\\b"
|
||||
# __
|
||||
- statement: "\\b(__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__|__gshared|__traits|__vector|__parameters)\\b"
|
||||
# Deprecated keywords
|
||||
- error: "\\b(delete|deprecated|typedef|volatile)\\b"
|
||||
# Primitive types
|
||||
- type: "\\b(bool|byte|cdouble|cent|cfloat|char|creal|dchar|double|float|idouble|ifloat|int|ireal|long|real|short|ubyte|ucent|uint|ulong|ushort|void|wchar)\\b"
|
||||
# Globally defined symbols
|
||||
- type: "\\b(string|wstring|dstring|size_t|ptrdiff_t)\\b"
|
||||
# Special tokens
|
||||
- constant: "\\b(__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__)\\b"
|
||||
# String literals
|
||||
# DoubleQuotedString
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
# WysiwygString
|
||||
- constant.string:
|
||||
start: "r\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "`"
|
||||
end: "`"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
# HexString
|
||||
- constant.string:
|
||||
start: "x\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
# DelimitedString
|
||||
- constant.string:
|
||||
start: "q\"\\("
|
||||
end: "\\)\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "q\"\\{"
|
||||
end: "q\"\\}"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "q\"\\["
|
||||
end: "q\"\\]"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "q\"<"
|
||||
end: "q\">"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "q\"[^({[<\"][^\"]*$"
|
||||
end: "^[^\"]+\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "q\"([^({[<\"])"
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
# Comments
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules: []
|
||||
- comment:
|
||||
start: "/\\*"
|
||||
end: "\\*/"
|
||||
rules: []
|
||||
- comment:
|
||||
start: "/\\+"
|
||||
end: "\\+/"
|
||||
rules: []
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
syntax "dart" "\.dart$"
|
||||
|
||||
color constant.number "\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b"
|
||||
color constant.number "\b[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
||||
color constant.number "\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
||||
color identifier "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
|
||||
color statement "\b(break|case|catch|continue|default|else|finally)\b"
|
||||
color statement "\b(for|function|get|if|in|as|is|new|return|set|switch|final|await|async|sync)\b"
|
||||
color statement "\b(switch|this|throw|try|var|void|while|with|import|library|part|const|export)\b"
|
||||
color constant "\b(true|false|null)\b"
|
||||
color type "\b(List|String)\b"
|
||||
color type "\b(int|num|double|bool)\b"
|
||||
color statement "[-+/*=<>!~%?:&|]"
|
||||
color constant "/[^*]([^/]|(\\/))*[^\\]/[gim]*"
|
||||
color constant "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
|
||||
color comment "(^|[[:space:]])//.*"
|
||||
color comment "/\*.+\*/"
|
||||
color todo "TODO:?"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
43
runtime/syntax/dart.yaml
Normal file
43
runtime/syntax/dart.yaml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
filetype: dart
|
||||
|
||||
detect:
|
||||
filename: "\\.dart$"
|
||||
|
||||
rules:
|
||||
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
|
||||
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
||||
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
||||
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
|
||||
- statement: "\\b(break|case|catch|continue|default|else|finally)\\b"
|
||||
- statement: "\\b(for|function|get|if|in|as|is|new|return|set|switch|final|await|async|sync)\\b"
|
||||
- statement: "\\b(switch|this|throw|try|var|void|while|with|import|library|part|const|export)\\b"
|
||||
- constant: "\\b(true|false|null)\\b"
|
||||
- type: "\\b(List|String)\\b"
|
||||
- type: "\\b(int|num|double|bool)\\b"
|
||||
- statement: "[-+/*=<>!~%?:&|]"
|
||||
- constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
|
||||
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules:
|
||||
- todo: "TODO:?"
|
||||
|
||||
- comment:
|
||||
start: "/\\*"
|
||||
end: "\\*/"
|
||||
rules:
|
||||
- todo: "TODO:?"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
syntax "dot" "\.(dot|gv)$"
|
||||
|
||||
color cyan "\<(digraph|edge|graph|node|subgraph)\>"
|
||||
color magenta "\<(arrowhead|arrowsize|arrowtail|bgcolor|center|color|constraint|decorateP|dir|distortion|fillcolor|fontcolor|fontname|fontsize|headclip|headlabel|height|labelangle|labeldistance|labelfontcolor|labelfontname|labelfontsize|label|layers|layer|margin|mclimit|minlen|name|nodesep|nslimit|ordering|orientation|pagedir|page|peripheries|port_label_distance|rankdir|ranksep|rank|ratio|regular|rotate|samehead|sametail|shapefile|shape|sides|size|skew|style|tailclip|taillabel|URL|weight|width)\>"
|
||||
color red "=|->|--"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightblack "(^|[[:space:]])//.*"
|
||||
color brightblack start="/\*" end="\*/"
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
## A HTML+Ruby set for Syntax Highlighting .erb files (Embedded RubyRails Views etc) ERB
|
||||
## (c) 2009, Georgios V. Michalakidis - g.michalakidis@computer.org
|
||||
## Licensed under the CC (Creative Commons) License.
|
||||
##
|
||||
## https://github.com/geomic/ERB-And-More-Code-Highlighting-for-nano
|
||||
|
||||
syntax "erb" "\.erb$" "\.rhtml$"
|
||||
color blue start="<" end=">"
|
||||
color white start="<%" end="%>"
|
||||
color red "&[^;[[:space:]]]*;"
|
||||
color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
|
||||
color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*"
|
||||
magenta (i) "([ ]|^):[0-9A-Z_]+\>"
|
||||
color brightyellow "\<(__FILE__|__LINE__)\>"
|
||||
color brightmagenta "!/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
|
||||
color brightblue "`[^`]*`" "%x\{[^}]*\}"
|
||||
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
|
||||
color brightgreen "#\{[^}]*\}"
|
||||
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||
color cyan "#[^{].*$" "#$"
|
||||
color brightcyan "##[^{].*$" "##$"
|
||||
color green start="<<-?'?EOT'?" end="^EOT"
|
||||
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
syntax "fish" "\.fish$"
|
||||
header "^#!.*/(env +)?fish( |$)"
|
||||
|
||||
# Numbers
|
||||
color constant "\b[0-9]+\b"
|
||||
|
||||
# Conditionals and control flow
|
||||
color statement "\b(and|begin|break|case|continue|else|end|for|function|if|in|not|or|return|select|shift|switch|while)\b"
|
||||
color special "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|^|!|=|&|\|)"
|
||||
|
||||
# Fish commands
|
||||
color type "\b(bg|bind|block|breakpoint|builtin|cd|count|command|commandline|complete|dirh|dirs|echo|emit|eval|exec|exit|fg|fish|fish_config|fish_ident|fish_pager|fish_prompt|fish_right_prompt|fish_update_completions|fishd|funced|funcsave|functions|help|history|jobs|math|mimedb|nextd|open|popd|prevd|psub|pushd|pwd|random|read|set|set_color|source|status|string|trap|type|ulimit|umask|vared)\b"
|
||||
|
||||
# Common linux commands
|
||||
color type "\b((g|ig)?awk|bash|dash|find|\w{0,4}grep|kill|killall|\w{0,4}less|make|pkill|sed|sh|tar)\b"
|
||||
|
||||
# Coreutils commands
|
||||
color type "\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|time|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\b"
|
||||
|
||||
# Conditional flags
|
||||
color statement "--[a-z-]+"
|
||||
color statement "\ -[a-z]+"
|
||||
|
||||
# Strings
|
||||
color constant.string ""(\\.|[^"])*""
|
||||
color constant.string "'(\\.|[^'])*'"
|
||||
color special """
|
||||
color special "'"
|
||||
|
||||
# Variables
|
||||
color identifier (i) "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||
|
||||
# Comments & TODOs
|
||||
color comment "(^|[[:space:]])#.*$"
|
||||
color todo "(TODO|XXX|FIXME):?"
|
||||
45
runtime/syntax/fish.yaml
Normal file
45
runtime/syntax/fish.yaml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
filetype: fish
|
||||
|
||||
detect:
|
||||
filename: "\\.fish$"
|
||||
header: "^#!.*/(env +)?fish( |$)"
|
||||
|
||||
rules:
|
||||
# Numbers
|
||||
- constant: "\\b[0-9]+\\b"
|
||||
|
||||
# Conditionals and control flow
|
||||
- statement: "\\b(and|begin|break|case|continue|else|end|for|function|if|in|not|or|return|select|shift|switch|while)\\b"
|
||||
- special: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|^|!|=|&|\\|)"
|
||||
|
||||
# Fish commands
|
||||
- type: "\\b(bg|bind|block|breakpoint|builtin|cd|count|command|commandline|complete|dirh|dirs|echo|emit|eval|exec|exit|fg|fish|fish_config|fish_ident|fish_pager|fish_prompt|fish_right_prompt|fish_update_completions|fishd|funced|funcsave|functions|help|history|jobs|math|mimedb|nextd|open|popd|prevd|psub|pushd|pwd|random|read|set|set_color|source|status|string|trap|type|ulimit|umask|vared)\\b"
|
||||
|
||||
# Common linux commands
|
||||
- type: "\\b((g|ig)?awk|bash|dash|find|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|sh|tar)\\b"
|
||||
|
||||
# Coreutils commands
|
||||
- type: "\\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|time|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b"
|
||||
|
||||
# Conditional flags
|
||||
- statement: "--[a-z-]+"
|
||||
- statement: "\\ -[a-z]+"
|
||||
|
||||
- identifier: "(?i)\\$\\{?[0-9A-Z_!@#$*?-]+\\}?"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules:
|
||||
- todo: "(TODO|XXX|FIXME):?"
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
## Here is an example for Fortran 90/95
|
||||
|
||||
syntax "fortran" "\.([Ff]|[Ff]90|[Ff]95|[Ff][Oo][Rr])$"
|
||||
|
||||
#color red "\<[A-Z_]a[0-9A-Z_]+\>"
|
||||
color red "\<[0-9]+\>"
|
||||
|
||||
green (i) "\<(action|advance|all|allocatable|allocated|any|apostrophe)\>"
|
||||
green (i) "\<(append|asis|assign|assignment|associated|character|common)\>"
|
||||
green (i) "\<(complex|data|default|delim|dimension|double precision)\>"
|
||||
green (i) "\<(elemental|epsilon|external|file|fmt|form|format|huge)\>"
|
||||
green (i) "\<(implicit|include|index|inquire|integer|intent|interface)\>"
|
||||
green (i) "\<(intrinsic|iostat|kind|logical|module|none|null|only)\>"
|
||||
green (i) "\<(operator|optional|pack|parameter|pointer|position|private)\>"
|
||||
green (i) "\<(program|public|real|recl|recursive|selected_int_kind)\>"
|
||||
green (i) "\<(selected_real_kind|subroutine|status)\>"
|
||||
|
||||
cyan (i) "\<(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\>"
|
||||
cyan (i) "\<(close|contains|count|cpu_time|cshift|date_and_time)\>"
|
||||
cyan (i) "\<(deallocate|digits|dot_product|eor|eoshift|function|iachar)\>"
|
||||
cyan (i) "\<(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\>"
|
||||
cyan (i) "\<(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\>"
|
||||
cyan (i) "\<(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\>"
|
||||
cyan (i) "\<(open|pad|present|print|product|pure|quote|radix)\>"
|
||||
cyan (i) "\<(random_number|random_seed|range|read|readwrite|replace)\>"
|
||||
cyan (i) "\<(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\>"
|
||||
cyan (i) "\<(spread|sum|system_clock|target|transfer|transpose|trim)\>"
|
||||
cyan (i) "\<(ubound|unpack|verify|write|tiny|type|use|yes)\>"
|
||||
|
||||
yellow (i) "\<(.and.|case|do|else|else?if|else?where|end|end?do|end?if)\>"
|
||||
yellow (i) "\<(end?select|.eqv.|forall|if|lge|lgt|lle|llt|.neqv.|.not.)\>"
|
||||
yellow (i) "\<(.or.|repeat|select case|then|where|while)\>"
|
||||
|
||||
magenta (i) "\<(continue|cycle|exit|go?to|result|return)\>"
|
||||
|
||||
#Operator Color
|
||||
color yellow "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
|
||||
|
||||
#Parenthetical Color
|
||||
color magenta "[(){}]" "\[" "\]"
|
||||
|
||||
# Add preprocessor commands.
|
||||
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
||||
|
||||
## String highlighting.
|
||||
cyan (i) "<[^= ]*>" ""(\\.|[^"])*""
|
||||
cyan (i) "<[^= ]*>" "'(\\.|[^"])*'"
|
||||
|
||||
## Comment highlighting
|
||||
brightred (i) "!.*$" "(^[Cc]| [Cc]) .*$"
|
||||
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
## GDScript syntax file, based on Python syntax file.
|
||||
##
|
||||
syntax "gdscript" "\.gd$"
|
||||
|
||||
## built-in objects
|
||||
color constant "\b(null|self|true|false)\b"
|
||||
## built-in attributes
|
||||
# color constant "\b()\b"
|
||||
## built-in functions
|
||||
color identifier "\b(abs|acos|asin|atan|atan2|ceil|clamp|convert|cos|cosh|db2linear|decimals|deg2rad|ease|exp|float|floor|fmod|fposmod|hash|int|isinf|isnan|lerp|linear2db|load|log|max|min|nearest_po2|pow|preload|print|printerr|printraw|prints|printt|rad2deg|rand_range|rand_seed|randomize|randi|randf|range|round|seed|sin|slerp|sqrt|str|str2var|tan|typeof|var2str|weakref)\b"
|
||||
## special method names
|
||||
color identifier "\b(AnimationPlayer|AnimationTreePlayer|Button|Control|HTTPClient|HTTPRequest|Input|InputEvent|MainLoop|Node|Node2D|SceneTree|Spatial|SteamPeer|PacketPeer|PacketPeerUDP|Timer|Tween)\b"
|
||||
## types
|
||||
color type "\b(Vector2|Vector3)\b"
|
||||
## definitions
|
||||
color identifier "func [a-zA-Z_0-9]+"
|
||||
## keywords
|
||||
color statement "\b(and|as|assert|break|breakpoint|class|const|continue|elif|else|export|extends|for|func|if|in|map|not|onready|or|pass|return|signal|var|while|yield)\b"
|
||||
|
||||
## decorators
|
||||
color brightgreen "@.*[(]"
|
||||
|
||||
## operators
|
||||
color statement "[.:;,+*|=!\%@]" "<" ">" "/" "-" "&"
|
||||
|
||||
## parentheses
|
||||
color statement "[(){}]" "\[" "\]"
|
||||
|
||||
## numbers
|
||||
color constant "\b[0-9]+\b"
|
||||
|
||||
## strings
|
||||
color constant.number "\b([0-9]+|0x[0-9a-fA-F]*)\b|'.'"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color constant.specialChar "\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
||||
color constant.string "`[^`]*`"
|
||||
|
||||
## brightblacks
|
||||
color comment "#.*$"
|
||||
|
||||
## block brightblacks
|
||||
color comment start=""""([^"]|$)" end="""""
|
||||
color comment start="'''([^']|$)" end="'''"
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
## Here is an example for ebuilds/eclasses
|
||||
##
|
||||
syntax "ebuild" "\.e(build|class)$"
|
||||
## All the standard portage functions
|
||||
color identifier "^src_(unpack|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
|
||||
## Highlight bash related syntax
|
||||
color statement "\b(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\b"
|
||||
color statement "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||
color statement "-(e|d|f|r|g|u|w|x|L)\b"
|
||||
color statement "-(eq|ne|gt|lt|ge|le|s|n|z)\b"
|
||||
## Highlight variables ... official portage ones in red, all others in bright red
|
||||
color preproc "\$\{?[a-zA-Z_0-9]+\}?"
|
||||
color special "\b(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\b"
|
||||
color special "\b(S|D|T|PV|PF|P|PN|A)\b" "\bC(XX)?FLAGS\b" "\bLDFLAGS\b" "\bC(HOST|TARGET|BUILD)\b"
|
||||
## Highlight portage commands
|
||||
color identifier "\buse(_(with|enable))?\b [!a-zA-Z0-9_+ -]*" "inherit.*"
|
||||
color statement "\be(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\b"
|
||||
color statement "\bdie\b" "\buse(_(with|enable))?\b" "\binherit\b" "\bhas\b" "\b(has|best)_version\b" "\bunpack\b"
|
||||
color statement "\b(do|new)(ins|s?bin|doc|lib(\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\b"
|
||||
color statement "\bdo(python|sed|dir|hard|sym|html|jar|mo)\b" "\bkeepdir\b"
|
||||
color statement "prepall(docs|info|man|strip)" "prep(info|lib|lib\.(so|a)|man|strip)"
|
||||
color statement "\b(doc|ins|exe)into\b" "\bf(owners|perms)\b" "\b(exe|ins|dir)opts\b"
|
||||
## Highlight common commands used in ebuilds
|
||||
color type "\bmake\b" "\b(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\b"
|
||||
## Highlight comments (doesnt work that well)
|
||||
color comment "#.*$"
|
||||
## Highlight strings (doesnt work that well)
|
||||
color constant.string ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
|
||||
44
runtime/syntax/gentoo-ebuild.yaml
Normal file
44
runtime/syntax/gentoo-ebuild.yaml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
filetype: ebuild
|
||||
|
||||
detect:
|
||||
filename: "\\.e(build|class)$"
|
||||
|
||||
rules:
|
||||
# All the standard portage functions
|
||||
- identifier: "^src_(unpack|compile|install|test)|^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
|
||||
# Highlight bash related syntax
|
||||
- statement: "\\b(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\\b"
|
||||
- statement: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)"
|
||||
- statement: "-(e|d|f|r|g|u|w|x|L)\\b"
|
||||
- statement: "-(eq|ne|gt|lt|ge|le|s|n|z)\\b"
|
||||
# Highlight variables ... official portage ones in red, all others in bright red
|
||||
- preproc: "\\$\\{?[a-zA-Z_0-9]+\\}?"
|
||||
- special: "\\b(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\\b"
|
||||
- special: "\\b(S|D|T|PV|PF|P|PN|A)\\b|\\bC(XX)?FLAGS\\b|\\bLDFLAGS\\b|\\bC(HOST|TARGET|BUILD)\\b"
|
||||
# Highlight portage commands
|
||||
- identifier: "\\buse(_(with|enable))?\\b [!a-zA-Z0-9_+ -]*|inherit.*"
|
||||
- statement: "\\be(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\\b"
|
||||
- statement: "\\bdie\\b|\\buse(_(with|enable))?\\b|\\binherit\\b|\\bhas\\b|\\b(has|best)_version\\b|\\bunpack\\b"
|
||||
- statement: "\\b(do|new)(ins|s?bin|doc|lib(\\.so|\\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\\b"
|
||||
- statement: "\\bdo(python|sed|dir|hard|sym|html|jar|mo)\\b|\\bkeepdir|\b"
|
||||
- statement: "prepall(docs|info|man|strip)|prep(info|lib|lib\\.(so|a)|man|strip)"
|
||||
- statement: "\\b(doc|ins|exe)into\\b|\\bf(owners|perms)\\b|\\b(exe|ins|dir)opts\\b"
|
||||
# Highlight common commands used in ebuilds
|
||||
- type: "\\bmake\\b|\\b(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\\b"
|
||||
# Highlight comments (doesnt work that well)
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
# Highlight strings (doesnt work that well)
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
## Here is an example for Portage control files
|
||||
##
|
||||
syntax "etc-portage" "\.(keywords|mask|unmask|use)$"
|
||||
## Base text:
|
||||
color green "^.+$"
|
||||
## Use flags:
|
||||
color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
|
||||
color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
|
||||
## Likely version numbers:
|
||||
color magenta "-[[:digit:]].*([[:space:]]|$)"
|
||||
## Accepted arches:
|
||||
color white "[~-]?\<(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\>"
|
||||
color white "[[:space:]][~-]?\*"
|
||||
## Categories:
|
||||
color cyan "^[[:space:]]*.*/"
|
||||
## Masking regulators:
|
||||
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
|
||||
## Comments:
|
||||
color yellow "#.*$"
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
# This code is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the new BSD License.
|
||||
#
|
||||
# Copyright (c) 2010, Sebastian Staudt
|
||||
# A nano configuration file to enable syntax highlighting of some Git specific
|
||||
# files with the GNU nano text editor (http://www.nano-editor.org)
|
||||
#
|
||||
syntax "git-commit" "COMMIT_EDITMSG|TAG_EDITMSG"
|
||||
|
||||
# Commit message
|
||||
color ignore ".*"
|
||||
|
||||
# Comments
|
||||
color comment "^#.*"
|
||||
|
||||
# Files changes
|
||||
color keyword "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*"
|
||||
color keyword "#[[:space:]]deleted:"
|
||||
color keyword "#[[:space:]]modified:"
|
||||
color keyword "#[[:space:]]new file:"
|
||||
color keyword "#[[:space:]]renamed:"
|
||||
|
||||
# Untracked filenames
|
||||
color error "^# [^/?*:;{}\\]+\.[^/?*:;{}\\]+$"
|
||||
|
||||
color keyword "^#[[:space:]]Changes.*[:]"
|
||||
color keyword "^#[[:space:]]Your branch and '[^']+"
|
||||
color keyword "^#[[:space:]]Your branch and '"
|
||||
color keyword "^#[[:space:]]On branch [^ ]+"
|
||||
color keyword "^#[[:space:]]On branch"
|
||||
|
||||
# Recolor hash symbols
|
||||
|
||||
# Recolor hash symbols
|
||||
color special "#"
|
||||
|
||||
# Trailing spaces (+LINT is not ok, git uses tabs)
|
||||
color ,error "[[:space:]]+$"
|
||||
30
runtime/syntax/git-commit.yaml
Normal file
30
runtime/syntax/git-commit.yaml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
filetype: git-commit
|
||||
|
||||
detect:
|
||||
filename: "COMMIT_EDITMSG|TAG_EDITMSG"
|
||||
|
||||
rules:
|
||||
# Commit message
|
||||
- ignore: ".*"
|
||||
# Comments
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
# File changes
|
||||
- keyword: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*"
|
||||
- keyword: "#[[:space:]]deleted:"
|
||||
- keyword: "#[[:space:]]modified:"
|
||||
- keyword: "#[[:space:]]new file:"
|
||||
- keyword: "#[[:space:]]renamed:"
|
||||
# Untracked filenames
|
||||
- error: "^# [^/?*:;{}\\\\]+\\.[^/?*:;{}\\\\]+$"
|
||||
- keyword: "^#[[:space:]]Changes.*[:]"
|
||||
- keyword: "^#[[:space:]]Your branch and '[^']+"
|
||||
- keyword: "^#[[:space:]]Your branch and '"
|
||||
- keyword: "^#[[:space:]]On branch [^ ]+"
|
||||
- keyword: "^#[[:space:]]On branch"
|
||||
# Recolor hash symbols
|
||||
- special: "#"
|
||||
# Trailing spaces (+LINT is not ok, git uses tabs)
|
||||
- error: "[[:space:]]+$"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
syntax "git-config" "git(config|modules)$|\.git/config$"
|
||||
|
||||
color constant "\<(true|false)\>"
|
||||
color keyword "^[[:space:]]*[^=]*="
|
||||
color constant "^[[:space:]]*\[.*\]$"
|
||||
color constant ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color comment "(^|[[:space:]])#([^{].*)?$"
|
||||
14
runtime/syntax/git-config.yaml
Normal file
14
runtime/syntax/git-config.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
filetype: git-config
|
||||
|
||||
detect:
|
||||
filename: "git(config|modules)$|\\.git/config$"
|
||||
|
||||
rules:
|
||||
- constant: "\\<(true|false)\\>"
|
||||
- keyword: "^[[:space:]]*[^=]*="
|
||||
- constant: "^[[:space:]]*\\[.*\\]$"
|
||||
- constant: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# This syntax format is used for interactive rebasing
|
||||
syntax "git-rebase-todo" "git-rebase-todo"
|
||||
|
||||
# Default
|
||||
color ignore ".*"
|
||||
|
||||
# Comments
|
||||
color comment "^#.*"
|
||||
|
||||
# Rebase commands
|
||||
color keyword "^(e|edit) [0-9a-f]{7,40}"
|
||||
color keyword "^# (e, edit)"
|
||||
color keyword "^(f|fixup) [0-9a-f]{7,40}"
|
||||
color keyword "^# (f, fixup)"
|
||||
color keyword "^(p|pick) [0-9a-f]{7,40}"
|
||||
color keyword "^# (p, pick)"
|
||||
color keyword "^(r|reword) [0-9a-f]{7,40}"
|
||||
color keyword "^# (r, reword)"
|
||||
color keyword "^(s|squash) [0-9a-f]{7,40}"
|
||||
color keyword "^# (s, squash)"
|
||||
color keyword "^(x|exec) [^ ]+ [0-9a-f]{7,40}"
|
||||
color keyword "^# (x, exec)"
|
||||
|
||||
# Recolor hash symbols
|
||||
color special "#"
|
||||
|
||||
# Commit IDs
|
||||
color identifier "[0-9a-f]{7,40}"
|
||||
30
runtime/syntax/git-rebase-todo.yaml
Normal file
30
runtime/syntax/git-rebase-todo.yaml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
filetype: git-rebase-todo
|
||||
|
||||
detect:
|
||||
filename: "git-rebase-todo"
|
||||
|
||||
rules:
|
||||
# Default
|
||||
- ignore: ".*"
|
||||
# Comments
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
# Rebase commands
|
||||
- keyword: "^(e|edit) [0-9a-f]{7,40}"
|
||||
- keyword: "^# (e, edit)"
|
||||
- keyword: "^(f|fixup) [0-9a-f]{7,40}"
|
||||
- keyword: "^# (f, fixup)"
|
||||
- keyword: "^(p|pick) [0-9a-f]{7,40}"
|
||||
- keyword: "^# (p, pick)"
|
||||
- keyword: "^(r|reword) [0-9a-f]{7,40}"
|
||||
- keyword: "^# (r, reword)"
|
||||
- keyword: "^(s|squash) [0-9a-f]{7,40}"
|
||||
- keyword: "^# (s, squash)"
|
||||
- keyword: "^(x|exec) [^ ]+ [0-9a-f]{7,40}"
|
||||
- keyword: "^# (x, exec)"
|
||||
# Recolor hash symbols
|
||||
- special: "#"
|
||||
# Commit IDs
|
||||
- identifier: "[0-9a-f]{7,40}"
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
syntax "glsl" "\.(frag|vert|fp|vp|glsl)$"
|
||||
|
||||
color brightblue "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]"
|
||||
color green "\<(void|bool|bvec2|bvec3|bvec4|int|ivec2|ivec3|ivec4|float|vec2|vec3|vec4|mat2|mat3|mat4|struct|sampler1D|sampler2D|sampler3D|samplerCUBE|sampler1DShadow|sampler2DShadow)\>"
|
||||
color green "\<gl_(DepthRangeParameters|PointParameters|MaterialParameters|LightSourceParameters|LightModelParameters|LightModelProducts|LightProducts|FogParameters)\>"
|
||||
color cyan "\<(const|attribute|varying|uniform|in|out|inout|if|else|return|discard|while|for|do)\>"
|
||||
color brightred "\<(break|continue)\>"
|
||||
color brightcyan "\<(true|false)\>"
|
||||
color red "[-+/*=<>?:!~%&|^]"
|
||||
color blue "\<([0-9]+|0x[0-9a-fA-F]*)\>"
|
||||
color brightblack "(^|[[:space:]])//.*"
|
||||
color brightblack start="/\*" end="\*/"
|
||||
color brightwhite,cyan "TODO:?"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
26
runtime/syntax/glsl.yaml
Normal file
26
runtime/syntax/glsl.yaml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
filetype: glsl
|
||||
|
||||
detect:
|
||||
filename: "\\.(frag|vert|fp|vp|glsl)$"
|
||||
|
||||
rules:
|
||||
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]"
|
||||
- type: "\\<(void|bool|bvec2|bvec3|bvec4|int|ivec2|ivec3|ivec4|float|vec2|vec3|vec4|mat2|mat3|mat4|struct|sampler1D|sampler2D|sampler3D|samplerCUBE|sampler1DShadow|sampler2DShadow)\\>"
|
||||
- statement: "\\<gl_(DepthRangeParameters|PointParameters|MaterialParameters|LightSourceParameters|LightModelParameters|LightModelProducts|LightProducts|FogParameters)\\>"
|
||||
- statement: "\\<(const|attribute|varying|uniform|in|out|inout|if|else|return|discard|while|for|do)\\>"
|
||||
- statement: "\\<(break|continue)\\>"
|
||||
- constant: "\\<(true|false)\\>"
|
||||
- statement: "[-+/*=<>?:!~%&|^]"
|
||||
- constant.number: "\\<([0-9]+|0x[0-9a-fA-F]*)\\>"
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules:
|
||||
- todo: "TODO:?"
|
||||
|
||||
- comment:
|
||||
start: "/\\*"
|
||||
end: "\\*/"
|
||||
rules:
|
||||
- todo: "TODO:?"
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
syntax "go" "\.go$"
|
||||
|
||||
# Conditionals and control flow
|
||||
color statement "\b(break|case|continue|default|else|for|go|goto|if|range|return|switch)\b"
|
||||
color statement "\b(package|import|const|var|type|struct|func|go|defer|iota)\b"
|
||||
color statement "[-+/*=<>!~%&|^]|:="
|
||||
|
||||
# Types
|
||||
color special "[a-zA-Z0-9]*\("
|
||||
color brightyellow "(,|\.)"
|
||||
color type "\b(u?int(8|16|32|64)?|float(32|64)|complex(64|128))\b"
|
||||
color type "\b(uintptr|byte|rune|string|interface|bool|map|chan|error)\b"
|
||||
color constant "\b(true|false|nil)\b"
|
||||
|
||||
# Brackets
|
||||
color statement "(\{|\})"
|
||||
color statement "(\(|\))"
|
||||
color statement "(\[|\])"
|
||||
color statement "!"
|
||||
color statement ","
|
||||
|
||||
# Numbers and strings
|
||||
color constant.number "\b([0-9]+|0x[0-9a-fA-F]*)\b|'.'"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color constant.specialChar "\\[abfnrtv'\"\\]"
|
||||
color constant.specialChar "\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
||||
color constant.string "`[^`]*`"
|
||||
|
||||
# Comments & TODOs
|
||||
color comment "(^|[[:space:]])//.*"
|
||||
color comment start="/\*" end="\*/"
|
||||
color todo "(TODO|XXX|FIXME):?"
|
||||
52
runtime/syntax/go.yaml
Normal file
52
runtime/syntax/go.yaml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
filetype: go
|
||||
|
||||
detect:
|
||||
filename: "\\.go$"
|
||||
|
||||
rules:
|
||||
- statement: "\\b(break|case|continue|default|else|for|go|goto|if|range|return|switch)\\b"
|
||||
- statement: "\\b(package|import|const|var|type|struct|func|go|defer|iota)\\b"
|
||||
- statement: "[-+/*=<>!~%&|^]|:="
|
||||
- identifier: "[a-zA-Z0-9]*\\("
|
||||
- type: "\\b(u?int(8|16|32|64)?|float(32|64)|complex(64|128))\\b"
|
||||
- type: "\\b(uintptr|byte|rune|string|interface|bool|map|chan|error)\\b"
|
||||
- constant: "\\b(true|false|nil)\\b"
|
||||
- statement: "(\\{|\\})"
|
||||
- statement: "(\\(|\\))"
|
||||
- statement: "(\\[|\\])"
|
||||
- statement: "!"
|
||||
- statement: ","
|
||||
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b"
|
||||
- constant.specialChar: "([0-7]{3|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules:
|
||||
- todo: "(TODO|XXX|FIXME):?"
|
||||
|
||||
- comment:
|
||||
start: "/\\*"
|
||||
end: "\\*/"
|
||||
rules:
|
||||
- todo: "(TODO|XXX|FIXME):?"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.specialChar: "%."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- preproc: "..+"
|
||||
- constant.specialChar: "%."
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "`"
|
||||
end: "`"
|
||||
rules: []
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
syntax "golo" "\.golo$"
|
||||
|
||||
color type "\b(function|fun|)\b"
|
||||
color type "\b(struct|DynamicObject|union|AdapterFabric|Adapter|DynamicVariable|Observable)\b"
|
||||
color type "\b(list|set|array|vector|tuple|map)\b"
|
||||
color type "\b(Ok|Error|Empty|None|Some|Option|Result|Result.ok|Result.fail|Result.error|Result.empty|Optional.empty|Optional.of)\b"
|
||||
|
||||
color statement "\b(augment|pimp)\b"
|
||||
color statement "\b(interfaces|implements|extends|overrides|maker|newInstance)\b"
|
||||
color statement "\b(isEmpty|isNone|isPresent|isSome|iterator|flattened|toList|flatMap|`and|orElseGet|`or|toResult|apply|either)\b"
|
||||
color statement "\b(result|option|trying|raising|nullify|catching)\b"
|
||||
color statement "\b(promise|setFuture|failedFuture|all|any)\b"
|
||||
color statement "\b(initialize|initializeWithinThread|start|future|fallbackTo|onSet|onFail|cancel|enqueue)\b"
|
||||
color statement "\b(println|print|raise|readln|readPassword|secureReadPassword|requireNotNull|require|newTypedArray|range|reversedRange|mapEntry|asInterfaceInstance|asFunctionalInterface|isClosure|fileToText|textToFile|fileExists|currentDir|sleep|uuid|isArray|arrayTypeOf|charValue|intValue|longValue|doubleValue|floatValue|removeByIndex|box)\b"
|
||||
color statement "\b(likelySupported|reset|bold|underscore|blink|reverse_video|concealed|fg_black|fg_red|fg_green|fg_yellow|fg_blue|fg_magenta|fg_cyan|fg_white|bg_black|bg_red|bg_green|bg_yellow|bg_blue|bg_magenta|bg_cyan|bg_white|cursor_position|cursor_save_position|cursor_restore_position|cursor_up|cursor_down|cursor_forward|cursor_backward|erase_display|erase_line)\b"
|
||||
color statement "\b(emptyList|cons|lazyList|fromIter|generator|repeat|iterate)\b"
|
||||
color statement "\b(asLazyList|foldl|foldr|take|takeWhile|drop|dropWhile|subList)\b"
|
||||
color statement "\b(import)\b"
|
||||
color statement "\b(module)\b"
|
||||
color statement "\b(JSON)\b"
|
||||
color statement "\b(stringify|parse|toJSON|toDynamicObject|updateFromJSON)\b"
|
||||
color statement "\b(newInstance|define|getKey|getValue|properties|fallback)\b"
|
||||
color statement "\b(times|upTo|downTo)\b"
|
||||
color statement "\b(format|toInt|toInteger|toDouble|toFloat|toLong)\b"
|
||||
color statement "\b(head|tail|isEmpty|reduce|each|count|exists)\b"
|
||||
color statement "\b(newWithSameType|destruct|append|add|addIfAbsent|prepend|insert|last|unmodifiableView|find|filter|map|join|reverse|reversed|order|ordered|removeAt|include|exclude|remove|delete|has|contains|getOrElse|toArray)\b"
|
||||
color statement "\b(add|addTo|succ|pred|mul|neg|sub|rsub|div|rdiv|mod|rmod|pow|rpow|str|lt|gt|eq|ne|ge|le|`and|`or|`not|xor|even|odd|contains|isEmpty|`is|`isnt|`oftype|`orIfNull|fst|snd|getitem|setitem|getter|id|const|False|True|Null|curry|uncurry|unary|spreader|varargs|swapArgs|swapCurry|swapCouple|swap|invokeWith|pipe|compose|io|andThen|until|recur|cond)\b"
|
||||
color statement "\b(toUpperCase|equals|startsWith)\b"
|
||||
|
||||
color preproc "\b(if|else|then|when|case|match|otherwise)\b"
|
||||
color preproc "\b(with|break|continue|return)\b"
|
||||
color error "\b(try|catch|finally|throw)\b"
|
||||
color identifier "\b(super|this|let|var|local)\b"
|
||||
color special "[(){}]" "\[" "\]"
|
||||
color preproc "\b(for|while|foreach|in)\b"
|
||||
color constant "\b(and|in|is|not|or|isnt|orIfNull)\b"
|
||||
|
||||
color constant "\b(true|false)\b"
|
||||
color constant "\b(null|undefined)\b"
|
||||
|
||||
color statement "[-+/*=<>!~%&|^]|:="
|
||||
color constant.number "\b([0-9]+|0x[0-9a-fA-F]*)\b|'.'"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
|
||||
color comment "#.*$"
|
||||
color comment start="----" end="----"
|
||||
|
||||
color todo "TODO:?"
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
## Here is an example for groff.
|
||||
##
|
||||
syntax "groff" "\.m[ems]$" "\.rof" "\.tmac$" "^tmac."
|
||||
## The argument of .ds or .nr
|
||||
color cyan "^\.(ds|nr) [^[[:space:]]]*"
|
||||
## Single character escapes
|
||||
color brightmagenta "\\."
|
||||
## Highlight the argument of \f or \s in the same color
|
||||
color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]"
|
||||
## Newlines
|
||||
color cyan "(\\|\\\\)n(.|\(..)"
|
||||
color cyan start="(\\|\\\\)n\[" end="]"
|
||||
## Requests
|
||||
color brightgreen "^\.[[:space:]]*[^[[:space:]]]*"
|
||||
## Comments
|
||||
color yellow "^\.\\".*$"
|
||||
## Strings
|
||||
color green "(\\|\\\\)\*(.|\(..)"
|
||||
color green start="(\\|\\\\)\*\[" end="]"
|
||||
## Characters
|
||||
color brightred "\\\(.."
|
||||
color brightred start="\\\[" end="]"
|
||||
## Macro arguments
|
||||
color brightcyan "\\\\\$[1-9]"
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
syntax "haml" "\.haml$"
|
||||
|
||||
color cyan "-|="
|
||||
color white "->|=>"
|
||||
cyan (i) "([ ]|^)%[0-9A-Z_]+\>"
|
||||
magenta (i) ":[0-9A-Z_]+\>"
|
||||
yellow (i) "\.[A-Z_]+\>"
|
||||
## Double quote & single quote
|
||||
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
|
||||
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||
## Vars
|
||||
color brightgreen "#\{[^}]*\}"
|
||||
color brightblue "(@|@@)[0-9A-Z_a-z]+"
|
||||
## Comments
|
||||
color brightcyan "#[^{].*$" "#$"
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
syntax "haskell" "\.hs$"
|
||||
|
||||
## Keywords
|
||||
color red "[ ](as|case|of|class|data|default|deriving|do|forall|foreign|hiding|if|then|else|import|infix|infixl|infixr|instance|let|in|mdo|module|newtype|qualified|type|where)[ ]"
|
||||
color red "(^data|^foreign|^import|^infix|^infixl|^infixr|^instance|^module|^newtype|^type)[ ]"
|
||||
color red "[ ](as$|case$|of$|class$|data$|default$|deriving$|do$|forall$|foreign$|hiding$|if$|then$|else$|import$|infix$|infixl$|infixr$|instance$|let$|in$|mdo$|module$|newtype$|qualified$|type$|where$)"
|
||||
|
||||
## Various symbols
|
||||
color cyan "(\||@|!|:|_|~|=|\\|;|\(\)|,|\[|\]|\{|\})"
|
||||
|
||||
## Operators
|
||||
color magenta "(==|/=|&&|\|\||<|>|<=|>=)"
|
||||
|
||||
## Various symbols
|
||||
color cyan "(->|<-)"
|
||||
color magenta "\.|\$"
|
||||
|
||||
## Data constructors
|
||||
color magenta "(True|False|Nothing|Just|Left|Right|LT|EQ|GT)"
|
||||
|
||||
## Data classes
|
||||
color magenta "[ ](Read|Show|Enum|Eq|Ord|Data|Bounded|Typeable|Num|Real|Fractional|Integral|RealFrac|Floating|RealFloat|Monad|MonadPlus|Functor)"
|
||||
|
||||
## Strings
|
||||
color yellow ""[^\"]*""
|
||||
|
||||
## Comments
|
||||
color green "--.*"
|
||||
color green start="\{-" end="-\}"
|
||||
|
||||
color brightred "undefined"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
## Here is a short improved example for HTML.
|
||||
##
|
||||
syntax "html" "\.htm[l]?$"
|
||||
color identifier "<.*?>"
|
||||
color special "&[^;[[:space:]]]*;"
|
||||
color constant ""[^"]*"|qq\|.*\|"
|
||||
color statement "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
|
||||
11
runtime/syntax/html.yaml
Normal file
11
runtime/syntax/html.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
filetype: html
|
||||
|
||||
detect:
|
||||
filename: "\\.htm[l]?$"
|
||||
|
||||
rules:
|
||||
- identifier: "<.*?>"
|
||||
- special: "&[^;[[:space:]]]*;"
|
||||
- statement: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
|
||||
- constant: "\"[^\"]*\"|qq\\|.*\\|"
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
syntax "ini" "\.(ini|desktop|lfl|override)$" "(mimeapps\.list|pinforc|setup\.cfg)$" "weechat/.+\.conf$"
|
||||
header "^\[[A-Za-z]+\]$"
|
||||
|
||||
color constant "\b(true|false)\b"
|
||||
color identifier "^[[:space:]]*[^=]*="
|
||||
color special "^[[:space:]]*\[.*\]$"
|
||||
color statement "[=;]"
|
||||
color comment "(^|[[:space:]])#([^{].*)?$"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
syntax "inputrc" "inputrc$"
|
||||
|
||||
color red "\<(off|none)\>"
|
||||
color green "\<on\>"
|
||||
color brightblue "\<set|\$include\>"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color magenta "\\.?"
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
## Here is an example for Java.
|
||||
##
|
||||
syntax "java" "\.java$"
|
||||
color type "\b(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\b"
|
||||
color statement "\b(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\b"
|
||||
color type "\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\b"
|
||||
color constant.string ""[^"]*""
|
||||
color constant "\b(true|false|null)\b"
|
||||
color constant.number "\b[0-9]+\b"
|
||||
color comment "//.*"
|
||||
color comment start="/\*" end="\*/"
|
||||
color comment start="/\*\*" end="\*/"
|
||||
34
runtime/syntax/java.yaml
Normal file
34
runtime/syntax/java.yaml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
filetype: java
|
||||
|
||||
detect:
|
||||
filename: "\\.java$"
|
||||
|
||||
rules:
|
||||
- type: "\\b(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\\b"
|
||||
- statement: "\\b(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\\b"
|
||||
- type: "\\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\\b"
|
||||
- constant: "\\b(true|false|null)\\b"
|
||||
- constant.number: "\\b[0-9]+\\b"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- preproc: "..+"
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "/\\*"
|
||||
end: "\\*/"
|
||||
rules: []
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
syntax "javascript" "\.js$"
|
||||
|
||||
color constant.number "\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b"
|
||||
color constant.number "\b[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
||||
color constant.number "\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
||||
color identifier "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
|
||||
color statement "\b(break|case|catch|continue|default|delete|do|else|finally)\b"
|
||||
color statement "\b(for|function|get|if|in|instanceof|new|return|set|switch)\b"
|
||||
color statement "\b(switch|this|throw|try|typeof|var|void|while|with)\b"
|
||||
color constant "\b(null|undefined|NaN)\b"
|
||||
color constant "\b(true|false)\b"
|
||||
color type "\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\b"
|
||||
color type "\b(Number|Object|RegExp|String)\b"
|
||||
color statement "[-+/*=<>!~%?:&|]"
|
||||
color constant "/[^*]([^/]|(\\/))*[^\\]/[gim]*"
|
||||
color constant "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
|
||||
color comment "(^|[[:space:]])//.*"
|
||||
color comment "/\*.+\*/"
|
||||
color todo "TODO:?"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
42
runtime/syntax/javascript.yaml
Normal file
42
runtime/syntax/javascript.yaml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
filetype: javascript
|
||||
|
||||
detect:
|
||||
filename: "\\.js$"
|
||||
|
||||
rules:
|
||||
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
|
||||
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
||||
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
||||
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
|
||||
- statement: "\\b(break|case|catch|continue|default|delete|do|else|finally)\\b"
|
||||
- statement: "\\b(for|function|get|if|in|instanceof|new|return|set|switch)\\b"
|
||||
- statement: "\\b(switch|this|throw|try|typeof|var|void|while|with)\\b"
|
||||
- constant: "\\b(null|undefined|NaN)\\b"
|
||||
- constant: "\\b(true|false)\\b"
|
||||
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b"
|
||||
- type: "\\b(Number|Object|RegExp|String)\\b"
|
||||
- statement: "[-+/*=<>!~%?:&|]"
|
||||
- constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
|
||||
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "/\\*"
|
||||
end: "\\*/"
|
||||
rules: []
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
syntax "json" "\.json$"
|
||||
header "^\{$"
|
||||
|
||||
color constant.number "\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\b"
|
||||
color constant.number "\b[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
||||
color constant.number "\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
||||
color constant "\b(null)\b"
|
||||
color constant "\b(true|false)\b"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color statement "\"(\\"|[^"])*\"[[:space:]]*:" "'(\'|[^'])*'[[:space:]]*:"
|
||||
color constant "\\u[0-9a-fA-F]{4}|\\[bfnrt'"/\\]"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
24
runtime/syntax/json.yaml
Normal file
24
runtime/syntax/json.yaml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
filetype: json
|
||||
|
||||
detect:
|
||||
filename: "\\.json$"
|
||||
header: "^\\{$"
|
||||
|
||||
rules:
|
||||
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
|
||||
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
||||
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
||||
- constant: "\\b(null)\\b"
|
||||
- constant: "\\b(true|false)\\b"
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- statement: "\\\"(\\\\\"|[^\"])*\\\"[[:space:]]*:\" \"'(\\'|[^'])*'[[:space:]]*:"
|
||||
- constant: "\\\\u[0-9a-fA-F]{4}|\\\\[bfnrt'\"/\\\\]"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
syntax "keymap" "\.(k|key)?map$|Xmodmap$"
|
||||
|
||||
color cyan "\<(add|clear|compose|keycode|keymaps|keysym|remove|string)\>"
|
||||
color cyan "\<(control|alt|shift)\>"
|
||||
color blue "\<[0-9]+\>"
|
||||
color red "="
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightblack "^!.*$"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
24
runtime/syntax/keymap.yaml
Normal file
24
runtime/syntax/keymap.yaml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
filetype: keymap
|
||||
|
||||
detect:
|
||||
filename: "\\.(k|key)?map$|Xmodmap$"
|
||||
|
||||
rules:
|
||||
- statement: "\\b(add|clear|compose|keycode|keymaps|keysym|remove|string)\\b"
|
||||
- statement: "\\b(control|alt|shift)\\b"
|
||||
- constant.number: "\\b[0-9]+\\b"
|
||||
- special: "="
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- comment:
|
||||
start: "^!"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
syntax "kickstart" "\.ks$" "\.kickstart$"
|
||||
|
||||
color brightmagenta "%[a-z]+"
|
||||
color cyan "^[[:space:]]*(install|cdrom|text|graphical|volgroup|logvol|reboot|timezone|lang|keyboard|authconfig|firstboot|rootpw|user|firewall|selinux|repo|part|partition|clearpart|bootloader)"
|
||||
color cyan "--(name|mirrorlist|baseurl|utc)(=|\>)"
|
||||
color brightyellow "\$(releasever|basearch)\>"
|
||||
|
||||
# Packages and groups
|
||||
color brightblack "^@[A-Za-z][A-Za-z-]*"
|
||||
color brightred "^-@[a-zA-Z0-9*-]+"
|
||||
color red "^-[a-zA-Z0-9*-]+"
|
||||
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
syntax "ledger" "(^|\.|/)ledger|ldgr|beancount|bnct$"
|
||||
|
||||
color brightmagenta "^([0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}|[=~]) .*"
|
||||
color blue "^[0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}"
|
||||
color brightyellow "^~ .*"
|
||||
color brightblue "^= .*"
|
||||
color cyan "^[[:space:]]+(![[:space:]]+)?\(?[A-Za-z ]+(:[A-Za-z ]+)*\)?"
|
||||
color cyan "^[[:space:]]+(![[:space:]]+)?\(?[A-Za-z_-]+(:[A-Za-z_-]+)*\)?"
|
||||
color red "[*!]"
|
||||
color brightblack "^[[:space:]]*;.*"
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
syntax "lfe" "lfe$" "\.lfe$"
|
||||
|
||||
# Parens are everywhere!
|
||||
color statement "\("
|
||||
color statement "\)"
|
||||
|
||||
# Good overrides for LFE in particular
|
||||
color type "defun|define-syntax|define|defmacro|defmodule|export"
|
||||
|
||||
# Dirty base cases stolen from the generic lisp syntax
|
||||
color constant "\ [A-Za-z][A-Za-z0-9_-]+\ "
|
||||
color statement "\(([-+*/<>]|<=|>=)|'"
|
||||
color constant.number "\<[0-9]+\>"
|
||||
color constant.string "\"(\\.|[^"])*\""
|
||||
color special "['|`][A-Za-z][A-Za-z0-9_-]+"
|
||||
color constant.string "\\.?"
|
||||
color comment "(^|[[:space:]]);.*"
|
||||
|
||||
# Some warning colors because our indents are wrong.
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
syntax "lilypond" "\.ly$" "\.ily$" "\.lly$"
|
||||
|
||||
color constant.number "\d+"
|
||||
color identifier "[[:space:]](staff|spacing|signature|routine|notes|handler|corrected|beams|arpeggios|Volta_engraver|Voice|Vertical_align_engraver|Vaticana_ligature_engraver|VaticanaVoice|VaticanaStaff|Tweak_engraver|Tuplet_engraver|Trill_spanner_engraver|Timing_translator|Time_signature_performer|Time_signature_engraver|Tie_performer|Tie_engraver|Text_spanner_engraver|Text_engraver|Tempo_performer|Tab_tie_follow_engraver|Tab_staff_symbol_engraver|Tab_note_heads_engraver|TabVoice|TabStaff|System_start_delimiter_engraver|Stem_engraver|Stanza_number_engraver|Stanza_number_align_engraver|Staff_symbol_engraver|Staff_performer|Staff_collecting_engraver|StaffGroup|Staff|Spanner_break_forbid_engraver|Span_bar_stub_engraver|Span_bar_engraver|Span_arpeggio_engraver|Spacing_engraver|Slur_performer|Slur_engraver|Slash_repeat_engraver|Separating_line_group_engraver|Script_row_engraver|Script_engraver|Script_column_engraver|Score|Rhythmic_column_engraver|RhythmicStaff|Rest_engraver|Rest_collision_engraver|Repeat_tie_engraver|Repeat_acknowledge_engraver|Pure_from_neighbor_engraver|Pitched_trill_engraver|Pitch_squash_engraver|Piano_pedal_performer|Piano_pedal_engraver|Piano_pedal_align_engraver|PianoStaff|Phrasing_slur_engraver|PetrucciVoice|PetrucciStaff|Percent_repeat_engraver|Part_combine_engraver|Parenthesis_engraver|Paper_column_engraver|Output_property_engraver|Ottava_spanner_engraver|OneStaff|NullVoice|Note_spacing_engraver|Note_performer|Note_name_engraver|Note_heads_engraver|Note_head_line_engraver|NoteName\|NoteHead|New_fingering_engraver|Multi_measure_rest_engraver|Midi_control_function_performer|Metronome_mark_engraver|Mensural_ligature_engraver|MensuralVoice|MensuralStaff|Mark_engraver|Lyrics|Lyric_performer|Lyric_engraver|Ligature_bracket_engraver|Ledger_line_engraver|Laissez_vibrer_engraver|Kievan_ligature_engraver|KievanVoice|KievanStaff|Key_performer|Key_engraver|Keep_alive_together_engraver|Instrument_switch_engraver|Instrument_name_engraver|Hyphen_engraver|Grob_pq_engraver|GregorianTranscriptionVoice|GregorianTranscriptionStaff|GrandStaff|Grace_spacing_engraver|Grace_engraver|Grace_beam_engraver|Grace_auto_beam_engraver|Global|Glissando_engraver|Fretboard_engraver|FretBoards|Forbid_line_break_engraver|Footnote_engraver|Font_size_engraver|Fingering_engraver|Fingering_column_engraver|Figured_bass_position_engraver|Figured_bass_engraver|FiguredBass|Extender_engraver|Episema_engraver|Dynamics|Dynamic_performer|Dynamic_engraver|Dynamic_align_engraver|Drum_notes_engraver|Drum_note_performer|DrumVoice|DrumStaff|Double_percent_repeat_engraver|Dots_engraver|Dot_column_engraver|Devnull|Default_bar_line_engraver|Custos_engraver|Cue_clef_engraver|CueVoice|Control_track_performer|Concurrent_hairpin_engraver|Collision_engraver|Cluster_spanner_engraver|Clef_engraver|Chord_tremolo_engraver|Chord_name_engraver|ChordNames|ChoirStaff|Breathing_sign_engraver|Break_align_engraver|Bend_engraver|Beam_performer|Beam_engraver|Beam_collision_engraver|Bar_number_engraver|Bar_engraver|Axis_group_engraver|Auto_beam_engraver|Arpeggio_engraver|Accidental_engraver|Score)[[:space:]]"
|
||||
color statement "[-_^]?\\[-A-Za-z_]+"
|
||||
color preproc "\b(((gisis|gis|geses|ges|g|fisis|fis|feses|fes|f|eisis|eis|eeses|ees|e|disis|dis|deses|des|d|cisis|cis|ceses|ces|c|bisis|bis|beses|bes|b|aisis|ais|aeses|aes|a)[,']*[?!]?)|s|r|R|q)(128|64|32|16|8|4|2|1|\\breve|\\longa|\\maxima)?([^\\\w]|_|\b)"
|
||||
color special "[(){}<>]" "\[" "\]"
|
||||
color constant.string "\".*\""
|
||||
color comment start="%{" end="%}"
|
||||
color comment "%.*$"
|
||||
24
runtime/syntax/lilypond.yaml
Normal file
24
runtime/syntax/lilypond.yaml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
filetype: lilypond
|
||||
|
||||
detect:
|
||||
filename: "\\.ly$|\\.ily$|\\.lly$"
|
||||
|
||||
rules:
|
||||
- constant.number: "\\d+"
|
||||
- identifier: "\\b(staff|spacing|signature|routine|notes|handler|corrected|beams|arpeggios|Volta_engraver|Voice|Vertical_align_engraver|Vaticana_ligature_engraver|VaticanaVoice|VaticanaStaff|Tweak_engraver|Tuplet_engraver|Trill_spanner_engraver|Timing_translator|Time_signature_performer|Time_signature_engraver|Tie_performer|Tie_engraver|Text_spanner_engraver|Text_engraver|Tempo_performer|Tab_tie_follow_engraver|Tab_staff_symbol_engraver|Tab_note_heads_engraver|TabVoice|TabStaff|System_start_delimiter_engraver|Stem_engraver|Stanza_number_engraver|Stanza_number_align_engraver|Staff_symbol_engraver|Staff_performer|Staff_collecting_engraver|StaffGroup|Staff|Spanner_break_forbid_engraver|Span_bar_stub_engraver|Span_bar_engraver|Span_arpeggio_engraver|Spacing_engraver|Slur_performer|Slur_engraver|Slash_repeat_engraver|Separating_line_group_engraver|Script_row_engraver|Script_engraver|Script_column_engraver|Score|Rhythmic_column_engraver|RhythmicStaff|Rest_engraver|Rest_collision_engraver|Repeat_tie_engraver|Repeat_acknowledge_engraver|Pure_from_neighbor_engraver|Pitched_trill_engraver|Pitch_squash_engraver|Piano_pedal_performer|Piano_pedal_engraver|Piano_pedal_align_engraver|PianoStaff|Phrasing_slur_engraver|PetrucciVoice|PetrucciStaff|Percent_repeat_engraver|Part_combine_engraver|Parenthesis_engraver|Paper_column_engraver|Output_property_engraver|Ottava_spanner_engraver|OneStaff|NullVoice|Note_spacing_engraver|Note_performer|Note_name_engraver|Note_heads_engraver|Note_head_line_engraver|NoteName\\|NoteHead|New_fingering_engraver|Multi_measure_rest_engraver|Midi_control_function_performer|Metronome_mark_engraver|Mensural_ligature_engraver|MensuralVoice|MensuralStaff|Mark_engraver|Lyrics|Lyric_performer|Lyric_engraver|Ligature_bracket_engraver|Ledger_line_engraver|Laissez_vibrer_engraver|Kievan_ligature_engraver|KievanVoice|KievanStaff|Key_performer|Key_engraver|Keep_alive_together_engraver|Instrument_switch_engraver|Instrument_name_engraver|Hyphen_engraver|Grob_pq_engraver|GregorianTranscriptionVoice|GregorianTranscriptionStaff|GrandStaff|Grace_spacing_engraver|Grace_engraver|Grace_beam_engraver|Grace_auto_beam_engraver|Global|Glissando_engraver|Fretboard_engraver|FretBoards|Forbid_line_break_engraver|Footnote_engraver|Font_size_engraver|Fingering_engraver|Fingering_column_engraver|Figured_bass_position_engraver|Figured_bass_engraver|FiguredBass|Extender_engraver|Episema_engraver|Dynamics|Dynamic_performer|Dynamic_engraver|Dynamic_align_engraver|Drum_notes_engraver|Drum_note_performer|DrumVoice|DrumStaff|Double_percent_repeat_engraver|Dots_engraver|Dot_column_engraver|Devnull|Default_bar_line_engraver|Custos_engraver|Cue_clef_engraver|CueVoice|Control_track_performer|Concurrent_hairpin_engraver|Collision_engraver|Cluster_spanner_engraver|Clef_engraver|Chord_tremolo_engraver|Chord_name_engraver|ChordNames|ChoirStaff|Breathing_sign_engraver|Break_align_engraver|Bend_engraver|Beam_performer|Beam_engraver|Beam_collision_engraver|Bar_number_engraver|Bar_engraver|Axis_group_engraver|Auto_beam_engraver|Arpeggio_engraver|Accidental_engraver|Score)\\b"
|
||||
- statement: "[-_^]?\\\\[-A-Za-z_]+"
|
||||
- preproc: "\\b(((gisis|gis|geses|ges|g|fisis|fis|feses|fes|f|eisis|eis|eeses|ees|e|disis|dis|deses|des|d|cisis|cis|ceses|ces|c|bisis|bis|beses|bes|b|aisis|ais|aeses|aes|a)[,']*[?!]?)|s|r|R|q)(128|64|32|16|8|4|2|1|\\\\breve|\\\\longa|\\\\maxima)?([^\\\\\\w]|_|\\b)"
|
||||
- special: "[(){}<>]|\\[|\\]"
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- comment:
|
||||
start: "%\\{"
|
||||
end: "%\\}"
|
||||
rules: []
|
||||
- comment:
|
||||
start: "%"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
syntax "lisp" "(emacs|zile)$" "\.(el|li?sp|scm|ss)$"
|
||||
|
||||
color brightblue "\([a-z-]+"
|
||||
color red "\(([-+*/<>]|<=|>=)|'"
|
||||
color blue "\<[0-9]+\>"
|
||||
cyan (i) "\<nil\>"
|
||||
color brightcyan "\<[tT]\>"
|
||||
color yellow "\"(\\.|[^"])*\""
|
||||
color magenta "'[A-Za-z][A-Za-z0-9_-]+"
|
||||
color magenta "\\.?"
|
||||
color brightblack "(^|[[:space:]]);.*"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
##############################################################################
|
||||
#
|
||||
# Lua syntax highlighting for Micro.
|
||||
#
|
||||
# Author: Matthew Wild <mwild1 (at) gmail.com>
|
||||
# License: GPL 2 or later
|
||||
#
|
||||
# Version: 2007-06-06
|
||||
#
|
||||
# Notes: Originally based on Ruby syntax rc by Josef 'Jupp' Schugt
|
||||
##############################################################################
|
||||
|
||||
|
||||
# Automatically use for '.lua' files
|
||||
syntax "lua" ".*\.lua$"
|
||||
|
||||
# Statements
|
||||
color statement "\b(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return)\b"
|
||||
|
||||
# Logic
|
||||
color statement "\b(not|and|or)\b"
|
||||
|
||||
# Keywords
|
||||
color statement "\b(debug|string|math|table|io|coroutine|os|utf8|bit32)\b\."
|
||||
color statement "\b(_ENV|_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\s*\("
|
||||
|
||||
# Standard library
|
||||
color identifier "io\.\b(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)\b"
|
||||
color identifier "math\.\b(abs|acos|asin|atan2|atan|ceil|cosh|cos|deg|exp|floor|fmod|frexp|huge|ldexp|log10|log|max|maxinteger|min|mininteger|modf|pi|pow|rad|random|randomseed|sinh|sqrt|tan|tointeger|type|ult)\b"
|
||||
color identifier "os\.\b(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)\b"
|
||||
color identifier "package\.\b(config|cpath|loaded|loadlib|path|preload|seeall|searchers|searchpath)\b"
|
||||
color identifier "string\.\b(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\b"
|
||||
color identifier "table\.\b(concat|insert|maxn|move|pack|remove|sort|unpack)\b"
|
||||
color identifier "utf8\.\b(char|charpattern|codes|codepoint|len|offset)\b"
|
||||
color identifier "coroutine\.\b(create|isyieldable|resume|running|status|wrap|yield)\b"
|
||||
color identifier "debug\.\b(debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|setfenv|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin)\b"
|
||||
color identifier "bit32\.\b(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)\b"
|
||||
|
||||
# File handle methods
|
||||
color identifier "\:\b(close|flush|lines|read|seek|setvbuf|write)\b"
|
||||
|
||||
# false, nil, true
|
||||
color constant "\b(false|nil|true)\b"
|
||||
|
||||
# External files
|
||||
color statement "(\b(dofile|require|include)|%q|%!|%Q|%r|%x)\b"
|
||||
|
||||
# Numbers
|
||||
color constant.number "\b([0-9]+)\b"
|
||||
|
||||
# Symbols
|
||||
color symbol "(\(|\)|\[|\]|\{|\}|\*\*|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.)"
|
||||
|
||||
# Strings
|
||||
color constant.string "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
|
||||
|
||||
# Multiline strings
|
||||
color constant start="\s*\[\[" end="\]\]"
|
||||
|
||||
# Escapes
|
||||
color special "\\[0-7][0-7][0-7]|\\x[0-9a-fA-F][0-9a-fA-F]|\\[abefnrs]|(\\c|\\C-|\\M-|\\M-\\C-)."
|
||||
|
||||
# Shebang
|
||||
color comment "^#!.*"
|
||||
|
||||
# Simple brightblacks
|
||||
color comment "\-\-.*$"
|
||||
|
||||
# Multiline brightblacks
|
||||
color comment start="\s*\-\-\s*\[\[" end="\]\]"
|
||||
|
||||
60
runtime/syntax/lua.yaml
Normal file
60
runtime/syntax/lua.yaml
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
filetype: lua
|
||||
|
||||
detect:
|
||||
filename: "\\.lua$"
|
||||
|
||||
rules:
|
||||
- statement: "\\b(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return)\\b"
|
||||
- statement: "\\b(not|and|or)\\b"
|
||||
- statement: "\\b(debug|string|math|table|io|coroutine|os|utf8|bit32)\\b\\."
|
||||
- statement: "\\b(_ENV|_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\s*\\("
|
||||
- identifier: "io\\.\\b(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)\\b"
|
||||
- identifier: "math\\.\\b(abs|acos|asin|atan2|atan|ceil|cosh|cos|deg|exp|floor|fmod|frexp|huge|ldexp|log10|log|max|maxinteger|min|mininteger|modf|pi|pow|rad|random|randomseed|sinh|sqrt|tan|tointeger|type|ult)\\b"
|
||||
- identifier: "os\\.\\b(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)\\b"
|
||||
- identifier: "package\\.\\b(config|cpath|loaded|loadlib|path|preload|seeall|searchers|searchpath)\\b"
|
||||
- identifier: "string\\.\\b(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\\b"
|
||||
- identifier: "table\\.\\b(concat|insert|maxn|move|pack|remove|sort|unpack)\\b"
|
||||
- identifier: "utf8\\.\\b(char|charpattern|codes|codepoint|len|offset)\\b"
|
||||
- identifier: "coroutine\\.\\b(create|isyieldable|resume|running|status|wrap|yield)\\b"
|
||||
- identifier: "debug\\.\\b(debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|setfenv|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin)\\b"
|
||||
- identifier: "bit32\\.\\b(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)\\b"
|
||||
- identifier: "\\:\\b(close|flush|lines|read|seek|setvbuf|write)\\b"
|
||||
- constant: "\\b(false|nil|true)\\b"
|
||||
- statement: "(\\b(dofile|require|include)|%q|%!|%Q|%r|%x)\\b"
|
||||
- constant.number: "\\b([0-9]+)\\b"
|
||||
- symbol: "(\\(|\\)|\\[|\\]|\\{|\\}|\\*\\*|\\*|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|\\.\\.)"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "\\[\\["
|
||||
end: "\\]\\]"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- special: "\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]|\\\\[abefnrs]|(\\\\c|\\\\C-|\\\\M-|\\\\M-\\\\C-)."
|
||||
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "\\-\\-"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "\\-\\-\\[\\["
|
||||
end: "\\]\\]"
|
||||
rules: []
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
syntax "mail" "(.*/mutt-.*|\.eml)$"
|
||||
header "^From .* \d+:\d+:\d+ \d+"
|
||||
|
||||
color yellow "^From .*"
|
||||
color identifier "^[^[:space:]]+:"
|
||||
color preproc "^List-(Id|Archive|Subscribe|Unsubscribe|Post|Help):"
|
||||
color constant "^(To|From):"
|
||||
color constant.string "^Subject:.*"
|
||||
color statement "<?[^@[:space:]]+@[^[:space:]]+>?"
|
||||
|
||||
color default start="^\n\n" end=".*"
|
||||
|
||||
color comment "^>.*$"
|
||||
25
runtime/syntax/mail.yaml
Normal file
25
runtime/syntax/mail.yaml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
filetype: mail
|
||||
|
||||
detect:
|
||||
filename: "(.*/mutt-.*|\\.eml)$"
|
||||
header: "^From .* \\d+:\\d+:\\d+ \\d+"
|
||||
|
||||
rules:
|
||||
- type: "^From .*"
|
||||
- identifier: "^[^[:space:]]+:"
|
||||
- preproc: "^List-(Id|Archive|Subscribe|Unsubscribe|Post|Help):"
|
||||
- constant: "^(To|From):"
|
||||
- constant.string:
|
||||
start: "^Subject:.*"
|
||||
end: "$"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- statement: "<?[^@[:space:]]+@[^[:space:]]+>?"
|
||||
- default:
|
||||
start: "^\\n\\n"
|
||||
end: ".*"
|
||||
rules: []
|
||||
- comment:
|
||||
start: "^>.*"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
syntax "makefile" "([Mm]akefile|\.ma?k)$"
|
||||
header "^#!.*/(env +)?[bg]?make( |$)"
|
||||
|
||||
color preproc "\<(ifeq|ifdef|ifneq|ifndef|else|endif)\>"
|
||||
color statement "^(export|include|override)\>"
|
||||
color operator "^[^:= ]+:"
|
||||
color operator "[=,%]" "\+=|\?=|:=|&&|\|\|"
|
||||
color statement "\$\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]"
|
||||
color statement "\$\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]"
|
||||
color statement "\$\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]"
|
||||
color statement "\$\((origin|patsubst|realpath|shell|sort|strip|suffix)[[:space:]]"
|
||||
color statement "\$\((value|warning|wildcard|word|wordlist|words)[[:space:]]"
|
||||
color identifier "^.+:"
|
||||
color identifier "[()$]"
|
||||
color constant ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color identifier "\$+(\{[^} ]+\}|\([^) ]+\))"
|
||||
color identifier "\$[@^<*?%|+]|\$\([@^<*?%+-][DF]\)"
|
||||
color identifier "\$\$|\\.?"
|
||||
color comment "(^|[[:space:]])#([^{].*)?$"
|
||||
color comment "^ @#.*"
|
||||
35
runtime/syntax/makefile.yaml
Normal file
35
runtime/syntax/makefile.yaml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
filetype: makefile
|
||||
|
||||
detect:
|
||||
filename: "([Mm]akefile|\\.ma?k)$"
|
||||
header: "^#!.*/(env +)?[bg]?make( |$)"
|
||||
|
||||
rules:
|
||||
- preproc: "\\<(ifeq|ifdef|ifneq|ifndef|else|endif)\\>"
|
||||
- statement: "^(export|include|override)\\>"
|
||||
- operator: "^[^:= ]+:"
|
||||
- operator: "([=,%]|\\+=|\\?=|:=|&&|\\|\\|)"
|
||||
- statement: "\\$\\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]"
|
||||
- statement: "\\$\\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]"
|
||||
- statement: "\\$\\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]"
|
||||
- statement: "\\$\\((origin|patsubst|realpath|shell|sort|strip|suffix)[[:space:]]"
|
||||
- statement: "\\$\\((value|warning|wildcard|word|wordlist|words)[[:space:]]"
|
||||
- identifier: "^.+:"
|
||||
- identifier: "[()$]"
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.string:
|
||||
start: "'"
|
||||
end: "'"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- identifier: "\\$+(\\{[^} ]+\\}|\\([^) ]+\\))"
|
||||
- identifier: "\\$[@^<*?%|+]|\\$\\([@^<*?%+-][DF]\\)"
|
||||
- identifier: "\\$\\$|\\\\.?"
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
## Here is an example for manpages.
|
||||
##
|
||||
syntax "man" "\.[1-9]x?$"
|
||||
color green "\.(S|T)H.*$"
|
||||
color brightgreen "\.(S|T)H" "\.TP"
|
||||
color brightred "\.(BR?|I[PR]?).*$"
|
||||
color brightblue "\.(BR?|I[PR]?|PP)"
|
||||
color brightwhite "\\f[BIPR]"
|
||||
color yellow "\.(br|DS|RS|RE|PD)"
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
syntax "markdown" "\.(md|mkd|mkdn|markdown)$"
|
||||
|
||||
# Tables (Github extension)
|
||||
color type ".*[ :]\|[ :].*"
|
||||
|
||||
# quotes
|
||||
color statement "^>.*"
|
||||
|
||||
# Emphasis
|
||||
color type "(^|[[:space:]])(_[^ ][^_]*_|\*[^ ][^*]*\*)"
|
||||
|
||||
# Strong emphasis
|
||||
color type "(^|[[:space:]])(__[^ ][^_]*__|\*\*[^ ][^*]*\*\*)"
|
||||
|
||||
# strike-through
|
||||
color type "(^|[[:space:]])~~[^ ][^~]*~~"
|
||||
|
||||
# horizontal rules
|
||||
color special "^(---+|===+|___+|\*\*\*+)\s*$"
|
||||
|
||||
# headlines
|
||||
color special "^#{1,6}.*"
|
||||
|
||||
# lists
|
||||
color identifier "^[[:space:]]*[\*+-] |^[[:space:]]*[0-9]+\. "
|
||||
|
||||
# misc
|
||||
color preproc "\(([CcRr]|[Tt][Mm])\)" "\.{3}" "(^|[[:space:]])\-\-($|[[:space:]])"
|
||||
|
||||
# links
|
||||
color constant "\[[^]]+\]"
|
||||
color constant "\[([^][]|\[[^]]*\])*\]\([^)]+\)"
|
||||
|
||||
# images
|
||||
color underlined "!\[[^][]*\](\([^)]+\)|\[[^]]+\])"
|
||||
|
||||
# urls
|
||||
color underlined "https?://[^ )>]+"
|
||||
|
||||
# code
|
||||
color special "`.*?`|^ {4}[^-+*].*"
|
||||
# code blocks
|
||||
color special "^```$"
|
||||
|
||||
49
runtime/syntax/markdown.yaml
Normal file
49
runtime/syntax/markdown.yaml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
filetype: markdown
|
||||
|
||||
detect:
|
||||
filename: "\\.(md|mkd|mkdn|markdown)$"
|
||||
|
||||
rules:
|
||||
# Tables (Github extension)
|
||||
- type: ".*[ :]\\|[ :].*"
|
||||
|
||||
# quotes
|
||||
- statement: "^>.*"
|
||||
|
||||
# Emphasis
|
||||
- type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)"
|
||||
|
||||
# Strong emphasis
|
||||
- type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)"
|
||||
|
||||
# strike-through
|
||||
- type: "(^|[[:space:]])~~[^ ][^~]*~~"
|
||||
|
||||
# horizontal rules
|
||||
- special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$"
|
||||
|
||||
# headlines
|
||||
- special: "^#{1,6}.*"
|
||||
|
||||
# lists
|
||||
- identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
|
||||
|
||||
# misc
|
||||
- preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
|
||||
|
||||
# links
|
||||
- constant: "\\[[^]]+\\]"
|
||||
- constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)"
|
||||
|
||||
# images
|
||||
- underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])"
|
||||
|
||||
# urls
|
||||
- underlined: "https?://[^ )>]+"
|
||||
|
||||
- special: "^```$"
|
||||
|
||||
- special:
|
||||
start: "`"
|
||||
end: "`"
|
||||
rules: []
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# Micro syntax by <nickolay02@inbox.ru>
|
||||
syntax "micro" "\.(micro)$"
|
||||
|
||||
color statement "\b(syntax|color(-link)?)\b"
|
||||
color statement "\b(start=|end=)\b"
|
||||
color identifier "\b(default|comment|symbol|identifier|constant(.string(.char)?|.number)?|statement|preproc|type|special|underlined|error|todo|statusline|indent-char|(current-)?line-number|gutter-error|gutter-warning|cursor-line|color-column)\b"
|
||||
color constant.number "\b(|h|A|0x)+[0-9]+(|h|A)+\b"
|
||||
color constant.number "\b0x[0-9 a-f A-F]+\b"
|
||||
|
||||
color comment "#.*$"
|
||||
|
||||
color constant.string ""(\\.|[^"])*""
|
||||
color constant.number "#[0-9 A-F a-f]+"
|
||||
22
runtime/syntax/micro.yaml
Normal file
22
runtime/syntax/micro.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
filetype: micro
|
||||
|
||||
detect:
|
||||
filename: "\\.(micro)$"
|
||||
|
||||
rules:
|
||||
- statement: "\\b(syntax|color(-link)?)\\b"
|
||||
- statement: "\\b(start=|end=)\\b"
|
||||
- identifier: "\\b(default|comment|symbol|identifier|constant(.string(.char)?|.number)?|statement|preproc|type|special|underlined|error|todo|statusline|indent-char|(current-)?line-number|gutter-error|gutter-warning|cursor-line|color-column)\\b"
|
||||
- constant.number: "\\b(|h|A|0x)+[0-9]+(|h|A)+\\b"
|
||||
- constant.number: "\\b0x[0-9 a-f A-F]+\\b"
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
- constant.number: "#[0-9 A-F a-f]+"
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
syntax "mpd" "mpd\.conf$"
|
||||
|
||||
color cyan "\<(user|group|bind_to_address|host|port|plugin|name|type)\>"
|
||||
color cyan "\<((music|playlist)_directory|(db|log|state|pid|sticker)_file)\>"
|
||||
color brightmagenta "^(input|audio_output|decoder)[[:space:]]*\{|\}"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
## Here is an example for nanorc files.
|
||||
##
|
||||
syntax "nanorc" "\.?nanorc$"
|
||||
## Possible errors and parameters
|
||||
brightwhite (i) "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
|
||||
## Keywords
|
||||
brightgreen (i) "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|preserve|punct)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds)\>"
|
||||
green (i) "^[[:space:]]*(set|unset|include|syntax|header)\>"
|
||||
## Colors
|
||||
yellow (i) "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
|
||||
magenta (i) "^[[:space:]]*i?color\>" "\<(start|end)="
|
||||
## Strings
|
||||
white (i) ""(\\.|[^"])*""
|
||||
## Comments
|
||||
brightblue (i) "^[[:space:]]*#.*$"
|
||||
cyan (i) "^[[:space:]]*##.*$"
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
syntax "nginx" "nginx.*\.conf$" "\.nginx$"
|
||||
header "^(server|upstream)[a-z ]*\{$"
|
||||
|
||||
color brightmagenta "\<(events|server|http|location|upstream)[[:space:]]*\{"
|
||||
color cyan "(^|[[:space:]{;])(access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth_basic|auth_basic_user_file|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|default_type|deny|directio|directio_alignment|disable_symlinks|empty_gif|env|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|log_format|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|port_in_redirect|postpone_output|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_header|proxy_read_timeout|proxy_redirect|proxy_send_timeout|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|working_directory|xml_entities|xslt_stylesheet|xslt_types)([[:space:]]|$)"
|
||||
color brightcyan "\<(on|off)\>"
|
||||
color brightyellow "\$[A-Za-z][A-Za-z0-9_]*"
|
||||
color red "[*]"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color yellow start="'$" end="';$"
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
syntax "nim" "\.nim$"
|
||||
|
||||
color preproc "[\{\|]\b(atom|lit|sym|ident|call|lvalue|sideeffect|nosideeffect|param|genericparam|module|type|let|var|const|result|proc|method|iterator|converter|macro|template|field|enumfield|forvar|label|nk[a-zA-Z]+|alias|noalias)\b[\}\|]"
|
||||
|
||||
color statement "\b(addr|and|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|div|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|in|include|interface|is|isnot|iterator|let|macro|method|mixin|mod|nil|not|notin|object|of|or|out|proc|ptr|raise|ref|return|shl|shr|static|template|try|tuple|type|using|var|when|while|with|without|xor|yield)\b"
|
||||
color statement "\b(deprecated|noSideEffect|constructor|destructor|override|procvar|compileTime|noReturn|acyclic|final|shallow|pure|asmNoStackFrame|error|fatal|warning|hint|line|linearScanEnd|computedGoto|unroll|immediate|checks|boundsChecks|overflowChecks|nilChecks|assertations|warnings|hints|optimization|patterns|callconv|push|pop|global|pragma|experimental|bitsize|volatile|noDecl|header|incompleteStruct|compile|link|passC|passL|emit|importc|importcpp|importobjc|codegenDecl|injectStmt|intdefine|strdefine|varargs|exportc|extern|bycopy|byref|union|packed|unchecked|dynlib|cdecl|thread|gcsafe|threadvar|guard|locks|compileTime)\b"
|
||||
color statement "[=\+\-\*/<>@\$~&%\|!\?\^\.:\\]+"
|
||||
|
||||
color special "\{\." "\.\}" "\[\." "\.\]" "\(\." "\.\)" ";" "," "`"
|
||||
|
||||
color statement "\.\."
|
||||
|
||||
color type "\b(int|cint|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float|float32|float64|bool|char|enum|string|cstring|array|openarray|seq|varargs|tuple|object|set|void|auto|cshort|range|nil|T|untyped|typedesc)\b"
|
||||
|
||||
color type "'[iI](8|16|32|64)?\b" "'[uU](8|16|32|64)?\b" "'[fF](32|64|128)?\b" "'[dD]\b"
|
||||
|
||||
color constant.number "\b[0-9]+\b"
|
||||
color constant.number "\b0[xX][0-9A-Fa-f][0-9_A-Fa-f]+\b"
|
||||
color constant.number "\b0[ocC][0-7][0-7_]+\b"
|
||||
color constant.number "\b0[bB][01][01_]+\b"
|
||||
color constant.number "\b[0-9_]((\.?)[0-9_]+)?[eE][+\-][0-9][0-9_]+\b"
|
||||
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
|
||||
color comment "[[:space:]]*#.*$"
|
||||
color comment start="\#\[" end="\]\#"
|
||||
|
||||
color todo "(TODO|FIXME|XXX):?"
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
## Here is an example for Obj-C.
|
||||
##
|
||||
syntax "Objective-C" "\.(m|mm|h)$"
|
||||
|
||||
color type "\b(float|double|CGFloat|id|bool|BOOL|Boolean|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline|Class|SEL|IMP|NS(U)?Integer)\b"
|
||||
color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
|
||||
color type "\b[A-Z][A-Z][[:alnum:]]*\b"
|
||||
color type "\b[A-Za-z0-9_]*_t\b"
|
||||
color type "\bdispatch_[a-zA-Z0-9_]*_t\b"
|
||||
|
||||
color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" "__unused" "_Nonnull" "_Nullable" "__block" "__builtin.*"
|
||||
color statement "\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\b"
|
||||
color statement "\b(for|if|while|do|else|case|default|switch)\b"
|
||||
color statement "\b(try|throw|catch|operator|new|delete)\b"
|
||||
color statement "\b(goto|continue|break|return)\b"
|
||||
color statement "\b(nonatomic|atomic|readonly|readwrite|strong|weak|assign)\b"
|
||||
color statement "@(encode|end|interface|implementation|class|selector|protocol|synchronized|try|catch|finally|property|optional|required|import|autoreleasepool)"
|
||||
|
||||
color preproc "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma).*$"
|
||||
color preproc "__[A-Z0-9_]*__"
|
||||
|
||||
color special "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\"|<].*\/?[>|\"][[:space:]]*$"
|
||||
|
||||
color statement "[.:;,+*|=!\%\[\]]" "<" ">" "/" "-" "&"
|
||||
|
||||
color constant.number "\b(-?)?[0-9]+\b" "\b\[0-9]+\.[0-9]+\b" "\b0x[0-9A-F]+\b"
|
||||
color constant "@\[(\\.|[^\]])*\]" "@\{(\\.|[^\}])*\}" "@\((\\.|[^\)])*\)"
|
||||
color constant "\b<(\\.[^\>])*\>\b"
|
||||
color constant "\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\b"
|
||||
color constant "\bk[[:alnum]]*\b"
|
||||
color constant.string "\"(\\.|[^\"])*\"" "@\"(\\.|[^\"])*\"" "'.'"
|
||||
|
||||
|
||||
color comment "//.*"
|
||||
color comment start="/\*" end="\*/"
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue