Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FZF support #37

Open
Holzhaus opened this issue Dec 7, 2018 · 2 comments
Open

FZF support #37

Holzhaus opened this issue Dec 7, 2018 · 2 comments

Comments

@Holzhaus
Copy link

Holzhaus commented Dec 7, 2018

It would be nice to be able to use fzf to select a docset instead of using w3m.

Holzhaus added a commit to Holzhaus/dasht that referenced this issue Dec 7, 2018
A quick and dirty implementation to select a query result (sunaku#37).
@wren
Copy link

wren commented Oct 27, 2020

Quick hacky alias to use fzf while this issue is being worked on:

alias dasht-search='func() { dasht-query-line $@ | perl -0777 -pe ''s/name = (.*?)\ntype = (.*?)\nfrom = (.*?)\nurl = (.*?)\n/ $4 | $1 | $3 | $3\n\n/g'' | column -ts''|'' | fzf --no-sort --with-nth=2.. --bind ''enter:execute(w3m {1})+accept''; }; func'

Please note that I'm using zsh, so you might have to escape some extra quotes if you are on another shell.

@NightMachinery
Copy link

function ffdash() {
    dasht-query-line $@ | perl -0777 -pe 's/name = (.*?)\ntype = (.*?)\nfrom = (.*?)\nurl = (.*?)\n/ $4 | $1 | $3 | $3\n\n/g' | column -ts'|' | fzf --no-sort --with-nth=2.. --bind 'enter:execute(w3m {1})+accept'
}

The above alias in a saner format. It isn't complete though:

❯ dasht-query-line 'wor' | rg word-bre                                                                    
name = word-break
url = file:///Users/evar/.local/share/dasht/docsets/CSS.docset/Contents/Resources/Documents/developer.mozilla.org/en-US/docs/Web/CSS/word-break.html#content

❯ dasht-query-line 'w' | rg word-bre     

dasht-query-line has a limit on the results it returns. I think this should be easy to fix? @sunaku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants