A Neovim nvim-cmp comparator that sorts completion items starting with underscores to the end of suggestions.
cmp-under-comparator is a Lua plugin for Neovim's nvim-cmp autocompletion engine. It modifies the sorting of completion suggestions to push items that start with underscores (like `_private` or `__magic__`) to the bottom of the list. This solves the problem of internal or 'private' language constructs cluttering the top of completion menus during coding.
Neovim users who utilize nvim-cmp for code completion, particularly developers working in Python or other languages where underscore-prefixed identifiers are common.
It offers a simple, configurable solution to a specific UX pain point in code completion, making suggestions more relevant by deprioritizing typically less-used underscored items without modifying core editor behavior.
nvim-cmp comparator function for completion items that start with one or more underlines
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The function is tiny and focused, with a single responsibility, reducing bloat and making it easy to maintain, as highlighted in the README's philosophy.
Directly addresses the UX pain point of underscore items cluttering completion lists, with visual before-and-after proof in the README showing improved ordering for Python and similar languages.
Works as a drop-in comparator in nvim-cmp's sorting setup, as demonstrated by the clear code snippet in the README that adds it to the comparators list without complex changes.
While optimized for Python, it benefits any language with underscore conventions, making it versatile without additional configuration, as noted in the key features.
The function has fixed behavior; users cannot adjust sensitivity, exclude specific underscore patterns, or customize sorting beyond the default, limiting flexibility for edge cases.
Only handles underscore sorting, so for comprehensive completion ordering, users must manually integrate additional comparators in nvim-cmp, increasing setup complexity.
Tightly coupled with nvim-cmp; it's useless without that plugin, and compatibility issues may arise if nvim-cmp's API changes, requiring updates or causing breaks.