|
Post by bigbass on Apr 25, 2020 0:43:43 GMT 1
I wrote a syntax file for the nano console editor should work for pico too BaCon.nanorcjust copy the file to the nano configuration folder sudo cp BaCon.nanorc /usr/share/nano bacon-nano-1.01.tar.gz (2.16 KB) detects .bac and .m4b I just did it for a fun project so that we have more options to use bacon Joe
|
|
|
Post by Pjot on Apr 25, 2020 7:20:26 GMT 1
Thanks Joe,
That comes handy indeed!
BR Peter
|
|
|
Post by bigbass on Apr 25, 2020 17:13:24 GMT 1
Thanks
only when the display is giving problems or working on the phone or tablet console apps are useful
for an emergency but to see friendly syntax is always nice
I did a minor update (as you know syntax highlighting requires a lot of tweaking) I tested on bacon.bac so it should catch most keywords correctly now
Joe
|
|
|
Post by bigbass on May 2, 2020 17:13:57 GMT 1
I made a menu entry (nano.desktop) for the RPI for nano the readme says what to do now you don't have to type the filename anymore it will save you the trouble nano-desktop-entry.tar.gz (554 B) you have to do this one time so that it is offered as a choice to open files now you can have a nice simple option to open files edit them and have bacon syntax highlighting too when you want to compare code snippets select copy and paste work also too many white screens I like to know where the different window is quickly its super stable and just works Joe
|
|
|
Post by rikky on May 28, 2020 6:15:25 GMT 1
so it should catch most keywords correctly now
I've checked thoroughly through the BaCon documentation (txt) and you have forgotten nothing. Only the DIR statement you have extra, so I flipped it out. But maybe I am mistaken, and DIR does actually mean something. I had to change syntax BaCon "\.(bac|m4b)$ into syntax "BaCon" "\.(bac|m4b)$" and all the icolors into colors Otherwise it gives me the following errors: Error in /usr/share/nano/BaCon.nanorc on line 7: A syntax name must be quoted Error in /usr/share/nano/BaCon.nanorc on line 11: A 'color' command requires a preceding 'syntax' command Error in /usr/share/nano/BaCon.nanorc on line 12: A 'color' command requires a preceding 'syntax' command Error in /usr/share/nano/BaCon.nanorc on line 13: A 'color' command requires a preceding 'syntax' command etc Press Enter to continue starting nano. So I took the liberty to add your extra keywords into the filetypes.BaCon.conf as it is found in the latest Fossil. its super stable and just works If only it had an option of spitting out the edited text to standard output after finishing. Rik. Attachments:syntax_highlite.tgz (4.77 KB)
|
|
|
Post by bigbass on May 28, 2020 15:47:49 GMT 1
Hello Rik
I didn't get any errors
but yes that is correct and I will change it
syntax "BaCon" "\.(bac|m4b)$"
I also will change to color instead of icolor
Thanks for the feedback just getting all that code to parse I'm sure there are some little mistakes in there even still its alpha first version quality
as your question about standard out from nano
this works but using old school select (highlighted)text in nano open a terminal and press the down the scroll wheel on the mouse be careful what you select to test with because it will run that code as is
maybe I missed something your end goal in saving the text editor buffer to standard out if so there is probably a way to do it since nano is one of those survival tools
Joe
|
|
|
Post by rikky on May 29, 2020 12:38:37 GMT 1
Well, with a few workarounds it is actually possible. tempbac$ = CHOP$(EXEC$("mktemp"))
SYSTEM "nano --syntax=BaCon --mouse --tempfile --nohelp " & tempbac$ & ".bac"
PRINT "compiling ... please wait."
response$ = EXEC$("/usr/bin/bacon" & " -y -s " & tempbac$ & ".bac") retval = RETVAL IF retval THEN EPRINT "Program exited with status " & STR$(retval) EPRINT response$ END retval END IF
SYSTEM tempbac$
SYSTEM "rm -f " & CHR$(34) & tempbac$ & "*" & CHR$(34) SYSTEM "rm -f " & CHR$(34) & "/tmp/Makefile.bacon" & CHR$(34)
So I 've thrown out my editor in the bash for dummy's program and replaced it with nano. For I was nearly there and had it (almost ready, with syntax highlighting and all), but nano is not a little bit quicker, but several multi factors quicker. And it has mouse support. Closing the file is ^X I believe, in nano, but that can be changed in the nanorc. I prefer ^d, and that would then be bind ^d exit all So a lot of work is now down the drain, but the result is so much better. And I learned a lot. Thanks for the suggestion. Coming up in a few minutes in 'Bash for dummys'. Rik.
|
|
|
Post by bigbass on May 29, 2020 18:26:28 GMT 1
Hello Rik (and others) Glad things worked for you for what you want to do and nano has config files to ease the pain for options that are frequently used I added color auto save tmp file and line numbers color and reset some of the control keys bacon-nano-1.02.tar.gz (6.3 KB) to test you could use wget -O documentation.bac http://www.basic-converter.org/documentation.txt nano documentation.bac a bash one liner to compile and run echo "PRINT \"TEST\" " > t.bac && bacon t && ./t when I feel lazy testing I just name the file with one letter t.bac bacon t ./t Joe
|
|
|
Post by rikky on May 30, 2020 8:02:24 GMT 1
A very important one: bind F1 mouse all If you have mouse support enabled, copy/past doesn't work anymore, so you have to toggle it off to copy past (with the left mouse button). I wanted ^M, but that one is the 'short' key for the enter key, and if you use that one, your enter key becomes the mouse toggle key, and doesnt enter anymore. And I've tested with TYPE VAR FROM TO and STEP, putted in the brightblue section, and that seem to just work. Nano recognises the TYPE being solo or part of the VARTYPE etc. This is one you also do not want to miss: color yellow start="/\*" end="\*/" and this one: comment "' " Now you can comment multiple lines at once with esc a, Then select text with arrowkeys. (unfortunately not the left mouse button) esc 3. And all your selected lines are commented. esc a again to disselect. Nice feature but I wont be able to remember this for longer then 2 days. Rik. Attachments:nano.tgz (5.79 KB)
|
|
|
Post by ptitjoz on Jun 11, 2020 7:43:33 GMT 1
I wrote a syntax file for the nano console editor should work for pico too BaCon.nanorcjust copy the file to the nano configuration folder sudo cp BaCon.nanorc /usr/share/nano detects .bac and .m4b I just did it for a fun project so that we have more options to use bacon Joe It's funny, I did something similar. but my code is not as successful as yours.
Regards
|
|