A Neovim plugin that provides a dynamic telescope picker for viewing and managing LSP (Language Server Protocol) client information in real-time.
- π Dynamic Telescope Picker: View all running LSP clients with detailed information
- π Real-time Updates: See LSP client status changes dynamically in the previewer
- π― Buffer Information: View attached buffers with diagnostic counts for each LSP client
- β‘ LSP Actions: Restart, stop, and start LSP servers directly from the picker
- π¨ Beautiful UI: Clean, organized display with syntax highlighting
- π§ Configurable: Customize telescope theme and update intervals
- Neovim 0.8.0+
- telescope.nvim
- plenary.nvim
{
'msc5/lspinfo.nvim',
dependencies = {
'nvim-telescope/telescope.nvim',
'nvim-lua/plenary.nvim',
},
config = function()
require('lspinfo').setup({
-- Configuration options (see Configuration section)
})
end,
}use({
'msc5/lspinfo.nvim',
requires = {
'nvim-telescope/telescope.nvim',
'nvim-lua/plenary.nvim',
},
config = function()
require('lspinfo').setup()
end,
})Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'msc5/lspinfo.nvim'Then in your init.lua:
require('lspinfo').setup():LSPInfo- Open the LSP client information picker
You can also bind the command to a keymap:
-- In your init.lua or keymaps file
vim.keymap.set('n', '<leader>li', '<cmd>LSPInfo<cr>', { desc = 'Show LSP Info' })-- Show LSP info picker
require('lspinfo').show()
-- Or call the clients module directly
require('lspinfo.clients')()The plugin can be configured by passing options to the setup() function:
require('lspinfo').setup({
-- Telescope theme configuration
telescope_theme = {
layout_strategy = 'vertical',
layout_config = {
preview_height = 35,
width = 0.5,
height = 0.9,
},
results_title = 'Configured LSP Clients',
sorting_strategy = 'ascending',
},
-- Command name for the LSPInfo command
command_name = 'LSPInfo',
-- Whether to enable dynamic updates in the previewer
enable_dynamic_updates = true,
-- Update interval for dynamic updates (in milliseconds)
update_interval = 1000,
-- Keymaps for the picker
keymaps = {
restart = 'r', -- Restart LSP server
stop = 's', -- Stop LSP server
start = 't', -- Start LSP server
capabilities = 'c', -- Show capabilities
close = '<Esc>', -- Close picker
},
})| Option | Type | Default | Description |
|---|---|---|---|
telescope_theme |
table | See above | Telescope picker theme configuration |
command_name |
string | 'LSPInfo' |
Name of the user command |
enable_dynamic_updates |
boolean | true |
Enable real-time updates in previewer |
update_interval |
number | 1000 |
Update interval in milliseconds |
keymaps.restart |
string | 'r' |
Key to restart LSP server |
keymaps.stop |
string | 's' |
Key to stop LSP server |
keymaps.start |
string | 't' |
Key to start LSP server |
keymaps.capabilities |
string | 'c' |
Key to show capabilities |
keymaps.close |
string | '<Esc>' |
Key to close picker |
The previewer shows detailed information about each LSP client:
- Client Name: The name of the LSP server
- ID: Unique identifier for the client
- Root Directory: The workspace root directory
- Current Buffer: Whether the client is attached to the current buffer
- Status: Running or stopped status
- Initialized: Whether the client has completed initialization
- Attached Buffers: List of all buffers with diagnostic counts
The previewer updates automatically when:
- LSP clients start or stop
- Buffers are attached or detached
- Diagnostic counts change
- Client status changes
When you select an LSP client entry, you can perform actions:
- Restart Server: Stop and restart the LSP server
- Stop Server: Stop the LSP server
- Start Server: Start the LSP server (if stopped)
- Capabilities: View detailed server capabilities
- LSP Commands: Execute custom LSP commands
Make sure you have LSP servers configured and running. You can check with:
vim.lsp.get_clients()Ensure you have telescope.nvim installed and configured:
-- In your init.lua
require('telescope').setup()Check that enable_dynamic_updates is set to true in your configuration. You can also adjust the update_interval if updates are too frequent or slow.
If you get an error like module 'lspinfo' not found, make sure:
- The plugin is properly installed in your Neovim configuration
- You're using the correct plugin manager configuration
- The plugin directory structure is correct (should be
lua/lspinfo/)
You can test if the plugin loads correctly by running:
:lua print(require('lspinfo') ~= nil and "Plugin loaded!" or "Plugin not found")You can run a simple test to verify the plugin works:
-- In Neovim, run this command:
:lua dofile('test_plugin.lua')Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with telescope.nvim
- Inspired by the need for better LSP client management in Neovim