| 12345678910111213141516171819202122232425262728293031 |
- local status_ok, conform = pcall(require, "conform")
- if not status_ok then
- return
- end
- conform.setup({
- formatters_by_ft = {
- javascript = { "prettier" },
- javascriptreact = { "prettier" },
- json = { "prettier" },
- jsonc = { "prettier" },
- markdown = { "prettier" },
- scss = { "prettier" },
- css = { "prettier" },
- typescript = { "prettier" },
- typescriptreact = { "prettier" },
- yaml = { "prettier" },
- },
- formatters = {
- prettier = {
- command = "/Users/leon/node_modules/.bin/prettier",
- },
- },
- })
- vim.api.nvim_create_user_command("Format", function()
- conform.format({
- async = true,
- lsp_fallback = true,
- })
- end, {})
|