Skip to content

Search with DuckDuckGo

David-Apps edited this page Jul 7, 2022 · 10 revisions

These functions make it easier to search with DuckDuckGo. The functions move to the first search result and stop. To move to the next search result, you can use the / command.

    # Search using DuckDuckGo.
# usage: <ddg <search terms>
function:ddg {
db0
H-
js-
b https://www.duckduckgo.com/
sw+
/<>/ i1=~0
i2*
g/h2 Ad/X
/h2 {/
if(?) {
/^No results\.$/f
}
}

# Search for the contents of the current line using DuckDuckGo.
# usage: <lddg
# This function uses session 999.
function:lddg {
db0
H-
.w999
b https://www.duckduckgo.com/
sw+
/<>/ i1<999
q999
i2*
g/h2 Ad/X
/h2 {/
if(?) {
/^No results\.$/f
}
}