tmux-plugins / tmux-open

Tmux key bindings for quick opening of a highlighted file or url
MIT License
620 stars 63 forks source link

Add a binding that performs a google search with the selected content #5

Closed lfv89 closed 9 years ago

lfv89 commented 9 years ago

What do you think?

bruno- commented 9 years ago

Hey, what are the chances someone doesn't like google search and wants microsoft bing? Or duckduckgo?

I would be okay with merging the code if it was more configurable. Here's what I would suggest: we don't want to hardcode neither google nor bing url in the source code. We create the interface where the user can specify something like this in their tmux.conf:

@open-S 'https://www.google.com.br/search?q={}'
@open-M 'https://www.bing.com.br/search?q={}'
@open-N 'whatever_else {}'

The above config would dynamically create prefix - S prefix - M and prefix - N key bindings, and would open a url or "whatever_else" the user specified.

I've done something similar for tmux-copycat so here are a couple hints if you want to give it a go:

Let me know and I'll gladly help you if you get stuck or something..

lfv89 commented 9 years ago

Hey, your considerations seems fair, and I agree with you. I'm gonna take a closer look at your links and then improve this PR.

I'll be back!

bruno- commented 9 years ago

Great!

lfv89 commented 9 years ago

Hey @bruno-

I've been working on this in the past few days and I think I've got a nice solution now.

This is a example of how the search engines can be configured:

@open-S 'https://www.google.com.br/search?q='
@open-B 'https://www.bing.com.br/search?q='
@open-D 'https://www.duckduckgo.com/'

What do you think?

bruno- commented 9 years ago

Hey @vasconcelloslf, it's good to hear you've made some progress on this. For some reason I can't see how is this implemented. It seems diff in this pull request does not work anymore? Can you please open another PR or something?

So yea, this is a nice feature and I'd definitely be interested to get it merged!