You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# As a command
:Telescope conventional_commits
# As a lua function
require('telescope').extensions.conventional_commits.conventional_commits()
Configuration
You can customize action on selection within Telescope setup() function.
telescope.setup({
...extensions= {
conventional_commits= {
theme="ivy", -- custom themeaction=function(entry)
-- entry = {-- display = "feat A new feature",-- index = 7,-- ordinal = "feat",-- value = feat"-- }vim.print(entry)
end,
include_body_and_footer=true, -- Add prompts for commit body and footer
},
},
})
telescope.load_extension("conventional_commits")
Default action
Default action is cc_actions.commit and can be found here.
Include body and footer
The easiest way is to add include_body_and_footer within telescope setup like shown above.
If however you wish to do something more advanced, you can create a command to initiate the extension with the include_body_and_footer flag.
localfunctioncreate_conventional_commit()
localactions=require("telescope._extensions.conventional_commits.actions")
localpicker=require("telescope._extensions.conventional_commits.picker")
localthemes=require("telescope.themes")
-- if you use the picker directly you have to provide your theme manuallylocalopts= {
action=actions.prompt,
include_body_and_footer=true,
}
opts=vim.tbl_extend("force", opts, themes["get_ivy"]())
picker(opts)
endvim.keymap.set(
"n",
"cc",
create_conventional_commit,
{ desc="Create conventional commit" }
)