christoomey / vim-quicklink

A Vim plugin for quickly looking up a topic in google and inserting the relevant link
MIT License
55 stars 4 forks source link

visual <c-k> is broken #16

Open sim590 opened 8 years ago

sim590 commented 8 years ago

When in markdown file and in visual mode pressing <c-k>, the following error message is printed:

Error detected while processing function Convert
VisualSelectionToLink[3]..<SNR>144_SearchForTerm:
line   12:
E121: Undefined variable: results
E15: Invalid expression: content.responseData.results
line   13:
E121: Undefined variable: results
E116: Invalid arguments for function <SNR>144_DisplaySearchResult

The plugin is basicly unsusable. @christoomey, do you experience this?

christoomey commented 8 years ago

I have experienced this. I believe the issue is that the underlying google API has finally closed up shop. We'll need to find an alternative, but for now I believe we are broken. :(

idvorkin commented 7 years ago

Sigh. It's probably worth writing this on the project readme :(

Also, we could add an variable to call google CSE with our own API keys.

christoomey commented 7 years ago

I would love to extend this to support a CSE! I wasn't aware of this, but it does look like it is possible to create a generic CSE that searches the whole web. @idvorkin do you know is needed on to configure a CSE, as well as what we'd need to change in this plugin?

idvorkin commented 7 years ago

Using a CSE is just like calling the old API. You make a rest call, that includes the API key. The 'gotchya' in this solution is you need to provide your CSE key in the API, and should not share the key with others, so they key would need to be a passed into the script in some way.

You can create a CSE from the google API console

geoffharcourt commented 7 years ago

Maybe we could have users put the key in an env variable?

Migacz85 commented 5 years ago

I just installed this plugin and found that thread. Really is no possible to fix that ? It's look that is super usefull feature to have.

sim590 commented 5 years ago

I personally don't have time to put on this just right now. I really used to like this plugin though.

@Migacz85 As pointed out by comments above, the API changed in favour of CSE and an API key is now needed. The change is obviously feasible. I would recommend setting the API key through a Vim variable and let users use their preferred password manager (like passwordstore) to recover it securely in their config.

Quite honestly, I did forget about this plugin, but I remember I quite liked it. I'd like a fix too. May be I'll do something about it soon, but I can't say for sure.

hoijui commented 4 years ago

please mention this in the README