From 7ce6a4cf2681180f8e4c3efd6e6a22f5c1eb32a7 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Sat, 4 Nov 2023 16:48:10 +0900 Subject: [PATCH] update: nvim: display LSP status in status bar --- dotfiles/neovim/lua/lualine_setup.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dotfiles/neovim/lua/lualine_setup.lua b/dotfiles/neovim/lua/lualine_setup.lua index 6d5017a..7f412d4 100644 --- a/dotfiles/neovim/lua/lualine_setup.lua +++ b/dotfiles/neovim/lua/lualine_setup.lua @@ -1,3 +1,12 @@ +-- https://qiita.com/uhooi/items/99aeff822d4870a8e269 +local lsp_names = function () + local clients = {} + for _, client in ipairs(vim.lsp.get_active_clients({ bufnr = 0})) do + table.insert(clients, client.name) + end + return ' ' .. table.concat(clients, ', ') +end + require('lualine').setup { options = { icons_enabled = true, @@ -21,7 +30,7 @@ require('lualine').setup { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_c = {'filename'}, - lualine_x = {'filetype'}, + lualine_x = {lsp_names, 'filetype'}, lualine_y = {'progress'}, lualine_z = {'location'} },