Jeri Raye wrote: > Hi, > > Is it possible that what is found with a syn match to reuse the > content later on as the same? > > In other words: > > In my syntax file I have > +-------------------------------------------------------------------------+ > syn match pbConstant "^[[:alpha:]][[:alnum:]]*:\=" > > hi def link pbConstant TODO > +-------------------------------------------------------------------------+ > > In my code this highlights the words RS232, DISPLAY and KEYPAD of the > following lines: > > RS232 EQU $3D > DISPLAY EQU $3E > KEYPAD EQU $3F > > Is it possible to reuse the knowledge that RS232, DISPLAY and KEYPAD > are pbConstant so that they can be highlighted in the lines below? > > LOAD GP0, RS232 > LOAD GP1, DISPLAY > LOAD GP2, KEYPAD >
Not easily. Presumably one could write code that would extract the desired new symbol names; that could be done via techniques similar to what David Fishburn used in his <SrchRplcHiGrp.vim> plugin. Then one could build new syntax highlighting rules using the symbol text, and finally source the file in. One would need to decide when to do the above operations, too (manually, or automatically -- CursorHold? etc). Regards, Chip Campbell --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
