Skip to content

Commit 63092ce

Browse files
unhappychoiceclaude
andcommitted
docs: add speed-rule documentation
- Add --speed-rule example to README Quick Start - Add speed_rules config option to configuration.md - Add --speed-rule CLI option to usage.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4a008e6 commit 63092ce

3 files changed

Lines changed: 66 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ gitlogue --theme dracula
120120
# Adjust typing speed (ms per character)
121121
gitlogue --speed 20
122122

123+
# Set different speeds for different file types
124+
gitlogue --speed-rule "*.java:50" --speed-rule "*.xml:5"
125+
123126
# Ignore specific file patterns (e.g., notebooks, lock files)
124127
gitlogue --ignore "*.ipynb" --ignore "poetry.lock"
125128

‎docs/configuration.md‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ loop = false
4848
# Ignore patterns (gitignore syntax)
4949
# Examples: ["*.ipynb", "poetry.lock", "docs/api/**"]
5050
ignore_patterns = []
51+
52+
# Speed rules for different file types (pattern:milliseconds)
53+
# Examples: ["*.java:50", "*.xml:5", "*.rs:30"]
54+
speed_rules = []
5155
```
5256

5357
## Configuration Options
@@ -150,13 +154,44 @@ Note: These patterns are additive with CLI `--ignore` flags and `--ignore-file`
150154
2. `--ignore-file` patterns
151155
3. CLI `--ignore` flags (highest priority)
152156

157+
### `speed_rules`
158+
159+
List of file-specific typing speed rules. Each rule specifies a glob pattern and speed in milliseconds.
160+
161+
- **Type**: Array of strings
162+
- **Default**: `[]` (empty array)
163+
- **Format**: `"PATTERN:MILLISECONDS"`
164+
- **Example**: `speed_rules = ["*.java:50", "*.xml:5"]`
165+
166+
The first matching rule wins. Files that don't match any rule use the base `speed` setting.
167+
168+
Common use cases:
169+
```toml
170+
# Slow down for important source files, speed through configs
171+
speed_rules = [
172+
"*.java:50", # 50ms per char for Java (slower, more readable)
173+
"*.rs:40", # 40ms per char for Rust
174+
"*.xml:5", # 5ms per char for XML (fast)
175+
"*.json:5", # 5ms per char for JSON (fast)
176+
"*.yaml:10", # 10ms per char for YAML
177+
]
178+
179+
# Focus on specific directories
180+
speed_rules = [
181+
"src/**/*.ts:30", # Slower for source TypeScript
182+
"tests/**/*.ts:10", # Faster for test files
183+
]
184+
```
185+
186+
Note: CLI `--speed-rule` flags take priority over config file rules. Rules are evaluated in order (CLI first, then config).
187+
153188
## Configuration Priority
154189

155190
Settings are applied in the following order (highest priority first):
156191

157192
1. **CLI arguments** - Command-line flags override everything
158193
```bash
159-
gitlogue --theme nord --speed 20 --background=false --order asc --loop
194+
gitlogue --theme nord --speed 20 --background=false --order asc --loop --speed-rule "*.rs:50"
160195
```
161196

162197
2. **Configuration file** - Values from `~/.config/gitlogue/config.toml`
@@ -247,6 +282,8 @@ speed = 30
247282
background = true
248283
order = "random"
249284
loop = false
285+
ignore_patterns = []
286+
speed_rules = []
250287
EOF
251288
```
252289

‎docs/usage.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,31 @@ gitlogue --speed 100 # Very slow typing
158158

159159
Lower values = faster typing. Recommended range: 10-100ms.
160160

161+
### `--speed-rule <PATTERN:MS>`
162+
163+
Set different typing speeds for files matching specific patterns. Can be specified multiple times.
164+
165+
```bash
166+
# Slow down for Java files, speed through XML
167+
gitlogue --speed-rule "*.java:50" --speed-rule "*.xml:5"
168+
169+
# Different speeds for source vs config files
170+
gitlogue --speed-rule "*.rs:40" --speed-rule "*.toml:10" --speed-rule "*.json:5"
171+
172+
# Combined with base speed (unmatched files use -s value)
173+
gitlogue --speed-rule "*.ts:30" -s 20
174+
```
175+
176+
Format: `PATTERN:MILLISECONDS`
177+
- Pattern uses glob syntax (e.g., `*.java`, `src/**/*.rs`)
178+
- First matching rule wins
179+
- Unmatched files use the base `--speed` value (default: 30ms)
180+
181+
Use cases:
182+
- Slow down for important source files you want to showcase
183+
- Speed through boilerplate like XML, JSON, or config files
184+
- Focus attention on specific directories
185+
161186
### `--order <ORDER>`
162187

163188
Set the commit playback order.

0 commit comments

Comments
 (0)