Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meck/alfred-hoogle
Search Hoogle with Alfred
https://github.com/meck/alfred-hoogle
Last synced: about 1 hour ago
JSON representation
Search Hoogle with Alfred
- Host: GitHub
- URL: https://github.com/meck/alfred-hoogle
- Owner: meck
- License: mit
- Created: 2018-10-28T20:18:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-20T10:49:10.000Z (almost 5 years ago)
- Last Synced: 2024-08-03T16:09:50.741Z (4 months ago)
- Language: Haskell
- Homepage:
- Size: 1.02 MB
- Stars: 20
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- alfred-workflows - Hoogle - Search [Hoogle](https://hoogle.haskell.org/). (Developer)
README
# Alfred-Hoogle
### A [Alfred](https://www.alfredapp.com) workflow for searching [Hoogle](https://hoogle.haskell.org)
This was made for my own use and to test my library for writing Alfred workflows in Haskell [alfred-footman](https://github.com/meck/alfred-footman). It can search locally and online simultaneously while filtering the results for duplicates. The default keyword is `ho`
![Demo](/docs/Screenshot.png)
### Possible actions on results
* Enter on a result opens the item docs in a browser.
* Enter+Shift opens the package docs of the item on Hackage or locally.
* Enter+Ctrl opens the module docs of the item if any on Hackage or locally.
* Alt+Enter opens the package docs of the item on Stackage.
* Cmd show the docs if any below the item.
* Cmd+Y or a tap on Shift opens a quicklook window.
* Cmd+C copies the function name.## Installation
Download binary from releases or check build section## Settings
Settings are available via the `hoset` keyword### Use a alternative server
Enabling this changes the server address from `hoogle.haskell.org` to `localhost:8080`,
for use with commands like `stack hoogle --server`.### Use a local database
Local search is disabled by default, enable it from the settings.
When searching next you will be prompted to build a database.
The indexing takes a while but reports back when its done.The default source for the database is stackage.
It can be set to a local folder with a Alfred file action,
any packages in this folder will be indexed then.It's possible to trigger a rebuild of the database anytime if needed.
If both online and local search is enabled results will be merged and filtered for duplicates,
by default the results from the local search take precedence, this changeable in the settings.### Workflow variables
Some settings are available as workflow variables in Alfred:
- The alternate address, default `http://localhost:8080`
- The number of local search results, default `15`
- The number of web search results, default `15`### External trigger
For triggering via applescript, as an example use it with Vim to lookup the word under the cursor:
``` vimscript
nnoremap ho :silent execute
\ ':!/usr/bin/osascript -e '
\ . shellescape(
\ 'tell application id "com.runningwithcrayons.Alfred"
\ to run trigger "ext_trig"
\ in workflow "se.meck.alfred-hoogle"
\ with argument "' . expand('') . '"'
\ )
```
### Building
1. Ensure `stack` is installed
2. Run `./build.hs` script, this makes `Hoggle.alfredworkflow`
3. Open it with Alfred