A powerful Obsidian plugin that tracks and visually highlights changed lines in your documents, providing real-time feedback on your editing progress with intuitive visual indicators.
Plugin is built with the philosophy of minimal interference and maximum informativeness. Follows the principle of "show, but don't interfere" โ it provides valuable information about your changes while remaining unobtrusive and not disrupting your familiar workflow.
When working with large documents or during lengthy editing sessions, it's easy to lose track of what exactly has been changed. This is especially relevant when:
- Refactoring large notes โ when you need to restructure content without losing important details
- Collaborative work โ when multiple people edit documents and you need to track each person's contribution
- Text experiments โ when trying different formulations and wanting to easily return to previous versions
- Long editing sessions โ when many small changes accumulate over several hours of work
- Source Mode Only: Activates exclusively when files are open in Source mode for precise tracking
- Existing Files Focus: Works only with previously saved files, ignoring new unsaved documents
- Real-time Tracking: Monitors changes as you type using CodeMirror 6 API
- Line Markers: Highlights changed lines with customizable colored indicators
- Gutter Dots: Alternative display mode with character indicators in the editor gutter
- Auto-removal: Markers automatically disappear when lines return to their original state
- Multiple Change Types: Different colors for added, modified, restored, and removed lines
- Original Content Preservation: Stores the initial file state for accurate comparison
- Diff Viewer: Built-in modal with side-by-side and line-by-line diff views
- Clean Patch Export: Generate and copy clean patches with zero context
- Smart Deletion Handling: Properly tracks removed lines without affecting subsequent content
The plugin highlighting changed lines in the editor
Built-in diff viewer showing changes side-by-side
Customizable settings for different indicator types
- Open Obsidian
- Go to Settings โ Community plugins
- Disable Safe mode if it's enabled
- Click Browse and search for "Local history" or "Line Change Tracker"
- Click Install and then Enable
- Download the latest release from the GitHub releases page
- Extract the files to your vault's plugins folder:
VaultFolder/.obsidian/plugins/local-history/ - Reload Obsidian
- Enable the plugin in Settings โ Community plugins
- Open an existing file in Source mode
- Start editing - the plugin automatically captures the original state
- See visual feedback as you make changes:
- โช Blue: Modified lines
- โช Orange: Added lines
- โช Base: Removed lines
- โช Gray: Restored lines
- Use the command palette (
Ctrl/Cmd + P) and search for "Show all changes" - Or access via the plugin's commands to open the diff viewer modal
- Side-by-side view: Compare original and current versions
- Line-by-line view: Unified diff format
- Patch export: Generate clean patches for external use
- Synchronized scrolling: Both panels scroll together in side-by-side mode
Access plugin settings via Settings โ Plugin Options โ Local History
- Indicator Type: Choose between line markers or gutter dots
- Show Indicators For: Toggle visibility for different change types
- Changed lines
- Added lines
- Removed lines
- Restored lines
- Keep History Until: Choose when to clear tracking data
- App close: Clear when Obsidian closes
- File close: Clear when file tab closes
- Line Width: Adjust the width of line indicators
- Gutter Character: Customize the character used in gutter mode
- Colors: Modify indicator colors via CSS snippets
/* Customize line change colors */
.lct-line.lct-changed:not(.mk-placeholder)::before {
background-color: #ff6b35; /* Orange for changed lines */
}
.lct-line.lct-added:not(.mk-placeholder)::before {
background-color: #4ecdc4; /* Teal for added lines */
}
.lct-line.lct-restored:not(.mk-placeholder)::after {
background-color: #fcdb89; /* Yellow for restored lines */
}
.lct-line.lct-removed:not(.mk-placeholder)::after {
background-color: #b6b6b6; /* Gray for removed lines */
}- Minimum Obsidian Version: 0.15.0
- Platform Support: Desktop and Mobile
- File Types: Plain text files (
.md,.txt,.csv,.json,.yaml)
If you find this plugin helpful, consider supporting its development:
Your support helps maintain and improve the plugin with new features and bug fixes!
Found a bug or have a feature request? Please help improve the plugin:
- Check existing issues on GitHub Issues
- Create a new issue with:
- Detailed description of the problem
- Steps to reproduce
- Your Obsidian version
- Your operating system
- Screenshots if applicable
This project is licensed under the MIT License - see the LICENSE file for details.
- Node.js (version 18 or higher)
- npm or yarn
- Git
-
Clone the repository
git clone https://github.com/bartlab/obsidian-local-history.git cd obsidian-local-history -
Install dependencies
npm install
-
Start development mode
npm run dev
-
Build for production
npm run build
obsidian-local-history/
โโโ src/ # Source code
โ โโโ commands/ # Command definitions
โ โโโ decorators/ # TypeScript decorators
โ โโโ events/ # Event handlers
โ โโโ extensions/ # CodeMirror extensions
โ โโโ helpers/ # Utility functions
โ โโโ lines/ # Line tracking logic
โ โโโ maps/ # Data structures
โ โโโ modals/ # UI modals
โ โโโ services/ # Core services
โ โโโ settings/ # Settings management
โ โโโ snapshots/ # File snapshot handling
โ โโโ main.ts # Plugin entry point
โ โโโ types.ts # TypeScript type definitions
โโโ styles.css # Plugin styles
โโโ manifest.json # Plugin manifest
โโโ package.json # Dependencies and scripts
โโโ tsconfig.json # TypeScript configuration
โโโ esbuild.config.mjs # Build configuration
โโโ README.md # This file
The plugin follows a service-oriented architecture with dependency injection:
- Services: Core functionality (snapshots, settings, events)
- Extensions: CodeMirror 6 integrations for editor features
- Commands: Obsidian command palette integrations
- Modals: UI components for diff viewing
- Helpers: Utility functions and DOM manipulation
- TypeScript: Type-safe development
- CodeMirror 6: Editor integration and decorations
- diff: Text comparison and patch generation
- diff2html: HTML diff rendering
- Obsidian API: Plugin framework integration
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes following the existing code style
- Add tests if applicable
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project follows the Google TypeScript Style Guide. Please ensure your contributions adhere to these standards.
# Run tests (when available)
npm test
# Run linting
npm run lint
# Type checking
npm run type-check- Update version in
manifest.jsonandpackage.json - Update
versions.jsonwith compatibility info - Create a git tag:
git tag -a 1.0.0 -m "Release 1.0.0" - Push tags:
git push origin --tags - GitHub Actions will automatically create a release
Made with โค๏ธ for the Obsidian community





