|
1 |
| -# Advanced Git Search |
| 1 | +# 🍃 Advanced Git Search |
2 | 2 |
|
3 | 3 | An advanced git search extension for `Telescope` and `fzf-lua`.
|
4 | 4 |
|
@@ -178,156 +178,152 @@ Enable `show_builtin_git_pickers` to additionally show builtin git pickers.
|
178 | 178 |
|
179 | 179 | ## ⚙️ Installation
|
180 | 180 |
|
| 181 | +### Config |
| 182 | + |
| 183 | +```lua |
| 184 | +{ |
| 185 | + -- fugitive or diffview |
| 186 | + diff_plugin = "fugitive", |
| 187 | + -- customize git in previewer |
| 188 | + -- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" } |
| 189 | + git_flags = {}, |
| 190 | + -- customize git diff in previewer |
| 191 | + -- e.g. flags such as { "--raw" } |
| 192 | + git_diff_flags = {}, |
| 193 | + -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch |
| 194 | + show_builtin_git_pickers = false, |
| 195 | + |
| 196 | + -- Telescope layout setup |
| 197 | + telescope_theme = { |
| 198 | + function_name_1 = { |
| 199 | + -- Theme options |
| 200 | + }, |
| 201 | + function_name_2 = "dropdown" |
| 202 | + -- e.g. realistic example |
| 203 | + show_custom_functions = { |
| 204 | + layout_config = { width = 0.4, height = 0.4 }, |
| 205 | + }, |
| 206 | + |
| 207 | + } |
| 208 | +} |
| 209 | +``` |
| 210 | + |
| 211 | +### Dependencies |
| 212 | + |
| 213 | +```lua |
| 214 | +{ |
| 215 | + "nvim-telescope/telescope.nvim", |
| 216 | + -- to show diff splits and open commits in browser |
| 217 | + "tpope/vim-fugitive", |
| 218 | + -- to open commits in browser with fugitive |
| 219 | + "tpope/vim-rhubarb", |
| 220 | + -- optional: to replace the diff from fugitive with diffview.nvim |
| 221 | + -- (fugitive is still needed to open in browser) |
| 222 | + -- "sindrets/diffview.nvim", |
| 223 | +} |
| 224 | +``` |
| 225 | + |
| 226 | + |
181 | 227 | ### Telescope
|
182 | 228 |
|
183 |
| -With Lazy |
| 229 | +<details> |
| 230 | +<summary>Lazy</summary> |
| 231 | +To complete this snippet, see [Config](#Config) and [Dependencies](#Dependencies). |
184 | 232 |
|
185 | 233 | ```lua
|
186 |
| - { |
187 |
| - "aaronhallaert/advanced-git-search.nvim", |
188 |
| - config = function() |
189 |
| - -- optional: setup telescope before loading the extension |
190 |
| - require("telescope").setup{ |
191 |
| - -- move this to the place where you call the telescope setup function |
192 |
| - extensions = { |
193 |
| - advanced_git_search = { |
194 |
| - -- fugitive or diffview |
195 |
| - diff_plugin = "fugitive", |
196 |
| - -- customize git in previewer |
197 |
| - -- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" } |
198 |
| - git_flags = {}, |
199 |
| - -- customize git diff in previewer |
200 |
| - -- e.g. flags such as { "--raw" } |
201 |
| - git_diff_flags = {}, |
202 |
| - -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch |
203 |
| - show_builtin_git_pickers = false, |
| 234 | +{ |
| 235 | + "aaronhallaert/advanced-git-search.nvim", |
| 236 | + config = function() |
| 237 | + -- optional: setup telescope before loading the extension |
| 238 | + require("telescope").setup{ |
| 239 | + -- move this to the place where you call the telescope setup function |
| 240 | + extensions = { |
| 241 | + advanced_git_search = { |
| 242 | + -- See Config |
204 | 243 | }
|
205 |
| - } |
206 | 244 | }
|
207 |
| - |
208 |
| - require("telescope").load_extension("advanced_git_search") |
209 |
| - end, |
210 |
| - dependencies = { |
211 |
| - "nvim-telescope/telescope.nvim", |
212 |
| - -- to show diff splits and open commits in browser |
213 |
| - "tpope/vim-fugitive", |
214 |
| - -- to open commits in browser with fugitive |
215 |
| - "tpope/vim-rhubarb", |
216 |
| - -- OPTIONAL: to replace the diff from fugitive with diffview.nvim |
217 |
| - -- (fugitive is still needed to open in browser) |
218 |
| - -- "sindrets/diffview.nvim", |
219 |
| - }, |
220 |
| - } |
| 245 | + } |
| 246 | + |
| 247 | + require("telescope").load_extension("advanced_git_search") |
| 248 | + end, |
| 249 | + dependencies = { |
| 250 | + --- See dependencies |
| 251 | + }, |
| 252 | +} |
221 | 253 | ```
|
| 254 | +</details> |
| 255 | + |
| 256 | +<details> |
| 257 | +<summary>Packer</summary> |
222 | 258 |
|
223 |
| -With Packer |
| 259 | +To complete this snippet, see [Config](#Config) and [Dependencies](#Dependencies). |
224 | 260 |
|
225 | 261 | ```lua
|
226 |
| - use({ |
227 |
| - "aaronhallaert/advanced-git-search.nvim", |
228 |
| - config = function() |
229 |
| - -- optional: setup telescope before loading the extension |
230 |
| - require("telescope").setup{ |
231 |
| - -- move this to the place where you call the telescope setup function |
232 |
| - extensions = { |
233 |
| - advanced_git_search = { |
234 |
| - -- Fugitive or diffview |
235 |
| - diff_plugin = "fugitive", |
236 |
| - -- Customize git in previewer |
237 |
| - -- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" } |
238 |
| - git_flags = {}, |
239 |
| - -- Customize git diff in previewer |
240 |
| - -- e.g. flags such as { "--raw" } |
241 |
| - git_diff_flags = {}, |
242 |
| - -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch |
243 |
| - show_builtin_git_pickers = false, |
244 |
| - } |
| 262 | +use({ |
| 263 | + "aaronhallaert/advanced-git-search.nvim", |
| 264 | + config = function() |
| 265 | + -- optional: setup telescope before loading the extension |
| 266 | + require("telescope").setup{ |
| 267 | + -- move this to the place where you call the telescope setup function |
| 268 | + extensions = { |
| 269 | + advanced_git_search = { |
| 270 | + -- Insert Config here |
245 | 271 | }
|
246 | 272 | }
|
247 |
| - |
248 |
| - require("telescope").load_extension("advanced_git_search") |
249 |
| - end, |
250 |
| - requires = { |
251 |
| - "nvim-telescope/telescope.nvim", |
252 |
| - -- to show diff splits and open commits in browser |
253 |
| - "tpope/vim-fugitive", |
254 |
| - -- to open commits in browser with fugitive |
255 |
| - "tpope/vim-rhubarb", |
256 |
| - -- optional: to replace the diff from fugitive with diffview.nvim |
257 |
| - -- (fugitive is still needed to open in browser) |
258 |
| - -- "sindrets/diffview.nvim", |
259 |
| - }, |
260 |
| - }) |
| 273 | + } |
| 274 | + |
| 275 | + require("telescope").load_extension("advanced_git_search") |
| 276 | + end, |
| 277 | + requires = { |
| 278 | + -- Insert Dependencies here |
| 279 | + }, |
| 280 | +}) |
261 | 281 | ```
|
| 282 | +</details> |
262 | 283 |
|
263 | 284 | ### Fzf-lua
|
264 | 285 |
|
265 |
| -With Lazy |
| 286 | +<details> |
| 287 | +<summary>Lazy</summary> |
| 288 | +To complete this snippet, see [Config](#Config) and [Dependencies](#Dependencies). |
266 | 289 |
|
267 | 290 | ```lua
|
268 |
| - { |
269 |
| - "aaronhallaert/advanced-git-search.nvim", |
270 |
| - config = function() |
271 |
| - -- optional: setup telescope before loading the extension |
272 |
| - require("advanced_git_search.fzf").setup{ |
273 |
| - -- fugitive or diffview |
274 |
| - diff_plugin = "fugitive", |
275 |
| - -- customize git in previewer |
276 |
| - -- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" } |
277 |
| - git_flags = {}, |
278 |
| - -- customize git diff in previewer |
279 |
| - -- e.g. flags such as { "--raw" } |
280 |
| - git_diff_flags = {}, |
281 |
| - -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch |
282 |
| - show_builtin_git_pickers = false, |
283 |
| - } |
284 |
| - end, |
285 |
| - dependencies = { |
286 |
| - "ibhagwan/fzf-lua", |
287 |
| - -- to show diff splits and open commits in browser |
288 |
| - "tpope/vim-fugitive", |
289 |
| - -- to open commits in browser with fugitive |
290 |
| - "tpope/vim-rhubarb", |
291 |
| - -- OPTIONAL: to replace the diff from fugitive with diffview.nvim |
292 |
| - -- (fugitive is still needed to open in browser) |
293 |
| - -- "sindrets/diffview.nvim", |
294 |
| - }, |
295 |
| - } |
| 291 | +{ |
| 292 | + "aaronhallaert/advanced-git-search.nvim", |
| 293 | + config = function() |
| 294 | + require("advanced_git_search.fzf").setup{ |
| 295 | + -- Insert Config here |
| 296 | + } |
| 297 | + end, |
| 298 | + dependencies = { |
| 299 | + -- Insert Dependencies here |
| 300 | + }, |
| 301 | +} |
296 | 302 | ```
|
| 303 | + |
| 304 | +</details> |
| 305 | + |
| 306 | +<details> |
| 307 | +<summary>Packer</summary> |
297 | 308 |
|
298 |
| -With Packer |
| 309 | +To complete this snippet, see [Config](#Config) and [Dependencies](#Dependencies). |
299 | 310 |
|
300 | 311 | ```lua
|
301 |
| - use({ |
302 |
| - "aaronhallaert/advanced-git-search.nvim", |
303 |
| - config = function() |
304 |
| - -- optional: setup telescope before loading the extension |
305 |
| - require("advanced_git_search.fzf").setup{ |
306 |
| - -- Fugitive or diffview |
307 |
| - diff_plugin = "fugitive", |
308 |
| - -- Customize git in previewer |
309 |
| - -- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" } |
310 |
| - git_flags = {}, |
311 |
| - -- Customize git diff in previewer |
312 |
| - -- e.g. flags such as { "--raw" } |
313 |
| - git_diff_flags = {}, |
314 |
| - -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch |
315 |
| - show_builtin_git_pickers = false, |
316 |
| - } |
| 312 | +use({ |
| 313 | + "aaronhallaert/advanced-git-search.nvim", |
| 314 | + config = function() |
| 315 | + require("advanced_git_search.fzf").setup{ |
| 316 | + -- Insert Config here |
317 | 317 | }
|
318 |
| - end, |
319 |
| - requires = { |
320 |
| - "ibhagwan/fzf-lua", |
321 |
| - -- to show diff splits and open commits in browser |
322 |
| - "tpope/vim-fugitive", |
323 |
| - -- to open commits in browser with fugitive |
324 |
| - "tpope/vim-rhubarb", |
325 |
| - -- optional: to replace the diff from fugitive with diffview.nvim |
326 |
| - -- (fugitive is still needed to open in browser) |
327 |
| - -- "sindrets/diffview.nvim", |
328 |
| - }, |
329 |
| - }) |
| 318 | + } |
| 319 | + end, |
| 320 | + requires = { |
| 321 | + -- Insert Dependencies here |
| 322 | + }, |
| 323 | +}) |
330 | 324 | ```
|
| 325 | +</details> |
| 326 | + |
331 | 327 |
|
332 | 328 | ### Prerequisites
|
333 | 329 |
|
|
0 commit comments