@@ -16,6 +16,7 @@ INTERFACE |gin-interface|
16
16
COMMANDS | gin-commands |
17
17
VARIABLES | gin-variables |
18
18
FUNCTIONS | gin-functions |
19
+ COMPONENTS | gin-components |
19
20
MAPPINGS | gin-mappings |
20
21
ACTIONS | gin-actions |
21
22
@@ -347,6 +348,47 @@ gin#action#list_actions()
347
348
gin#action#gather_candidates({range} )
348
349
Gather and return candidates of the current buffer in {range} .
349
350
351
+ -----------------------------------------------------------------------------
352
+ COMPONENTS *gin-components*
353
+
354
+ Components are | Function | that return a string for | statusline | and | tabline | .
355
+ The function will never throw errors and fail silently.
356
+ Note that the result of function is cached shortly to keep performance.
357
+ If no {worktree} is specified or an empty string, gin tries to find one like
358
+ ++worktree option explained in | gin-command-options | .
359
+ >
360
+ set statusline+=\ %{gin#component#worktree#name()}
361
+ set statusline+=\ (%{gin#component#branch#ascii()})
362
+ set statusline+=\ [%{gin#component#traffic#ascii()}]
363
+ <
364
+ Because | statusline | and/or | tabline | is not rendered on | BufEnter | , the
365
+ following configuration is recommended for fast update.
366
+ >
367
+ augroup gin_component_fast_update
368
+ autocmd!
369
+ autocmd BufEnter * ++nested redrawstatusline
370
+ " Or if you prefer tabline, use below
371
+ "autocmd BufEnter * ++nested redrawtabline
372
+ augroup END
373
+ <
374
+ *gin#component#branch#ascii()*
375
+ *gin#component#branch#unicode()*
376
+ gin#component#branch#ascii([{worktree} ])
377
+ gin#component#branch#unicode([{worktree} ])
378
+ Return an indicator string of a current and upstream branches.
379
+
380
+ *gin#component#traffic#ascii()*
381
+ *gin#component#traffic#unicode()*
382
+ gin#component#traffic#ascii([{worktree} ])
383
+ gin#component#traffic#unicode([{worktree} ])
384
+ Return an indicator string of the number of ahead and behind commits.
385
+
386
+ *gin#component#worktree#full()*
387
+ *gin#component#worktree#name()*
388
+ gin#component#worktree#full([{worktree} ])
389
+ gin#component#worktree#name([{worktree} ])
390
+ Return an indicator string of the current worktree.
391
+
350
392
-----------------------------------------------------------------------------
351
393
MAPPINGS *gin-mappings*
352
394
0 commit comments