vimium-c icon indicating copy to clipboard operation
vimium-c copied to clipboard

Can we add a key-map which make the query of some website ?

Open heissonly opened this issue 2 years ago • 22 comments

Something like below:

map hg openUrl url="https://context.reverso.net/%C3%BCbersetzung/deutsch-englisch/%s"

it is not working since it couldn't catch the selected word.

heissonly avatar Aug 13 '22 21:08 heissonly

map hg autoOpen keyword="reverso" do so, if only in Custom search engines there's:

reverso: https://context.reverso.net/%C3%BCbersetzung/deutsch-englisch/%s

gdh1995 avatar Aug 15 '22 02:08 gdh1995

Hi, It works autoopen only for normal web page text but doesn't work when I am writing something in some text field and try to activate autoOpen shortcut. Is there a solution to activate mapkey in text input field ?

heissonly avatar Aug 17 '22 17:08 heissonly

Please see https://github.com/gdh1995/vimium-c/wiki/Trigger-commands-in-an-input-box#trigger-commands-of-vimium-c . You may use map <f1> autoCopy or map <c-s-c:i> autoCopy.

gdh1995 avatar Aug 18 '22 02:08 gdh1995

Is it possible to make a mapkey both that work with insert mode and without insert mode because I dont want to set the key separately for each mode for the same website query. I gave a example of my current mapkey below;

map <c-r> autoOpen selected keyword="r"
map <c-s-r:i> autoOpen selected keyword="r"

Instead of that I would like to the make same map key for both mode.

heissonly avatar Aug 18 '22 18:08 heissonly

If you mean Ctrl Down, J Down, J Up, K Down, K Up and then Ctrl Up, then its name is <c-j><c-k>.

To make a mapkey both that work with insert mode and without insert mode, here's an example:

map <c-s-r> autoOpen selected keyword="r"
run <c-s-r:i> <c-s-r>

gdh1995 avatar Aug 19 '22 01:08 gdh1995

map <c-g>r autoOpen selected keyword="r"
run <c-g:i>r <c-g>r

map <c-g>d autoOpen selected copied keyword="d"
run <c-g:i>d <c-g>d

map <c-g>t autoOpen selected copied  keyword="t"
run <c-g:i>t <c-g>t

Thanks you for your reply, I would like to assign two consecutive key as above so that they don't interfere with my others mapkeys. Is it possible to make with run command. It seems that they don't work as it is now.

heissonly avatar Aug 19 '22 09:08 heissonly

What's the version of your Vimium C? What's your browser?

gdh1995 avatar Aug 19 '22 09:08 gdh1995

The logic about key mapping is changing in recent 2 minor versions, so I need a detailed version info to decide how to write mappings.

gdh1995 avatar Aug 19 '22 09:08 gdh1995

Chrome Version 104.0.5112.101 (Official Build) (arm64)

Vimuim Version 1.99.2

heissonly avatar Aug 19 '22 09:08 heissonly

Sorry because of some bugs in v1.99.0-v1.99.2, currently it's impossible to map a sequence of 2 key names in Insert mode.

I'll fix it, and in v1.99.3 such a mapping should work:

mapKey <c-g:i> <v-open>
mapKey <c-g:n> <v-open>

run <v-o2> autoOpen#selected&copied&keyword=$s mask
run <v-open>r o2 r
run <v-open>d o2 d
run <v-open>t o2 t

gdh1995 avatar Aug 19 '22 10:08 gdh1995

It gave me these 3 Errors below when I copied and tried to save your mapping.

Command "o2" doesn't exist!. Command "o2" doesn't exist!. Command "o2" doesn't exist!.

heissonly avatar Aug 19 '22 10:08 heissonly

Oh I forgot to update my clipboard.

gdh1995 avatar Aug 19 '22 10:08 gdh1995

updated.

gdh1995 avatar Aug 19 '22 10:08 gdh1995

It doesn't work unfortunately in insert mode.

heissonly avatar Aug 19 '22 10:08 heissonly

because of some bugs in v1.99.0-v1.99.2, currently it's impossible to map a sequence of 2 key names in Insert mode.

I'll fix it, and in v1.99.3 such a mapping should work:

gdh1995 avatar Aug 19 '22 10:08 gdh1995

Okay, Thanks for your amazing effort to maintain this beautiful extension. I appreciated if you let me know when you update.

heissonly avatar Aug 19 '22 10:08 heissonly

Hello, v1.99.3 has been available on Chrome Web Store and Firefox Add-Ons.

gdh1995 avatar Aug 22 '22 14:08 gdh1995

Thanks it is working!

When we are are continue to write sth in text box (insert mode), can we grap the last word and give the query of intended website when I trigger these map-key if nothing already selected ?

For example I want to be sure what is the article of selected word or the meaning of the word from a dictionary, when I trigger the duden query map-key. For this, I want to automatically select the last word that I wrote and bring me the this site so that I don't need necessarily to select with mouse last word and than trigger to map-key.

I add here a gif from another app that I am using. What the app doing is that when I rigger assigned key it automatically search in pop-up dictionary the last word I selected. Basically two job is done with one key.Last Word is selected and pup-up dictionary is opened.

heissonly avatar Aug 22 '22 15:08 heissonly

Vimium C won't show a popup of search result, because this feature is far away from what Vimium C focuses on. And the need of searching in a dictionary should have been satisfied by those professional dictionary extension.

If you still want, I can find a way to "select the last word" and then open it under a given search engine in a new tab.

gdh1995 avatar Aug 23 '22 02:08 gdh1995

If you still want, I can find a way to "select the last word" and then open it under a given search engine in a new tab.

This is what I am looking for. The other pub-up is just the example of "select the last word" feature. Thanks I'll be appreciated if you can implemented.

heissonly avatar Aug 23 '22 06:08 heissonly

This is what I am looking for. The other pub-up is just the example of "select the last word" feature.
Thanks I'll be appreciated it if you can implemented.

Have you implemented it?

heissonly avatar Dec 16 '22 16:12 heissonly

Not now. It may arrive at Vimium C v2.01 in a few more months.

gdh1995 avatar Dec 18 '22 09:12 gdh1995