Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whole commented lines in green #2

Open
fotomas opened this issue Mar 13, 2015 · 10 comments
Open

Whole commented lines in green #2

fotomas opened this issue Mar 13, 2015 · 10 comments

Comments

@fotomas
Copy link

fotomas commented Mar 13, 2015

It is a bit difficult to distinguish commented lines (starting with semicolon) from live lines.
I suggest that the commented lines are in one one color that differs from all the other colors. Preferably green. The fact that M-commands are highlighted in in commented lines are bit confusing.

@themachinist
Copy link
Owner

Hi! Thanks for opening this issue. Could you share which color scheme you are using?

@Manouchehri
Copy link
Contributor

Uploading a screenshot would also help a lot.

@fotomas
Copy link
Author

fotomas commented Apr 4, 2015

sublime

Also Coloring G-Codes the same way as with M-Codes would be helpful for me. As of now the are to anonymous.

@creyc
Copy link

creyc commented Apr 27, 2015

@fotomas it looks like you're using the Monokai color scheme, I get the same result here.

This syntax seems to work a lot better with the Cobalt color scheme.

@themachinist
Copy link
Owner

Hi guys. I apologize for the delay in getting out an update. Just wanted to state that I am aware of the issue and there are some updates in process that address the issue. My semester is over in May and I will have some free time then. In the mean time feel free to make a push request. Thanks for your patience.

@digex
Copy link

digex commented May 28, 2015

I adapted plugin for use with the theme Monokai extended
2015-05-28 13-32-26
Unpack zip in %appdata%\Sublime Text 3\Packages\ , then select View-Syntax-CNC

Work best with Fanuc Oi.
For best use without file extensions, install plugin ApplySyntax and put this code in "default_syntaxes" section file ApplySyntax.sublime-settings ==> Preferences - Package settings - ApplySyntax - Settings-User

        {
            "name": "CNC/CNC",
            "match": "all",
            "rules": [
                {"contains": "(G0)|(M30)"},
                {"contains": "(O)"}
            ]
        },

ZIP - https://yadi.sk/d/VcV-Am7ogvMCp

@ElectricRCAircraftGuy
Copy link

Any update on this? I'd love to see comment syntax highlighting working too. Many thanks.

@themachinist
Copy link
Owner

I didn't realize anyone was still using this and I was surprised to find it in the package manager a few days ago. It's been years since I maintained this project, but I am using it again so I will take a look into this issue over the next couple of weeks.

@ElectricRCAircraftGuy
Copy link

ElectricRCAircraftGuy commented Mar 19, 2022

@themachinist , yeah, people are definitely still using it. It's the only gcode syntax highlighter available in the Package Manager for Sublime Text. You've got 8000 downloads, with 2 to 6 new downloads per day, every day. See the graph here. I'm getting into 3D printers and using it now, for instance, to look at gcode files to print objects.

@digex 's zip file above works pretty well, by the way. Take a look at it for some pretty useful changes.

I installed it in Sublime Text 4 in Linux Ubuntu 20.04 like this:

  1. Install the G-code Syntax Highlighting plugin like normal using the Sublime Text package Manager
  2. In Sublime Go to Preferences --> "Browse Packages...". This opens up my GUI file manager in this dir: /home/gabriel/.config/sublime-text-3/Packages
  3. In this Packages dir, create another dir named G-code Syntax Highlighting.
  4. Extract @digex 's "cnc" zip into this dir.
  5. Now, in Sublime Text, I automatically see it as an option in the list of syntax highlighters:
    image

Comparison of the syntax highlighting:

This is a Marlin g-code file generated by the Cura 3D printer slicer engine.

The G-code syntax highlighting, provided by this repo in its current state, is on the left, and the syntax highlighting provided by @digex's zip file above is on the right. It looks much better. This is in Sublime Text 4 (build 4126), with Monokai, from Sublime Text 3, selected as the color theme:

image

@ElectricRCAircraftGuy
Copy link

ElectricRCAircraftGuy commented Mar 24, 2022

I've completed my brand new gcode syntax highlighter. It adds highlighting for comments, and makes many other improvements too. I've opened a PR to add it to Sublime's Package Control package too. If anyone would like to use it meanwhile, manual installation instructions are in the main readme: https://github.com/ElectricRCAircraftGuy/sublime_gcode

Bit thanks to @themachinist for paving the way on this syntax highlighter. Without his work I would not have know where to begin with this, as it was a very large undertaking for me to figure out this past weekend and each evening up to now.

Screenshots:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants