dasht icon indicating copy to clipboard operation
dasht copied to clipboard

FZF support

Open Holzhaus opened this issue 5 years ago • 2 comments

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

Holzhaus avatar Dec 07 '18 12:12 Holzhaus

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.

wren avatar Oct 27 '20 05:10 wren

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

NightMachinery avatar May 19 '21 02:05 NightMachinery