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.11+。

使用 uv(推荐):

uv sync
uv run easymd demo.md

或使用 pip:

pip install -r requirements.txt
pip install -e .
easymd demo.md        # 文件不存在时会在首次 :w 时创建

按键参考

模式

按键 作用
i a A I o O 进入插入模式(位置同 vim)
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 删除光标处字符
dd / yy / cc 删除 / 复制 / 改写整行(支持 3dd
dw de d$ 操作符 + 移动(yc 同理)
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/
  smoke_test.py  # 无头冒烟测试(Textual Pilot 驱动按键)

运行测试:uv run python tests/smoke_test.py

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.1.0.tar.gz (10.4 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.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easymd_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for easymd_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 846b8248b6fc216ed8f3113d3e5b2cad79f5d082760d24628b9d80295909486e
MD5 dbdb1ce24ea9a8518ab42bfd8d7ebbe7
BLAKE2b-256 4e4c7ad1bb8afb1d1de748eaa0a62f85bf411d758a4f201ba622e66cc03b2d2c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: easymd_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for easymd_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23f70b95741dd8ebc214a4017ae6966f769e6fc68bfd1332adb3a8933446ab9a
MD5 e5cf1c61d1b3648f0d2e22f6241d6e94
BLAKE2b-256 10916ce49703194ce0ea3c192e7592baea2b19f7b4edc9123c5647953b417f46

See more details on using hashes here.

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