https://github.com/soulis-1256/hoverhints.nvim
Show diagnostics and lsp info inside a custom window, following the mouse position
https://github.com/soulis-1256/hoverhints.nvim
lua neovim neovim-plugin
Last synced: 8 months ago
JSON representation
Show diagnostics and lsp info inside a custom window, following the mouse position
- Host: GitHub
- URL: https://github.com/soulis-1256/hoverhints.nvim
- Owner: soulis-1256
- License: apache-2.0
- Created: 2023-10-24T14:03:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-17T13:50:40.000Z (about 1 year ago)
- Last Synced: 2024-05-23T00:13:50.979Z (about 1 year ago)
- Topics: lua, neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 145 KB
- Stars: 187
- Watchers: 6
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# eagle.nvim
***To soar like an eagle is to rise above all obstacles.***
Following either your mouse or your cursor, this plugin provides a custom floating (popup) window that displays any diagnostic (Error, Warning, Hint) returned by the [Diagnostic API](https://neovim.io/doc/user/diagnostic.html), along with lsp information returned by the [LSP API](https://neovim.io/doc/user/lsp.html).
### Overview
Enhance your Neovim experience by utilizing the following features:
- Detect when the mouse hovers over an underlined part of code. Once it goes idle (for a [configurable](./lua/eagle/config.lua) amount of time), the window will be invoked. I tried to mirror the way conventional GUI Editors like VS Code work.
- Display the Diagnostics under the current mouse position. If there are multiple diagnostics on the same position (ie Error and Warning), display them all in a numbered list. For better user experience, the window is re-rendered only once the mouse encounters a "special" character (like "{}.?:" and more). This means that it stays open if it detects mouse movement and you are still hovering over the same variable/function/operator name.
- Show LSP information (the same contents as with vim.lsp.buf.hover()).
- **Recently added opt-in support for keyboard control, which can work together with mouse control.**
As you can see, the plugin's window is displaying all the information related to each position.### Installation
With [Lazy](https://github.com/folke/lazy.nvim):
```lua
{
"soulis-1256/eagle.nvim",
opts = {
--override the default values found in config.lua
}
},
```Alternative setup (without Lazy's `opts` property), in case you encounter any issues:
```lua
{ "soulis-1256/eagle.nvim" },
``````lua
require("eagle").setup({
--override the default values found in config.lua
})
```You can find the description of all the options in [config.lua](./lua/eagle/config.lua). Here is a concise list:
```lua
order = 1,
improved_markdown = true,
mouse_mode = true,
keyboard_mode = false,
logging = false,
close_on_cmd = true,
show_lsp_info = true,
scrollbar_offset = 0,
max_width_factor = 2,
max_height_factor = 2.5,
render_delay = 500,
detect_idle_timer = 50,
window_row = 1,
window_col = 5,
border = "single",
title = "",
title_pos = "center",
title_color = "#8AAAE5",
border_color = "#8AAAE5",
```> [!IMPORTANT]\
> By default, `keyboard_mode` is disabled and `mouse_mode` is enabled, but they can both be enabled at the same time.If you keep `mouse_mode` enabled, make sure `vim.o.mousemoveevent` is also enabled:
```lua
vim.o.mousemoveevent = true
```
If you enable `keyboard_mode`, make sure you set a **custom keymap** to be able to use the plugin using the keyboard:
```lua
vim.keymap.set('n', '', ':EagleWin', { noremap = true, silent = true })
```> [!NOTE]\
> The plugin is confirmed to work on build version `0.10.2` (`api level 12`)### Support
You can support me by donating through [PayPal](https://www.paypal.com/paypalme/soulis1256) and by providing your feedback. You can message me on [Discord](https://discord.com/users/319490489411829761).