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 整页

按键 作用
f F t T + 字符 行内查找:到 / 反向到 / 到前一格 / 反向到后一格;可配 operator(df, ct.
; / , 重复上次行内查找(同向 / 反向)
% 跳到匹配的括号(( ) [ ] { },支持嵌套与跨行)
* / # 搜索光标处单词(向后 / 向前,全词匹配),再用 n/N 继续

编辑

按键 作用
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 在后 / 前粘贴
. 重复上次修改(支持计数覆盖,如 3.
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.2.tar.gz (22.9 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.2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easymd_cli-0.2.2.tar.gz
  • Upload date:
  • Size: 22.9 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.2.tar.gz
Algorithm Hash digest
SHA256 7d9beebb7bcfe6d1513424336eacf701fceee434cc8b2ad9ac5b4fed652b839b
MD5 0f5903a40a7f2326fc77f82c27342786
BLAKE2b-256 9209f78bd506a51d1f263aab775d3b30ae65eeae694917827ec7a10eff795a46

See more details on using hashes here.

Provenance

The following attestation bundles were made for easymd_cli-0.2.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: easymd_cli-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 16.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90f6d2114d3f6bb21d8583453e4dfd85d80e8ef403bb898f0eb2c5836aadc856
MD5 c2e9a89daed83b0116b229634f69b412
BLAKE2b-256 8d9e4b87ebc5a84615bfae48e76257e9111ee03cc52f5c102fd722cc632c868c

See more details on using hashes here.

Provenance

The following attestation bundles were made for easymd_cli-0.2.2-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