Page 1 of 1
Lexer to highlight *.txt files
Posted: 16.05.2024 03:54
by jcfaria.uesc
Good morning,
I'm looking but I'm not finding it.
Is there a ready-made lexer for the "*.txt" file extension?
Re: Lexer to *.txt
Posted: 16.05.2024 05:50
by main Alexey
We have lexer "Text with indentation" but it is not assigned to .txt filetype, you need to use this feature:
https://wiki.freepascal.org/CudaText#File_types
Lexer is in the Addons Manager.
you can also create empty lexer (in SynWrite, as wiki tells) and make custom features there.
e.g. you can highlight 'numbers' or 'quoted strings'.
Re: Lexer to *.txt
Posted: 16.05.2024 14:23
by jcfaria.uesc
Alexey,
Text with indentation
OK, I'm grateful. I had already found the one you mentioned, but it's not what I need.
I will try to make one - from scratch - to meet my needs. Basically, the following highlights:
- numbers (integers and float)
- Notes in 3 levels (as was done for my Lexer R derivation)
- text between single and double quotes for multiline
- and a few more little things
Best,
Re: Lexer to *.txt
Posted: 16.05.2024 16:02
by main Alexey
But I don't think this lexer will be useful for many ppl. like lexer for some language.
Re: Lexer to *.txt
Posted: 16.05.2024 18:27
by jcfaria.uesc
It will be made for my use!
Re: Lexer to *.txt
Posted: 20.05.2024 03:49
by jcfaria.uesc
I use files.txt a lot for almost all my activities as a university professor: notes, teaching classes, presentations at events, etc.
I stopped wasting time creating very elaborate slide-style presentations, even the ones I used to do in LaTeX. Over time I started replacing all the slides with files.txt: it's much more practical and functional, as long as you have a good text editor with good - and customizable - syntax highlighting.
To make my files like *.txt interesting, I developed, over time, my own syntax (figures attached). I believe there are no references elsewhere, as I have never heard of comments for *.txt files, much less notes (three levels) derived from comments. Let's say it's my conception of what *.txt files might look like.
I leave the style - still simple, but functional - that I created - for files with the *.txt extension available to the community for anyone who wants to use it.
If Alexey finds it interesting, he can put it in the CudaText repositories for all users.
Re: Lexer to *.txt
Posted: 20.05.2024 05:01
by main Alexey
Thanks, good work.
Re: Lexer to *.txt
Posted: 11.06.2024 23:48
by dimon40001
jcfaria.uesc wrote: ↑16.05.2024 03:54
Is there a ready-made lexer for the "*.txt" file extension?
Consider some ideas from Text IMprovied lexer
https://synwrite.sourceforge.net/forums ... php?t=2839