init
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# ==============================================================================
|
||||
# Auth: Alex Celani
|
||||
# File: XXX.xx
|
||||
# Revn: MM-DD-YYYY 0.0
|
||||
# Func:
|
||||
#
|
||||
# TODO: create
|
||||
# ==============================================================================
|
||||
# CHANGE LOG
|
||||
# ------------------------------------------------------------------------------
|
||||
# MM-DD-YYYY: init
|
||||
#
|
||||
# ==============================================================================
|
||||
@@ -0,0 +1,13 @@
|
||||
% ==============================================================================
|
||||
% Auth: Alex Celani
|
||||
% File: XXX.xx
|
||||
% Revn: MM-DD-YYYY 0.0
|
||||
% Func:
|
||||
%
|
||||
% TODO: create
|
||||
% ==============================================================================
|
||||
% CHANGE LOG
|
||||
% ------------------------------------------------------------------------------
|
||||
% MM-DD-YYYY: init
|
||||
%
|
||||
% ==============================================================================
|
||||
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
===============================================================================
|
||||
Auth: Alex Celani
|
||||
File: XXX.py
|
||||
Revn: MM-DD-YYYY 0.0
|
||||
Func:
|
||||
|
||||
TODO: create
|
||||
===============================================================================
|
||||
CHANGE LOG
|
||||
-------------------------------------------------------------------------------
|
||||
MM-DD-YYYY: init
|
||||
|
||||
===============================================================================
|
||||
"""
|
||||
@@ -0,0 +1,13 @@
|
||||
// =============================================================================
|
||||
// Auth: Alex Celani
|
||||
// File: XXX.xx
|
||||
// Revn: MM-DD-YYYY 0.0
|
||||
// Func:
|
||||
//
|
||||
// TODO: create
|
||||
// =============================================================================
|
||||
// CHANGE LOG
|
||||
// -----------------------------------------------------------------------------
|
||||
// MM-DD-YYYY: init
|
||||
//
|
||||
// =============================================================================
|
||||
@@ -0,0 +1 @@
|
||||
au BufRead,BufNewFile *.ano set filetype=ano
|
||||
Executable
+135
@@ -0,0 +1,135 @@
|
||||
" ==============================================================================
|
||||
" Auth: David Daub <david.daub@googlemail.com>, Alex
|
||||
" Lang: GoLang
|
||||
" Revn: 15-11-2009 Official, 03-27-2020 1.4
|
||||
" Func: Define syntax coloring for .go files when being edited in Vim
|
||||
"
|
||||
" TODO: very much
|
||||
" learn regex
|
||||
" learn Go
|
||||
" ==============================================================================
|
||||
" CHANGE LOG
|
||||
" ------------------------------------------------------------------------------
|
||||
" 12-31-2018: init
|
||||
" 01-01-2019: added header block
|
||||
" added coloring for bool type
|
||||
" changed print/println to Print/Println, added Printf/Sprintf
|
||||
" changed boolean values link to Keyword (Yellow) from Boolean
|
||||
" (Green?)
|
||||
" 01-02-2019: added coloring for main and Scanln
|
||||
" 12-26-2019: changed goBoolean link from Keyword to Type
|
||||
" added coloring for error
|
||||
" 03-27-2020: added while to list of repetition structures
|
||||
"
|
||||
" ==============================================================================
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
" A bunch of useful Go keywords
|
||||
syn keyword goStatement select
|
||||
syn keyword goStatement defer
|
||||
syn keyword goStatement fallthrough range type
|
||||
syn keyword goStatement return
|
||||
|
||||
syn keyword goClause import package
|
||||
syn keyword goConditional if else switch
|
||||
syn keyword goBranch goto break continue
|
||||
syn keyword goLabel case default
|
||||
syn keyword goRepeat for
|
||||
syn keyword goRepeat while
|
||||
" Added this line ^^^
|
||||
syn keyword goType struct const interface func
|
||||
syn keyword goType var map
|
||||
syn keyword goType uint8 uint16 uint32 uint64
|
||||
syn keyword goType int8 int16 int32 int64
|
||||
syn keyword goType float32 float64
|
||||
syn keyword goType float32 float64
|
||||
syn keyword goType byte
|
||||
syn keyword goType uint int float uintptr string
|
||||
syn keyword goType bool
|
||||
" Added this line ^^^
|
||||
syn keyword goType error
|
||||
" Added this line ^^^
|
||||
|
||||
syn keyword goConcurrent chan go
|
||||
|
||||
syn keyword goValue nil
|
||||
syn keyword goBoolean true false
|
||||
|
||||
syn keyword goConstant iota
|
||||
|
||||
" Builtin functions
|
||||
syn keyword goBif len make new close closed cap map
|
||||
|
||||
" According to the language specification it is not garanteed to stay in the
|
||||
" language. See http://golang.org/doc/go_spec.html#Bootstrapping
|
||||
syn keyword goBif Print Println Printf Sprintf Scanln
|
||||
" Changed print[ln] to Print[ln] ^^^
|
||||
|
||||
syn keyword goBif panic panicln main
|
||||
|
||||
" Comments
|
||||
syn keyword goTodo contained TODO FIXME XXX
|
||||
syn match goLineComment "\/\/.*" contains=@Spell,goTodo
|
||||
syn match goCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
|
||||
syn region goComment start="/\*" end="\*/" contains=@Spell,goTodo
|
||||
|
||||
" Numerals
|
||||
syn case ignore
|
||||
"integer number, or floating point number without a dot and with "f".
|
||||
syn match goNumbers display transparent "\<\d\|\.\d" contains=goNumber,goFloat,goOctError,goOct
|
||||
syn match goNumbersCom display contained transparent "\<\d\|\.\d" contains=goNumber,goFloat,goOct
|
||||
syn match goNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
|
||||
" hex number
|
||||
syn match goNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
|
||||
" oct number
|
||||
syn match goOct display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=goOctZero
|
||||
syn match goOctZero display contained "\<0"
|
||||
|
||||
syn match goFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\="
|
||||
syn match goFloat display contained "\d\+e[-+]\=\d\=\>"
|
||||
syn match goFloat display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=\>"
|
||||
|
||||
" Literals
|
||||
syn region goString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
|
||||
|
||||
syn match goSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
|
||||
syn match goCharacter "L\='[^\\]'"
|
||||
syn match goCharacter "L'[^']*'" contains=goSpecial
|
||||
|
||||
|
||||
hi def link goStatement Statement
|
||||
hi def link goClause Preproc
|
||||
hi def link goConditional Conditional
|
||||
hi def link goBranch Conditional
|
||||
hi def link goLabel Label
|
||||
hi def link goRepeat Repeat
|
||||
hi def link goType Type
|
||||
hi def link goConcurrent Statement
|
||||
hi def link goValue Constant
|
||||
hi def link goBoolean Type
|
||||
" Changed goBoolean link from Boolean to Keyword
|
||||
" Changed goBoolean link from Keyword to Type
|
||||
hi def link goConstant Constant
|
||||
hi def link goBif Function
|
||||
hi def link goTodo Todo
|
||||
hi def link goLineComment goComment
|
||||
hi def link goComment Comment
|
||||
hi def link goNumbers Number
|
||||
hi def link goNumbersCom Number
|
||||
hi def link goNumber Number
|
||||
hi def link goFloat Float
|
||||
hi def link goOct Number
|
||||
hi def link goOctZero Number
|
||||
hi def link goString String
|
||||
hi def link goSpecial Special
|
||||
hi def link goCharacter Character
|
||||
|
||||
|
||||
let b:current_syntax = "go"
|
||||
@@ -0,0 +1 @@
|
||||
au BufRead,BufNewFile *.prv set filetype=prv
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
autocmd BufNewFile,BufRead *.txt set filetype=txt
|
||||
|
||||
|
||||
Executable
+231
@@ -0,0 +1,231 @@
|
||||
" ====================================================================
|
||||
" Auth: jontino
|
||||
" Lang: ANO
|
||||
" Revn: 04-17-2023 1.0
|
||||
" Func: Define syntax coloring for .ano files when being edited in Vim
|
||||
"
|
||||
" TODO: begin writing, add new words
|
||||
" implement regular expressions for match baby names
|
||||
" ====================================================================
|
||||
" CHANGE LOG
|
||||
" --------------------------------------------------------------------
|
||||
" 04-17-2023: copied from prv.vim
|
||||
"
|
||||
" ====================================================================
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
" Required fields
|
||||
" Comments
|
||||
" header comments # Green
|
||||
" single line comments // Cyan
|
||||
" in/multi line comments /* ... */ Cyan
|
||||
" Quotes
|
||||
" must work multiline
|
||||
" Gray? LightRed?
|
||||
" Names
|
||||
"
|
||||
|
||||
|
||||
|
||||
" XXX Dates:
|
||||
" Date highlighting for the Change Log
|
||||
" the first and last quote define the expression
|
||||
" \d is any digit [0-9]
|
||||
" \{1,2} matches 1 or 2 times, although it should only ever get 2
|
||||
" - literal hyphen, which seperates months, days, and years
|
||||
" The same three elements are repeated again for the days
|
||||
" \d is any digit, used again for the years
|
||||
" \{4} for only four digits can be matched
|
||||
" ends with : because only dates in change log should be highlighted
|
||||
" marked as contained, as it should only be highlighted in comments
|
||||
" contains colon, so I can highlight the color separately
|
||||
" for some reason, the colon doesn't work as keyword, so simple match
|
||||
syn match date "\d\{1,2}-\d\{1,2}-\d\{4}:" contained contains=colon
|
||||
syn match colon ":" contained
|
||||
|
||||
|
||||
|
||||
" XXX Comments:
|
||||
" comments come after #
|
||||
" eg| not comment # now a comment
|
||||
" # comment
|
||||
" not a comment
|
||||
" not
|
||||
" not
|
||||
" ### comment
|
||||
"
|
||||
" first and last quote define the expression
|
||||
" # can come literally, because it doesn't need escaping
|
||||
" . is every non-new line character possible
|
||||
" * matches as many matches as possible
|
||||
" i.e. a pound sign, and then as many characters as possible
|
||||
syn match header "#.*" contains=commentFields,commentTodo,date,names,germ,rus,latin,rusgerm
|
||||
syn match SLcomment "//.*" contains=names,germ,rus,latin,rusgerm
|
||||
syn region ILMLcomment start="/\*" end="\*/" contains=names,germ,rus,latin,rusgerm
|
||||
" commentFields and commentTodo are contained within comments, so they
|
||||
" are as such in the definition of a comment, and listed as contained
|
||||
" in their own definitions
|
||||
" commentFields is match instead of keyword, will contain the space
|
||||
syn keyword commentFields contained Auth Revn File Func
|
||||
syn keyword commentTodo contained TODO todo Todo XXX FIXME
|
||||
syn match commentFields contained "CHANGE LOG"
|
||||
|
||||
|
||||
|
||||
" XXX Quotes:
|
||||
" quotes should exist between odd pairs of quotation marks
|
||||
" eg| "quote" not
|
||||
" "quote" not "quote"
|
||||
" "not
|
||||
" quote"
|
||||
" "quote only if the it rolls
|
||||
" over onto the next line"
|
||||
" Calling the quotation a region instead of pattern match makes it
|
||||
" easier to wrap around a new line
|
||||
" the first and last quote define the expression
|
||||
" \ escapes the next character, allowing \" to appear as a literal "
|
||||
" thus, start and end are both quotes, and the reqion can span lines
|
||||
syn region quote start="\"" end="\"" contains=names,germ,rus,latin,rusgerm
|
||||
" -- DEPRECATED --
|
||||
" the first and last quote define the expression
|
||||
" \ is the escape character, so \" means I want to look for a quote
|
||||
" . is every non-new line character possible
|
||||
" \{,} is \{0,infinity}, means I'm looking for between 0 and infinity
|
||||
" matches for the previous character, which is a wildcard, .
|
||||
" \{-,} will prioritize the smallest amount of matches possible
|
||||
" syn match quote "\".\{-,}\""
|
||||
" -- DEPRECATED --
|
||||
|
||||
|
||||
|
||||
" XXX Notes:
|
||||
" Allow for notes to be left with special highlighting
|
||||
" \c escapes the case, so search is entirely case insensitive
|
||||
" note are all literals
|
||||
" s\? will alow for either 0 or 1 of the character "s" to be matched,
|
||||
" essentially allowing for both notes and note
|
||||
" finally followed by a colon
|
||||
" nextgroup is the actual notes to be taken, as this is just the tag
|
||||
syn match noteTag "\cnotes\?:" nextgroup=notes
|
||||
" define notes as starting with space, ending with exclamation mark
|
||||
" if it's not denoted as contained, then the whole damn thing will be
|
||||
" highlighted
|
||||
syn region notes start=" " end="!" contained
|
||||
|
||||
|
||||
|
||||
" XXX Names:
|
||||
" keyword to the whole list of words
|
||||
" lmfao ignore case sensitivity to avoid writing things twice
|
||||
syn case ignore
|
||||
|
||||
" nicknames for archie
|
||||
syn keyword ambiii archie chicho chach chibo
|
||||
syn keyword ambiii barchie chachfield archibald
|
||||
syn match ambiii "Lord Archibald Mordecai Blackanddecker III"
|
||||
|
||||
" nicknames for olly
|
||||
syn keyword obrg olly bolly boliver oliver ogibler oboe
|
||||
syn match obrg "bolly bear"
|
||||
syn match obrg "bolly ball"
|
||||
syn match obrg "olly ball"
|
||||
syn match obrg "Sir Oliver Boliver Rockford Gubbins"
|
||||
|
||||
" things that apply to both babies
|
||||
syn match both "of Sealand"
|
||||
syn match both "sink boy"
|
||||
syn match both "baby boy"
|
||||
|
||||
" us?
|
||||
syn keyword parents mom dad
|
||||
|
||||
syn case match
|
||||
" lmfao and turn the case sensitivity back on
|
||||
|
||||
|
||||
|
||||
|
||||
" keeping this as it might be useful later
|
||||
" XXX Expressions:
|
||||
" highlight equations, formulas, expressions, etc
|
||||
" expressions: .* is any number of characters
|
||||
" = is literal
|
||||
" .* is any number of characters again
|
||||
" added spaces around = to avoid confusion with =>
|
||||
"
|
||||
" the idea is that it's stuff that equals stuff, and we
|
||||
" worry about what it is later
|
||||
" name: \c case-escapes the sequence
|
||||
" \a is alphabetic characters, probably don't need escaping
|
||||
" \+ is at least 1 match, so it's 1 or more letters is a name
|
||||
" name: \c\a\= is 0 or 1 case-escaped alphabetic characters
|
||||
" _ is literal, best I can get to subscripts
|
||||
" \a\+ is 1 or more case-escaped alphabetic characters
|
||||
" op: inside [] can allow for one choice from any contained characters
|
||||
" =, +, -, /, ^ are all literals for operations
|
||||
" \* escapes the * character, which is now multiplication
|
||||
" Num: see Numbers: below
|
||||
" FIXME try to make name into one thing, probably with \{,1}
|
||||
|
||||
|
||||
" ColorGuide: ctermfg and ctermbg args - - - - source:: :help cterm
|
||||
" Black
|
||||
" LightBlue/Cyan/LightCyan, Blue/DarkBlue/DarkCyan
|
||||
" Green/LightGreen, DarkGreen
|
||||
" Red/LightRed, DarkRed
|
||||
" Magenta/LightMagenta, DarkMagenta
|
||||
" Yellow/LightYellow, DarkYellow/Brown
|
||||
" White
|
||||
" Gray/LightGray, DarkGray
|
||||
" ColorGuide: ctermfg and ctermbg args - - - - source:: :help cterm
|
||||
" ColorGuide: - - - - - - - - - - - - - - - source:: :help group-name
|
||||
" Dates and fields in comments still use links for highlighting to get
|
||||
" access to 'term' arguments that don't want to load correctly, namely
|
||||
" Underline -> PreProc (Magenta in default colo), with underline
|
||||
" ColorGuide: - - - - - - - - - - - - - - - source:: :help group-name
|
||||
|
||||
|
||||
" XXX Coloring:
|
||||
" hi[ghlight] <group> cterm=<style> ctermfg=<color> [ctermbg=<color>]
|
||||
" group is typically a user-made group
|
||||
" cterm is stuff like Underline and Bold
|
||||
" ctermfg is the foreground, or font color
|
||||
" ctermbg is the background color, or highlight color
|
||||
|
||||
" quotes are good
|
||||
hi quote ctermfg=DarkRed
|
||||
|
||||
" header comments are good
|
||||
hi header ctermfg=Green
|
||||
" leaving these as link because I like the color it sets
|
||||
" in theory... I could choose my own colors...
|
||||
"hi def link commentFields Underlined
|
||||
"hi def link date Underlined
|
||||
hi commentFields cterm=Underline ctermfg=Blue
|
||||
hi date cterm=Underline ctermfg=Blue
|
||||
|
||||
" comments are good
|
||||
hi SLcomment ctermfg=Cyan
|
||||
hi ILMLcomment ctermfg=Cyan
|
||||
hi colon ctermfg=Cyan
|
||||
hi commentTodo ctermfg=Black ctermbg=Yellow
|
||||
|
||||
" important notes
|
||||
" could probably do without this, tbh
|
||||
hi noteTag ctermfg=White ctermbg=Red
|
||||
hi notes ctermfg=White ctermbg=Red
|
||||
|
||||
" nicknames for the boys
|
||||
hi ambiii ctermfg=Green
|
||||
hi obrg ctermfg=Red
|
||||
" picked by archie himself
|
||||
hi both ctermfg=LightBlue
|
||||
hi parents ctermfg=DarkGray
|
||||
|
||||
let b:current_syntax = "ano"
|
||||
|
||||
Executable
+135
@@ -0,0 +1,135 @@
|
||||
" ==============================================================================
|
||||
" Auth: David Daub <david.daub@googlemail.com>, Alex
|
||||
" Lang: GoLang
|
||||
" Revn: 15-11-2009 Official, 03-27-2020 1.4
|
||||
" Func: Define syntax coloring for .go files when being edited in Vim
|
||||
"
|
||||
" TODO: very much
|
||||
" learn regex
|
||||
" learn Go
|
||||
" ==============================================================================
|
||||
" CHANGE LOG
|
||||
" ------------------------------------------------------------------------------
|
||||
" 12-31-2018: init
|
||||
" 01-01-2019: added header block
|
||||
" added coloring for bool type
|
||||
" changed print/println to Print/Println, added Printf/Sprintf
|
||||
" changed boolean values link to Keyword (Yellow) from Boolean
|
||||
" (Green?)
|
||||
" 01-02-2019: added coloring for main and Scanln
|
||||
" 12-26-2019: changed goBoolean link from Keyword to Type
|
||||
" added coloring for error
|
||||
" 03-27-2020: added while to list of repetition structures
|
||||
"
|
||||
" ==============================================================================
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
" A bunch of useful Go keywords
|
||||
syn keyword goStatement select
|
||||
syn keyword goStatement defer
|
||||
syn keyword goStatement fallthrough range type
|
||||
syn keyword goStatement return
|
||||
|
||||
syn keyword goClause import package
|
||||
syn keyword goConditional if else switch
|
||||
syn keyword goBranch goto break continue
|
||||
syn keyword goLabel case default
|
||||
syn keyword goRepeat for
|
||||
syn keyword goRepeat while
|
||||
" Added this line ^^^
|
||||
syn keyword goType struct const interface func
|
||||
syn keyword goType var map
|
||||
syn keyword goType uint8 uint16 uint32 uint64
|
||||
syn keyword goType int8 int16 int32 int64
|
||||
syn keyword goType float32 float64
|
||||
syn keyword goType float32 float64
|
||||
syn keyword goType byte
|
||||
syn keyword goType uint int float uintptr string
|
||||
syn keyword goType bool
|
||||
" Added this line ^^^
|
||||
syn keyword goType error
|
||||
" Added this line ^^^
|
||||
|
||||
syn keyword goConcurrent chan go
|
||||
|
||||
syn keyword goValue nil
|
||||
syn keyword goBoolean true false
|
||||
|
||||
syn keyword goConstant iota
|
||||
|
||||
" Builtin functions
|
||||
syn keyword goBif len make new close closed cap map
|
||||
|
||||
" According to the language specification it is not garanteed to stay in the
|
||||
" language. See http://golang.org/doc/go_spec.html#Bootstrapping
|
||||
syn keyword goBif Print Println Printf Sprintf Scanln
|
||||
" Changed print[ln] to Print[ln] ^^^
|
||||
|
||||
syn keyword goBif panic panicln main
|
||||
|
||||
" Comments
|
||||
syn keyword goTodo contained TODO FIXME XXX
|
||||
syn match goLineComment "\/\/.*" contains=@Spell,goTodo
|
||||
syn match goCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
|
||||
syn region goComment start="/\*" end="\*/" contains=@Spell,goTodo
|
||||
|
||||
" Numerals
|
||||
syn case ignore
|
||||
"integer number, or floating point number without a dot and with "f".
|
||||
syn match goNumbers display transparent "\<\d\|\.\d" contains=goNumber,goFloat,goOctError,goOct
|
||||
syn match goNumbersCom display contained transparent "\<\d\|\.\d" contains=goNumber,goFloat,goOct
|
||||
syn match goNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
|
||||
" hex number
|
||||
syn match goNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
|
||||
" oct number
|
||||
syn match goOct display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=goOctZero
|
||||
syn match goOctZero display contained "\<0"
|
||||
|
||||
syn match goFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\="
|
||||
syn match goFloat display contained "\d\+e[-+]\=\d\=\>"
|
||||
syn match goFloat display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=\>"
|
||||
|
||||
" Literals
|
||||
syn region goString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
|
||||
|
||||
syn match goSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
|
||||
syn match goCharacter "L\='[^\\]'"
|
||||
syn match goCharacter "L'[^']*'" contains=goSpecial
|
||||
|
||||
|
||||
hi def link goStatement Statement
|
||||
hi def link goClause Preproc
|
||||
hi def link goConditional Conditional
|
||||
hi def link goBranch Conditional
|
||||
hi def link goLabel Label
|
||||
hi def link goRepeat Repeat
|
||||
hi def link goType Type
|
||||
hi def link goConcurrent Statement
|
||||
hi def link goValue Constant
|
||||
hi def link goBoolean Type
|
||||
" Changed goBoolean link from Boolean to Keyword
|
||||
" Changed goBoolean link from Keyword to Type
|
||||
hi def link goConstant Constant
|
||||
hi def link goBif Function
|
||||
hi def link goTodo Todo
|
||||
hi def link goLineComment goComment
|
||||
hi def link goComment Comment
|
||||
hi def link goNumbers Number
|
||||
hi def link goNumbersCom Number
|
||||
hi def link goNumber Number
|
||||
hi def link goFloat Float
|
||||
hi def link goOct Number
|
||||
hi def link goOctZero Number
|
||||
hi def link goString String
|
||||
hi def link goSpecial Special
|
||||
hi def link goCharacter Character
|
||||
|
||||
|
||||
let b:current_syntax = "go"
|
||||
Executable
+283
@@ -0,0 +1,283 @@
|
||||
" ====================================================================
|
||||
" Auth: jontino
|
||||
" Lang: Providence
|
||||
" Revn: 04-17-2023 1.0
|
||||
" Func: Define syntax coloring for .prv files when being edited in Vim
|
||||
"
|
||||
" TODO: begin writing, add new words
|
||||
" ====================================================================
|
||||
" CHANGE LOG
|
||||
" --------------------------------------------------------------------
|
||||
" 02-13-2023: copied from txt.vim
|
||||
" 04-17-2023: completed
|
||||
"
|
||||
" ====================================================================
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
" Required fields
|
||||
" Comments
|
||||
" header comments # Green
|
||||
" single line comments // Cyan
|
||||
" in/multi line comments /* ... */ Cyan
|
||||
"
|
||||
" Quotes
|
||||
" must work multiline
|
||||
" Gray? LightRed?
|
||||
" Names
|
||||
" each type of character gets a different color
|
||||
" Good
|
||||
" Green
|
||||
" Evil
|
||||
" DarkRed
|
||||
" Neutral/Background
|
||||
" Blue
|
||||
" Places
|
||||
" Words
|
||||
" Latin-derived words
|
||||
" LightBlue
|
||||
" Germanic words
|
||||
" LightGreen
|
||||
" Russian words
|
||||
" Red
|
||||
" Russo-Germanic words
|
||||
" Brown
|
||||
"
|
||||
|
||||
|
||||
|
||||
" XXX Dates:
|
||||
" Date highlighting for the Change Log
|
||||
" the first and last quote define the expression
|
||||
" \d is any digit [0-9]
|
||||
" \{1,2} matches 1 or 2 times, although it should only ever get 2
|
||||
" - literal hyphen, which seperates months, days, and years
|
||||
" The same three elements are repeated again for the days
|
||||
" \d is any digit, used again for the years
|
||||
" \{4} for only four digits can be matched
|
||||
" ends with : because only dates in change log should be highlighted
|
||||
" marked as contained, as it should only be highlighted in comments
|
||||
" contains colon, so I can highlight the color separately
|
||||
" for some reason, the colon doesn't work as keyword, so simple match
|
||||
syn match date "\d\{1,2}-\d\{1,2}-\d\{4}:" contained contains=colon
|
||||
syn match colon ":" contained
|
||||
|
||||
|
||||
|
||||
" XXX Comments:
|
||||
" comments come after #
|
||||
" eg| not comment # now a comment
|
||||
" # comment
|
||||
" not a comment
|
||||
" not
|
||||
" not
|
||||
" ### comment
|
||||
"
|
||||
" first and last quote define the expression
|
||||
" # can come literally, because it doesn't need escaping
|
||||
" . is every non-new line character possible
|
||||
" * matches as many matches as possible
|
||||
" i.e. a pound sign, and then as many characters as possible
|
||||
syn match header "#.*" contains=commentFields,commentTodo,date,names,germ,rus,latin,rusgerm
|
||||
syn match SLcomment "//.*" contains=names,germ,rus,latin,rusgerm
|
||||
syn region ILMLcomment start="/\*" end="\*/" contains=names,germ,rus,latin,rusgerm
|
||||
" commentFields and commentTodo are contained within comments, so they
|
||||
" are as such in the definition of a comment, and listed as contained
|
||||
" in their own definitions
|
||||
" commentFields is match instead of keyword, will contain the space
|
||||
syn keyword commentFields contained Auth Revn File Func
|
||||
syn keyword commentTodo contained TODO todo Todo XXX FIXME
|
||||
syn match commentFields contained "CHANGE LOG"
|
||||
|
||||
|
||||
|
||||
" XXX Quotes:
|
||||
" quotes should exist between odd pairs of quotation marks
|
||||
" eg| "quote" not
|
||||
" "quote" not "quote"
|
||||
" "not
|
||||
" quote"
|
||||
" "quote only if the it rolls
|
||||
" over onto the next line"
|
||||
" Calling the quotation a region instead of pattern match makes it
|
||||
" easier to wrap around a new line
|
||||
" the first and last quote define the expression
|
||||
" \ escapes the next character, allowing \" to appear as a literal "
|
||||
" thus, start and end are both quotes, and the reqion can span lines
|
||||
syn region quote start="\"" end="\"" contains=names,germ,rus,latin,rusgerm
|
||||
" -- DEPRECATED --
|
||||
" the first and last quote define the expression
|
||||
" \ is the escape character, so \" means I want to look for a quote
|
||||
" . is every non-new line character possible
|
||||
" \{,} is \{0,infinity}, means I'm looking for between 0 and infinity
|
||||
" matches for the previous character, which is a wildcard, .
|
||||
" \{-,} will prioritize the smallest amount of matches possible
|
||||
" syn match quote "\".\{-,}\""
|
||||
" -- DEPRECATED --
|
||||
|
||||
|
||||
|
||||
" XXX Notes:
|
||||
" Allow for notes to be left with special highlighting
|
||||
" \c escapes the case, so search is entirely case insensitive
|
||||
" note are all literals
|
||||
" s\? will alow for either 0 or 1 of the character "s" to be matched,
|
||||
" essentially allowing for both notes and note
|
||||
" finally followed by a colon
|
||||
" nextgroup is the actual notes to be taken, as this is just the tag
|
||||
syn match noteTag "\cnotes\?:" nextgroup=notes
|
||||
" define notes as starting with space, ending with exclamation mark
|
||||
" if it's not denoted as contained, then the whole damn thing will be
|
||||
" highlighted
|
||||
syn region notes start=" " end="!" contained
|
||||
|
||||
|
||||
|
||||
" XXX Names:
|
||||
" Separated into three catergories: Good, Neutral, Bad
|
||||
" This taxonomy is pretty self-explanatory
|
||||
" keyword to the whole list of words
|
||||
" lmfao ignore case sensitivity to avoid writing things twice
|
||||
syn case ignore
|
||||
|
||||
syn keyword good dobra miro
|
||||
syn keyword neutral yaroslav
|
||||
syn keyword bad boris mstislav
|
||||
|
||||
|
||||
|
||||
" XXX Places:
|
||||
" Places! Just place names!
|
||||
" keyword to the whole list of words
|
||||
syn keyword place providence
|
||||
|
||||
|
||||
|
||||
" XXX Words:
|
||||
" Different types of words:
|
||||
" words referring to norway, russian, etc
|
||||
" Latin
|
||||
" Slavic
|
||||
" Germanic
|
||||
" Russo-Germanic
|
||||
|
||||
" Highlight norwegian shit green
|
||||
" Highlight Russian shit red
|
||||
|
||||
syn keyword latin constable
|
||||
|
||||
syn keyword slavic slava
|
||||
|
||||
syn keyword germanic reeve
|
||||
|
||||
syn keyword russogerm skazarktos
|
||||
|
||||
syn keyword norwegian nordic nordics
|
||||
syn keyword norwegian norse
|
||||
syn keyword norwegian norway
|
||||
syn keyword norwegian norge
|
||||
syn keyword norwegian norsk
|
||||
syn keyword norwegian norwegian norwegians
|
||||
|
||||
syn keyword russian russian russians
|
||||
syn keyword russian rusky ruskies
|
||||
syn keyword russian russia
|
||||
syn keyword russian slav slavs
|
||||
syn keyword russian slavic
|
||||
syn case match
|
||||
" lmfao and turn the case sensitivity back on
|
||||
|
||||
|
||||
|
||||
|
||||
" keeping this as it might be useful later
|
||||
" XXX Expressions:
|
||||
" highlight equations, formulas, expressions, etc
|
||||
" expressions: .* is any number of characters
|
||||
" = is literal
|
||||
" .* is any number of characters again
|
||||
" added spaces around = to avoid confusion with =>
|
||||
"
|
||||
" the idea is that it's stuff that equals stuff, and we
|
||||
" worry about what it is later
|
||||
" name: \c case-escapes the sequence
|
||||
" \a is alphabetic characters, probably don't need escaping
|
||||
" \+ is at least 1 match, so it's 1 or more letters is a name
|
||||
" name: \c\a\= is 0 or 1 case-escaped alphabetic characters
|
||||
" _ is literal, best I can get to subscripts
|
||||
" \a\+ is 1 or more case-escaped alphabetic characters
|
||||
" op: inside [] can allow for one choice from any contained characters
|
||||
" =, +, -, /, ^ are all literals for operations
|
||||
" \* escapes the * character, which is now multiplication
|
||||
" Num: see Numbers: below
|
||||
" FIXME try to make name into one thing, probably with \{,1}
|
||||
|
||||
|
||||
" ColorGuide: ctermfg and ctermbg args - - - - source:: :help cterm
|
||||
" Black
|
||||
" LightBlue/Cyan/LightCyan, Blue/DarkBlue/DarkCyan
|
||||
" Green/LightGreen, DarkGreen
|
||||
" Red/LightRed, DarkRed
|
||||
" Magenta/LightMagenta, DarkMagenta
|
||||
" Yellow/LightYellow, DarkYellow/Brown
|
||||
" White
|
||||
" Gray/LightGray, DarkGray
|
||||
" ColorGuide: ctermfg and ctermbg args - - - - source:: :help cterm
|
||||
" ColorGuide: - - - - - - - - - - - - - - - source:: :help group-name
|
||||
" Dates and fields in comments still use links for highlighting to get
|
||||
" access to 'term' arguments that don't want to load correctly, namely
|
||||
" Underline -> PreProc (Magenta in default colo), with underline
|
||||
" ColorGuide: - - - - - - - - - - - - - - - source:: :help group-name
|
||||
|
||||
|
||||
" XXX Coloring:
|
||||
" hi[ghlight] <group> cterm=<style> ctermfg=<color> [ctermbg=<color>]
|
||||
" group is typically a user-made group
|
||||
" cterm is stuff like Underline and Bold
|
||||
" ctermfg is the foreground, or font color
|
||||
" ctermbg is the background color, or highlight color
|
||||
|
||||
" quotes are good
|
||||
hi quote ctermfg=DarkRed
|
||||
|
||||
" header comments are good
|
||||
hi header ctermfg=Green
|
||||
" leaving these as link because I like the color it sets
|
||||
" in theory... I could choose my own colors...
|
||||
"hi def link commentFields Underlined
|
||||
"hi def link date Underlined
|
||||
hi commentFields cterm=Underline ctermfg=Red
|
||||
hi date cterm=Underline ctermfg=Red
|
||||
|
||||
" comments are good
|
||||
hi SLcomment ctermfg=Cyan
|
||||
hi ILMLcomment ctermfg=Cyan
|
||||
hi colon ctermfg=Cyan
|
||||
hi commentTodo ctermfg=Black ctermbg=Yellow
|
||||
|
||||
" important notes
|
||||
" could probably do without this, tbh
|
||||
hi noteTag ctermfg=White ctermbg=Red
|
||||
hi notes ctermfg=White ctermbg=Red
|
||||
|
||||
" different types of characters get different colors
|
||||
hi good ctermfg=Green
|
||||
hi neutral ctermfg=Blue
|
||||
hi bad ctermfg=DarkRed
|
||||
|
||||
" places are underlined
|
||||
" maybe give places a color?
|
||||
hi place ctermfg=White cterm=Underline
|
||||
|
||||
" color words in different registers different colors
|
||||
hi germanic ctermfg=LightGreen
|
||||
hi slavic ctermfg=Red
|
||||
hi latin ctermfg=LightBlue
|
||||
hi russogerm ctermfg=Brown
|
||||
|
||||
let b:current_syntax = "prv"
|
||||
|
||||
Executable
+385
@@ -0,0 +1,385 @@
|
||||
" Vim syntax file
|
||||
" Language: Rust
|
||||
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
||||
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Last Change: Feb 24, 2016
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Syntax definitions {{{1
|
||||
" Basic keywords {{{2
|
||||
syn keyword rustConditional match if else
|
||||
syn keyword rustRepeat loop while
|
||||
" `:syn match` must be used to prioritize highlighting `for` keyword.
|
||||
syn match rustRepeat /\<for\>/
|
||||
" Highlight `for` keyword in `impl ... for ... {}` statement. This line must
|
||||
" be put after previous `syn match` line to overwrite it.
|
||||
syn match rustKeyword /\%(\<impl\>.\+\)\@<=\<for\>/
|
||||
syn keyword rustRepeat in
|
||||
syn keyword rustTypedef type nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained
|
||||
syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion
|
||||
syn keyword rustOperator as
|
||||
syn keyword rustExistential existential nextgroup=rustTypedef skipwhite skipempty contained
|
||||
syn match rustExistentialContextual /\<existential\_s\+type/ transparent contains=rustExistential,rustTypedef
|
||||
|
||||
syn match rustAssert "\<assert\(\w\)*!" contained
|
||||
syn match rustPanic "\<panic\(\w\)*!" contained
|
||||
syn match rustAsync "\<async\%(\s\|\n\)\@="
|
||||
syn keyword rustKeyword break
|
||||
syn keyword rustKeyword box
|
||||
syn keyword rustKeyword continue
|
||||
syn keyword rustKeyword crate
|
||||
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
||||
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
||||
syn keyword rustKeyword impl let
|
||||
syn keyword rustKeyword macro
|
||||
syn keyword rustKeyword pub nextgroup=rustPubScope skipwhite skipempty
|
||||
syn keyword rustKeyword return
|
||||
syn keyword rustKeyword yield
|
||||
syn keyword rustSuper super
|
||||
syn keyword rustKeyword where
|
||||
syn keyword rustUnsafeKeyword unsafe
|
||||
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
|
||||
" FIXME: Scoped impl's name is also fallen in this category
|
||||
syn keyword rustKeyword mod trait nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustStorage move mut ref static const
|
||||
syn match rustDefault /\<default\ze\_s\+\(impl\|fn\|type\|const\)\>/
|
||||
syn keyword rustAwait await
|
||||
syn match rustKeyword /\<try\>!\@!/ display
|
||||
|
||||
syn keyword rustPubScopeCrate crate contained
|
||||
syn match rustPubScopeDelim /[()]/ contained
|
||||
syn match rustPubScope /([^()]*)/ contained contains=rustPubScopeDelim,rustPubScopeCrate,rustSuper,rustModPath,rustModPathSep,rustSelf transparent
|
||||
|
||||
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty
|
||||
" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
|
||||
syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator
|
||||
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
|
||||
|
||||
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
syn match rustFuncName "\%(r#\)\=\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
|
||||
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end="),\=[*+]" contains=TOP
|
||||
syn match rustMacroVariable "$\w\+"
|
||||
syn match rustRawIdent "\<r#\h\w*" contains=NONE
|
||||
|
||||
" Reserved (but not yet used) keywords {{{2
|
||||
syn keyword rustReservedKeyword become do priv typeof unsized abstract virtual final override
|
||||
|
||||
" Built-in types {{{2
|
||||
syn keyword rustType isize usize char bool u8 u16 u32 u64 u128 f32
|
||||
syn keyword rustType f64 i8 i16 i32 i64 i128 str Self
|
||||
|
||||
" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2
|
||||
" This section is just straight transformation of the contents of the prelude,
|
||||
" to make it easy to update.
|
||||
|
||||
" Reexported core operators {{{3
|
||||
syn keyword rustTrait Copy Send Sized Sync
|
||||
syn keyword rustTrait Drop Fn FnMut FnOnce
|
||||
|
||||
" Reexported functions {{{3
|
||||
" There’s no point in highlighting these; when one writes drop( or drop::< it
|
||||
" gets the same highlighting anyway, and if someone writes `let drop = …;` we
|
||||
" don’t really want *that* drop to be highlighted.
|
||||
"syn keyword rustFunction drop
|
||||
|
||||
" Reexported types and traits {{{3
|
||||
syn keyword rustTrait Box
|
||||
syn keyword rustTrait ToOwned
|
||||
syn keyword rustTrait Clone
|
||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
||||
syn keyword rustTrait AsRef AsMut Into From
|
||||
syn keyword rustTrait Default
|
||||
syn keyword rustTrait Iterator Extend IntoIterator
|
||||
syn keyword rustTrait DoubleEndedIterator ExactSizeIterator
|
||||
syn keyword rustEnum Option
|
||||
syn keyword rustEnumVariant Some None
|
||||
syn keyword rustEnum Result
|
||||
syn keyword rustEnumVariant Ok Err
|
||||
syn keyword rustTrait SliceConcatExt
|
||||
syn keyword rustTrait String ToString
|
||||
syn keyword rustTrait Vec
|
||||
|
||||
" Other syntax {{{2
|
||||
syn keyword rustSelf self
|
||||
syn keyword rustBoolean true false
|
||||
|
||||
" If foo::bar changes to foo.bar, change this ("::" to "\.").
|
||||
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
|
||||
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
|
||||
syn match rustModPathSep "::"
|
||||
|
||||
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
|
||||
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
|
||||
|
||||
" This is merely a convention; note also the use of [A-Z], restricting it to
|
||||
" latin identifiers rather than the full Unicode uppercase. I have not used
|
||||
" [:upper:] as it depends upon 'noignorecase'
|
||||
"syn match rustCapsIdent display "[A-Z]\w\(\w\)*"
|
||||
|
||||
syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?"
|
||||
" This one isn't *quite* right, as we could have binary-& with a reference
|
||||
syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
||||
syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
||||
" This isn't actually correct; a closure with no arguments can be `|| { }`.
|
||||
" Last, because the & in && isn't a sigil
|
||||
syn match rustOperator display "&&\|||"
|
||||
" This is rustArrowCharacter rather than rustArrow for the sake of matchparen,
|
||||
" so it skips the ->; see http://stackoverflow.com/a/30309949 for details.
|
||||
syn match rustArrowCharacter display "->"
|
||||
syn match rustQuestionMark display "?\([a-zA-Z]\+\)\@!"
|
||||
|
||||
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
|
||||
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
|
||||
|
||||
syn match rustEscapeError display contained /\\./
|
||||
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
|
||||
syn match rustEscapeUnicode display contained /\\u{\%(\x_*\)\{1,6}}/
|
||||
syn match rustStringContinuation display contained /\\\n\s*/
|
||||
syn region rustString matchgroup=rustStringDelimiter start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
|
||||
syn region rustString matchgroup=rustStringDelimiter start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
||||
syn region rustString matchgroup=rustStringDelimiter start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
||||
|
||||
" Match attributes with either arbitrary syntax or special highlighting for
|
||||
" derives. We still highlight strings and comments inside of the attribute.
|
||||
syn region rustAttribute start="#!\?\[" end="\]" contains=@rustAttributeContents,rustAttributeParenthesizedParens,rustAttributeParenthesizedCurly,rustAttributeParenthesizedBrackets,rustDerive
|
||||
syn region rustAttributeParenthesizedParens matchgroup=rustAttribute start="\w\%(\w\)*("rs=e end=")"re=s transparent contained contains=rustAttributeBalancedParens,@rustAttributeContents
|
||||
syn region rustAttributeParenthesizedCurly matchgroup=rustAttribute start="\w\%(\w\)*{"rs=e end="}"re=s transparent contained contains=rustAttributeBalancedCurly,@rustAttributeContents
|
||||
syn region rustAttributeParenthesizedBrackets matchgroup=rustAttribute start="\w\%(\w\)*\["rs=e end="\]"re=s transparent contained contains=rustAttributeBalancedBrackets,@rustAttributeContents
|
||||
syn region rustAttributeBalancedParens matchgroup=rustAttribute start="("rs=e end=")"re=s transparent contained contains=rustAttributeBalancedParens,@rustAttributeContents
|
||||
syn region rustAttributeBalancedCurly matchgroup=rustAttribute start="{"rs=e end="}"re=s transparent contained contains=rustAttributeBalancedCurly,@rustAttributeContents
|
||||
syn region rustAttributeBalancedBrackets matchgroup=rustAttribute start="\["rs=e end="\]"re=s transparent contained contains=rustAttributeBalancedBrackets,@rustAttributeContents
|
||||
syn cluster rustAttributeContents contains=rustString,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError
|
||||
syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait
|
||||
" This list comes from src/libsyntax/ext/deriving/mod.rs
|
||||
" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).
|
||||
syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy
|
||||
|
||||
" dyn keyword: It's only a keyword when used inside a type expression, so
|
||||
" we make effort here to highlight it only when Rust identifiers follow it
|
||||
" (not minding the case of pre-2018 Rust where a path starting with :: can
|
||||
" follow).
|
||||
"
|
||||
" This is so that uses of dyn variable names such as in 'let &dyn = &2'
|
||||
" and 'let dyn = 2' will not get highlighted as a keyword.
|
||||
syn match rustKeyword "\<dyn\ze\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)" contains=rustDynKeyword
|
||||
syn keyword rustDynKeyword dyn contained
|
||||
|
||||
" Number literals
|
||||
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
|
||||
" Special case for numbers of the form "1." which are float literals, unless followed by
|
||||
" an identifier, which makes them integer literals with a method call or field access,
|
||||
" or by another ".", which makes them integer literals followed by the ".." token.
|
||||
" (This must go first so the others take precedence.)
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
|
||||
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
|
||||
" a decimal point and more numbers; an exponent; and a type suffix.
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
|
||||
|
||||
" For the benefit of delimitMate
|
||||
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u{\%(\x_*\)\{1,6}}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
|
||||
syn region rustGenericRegion display start=/<\%('\|[^[:cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
|
||||
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
|
||||
|
||||
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
|
||||
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
|
||||
syn match rustLabel display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*:"
|
||||
syn match rustLabel display "\%(\<\%(break\|continue\)\s*\)\@<=\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
|
||||
syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
||||
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
|
||||
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
||||
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u{\%(\x_*\)\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
||||
|
||||
syn match rustShebang /\%^#![^[].*/
|
||||
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentLineDocError start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell contained
|
||||
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
|
||||
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,rustCommentBlockDocRustCode,@Spell
|
||||
syn region rustCommentBlockDocError matchgroup=rustCommentBlockDocError start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained
|
||||
syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent
|
||||
syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent
|
||||
syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained transparent
|
||||
|
||||
" FIXME: this is a really ugly and not fully correct implementation. Most
|
||||
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
|
||||
" a comment, but in practice at present it leaves comments open two levels
|
||||
" deep. But as long as you stay away from that particular case, I *believe*
|
||||
" the highlighting is correct. Due to the way Vim's syntax engine works
|
||||
" (greedy for start matches, unlike Rust's tokeniser which is searching for
|
||||
" the earliest-starting match, start or end), I believe this cannot be solved.
|
||||
" Oh you who would fix it, don't bother with things like duplicating the Block
|
||||
" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as
|
||||
" then you must deal with cases like ``/*/**/*/``. And don't try making it
|
||||
" worse with ``\%(/\@<!\*\)\@<!``, either...
|
||||
|
||||
syn keyword rustTodo contained TODO FIXME XXX NB NOTE SAFETY
|
||||
|
||||
" asm! macro {{{2
|
||||
syn region rustAsmMacro matchgroup=rustMacro start="\<asm!\s*(" end=")" contains=rustAsmDirSpec,rustAsmSym,rustAsmConst,rustAsmOptionsGroup,rustComment.*,rustString.*
|
||||
|
||||
" Clobbered registers
|
||||
syn keyword rustAsmDirSpec in out lateout inout inlateout contained nextgroup=rustAsmReg skipwhite skipempty
|
||||
syn region rustAsmReg start="(" end=")" contained contains=rustString
|
||||
|
||||
" Symbol operands
|
||||
syn keyword rustAsmSym sym contained nextgroup=rustAsmSymPath skipwhite skipempty
|
||||
syn region rustAsmSymPath start="\S" end=",\|)"me=s-1 contained contains=rustComment.*,rustIdentifier
|
||||
|
||||
" Const
|
||||
syn region rustAsmConstBalancedParens start="("ms=s+1 end=")" contained contains=@rustAsmConstExpr
|
||||
syn cluster rustAsmConstExpr contains=rustComment.*,rust.*Number,rustString,rustAsmConstBalancedParens
|
||||
syn region rustAsmConst start="const" end=",\|)"me=s-1 contained contains=rustStorage,@rustAsmConstExpr
|
||||
|
||||
" Options
|
||||
syn region rustAsmOptionsGroup start="options\s*(" end=")" contained contains=rustAsmOptions,rustAsmOptionsKey
|
||||
syn keyword rustAsmOptionsKey options contained
|
||||
syn keyword rustAsmOptions pure nomem readonly preserves_flags noreturn nostack att_syntax contained
|
||||
|
||||
" Folding rules {{{2
|
||||
" Trivial folding rules to begin with.
|
||||
" FIXME: use the AST to make really good folding
|
||||
syn region rustFoldBraces start="{" end="}" transparent fold
|
||||
|
||||
if !exists("b:current_syntax_embed")
|
||||
let b:current_syntax_embed = 1
|
||||
syntax include @RustCodeInComment <sfile>:p:h/rust.vim
|
||||
unlet b:current_syntax_embed
|
||||
|
||||
" Currently regions marked as ```<some-other-syntax> will not get
|
||||
" highlighted at all. In the future, we can do as vim-markdown does and
|
||||
" highlight with the other syntax. But for now, let's make sure we find
|
||||
" the closing block marker, because the rules below won't catch it.
|
||||
syn region rustCommentLinesDocNonRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\).\+$' end='^\z1$' keepend contains=rustCommentLineDoc
|
||||
|
||||
" We borrow the rules from rust’s src/librustdoc/html/markdown.rs, so that
|
||||
" we only highlight as Rust what it would perceive as Rust (almost; it’s
|
||||
" possible to trick it if you try hard, and indented code blocks aren’t
|
||||
" supported because Markdown is a menace to parse and only mad dogs and
|
||||
" Englishmen would try to handle that case correctly in this syntax file).
|
||||
syn region rustCommentLinesDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentLineDocLeader
|
||||
syn region rustCommentBlockDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\%(\s*\*\)\?\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentBlockDocStar
|
||||
" Strictly, this may or may not be correct; this code, for example, would
|
||||
" mishighlight:
|
||||
"
|
||||
" /**
|
||||
" ```rust
|
||||
" println!("{}", 1
|
||||
" * 1);
|
||||
" ```
|
||||
" */
|
||||
"
|
||||
" … but I don’t care. Balance of probability, and all that.
|
||||
syn match rustCommentBlockDocStar /^\s*\*\s\?/ contained
|
||||
syn match rustCommentLineDocLeader "^\s*//\%(//\@!\|!\)" contained
|
||||
endif
|
||||
|
||||
" Default highlighting {{{1
|
||||
hi def link rustDecNumber rustNumber
|
||||
hi def link rustHexNumber rustNumber
|
||||
hi def link rustOctNumber rustNumber
|
||||
hi def link rustBinNumber rustNumber
|
||||
hi def link rustIdentifierPrime rustIdentifier
|
||||
hi def link rustTrait rustType
|
||||
hi def link rustDeriveTrait rustTrait
|
||||
|
||||
hi def link rustMacroRepeatDelimiters Macro
|
||||
hi def link rustMacroVariable Define
|
||||
hi def link rustSigil StorageClass
|
||||
hi def link rustEscape Special
|
||||
hi def link rustEscapeUnicode rustEscape
|
||||
hi def link rustEscapeError Error
|
||||
hi def link rustStringContinuation Special
|
||||
hi def link rustString String
|
||||
hi def link rustStringDelimiter String
|
||||
hi def link rustCharacterInvalid Error
|
||||
hi def link rustCharacterInvalidUnicode rustCharacterInvalid
|
||||
hi def link rustCharacter Character
|
||||
hi def link rustNumber Number
|
||||
hi def link rustBoolean Boolean
|
||||
hi def link rustEnum rustType
|
||||
hi def link rustEnumVariant rustConstant
|
||||
hi def link rustConstant Constant
|
||||
hi def link rustSelf Constant
|
||||
hi def link rustFloat Float
|
||||
hi def link rustArrowCharacter rustOperator
|
||||
hi def link rustOperator Operator
|
||||
hi def link rustKeyword Keyword
|
||||
hi def link rustDynKeyword rustKeyword
|
||||
hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust
|
||||
hi def link rustStructure Keyword " More precise is Structure
|
||||
hi def link rustUnion rustStructure
|
||||
hi def link rustExistential rustKeyword
|
||||
hi def link rustPubScopeDelim Delimiter
|
||||
hi def link rustPubScopeCrate rustKeyword
|
||||
hi def link rustSuper rustKeyword
|
||||
hi def link rustUnsafeKeyword Exception
|
||||
hi def link rustReservedKeyword Error
|
||||
hi def link rustRepeat Conditional
|
||||
hi def link rustConditional Conditional
|
||||
hi def link rustIdentifier Identifier
|
||||
hi def link rustCapsIdent rustIdentifier
|
||||
hi def link rustModPath Include
|
||||
hi def link rustModPathSep Delimiter
|
||||
hi def link rustFunction Function
|
||||
hi def link rustFuncName Function
|
||||
hi def link rustFuncCall Function
|
||||
hi def link rustShebang Comment
|
||||
hi def link rustCommentLine Comment
|
||||
hi def link rustCommentLineDoc SpecialComment
|
||||
hi def link rustCommentLineDocLeader rustCommentLineDoc
|
||||
hi def link rustCommentLineDocError Error
|
||||
hi def link rustCommentBlock rustCommentLine
|
||||
hi def link rustCommentBlockDoc rustCommentLineDoc
|
||||
hi def link rustCommentBlockDocStar rustCommentBlockDoc
|
||||
hi def link rustCommentBlockDocError Error
|
||||
hi def link rustCommentDocCodeFence rustCommentLineDoc
|
||||
hi def link rustAssert PreCondit
|
||||
hi def link rustPanic PreCondit
|
||||
hi def link rustMacro Macro
|
||||
hi def link rustType Type
|
||||
hi def link rustTodo Todo
|
||||
hi def link rustAttribute PreProc
|
||||
hi def link rustDerive PreProc
|
||||
hi def link rustDefault StorageClass
|
||||
hi def link rustStorage StorageClass
|
||||
hi def link rustObsoleteStorage Error
|
||||
hi def link rustLifetime Special
|
||||
hi def link rustLabel Label
|
||||
hi def link rustExternCrate rustKeyword
|
||||
hi def link rustObsoleteExternMod Error
|
||||
hi def link rustQuestionMark Special
|
||||
hi def link rustAsync rustKeyword
|
||||
hi def link rustAwait rustKeyword
|
||||
hi def link rustAsmDirSpec rustKeyword
|
||||
hi def link rustAsmSym rustKeyword
|
||||
hi def link rustAsmOptions rustKeyword
|
||||
hi def link rustAsmOptionsKey rustAttribute
|
||||
|
||||
" Other Suggestions:
|
||||
" hi rustAttribute ctermfg=cyan
|
||||
" hi rustDerive ctermfg=cyan
|
||||
" hi rustAssert ctermfg=yellow
|
||||
" hi rustPanic ctermfg=red
|
||||
" hi rustMacro ctermfg=magenta
|
||||
|
||||
"syn sync minlines=200
|
||||
"syn sync maxlines=500
|
||||
|
||||
let b:current_syntax = "rust"
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
@@ -0,0 +1,37 @@
|
||||
# ==============================================================================
|
||||
# Auth: Alex Celani
|
||||
# File: test.prv
|
||||
# Revn: 04-17-2023 1.0
|
||||
# Func: show all of the functions of the prv syntax highlighting
|
||||
#
|
||||
# TODO: update as needed
|
||||
# ==============================================================================
|
||||
# CHANGE LOG
|
||||
# ------------------------------------------------------------------------------
|
||||
# 04-17-2023: wrote and commented
|
||||
#
|
||||
# ==============================================================================
|
||||
|
||||
// we out here in that single line comment
|
||||
|
||||
/* in-line comment */ un highlighted, not in brackets
|
||||
|
||||
/* also functions as a
|
||||
multiline comment */ notice how this is not highlighted
|
||||
|
||||
// archie nicknames
|
||||
archie chach chibo
|
||||
|
||||
// olly nicknames
|
||||
olly olly bolly bear
|
||||
Oliver Boliver Rockford Gubbins
|
||||
|
||||
// both
|
||||
sink boy
|
||||
of sealaND
|
||||
|
||||
// parents
|
||||
mom and dad
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# ==============================================================================
|
||||
# Auth: Alex Celani
|
||||
# File: test.prv
|
||||
# Revn: 04-17-2023 1.0
|
||||
# Func: show all of the functions of the prv syntax highlighting
|
||||
#
|
||||
# TODO: update as needed
|
||||
# ==============================================================================
|
||||
# CHANGE LOG
|
||||
# ------------------------------------------------------------------------------
|
||||
# 04-17-2023: wrote and commented
|
||||
#
|
||||
# ==============================================================================
|
||||
|
||||
// we out here in that single line comment
|
||||
|
||||
/* in-line comment */ un highlighted, not in brackets
|
||||
|
||||
/* also functions as a
|
||||
multiline comment */ notice how this is not highlighted
|
||||
|
||||
// bad people names
|
||||
mstislav Mstislav Boris boris
|
||||
// neutral people names
|
||||
yaroslav Yaroslav
|
||||
// good people names
|
||||
miro Miro Dobra dobra
|
||||
|
||||
// place names :)
|
||||
Providence
|
||||
|
||||
|
||||
// latin word, german word
|
||||
constable reeve
|
||||
// russogermanic, slavic
|
||||
skazarktos slava
|
||||
@@ -0,0 +1,53 @@
|
||||
# ====================================================================
|
||||
# Auth: Alex Celani
|
||||
# File: template.txt
|
||||
# Revn: 10-16-2020 1.0
|
||||
# Func: Demonstrate everything the text syntax file can do
|
||||
#
|
||||
# TODO: create
|
||||
# ====================================================================
|
||||
# CHANGE LOG
|
||||
# --------------------------------------------------------------------
|
||||
# 10-16-2020: init
|
||||
#
|
||||
# ====================================================================
|
||||
|
||||
|
||||
Attribute:: explanation for a little while, really how ever long you
|
||||
want it to go on for. The double quote marks this text as
|
||||
a property. For the time being, this text also serves as
|
||||
the body, and is really hard to properly color
|
||||
-> this marks a field. This is the first field, field 1
|
||||
# this is a comment. below this is field 2
|
||||
-> here's field 2, the second field
|
||||
=> this is also a field, field 3
|
||||
==> fields can be "indented" to acknowledge that things are
|
||||
subortinate to the prior
|
||||
---> check out that quote
|
||||
-> "Ask not what your country can do for you, but what you
|
||||
can do for your country" - Old Man
|
||||
-> "I made numbers like 5 highlight differently in quotes"
|
||||
|
||||
(1) Fs = 2 * f_max
|
||||
(2) x = e^(j*2*pi*f*t)
|
||||
|
||||
==> See above in (1) where I have defined the Nyquist
|
||||
Sampling Theorem. Expressions only highlight when there
|
||||
is at least one space before and after the equal sign.
|
||||
Adding this kept it from highlighting the ==> arrows
|
||||
==> In (2), we can see that e, j (also i), and pi are seen as
|
||||
numbers
|
||||
|
||||
NOTE: I added this next part for fun!
|
||||
-> I want to live in Norway, I wish I was Norwegian, I want
|
||||
to be Norse, in Norge, Speaking Norsk like the Norwegians
|
||||
-> Or perhaps live in Russia, be Russian, a slav, and speak
|
||||
a slavic language like the Ruskies
|
||||
note: anything between "note:" and ! will be highlighted
|
||||
NoTe: the trigger is case insensitive!
|
||||
|
||||
-> whatever <this> is, I'm not sure yet, but it does it
|
||||
--> also contains <numb3rs>
|
||||
|
||||
|
||||
|
||||
Executable
+297
@@ -0,0 +1,297 @@
|
||||
" ====================================================================
|
||||
" Auth: Alex Celani
|
||||
" Lang: Text
|
||||
" Revn: 10-16-2020 1.5
|
||||
" Func: Define syntax coloring for .txt files when being edited in Vim
|
||||
"
|
||||
" TODO: make comments create new comments on line overrun and newline
|
||||
" add highlighting for titles, vocab words, definitions
|
||||
" create a better template file showing all the highlighting
|
||||
" get term=underline working to avoid using link statements
|
||||
" ====================================================================
|
||||
" CHANGE LOG
|
||||
" --------------------------------------------------------------------
|
||||
" 09-29-2020: copy over from go.vim
|
||||
" 10-01-2020: gutted entire file
|
||||
" made my own quote regex
|
||||
" made comment
|
||||
" added link to list of group names and their colors
|
||||
" 10-02-2020: rewrote quotes to allow multiline quotes with rollover
|
||||
" added recognition for numbers
|
||||
" separated numbers into numbers and numbers in quotes
|
||||
" added date recognition, underlines dates in change log
|
||||
" made comments recognize Auth, Lang, Revn, Func, Todo
|
||||
" underline Auth, Lang, Revn, Func, Todo, and Change Log
|
||||
" recognized fields, the field delimiter (::), and
|
||||
" property delimiter (->)
|
||||
" added tags for notes to self, and the body of such
|
||||
" began writing something to passively color body
|
||||
" colored things Norse things green, and Russian red
|
||||
" added Color Guide, and source
|
||||
" changed some colors up a bit
|
||||
" made property delimiter of variable length, also use =>
|
||||
" 10-03-2020: added reminded to color explicitly in Todo
|
||||
" 10-11-2020: replaced most links with explicit ctermfg statements
|
||||
" added expressions, names, operations
|
||||
" changed some colors up a bit
|
||||
" shortened lines down to <= 70 characters
|
||||
" 10-16-2020: added Norge to norwegian words
|
||||
" added spaces around = in expression to avoid confusion
|
||||
" with => marker
|
||||
" changed noteTag color from DkRed to Red to match notes
|
||||
" added <> region
|
||||
" added i, j, e, pi as numbers
|
||||
"
|
||||
" ====================================================================
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
" XXX Expressions:
|
||||
" highlight equations, formulas, expressions, etc
|
||||
" expressions: .* is any number of characters
|
||||
" = is literal
|
||||
" .* is any number of characters again
|
||||
" added spaces around = to avoid confusion with =>
|
||||
"
|
||||
" the idea is that it's stuff that equals stuff, and we
|
||||
" worry about what it is later
|
||||
" name: \c case-escapes the sequence
|
||||
" \a is alphabetic characters, probably don't need escaping
|
||||
" \+ is at least 1 match, so it's 1 or more letters is a name
|
||||
" name: \c\a\= is 0 or 1 case-escaped alphabetic characters
|
||||
" _ is literal, best I can get to subscripts
|
||||
" \a\+ is 1 or more case-escaped alphabetic characters
|
||||
" op: inside [] can allow for one choice from any contained characters
|
||||
" =, +, -, /, ^ are all literals for operations
|
||||
" \* escapes the * character, which is now multiplication
|
||||
" Num: see Numbers: below
|
||||
" FIXME try to make name into one thing, probably with \{,1}
|
||||
syn match expression ".* = .*" contains=name,op,num skipwhite
|
||||
syn match name "\c\a\+" contained
|
||||
syn match name "\c\a\=_\a\+" contained
|
||||
syn match op "[=+-/^\*]" contained
|
||||
|
||||
|
||||
" XXX Quotes:
|
||||
" quotes should exist between odd pairs of quotation marks
|
||||
" eg| "quote" not
|
||||
" "quote" not "quote"
|
||||
" "not
|
||||
" quote"
|
||||
" "quote only if the it rolls
|
||||
" over onto the next line"
|
||||
" Calling the quotation a region instead of pattern match makes it
|
||||
" easier to wrap around a new line
|
||||
" the first and last quote define the expression
|
||||
" \ escapes the next character, allowing \" to appear as a literal "
|
||||
" thus, start and end are both quotes, and the reqion can span lines
|
||||
" added contains num on the off chance I want to embed a number
|
||||
" added contains for norwegian and russian for the hell of it
|
||||
syn region quote start="\"" end="\"" contains=numQuote,norwegian,russian
|
||||
" -- DEPRECATED --
|
||||
" the first and last quote define the expression
|
||||
" \ is the escape character, so \" means I want to look for a quote
|
||||
" . is every non-new line character possible
|
||||
" \{,} is \{0,infinity}, means I'm looking for between 0 and infinity
|
||||
" matches for the previous character, which is a wildcard, .
|
||||
" \{-,} will prioritize the smallest amount of matches possible
|
||||
" syn match quote "\".\{-,}\""
|
||||
" -- DEPRECATED --
|
||||
|
||||
|
||||
" XXX Unnamed Field:
|
||||
" match, because it should really only span one line
|
||||
" < and > are literals
|
||||
" .* means any character any number of times
|
||||
" contains numQuote
|
||||
syn match unnamed "<.*>" contains=numQuote
|
||||
|
||||
|
||||
" XXX Numbers:
|
||||
" num and numQuote allow for the coloring of numbers. numQuote exists
|
||||
" for the sole purpose of coloring numbers differently for when
|
||||
" they're inside of a quote, thus the contained keyword for numQuote
|
||||
" the first and last quote define the expression
|
||||
" - is the negative symbol, \? allows for 0 or 1 matchings, which
|
||||
" allows for negative numbers
|
||||
" \d is any digit [0-9], \+ is 1 or more matches, which means there
|
||||
" MUST be at least one number for a match to be seen
|
||||
" \a is any letter [a-zA-Z], * allows any number of them for variables
|
||||
" \. escapes the . character so decimal points can be represented
|
||||
" \? allows 0 or 1 matches of \., because number only have 1 decimal
|
||||
" \d for numbers after the decimal
|
||||
" * for any number of matches, using \+ (one or more matches) would
|
||||
" have only allowed for 2 digit numbers minimum
|
||||
" i, j, e, pi are all common numbers
|
||||
syn match numQuote "-\?\d\+\a*\.\?\d*" contained
|
||||
syn keyword numQuote j i e pi contained
|
||||
syn match num "-\?\d\+\a*\.\?\d*"
|
||||
syn keyword num j i e pi
|
||||
|
||||
|
||||
|
||||
" XXX Dates:
|
||||
" Date highlighting for the Change Log
|
||||
" the first and last quote define the expression
|
||||
" \d is any digit [0-9]
|
||||
" \{1,2} matches 1 or 2 times, although it should only ever get 2
|
||||
" - literal hyphen, which seperates months, days, and years
|
||||
" The same three elements are repeated again for the days
|
||||
" \d is any digit, used again for the years
|
||||
" \{4} for only four digits can be matched
|
||||
" ends with : because only dates in change log should be highlighted
|
||||
" marked as contained, as it should only be highlighted in comments
|
||||
" contains colon, so I can highlight the color separately
|
||||
" for some reason, the colon doesn't work as keyword, so simple match
|
||||
syn match date "\d\{1,2}-\d\{1,2}-\d\{4}:" contained contains=colon
|
||||
syn match colon ":" contained
|
||||
|
||||
|
||||
" XXX Comments:
|
||||
" comments come after #
|
||||
" eg| not comment # now a comment
|
||||
" # comment
|
||||
" not a comment
|
||||
" not
|
||||
" not
|
||||
" ### comment
|
||||
"
|
||||
" first and last quote define the expression
|
||||
" # can come literally, because it doesn't need escaping
|
||||
" . is every non-new line character possible
|
||||
" * matches as many matches as possible
|
||||
" i.e. a pound sign, and then as many characters as possible
|
||||
syn match comments "#.*" contains=commentFields,commentTodo,date,norwegian,russian
|
||||
" commentFields and commentTodo are contained within comments, so they
|
||||
" are as such in the definition of a comment, and listed as contained
|
||||
" in their own definitions
|
||||
" commentFields is match instead of keyword, will contain the space
|
||||
syn keyword commentFields contained Auth Revn File Func
|
||||
syn keyword commentTodo contained TODO
|
||||
syn match commentFields contained "CHANGE LOG"
|
||||
|
||||
|
||||
" XXX Fields:
|
||||
" Denotes properties, things that are of importance
|
||||
" first and last quote define the expression
|
||||
" . is any character
|
||||
" * is any number of that character
|
||||
" :: is the literal characters '::', which denotes the property
|
||||
" Using nextgroup would have been better praxis, but this works
|
||||
" After, denote the delimiter as own syntax element to color uniquely
|
||||
" FIXME: make this better with nextgroup
|
||||
syn match fields ".*::" contains=delim
|
||||
syn match delim "::"
|
||||
|
||||
" XXX Properties:
|
||||
" Denotes a property of a field
|
||||
" -\+ is one or more hyphens
|
||||
" =\+ is one or more equals signs
|
||||
" > is a literal
|
||||
syn match properties "-\+>"
|
||||
syn match properties "=\+>"
|
||||
|
||||
|
||||
" XXX Notes:
|
||||
" Allow for notes to be left with special highlighting
|
||||
" \c escapes the case, so search is entirely case insensitive
|
||||
" note are all literals
|
||||
" s\? will alow for either 0 or 1 of the character "s" to be matched,
|
||||
" essentially allowing for both notes and note
|
||||
" finally followed by a colon
|
||||
" nextgroup is the actual notes to be taken, as this is just the tag
|
||||
syn match noteTag "\cnotes\?:" nextgroup=notes
|
||||
" define notes as starting with space, ending with exclamation mark
|
||||
" if it's not denoted as contained, then the whole damn thing will be
|
||||
" highlighted
|
||||
syn region notes start=" " end="!" contained
|
||||
|
||||
|
||||
" FIXME Body:
|
||||
" This is the rest of the text
|
||||
" I found out with notes, if this isn't given as contained, it'll just
|
||||
" highlight everything
|
||||
"syn region body start=" " end=" "
|
||||
|
||||
|
||||
" XXX Norwegian:
|
||||
" XXX Russian:
|
||||
" lmfao ignore case sensitivity to avoid writing things twice
|
||||
" Highlight norwegian shit green
|
||||
syn case ignore
|
||||
syn keyword norwegian nordic nordics
|
||||
syn keyword norwegian norse
|
||||
syn keyword norwegian norway
|
||||
syn keyword norwegian norge
|
||||
syn keyword norwegian norsk
|
||||
syn keyword norwegian norwegian norwegians
|
||||
" Highlight Russian shit red
|
||||
syn keyword russian russian russians
|
||||
syn keyword russian rusky ruskies
|
||||
syn keyword russian russia
|
||||
syn keyword russian slav slavs
|
||||
syn keyword russian slavic
|
||||
syn case match
|
||||
" lmfao and turn the case sensitivity back on
|
||||
|
||||
|
||||
|
||||
" ColorGuide: ctermfg and ctermbg args - - - - source:: :help cterm
|
||||
" Black
|
||||
" LightBlue/Cyan/LightCyan, Blue/DarkBlue/DarkCyan
|
||||
" Green/LightGreen, DarkGreen
|
||||
" Red/LightRed, DarkRed
|
||||
" Magenta/LightMagenta, DarkMagenta
|
||||
" Yellow/LightYellow, DarkYellow/Brown
|
||||
" White
|
||||
" Gray/LightGray, DarkGray
|
||||
" ColorGuide: ctermfg and ctermbg args - - - - source:: :help cterm
|
||||
" ColorGuide: - - - - - - - - - - - - - - - source:: :help group-name
|
||||
" Dates and fields in comments still use links for highlighting to get
|
||||
" access to 'term' arguments that don't want to load correctly, namely
|
||||
" Underline -> PreProc (Magenta in default colo), with underline
|
||||
" ColorGuide: - - - - - - - - - - - - - - - source:: :help group-name
|
||||
|
||||
|
||||
" XXX Coloring:
|
||||
" hi[ghlight] <group> ctermfg=<color> [ctermbg=<color>]
|
||||
" group is typically a user-made group
|
||||
" ctermfg is the foreground, or font color
|
||||
" ctermbg is the background color, or highlight color
|
||||
|
||||
" Note: Keep ctermfg for expression and op the same value
|
||||
hi expression ctermfg=Blue
|
||||
hi name ctermfg=LightGreen
|
||||
hi op ctermfg=Blue
|
||||
hi num ctermfg=Magenta
|
||||
|
||||
hi unnamed ctermfg=Magenta
|
||||
hi quote ctermfg=DarkRed
|
||||
hi numQuote ctermfg=Green
|
||||
|
||||
hi comments ctermfg=Green
|
||||
" I want the underlines, but I can't figure out how to make them work
|
||||
" Normally, you add 'term=Underline', but that doesn't quite work
|
||||
hi def link commentFields Underlined
|
||||
hi def link date Underlined
|
||||
hi colon ctermfg=Cyan
|
||||
hi commentTodo ctermfg=Black ctermbg=Yellow
|
||||
|
||||
hi fields ctermfg=Red
|
||||
hi delim ctermfg=Yellow
|
||||
|
||||
hi properties ctermfg=Red
|
||||
hi noteTag ctermfg=White ctermbg=Red
|
||||
hi notes ctermfg=White ctermbg=Red
|
||||
|
||||
"hi body ctermfg=LightBlue
|
||||
|
||||
hi norwegian ctermfg=Green
|
||||
hi russian ctermfg=Red
|
||||
|
||||
let b:current_syntax = "txt"
|
||||
|
||||
Reference in New Issue
Block a user