OneClick-CP — One-click DSA & CP Starter Kit
A VS Code extension that sets up your coding sandbox in seconds, exports your solutions neatly, and gives you a growing snippets library — all without leaving the editor.
✨ Features
🚀 Multi-Language Support
Seamlessly switch between C++, Java, Python, and JavaScript. The extension automatically detects the language based on your active file or workspace structure.
🚀 Reset Files
Quickly reset the standard files in your workspace:
main.cpp / Main.java / main.py / main.js
input.txt
output.txt
Uses the selected template (see below). If any file is missing in the chosen template, a sensible default is used.
📤 Export Solution
Save your current main file, input.txt, and output.txt into Solutions/<your-name>/.
Reads from the open editors first (so unsaved work is exported), then falls back to disk.
🔁 Export + Reset
One command to:
- Export the current solution
- Reset the files with your selected template
Perfect for quick problem switching.
💾 Custom Templates
Save any combination of the three files as a reusable template.
- Create templates via the Sidebar → Save Template
- Delete templates via the Sidebar → Delete Template
- Templates are stored in VS Code settings under
oneclick-cp.templates
A curated snippet library for C++, Java, Python, and JavaScript.
- Algorithms: Sorting, Searching (Binary Search), Graph (BFS, DFS, Dijkstra), DP (Knapsack, LCS), Math (GCD, Sieve), Backtracking.
- Data Structures: Segment Trees, Tries, Union Find, Fenwick Trees, Linked Lists, Trees.
- Utilities: Fast I/O, Comparators.
Functionality:
- Browse by Category/Subcategory in the Sidebar
- Preview a snippet (inline "ghost" preview)
- Insert at the cursor location
- Create from Selection → Save highlighted code as a new snippet (auto-name collision handling; saved under
Custom/<subcategory>.json)
- Built-in snippets are merged with your user snippets (user overrides on duplicate keys)
User snippets are stored under the extension’s global storage path:
<globalStorage>/snippets/<language>/Custom/<subcategory>.json
👉 Full list of built-in snippets is available here:
📑 Snippets Index
🧩 Arrange Layout
Closes all tabs and opens:
main file (left)
input.txt (top-right)
output.txt (bottom-right)
🧰 Commands & Shortcuts
| Command |
ID |
Notes |
| Reset Files |
oneclick-cp.resetFiles |
Uses currently selected template |
| Export Solution |
oneclick-cp.exportSolution |
Prompts for folder name |
| Export + Reset |
via Sidebar |
First export, then reset |
| Arrange Layout |
oneclick-cp.arrangeLayout |
Opens 1–2–3 layout |
| Save Template |
oneclick-cp.saveTemplate |
From Sidebar form |
| Delete Template |
oneclick-cp.deleteTemplate |
From Sidebar dropdown |
| Create Snippet (from selection) |
oneclick-cp.createSnippet |
Stored under Custom |
Default keybinding example (optional):
- Reset Files →
Ctrl + Alt + R (you can bind this yourself in Keyboard Shortcuts)
🧪 How to Use
- Open your CP workspace folder in VS Code.
- Click the OneClick-CP icon in the Activity Bar to open the Sidebar.
- Pick a Template (or create your own).
- Click Reset Files to bootstrap your environment.
- Start coding.
- Use Export Solution when you’re done (or Export + Reset to jump to the next problem).
- Use Snippets in the Sidebar to preview & insert, or create your own from selection.
🙌 Support Development
If you love this extension and want to support its development:
🛠️ Installation
- Clone or download this repo
- Run
npm install
- Run
npm run compile
- Launch extension via Run & Debug (F5) or package via vsce
🤝 Contributing
Pull requests, issue reports, and suggestions are always welcome!
- Fork the repository
- Make your changes
- Submit a PR with a clear explanation
Suggest a Snippet
Feel free to contribute to the snippet JSONs inside snippets/ folder or open an issue with your idea.

🧯 Troubleshooting
- Sidebar looks empty / styling off → Ensure HTML/CSS files are bundled.
- Snippet preview not visible → Make sure an editor is active; preview shows as faint inline text.
- Nothing resets → Confirm a workspace is open and the files exist (fallback will write them to your first workspace).
- Exported files missing changes → We read from open editors first; if none open, we read from disk.
📝 Changelog
See CHANGELOG.md.
👤 Author
Developed by Bharath Kotipalli
“Created to make your CP journey smoother.”
📃 License
MIT © Bharath Kotipalli