Tusk
A modern terminal-based Markdown editor with real-time preview, supercharged with vim.
Tusk
A modern terminal-based Markdown editor with real-time preview.
Table of Contents
Installation
Via pip
pip install tusk-editor
From source
git clone https://github.com/vedant-asati03/tusk.git
cd tusk
pip install -e .
Usage
To start the editor:
tusk filename.md
Key Bindings
Ctrl+S
: Save fileCtrl+P
: Open command paletteCtrl+@
: Toggle preview paneCtrl+L
: Expand input-boxCtrl+Q
: Shrink input-boxCtrl+B
: Insert Table of ContentsTab
: Expand snippet
Auto-Completion
Automatic completion for:
- Brackets: (), [], {}, <>
- Quotes: “”, ‘’, ``
- Markdown: **, __, ~~, ```
- Headers: # automatically adds space
Snippets
Built-in snippets:
- Headers:
h1
,h2
,h3
- Formatting:
bold
,italic
,strike
,code
- Lists:
ul
,ol
- Links:
link
,img
- Others:
quote
,hr
,todo
,done
Custom snippets can be added via ~/.config/tusk/snippets.json
Export Options
Export your markdown to:
- HTML (
Ctrl+P
→ “export html”) - PDF (
Ctrl+P
→ “export pdf”) - DOCX (
Ctrl+P
→ “export docx”)
Configuration
- Snippets:
~/.config/tusk/snippets.json
- Logs:
~/.tusk/logs/tusk.log
- Auto-save: Enabled by default
Dependencies
- Python 3.10+
- textual>=0.38.1
- markdown>=3.4.3
- pypandoc>=1.11 (for exports)
- pandoc (system package)
Common Issues
- Export fails: Ensure pandoc is installed on your system
- Syntax highlighting issues: Make sure you’re using a compatible terminal
- Unicode errors: Set your terminal to UTF-8 encoding
Roadmap
- Vim keybindings (In testing phase)
- Custom themes support
- File browser
- Git integration
- Plugin system
Contributing
Feel free to contribute by forking the repo and submitting a pull request! 🚀
License
This project is licensed under the MIT License - see the LICENSE file for details.
Source Code:
https://github.com/Vedant-Asati03/Tusk.git
Technologies: