Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/WhoIsSethDaniel/toggle-lsp-diagnostics.nvim

Neovim plugin for toggling the LSP diagnostics.
https://github.com/WhoIsSethDaniel/toggle-lsp-diagnostics.nvim

lsp neovim neovim-lsp neovim-plugin nvim nvim-plugin

Last synced: 3 months ago
JSON representation

Neovim plugin for toggling the LSP diagnostics.

Awesome Lists containing this project

README

        

# ARCHIVED

This plugin has been archived. There isn't much reason for this plugin anymore.
Toggling the diagnostics for all buffers is made very simple by the current Lua
API. e.g. what I currently use to toggle all diagnostics on/off is this:

```lua
map(
'n',
'td',
(function()
local diag_status = 1 -- 1 is show; 0 is hide
return function()
if diag_status == 1 then
diag_status = 0
vim.diagnostic.hide()
else
diag_status = 1
vim.diagnostic.show()
end
end
end)()
)
```

# Description

A Neovim plugin for toggling the LSP diagnostics. Turn all diagnostics on/off or turn on/off
individual features of diagnostics (virtual text, underline, signs, etc...).

## Compatibility

Neovim >= 0.5.0

## Installation

Install using your favorite plugin manager.

If you use vim-plug:

```vim
Plug 'WhoIsSethDaniel/toggle-lsp-diagnostics.nvim'
```

Or if you use Vim 8 style packages:

```bash
cd
git clone https://github.com/WhoIsSethDaniel/toggle-lsp-diagnostics.nvim
```

## Configuration

Somwhere in your config you should have this:

```lua
require('toggle_lsp_diagnostics').init()
```

If you are using Vimscript for configuration:

```vim
lua <(toggle-lsp-diag-underline)`
Toggle underlining diagnostic information.

`(toggle-lsp-diag-signs)`
Toggle displaying signs in the sign column.

`(toggle-lsp-diag-vtext)`
Toggle displaying virtual text in your code.

`(toggle-lsp-diag-update_in_insert)`
Toggle updating diagnostic information while in insert mode.

`(toggle-lsp-diag)`
Toggle all diagnostics. Turn them all off / or back to what was passed to init().

`(toggle-lsp-diag-default)`
Set all diagnostics to their default. The default is everything is on, unless other values were
passed to init().

`(toggle-lsp-diag-on)`
Turn all diagnostics on.

`(toggle-lsp-diag-off)`
Turn all diagnostics off.

An example configuration:

```vim
nmap tlu (toggle-lsp-diag-underline)
nmap tls (toggle-lsp-diag-signs)
nmap tlv (toggle-lsp-diag-vtext)
nmap tlp (toggle-lsp-diag-update_in_insert)

nmap tld (toggle-lsp-diag)
nmap tldd (toggle-lsp-diag-default)
nmap tldo (toggle-lsp-diag-off)
nmap tldf (toggle-lsp-diag-on)
```

## Commands

The following commands are available:

`:ToggleDiag`
Toggle ALL diagnostics on/off

`:ToggleDiagDefault`
Toggle ALL diagnostics to their default

`:ToggleDiagOn`
Turn ALL diagnostics on

`:ToggleDiagOff`
Turn ALL diagnostics off