LinePeek

Display line counts directly in the VS Code Explorer
LinePeek is a lightweight Visual Studio Code extension that shows the number of lines in each file as a badge in the Explorer sidebar, helping you quickly identify file sizes and navigate large codebases with ease.

Table of Contents
Features
- ⚡ High Performance – Stream-based file reading and intelligent caching ensure minimal impact on VS Code's performance, even in large workspaces
- 🎯 Unobtrusive Design – Line counts appear as subtle badges that don't clutter the Explorer view
- ⚙️ Configurable – Customize which file types to ignore based on extension
- 🔄 Real-time Updates – Line counts automatically refresh when files are saved
- 🛡️ Smart Filtering – Automatically skips binary files, large files (>10MB), and directories
- 🎨 Theme Aware – Uses VS Code's native theming for consistent appearance
Installation
From the VS Code Marketplace
- Open VS Code
- Go to Extensions (
Cmd+Shift+X / Ctrl+Shift+X)
- Search for "LinePeek"
- Click Install
From the Command Line
code --install-extension brunobrise.linepeek
From Open VSX Registry
For VS Code-compatible editors (VSCodium, etc.):
wget https://open-vsx.org/api/brunobrise/linepeek/0.0.1/file/brunobrise.linepeek-0.0.1.vsix
Usage
LinePeek works automatically once installed. Open any folder in VS Code and you'll see line counts displayed as badges next to files in the Explorer sidebar.
What Gets Counted
- ✅ Text files with valid extensions
- ✅ Files smaller than 10MB
- ✅ Files with standard line endings (LF, CRLF)
What Gets Skipped
- ❌ Directories and virtual folders
- ❌ Binary files (images, videos, archives, executables)
- ❌ Files larger than 10MB (performance protection)
- ❌ Files with extensions in your ignore list
Configuration
LinePeek can be configured through VS Code settings. Access settings with Cmd+, (macOS) or Ctrl+, (Windows/Linux).
Settings
| Setting |
Type |
Default |
Description |
linepeek.enable |
boolean |
true |
Enable or disable line count decorations globally |
linepeek.ignoredFileExtensions |
string[] |
See list below |
File extensions to exclude from line counting |
Default Ignored Extensions
The following extensions are ignored by default to avoid counting binary or non-text files:
| Category |
Extensions |
| Images |
png, jpg, jpeg, gif, bmp, ico, tiff, webp, svg |
| Video |
mp4, mov, avi, mkv |
| Audio |
mp3, wav, flac |
| Archives |
zip, tar, gz, 7z, rar |
| Executables |
exe, dll, so, dylib, bin |
| Documents |
pdf, doc, docx, xls, xlsx, ppt, pptx, odt, ods, odp |
| Disk Images |
iso |
Custom Configuration Example
Add to your .vscode/settings.json or global VS Code settings:
{
"linepeek.enable": true,
"linepeek.ignoredFileExtensions": ["png", "jpg", "min.js", "map", "lock"]
}
Disabling for Specific Workspaces
To disable LinePeek for a specific project, add to that project's .vscode/settings.json:
{
"linepeek.enable": false
}
How It Works
LinePeek uses VS Code's FileDecorationProvider API to add badges to file items in the Explorer. Here's how it operates:
- Lazy Loading – Line counts are calculated only when files become visible in the Explorer
- Stream-Based Reading – Uses Node.js streams to count newlines without loading entire files into memory
- Smart Caching – Caches results to avoid re-reading files that haven't changed
- Incremental Updates – Clears cache entries only for files that are modified or saved
- Size Limits – Skips files over 10MB to maintain IDE responsiveness
Line Counting Logic
LinePeek uses a counting algorithm that matches standard editor behavior:
- Empty file →
0 lines
- File with content but no newlines →
1 line
- File with newlines → newline count + 1
This matches how VS Code and most editors display line numbers.
Contributing
We welcome contributions! Please read our Contributing Guide for details on:
- Setting up your development environment
- Coding standards and conventions
- Submitting pull requests
- Commit message conventions (we use Conventional Commits)
Quick Start for Contributors
# Clone the repository
git clone https://github.com/brunobrise/linepeek.git
cd linepeek
# Install dependencies
npm install
# Start development mode
npm run watch
Press F5 in VS Code to launch the extension in a new Extension Development Host window.
Changelog
See CHANGELOG.md for a detailed history of changes and releases.
Latest Release (0.0.1)
- Initial release with core line counting functionality
- Configuration support for enable/disable and ignored extensions
- Efficient caching system
- Real-time updates on file save
- Large file protection (>10MB)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Support
Made with ❤️ by Bruno Brise