Can w3m automatically search the entered text

internetw3mweb

Is there a way to configure w3m so that at 'U',
i.e. after entering text into the URL field, the
browser will automatically prepend
"google.com/search?q=" to it? Or can some other
command be used or defined to obtain the same effect?
I tried calling a shell script via "#" but it just
passes output into buffer.

Best Answer

I added this to my ~/.profile

goo() {
    IFS=+ w3m https://google.com/search?hl=en\&q="$*"\&btnI= https://google.com/search?hl=en\&q="$*"
}

This allows a quick look at "I'm Feeling Lucky" result on a command line like this: goo linux kernel. If first match is a miss, hitting B presents the normal list of results. The convenience comes at expense of latency though, as both URLs load before anything is displayed.

Related Question