[Home]History of Highlighting In Vim

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Revision 6 . . (edit) January 20, 2012 10:58 pm by CNCDreamer [rebranded]
Revision 5 . . June 1, 2008 4:06 pm by Fenn [upload: good or bad?]
Revision 4 . . June 1, 2008 3:53 pm by Fenn
  

Difference (from prior major revision) (minor diff, author diff)

Changed: 3c3
g-code syntax hilighting for the vim editor
Syntax hilighting for vim

Changed: 7c7,21
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

Changed: 10c24,25
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.

Changed: 23,24c38,39
* all g-codes�
* all m-codes�
* all g-codes
* all m-codes

Changed: 34c49
* 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)

Removed: 62,78d76

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.

Changed: 81c79
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.

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
Search:
Published under a Creative Commons License