mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 05:18:12 +09:00
nixvim: show active formatter in lualine, prefer biome when available
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
@@ -3,11 +3,11 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
javascript.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
javascript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
|
||||||
javascriptreact.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
javascriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
|
||||||
typescript.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
typescript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
|
||||||
typescriptreact.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
typescriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
|
||||||
json.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
json.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }'';
|
||||||
yaml.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
yaml.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
||||||
markdown.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
markdown.__raw = ''{ "prettierd", "prettier", stop_after_first = true }'';
|
||||||
lua = ["stylua"];
|
lua = ["stylua"];
|
||||||
|
|||||||
@@ -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"
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user