This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+web-services/search-engine
2021-04-17 11:32:54 +03:00
..
img
config.el Search Engine layer: Allow customization of Amazon site TLD. 2021-04-15 22:10:08 +02:00
funcs.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
packages.el Search Engine layer: Allow customization of Amazon site TLD. 2021-04-15 22:10:08 +02:00
README.org documentation formatting: Sat Apr 17 07:08:57 UTC 2021 2021-04-17 11:32:54 +03:00

Search Engine layer

/TakeV/spacemacs/media/commit/77f0124a45fd8600435e298e81275418bb84bb49/layers/+web-services/search-engine/img/searchengine.jpg

Description

This layer adds support for the Search Engine package.

Features:

  • Browser search integration

Supported search engines

  • Amazon
  • Bing
  • Duck Duck Go
  • Ecosia
  • Google
  • Google Images
  • GitHub
  • Google Maps
  • Twitter
  • Project Gutenberg
  • YouTube
  • Stack Overflow
  • Spacemacs Issues
  • Spacemacs Pull Requests
  • Wikipedia
  • Wolfram Alpha
  • Maven Central
  • Npm
  • Hoogle 5
  • Hackage Package Search
  • Clojure-doc
  • Python Package Index
  • Python Docs
  • C++ Reference
  • Melpa
  • Debian Packages
  • Ubuntu Packages

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add search-engine to the existing dotspacemacs-configuration-layers list in this file.

Key bindings

Evil Holy Command
SPC a w / C-c / Summon a Helm buffer to select any engine

Customize it!

If you'd rather have emacs use chrome, or firefox or any other thing (eww) you can have that customization. For example for google chrome you can put this in your dotspacemacs/user-config:

  (setq browse-url-browser-function 'browse-url-generic
        engine/browser-function 'browse-url-generic
        browse-url-generic-program "google-chrome")

The Amazon search engine defaults to use the .com TLD. If you want it to search on another country's website, you can specify a different one:

  ;; Use amazon.es site (Spain)
  (setq-default search-engine-amazon-tld "es")

If you want more control of how various search engines are handled or you want to add additional ones you can do so by setting the following datastructure to search-engine-config-list in your dotspacemacs/user-config.

The datastructure consists of a key and:

  • name -> the name displayed in the search prompt.
  • url -> the url to query against, search parameter must be set as %s.
  • keywords -> a list of engine-mode keywords like a specific browser to use or a specific transformation to make. You can find a detailed list of all supported features here.
  (setq-default dotspacemacs-configuration-layers
    '((search-engine :variables
                     search-engine-config-list '((custom1
                                                  :name "Custom Search Engine 1"
                                                  :url "http://www.domain.com/s/stuff_sutff_remember_to_replace_search_candidate_with_%s"
                                                  :keywords (:docstring "My custom string"
                                                                        :browser 'eww-browse-url))))))

If you'd rather not use helm but would want a specific search engine, remember the function generated is always engine/search-(the name of the search engine lower-case and hyphen instead-of-spaces-for-separation) so you can bind that to any key binding you want.