vim-language-server
vim language server
Last updated a month ago by yuuko .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vim-language-server 
SYNC missed versions from official npm registry.

VimScript Language Server

CI Npm Type download

language server for VimScript

Features:

  • auto completion
  • function signature help
  • hover document
  • go to definition
  • go to references
  • document symbols
  • document highlight
  • folding range
  • select range
  • rename
  • snippets
  • diagnostic

autocomplete

Install

For yarn

yarn global add vim-language-server

For npm

npm install -g vim-language-server

For coc.nvim user install coc extension:

:CocInstall coc-vimlsp

Config

for document highlight

let g:markdown_fenced_languages = [
      \ 'vim',
      \ 'help'
      \]

lsp client config example with coc.nvim

  • Using node ipc
"languageserver": {
  "vimls": {
    "module": "/path/to/vim-language-server/bin/index.js",
    "args": ["--node-ipc"],
    "initializationOptions": {
      "iskeyword": "@,48-57,_,192-255,-#", // vim iskeyword option
      "vimruntime": "", // $VIMRUNTIME option
      "runtimepath": "",   // vim runtime path separate by `,`
      "diagnostic": {
        "enable": true
      },
      "indexes": {
        "runtimepath": true,      // if index runtimepath's vim files this will effect the suggest
        "gap": 100,               // index time gap between next file
        "count": 3,               // count of files index at the same time
        "projectRootPatterns" : ["strange-root-pattern", ".git", "autoload", "plugin"] // Names of files used as the mark of project root. If empty, the default value [".git", "autoload", "plugin"] will be used
      },
      "suggest": {
        "fromVimruntime": true,   // completionItems from vimruntime's vim files
        "fromRuntimepath": false  // completionItems from runtimepath's vim files, if this is true that fromVimruntime is true
      }
    },
    "filetypes": [ "vim" ],
  }
}
  • Using stdio
"languageserver": {
  "vimls": {
    "command": "vim-language-server",
    "args": ["--stdio"],
    "initializationOptions": {
      "iskeyword": "@,48-57,_,192-255,-#", // vim iskeyword option
      "vimruntime": "",                    // $VIMRUNTIME option
      "runtimepath": "",                   // vim runtime path separate by `,`
      "diagnostic": {
        "enable": true
      },
      "indexes": {
        "runtimepath": true,      // if index runtimepath's vim files this will effect the suggest
        "gap": 100,               // index time gap between next file
        "count": 3,               // count of files index at the same time
        "projectRootPatterns" : ["strange-root-pattern", ".git", "autoload", "plugin"] // Names of files used as the mark of project root. If empty, the default value [".git", "autoload", "plugin"] will be used
      },
      "suggest": {
        "fromVimruntime": true,   // completionItems from vimruntime's vim files
        "fromRuntimepath": false  // completionItems from runtimepath's vim files, if this is true that fromVimruntime is true
      }
    },
    "filetypes": [ "vim" ]
  }
}

Note:

  • if you want to speed up index, change gap to smaller and count to greater, this will cause high CPU usage for some time
  • if you don't want to index vim's runtimepath files, set runtimepath to false and you will not get any suggest from those files.
  • while fromRuntimepath is true, if you have install too many plugins it will slow down the complete

Usage

The screen record is using coc.nvim as LSP client.

Auto complete and function signature help:

autocomplete

Hover document:

hover

Go to definition and references:

goto

Document symbols:

symbols

Document highlight:

highlight

Folding range and selection range:

fold

Rename:

rename

Snippets and diagnostic:

dia

References

Buy Me A Coffee ☕️

btc

image

Current Tags

  • 1.9.0                                ...           latest (a month ago)

55 Versions

  • 1.9.0                                ...           a month ago
  • 1.8.0                                ...           a month ago
  • 1.7.0                                ...           a month ago
  • 1.6.0                                ...           a month ago
  • 1.5.7                                ...           a month ago
  • 1.5.6                                ...           a month ago
  • 1.5.5                                ...           2 months ago
  • 1.5.4                                ...           2 months ago
  • 1.5.3                                ...           2 months ago
  • 1.5.2                                ...           2 months ago
  • 1.5.1                                ...           2 months ago
  • 1.5.0                                ...           2 months ago
  • 1.4.2                                ...           4 months ago
  • 1.4.1                                ...           5 months ago
  • 1.4.0                                ...           7 months ago
  • 1.3.1                                ...           7 months ago
  • 1.3.0                                ...           7 months ago
  • 1.2.14                                ...           7 months ago
  • 1.2.13                                ...           7 months ago
  • 1.2.12                                ...           7 months ago
  • 1.2.11                                ...           7 months ago
  • 1.2.10                                ...           7 months ago
  • 1.2.9                                ...           9 months ago
  • 1.2.8                                ...           9 months ago
  • 1.2.7                                ...           10 months ago
  • 1.2.6                                ...           10 months ago
  • 1.2.5                                ...           10 months ago
  • 1.2.4                                ...           10 months ago
  • 1.2.3                                ...           10 months ago
  • 1.2.2                                ...           10 months ago
  • 1.2.1                                ...           10 months ago
  • 1.2.0                                ...           10 months ago
  • 1.1.0                                ...           a year ago
  • 1.0.19                                ...           a year ago
  • 1.0.18                                ...           a year ago
  • 1.0.17                                ...           a year ago
  • 1.0.16                                ...           a year ago
  • 1.0.15                                ...           a year ago
  • 1.0.14                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 3
Last Day 1
Last Week 2
Last Month 127
Dependencies (0)
None
Dev Dependencies (19)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |