Skip to content

Commit

Permalink
vim: Switch to conform
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed May 6, 2024
1 parent 26d4682 commit 69f6f5e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 52 deletions.
38 changes: 38 additions & 0 deletions base/nvim/lua/my/plugins/conform.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
local P = {
"stevearc/conform.nvim",
}

function P.config()
local conform = require("conform")

local jsformat = {
{ "prettierd", "prettier" },
"eslint_d",
}

conform.setup({
log_level = vim.log.levels.TRACE,

format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 1000,
async = true,
lsp_fallback = true,
},

formatters_by_ft = {
lua = { "stylua" },
python = { "black", "isort" },
go = { "gofmt" },
sh = { "shfmt" },
rust = { "rustfmt" },
javascript = jsformat,
javascriptreact = jsformat,
typescript = jsformat,
typescriptreact = jsformat,
jsonnet = { "jsonnetfmt" },
},
})
end

return P
52 changes: 0 additions & 52 deletions base/nvim/lua/my/plugins/none-ls.lua

This file was deleted.

0 comments on commit 69f6f5e

Please sign in to comment.