Registry / observability / vim-language-server

vim-language-server

JSON →
library2.3.1jsnpmunverified

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.

npm install vim-language-server
INSTALL
IMPORT
SIG · VIM-LANGUAGE-SERVE
V
vim-language-server
observabilityjavascriptv2.3.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

vim-language-server (CLI)
npm install -g vim-language-server vim-language-server --stdio
import { startServer } from 'vim-language-server'
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.
module path for LSP clients
"module": "/path/to/vim-language-server/bin/index.js"
require('/path/to/vim-language-server/bin/index.js')
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.
command for LSP clients
"command": "vim-language-server"
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.

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.

{ // First, install the language server globally: // npm install -g vim-language-server // To use with coc.nvim, add the following to your coc-settings.json: // This configuration tells coc.nvim how to launch and interact with the server. "languageserver": { "vimls": { // Option 1: Using Node.js IPC (Inter-Process Communication) for potentially faster communication. // Ensure the path to index.js is correct for your installation. // You can find it by running `npm root -g` and then looking inside `vim-language-server/bin/index.js`. "module": "/usr/local/lib/node_modules/vim-language-server/bin/index.js", // Example path, adjust as needed "args": ["--node-ipc"], // Option 2 (alternative to "module"): Using standard I/O for communication. // This assumes `vim-language-server` is in your system's PATH. // "command": "vim-language-server", // "args": ["--stdio"], "initializationOptions": { "isNeovim": true, // Set to true if you are using Neovim, false for Vim8+ "iskeyword": "@,48-57,_,192-255,-#", // Customize Vim's `iskeyword` option "vimruntime": "$VIMRUNTIME", // Path to your $VIMRUNTIME directory "runtimepath": "~/.config/nvim,~/.vim", // Comma-separated list of runtime paths "diagnostic": { "enable": true }, // Enable diagnostics "indexes": { "runtimepath": true, // Index vim files from runtimepath for suggestions "gap": 50, // Indexing time gap in ms "count": 5 // Number of files to index concurrently }, "suggest": { "fromVimruntime": true, "fromRuntimepath": true } }, "filetypes": [ "vim" ] // Specify file types this server should handle } } }
vim-language-server --version
Debug
Known issues
breakingMajor 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.
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.
affects: >=2.0.0
gotchaSetting `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`).
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.
affects: >=1.0.0
gotchaPerformance issues such as slow completion or diagnostics can occur, especially in large projects, due to default indexing settings.
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.
affects: >=1.0.0
Errors
Common errors & fixes
Error: "command like `fixdel` in vimrc which neovim does not support will report error."
The `isNeovim` option is set to `true` in `initializationOptions`, but your VimScript contains commands not recognized by Neovim.
fix
Set `isNeovim: false` in your LSP client's configuration for the server, or modify your VimScript to remove/handle Neovim-incompatible commands.
LSP features (completion, diagnostics) are slow or unresponsive.
The default indexing configuration (`initializationOptions.indexes`) is not optimized for your project size or system resources.
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.
Upgrade
Version history
2.3.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
43 hits · last 30 days
node
38
OpenAI (training)
1
Resources
vim-language-server — npm install vim-language-server · libregistry