Skip to content

Commit be0a5ad

Browse files
chore(docs): #1684 Explain builder hooks in docs
1 parent ff5c82e commit be0a5ad

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

README.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,7 @@ neogit.setup {
101101
-- Scope persisted settings on a per-project basis
102102
use_per_project_settings = true,
103103
-- Table of settings to never persist. Uses format "Filetype--cli-value"
104-
ignored_settings = {
105-
"NeogitPushPopup--force-with-lease",
106-
"NeogitPushPopup--force",
107-
"NeogitPullPopup--rebase",
108-
"NeogitCommitPopup--allow-empty",
109-
"NeogitRevertPopup--no-edit",
110-
},
104+
ignored_settings = {},
111105
-- Configure highlight group features
112106
highlight = {
113107
italic = true,

doc/neogit.txt

+17-7
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,7 @@ to Neovim users.
128128
-- Scope persisted settings on a per-project basis
129129
use_per_project_settings = true,
130130
-- Table of settings to never persist. Uses format "Filetype--cli-value"
131-
ignored_settings = {
132-
"NeogitPushPopup--force-with-lease",
133-
"NeogitPushPopup--force",
134-
"NeogitPullPopup--rebase",
135-
"NeogitCommitPopup--allow-empty",
136-
"NeogitRevertPopup--no-edit",
137-
},
131+
ignored_settings = {},
138132
-- Configure highlight group features
139133
highlight = {
140134
italic = true,
@@ -2136,5 +2130,21 @@ calling the setup function:
21362130
},
21372131
})
21382132
<
2133+
2134+
You can also customize existing popups via the Neogit config.
2135+
Below is an example of adding a custom switch, but you can use any function
2136+
from the builder API.
2137+
>lua
2138+
require("neogit").setup({
2139+
builders = {
2140+
NeogitPushPopup = function(builder)
2141+
builder:switch('m', 'merge_request.create', 'Create merge request', { cli_prefix = '-o ', persisted = false })
2142+
end,
2143+
},
2144+
})
2145+
2146+
Keep in mind that builder hooks are executed at the end of the popup
2147+
builder, so any switches or options added will be placed at the end.
2148+
21392149
------------------------------------------------------------------------------
21402150
vim:tw=78:ts=8:ft=help:norl:

0 commit comments

Comments
 (0)