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

How can I search the selected text with my custom search engines with a single key? #2566

Open
ffplayer opened this issue Jul 14, 2017 · 5 comments

Comments

@ffplayer
Copy link

When I selected some text and want to quickly search this text with specific custom search engine just with pressing s key.

Is it possible to do this?

@innaterebel
Copy link

innaterebel commented Jul 15, 2017

Configure your custom search engine in the advanced section of Vimium options.
Then p/P. (p is to paste the current string in clipboard to do a navigation if is an URL, otherwise do a search using the configured search engine. Uppercase P is to paste in a new tab)

Similar with selecting text via Visual Mode. Instead of y to copy the selection, p/P to directly search it using the configured search engine.

@ffplayer
Copy link
Author

@innaterebel thanks for your reply!
This two step method seems not perfectly to do "one single key searching".
I have a habit from opera of searching selected text with different single key with appropriate search engine. Such as I select "github" highlighted ,and then I can press g search it with google or press w search with wikipedia.
Maybe it not a general demand :P

@gdh1995
Copy link
Contributor

gdh1995 commented Jul 18, 2017

My custom Vimium allows this: it has a special command "autoOpen" which reads selected text and open or search it. The project is https://github.com/gdh1995/vimium-c , and Chrome WebStore link is https://chrome.google.com/webstore/detail/vimium-c/hfjbmagddngcpeloejdejnfgbamkjaeg/

For example, my command mappings are:

map Cd autoOpen keyword="dict"
map Cg autoOpen keyword="google"
map Cb autoOpen keyword="baidu"
# "dict" is the name of Bing Dict search engine (declared in "Custom search engines")
# "baidu" is another search engine mainly for Chinese users

@zz5678
Copy link

zz5678 commented Sep 21, 2020

My custom Vimium allows this: it has a special command "autoOpen" which reads selected text and open or search it. The project is https://github.com/gdh1995/vimium-plus , and Chrome WebStore link is https://chrome.google.com/webstore/detail/vimium%2B%2B/hfjbmagddngcpeloejdejnfgbamkjaeg/

For example, my command mappings are:

map Cd autoOpen keyword="dict"
map Cg autoOpen keyword="google"
map Cb autoOpen keyword="baidu"
# "dict" is the name of Bing Dict search engine (declared in "Custom search engines")
# "baidu" is another search engine mainly for Chinese users

wonderful !!
I have found this func so long, now I set up "s" key for selected text search in Google:
map s autoOpen keyword="google"

Unfortunately, few people know about your project

@zz5678
Copy link

zz5678 commented Dec 6, 2020

btw, feel great setting z and c keys as tabs changer-key, x and X as close and re-open keys by default with
vimium-c

map z previousTab
map c nextTab

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

No branches or pull requests

4 participants