{"id":13898179,"url":"https://github.com/girishji/vimcomplete","last_synced_at":"2025-10-24T22:37:00.093Z","repository":{"id":181587954,"uuid":"667003258","full_name":"girishji/vimcomplete","owner":"girishji","description":"Async autocompletion for Vim.","archived":false,"fork":false,"pushed_at":"2025-02-26T19:22:33.000Z","size":9296,"stargazers_count":164,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T09:08:27.485Z","etag":null,"topics":["autocomplete","autocomplete-suggestions","autocompletion","lsp","snippets","vim","vim-plugin","vim9-plugin","vim9script"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","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/girishji.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}},"created_at":"2023-07-16T10:13:58.000Z","updated_at":"2025-03-28T11:14:50.000Z","dependencies_parsed_at":"2023-11-20T09:29:38.647Z","dependency_job_id":"ca628353-0bac-47b5-b23c-f7ab29b80b02","html_url":"https://github.com/girishji/vimcomplete","commit_stats":null,"previous_names":["girishji/vimcomplete"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/girishji%2Fvimcomplete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/girishji%2Fvimcomplete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/girishji%2Fvimcomplete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/girishji%2Fvimcomplete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/girishji","download_url":"https://codeload.github.com/girishji/vimcomplete/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"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":["autocomplete","autocomplete-suggestions","autocompletion","lsp","snippets","vim","vim-plugin","vim9-plugin","vim9script"],"created_at":"2024-08-06T18:04:08.572Z","updated_at":"2025-10-24T22:37:00.087Z","avatar_url":"https://github.com/girishji.png","language":"Vim Script","funding_links":[],"categories":["Vim Script","Completion"],"sub_categories":[],"readme":"\n\u003ch2 align=\"center\"\u003e VimComplete \u003c/h2\u003e\n\n## ⚠️ Plugin Deprecated\n\n\u003e **This plugin is obsolete and will no longer be maintained.**\n\u003e I’ve implemented its core features, including autocompletion, in Vim.\n\u003e See `:h ins-autocompletion` and `:h ins-autocompletion-example` for details.\n\n---------\n\n\n\n\u003ch4 align=\"center\"\u003e A lightweight autocompletion plugin for Vim, written in vim9script. \u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#key-features\"\u003eKey Features\u003c/a\u003e •\n  \u003ca href=\"#requirements\"\u003eRequirements\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#configuration\"\u003eConfiguration\u003c/a\u003e •\n  \u003ca href=\"#commands\"\u003eCommands\u003c/a\u003e •\n  \u003ca href=\"#Writing-Your-Own-Extension\"\u003eAdd-on\u003c/a\u003e\n\u003c/p\u003e\n\n![Demo](https://gist.githubusercontent.com/girishji/40e35cd669626212a9691140de4bd6e7/raw/6041405e45072a7fbc4e352cbd461e450a7af90e/vimcomplete-demo.gif)\n\n\n# Key Features\n\nWords are sourced ***asynchronously*** from various sources:\n\n- **[Buffers](#buffer-Completion)**\n- **[Dictionary](#dictionary-Completion)** files\n- **[Code](#lsp-Completion)** completion sourced from [LSP](https://github.com/yegappan/lsp) client\n- **[Snippets](#snippets-Completion)** from [vim-vsnip](https://github.com/hrsh7th/vim-vsnip) client\n- **[Words and bigrams](#ngrams-Completion)** from [Ngrams](https://norvig.com/ngrams/) database\n- Vim's **[omnifunc](#omnifunc-Completion)**\n- **[Path](#path-Completion)** search\n- Vim's **[abbreviations](#abbreviations-Completion)**\n- **[Vim9script](#vim9script-language-Completion)** language (similar to LSP)\n- **[Tmux](#tmux-Completion)** panes\n- **[Tag](#tag-Completion)** names\n\nAll crucial source modules are integrated, eliminating the need to manage\nmultiple plugins. Users have the flexibility to enable or disable each\ncompletion source and customize settings on a per-file-type basis (`:h filetype`).\n\n\nCompletion items are _sorted_ according to the following criteria:\n\n- Recency (using a LRU cache)\n- Length of item\n- Priority\n- Proximity of item (for buffer completion)\n- Case match\n\n\u003e [!NOTE]\n\u003e For cmdline-mode completion (`/`, `?`, and `:` commands), refer to **[VimSuggest](https://github.com/girishji/vimsuggest)** plugin.\n\n\n# Requirements\n\n- Vim version 9.1 or higher\n\n# Installation\n\nInstall it via [vim-plug](https://github.com/junegunn/vim-plug).\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eShow instructions\u003c/b\u003e\u003c/summary\u003e\n\u003cbr\u003e\n  \nUsing vim9 script:\n\n```vim\nvim9script\nplug#begin()\nPlug 'girishji/vimcomplete'\nplug#end()\n```\n\nUsing legacy script:\n\n```vim\ncall plug#begin()\nPlug 'girishji/vimcomplete'\ncall plug#end()\n```\n\n\u003c/details\u003e\n\nInstall using Vim's built-in package manager.\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eShow instructions\u003c/b\u003e\u003c/summary\u003e\n\u003cbr\u003e\n  \n```bash\n$ mkdir -p $HOME/.vim/pack/downloads/opt\n$ cd $HOME/.vim/pack/downloads/opt\n$ git clone https://github.com/girishji/vimcomplete.git\n```\n\nAdd the following line to your $HOME/.vimrc file.\n\n```vim\npackadd vimcomplete\n```\n\n\u003c/details\u003e\n\n# Configuration\n\nThe completion sources mentioned above, aside from [buffer](#Buffer-Completion), [path](#path-completion), and [lsp](#lsp-completion) completion, are not enabled by default. This section provides instructions on configuring both the completion sources and the completion engine itself.\n\n## Completion Engine\n\nThis entity retrieves completion items from the enabled completion sources and then displays the popup menu.\n\nOption|Type|Description\n------|----|-----------\n`alwaysOn`|`Boolean`| If set to `true`, the completion menu is automatically triggered by any change in the buffer. If set to `false`, use `\u003cC-Space\u003e` (control-space) to manually trigger auto-completion. If you choose to map some other key instead, map your favorite key to `\u003cPlug\u003e(vimcomplete-do-complete)`. If set to `false`, `completeopt` Vim option determins popup behavior. Default: true.\n`completionKinds`|`Dictionary`|Custom text to use when `customCompletionKinds` is set (explained below). Default: `{}`.\n`customCompletionKinds`|`Boolean`|Set this option to customize the 'kind' attribute (explained below). Default: `false`.\n`kindDisplayType`|`String`|The 'kind' field of completion item can be displayed in a number of ways: as a single letter symbol (`symbol`), a single letter with descriptive text (`symboltext`), only text (`text`), an icon (`icon`), or icon with text (`icontext`). For showing VSCode like icons you need [a patched font](https://www.nerdfonts.com/). Default: `symbol`.\n`matchCase`|`Boolean`|Prioritize the items that match the case of the prefix being completed. Default: `true`.\n`noNewlineInCompletion` | `Boolean` | When `true`, pressing `\u003cEnter\u003e` (`\u003cCR\u003e`) in insert mode will insert a newline only if an item in the popup menu is selected. If an item is not selected, the popup is dismissed without inserting a newline. Default: `false`.\n`noNewlineInCompletionEver` | `Boolean` | When `true`, pressing `\u003cEnter\u003e` (`\u003cCR\u003e`) will never insert a newline, regardless of whether an item in the popup menu is selected. This option overrides `noNewlineInCompletion`. If both options are `false`, `\u003cCR\u003e` behaves as per the default Vim behavior, inserting a newline whether an item is selected or not. Default: `false`.\n`postfixClobber` | `Boolean` | When completing 'foo\\\u003ccursor\\\u003ebar' and the candidate is 'foosome', enabling this option (`true`) will complete 'foosome' instead of 'foosomebar'. Default: `false`.\n`postfixHighlight` | `Boolean` | This option functions similarly to `postfixClobber`, but instead of deleting adjoining text to the right of the completed text, it highlights it using the 'VimCompletePostfix' highlight group. Use `\u003cEsc\u003e` to retain the adjoining text and `\u003cC-L\u003e` to delete. Default: `false`.\n`recency`|`Boolean`|Display recently chosen items from the LRU cache. Items are shown at the top of the list. Default: `true`.\n`recentItemCount`|`Number`|Count of recent items to show from LRU cache. Default: `5`.\n`showKind`|`Boolean`|Show the type ('kind') of completion item returned by LSP server. Default: `true`.\n`showCmpSource`|`Boolean`|Show the source of the completion item in the menu. Default: `true`.\n`cmpSourceWidth`|`Number`|Number of characters displayed for completion source. Default: `4`.\n`shuffleEqualPriority`|`Boolean`|Arrange items from sources with equal priority such that the first item of all sources appear before the second item of any source. Default: `false`.\n`sortByLength`|`Boolean`|Sort completion items by length. Default: `false`.\n`triggerWordLen`|`Number`|Minimum number of characters needed to trigger completion menu. Not applicable to completion triggered by LSP trigger characters (this exemption applies only to Vim version 9.1.650 or higher). Default: `1`.\n`infoPopup`|`Boolean`|Show an info popup (`:h completepopup`) for extra information. If you prefer the preview window, set this option to `false` and `set completeopt+=preview`. If you prefer to not have any info window, set this option to `false` and `set completeopt-=preview`. Default: `true`.\n`setCompleteOpt` | `Boolean` | If `false`, `completeopt` is not set automatically. To have the first item selected when `alwaysOn` is enabled, you can manually add `set completeopt=menuone,noinsert` to your `vimrc` and type `\u003cC-y\u003e` to insert the selected item. If `true`, the first item is not automatically selected. Default: `true`.\n\n## Buffer Completion\n\nThe current buffer, as well as other open buffers, are searched for completion candidates using an asynchronous mechanism with a timeout. This approach ensures that the completion engine is not slowed down by large buffers.\n\nOption|Type|Description\n------|----|-----------\n`completionMatcher`| `String` | Enable fuzzy or case insensitive completion. Accepts one of the following values: `case` for case sensitive matching, `icase` for ignoring case while matching, and `fuzzy` for fuzzy match. Default: `icase`.\n`dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `true`.\n`enable`|`Boolean`|Set this to `false` to disable buffer completion. Default: `true`.\n`envComplete`      | `Boolean` | Complete environment variables after typing the `$` character. Default: `false`.\n`filetypes`|`List`|List of file types for which this source is enabled. Default: `['*']` (all file types).\n`maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`.\n`otherBuffersCount`| `Number`  | Maximum number of other listed buffers to search. Set it to `0` to only search current buffer. Default: `3`.\n`priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `10`.\n`timeout`          | `Number`  | Maximum time allocated for searching completion candidates in the current buffer. Default: `100` milliseconds. If searching in multiple buffers, an additional 100 milliseconds is allocated. The search is aborted if any key is pressed.\n`urlComplete`      | `Boolean` | Enable completion of http links in entirety. This is useful when typing the same URL multiple times. Default: `false`.\n\n## Dictionary Completion\n\nThe dictionary provider is capable of searching an arbitrary list of words placed one per line in a text file. These words can encompass any non-space characters, and the file doesn't necessarily need to be sorted. This feature presents various opportunities. For instance, you can create a dictionary akin to [Pydiction](https://github.com/vim-scripts/Pydiction), enabling the completion of keywords, functions, and method names for any programming language. Moreover, it can efficiently search a sorted dictionary using binary search.\n\nUnsorted dictionaries are searched in linear time `O(n)`, but they tend to perform acceptably well for file sizes below 3MB (performance might vary depending on your system). Only one unsorted dictionary is used for completion, while any number of sorted dictionaries can be used simultaneously.\n\nDictionary can also include comments. Any line starting with `---` is considered as a comment and ignored.\n\nAdditional information can be included for each item which can be displayed in a preview or popup window. Any line starting with 4 spaces is displayed in the 'info' popup (or preview) window as part of the item above. Here is an example of dictionary file:\n\n```\n--- This is a comment\nitem_1\n    Additional information for 'info' window related to item_1. Can be multi-line.\nitem_2\n    Additional information for 'info' window related to item_2.\n```\n\nOption|Type|Description\n------|----|-----------\n`commentStr`       | `String` | Any lines beginning with this string is ignored. Default: `---`.\n`dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `false`.\n`enable`|`Boolean`|Set this to `true` to enable dictionary completion. Default: `false`.\n`filetypes`|`List`|List of file types for which this source is enabled. Default: `['text', 'markdown']`.\n`matcher`| `String` | This option is active only when `onlyWords` is `true` (text files). It makes sense only when `sortedDict` is set to `false` since binary search is done case sensitive (assuming that sorting of the dictionary file is done case sensitive). Accepted values are `case` (case sensitive) and `ignorecase`. Default: `case`.\n`maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`.\n`onlyWords`| `Boolean` | Set this to `true` if both the prefix you are trying to complete and the dictionary contain alphanumeric characters only (text files). For programming language dictionaries it should be set to `false`, since they can contain characters like `@`, `.`, `(`, etc. Default: `false`.\n`priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `10`.\n`sortedDict`       | `Boolean` | `true` if the dictionary file is sorted, `false` otherwise. This option affects both performance and correctness. Take care to set it correctly. Searching is case sensitive. Default: `true`.\n`triggerWordLen`|`Number`|Minimum number of characters needed to trigger completion menu. Default: `1`.\n\n### Sample Configuration\n\nFurther information about setting up configurations will be available later. Nonetheless, here is a sample configuration specifically targeting the dictionary source.\nDictionary files can be configured individually for each 'filetype' (`:h filetype`). \n\n```\nvim9script\nvar dictproperties = {\n    python: { sortedDict: false },\n    text: { sortedDict: true }\n}\nvar vcoptions = {\n    dictionary: { enable: true, priority: 11, filetypes: ['python', 'text'], properties: dictproperties },\n}\nautocmd VimEnter * g:VimCompleteOptionsSet(vcoptions)\nautocmd FileType text set dictionary+=/usr/share/dict/words\n```\n\nBy adding the following snippet to your `vimrc`, you can add custom completions for each filetype, say `python`, by adding a text  file `dicts/python` into the `vimrc` folder:\n\n```vim\nvim9script\ng:vimfiles_dir = \u0026runtimepath-\u003esplit(',')[0]\nautocmd FileType * {\n    var dict = $'{g:vimfiles_dir}/dicts/{expand(\"\u003camatch\u003e\")}'-\u003eresolve()-\u003efnamemodify(':p')\n    if dict-\u003efilereadable()\n        exe $'setlocal dictionary={dict}'\n    endif\n}\n```\n\n\u003e [!TIP]\n\u003e For completing English words, you can utilize [ngram](https://en.wikipedia.org/wiki/N-gram) completion as outlined below, or opt for a custom dictionary containing frequently used words. Unfortunately, the default dictionary that comes pre-installed with Linux or MacOS contains numerous infrequently used words that spam the menu.\n\n\u003e [!NOTE]\n\u003e For legacy script, the syntax for 'autocmd' is:\n\u003e ```\n\u003e autocmd VimEnter * call g:VimCompleteOptionsSet(vcoptions)\n\u003e ```\n\n## LSP Completion\n\nThis source obtains autocompletion items from the\n[LSP client](https://github.com/yegappan/lsp).\n\n\u003e [!IMPORTANT]\n\u003e Please install the [LSP client](https://github.com/yegappan/lsp) separately.\n\nOption|Type|Description\n------|----|-----------\n`dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `true`.\n`enable`|`Boolean`|Set this to `false` to disable LSP completion. Default: `true`.\n`filetypes`|`List`|This option need not be specified. If this option is not specified or is empty, completion items are sourced for any file type for which LSP is configured. Otherwise, items are sourced only for listed file types. Default: Not specified.\n`keywordOnly`|`Boolean`|If `true` completion will be triggered after any keyword character as defined by the file type (`:h 'iskeyword'`). `false` will trigger completion after non-keywords like `.` (for instance). Default: `false`.\n`maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`.\n`priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `10`.\n\n\u003e [!NOTE]\n\u003e For fuzzy and case insensitive completion, set the `completionMatcher` option in the [LSP client](https://github.com/yegappan/lsp). See `:h lsp-opt-completionMatcher`.\n\n## Snippets Completion\n\nThis source provides snippet completion from [vim-vsnip](https://github.com/hrsh7th/vim-vsnip).\n\n\u003e [!IMPORTANT]\n\u003e Please install the following separately.\n\u003e - [vim-vsnip](https://github.com/hrsh7th/vim-vsnip)\n\u003e - [vim-vsnip-integ](https://github.com/hrsh7th/vim-vsnip-integ)\n\u003e\n\u003e Optional:\n\u003e - [friendly-snippets](https://github.com/rafamadriz/friendly-snippets)\n\n\nOption|Type|Description\n------|----|-----------\n`adaptNonKeyword`|`Boolean`|(experimental) When completing snippets starting with non-keywords, say '#i' for instance, adjust completion such that they are compatible with items starting with keywords like 'i' (returned by LSP, for instance). Default is `false`.\n`dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `true`.\n`enable`|`Boolean`|Set this to `true` to enable this source. Default: `false`.\n`filetypes`|`List`|List of file types for which this source is enabled. Default: `['*']` (all file types).\n`maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`.\n`priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `10`.\n\n\u003e [!NOTE]\n\u003e The `\u003cTab\u003e` key facilitates movement within a snippet. When a snippet is active, the popup completion menu won't open. However, the popup window will activate upon reaching the final stop within the snippet. If you wish to navigate backward within the snippet using `\u003cS-Tab\u003e`, you can dismiss the popup by using `CTRL-E`.\n\n\n## Ngrams Completion\n\nThis source is kept as a separate plugin since it includes large database\nfiles. Please see\n**[ngram-complete](https://github.com/girishji/ngram-complete.vim)** for\ninstallation and usage instructions.\n\n## Omnifunc Completion\n\nThis source completes items emitted by the function set in `omnifunc` (`:h 'omnifunc'`).\n\nVim provides language based autocompletion through Omni completion for many\nlanguages (see `$VIMRUNTIME/autoload`). This is a lightweight alternative to using LSP.\n\n| __Vim File__  | __Language__  |\n|---|---|\n|ccomplete.vim|C|\n|csscomplete.vim|HTML / CSS|\n|htmlcomplete.vim|HTML|\n|javascriptcomplete.vim|Javascript|\n|phpcomplete.vim|PHP|\n|pythoncomplete.vim|Python|\n|rubycomplete.vim|Ruby|\n|syntaxcomplete.vim|from syntax highlighting|\n|xmlcomplete.vim|XML (uses files in the xml directory)|\n\nVim sets the `omnifunc` option automatically when file type is detected.\n\nAlso, any user defined `omnifunc` can also be used for autocompletion.\n\n\u003e [!CAUTION]\n\u003e Disable the \u003ca href=\"#lsp-completion\"\u003eLSP Completion\u003c/a\u003e when using omnifunc.\n\nOption|Type|Description\n------|----|-----------\n`dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `true`.\n`enable`|`Boolean`|Set this to `true` to enable omnifunc completion. Default: `false`.\n`filetypes`|`List`|List of file types for which this source is enabled. Default: `['*']` (all file types).\n`maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`.\n`priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `10`.\n\n## Path Completion\n\nBoth relative and absolute path names are completed.\n\n| Option              | Type      | Description   |\n|---------------------|-----------|---------------|\n| `bufferRelativePath`| `Boolean` | Interpret relative paths relative to the directory of the current buffer. Otherwise paths are interpreted relative to the directory from which Vim is started. Default: `true`.    |\n| `dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `true`. |\n| `enable`|`Boolean`|Set this to `false` to disable path completion. Default: `true`. |\n| `filetypes`|`List`|List of file types for which this source is enabled. Default: `['*']` (all file types). |\n| `groupDirectoriesFirst`| `Boolean` | Group directories before files (like linux's 'ls --group-directories-first'). Default: `false`.    |\n| `maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`. |\n| `priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `12`. |\n| `showPathSeparatorAtEnd`| `Boolean` | Show path separator (`/` in unix) at the end of directory entry. Default: `false`.    |\n\n\u003e [!NOTE]\n\u003e Path completion activates when there is a `/` (`\\` for Windows when Vim option `shellslash` is not set) or `.` in the word before the cursor. To autocomplete deeper in a directory type `/` at the end.\n\n## Abbreviations Completion\n\nAbbreviations (`:h abbreviations`) are completed based on the `id`.\n\n| Option              | Type      | Description   |\n|---------------------|-----------|---------------|\n| `dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `true`. |\n| `enable`|`Boolean`|Set this to `true` to enable abbreviation completion. Default: `false`. |\n| `filetypes`|`List`|List of file types for which this source is enabled. Default: `['*']` (all file types). |\n| `maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`. |\n| `priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `10`. |\n\n## Vim9script Language Completion\n\nThis source completes Vim9 script function names, arguments, variables, reserved words and\nthe like. Enable this if you are developing a Vim plugin or configuring a non-trivial _.vimrc_.\n\n\n| Option              | Type      | Description   |\n|---------------------|-----------|---------------|\n| `dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `true`. |\n| `enable`|`Boolean`|Set this to `false` to disable this source. Default: `true`. |\n| `filetypes`|`List`|List of file types for which this source is enabled. Default: `['vim']`. |\n| `maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`. |\n| `priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `10`. |\n\n## Tmux Completion\n\nWords are sourced asynchronously from adjacent tmux panes, ensuring Vim won't hang even with a lot of output in the tmux windows.\n\nOption|Type|Description\n------|----|-----------\n`completionMatcher`| `String` | Enable fuzzy or case insensitive completion. Accepts one of the following values: `case` for case sensitive matching, `icase` for ignoring case while matching, and `fuzzy` for fuzzy match. Default: `icase`.\n`dup`|`Boolean`|If true, include items from this source that are duplicates of items from other sources. Default: `false`.\n`enable`|`Boolean`|Set this to `true` to enable tmux completion. Default: `false`.\n`filetypes`|`List`|List of file types for which this source is enabled. Default: `['*']`.\n`maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`.\n`name`|`String`|Name of the executable. You can specify the full path if the *tmux* executable is not found in $PATH. Default: `tmux`.\n`priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `8`.\n`scrollCount`| `Number` | Number of lines above visible lines to search for words. Excludes visible lines if Vim is running in a pane. Default: 200.\n\n## Tag Completion\n\nTag names are autocompleted if tags file is available.\n\nOption|Type|Description\n------|----|-----------\n`enable`|`Boolean`|Set this to `true` to enable tag name completion. Default: `false`.\n`filetypes`|`List`|List of file types for which this source is enabled. Default: `['*']`.\n`maxCount`|`Number`|Total number of completion candidates emitted by this source. Default: `10`.\n`priority`|`Number`|Priority of this source relative to others. Items from higher priority sources are displayed at the top. Default: `8`.\n\n## Configure Options\n\nOptions can be configured using the global function `g:VimCompleteOptionsSet()`. The example below illustrates how to enable and configure completion sources. Please note that not all options are demonstrated here; for a comprehensive list of all available options, refer to the tables provided above.\n\n```vim\nvim9script\nvar options = {\n    completor: { shuffleEqualPriority: true, postfixHighlight: true },\n    buffer: { enable: true, priority: 10, urlComplete: true, envComplete: true },\n    abbrev: { enable: true, priority: 10 },\n    lsp: { enable: true, priority: 10, maxCount: 5 },\n    omnifunc: { enable: false, priority: 8, filetypes: ['python', 'javascript'] },\n    vsnip: { enable: true, priority: 11 },\n    vimscript: { enable: true, priority: 11 },\n    ngram: {\n        enable: true,\n        priority: 10,\n        bigram: false,\n        filetypes: ['text', 'help', 'markdown'],\n        filetypesComments: ['c', 'cpp', 'python', 'java'],\n    },\n}\nautocmd VimEnter * g:VimCompleteOptionsSet(options)\n```\n\n\u003e [!NOTE]\n\u003e For legacy script, the syntax for 'autocmd' is:\n\u003e ```\n\u003e autocmd VimEnter * call g:VimCompleteOptionsSet(options)\n\u003e ```\n\n## Tab Completion\n\nYou can map the `\u003cTab\u003e` and `\u003cS-Tab\u003e` keys to navigate autocomplete items in insert mode. By default, Vim uses `CTRL-N` and `CTRL-P` to cycle through completion menu options. `\u003cTab\u003e` and `\u003cS-Tab\u003e` also jump between snippet placeholders where appropriate.\n\nTo enable `\u003cTab\u003e` and `\u003cS-Tab\u003e` for this purpose, add the following to your configuration:\n\n```vim\nvim9script\ng:vimcomplete_tab_enable = 1\n```\n\n\u003e **Note**: Enabling this option will remove any existing mappings for `\u003cTab\u003e` and `\u003cS-Tab\u003e`.\n\nIf you'd like to retain `\u003cTab\u003e` and `\u003cS-Tab\u003e` mappings from other plugins, unset the above variable and instead use these custom mappings, substituting `{rhs}` as needed (using `\"\\\u003cTab\u003e\"` as `\"{rhs}\"` will behave the same as setting the variable):\n\n```vim\ninoremap \u003cbuffer\u003e\u003cexpr\u003e \u003ctab\u003e   g:VimCompleteTab() ?? \"{rhs}\"\ninoremap \u003cbuffer\u003e\u003cexpr\u003e \u003cs-tab\u003e g:VimCompleteSTab() ?? \"{rhs}\"\n```\n\nThis configuration allows `\u003cTab\u003e` and `\u003cS-Tab\u003e` to integrate with other plugin mappings.\n\nAlternatively, you can use the keys `\u003cPlug\u003e(vimcomplete-tab)` and `\u003cPlug\u003e(vimcomplete-s-tab)` directly in your custom mappings.\n\n## Enter Key Handling\n\n`\u003cEnter\u003e` is mapped by default to insert the currently selected item and/or insert a literal `\u003cCR\u003e`, depending on configuration (see `noNewlineInCompletion` and `noNewlineInCompletionEver` options).\n\nIn case of conflicts with other plugins, this mapping can be disabled entirely:\n\n```vim\nvim9script\ng:vimcomplete_cr_enable = 0\n```\n\nIn this case, the user must define an appropriate `\u003cCR\u003e` mapping to resolve conflicts between plugins. When creating your mapping, if `alwaysOn` is enabled, consider emitting `\u003cPlug\u003e(vimcomplete-skip)` to prevent the next keystroke from automatically reactivating the completion popup.\n\n\u003e [!NOTE]\n\u003e For help with other keybindings see `:h popupmenu-keys`. This help section includes keybindings for `\u003cBS\u003e`, `CTRL-H`, `CTRL-L`, `CTRL-Y`, `CTRL-E`, `\u003cPageUp\u003e`, `\u003cPageDown\u003e`, `\u003cUp\u003e`, and `\u003cDown\u003e` keys when popup menu is open.\n\n## Disable mappings\n\nDisable all mappings set by vimcomplete.\nPlease set your preferred mappings.\nBoth `g:vimcomplete_tab_enable` and `g:vimcomplete_cr_enable` are ignored.\n\n```vim\nvim9script\ng:vimcomplete_do_mapping = 0\n```\n\n## Highlight Groups\n\nYou can use `Pmenu`, `PmenuThumb`, `PmenuSbar`, `PmenuSel`, `PmenuKind`,\n`PmenuKindSel`, `PmenuExtra` and `PmenuExtraSel` Vim highlight groups to alter the\nappearance of the popup menu.\n\nYou can also customize the appearance of the column containing the 'kind' attribute in the menu. For example, to modify the appearance of the 'Keyword' kind, configure the `PmenuKindKeyword` highlight group. Refer to the [list](#Custom-Completion-Kinds) for all available 'kind' items.\n\nIf `postfixHighlight` option is enabled, you can utilize the `VimCompletePostfix` highlight group to adjust the appearance of text adjacent to the completion. By default, it is linked to `DiffChange`.\n\n## Info Popup Window\n\nVim's completion system can display an additional popup window (referred to as the \"info\" window) next to the selected menu item when supplementary information is available. \n\nTo apply basic customizations, you can use the `completepopup` option. For example:\n\n```vim\nautocmd VimEnter * set completepopup+=border:off,highlight:Normal\n```\n\nThis provides limited customization. For advanced control over the appearance and behavior of the \"info\" window, use the `g:VimCompleteInfoWindowOptionsSet()` function. This function accepts a dictionary of popup window options. Refer to `:h popup_create-arguments` for detailed descriptions. Here’s an example:\n\n```vim\ng:VimCompleteInfoWindowOptionsSet({\n    drag: false,    # Disable dragging\n    close: 'none',  # Disable close button\n    resize: false,  # Disable resizing\n})\n```\n\nInfo window can be scrolled using the following keys:\n`\u003cPlug\u003e(vimcomplete-info-window-pageup)`,\n`\u003cPlug\u003e(vimcomplete-info-window-pagedown)`,\n`\u003cPlug\u003e(vimcomplete-info-window-home)`, and\n`\u003cPlug\u003e(vimcomplete-info-window-end)`. Here's an example mapping:\n\n```vim\ninoremap \u003cC-b\u003e \u003cPlug\u003e(vimcomplete-info-window-pageup)\ninoremap \u003cC-f\u003e \u003cPlug\u003e(vimcomplete-info-window-pagedown)\n```\n\n# Commands\n\nCommands are available to list completion sources and to enable or disable the plugin.\n\n## Listing Completion Sources\n\nThe following command displays a list of completion sources enabled for the current buffer.\n\n```vim\n:VimCompleteCompletors\n```\n\n## Enable and Disable\n\nAutocompletion is enabled by default. At any time, you can enable or disable the plugin using the following commands:\n\n```vim\n:VimCompleteEnable\n:VimCompleteDisable\n```\n\nYou can selectively enable autocompletion for specific _file types_. For instance, enable autocompletion for `c`, `cpp`, `python`, `vim`, `text`, and `markdown` files.\n\n```vim\n:VimCompleteEnable c cpp python vim text markdown\n```\n\nTo start Vim with autocompletion disabled, set the following variable.\n\n```vim\ng:vimcomplete_enable_by_default = false\n```\n\n`VimCompleteEnable` takes a space-separated list of _file types_ as an argument. If no argument is specified, autocompletion is enabled for _all file types_.\n\nWhen Vim is started without any arguments or a new buffer is created with\n`:bufnew`, it opens an unnamed buffer. This buffer is not associated with any\n_file type_. To enable/disable autocompletion on this buffer use the following\nvariable. It is set by default.\n\n```vim\ng:vimcomplete_noname_buf_enable = true\n```\n\n# Custom Completion Kinds\n\nEach item returned by the LSP server has a type associated with it, which can\nbe displayed on the popup menu. To customize , you need to use the option\n`customCompletionKinds` and set all custom kinds in the `completionKinds`.\nThe following table has all default LSP kinds:\n\nKind|Description\n----|-----------\nt | Text\nm | Method\nf | Function\nC | Constructor\nF | Field\nv | Variable\nc | Class\ni | Interface\nM | Module\np | Property\nu | Unit\nV | Value\ne | Enum\nk | Keyword\nS | Snippet\nC | Color\nf | File\nr | Reference\nF | Folder\nE | EnumMember\nd | Constant\ns | Struct\nE | Event\no | Operator\nT | TypeParameter\nB | Buffer[^2]\nD | Dictionary[^2]\nw | Word[^2]\nO | Option[^2]\na | Abbreviation[^2]\ne | EnvVariable[^2]\nU | URL[^2]\nc | Command[^2]\nX | Tmux[^2]\nG | Tag[^2]\n\n[^2]: This is not returned by LSP.\n\nFor example, if you want to change the \"Method\" kind to the kind \"method()\":\n\n```vim\nvim9script\ng:VimCompleteOptionsSet({ Completor: {\n    customCompletionKinds: true,\n    completionKinds: {\n        \"Method\": \"method()\"\n    }\n})\n\nIn the completion popup, will show something like this: \u003e\n\n    var file = new File()\n\n    file.cre\n        | create                method() |\n        | createIfNotExists     method() |\n        | ...                            |\n```\n\n# Writing Your Own Extension\n\nStart by examining the implementation of an external plugin like [ngrams-viewer](https://github.com/girishji/ngramview-complete.vim) (which spawns a new process to handle http requests) or [ngram-complete](https://github.com/girishji/ngram-complete.vim).\n\nThe completion engine employs an interface similar to Vim's [complete-functions](https://vimhelp.org/insert.txt.html#complete-functions). However, the function is invoked in three ways instead of two:\n\n- First, to find the start of the text to be completed.\n- Next, to check if completion candidates are available.\n- Lastly, to find the actual matches.\n\nThe first and last invocation are identical to Vim's [complete-functions](https://vimhelp.org/insert.txt.html#complete-functions). During the second invocation, the arguments are:\n\n- `findstart: 2`\n- `base: empty`\n\nThe function must return `true` or `false` to indicate whether completion candidates are ready. Only when this return value is `true` will the function be invoked for the third time to get the actual matches. This step is essential for asynchronous completion.\n\nThe name of the completion function does not matter, but it should take two arguments: `findstart: Number` and `base: String`, and return `\u003cany\u003e`. Register this function with the completion engine by calling `vimcompletor.Register()`. Use the `User` event of type `VimCompleteLoaded` to time the registration.\n\nWhen users set options through the configuration file, a `User` event with type `VimCompleteOptionsChanged` is issued. The plugin should register for this event and update its internal state accordingly.\n\n# Other Plugins to Enhance Your Workflow\n\n1. [**Devdocs.vim**](https://github.com/girishji/devdocs.vim) - browse documentation from [devdocs.io](https://devdocs.io).\n\n2. [**Scope.vim**](https://github.com/girishji/scope.vim) - fuzzy find anything.\n\n3. [**VimBits**](https://github.com/girishji/vimbits) - curated suite of lightweight Vim plugins.\n\n4. [**VimSuggest**](https://github.com/girishji/vimsuggest) - autocompletion for Vim's command-line.\n\n# Contributing\n\nPull requests are welcomed.\n\n# Similar Vim Plugins\n\n- [asyncomplete](https://github.com/prabirshrestha/asyncomplete.vim)\n- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgirishji%2Fvimcomplete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgirishji%2Fvimcomplete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgirishji%2Fvimcomplete/lists"}