comments(nvim): add tsserver variable annotation

This commit is contained in:
sankalp committed 2024-02-25 21:01:25 +05:45
1 parent 3f062011c5
commit 3be72c24bc
7 files changed
+134 -78

No files matched your search

+30
View File
@@ -1,3 +1,30 @@
local lsp = function()
local buf_clients = vim.lsp.get_clients({ bufnr = 0 })
if #buf_clients == 0 then
return ""
else
return ""
end
end
local formatter = function()
local formatters = require("conform").list_formatters(0)
if #formatters == 0 then
return ""
else
return "󰛖 "
end
end
local linter = function()
local linters = require("lint").linters_by_ft[vim.bo.filetype]
if #linters == 0 then
return ""
else
return "󱉶 "
end
end
return {
"nvim-lualine/lualine.nvim",
opts = function(_, opts)
@@ -5,6 +32,9 @@ return {
opts.options.section_separators = { left = "", right = "" }
table.remove(opts.sections.lualine_x, 1)
table.insert(opts.sections.lualine_x, 2, lsp)
table.insert(opts.sections.lualine_x, 2, formatter)
table.insert(opts.sections.lualine_x, 2, linter)
opts.sections.lualine_a = { { "mode", icon = "" } }
opts.sections.lualine_y = { { "progress", icon = "", separator = " ", padding = { left = 1, right = 1 } } }
opts.sections.lualine_z = { { "location", icon = "", padding = { left = 1, right = 1 } } }