2015-05-21 17:06:13 +00:00
|
|
|
;;; packages.el --- search-engine Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2015-05-21 17:06:13 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
;; List of all packages to install and/or initialize. Built-in packages
|
|
|
|
;; which require an initialization must be listed explicitly in the list.
|
|
|
|
(setq search-engine-packages
|
2018-08-15 18:09:48 +00:00
|
|
|
'(
|
2019-08-03 21:34:18 +00:00
|
|
|
engine-mode))
|
|
|
|
|
2015-05-21 17:06:13 +00:00
|
|
|
|
|
|
|
(defun search-engine/init-engine-mode ()
|
|
|
|
(use-package engine-mode
|
|
|
|
:commands (defengine spacemacs/search-engine-select)
|
|
|
|
:defines search-engine-alist
|
|
|
|
:init
|
2016-08-13 07:57:25 +00:00
|
|
|
(progn
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"a/" 'spacemacs/search-engine-select)
|
|
|
|
(setq search-engine-alist
|
2019-07-31 18:32:20 +00:00
|
|
|
`((amazon
|
2016-08-13 07:57:25 +00:00
|
|
|
:name "Amazon"
|
2018-08-15 18:09:48 +00:00
|
|
|
:url "https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%%3Daps&field-keywords=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(bing
|
|
|
|
:name "Bing"
|
2018-08-15 18:09:48 +00:00
|
|
|
:url "https://www.bing.com/search?q=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(duck-duck-go
|
|
|
|
:name "Duck Duck Go"
|
|
|
|
:url "https://duckduckgo.com/?q=%s")
|
2018-08-15 18:09:48 +00:00
|
|
|
(ecosia
|
|
|
|
:name "Ecosia"
|
|
|
|
:url "https://www.ecosia.org/search?q=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(google
|
|
|
|
:name "Google"
|
2018-08-15 18:09:48 +00:00
|
|
|
:url "https://www.google.com/search?ie=utf-8&oe=utf-8&q=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(google-images
|
|
|
|
:name "Google Images"
|
2018-08-15 18:09:48 +00:00
|
|
|
:url "https://www.google.com/images?hl=en&source=hp&biw=1440&bih=795&gbv=2&aq=f&aqi=&aql=&oq=&q=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(github
|
2018-08-15 18:09:48 +00:00
|
|
|
:name "GitHub"
|
2016-08-13 07:57:25 +00:00
|
|
|
:url "https://github.com/search?ref=simplesearch&q=%s")
|
|
|
|
(google-maps
|
|
|
|
:name "Google Maps"
|
2018-08-15 18:09:48 +00:00
|
|
|
:url "https://maps.google.com/maps?q=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(twitter
|
|
|
|
:name "Twitter"
|
|
|
|
:url "https://twitter.com/search?q=%s")
|
|
|
|
(project-gutenberg
|
|
|
|
:name "Project Gutenberg"
|
2018-08-15 18:09:48 +00:00
|
|
|
:url "https://www.gutenberg.org/ebooks/search.html/?format=html&default_prefix=all&sort_order=&query=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(youtube
|
|
|
|
:name "YouTube"
|
2018-08-15 18:09:48 +00:00
|
|
|
:url "https://www.youtube.com/results?aq=f&oq=&search_query=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(stack-overflow
|
|
|
|
:name "Stack Overflow"
|
|
|
|
:url "https://stackoverflow.com/search?q=%s")
|
|
|
|
(spacemacs-issues
|
|
|
|
:name "Spacemacs Issues"
|
|
|
|
:url "https://github.com/syl20bnr/spacemacs/issues?utf8=%%E2%%9C%%93&q=is%%3Aissue+is%%3Aopen+%s")
|
|
|
|
(spacemacs-pullrequests
|
|
|
|
:name "Spacemacs Pull Requests"
|
|
|
|
:url "https://github.com/syl20bnr/spacemacs/pulls?utf8=%%E2%%9C%%93&q=is%%3Aissue+is%%3Aopen+%s")
|
|
|
|
(wikipedia
|
|
|
|
:name "Wikipedia"
|
2018-08-15 18:09:48 +00:00
|
|
|
:url "https://www.wikipedia.org/search-redirect.php?language=en&go=Go&search=%s")
|
2019-08-03 21:34:18 +00:00
|
|
|
(maven
|
|
|
|
:name "Maven Central"
|
|
|
|
:url "https://search.maven.org/search?q=%s")
|
|
|
|
(npm
|
|
|
|
:name "Npmjs"
|
|
|
|
:url "https://www.npmjs.com/search?q=%s")
|
2019-08-03 21:59:15 +00:00
|
|
|
(hoogle
|
2019-10-13 04:48:45 +00:00
|
|
|
:name "Hoogle 5"
|
2019-08-03 21:59:15 +00:00
|
|
|
:url "https://hoogle.haskell.org/?hoogle=%s")
|
2019-08-04 14:32:45 +00:00
|
|
|
(haskell-packages
|
|
|
|
:name "Hackage Package Search"
|
|
|
|
:url "https://hackage.haskell.org/packages/search?terms=%s")
|
2019-08-03 21:59:15 +00:00
|
|
|
(clojure
|
|
|
|
:name "Clojure Docs"
|
|
|
|
:url "https://clojuredocs.org/search?q=%s")
|
2019-08-04 14:32:45 +00:00
|
|
|
(pip
|
|
|
|
:name "Python Package Index"
|
|
|
|
:url "https://pypi.org/search/?q=%s")
|
|
|
|
(python-doc
|
|
|
|
:name "Python Docs"
|
|
|
|
:url "https://docs.python.org/3/search.html?q=%s")
|
|
|
|
(c++-api-reference
|
|
|
|
:name "C++ Reference"
|
|
|
|
:url "https://en.cppreference.com/mwiki/index.php?search=%s")
|
2016-08-13 07:57:25 +00:00
|
|
|
(wolfram-alpha
|
|
|
|
:name "Wolfram Alpha"
|
2019-07-31 18:32:20 +00:00
|
|
|
:url "https://www.wolframalpha.com/input/?i=%s")
|
2019-12-11 12:10:43 +00:00
|
|
|
(ctan
|
|
|
|
:name "CTAN"
|
|
|
|
:url "https://ctan.org/search?phrase=%s")
|
2019-07-31 18:32:20 +00:00
|
|
|
,@search-engine-config-list))
|
2016-08-13 07:57:25 +00:00
|
|
|
(dolist (engine search-engine-alist)
|
|
|
|
(let ((func (intern (format "engine/search-%S" (car engine)))))
|
|
|
|
(autoload func "engine-mode" nil 'interactive))))
|
2015-05-21 17:06:13 +00:00
|
|
|
:config
|
2016-08-13 07:57:25 +00:00
|
|
|
(progn
|
|
|
|
(engine-mode t)
|
|
|
|
(dolist (engine search-engine-alist)
|
|
|
|
(let* ((cur-engine (car engine))
|
2019-08-03 21:34:18 +00:00
|
|
|
(engine-url (plist-get (cdr engine) :url))
|
|
|
|
(engine-keywords (plist-get (cdr engine) :keywords)))
|
|
|
|
(eval `(defengine ,cur-engine ,engine-url ,@engine-keywords)))))))
|