diff --git a/core/core-docs.el b/core/core-docs.el index fce0485f5..53289adc4 100644 --- a/core/core-docs.el +++ b/core/core-docs.el @@ -22,5 +22,21 @@ (setq-local ,(if IS-MAC 'dash-at-point-docset 'zeal-at-point-docset) ,docset))) +(use-package google-this + :commands (google-this-search + google-this-lucky-and-insert-url + google-this-lucky-search + google-this-string + google-this-line + google-this-ray + google-this-word + google-this-symbol + google-this-region + google-this + google-this-noconfirm + google-this-error + google-this-cpp-reference + google-this-forecast)) + (provide 'core-docs) ;;; core-docs.el ends here diff --git a/core/defuns/defuns-docs.el b/core/defuns/defuns-docs.el index 94b0a87a2..e944c29c4 100644 --- a/core/defuns/defuns-docs.el +++ b/core/defuns/defuns-docs.el @@ -12,5 +12,20 @@ (setq query (thing-at-point 'symbol))) (doom-docs-lookup query bang))) +;;;###autoload (autoload 'doom:google-search "defuns-docs" nil t) +(evil-define-command doom:google-search (&optional bang search) + "Opens a browser and performs the entered google search. If BANG, use 'I'm +feeling lucky'." + (interactive "") + (if search + (google-this-parse-and-search-string + search nil + (if bang (google-this-lucky-search-url))) + (cond ((eq major-mode 'c++-mode) + (google-this-cpp-reference)) + ((evil-visual-state-p) + (google-this-region nil)) + (t (google-this-symbol nil))))) + (provide 'defuns-docs) ;;; defuns-docs.el ends here