From 502d0dc78a2775cbf19e7116292cb8a9775706f7 Mon Sep 17 00:00:00 2001 From: aleidk Date: Tue, 24 Dec 2024 08:32:31 -0300 Subject: [PATCH] update lazygit config --- config/lazygit/config.yml | 27 +++++++++++++++++--- config/nvim/lua/aleidk/plugins-ide/ai.lua | 30 +++++------------------ 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/config/lazygit/config.yml b/config/lazygit/config.yml index 422844f..c731239 100644 --- a/config/lazygit/config.yml +++ b/config/lazygit/config.yml @@ -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: + +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 }}" diff --git a/config/nvim/lua/aleidk/plugins-ide/ai.lua b/config/nvim/lua/aleidk/plugins-ide/ai.lua index fefdb2d..463cb7c 100644 --- a/config/nvim/lua/aleidk/plugins-ide/ai.lua +++ b/config/nvim/lua/aleidk/plugins-ide/ai.lua @@ -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", }, + { + "ad", + "CopilotChatDocs", + desc = "Generate documentation", + mode = { "n", "v" }, + }, } }