doomemacs/core/defuns/defuns-docs.el
2016-06-18 00:54:13 -04:00

17 lines
608 B
EmacsLisp

;;; defuns-docs.el
;;;###autoload (autoload 'doom:docs-lookup "defuns-docs" nil t)
(evil-define-command doom:docs-lookup (&optional bang input)
"Look up INPUT (otherwise the current selection) in Dash or Zeal."
(interactive "<!><a>")
(let ((query input))
(when (evil-visual-state-p)
(setq query (concat (buffer-substring-no-properties (region-beginning) (region-end))
" " query)))
(when (or (not query) (zerop (length query)))
(setq query (thing-at-point 'symbol)))
(doom-docs-lookup query bang)))
(provide 'defuns-docs)
;;; defuns-docs.el ends here