A Neovim completion source for suggesting words from your open buffers.
cmp-buffer is a Neovim plugin that serves as a completion source for nvim-cmp, providing auto-completion suggestions based on words present in your open buffers. It solves the problem of needing to recall or retype words that have already been used in your editing session, enhancing coding speed and reducing typos.
Neovim users who utilize nvim-cmp for auto-completion and want context-aware suggestions from their current and other open buffers.
Developers choose cmp-buffer for its seamless integration with nvim-cmp, configurable word matching, and locality-based sorting that improves suggestion relevance, all while maintaining performance through asynchronous indexing.
nvim-cmp source for buffer words
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Indexes words in the background without blocking the editor, allowing smooth editing during the process, as highlighted in the indexing section.
Configurable with Vim regex patterns via keyword_pattern, enabling precise control over completable words, such as using [[\k\+]] for iskeyword-based matching.
Provides a locality bonus comparator that prioritizes completion items based on proximity to the cursor line, improving suggestion relevance in nvim-cmp.
Supports specifying buffers to index via the get_bufnrs function, allowing completion from current, visible, or all open buffers with customizable recipes.
Indexing large files can consume tens of megabytes of RAM, as acknowledged in the README, requiring manual configuration to avoid performance hits.
The documentation warns about incorrectly setting options like keyword_pattern outside the options table, which can lead to setup errors and confusion.
Only provides word-based completion from buffers, lacking code context understanding compared to LSP sources, limiting usefulness for complex coding tasks.
While indexing is async, watching for changes is synchronous, which might cause lag during large edits like pasting multi-line snippets, as noted in the indexing section.