soulis-1256/eagle.nvim

github github
lspneovim-0.5
stars 147
issues 0
subscribers 6
forks 2
CREATED

2023-10-24

UPDATED

8 days ago


eagle.nvim

To soar like an eagle is to rise above all the obstacles that come your way.

Following your mouse cursor, this plugin introduces a custom floating (popup) window that displays any Diagnostic (Error, Warning, Hint) with the help of the Diagnostic API of Neovim, along with LSP Information, from the LSP API.

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 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()).

showcase_eagle This was a C++ workspace, with clangd and clang-tidy configured. You can also shift+click the href links to open them in your browser.

Installation

Using Lazy:

{
    "soulis-1256/eagle.nvim"
},

[!IMPORTANT]
Until I test it and add it here, don't try setting additional Lazy properties (like main, config, opts) as an alternative way to setup the plugin.

Setup

require("eagle").setup({
-- override the default values found in config.lua
})

-- make sure mousemoveevent is enabled
vim.o.mousemoveevent = true

You can find the description of all the options in config.lua.

image

[!NOTE]
The plugin has been tested on Neovim versions 0.9.4 and 0.9.5.

Support

You can support me by donating through PayPal and by providing your feedback. You can message me on Discord.