2bef3f67e0
In the upstream dash-docs and helm-dash documentation, they suggest a workflow where users leave relatively little in `dash-common-docsets`, and instead add per-mode hooks to enable specific docsets, since a user is unlikely to want Python documentation while in a C++ buffer and vice versa. Currently, the spacemacs dash layer will automatically discover all installed docsets and add them to `dash-common-docsets`. This commit adds a config option `dash-autoload-common-docsets` that can be set to nil to skip the auto-loading and allow users to opt-in. Co-Authored-By: duianto <otnaiud@gmail.com>
51 lines
1.7 KiB
EmacsLisp
51 lines
1.7 KiB
EmacsLisp
;; see conditional package inclusion
|
|
(setq dash-packages
|
|
'(
|
|
(dash-at-point :toggle (spacemacs/system-is-mac))
|
|
(helm-dash :requires helm)
|
|
(counsel-dash :requires ivy)
|
|
(zeal-at-point :toggle (or (spacemacs/system-is-linux)
|
|
(spacemacs/system-is-mswindows)))))
|
|
|
|
(defun dash/init-helm-dash ()
|
|
(use-package helm-dash
|
|
:defer t
|
|
:init (progn
|
|
(spacemacs/declare-prefix "d" "docs")
|
|
(spacemacs/set-leader-keys
|
|
"dh" 'helm-dash-at-point
|
|
"dH" 'helm-dash))
|
|
:config (when dash-autoload-common-docsets
|
|
(dash//activate-package-docsets helm-dash-docset-newpath))))
|
|
|
|
(defun dash/init-counsel-dash ()
|
|
(use-package counsel-dash
|
|
:defer t
|
|
:init (progn
|
|
(spacemacs/declare-prefix "d" "docs")
|
|
(spacemacs/set-leader-keys
|
|
"dh" 'counsel-dash-at-point
|
|
"dH" 'counsel-dash))
|
|
:config (when dash-autoload-common-docsets
|
|
(dash//activate-package-docsets helm-dash-docset-newpath))))
|
|
|
|
(defun dash/init-dash-at-point ()
|
|
(use-package dash-at-point
|
|
:defer t
|
|
:init (progn
|
|
(spacemacs/declare-prefix "d" "docs")
|
|
(spacemacs/set-leader-keys
|
|
"dd" 'dash-at-point
|
|
"dD" 'dash-at-point-with-docset))))
|
|
|
|
(defun dash/init-zeal-at-point ()
|
|
(use-package zeal-at-point
|
|
:defer t
|
|
:init (progn
|
|
(spacemacs/declare-prefix "d" "docs")
|
|
(spacemacs/set-leader-keys
|
|
"dd" 'zeal-at-point
|
|
"dD" 'zeal-at-point-set-docset))
|
|
:config
|
|
;; This lets users seach in multiple docsets
|
|
(add-to-list 'zeal-at-point-mode-alist '(web-mode . "html,css,javascript"))))
|