diff options
Diffstat (limited to 'lisp/programming.el')
| -rw-r--r-- | lisp/programming.el | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lisp/programming.el b/lisp/programming.el index 592551e..5f8d743 100644 --- a/lisp/programming.el +++ b/lisp/programming.el @@ -123,3 +123,37 @@ (:map smartparens-mode-map ("C-M-o" . sp-up-sexp) ("C-M-i" . sp-backward-down-sexp))) + +;; Dash [1] is an alright system for managing documentation offline. We're in +;; Emacs, though, so why not make full use of it and use EWW to browse docs? +;; +;; [1]: https://kapeli.com/dash + +(defun maybe-install-docset (name) + "Install NAME if it is not already installed." + (let ((file-name (concat name ".docset"))) + (unless (file-exists-p (expand-file-name file-name dash-docs-docsets-path)) + (dash-docs-install-docset name)))) + +(use-package dash-docs + :init + (setq dash-docs-browser-func 'w3m-goto-url) + :config + (maybe-install-docset "Rust") + :hook + (rust-mode . (lambda () (setq-local dash-docs-docsets '("Rust")))) + :bind + (("C-c C-M-d" . counsel-dash))) + +(use-package counsel-dash) + +;; I configure EWW here because I mostly use it for Dash. Thanks to the +;; Javascript curse, Firefox is my daily driver for recreational browsing. + +(use-package eww + :straight nil + :init + (setq shr-max-width 80) + (setq shr-use-colors nil) + (setq shr-use-fonts nil) + (setq eww-header-line-format nil) |