Pretty_hover is a light weight plugin that parses the hover message before opening the popup window. The output can be easily manipulated with. This will result in more readable hover message.
Using native vim.lsp.buf.hover()
{
"Fildo7525/pretty_hover",
config = function()
require("pretty_hover").setup(options)
end
},
use {
"Fildo7525/pretty_hover",
config = function()
require("pretty_hover").setup(options)
end
}
The configuration consists of four parts. line
is a table containing all the words after which will the whole line surrounded by stylers.line
character.
The word
will surround only one word after the elements with stylers.word
character. The last table consists of flags that behave as an heading.
The stylers.header
will replace the elements in header
. border
is than passed to the nvim api and represents the type of the floating window.
NOTE: To really use this plugin you have to create a keymap that will call
require('pretty_hover').hover()
function.
{
line = {
"@brief",
},
word = {
"@param",
"@tparam",
"@see",
},
header = {
"@class",
},
stylers = {
line = "**",
word = "`",
header = "###",
},
border = "rounded",
}