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

**URL:** <https://discuss.kakoune.com/t/is-there-a-way-to-enable-kak-lsp-auto-hover-only-for-errors-and-warnings/1360>\
**Category:** Help\
**Tags:** lsp\
**Created:** [November 12, 2020, 9:12am UTC](https://discuss.kakoune.com/t/is-there-a-way-to-enable-kak-lsp-auto-hover-only-for-errors-and-warnings/1360 "2020-11-12T09:12:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![crdpa](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/crdpa/32/634_2.png) [@crdpa](https://discuss.kakoune.com/u/crdpa)\
**Post date:** [November 12, 2020, 9:12am UTC](https://discuss.kakoune.com/t/is-there-a-way-to-enable-kak-lsp-auto-hover-only-for-errors-and-warnings/1360/1 "2020-11-12T09:12:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![alexherbo2](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/alexherbo2/32/1140_2.png) [@alexherbo2](https://discuss.kakoune.com/u/alexherbo2)\
**Post date:** [November 12, 2020, 8:36pm UTC](https://discuss.kakoune.com/t/is-there-a-way-to-enable-kak-lsp-auto-hover-only-for-errors-and-warnings/1360/2 "2020-11-12T20:36:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ulis](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ulis/32/620_2.png) [@ulis](https://discuss.kakoune.com/u/ulis)\
**Post date:** [November 12, 2020, 10:18pm UTC](https://discuss.kakoune.com/t/is-there-a-way-to-enable-kak-lsp-auto-hover-only-for-errors-and-warnings/1360/3 "2020-11-12T22:18:03Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![crdpa](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/crdpa/32/634_2.png) [@crdpa](https://discuss.kakoune.com/u/crdpa)\
**Post date:** [November 13, 2020, 12:02am UTC](https://discuss.kakoune.com/t/is-there-a-way-to-enable-kak-lsp-auto-hover-only-for-errors-and-warnings/1360/4 "2020-11-13T00:02:16Z")

</div>

Thanks! That worked.

---

<div class="post-metadata">

**Author:** ![Anton](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/anton/32/739_2.png) [@Anton](https://discuss.kakoune.com/u/Anton)\
**Post date:** [December 22, 2020, 12:09am UTC](https://discuss.kakoune.com/t/is-there-a-way-to-enable-kak-lsp-auto-hover-only-for-errors-and-warnings/1360/5 "2020-12-22T00:09:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ulis](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ulis/32/620_2.png) [@ulis](https://discuss.kakoune.com/u/ulis)\
**Post date:** [January 6, 2021, 7:59pm UTC](https://discuss.kakoune.com/t/is-there-a-way-to-enable-kak-lsp-auto-hover-only-for-errors-and-warnings/1360/6 "2021-01-06T19:59:54Z")

</div>

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](https://github.com/kak-lsp/kak-lsp/blob/master/rc/lsp.kak#L938)) 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.
