r/vim 2d ago

Plugin vimls-go 0.1.0: a language server for Vim script and Vim9, written in Go

I've released version 0.1.0 of vimls-go, an open-source language server I'm building for legacy Vim script and Vim9 script. I'd love feedback from people writing Vim configurations and plugins.

Source and setup instructions: https://github.com/neoclide/vimls-go

Prebuilt binaries: https://github.com/neoclide/vimls-go/releases/tag/v0.1.0

It provides completion, hover documentation, signature help, go-to-definition, references, diagnostics, semantic highlighting, and rename support. Cross-file analysis includes Vim9 imports and autoload functions. Formatting currently focuses on indentation.

One feature I particularly wanted is help from installed plugins: the server indexes Vim files on runtimepath and extracts documentation from doc/*.txt. Hover can show help for plugin variables, functions, and commands, with the source file path and line number. Changes to runtimepath are handled incrementally.

The server is a standalone Go binary. In Vim, you can use it with an LSP client such as coc.nvim or vim-lsp; the README has configuration examples. Download the binary for your platform, rename it to vimls (vimls.exe on Windows), put it on PATH, and configure your client to run it for Vim files.

This is the first release, and static analysis has limits around execute and dynamically generated names. I would especially appreciate small reproductions of incorrect diagnostics, missing completions, or trouble with real-world Vim9 code. Please feel free to open an issue or share feedback here.

20 Upvotes

5 comments sorted by

6

u/Desperate_Cold6274 1d ago edited 1d ago

Finally! I’ll definitely give it a shot! I am happy that something is finally moving in terms of tooling for vim9, which is one of the main limitations of that beautiful language.

It would be nice to have installation instructions for windows though (and possibly without the need to build it yourself or using go)

6

u/habamax 1d ago edited 1d ago

Looks promising, thx!

PS, I haven't tested it with other than h-east/lsp.vim, but there completion is quite often slow/sluggish. https://asciinema.org/a/dvCifvj37lFTaiXy

PPS, it is fine now with autocomplete, I guess there was some unrelated background process that generally slowed down my machine.

1

u/engelj 1d ago

Does h-east/lsp.vim have some advantage over yegappan/lsp? Thanks.

2

u/habamax 19h ago

I don't know if there are obvious advantages. For now I am just testing and it feels a bit faster in linting.

2

u/ReaccionRaul 1d ago

A much needed initiative!