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

Tooltip support #26

Open
yshui opened this issue Jan 17, 2018 · 2 comments
Open

Tooltip support #26

yshui opened this issue Jan 17, 2018 · 2 comments

Comments

@yshui
Copy link

yshui commented Jan 17, 2018

Add tooltip support to display information while hovering over some text.

@jeanguyomarch
Copy link
Owner

Mhh... let me try to rephrase, to see if I understood you correctly. Let say that you have a vim plugin that scans the current buffer for information. For example: finding an URL below the cursor. When the plugin does detect the URL, it wants the GUI client (Eovim) to trigger a widget at a given position (e.g. line+column) to make it contain additional information or controls (e.g. the widget could contain a button "Open"). Something like what is show there: https://fau.re/blog/20141019_terminology_gravatar.html.

That would indeed be a nice feature to have. Actually, you can already make it, but is would require some work, as you would need to implement an Eovim plugin.

If we take my previous example, upon detecting an URL under the cursor, the neovim plugin would run something like:

:call Eovim("tooltip", {'column': xx, 'line': yy, 'data': '...'})

Here data is a bit too generic, but I believe we can pass instead different keys:

  • text, taking a string with markup, to have rich text display,
  • run_command, which would generate a button with some explicative text (e.g. "Open URL") which upon being pressed would execute a command (e.g. xdg-open <url>).
  • ...

Please tell me this is somewhat what you had in mind, and I'll try to add a new Eovim plugin that implements a tooltip functionality.

@yshui
Copy link
Author

yshui commented Jan 17, 2018

Yep, that's basically it.

I actually have an implementation of this for vanilla neovim: yshui/tooltip.nvim

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

2 participants