Skip to content

Instantly share code, notes, and snippets.

@ne1uno
Last active November 22, 2019 19:59
Show Gist options
  • Save ne1uno/2a79cc18f264b9cb6929f3f8eeb30c8a to your computer and use it in GitHub Desktop.
Save ne1uno/2a79cc18f264b9cb6929f3f8eeb30c8a to your computer and use it in GitHub Desktop.
generate red language syntax file for geany editor/ide one of two files plus a colorscheme.conf
ne1 11/19 hardwire to generate syntax file for geany
needs more work to filter and split keyword list by type
did I mention I barely knew any rebol/red when I first got this working?
still a bit surprised when something works the first time
there sure are a lot of existing words for a language with so few reserved
needs %./red-diffwords.red to declare several lists of keywords
no command-line options but can edit debug+ to turn off or reduce prints to console
don't debug the comments
expect revisions
adter run, rename/move/merge file.Red.conf to proper path, filetype.red
or filetype.red.conf if using install.red
not sure how any editor handles errors in syntax files so **buyer beware**
you can edit your own preferences near the end for build menu and lexer options
rough cut code from rebol script repo years ago, couldn't find anything in red
begs the question, why is there no default syntax file creator by now?
or list of sorted words readily available
and why so few user generated syntax files for various editor/ide exist.
PSPad syntax rebol/red
http://www.rebol.org/view-script.r?script=pspad-spec.r
Added or last Updated by mike on: 6-Jul-2005
maybe there was discussion or doc on that page?
ne1 early 2017, this was my first rebol red conversion
before I really knew much about rebol/red. I got usable syntax files somehow
PSPad & other editors really need a rebol parser, quite a few things don't work properly
it shouldn't take this much work to get code highlighting in your editor of choice
at some point may option to create syntax file for other editors but not a huge priority
you have to wonder in the past 10 or 20 years why so few editors support rebol or red
https://www.geany.org/download/releases/
https://sourceforge.net/projects/geany/
https://plugins.geany.org/downloads.html
plugin install doesn't work with portable, needs regex to get install dir
https://www.softpedia.com/get/PORTABLE-SOFTWARE/Programming/Geany-Portable.shtml
https://www.softpedia.com/reviews/linux/Geany--84142.shtml
https://www.softpedia.com/get/Programming/File-Editors/Geany.shtml
current 1.36 the portable is older, no idea other OS
this editor has been around for quite a while,
no idea why geany isn't more popular as an ide/editor.
it's scriptable, code folds, themable, has plugins, is opensource
,cross platform, small footprint
cons
difficulty of configuration?
gtk2? which not everyone likes and gtk mightily complicates building.
I haven't used geany much till recently, PSPad getting to be too annoying
loses bookmarks on crash or phases of the moon.
weekly crash, no 64bit scripting, insane popup process if sharing networked files.
there's more to dislike but otherwise one of the better options on windows.
SciTE another roll your own configuration challenge more than a ready to use solution.
PSPad format comments misses last block marker so leaves a latent syntax error if you don't notice it
and you know how painful missing brackets or braces are if you get too far ahead of yourself
can't remember all of the bugs off the top of my head,
probably made notes at the end, have to strip comments and get this working better
I didn't know at the time all the permutations of the function type, they could all be supported
with drop down selection from the function header instead of or in addition to each name, func has etc
possibly incorporate the solarize colors @dander found
kept some notes on improvements or bits of code related to gathering system words
added a collect system word snippit you can include at the bottom and top of a script
to generate a list of words leaked into the global context but it doesn't account for redefined words
things you might find useful in an editor/ide. could be wish to clean up or maybe save for later
it would be nice to have some framework to make scripts usable
put into a context so changes to this script doesn't leak into the supported words
remove known red-lang leaks from the console that aren't really useful in a syntax highlighter
make other editor syntax file creation easier by producing generic word and type list ready to use
prior art: scattered all over the web and way back machine. hardly any red-lang
rebol script repo pspad-spec.r
https://github.com/onetom/rebol-red-sublime
Visual Studio Code plugin for Red #vscode
https://code.google.com/archive/p/google-code-prettify/
https://trello.com/c/im4vMqga/4-editors-rebol-net
few zip attached
GeSHi - Generic Syntax Highlighter :: Demo - QBNZ
qbnz.com/highlighter/demo.php
wiki.greenstone.org/doku.php?id=wiki:syntax
http://www.revolvy.com/topic/Red%20(programming%20language)
rebol-kate.xml
rebol.el
vim-rebol.htm
rebol.syn
rebol.properties
rebol-jedit.xml
https://atom.io/packages/language-rebol
Komodo REBOLLanguage.py
Rebol source color-coding (syntax highlighting)
www.rebol.com/article/0524.html
www.rebol.com/cgi-bin/blog.r?view=0524
rebol-sourceinsight.zip
rebolsource-syntax.r
http://ceronio.net/2014/06/taking-a-new-look-at-rebol/
http://disq.us/url?url=http%3A%2F%2Fceronio.net%2F2016%2F04%2Flittle-logo-interpreter-in-81-lines-of-red%2F%3AxC7BvkTO7oMsqVHk9wXTWYpW0t4&imp=34a74ne3j5f2j&prev_imp=3493rdh11um0r3&forum_id=3067466&forum=ceronionet&thread_id=2771787883&thread=4778769160&zone=thread&area=bottom&object_type=thread&object_id=4778769160
http://ceronio.net/2016/04/little-logo-interpreter-in-81-lines-of-red
https://gist.github.com/mydoghasworms/23fff6e454c3ca8b66f76a7b9421e80a#file-logred-red
http://ceronio.net/2015/02/having-fun-with-rebol-parse/#more-699
http://stackoverflow.com/questions/28568589/rebol-2-using-a-parse-rule-to-check-input-without-executing-code
http://www.drdobbs.com/open-source/open-source-rebol-language-reaches-versi/240144490
http://metaeducation.com/media/shared/rebol/nick-rebol-2-tutorial.pdf
http://www.digicamsoft.com/cgi-bin/rebelBB.cgi?thread=25Jun2011205052175934200
www.crimsoneditor.com/
https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml
https://www.quora.com/Why-is-REBOL-not-as-popular-as-Python
http://www.drdobbs.com/why-rebol-matters/184412756
http://www.drdobbs.com/web-development/restful-web-services-a-tutorial/240169069?cid=SBX_ddj_related_mostpopular_default_why_rebol_matters&itc=SBX_ddj_related_mostpopular_default_why_rebol_matters
https://wiki.openwrt.org/meta/syntax
https://oldwiki.archive.openwrt.org/meta/syntax
Refer to https://openwrt.org/ for up-to-date information.
https://wiki.geany.org/wiki/syntax dowiki
https://wiki.geany.org/howtos/check_python_code
https://wiki.geany.org/howtos/custom_autocomplete
https://wiki.geany.org/snippets/start
https://wiki.geany.org/config/start
https://wiki.geany.org/config/euphoria
isn't there a wiki page and a roadmap to editors that have rebol modes?
why does kdevelop not have a rebol mode? that's a crime,
got to be intentional, it has 325 or more different syntax supported!
https://www.divio.com/blog/documentation/
from LeoEditor group
Found by way of Guido von Rossum in python discussion forum:
Tutorials are learning oriented.
How-to's are goal oriented.
Explanations are understanding oriented.
References are information oriented.
everything else is project process docs
Red [
Title: "geany syntax file from REBOL Spec Generator for Text Editor PsPAD"
Date: "any [06-Jul-2005 2019/11]"
Purpose: {Create geany syntax file from Red system words}
author: "ne1 converted from work by %cybarite--sympatico--ca and others"
File: %make-geany-conf.red
;; Source: {
;; Based on rebdoc.r by Carl Sassenrath
;; which says "With minor modifications
;; you can use this script to create
;; docs for your own scripts."
;; }
;; library: [
;; level: 'beginner
;; platform: [windows]
;; type: [tool]
;; domain: 'text-processing
;; tested-under: {REBOL/View 1.3.1.3.1 17-Jun-2005 Core 2.6.0}
;; support: none
;; license: none
;; see-also: none
;; ]
]
;
debug+: 1 ; 0 set to control minimal prints probes 1 2 3
;
Directory: %./
;kealist\RedMezzanines? Gregg Irwin?
;
starts-with?: func [{ head-is? begins-with? x "y" }
series [series!]
value
/only
][
;!! This scalar test is an optimization. Need to profile and weigh the gain.
either scalar? value [ value = first series ][
;!! A `refine` func would be nice here.
make logic! either only [ find/match/only series value ][ find/match series value ]
]
]
ends-with?: function [ ; tail-is?
series [series!]
value
/only
][
;!! This scalar test is an optimization. Need to profile and weigh the gain.
either scalar? value [ value = last series ][
;!! A `refine` func would be nice here.
pos: either only [
find/last/tail/only series value
][
find/last/tail series value
]
either pos [ tail? pos ][ false ]
]
]
;run once with eith cli or gui console to create wordlist including view/vid words
;there may be simpler ways to get this list and can just use pre-generated list for now
;; either all [
;; not unset? view
;; ;find system/codecs 'view
;; ][
;; print ["generating gui view list if it doesn't exist"]
;; ][
;; print ["including red-diffwords.txt"]
;; #include %./red-guiwords.red
;; #include %./red-cliwords.red
;;
;; ;if not exists then generate
;; ]
;needs work, should work interpreted or compiled, empty list if no gui available
;fail if unset red-diffwords and red-colors user3 user4
print ["including red-diffwords.red"] #include %./red-diffwords.red
if 3 <= debug+ [probe system/words] ;dumps the whole object
;build this list once and copy on use in 2 places
; word type value but value looks like a doc for some, just unset for many
;maybe should look at what is returned in rebol
;; >> ? system
;; version tuple! 0.6.3
;; build object! [date config]
;; words object! [datatype! unset! none! logic! block! paren! string! file! url! char! integer!...
;; platform function! Return a word identifying the operating system.
;; catalog object! [datatypes actions natives accessors errors]
;; ...
;had to edit was {[]}, load not read?
;rwords: load %rebol_system_words0.txt ;add difference maybe
;; Use words-of system/words to get a list of all words defined in global context.
;; Use system/version to get the version and system/build/date for the build date
;@doc https://stackoverflow.com/questions/18091704/is-there-a-way-to-list-words-in-the-current-red-console?rq=1
redwords: words-of system/words ;try w/o extra binding & copy
;global words from this script managed to get in there
;local block or function words like in foreach probably are hidden?
;a bunch from all over that probably shouldn't be in there anyway
; random double letter or letter number pairs that have no meaning in red
; some are for key codes? I'm not loading any other files
;
;make sure script doesn't override any usual system words
res: [
;need to automate collection of words from red-console, hard wired list will get out of date
;really should have better names than kw#
;words isn't removed? word isn't in there, used as function local
'kw-reserved 'kw1-x 'kw2-x 'kw3-x 'kw4-x 'res
'Directory 'ini-buffer 'ini-tags 'word-blk 'redwords ;'words 'word
'template-file 'def-buffer 'tvalue 'tvals 'ttag
'tspec 'targ-list 'targs 'tname 'word-list
'A1 'A2 'B1 'B2 ;'rwords
;'a 'b 'c 'd 'f 'g 'i 'j 'k 'l 'm 'n 'o 'p 'q 'r 's 't 'u 'v 'w 'x 'y 'z
'A 'B 'C 'D 'F 'G 'I 'J 'K 'L 'M 'N 'O 'P 'Q 'R 'S 'T 'U 'V 'W 'X 'Y 'Z
'starts-with? 'ends-with? debug+ 'red-colors 'red-diffwords 'user3 'user4
]
;append res sort red-colors ;named colors added directly
;append res sort red-diffwords ;view/vid added directly
foreach i red-colors [remove-each x redwords [x = i]]
foreach i red-diffwords [remove-each x redwords [x = i]] ;remove and add at user2
;; link-sub-to-parent function! Internal Use Only.
;; link-tabs-to-parent function! Internal Use Only.
; can I capture `? link-` and exclude internal use only?
forall redwords [
case [
any [
;might be stepping on valid keyword and not future proof
;too many odd keywords probably not a huge problem
starts-with? form to-lit-word redwords/1 "_"
starts-with? form to-lit-word redwords/1 "<"
starts-with? form to-lit-word redwords/1 "="
starts-with? form to-lit-word redwords/1 "-"
starts-with? form to-lit-word redwords/1 "bad-"
starts-with? form to-lit-word redwords/1 "invalid-"
starts-with? form to-lit-word redwords/1 "cfg-"
starts-with? form to-lit-word redwords/1 "ctx"
ends-with? form to-lit-word redwords/1 "ctx"
starts-with? form to-lit-word redwords/1 "arg" ;+0-9
;= may need length >1, <> may need length >2, maybe add back = & <>
][
;needs work
if 1 <= debug+ [print [tab tab '!any-function '!_ :redwords/1]]
append res redwords/1
]
all [word? redwords/1 any-function? get/any :redwords/1][
;from api generator and PSPas def section
if 1 <= debug+ [print [tab 'any-function :redwords/1]]
]
'default [
;
if 1 <= debug+ [print [tab tab tab 'default :redwords/1]]
]
]
]
if 1 <= debug+ [print "excluded" probe res] ;diff res maybe then combine newres
; once again remove doesn't do what it sounds like it should?
;foreqch x res [remove redwords x]
;
; any removes just one, the same one all the time, all removes none of them
;maybe quoting isn't the way to go but then it errors no value
;apparently I don't know how to do this, but it should be done
;remove-each i redwords [i = any res ]
;
;one more try, this seems to have worked ok
;seems like it goes through the list more than it should but whatevs
; case insensitive
;
foreach i res [remove-each x redwords [x = i]]
;exclude would've worked
;
;no need to keep writing this while debugging program
; save %system_words.txt red-words-list print ["wrote words l=" length? red-words-list]
;if 3 <= debug+ [probe red-words] ;copy gives me the object again?
;; halt ;may as well go step by step see if everything actually works in red
;red-vals-list: vals-of system/words ;second makes no sense in red, worked in rebol
;save %system_vals.txt red-vals-list print ["wrote vals"]
;will build this while parsing keywwords,
;also probably needs other work at context
;words: copy red-words-list ;work from a copy
;;;; First the syntax/.ini file
;have to edit in any use of braces in buffer: to keep them balanced? no nesting?
;will append later
ini-buffer: {# geany editor/ide syntax file
# See red-lang.org www.rebol.com www.geany.org
# filetypes.red syntax file for Redlang from lua lexer
# ne1 2019/11 syntax & code from cybarite for REBOL 2005 and Euphoria 2013 & 2005 or earlier
#
# For complete documentation of this file, please see Geany's main documentation
[styling]
# Edit these in the colorscheme .conf file instead
default=default
comment=comment
commentline=comment_line
commentdoc=comment_line_doc
number=number_1
word=keyword_1
string=string_1
character=character
literalstring=string_2
preprocessor=preprocess
operator=operator
identifier=identifier_1
stringeol=string_eol
function_basic=function
function_other=type
coroutines=class
word5=keyword_1
word6=keyword_2
word7=keyword_3
word8=keyword_4
label=label
[keywords]
# all items must be in one line
}
; maybe can figure out a good way to put some words in kw2 & 3? instead of all kw1
; looking through other ini file for what works, might be in the help too?
; there are no real reserved words but this give a different color to them
; will have to compile a list manually and remove from the others
; new words may be added old ones removed as the language evolves
; maybe put all the view, vid & color words in reserved?
; does rebol or red have a preferred theme color? comment colors?
; do a poll? style guide mention anything?
; going to need a set of dark and solorize light & dark colors too
;system/words is not actually a clean list?
;going to need a list of words to delete from it, m,t,g bunch of single letters?
;to-* *! *? *-of red/system words math words & operators
; none true false, loop constructs, context, join, reduce etc
; wonder if there is a more programmatic way to know which category a word belongs?
;http://rebol2.blogspot.com/2012/04/ some more clues from rebol
{
these are actually words, not strings. use type? to build keyword 1-4 blocks.
later
skip presaved lists of words like colors,
though they might be easy to find? color? tuple?
build block or map of word values to use for context at the same time
}
kw1-x: copy []
kw2-x: copy []
kw3-x: copy []
kw4-x: copy []
kw-reserved: copy []
;try limit length words to the first 50 or something to simplify debugging
;skip words 1890 is about 20? they're all word, but what is the contents type?
;words: skip redwords 1890 ;most of the last ones are unset
foreach word sort redwords [ ;later chg to natural sort
;print [:word] ;type? to-word
;probe got a bunch of different results.
;but in the switch? load can't load word,
;to-typeset might work for some, but not all? help isn't nearly enough
;type? should work. so annoying that I can get hung here for hours
;trying different things it should be making it obvious why it's failing
; how can I pause every 20 prints in console
;not helped in red by example using type as a header for every blanking item
;maybe have to get? can't get !tuple! why is it in there?
;why is it not catching the error and returning none?
;; ;so lost, does any short circuit?
;; w: either all [word = !tuple! ]
;; [word]
;; [either attempt (get word) [get word][word]]
;( type?/word word) attempt type? get word
;why does get/any fail here
;
either error? tvalue: try [ get word ][
tvalue: word
if 1 <= debug+ [print [tab "err:" word " type:" type?/word word]] ;word!
][
if 1 <= debug+ [print [word " type:" type?/word :tvalue]]
]
;if error [print ["err:" value ]] ;has no value if unset?
switch/default type?/word :tvalue [ ;type?/word get/any word
;unset words are dialect? colors are tuple?
; many words show unset
;could append =type? right here and pick to = out later for context
;some also have docstring, but that could be gathered later at context
;assuming switch does fallthru?
;will exit actually exit on success? is exit how it works already?
;type?/word word either, which makes sense, try type? :word
;at that same cliff, need to know the contents not the container
;assumes fallthru then break?
action! object! any-function! routine!
[append kw1-x word]
unset! event! tuple! color!
[append kw2-x word] ;just yello
;may have to filter more
native! op! char! none! logic! float! string!
[append kw3-x word]
datatype! bitset! typeset!
[append kw4-x word]
;later switch on lit-word and pick out to-* *-of
;err can catch?
][append kw-reserved word] ;default catchall word!
]
;; >> ? any-type!
;; ANY-TYPE! is a typeset! value: make typeset! [datatype!
;; unset! none! logic! block! paren! string! file! url! char!
;; integer! float! word! set-word! lit-word! get-word!
;; refinement! issue! native! action! op! function! path!
;; lit-path! set-path! get-path! routine! bitset! object!
;; typeset! error! vector! hash! pair! percent! tuple! map!
;; binary! time! tag! email! handle! date! image! event!]
;; if (length? kw-reserved) < 5 [print ["fail"] halt] ;has to be at least a few
append kw2-x union red-colors red-diffwords ;keep user2-4 free for user
word-blk: [ ; iterate with ini-tags to distribute words
kw1-x
kw2-x
kw3-x
kw4-x
kw-reserved
]
if 1 <= debug+ [
print ['kw1-r] ;foreach inside print block acts weird
foreach x word-blk [rejoin [x " length=" length? reduce [x] " "]]
]
if 1 <= debug+ [print ["-blk "] probe word-blk probe first :word-blk]
;can't I even get the right output here? dwim
;; ini-tags: [ ;PSPad
;; [ "[KeyWords]" newline ";everything else" newline]
;; [ "[KeyWords2]" newline ";loops etc word?" newline]
;; [ "[KeyWords3]" newline ";math" newline]
;; [ "[KeyWords4]" newline ";truth of in to" newline]
;; [ "[ReservedWords]" newline ";view vid color unset?" newline]
;; ]
ini-tags: [ ;geany
["keywords=` "] ;kw **the sorting is not exact**
[newline newline "# view/VID + colors" newline "function_basic="] ;kw2 append
[newline newline "# series & math functions" newline "function_other="] ;kw3
[newline newline "#truth of in to" newline "coroutines="] ;kw4 lua lexer specific?
[newline newline "#word! unset? " newline "user1="] ;reserved words but not really
]
;each should already be sorted since they were appended from sorted words
;
foreach word-list word-blk [
ttag: first ini-tags
ini-tags: next ini-tags
append ini-buffer rejoin ttag
if 1 <= debug+ [
print ["next tag: "]
probe ttag
probe :word-list ;:this shows the kw 1..4 & reserved block names
]
foreach word reduce word-list [ ;add sort or don't to keep append order
; geany syntax file all one line, PSPad gets one word= per line
append ini-buffer rejoin [ word space] ;PSPad [ word "=" newline]
]
]
append ini-buffer {
# more user definable keywords
user2=
# user definable keywords
user3=}
foreach x user3 [
append ini-buffer rejoin [x space]
]
append ini-buffer {
# user definable keywords
user4=}
foreach x user4 [
append ini-buffer rejoin [x space]
]
;finally, closing items
append ini-buffer {
[settings]
# default extension used when saving files
extension=red
# rd r reb
lexer_filetype=Lua
# the following characters are these which a "word" can contains, see documentation.
# may be more in rebol/red, may confuse lexer, make sure this works before adding ~?*+=-. +utf
wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# single comments, like # in this file
comment_single=;
# multiline comments
comment_open={
comment_close=}
# set to false if a comment character/string should start at column 0 of a line, true uses any
# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
#command_example();
# setting to false would generate this
# command_example();
# This setting works only for single line comments
comment_use_indent=true
# context action command (please see Geany's main documentation for details)
context_action_cmd=
[indentation]
#width=4
# 0 is spaces, 1 is tabs, 2 is tab & spaces
#type=1
[lexer_properties]
fold.type.lua=1
fold.quotes.lua=1
fold.keywords.lua=1
[build_settings]
# %f will be replaced by the complete filename
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=\c\Lang\red-lang\run\red\red-064_latest\_red-latest.exe "-r -t Windows %f"
run_cmd=\c\Lang\red-lang\red\red-master\red-console.exe "%f"
}
; setup build choice multiple version executable,
; possibly rebol older red latest nightly branch etc
;;write pspad-directory/%syntax/rebol.ini buffer
write %.\file.Red.conf ini-buffer print ["wrote conf"]
;; print [sort difference redwords words-of system/words]
;; a A1 A2 b B1 B2 c d def-buffer f g i ini-buffer ini-tags J k
;; kw-reserved kw1-x kw2-x kw3-x kw4-x L m n O p PsPAD-Directory q r
;; res s t targ-list targs template-file tname tspec ttag tvalue U v
;; vals w word-blk word-list words x y Z
; it's not eating any words, so why aren't some types colorized?
;print [sort difference rwords redwords]
;first complains, used load, diff is way too many extra words,
; either order fk'it, also need a difference between diff & words?
; to find out which are only in rebol.
;; or rwords was empty
;; maybe later
;; halt
; PSPad gets slightly different preamble and post,
; then a .def file that can be automated more or less
;could also generate a template file
;; template-file: copy {
;; sample red program template. fill in the blanks and put in template dir
;; could also associate in windows and create a new file template
;; Red [
;; Title:
;; Author:
;; Date:
;; ]
;;
;; ;your program here
;;
;; }
;;
;; comment {
;; todo
;; add
;; }
;; write %.\Default.red template-file print ["wrote template"]
;geany can use a snippit files that could be generated from multi line string or code
;merge with snippits.conf at proper path
;; # Geany's snippets configuration file
;; #
;; # use \n or %newline% for a new line (it will be replaced by the used EOL char(s) - LF, CR/LF, CR).
;; # use \t or %ws% for an indentation step, it will be replaced according to the current document's indent mode.
;; # use \s to force whitespace at beginning or end of a value ('key= value' won't work, use 'key=\svalue').
;; # use %key% for all keys defined in the [Special] section.
;; # use %cursor% to define where the cursor should be placed after completion. You can define multiple
;; # %cursor% wildcards and use the "Move cursor in snippet" to jump to the next defined cursor
;; # position in the completed snippet.
;; # You can define a section for each supported filetype to overwrite default settings, the section
;; # name must match exactly the internal filetype name, run 'geany --ft-names' for a full list.
;; #
;; # Additionally, you can use most of the template wildcards like {developer}, {command:...},
;; # or {date} in the snippets.
;; # See the documentation for details.
;;
;; # For a list of available filetype names, execute:
;; # geany --ft-names
;;
;; # Default is used for all filetypes and keys can be overwritten by [filetype] sections
;; [Default]
;;
;; # special keys to be used in other snippets, cannot be used "standalone"
;; # can be used by %key%, e.g. %brace_open%
;; # nesting of special keys is not supported (e.g. brace_open=\n{\n%brace_close% won't work)
;; # key "wordchars" is very special, it defines the word delimiting characters when looking for
;; # a word to auto complete, leave commented to use the default wordchars
;; [Special]
;; brace_open=\n{\n\t
;; brace_close=}\n
;; block=\n{\n\t%cursor%\n}
;; block_cursor=\n{\n\t%cursor%\n}\n%cursor%
;; #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
;;
;; # Optional keybindings to insert snippets
;; # Note: these can be overridden by Geany's configurable keybindings
;; [Keybindings]
;; #for=<Ctrl>7
;;
;; # The snippets below are for the Euphoria Programming Language
;; [Euphoria]
;; procedure=procedure %cursor%(%cursor%)\n\t%cursor%\nend\sprocedure\n\n%cursor%
;; function=function%cursor%%cursor%)\n\t%cursor%\nreturn%cursor%\nend\sfunction\n\n%cursor%
;; if=if %cursor% then\n\t%cursor%\nend\sif\n\n%cursor%
;; ifdef=ifdef %cursor% then\n\t%cursor%\nend\sifdef\n\n%cursor%
;; while=while %cursor% do\n\t%cursor%\nend\swhile\n\n%cursor%
;; loop=loop %cursor% do\n\t%cursor%\nend\sloop\n\n%cursor%
;; for=for %cursor% = %cursor% to %cursor% do\n\t%cursor%\nend\sfor\n\n%cursor%
;; switch=switch %cursor% do\n\t%cursor%\nend\sswitch\n\n%cursor%
;; type=type %cursor%(%cursor%)\n\treturn %cursor%\nend\stype\n\n%cursor%
;;
;; #needs work, will be nicer to take source w/%c=cursor and let script translate
;; rather than edit compressed source directly
;; FIXME
ini-buffer: {
[Red]
function=function%cursor%%cursor%)\n\t%cursor%\nreturn%cursor%\n]\n%cursor%
if=if %cursor% [%cursor%]\n%cursor%
either=either %cursor% [%cursor%][\n%cursor%]
}
print [newline "merge with geany/user/??/snippits.conf" newline ini-buffer]
;check if exists or maybe just print, also, won't want to make snippits of every keyword obviously
;; write %.\snippits.conf ini-buffer print ["wrote snippits.conf"]
;; halt
;completion keystroke file?
comment {
see pspad-spec for links to other rebol syntax files
m2019B11a04 hardwire to try to get basic rebol/red support in geany
may want rebol and red rather than combined for various reasons
chg each kw output to all be one line but newline for new section different than PSPad
seems like quite a few more console/system leaked words and tags need to be excluded
keywords have become messy, with so much redlang branch work not unexpected
maybe produce formatted various sorted numbered list to simplify regenerating exclude block
may need to make a gui to help produce exclude list by hand
similar to spellcheck list culling
not including other file so maybe mangling could be from above
user1=--- --catch <anon633> <anon> <body> <not-found> =fragment =host =IP-literal =normal-switch= =path =port =
need to go over the type tracking to get more effective split of types
first make a very simple file conf to make sure this works in geany for redlang
in case there is a problem with syntax here can revert to check different lexers
todo
isolate colors for each type and convert to hex if that's all geany understands
get multiple build choices, different versions of interpreter compiler & options
add my list of X-11 colors
add ability to scan selected include file for func/function and other words
add back the #include word gather or exclude lines.
put list of user words in block at top of file
can I discover vid/view or parser any DSL words and make them different in context?
will need to build geany rebol/red lexer to make that happen.
may not want to appropriate Lua files if geany scripting is lua
maybe ada or lisp would work?
need to change highlighting for this and some other languages to fit theme
is there a Red style guide? preferred color scheme
keywords red? comments gray strings green? they should be in english not hex!
how to call chm/pdf or html context sensitive help?
cut back echo to console
[...]
still nowhere near ready to publish,
though syntax file getting better, source getting more confusing
way too many random words in last block.
some might want to exclude many/most of them,
just add to 'res exclude block or devise a different way to cull the default word!
I'm sure someone has posted geany conf files I won't find till later
more importantly, still untested.
}
# rename/move/merge
# this red-hybrid-light.conf to portable\X-Geany\User\Geany\colorschemes\
# or newer installed /Users/%YOU%/AppData/Roaming/geany/colorschemes/
# generate filetypes.Red.conf and filetype_extensions.conf to proper path
# possibly auto generated
# partially tested
[theme_info]
name=red-hybrid-light
description=from Alternate Geany color scheme but brighter comments brackets green strings
version=0.02
author=
url=
#geany1.36, is it old? using ,bold in places, false assumed?
[named_colors]
# from fluffy
almost_black=#111
#blue=#06f
cyan=#02b5d1
#dark_grey=#babdb6
#green=#00bb87
Lime=#008000
#highlight_blue=#abf5ff
highlight_green=#c1ff9d
highlight_yellow=#fce94f
indigo=#b76fff
violet=#48005A
Azure=#F0FFFF
#light_grey=#eeeeec
magenta=#ff6fff
#medium_grey=#d3d7cf
red=#ff405a
Sienna=#A0522D
#very_dark_grey=#888a85
very_light_grey=#fafaf8
#white=#fff
[named_styles]
default=#000080;#fefcf5;;false
error=#f00;#bfbfbf
# Editor styles
#--------------------------------------------
selection=indego;highlight_yellow;true;true
current_line=Azure;#e8e8ff;true;true
brace_good=;highlight_green;true;false
brace_bad=red;0xFFFFFF;true;false
margin_line_number=#000;#dfd7cf
margin_folding=#000;#f6f4f2
fold_symbol_highlight=#fff
indent_guide=#3d291c
caret=#843121
marker_line=0x000000;0xffff00
marker_search=0x000000;0x0000f0
marker_mark=0x000000;0xb8f4b8
call_tips=0xc0c0c0;0xffffff;false;false
white_space=#c0c0c0;#fff;true;false
# Programming languages
#-----------------------------------------------
comment=Sienna
comment_doc=0xa52a10
comment_line=comment
comment_line_doc=comment_doc
comment_doc_keyword=comment_doc,bold
comment_doc_keyword_error=comment_doc,italic
number=indigo;;true
number_1=number
number_2=number_1
type=0x2E8B57;;true
class=type
function=0x000080
parameter=function
keyword=0x003030;;true
keyword_1=keyword
keyword_2=0x9f0200;;true
keyword_3=keyword_1
keyword_4=keyword_1
identifier=default
identifier_1=identifier
identifier_2=identifier_1
identifier_3=identifier_1
identifier_4=identifier_1
string=Lime
string_1=string
string_2=string_1
string_3=default
string_4=default
string_eol=0x000000;0xe0c0e0
character=string_1
backticks=string_2
here_doc=string_2
### why is it using coma bold instead of ;true?
label=default,bold
preprocessor=0x808000
regex=number_1
operator=0x300080
decorator=string_1,bold
other=0x404080
## Markup-type languages
##----------------------------------------------------
tag=type
tag_unknown=tag,bold
tag_end=tag,bold
attribute=keyword_1
attribute_unknown=attribute,bold
value=string_1
entity=default
# Diff
#-----------------------------------------------------
line_added=0x008B8B
line_removed=0x6A5ACD
line_changed=preprocessor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment