Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you know if it’s possible in vim to show hover for an arbitrary selection? A visual selection?


Like many things in vim it depends on whether you wish to write it ;)

You can define your own popup(:h bexpr) however you feel, including per-filetype or buffer. Instead of simply operating on the variables it defines to you can also work upon the selection by querying the register(:h quotestar) instead.

As an example, I like displaying wordnet¹ popups when writing prose. Occasionally, I'll also dump diction² output in to a popup too.

However, I do think that using messages(:h :messages) might make more sense for selection info in general. That way you can select a text, call a map to display information, and still easily recall that data when you're in another place via :messages at a later time. Depends entirely on your use case, and once again how interested in writing the functionality you are.

¹ http://wordnet.princeton.edu/

² http://www.gnu.org/software/diction/diction.html


Thank you! Will add this to my Vim to-do.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: