Good morning,
I'm looking but I'm not finding it.
Is there a ready-made lexer for the "*.txt" file extension?
Lexer to highlight *.txt files
-
- Posts: 2236
- Joined: 25.08.2021 18:15
Re: Lexer to *.txt
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'.
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'.
-
- Posts: 27
- Joined: 07.05.2024 18:58
Re: Lexer to *.txt
Alexey,
I will try to make one - from scratch - to meet my needs. Basically, the following highlights:
OK, I'm grateful. I had already found the one you mentioned, but it's not what I need.Text with indentation
I will try to make one - from scratch - to meet my needs. Basically, the following highlights:
- numbers (integers and float)
- URI
- 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
-
- Posts: 2236
- Joined: 25.08.2021 18:15
Re: Lexer to *.txt
But I don't think this lexer will be useful for many ppl. like lexer for some language.
-
- Posts: 27
- Joined: 07.05.2024 18:58
Re: Lexer to *.txt
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.
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.
- Attachments
-
- TXT.zip
- (1.49 KiB) Downloaded 346 times
-
- Posts: 21
- Joined: 05.05.2022 18:52
Re: Lexer to *.txt
Consider some ideas from Text IMprovied lexer https://synwrite.sourceforge.net/forums ... php?t=2839