-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Status line #16
Comments
Well, I've been looking at lualine but it seems that the lightline ecosystem is a bit more mature with https://github.com/josa42/nvim-lightline-lsp |
I believe lsp-status.nvim should help you with this. It has like a bunch of helper functions that query the language server. You can make it work even without a statusline plugin. ---
-- LSP
---
local lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.on_attach(function(client, bufnr)
vim.b.lsp_attached = true
end)
lsp.setup()
---
-- Statusline
---
local lsp_status = require('lsp-status')
lsp_status.config({
status_symbol = '',
indicator_errors = '✘',
indicator_warnings = '▲',
indicator_info = '',
indicator_hint = '⚑',
indicator_ok = '',
})
function LspStatus()
if vim.b.lsp_attached then
return lsp_status.status()
end
return ''
end
vim.opt.statusline = '%=%{v:lua.LspStatus()}%r%m %l:%c %p%% %y ' To see notification reports of the server status I use fidget.nvim. This one has good defaults (for the server I have used), so I only add this. require('fidget').setup({}) |
Thank you, @VonHeikemen . I ended up using fidget-nvim only. |
I've looked into what it would take to have lsp related info such as server status and diagnostics in a status line and it seems like a lot of hooking up work. Perhaps another task for lsp-zero?
The text was updated successfully, but these errors were encountered: