{"id":13409958,"url":"https://github.com/hrsh7th/nvim-cmp","last_synced_at":"2025-05-15T01:00:34.030Z","repository":{"id":37003757,"uuid":"381453955","full_name":"hrsh7th/nvim-cmp","owner":"hrsh7th","description":"A completion plugin for neovim coded in Lua.","archived":false,"fork":false,"pushed_at":"2025-04-01T08:39:43.000Z","size":917,"stargazers_count":8670,"open_issues_count":297,"forks_count":417,"subscribers_count":45,"default_branch":"main","last_synced_at":"2025-04-08T19:16:22.595Z","etag":null,"topics":["nvim-cmp"],"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/hrsh7th.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["hrsh7th"]}},"created_at":"2021-06-29T18:01:04.000Z","updated_at":"2025-04-08T18:12:02.000Z","dependencies_parsed_at":"2024-04-02T08:28:28.506Z","dependency_job_id":"93d29913-20f4-4766-bf3e-0bbaa68445b2","html_url":"https://github.com/hrsh7th/nvim-cmp","commit_stats":{"total_commits":778,"total_committers":172,"mean_commits":4.523255813953488,"dds":0.3290488431876607,"last_synced_commit":"98e8b9d593a5547c126a39212d6f5e954a2d85dd"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrsh7th%2Fnvim-cmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrsh7th%2Fnvim-cmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrsh7th%2Fnvim-cmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrsh7th%2Fnvim-cmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrsh7th","download_url":"https://codeload.github.com/hrsh7th/nvim-cmp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250296175,"owners_count":21407037,"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":["nvim-cmp"],"created_at":"2024-07-30T20:01:04.238Z","updated_at":"2025-04-22T18:10:22.659Z","avatar_url":"https://github.com/hrsh7th.png","language":"Lua","readme":"# nvim-cmp\n\nA completion engine plugin for neovim written in Lua.\nCompletion sources are installed from external repositories and \"sourced\".\n\nhttps://github.com/hrsh7th/nvim-cmp/assets/22756295/afa70011-9121-4e42-aedd-0153b630eeab\n\nReadme!\n====================\n\n1. There is a GitHub issue that documents [breaking changes](https://github.com/hrsh7th/nvim-cmp/issues/231) for nvim-cmp. Subscribe to the issue to be notified of upcoming breaking changes.\n2. This is my hobby project. You can support me via GitHub sponsors.\n3. Bug reports are welcome, but don't expect a fix unless you provide minimal configuration and steps to reproduce your issue.\n4. The `cmp.mapping.preset.*` is pre-defined configuration that aims to mimic neovim's native like behavior. It can be changed without announcement. Please manage key-mapping by yourself.\n\nConcept\n====================\n\n- Full support for LSP completion related capabilities\n- Powerful customizability via Lua functions\n- Smart handling of key mappings\n- No flicker\n\n\nSetup\n====================\n\n### Recommended Configuration\n\nThis example configuration uses `vim-plug` as the plugin manager and `vim-vsnip` as a snippet plugin.\n\n```vim\ncall plug#begin(s:plug_dir)\nPlug 'neovim/nvim-lspconfig'\nPlug 'hrsh7th/cmp-nvim-lsp'\nPlug 'hrsh7th/cmp-buffer'\nPlug 'hrsh7th/cmp-path'\nPlug 'hrsh7th/cmp-cmdline'\nPlug 'hrsh7th/nvim-cmp'\n\n\" For vsnip users.\nPlug 'hrsh7th/cmp-vsnip'\nPlug 'hrsh7th/vim-vsnip'\n\n\" For luasnip users.\n\" Plug 'L3MON4D3/LuaSnip'\n\" Plug 'saadparwaiz1/cmp_luasnip'\n\n\" For mini.snippets users.\n\" Plug 'echasnovski/mini.snippets'\n\" Plug 'abeldekat/cmp-mini-snippets'\n\n\" For ultisnips users.\n\" Plug 'SirVer/ultisnips'\n\" Plug 'quangnguyen30192/cmp-nvim-ultisnips'\n\n\" For snippy users.\n\" Plug 'dcampos/nvim-snippy'\n\" Plug 'dcampos/cmp-snippy'\n\ncall plug#end()\n\nlua \u003c\u003cEOF\n  -- Set up nvim-cmp.\n  local cmp = require'cmp'\n\n  cmp.setup({\n    snippet = {\n      -- REQUIRED - you must specify a snippet engine\n      expand = function(args)\n        vim.fn[\"vsnip#anonymous\"](args.body) -- For `vsnip` users.\n        -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.\n        -- require('snippy').expand_snippet(args.body) -- For `snippy` users.\n        -- vim.fn[\"UltiSnips#Anon\"](args.body) -- For `ultisnips` users.\n        -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)\n\n        -- For `mini.snippets` users:\n        -- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert\n        -- insert({ body = args.body }) -- Insert at cursor\n        -- cmp.resubscribe({ \"TextChangedI\", \"TextChangedP\" })\n        -- require(\"cmp.config\").set_onetime({ sources = {} })\n      end,\n    },\n    window = {\n      -- completion = cmp.config.window.bordered(),\n      -- documentation = cmp.config.window.bordered(),\n    },\n    mapping = cmp.mapping.preset.insert({\n      ['\u003cC-b\u003e'] = cmp.mapping.scroll_docs(-4),\n      ['\u003cC-f\u003e'] = cmp.mapping.scroll_docs(4),\n      ['\u003cC-Space\u003e'] = cmp.mapping.complete(),\n      ['\u003cC-e\u003e'] = cmp.mapping.abort(),\n      ['\u003cCR\u003e'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.\n    }),\n    sources = cmp.config.sources({\n      { name = 'nvim_lsp' },\n      { name = 'vsnip' }, -- For vsnip users.\n      -- { name = 'luasnip' }, -- For luasnip users.\n      -- { name = 'ultisnips' }, -- For ultisnips users.\n      -- { name = 'snippy' }, -- For snippy users.\n    }, {\n      { name = 'buffer' },\n    })\n  })\n\n  -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below\n  -- Set configuration for specific filetype.\n  --[[ cmp.setup.filetype('gitcommit', {\n    sources = cmp.config.sources({\n      { name = 'git' },\n    }, {\n      { name = 'buffer' },\n    })\n })\n require(\"cmp_git\").setup() ]]-- \n\n  -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).\n  cmp.setup.cmdline({ '/', '?' }, {\n    mapping = cmp.mapping.preset.cmdline(),\n    sources = {\n      { name = 'buffer' }\n    }\n  })\n\n  -- Use cmdline \u0026 path source for ':' (if you enabled `native_menu`, this won't work anymore).\n  cmp.setup.cmdline(':', {\n    mapping = cmp.mapping.preset.cmdline(),\n    sources = cmp.config.sources({\n      { name = 'path' }\n    }, {\n      { name = 'cmdline' }\n    }),\n    matching = { disallow_symbol_nonprefix_matching = false }\n  })\n\n  -- Set up lspconfig.\n  local capabilities = require('cmp_nvim_lsp').default_capabilities()\n  -- Replace \u003cYOUR_LSP_SERVER\u003e with each lsp server you've enabled.\n  require('lspconfig')['\u003cYOUR_LSP_SERVER\u003e'].setup {\n    capabilities = capabilities\n  }\nEOF\n```\n\n\n### Where can I find more completion sources?\n\nHave a look at the [Wiki](https://github.com/hrsh7th/nvim-cmp/wiki/List-of-sources) and the `nvim-cmp` [GitHub topic](https://github.com/topics/nvim-cmp).\n\n\n### Where can I find advanced configuration examples?\n\nSee the [Wiki](https://github.com/hrsh7th/nvim-cmp/wiki).\n","funding_links":["https://github.com/sponsors/hrsh7th"],"categories":["Lua","Completion","Plugins","LUA"],"sub_categories":["(requires Neovim 0.5)","Diagnostics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrsh7th%2Fnvim-cmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrsh7th%2Fnvim-cmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrsh7th%2Fnvim-cmp/lists"}