g-code syntax hilighting for the vim editor |
Syntax hilighting for vim |
The syntax file I made (links/install how-to near the end of this email) is understandably remedial, given the single night of R&D, but it already properly |
Installation#make yourself a ~/.vim/ directory #make a syntax directory in there #save upload:ngc.vim into ~/.vim/syntax/ #save upload:filetype.vim into ~/.vim/ (or merge with your existing one, if any): #open, or restart vim #open any files with *.ngc extensions, and it should auto-highlight them You can also force highlighting with: :set syntax=ngc There are ways to have Vim check a few lines in the file to determine type, but that's more involved, and an exercise for a later date. You can duplicate the au! line in filetype.vim to add your own extension(s), or just modify the one that's already there (*.ngc). The syntax file I made is understandably remedial, given the single night of R&D, but it already properly |
types - all are linked to types that already exist in Vim. (as it should be.) |
types - all are linked to types that already exist in Vim. I happen to have a lot of my subtypes as the same core type colors, so there's actually more separation of highlight types than you're seeing, but already I think it's a bit easier to visually parse. |
* all g-codes� * all m-codes� |
* all g-codes * all m-codes |
* everything is case-insensitive, as w/ RS274 NGC gcode (g1, and G1 are the same) |
* everything is case-insensitive, as w/ NGC/LinuxCNC (g1, and G1 are the same) |
Installation#make yourself a ~/.vim/ directory # make a syntax directory in there #save [ngc.vim] into ~/.vim/syntax/ #save [filetype.vim] into ~/.vim/ (or merge with your existing one, if any): #open, or restart vim #open any files with *.ngc extensions, and it should auto-highlight them You can also force highlighting with: :set syntax=ngc There are ways to have Vim check a few lines in the file to determine type, but that's more involved, and an exercise for a later date. You can duplicate the au! line in filetype.vim to add your own extension(s), or just modify the one that's already there (*.ngc). I happen to have a lot of my subtypes as the same core type colors, so there's actually more separation of highlight types than you're seeing, but already I think it's a bit easier to visually parse. |
wiki powers, but if someone would like to add it, that would also be nice. Thanks! you're welcome, btw |
wiki powers, but if someone would like to add it, that would also be nice. Thanks! you're welcome. btw, how to edit wiki pages. |