nvim: bootstrap minimal nix-first config
This commit is contained in:
parent
8a2e735875
commit
d90c74150f
14 changed files with 557 additions and 12 deletions
36
.config/nvim/lua/plugins/format.lua
Normal file
36
.config/nvim/lua/plugins/format.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>cf",
|
||||
function()
|
||||
require("conform").format({ async = true, lsp_fallback = true })
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Format buffer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
format_on_save = function()
|
||||
return {
|
||||
timeout_ms = 1000,
|
||||
lsp_fallback = true,
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
nix = { "alejandra", "nixfmt" },
|
||||
sh = { "shfmt" },
|
||||
bash = { "shfmt" },
|
||||
zsh = { "shfmt" },
|
||||
json = { "prettierd", "prettier" },
|
||||
yaml = { "prettierd", "prettier" },
|
||||
markdown = { "prettierd", "prettier" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue