Saturday, January 8, 2011

Bat File Syntax Highlighter For Visual Studio 2010

I created an extension for Visual Studio 2010 to display batch files (.bat) with syntax highlighting.


The colors can be configured by editing a Python file named COLORS_DEFINITION.py.

 BAT_COLORS_DEFINITIONS =  { 
     "Keyword"        :  "Blue",             # Echo, Copy any Bat keyword 
     "Comment"        :  "Green",            # rem 
     "Param"          :  "Brown",            # /b /s 
     "Label"          :  "Darkmagenta",      # label 
     "EnvVar"         :  "MediumPurple",     # %TEMP% 
     "Redirection"    :  "Red",              # > and >>  
     "Default"        :  "Black" 
 }

Download the extension at http://visualstudiogallery.msdn.microsoft.com/en-us/6706b602-6f10-4fd1-8e14-75840f855569

4 comments:

  1. Where is the COLORS_DEFINITION.py file located?

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. Found it at:
      C:\Users\[user_name]\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Frederic Torres\TextHighlighterExtension\1.3

      Delete
  2. Thank you for sharing this. I have been missing this basic feature for quite some time.

    ReplyDelete