⚡ Smart ReplaceReplace code blocks from AI with automatic indentation fixing no more indentation errors, no more wasted tokens. The ProblemWhen you ask AI to fix or update part of your code, it usually gives you the new code only. To replace it manually, you have to:
This wastes time, wastes tokens (asking AI to regenerate), and is easy to get wrong. The SolutionSmart Replace gives you a panel with 3 simple steps:
Done. Correct indentation, no errors, no regeneration needed. Requirements
Installation
How to UseStep 1 Ask AI for both old and new codeThis is the key. When asking AI to update your code, always say:
Example prompt:
AI will give you two blocks old and new. That's all you need. Step 2 Open Smart ReplacePress Ctrl+Shift+R while your Python file is open. A panel will appear on the right side with 3 boxes. Step 3 Find & HighlightPaste the full old code block from AI into box ①. Click 🔍 Find & Highlight in File. Smart Replace will:
Step 4 Copy the Highlighted CodeIn your file, the code is now highlighted. Press Ctrl+C to copy it. Paste it into box ②.
Step 5 ReplacePaste the new code from AI into box ③. Click ⚡ Replace with correct indentation. Done! The code is replaced with correct indentation automatically. Tips for Best ResultsAlways ask AI for the full blockThe more complete the old code in box ①, the more accurately Smart Replace can find it. ✅ Good full function:
❌ Not enough — too short, might match wrong location:
Works with nested code tooSmart Replace handles deeply nested code inside classes and functions. Just make sure to paste the full block. If "Could not find" error appears
Keyboard Shortcuts
Tested On
Made byRijal Saepuloh — github.com/rijal028 |