bye nixvim
This commit is contained in:
41
home/modules/devtools/neovim/plugins/conform-nvim.nix
Normal file
41
home/modules/devtools/neovim/plugins/conform-nvim.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = conform-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
bash = { "shfmt" },
|
||||
css = { "prettierd" },
|
||||
html = { "prettierd" },
|
||||
javascript = { "prettierd" },
|
||||
json = { "fixjson" },
|
||||
lua = { "stylua" },
|
||||
nix = { "alejandra" },
|
||||
php = { "php_cs_fixer" },
|
||||
python = { "black" },
|
||||
rust = { "rustfmt" },
|
||||
sh = { "shfmt" },
|
||||
typescript = { "prettierd" },
|
||||
query = { "sql_formatter" },
|
||||
yaml = { "prettierd" },
|
||||
["*"] = { "injected" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Optionally, set up a command or auto-command to format on save
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
require("conform").format({ bufnr = args.buf })
|
||||
end,
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user