Add a section of magit repositories #568
Unanswered
ipocentro87
asked this question in
Q&A
Replies: 1 comment
-
Hi, (dashboard-insert-section SECTION-NAME LIST LIST-SIZE SHORTCUT-ID SHORTCUT-CHAR ACTION &rest WIDGET-PARAMS) In the case of this "Magit" section, you need to define this "insert section" function: (defun dashboard-insert-magit (list-size)
"Insert LIST-SIZE number of magit repositories in dashboard."
(dashboard-insert-section
"Magit" ;; SECTION-NAME
(magit-list-repos) ;; LIST
list-size ;; LIST-SIZE
'magit ;; SHORCUT-ID
(dashboard-get-shortcut 'magit) ;; SHORTCUT CHAR
`(lambda (&rest _) (magit-status ,el)) ;; ACTION
(format "%s" el) ;; WIDGET-PARAMS
)) For (add-to-list 'dashboard-item-shortcuts
'(magit . "b")) Then, you have to add this "generator" to (add-to-list 'dashboard-item-generators '(magit . dashboard-insert-magit)) Now users can customize their (add-to-list 'dashboard-items '(magit . 7))` Hope this help. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I've been trying to add a custom section listing the magit repositories in the dashboard, similarly to what
magit-list-repositories
provides.I did find a solution to make it work, however it's a bit ugly as I override some dashboard functions and replaced the projects section instead of creating a new one. Here's my solution:
Is there any cleaner solution?
Thanks 🙏
Beta Was this translation helpful? Give feedback.
All reactions