Plan Syntax Highlighter is a Visual Studio Code extension that provides custom syntax highlighting for text files (plan.txt). The extension allows you to assign specific colors to lines that start with certain characters or have special patterns, making it easier to visually categorize different types of content.
Features
This extension highlights lines in plan.txt files based on the following patterns:
Comments (//): Highlighted in green.
Important lines (#): Highlighted in purple.
Red lines (*): Highlighted in red.
Rose lines (!): Highlighted in rose.
Tag lines (@): Highlighted in tag color (orange).
Lines with leading whitespace: Highlighted in green.
All other lines: Highlighted in blue.
Example:
// This is a comment (green)
# This is an important line (purple)
* This is a red line (red)
! This is a rose line (rose)
@ This is a tag line (orange)
This line starts with whitespace (green)
This is a normal line (blue)
Installation
Download and install Visual Studio Code.
Go to the Extensions Marketplace.
Search for Plan Syntax Highlighter and click Install.
Alternatively, you can install it directly from within Visual Studio Code:
Open VS Code.
Click on the Extensions view icon on the Sidebar (or press Ctrl+Shift+X).
Search for Plan Syntax Highlighter.
Click Install.
Usage
Create or open a file named plan.txt.
The syntax highlighting will automatically apply based on the predefined rules.
Customization
Currently, the following patterns are recognized:
Lines starting with // are comments.
Lines starting with # are marked as important.
Lines starting with * are highlighted in red.
Lines starting with ! are highlighted in rose.
Lines starting with @ are marked as tag lines.
Lines with leading whitespace are highlighted in green.
All other text lines are highlighted in blue.
You can customize the syntax and colors by modifying the extension files (planlang.tmLanguage.json and plan-theme-color-theme.json).
Development
To modify this extension or contribute:
Clone the repository.
Open the project in Visual Studio Code.
Run the extension by pressing F5.
This will open a new VS Code window where the extension is applied. Make any modifications and test them live.