A completion source for nvim-cmp that provides autocompletion for Danbooru tags. Inspired by ComfyUI-Custom-Scripts#Autocomplete.
{
"hrsh7th/nvim-cmp",
dependencies = {
-- ... other dependencies
{
"zknx/cmp-danbooru-tags",
config = true,
},
}
}Then, enable the source in your nvim-cmp setup and configure the options as needed.
require("cmp").setup({
sources = {
-- ... other sources
{
name = "danbooru-tags",
--- @type CmpDanbooruTags.Option
option = { -- These values are default so re-define them only if you wanna change it.
max_tags = -1, -- Max number of tags to read from the CSV file, it sorted by usage count (-1 for all).
max_results = 100, -- Max number of completion results to show at once, recommended lower number cz there are 170k+ tags.
}
},
},
})Run the following command in Neovim to download the tag CSV file.
:CmpDanbooruTags installYou can also provide a different URL: :CmpDanbooruTags install <url>
Note: This plugin is designed to parse the specific CSV format provided by the default URL. It relies on a tag,category,count,aliases structure. If the format of the source file changes in the future, or if you use a custom URL with a different structure, the plugin may not work correctly.
Completion is disabled by default. Use the following commands to enable it for the current buffer.
:CmpDanbooruTags enable: Enables completion.:CmpDanbooruTags disable: Disables completion.:CmpDanbooruTags toggle: Toggles the enable/disable state.
Once enabled, simply start typing in insert mode, and Danbooru tag suggestions will appear.
The tag data used by this plugin is sourced from the dbr-e621-lists-archive project by DraconicDragon.
The default download URL is:
https://raw.githubusercontent.com/DraconicDragon/dbr-e621-lists-archive/main/tag-lists/danbooru/danbooru_2025-07-05_pt20-ia-dd.csv
