HOME | DD
#code #coding #computers #computing #foss #hacker #hacking #linux #nerdy #opensource #program #programming #script #scripting #syntax #tech #text #unix #vi #vim #colorcode #colorcoded #colorcoding #texteditor #textediting #computer #syntaxhighlighting #vimscript
Published: 2022-02-21 21:54:52 +0000 UTC; Views: 3741; Favourites: 8; Downloads: 1
Redirect to original
Description
Vim syntax file that I made for the Processing language. The script is incomplete as it doesn't implement highlighting for all the different functions and data types (that would be way too long to take a screenshot of), but it provides for some of the basic drawing functions that you'd be using on a day-to-day basis.When I was collecting information for this syntax file from the Processing documentation, it occurred to me that there's a whole lot I don't know about this language. It's pretty easy to code in, since syntactically it's just a subset of C which I am familiar with, but there are a lot of additional graphics-related functions and data structures implemented on top of of the base subset C language, and I feel it's a shame that I've put off learning about them for so long. I really need to take some time to dive deeper into Processing and really master all the language constructs.
Since the syntax is essentially C, this makes implementing syntax highlighting for Processing easier as you can simply build on the already existing syntax highlighting rules provided for basic C constructs. The only thing I had to implement that wasn't a keyword was the hexadecimal codes, which are syntactic sugar for integers that represent colors. I had to learn the Vimscript syntax for highlighting a region based on a pattern (see line 23), as opposed to just highlighting keywords.




















