Skip to content

Commit eb3d921

Browse files
committed
docs: update README with instructions for AI commit message editing feature
1 parent 06e4137 commit eb3d921

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,32 @@ customCommands:
149149
labelFormat: "{{ .raw | green }}"
150150
```
151151

152+
This config will allows you to edit the commit message after picking from lazycommit suggestions.
153+
```yaml
154+
- key: "<c-b>" # ctrl + b
155+
description: "Pick AI commit (edit before committing)"
156+
context: "files"
157+
command: >
158+
bash -c 'msg="{{.Form.Msg}}"; echo "$msg" > .git/COMMIT_EDITMSG && ${EDITOR:-nvim} .git/COMMIT_EDITMSG && if [ -s .git/COMMIT_EDITMSG ]; then
159+
160+
git commit -F .git/COMMIT_EDITMSG;
161+
else
162+
163+
echo "Commit message is empty, commit aborted.";
164+
fi'
165+
166+
prompts:
167+
- type: "menuFromCommand"
168+
title: "ai Commits"
169+
key: "Msg"
170+
command: "lazycommit commit"
171+
filter: '^(?P<raw>.+)$'
172+
valueFormat: "{{ .raw }}"
173+
labelFormat: "{{ .raw | green }}"
174+
output: terminal
175+
```
176+
177+
152178
## Troubleshooting
153179

154180
- "No staged changes to commit." — run `git add` first.

0 commit comments

Comments
 (0)