have ne automatically apply syntax highlighting based on filename extension?

16 views
Skip to first unread message

John Gabriele

unread,
Aug 12, 2019, 9:57:18 PM8/12/19
to niceeditor
I have a ~/.ne/syntax/haxe.jsf file (for now, just copied the java one), and I'd like ne to apply that syntax highlighting when I open a .hx file. How can I configure ne to do that?

Currently I have to run `^k sy haxe` each time I open a .hx file.

Thanks!

todd_...@unc.edu

unread,
Aug 13, 2019, 6:43:02 AM8/13/19
to niceeditor
Be sure the line `Syntax haxe` is in the `~/.ne/hx#ap` file. One way to do that is to invoke the `SaveAutoPrefs` command either from the command line or from the `Prefs` menu after you have (1) loaded a document the name of which has a `.hx` extension and (2) have set the `syntax` to `haxe`. It will save a bunch of other things in the `~/.ne/h#ap` file too, any of which you can remove or change as you want. For example, my `c#ap` contains:
AutoIndent 1
AutoMatchBracket 1
AutoPrefs 1
Binary 0
CaseSearch 0
ClipNumber 0
DelTabs 0
DoUndo 1
FreeForm 1
HexCode 1
Insert 1
NoFileReq 0
PreserveCR 0
RightMargin 0
ShiftTabs 0
Syntax c
Tabs 1
TabSize 3
UTF8Auto
1
VisualBell 1
WordWrap 0

John Gabriele

unread,
Aug 13, 2019, 1:04:45 PM8/13/19
to niceeditor
Ah! Thanks! I manually created that ~/.ne/hx#ap file, and put only one line in it: Syntax haxe. Works great. :)

(Incidentally, the csharp.jsf highlighter so far seems to work a little better for Haxe than the java.jsf.)

Reply all
Reply to author
Forward
0 new messages