add nvim-qt config and lsp config
This commit is contained in:
@ -1,3 +1,20 @@
|
||||
-- 显示lsp_name
|
||||
local function lsp_name()
|
||||
local msg = "No Active Lsp"
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) == nil then
|
||||
return msg
|
||||
end
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return client.name
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
@ -20,7 +37,7 @@ require("lualine").setup({
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "require'lsp-status'.status()" },
|
||||
lualine_c = { { lsp_name, icon = " LSP:", color = { fg = "#9933ff", gui = "bold" } } },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
|
Reference in New Issue
Block a user