Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/WhoIsSethDaniel/toggle-lsp-diagnostics.nvim
- Owner: WhoIsSethDaniel
- License: mit
- Archived: true
- Created: 2021-06-10T21:47:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-20T20:42:07.000Z (4 months ago)
- Last Synced: 2024-07-20T22:12:50.877Z (4 months ago)
- Topics: lsp, neovim, neovim-lsp, neovim-plugin, nvim, nvim-plugin
- Language: Lua
- Homepage:
- Size: 27.3 KB
- Stars: 96
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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