Read the blog post: https://blog.almost.education/posts/bang-el
bang.el allows one to DuckDuckGo’s !Bang from the comfort of Emacs.
It adds special support for Org-roam, with the function bang-roam allowing one to search with the roam node’s title, and bang-roam-wiki, which does the same specifically for Wikipedia.
bang.el requires that org-roam also be installed. We are working to make this an optional requirement.
In packages.el:
(package! bang :recipe (:host github :repo "EducatedAlmost/bang.el"))In config.el:
(require 'bang)
;; or, with roam support
(setq bang-roam-support t)
(after! org
(require 'bang))All functions can also be called interactively.
;; Can be called from anywhere:
(bang "w" "Gnosis")
(bang-info)
(bang-find-prefix "")
;; Must be called from inside an Org-roam node:
(bang-roam "ma")
(bang-roam-wiki)Called without a TERM argument, most Bangs will take one to the website’s homepage.
!gh- GitHub repositories
!clj- ClojureDocs
!xiny- Learn X in Y minutes, a introduction to any programming language
!pm- PubMed, biomedical papers
!arx- arXiv, physics papers
!wa- WolframAlpha, computational knowledge engine
!ma- MemoryAlpha, the Star Trek Wiki
!awoiaf- A Wiki of Ice and Fire
For a list of prefixes, see here, or call bang-find-prefix or bang-info.
To suggest a new Bang or correct an existing one: https://duckduckgo.com/newbang
Internally, the functions all call browse-url. To choose which program is used, one can edit the values of browse-url-browser-function and browse-url-generic-function as documented here.