MDit is a focused, offline-first, browser-based Markdown editor designed for distraction-free writing. It features a beautiful Gruvbox-inspired theme, a robust WYSIWYG editing experience, and seamless integration with both your local file system and remote SSH servers.
- 📝 Dual Editing Modes: Instantly toggle between a rich WYSIWYG live-preview and a rock-solid raw source editor (
Ctrl + M). - 🌐 Remote SSH Editing: Connect to remote machines via SSH/SFTP to open, edit, and save files directly on your servers.
- 💾 Unified Storage Controls: Streamlined "Open" and "Save" split-buttons for quick actions or explicit Local/Remote choices.
- 🎨 Pro Gruvbox Theme: High-contrast Light and Dark modes with specialized syntax highlighting for code blocks.
- ⚡ Auto-save (Default): Your work is protected by default. Changes are automatically saved to your chosen location, with background draft backup in IndexedDB.
- 🔗 Connection Status: A dedicated header "pill" shows exactly which remote machine you're connected to, with a one-click disconnect.
- 🖥️ Machine Manager: Save and switch between multiple named remote configurations effortlessly.
- ⌨️ Keyboard Optimized: Efficient shortcuts for almost every action, including a custom Tab-supported source editor.
- Node.js: Version 18 or higher.
- SSH Server: For remote editing, ensure your machine has SFTP enabled.
-
Clone the repository:
git clone https://github.com/hnrkgrln/mdit.git cd mdit -
Install root dependencies:
npm install --legacy-peer-deps
(Note:
--legacy-peer-depsis required for certain Milkdown plugins). -
Install backend dependencies:
cd server npm install cd ..
Start both the frontend and the SSH backend:
npm run dev:allThe editor will be available at http://localhost:5173. The backend runs on port 3002.
-
Build the Frontend:
npm run build
-
Run the Production Server:
npm start
The backend serves both the API and the assets on port
3002(configurable viaPORTenv var).
| Action | Shortcut |
|---|---|
| New File | Ctrl + Shift + N |
| Open Menu | Ctrl + O |
| Save / Quick Save | Ctrl + S |
| Toggle Auto-save | Ctrl + A |
| Toggle Source Mode | Ctrl + M |
| Toggle Theme | Ctrl + Shift + L |
| Markdown Help | Ctrl + H |
| Close Modals/Menus | Escape |
- Frontend: React 18, TypeScript, Vite.
- Editor: Milkdown (Crepe).
- Backend: Node.js, Express,
ssh2(SFTP). - Storage: HTML5 File System Access API & IndexedDB (idb-keyval).
- Local Files: Handled entirely via browser APIs; never touched by the backend.
- Remote Files: Credentials are sent to your local Node.js backend to establish the SSH tunnel. No third-party servers involved.
- Persistent Config: Machine metadata is stored locally in your browser's
localStorage.