diff --git a/README.org b/README.org index 4a05761e..2dc31fb4 100644 --- a/README.org +++ b/README.org @@ -66,6 +66,9 @@ To update the banner or banner title ;; Content is not centered by default. To center, set (setq dashboard-center-content t) + +;; To disable shortcut "jump" indicators for each section, set +(setq dashboard-show-shortcuts nil) #+END_SRC To customize which widgets are displayed, you can use the following snippet diff --git a/dashboard-widgets.el b/dashboard-widgets.el index df5b8990..63b8e9b8 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -44,6 +44,11 @@ to the specified width, with aspect ratio preserved." :type 'integer :group 'dashboard) +(defcustom dashboard-show-shortcuts t + "Whether to show shortcut keys for each section." + :type 'boolean + :group 'dashboard) + (defconst dashboard-banners-directory (concat (file-name-directory (locate-library "dashboard")) @@ -155,9 +160,10 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." "Insert a page break line in dashboard buffer." (dashboard-append dashboard-page-separator)) -(defun dashboard-insert-heading (heading) - "Insert a widget HEADING in dashboard buffer." - (insert (propertize heading 'face 'dashboard-heading-face))) +(defun dashboard-insert-heading (heading &optional shortcut) + "Insert a widget HEADING in dashboard buffer, adding SHORTCUT if provided." + (insert (propertize heading 'face 'dashboard-heading-face)) + (if shortcut (insert (format " (%s)" shortcut)))) ;; ;; BANNER @@ -272,7 +278,8 @@ SHORTCUT is the keyboard shortcut used to access the section. ACTION is theaction taken when the user activates the widget button. WIDGET-PARAMS are passed to the \"widget-create\" function." `(progn - (dashboard-insert-heading ,section-name) + (dashboard-insert-heading ,section-name + (if (and ,list dashboard-show-shortcuts) ,shortcut)) (when (dashboard-insert-section-list ,section-name (dashboard-subseq ,list 0 list-size)