LTspice Syntax Highlighter
A comprehensive Visual Studio Code extension that provides syntax highlighting for LTspice files with full theme support.
Features
Complete LTspice Support: Syntax highlighting for all major LTspice file types:
.asc - Schematic files
.lib - Library files
.asy - Symbol files
.sub - Subcircuit files
Theme Compatible: Works seamlessly with all VS Code themes (Dark+, Light+, Gruvbox, Material Theme, etc.)
Smart Highlighting: Recognizes and highlights:
- SPICE directives (
.MODEL, .SUBCKT, .PARAM, etc.)
- Component declarations (resistors, capacitors, transistors, etc.)
- Analysis commands (
.AC, .DC, .TRAN, etc.)
- SYMATTR/PINATTR commands with distinct coloring
- PARAMS: declarations with parameter assignments
- Numeric values with docstring-like highlighting (similar to Python)
- Parameters and attributes
- Comments (
; and * style)
- Coordinates and string literals
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "LTspice Syntax Highlighter"
- Click Install
Or install from VSIX:
- Download the
.vsix file
- Open VS Code
- Run
Extensions: Install from VSIX... from Command Palette
- Select the downloaded file
Supported File Types
| Extension |
Description |
Language ID |
.asc |
LTspice Schematic Files |
ltspice-schematic |
.lib |
LTspice Library Files |
ltspice-library |
.asy |
LTspice Symbol Files |
ltspice-symbol |
.sub |
LTspice Subcircuit Files |
ltspice-subcircuit |
Examples
Schematic Files (.asc)
VERSION 4
SHEET 1 880 680
WIRE 64 80 32 80
WIRE 96 80 64 80
SYMBOL voltage 32 96 R0
SYMATTR InstName V1
SYMATTR Value 5
Library Files (.lib)
.MODEL D1N4148 D(IS=2.52n RS=0.568 N=1.752 CJO=4p M=0.4 TT=20n)
.MODEL 2N2222 NPN(IS=14.34f XTI=3 EG=1.11 VAF=74.03 BF=255.9)
Symbol Files (.asy)
Version 4
SymbolType CELL
LINE Normal 0 44 32 44
LINE Normal 0 20 32 20
RECTANGLE Normal 32 52 0 12
PIN 0 32 NONE 8
PINATTR PinName A
Theme Compatibility
This extension uses semantic token scopes that work with all VS Code themes:
keyword.control - Directives and commands
entity.name.type - Component types and models
variable.parameter - Parameters and attributes
constant.numeric - Numbers and coordinates
string.quoted - String literals
comment.line - Comments
Contributing
Found a bug or want to contribute? Visit our GitHub repository.
License
MIT License - see LICENSE file for details.
Release Notes
1.0.0
- Initial release
- Support for .asc, .lib, .asy, and .sub files
- Complete syntax highlighting with theme support
- Smart recognition of SPICE directives and components