Is there a way to enable kak-lsp auto-hover only for errors and warnings?

Whenever i rest the cursor on a string, for example, this huge text appears covering a big portion of the screen explaining everything.

For now i’m using ,h to call lsp-hover, but is there a way to configure auto-hover to show only errors and warnings?

Or maybe reduce the size of the popup with an option to expand it if necessary?

1 Like

I have a very little experience with kak-lsp, but what I can suggest you for the time being is to look at the lsp.kak file and search for the group name using lsp-hover and remove that hook from your kakrc.

The best is to open an issue for the kak-lsp developers explaining your problem.

set-option global lsp_show_hover_format 'printf %s "${lsp_diagnostics}"'

Thanks! That worked.

That’s awesome! I had the same issue and did the same mapping of ,h but this solution looks great.
Do you have any idea how one could still have the full hover info when using ,h ?
I guess setting the option to it’s original value, calling lsp-hover and resetting it would be a possibility but I wonder if there is a better way


I’m not sure what is the best solution but maybe the following would be useful to find it: you can override lsp-show-hover (kak-lsp/lsp.kak at master · kak-lsp/kak-lsp · GitHub) in your config to fully customise its behaviour. Or bake in more logic into lsp_show_hover_format which is just shell code called from Kakoune, so $kak_ variables are available there if you need branching logic.

1 Like