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 l、w b e、0 ^ $、gg G(3G 跳第 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$ 等 |
操作符 + 移动(y、c 同理;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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easymd_cli-0.2.3.tar.gz.
File metadata
- Download URL: easymd_cli-0.2.3.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8e4b7091523d245bc96d49821118e648c5e2a2ff26750bbe5174a583dba488d
|
|
| MD5 |
608de6d4e565fc6b31e0d7f068f927d8
|
|
| BLAKE2b-256 |
1e04ee8fe8eb88bb27f551c08662662ff5e3f8dbac9d641e2397b5ebb9d0d244
|
Provenance
The following attestation bundles were made for easymd_cli-0.2.3.tar.gz:
Publisher:
release.yml on decajoin/easymd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easymd_cli-0.2.3.tar.gz -
Subject digest:
e8e4b7091523d245bc96d49821118e648c5e2a2ff26750bbe5174a583dba488d - Sigstore transparency entry: 1821811961
- Sigstore integration time:
-
Permalink:
decajoin/easymd@43048494649f58aa505f4a2522d51712235b880c -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/decajoin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@43048494649f58aa505f4a2522d51712235b880c -
Trigger Event:
push
-
Statement type:
File details
Details for the file easymd_cli-0.2.3-py3-none-any.whl.
File metadata
- Download URL: easymd_cli-0.2.3-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ea6fff6d0705f8c8f0898178a940888526d2ed4c798920dd456cfb935ac9f65
|
|
| MD5 |
04dc147d1cb1c91f145d6aed058558fb
|
|
| BLAKE2b-256 |
af1d304dbe47e28ca77509c5842fe48c5e55e03ae46e5a658c0d1a390c4dc584
|
Provenance
The following attestation bundles were made for easymd_cli-0.2.3-py3-none-any.whl:
Publisher:
release.yml on decajoin/easymd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easymd_cli-0.2.3-py3-none-any.whl -
Subject digest:
5ea6fff6d0705f8c8f0898178a940888526d2ed4c798920dd456cfb935ac9f65 - Sigstore transparency entry: 1821812040
- Sigstore integration time:
-
Permalink:
decajoin/easymd@43048494649f58aa505f4a2522d51712235b880c -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/decajoin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@43048494649f58aa505f4a2522d51712235b880c -
Trigger Event:
push
-
Statement type: