https://github.com/prosumma/vim-rebol
REBOL 3 syntax highlighting
https://github.com/prosumma/vim-rebol
Last synced: 12 months ago
JSON representation
REBOL 3 syntax highlighting
- Host: GitHub
- URL: https://github.com/prosumma/vim-rebol
- Owner: Prosumma
- Created: 2014-10-07T20:11:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-30T07:06:38.000Z (almost 11 years ago)
- Last Synced: 2025-07-01T11:05:26.493Z (12 months ago)
- Language: VimL
- Size: 137 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Syntax Highlighting For REBOL (3) in Vim
----
I'm going to assume that anyone needing REBOL syntax highlighting for Vim is already aware that REBOL is a homoiconic language. Most syntax highlighting I've seen for REBOL downplays its homoiconicity, treating it as if the DO dialect were paramount. I wanted to strike a balance between the DO dialect and plain homoiconicity, and I think I've hit on it.
What this means is that I don't highlight a token based on whether the DO dialect predefines it as a function or some other data type. Rather, I highlight it based on its _homoiconic_ data type and whether or not it is predefined. E.g., X is a WORD!, but it is not predefined. DO is also a WORD! and it is predefined. Each will get different highlighting.
There are some exceptions. There's a convention in REBOL that data types end with an exclamation point. _Any word ending in an exclamation point will be highlighted as a datatype, whether predefined or not._ Also, the tokens REBOL, SELF, YES, NO, ON, OFF, TRUE, FALSE, and /LOCAL get special emphasis.
There are alse some compromises. REBOL allows some pretty complex path expressions, e.g.
foo/:x/(2 + 3): 7
What to do with this? My solution isn't perfect, but try it out and see. :)
This is a work in progress, but it is mostly complete with few problems. There is a bug with / used as an operator and I still have to finish proper highlighting of non-integral numbers, dates, issues, and a few other types. Complex paths such as those mentioned above may need a few tweaks, though they work pretty well.
Lastly, the ftdetect plugin in this bundle assumes the use of the .reb extension rather than .r as suggested by Carl Sassenrath (http://www.rebol.com/cgi-bin/blog.r?view=0540). I use this for everything I do. (Most of what I write is R3, not R2.)