feat(nvim): rustfmt config
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
5443f5f067
commit
56c6370a73
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue