Right-click any file in the VSCode explorer to produce a numbered copy — like running cat -n on Unix, but integrated into your editor.
Why
Coverage reports, error messages, and test output all reference line numbers. When you paste code into a chat with an AI assistant, line numbers are lost and the AI has to count lines manually or estimate. Numbered Cat gives you a one-click way to get a numbered version of any file — either straight to your clipboard or saved to disk as a permanent artifact.
Every other line-numbers extension copies a selection to your clipboard. Numbered Cat works on the whole file, directly from the explorer panel.
Usage
Right-click any file in the Explorer panel. You'll see two options:
Copy with Line Numbers
Puts the numbered content straight into your clipboard. Nothing is written to disk — just paste directly into your AI chat, email, or wherever you need it.
Save with Line Numbers
Writes a numbered copy to disk next to the source file:
1 <?php
2
3 namespaceApp\Http\Controllers;
4
5 use Illuminate\Support\Facades\Storage;
Line number width scales automatically with the file length — a 50-line file uses 2-digit padding, a 500-line file uses 3-digit padding, and so on.
Configuration
All settings apply to the Save with Line Numbers command and are under the numberedCat namespace in your VSCode settings.
| Setting | Type | Default | Description |
|---|---|---|---|
numberedCat.outputDirectory |
string | Same directory as source | Where to write the output file. Accepts absolute paths and ${workspaceFolder}. |
numberedCat.outputSuffix |
string | (empty) | Suffix appended to the filename before the extension. |
numberedCat.outputExtension |
string | numbered |
Output file extension. Defaults to numbered, producing e.g. file.php.numbered. |
numberedCat.promptForFilename |
boolean | false |
If true, shows an input box before writing so you can override the output filename. |
Example: always produce a .txt file in a dedicated folder
"numberedCat.outputDirectory": "${workspaceFolder}/numbered-exports",
"numberedCat.outputExtension": "txt"
GigController.blade.php → numbered-exports/GigController.blade.php.txt
License
MIT