{"id":13761279,"url":"https://github.com/nvim-lua/completion-nvim","last_synced_at":"2025-05-10T12:31:32.624Z","repository":{"id":40598270,"uuid":"246327787","full_name":"nvim-lua/completion-nvim","owner":"nvim-lua","description":"A async completion framework aims to provide completion to neovim's built in LSP written in Lua","archived":true,"fork":false,"pushed_at":"2021-10-12T19:59:47.000Z","size":409,"stargazers_count":979,"open_issues_count":81,"forks_count":79,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-08-03T13:06:22.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvim-lua.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}},"created_at":"2020-03-10T14:46:45.000Z","updated_at":"2024-07-08T23:43:10.000Z","dependencies_parsed_at":"2022-07-13T16:44:36.964Z","dependency_job_id":null,"html_url":"https://github.com/nvim-lua/completion-nvim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-lua%2Fcompletion-nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-lua%2Fcompletion-nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-lua%2Fcompletion-nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-lua%2Fcompletion-nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-lua","download_url":"https://codeload.github.com/nvim-lua/completion-nvim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224958125,"owners_count":17398495,"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":[],"created_at":"2024-08-03T13:01:47.046Z","updated_at":"2024-11-16T18:32:31.212Z","avatar_url":"https://github.com/nvim-lua.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"## WARNING: completion.nvim is no longer maintained\n\nIf you are looking for an autocompletion plugin, the neovim LSP team recommends either [nvim-cmp](https://github.com/hrsh7th/nvim-cmp/) or [coq_nvim](https://github.com/ms-jpq/coq_nvim).\n\n[![Build Status](https://travis-ci.com/haorenW1025/completion-nvim.svg?branch=master)](https://travis-ci.com/haorenW1025/completion-nvim)\n[![Gitter](https://badges.gitter.im/completion-nvim/community.svg)](https://gitter.im/completion-nvim/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n# completion-nvim\n\ncompletion-nvim is an auto completion framework that aims to provide a better\ncompletion experience with neovim's built-in LSP.  Other LSP functionality is not\nsupported.\n\n## Features\n\n- Asynchronous completion using the `libuv` api.\n- Automatically open hover windows when popupmenu is available.\n- Automatically open signature help if it's available.\n- Snippets integration with UltiSnips, Neosnippet, vim-vsnip, and snippets.nvim.\n- Apply *additionalTextEdits* in LSP spec if it's available.\n- Chain completion support inspired by [vim-mucomplete](https://github.com/lifepillar/vim-mucomplete)\n\n## Demo\n\nDemo using `sumneko_lua`\n![](https://user-images.githubusercontent.com/35623968/76489411-3ca1d480-6463-11ea-8c3a-7f0e3c521cdb.gif)\n\n## Prerequisites\n- Neovim nightly\n- You should set up your language server of choice with the help of [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)\n\n## Install\n\n- Install with any plugin manager by using the path on GitHub.\n\n```vim\nPlug 'nvim-lua/completion-nvim'\n```\n\n## Setup\n\n- completion-nvim requires several autocommands set up to work properly. You should\n  set it up using the `on_attach` function like this.\n\n```vim\nlua require'lspconfig'.pyls.setup{on_attach=require'completion'.on_attach}\n```\n- Change `pyls` to whichever language server you're using.\n- If you want completion-nvim to be set up for all buffers instead of only being\n  used when lsp is enabled, call the `on_attach` function directly:\n\n```vim\n\" Use completion-nvim in every buffer\nautocmd BufEnter * lua require'completion'.on_attach()\n```\n\n*NOTE* It's okay to set up completion-nvim without lsp. It will simply use\nanother completion source instead(Ex: snippets).\n\n## Supported Completion Source\n\n- built-in sources\n\n    * lsp: completion source for neovim's built-in LSP.\n    * snippet: completion source for snippet.\n    * path: completion source for path from current file.\n\n- ins-complete sources\n\n    * See `:h ins-completion` and [wiki](https://github.com/haorenW1025/completion-nvim/wiki/chain-complete-support)\n\n- external sources\n\n    * [completion-buffers](https://github.com/steelsojka/completion-buffers): completion for\n    buffers word.\n    * [completion-treesitter](https://github.com/nvim-treesitter/completion-treesitter): treesitter\n    based completion sources.\n    * [vim-dadbod-completion](https://github.com/kristijanhusak/vim-dadbod-completion): completion sources\n    for `vim-dadbod`.\n    * [completion-tabnine](https://github.com/aca/completion-tabnine): AI code completion tool TabNine integration.\n    * [completion-tags](https://github.com/kristijanhusak/completion-tags): Slightly improved ctags completion\n    * [completion-tmux](https://github.com/albertoCaroM/completion-tmux): tmux panels completion\n    * [completion-vcard](https://github.com/cbarrete/completion-vcard): email completion from vCards\n\n## Configuration\n\n### Recommended Setting\n\n```vim\n\" Use \u003cTab\u003e and \u003cS-Tab\u003e to navigate through popup menu\ninoremap \u003cexpr\u003e \u003cTab\u003e   pumvisible() ? \"\\\u003cC-n\u003e\" : \"\\\u003cTab\u003e\"\ninoremap \u003cexpr\u003e \u003cS-Tab\u003e pumvisible() ? \"\\\u003cC-p\u003e\" : \"\\\u003cS-Tab\u003e\"\n\n\" Set completeopt to have a better completion experience\nset completeopt=menuone,noinsert,noselect\n\n\" Avoid showing message extra message when using completion\nset shortmess+=c\n```\n\n### Enable/Disable auto popup\n\n- By default auto popup is enabled, turn it off by\n\n```vim\nlet g:completion_enable_auto_popup = 0\n```\n- Or you can toggle auto popup on the fly by using command `CompletionToggle`\n- You can manually trigger completion with mapping key by\n\n```vim\n\"map \u003cc-p\u003e to manually trigger completion\nimap \u003csilent\u003e \u003cc-p\u003e \u003cPlug\u003e(completion_trigger)\n```\n\n- Or you want to use `\u003cTab\u003e` as trigger keys\n\n```vim\nimap \u003ctab\u003e \u003cPlug\u003e(completion_smart_tab)\nimap \u003cs-tab\u003e \u003cPlug\u003e(completion_smart_s_tab)\n```\n\n### Enable Snippets Support\n\n- By default other snippets source support are disabled, turn them on by\n\n```vim\n\" possible value: 'UltiSnips', 'Neosnippet', 'vim-vsnip', 'snippets.nvim'\nlet g:completion_enable_snippet = 'UltiSnips'\n```\n- Supports `UltiSnips`, `Neosnippet`, `vim-vsnip` and `snippets.nvim`\n\n### LSP Based Snippet parsing\n\n- Some language server have snippet support but neovim couldn't handle that for now, `completion-nvim` can integrate\nwith other LSP snippet parsing plugin for this support.\n\nRight now, [vim-vsnip](https://github.com/hrsh7th/vim-vsnip) (requiring [vim-vsnip-integ](https://github.com/hrsh7th/vim-vsnip-integ)) and [snippets.nvim](https://github.com/norcalli/snippets.nvim) are supported.\n\n### Chain Completion Support\n\n- completion-nvim supports chain completion, which use other completion sources\n  and `ins-completion` as a fallback for lsp completion.\n\n- See [wiki](https://github.com/haorenW1025/completion-nvim/wiki/chain-complete-support) for\n  details on how to set this up.\n\n### Changing Completion Confirm key\n\n- By default `\u003cCR\u003e` is used to confirm completion and expand snippets, change it by\n\n```vim\nlet g:completion_confirm_key = \"\\\u003cC-y\u003e\"\n```\n\n- Make sure to use `\" \"` and add escape key `\\` to avoid parsing issues.\n- If the confirm key has a fallback mapping, for example when using the auto\n  pairs plugin, it maps to `\u003cCR\u003e`. You can avoid using the default confirm key option and\n  use a mapping like this instead.\n\n```.vim\nlet g:completion_confirm_key = \"\"\nimap \u003cexpr\u003e \u003ccr\u003e  pumvisible() ? complete_info()[\"selected\"] != \"-1\" ?\n                 \\ \"\\\u003cPlug\u003e(completion_confirm_completion)\"  : \"\\\u003cc-e\u003e\\\u003cCR\u003e\" :  \"\\\u003cCR\u003e\"\n```\n\n### Enable/Disable auto hover\n\n- By default when navigating through completion items, LSP's hover is automatically\n  called and displays in a floating window. Disable it by\n\n```vim\nlet g:completion_enable_auto_hover = 0\n```\n\n### Enable/Disable auto signature\n\n- By default signature help opens automatically whenever it's available. Disable\n  it by\n\n```vim\nlet g:completion_enable_auto_signature = 0\n```\n\n### Sorting completion items\n\n- You can decide how your items being sorted in the popup menu. The default value\nis `\"alphabet\"`, change it by\n```vim\n\" possible value: \"length\", \"alphabet\", \"none\"\nlet g:completion_sorting = \"length\"\n```\n\n- If you don't want any sorting, you can set this value to `\"none\"`.\n\n### Matching Strategy\n\n- There are three different kind of matching technique implement in\ncompletion-nvim: `substring`, `fuzzy`, `exact` or `all`.\n\n- You can specify a list of matching strategy, completion-nvim will loop through the list and\nassign priority from high to low. For example\n\n```vim\nlet g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy', 'all']\n```\n\n*NOTE* Fuzzy match highly dependent on what language server you're using. It might not\nwork as you expect on some language server.\n\n- You can also enable ignore case matching by\n```vim\ng:completion_matching_ignore_case = 1\n```\n- Or smart case matching by\n```vim\ng:completion_matching_smart_case = 1\n```\n\n### Trigger Characters\n\n- By default, `completion-nvim` respect the trigger character of your language server, if you\nwant more trigger characters, add it by\n\n\n```vim\nlet g:completion_trigger_character = ['.', '::']\n```\n\n*NOTE* use `:lua print(vim.inspect(vim.lsp.buf_get_clients()[1].server_capabilities.completionProvider.triggerCharacters))`\nto see the trigger character of your language server.\n\n- If you want different trigger character for different languages, wrap it in an autocommand like\n\n```vim\naugroup CompletionTriggerCharacter\n    autocmd!\n    autocmd BufEnter * let g:completion_trigger_character = ['.']\n    autocmd BufEnter *.c,*.cpp let g:completion_trigger_character = ['.', '::']\naugroup end\n```\n\n### Trigger keyword length\n\n- You can specify keyword length for triggering completion, if the current word is less then keyword length, completion won't be\ntriggered.\n\n```vim\nlet g:completion_trigger_keyword_length = 3 \" default = 1\n```\n\n**NOTE** `completion-nvim` will ignore keyword length if you're on trigger character.\n\n### Trigger on delete\n\n- `completion-nvim` doesn't trigger completion on delete by default because sometimes I've found it annoying. However,\nyou can enable it by\n\n```vim\nlet g:completion_trigger_on_delete = 1\n```\n\n### Timer Adjustment\n\n- completion-nvim uses a timer to control the rate of completion. You can adjust the timer rate by\n\n```vim\nlet g:completion_timer_cycle = 200 \"default value is 80\n```\n\n### Per Server Setup\n\n- You can have different setup for each server in completion-nvim using lua, see [wiki]\n(https://github.com/nvim-lua/completion-nvim/wiki/per-server-setup-by-lua) for more guide.\n\n## Trouble Shooting\n\n- This plugin is in the early stages and might have unexpected issues.\n  Please follow [wiki](https://github.com/haorenW1025/completion-nvim/wiki/trouble-shooting)\n  for trouble shooting.\n- Feel free to post issues on any unexpected behavior or open a feature request!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-lua%2Fcompletion-nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-lua%2Fcompletion-nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-lua%2Fcompletion-nvim/lists"}