具有VI键绑定的Markdown CLI查看器
Markdown CLI viewer with VI keybindings

原始链接: https://github.com/taf2/mdvi

## mdvi:一个受 Vim 启发的终端 Markdown 查看器 mdvi 是一个用 Rust 构建的快速、全屏终端 Markdown 查看器,提供流畅的阅读体验和 Vim 风格的导航。它利用 `crossterm` 和 `ratatui` 提供高质量的 TUI,并使用 `pulldown-cmark` 进行准确的 Markdown 渲染,支持常见的元素,如标题、列表、代码块、链接和表格。 主要功能包括流畅的键盘导航(箭头键、翻页键、Vim 快捷键如 `j/k`、`Ctrl-f/b`、`gg/G`)、文件更改时的实时重新加载 (`r`),以及从特定行开始查看 (`--line`) 的能力。 mdvi 专为大型文件设计,优先考虑性能和可预测性。它以单个静态二进制文件的形式分发,并受益于 Rust 强大的工具和生态系统。安装很简单,可以使用 Homebrew:`brew tap taf2/tap && brew install mdvi`。

Hacker News新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交登录 带有VI键绑定的Markdown CLI查看器 (github.com/taf2) 11点 由 taf2 42分钟前 | 隐藏 | 过去 | 收藏 | 3评论 juancn 14分钟前 | 下一个 [–] 一张截图会是README的一个不错的补充。根据这个:https://github.com/taf2/mdvi/blob/master/src/renderer.rs,看起来它只是纯文本(不支持终端的图像扩展,只是一个指向图像的链接)。代码看起来简洁干净。回复 maxsimb 7分钟前 | 上一个 | 下一个 [–] https://github.com/Vagab/mark 一个类似的工具,但同时也支持编辑!回复 verdverm 7分钟前 | 上一个 [–] https://github.com/charmbracelet/glamour Charm Glamour使用视口,也使用了基本的vi键绑定。回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

mdvi is a terminal markdown viewer with Vim-style navigation.

It renders markdown into a polished full-screen TUI with fast keyboard navigation, clear typography, and predictable behavior for large files.

  • Full-screen terminal viewer (crossterm + ratatui)
  • Vim-style navigation controls
  • High-quality markdown rendering via pulldown-cmark
  • Support for:
    • headings
    • lists and task lists
    • blockquotes
    • code blocks and inline code
    • links, tables, footnotes, emphasis/strong/strikethrough
  • Live reload (r) when the file changes on disk
  • Start at specific line (--line)
  • Works with standard terminal keys (arrows, page up/down, home/end)
brew tap taf2/tap
brew install mdvi

Examples:

mdvi docs/spec.md
mdvi --line 120 CHANGELOG.md
  • j / Down: scroll down one line
  • k / Up: scroll up one line
  • Ctrl-d: half-page down
  • Ctrl-u: half-page up
  • PageDown: full-page down
  • PageUp: full-page up
  • Ctrl-f: full-page down (Vim-style)
  • Ctrl-b: full-page up (Vim-style)
  • g / Home: jump to top
  • G / End: jump to bottom
  • r: reload file from disk
  • /: start search
  • n: next search match
  • N: previous search match
  • ?: toggle help line
  • q: quit

Rust is a strong fit for a serious CLI viewer:

  • precise terminal control
  • excellent performance for large files
  • single static binary distribution
  • mature ecosystem for TUI and markdown parsing
cargo test
cargo fmt
cargo clippy -- -D warnings

MIT

联系我们 contact @ memedata.com