Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gaetanlepage/cmp-nixpkgs-maintainers
nvim-cmp source for nixpkgs maintainers GitHub handles
https://github.com/gaetanlepage/cmp-nixpkgs-maintainers
neovim nix nixpkgs
Last synced: 12 days ago
JSON representation
nvim-cmp source for nixpkgs maintainers GitHub handles
- Host: GitHub
- URL: https://github.com/gaetanlepage/cmp-nixpkgs-maintainers
- Owner: GaetanLepage
- License: mit
- Created: 2024-07-27T21:03:20.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-10-15T21:48:30.000Z (about 1 month ago)
- Last Synced: 2024-10-17T07:54:42.253Z (about 1 month ago)
- Topics: neovim, nix, nixpkgs
- Language: Lua
- Homepage:
- Size: 116 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cmp-nixpkgs-maintainers
This neovim plugin provides a [cmp](https://github.com/hrsh7th/nvim-cmp) source for completing
[nixpkgs](https://github.com/NixOS/nixpkgs/)
[maintainers](https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix)
when editing PR messages.You can use the [GitHub CLI tool](https://cli.github.com/) to create your PR to nixpkgs from the
command line.
It lets you edit the PR description from your editor.
In there, you can now get completion when tagging other nixpkgs maintainers by inserting `@`.You can either start typing the github handle or the nixpkgs maintainer alias of the person.
Each completion item is displayed `nixpkgs-handle (@GitHub-handle)`.![](screenshot.png)
This plugin will fetch the `lib.maintainers` attribute from the `nixpkgs` flake and store it locally.
## Setup
```lua
require'cmp'.setup {
sources = {
{
name = 'nixpkgs_maintainers',
option = {
-- Number of days after which the list of maintainers is refreshed
cache_lifetime = 14,
-- Do not print status messages
silent = false,
-- Customize the `nixpkgs` source flake for fetching the maintainers list
-- Example: "github:NixOS/nixpkgs/master"
nixpkgs_flake_uri = "nixpkgs",
},
}
}
}
```## Acknowlegments
- Greg Hurrell's [video](https://www.youtube.com/watch?v=gAsYolNrjtQ)
and [implementation](https://github.com/wincent/wincent/blob/2d926177773f/aspects/nvim/files/.config/nvim/lua/wincent/cmp/handles.lua)
of a very similar source