nixos-configuration/users/jrpotter/neovim/config/utils/statusline.lua

36 lines
760 B
Lua
Raw Normal View History

local M = {}
function M.get_active_lsp()
2024-03-05 03:10:57 +00:00
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return ""
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return string.format(" %s", client.name)
end
end
return ""
end
function M.get_dap_status()
local status = require('dap').status()
if string.len(status) > 0 then
return string.format("🪳 %s", status)
else
return ""
end
end
function M.get_autoexpand_status()
if require('luasnip').expand_auto_on then
return "🟢 auto"
else
return "🔴 auto"
end
end
return M