add nvim-qt config and lsp config

This commit is contained in:
gameloader
2022-10-31 11:44:48 +08:00
parent a1d61a1144
commit f1ad37b19c
4 changed files with 50 additions and 5 deletions

View File

@ -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" },