A plugin to toggle LSP clients. It has a persistent cache so settings are saved!
lsp-toggle.mp4
Requires nvim v0.11 or higher.
return {
'NeoSahadeo/lsp-toggle.nvim',
opts = {
--- If less than `1`, this will revert back to `20`
max_height = 20,
--- If less than `1`, this will revert back to `30`
max_width = 30,
--- A list of LSP server names to exclude,
--- e.g. `{ 'lua_ls', 'clangd' }` and so on...
---@type string[]
exclude_lsp = {},
---@type string[]|'double'|'none'|'rounded'|'shadow'|'single'|'solid'
border = { '╔', '-', '╗', '║', '╝', '═', '╚', '║' },
-- Enable/Disable caching
---@type boolean
cache = true,
-- File type caching or file name caching
-- Uses the file type instead of file name with caches.
-- e.g.
-- all typescript files (File type)
-- specific files (File name)
---@type string|"file_type"|"file_name"
cache_type = 'file_type',
--- Load LSPs by default regardless of cache
--- if enabled, no LSPs will be loaded by default
---@type boolean
exclusive_mode = false,
},
}
require('pckr').add({
'NeoSahadeo/lsp-toggle.nvim',
config = function()
require('lsp-toggle').setup({
--- If less than `1`, this will revert back to `20`
max_height = 20,
--- If less than `1`, this will revert back to `30`
max_width = 30,
--- A list of LSP server names to exclude,
--- e.g. `{ 'lua_ls', 'clangd' }` and so on...
---@type string[]
exclude_lsp = {},
---@type string[]|'double'|'none'|'rounded'|'shadow'|'single'|'solid'
border = { '╔', '-', '╗', '║', '╝', '═', '╚', '║' },
-- Enable/Disable caching
---@type boolean
cache = true,
-- File type caching or file name caching
-- Uses the file type instead of file name with caches.
-- e.g.
-- all typescript files (File type)
-- specific files (File name)
---@type string|"file_type"|"file_name"
cache_type = 'file_type',
--- Load LSPs by default regardless of cache
--- if enabled, no LSPs will be loaded by default
---@type boolean
exclusive_mode = false,
})
end,
})
To toggle the menu, run the following in the cmdline:
:ToggleLSP
To clear the cache, run the following in the cmdline:
:ToggleLSPClearCache
- @DrKJeff16 Contributor
- @NeoSahadeo Maintainer (Current owner)