This repository is the core implementation of **coc.nvim**, a powerful Language Server Protocol (LSP) client and extension host for Neovim and Vim. It transforms these editors into full-featured IDEs by managing the lifecycle of language servers and providing rich features like intelligent code completion, diagnostics, refactoring, navigation, and snippet expansion. The architecture is a monolithic Node.js backend that communicates with the editor via RPC (`@chemzqm/neovim`), with a Lua bridge for performance-critical text operations and a sophisticated extension system that allows users to install and manage third-party plugins. The codebase demonstrates a high degree of engineering craftsmanship. It features a clean, event-driven architecture with extensive use of the Disposable and CancellationToken patterns for resource management. Notable subsystems include a highly optimized fuzzy matching engine with WASM support, a complete Model Context Protocol (MCP) server for AI agent integration, a robust configuration system with layered scoping, and a secure download/extraction utility. The project maintains an exceptionally large and well-structured test suite covering unit, integration, and handler-level scenarios. Currently, the project is in an **active** maintenance state with very low technical drift. It aggressively tracks the latest Node.js versions and LSP protocol extensions. While the sheer size of the codebase introduces some inherent complexity and a few deprecated internal APIs, the overall architecture is sound, the code is well-factored, and several components are genuinely reusable in other projects. It stands as a benchmark for how to build a complex, high-performance editor plugin.
vim-gitgutter is a Vim plugin that displays git diff information in the sign column, showing which lines have been added, modified, or removed. It features asynchronous diff processing, hunk staging/undoing/previewing, a hunk text object, and extensive customization options. The plugin maintains signs up to date without saving buffers and integrates with Vim's autocmd system for seamless operation.
vim-matchup is a Vim/Neovim plugin that extends the `%` key to navigate between matching language constructs (e.g., if/endif, for/endfor, HTML tags, LaTeX environments) and highlights matching pairs. Its architecture is a classic Vim plugin: `plugin/matchup.vim` is the entry point that initializes configuration, loads modules, and sets up autocommands. Core logic lives in `autoload/matchup/*.vim` files, which are lazy-loaded on demand. The plugin supports both a Vimscript-based matching engine (using `b:match_words` regex patterns) and a Neovim-only treesitter-based engine (Lua code in `lua/treesitter-matchup/`). Key modules include `delim` (delimiter detection and matching), `motion` (movements like `%`, `[%`, `]%`), `text_obj` (text objects `i%`, `a%`), `matchparen` (highlighting and off-screen display), and `perf` (performance timing). It depends on Vim 7.4+ or Neovim 0.5+, and optionally on installed treesitter parsers for enhanced matching. The codebase is well-structured, extensively tested, and demonstrates advanced Vimscript and Lua craftsmanship.
This is a Vim plugin that provides keybindings (gS/gJ) to split single-line code constructs into multiple lines and join them back, covering 30+ languages. The architecture uses a callback-based system where per-filetype scripts register split/join callbacks in buffer-local variables, and the main engine (autoload/sj.vim) iterates through them. The codebase is modular and well-structured, with reusable utility functions for text replacement, cursor management, and parsing (e.g., sj#argparser). Each language has dedicated autoload files that implement specific transformations (e.g., hashes, blocks, if-clauses). The plugin supports customization via many settings and alignment through external plugins. It is thoroughly tested with RSpec/Vimrunner and is actively maintained.
YouCompleteMe (YCM) is a Vim plugin that provides as-you-type code completion, diagnostics, refactoring, and other IDE-like features for multiple programming languages. It uses a client-server architecture: a thin Vim client communicates via HTTP+JSON with a separate ycmd server, which in turn integrates with language-specific backends such as clangd, Jedi, OmniSharp-Roslyn, Gopls, TSServer, rust-analyzer, and jdt.ls. The plugin supports semantic completion, signature help, hover information, go-to-definition, find references, fixits, type/call hierarchy, inlay hints, and semantic highlighting. It is highly configurable through Vim global variables and per-project configuration files. The codebase is mature, with extensive Python and Vimscript test suites, Docker-based CI, and a well-documented help file. While primarily a Vim plugin, its client-server design and reusable components (e.g., async HTTP request pattern, composable diagnostic filters, thread pool) could be adapted for other editor integrations or standalone tools.
asyncomplete.vim is a Vim and Neovim plugin that provides asynchronous autocompletion using timers. It allows completion sources to be registered and triggered without blocking the editor. The architecture centers around a core completion engine that manages sources, triggers, and popup menu display. Key features include context-aware completion triggering, support for various change detection mechanisms (autocommands or timers), and a flexible source registration system. The plugin depends only on Vim 8+ or Neovim with timers feature, integrating with Vim's native complete() function for popup menu handling.
VimWiki is a mature Vim/Neovim plugin implementing a personal wiki system for note-taking, task management, documentation, and diary keeping. It features syntax highlighting for multiple markup languages (default VimWiki, Markdown, MediaWiki), wiki link resolution, table formatting, tag generation, and HTML export. The architecture follows a modular autoload pattern with scoped variable management (global, wiki-local, syntax-local, buffer-local) enabling flexible configuration. Core functionality includes link handling, diary automation, and text object manipulation for lists/tables. The project maintains active development with comprehensive testing across Vim/Neovim versions via CI, demonstrating strong adherence to Vim plugin best practices.
This Neovim plugin renders indentation guides using virtual text, avoiding the 'conceal' feature. It provides highly configurable indentation guides, including support for tabs, mixed indentation, and multiple highlight groups. The architecture is modular: `config.lua` handles a hierarchical configuration system with merging, validation, and buffer-scoped overrides; `hooks.lua` implements an extensible type-safe hook system that allows other plugins or user configurations to modify every aspect of the rendering pipeline; `indent.lua` performs whitespace analysis and classifies each cell into an enum (TAB_START, TAB_FILL, etc.); `scope.lua` uses Treesitter to determine the current scope (e.g., function body) for highlighting; and `virt_text.lua` composes the final virtual text extmarks. The plugin refreshes on cursor movement, option changes, and scrolling, with built-in debouncing. It integrates with Neovim's `listchars` and supports repeat_linebreak for wrapped lines. Test coverage is moderate but exercise key components. The code demonstrates mature Lua engineering with careful Neovim version compatibility and a clean public API.
This is a Vim plugin that visualizes the undo history of a buffer as a tree, allowing users to navigate between different undo branches. It parses Vim's internal `undotree()` data structure and renders an ASCII representation in a dedicated split window. The architecture follows an object-oriented pattern in Vim script, with classes for panels (undotree and diffpanel) encapsulating state and behavior. Key features include: window layout customization, diff panel with sign highlighting, relative timestamps, configurable tree shapes, and support for persistent undo. The plugin is purely Vim script and depends only on an external diff command for the diff panel. It is well-maintained, actively used, and avoids deprecated Vim APIs. The code demonstrates high craftsmanship in Vim scripting, particularly in the ASCII tree rendering algorithm and the diff caching mechanism.
vim-which-key is a Vim/Neovim plugin that provides an interactive keybinding guide. When a leader key is pressed, it intercepts subsequent keystrokes and displays available mappings in a popup or split window. The plugin dynamically parses native Vim mappings for the given prefix and merges them with user-defined description dictionaries to show meaningful labels and group names. It supports both Vim's popup API and Neovim's floating windows, offering a modern, non-intrusive UI. The architecture is modular: mapping parsing, layout rendering, window management, and key input handling are separated into distinct autoload modules. The code demonstrates solid Vimscript engineering, with careful handling of edge cases like timeout, exit codes, special keys, and fallback to native mappings.
Vim-R is a Vim plugin that transforms Vim into a full-featured integrated development environment for the R language. It provides interactive R console integration (via built-in terminal or external tmux), omni-completion for R objects and function arguments, an object browser, PDF preview with SyncTeX forward/backward search, and support for R Markdown, Rnoweb, and Quarto documents. The plugin communicates with R through a custom TCP/IP server (vimrserver) written in C and a companion R package (vimcom). While the plugin is superseded by R.nvim for Neovim users, the codebase demonstrates high craftsmanship in its multi-language architecture (VimL, C, R, Python) and remains functional for Vim users. It is not a data analysis tool but an editor enhancement for R development.
coc-snippets is a Neovim/Vim plugin that provides snippet completion and expansion for the coc.nvim completion framework. It supports multiple snippet formats including UltiSnips, snipmate, and VSCode snippets, allowing users to load snippets from various sources and use them as completion items in their code editing workflow. The extension follows a modular architecture where each snippet format is handled by a dedicated provider (e.g., UltiSnipsProvider, SnipmateProvider, TextmateProvider). A provider manager aggregates results from all active providers, filters and sorts them, and presents them as completion options. When a snippet is selected, it is expanded in the buffer with support for placeholders and tab stops. Key features include asynchronous loading of snippets to avoid blocking the UI, support for snippet context conditions (via UltiSnips context), and integration with coc.nvim's completion system. The extension also provides commands for editing snippets and listing available snippets. While the core functionality is well-implemented, the extension is tightly coupled to the coc.nvim API, which limits the reusability of individual components outside of the Neovim/Vim ecosystem. However, the utility module (src/util.ts) contains a collection of reusable functions for string manipulation, collections, and cryptographic operations that can be extracted with minimal modification.