1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:10:06 +08:00
SpaceVim/docs/layers/language-server-protocol.md

66 lines
1.6 KiB
Markdown
Raw Normal View History

2017-12-22 20:52:38 +08:00
---
title: "SpaceVim language server protocol layer"
description: "This layers provides language server protocol for vim and neovim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) lsp
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Install](#install)
- [Configuration](#configuration)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layers adds extensive support for [language-server-protocol](https://microsoft.github.io/language-server-protocol/)
## Features
## Install
To use this configuration layer, add `call SpaceVim#layers#load('lsp')` to your custom configuration file.
## Configuration
To enable lsp support for a specified filetype, you may need to load this layer with `filtypes` option, for example:
```vim
call SpaceVim#layers#load('lsp',
\ {
\ 'filetypes' : ['rust',
\ 'typescript',
\ 'javascript',
\ ],
\ }
```
2017-12-22 21:50:03 +08:00
default language server commands:
| language | server command |
| ------------ | --------------------------------- |
| `javascript` | `['javascript-typescript-stdio']` |
2017-12-23 15:03:57 +08:00
| `haskell` | `['hie', '--lsp']` |
2017-12-22 21:50:03 +08:00
To override the server command, you may need to use `override_cmd` option:
```vim
call SpaceVim#layers#load('lsp',
\ {
\ 'override_cmd' : {
\ 'rust' : ['rustup', 'run', 'nightly', 'rls'],
\ }
\ }
```
2017-12-22 20:52:38 +08:00
## Key bindings
2017-12-23 15:10:00 +08:00
| Key Binding | Description |
| --------------- | ------------- |
| `K` / `SPC l d` | show document |
| `SPC l e` | rename symbol |