Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/halkn/lightline-lsp

Vim plugin for lightline.vim and vim-lsp
https://github.com/halkn/lightline-lsp

lightline vim vim-lsp vim-plugin

Last synced: 3 months ago
JSON representation

Vim plugin for lightline.vim and vim-lsp

Awesome Lists containing this project

README

        

# lightline-lsp

This plugin is a very simple plugin that integrates [lightline.vim](1) and [vim-lsp](2).
Display the diagnostic result of vim-lsp in the statusline of lightline.vim.

## Install

Install with your favorite plugin manager.
Of course lightline.vim and vim-lsp are required.

## Usage

For example, set `g:lightline` in vimrc.
Just set `component_expand` to this plugin's autoload function and specify its type.
See lightline.vim documentation for more infomation.

```vim
let g:lightline = {
\ 'active': {
\ 'right': [ [ 'lsp_errors', 'lsp_warnings', 'lsp_ok', 'lineinfo' ],
\ [ 'percent' ],
\ [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_expand': {
\ 'lsp_warnings': 'lightline_lsp#warnings',
\ 'lsp_errors': 'lightline_lsp#errors',
\ 'lsp_ok': 'lightline_lsp#ok',
\ },
\ 'component_type': {
\ 'lsp_warnings': 'warning',
\ 'lsp_errors': 'error',
\ 'lsp_ok': 'middle',
\ },
\ }
```

## Configuration

The warning and error signs depend on the vim-lsp settings.
See vim-lsp documentation for more infomation.
The sign when vim-lsp diagnostic result does not exist is set with `g:lightline_lsp_signs_ok`.
The default value if this global variable does not exist is `OK`.

[1]: https://github.com/itchyny/lightline.vim "lightline.vim"
[2]: https://github.com/prabirshrestha/vim-lsp "vim-lsp"