{"id":15017,"library":"vim-language-server","title":"VimScript Language Server","description":"The `vim-language-server` package provides Language Server Protocol (LSP) features specifically for VimScript, enhancing the development experience within Vim and Neovim environments. It offers core LSP functionalities such as auto-completion, function signature help, hover documentation, go-to-definition, find references, document symbols, and diagnostics. The current stable version is 2.3.1, with releases occurring periodically to introduce new features or improve parsing capabilities, as seen by the recent v2.3.0 update that included an `vimlparser` update. Its key differentiators include its dedicated support for VimScript, robust integration with popular Vim LSP clients like `coc.nvim` and `vim-easycomplete`, and configurable indexing options for performance tuning. This server is designed to be run as a standalone process or managed by an LSP client, rather than being imported as a programmatic library in JavaScript or TypeScript applications.","status":"active","version":"2.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/iamcco/vim-language-server","tags":["javascript","viml","vim","lsp","language","server","autocomplete"],"install":[{"cmd":"npm install vim-language-server","lang":"bash","label":"npm"},{"cmd":"yarn add vim-language-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add vim-language-server","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is primarily a command-line executable. Developers interact with it by installing it globally and launching it via a Language Server Protocol (LSP) client or directly as a CLI process. Direct programmatic imports for application logic are not the intended use case.","wrong":"import { startServer } from 'vim-language-server'","symbol":"vim-language-server (CLI)","correct":"npm install -g vim-language-server\nvim-language-server --stdio"},{"note":"LSP clients like `coc.nvim` can be configured to launch the server by specifying the direct path to its main executable script, `bin/index.js`, for Node.js IPC communication. This is a configuration setting, not a direct JavaScript `require` or `import` for programmatic use within an application.","wrong":"require('/path/to/vim-language-server/bin/index.js')","symbol":"module path for LSP clients","correct":"\"module\": \"/path/to/vim-language-server/bin/index.js\""},{"note":"Alternatively, LSP clients can execute the globally installed `vim-language-server` command directly from the system's PATH for standard I/O (stdio) communication. This is also a configuration setting within the LSP client.","symbol":"command for LSP clients","correct":"\"command\": \"vim-language-server\""}],"quickstart":{"code":"{\n  // First, install the language server globally:\n  // npm install -g vim-language-server\n\n  // To use with coc.nvim, add the following to your coc-settings.json:\n  // This configuration tells coc.nvim how to launch and interact with the server.\n  \"languageserver\": {\n    \"vimls\": {\n      // Option 1: Using Node.js IPC (Inter-Process Communication) for potentially faster communication.\n      // Ensure the path to index.js is correct for your installation. \n      // You can find it by running `npm root -g` and then looking inside `vim-language-server/bin/index.js`.\n      \"module\": \"/usr/local/lib/node_modules/vim-language-server/bin/index.js\", // Example path, adjust as needed\n      \"args\": [\"--node-ipc\"],\n\n      // Option 2 (alternative to \"module\"): Using standard I/O for communication.\n      // This assumes `vim-language-server` is in your system's PATH.\n      // \"command\": \"vim-language-server\",\n      // \"args\": [\"--stdio\"],\n\n      \"initializationOptions\": {\n        \"isNeovim\": true, // Set to true if you are using Neovim, false for Vim8+\n        \"iskeyword\": \"@,48-57,_,192-255,-#\", // Customize Vim's `iskeyword` option\n        \"vimruntime\": \"$VIMRUNTIME\",         // Path to your $VIMRUNTIME directory\n        \"runtimepath\": \"~/.config/nvim,~/.vim\", // Comma-separated list of runtime paths\n        \"diagnostic\": { \"enable\": true }, // Enable diagnostics\n        \"indexes\": {\n          \"runtimepath\": true, // Index vim files from runtimepath for suggestions\n          \"gap\": 50,           // Indexing time gap in ms\n          \"count\": 5           // Number of files to index concurrently\n        },\n        \"suggest\": {\n          \"fromVimruntime\": true,\n          \"fromRuntimepath\": true\n        }\n      },\n      \"filetypes\": [ \"vim\" ] // Specify file types this server should handle\n    }\n  }\n}","lang":"json","description":"Demonstrates global installation via npm and a comprehensive `coc.nvim` configuration example for the VimScript Language Server, showing both Node.js IPC and stdio setup options."},"warnings":[{"fix":"Review the project's GitHub release notes or issues for `v2.0.0` for specific breaking changes and update configurations accordingly. Test thoroughly after upgrading.","message":"Major version `v2.0.0` was released without detailed breaking changes noted in the provided changelog. Users upgrading from v1.x may encounter unexpected behavior or require configuration adjustments.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"If you encounter errors related to unsupported commands, either set `isNeovim: false` in your configuration or remove/guard the problematic commands in your VimScript files.","message":"Setting `initializationOptions.isNeovim: true` can cause errors if your VimScript files contain commands that are specific to Vim and not supported by Neovim (e.g., `fixdel`).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Adjust the `initializationOptions.indexes.gap` (indexing time gap in ms, lower for faster) and `initializationOptions.indexes.count` (number of files to index concurrently, higher for faster) to optimize performance for your environment.","message":"Performance issues such as slow completion or diagnostics can occur, especially in large projects, due to default indexing settings.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Set `isNeovim: false` in your LSP client's configuration for the server, or modify your VimScript to remove/handle Neovim-incompatible commands.","cause":"The `isNeovim` option is set to `true` in `initializationOptions`, but your VimScript contains commands not recognized by Neovim.","error":"Error: \"command like `fixdel` in vimrc which neovim does not support will report error.\""},{"fix":"Increase `initializationOptions.indexes.count` (e.g., to 5 or more) and decrease `initializationOptions.indexes.gap` (e.g., to 50 or less) to speed up file indexing.","cause":"The default indexing configuration (`initializationOptions.indexes`) is not optimized for your project size or system resources.","error":"LSP features (completion, diagnostics) are slow or unresponsive."}],"ecosystem":"npm"}