Julia syntax highlighting

55 views
Skip to first unread message

Sébastien Celles

unread,
Oct 11, 2018, 3:58:21 AM10/11/18
to niceeditor
Hello,

currently Julia syntax highlighting is not supported out-of-the-box (.jl extension)
It will be nice to add this language support

Kind regards

John Gabriele

unread,
Jan 4, 2020, 12:07:01 AM1/4/20
to niceeditor
As a temporary workaround, if you find that ne already has support for a language with somewhat similar syntax and keywords to Julia, you can copy the relevant $ne-global-dir/syntax/whatev.jsf file to your ~/.ne/syntax directory, renaming it in the process to julia.jsf. For example, you might try:

    cp /usr/local/share/ne/syntax/python.jsf ~/.ne/syntax/julia.jsf

(though I see that doesn't catch `#= multiline
comments =#`.)

Then whenever you open a .jl file, run `^k sy julia` first thing to enable the syntax highlighting.

I don't think there's currently a way to configure ne automatically run that `^k sy julia` for you upon opening a .jl file.

-- John

John Gabriele

unread,
Jan 4, 2020, 1:08:19 AM1/4/20
to niceeditor


On Saturday, January 4, 2020 at 12:07:01 AM UTC-5, John Gabriele wrote:

I don't think there's currently a way to configure ne automatically run that `^k sy julia` for you upon opening a .jl file.


Whoops. I'm mistaken. As I think has been pointed out to me in the past, you can save an auto-pref for the julia filetype that sets its syntax to julia. That is,

 1. open a .jl file
 2. do `^k sy julia`
 3. go to the Prefs menu and choose "Save Auto Prefs"

This will create a ~/.ne/jl#ap file with all your current settings, including the all-important "Syntax julia" line.

You could also manually create this `~/.ne/jl#ap` file yourself and just put that one line in it:

    Syntax julia

and that would work too.

Now when you open a .jl file that syntax will be automatically set for you.

-- John

John Gabriele

unread,
Jun 19, 2020, 2:05:02 PM6/19/20
to niceeditor
Oy! Sorry, my "temporary workaround" advice about copying and renaming an existing jsf is not optimal. There's no need to copy any jsf file. Just open your .jl file, do the `^k sy python` or whatever existing jsf that get you close enough for now, and save auto prefs.

That is, same as my last post, but just choose the existing syntax file that works best. No need to copy it to your ~/.ne/syntax and rename, and in fact that might even cause confusion.

-- John
Reply all
Reply to author
Forward
0 new messages