Skip to main content

Terminal Markdown editor with vim-style keys and live side-by-side preview

Project description

easymd

终端里的 Markdown 编辑器:左侧 vim 式编辑,右侧实时预览。基于 Textual

安装

需要 Python 3.10+。推荐用 pip 或 uv 从 PyPI 安装:

pip install easymd-cli      # 或: uv tool install easymd-cli
easymd 笔记.md               # 文件不存在时会在首次 :w 时创建

从源码开发:

git clone https://github.com/decajoin/easymd && cd easymd
uv sync --group dev
uv run easymd demo.md
uv run pytest            # 运行测试

按键参考

模式

按键 作用
i a A I o O 进入插入模式(位置同 vim)
R 替换模式(连续覆写,退格可恢复被覆写的字符)
Esc 回到普通模式
v 可视模式(y/d/c 作用于选区)
V 可视行模式(按整行选择,y/d/c 作用于整行;v/V 互切)

移动(普通/可视模式,支持数字前缀如 3j

h j k lw b e0 ^ $gg G3G 跳第 3 行)、Ctrl+d/u 半页、Ctrl+f/b 整页

编辑

按键 作用
x 删除光标处字符
r / ~ 替换光标处字符 / 切换大小写(支持计数)
J 合并下一行(3J 合并三行)
dd / yy / cc 删除 / 复制 / 改写整行(支持 3dd
D / C / Y 删除至行尾 / 改写至行尾 / 复制整行
dw de d$ 操作符 + 移动(yc 同理;cw 同 vim 不吃尾随空格)
diw ci" ya( 文本对象:i/a + w " ' ` ( [ {,配 d/c/y 或可视模式
p / P 在后 / 前粘贴
u / Ctrl+r 撤销 / 重做

命令与搜索

命令 作用
:w :w 文件名 保存
:q :q! :wq :x 退出(有未保存修改时 :q 会拒绝)
/文本 然后 n / N 搜索 / 下一个 / 上一个

项目结构

src/easymd/
  cli.py     # 命令行入口
  app.py     # 分屏布局、状态栏、命令行、预览同步
  editor.py  # vim 模态层(TextArea 子类)
tests/       # pytest 套件(Textual Pilot 无头驱动真实按键)

运行测试:uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easymd_cli-0.2.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easymd_cli-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file easymd_cli-0.2.0.tar.gz.

File metadata

  • Download URL: easymd_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for easymd_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 17d9a335d3f6fb075662d0726f7180ad6c4b960225ac4101cabbfe8ca7b892c3
MD5 fa0cee8ee8536db4ec288ceecadb3aaf
BLAKE2b-256 28ae1e3e54dfb38c94ebcaa84f852fc5eb8df12a8be2606e51af836aa5a36d72

See more details on using hashes here.

Provenance

The following attestation bundles were made for easymd_cli-0.2.0.tar.gz:

Publisher: release.yml on decajoin/easymd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file easymd_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: easymd_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for easymd_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 907a4148ea7e1a6b3bf1dee9596e31c943d989789112bde1c8319c823ee29f92
MD5 c599fb4e5721220495c82e3c7ada61ec
BLAKE2b-256 2269f1015169aa07b4c6ab1e6f67fbfe9220e15d63d3b16a6d0986f58e2e98e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for easymd_cli-0.2.0-py3-none-any.whl:

Publisher: release.yml on decajoin/easymd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page