A comprehensive syntax highlighter and autocorrector for Script2Plot (s2ps) screenwriting format, providing intelligent assistance for both character syntax and character dialogue syntax.
- Color-coded command types for easy visual parsing:
- Title commands: Yellow (
#FFFF00) - Character projection commands: Cyan (
#00FFFF) - Scene commands: Indigo (
#4B0082) - Sound commands: Blue (
#0000FF) - Music commands: Turquoise (
#40E0D0) - Character commands: Gray (
#808080) - Action commands: Dark red (
#AA0011) - Effect commands: Autumn grey (
#8C8F75) - Textplate commands: Tan (
#D2B48C)
- Title commands: Yellow (
- Parameter highlighting: Light blue (
#9CDCFE) - Function syntax: Purple (
#c7cdff) for names, light gray (#b5c2cf) for arguments - Comments: Green italic (
#6A9955)
- Character Syntax Autocorrection: Automatically fixes common character syntax errors
- Character Dialogue Syntax Autocorrection: Intelligently corrects dialogue formatting issues
- Real-time suggestions as you type
- Context-aware corrections based on s2ps formatting rules
- Full support for
.s2psfile extensions - Language ID:
s2ps - Aliases:
Script2Plot,s2ps
- Visual Studio Code version 1.60.0 or higher
- No additional dependencies required
This extension contributes the following syntax highlighting rules through configurationDefaults:
s2ps.command.title: Title commandss2ps.command.chrpjtl: Character projection commandss2ps.command.scene: Scene commandss2ps.command.sound: Sound commandss2ps.command.music: Music commandss2ps.command.char: Character commandss2ps.command.action: Action commandss2ps.command.effect: Effect commandss2ps.command.textplate: Textplate commands
s2ps.parameter: Command parameterss2ps.function.name: Function namess2ps.function.argument: Function argumentscomment.line.s2ps: Line comments
The autocorrector activates automatically when editing .s2ps files. It provides:
-
Visual Indicators:
- Unknown characters are underlined with a yellow squiggly line
- Hover to see:
Unknown character "Gooo". Did you mean "Goomo"?(s2ps:fix:Goomo)
-
Quick Fix Hotkeys (when cursor is on/near the error):
- Enter: Automatically apply the suggested correction
- Tab: Also applies the suggested correction
- Both keys insert normal newline/tab if no correction is available
-
Traditional Methods:
- Press
Ctrl+.(Windows/Linux) orCmd+.(macOS) for Quick Fix menu - Click the lightbulb icon when hovering
- Press
-
Intelligent Matching:
- Uses fuzzy matching to suggest corrections
- Considers character definitions from
@charand@chrpjtlcommands - Case-insensitive with smart distance calculations
The autocorrector runs in the background and provides suggestions through VS Code's suggestion interface. You can accept corrections by pressing Tab or Enter when suggestions appear.
*The type of autocorrector is similar but better than the claude.ai version made with react.js I've eventually scrapped.
Initial release of Script2Plot Syntax extension featuring:
- Complete syntax highlighting for all s2ps command types
- Built-in autocorrector for character syntax
- Built-in autocorrector for character dialogue syntax
- Color-coded visual differentiation of script elements
- Support for
.s2psfile extensions
- Create a new file with
.s2psextension - Start typing your script - syntax highlighting will activate immediately
- Use s2ps commands (title, scene, char, action, etc.) - they will be automatically color-coded
- The autocorrector will provide suggestions for character and dialogue syntax as you type
- Split editor:
Cmd+\(macOS) orCtrl+\(Windows/Linux) - Toggle suggestions:
Ctrl+Space(all platforms) - Accept suggestion:
TaborEnter
Happy screenwriting with Script2Plot!