• Stars
    star
    1,110
  • Rank 41,818 (Top 0.9 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Auto configurations for Language Server for vim-lsp

vim-lsp-settings

Actions Status Actions Status

Auto configurations for Language Servers for vim-lsp.

Introduction

Language Servers are not easy to install. Visual Studio Code provides easy ways to install and update Language Servers and Language Server Client. This plugin provides the same feature for Vim.

Installation

Using the vim-plug plugin manager:

Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'

You need to install both vim-lsp and vim-lsp-settings.

Usage

While editing a file with a supported filetype:

:LspInstallServer

To uninstall server:

:LspUninstallServer server-name

Because there is no way to update a server, please run :LspInstallServer again, the newer version will be installed.

Auto-complete

If you want to use auto-completion, you can use one of the following.

asyncomplete.vim

Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'

ddc.vim

Plug 'Shougo/ddc.vim'
Plug 'shun/ddc-vim-lsp'

LSP server download directory

This is where LSP servers are placed on your system after you download them with :LspInstallServer

Windows

%LOCALAPPDATA%\vim-lsp-settings\servers

MacOS/Linux

$HOME/.local/share/vim-lsp-settings/servers

If you define $XDG_DATA_HOME:

$XDG_DATA_HOME/vim-lsp-settings/servers

You can change the directory to install servers by set g:lsp_settings_servers_dir option in full path.

Supported Languages

Language Language Server Installer Local Install
Apex/VisualForce apex-jorje-lsp Yes Yes
Astro astro-ls Yes Yes
Bash bash-language-server Yes Yes
C# omnisharp Yes Yes
C/C++ clangd Yes Yes
COBOL cobol-language-support Yes Yes
CSS css-languageserver Yes Yes
CSS tailwindcss-intellisense Yes Yes
Clojure clojure-lsp Yes Yes
Clojure clj-kondo-lsp Yes Yes
Cmake cmake-language-server Yes Yes
D dls Yes No
D serve-d Yes No
Dart analysis-server-dart-snapshot Yes Yes
Dockerfile dockerfile-language-server-nodejs Yes Yes
Dot dot-language-server Yes Yes
Elixir elixir-ls Yes Yes
Elm elm-language-server Yes Yes
Erlang erlang-ls Yes Yes
F# fsautocomplete Yes Yes
F# fsharp-language-server Yes Yes
Fortran fortls Yes Yes
Go gopls Yes Yes
Go golangci-lint-langserver Yes Yes
GraphQL graphql-language-service-cli Yes Yes
GraphQL gql-language-server Yes Yes
Groovy groovy-language-server Yes Yes
Haskell haskell-ide-engine No No
Haskell haskell-language-server No No
HTML html-languageserver Yes Yes
HTML angular-language-server Yes Yes
HTML tailwindcss-intellisense Yes Yes
JSON json-languageserver Yes Yes
JSON rome Yes Yes
Jsonnet jsonnet-language-server Yes Yes
Java eclipse-jdt-ls Yes Yes
Java java-language-server No Yes
JavaScript typescript-language-server Yes Yes
JavaScript javascript-typescript-stdio Yes Yes
JavaScript rome Yes Yes
JavaScript flow Yes Yes
JavaScript eslint-language-server Yes Yes
Julia LanguageServer.jl Yes No
Kotlin kotlin-language-server Yes Yes
Lisp cl-lsp Yes No
Lua emmylua-ls Yes Yes
Lua sumneko-lua-language-server Yes Yes
Markdown (remark) remark-language-server Yes Yes
Markdown Marksman Yes Yes
Nim nimls No No
Nix nixd Yes Yes
Nix rnix-lsp Yes Yes
PHP intelephense Yes Yes
PHP psalm-language-server Yes Yes
OCaml ocaml-lsp UNIX Only Yes
Protobuf bufls Yes Yes
Puppet puppet-languageserver Yes Yes
PureScript purescript-language-server Yes Yes
Python pyls-all (pyls with dependencies) Yes Yes
Python pyls (pyls without dependencies) Yes Yes
Python pyls-ms (Microsoft Version) Yes Yes
Python jedi-language-server Yes Yes
Python pyright-langserver Yes Yes
Python pylsp-all (pylsp with dependencies) Yes Yes
Python pylsp (pylsp without dependencies) Yes Yes
Python ruff-lsp Yes Yes
Prisma prisma-language-server Yes Yes
R languageserver Yes No
Racket racket-lsp Yes No
Reason reason-language-server Yes Yes
Ruby ruby-lsp UNIX Only Yes
Ruby solargraph Yes Yes
Ruby steep Yes Yes
Ruby typeprof Yes Yes
Rust rls Yes No
Rust rust-analyzer Yes Yes
Sphinx esbonio Yes Yes
SQL sql-language-server Yes Yes
SQL sqls Yes Yes
SQL plpgsql-server UNIX Only Yes
Scala Metals Yes Yes
Svelte svelte-language-server Yes Yes
Swift sourcekit-lsp Yes No
SystemVerilog svls Yes Yes
TeX texlab Yes Yes
TeX digestif Yes No
Terraform terraform-lsp Yes Yes
Terraform terraform-ls Yes Yes
TOML taplo-lsp No Yes
TTCN-3 ntt Yes Yes
TypeScript typescript-language-server Yes Yes
TypeScript deno Yes Yes
TypeScript rome Yes Yes
TypeScript eslint-language-server Yes Yes
Vim vim-language-server Yes Yes
Vala vala-language-server No No
Veryl veryl-ls Yes Yes
Vue volar-server Yes Yes
Vue vls Yes Yes
V vlang-vls Yes Yes
XML lemminx Yes Yes
YAML yaml-language-server Yes Yes
ZIG zls Yes Yes
* efm-langserver Yes Yes

Notes

clangd (C/C++)

There is a Linux OS/version that does not run the locally installed clangd due to zlib version mismatch. If you want to use clangd, please install clangd on your system.

rls (Rust)

If you installed rls already, you can use rls without configurations. But if you have not installed rls yet, you can install it by following these instructions.

deno (TypeScript)

To use deno, deno.json(c) should located on the project directory or traversing the filesystem upwards.

If deno.json does not located, node_modules should not located on the project directory or traversing the filesystem upwards.

When editing Node projects, the following warning message is shown.

server "deno" is disabled since "node_modules" is found

If you want to disable warning message, you may put .vim-lsp-settings/settings.json in your project root directory.

{
  "deno": {
    "disabled": true
  }
}

To use importMap, default file name is import_map.json.

If you don't want to use import_map.json, you may put .vim-lsp-settings/settings.json in your project root directory and set importMap whatever you want.

{
  "deno": {
    "initialization_options": {
      "enable": true,
      "lint": true,
      "unstable": true,
      "importMap": "your_own_import_map.json"
    }
  }
}

Recommend to add let g:markdown_fenced_languages = ['ts=typescript'] to your vimrc for hover(preview) Deno's library.

Note that deno language server is specified.

let g:lsp_settings_filetype_typescript = ['typescript-language-server', 'eslint-language-server', 'deno']

flow (JavaScript)

To use flow, the .flowconfig has to be located on the top of project directory.

graphql-language-service-cli(GraphQL)

To use graphql-language-service-cli, the GraphQL Config has to be located on the top of project directory. The schema must be pointed to the schema file correctly.

{
  "schema": "./schema.graphql"
}

gql-language-server (GraphQL)

To use gql-language-server, the .gqlconfig has to be located on the top of project directory. The schema must be pointed to the schema file correctly.

{
  schema: {
    files: 'path/to/schema.graphql'
  }
}

Finally, you have to install @playlyfe/gql into your project.

$ npm install @playlyfe/gql --save-dev

dart analysis server (Dart)

If you have a separate existing installation of the dart analysis server and want it to be used, it must either exist in your path, or you must specify its location. See 'Configurations' below.

haskell ide engine (Haskell)

If you installed hie with stack, you can use hie without configurations. But if you have not installed hie yet, you can install it by following these steps.

golangci-lint-langserver (Go)

To use older version golangci-lint, please run :LspSettingsGlobalEdit and put bellow configuration.

"golangci-lint-langserver": {
    "initialization_options": {
        "command": [
            "golangci-lint", "run", "--enable-all", "--disable", "lll", "--out-format", "json"
        ]
    }
}

Extra Configurations

Most of the configurations are not required.

If you installed clangd already, you can use clangd for C/C++ without any configuration. But if you installed clang with the name clangd-6.0, you can replace executable with the following config:

let g:lsp_settings = {
\  'clangd': {'cmd': ['clangd-6.0']},
\  'efm-langserver': {'disabled': v:false}
\}

Or put .vim-lsp-settings/settings.json in your project root directory.

{
  "clangd": {
    "cmd": ["clangd-6.0"]
  },
  "efm-langserver": {
    "disabled": false
  }
}

If you already have the dart analysis server installed but it is not in your path, you can still configure the settings to use it. Use the vimscript below to change the command to start the server. Note the command has two parts: the path to your 'dart' executable, and a subcommand 'language-server.

let g:lsp_settings = {
    \ 'analysis-server-dart-snapshot': {
    \     'cmd': [
    \         '/path/to/your/dart-sdk/bin/dart',
    \         'language-server'
    \     ],
    \ },
\ }

To edit the project local settings.json, do :LspSettingsLocalEdit.

Overridable keys are:

  • cmd (List ex: ['clangd-6.0', '-enable-snippets'])
  • initialization_options (Dictionary)
  • allowlist (List)
  • blocklist (List)
  • config (Dictionary)
  • workspace_config (Dictionary)
  • disabled (Boolean)
  • root_uri (String)
  • root_uri_patterns (List)
  • semantic_highlight (Dictionary)

If you have some Language Servers and want to use specified the server:

let g:lsp_settings_filetype_perl = 'slp'
let g:lsp_settings_filetype_html = ['html-languageserver', 'angular-language-server']
let g:lsp_settings_filetype_typescript = ['typescript-language-server', 'eslint-language-server']

When the servers are specified in a list, these will all be started.

If you want to configure Language Server to use flake8 rather than pycodestyle, the following can be added to your ~/.vimrc file. Note that pylsp-all was the automatically registered server name. Check with :LspStatus.

let g:lsp_settings = {
\   'pylsp-all': {
\     'workspace_config': {
\       'pylsp': {
\         'configurationSources': ['flake8']
\       }
\     }
\   },
\}

If you want to disable a Language Server:

let g:lsp_settings = {
\  'perl-languageserver': {
\    'disabled': 1,
\   }
\}

When resolving the root directory for a language server, this plugin will look for directories containing special root markers defined in g:lsp_settings_root_markers.

By default, this is set to:

let g:lsp_settings_root_markers = [
\   '.git',
\   '.git/',
\   '.svn',
\   '.hg',
\   '.bzr'
\ ]

If you need to specify alternative root markers:

let g:lsp_settings_root_markers = ['.projections.json', '.git', '.git/']

This would look for a custom .projections.json, a git submodule .git or a git root .git/ starting from the current directory upwards.

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

More Repositories

1

go-sqlite3

sqlite3 driver for go using database/sql
C
7,722
star
2

emmet-vim

emmet for vim: http://emmet.io/
Vim Script
6,288
star
3

goreman

foreman clone written in go language
Go
2,330
star
4

go-gtk

Go binding for GTK
Go
2,108
star
5

vim-gist

Vim plugin for Gist
Vim Script
1,688
star
6

gom

Go Manager - bundle for go
Go
1,389
star
7

anko

Scriptable interpreter written in golang
Go
1,364
star
8

go-generics-example

Example code for Go generics
Go
1,324
star
9

memo

πŸ““ Memo Life For You
Go
924
star
10

efm-langserver

General purpose Language Server
Go
880
star
11

goveralls

Go
789
star
12

go-isatty

Go
739
star
13

sudo

sudo for windows
Go
732
star
14

go-colorable

Go
713
star
15

webapi-vim

vim interface to Web API
Vim Script
680
star
16

longcat

Looooooooooooooooooooooooooooooooooooooooooooooong cat
Go
645
star
17

go-oci8

Oracle driver for Go using database/sql
Go
618
star
18

docx2md

Convert Microsoft Word Document to Markdown
Go
575
star
19

awesome-twitter-communities

Awesome Twitter Communities for Engineers
561
star
20

go-mastodon

mastodon client for golang
Go
553
star
21

go-runewidth

wcwidth for golang
Go
544
star
22

go-shellwords

Parse line as shell words
Go
491
star
23

vim-sonictemplate

Easy and high speed coding method
Vim Script
329
star
24

go-webkit

webkit widget for go-gtk
Go
291
star
25

twty

command-line twitter client written in golang
Go
280
star
26

gopher

Windows Desktop Mascot Applicaiton "Gopher"
Go
279
star
27

go-tflite

Go binding for TensorFlow Lite
Jupyter Notebook
270
star
28

go-v8

Go binding for v8
Go
264
star
29

calendar-vim

calendar vimscript
Vim Script
253
star
30

flappyvird-vim

Vim Script
235
star
31

growl-for-linux

Growl Implementation For Linux #growl4linux
C
207
star
32

go-zglob

Go
195
star
33

go-redmine

Go
186
star
34

ft

File Transferer
Go
185
star
35

go-tty

Go
184
star
36

goemon

五右葛門
Go
179
star
37

gof

Go
177
star
38

qq

Go
166
star
39

vim-maketable

Vim Script
150
star
40

vim-goimports

Vim plugin for Minimalist Gopher
Vim Script
149
star
41

go-pipeline

Go
147
star
42

etcdenv

Go
142
star
43

jvgrep

grep for japanese vimmer
Go
140
star
44

go-sixel

DRCS/Sixel Encoder/Decoder
Go
137
star
45

go-vue-example

Example App using Go, Vue.js, Element, Axios
Go
135
star
46

tailscale-systray

Linux port of tailscale system tray menu.
Go
134
star
47

go-adodb

Microsoft ActiveX Object DataBase driver for go that using exp/sql
Go
133
star
48

vim-particle

This plugin works on Windows
C
129
star
49

todo

A simple command-line todo list written in Go.
Go
129
star
50

jedie

Static site generator written in golang
Go
128
star
51

clask

Web micro-framework like flask in C++.
C++
124
star
52

golisp

Lisp Interpreter
Go
123
star
53

go-pointer

Go
118
star
54

godown

Convert HTML into Markdown
Go
113
star
55

go-gimei

Go
113
star
56

golang-wasm-example

Example app using Go's wasm support.
JavaScript
111
star
57

vim-trex

Running T-Rex with Vim
JavaScript
111
star
58

livestyle-vim

Emmet LiveStyle for Vim
Vim Script
110
star
59

go-pubsub

Go
107
star
60

go-scan

Go
103
star
61

go-slim

Slim Template Engine for golang
Go
103
star
62

vim-notification

Message notification system for Vim8
Vim Script
103
star
63

gowasmer

WebAssembly runtime for wasmer-go
Go
102
star
64

bsky

A cli application for bluesky social
Go
101
star
65

dotfiles

100
star
66

vim-starwars

Playing StarWars on Vim
Vim Script
97
star
67

vim-brain

Neural Networks written in Vim script
Vim Script
96
star
68

go-nulltype

Null friendly types
Go
96
star
69

go-jsonpointer

Go
95
star
70

files

Fast file find
Go
92
star
71

mkup

Portable Markdown Previewer
JavaScript
92
star
72

go-uv

Go binding for libuv
Go
92
star
73

dboxpaper

client for Dropbox Paper
Go
92
star
74

mruby-uv

interface to libuv for mruby(experimental)
C
91
star
75

davfs

Go
90
star
76

tinytinyhttpd

tiny tiny httpd
C++
88
star
77

echo-scaffold

Echo scaffold is CLI to generate scaffolds for the echo framework.
Go
87
star
78

vim-chatgpt

Vim Script
85
star
79

streeem

ごめんγͺさいごめんγͺさい
Go
85
star
80

go-mruby

go-mruby make interface to embed mruby into go.
Go
83
star
81

algia

A cli application for nostr
Go
80
star
82

http-server

C
76
star
83

go-ieproxy

Go
76
star
84

cho

Go
76
star
85

vim-sqlfmt

Vim Script
74
star
86

vim-molder

Vim Script
71
star
87

vim-treesitter

Go
70
star
88

vimtweak

VimTweak : The tweaking dll for GVim.exe.
C
69
star
89

gomate

Go
68
star
90

awesome-sonomasakada

68
star
91

ansicolor-w32.c

C
67
star
92

gh-ost

gh extension to meet ghost.
Shell
66
star
93

http-gonsole

Speak HTTP like a local. (the simple, intuitive HTTP console, golang version)
Go
65
star
94

vim-fz

Ultra Fast Fuzzy Finder for Vim8
Vim Script
65
star
95

vdbi-vim

Database client for Vim
Vim Script
64
star
96

chatgpt

Go
63
star
97

xgopher

Linux port of https://github.com/mattn/gopher
C
61
star
98

gntp-send

command line program that send to growl using GNTP protocol.
C
57
star
99

vim-usa_president_2016

Vim Script
55
star
100

go-uwsgi

uwsgi implement for go
Go
54
star