{"id":13409972,"url":"https://github.com/lukas-reineke/cmp-under-comparator","last_synced_at":"2025-04-14T15:40:44.210Z","repository":{"id":43379997,"uuid":"420149105","full_name":"lukas-reineke/cmp-under-comparator","owner":"lukas-reineke","description":"nvim-cmp comparator function for completion items that start with one or more underlines","archived":false,"fork":false,"pushed_at":"2022-03-04T08:38:10.000Z","size":5,"stargazers_count":192,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T04:34:52.125Z","etag":null,"topics":["neovim","neovim-plugin","nvim-cmp","vim","vim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukas-reineke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["lukas-reineke"]}},"created_at":"2021-10-22T15:25:53.000Z","updated_at":"2025-02-28T23:12:30.000Z","dependencies_parsed_at":"2022-08-12T10:41:20.063Z","dependency_job_id":null,"html_url":"https://github.com/lukas-reineke/cmp-under-comparator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukas-reineke%2Fcmp-under-comparator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukas-reineke%2Fcmp-under-comparator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukas-reineke%2Fcmp-under-comparator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukas-reineke%2Fcmp-under-comparator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukas-reineke","download_url":"https://codeload.github.com/lukas-reineke/cmp-under-comparator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248907836,"owners_count":21181409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim","neovim-plugin","nvim-cmp","vim","vim-plugin"],"created_at":"2024-07-30T20:01:04.294Z","updated_at":"2025-04-14T15:40:44.174Z","avatar_url":"https://github.com/lukas-reineke.png","language":"Lua","funding_links":["https://github.com/sponsors/lukas-reineke"],"categories":["Completion","Lua"],"sub_categories":["(requires Neovim 0.5)","Diagnostics"],"readme":"# cmp-under-comparator\n\nA tiny function for [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) to better\nsort completion items that start with one or more underlines.\n\nIn most languages, especially Python, items that start with one or more\nunderlines should be at the end of the completion suggestion.\n\n|                                                   Before                                                   |                                                   After                                                    |\n| :--------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------: |\n| ![](https://user-images.githubusercontent.com/12900252/138484425-93c14853-d45f-42e2-a5b8-8deaaa748330.png) | ![](https://user-images.githubusercontent.com/12900252/138484481-212b2478-c427-48b4-bc9f-0c0098be04b9.png) |\n\n## Install\n\nUse your favourite plugin manager to install.\n\n#### Example with Packer\n\n[wbthomason/packer.nvim](https://github.com/wbthomason/packer.nvim)\n\n```lua\n-- init.lua\nrequire(\"packer\").startup(\n    function()\n        use \"lukas-reineke/cmp-under-comparator\"\n    end\n)\n```\n\n#### Example with Plug\n\n[junegunn/vim-plug](https://github.com/junegunn/vim-plug)\n\n```vim\n\" init.vim\ncall plug#begin('~/.vim/plugged')\nPlug 'lukas-reineke/cmp-under-comparator'\ncall plug#end()\n```\n\n## Setup\n\nAdd the `under` function to the list of comparators in the cmp setup function.\n\n```lua\nlocal cmp = require \"cmp\"\ncmp.setup {\n    -- ... rest of your setup ...\n\n    sorting = {\n        comparators = {\n            cmp.config.compare.offset,\n            cmp.config.compare.exact,\n            cmp.config.compare.score,\n            require \"cmp-under-comparator\".under,\n            cmp.config.compare.kind,\n            cmp.config.compare.sort_text,\n            cmp.config.compare.length,\n            cmp.config.compare.order,\n        },\n    },\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukas-reineke%2Fcmp-under-comparator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukas-reineke%2Fcmp-under-comparator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukas-reineke%2Fcmp-under-comparator/lists"}