NewPlus for VS Code

Create files and folders from templates with context-aware suggestions and workspace intelligence. A powerful VS Code extension that brings PowerToys NewPlus functionality to your editor.
✨ Features
🎯 Smart Template Selection
- Context-Aware Filtering: Automatically suggests templates based on your current location and project type
- Workspace Intelligence: Detects Node.js, Python, Java, and other project types
- File vs Folder Context: Shows appropriate templates when right-clicking files or folders
📝 Template System
- File Templates: Individual files with variable substitution
- Folder Templates: Complete directory structures with multiple files
- Variable Support: Built-in variables (
$DATE$, $USER$, $WORKSPACE_NAME$, etc.)
- PowerToys Compatible: Uses PowerToys NewPlus template directory structure
🚀 Seamless Integration
- Explorer Context Menu: Right-click to create from templates
- Command Palette: Quick access via
Ctrl+Shift+P → "New+"
- Progress Feedback: Visual progress for multi-file operations
- Smart Naming: Context-aware default names with validation
🎬 Quick Start
Installation
From VS Code Marketplace:
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Search for "NewPlus"
- Click Install
From VSIX:
- Download
newplus-1.0.1.vsix from releases
- Open VS Code
- Run
Extensions: Install from VSIX...
- Select the downloaded file
🎯 Usage
Creating from Templates
Via Context Menu (Recommended)
- Right-click on any folder in the Explorer
- Select "New+"
- Choose a template (filtered by context)
- Enter a name and any custom variables
- Done! 🎉
Via Command Palette
- Press
Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
- Type "New+"
- Select your template
- Follow the prompts
Template Structure
Templates are stored in:
Windows: %LOCALAPPDATA%\Microsoft\PowerToys\NewPlus\Templates
Mac/Linux: ~/.local/share/Microsoft/PowerToys/NewPlus/Templates
File Template Example:
MyComponent.tsx
Folder Template Example:
ReactComponent/
├── index.tsx
├── styles.module.css
└── __tests__/
└── component.test.tsx
🔧 Variables
Templates support powerful variable substitution:
Built-in Variables
| Variable |
Description |
Example |
$DATE$ |
Current date |
2025-10-06 |
$TIME$ |
Current time |
14:30:45 |
$YEAR$ |
Current year |
2025 |
$MONTH$ |
Current month |
10 |
$DAY$ |
Current day |
06 |
$USER$ |
Current user |
jhaisley |
$RANDOM$ |
Random number |
42857 |
$UUID$ |
UUID v4 |
a1b2c3d4-... |
Context Variables (Auto-filled)
| Variable |
Description |
$WORKSPACE_NAME$ |
Active workspace name |
$TARGET_DIR$ |
Target directory name |
$TARGET_PATH$ |
Full target path |
Note: Custom variable prompts are not currently implemented. Only the built-in and context variables listed above are supported.
⚙️ Configuration
| Setting |
Type |
Default |
Description |
newFromTemplate.templatesPath |
string |
%LOCALAPPDATA%\Microsoft\PowerToys\NewPlus\Templates |
Templates directory path |
newFromTemplate.display.hideFileExtensions |
boolean |
true |
Hide extensions in picker |
newFromTemplate.display.hideSortingPrefix |
boolean |
false |
Hide leading numbers (e.g., 01.) |
newFromTemplate.behavior.replaceVariablesInFilename |
boolean |
false |
Enable variables in filenames |
Commands
| Command |
Description |
New+ |
Create from template |
New+: Open Templates Folder |
Open templates directory |
🧠 Smart Features
Context Detection
NewPlus detects your project type and suggests relevant templates:
- Node.js → JavaScript/TypeScript templates
- Python → Python module templates
- Java → Class/interface templates
- Generic → All templates
Workspace Integration
- ✅ Multi-root workspace support
- ✅ Active editor context awareness
- ✅ Intelligent target directory resolution
- ✅ Real-time name validation
🔧 Development
Build from Source
git clone https://github.com/jhaisley/new_plus_ext.git
cd new_plus_ext
npm install
npm run compile
npm test
Architecture
Commands → Services → Models → Utils
↓
Template Discovery (lazy loading, parallel)
Variable Substitution (10-level recursion)
Context Detection (workspace intelligence)
Tech Stack:
- TypeScript 5.1+ (strict mode)
- VS Code Extension API 1.104+
- Mocha test framework
📋 Requirements
- VS Code 1.104.0 or higher
- Node.js 16+ (for development)
🐛 Troubleshooting
Templates not showing?
- Check
newFromTemplate.templatesPath setting
- Verify templates directory exists and is readable
- Reload window:
Developer: Reload Window
Variables not working?
- Enable
newFromTemplate.behavior.replaceVariablesInFilename
- Use correct syntax:
$VARIABLE_NAME$
- Check recursion limit (max 10 levels)
Context menu missing?
- Reload VS Code
- Verify extension is enabled
- Right-click on folders or files in Explorer
🤝 Contributing
Contributions welcome! Areas of interest:
- Template examples and starter packs
- Additional project type detection
- Custom variable prompts and enhanced variable features
- UI/UX improvements
See CONTRIBUTING.md for guidelines.
📜 License
MIT License - see file for details.
🙏 Acknowledgments
Made with ❤️ by Jordan Haisley
