Neovim provides a convenient pretty-printer:
:lua vim.print(vim.lsp.get_active_clients())
However, the active lsp clients output is massive so I'd want to see it in a buffer.
With vim-scriptease, I can use :Verbose
to capture that output into a buffer:
:Verbose lua vim.print(vim.lsp.get_active_clients())
That pretty prints the table, captures the output, and creates a buffer with that output. Great to use /
to navigate around the output.
But it seems that capturing lua should be easier in nvim since it's a core config language.
I figured out a command, but it seems verbose:
:lua vim.api.nvim_put(vim.split(vim.inspect(vim.lsp.get_active_clients()), "\n"), "", true, false)
I expected to find something like vim.api.nvim_as_buffer(vim.lsp.get_active_clients())
, but maybe I'm just having trouble finding it in lua.txt?