A Neovim plugin that provides a floating window for diagnostics and LSP information.
Smart Mouse Tracking — Detects when the mouse hovers over underlined code. Once idle (configurable delay), a floating window appears, mirroring the behavior of conventional GUI editors like VS Code.
Comprehensive Diagnostics — Displays all diagnostics (Errors, Warnings, Hints) under the current position. Multiple diagnostics at the same location are shown in a numbered list.
LSP Integration — Shows LSP hover information (same content as vim.lsp.buf.hover()).
Intelligent Re-rendering — The window only re-renders when the mouse encounters a "special" character (like {}.?:), staying open while hovering over the same variable/function/operator name.
Keyboard Mode — Opt-in keyboard control that can work alongside or independently of mouse control (eg. using the <Tab> key).
Highly Customizable — Extensive configuration options for appearance, timing, and behavior.
| Feature | Built-in vim.diagnostic.open_float() |
Built-in vim.lsp.buf.hover() |
eagle.nvim |
|---|---|---|---|
| Mouse tracking | ❌ | ❌ | ✅ |
| Combined diagnostics + LSP | ❌ | ❌ | ✅ |
| Smart rendering | ❌ | ❌ | ✅ |
| Keyboard + Mouse cooperation | ❌ | ❌ | ✅ |
>= 0.10.2 (API level 12)lazy.nvim is a modern plugin manager for Neovim.
Basic setup:
{
"soulis-1256/eagle.nvim",
opts = {},
config = function(_, opts)
require("eagle").setup(opts)
vim.o.mousemoveevent = true -- Required for mouse mode
end,
},
With keyboard mode enabled:
{
"soulis-1256/eagle.nvim",
opts = {
keyboard_mode = true,
},
config = function(_, opts)
require("eagle").setup(opts)
vim.o.mousemoveevent = true
vim.keymap.set('n', '<Tab>', ':EagleWin<CR>', { noremap = true, silent = true })
end,
},
Alternative setup (if you encounter issues with opts):
{ "soulis-1256/eagle.nvim" },
Then in your config:
require("eagle").setup({
-- your options here
})
vim.o.mousemoveevent = true
LazyVim is a Neovim setup powered by lazy.nvim.
Create a file under lua/plugins/eagle.lua:
return {
{
"soulis-1256/eagle.nvim",
config = function()
require("eagle").setup({
keyboard_mode = true,
})
vim.o.mousemoveevent = true
vim.keymap.set('n', '<Tab>', ':EagleWin<CR>', { noremap = true, silent = true })
end,
},
}
All options can be passed to the setup() function. See config.lua for extensive documentation.
require("eagle").setup({
-- Behavior
mouse_mode = true, -- Enable mouse hover detection
keyboard_mode = false, -- Enable keyboard-triggered window
close_on_cmd = true, -- Close window when entering command mode
show_lsp_info = true, -- Show LSP hover information
logging = false, -- Enable debug logging
-- Content
show_headers = true, -- Show section headers in the window
order = 1, -- Order of content (1: diagnostics first, 2: LSP first)
improved_markdown = true, -- Enhanced markdown rendering
-- Timing
render_delay = 500, -- Delay (ms) before rendering the window
detect_idle_timer = 50, -- Interval (ms) for idle detection
-- Window Positioning
window_row = 1, -- Vertical offset from cursor
window_col = 5, -- Horizontal offset from cursor
scrollbar_offset = 0, -- Offset for scrollbar
-- Window Size
max_width_factor = 2, -- Max width as factor of window width
max_height_factor = 2.5, -- Max height as factor of window height
-- Window Appearance
border = "single", -- Border style: "single", "double", "rounded", "solid", "shadow", "none"
title = "", -- Window title
title_pos = "center", -- Title position: "left", "center", "right"
-- Colors (leave empty to use defaults)
title_color = "#8AAAE5", -- Title text color
border_color = "#8AAAE5", -- Border color
diagnostic_header_color = "", -- Diagnostic header color
lsp_info_header_color = "", -- LSP info header color
diagnostic_content_color = "", -- Diagnostic content color
lsp_info_content_color = "", -- LSP info content color
})
<Tab> is your custom keybind)<Tab> and the floating window will appear at your cursor position<h>,<j>,<k>,<l>), or press <Tab> again to enter it<Tab> one last time to close it (once inside)| Command | Description |
|---|---|
:EagleWin |
Toggle the eagle window at the current cursor position |
Make sure mousemoveevent is enabled:
vim.o.mousemoveevent = true
This must be set for mouse tracking to work.
keyboard_mode = true in your setup:EagleWin:vim.keymap.set('n', '<Tab>', ':EagleWin<CR>', { noremap = true, silent = true })
show_lsp_info = true (default):LspInfo:lua vim.lsp.buf.hover()If you're using other plugins that provide hover functionality (like noice.nvim or custom LSP handlers), you may need to disable their hover features or configure them to not conflict with eagle.nvim.
To diagnose issues, enable logging:
require("eagle").setup({
logging = true,
})
Contributions are welcome! Here's how you can help:
If you find this plugin useful, consider supporting its development: