From e2c24becafc21f474a9f84a668350e40ffe48d4c Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Thu, 24 Nov 2022 00:36:26 +0100 Subject: Install and set up Dash docs in Emacs --- emacs-init.el | 16 ++++++++++++++++ home-configuration.scm | 1 + 2 files changed, 17 insertions(+) diff --git a/emacs-init.el b/emacs-init.el index c6679a63..6993f5fe 100644 --- a/emacs-init.el +++ b/emacs-init.el @@ -95,6 +95,22 @@ :config (counsel-mode +1) :diminish counsel-mode) +(defun tw/counsel-dash-is-help () + "Install `counsel-dash-at-point' as `evil-lookup-func'." + (setq-local evil-lookup-func #'counsel-dash-at-point)) + +(use-package counsel-dash + :bind (("K" . counsel-dash-at-point) ; TODO: just install as `evil-lookup-func'? + ("dK" . counsel-dash) + ("di" . counsel-dash-install-docset) + ("da" . counsel-dash-activate-docset) + ("dd" . counsel-dash-deactivate-docset)) + :hook (python-mode . tw/counsel-dash-is-help) + :custom + (counsel-dash-docsets-path (tw/xdg-emacs-subdir 'data "dash-docsets") "Store docsets in the XDG data directory.") + (counsel-dash-browser-func 'eww "Open documentation pages using `eww' instead of an external browser.") + (counsel-dash-enable-debugging nil "Disable popping up useless warnings.")) + (use-package rainbow-mode :after (evil) :bind (("tR" . rainbow-mode))) diff --git a/home-configuration.scm b/home-configuration.scm index 4b39e189..f65e7bfa 100644 --- a/home-configuration.scm +++ b/home-configuration.scm @@ -431,6 +431,7 @@ replacement spec (to which `regexp-substitute/global' is applied)." "emacs-use-package" "emacs-eglot" "emacs-counsel" + "emacs-counsel-dash" "sqlite" ; emacs-counsel-dash requires the sqlite3 binary "emacs-ivy" "emacs-ivy-posframe" "emacs-company" "emacs-company-quickhelp" "emacs-company-posframe" "emacs-autothemer" ; for catppuccin/emacs -- cgit v1.2.3