SongTxt README
SongTxt is a simple Visual Studio Code extension that improves the experience around typing in music transcriptions in plain text files. It is built to follow the formatting guidelines used by Ultimate Guitar.
Install
Install the extension from the Visual Studio Marketplace or search for SongTxt
from the Extensions pane in Visual Studio Code.
Features
- Syntax Highlighting: Automatic highlighting for chords, song sections, and guitar tablature in
.txt
and .tab
files
- Toggle Control: Enable or disable SongTxt syntax highlighting on demand
- Status Bar Integration: Visual indicator showing current state with one-click toggle
- Smart File Detection: Automatically applies to Ultimate Guitar formatted text files
- Grammar Testing: Comprehensive regex testing to ensure accurate chord recognition
See the full list of features and documentation at the SongTxt Wiki.
Commands
SongTxt provides two commands accessible via the Command Palette (Ctrl+Shift+P
/ Cmd+Shift+P
):
- Enable SongTxt: Activates syntax highlighting for
.txt
and .tab
files
- Disable SongTxt: Deactivates syntax highlighting (files appear as plain text)
You can also toggle between enabled/disabled states by clicking the SongTxt status bar item.
Screenshot

Release Notes
Requirements
Extension Settings
Testing
Currently only grammar/regex tests are maintained.
Prerequisites
npm install
Run Tests
Compile then run the grammar test suite:
npm run compile
npm test
You should see output ending with something like 16 passing
(count may grow as new cases are added).
Add More Tests
Edit src/test/suite/grammar.test.ts
, add new test(...)
blocks, then rerun:
npm test
Lint
npm run lint
Troubleshooting
- If patterns disappear, confirm
syntaxes/songtxt.tmLanguage.json
still has the expected repository entries.
- After changing regex order, update indices in the test file or refactor to search by
comment
.
Acknowledgments / Open Source
SongTxt is built on and benefits from the wider open source ecosystem:
- Visual Studio Code Extension API – Copyright (c) Microsoft Corporation. Licensed under the MIT License.
- TypeScript – (c) Microsoft Corporation. Apache 2.0.
- Mocha (test framework) – (c) OpenJS Foundation and contributors. MIT.
- ESLint and @typescript-eslint – (c) OpenJS Foundation & Contributors. MIT.
- Node.js type definitions (@types/node) – DefinitelyTyped contributors. MIT.
- VS Code type definitions (@types/vscode) – Microsoft. MIT.
Tab / chord formatting inspiration: Community conventions as documented by Ultimate Guitar contribution rubric.
If you believe additional attribution is required for any component, please open an issue or pull request.