From ca2c0ac8b3613f6ce189706d7f5841116f154d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tymoteusz=20Wo=C5=82od=C5=BAko?= Date: Sat, 13 Feb 2021 11:23:31 +0100 Subject: [PATCH 1/3] Syntax highlighting for Julia --- julia.nanorc | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 julia.nanorc diff --git a/julia.nanorc b/julia.nanorc new file mode 100644 index 0000000..eda9759 --- /dev/null +++ b/julia.nanorc @@ -0,0 +1,47 @@ +## Julia syntax highlighting rules for Nano + +syntax "julia" "\.jl$" +header "^#!.*/(env +)?julia[-0-9._]*( |$)" +magic "Julia" +comment "#" + +## buildin keywords +color brightcyan "\<(baremodule|begin|break|catch|const|continue|do|else|elseif|end|export)\>" +color brightcyan "\<(false|finally|for|function|global|if|import|let|local|macro|module)\>" +color brightcyan "\<(quote|return|struct|true|try|using|while)\>" + +## operators +color magenta "[.:;,+*|=!\%?]" "<" ">" "/" "-" "&" +color magenta "[÷√∛⊻∈∉∋∌≈≉≠≡≢≤≥∩∪⊆⊇⊈⊉⊊⊋±]" + +## functions +color brightblue "[A-Za-z][A-Za-z0-9_]*\!?\.?[\(]" + +## symbols +color yellow "([^A-Za-z0-9_:]|^):[0-9A-Za-z_]+" + +## parentheses +color magenta "[(){}]" "\[" "\]" + +## comments +color green "^#.*|[[:space:]]#.*$" +color green start="#=" end="=#" + +## chars and strings +color yellow start="[rb]?["]" end="["]" start="[rb]?["]{3}" end="["]{3}" +color yellow "[']\\?[^'][']" + +## string interpolation +color normal "\$\([^)]*\)" + +## external commands +color red start="`" end="`" + +## macros +color cyan "@[A-Za-z0-9_]+" + +## Trailing spaces +color ,red "[[:space:]]+$" + +## reminders +color brightwhite,yellow "(FIXME|TODO|XXX)" From 9740d4e95961f0a158ada96e38f9bfbf05c3d484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tymoteusz=20Wo=C5=82od=C5=BAko?= Date: Mon, 15 Feb 2021 09:12:49 +0100 Subject: [PATCH 2/3] Few more unicode operators --- julia.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia.nanorc b/julia.nanorc index eda9759..9d81864 100644 --- a/julia.nanorc +++ b/julia.nanorc @@ -12,7 +12,7 @@ color brightcyan "\<(quote|return|struct|true|try|using|while)\>" ## operators color magenta "[.:;,+*|=!\%?]" "<" ">" "/" "-" "&" -color magenta "[÷√∛⊻∈∉∋∌≈≉≠≡≢≤≥∩∪⊆⊇⊈⊉⊊⊋±]" +color magenta "[÷⋅×√∛⊻∈∉∋∌≈≉≠≡≢≤≥∩∪⊆⊇⊈⊉⊊⊋±∘]" ## functions color brightblue "[A-Za-z][A-Za-z0-9_]*\!?\.?[\(]" From a9c5aeae6ee429302fd288608c3b97c28db327ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tymoteusz=20Wo=C5=82od=C5=BAko?= Date: Mon, 15 Feb 2021 09:20:24 +0100 Subject: [PATCH 3/3] handle transpose operator --- julia.nanorc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/julia.nanorc b/julia.nanorc index 9d81864..1bee9d9 100644 --- a/julia.nanorc +++ b/julia.nanorc @@ -12,7 +12,7 @@ color brightcyan "\<(quote|return|struct|true|try|using|while)\>" ## operators color magenta "[.:;,+*|=!\%?]" "<" ">" "/" "-" "&" -color magenta "[÷⋅×√∛⊻∈∉∋∌≈≉≠≡≢≤≥∩∪⊆⊇⊈⊉⊊⊋±∘]" +color magenta "[÷⋅×√∛⊻∈∉∋∌≈≉≠≡≢≤≥∩∪⊆⊇⊈⊉⊊⊋±∘']" ## functions color brightblue "[A-Za-z][A-Za-z0-9_]*\!?\.?[\(]" @@ -29,7 +29,7 @@ color green start="#=" end="=#" ## chars and strings color yellow start="[rb]?["]" end="["]" start="[rb]?["]{3}" end="["]{3}" -color yellow "[']\\?[^'][']" +color yellow "[']\\?[^' ][']" ## string interpolation color normal "\$\([^)]*\)"