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

使用 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.1.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.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easymd_cli-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 24abb2270a3ce1028677a282f7169fa7ea9905e0277ec085aedd03fe3d36782c
MD5 27f09207590b7fb910d99c3e7f4d8655
BLAKE2b-256 99d33be6e8e9a071622f975e248754f594e3b50c50b8feabac1b4cd20206ccb6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: easymd_cli-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a05ddde311ff5315ddc03bab815c4d2783f887498e3ae725507c0922d59ccb0
MD5 d2da9dbda3b3bd1f380294b18f526b3d
BLAKE2b-256 69fd3028dec1e729a4f74d4a0d169755491e4258e15260a1bcded31b1ccac33f

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