Marius Roets wrote:
Hi Vimmers,
I have a big a (3000+ lines) source code file. The syntax highlighting
works perfectly, so all keywords are highlighted correctly. Is there
any way that I can use this fact to convert all keywords to uppercase,
or do I have to do them all one by one?

Thanks
Marius


I think it should be possible to write a function or command to put the cursor on each word in turn, determine if it is a keyword, and depending on the result, do either nothing or "normal gUaw" (without the quotes). You may want to do this within a visual highlighted area (i.e., from mark `< to mark `> ) or as a command accepting a range (like the :s command).

Note that highlight names usually vary from language to language. Three may even be several in a single language: e.g. vimAutoCmd links to vimCommand which links to Statement

See
        :help text-objects
        :help gU
        :help synID()
        :help synIDattr()
        :help synIDtrans()
        :help line()
        :help col()
        :help :command
        :help :function


Best regards,
Tony.

Reply via email to