feat(nvim): rustfmt config
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Rob Watson 2023-11-06 07:36:32 +01:00
parent 5443f5f067
commit 56c6370a73
1 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,14 @@ local goimports = function()
}
end
local rustfmt = function()
return {
exe = "rustfmt",
args = { "--edition", "2021" },
stdin = true,
}
end
require("formatter").setup({
log_level = vim.log.levels.INFO,
filetype = {
@ -29,6 +37,7 @@ require("formatter").setup({
typescript = { prettier },
typescriptreact = { prettier },
go = { goimports },
rust = { rustfmt },
-- https://github.com/JohnnyMorganz/StyLua
-- cargo install stylua --features lua54
@ -43,7 +52,7 @@ vim.api.nvim_exec2(
[[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost *.js,*.ts,*.tsx,*.go,*.lua silent FormatWrite
autocmd BufWritePost *.js,*.ts,*.tsx,*.go,*.lua,*.rs silent FormatWrite
augroup END
]],
{ output = true }