A Neovim plugin that displays LSP inlay hints at the end of lines instead of within them for better editing flow.
nvim-lsp-endhints is a Neovim plugin that repositions LSP inlay hints—such as type annotations and parameter names—to the end of lines instead of within the code. It solves the problem of inline hints disrupting vim motions and cluttering code, particularly for languages with verbose type systems. The plugin integrates seamlessly with Neovim's built-in LSP capabilities.
Neovim users who work with LSP-supported languages (e.g., TypeScript, Go, Lua, C++) and find inline inlay hints intrusive to their editing workflow. It's especially useful for developers who rely heavily on vim motions and prefer cleaner line-based displays.
Unlike other inlay hint plugins, nvim-lsp-endhints is extremely lightweight (~250 LOC) and focuses solely on repositioning hints without extra bloat. It offers a simple toggle between end-of-line and default inline hints, giving users flexibility while maintaining compatibility with Neovim's native LSP functions.
Display LSP inlay hints at the end of the line, rather than within the line.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Moves hints to line ends to prevent disruption to cursor navigation and editing flow, specifically addressing issues with long type hints in languages like TypeScript as noted in the background section.
Implements only ~250 lines of code by overriding Neovim's built-in handler, making it simpler than archived alternatives like nvim-inlayhints.
Provides enable, disable, and toggle functions to seamlessly switch between end-of-line and default inline hints, integrating with Neovim's native LSP commands.
Offers hintFormatFunc for tailoring hint display per filetype or LSP, with practical examples in the FAQ for specific use cases like rust_analyzer.
Lacks built-in support for displaying hints only on the current line, a limitation admitted in the FAQ that forces users to implement custom snippets.
Overrides Neovim's textDocument/inlayHint handler, which can incompatibility with other inlay hint plugins, requiring workarounds as warned in the compatibility FAQ.
Requires manual enablement of inlay hints for each LSP server (e.g., TypeScript, gopls), adding setup complexity beyond the plugin's own configuration.