update lazygit config

This commit is contained in:
Alexander Navarro 2024-12-24 08:32:31 -03:00
parent 1907cbfdf0
commit 502d0dc78a
2 changed files with 30 additions and 27 deletions

View file

@ -282,12 +282,12 @@ git:
disableForcePushing: false
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-commit-message-prefix
commitPrefix:
# commitPrefix:
# pattern to match on. E.g. for 'feature/AB-123' to match on the AB-123 use "^\\w+\\/(\\w+-\\w+).*"
pattern: ""
# pattern: ""
# Replace directive. E.g. for 'feature/AB-123' to start the commit message with 'AB-123 ' use "[$1] "
replace: ""
# replace: ""
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-branch-name-prefix
branchPrefix: ""
@ -573,3 +573,24 @@ keybinding:
bulkMenu: b
commitMessage:
commitMenu: <c-o>
customCommands:
- key: "C"
command: 'cog commit "{{ .Form.Type }} {{ .Form.Description }}" {{if .Form.Scopes}}({{ .Form.Scopes }}){{end}}'
description: "Commit with cocogitto"
context: "files"
prompts:
- type: "menuFromCommand"
title: "Select the commit type"
key: "Type"
command: >
bash -c "cog commit --help | sed -n 's/.*\\[possible values: \\(.*\\)\\].*/\\1/p' | tr ', ' '\\n' | sed '/^$/d' | sort"
- type: "input"
title: "Enter the scope(s) of this change"
key: "Scopes"
- type: "input"
title: "Enter a short description of the change"
key: "Description"
- type: "confirm"
title: "Is the commit message correct?"
body: "{{ .Form.Type }}{{if .Form.Scopes}}({{ .Form.Scopes }}){{end}}: {{ .Form.Description }}"

View file

@ -56,30 +56,6 @@ return {
The user can ask follow up question, which needs to follow the same rules.
]]
},
Explain = {
prompt = '> /COPILOT_EXPLAIN\n\nWrite an explanation for the selected code as paragraphs of text.',
},
Review = {
prompt = '> /COPILOT_REVIEW\n\nReview the selected code.',
-- see config.lua for implementation
},
Fix = {
prompt =
'> /COPILOT_GENERATE\n\nThere is a problem in this code. Rewrite the code to show it with the bug fixed.',
},
Optimize = {
prompt = '> /COPILOT_GENERATE\n\nOptimize the selected code to improve performance and readability.',
},
Docs = {
prompt = '> /COPILOT_GENERATE\n\nPlease add documentation comments to the selected code.',
},
Tests = {
prompt = '> /COPILOT_GENERATE\n\nPlease generate tests for my code.',
},
Commit = {
prompt =
'> #git:staged\n\nWrite commit message for the change with commitizen convention. Make sure the title has maximum 50 characters and message is wrapped at 72 characters. Wrap the whole message in code block with language gitcommit.',
},
},
question_header = "" .. vim.env.USER or "User" .. " ",
answer_header = " Copilot ",
@ -162,5 +138,11 @@ return {
end,
desc = "Set debug level",
},
{
"<leader>ad",
"<CMD>CopilotChatDocs<CR>",
desc = "Generate documentation",
mode = { "n", "v" },
},
}
}