Files
vimx/challenges/speed-drill.md
T
fukunee e8dfa0e2f1 Add Vim exercises, cheatsheet, and project polish
Add code golf challenges for Vim practice, a weekly review template, and
extend the cheatsheet with high-frequency commands. Fix the calculator
`multiply` implementation and correct a logger import path.
2026-05-31 23:01:37 +08:00

99 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ⚡ Speed Drill — 速度训练
> 这是你可以反复练习的计时挑战。每次记录时间,不断刷新纪录!
## 挑战 1:hjkl 盲打
**目标**:在 `01-basics/practice.ts` 中,用 `j/k` 从第 1 行移动到最后一行再回到第 1 行。
| 日期 | 时间 | 出错次数 | 备注 |
|------|------|----------|------|
| | | | |
## 挑战 2:单词跳跃
**目标**:在 `02-motions/maze.ts` 中,用 `w` 从 `START` 跳到 `END`,再用 `b` 返回。
| 日期 | 时间 | 出错次数 | 备注 |
|------|------|----------|------|
| | | | |
## 挑战 3:文本对象连击
**目标**:在 `03-operators/sandbox.ts` 中连续完成 10 个操作:
1. `ciw` 修改任意单词
2. `ci"` 修改引号内容
3. `di(` 删除括号内容
4. `yi{` 复制花括号内容
5. `da"` 删除引号及内容
6. `ci(` 修改括号内容
7. `dap` 删除段落
8. `>i{` 缩进花括号
9. `=i{` 格式化花括号
10. `ci'` 修改单引号内容
⚠️ 每次操作后按 `u` 撤销,保持文件原样。
| 日期 | 时间 | 出错次数 | 备注 |
|------|------|----------|------|
| | | | |
## 挑战 4:重命名风暴
**目标**:在 `04-zed-superpowers/superpowers.ts` 中:
- 用 `c d` 重命名 `User` → `Customer`(2 处位置需更新)
- 用 `c d` 重命名 `fetchUsers` → `loadCustomers`
- 用 `g l` 选中所有 `user` 改为 `cust`
- 全部还原用 `u`
| 日期 | 时间 | 出错次数 | 备注 |
|------|------|----------|------|
| | | | |
## 挑战 5:宏马拉松
**目标**:在 `05-advanced/workshop.ts` 中:
1. 录制宏 `qa`:把数字行 `1` → `{id: 1}`
2. 用 `4@a` 把剩下 4 行也转换
3. 录制宏 `qb`:用 `ysiw"` 给单词加引号
4. 用 `@b` 给另一个单词加引号
| 日期 | 时间 | 出错次数 | 备注 |
|------|------|----------|------|
| | | | |
## 挑战 6:项目导航
**目标**:在 `06-integration/project/` 中完成:
1. `:E` 打开项目面板
2. 用 `j/k` → `o` 打开 `index.ts`
3. 用 `g d` 跳到 `Calculator` 的定义
4. 用 `g A` 查看 `logger` 的所有引用
5. 用 `Ctrl+o` 跳回去
6. `:vs` 分割窗格,打开 `formatter.ts`
7. `Ctrl+w h/l` 在两个窗格间切换
8. `:G` 打开 Git 面板
| 日期 | 时间 | 出错次数 | 备注 |
|------|------|----------|------|
| | | | |
## 终极大挑战:重构马拉松
**目标**:在 `06-integration/project/` 中完成以下全部操作:
1. 用 `g S` 找到 `Calculator` 类
2. 用 `c d` 将其重命名为 `MathEngine`
3. 用 `g A` 确保所有引用都已更新
4. 用 `] m` 跳到每个方法,用 `g c` 选择注释
5. 用 `:%s/result/output/g` 全局替换变量名
6. 用 `g l` 选中所有 `const` 改为 `let`
7. 用 `u` 全部撤销
8. 用 `:E` → `:te` 打开终端
9. 用 `Ctrl+w j` 回到编辑器
10. 用 `:wq` 关闭所有
| 日期 | 时间 | 出错次数 | 备注 |
|------|------|----------|------|
| | | | |