leaf - Features Demo#
leaf is a terminal-based Markdown previewer with syntax highlighting, LaTeX rendering, theme support, and interactive navigation.
Interactive Features#
Watch Mode#
leaf can monitor your file for changes and automatically reload the preview. The status bar shows a "reloaded" flash indicator when the file is updated. Scroll position is preserved across reloads.
- Press
worCtrl+Wto toggle watch mode - Press
rorCtrl+Rto manually reload the file - Use
--watchflag on startup:leaf --watch file.md
Source: demo-watch-mode.md

Open in Editor#
Quickly open the current file in your preferred external editor without leaving leaf. When you return, the file is automatically reloaded with the latest changes.
- Press
Ctrl+Eto open in the configured editor - Press
Shift+Eto pick an editor (nano, vim, code, subl, emacs) - Use
--editorflag on startup:leaf --editor vim file.md
Source: demo-open-editor.md

File Picker#
Browse and open Markdown files without leaving leaf. Two modes are available: a fuzzy finder for quick search by filename, and a directory browser for navigating the file tree.
- Press
Ctrl+Pfor fuzzy file picker - Press
Shift+Pfor directory browser - Use
--pickerflag on startup:leaf --picker
Source: demo-file-picker.md

Table of Contents#
A sidebar displays the document's heading structure for quick navigation. leaf intelligently normalizes heading levels and highlights the currently visible section.
- Press
tto toggle the TOC sidebar - Press
1-9to jump directly to a heading
Source: demo-toc-sidebar.md

Search#
Full-text search with visual highlighting of all matches. Navigate between results with match counter feedback in the status bar.
- Press
/orCtrl+Fto start searching - Press
nto jump to next match - Press
Shift+Nto jump to previous match
Source: demo-search.md

And also:
- Auto-update: run
leaf --updateto check and install the latest version from GitHub with SHA256 verification - Stdin support: pipe Markdown directly with
echo '# Hello' | leaf(up to 8 MB) - Status bar: displays filename, watch indicator, search status, and scroll percentage
- Help modal: press
?to view all keyboard shortcuts organized by category
Markdown Rendering#
LaTeX / Math#
leaf renders mathematical formulas directly in the terminal — a rare feature for a terminal viewer. Inline math with $...$ and display math with $$...$$ are converted to Unicode symbols.
Supported: fractions, superscripts, subscripts, Greek letters, roots, and more. Code blocks with latex or tex language are also rendered.
Source: demo-latex-render.md

Code Blocks with Syntax Highlighting#
Fenced code blocks are displayed in a decorative frame with language label and line numbers. Syntax highlighting supports 40+ languages (Rust, Python, JavaScript, TypeScript, Go, C/C++, Java, and more) via the syntect library.
Code blocks adapt to the terminal width with intelligent wrapping.
Source: demo-code-syntax.md

Tables#
Markdown tables are rendered with Unicode box-drawing borders and column alignment (left, center, right). Cells support inline code and LaTeX math. Tables adapt to the available terminal width.
Source: demo-table-render.md

Theme Picker#
Choose from 4 built-in themes with live preview as you navigate. Each theme applies to the UI, Markdown elements, and syntax highlighting simultaneously.
- Press
Shift+Tto open the theme picker - Available themes: Arctic, Forest, Ocean Dark, Solarized Dark
- Press
Escto cancel and restore the original theme
Source: demo-theme-picker.md

Navigation#
Navigate documents with keyboard shortcuts or mouse. The scrollbar on the right supports click and drag for quick positioning.
j/kor arrow keys: scroll line by lined/uor PageDown/PageUp: scroll by pageg/Shift+Gor Home/End: jump to top/bottom- Mouse wheel: scroll 3 lines per tick
- Scrollbar: click and drag for fast navigation
Source: demo-navigation.md

And also:
- Blockquotes: multi-level nesting with vertical markers, italic text, can contain lists and code
- Nested lists: Unicode bullets per level (bullet, circle, triangle), distinct colors, ordered lists with numbering
- Headings: H1 underlined with double lines, H2 with single lines, H3 bold, H4+ with distinct colors
- Inline formatting: bold, italic,
strikethrough,inline code, links with icon