jeanguyomarch / eovim

The Enlightened Neovim
https://github.com/jeanguyomarch/eovim/wiki
MIT License
193 stars 3 forks source link

Tooltip support #26

Open yshui opened 6 years ago

yshui commented 6 years ago

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

jeanguyomarch commented 6 years ago

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:

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 commented 6 years ago

Yep, that's basically it.

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