A professional-grade text editor with hot exit, cloud sync, AI integration, and 50+ language syntax highlighting.
Features β’ Installation β’ Build β’ Usage β’ Shortcuts
- Never lose work again: All tabs saved automatically on close
- Full state restoration: Reopens with exact cursor positions, scroll positions, and unsaved content
- No save prompts: Just close the window - everything is preserved
- Modified indicators: Visual feedback for unsaved changes
- Viewport-only highlighting: Only processes visible lines + buffer
- Large file mode: Files >1MB auto-disable syntax highlighting
- Thread-safe dispatcher: All background operations safely marshal to UI thread
- Move lines:
Ctrl+Shift+Up/Downto move lines or selections - Delete line:
Ctrl+Shift+Kremoves current line - Duplicate:
Ctrl+Dduplicates line or selection with full undo support
- Clickable line ending: Toggle between CRLF and LF
- Clickable encoding: Toggle between UTF-8 and ANSI
- Click position: Jump to Go to Line dialog
- Click zoom: Reset to 100%
- 12 Built-in Themes: Professional Dark, Light, Monokai, Solarized Dark/Light, Dracula, Nord, One Dark, Catppuccin, Tokyo Night, High Contrast, Gruvbox
- Dark Title Bar: Native Windows 10/11 dark mode support
- Scalable UI: 100% to 200% scaling for high-DPI displays
- Collapsible Ribbon: Auto-hide or pin the ribbon toolbar
- Code Minimap: VS Code-style document overview
- Hot Exit: Saves complete session state including unsaved content
- Auto-Save Cache: Automatically saves every 10 seconds locally
- Session Restore: Reopens all tabs exactly where you left off
- External Change Detection: Prompts to reload when files change outside the editor
- Backup Manager: View and restore previous versions of files
- GitHub Integration: Sync files to any GitHub repository
- Automatic Sync: Background sync with status indicator
- Connection Testing: Verify sync setup before committing
- Multiple Providers: OpenAI (GPT-4), Anthropic (Claude), Ollama (local)
- Built-in Prompts: Summarize, Fix Grammar, Professional Email, Simplify, Expand, Explain Code, Refactor, Add Comments, Convert to Bullet Points, Translate to Python
- Custom Prompts: Write your own AI instructions
- Thread-safe: AI operations run in background without freezing UI
- 50+ Languages: Syntax highlighting for Python, JavaScript, TypeScript, PowerShell, JSON, HTML, CSS, Markdown, and many more
- Find & Replace: With regex support and whole word matching
- Find in Files: Search across entire directories
- Clipboard Panel: Access clipboard history with pinning support
- Line Numbers: With bookmarks and fold markers
- Bracket Matching: Automatic highlight and auto-close
- Current Line Highlight: Always know where your cursor is
- Spell Check: Built-in with custom dictionary support
- Snippets: Code templates with tab stops
- Macros: Record and playback actions
- Multi-Tab Interface: Drag and drop to reorder tabs
- File Tree Sidebar: Browse and open files easily
- Recent Files: Quick access dropdown in tab bar
- Closed Tabs Recovery:
Ctrl+Shift+Tto reopen closed tabs - Notepad++ Import: Import sessions from Notepad++
- Middle-Click Scroll: Browser-style auto-scroll
- Click Tab Bar: Click empty space to create new tab
- Tab Context Menu: Right-click for close options
- Command Palette:
Ctrl+Shift+Pfor quick access to all commands - Integrated Terminal: `Ctrl+`` to toggle terminal
- File Comparison: Diff view for comparing files
- Make sure you have Python 3.8+ installed
- Download or clone this repository
- Run the script:
Dependencies are installed automatically on first run.
python mattpad_v5.py
- Download or clone this repository
- Double-click
build_exe.bat - Wait for the build to complete (~2-5 minutes)
- Find
Mattpad.exein thedistfolder
The portable exe requires no installation - just copy and run anywhere!
- Python 3.8 or higher
- pip (Python package manager)
# Run the build menu
build_exe.batThis presents two options:
- Portable EXE - Single file, includes spellcheck, runs anywhere
- Installer Build - Creates files for Inno Setup installer
# Install dependencies
pip install pyinstaller customtkinter pillow chardet requests pyspellchecker openai anthropic
# Build portable exe with spellcheck
pyinstaller --onefile --windowed --name "Mattpad" --icon=mattpad.ico ^
--collect-all customtkinter ^
--collect-all spellchecker ^
--collect-data spellchecker ^
mattpad_v5.pyThe compiled executable will be in the dist folder:
dist/
βββ Mattpad.exe (~50-100 MB)
- Run
build_exe.batand select option 2 - Download Inno Setup
- Open
Mattpad_Setup.iss - Build β Compile
- Find
Mattpad_Setup_v5.0.exein theinstallerfolder
- The application opens maximized with a dark theme
- A new untitled tab is created automatically
- Start typing or open a file (Ctrl+O)
Just close the window! Mattpad automatically:
- Saves all tab content (including unsaved files)
- Preserves cursor positions and scroll positions
- Restores everything on next launch
No save prompts, no data loss.
GitHub:
- Go to Cloud tab β Configure GitHub
- Enter your Personal Access Token (create at github.com/settings/tokens)
- Enter repository name (e.g.,
username/my-notes) - Click Save
- Go to AI tab β Settings
- Select your provider (OpenAI, Anthropic, or Ollama)
- Enter your API key
- Select a model
- Use AI features via the AI tab or right-click context menu
| Action | Shortcut |
|---|---|
| File | |
| New File | Ctrl+N |
| Open File | Ctrl+O |
| Save | Ctrl+S |
| Save As | Ctrl+Shift+S |
| Close Tab | Ctrl+W |
| Reopen Closed Tab | Ctrl+Shift+T |
| Edit | |
| Undo | Ctrl+Z |
| Redo | Ctrl+Y |
| Cut | Ctrl+X |
| Copy | Ctrl+C |
| Paste | Ctrl+V |
| Duplicate Line | Ctrl+D |
| Move Line Up | Ctrl+Shift+Up |
| Move Line Down | Ctrl+Shift+Down |
| Delete Line | Ctrl+Shift+K |
| Toggle Comment | Ctrl+/ |
| Find | |
| Find/Replace | Ctrl+F |
| Find in Files | Ctrl+Shift+F |
| Find Next | F3 |
| Go to Line | Ctrl+G |
| View | |
| Zoom In | Ctrl++ |
| Zoom Out | Ctrl+- |
| Reset Zoom | Ctrl+0 |
| Toggle Sidebar | Ctrl+B |
| Toggle Terminal | `Ctrl+`` |
| Command Palette | Ctrl+Shift+P |
Syntax highlighting for 50+ languages including:
| Languages | |||
|---|---|---|---|
| Python | JavaScript | TypeScript | PowerShell |
| Batch | Bash | C | C++ |
| C# | Java | Kotlin | Swift |
| Go | Rust | Ruby | PHP |
| HTML | CSS | SCSS | SQL |
| JSON | YAML | XML | Markdown |
| Lua | Perl | R | MATLAB |
| Haskell | Scala | Clojure | F# |
| Dart | Julia | Zig | Nim |
| TOML | INI | Dockerfile | Makefile |
Settings are stored in ~/.mattpad/settings.json and include:
- Theme preference
- UI scale
- Font size and family
- Hot exit enabled/disabled
- Cloud sync credentials
- AI provider settings
- Recent files list
Data directories:
~/.mattpad/cache/- Session data~/.mattpad/hot_exit/- Hot exit snapshots~/.mattpad/backups/- File backups~/.mattpad/closed_tabs/- Closed tab recovery~/.mattpad/snippets/- Custom snippets~/.mattpad/macros/- Recorded macros
Try the alternative command:
pyinstaller --onefile --windowed --name "Mattpad" --collect-all customtkinter mattpad_v5.pyRun manually:
pip install customtkinter pillow chardet requests openai anthropicSome antivirus software flags PyInstaller executables. Add an exception for Mattpad.exe or the dist folder.
Dark title bar requires Windows 10 version 20H1 or later. On older versions, the system theme is used.
Files over 1MB automatically disable syntax highlighting for better performance. This is indicated in the status bar.
- Hot Exit: Complete session persistence without save prompts
- Thread-safe dispatcher for background operations
- Line operations: move up/down, delete line
- Clickable status bar toggles (line ending, encoding)
- Viewport-only syntax highlighting
- Large file mode (>1MB)
- Tab order preservation
- Ribbon interface
- DPI awareness
- Improved themes
- AI integration
- Cloud sync
- Clipboard panel
This project is provided as-is for personal and commercial use.
- Built with CustomTkinter
- Themes inspired by popular code editors
- Icons and design following modern UI principles