Add google-this plugin

This commit is contained in:
Henrik Lissner 2016-10-03 12:11:10 +02:00
parent c28bb1519d
commit d2c6f0ca71
2 changed files with 31 additions and 0 deletions

View File

@ -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

View File

@ -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 "<!><a>")
(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