Quick start
-
Turn on function hooks (early access) in ~/.claude/settings.json:
{ "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" } }
-
Install, from your shell or inside a session:
claude plugin marketplace add nogu66/md-prompt
claude plugin install md-prompt@nogu66
/plugin marketplace add nogu66/md-prompt
/plugin install md-prompt@nogu66
The installer may say 1 userConfig option not yet set. There is nothing to do: the mode defaults to on, and you can change it later with /md-prompt or in /config.
-
Start a new session and type into the prompt box. A multi-line draft starts with \ + Enter (or Shift+Enter where your terminal supports it):
```ts
const answer: number = 42 // painted as you type
```
Paint only. A hook can colour the characters of the draft but not change them, so what you type, and what is sent to the model, is exactly what you typed. The Markdown markers (**, ```) stay visible; they are dimmed instead of hidden.
What it paints
| You type | You see |
|---|
```ts … ```, ~~~, indented code | A card with a fixed background and syntax colours, from the opening fence on, closed or not. Fences work inside lists and quotes |
`code` | A chip |
**bold** *italic* ***both*** ~~strike~~ | The text styled, the markers dimmed. CommonMark's rules: nested, across the lines of a paragraph |
- item * item 1. item (nested) | The marker coloured and bold, the text as typed |
- [ ] - [x], or [ ] [x] opening a line with no bullet | The box amber while open, green when done |
> quote, >> nested | The marker greyed, the text italic; lists and fences inside a quote work |
# H1 to ###### H6, setext, closing #s | The marker dimmed. H1 bold and underlined, H2 bold, H3 bold italic, H4 plain, H5 italic, H6 faint italic |
--- *** ___ | Dimmed |
| Tables | Header bold, the pipes and delimiter row dimmed, cells keep their inline styles |
[text](url "title"), [text][ref] with [ref]: url, <https://…>, bare URLs, , [^1] | The text underlined and coloured, the URL and brackets dimmed |
<b>, <!-- comment -->, & | Tags and entities coloured, comments dim italic |
Things that only look like Markdown stay plain: 2*3*4, src/*.ts, __init__, Array<string>, arr[i][j], snake_case_name, $5, ~/path. A reference link or footnote is painted only when the draft defines it.
Code is highlighted for js jsx ts tsx, py, sh bash zsh, json, yaml, toml ini .env, go, rust, swift, the C and Java families (java kotlin c cpp cs php dart scala objc groovy), sql, ruby, lua, hcl terraform, powershell, graphql, elixir, haskell, zig, r, perl, nginx, proto, html xml svg vue svelte, css scss less, markdown, dockerfile, makefile and diff (added, removed and hunk lines). Any other or missing language gets strings and numbers only, so a guess never turns prose into a comment.
Colours. Code sits on a card with fixed foreground and background colours, so it reads on any theme. The few colours that sit straight on your terminal background (headings, links, list markers, task boxes, tags) are mid-tones with at least 3.3:1 contrast on white and 4.3:1 on a dark terminal, held by a test; markers use the engine's dim. To change any of them, edit PALETTE in palette.ts.
Commands
| Command | |
|---|
/md-prompt on | Paint everything (the default) |
/md-prompt off | Leave the prompt box as plain text |
/md-prompt toggle | Switch between off and on |
/md-prompt | Show the current mode |