nixvim: show active formatter in lualine, prefer biome when available

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-03-11 19:54:09 +09:00
co-authored by Claude Sonnet 4.6
parent 137a561907
commit 63cc96656f
2 changed files with 28 additions and 6 deletions
@@ -3,11 +3,11 @@
enable = true;
settings = {
formatters_by_ft = {
javascript.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
javascriptreact.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
typescript.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
typescriptreact.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
json.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
javascript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
javascriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
typescript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
typescriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
json.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
yaml.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
markdown.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
lua = ["stylua"];
+23 -1
View File
@@ -1,3 +1,25 @@
{...}: {
programs.nixvim.plugins.lualine.enable = true;
programs.nixvim.plugins.lualine = {
enable = true;
settings.sections.lualine_x = [
{
__raw = ''
function()
local ok, conform = pcall(require, "conform")
if not ok then return "" end
local formatters = conform.list_formatters(0)
for _, f in ipairs(formatters) do
if f.available then
return "󰛖 " .. f.name
end
end
return ""
end
'';
}
"encoding"
"fileformat"
"filetype"
];
};
}