Skip to content

amrg101/code-checkpoints

Repository files navigation

🛡️ Code Checkpoints for IntelliJ

Stop "Ctrl+Z" Anxiety. A local Time Travel, Snippet Manager, and "Save State" tool for your code.

Version Platform License

⚡ The Problem

Git is great for commits, but git stash is too slow for 5-minute experiments. IntelliJ's built-in "Local History" is powerful but messy, it's auto-generated, hard to search, and gets wiped when you clear caches.

Code Checkpoints gives you a deliberate "Save Game" button for your files.

✨ Features

📸 Capture & Restore

  • Manual Checkpoints: Hit Ctrl+Alt+S to save the full file state with a note.
  • Silent Quick-Save: Hit Ctrl+Alt+Shift+S to save instantly without a dialog.
  • Persistent: Checkpoints are stored in your .idea folder and survive cache invalidation.

✂️ Code Snippets

Highlight a specific function or block of code and save it as a Snippet.

  • Restore Logic: Unlike restoring a file (which overwrites everything), restoring a snippet inserts it at your cursor.
  • Great for holding onto code you are about to delete but might need later.

🔍 Diff & Time Travel

  • Time Travel Slider: Drag the slider in the sidebar to scrub through history and watch your code evolve.
  • Embedded Diff: Click any checkpoint to see a side-by-side comparison with your current live code instantly.
  • Clipboard Diff: Right-click a checkpoint -> "Compare with Clipboard" to check code you found online against your saved version.

🤖 Smart Automation

  • Refactor Safety Net: Automatically creates a checkpoint named Pre-Refactor before you run any IntelliJ refactoring action.
  • Run/Debug Backup: Automatically saves before you run your app, just in case a script overwrites data.
  • Rename Tracking: If you rename User.kt to Customer.kt, your history moves with the file.

📂 Organization

  • Global Search: Ctrl+Alt+Shift+F lets you Regex search the content of every checkpoint across the project.
  • Tags: Add tags like #stable, #bug, or #experiment.
  • Stars: Star important versions to prevent them from auto-cleanup.

🚀 Installation

  1. Open IntelliJ IDEA.
  2. Go to Settings > Plugins > Marketplace.
  3. Search for "Code Checkpoints".
  4. Click Install.

⌨️ Shortcuts

Action Shortcut (Windows/Linux) Shortcut (Mac)
Create Checkpoint Ctrl + Alt + S Cmd + Opt + S
Quick Save (Silent) Ctrl + Alt + Shift + S Cmd + Opt + Shift + S
Save Snippet Ctrl + Alt + Shift + S Cmd + Opt + Shift + S
Search Checkpoints Ctrl + Alt + Shift + F Cmd + Opt + Shift + F

(Note: Snippet action shares the shortcut with Quick Save but activates only when text is selected)


⚙️ Configuration

Go to Settings/Preferences > Code Checkpoints to configure:

  • Max Checkpoints: Limit how many snapshots are kept per file (default: 20).
  • Auto-Save Toggles: Enable/Disable auto-save on Refactor or Run.
  • Date Format: Customize how timestamps appear.

📜 License

This project is open source and available under the Apache License 2.0. You are free to use, modify, and distribute this software.

About

Manual code snapshots & snippet manager for IntelliJ to track and restore file states.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages